map = new HashMap<>();
+ // 最大转换20W以内的数值
+ if (number >= 100000000 || number <= 0 ){
+ return null;
+ }
+ long ret = (long) (number*100);
+ boolean flag = false;
+ boolean clear = false;
+
+ for (String s : str) {
+ switch (s) {
+ case "fen":
+ map.put(s + level, String.valueOf(ret%10));
+ if (ret < 10) {
+ flag = true;
+ }
+ break;
+ case "jiao":
+ if (flag){
+ if (clear) {
+ map.put(s + level, " ");
+ } else {
+ map.put(s + level, "¥");
+ clear = true;
+ }
+ } else {
+ if (ret < 100) {
+ flag = true;
+ }
+ map.put(s + level, String.valueOf((ret / 10) % 10));
+ }
+ break;
+ case "yuan":
+ if (flag){
+ if (clear) {
+ map.put(s + level, " ");
+ } else {
+ map.put(s + level, "¥");
+ clear = true;
+ }
+ } else {
+ if (ret < 1000) {
+ flag = true;
+ }
+ map.put(s + level, String.valueOf((ret / 100) % 10));
+ }
+ break;
+ case "shi":
+ if (flag){
+ if (clear) {
+ map.put(s + level, " ");
+ } else {
+ map.put(s + level, "¥");
+ clear = true;
+ }
+ } else {
+ if (ret < 10000) {
+ flag = true;
+ }
+ map.put(s + level, String.valueOf((ret / 1000) % 10));
+ }
+ break;
+ case "bai":
+ if (flag){
+ if (clear) {
+ map.put(s + level, " ");
+ } else {
+ map.put(s + level, "¥");
+ clear = true;
+ }
+ } else {
+ if (ret < 100000) {
+ flag = true;
+ }
+ map.put(s + level, String.valueOf((ret / 10000) % 10));
+ }
+ break;
+ case "qian":
+ if (flag){
+ if (clear) {
+ map.put(s + level, " ");
+ } else {
+ map.put(s + level, "¥");
+ clear = true;
+ }
+ } else {
+ if (ret < 1000000) {
+ flag = true;
+ }
+ map.put(s + level, String.valueOf((ret / 100000) % 10));
+ }
+ break;
+ case "wan":
+ if (flag){
+ if (clear) {
+ map.put(s + level, " ");
+ } else {
+ map.put(s + level, "¥");
+ clear = true;
+ }
+ } else {
+ if (ret < 10000000) {
+ flag = true;
+ }
+ map.put(s + level, String.valueOf((ret / 1000000) % 10));
+ }
+ break;
+ case "shiwan":
+ if (flag){
+ if (clear) {
+ map.put(s + level, " ");
+ } else {
+ map.put(s + level, "¥");
+ clear = true;
+ }
+ } else {
+ if (ret < 100000000) {
+ flag = true;
+ }
+ map.put(s + level, String.valueOf((ret / 10000000) % 10));
+ }
+ break;
+ case "baiwan":
+ if (flag){
+ if (clear) {
+ map.put(s + level, " ");
+ } else {
+ map.put(s + level, "¥");
+ clear = true;
+ }
+ } else {
+ if (ret < 1000000000) {
+ flag = true;
+ }
+ map.put(s + level, String.valueOf((ret / 100000000) % 10));
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ return map;
+ }
+
+ public static String convertToHan(float number) {
+ String[] hanNumber = { "零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖" };
+ String[] han = { "佰", "拾", "万", "仟", "佰", "拾", "元", "角", "分"};
+
+ StringBuilder builder = new StringBuilder();
+ String[] str = String.valueOf((long) (number * 100)).split("");
+ int i = han.length - 1;
+ for (int j = str.length - 1; j >= 0 ; j--) {
+ builder
+ .append(han[i])
+ .append(hanNumber[Integer.parseInt(str[j])])
+ .append(" ");
+ i--;
+ }
+ return builder.reverse().toString();
+
+ }
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/ClientController.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/ClientController.java
new file mode 100644
index 0000000000000000000000000000000000000000..5e8958e3afdcc546d8e0f95eac0c76127a28b91a
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/ClientController.java
@@ -0,0 +1,663 @@
+package com.ruoyi.system.fantang.controller;
+
+import cn.hutool.core.codec.Base64;
+import cn.hutool.core.date.DateTime;
+import cn.hutool.core.date.DateUtil;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.system.fantang.common.DinnerTypeUtils;
+import com.ruoyi.system.fantang.domain.*;
+import com.ruoyi.system.fantang.service.*;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
+
+import java.math.BigDecimal;
+import java.util.Arrays;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+
+@Slf4j
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
+@RestController
+@RequestMapping("/client_api/staff")
+public class ClientController extends BaseController {
+
+ @Autowired
+ private IFtConfigDaoService iFtConfigDaoService;
+
+ @Autowired
+ private IFtStaffInfoDaoService staffInfoDaoService;
+
+ @Autowired
+ private IFtStaffDemandDaoService staffDemandDaoService;
+
+ @Autowired
+ private IFtOrderDaoService orderDaoService;
+
+ @Autowired
+ private IFtWeekMenuDaoService weekMenuDaoService;
+
+ @Autowired
+ private IFtFaceinfoDaoService faceinfoDaoService;
+
+ @Autowired
+ private IFtStaffSubsidyDaoService staffSubsidyDaoService;
+
+ @Autowired
+ private IFtFoodDaoService foodDaoService;
+
+ @Autowired
+ private IFtOrderDaoService iFtOrderDaoService;
+
+ @Autowired
+ private IFtFoodDefaultDaoService foodDefaultDaoService;
+
+ @Autowired
+ private IFtStaffStopMealsDaoService staffStopMealsDaoService;
+
+ /**
+ * 获取用餐时间信息
+ * 日期:2020年12月11日
+ * 作者:陈智兴
+ * type:订餐类型
+ *
+ * @return
+ */
+ @GetMapping("/getDinnerTimeSetting")
+ public AjaxResult getDinnerTimeSetting() {
+ return AjaxResult.success(iFtConfigDaoService.getDinnerTimeSetting());
+ }
+
+ /**
+ * 获取员工当天订单信息
+ * 日期:2020年12月11日
+ * 作者:陈智兴
+ *
+ * @return AjaxResult
+ */
+ @GetMapping("/getOrderOfToday/{staffId}")
+ public AjaxResult getOrderOfToday(@PathVariable("staffId") Long staffId) {
+ return AjaxResult.success(orderDaoService.getOrderOfToday(staffId));
+ }
+
+ /**
+ * 获取员工某一天的订单信息
+ * 日期:2020年12月11日
+ * 作者:陈智兴
+ *
+ * return
+ */
+ @GetMapping("/getOrderOfDay")
+ public AjaxResult getOrderOfDate(@RequestParam("staffId") Long staffId, @RequestParam("orderDate") Date orderDate) {
+ return AjaxResult.success(orderDaoService.getOrderOfDay(staffId, orderDate));
+ }
+
+
+ @GetMapping("/getWeekMenu")
+ public AjaxResult getWeekMenu() {
+ return AjaxResult.success("调用每周菜谱成功");
+ }
+
+ @GetMapping("/getAvailableOrder/{staffId}")
+ public AjaxResult getAvailableOrder(@PathVariable("staffId") Integer staffId) {
+ return AjaxResult.success(orderDaoService.getAvailableOrder(staffId));
+ }
+
+
+ /**
+ * 获取员工停餐信息
+ * 日期:2020年12月21日
+ * 作者:陈智兴
+ *
+ * param JSONObject staffId: 员工id
+ * return
+ */
+ @PostMapping("/getAvailableStopOrder")
+ public AjaxResult getAvailableStopOrder(@RequestBody JSONObject params) {
+ return AjaxResult.success(orderDaoService.getAvailableStopOrder(params.getLong("staffId")));
+ }
+
+
+ /**
+ * 推送订单信息
+ * 日期:2020年12月11日
+ * 作者:陈智兴
+ *
+ * param JSONObject staffId: 员工id
+ * orderType:订餐类型
+ * demandDate: 订餐用餐日期
+ * return
+ */
+ @PostMapping("/PostOrder")
+ public AjaxResult postOrder(@RequestBody JSONObject params) {
+ return AjaxResult.success(orderDaoService.insertOrder(params.getLong("staffId"), params.getInteger("orderType"), params.getDate("demandDate")));
+ }
+
+ /**
+ * 推送停餐信息
+ * 日期:2020年12月21日
+ * 作者:陈智兴
+ *
+ * param staffId: 员工id
+ * type:订餐类型
+ * demandDate: 订餐用餐日期
+ * return -1: 已报停餐信息, 1: 停餐成功
+ */
+ @PostMapping("/postStopOrder")
+ public AjaxResult postStopOrder(@RequestBody JSONObject params) {
+ return AjaxResult.success(orderDaoService.stopOrder(params.getLong("staffId"), params.getInteger("orderType"), params.getDate("demandDate")));
+ }
+
+ /**
+ * 员工取消订餐信息
+ * 日期:2020年12月21日
+ * 作者:陈智兴
+ *
+ * param staffId: 员工id
+ * type:订餐类型
+ * demandDate: 订餐用餐日期
+ * return -1: 已报停餐信息, 1: 停餐成功
+ */
+ @PostMapping("/postCancelOrder")
+ public AjaxResult postCancelOrder(@RequestBody JSONObject params) {
+ return orderDaoService.cancelOrder(params.getLong("orderId"));
+ }
+
+ /**
+ * 推送取消停餐信息
+ * 日期:2020年12月21日
+ * 作者:陈智兴
+ *
+ * param staffId: 员工id
+ * type:订餐类型
+ * demandDate: 订餐用餐日期
+ * return -1: 已报停餐信息, 1: 停餐成功
+ */
+ @PostMapping("/postCancelStopOrder")
+ public AjaxResult postCancelStopOrder(@RequestBody JSONObject params) {
+ return AjaxResult.success(orderDaoService.cancelStopOrder(params.getLong("orderId")));
+ }
+
+ // 获取配置信息
+ @GetMapping("/getConfiguration/{staffId}")
+ public AjaxResult getConfiguration(@PathVariable("staffId") Long staffId) {
+ return AjaxResult.success(staffDemandDaoService.getConfiguration(staffId));
+ }
+
+ /**
+ * 员工登录
+ * 日期:2020年12月10日
+ * 作者: 陈智兴
+ * 修改:首次创建
+ *
+ * param { tel: 手机号码;
+ * password: 密码
+ * }
+ * return 返回员工信息
+ */
+ @GetMapping("/login")
+ public AjaxResult login(String tel, String password) {
+ return staffInfoDaoService.login(tel, password);
+ }
+
+ @PostMapping("/logout")
+ public AjaxResult logout(@RequestBody JSONObject params) {
+ return AjaxResult.success(staffInfoDaoService.logout(params.getLong("staffId")));
+ }
+
+ @GetMapping("/getWorkday")
+ public AjaxResult getWorkday() {
+ return null;
+ }
+
+ @GetMapping("/getProduct")
+ public AjaxResult getProduct() {
+ return null;
+ }
+
+ @GetMapping("/getOtherProduct")
+ public AjaxResult getOtherProduct() {
+ return null;
+ }
+
+ @PostMapping("/postProductOrder")
+ public AjaxResult postProductOrder() {
+ return null;
+ }
+
+ @PostMapping("/postCurrentOrder")
+ public AjaxResult postCurrentOrder() {
+ return null;
+ }
+
+ @PostMapping("/postRestoreOrder")
+ public AjaxResult postRestoreOrder() {
+ return null;
+ }
+
+ /**
+ * 初始化员工订餐配置文件,并返回初始化后的记录给前端
+ * params: staffId
+ * return
+ */
+ @PostMapping("/initDemandMode")
+ public AjaxResult initDemandMode(@RequestBody JSONObject params) {
+ return staffDemandDaoService.initDemandMode(params.getLong("staffId"));
+ }
+
+ /**
+ * 设置订餐模式
+ * 日期:2020年12月11日
+ * 作者: 陈智兴
+ * 修改:首次创建
+ *
+ * @param { config_id: id;
+ * demandMode: true:自动模式;false:手动模式
+ * }
+ * @return
+ */
+ @PostMapping("/setDemandMode")
+ public AjaxResult setDemandMode(@RequestBody JSONObject params) {
+ Long id = params.getLong("id");
+ Integer type = params.getInteger("type");
+ Boolean demandMode = params.getBoolean("demandModeFlag");
+ return staffDemandDaoService.setDemandMode(id, type, demandMode);
+ }
+
+ /**
+ * 返回某天的菜单
+ * param today
+ * return
+ */
+ @PostMapping("/getMenuOfDay")
+ public AjaxResult getMenuOfDay(@RequestBody JSONObject params) {
+ String[] weekDays = {"周日", "周一", "周二", "周三", "周四", "周五", "周六"};
+ Calendar cal = Calendar.getInstance();
+ cal.setTime(params.getDate("date"));
+ int w = cal.get(Calendar.DAY_OF_WEEK) - 1;
+ if (w < 0) {
+ w = 0;
+ }
+ return weekMenuDaoService.getMenuOfDay(weekDays[w]);
+ }
+
+ @GetMapping("/StatisGetOrderOfDate")
+ public AjaxResult statisGetOrderOfDate(@RequestParam Date date) {
+ return AjaxResult.success(orderDaoService.statisGetOrderOfDate(date,1 ,50));
+ }
+
+ /**
+ * 获取指定日期的订单明细
+ * 类型,日期
+ * 类型 = 0 ,所有
+ * type = 1,2,3:早,午,晚
+ */
+ @PostMapping("/getOrderDetailedByDate")
+ public AjaxResult getOrderDetailedByDate(@RequestBody JSONObject params) {
+
+ String createAt = params.getString("createAt");
+ Integer orderType = params.getInteger("orderType");
+ String start = createAt + " 00:00:00";
+ String end = createAt + " 23:59:59";
+
+// QueryWrapper wrapper = new QueryWrapper<>();
+// if (orderType != 0) {
+// wrapper.eq("order_type", orderType);
+// }
+// wrapper.between("create_at", start, end);
+// orderDaoService.list(wrapper);
+
+ List orderList;
+
+ if (orderType != 0) {
+ orderList = orderDaoService.listDetailedByDate(orderType, start, end);
+ } else {
+ orderList = orderDaoService.listAllDetailedByDate(start, end);
+ }
+
+ return AjaxResult.success(orderList);
+ }
+
+ /**
+ * 查看补贴记录
+ */
+ @GetMapping("/getStaffSubsidy/{staffId}")
+ public AjaxResult getStaffSubsidy(@PathVariable Long staffId) {
+ QueryWrapper wrapper = new QueryWrapper<>();
+ wrapper.eq("staff_id", staffId);
+
+ return AjaxResult.success(staffSubsidyDaoService.list(wrapper));
+ }
+
+ /**
+ * 查看补贴余额
+ */
+ @GetMapping("/getStaffSubsidyBalance/{staffId}")
+ public AjaxResult getStaffSubsidyBalance(@PathVariable Long staffId) {
+ FtStaffInfoDao staffInfoDao = staffInfoDaoService.getById(staffId);
+
+ return AjaxResult.success(staffInfoDao.getBalance());
+ }
+
+ /**
+ * 查看商品清单
+ */
+ @GetMapping("/getGoodsList")
+ public AjaxResult getGoodsList() {
+ QueryWrapper wrapper = new QueryWrapper<>();
+ wrapper.eq("type", 2);
+ List list = foodDaoService.list(wrapper);
+
+ return AjaxResult.success(list);
+ }
+
+ /**
+ * 用餐流水(订单)查看
+ */
+ @GetMapping("/getStaffOrder/{staffId}")
+ public AjaxResult getStaffOrder(@PathVariable Long staffId) {
+ QueryWrapper wrapper = new QueryWrapper<>();
+ wrapper.eq("staff_id", staffId);
+
+ return AjaxResult.success(iFtOrderDaoService.list(wrapper));
+ }
+
+ /**
+ * 获取截止订餐参数
+ */
+ @GetMapping("/getStopDinnerTime")
+ public AjaxResult getStopDinnerTime() {
+ QueryWrapper wrapper = new QueryWrapper<>();
+ wrapper.eq("config_key", "stop_dinner");
+ FtConfigDao ftConfigDao = iFtConfigDaoService.getOne(wrapper);
+
+ return AjaxResult.success(ftConfigDao.getConfigValue());
+ }
+
+ /**
+ * 获取菜品清单
+ */
+ @GetMapping("/getFoodList")
+ public AjaxResult getFoodList() {
+ QueryWrapper wrapper = new QueryWrapper<>();
+ wrapper.eq("type", 1)
+ .or()
+ .eq("type", 4);
+ List list = foodDaoService.list(wrapper);
+
+ return AjaxResult.success(list);
+ }
+
+ /**
+ * 获取各餐品的价格清单
+ *
+ * @param
+ * @author : 陈智兴
+ */
+ @GetMapping("/getDinnerPriceList")
+ public AjaxResult getDinnerPriceList() {
+ List list = foodDefaultDaoService.list(null);
+ return AjaxResult.success(list);
+ }
+
+
+ /**
+ * 获取订餐优惠比例
+ */
+ @GetMapping("/getOrderDiscount/{orderId}")
+ public AjaxResult getOrderDiscount(@PathVariable Long orderId) {
+ FtOrderDao ftOrderDao = orderDaoService.getById(orderId);
+
+ return AjaxResult.success(ftOrderDao.getDiscount());
+ }
+
+ /**
+ * 补贴订单收款
+ */
+ @Transactional
+ @PostMapping("/orderCollection")
+ public AjaxResult orderCollection(@RequestBody JSONObject params) {
+
+ // 员工 id
+ Long staffId = params.getLong("staffId");
+
+ // 订餐类型
+ Integer type = params.getInteger("type");
+
+ // 总价
+ BigDecimal totalPrice = params.getBigDecimal("receipts");
+
+ // 生成新订单
+ FtOrderDao orderDao = new FtOrderDao();
+ orderDao.setOrderType(type);
+ orderDao.setStaffId(staffId);
+ orderDao.setTotalPrice(totalPrice);
+ Date today = new Date();
+ orderDao.setCreateAt(today);
+ orderDao.setOrderSrc("在线订单");
+ // 余额支付
+ orderDao.setPayType(3);
+ // 已支付
+ orderDao.setPayFlag(1);
+ // 未过期
+ orderDao.setExpiredFlag(0);
+ // 未核销
+ orderDao.setWriteOffFlag(0);
+ DateTime tomorrow = DateUtil.offsetDay(today, 1);
+ orderDao.setOrderDate(tomorrow);
+
+ // 当前订单员工信息
+ FtStaffInfoDao staffInfoDao = staffInfoDaoService.getById(orderDao.getStaffId());
+
+ // 员工账户补贴余额
+ BigDecimal balance = staffInfoDao.getBalance();
+
+ // 余额是否大于实收
+ if (balance.compareTo(totalPrice) < 0) {
+
+ return AjaxResult.error("补贴余额不足");
+
+ } else {
+
+ // 更新员工账户补贴余额
+ BigDecimal nowBalance = balance.subtract(totalPrice);
+ staffInfoDao.setBalance(nowBalance);
+ staffInfoDaoService.updateById(staffInfoDao);
+
+ orderDaoService.save(orderDao);
+
+ // 添加补贴流水记录
+ FtStaffSubsidyDao staffSubsidyDao = new FtStaffSubsidyDao();
+ staffSubsidyDao.setStaffId(orderDao.getStaffId());
+ staffSubsidyDao.setSubsidyType("餐费补贴");
+ staffSubsidyDao.setIncomeType(2);
+ staffSubsidyDao.setPrice(totalPrice);
+ staffSubsidyDao.setConsumAt(today);
+ staffSubsidyDao.setOrderId(orderDao.getOrderId());
+ staffSubsidyDaoService.save(staffSubsidyDao);
+
+ }
+
+ return AjaxResult.success(orderDao);
+ }
+
+ /**
+ * 补贴订单退款
+ */
+ @Transactional
+ @PostMapping("/orderRefund")
+ public AjaxResult orderRefund(@RequestBody JSONObject params) {
+
+ // 订单 id
+ Integer orderId = params.getInteger("orderId");
+
+ // 当前订单信息
+ FtOrderDao orderDao = orderDaoService.getById(orderId);
+ if (orderDao == null) {
+ AjaxResult.error("无效订单");
+ }
+ // 更新订单信息
+ orderDao.setPayFlag(2);
+ orderDaoService.save(orderDao);
+
+ // 总价
+ BigDecimal totalPrice = orderDao.getTotalPrice();
+
+ // 当前订单员工信息
+ FtStaffInfoDao staffInfoDao = staffInfoDaoService.getById(orderDao.getStaffId());
+
+ // 员工账户补贴余额
+ BigDecimal balance = staffInfoDao.getBalance();
+
+ // 更新员工账户补贴余额
+ staffInfoDao.setBalance(balance.add(totalPrice));
+ staffInfoDaoService.updateById(staffInfoDao);
+
+ // 添加补贴流水记录
+ FtStaffSubsidyDao staffSubsidyDao = new FtStaffSubsidyDao();
+ staffSubsidyDao.setStaffId(orderDao.getStaffId());
+ // 退款
+ staffSubsidyDao.setIncomeType(4);
+ staffSubsidyDao.setPrice(totalPrice);
+ staffSubsidyDao.setConsumAt(new Date());
+ staffSubsidyDao.setOrderId(orderDao.getOrderId());
+ staffSubsidyDaoService.save(staffSubsidyDao);
+
+ return AjaxResult.success("已退款");
+ }
+
+
+ /**
+ * 今日员工报餐统计
+ */
+ @GetMapping("/getStatisticsOrderOfToday")
+ public AjaxResult getStatisticsOrderOfToday() {
+
+ Date today = new Date();
+
+ return AjaxResult.success(orderDaoService.statisGetOrderOfDate(today, 1, 100));
+ }
+
+ /**
+ * 明日员工报餐统计
+ */
+ @GetMapping("/getStatisticsOrderOfTomorrow")
+ public AjaxResult getStatisticsReportMealsOfTomorrow() {
+ AjaxResult result = new AjaxResult();
+ result.success();
+ result.put("reports", orderDaoService.getStatisticsReportMealsOfTomorrow());
+ result.put("staffs", orderDaoService.getStatisticsStaffOfTomorrow());
+ result.put("stops", orderDaoService.getStopOrderOfTomorrow());
+ result.put("order",orderDaoService.statisGetOrderOfDate(DateUtil.offsetDay(new Date(), 1), 1, 100) );
+
+ return result;
+ }
+
+
+ /**
+ * 人脸识别设备心跳信号
+ *
+ * @param request
+ * @return
+ */
+ @PostMapping("/heartbeat")
+ public String faceDeviceHeartbeatEvent(@RequestBody JSONObject request) {
+ System.out.println("face device heartbeat.....");
+ System.out.println(request);
+ return "ok";
+
+ }
+
+
+ @PostMapping("/verify")
+ public String faceDeviceVerifyEvent(@RequestBody JSONObject request) {
+
+ // 判断是否在用餐时间,否则只写日志,不处理事件
+ DinnerTypeUtils.DinnerType dinnerType = DinnerTypeUtils.getInstance(iFtConfigDaoService).getDinnerType();
+ System.out.println(request);
+ if (dinnerType == DinnerTypeUtils.DinnerType.notMatch) {
+ log.info("未到用餐时间人脸记录 : {} ", request);
+ return request.toJSONString();
+ }
+
+ // 从数据中获取人脸id
+ JSONObject info = request.getJSONObject("info");
+ Integer personId = info.getInteger("PersonID");
+ Long deviceId = info.getLong("DeviceID");
+
+ // 判断该设备是否有效
+ Boolean isEffective = iFtConfigDaoService.isDeviceEffective(deviceId);
+ if (!isEffective) {
+ log.info("设备有效性 : {} ", "该人脸识别设备已失效");
+ return "该人脸识别设备已失效";
+ }
+
+ log.info("用餐时人脸记录 : {} ", info);
+ // 是否有该员工
+ FtStaffInfoDao staffInfoDao = staffInfoDaoService.inStaff(personId);
+
+ if (staffInfoDao != null) {
+
+ // 获取员工 id
+ Long staffId = staffInfoDao.getStaffId();
+
+ String message;
+
+ // 进行核销,如果该员工没有订餐则自动生成一个订餐记录并核销
+ switch (dinnerType) {
+ case breakfast:
+ message = orderDaoService.setWriteOff(staffId, 1, deviceId);
+ break;
+ case lunch:
+ message = orderDaoService.setWriteOff(staffId, 2, deviceId);
+ break;
+ case dinner:
+ message = orderDaoService.setWriteOff(staffId, 3, deviceId);
+ break;
+ default:
+ throw new IllegalStateException("Unexpected value: " + dinnerType);
+ }
+ log.info("人脸核销结果 : {}", message);
+
+ return message;
+
+ } else {
+
+ // 如果该人脸id没有对应的员工,则记录找日志中
+ log.info("员工查询 : {}", "没有找到该员工");
+ return "没有找到该员工";
+ }
+
+ }
+
+ /**
+ * 自动切换手动报餐时清空停餐记录
+ */
+ @DeleteMapping("deleteStopMeals/{staffId}")
+ public AjaxResult deleteStopMeals(@PathVariable Long staffId) {
+
+ QueryWrapper wrapper = new QueryWrapper<>();
+ wrapper.eq("staff_id", staffId);
+ staffStopMealsDaoService.remove(wrapper);
+
+ return AjaxResult.success("已删除");
+ }
+
+ @PostMapping("qrcode")
+ public AjaxResult qrcode(@RequestBody JSONObject params) {
+ String data = params.getString("data");
+ JSONObject jsonData = JSONObject.parseObject(Base64.decodeStr(data));
+ Long staffId = jsonData.getLong("staffId");
+ Long orderId = jsonData.getLong("orderId");
+ String tel = jsonData.getString("tel");
+ log.info("二维码:原始字串-{};员工id:{}; 订单id:{}", jsonData, staffId, orderId);
+ return AjaxResult.success(String.format("二维码:原始字串-%s;员工id:%d; 订单id:%d, 电话:%s", jsonData, staffId, orderId, tel));
+ }
+
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/ClientPatientController.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/ClientPatientController.java
new file mode 100644
index 0000000000000000000000000000000000000000..d81aa798ed9f49c2535d4825752e0e1d4015c61b
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/ClientPatientController.java
@@ -0,0 +1,239 @@
+package com.ruoyi.system.fantang.controller;
+
+import cn.hutool.core.date.DateTime;
+import cn.hutool.core.date.DateUtil;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.system.fantang.domain.*;
+import com.ruoyi.system.fantang.service.*;
+import com.ruoyi.system.fantang.vo.FtPatientVo;
+import com.ruoyi.system.fantang.vo.FtReportMealVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+
+
+@RestController
+@RequestMapping("/client_api/patient")
+public class ClientPatientController extends BaseController {
+
+ @Autowired
+ private IFtPatientDaoService iFtPatientDaoService;
+
+ @Autowired
+ private IFtStaffInfoDaoService iFtStaffInfoDaoService;
+
+ @Autowired
+ private IFtDepartDaoService iFtDepartDaoService;
+
+ @Autowired
+ private IFtReportMealsDaoService reportMealsDaoService;
+
+ @Autowired
+ private IFtFoodDemandDaoService iFtFoodDemandDaoService;
+
+ @Autowired
+ private IFtNutritionFoodDaoService iFftNutritionFoodDaoService;
+
+ @Autowired
+ private IFtFoodDaoService iftFoodDaoService;
+
+ /**
+ * 根据病人获取今日报餐信息
+ */
+ @GetMapping("/getReportMealsToday/{patientId}")
+ public AjaxResult getReportMealsToday(@PathVariable("patientId") Long patientId) {
+
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+ String createAt = sdf.format(new Date());
+
+ return AjaxResult.success(iFtPatientDaoService.getReportMealsToday(createAt, patientId));
+ }
+
+ /**
+ * 根据病人获取次日报餐信息
+ */
+ @GetMapping("/getReportMealsTomorrow/{patientId}")
+ public AjaxResult getReportMealsTomorrow(@PathVariable("patientId") Long patientId) {
+
+ DateTime tomorrow = DateUtil.tomorrow();
+ String formatDate = DateUtil.formatDate(tomorrow);
+
+ return AjaxResult.success(iFtPatientDaoService.getReportMealsToday(formatDate, patientId));
+ }
+
+ /**
+ * 根据科室获取次日报餐信息
+ */
+ @GetMapping("/getReportMealsByDepart/{departId}")
+ public AjaxResult getReportMealsByDepart(@PathVariable("departId") Long departId) {
+
+ DateTime tomorrow = DateUtil.tomorrow();
+ String formatDate = DateUtil.formatDate(tomorrow);
+
+ List patientVos = iFtPatientDaoService.getReportMealsByDepart(departId, formatDate);
+
+ return AjaxResult.success(patientVos);
+ }
+
+ /**
+ * 获取护工默认部门信息
+ */
+ @GetMapping("/getDepartInfo/{staffId}")
+ public AjaxResult getDepartInfo(@PathVariable("staffId") Long staffId) {
+
+ FtStaffInfoDao departInfo = iFtStaffInfoDaoService.getDepartInfo(staffId);
+
+ return AjaxResult.success(departInfo);
+ }
+
+ /**
+ * 获取部门列表
+ */
+ @GetMapping("/getAllDepart")
+ public AjaxResult getAllDepart() {
+
+ return AjaxResult.success(iFtDepartDaoService.list());
+ }
+
+ /**
+ * 更改默认报餐部门
+ */
+ @PutMapping("/updateDepart")
+ public AjaxResult updateDepart(@RequestBody JSONObject params) {
+ Long staffId = params.getLong("staffId");
+ String departId = params.getString("departId");
+
+ UpdateWrapper wrapper = new UpdateWrapper<>();
+ wrapper.eq("staff_id", staffId);
+ FtStaffInfoDao staffInfoDao = new FtStaffInfoDao();
+ staffInfoDao.setDeptList(departId);
+
+ return AjaxResult.success(iFtStaffInfoDaoService.update(staffInfoDao, wrapper));
+ }
+
+ /**
+ * 批量更新报餐记录
+ */
+ @PutMapping("/batchUpdateReportMeals")
+ public AjaxResult batchUpdateReportMeals(@RequestBody List reportMealsDaoList) {
+ return AjaxResult.success(reportMealsDaoService.updateBatchById(reportMealsDaoList));
+ }
+
+ /**
+ * 更新指定病患的报餐记录
+ */
+ @PutMapping("/updateReportMeals")
+ public AjaxResult updateReportMeals(@RequestBody FtReportMealsDao ftReportMealsDao) {
+ return AjaxResult.success(reportMealsDaoService.updateById(ftReportMealsDao));
+ }
+
+ /**
+ * 更新指定病患默认报餐数据
+ */
+ @PutMapping("/updateFoodDemand")
+ public AjaxResult updateFoodDemand(@RequestBody FtFoodDemandDao ftFoodDemandDao) {
+ return AjaxResult.success(iFtFoodDemandDaoService.updateById(ftFoodDemandDao));
+ }
+
+ /**
+ * 获取营养配餐配置信息
+ */
+ @GetMapping("getNutritionFood")
+ public AjaxResult getNutritionFood() {
+ return AjaxResult.success(iFftNutritionFoodDaoService.list());
+ }
+
+ /**
+ * 获取菜品清单
+ */
+ @GetMapping("/getFoodPrice")
+ public AjaxResult getFoodPrice() {
+ QueryWrapper wrapper = new QueryWrapper<>();
+ wrapper.in("type", 1,4)
+ .gt("dinner_type", 0);
+ return AjaxResult.success(iftFoodDaoService.list(wrapper));
+ }
+
+ /**
+ * 病患报餐日统计
+ */
+ @GetMapping("/getStatisticsReportMealsOfDay")
+ public AjaxResult getStatisticsReportMealsOfDay(@RequestParam("date") Date day) {
+
+ List list = iFtFoodDemandDaoService.getStatisticsOfDay(day);
+
+ return AjaxResult.success(list);
+ }
+
+
+ /**
+ * 明日(未报)病患报餐统计
+ */
+ @GetMapping("/getStatisticsReportMealsOfTomorrow")
+ public AjaxResult getStatisticsReportMealsOfTomorrow() {
+
+ List list = iFtFoodDemandDaoService.getStatisticsFoodDemand();
+
+ return AjaxResult.success(list);
+ }
+
+ /**
+ * 病患报餐周统计
+ */
+ @GetMapping("/getStatisticsReportMealsOfWeek")
+ public AjaxResult getStatisticsReportMealsOfWeek(@RequestParam("date") Date day) {
+
+ List list = iFtFoodDemandDaoService.getStatisticsOfWeek(day);
+
+ return AjaxResult.success(list);
+ }
+
+ /**
+ * 病患报餐月统计
+ */
+ @GetMapping("/getStatisticsReportMealsOfMonth")
+ public AjaxResult getStatisticsReportMealsOfMonth(@RequestParam("date") Date day) {
+
+ List list = iFtFoodDemandDaoService.getStatisticsOfMonth(day);
+
+ return AjaxResult.success(list);
+ }
+
+ /**
+ * 按照用餐类型统计指定日期的各菜品数量
+ * @author 陈智兴
+ * @param day:查询日期
+ * @return
+ */
+ @GetMapping("/getStatisticsFoods")
+ public AjaxResult getStatisticsFoods(@RequestParam("departId") Integer departId, @RequestParam("date") Date day) {
+ List list = reportMealsDaoService.getStatisticsFoods(departId, day);
+ return AjaxResult.success(list);
+ }
+
+ /**
+ * 接收病患报餐数据,更新;生成报餐日志表
+ * @param list
+ * @return
+ */
+ @PostMapping("/tomorrowReport")
+ public AjaxResult tomorrowReport(@RequestBody JSONArray list){
+ List objects = list.toJavaList(JSONObject.class);
+ logger.info("送餐员报餐总数:{}", objects.size());
+ for (JSONObject object : objects) {
+ FtReportMealsDao dao = JSONObject.toJavaObject(object, FtReportMealsDao.class);
+ reportMealsDaoService.updateById(dao);
+ }
+
+ AjaxResult result = AjaxResult.success();
+ return result;
+ }
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtCateringDaoController.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtCateringDaoController.java
new file mode 100644
index 0000000000000000000000000000000000000000..b485cb3f3c110031d32a2c351d782627c238bf36
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtCateringDaoController.java
@@ -0,0 +1,203 @@
+package com.ruoyi.system.fantang.controller;
+
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.fantang.domain.FtCateringDao;
+import com.ruoyi.system.fantang.domain.FtFoodDemandDao;
+import com.ruoyi.system.fantang.service.IFtCateringDaoService;
+import com.ruoyi.system.fantang.service.IFtFoodDemandDaoService;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.*;
+
+/**
+ * 配餐功能Controller
+ *
+ * @author ft
+ * @date 2020-12-07
+ */
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
+@RestController
+@RequestMapping("/fantang/catering")
+public class FtCateringDaoController extends BaseController {
+
+ private final IFtCateringDaoService iFtCateringDaoService;
+
+ private final IFtFoodDemandDaoService iFtFoodDemandDaoService;
+
+ /**
+ * 查询配餐功能列表
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:catering:list')")
+ @GetMapping("/list")
+ public TableDataInfo list(FtCateringDao ftCateringDao) {
+ startPage();
+ List list = iFtCateringDaoService.listNewFormatter(ftCateringDao);
+ return getDataTable(list);
+ }
+
+ /**
+ * 导出配餐功能列表
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:catering:export')")
+ @Log(title = "配餐功能", businessType = BusinessType.EXPORT)
+ @GetMapping("/export")
+ public AjaxResult export(FtCateringDao ftCateringDao) {
+ LambdaQueryWrapper lqw = new LambdaQueryWrapper(ftCateringDao);
+ List list = iFtCateringDaoService.list(lqw);
+ ExcelUtil util = new ExcelUtil(FtCateringDao.class);
+ return util.exportExcel(list, "catering");
+ }
+
+ /**
+ * 获取配餐功能详细信息
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:catering:query')")
+ @GetMapping(value = "/{id}")
+ public AjaxResult getInfo(@PathVariable("id") Long id) {
+ FtCateringDao ftCateringDao = iFtCateringDaoService.getByIdNewFormatter(id);
+ return AjaxResult.success(ftCateringDao);
+ }
+
+ /**
+ * 新增配餐功能
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:catering:add')")
+ @Log(title = "配餐功能", businessType = BusinessType.INSERT)
+ @PostMapping
+ @Transactional
+ public AjaxResult add(@RequestBody FtCateringDao ftCateringDao) {
+
+ // 添加一个病人新增 4 条营养配餐记录
+ List ftCateringList = iFtCateringDaoService.addNutritionCatering(ftCateringDao);
+
+ // 更新病人报餐配置表
+ iFtFoodDemandDaoService.updateDayFoodDemand(ftCateringList);
+
+ return AjaxResult.success("新增成功");
+ }
+
+ /**
+ * 修改配餐功能
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:catering:edit')")
+ @Log(title = "配餐功能", businessType = BusinessType.UPDATE)
+ @PutMapping
+ public AjaxResult edit(@RequestBody FtCateringDao ftCateringDao) {
+
+ Long patientId = ftCateringDao.getPatientId();
+ Integer type = ftCateringDao.getType();
+ Long number = ftCateringDao.getNumber();
+ Boolean flag = ftCateringDao.getFlag();
+
+ QueryWrapper wrapper = new QueryWrapper<>();
+ wrapper.eq("patient_id", patientId);
+ wrapper.eq("type", type);
+ FtFoodDemandDao foodDemandDao = iFtFoodDemandDaoService.getOne(wrapper);
+ foodDemandDao.setNutritionFoodId(number);
+ foodDemandDao.setUpdateAt(new Date());
+ foodDemandDao.setNutritionFoodFlag(flag);
+ iFtFoodDemandDaoService.updateById(foodDemandDao);
+
+ return toAjax(iFtCateringDaoService.updateById(ftCateringDao) ? 1 : 0);
+ }
+
+ /**
+ * 删除配餐功能
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:catering:remove')")
+ @Log(title = "配餐功能", businessType = BusinessType.DELETE)
+ @DeleteMapping("/{ids}")
+ public AjaxResult remove(@PathVariable Long[] ids) {
+ return AjaxResult.success(iFtCateringDaoService.deleteByPatientId(ids));
+ }
+
+ /**
+ * 暂停多个病患营养配餐配置,并更新默认报餐配置
+ */
+ @PutMapping("/cancel/{ids}")
+ @Transactional
+ public AjaxResult cancel(@PathVariable Long[] ids) {
+ System.out.println(Arrays.toString(ids));
+
+ // 根据病人 id 修改 营养配餐 启用标志
+ iFtCateringDaoService.cancelByPatientId(ids);
+
+ return AjaxResult.success("已暂停");
+ }
+
+
+ /**
+ * 恢复多个病患营养配餐配置,并更新默认报餐配置
+ */
+ @PutMapping("/restoreCatering/{ids}")
+ @Transactional
+ public AjaxResult restoreCatering(@PathVariable Long[] ids) {
+ System.out.println(Arrays.toString(ids));
+
+ // 根据病人 id 修改营养配餐启用标志
+ iFtCateringDaoService.restoreByPatientId(ids);
+
+ return AjaxResult.success("已恢复");
+ }
+
+ /**
+ * 根据病人 id 查找营养配餐数据
+ */
+ @GetMapping("/getByPatient/{patientId}")
+ public AjaxResult getByPatient(@PathVariable Long patientId) {
+ QueryWrapper wrapper = new QueryWrapper<>();
+ wrapper.eq("patient_id", patientId);
+ wrapper.eq("type", 1);
+ return AjaxResult.success(iFtCateringDaoService.getOne(wrapper));
+ }
+
+ /**
+ * 根据病人 id 查找营养配餐数据
+ */
+ @GetMapping("/getAllByPatient/{patientId}")
+ public AjaxResult getAllByPatient(@PathVariable Long patientId) {
+ QueryWrapper wrapper = new QueryWrapper<>();
+ wrapper.eq("patient_id", patientId);
+ return AjaxResult.success(iFtCateringDaoService.list(wrapper));
+ }
+
+
+ /**
+ * 拷贝并新增
+ */
+ @PostMapping("/copyAndAdd")
+ public AjaxResult copyAndAdd(@RequestBody JSONObject params) {
+ List patientIds = params.getJSONArray("patientIds").toJavaList(Long.class);
+ List data = params.getJSONArray("data").toJavaList(FtCateringDao.class);
+ for (Long patientId : patientIds) {
+ Integer ftCateringDaoList = iFtCateringDaoService.copyAndAdd(patientId, data);
+ }
+ return AjaxResult.success();
+ }
+
+ @PutMapping("/paste")
+ public AjaxResult paste(@RequestBody JSONObject params) {
+
+ List ids = params.getJSONArray("ids").toJavaList(Long.class);
+ List ftCateringDaoList = params.getJSONArray("copyItem").toJavaList(FtCateringDao.class);
+
+ for (Long id : ids) {
+ iFtCateringDaoService.paste(id,ftCateringDaoList);
+ }
+
+ return AjaxResult.success("已修改");
+ }
+
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtConfigDaoController.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtConfigDaoController.java
new file mode 100644
index 0000000000000000000000000000000000000000..379e9396a826e898f1d09f7e4010fc568dfab34c
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtConfigDaoController.java
@@ -0,0 +1,172 @@
+package com.ruoyi.system.fantang.controller;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.fantang.common.DinnerTypeUtils;
+import com.ruoyi.system.fantang.domain.FtConfigDao;
+import com.ruoyi.system.fantang.service.IFtConfigDaoService;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+/**
+ * 饭堂参数Controller
+ *
+ * @author ft
+ * @date 2020-12-07
+ */
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
+@RestController
+@RequestMapping("/fantang/fantangConfig")
+public class FtConfigDaoController extends BaseController {
+
+ private final IFtConfigDaoService iFtConfigDaoService;
+
+ /**
+ * 查询饭堂参数列表
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:fantangConfig:list')")
+ @GetMapping("/list")
+ public TableDataInfo list(FtConfigDao ftConfigDao) {
+ startPage();
+ LambdaQueryWrapper lqw = Wrappers.lambdaQuery(ftConfigDao);
+ if (ftConfigDao.getCorpId() != null) {
+ lqw.eq(FtConfigDao::getCorpId, ftConfigDao.getCorpId());
+ }
+ if (StringUtils.isNotBlank(ftConfigDao.getConfigKey())) {
+ lqw.eq(FtConfigDao::getConfigKey, ftConfigDao.getConfigKey());
+ }
+ if (StringUtils.isNotBlank(ftConfigDao.getConfigValue())) {
+ lqw.eq(FtConfigDao::getConfigValue, ftConfigDao.getConfigValue());
+ }
+ if (ftConfigDao.getFlag() != null) {
+ lqw.eq(FtConfigDao::getFlag, ftConfigDao.getFlag());
+ }
+ List list = iFtConfigDaoService.list(lqw);
+ return getDataTable(list);
+ }
+
+ /**
+ * 导出饭堂参数列表
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:fantangConfig:export')")
+ @Log(title = "饭堂参数", businessType = BusinessType.EXPORT)
+ @GetMapping("/export")
+ public AjaxResult export(FtConfigDao ftConfigDao) {
+ LambdaQueryWrapper lqw = new LambdaQueryWrapper(ftConfigDao);
+ List list = iFtConfigDaoService.list(lqw);
+ ExcelUtil util = new ExcelUtil(FtConfigDao.class);
+ return util.exportExcel(list, "fantangConfig");
+ }
+
+ /**
+ * 获取饭堂参数详细信息
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:fantangConfig:query')")
+ @GetMapping(value = "/{id}")
+ public AjaxResult getInfo(@PathVariable("id") Long id) {
+ return AjaxResult.success(iFtConfigDaoService.getById(id));
+ }
+
+ /**
+ * 新增饭堂参数
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:fantangConfig:add')")
+ @Log(title = "饭堂参数", businessType = BusinessType.INSERT)
+ @PostMapping
+ public AjaxResult add(@RequestBody FtConfigDao ftConfigDao) {
+ return toAjax(iFtConfigDaoService.save(ftConfigDao) ? 1 : 0);
+ }
+
+ /**
+ * 修改饭堂参数
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:fantangConfig:edit')")
+ @Log(title = "饭堂参数", businessType = BusinessType.UPDATE)
+ @PutMapping
+ public AjaxResult edit(@RequestBody FtConfigDao ftConfigDao) {
+ return toAjax(iFtConfigDaoService.updateById(ftConfigDao) ? 1 : 0);
+ }
+
+ /**
+ * 删除饭堂参数
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:fantangConfig:remove')")
+ @Log(title = "饭堂参数", businessType = BusinessType.DELETE)
+ @DeleteMapping("/{ids}")
+ public AjaxResult remove(@PathVariable Long[] ids) {
+ return toAjax(iFtConfigDaoService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
+ }
+
+ @PostMapping("/updateDinnerTime")
+ public AjaxResult updateDinnerTime(@RequestBody JSONObject params) {
+
+ StringBuilder configValue = new StringBuilder();
+
+ SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
+ JSONArray breakfastJson = params.getJSONArray("breakfast");
+ JSONArray lunchJson = params.getJSONArray("lunch");
+ JSONArray dinnerJson = params.getJSONArray("dinner");
+
+ List breakfastTime = breakfastJson.toJavaList(Date.class);
+ for (Date date : breakfastTime) {
+ String time = sdf.format(date);
+ System.out.println(time);
+ configValue.append(time).append(",");
+ }
+
+ List lunchTime = lunchJson.toJavaList(Date.class);
+ for (Date date : lunchTime) {
+ String time = sdf.format(date);
+ System.out.println(time);
+ configValue.append(time).append(",");
+ }
+
+ List dinnerTime = dinnerJson.toJavaList(Date.class);
+
+ for (int i = 0; i < dinnerTime.size(); i++) {
+ String time = sdf.format(dinnerTime.get(i));
+ configValue.append(time);
+ if (i != dinnerTime.size() - 1) {
+ configValue.append(",");
+ }
+ }
+
+ iFtConfigDaoService.updateConfigValue(params.getLong("id"),configValue.toString());
+
+ DinnerTypeUtils.getInstance(iFtConfigDaoService).updateDinnerTypeUtils(configValue.toString());
+
+ return AjaxResult.success("已修改");
+ }
+
+ /**
+ * 修改人脸识别设备信息
+ */
+ @PostMapping("/updateFaceDevice")
+ public AjaxResult updateFaceDevice(@RequestBody JSONObject params) {
+
+ String deviceId = params.getString("deviceId");
+ Long deviceConfigId = params.getLong("deviceConfigId");
+ iFtConfigDaoService.updateConfigValue(deviceConfigId, deviceId);
+
+ String deviceFlag = params.getString("deviceFlag");
+ Long flagConfigId = params.getLong("flagConfigId");
+ iFtConfigDaoService.updateConfigValue(flagConfigId, deviceFlag);
+
+ return AjaxResult.success("已修改");
+ }
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtDepartDaoController.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtDepartDaoController.java
new file mode 100644
index 0000000000000000000000000000000000000000..d5416403322ad87b7976d27b95f141b8ed0a8241
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtDepartDaoController.java
@@ -0,0 +1,113 @@
+package com.ruoyi.system.fantang.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+
+import java.util.List;
+import java.util.Arrays;
+
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.ruoyi.common.utils.StringUtils;
+import lombok.RequiredArgsConstructor;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.system.fantang.domain.FtDepartDao;
+import com.ruoyi.system.fantang.service.IFtDepartDaoService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 科室管理Controller
+ *
+ * @author ft
+ * @date 2020-11-24
+ */
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
+@RestController
+@RequestMapping("/fantang/depart" )
+public class FtDepartDaoController extends BaseController {
+
+ private final IFtDepartDaoService iFtDepartDaoService;
+
+ /**
+ * 查询科室管理列表
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:depart:list')")
+ @GetMapping("/list")
+ public TableDataInfo list(FtDepartDao ftDepartDao)
+ {
+ startPage();
+ LambdaQueryWrapper lqw = Wrappers.lambdaQuery(ftDepartDao);
+ if (StringUtils.isNotBlank(ftDepartDao.getDepartName())){
+ lqw.like(FtDepartDao::getDepartName ,ftDepartDao.getDepartName());
+ }
+ if (StringUtils.isNotBlank(ftDepartDao.getDepartCode())){
+ lqw.eq(FtDepartDao::getDepartCode ,ftDepartDao.getDepartCode());
+ }
+ List list = iFtDepartDaoService.list(lqw);
+ return getDataTable(list);
+ }
+
+ /**
+ * 导出科室管理列表
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:depart:export')" )
+ @Log(title = "科室管理" , businessType = BusinessType.EXPORT)
+ @GetMapping("/export" )
+ public AjaxResult export(FtDepartDao ftDepartDao) {
+ LambdaQueryWrapper lqw = new LambdaQueryWrapper(ftDepartDao);
+ List list = iFtDepartDaoService.list(lqw);
+ ExcelUtil util = new ExcelUtil(FtDepartDao. class);
+ return util.exportExcel(list, "depart" );
+ }
+
+ /**
+ * 获取科室管理详细信息
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:depart:query')" )
+ @GetMapping(value = "/{departId}" )
+ public AjaxResult getInfo(@PathVariable("departId" ) Long departId) {
+ return AjaxResult.success(iFtDepartDaoService.getById(departId));
+ }
+
+ /**
+ * 新增科室管理
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:depart:add')" )
+ @Log(title = "科室管理" , businessType = BusinessType.INSERT)
+ @PostMapping
+ public AjaxResult add(@RequestBody FtDepartDao ftDepartDao) {
+ return toAjax(iFtDepartDaoService.save(ftDepartDao) ? 1 : 0);
+ }
+
+ /**
+ * 修改科室管理
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:depart:edit')" )
+ @Log(title = "科室管理" , businessType = BusinessType.UPDATE)
+ @PutMapping
+ public AjaxResult edit(@RequestBody FtDepartDao ftDepartDao) {
+ return toAjax(iFtDepartDaoService.updateById(ftDepartDao) ? 1 : 0);
+ }
+
+ /**
+ * 删除科室管理
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:depart:remove')" )
+ @Log(title = "科室管理" , businessType = BusinessType.DELETE)
+ @DeleteMapping("/{departIds}" )
+ public AjaxResult remove(@PathVariable Long[] departIds) {
+ return toAjax(iFtDepartDaoService.removeByIds(Arrays.asList(departIds)) ? 1 : 0);
+ }
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtFaceinfoDaoController.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtFaceinfoDaoController.java
new file mode 100644
index 0000000000000000000000000000000000000000..b478a3d92572704b304a8683a99b00c238ae2351
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtFaceinfoDaoController.java
@@ -0,0 +1,100 @@
+package com.ruoyi.system.fantang.controller;
+
+import java.util.List;
+import java.util.Arrays;
+
+import lombok.RequiredArgsConstructor;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.system.fantang.domain.FtFaceinfoDao;
+import com.ruoyi.system.fantang.service.IFtFaceinfoDaoService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 人脸信息Controller
+ *
+ * @author ryo
+ * @date 2021-01-11
+ */
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
+@RestController
+@RequestMapping("/fantang/faceInfo" )
+public class FtFaceinfoDaoController extends BaseController {
+
+ private final IFtFaceinfoDaoService iFtFaceinfoDaoService;
+
+ /**
+ * 查询人脸信息列表
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:faceInfo:list')")
+ @GetMapping("/list")
+ public TableDataInfo list(FtFaceinfoDao ftFaceinfoDao) {
+ startPage();
+ List list = iFtFaceinfoDaoService.queryList(ftFaceinfoDao);
+ return getDataTable(list);
+ }
+
+ /**
+ * 导出人脸信息列表
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:faceInfo:export')" )
+ @Log(title = "人脸信息" , businessType = BusinessType.EXPORT)
+ @GetMapping("/export" )
+ public AjaxResult export(FtFaceinfoDao ftFaceinfoDao) {
+ List list = iFtFaceinfoDaoService.queryList(ftFaceinfoDao);
+ ExcelUtil util = new ExcelUtil(FtFaceinfoDao.class);
+ return util.exportExcel(list, "faceInfo" );
+ }
+
+ /**
+ * 获取人脸信息详细信息
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:faceInfo:query')" )
+ @GetMapping(value = "/{id}" )
+ public AjaxResult getInfo(@PathVariable("id" ) Long id) {
+ return AjaxResult.success(iFtFaceinfoDaoService.getById(id));
+ }
+
+ /**
+ * 新增人脸信息
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:faceInfo:add')" )
+ @Log(title = "人脸信息" , businessType = BusinessType.INSERT)
+ @PostMapping
+ public AjaxResult add(@RequestBody FtFaceinfoDao ftFaceinfoDao) {
+ return toAjax(iFtFaceinfoDaoService.save(ftFaceinfoDao) ? 1 : 0);
+ }
+
+ /**
+ * 修改人脸信息
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:faceInfo:edit')" )
+ @Log(title = "人脸信息" , businessType = BusinessType.UPDATE)
+ @PutMapping
+ public AjaxResult edit(@RequestBody FtFaceinfoDao ftFaceinfoDao) {
+ return toAjax(iFtFaceinfoDaoService.updateById(ftFaceinfoDao) ? 1 : 0);
+ }
+
+ /**
+ * 删除人脸信息
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:faceInfo:remove')" )
+ @Log(title = "人脸信息" , businessType = BusinessType.DELETE)
+ @DeleteMapping("/{ids}" )
+ public AjaxResult remove(@PathVariable Long[] ids) {
+ return toAjax(iFtFaceinfoDaoService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
+ }
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtFoodDaoController.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtFoodDaoController.java
new file mode 100644
index 0000000000000000000000000000000000000000..4a9a2199a780c421768f9086e4ca7ceb6bef6a45
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtFoodDaoController.java
@@ -0,0 +1,107 @@
+package com.ruoyi.system.fantang.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.fantang.domain.FtFoodDao;
+import com.ruoyi.system.fantang.service.IFtFoodDaoService;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 食品管理Controller
+ *
+ * @author ft
+ * @date 2020-11-24
+ */
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
+@RestController
+@RequestMapping("/fantang/food")
+public class FtFoodDaoController extends BaseController {
+
+ private final IFtFoodDaoService iFtFoodDaoService;
+
+ /**
+ * 查询食品管理列表
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:food:list')")
+ @GetMapping("/list")
+ public TableDataInfo list(FtFoodDao ftFoodDao) {
+ startPage();
+ LambdaQueryWrapper lqw = Wrappers.lambdaQuery(ftFoodDao);
+ if (StringUtils.isNotBlank(ftFoodDao.getName())) {
+ lqw.like(FtFoodDao::getName, ftFoodDao.getName());
+ }
+ if (ftFoodDao.getPrice() != null) {
+ lqw.eq(FtFoodDao::getPrice, ftFoodDao.getPrice());
+ }
+ if (ftFoodDao.getType() != null) {
+ lqw.eq(FtFoodDao::getType, ftFoodDao.getType());
+ }
+ List list = iFtFoodDaoService.list(lqw);
+ return getDataTable(list);
+ }
+
+ /**
+ * 导出食品管理列表
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:food:export')")
+ @Log(title = "食品管理", businessType = BusinessType.EXPORT)
+ @GetMapping("/export")
+ public AjaxResult export(FtFoodDao ftFoodDao) {
+ LambdaQueryWrapper lqw = new LambdaQueryWrapper(ftFoodDao);
+ List list = iFtFoodDaoService.list(lqw);
+ ExcelUtil util = new ExcelUtil(FtFoodDao.class);
+ return util.exportExcel(list, "food");
+ }
+
+ /**
+ * 获取食品管理详细信息
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:food:query')")
+ @GetMapping(value = "/{foodId}")
+ public AjaxResult getInfo(@PathVariable("foodId") Long foodId) {
+ return AjaxResult.success(iFtFoodDaoService.getById(foodId));
+ }
+
+ /**
+ * 新增食品管理
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:food:add')")
+ @Log(title = "食品管理", businessType = BusinessType.INSERT)
+ @PostMapping
+ public AjaxResult add(@RequestBody FtFoodDao ftFoodDao) {
+ return toAjax(iFtFoodDaoService.save(ftFoodDao) ? 1 : 0);
+ }
+
+ /**
+ * 修改食品管理
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:food:edit')")
+ @Log(title = "食品管理", businessType = BusinessType.UPDATE)
+ @PutMapping
+ public AjaxResult edit(@RequestBody FtFoodDao ftFoodDao) {
+ return toAjax(iFtFoodDaoService.updateById(ftFoodDao) ? 1 : 0);
+ }
+
+ /**
+ * 删除食品管理
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:food:remove')")
+ @Log(title = "食品管理", businessType = BusinessType.DELETE)
+ @DeleteMapping("/{foodIds}")
+ public AjaxResult remove(@PathVariable Long[] foodIds) {
+ return toAjax(iFtFoodDaoService.removeByIds(Arrays.asList(foodIds)) ? 1 : 0);
+ }
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtFoodDefaultDaoController.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtFoodDefaultDaoController.java
new file mode 100644
index 0000000000000000000000000000000000000000..75d28facc963f4ba33e0d20bea68e326b2764ca6
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtFoodDefaultDaoController.java
@@ -0,0 +1,116 @@
+package com.ruoyi.system.fantang.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.fantang.domain.FtFoodDefaultDao;
+import com.ruoyi.system.fantang.service.IFtFoodDaoService;
+import com.ruoyi.system.fantang.service.IFtFoodDefaultDaoService;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.math.BigDecimal;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 默认报餐管理Controller
+ *
+ * @author ft
+ * @date 2020-11-25
+ */
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
+@RestController
+@RequestMapping("/fantang/foodDefault")
+public class FtFoodDefaultDaoController extends BaseController {
+
+ private final IFtFoodDefaultDaoService iFtFoodDefaultDaoService;
+
+ private final IFtFoodDaoService iFtFoodDaoService;
+
+ /**
+ * 查询默认报餐管理列表
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:foodDefault:list')")
+ @GetMapping("/list")
+ public TableDataInfo list(FtFoodDefaultDao ftFoodDefaultDao) {
+ startPage();
+ LambdaQueryWrapper lqw = Wrappers.lambdaQuery(ftFoodDefaultDao);
+ if (ftFoodDefaultDao.getType() != null) {
+ lqw.eq(FtFoodDefaultDao::getType, ftFoodDefaultDao.getType());
+ }
+ List list = iFtFoodDefaultDaoService.list(lqw);
+ return getDataTable(list);
+ }
+
+ /**
+ * 导出默认报餐管理列表
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:foodDefault:export')")
+ @Log(title = "默认报餐管理", businessType = BusinessType.EXPORT)
+ @GetMapping("/export")
+ public AjaxResult export(FtFoodDefaultDao ftFoodDefaultDao) {
+ LambdaQueryWrapper lqw = new LambdaQueryWrapper(ftFoodDefaultDao);
+ List list = iFtFoodDefaultDaoService.list(lqw);
+ ExcelUtil util = new ExcelUtil(FtFoodDefaultDao.class);
+ return util.exportExcel(list, "foodDefault");
+ }
+
+ /**
+ * 获取默认报餐管理详细信息
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:foodDefault:query')")
+ @GetMapping(value = "/{id}")
+ public AjaxResult getInfo(@PathVariable("id") Long id) {
+ return AjaxResult.success(iFtFoodDefaultDaoService.getById(id));
+ }
+
+ /**
+ * 新增默认报餐管理
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:foodDefault:add')")
+ @Log(title = "默认报餐管理", businessType = BusinessType.INSERT)
+ @PostMapping
+ public AjaxResult add(@RequestBody FtFoodDefaultDao ftFoodDefaultDao) {
+ ftFoodDefaultDao.setCreatedAt(new Date());
+ return toAjax(iFtFoodDefaultDaoService.save(ftFoodDefaultDao) ? 1 : 0);
+ }
+
+ /**
+ * 修改默认报餐管理
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:foodDefault:edit')")
+ @Log(title = "默认报餐管理", businessType = BusinessType.UPDATE)
+ @PutMapping
+ public AjaxResult edit(@RequestBody FtFoodDefaultDao ftFoodDefaultDao) {
+ String foodList = ftFoodDefaultDao.getFoodList();
+ String[] temp = foodList.split(",");
+ BigDecimal totalPrice = new BigDecimal(0);
+ for (String foodId : temp) {
+ BigDecimal price = iFtFoodDaoService.getById(Long.parseLong(foodId)).getPrice();
+ totalPrice = totalPrice.add(price);
+ }
+ ftFoodDefaultDao.setPrice(totalPrice);
+
+ ftFoodDefaultDao.setUpdatedAt(new Date());
+ return toAjax(iFtFoodDefaultDaoService.updateById(ftFoodDefaultDao) ? 1 : 0);
+ }
+
+ /**
+ * 删除默认报餐管理
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:foodDefault:remove')")
+ @Log(title = "默认报餐管理", businessType = BusinessType.DELETE)
+ @DeleteMapping("/{ids}")
+ public AjaxResult remove(@PathVariable Long[] ids) {
+ return toAjax(iFtFoodDefaultDaoService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
+ }
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtFoodDemandDaoController.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtFoodDemandDaoController.java
new file mode 100644
index 0000000000000000000000000000000000000000..c9a69fd11f70299653d154cd8972830b51725641
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtFoodDemandDaoController.java
@@ -0,0 +1,100 @@
+package com.ruoyi.system.fantang.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.fantang.domain.FtFoodDemandDao;
+import com.ruoyi.system.fantang.service.IFtFoodDemandDaoService;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 病人报餐Controller
+ *
+ * @author ft
+ * @date 2020-12-03
+ */
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
+@RestController
+@RequestMapping("/fantang/foodDemand")
+public class FtFoodDemandDaoController extends BaseController {
+
+ private final IFtFoodDemandDaoService iFtFoodDemandDaoService;
+
+ /**
+ * 查询病人报餐列表
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:foodDemand:list')")
+ @GetMapping("/list")
+ public TableDataInfo list(FtFoodDemandDao ftFoodDemandDao) {
+ startPage();
+
+ List list = iFtFoodDemandDaoService.listNewFormatter(ftFoodDemandDao);
+ return getDataTable(list);
+ }
+
+ /**
+ * 导出病人报餐列表
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:foodDemand:export')")
+ @Log(title = "病人报餐", businessType = BusinessType.EXPORT)
+ @GetMapping("/export")
+ public AjaxResult export(FtFoodDemandDao ftFoodDemandDao) {
+ LambdaQueryWrapper lqw = new LambdaQueryWrapper(ftFoodDemandDao);
+ List list = iFtFoodDemandDaoService.list(lqw);
+ ExcelUtil util = new ExcelUtil(FtFoodDemandDao.class);
+ return util.exportExcel(list, "foodDemand");
+ }
+
+ /**
+ * 获取病人报餐详细信息
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:foodDemand:query')")
+ @GetMapping(value = "/{id}")
+ public AjaxResult getInfo(@PathVariable("id") Long id) {
+ FtFoodDemandDao ftFoodDemandDao = iFtFoodDemandDaoService.getByIdNewFormatter(id);
+ return AjaxResult.success(ftFoodDemandDao);
+ }
+
+ /**
+ * 新增病人报餐
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:foodDemand:add')")
+ @Log(title = "病人报餐", businessType = BusinessType.INSERT)
+ @PostMapping
+ public AjaxResult add(@RequestBody FtFoodDemandDao ftFoodDemandDao) {
+ ftFoodDemandDao.setFlag(true);
+ return toAjax(iFtFoodDemandDaoService.save(ftFoodDemandDao) ? 1 : 0);
+ }
+
+ /**
+ * 修改病人报餐
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:foodDemand:edit')")
+ @Log(title = "病人报餐", businessType = BusinessType.UPDATE)
+ @PutMapping
+ public AjaxResult edit(@RequestBody FtFoodDemandDao ftFoodDemandDao) {
+ ftFoodDemandDao.setUpdateAt(new Date());
+ return toAjax(iFtFoodDemandDaoService.updateById(ftFoodDemandDao) ? 1 : 0);
+ }
+
+ /**
+ * 删除病人报餐
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:foodDemand:remove')")
+ @Log(title = "病人报餐", businessType = BusinessType.DELETE)
+ @DeleteMapping("/{ids}")
+ public AjaxResult remove(@PathVariable Long[] ids) {
+ return toAjax(iFtFoodDemandDaoService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
+ }
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtInvoiceDaoController.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtInvoiceDaoController.java
new file mode 100644
index 0000000000000000000000000000000000000000..e45b31e91c0a09d5e56b17c0af7c119ae46eeff4
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtInvoiceDaoController.java
@@ -0,0 +1,192 @@
+package com.ruoyi.system.fantang.controller;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.fantang.domain.FtInvoiceDao;
+import com.ruoyi.system.fantang.domain.FtSettlementDao;
+import com.ruoyi.system.fantang.service.IFtInvoiceDaoService;
+import com.ruoyi.system.fantang.service.IFtReturnDaoService;
+import com.ruoyi.system.fantang.service.IFtSettlementDaoService;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 财务收费开票Controller
+ *
+ * @author ft
+ * @date 2020-12-08
+ */
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
+@RestController
+@RequestMapping("/fantang/invoice")
+public class FtInvoiceDaoController extends BaseController {
+
+ private final IFtInvoiceDaoService iFtInvoiceDaoService;
+
+ private final IFtSettlementDaoService settSettlementDaoService;
+
+ private final IFtReturnDaoService ftReturnDaoService;
+
+ /**
+ * 查询财务收费开票列表
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:invoice:list')")
+ @GetMapping("/list")
+ public TableDataInfo list(FtInvoiceDao ftInvoiceDao) {
+ startPage();
+ LambdaQueryWrapper lqw = Wrappers.lambdaQuery(ftInvoiceDao);
+
+ if (ftInvoiceDao.getInvoiceType() != null) {
+ lqw.eq(FtInvoiceDao::getInvoiceType, ftInvoiceDao.getInvoiceType());
+ }
+
+ List list = iFtInvoiceDaoService.list(lqw);
+ return getDataTable(list);
+ }
+
+ /**
+ * 导出财务收费开票列表
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:invoice:export')")
+ @Log(title = "财务收费开票", businessType = BusinessType.EXPORT)
+ @GetMapping("/export")
+ public AjaxResult export(FtInvoiceDao ftInvoiceDao) {
+ LambdaQueryWrapper lqw = new LambdaQueryWrapper(ftInvoiceDao);
+ List list = iFtInvoiceDaoService.list(lqw);
+ ExcelUtil util = new ExcelUtil(FtInvoiceDao.class);
+ return util.exportExcel(list, "invoice");
+ }
+
+ /**
+ * 获取财务收费开票详细信息
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:invoice:query')")
+ @GetMapping(value = "/{id}")
+ public AjaxResult getInfo(@PathVariable("id") Long id) {
+ return AjaxResult.success(iFtInvoiceDaoService.getById(id));
+ }
+
+ /**
+ * 新增财务收费开票
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:invoice:add')")
+ @Log(title = "财务收费开票", businessType = BusinessType.INSERT)
+ @PostMapping
+ public AjaxResult add(@RequestBody FtInvoiceDao ftInvoiceDao) {
+ return toAjax(iFtInvoiceDaoService.save(ftInvoiceDao) ? 1 : 0);
+ }
+
+ /**
+ * 修改财务收费开票
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:invoice:edit')")
+ @Log(title = "财务收费开票", businessType = BusinessType.UPDATE)
+ @PutMapping
+ public AjaxResult edit(@RequestBody FtInvoiceDao ftInvoiceDao) {
+ return toAjax(iFtInvoiceDaoService.updateById(ftInvoiceDao) ? 1 : 0);
+ }
+
+ /**
+ * 删除财务收费开票
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:invoice:remove')")
+ @Log(title = "财务收费开票", businessType = BusinessType.DELETE)
+ @DeleteMapping("/{ids}")
+ public AjaxResult remove(@PathVariable Long[] ids) {
+ return toAjax(iFtInvoiceDaoService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
+ }
+
+ @PostMapping("/addToInvoice")
+ @Transactional(propagation = Propagation.REQUIRES_NEW)
+ public AjaxResult addToInvoice(@RequestBody JSONObject params) {
+
+ // 应收
+ BigDecimal payable = params.getBigDecimal("payable");
+ // 实收
+ BigDecimal receipts = params.getBigDecimal("receipts");
+ // 收款方式
+ String type = params.getString("type");
+ // 发票号
+ String invoiceNum = params.getString("invoiceNum");
+ // 发票名
+ String invoiceName = params.getString("invoiceName");
+ // 税号
+ String taxId = params.getString("taxId");
+ // 跟踪回款
+ Integer invoiceType = params.getInteger("invoiceType");
+ // 开票金额
+ BigDecimal invoiceAmount = params.getBigDecimal("invoiceAmount");
+
+ FtInvoiceDao invoiceDao = new FtInvoiceDao();
+ Date today = new Date();
+ invoiceDao.setCreateAt(today);
+ invoiceDao.setPayable(payable);
+ invoiceDao.setReceipts(receipts);
+ invoiceDao.setCollectionType(type);
+ invoiceDao.setInvoiceNum(invoiceNum);
+ invoiceDao.setInvoiceName(invoiceName);
+ invoiceDao.setTaxId(taxId);
+ invoiceDao.setInvoiceType(invoiceType);
+ invoiceDao.setInvoiceAmount(invoiceAmount);
+ iFtInvoiceDaoService.save(invoiceDao);
+
+ // 结算 ids
+ JSONArray settleIds = params.getJSONArray("settleIds");
+
+ if (settleIds!=null){
+
+ List ids = JSONObject.parseArray(settleIds.toString(), Long.class);
+
+ List settleList = new ArrayList<>();
+ for (Long id : ids) {
+ FtSettlementDao settlementDao = new FtSettlementDao();
+ settlementDao.setSettleId(id);
+ settlementDao.setInvoiceId(invoiceDao.getId());
+ settlementDao.setInvoiceFlag(1);
+ settleList.add(settlementDao);
+ }
+
+ settSettlementDaoService.updateBatchById(settleList);
+ }else {
+
+ FtSettlementDao settlementDao = new FtSettlementDao();
+ settlementDao.setSettleId(params.getLong("settleId"));
+ settlementDao.setInvoiceId(invoiceDao.getId());
+ settlementDao.setInvoiceFlag(1);
+ settSettlementDaoService.updateById(settlementDao);
+
+ }
+
+ return AjaxResult.success("已开票");
+ }
+
+ @PutMapping("/finish/{id}")
+ public AjaxResult finish(@PathVariable Long id){
+
+ FtInvoiceDao invoiceDao = new FtInvoiceDao();
+ invoiceDao.setId(id);
+ invoiceDao.setInvoiceType(1);
+
+ iFtInvoiceDaoService.updateById(invoiceDao);
+
+ return AjaxResult.success("已结束跟踪");
+ }
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtNotifyDaoController.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtNotifyDaoController.java
new file mode 100644
index 0000000000000000000000000000000000000000..d3df8eaee279b74919863aadecc6ed8b2a4331c8
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtNotifyDaoController.java
@@ -0,0 +1,133 @@
+package com.ruoyi.system.fantang.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.fantang.domain.FtNotifyDao;
+import com.ruoyi.system.fantang.service.IFtNotifyDaoService;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 系统信息Controller
+ *
+ * @author ft
+ * @date 2020-12-17
+ */
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
+@RestController
+@RequestMapping("/fantang/notify")
+public class FtNotifyDaoController extends BaseController {
+
+ private final IFtNotifyDaoService iFtNotifyDaoService;
+
+
+ @GetMapping("/isHaveNewMsg")
+ public AjaxResult isHaveNewMsg() {
+ QueryWrapper wrapper = new QueryWrapper<>();
+ wrapper.eq("read_flag", 0);
+ wrapper.eq("message_type",1);
+ List list = iFtNotifyDaoService.list(wrapper);
+ int size = list.size();
+ String msgBody = "";
+ if (list.size() > 0) {
+ msgBody = "有 " + list.size() + " 条病患冲突消息待处理";
+ }
+ Map messageData = new HashMap<>();
+ messageData.put("size", size);
+ messageData.put("msgBody", msgBody);
+
+ return AjaxResult.success(messageData);
+ }
+
+
+ /**
+ * 查询系统信息列表
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:notify:list')")
+ @GetMapping("/list")
+ public TableDataInfo list(FtNotifyDao ftNotifyDao) {
+ startPage();
+ LambdaQueryWrapper lqw = Wrappers.lambdaQuery(ftNotifyDao);
+ if (ftNotifyDao.getMessageType() != null) {
+ lqw.eq(FtNotifyDao::getMessageType, ftNotifyDao.getMessageType());
+ }
+ if (ftNotifyDao.getScope() != null) {
+ lqw.eq(FtNotifyDao::getScope, ftNotifyDao.getScope());
+ }
+ if (StringUtils.isNotBlank(ftNotifyDao.getMessageBody())) {
+ lqw.eq(FtNotifyDao::getMessageBody, ftNotifyDao.getMessageBody());
+ }
+ if (ftNotifyDao.getReadFlag() != null) {
+ lqw.eq(FtNotifyDao::getReadFlag, ftNotifyDao.getReadFlag());
+ }
+ List list = iFtNotifyDaoService.list(lqw);
+ return getDataTable(list);
+ }
+
+ /**
+ * 导出系统信息列表
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:notify:export')")
+ @Log(title = "系统信息", businessType = BusinessType.EXPORT)
+ @GetMapping("/export")
+ public AjaxResult export(FtNotifyDao ftNotifyDao) {
+ LambdaQueryWrapper lqw = new LambdaQueryWrapper(ftNotifyDao);
+ List list = iFtNotifyDaoService.list(lqw);
+ ExcelUtil util = new ExcelUtil(FtNotifyDao.class);
+ return util.exportExcel(list, "notify");
+ }
+
+ /**
+ * 获取系统信息详细信息
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:notify:query')")
+ @GetMapping(value = "/{id}")
+ public AjaxResult getInfo(@PathVariable("id") Long id) {
+ return AjaxResult.success(iFtNotifyDaoService.getById(id));
+ }
+
+ /**
+ * 新增系统信息
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:notify:add')")
+ @Log(title = "系统信息", businessType = BusinessType.INSERT)
+ @PostMapping
+ public AjaxResult add(@RequestBody FtNotifyDao ftNotifyDao) {
+ return toAjax(iFtNotifyDaoService.save(ftNotifyDao) ? 1 : 0);
+ }
+
+ /**
+ * 修改系统信息
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:notify:edit')")
+ @Log(title = "系统信息", businessType = BusinessType.UPDATE)
+ @PutMapping
+ public AjaxResult edit(@RequestBody FtNotifyDao ftNotifyDao) {
+ return toAjax(iFtNotifyDaoService.updateById(ftNotifyDao) ? 1 : 0);
+ }
+
+ /**
+ * 删除系统信息
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:notify:remove')")
+ @Log(title = "系统信息", businessType = BusinessType.DELETE)
+ @DeleteMapping("/{ids}")
+ public AjaxResult remove(@PathVariable Long[] ids) {
+ return toAjax(iFtNotifyDaoService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
+ }
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtNutritionFoodDaoController.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtNutritionFoodDaoController.java
new file mode 100644
index 0000000000000000000000000000000000000000..0f14bedfc59c97a34884bf5c97cebbf57ecc812b
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtNutritionFoodDaoController.java
@@ -0,0 +1,121 @@
+package com.ruoyi.system.fantang.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.fantang.domain.FtNutritionFoodDao;
+import com.ruoyi.system.fantang.service.IFtNutritionFoodDaoService;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 病患营养配餐Controller
+ *
+ * @author ft
+ * @date 2020-12-03
+ */
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
+@RestController
+@RequestMapping("/fantang/nutritionFood")
+public class FtNutritionFoodDaoController extends BaseController {
+
+ private final IFtNutritionFoodDaoService iFtNutritionFoodDaoService;
+
+ /**
+ * 查询病患营养配餐列表
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:nutritionFood:list')")
+ @GetMapping("/list")
+ public TableDataInfo list(FtNutritionFoodDao ftNutritionFoodDao) {
+ startPage();
+ LambdaQueryWrapper lqw = Wrappers.lambdaQuery(ftNutritionFoodDao);
+ if (StringUtils.isNotBlank(ftNutritionFoodDao.getName())) {
+ lqw.like(FtNutritionFoodDao::getName, ftNutritionFoodDao.getName());
+ }
+ if (ftNutritionFoodDao.getPrice() != null) {
+ lqw.eq(FtNutritionFoodDao::getPrice, ftNutritionFoodDao.getPrice());
+ }
+ if (ftNutritionFoodDao.getFlag() != null) {
+ lqw.eq(FtNutritionFoodDao::getFlag, ftNutritionFoodDao.getFlag());
+ }
+ List list = iFtNutritionFoodDaoService.list(lqw);
+ return getDataTable(list);
+ }
+
+ /**
+ * 导出病患营养配餐列表
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:nutritionFood:export')")
+ @Log(title = "病患营养配餐", businessType = BusinessType.EXPORT)
+ @GetMapping("/export")
+ public AjaxResult export(FtNutritionFoodDao ftNutritionFoodDao) {
+ LambdaQueryWrapper lqw = new LambdaQueryWrapper(ftNutritionFoodDao);
+ List list = iFtNutritionFoodDaoService.list(lqw);
+ ExcelUtil util = new ExcelUtil(FtNutritionFoodDao.class);
+ return util.exportExcel(list, "nutritionFood");
+ }
+
+ /**
+ * 获取病患营养配餐详细信息
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:nutritionFood:query')")
+ @GetMapping(value = "/{id}")
+ public AjaxResult getInfo(@PathVariable("id") Long id) {
+ return AjaxResult.success(iFtNutritionFoodDaoService.getById(id));
+ }
+
+ /**
+ * 新增病患营养配餐
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:nutritionFood:add')")
+ @Log(title = "病患营养配餐", businessType = BusinessType.INSERT)
+ @PostMapping
+ public AjaxResult add(@RequestBody FtNutritionFoodDao ftNutritionFoodDao) {
+ ftNutritionFoodDao.setFlag(true);
+ ftNutritionFoodDao.setCreateAt(new Date());
+ return toAjax(iFtNutritionFoodDaoService.save(ftNutritionFoodDao) ? 1 : 0);
+ }
+
+ /**
+ * 修改病患营养配餐
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:nutritionFood:edit')")
+ @Log(title = "病患营养配餐", businessType = BusinessType.UPDATE)
+ @PutMapping
+ public AjaxResult edit(@RequestBody FtNutritionFoodDao ftNutritionFoodDao) {
+ return toAjax(iFtNutritionFoodDaoService.updateById(ftNutritionFoodDao) ? 1 : 0);
+ }
+
+ /**
+ * 停用病患营养配餐
+ */
+ @PutMapping("/deactivate/{id}")
+ public AjaxResult deactivate(@PathVariable("id") Long id) {
+ FtNutritionFoodDao ftNutritionFoodDao = iFtNutritionFoodDaoService.getById(id);
+ ftNutritionFoodDao.setFlag(false);
+ iFtNutritionFoodDaoService.updateById(ftNutritionFoodDao);
+ return AjaxResult.success("停用成功");
+ }
+
+ /**
+ * 删除病患营养配餐
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:nutritionFood:remove')")
+ @Log(title = "病患营养配餐", businessType = BusinessType.DELETE)
+ @DeleteMapping("/{ids}")
+ public AjaxResult remove(@PathVariable Long[] ids) {
+ return toAjax(iFtNutritionFoodDaoService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
+ }
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtOrderDaoController.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtOrderDaoController.java
new file mode 100644
index 0000000000000000000000000000000000000000..89b024114ba13c79c5084aebc07e06de7597cba7
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtOrderDaoController.java
@@ -0,0 +1,237 @@
+package com.ruoyi.system.fantang.controller;
+
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.fantang.domain.FtOrderDao;
+import com.ruoyi.system.fantang.service.IFtOrderDaoService;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 订单管理Controller
+ *
+ * @author ft
+ * @date 2020-11-19
+ */
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
+@RestController
+@RequestMapping("/fantang/order")
+public class FtOrderDaoController extends BaseController {
+
+ private final IFtOrderDaoService iFtOrderDaoService;
+
+ /**
+ * 查询订单管理列表
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:order:list')")
+ @GetMapping("/list")
+ public TableDataInfo list(FtOrderDao ftOrderDao) {
+ startPage();
+ LambdaQueryWrapper lqw = Wrappers.lambdaQuery(ftOrderDao);
+ if (ftOrderDao.getOrderType() != null) {
+ lqw.eq(FtOrderDao::getOrderType, ftOrderDao.getOrderType());
+ }
+ if (ftOrderDao.getTotalPrice() != null) {
+ lqw.eq(FtOrderDao::getTotalPrice, ftOrderDao.getTotalPrice());
+ }
+ if (ftOrderDao.getDiscount() != null) {
+ lqw.eq(FtOrderDao::getDiscount, ftOrderDao.getDiscount());
+ }
+ if (ftOrderDao.getReceipts() != null) {
+ lqw.eq(FtOrderDao::getReceipts, ftOrderDao.getReceipts());
+ }
+ if (ftOrderDao.getCreateAt() != null) {
+ lqw.eq(FtOrderDao::getCreateAt, ftOrderDao.getCreateAt());
+ }
+ if (StringUtils.isNotBlank(ftOrderDao.getOrderSrc())) {
+ lqw.eq(FtOrderDao::getOrderSrc, ftOrderDao.getOrderSrc());
+ }
+ if (ftOrderDao.getCurrentPrice() != null) {
+ lqw.eq(FtOrderDao::getCurrentPrice, ftOrderDao.getCurrentPrice());
+ }
+ if (ftOrderDao.getPayType() != null) {
+ lqw.eq(FtOrderDao::getPayType, ftOrderDao.getPayType());
+ }
+ if (ftOrderDao.getWriteOffAt() != null) {
+ lqw.eq(FtOrderDao::getWriteOffAt, ftOrderDao.getWriteOffAt());
+ }
+ List list = iFtOrderDaoService.list(lqw);
+ return getDataTable(list);
+ }
+
+ /**
+ * 导出订单管理列表
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:order:export')")
+ @Log(title = "订单管理", businessType = BusinessType.EXPORT)
+ @GetMapping("/export")
+ public AjaxResult export(FtOrderDao ftOrderDao) {
+ LambdaQueryWrapper lqw = new LambdaQueryWrapper(ftOrderDao);
+ List list = iFtOrderDaoService.list(lqw);
+ ExcelUtil util = new ExcelUtil(FtOrderDao.class);
+ return util.exportExcel(list, "order");
+ }
+
+ /**
+ * 获取订单管理详细信息
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:order:query')")
+ @GetMapping(value = "/{orderId}")
+ public AjaxResult getInfo(@PathVariable("orderId") Long orderId) {
+ return AjaxResult.success(iFtOrderDaoService.getById(orderId));
+ }
+
+ /**
+ * 新增订单管理
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:order:add')")
+ @Log(title = "订单管理", businessType = BusinessType.INSERT)
+ @PostMapping
+ public AjaxResult add(@RequestBody FtOrderDao ftOrderDao) {
+ return toAjax(iFtOrderDaoService.save(ftOrderDao) ? 1 : 0);
+ }
+
+ /**
+ * 修改订单管理
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:order:edit')")
+ @Log(title = "订单管理", businessType = BusinessType.UPDATE)
+ @PutMapping
+ public AjaxResult edit(@RequestBody FtOrderDao ftOrderDao) {
+ return toAjax(iFtOrderDaoService.updateById(ftOrderDao) ? 1 : 0);
+ }
+
+ /**
+ * 删除订单管理
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:order:remove')")
+ @Log(title = "订单管理", businessType = BusinessType.DELETE)
+ @DeleteMapping("/{orderIds}")
+ public AjaxResult remove(@PathVariable Long[] orderIds) {
+ return toAjax(iFtOrderDaoService.removeByIds(Arrays.asList(orderIds)) ? 1 : 0);
+ }
+
+ /**
+ * 统计日报餐信息
+ */
+ @PostMapping("/getStatisGetOrderOfDay")
+ public AjaxResult getStatisGetOrderOfDay(@RequestBody JSONObject params) {
+
+ Date selectDay = params.getDate("selectDay");
+ Integer statisticsType = params.getInteger("statisticsType");
+ Integer pageNum = params.getInteger("pageNum");
+ Integer pageSize = params.getInteger("pageSize");
+
+ if (statisticsType == 1) {
+ return AjaxResult.success(iFtOrderDaoService.statisGetOrderOfDate(selectDay, pageNum, pageSize));
+ } else {
+ return AjaxResult.success(iFtOrderDaoService.statisGetOrderOfDateByPerson(selectDay, pageNum, pageSize));
+ }
+ }
+
+ @PostMapping("/exportOrderOfDay")
+ public AjaxResult exportOrderOfDay(@RequestBody JSONObject params) {
+
+ Date selectDay = params.getDate("selectDay");
+ Integer statisticsType = params.getInteger("statisticsType");
+
+ List list;
+
+ if (statisticsType != 1) {
+ list = iFtOrderDaoService.statisOrderOfDateByPersonNoPage(selectDay);
+ } else {
+ list = null;
+ }
+
+ ExcelUtil util = new ExcelUtil<>(FtOrderDao.class);
+ return util.exportExcel(list, "员工用餐统计");
+ }
+
+ /**
+ * 统计周报餐信息
+ */
+ @PostMapping("/getStatisGetOrderOfWeek")
+ public AjaxResult getStatisGetOrderOfWeek(@RequestBody JSONObject params) {
+
+ Date selectWeek = params.getDate("selectWeek");
+ Integer statisticsType = params.getInteger("statisticsType");
+ Integer pageNum = params.getInteger("pageNum");
+ Integer pageSize = params.getInteger("pageSize");
+
+ if (statisticsType == 1) {
+ return AjaxResult.success(iFtOrderDaoService.statisGetOrderOfWeek(selectWeek, pageNum, pageSize));
+ } else {
+ return AjaxResult.success(iFtOrderDaoService.statisGetOrderOfWeekByPerson(selectWeek, pageNum, pageSize));
+ }
+
+ }
+
+ @PostMapping("/exportOrderOfWeek")
+ public AjaxResult exportOrderOfWeek(@RequestBody JSONObject params) {
+
+ Date selectWeek = params.getDate("selectWeek");
+ Integer statisticsType = params.getInteger("statisticsType");
+
+ List list;
+
+ if (statisticsType != 1) {
+ list = iFtOrderDaoService.statisOrderOfWeekByPersonNoPage(selectWeek);
+ } else {
+ list = null;
+ }
+
+ ExcelUtil util = new ExcelUtil<>(FtOrderDao.class);
+ return util.exportExcel(list, "员工用餐统计");
+ }
+
+ /**
+ * 统计月报餐信息
+ */
+ @PostMapping("/getStatisGetOrderOfMonth")
+ public AjaxResult getStatisGetOrderOfMonth(@RequestBody JSONObject params) {
+
+ Date selectMonth = params.getDate("selectMonth");
+ Integer statisticsType = params.getInteger("statisticsType");
+ Integer pageNum = params.getInteger("pageNum");
+ Integer pageSize = params.getInteger("pageSize");
+
+ if (statisticsType == 1) {
+ return AjaxResult.success(iFtOrderDaoService.statisGetOrderOfMonth(selectMonth, pageNum, pageSize));
+ } else {
+ return AjaxResult.success(iFtOrderDaoService.statisGetOrderOfMonthByPerson(selectMonth, pageNum, pageSize));
+ }
+ }
+
+ @PostMapping("/exportOrderOfMonth")
+ public AjaxResult exportOrderOfMonth(@RequestBody JSONObject params){
+
+ Date selectMonth = params.getDate("selectMonth");
+ Integer statisticsType = params.getInteger("statisticsType");
+
+ List list;
+
+ if (statisticsType != 1) {
+ list = iFtOrderDaoService.statisOrderOfMonthByPersonNoPage(selectMonth);
+ } else {
+ list = null;
+ }
+
+ ExcelUtil util = new ExcelUtil<>(FtOrderDao.class);
+ return util.exportExcel(list, "员工用餐统计");
+
+ }
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtPatientDaoController.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtPatientDaoController.java
new file mode 100644
index 0000000000000000000000000000000000000000..b0e1435aef6abe14123208030bf915a8c1183a2d
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtPatientDaoController.java
@@ -0,0 +1,155 @@
+package com.ruoyi.system.fantang.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.fantang.domain.FtPatientDao;
+import com.ruoyi.system.fantang.service.IFtFoodDemandDaoService;
+import com.ruoyi.system.fantang.service.IFtPatientDaoService;
+import com.ruoyi.system.fantang.service.IFtReportMealsDaoService;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 病人管理Controller
+ *
+ * @author ft
+ * @date 2020-11-24
+ */
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
+@RestController
+@RequestMapping("/fantang/patient")
+public class FtPatientDaoController extends BaseController {
+
+ private final IFtPatientDaoService iFtPatientDaoService;
+
+ private final IFtFoodDemandDaoService iFtFoodDemandDaoService;
+
+ @Autowired
+ private IFtReportMealsDaoService reportMealsDaoService;
+
+ /**
+ * 查询病人管理列表
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:patient:list')")
+ @GetMapping("/list")
+ public TableDataInfo list(FtPatientDao ftPatientDao) {
+ startPage();
+ LambdaQueryWrapper lqw = Wrappers.lambdaQuery(ftPatientDao);
+ if (StringUtils.isNotBlank(ftPatientDao.getName())) {
+ lqw.like(FtPatientDao::getName, ftPatientDao.getName());
+ }
+ if (StringUtils.isNotBlank(ftPatientDao.getBedId())) {
+ lqw.eq(FtPatientDao::getBedId, ftPatientDao.getBedId());
+ }
+ if (StringUtils.isNotBlank(ftPatientDao.getHospitalId())) {
+ lqw.eq(FtPatientDao::getHospitalId, ftPatientDao.getHospitalId());
+ }
+ List list = iFtPatientDaoService.list(lqw);
+ return getDataTable(list);
+ }
+
+ /**
+ * 根据 departId 查询病人列表
+ */
+ @GetMapping("/selectPatientByDepartId/{departId}")
+ public AjaxResult selectPatientByDepartId(@PathVariable("departId") Long departId) {
+ QueryWrapper wrapper = new QueryWrapper<>();
+ wrapper.eq("depart_id", departId);
+ List list = iFtPatientDaoService.list(wrapper);
+ return AjaxResult.success(list);
+ }
+
+ /**
+ * 根据 departId 查询所有没有营养配餐的病人列表
+ * @author 陈智兴
+ */
+ @GetMapping("/selectNoCateringByDepartId/{departId}")
+ public AjaxResult selectNoCateringByDepartId(@PathVariable("departId") Long departId) {
+ List list = iFtPatientDaoService.selectNoCateringByDepartId(departId);
+ return AjaxResult.success(list);
+ }
+
+
+ /**
+ * 根据 patientId 查询病人床号
+ */
+ @GetMapping("/getBedIdById/{patientId}")
+ public AjaxResult getBedIdById(@PathVariable("patientId") Long patientId) {
+ String bedId = iFtPatientDaoService.getById(patientId).getBedId();
+ return AjaxResult.success(bedId);
+ }
+
+ /**
+ * 导出病人管理列表
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:patient:export')")
+ @Log(title = "病人管理", businessType = BusinessType.EXPORT)
+ @GetMapping("/export")
+ public AjaxResult export(FtPatientDao ftPatientDao) {
+ LambdaQueryWrapper lqw = new LambdaQueryWrapper(ftPatientDao);
+ List list = iFtPatientDaoService.list(lqw);
+ ExcelUtil util = new ExcelUtil(FtPatientDao.class);
+ return util.exportExcel(list, "patient");
+ }
+
+ /**
+ * 获取病人管理详细信息
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:patient:query')")
+ @GetMapping(value = "/{patientId}")
+ public AjaxResult getInfo(@PathVariable("patientId") Long patientId) {
+ return AjaxResult.success(iFtPatientDaoService.getById(patientId));
+ }
+
+ /**
+ * 新增病人管理
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:patient:add')")
+ @Log(title = "病人管理", businessType = BusinessType.INSERT)
+ @PostMapping
+ public AjaxResult add(@RequestBody FtPatientDao ftPatientDao) {
+
+ ftPatientDao.setCreateAt(new Date());
+ ftPatientDao.setOffFlag(0);
+ iFtPatientDaoService.save(ftPatientDao);
+
+ iFtFoodDemandDaoService.GenerateOrderByPatientId(ftPatientDao.getPatientId());
+ reportMealsDaoService.insertTomorrowReportMealByPatient(ftPatientDao.getPatientId());
+
+ return AjaxResult.success("已添加");
+ }
+
+ /**
+ * 修改病人管理
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:patient:edit')")
+ @Log(title = "病人管理", businessType = BusinessType.UPDATE)
+ @PutMapping
+ public AjaxResult edit(@RequestBody FtPatientDao ftPatientDao) {
+ return toAjax(iFtPatientDaoService.updateById(ftPatientDao) ? 1 : 0);
+ }
+
+ /**
+ * 删除病人管理
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:patient:remove')")
+ @Log(title = "病人管理", businessType = BusinessType.DELETE)
+ @DeleteMapping("/{patientIds}")
+ public AjaxResult remove(@PathVariable Long[] patientIds) {
+ return toAjax(iFtPatientDaoService.removeByIds(Arrays.asList(patientIds)) ? 1 : 0);
+ }
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtPrepaymentDaoController.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtPrepaymentDaoController.java
new file mode 100644
index 0000000000000000000000000000000000000000..5ec8ba0d9cebc568e0744be48498a8c0985810a5
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtPrepaymentDaoController.java
@@ -0,0 +1,227 @@
+package com.ruoyi.system.fantang.controller;
+
+import cn.hutool.core.date.DateUtil;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.config.RuoYiConfig;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.fantang.domain.FtPrepaymentDao;
+import com.ruoyi.system.fantang.domain.FtPrepaymentVo;
+import com.ruoyi.system.fantang.service.IFtPrepaymentDaoService;
+import com.ruoyi.system.fantang.utils.PdfUtils;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.math.BigDecimal;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 收费管理Controller
+ *
+ * @author ft
+ * @date 2020-11-19
+ */
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
+@RestController
+@RequestMapping("/fantang/prepayment")
+public class FtPrepaymentDaoController extends BaseController {
+
+ private final IFtPrepaymentDaoService iFtPrepaymentDaoService;
+
+ @Value("${fantang.templatePath}")
+ private String templatePath;
+
+ @Value("${fantang.fileWebUrl}")
+ private String fileWebUrl;
+
+ @GetMapping("/getCountById/{patientId}")
+ public AjaxResult getCountById(@PathVariable("patientId") Long patientId) {
+ FtPrepaymentVo dao = iFtPrepaymentDaoService.getCountById(patientId);
+ if (dao == null)
+ return AjaxResult.error("无该记录");
+ return AjaxResult.success("操作成功", dao);
+ }
+
+ /**
+ * 通过病人id查询收费管理详细
+ * 作者:陈智兴
+ * 日期:2020年12月2日
+ * 功能: 前端查询预付款情况
+ *
+ * @param patientId
+ * @return
+ */
+ @GetMapping("/getPrepaymentByPatientId/{patientId}")
+ public AjaxResult getPrepaymentByPatientId(@PathVariable("patientId") Long patientId) {
+ FtPrepaymentDao ftPrepaymentDao = iFtPrepaymentDaoService.getByPatientId(patientId);
+ if (ftPrepaymentDao == null) {
+ return AjaxResult.error("无该记录");
+ }
+ return AjaxResult.success("操作成功", ftPrepaymentDao);
+ }
+
+ // 查询所有待缴费列表
+ @PreAuthorize("@ss.hasPermi('fantang:prepayment:list')")
+ @GetMapping("/listNoPrepay")
+ public TableDataInfo listNoPrepay(FtPrepaymentVo params) {
+ startPage();
+ return getDataTable(iFtPrepaymentDaoService.listNoPrepay(params));
+ }
+
+ // 查询所有已缴费列表
+ @PreAuthorize("@ss.hasPermi('fantang:prepayment:list')")
+ @GetMapping("/listPrepay")
+ public TableDataInfo listPrepay(FtPrepaymentVo params) {
+ startPage();
+ if (params.getPrepaidAt() != null) {
+ Date date = DateUtil.parse(params.getPrepaidAt().toString());
+ params.setPrepaidAt(date);
+ }
+ return getDataTable(iFtPrepaymentDaoService.listPrepay(params));
+ }
+
+ // 查询所有已结算列表
+ @PreAuthorize("@ss.hasPermi('fantang:prepayment:list')")
+ @GetMapping("/listAllPrepay")
+ public TableDataInfo listAllPrepay(FtPrepaymentVo params) {
+ startPage();
+
+ List list = iFtPrepaymentDaoService.listAllPrepay(params);
+ return getDataTable(list);
+ }
+
+
+ /**
+ * 查询收费管理列表
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:prepayment:list')")
+ @GetMapping("/list")
+ public TableDataInfo list(FtPrepaymentDao ftPrepaymentDao) {
+ startPage();
+ LambdaQueryWrapper lqw = Wrappers.lambdaQuery(ftPrepaymentDao);
+ if (ftPrepaymentDao.getCollectAt() != null) {
+ lqw.eq(FtPrepaymentDao::getCollectAt, ftPrepaymentDao.getCollectAt());
+ }
+ if (ftPrepaymentDao.getSettlementAt() != null) {
+ lqw.eq(FtPrepaymentDao::getSettlementAt, ftPrepaymentDao.getSettlementAt());
+ }
+ if (ftPrepaymentDao.getSettlementFlag() != null) {
+ lqw.eq(FtPrepaymentDao::getSettlementFlag, ftPrepaymentDao.getSettlementFlag());
+ }
+ if (ftPrepaymentDao.getPrepaid() != null) {
+ lqw.eq(FtPrepaymentDao::getPrepaid, ftPrepaymentDao.getPrepaid());
+ }
+ if (ftPrepaymentDao.getPrepaidAt() != null) {
+ lqw.eq(FtPrepaymentDao::getPrepaidAt, ftPrepaymentDao.getPrepaidAt());
+ }
+ if (ftPrepaymentDao.getPrepaidAt() != null) {
+ lqw.eq(FtPrepaymentDao::getPrepaidAt, ftPrepaymentDao.getPrepaidAt());
+ }
+ List list = iFtPrepaymentDaoService.list(lqw);
+ return getDataTable(list);
+ }
+
+ /**
+ * 导出收费管理列表
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:prepayment:export')")
+ @Log(title = "收费管理", businessType = BusinessType.EXPORT)
+ @GetMapping("/export")
+ public AjaxResult export(FtPrepaymentDao ftPrepaymentDao) {
+ LambdaQueryWrapper lqw = new LambdaQueryWrapper(ftPrepaymentDao);
+ List list = iFtPrepaymentDaoService.list(lqw);
+ ExcelUtil util = new ExcelUtil(FtPrepaymentDao.class);
+ return util.exportExcel(list, "prepayment");
+ }
+
+ /**
+ * 获取收费管理详细信息
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:prepayment:query')")
+ @GetMapping(value = "/{prepaymentId}")
+ public AjaxResult getInfo(@PathVariable("prepaymentId") Long prepaymentId) {
+ return AjaxResult.success(iFtPrepaymentDaoService.getById(prepaymentId));
+ }
+
+ /**
+ * 新增收费管理
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:prepayment:add')")
+ @Log(title = "收费管理", businessType = BusinessType.INSERT)
+ @PostMapping
+ public AjaxResult add(@RequestBody FtPrepaymentDao ftPrepaymentDao) {
+ ftPrepaymentDao.setCollectAt(new Date());
+
+ return toAjax(iFtPrepaymentDaoService.save(ftPrepaymentDao) ? 1 : 0);
+ }
+
+ /**
+ * 修改收费管理
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:prepayment:edit')")
+ @Log(title = "收费管理", businessType = BusinessType.UPDATE)
+ @PutMapping
+ public AjaxResult edit(@RequestBody FtPrepaymentVo ftPrepaymentDao) {
+ return toAjax(iFtPrepaymentDaoService.updateById(ftPrepaymentDao) ? 1 : 0);
+ }
+
+ /**
+ * 删除收费管理
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:prepayment:remove')")
+ @Log(title = "收费管理", businessType = BusinessType.DELETE)
+ @DeleteMapping("/{prepaymentIds}")
+ public AjaxResult remove(@PathVariable Long[] prepaymentIds) {
+ return toAjax(iFtPrepaymentDaoService.removeByIds(Arrays.asList(prepaymentIds)) ? 1 : 0);
+ }
+
+ /**
+ * 生成 pdf 收据
+ */
+ @PostMapping("/generateReceiptPdf")
+ public AjaxResult generateReceiptPdf(@RequestBody JSONObject params) {
+
+ String patientId = params.getString("patientId");
+
+ // 模板路径
+// String templatePath = "F:\\pdfTemplate\\饭堂票据模板2.pdf";
+// String templatePath = "Z:\\程序开发\\项目测试\\三院饭堂\\饭堂收费票据模板.pdf";
+
+ // 生成的新文件路径
+ String outputPath = RuoYiConfig.getUploadPath() + "\\饭堂票据" + patientId + ".pdf";
+
+ PdfUtils.generatePrepaymentPdf(templatePath, outputPath, params);
+
+ // 下载地址
+ String downloadPath = "profile/upload/饭堂票据" + patientId + ".pdf";
+
+ return AjaxResult.success(fileWebUrl + downloadPath);
+ }
+
+ /**
+ * 出院结清
+ */
+ @PutMapping("/leaveSettlePrepayment/{prepaymentId}")
+ public AjaxResult leaveSettlePrepayment(@PathVariable Long prepaymentId){
+
+ FtPrepaymentDao prepaymentDao = new FtPrepaymentDao();
+ prepaymentDao.setPrepaymentId(prepaymentId);
+ prepaymentDao.setPrepaid(new BigDecimal(0));
+ prepaymentDao.setSettlementFlag(1);
+ prepaymentDao.setSettlementAt(new Date());
+
+ iFtPrepaymentDaoService.updateById(prepaymentDao);
+ return AjaxResult.success("已结清");
+ }
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtReportMealsDaoController.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtReportMealsDaoController.java
new file mode 100644
index 0000000000000000000000000000000000000000..67b9cd2457db417d30f7a0cc7db90de84aaea6f7
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtReportMealsDaoController.java
@@ -0,0 +1,251 @@
+package com.ruoyi.system.fantang.controller;
+
+import cn.hutool.core.date.DateUnit;
+import cn.hutool.core.date.DateUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.fantang.domain.FtPrepaymentDao;
+import com.ruoyi.system.fantang.domain.FtReportMealsDao;
+import com.ruoyi.system.fantang.entity.ReportMealsDayEntity;
+import com.ruoyi.system.fantang.service.IFtPrepaymentDaoService;
+import com.ruoyi.system.fantang.service.IFtReportMealsDaoService;
+import com.ruoyi.system.fantang.vo.FtReportMealVo;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+
+import static com.ruoyi.common.core.domain.AjaxResult.success;
+
+/**
+ * 报餐管理Controller
+ *
+ * @author ft
+ * @date 2020-11-19
+ */
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
+@RestController
+@RequestMapping("/fantang/meals")
+public class FtReportMealsDaoController extends BaseController {
+
+ private final IFtReportMealsDaoService iFtReportMealsDaoService;
+
+ @Autowired
+ private IFtPrepaymentDaoService prepaymentDaoService;
+
+
+ /**
+ * 查询指定用户上一次结算的日期,并通过这个日期计算未结算的天数
+ */
+ @GetMapping("/getLastSettlementDate/{patientId}")
+ public AjaxResult getLastSettlementDate(@PathVariable("patientId") Long patientId) {
+ // 初始化一个返回对象
+ AjaxResult result = AjaxResult.success();
+
+ // 获取该病患的预付费数据
+ FtPrepaymentDao prepaymentDao = prepaymentDaoService.getByPatientId(patientId);
+ result.put("prepayment", prepaymentDao);
+
+ // 获取最近一次已结算的报餐记录,如果首次结算则返回第一条已用餐的记录
+ FtReportMealsDao reportMealsDao = iFtReportMealsDaoService.getLastReportMeals(patientId);
+
+ // 获取用餐日期
+ Date diningAt = reportMealsDao.getDiningAt();
+ // 获取结算日期
+ Date settlementAt = reportMealsDao.getSettlementAt();
+ ReportMealsDayEntity reportMealsDayEntity = new ReportMealsDayEntity();
+
+ // 如果首次结算
+ if (settlementAt == null) {
+ // 计算第一条已用餐的用餐时间与现在相差多少天
+ long betweenDays = DateUtil.between(diningAt, new Date(), DateUnit.DAY);
+ reportMealsDayEntity.setDays(betweenDays);
+ reportMealsDayEntity.setLastCreateDate(diningAt);
+ result.put("reportMeals", reportMealsDayEntity);
+
+ return result;
+ }
+
+ //计算上次结算日期与现在相差多少天
+ long days = DateUtil.between(settlementAt, new Date(), DateUnit.DAY);
+ reportMealsDayEntity.setSettlementAt(settlementAt);
+ reportMealsDayEntity.setDays(days);
+ result.put("reportMeals", reportMealsDayEntity);
+
+ return result;
+ }
+
+
+ /**
+ * 查询所有报餐列表
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:meals:list')")
+ @GetMapping("/listAll")
+ public TableDataInfo listAll(FtReportMealVo ftReportMealsDao) {
+ startPage();
+ List list = iFtReportMealsDaoService.listAll();
+ return getDataTable(list);
+ }
+
+ /**
+ * 查询所有未付费报餐列表
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:meals:list')")
+ @GetMapping("/listNoPay")
+ public TableDataInfo listNoPay(FtReportMealVo ftReportMealsDao) {
+ startPage();
+ List list = iFtReportMealsDaoService.listNoPay();
+ return getDataTable(list);
+ }
+
+ /**
+ * 查询所有已付费报餐列表
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:meals:list')")
+ @GetMapping("/listPayoff")
+ public TableDataInfo listPayoff(FtReportMealVo ftReportMealsDao) {
+ startPage();
+
+ List list = iFtReportMealsDaoService.listPayoff();
+ return getDataTable(list);
+ }
+
+
+ /**
+ * 查询报餐管理列表
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:meals:list')")
+ @GetMapping("/list")
+ public TableDataInfo list(FtReportMealsDao ftReportMealsDao) {
+ startPage();
+ LambdaQueryWrapper lqw = Wrappers.lambdaQuery(ftReportMealsDao);
+ if (ftReportMealsDao.getCreateAt() != null) {
+ lqw.eq(FtReportMealsDao::getCreateAt, ftReportMealsDao.getCreateAt());
+ }
+ if (ftReportMealsDao.getType() != null) {
+ lqw.eq(FtReportMealsDao::getType, ftReportMealsDao.getType());
+ }
+ if (ftReportMealsDao.getCreateBy() != null) {
+ lqw.eq(FtReportMealsDao::getCreateBy, ftReportMealsDao.getCreateBy());
+ }
+ if (ftReportMealsDao.getPrice() != null) {
+ lqw.eq(FtReportMealsDao::getPrice, ftReportMealsDao.getPrice());
+ }
+ List list = iFtReportMealsDaoService.list(lqw);
+ return getDataTable(list);
+ }
+
+ @GetMapping("/listStatistics")
+ public TableDataInfo listStatistics(FtReportMealsDao ftReportMealsDao) {
+
+ startPage();
+
+ return getDataTable(iFtReportMealsDaoService.listNutrition(ftReportMealsDao));
+ }
+
+ @PreAuthorize("@ss.hasPermi('fantang:meals:list')")
+ @GetMapping("/listMealsWithInSettle")
+ public TableDataInfo listMealsWithInSettle(FtReportMealsDao ftReportMealsDao) {
+ startPage();
+ List list = iFtReportMealsDaoService.listMealsWithInSettle(ftReportMealsDao);
+ return getDataTable(list);
+ }
+
+ /**
+ * 导出报餐管理列表
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:meals:export')")
+ @Log(title = "报餐管理", businessType = BusinessType.EXPORT)
+ @GetMapping("/export")
+ public AjaxResult export(FtReportMealsDao ftReportMealsDao) {
+ Date createAt = ftReportMealsDao.getCreateAt();
+
+ if (createAt != null) {
+ ftReportMealsDao.setBeginOfDay(createAt);
+ ftReportMealsDao.setEndOfDay(createAt);
+ }
+
+ List list = iFtReportMealsDaoService.listPatientReportMeals(ftReportMealsDao);
+
+ ExcelUtil util = new ExcelUtil<>(FtReportMealsDao.class);
+ return util.exportExcel(list, "病患报餐统计");
+ }
+
+
+ /**
+ * 计算两个日期之间的未结算数据
+ *
+ * @param dao
+ * @return
+ */
+ @GetMapping("/countBillingBetween")
+ public AjaxResult countBillingBetween(ReportMealsDayEntity dao) {
+ return success(iFtReportMealsDaoService.countBillingBetween(dao));
+ }
+
+ /**
+ * 获取报餐管理详细信息
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:meals:query')")
+ @GetMapping(value = "/{id}")
+ public AjaxResult getInfo(@PathVariable("id") Long id) {
+ return success(iFtReportMealsDaoService.getById(id));
+ }
+
+ /**
+ * 新增报餐管理
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:meals:add')")
+ @Log(title = "报餐管理", businessType = BusinessType.INSERT)
+ @PostMapping
+ public AjaxResult add(@RequestBody FtReportMealsDao ftReportMealsDao) {
+ return toAjax(iFtReportMealsDaoService.save(ftReportMealsDao) ? 1 : 0);
+ }
+
+ /**
+ * 修改报餐管理
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:meals:edit')")
+ @Log(title = "报餐管理", businessType = BusinessType.UPDATE)
+ @PutMapping
+ public AjaxResult edit(@RequestBody FtReportMealsDao ftReportMealsDao) {
+ return toAjax(iFtReportMealsDaoService.updateById(ftReportMealsDao) ? 1 : 0);
+ }
+
+ /**
+ * 删除报餐管理
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:meals:remove')")
+ @Log(title = "报餐管理", businessType = BusinessType.DELETE)
+ @DeleteMapping("/{ids}")
+ public AjaxResult remove(@PathVariable Long[] ids) {
+ return toAjax(iFtReportMealsDaoService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
+ }
+
+
+ @GetMapping("/listPatientReportMeals")
+ public TableDataInfo listPatientReportMeals(FtReportMealsDao ftReportMealsDao) {
+ startPage();
+ Date createAt = ftReportMealsDao.getCreateAt();
+
+ if (createAt != null) {
+ ftReportMealsDao.setBeginOfDay(createAt);
+ ftReportMealsDao.setEndOfDay(createAt);
+ }
+
+ List list = iFtReportMealsDaoService.listPatientReportMeals(ftReportMealsDao);
+ return getDataTable(list);
+
+ }
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtReturnDaoController.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtReturnDaoController.java
new file mode 100644
index 0000000000000000000000000000000000000000..25cd166bad79c90b47d3a94b6ae6d9965b6292c8
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtReturnDaoController.java
@@ -0,0 +1,165 @@
+package com.ruoyi.system.fantang.controller;
+
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.fantang.domain.FtInvoiceDao;
+import com.ruoyi.system.fantang.domain.FtReturnDao;
+import com.ruoyi.system.fantang.service.IFtInvoiceDaoService;
+import com.ruoyi.system.fantang.service.IFtReturnDaoService;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.math.BigDecimal;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 回款登记Controller
+ *
+ * @author ft
+ * @date 2021-01-25
+ */
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
+@RestController
+@RequestMapping("/fantang/returnManage")
+public class FtReturnDaoController extends BaseController {
+
+ private final IFtReturnDaoService iFtReturnDaoService;
+
+ private final IFtInvoiceDaoService iFtInvoiceDaoService;
+
+ /**
+ * 查询回款登记列表
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:returnManage:list')")
+ @GetMapping("/list")
+ public TableDataInfo list(FtReturnDao ftReturnDao) {
+ startPage();
+ List list = iFtReturnDaoService.queryList(ftReturnDao);
+ return getDataTable(list);
+ }
+
+ /**
+ * 导出回款登记列表
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:returnManage:export')")
+ @Log(title = "回款登记", businessType = BusinessType.EXPORT)
+ @GetMapping("/export")
+ public AjaxResult export(FtReturnDao ftReturnDao) {
+ List list = iFtReturnDaoService.queryList(ftReturnDao);
+ ExcelUtil util = new ExcelUtil(FtReturnDao.class);
+ return util.exportExcel(list, "returnManage");
+ }
+
+ /**
+ * 获取回款登记详细信息
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:returnManage:query')")
+ @GetMapping(value = "/{id}")
+ public AjaxResult getInfo(@PathVariable("id") Long id) {
+ return AjaxResult.success(iFtReturnDaoService.getById(id));
+ }
+
+ /**
+ * 新增回款登记
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:returnManage:add')")
+ @Log(title = "回款登记", businessType = BusinessType.INSERT)
+ @PostMapping
+ public AjaxResult add(@RequestBody FtReturnDao ftReturnDao) {
+ return toAjax(iFtReturnDaoService.save(ftReturnDao) ? 1 : 0);
+ }
+
+ /**
+ * 修改回款登记
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:returnManage:edit')")
+ @Log(title = "回款登记", businessType = BusinessType.UPDATE)
+ @PutMapping
+ public AjaxResult edit(@RequestBody FtReturnDao ftReturnDao) {
+ return toAjax(iFtReturnDaoService.updateById(ftReturnDao) ? 1 : 0);
+ }
+
+ /**
+ * 删除回款登记
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:returnManage:remove')")
+ @Log(title = "回款登记", businessType = BusinessType.DELETE)
+ @DeleteMapping("/{ids}")
+ public AjaxResult remove(@PathVariable Long[] ids) {
+ return toAjax(iFtReturnDaoService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
+ }
+
+ @PostMapping("/addToReturn")
+ public AjaxResult addToReturn(@RequestBody JSONObject params) {
+ System.out.println(params);
+
+ // 回款金额
+ BigDecimal returnPrice = params.getBigDecimal("returnPrice");
+
+ // 开票金额
+ BigDecimal invoiceAmount = params.getBigDecimal("invoiceAmount");
+
+ // 余额
+ BigDecimal nowBalancePrice;
+
+ // 发票 id
+ Long id = params.getLong("id");
+
+ if (returnPrice.compareTo(invoiceAmount) > 0) {
+ return AjaxResult.error("该次回款超出开票金额");
+ }
+
+ // 查找该发票上次的回款记录
+ FtReturnDao lastReturn = iFtReturnDaoService.selectLastReturn(id);
+
+ if (lastReturn == null) {
+ // 余额
+ nowBalancePrice = invoiceAmount.subtract(returnPrice);
+ } else {
+ BigDecimal lastBalancePrice = lastReturn.getBalancePrice();
+ if (lastBalancePrice.compareTo(returnPrice) < 0) {
+ return AjaxResult.error("该次回款超出开票金额");
+ } else {
+ nowBalancePrice = lastBalancePrice.subtract(returnPrice);
+ }
+ }
+
+
+ FtReturnDao ftReturnDao = new FtReturnDao();
+ ftReturnDao.setInvoiceId(id);
+ ftReturnDao.setReturnPrice(returnPrice);
+ ftReturnDao.setVoucherUrl(params.getString("voucherUrl"));
+ ftReturnDao.setReturnAt(new Date());
+ ftReturnDao.setBalancePrice(nowBalancePrice);
+
+ if (nowBalancePrice.compareTo(new BigDecimal(0)) == 0) {
+ FtInvoiceDao ftInvoiceDao = new FtInvoiceDao();
+ ftInvoiceDao.setId(id);
+ ftInvoiceDao.setInvoiceType(1);
+ iFtInvoiceDaoService.updateById(ftInvoiceDao);
+ }
+
+ iFtReturnDaoService.save(ftReturnDao);
+
+ return AjaxResult.success("回款成功");
+ }
+
+ @GetMapping("/getReturnByInvoice/{id}")
+ public TableDataInfo getReturnByInvoice(@PathVariable Long id) {
+ startPage();
+ QueryWrapper wrapper = new QueryWrapper<>();
+ wrapper.eq("invoice_id", id);
+ List list = iFtReturnDaoService.list(wrapper);
+ return getDataTable(list);
+ }
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtSettleDaoController.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtSettleDaoController.java
new file mode 100644
index 0000000000000000000000000000000000000000..2a53a85fd1b77a4f73748b7259f9bf119844cb41
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtSettleDaoController.java
@@ -0,0 +1,289 @@
+package com.ruoyi.system.fantang.controller;
+
+import cn.hutool.core.date.DateUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.fantang.domain.FtPrepaymentDao;
+import com.ruoyi.system.fantang.domain.FtReportMealsDao;
+import com.ruoyi.system.fantang.domain.FtSettleDao;
+import com.ruoyi.system.fantang.entity.ReportMealsPriceEntity;
+import com.ruoyi.system.fantang.entity.SettleEntity;
+import com.ruoyi.system.fantang.service.IFtInvoiceDaoService;
+import com.ruoyi.system.fantang.service.IFtPrepaymentDaoService;
+import com.ruoyi.system.fantang.service.IFtReportMealsDaoService;
+import com.ruoyi.system.fantang.service.IFtSettleDaoService;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+/**
+ * 结算报Controller
+ *
+ * @author ft
+ * @date 2020-11-19
+ */
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
+@RestController
+@RequestMapping("/fantang/settle")
+public class FtSettleDaoController extends BaseController {
+
+ private final IFtSettleDaoService iFtSettleDaoService;
+
+ private final IFtReportMealsDaoService iFtReportMealsDaoService;
+
+ private final IFtPrepaymentDaoService iFtPrepaymentDaoService;
+
+ private final IFtInvoiceDaoService iFtInvoiceDaoService;
+
+
+ /**
+ * 显示报餐信息,包含日期,正餐与营养餐的总价格
+ */
+ @PostMapping("/showMealsWithSelect")
+ public AjaxResult showMealsWithSelect(@RequestBody SettleEntity settlement) {
+
+ // 病人 id
+ Long patientId = settlement.getPatientId();
+
+ // 上次结算 / 用餐日期
+ Date lastBillingDate = settlement.getLastBillingDate();
+
+ // 用户选择结算日期
+ Date selectBillingDate = settlement.getSelectBillingDate();
+
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+
+ // 根据病人 id ,上次结算日期,选择日期查询病人非营养餐记录
+ QueryWrapper reportMealsWrapper = new QueryWrapper<>();
+ reportMealsWrapper
+ .eq("patient_id", patientId)
+ .eq("dining_flag",1)
+ .between("dining_at", sdf.format(lastBillingDate), DateUtil.endOfDay(selectBillingDate));
+ Integer pageNum = settlement.getPageNum();
+ Integer pageSize = settlement.getPageSize();
+ IPage reportMealsList = iFtReportMealsDaoService.listPage(reportMealsWrapper, pageNum, pageSize);
+
+ ReportMealsPriceEntity reportMealsPrice = iFtReportMealsDaoService.sumTotalPrice(patientId, DateUtil.beginOfDay(lastBillingDate), DateUtil.endOfDay(selectBillingDate));
+
+ Map data = new HashMap<>(2);
+ data.put("reportMealsList", reportMealsList);
+ data.put("reportMealsPrice", reportMealsPrice);
+
+ return AjaxResult.success(data);
+ }
+
+ @GetMapping("/showAllMealsWithNoPay")
+ public AjaxResult showAllMealsWithNoPay(@RequestParam("patientId") Long patientId, @RequestParam("pageNum") Integer pageNum,@RequestParam("pageSize") Integer pageSize) {
+
+ // 查找该病人所有已用餐未结算记录
+ QueryWrapper wrapper = new QueryWrapper<>();
+ wrapper.eq("patient_id", patientId);
+ wrapper.eq("dining_flag",1);
+ wrapper.eq("settlement_flag",0);
+
+ IPage reportMealsList = iFtReportMealsDaoService.listPage(wrapper, pageNum, pageSize);
+ ReportMealsPriceEntity reportMealsPrice = iFtReportMealsDaoService.sumAllTotalPrice(patientId);
+
+ Map data = new HashMap<>(2);
+ data.put("reportMealsList", reportMealsList);
+ data.put("reportMealsPrice", reportMealsPrice);
+
+ return AjaxResult.success(data);
+ }
+
+ /**
+ * 新增结算报
+ */
+ @PostMapping("/addSettle")
+ public AjaxResult addSettle(@RequestBody SettleEntity settlement) {
+
+ // 病人 id
+ Long patientId = settlement.getPatientId();
+
+ // 上次结算 / 用餐日期
+ Date lastBillingDate = settlement.getLastBillingDate();
+
+ // 用户选择结算日期
+ Date selectBillingDate = settlement.getSelectBillingDate();
+
+ // 应收
+ BigDecimal sumTotalPrice = settlement.getSumTotalPrice();
+
+ // 实收
+ BigDecimal netPeceipt = settlement.getNetPeceipt();
+
+ // 操作用户
+ String userName = settlement.getUserName();
+
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+
+ // 添加结算记录
+ FtSettleDao ftSettleDao = new FtSettleDao();
+ ftSettleDao.setReceipts(netPeceipt);
+ ftSettleDao.setPatientId(patientId);
+ Date nowDate = new Date();
+ ftSettleDao.setSettleAt(nowDate);
+ ftSettleDao.setOpera(userName);
+ ftSettleDao.setPayable(sumTotalPrice);
+ ftSettleDao.setReceipts(netPeceipt);
+
+ //支付方式
+ switch (settlement.getPayType()) {
+ case 1:
+ ftSettleDao.setType("现金");
+ break;
+
+ case 2:
+ // 根据病人 id 查询预付费记录
+ QueryWrapper prepaymentWrapper = new QueryWrapper<>();
+ prepaymentWrapper.eq("patient_id", patientId);
+ FtPrepaymentDao prepaymentDao = iFtPrepaymentDaoService.getOne(prepaymentWrapper);
+
+ // 预付费扣费
+ BigDecimal prepaid = prepaymentDao.getPrepaid();
+ BigDecimal balance = prepaid.subtract(netPeceipt);
+ prepaymentDao.setPrepaid(balance);
+ iFtPrepaymentDaoService.updateById(prepaymentDao);
+
+ ftSettleDao.setType("预付款冲减");
+ break;
+
+ case 3:
+ ftSettleDao.setType("在线支付");
+ break;
+ case 4 :
+ ftSettleDao.setType("银行汇款");
+ break;
+ case 5:
+ ftSettleDao.setType("挂账");
+ break;
+
+ default:
+ }
+
+
+ iFtSettleDaoService.save(ftSettleDao);
+
+ // 修改报餐信息
+ UpdateWrapper reportMealsWrapper = new UpdateWrapper<>();
+ reportMealsWrapper.eq("patient_id", patientId);
+ reportMealsWrapper.between("create_at", sdf.format(lastBillingDate), sdf.format(selectBillingDate));
+ FtReportMealsDao reportMealsDao = new FtReportMealsDao();
+ reportMealsDao.setSettlementFlag(1);
+ reportMealsDao.setSettlementAt(nowDate);
+ reportMealsDao.setSettlementBy(userName);
+ reportMealsDao.setSettlementId(ftSettleDao.getSettleId());
+ iFtReportMealsDaoService.update(reportMealsDao, reportMealsWrapper);
+
+ return AjaxResult.success("已收费");
+ }
+
+ /**
+ * 查询结算报列表
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:settle:list')")
+ @GetMapping("/list")
+ public TableDataInfo list(FtSettleDao ftSettleDao) {
+ startPage();
+ LambdaQueryWrapper lqw = Wrappers.lambdaQuery(ftSettleDao);
+ if (ftSettleDao.getSettleAt() != null) {
+ lqw.eq(FtSettleDao::getSettleAt, ftSettleDao.getSettleAt());
+ }
+ if (ftSettleDao.getPrice() != null) {
+ lqw.eq(FtSettleDao::getPrice, ftSettleDao.getPrice());
+ }
+ if (ftSettleDao.getPayable() != null) {
+ lqw.eq(FtSettleDao::getPayable, ftSettleDao.getPayable());
+ }
+ if (ftSettleDao.getReceipts() != null) {
+ lqw.eq(FtSettleDao::getReceipts, ftSettleDao.getReceipts());
+ }
+ if (StringUtils.isNotBlank(ftSettleDao.getType())) {
+ lqw.eq(FtSettleDao::getType, ftSettleDao.getType());
+ }
+ if (ftSettleDao.getRefund() != null) {
+ lqw.eq(FtSettleDao::getRefund, ftSettleDao.getRefund());
+ }
+ List list = iFtSettleDaoService.list(lqw);
+ return getDataTable(list);
+ }
+
+ /**
+ * 导出结算报列表
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:settle:export')")
+ @Log(title = "结算报", businessType = BusinessType.EXPORT)
+ @GetMapping("/export")
+ public AjaxResult export(FtSettleDao ftSettleDao) {
+ LambdaQueryWrapper lqw = new LambdaQueryWrapper(ftSettleDao);
+ List list = iFtSettleDaoService.list(lqw);
+ ExcelUtil util = new ExcelUtil(FtSettleDao.class);
+ return util.exportExcel(list, "settle");
+ }
+
+ /**
+ * 获取结算报详细信息
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:settle:query')")
+ @GetMapping(value = "/{settleId}")
+ public AjaxResult getInfo(@PathVariable("settleId") Long settleId) {
+ return AjaxResult.success(iFtSettleDaoService.getById(settleId));
+ }
+
+ /**
+ * 新增结算报
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:settle:add')")
+ @Log(title = "结算报", businessType = BusinessType.INSERT)
+ @PostMapping
+ public AjaxResult add(@RequestBody FtSettleDao ftSettleDao) {
+ ftSettleDao.setSettleAt(new Date());
+ ftSettleDao.setReceipts(ftSettleDao.getNetPeceipt());
+
+ Long patientId = ftSettleDao.getPatientId();
+ Date lastBillingDate = ftSettleDao.getLastBillingDate();
+ Date selectBillingDate = ftSettleDao.getSelectBillingDate();
+ iFtSettleDaoService.save(ftSettleDao);
+ Long settlementId = ftSettleDao.getSettleId();
+ SimpleDateFormat ft = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
+ iFtReportMealsDaoService.settleMeals(settlementId, patientId, ft.format(lastBillingDate), ft.format(selectBillingDate));
+ iFtSettleDaoService.updateList(settlementId, patientId, ft.format(lastBillingDate), ft.format(selectBillingDate));
+
+ return AjaxResult.success("结算成功");
+ }
+
+ /**
+ * 修改结算报
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:settle:edit')")
+ @Log(title = "结算报", businessType = BusinessType.UPDATE)
+ @PutMapping
+ public AjaxResult edit(@RequestBody FtSettleDao ftSettleDao) {
+ return toAjax(iFtSettleDaoService.updateById(ftSettleDao) ? 1 : 0);
+ }
+
+ /**
+ * 删除结算报
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:settle:remove')")
+ @Log(title = "结算报", businessType = BusinessType.DELETE)
+ @DeleteMapping("/{settleIds}")
+ public AjaxResult remove(@PathVariable Long[] settleIds) {
+ return toAjax(iFtSettleDaoService.removeByIds(Arrays.asList(settleIds)) ? 1 : 0);
+ }
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtSettlementDaoController.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtSettlementDaoController.java
new file mode 100644
index 0000000000000000000000000000000000000000..b3a142e83400ade48e5eef06988593c0e4312b61
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtSettlementDaoController.java
@@ -0,0 +1,98 @@
+package com.ruoyi.system.fantang.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.fantang.domain.FtSettleDao;
+import com.ruoyi.system.fantang.domain.FtSettlementDao;
+import com.ruoyi.system.fantang.service.IFtSettlementDaoService;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 结算管理Controller
+ *
+ * @author ft
+ * @date 2020-12-25
+ */
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
+@RestController
+@RequestMapping("/fantang/settlement")
+public class FtSettlementDaoController extends BaseController {
+
+ private final IFtSettlementDaoService iFtSettlementDaoService;
+
+ /**
+ * 查询结算管理列表
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:settlement:list')")
+ @GetMapping("/list")
+ public TableDataInfo list(FtSettlementDao ftSettlementDao) {
+ startPage();
+ List list = iFtSettlementDaoService.listWithPatient(ftSettlementDao);
+ return getDataTable(list);
+ }
+
+ /**
+ * 导出结算管理列表
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:settlement:export')")
+ @Log(title = "结算管理", businessType = BusinessType.EXPORT)
+ @GetMapping("/export")
+ public AjaxResult export(FtSettlementDao ftSettlementDao) {
+ LambdaQueryWrapper lqw = new LambdaQueryWrapper(ftSettlementDao);
+ List list = iFtSettlementDaoService.list(lqw);
+ ExcelUtil util = new ExcelUtil(FtSettlementDao.class);
+ return util.exportExcel(list, "settlement");
+ }
+
+ /**
+ * 获取结算管理详细信息
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:settlement:query')")
+ @GetMapping(value = "/{settleId}")
+ public AjaxResult getInfo(@PathVariable("settleId") Long settleId) {
+ return AjaxResult.success(iFtSettlementDaoService.getById(settleId));
+ }
+
+ /**
+ * 新增结算管理
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:settlement:add')")
+ @Log(title = "结算管理", businessType = BusinessType.INSERT)
+ @PostMapping
+ public AjaxResult add(@RequestBody FtSettlementDao ftSettlementDao) {
+ return toAjax(iFtSettlementDaoService.save(ftSettlementDao) ? 1 : 0);
+ }
+
+ /**
+ * 修改结算管理
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:settlement:edit')")
+ @Log(title = "结算管理", businessType = BusinessType.UPDATE)
+ @PutMapping
+ public AjaxResult edit(@RequestBody FtSettlementDao ftSettlementDao) {
+ return toAjax(iFtSettlementDaoService.updateById(ftSettlementDao) ? 1 : 0);
+ }
+
+ /**
+ * 删除结算管理
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:settlement:remove')")
+ @Log(title = "结算管理", businessType = BusinessType.DELETE)
+ @DeleteMapping("/{settleIds}")
+ public AjaxResult remove(@PathVariable Long[] settleIds) {
+ return toAjax(iFtSettlementDaoService.removeByIds(Arrays.asList(settleIds)) ? 1 : 0);
+ }
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtStaffDemandDaoController.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtStaffDemandDaoController.java
new file mode 100644
index 0000000000000000000000000000000000000000..73dd2ff3d87697000ba1e58284cfa593fa7be621
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtStaffDemandDaoController.java
@@ -0,0 +1,130 @@
+package com.ruoyi.system.fantang.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.fantang.domain.FtStaffDemandDao;
+import com.ruoyi.system.fantang.service.IFtConfigDaoService;
+import com.ruoyi.system.fantang.service.IFtStaffDemandDaoService;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 员工报餐Controller
+ *
+ * @author ft
+ * @date 2020-12-07
+ */
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
+@RestController
+@RequestMapping("/fantang/staffDemand")
+public class FtStaffDemandDaoController extends BaseController {
+
+ private final IFtStaffDemandDaoService iFtStaffDemandDaoService;
+
+ private final IFtConfigDaoService iFtConfigDaoService;
+
+
+
+ /**
+ * 查询员工报餐列表
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:staffDemand:list')")
+ @GetMapping("/list")
+ public TableDataInfo list(FtStaffDemandDao ftStaffDemandDao) {
+ startPage();
+ LambdaQueryWrapper lqw = Wrappers.lambdaQuery(ftStaffDemandDao);
+ if (ftStaffDemandDao.getStaffId() != null) {
+ lqw.eq(FtStaffDemandDao::getStaffId, ftStaffDemandDao.getStaffId());
+ }
+ if (StringUtils.isNotBlank(ftStaffDemandDao.getFoods())) {
+ lqw.eq(FtStaffDemandDao::getFoods, ftStaffDemandDao.getFoods());
+ }
+ if (ftStaffDemandDao.getType() != null) {
+ lqw.eq(FtStaffDemandDao::getType, ftStaffDemandDao.getType());
+ }
+ if (ftStaffDemandDao.getCreateAt() != null) {
+ lqw.eq(FtStaffDemandDao::getCreateAt, ftStaffDemandDao.getCreateAt());
+ }
+ if (ftStaffDemandDao.getUpdateAt() != null) {
+ lqw.eq(FtStaffDemandDao::getUpdateAt, ftStaffDemandDao.getUpdateAt());
+ }
+ if (ftStaffDemandDao.getUpdateFrom() != null) {
+ lqw.eq(FtStaffDemandDao::getUpdateFrom, ftStaffDemandDao.getUpdateFrom());
+ }
+ if (StringUtils.isNotBlank(ftStaffDemandDao.getOrderInfo())) {
+ lqw.eq(FtStaffDemandDao::getOrderInfo, ftStaffDemandDao.getOrderInfo());
+ }
+ if (ftStaffDemandDao.getDemandMode() != null) {
+ lqw.eq(FtStaffDemandDao::getDemandMode, ftStaffDemandDao.getDemandMode());
+ }
+ if (ftStaffDemandDao.getStopFlag() != null) {
+ lqw.eq(FtStaffDemandDao::getStopFlag, ftStaffDemandDao.getStopFlag());
+ }
+ List list = iFtStaffDemandDaoService.list(lqw);
+ return getDataTable(list);
+ }
+
+ /**
+ * 导出员工报餐列表
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:staffDemand:export')")
+ @Log(title = "员工报餐", businessType = BusinessType.EXPORT)
+ @GetMapping("/export")
+ public AjaxResult export(FtStaffDemandDao ftStaffDemandDao) {
+ LambdaQueryWrapper lqw = new LambdaQueryWrapper(ftStaffDemandDao);
+ List list = iFtStaffDemandDaoService.list(lqw);
+ ExcelUtil util = new ExcelUtil(FtStaffDemandDao.class);
+ return util.exportExcel(list, "staffDemand");
+ }
+
+ /**
+ * 获取员工报餐详细信息
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:staffDemand:query')")
+ @GetMapping(value = "/{id}")
+ public AjaxResult getInfo(@PathVariable("id") Long id) {
+ return AjaxResult.success(iFtStaffDemandDaoService.getById(id));
+ }
+
+ /**
+ * 新增员工报餐
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:staffDemand:add')")
+ @Log(title = "员工报餐", businessType = BusinessType.INSERT)
+ @PostMapping
+ public AjaxResult add(@RequestBody FtStaffDemandDao ftStaffDemandDao) {
+ return toAjax(iFtStaffDemandDaoService.save(ftStaffDemandDao) ? 1 : 0);
+ }
+
+ /**
+ * 修改员工报餐
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:staffDemand:edit')")
+ @Log(title = "员工报餐", businessType = BusinessType.UPDATE)
+ @PutMapping
+ public AjaxResult edit(@RequestBody FtStaffDemandDao ftStaffDemandDao) {
+ return toAjax(iFtStaffDemandDaoService.updateById(ftStaffDemandDao) ? 1 : 0);
+ }
+
+ /**
+ * 删除员工报餐
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:staffDemand:remove')")
+ @Log(title = "员工报餐", businessType = BusinessType.DELETE)
+ @DeleteMapping("/{ids}")
+ public AjaxResult remove(@PathVariable Long[] ids) {
+ return toAjax(iFtStaffDemandDaoService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
+ }
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtStaffInfoDaoController.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtStaffInfoDaoController.java
new file mode 100644
index 0000000000000000000000000000000000000000..7e02d3ab8075ac5910713ce0a9477c63d0c628d4
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtStaffInfoDaoController.java
@@ -0,0 +1,193 @@
+package com.ruoyi.system.fantang.controller;
+
+import cn.hutool.core.date.DateTime;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.fantang.domain.FtStaffInfoDao;
+import com.ruoyi.system.fantang.service.IFtStaffInfoDaoService;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 员工管理Controller
+ *
+ * @author ft
+ * @date 2020-11-24
+ */
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
+@RestController
+@RequestMapping("/fantang/staffInfo")
+public class FtStaffInfoDaoController extends BaseController {
+
+ private final IFtStaffInfoDaoService iFtStaffInfoDaoService;
+
+ /**
+ * 查询员工管理列表
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:staffInfo:list')")
+ @GetMapping("/staffList")
+ public TableDataInfo staffList(FtStaffInfoDao ftStaffInfoDao) {
+ startPage();
+ LambdaQueryWrapper lqw = Wrappers.lambdaQuery(ftStaffInfoDao);
+ lqw.eq(FtStaffInfoDao::getStaffType, 1);
+ if (StringUtils.isNotBlank(ftStaffInfoDao.getName())) {
+ lqw.like(FtStaffInfoDao::getName, ftStaffInfoDao.getName());
+ }
+ if (StringUtils.isNotBlank(ftStaffInfoDao.getPost())) {
+ lqw.eq(FtStaffInfoDao::getPost, ftStaffInfoDao.getPost());
+ }
+ if (ftStaffInfoDao.getFlag() != null) {
+ lqw.eq(FtStaffInfoDao::getFlag, ftStaffInfoDao.getFlag());
+ }
+ List list = iFtStaffInfoDaoService.list(lqw);
+ return getDataTable(list);
+ }
+
+ @GetMapping("/staffListWithDepart")
+ public TableDataInfo staffListWithDepart(FtStaffInfoDao ftStaffInfoDao) {
+ startPage();
+ return getDataTable(iFtStaffInfoDaoService.selectStaffInfoWithDepart(ftStaffInfoDao));
+ }
+
+ /**
+ * 查询护工管理列表
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:staffInfo:list')")
+ @GetMapping("/careStaffList")
+ public TableDataInfo careStaffList(FtStaffInfoDao ftStaffInfoDao) {
+ startPage();
+ LambdaQueryWrapper lqw = Wrappers.lambdaQuery(ftStaffInfoDao);
+ lqw.eq(FtStaffInfoDao::getStaffType, 2);
+ if (StringUtils.isNotBlank(ftStaffInfoDao.getName())) {
+ lqw.like(FtStaffInfoDao::getName, ftStaffInfoDao.getName());
+ }
+ if (StringUtils.isNotBlank(ftStaffInfoDao.getPost())) {
+ lqw.eq(FtStaffInfoDao::getPost, ftStaffInfoDao.getPost());
+ }
+ List list = iFtStaffInfoDaoService.list(lqw);
+ return getDataTable(list);
+ }
+
+ /**
+ * 导出员工管理列表
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:staffInfo:export')")
+ @Log(title = "员工管理", businessType = BusinessType.EXPORT)
+ @GetMapping("/export")
+ public AjaxResult export(FtStaffInfoDao ftStaffInfoDao) {
+ LambdaQueryWrapper lqw = new LambdaQueryWrapper(ftStaffInfoDao);
+ List list = iFtStaffInfoDaoService.list(lqw);
+ ExcelUtil util = new ExcelUtil(FtStaffInfoDao.class);
+ return util.exportExcel(list, "staffInfo");
+ }
+
+ /**
+ * 获取员工管理详细信息
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:staffInfo:query')")
+ @GetMapping(value = "/nursing/{staffId}")
+ public AjaxResult getNursingInfo(@PathVariable("staffId") Long staffId) {
+ return AjaxResult.success(iFtStaffInfoDaoService.getById(staffId));
+ }
+
+ /**
+ * 获取护工管理详细信息
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:staffInfo:query')")
+ @GetMapping(value = "/{staffId}")
+ public AjaxResult getInfo(@PathVariable("staffId") Long staffId) {
+ return AjaxResult.success(iFtStaffInfoDaoService.getById(staffId));
+ }
+
+
+ /**
+ * 新增员工管理
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:staffInfo:add')")
+ @Log(title = "员工管理", businessType = BusinessType.INSERT)
+ @PostMapping
+ public AjaxResult add(@RequestBody FtStaffInfoDao ftStaffInfoDao) {
+
+ List list = iFtStaffInfoDaoService.list(null);
+ for (FtStaffInfoDao staffInfoDao : list) {
+ if (ftStaffInfoDao.getTel() != null && ftStaffInfoDao.getTel().equals(staffInfoDao.getTel())) {
+ return AjaxResult.error("该电话号码已存在");
+ }
+ }
+
+ // 判断是否有所属公司
+ if (ftStaffInfoDao.getCorpName() == null) {
+ ftStaffInfoDao.setStaffType(1L);
+ } else {
+ ftStaffInfoDao.setStaffType(2L);
+ }
+
+ // 判断密码是否为空
+ if (ftStaffInfoDao.getPassword() == null || "".equals(ftStaffInfoDao.getPassword())) {
+ ftStaffInfoDao.setPassword("123456");
+ }
+
+ ftStaffInfoDao.setCreateAt(new Date());
+ ftStaffInfoDao.setDeptList(ftStaffInfoDao.getDeptList());
+
+ iFtStaffInfoDaoService.save(ftStaffInfoDao);
+
+ return AjaxResult.success("添加成功");
+ }
+
+ /**
+ * 修改员工管理
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:staffInfo:edit')")
+ @Log(title = "员工管理", businessType = BusinessType.UPDATE)
+ @PutMapping
+ public AjaxResult edit(@RequestBody FtStaffInfoDao ftStaffInfoDao) {
+ return toAjax(iFtStaffInfoDaoService.updateById(ftStaffInfoDao) ? 1 : 0);
+ }
+
+
+ /**
+ * 修改护工管理
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:staffInfo:edit')")
+ @Log(title = "护工管理", businessType = BusinessType.UPDATE)
+ @PutMapping("/nursing")
+ public AjaxResult nursingEdit(@RequestBody JSONObject param) {
+ FtStaffInfoDao dao = new FtStaffInfoDao();
+ dao.setPassword(param.getString("password"));
+ dao.setTel(param.getString("tel"));
+ dao.setStaffId(param.getLong("staffId"));
+ dao.setCorpName(param.getString("corpName"));
+ dao.setCreateAt(new DateTime());
+ dao.setSex(param.getInteger("sex"));
+ dao.setDeptList(param.getString("deptList"));
+ dao.setStaffType(param.getLong("staffType"));
+ dao.setName(param.getString("name"));
+ return toAjax(iFtStaffInfoDaoService.updateById(dao) ? 1 : 0);
+ }
+
+
+ /**
+ * 删除员工管理
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:staffInfo:remove')")
+ @Log(title = "员工管理", businessType = BusinessType.DELETE)
+ @DeleteMapping("/{staffIds}")
+ public AjaxResult remove(@PathVariable Long[] staffIds) {
+ return toAjax(iFtStaffInfoDaoService.removeByIds(Arrays.asList(staffIds)) ? 1 : 0);
+ }
+}
\ No newline at end of file
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtStaffSubsidyDaoController.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtStaffSubsidyDaoController.java
new file mode 100644
index 0000000000000000000000000000000000000000..a35e7f03c96f3cca0f6533b76e8c8865f380698a
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtStaffSubsidyDaoController.java
@@ -0,0 +1,191 @@
+package com.ruoyi.system.fantang.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.fantang.domain.*;
+import com.ruoyi.system.fantang.mapper.FtStaffInfoDaoMapper;
+import com.ruoyi.system.fantang.service.IFtConfigDaoService;
+import com.ruoyi.system.fantang.service.IFtStaffInfoDaoService;
+import com.ruoyi.system.fantang.service.IFtStaffSubsidyDaoService;
+import com.ruoyi.system.fantang.vo.FtStaffSubsidyVo;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.math.BigDecimal;
+import java.util.*;
+
+/**
+ * 补贴流水查看Controller
+ *
+ * @author ft
+ * @date 2020-11-19
+ */
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
+@RestController
+@RequestMapping("/fantang/staffSubsidy")
+public class FtStaffSubsidyDaoController extends BaseController {
+
+ private final IFtStaffSubsidyDaoService iFtStaffSubsidyDaoService;
+
+ private final IFtStaffInfoDaoService staffInfoDaoService;
+
+ private final IFtConfigDaoService configDaoService;
+
+ /**
+ * 查询补贴流水查看列表
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:staffSubsidy:list')")
+ @GetMapping("/list")
+ public TableDataInfo list(FtStaffSubsidyDao ftStaffSubsidyDao) {
+ startPage();
+ LambdaQueryWrapper lqw = Wrappers.lambdaQuery(ftStaffSubsidyDao);
+ if (StringUtils.isNotBlank(ftStaffSubsidyDao.getSubsidyType())) {
+ lqw.eq(FtStaffSubsidyDao::getSubsidyType, ftStaffSubsidyDao.getSubsidyType());
+ }
+ if (ftStaffSubsidyDao.getIncomeType() != null) {
+ lqw.eq(FtStaffSubsidyDao::getIncomeType, ftStaffSubsidyDao.getIncomeType());
+ }
+ if (ftStaffSubsidyDao.getPrice() != null) {
+ lqw.eq(FtStaffSubsidyDao::getPrice, ftStaffSubsidyDao.getPrice());
+ }
+ if (ftStaffSubsidyDao.getConsumAt() != null) {
+ lqw.eq(FtStaffSubsidyDao::getConsumAt, ftStaffSubsidyDao.getConsumAt());
+ }
+ List list = iFtStaffSubsidyDaoService.list(lqw);
+ return getDataTable(list);
+ }
+
+ /**
+ * 导出补贴流水查看列表
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:staffSubsidy:export')")
+ @Log(title = "补贴流水查看", businessType = BusinessType.EXPORT)
+ @GetMapping("/export")
+ public AjaxResult export(FtStaffSubsidyDao ftStaffSubsidyDao) {
+ LambdaQueryWrapper lqw = new LambdaQueryWrapper(ftStaffSubsidyDao);
+ List list = iFtStaffSubsidyDaoService.list(lqw);
+ ExcelUtil util = new ExcelUtil(FtStaffSubsidyDao.class);
+ return util.exportExcel(list, "staffSubsidy");
+ }
+
+ /**
+ * 获取补贴流水查看详细信息
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:staffSubsidy:query')")
+ @GetMapping(value = "/{subsidyId}")
+ public AjaxResult getInfo(@PathVariable("subsidyId") Long subsidyId) {
+ return AjaxResult.success(iFtStaffSubsidyDaoService.getById(subsidyId));
+ }
+
+ /**
+ * 新增补贴流水查看
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:staffSubsidy:add')")
+ @Log(title = "补贴流水查看", businessType = BusinessType.INSERT)
+ @PostMapping
+ public AjaxResult add(@RequestBody FtStaffSubsidyDao ftStaffSubsidyDao) {
+ return toAjax(iFtStaffSubsidyDaoService.save(ftStaffSubsidyDao) ? 1 : 0);
+ }
+
+ /**
+ * 修改补贴流水查看
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:staffSubsidy:edit')")
+ @Log(title = "补贴流水查看", businessType = BusinessType.UPDATE)
+ @PutMapping
+ public AjaxResult edit(@RequestBody FtStaffSubsidyDao ftStaffSubsidyDao) {
+ return toAjax(iFtStaffSubsidyDaoService.updateById(ftStaffSubsidyDao) ? 1 : 0);
+ }
+
+ /**
+ * 删除补贴流水查看
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:staffSubsidy:remove')")
+ @Log(title = "补贴流水查看", businessType = BusinessType.DELETE)
+ @DeleteMapping("/{subsidyIds}")
+ public AjaxResult remove(@PathVariable Long[] subsidyIds) {
+ return toAjax(iFtStaffSubsidyDaoService.removeByIds(Arrays.asList(subsidyIds)) ? 1 : 0);
+ }
+
+ /**
+ * 发放员工补贴
+ */
+ @PostMapping("/submitGiveOutSubsidy")
+ public AjaxResult submitGiveOutSubsidy(@RequestBody FtStaffSubsidyVo ftStaffSubsidyVo) {
+
+ FtSubsidyDao subsidy = ftStaffSubsidyVo.getSubsidy();
+ List noGiveoutList = ftStaffSubsidyVo.getNoGiveoutList();
+ Date giveOutDate = ftStaffSubsidyVo.getGiveOutDate();
+ QueryWrapper wrapper = new QueryWrapper<>();
+ wrapper.notIn("staff_id", noGiveoutList);
+ List staffData = staffInfoDaoService.list(wrapper);
+
+ List ftStaffSubsidyDaoList = new ArrayList<>();
+
+ for (FtStaffInfoDao staffDatum : staffData) {
+ if (staffDatum.getGiveOutFlag()) {
+ FtStaffSubsidyDao ftStaffSubsidyDao = new FtStaffSubsidyDao();
+ ftStaffSubsidyDao.setStaffId(staffDatum.getStaffId());
+ ftStaffSubsidyDao.setSubsidyType(subsidy.getType());
+ ftStaffSubsidyDao.setIncomeType(1);
+ ftStaffSubsidyDao.setPrice(subsidy.getPrice());
+ ftStaffSubsidyDao.setConsumAt(giveOutDate);
+ ftStaffSubsidyDaoList.add(ftStaffSubsidyDao);
+ }
+ }
+
+ Integer ret = iFtStaffSubsidyDaoService.insertBatchStaffSubsidy(ftStaffSubsidyDaoList);
+ logger.info("发放补贴:{} 人", ret);
+
+ StringBuilder builder = new StringBuilder();
+ builder.append(String.format("本次发放合计:%d 人;", ret));
+
+ // 统计发放补贴后,有多少人的补贴超过了设置的上限150元;
+ // 1 先去应用数据配置表中找到该企业配置的最大补贴上限
+ QueryWrapper wrapper1 = new QueryWrapper<>();
+ wrapper1
+ .eq("config_key", "max_subsidy")
+ .eq("corp_id", 1);
+ List list = configDaoService.list(wrapper1);
+ if (list.size() <= 0 ) {
+ logger.error("获取系统配置的最大补贴数据失败!");
+ return AjaxResult.error("获取系统配置的最大补贴数据失败!");
+ }
+ FtConfigDao configDao = list.get(0);
+ Integer maxSubsidy = Integer.parseInt(configDao.getConfigValue());
+
+ // 2 去员工信息表中统计余额信息超过 最大补贴数的信息
+ QueryWrapper wrapper2 = new QueryWrapper<>();
+ wrapper2.gt("balance", 150);
+ int overflowCount = staffInfoDaoService.count(wrapper2);
+ builder.append(String.format("本次统计超出余额上限员工合计:%d", overflowCount));
+
+ if (overflowCount <= 0) {
+ builder.append(String.format("本次补贴发放没有累计余额超出上限员工"));
+ return AjaxResult.success(builder);
+ }
+
+ // 3 如果有超过的余额的,进行余额冲减操作
+ iFtStaffSubsidyDaoService.reBalance(subsidy.getType(), maxSubsidy);
+
+ // 4 更新员工表的余额信息,超过 最大数的全部冲减
+ UpdateWrapper updateWrapper=new UpdateWrapper<>();
+ FtStaffInfoDao staffInfoDao = new FtStaffInfoDao();
+ staffInfoDao.setBalance(BigDecimal.valueOf(maxSubsidy));
+ updateWrapper.gt("balance", maxSubsidy);
+ staffInfoDaoService.update(staffInfoDao, updateWrapper);
+ builder.append(String.format("本次超出余额上限员工全部进行冲减,请查看日志"));
+ return AjaxResult.success(builder);
+ }
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtSubsidyDaoController.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtSubsidyDaoController.java
new file mode 100644
index 0000000000000000000000000000000000000000..1c46f4064a04ba19f56064cadd5fad53ec19a915
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtSubsidyDaoController.java
@@ -0,0 +1,122 @@
+package com.ruoyi.system.fantang.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Arrays;
+
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.ruoyi.common.utils.StringUtils;
+import lombok.RequiredArgsConstructor;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.system.fantang.domain.FtSubsidyDao;
+import com.ruoyi.system.fantang.service.IFtSubsidyDaoService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 补贴管理Controller
+ *
+ * @author ft
+ * @date 2020-11-25
+ */
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
+@RestController
+@RequestMapping("/fantang/subsidy" )
+public class FtSubsidyDaoController extends BaseController {
+
+ private final IFtSubsidyDaoService iFtSubsidyDaoService;
+
+ /**
+ * 查询补贴管理列表
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:subsidy:list')")
+ @GetMapping("/list")
+ public TableDataInfo list(FtSubsidyDao ftSubsidyDao)
+ {
+ startPage();
+ LambdaQueryWrapper lqw = Wrappers.lambdaQuery(ftSubsidyDao);
+ if (StringUtils.isNotBlank(ftSubsidyDao.getType())){
+ lqw.eq(FtSubsidyDao::getType ,ftSubsidyDao.getType());
+ }
+ if (ftSubsidyDao.getPrice() != null){
+ lqw.eq(FtSubsidyDao::getPrice ,ftSubsidyDao.getPrice());
+ }
+ if (ftSubsidyDao.getCreateAt() != null){
+ lqw.eq(FtSubsidyDao::getCreateAt ,ftSubsidyDao.getCreateAt());
+ }
+ if (StringUtils.isNotBlank(ftSubsidyDao.getCreateBy())){
+ lqw.eq(FtSubsidyDao::getCreateBy ,ftSubsidyDao.getCreateBy());
+ }
+ List list = iFtSubsidyDaoService.list(lqw);
+ return getDataTable(list);
+ }
+
+ /**
+ * 导出补贴管理列表
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:subsidy:export')" )
+ @Log(title = "补贴管理" , businessType = BusinessType.EXPORT)
+ @GetMapping("/export" )
+ public AjaxResult export(FtSubsidyDao ftSubsidyDao) {
+ LambdaQueryWrapper lqw = new LambdaQueryWrapper(ftSubsidyDao);
+ List list = iFtSubsidyDaoService.list(lqw);
+ ExcelUtil util = new ExcelUtil(FtSubsidyDao. class);
+ return util.exportExcel(list, "subsidy" );
+ }
+
+ /**
+ * 获取补贴管理详细信息
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:subsidy:query')" )
+ @GetMapping(value = "/{subsidyId}" )
+ public AjaxResult getInfo(@PathVariable("subsidyId" ) Long subsidyId) {
+ return AjaxResult.success(iFtSubsidyDaoService.getById(subsidyId));
+ }
+
+ /**
+ * 新增补贴管理
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:subsidy:add')" )
+ @Log(title = "补贴管理" , businessType = BusinessType.INSERT)
+ @PostMapping
+ public AjaxResult add(@RequestBody FtSubsidyDao ftSubsidyDao) {
+
+ ftSubsidyDao.setCreateAt(new Date());
+ return toAjax(iFtSubsidyDaoService.save(ftSubsidyDao) ? 1 : 0);
+ }
+
+ /**
+ * 修改补贴管理
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:subsidy:edit')" )
+ @Log(title = "补贴管理" , businessType = BusinessType.UPDATE)
+ @PutMapping
+ public AjaxResult edit(@RequestBody FtSubsidyDao ftSubsidyDao) {
+ return toAjax(iFtSubsidyDaoService.updateById(ftSubsidyDao) ? 1 : 0);
+ }
+
+ /**
+ * 删除补贴管理
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:subsidy:remove')" )
+ @Log(title = "补贴管理" , businessType = BusinessType.DELETE)
+ @DeleteMapping("/{subsidyIds}" )
+ public AjaxResult remove(@PathVariable Long[] subsidyIds) {
+ return toAjax(iFtSubsidyDaoService.removeByIds(Arrays.asList(subsidyIds)) ? 1 : 0);
+ }
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtSyncConflictGenDaoController.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtSyncConflictGenDaoController.java
new file mode 100644
index 0000000000000000000000000000000000000000..276688f0e0339f53f853d38278b1d8202197a2c3
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtSyncConflictGenDaoController.java
@@ -0,0 +1,167 @@
+package com.ruoyi.system.fantang.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.fantang.domain.FtPatientDao;
+import com.ruoyi.system.fantang.domain.FtSyncConflictGenDao;
+import com.ruoyi.system.fantang.service.IFtPatientDaoService;
+import com.ruoyi.system.fantang.service.IFtSyncConflictGenDaoService;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 同步冲突Controller
+ *
+ * @author ft
+ * @date 2020-12-24
+ */
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
+@RestController
+@RequestMapping("/fantang/syncConflict")
+public class FtSyncConflictGenDaoController extends BaseController {
+
+ private final IFtSyncConflictGenDaoService iFtSyncConflictGenDaoService;
+
+ private final IFtPatientDaoService iFftPatientDaoService;
+
+
+ /**
+ * 处理冲突
+ */
+ @PostMapping("/solveConflict")
+ public AjaxResult solveConflict(@RequestBody FtSyncConflictGenDao syncConflictGenDao) {
+
+ Integer patientFlag = syncConflictGenDao.getPatientFlag();
+ Long patientId = syncConflictGenDao.getPatientId();
+
+ if (patientFlag==2){
+ if (syncConflictGenDao.getHospitalId().equals(syncConflictGenDao.getOldHospitalId())){
+ FtPatientDao patientDao = iFftPatientDaoService.getById(patientId);
+ patientDao.setDepartId(syncConflictGenDao.getDepartId());
+ patientDao.setBedId(syncConflictGenDao.getBedId());
+ patientDao.setName(syncConflictGenDao.getName());
+ iFftPatientDaoService.updateById(patientDao);
+ }else {
+ FtPatientDao ftPatientDao = new FtPatientDao();
+ ftPatientDao.setDepartId(syncConflictGenDao.getDepartId());
+ ftPatientDao.setBedId(syncConflictGenDao.getBedId());
+ ftPatientDao.setName(syncConflictGenDao.getName());
+ iFftPatientDaoService.save(ftPatientDao);
+ }
+ }
+
+ syncConflictGenDao.setIsSolve(1);
+ iFtSyncConflictGenDaoService.updateById(syncConflictGenDao);
+
+ return AjaxResult.success("已处理");
+ }
+
+ /**
+ * 查询同步冲突列表
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:syncConflict:list')")
+ @GetMapping("/list")
+ public TableDataInfo list(FtSyncConflictGenDao ftSyncConflictGenDao) {
+ startPage();
+ LambdaQueryWrapper lqw = Wrappers.lambdaQuery(ftSyncConflictGenDao);
+ if (StringUtils.isNotBlank(ftSyncConflictGenDao.getHospitalId())) {
+ lqw.eq(FtSyncConflictGenDao::getHospitalId, ftSyncConflictGenDao.getHospitalId());
+ }
+ if (StringUtils.isNotBlank(ftSyncConflictGenDao.getName())) {
+ lqw.like(FtSyncConflictGenDao::getName, ftSyncConflictGenDao.getName());
+ }
+ if (StringUtils.isNotBlank(ftSyncConflictGenDao.getDepartName())) {
+ lqw.like(FtSyncConflictGenDao::getDepartName, ftSyncConflictGenDao.getDepartName());
+ }
+ if (StringUtils.isNotBlank(ftSyncConflictGenDao.getBedId())) {
+ lqw.eq(FtSyncConflictGenDao::getBedId, ftSyncConflictGenDao.getBedId());
+ }
+ if (StringUtils.isNotBlank(ftSyncConflictGenDao.getOldHospitalId())) {
+ lqw.eq(FtSyncConflictGenDao::getOldHospitalId, ftSyncConflictGenDao.getOldHospitalId());
+ }
+ if (StringUtils.isNotBlank(ftSyncConflictGenDao.getOldName())) {
+ lqw.like(FtSyncConflictGenDao::getOldName, ftSyncConflictGenDao.getOldName());
+ }
+ if (StringUtils.isNotBlank(ftSyncConflictGenDao.getOldDepartName())) {
+ lqw.like(FtSyncConflictGenDao::getOldDepartName, ftSyncConflictGenDao.getOldDepartName());
+ }
+ if (StringUtils.isNotBlank(ftSyncConflictGenDao.getOldBedId())) {
+ lqw.eq(FtSyncConflictGenDao::getOldBedId, ftSyncConflictGenDao.getOldBedId());
+ }
+ if (ftSyncConflictGenDao.getDepartId() != null) {
+ lqw.eq(FtSyncConflictGenDao::getDepartId, ftSyncConflictGenDao.getDepartId());
+ }
+ if (ftSyncConflictGenDao.getOldDepartId() != null) {
+ lqw.eq(FtSyncConflictGenDao::getOldDepartId, ftSyncConflictGenDao.getOldDepartId());
+ }
+ if (ftSyncConflictGenDao.getIsSolve()!=null){
+ lqw.eq(FtSyncConflictGenDao::getIsSolve,ftSyncConflictGenDao.getIsSolve());
+ }
+ List list = iFtSyncConflictGenDaoService.list(lqw);
+ return getDataTable(list);
+ }
+
+ /**
+ * 导出同步冲突列表
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:syncConflict:export')")
+ @Log(title = "同步冲突", businessType = BusinessType.EXPORT)
+ @GetMapping("/export")
+ public AjaxResult export(FtSyncConflictGenDao ftSyncConflictGenDao) {
+ LambdaQueryWrapper lqw = new LambdaQueryWrapper(ftSyncConflictGenDao);
+ List list = iFtSyncConflictGenDaoService.list(lqw);
+ ExcelUtil util = new ExcelUtil(FtSyncConflictGenDao.class);
+ return util.exportExcel(list, "syncConflict");
+ }
+
+ /**
+ * 获取同步冲突详细信息
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:syncConflict:query')")
+ @GetMapping(value = "/{id}")
+ public AjaxResult getInfo(@PathVariable("id") Long id) {
+ return AjaxResult.success(iFtSyncConflictGenDaoService.getById(id));
+ }
+
+ /**
+ * 新增同步冲突
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:syncConflict:add')")
+ @Log(title = "同步冲突", businessType = BusinessType.INSERT)
+ @PostMapping
+ public AjaxResult add(@RequestBody FtSyncConflictGenDao ftSyncConflictGenDao) {
+ return toAjax(iFtSyncConflictGenDaoService.save(ftSyncConflictGenDao) ? 1 : 0);
+ }
+
+ /**
+ * 修改同步冲突
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:syncConflict:edit')")
+ @Log(title = "同步冲突", businessType = BusinessType.UPDATE)
+ @PutMapping
+ public AjaxResult edit(@RequestBody FtSyncConflictGenDao ftSyncConflictGenDao) {
+ return toAjax(iFtSyncConflictGenDaoService.updateById(ftSyncConflictGenDao) ? 1 : 0);
+ }
+
+ /**
+ * 删除同步冲突
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:syncConflict:remove')")
+ @Log(title = "同步冲突", businessType = BusinessType.DELETE)
+ @DeleteMapping("/{ids}")
+ public AjaxResult remove(@PathVariable Long[] ids) {
+ return toAjax(iFtSyncConflictGenDaoService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
+ }
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtWeekMenuDaoController.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtWeekMenuDaoController.java
new file mode 100644
index 0000000000000000000000000000000000000000..bf43cbc724008dff369de6ec7c36f93c71c81eb9
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtWeekMenuDaoController.java
@@ -0,0 +1,97 @@
+package com.ruoyi.system.fantang.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.fantang.domain.FtWeekMenuDao;
+import com.ruoyi.system.fantang.service.IFtWeekMenuDaoService;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 每周菜单Controller
+ *
+ * @author ft
+ * @date 2020-11-27
+ */
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
+@RestController
+@RequestMapping("/fantang/weekMenu")
+public class FtWeekMenuDaoController extends BaseController {
+
+ private final IFtWeekMenuDaoService iFtWeekMenuDaoService;
+
+ /**
+ * 查询每周菜单列表
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:weekMenu:list')")
+ @GetMapping("/list")
+ public TableDataInfo list(FtWeekMenuDao ftWeekMenuDao) {
+ startPage();
+ List list = iFtWeekMenuDaoService.list(null);
+ return getDataTable(list);
+ }
+
+ /**
+ * 导出每周菜单列表
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:weekMenu:export')" )
+ @Log(title = "每周菜单" , businessType = BusinessType.EXPORT)
+ @GetMapping("/export" )
+ public AjaxResult export(FtWeekMenuDao ftWeekMenuDao) {
+ LambdaQueryWrapper lqw = new LambdaQueryWrapper(ftWeekMenuDao);
+ List list = iFtWeekMenuDaoService.list(lqw);
+ ExcelUtil util = new ExcelUtil(FtWeekMenuDao. class);
+ return util.exportExcel(list, "weekMenu" );
+ }
+
+ /**
+ * 获取每周菜单详细信息
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:weekMenu:query')")
+ @GetMapping(value = "/{id}")
+ public AjaxResult getInfo(@PathVariable("id") Long id) {
+ return AjaxResult.success(iFtWeekMenuDaoService.getById(id));
+ }
+
+ /**
+ * 新增每周菜单
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:weekMenu:add')")
+ @Log(title = "每周菜单", businessType = BusinessType.INSERT)
+ @PostMapping
+ public AjaxResult add(@RequestBody FtWeekMenuDao ftWeekMenuDao) {
+ return toAjax(iFtWeekMenuDaoService.save(ftWeekMenuDao) ? 1 : 0);
+ }
+
+ /**
+ * 修改每周菜单
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:weekMenu:edit')")
+ @Log(title = "每周菜单", businessType = BusinessType.UPDATE)
+ @PutMapping
+ public AjaxResult edit(@RequestBody FtWeekMenuDao ftWeekMenuDao) {
+ return toAjax(iFtWeekMenuDaoService.updateById(ftWeekMenuDao) ? 1 : 0);
+ }
+
+ /**
+ * 删除每周菜单
+ */
+ @PreAuthorize("@ss.hasPermi('fantang:weekMenu:remove')")
+ @Log(title = "每周菜单", businessType = BusinessType.DELETE)
+ @DeleteMapping("/{ids}")
+ public AjaxResult remove(@PathVariable Long[] ids) {
+ return toAjax(iFtWeekMenuDaoService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
+ }
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtCateringDao.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtCateringDao.java
new file mode 100644
index 0000000000000000000000000000000000000000..dcfdcbe7b507992f17d6ef4e0249e2fe4c848d4b
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtCateringDao.java
@@ -0,0 +1,118 @@
+package com.ruoyi.system.fantang.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.system.fantang.vo.FtCateringVo;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
+import lombok.experimental.Accessors;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 配餐功能对象 ft_catering
+ *
+ * @author ft
+ * @date 2020-12-07
+ */
+@Data
+@ToString
+@EqualsAndHashCode(callSuper = false)
+@NoArgsConstructor
+@Accessors(chain = true)
+@TableName("ft_catering")
+public class FtCateringDao extends FtCateringVo {
+
+ private static final long serialVersionUID = 1L;
+
+
+ /**
+ * id
+ */
+ @TableId(value = "id")
+ private Long id;
+
+ /**
+ * 病人 id
+ */
+ private Long patientId;
+
+ /**
+ * 病人 ids
+ */
+ @TableField(exist = false)
+ private List patientIds;
+
+ /**
+ * 正餐类型
+ */
+ @Excel(name = "正餐类型")
+ private Integer type;
+
+ /**
+ * 配餐号
+ */
+ @Excel(name = "配餐号")
+ private Long number;
+
+ /**
+ * 配餐频次
+ */
+ @Excel(name = "配餐频次")
+ private String frequency;
+
+ /**
+ * 用法
+ */
+ @Excel(name = "用法")
+ private Integer cateringUsage;
+
+ /**
+ * 是否代替正餐
+ */
+ private Integer isReplace;
+
+ /**
+ * 启用标志
+ */
+ private Boolean flag;
+
+ /**
+ * 更新日期
+ */
+ private Date updateAt;
+
+ /**
+ * 更新人
+ */
+ @Excel(name = "更新人")
+ private String updateBy;
+
+ /**
+ * 创建时间
+ */
+ @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date createAt;
+
+ /**
+ * 创建人
+ */
+ private String createBy;
+
+ /**
+ * 描述
+ */
+ @Excel(name = "描述")
+ private String cateringDescribe;
+
+ // 暂停标志
+ @Excel(name = "停餐")
+ private Boolean suspendFlag;
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtConfigDao.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtConfigDao.java
new file mode 100644
index 0000000000000000000000000000000000000000..b9a50052e52fda796e8010b3f19165d4c2fb0044
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtConfigDao.java
@@ -0,0 +1,54 @@
+package com.ruoyi.system.fantang.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
+import lombok.experimental.Accessors;
+import com.ruoyi.common.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import java.io.Serializable;
+import java.util.Date;
+import java.math.BigDecimal;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 饭堂参数对象 ft_config
+ *
+ * @author ft
+ * @date 2020-12-07
+ */
+@Data
+@ToString
+@EqualsAndHashCode
+@NoArgsConstructor
+@Accessors(chain = true)
+@TableName("ft_config")
+public class FtConfigDao implements Serializable {
+
+private static final long serialVersionUID=1L;
+
+
+ /** $column.columnComment */
+ @TableId(value = "id")
+ private Long id;
+
+ /** $column.columnComment */
+ @Excel(name = "${comment}" , readConverterExp = "$column.readConverterExp()")
+ private Long corpId;
+
+ /** $column.columnComment */
+ @Excel(name = "${comment}" , readConverterExp = "$column.readConverterExp()")
+ private String configKey;
+
+ /** $column.columnComment */
+ @Excel(name = "${comment}" , readConverterExp = "$column.readConverterExp()")
+ private String configValue;
+
+ /** $column.columnComment */
+ @Excel(name = "${comment}" , readConverterExp = "$column.readConverterExp()")
+ private Long flag;
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtDepartDao.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtDepartDao.java
new file mode 100644
index 0000000000000000000000000000000000000000..7e87280db7a90224829292d1d98410a46dc02479
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtDepartDao.java
@@ -0,0 +1,54 @@
+package com.ruoyi.system.fantang.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
+import lombok.experimental.Accessors;
+import com.ruoyi.common.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import java.io.Serializable;
+import java.util.Date;
+import java.math.BigDecimal;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 科室管理对象 ft_depart
+ *
+ * @author ft
+ * @date 2020-11-24
+ */
+@Data
+@ToString
+@EqualsAndHashCode
+@NoArgsConstructor
+@Accessors(chain = true)
+@TableName("ft_depart")
+public class FtDepartDao implements Serializable {
+
+private static final long serialVersionUID=1L;
+
+
+ /** 科室编号 */
+ @TableId(value = "depart_id")
+ private Long departId;
+
+ /** 科室名称 */
+ @Excel(name = "科室名称")
+ private String departName;
+
+ /** 科室编号 */
+ @Excel(name = "科室编号")
+ private String departCode;
+
+ @TableField(exist = false)
+ private Long patientId;
+ @TableField(exist = false)
+ private String bedId;
+ @TableField(exist = false)
+ private String name;
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtFaceEventDao.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtFaceEventDao.java
new file mode 100644
index 0000000000000000000000000000000000000000..3ca16ffa99d5eaa08835823d807cfd1480a47c5b
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtFaceEventDao.java
@@ -0,0 +1,32 @@
+package com.ruoyi.system.fantang.domain;
+
+import com.baomidou.mybatisplus.annotation.*;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.Date;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@TableName("ft_faceEvent")
+public class FtFaceEventDao {
+ @TableId(type = IdType.AUTO)
+ private Long id;
+
+ @TableField(value = "device_id")
+ private String deviceId;
+
+ @TableField(value = "person_id")
+ private String personId;
+
+ @TableField(fill= FieldFill.INSERT)
+ private int flag;
+
+ @TableField(fill = FieldFill.INSERT)
+ private Date createTime;
+
+ @TableField(fill = FieldFill.INSERT)
+ private int findFlag;
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtFaceinfoDao.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtFaceinfoDao.java
new file mode 100644
index 0000000000000000000000000000000000000000..17dab2974edcd5111724715bd4987e26252952e6
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtFaceinfoDao.java
@@ -0,0 +1,63 @@
+package com.ruoyi.system.fantang.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
+import lombok.experimental.Accessors;
+import com.ruoyi.common.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import java.io.Serializable;
+import java.util.Date;
+import java.util.Map;
+import java.util.HashMap;
+import java.math.BigDecimal;
+
+/**
+ * 人脸信息对象 ft_faceInfo
+ *
+ * @author ryo
+ * @date 2021-01-11
+ */
+@Data
+@ToString
+@EqualsAndHashCode
+@NoArgsConstructor
+@Accessors(chain = true)
+@TableName("ft_faceInfo")
+public class FtFaceinfoDao implements Serializable {
+
+private static final long serialVersionUID=1L;
+
+
+ /** id */
+ @TableId(value = "id")
+ private Long id;
+
+ /** 设备 id */
+ @Excel(name = "设备 id")
+ private String deviceId;
+
+ /** 员工 id */
+ @Excel(name = "员工 id")
+ private Long personId;
+
+ /** 手机 */
+ @Excel(name = "手机")
+ private String phone;
+
+ /** $column.columnComment */
+ private Long memId;
+
+ /** 创建时间 */
+ @Excel(name = "创建时间" , width = 30, dateFormat = "yyyy-MM-dd")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date createtime;
+
+ @TableField(exist = false)
+ private Map params = new HashMap<>();
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtFoodDao.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtFoodDao.java
new file mode 100644
index 0000000000000000000000000000000000000000..4ad660f5993979c0d60809a4374a902826da3c86
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtFoodDao.java
@@ -0,0 +1,70 @@
+package com.ruoyi.system.fantang.domain;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.ruoyi.common.annotation.Excel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+/**
+ * 食品管理对象 ft_food
+ *
+ * @author ft
+ * @date 2020-11-24
+ */
+@Data
+@ToString
+@EqualsAndHashCode
+@NoArgsConstructor
+@Accessors(chain = true)
+@TableName("ft_food")
+public class FtFoodDao implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+
+ /**
+ * 食品id
+ */
+ @TableId(value = "food_id")
+ private Long foodId;
+
+ /**
+ * 名称
+ */
+ @Excel(name = "名称")
+ private String name;
+
+ /**
+ * 图片
+ */
+ private String pictureUrl;
+
+ /**
+ * 售价
+ */
+ @Excel(name = "售价")
+ private BigDecimal price;
+
+ /**
+ * 启用标志
+ */
+ private Long flag;
+
+ /**
+ * 食品分类
+ */
+ @Excel(name = "食品分类")
+ private Long type;
+
+ /**
+ * 用餐类型
+ */
+ private Integer dinnerType;
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtFoodDefaultDao.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtFoodDefaultDao.java
new file mode 100644
index 0000000000000000000000000000000000000000..f1e859655c1104d24824a750984ab4ca29141ff4
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtFoodDefaultDao.java
@@ -0,0 +1,65 @@
+package com.ruoyi.system.fantang.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
+import lombok.experimental.Accessors;
+import com.ruoyi.common.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import java.io.Serializable;
+import java.util.Date;
+import java.math.BigDecimal;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 默认报餐管理对象 ft_food_default
+ *
+ * @author ft
+ * @date 2020-11-25
+ */
+@Data
+@ToString
+@EqualsAndHashCode
+@NoArgsConstructor
+@Accessors(chain = true)
+@TableName("ft_food_default")
+public class FtFoodDefaultDao implements Serializable {
+
+private static final long serialVersionUID=1L;
+
+
+ /** id */
+ @TableId(value = "id")
+ private Long id;
+
+ /** 报餐类型 */
+ @Excel(name = "报餐类型")
+ private Long type;
+
+ /** 菜品列表 */
+ private String foodList;
+
+ /** 创建日期 */
+ @Excel(name = "创建日期" , width = 30, dateFormat = "yyyy-MM-dd")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date createdAt;
+
+ /** 创建人 */
+ private Long createdBy;
+
+ /** 更新日期 */
+ @Excel(name = "更新日期" , width = 30, dateFormat = "yyyy-MM-dd")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date updatedAt;
+
+ /** 更新人 */
+ private Long updatedBy;
+
+ /** 总价格 */
+ @Excel(name = "总价格")
+ private BigDecimal price;
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtFoodDemandDao.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtFoodDemandDao.java
new file mode 100644
index 0000000000000000000000000000000000000000..f09ef3142d3a0595c1470463297f4df56975479d
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtFoodDemandDao.java
@@ -0,0 +1,137 @@
+package com.ruoyi.system.fantang.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.system.fantang.entity.BasePatient;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 病人报餐对象 ft_food_demand
+ *
+ * @author ft
+ * @date 2020-12-03
+ */
+@Data
+@ToString
+@EqualsAndHashCode
+@NoArgsConstructor
+@Accessors(chain = true)
+@TableName("ft_food_demand")
+public class FtFoodDemandDao extends BasePatient implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+
+ /**
+ * id
+ */
+ @TableId(value = "id")
+ private Long id;
+
+ /**
+ * 病人id
+ */
+ private Long patientId;
+
+ /**
+ * 正餐清单
+ */
+ @Excel(name = "正餐清单")
+ private String foods;
+
+ /**
+ * 正餐类型
+ */
+ @Excel(name = "正餐类型")
+ private Integer type;
+
+ /**
+ * 创建时间
+ */
+ private Date createAt;
+
+ /**
+ * 创建人
+ */
+ private Long createBy;
+
+ /**
+ * 更新日期
+ */
+ @Excel(name = "更新日期", width = 30, dateFormat = "yyyy-MM-dd")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date updateAt;
+
+ /**
+ * 加菜
+ */
+ @Excel(name = "加菜")
+ private Boolean vegetables;
+
+ /**
+ * 更新操作人 id
+ */
+ private Long updateBy;
+
+ /**
+ * 加肉
+ */
+ @Excel(name = "加肉")
+ private Boolean meat;
+
+ /**
+ * 更新来源
+ */
+ private Integer updateFrom;
+
+ /**
+ * 加饭
+ */
+ @Excel(name = "加饭")
+ private Boolean rice;
+
+ /**
+ * 加蛋
+ */
+ @Excel(name = "加蛋")
+ private Integer egg;
+
+ /**
+ * 订单详情
+ */
+ private String orderInfo;
+
+ /**
+ * 启用状态
+ */
+ @Excel(name = "启用状态")
+ private Boolean flag;
+
+ /**
+ * 营养餐 id
+ **/
+ private Long nutritionFoodId;
+
+ /**
+ * 营养餐标志
+ **/
+ private Boolean nutritionFoodFlag;
+
+ /**
+ * 营养餐名
+ */
+ @TableField(exist = false)
+ private String nutritionFood;
+
+ private Boolean openFlag;
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtInvoiceDao.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtInvoiceDao.java
new file mode 100644
index 0000000000000000000000000000000000000000..038c9b913087d295a30274c9395a2c81291e3f23
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtInvoiceDao.java
@@ -0,0 +1,87 @@
+package com.ruoyi.system.fantang.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
+import lombok.experimental.Accessors;
+import com.ruoyi.common.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import java.io.Serializable;
+import java.util.Date;
+import java.math.BigDecimal;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 财务收费开票对象 ft_invoice
+ *
+ * @author ft
+ * @date 2020-12-08
+ */
+@Data
+@ToString
+@EqualsAndHashCode
+@NoArgsConstructor
+@Accessors(chain = true)
+@TableName("ft_invoice")
+public class FtInvoiceDao implements Serializable {
+
+private static final long serialVersionUID=1L;
+
+
+ /** id */
+ @TableId(value = "id")
+ private Long id;
+
+ /** 发票单位 */
+ private String invoiceUnit;
+
+ /** 发票 id */
+ private Long invoiceId;
+
+ /** 日期 */
+ private Date createAt;
+
+ /** 开票人 */
+ private String drawer;
+
+ /** 收款方式 */
+ private String collectionType;
+
+ /** 应收 */
+ private BigDecimal payable;
+
+ /** 实收 */
+ private BigDecimal receipts;
+
+ /** 凭证列表 */
+ private String voucherList;
+
+ /**
+ * 发票号
+ */
+ private String invoiceNum;
+
+ /**
+ * 发票名
+ */
+ private String invoiceName;
+
+ /**
+ * 税号
+ */
+ private String taxId;
+
+ /**
+ * 开票类型
+ */
+ private Integer invoiceType;
+
+ /**
+ * 开票金额
+ */
+ private BigDecimal invoiceAmount;
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtNotifyDao.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtNotifyDao.java
new file mode 100644
index 0000000000000000000000000000000000000000..c4aab63fe7dc0475701f538ff3b7f61bcd86c44e
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtNotifyDao.java
@@ -0,0 +1,62 @@
+package com.ruoyi.system.fantang.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
+import lombok.experimental.Accessors;
+import com.ruoyi.common.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import java.io.Serializable;
+import java.util.Date;
+import java.math.BigDecimal;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 系统信息对象 ft_notify
+ *
+ * @author ft
+ * @date 2020-12-17
+ */
+@Data
+@ToString
+@EqualsAndHashCode
+@NoArgsConstructor
+@Accessors(chain = true)
+@TableName("ft_notify")
+public class FtNotifyDao implements Serializable {
+
+private static final long serialVersionUID=1L;
+
+
+ /** $column.columnComment */
+ @TableId(value = "id")
+ private Long id;
+
+ /** 消息类型 */
+ @Excel(name = "消息类型")
+ private Integer messageType;
+
+ /** 消息范围 */
+ @Excel(name = "消息范围")
+ private Integer scope;
+
+ /** 消息内容 */
+ @Excel(name = "消息内容")
+ private String messageBody;
+
+ /** 创建时间 */
+ @Excel(name = "创建时间" , width = 30, dateFormat = "yyyy-MM-dd")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date createAt;
+
+ /** 创建人 */
+ private String createBy;
+
+ /** 阅读标志 */
+ @Excel(name = "阅读标志")
+ private Integer readFlag;
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtNutritionFoodDao.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtNutritionFoodDao.java
new file mode 100644
index 0000000000000000000000000000000000000000..f33b408f81da1d7093f2b6c5d29a7cc1635f1df4
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtNutritionFoodDao.java
@@ -0,0 +1,66 @@
+package com.ruoyi.system.fantang.domain;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.ruoyi.common.annotation.Excel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 病患营养配餐对象 ft_nutrition_food
+ *
+ * @author ft
+ * @date 2020-12-03
+ */
+@Data
+@ToString
+@EqualsAndHashCode
+@NoArgsConstructor
+@Accessors(chain = true)
+@TableName("ft_nutrition_food")
+public class FtNutritionFoodDao implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+
+ /**
+ * id
+ */
+ @TableId(value = "id")
+ private Long id;
+
+ /**
+ * 营养餐名称
+ */
+ @Excel(name = "营养餐名称")
+ private String name;
+
+ /**
+ * 价格
+ */
+ @Excel(name = "价格")
+ private BigDecimal price;
+
+ /**
+ * 启用标志
+ */
+ @Excel(name = "启用标志")
+ private Boolean flag;
+
+ /**
+ * 创建日期
+ */
+ private Date createAt;
+
+ /**
+ * 创建人
+ */
+ private String createBy;
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtOrderDao.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtOrderDao.java
new file mode 100644
index 0000000000000000000000000000000000000000..44c785b19baee8df6f934101f2606e95250fcf1c
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtOrderDao.java
@@ -0,0 +1,177 @@
+package com.ruoyi.system.fantang.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.common.annotation.Excel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 订单管理对象 ft_order
+ *
+ * @author ft
+ * @date 2020-11-19
+ */
+@Data
+@ToString
+@EqualsAndHashCode
+@NoArgsConstructor
+@Accessors(chain = true)
+@TableName("ft_order")
+public class FtOrderDao implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+
+ /**
+ * 订单 id
+ */
+ @TableId(value = "order_id")
+ private Long orderId;
+
+ @TableField(exist = false)
+ @Excel(name = "部门名称")
+ private String departName;
+
+ /**
+ * 员工姓名
+ */
+ @TableField(exist = false)
+ @Excel(name = "员工姓名")
+ private String name;
+
+ @TableField(exist = false)
+ @Excel(name = "电话")
+ private String tel;
+
+ /**
+ * 订单类型
+ */
+ @Excel(name = "订单类型", readConverterExp = "1=早餐,2=午餐,3=晚餐")
+ private Integer orderType;
+
+ @TableField(exist = false)
+ private String orderTypeString;
+
+ /**
+ * 员工 id
+ */
+ private Long staffId;
+
+ /**
+ * 清单
+ */
+ private String orderList;
+
+ /**
+ * 总价
+ */
+ @Excel(name = "价格")
+ private BigDecimal totalPrice;
+
+ /**
+ * 统计总数
+ */
+ @TableField(exist = false)
+ private Long total;
+
+ /**
+ * 报餐类型
+ */
+ @TableField(exist = false)
+ private Integer type;
+
+ /**
+ * 折扣
+ */
+ private BigDecimal discount;
+
+ /**
+ * 实收
+ */
+ private BigDecimal receipts;
+
+ /**
+ * 创建时间
+ */
+ @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date createAt;
+
+ // 订用餐日期
+ @Excel(name = "订用餐日期", width = 30, dateFormat = "yyyy-MM-dd")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date orderDate;
+
+ /**
+ * 创建人
+ */
+ private String createBy;
+
+ /**
+ * 订单来源
+ */
+ private String orderSrc;
+
+ /**
+ * 订单现售
+ */
+ private BigDecimal currentPrice;
+
+ /**
+ * 支付方式
+ */
+ private Integer payType;
+
+ /**
+ * 支付标志
+ */
+ private Integer payFlag;
+
+ /**
+ * 过期标志
+ */
+ private Integer expiredFlag;
+
+ /**
+ * 核销标志
+ */
+ @Excel(name = "是否核销", readConverterExp = "0=否,1=是")
+ private Integer writeOffFlag;
+
+ /**
+ * 核销时间
+ */
+ @Excel(name = "核销时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date writeOffAt;
+
+ /**
+ * 是否过期
+ */
+ private Integer isExpired;
+
+ /**
+ * 核销设备 id
+ */
+ private Long deviceId;
+
+ @TableField(exist = false)
+ private Integer countOrder;
+
+ @TableField(exist = false)
+ private Long departId;
+
+ @TableField(exist = false)
+ private String staffName;
+
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtPatientDao.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtPatientDao.java
new file mode 100644
index 0000000000000000000000000000000000000000..93343180e2de36f4a6dde8622f13b44f3a00e0a2
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtPatientDao.java
@@ -0,0 +1,66 @@
+package com.ruoyi.system.fantang.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
+import lombok.experimental.Accessors;
+import com.ruoyi.common.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import java.io.Serializable;
+import java.util.Date;
+import java.math.BigDecimal;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 病人管理对象 ft_patient
+ *
+ * @author ft
+ * @date 2020-11-24
+ */
+@Data
+@ToString
+@EqualsAndHashCode
+@NoArgsConstructor
+@Accessors(chain = true)
+@TableName("ft_patient")
+public class FtPatientDao implements Serializable {
+
+private static final long serialVersionUID=1L;
+
+
+ /** 病人id */
+ @TableId(value = "patient_id")
+ private Long patientId;
+
+ /** 姓名 */
+ @Excel(name = "姓名")
+ private String name;
+
+ /** 所属部门id */
+ private Long departId;
+
+ @TableField(exist = false)
+ private String departName;
+
+ /** 床号 */
+ @Excel(name = "床号")
+ private String bedId;
+
+ /** 住院号 */
+ @Excel(name = "住院号")
+ private String hospitalId;
+
+ /** 同步标志 */
+ private Integer syncFlag;
+
+ /** 出院标志 */
+ private Integer offFlag;
+
+ /** 创建时间 */
+ private Date createAt;
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtPrepaymentDao.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtPrepaymentDao.java
new file mode 100644
index 0000000000000000000000000000000000000000..f269a6c0a8cb601d4b27fbc87f5a2173ef03d632
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtPrepaymentDao.java
@@ -0,0 +1,91 @@
+package com.ruoyi.system.fantang.domain;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.common.annotation.Excel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 收费管理对象 ft_prepayment
+ *
+ * @author ft
+ * @date 2020-11-19
+ */
+@Data
+@ToString
+@EqualsAndHashCode
+@NoArgsConstructor
+@Accessors(chain = true)
+@TableName("ft_prepayment")
+public class FtPrepaymentDao implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 预付费id
+ */
+ @TableId(value = "prepayment_id")
+ private Long prepaymentId;
+
+ /**
+ * 病人id
+ */
+ private Long patientId;
+
+ /**
+ * 收款时间
+ */
+ @Excel(name = "收款时间", width = 30, dateFormat = "yyyy-MM-dd")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date collectAt;
+
+ /**
+ * 收款员
+ */
+ private String collectBy;
+
+ /**
+ * 结算时间
+ */
+ @Excel(name = "结算时间", width = 30, dateFormat = "yyyy-MM-dd")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date settlementAt;
+
+ /**
+ * 结算员
+ */
+ private Long settlementBy;
+
+ /**
+ * 结算报表id
+ */
+ private Long settlementId;
+
+ /**
+ * 结算标志
+ */
+ @Excel(name = "结算标志")
+ private Integer settlementFlag;
+
+ /**
+ * 预付费金额
+ */
+ @Excel(name = "预付费金额")
+ private BigDecimal prepaid;
+
+ /**
+ * 预付费时间
+ */
+ @Excel(name = "预付费时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+ @JsonFormat(pattern = "yyyy-MM-dd")
+ private Date prepaidAt;
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtPrepaymentVo.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtPrepaymentVo.java
new file mode 100644
index 0000000000000000000000000000000000000000..a3f2f6b21e027106757c757c4f21416297d24aa0
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtPrepaymentVo.java
@@ -0,0 +1,44 @@
+package com.ruoyi.system.fantang.domain;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.common.annotation.Excel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 收费管理对象 ft_prepayment
+ *
+ * @author ft
+ * @date 2020-11-19
+ */
+@Data
+@ToString
+@EqualsAndHashCode
+@NoArgsConstructor
+@Accessors(chain = true)
+public class FtPrepaymentVo extends FtPrepaymentDao {
+
+ /**
+ * select a.patient_id , a.name, a.hospital_id, b.depart_name, b.depart_code from ft_patient a
+ * LEFT JOIN ft_depart b on a.depart_id = b.depart_id
+ * where a.patient_id not in (select patient_id from ft_prepayment )
+ */
+ private String name;
+
+ private String bedId;
+
+ private String departName;
+
+ private String hospitalId;
+
+ private String departCode;
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtRemotePatientDao.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtRemotePatientDao.java
new file mode 100644
index 0000000000000000000000000000000000000000..56f3b42a02fff52529b5f815a7fac34fd2c1a0b7
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtRemotePatientDao.java
@@ -0,0 +1,47 @@
+package com.ruoyi.system.fantang.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.ruoyi.common.annotation.Excel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+/**
+ * 远程病患数据实体类
+ *
+ * @author 陈智兴
+ * @date 2020-11-24
+ */
+@Data
+@ToString
+@EqualsAndHashCode
+@NoArgsConstructor
+@Accessors(chain = true)
+@TableName("ft_sync")
+public class FtRemotePatientDao implements Serializable {
+
+private static final long serialVersionUID=1L;
+
+
+ /** 住院号 */
+ @TableField(value = "hospital_id")
+ private String hospitalid;
+
+ /** 姓名 */
+ private String name;
+
+ // 科室名称
+ @TableField("depart_name")
+ private String departName;
+
+ // 床号
+ @TableField("bed_id")
+ private String bedId;
+
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtReportMealsDao.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtReportMealsDao.java
new file mode 100644
index 0000000000000000000000000000000000000000..0073395b72be5fbc5b37bdaf071ee1c30c965794
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtReportMealsDao.java
@@ -0,0 +1,194 @@
+package com.ruoyi.system.fantang.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.common.annotation.Excel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 报餐管理对象 ft_report_meals
+ *
+ * @author ft
+ * @date 2020-11-19
+ */
+@Data
+@ToString
+@EqualsAndHashCode
+@NoArgsConstructor
+@Accessors(chain = true)
+@TableName("ft_report_meals")
+public class FtReportMealsDao implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+
+ /**
+ * id
+ */
+ @TableId(value = "id")
+ private Long id;
+
+ /**
+ * 科室名
+ */
+ @TableField(exist = false)
+ @Excel(name = "部门名称")
+ private String departName;
+
+ /**
+ * 住院号
+ */
+ @TableField(exist = false)
+ @Excel(name = "住院号")
+ private String hospitalId;
+
+ /**
+ * 床号
+ */
+ @TableField(exist = false)
+ @Excel(name = "床号")
+ private String bedId;
+
+ /**
+ * 病人姓名
+ */
+ @TableField(exist = false)
+ @Excel(name = "姓名")
+ private String name;
+
+ /**
+ * 报餐日期
+ */
+ @Excel(name = "报餐日期", width = 30, dateFormat = "yyyy-MM-dd")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date createAt;
+
+ /**
+ * 报餐类型
+ */
+ @Excel(name = "报餐类型", readConverterExp = "1=早餐,2=午餐,3=晚餐,4=加餐")
+ private Long type;
+
+ /**
+ * 病人id
+ */
+ private Long patientId;
+
+ /**
+ * 报餐人
+ */
+ private Long createBy;
+
+ /**
+ * 订单列表
+ */
+ private String foods;
+
+ /**
+ * 正餐总价
+ */
+ @Excel(name = "正餐总价")
+ private BigDecimal price;
+
+ /**
+ * 结算标志
+ */
+ private Integer settlementFlag;
+
+ private Long settlementId;
+
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date settlementAt;
+
+ private String settlementBy;
+
+ /**
+ * 科室 id
+ */
+ @TableField(exist = false)
+ private String departId;
+
+ /**
+ * 营养餐 id
+ */
+ private Long nutritionFoodId;
+
+ /**
+ * 营养配餐标志
+ */
+ private Integer nutritionFoodFlag;
+
+ /**
+ * 是否替代正餐
+ */
+ private Boolean isReplaceFood;
+
+ /**
+ * 营养配餐价格
+ */
+ @Excel(name = "营养配餐价格")
+ private BigDecimal nutritionFoodPrice;
+
+ /**
+ * 当前报餐总价
+ */
+ @Excel(name = "当餐总价")
+ private BigDecimal totalPrice;
+
+ private Boolean vegetables;
+
+ private Boolean meat;
+
+ private Boolean rice;
+
+ private Integer egg;
+
+ @TableField(exist = false)
+ private Integer total;
+
+ private Boolean openFlag;
+
+ @TableField(exist = false)
+ private Integer statisticsType;
+
+ /**
+ * 营养餐名称
+ */
+ @TableField(exist = false)
+ private String nutritionName;
+
+ @TableField(exist = false)
+ private Integer cateringUsage;
+
+ /**
+ * 用餐开始时间
+ */
+ @TableField(exist = false)
+ private Date beginOfDay;
+
+ /**
+ * 用餐结束时间
+ */
+ @TableField(exist = false)
+ private Date endOfDay;
+
+ /**
+ * 用餐标志
+ */
+ @Excel(name = "是否已用餐", readConverterExp = "1=是,0=否")
+ private Integer diningFlag;
+
+ @Excel(name = "用餐日期", width = 30, dateFormat = "yyyy-MM-dd")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date diningAt;
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtReturnDao.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtReturnDao.java
new file mode 100644
index 0000000000000000000000000000000000000000..cc91a3de6a68e28b68c02738a4a3fc684b6bb05d
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtReturnDao.java
@@ -0,0 +1,72 @@
+package com.ruoyi.system.fantang.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
+import lombok.experimental.Accessors;
+import com.ruoyi.common.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import java.io.Serializable;
+import java.util.Date;
+import java.util.Map;
+import java.util.HashMap;
+import java.math.BigDecimal;
+
+/**
+ * 回款登记对象 ft_return
+ *
+ * @author ft
+ * @date 2021-01-25
+ */
+@Data
+@ToString
+@EqualsAndHashCode
+@NoArgsConstructor
+@Accessors(chain = true)
+@TableName("ft_return")
+public class FtReturnDao implements Serializable {
+
+private static final long serialVersionUID=1L;
+
+
+ /** id */
+ @TableId(value = "id")
+ private Long id;
+
+ /** 对应发票id */
+ @Excel(name = "对应发票id")
+ private Long invoiceId;
+
+ /** 回款日期 */
+ @Excel(name = "回款日期" , width = 30, dateFormat = "yyyy-MM-dd")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date returnAt;
+
+ /** 回款金额 */
+ @Excel(name = "回款金额")
+ private BigDecimal returnPrice;
+
+ /** 余额 */
+ @Excel(name = "余额")
+ private BigDecimal balancePrice;
+
+ /** 操作员 */
+ @Excel(name = "操作员")
+ private String opera;
+
+ /** 凭证的图片url */
+ @Excel(name = "凭证的图片url")
+ private String voucherUrl;
+
+ /** 是否完成回款标志 */
+ @Excel(name = "是否完成回款标志")
+ private Integer returnFlag;
+
+ @TableField(exist = false)
+ private Map params = new HashMap<>();
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtSettleDao.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtSettleDao.java
new file mode 100644
index 0000000000000000000000000000000000000000..114795bfd4a80dbbc03784233c6c53e9e28e226c
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtSettleDao.java
@@ -0,0 +1,119 @@
+package com.ruoyi.system.fantang.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.common.annotation.Excel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 结算报对象 ft_settle
+ *
+ * @author ft
+ * @date 2020-11-19
+ */
+@Data
+@ToString
+@EqualsAndHashCode
+@NoArgsConstructor
+@Accessors(chain = true)
+@TableName("ft_settle")
+public class FtSettleDao implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+
+ /**
+ * 结算 id
+ */
+ @TableId(value = "settle_id")
+ private Long settleId;
+
+ /**
+ * 病人 id
+ */
+ private Long patientId;
+
+ /**
+ * 结算日期
+ */
+ @Excel(name = "结算日期", width = 30, dateFormat = "yyyy-MM-dd")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date settleAt;
+
+ /**
+ * 操作员
+ */
+ private String opera;
+
+ /**
+ * 记录清单
+ */
+ @Excel(name = "记录清单")
+ private String list;
+
+ /**
+ * 结算总价
+ */
+ @Excel(name = "结算总价")
+ private BigDecimal price;
+
+ /**
+ * 应收
+ */
+ @Excel(name = "应收")
+ private BigDecimal payable;
+
+ /**
+ * 实收
+ */
+ @Excel(name = "实收")
+ private BigDecimal receipts;
+
+ /**
+ * 结算类型
+ */
+ @Excel(name = "结算类型")
+ private String type;
+
+ /**
+ * 退押金标志
+ */
+ private Integer flag;
+
+ /**
+ * 退款总额
+ */
+ @Excel(name = "退款总额")
+ private BigDecimal refund;
+
+ @TableField(exist = false)
+ private BigDecimal netPeceipt;
+
+ @TableField(exist = false)
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date lastBillingDate;
+
+ @TableField(exist = false)
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date selectBillingDate;
+
+ /**
+ * 开票标志
+ */
+ private Boolean invoiceFlag;
+
+ /**
+ * 发票 id
+ */
+ private Long invoiceId;
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtSettlementDao.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtSettlementDao.java
new file mode 100644
index 0000000000000000000000000000000000000000..d18d1b28d066168086c7b6c618fa80d1e3df525f
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtSettlementDao.java
@@ -0,0 +1,112 @@
+package com.ruoyi.system.fantang.domain;
+
+import cn.hutool.core.date.DateTime;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.common.annotation.Excel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 结算管理对象 ft_settle
+ *
+ * @author ft
+ * @date 2020-12-25
+ */
+@Data
+@ToString
+@EqualsAndHashCode
+@NoArgsConstructor
+@Accessors(chain = true)
+@TableName("ft_settle")
+public class FtSettlementDao implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+
+ /**
+ * 结算 id
+ */
+ @TableId(value = "settle_id")
+ private Long settleId;
+
+ /**
+ * 病人 id
+ */
+ private Long patientId;
+
+ /**
+ * 结算日期
+ */
+ @Excel(name = "结算日期", width = 30, dateFormat = "yyyy-MM-dd")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date settleAt;
+
+ /**
+ * 操作员
+ */
+ private String opera;
+
+ /**
+ * 记录清单
+ */
+ @Excel(name = "记录清单")
+ private String list;
+
+ /**
+ * 结算总价
+ */
+ @Excel(name = "结算总价")
+ private BigDecimal price;
+
+ /**
+ * 应收
+ */
+ @Excel(name = "应收")
+ private BigDecimal payable;
+
+ /**
+ * 实收
+ */
+ @Excel(name = "实收")
+ private BigDecimal receipts;
+
+ /**
+ * 结算类型
+ */
+ @Excel(name = "结算类型")
+ private String type;
+
+ /**
+ * 退押金标志
+ */
+ private Integer flag;
+
+ /**
+ * 退款总额
+ */
+ @Excel(name = "退款总额")
+ private BigDecimal refund;
+
+ @TableField(exist = false)
+ private String name;
+
+ @TableField(exist = false)
+ private String beginOfDay;
+
+ @TableField(exist = false)
+ private String endOfDay;
+
+ private Long invoiceId;
+
+ private Integer invoiceFlag;
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtStaffDemandDao.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtStaffDemandDao.java
new file mode 100644
index 0000000000000000000000000000000000000000..971384d189c0b7adde6aa72901835fa0fe7ac190
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtStaffDemandDao.java
@@ -0,0 +1,83 @@
+package com.ruoyi.system.fantang.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.system.fantang.entity.BaseStaff;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
+import lombok.experimental.Accessors;
+import com.ruoyi.common.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import java.io.Serializable;
+import java.util.Date;
+import java.math.BigDecimal;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 员工报餐对象 ft_staff_demand
+ *
+ * @author ft
+ * @date 2020-12-07
+ */
+@Data
+@ToString
+@EqualsAndHashCode
+@NoArgsConstructor
+@Accessors(chain = true)
+@TableName("ft_staff_demand")
+public class FtStaffDemandDao extends BaseStaff implements Serializable {
+
+private static final long serialVersionUID=1L;
+
+
+ /** id */
+ @TableId(value = "id")
+ private Long id;
+
+ /** 员工 id */
+ @Excel(name = "员工 id")
+ private Integer staffId;
+
+ /** 正餐清单 */
+ @Excel(name = "正餐清单")
+ private String foods;
+
+ /** 用餐类型 */
+ @Excel(name = "用餐类型")
+ private Long type;
+
+ /** 创建时间 */
+ @Excel(name = "创建时间" , width = 30, dateFormat = "yyyy-MM-dd")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date createAt;
+
+ /** 创建人 */
+ private Long createBy;
+
+ /** 更新时间 */
+ @Excel(name = "更新时间" , width = 30, dateFormat = "yyyy-MM-dd")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date updateAt;
+
+ /** 更新人 */
+ private Long updateBy;
+
+ /** 更新来源 */
+ @Excel(name = "更新来源")
+ private Integer updateFrom;
+
+ /** 订单详情 */
+ @Excel(name = "订单详情")
+ private String orderInfo;
+
+ /** 报餐模式 */
+ @Excel(name = "报餐模式")
+ private Boolean demandMode;
+
+ /** 停用标志 */
+ @Excel(name = "停用标志")
+ private Integer stopFlag;
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtStaffInfoDao.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtStaffInfoDao.java
new file mode 100644
index 0000000000000000000000000000000000000000..3c4335e1937bf1fe17f8129c0bd817c573212e57
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtStaffInfoDao.java
@@ -0,0 +1,152 @@
+package com.ruoyi.system.fantang.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.common.annotation.Excel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
+import lombok.experimental.Accessors;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 员工管理对象 ft_staff_info
+ *
+ * @author ft
+ * @date 2020-11-24
+ */
+@Data
+@ToString
+@EqualsAndHashCode(callSuper = false)
+@NoArgsConstructor
+@Accessors(chain = true)
+@TableName("ft_staff_info")
+public class FtStaffInfoDao {
+
+ private static final long serialVersionUID = 1L;
+
+
+ /**
+ * 员工 id
+ */
+ @TableId(value = "staff_id")
+ private Long staffId;
+
+ /**
+ * 科室 id
+ */
+ private Long departId;
+
+ /**
+ * 科室名
+ */
+ @TableField(exist = false)
+ private String departName;
+
+ /**
+ * 科室编号
+ */
+ @TableField(exist = false)
+ private String departCode;
+
+ /**
+ * 姓名
+ */
+ @Excel(name = "姓名")
+ private String name;
+
+ /**
+ * 岗位
+ */
+ @Excel(name = "岗位")
+ private String post;
+
+ /**
+ * 角色
+ */
+ @Excel(name = "角色")
+ private String role;
+
+ /**
+ * 密码
+ */
+ private String password;
+
+ /**
+ * 创建日期
+ */
+ @Excel(name = "创建日期", width = 30, dateFormat = "yyyy-MM-dd")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date createAt;
+
+ /**
+ * 创建人
+ */
+ private String createBy;
+
+ /**
+ * 启用标志
+ */
+ @Excel(name = "启用标志")
+ private Boolean flag;
+
+ /**
+ * 补贴余额
+ */
+ @Excel(name = "补贴余额")
+ private BigDecimal balance;
+
+ /**
+ * 员工类别
+ */
+ private Long staffType;
+
+ /**
+ * 所属公司
+ */
+ private String corpName;
+
+ /**
+ * 照片
+ */
+ private String pictureUrl;
+
+ /**
+ * 报餐科室列表
+ */
+ private String deptList;
+
+ /**
+ * 二维码
+ */
+ private String qrCode;
+
+ /**
+ * 性别
+ */
+ private Integer sex;
+
+ /**
+ * 手机号码
+ */
+ private String tel;
+
+ private String token;
+
+ private Boolean loginFlag;
+
+ private String expired;
+
+ @TableField(exist = false)
+ private Boolean giveOutFlag = true;
+
+ /**
+ * 人脸设备里的员工 id
+ */
+ private Long personId;
+}
\ No newline at end of file
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtStaffStopMealsDao.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtStaffStopMealsDao.java
new file mode 100644
index 0000000000000000000000000000000000000000..0be67c9471f74e347dad8b8e9f2a15e4d13093ea
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtStaffStopMealsDao.java
@@ -0,0 +1,55 @@
+package com.ruoyi.system.fantang.domain;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.system.fantang.entity.BaseStaff;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 员工报餐对象 ft_staff_demand
+ *
+ * @author ft
+ * @date 2020-12-07
+ */
+@Data
+@ToString
+@EqualsAndHashCode
+@NoArgsConstructor
+@Accessors(chain = true)
+@TableName("ft_staff_stop_meals")
+public class FtStaffStopMealsDao extends BaseStaff implements Serializable {
+
+private static final long serialVersionUID=1L;
+
+
+ /** id */
+ @TableId(value = "id")
+ private Long id;
+
+ /** 员工 id */
+ @Excel(name = "员工 id")
+ private Long staffId;
+
+ /** 用餐类型 */
+ @Excel(name = "用餐类型")
+ private Integer type;
+
+ /** 创建时间 */
+ @Excel(name = "创建时间" , width = 30, dateFormat = "yyyy-MM-dd")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date createAt;
+
+ /** 停餐时间 */
+ @Excel(name = "停餐时间" , width = 30, dateFormat = "yyyy-MM-dd")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date demandDate;
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtStaffSubsidyDao.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtStaffSubsidyDao.java
new file mode 100644
index 0000000000000000000000000000000000000000..dc8167406f14880a84c427221b97bd792696f70c
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtStaffSubsidyDao.java
@@ -0,0 +1,74 @@
+package com.ruoyi.system.fantang.domain;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.common.annotation.Excel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 补贴流水查看对象 ft_staff_subsidy
+ *
+ * @author ft
+ * @date 2020-11-19
+ */
+@Data
+@ToString
+@EqualsAndHashCode
+@NoArgsConstructor
+@Accessors(chain = true)
+@TableName("ft_staff_subsidy")
+public class FtStaffSubsidyDao implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+
+ /**
+ * 补贴流水 id
+ */
+ @TableId(value = "subsidy_id")
+ private Long subsidyId;
+
+ /**
+ * 员工 id
+ */
+ private Long staffId;
+
+ /**
+ * 补贴类型
+ */
+ @Excel(name = "补贴类型")
+ private String subsidyType;
+
+ /**
+ * 收支类型
+ */
+ @Excel(name = "收支类型")
+ private Integer incomeType;
+
+ /**
+ * 金额
+ */
+ @Excel(name = "金额")
+ private BigDecimal price;
+
+ /**
+ * 消费日期
+ */
+ @Excel(name = "消费日期", width = 30, dateFormat = "yyyy-MM-dd")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date consumAt;
+
+ /**
+ * 消费订单 id
+ */
+ private Long orderId;
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtSubsidyDao.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtSubsidyDao.java
new file mode 100644
index 0000000000000000000000000000000000000000..fb062a9b1007ee2db8b69711afd80fd7cb3bc0ad
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtSubsidyDao.java
@@ -0,0 +1,64 @@
+package com.ruoyi.system.fantang.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
+import lombok.experimental.Accessors;
+import com.ruoyi.common.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import java.io.Serializable;
+import java.util.Date;
+import java.math.BigDecimal;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 补贴管理对象 ft_subsidy
+ *
+ * @author ft
+ * @date 2020-11-25
+ */
+@Data
+@ToString
+@EqualsAndHashCode
+@NoArgsConstructor
+@Accessors(chain = true)
+@TableName("ft_subsidy")
+public class FtSubsidyDao implements Serializable {
+
+private static final long serialVersionUID=1L;
+
+
+ /** 补贴 id */
+ @TableId(value = "subsidy_id")
+ private Long subsidyId;
+
+ /** 补贴类型 */
+ @Excel(name = "补贴类型")
+ private String type;
+
+ /** 金额 */
+ @Excel(name = "金额")
+ private BigDecimal price;
+
+ /** 范围 */
+ private String subsidyRange;
+
+ /** 周期 */
+ private String cycle;
+
+ /** 启用标志 */
+ private Boolean flag;
+
+ /** 创建日期 */
+ @Excel(name = "创建日期" , width = 30, dateFormat = "yyyy-MM-dd")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date createAt;
+
+ /** 创建人 */
+ @Excel(name = "创建人")
+ private String createBy;
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtSyncConflictGenDao.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtSyncConflictGenDao.java
new file mode 100644
index 0000000000000000000000000000000000000000..79f09d58eb9baf1ba7c98b356f58ceb02db676ff
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtSyncConflictGenDao.java
@@ -0,0 +1,59 @@
+package com.ruoyi.system.fantang.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+/**
+ * 同步冲突对象 ft_sync_conflict
+ *
+ * @author ft
+ * @date 2020-12-24
+ */
+@Data
+@ToString
+@EqualsAndHashCode
+@NoArgsConstructor
+@Accessors(chain = true)
+@TableName("ft_sync_conflict")
+public class FtSyncConflictGenDao implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ @TableId(value = "id")
+ private Long id;
+
+ private String hospitalId;
+
+ private String name;
+
+ private String departName;
+
+ private String bedId;
+
+ private String oldHospitalId;
+
+ private String oldName;
+
+ private String oldDepartName;
+
+ private String oldBedId;
+
+ private Long departId;
+
+ private Long oldDepartId;
+
+ @TableField(exist = false)
+ private Integer patientFlag;
+
+ private Long patientId;
+
+ private Integer isSolve;
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtSyncLogDao.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtSyncLogDao.java
new file mode 100644
index 0000000000000000000000000000000000000000..dcb06e59a39de21eb1258766d3acf974afcdb3f0
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtSyncLogDao.java
@@ -0,0 +1,43 @@
+package com.ruoyi.system.fantang.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.ruoyi.common.annotation.Excel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 科室管理对象 ft_depart
+ *
+ * @author ft
+ * @date 2020-11-24
+ */
+@Data
+@ToString
+@EqualsAndHashCode
+@NoArgsConstructor
+@Accessors(chain = true)
+@TableName("ft_sync_log")
+public class FtSyncLogDao implements Serializable {
+
+private static final long serialVersionUID=1L;
+
+
+ /** 同步时间 */
+ @TableField(value = "created_at")
+ private Date createAt;
+
+ @TableField("total_record")
+ private Long totalRecord;
+
+ @TableField("sync_record")
+ private Long SyncRecord;
+
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtSyncPatientDao.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtSyncPatientDao.java
new file mode 100644
index 0000000000000000000000000000000000000000..6a85f013cbd87635a13312e2eb00e13bb7c98069
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtSyncPatientDao.java
@@ -0,0 +1,45 @@
+package com.ruoyi.system.fantang.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+/**
+ * 远程病患数据实体类
+ *
+ * @author 陈智兴
+ * @date 2020-11-24
+ */
+@Data
+@ToString
+@EqualsAndHashCode
+@NoArgsConstructor
+@Accessors(chain = true)
+@TableName("ft_sync")
+public class FtSyncPatientDao implements Serializable {
+
+private static final long serialVersionUID=1L;
+
+
+ /** 住院号 */
+ @TableField(value = "hospital_id")
+ private String hospitalid;
+
+ /** 姓名 */
+ private String name;
+
+ // 科室名称
+ @TableField("depart_name")
+ private String departName;
+
+ // 床号
+ @TableField("bed_id")
+ private String bedId;
+
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtWeekMenuDao.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtWeekMenuDao.java
new file mode 100644
index 0000000000000000000000000000000000000000..ac85487c68519fbf6080d657074e6141fbe37669
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtWeekMenuDao.java
@@ -0,0 +1,58 @@
+package com.ruoyi.system.fantang.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
+import lombok.experimental.Accessors;
+import com.ruoyi.common.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import java.io.Serializable;
+import java.util.Date;
+import java.math.BigDecimal;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 每周菜单对象 ft_week_menu
+ *
+ * @author ft
+ * @date 2020-11-27
+ */
+@Data
+@ToString
+@EqualsAndHashCode
+@NoArgsConstructor
+@Accessors(chain = true)
+@TableName("ft_week_menu")
+public class FtWeekMenuDao implements Serializable {
+
+private static final long serialVersionUID=1L;
+
+
+ /** id */
+ @TableId(value = "id")
+ private Long id;
+
+ /** 用餐类型 */
+ @Excel(name = "用餐类型")
+ private String dinnerType;
+
+ /** 星期几 */
+ @Excel(name = "星期几")
+ private String weekday;
+
+ /** 菜品列表 */
+ @Excel(name = "菜品列表")
+ private String foods;
+
+ /** 总价格 */
+ @Excel(name = "总价格")
+ private BigDecimal price;
+
+ /** 启用标志 */
+ @Excel(name = "启用标志")
+ private Boolean flag;
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/entity/BasePatient.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/entity/BasePatient.java
new file mode 100644
index 0000000000000000000000000000000000000000..1af80d77d12abb08ed8c116186553ce2acb1cc23
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/entity/BasePatient.java
@@ -0,0 +1,24 @@
+package com.ruoyi.system.fantang.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class BasePatient {
+ @TableField(exist = false)
+ public String hospitalId;
+ @TableField(exist = false)
+ public String bedId;
+ @TableField(exist = false)
+ public String name;
+ @TableField(exist = false)
+ public String departName;
+ @TableField(exist = false)
+ private Long departId;
+ @TableField(exist = false)
+ private Long total;
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/entity/BaseStaff.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/entity/BaseStaff.java
new file mode 100644
index 0000000000000000000000000000000000000000..5de9a12a923e6b6287337f8fad535bd19ce8b16f
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/entity/BaseStaff.java
@@ -0,0 +1,20 @@
+package com.ruoyi.system.fantang.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class BaseStaff {
+ @TableField(exist = false)
+ public String name;
+ @TableField(exist = false)
+ public String departName;
+ @TableField(exist = false)
+ private Long departId;
+ @TableField(exist = false)
+ private Long total;
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/entity/ReportMealsDayEntity.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/entity/ReportMealsDayEntity.java
new file mode 100644
index 0000000000000000000000000000000000000000..ffa4581d1da25b7fe062132288baf4b75f077e05
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/entity/ReportMealsDayEntity.java
@@ -0,0 +1,25 @@
+package com.ruoyi.system.fantang.entity;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.system.fantang.domain.FtReportMealsDao;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+
+import java.util.Date;
+
+@EqualsAndHashCode(callSuper = true)
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class ReportMealsDayEntity extends FtReportMealsDao {
+ // 用户自定义结算日期
+ @JsonFormat(pattern = "yyyy-MM-dd")
+ private Date selectBillingDate;
+ // 自上一次结算累计未结算天数
+ private Long days;
+ // 上次缴费日期
+ @JsonFormat(pattern = "yyyy-MM-dd")
+ private Date lastCreateDate;
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/entity/ReportMealsPriceEntity.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/entity/ReportMealsPriceEntity.java
new file mode 100644
index 0000000000000000000000000000000000000000..b7c246adda5cb66bd819be6bd09d70213f9b88b9
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/entity/ReportMealsPriceEntity.java
@@ -0,0 +1,28 @@
+package com.ruoyi.system.fantang.entity;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.math.BigDecimal;
+
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class ReportMealsPriceEntity {
+
+ /**
+ * 正餐总价
+ */
+ private BigDecimal dinnerTotalPrice;
+
+ /**
+ * 营养餐总价
+ */
+ private BigDecimal nutritionTotalPrice;
+
+ /**
+ * 正餐和营养餐总价
+ */
+ private BigDecimal sumTotalPrice;
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/entity/SettleEntity.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/entity/SettleEntity.java
new file mode 100644
index 0000000000000000000000000000000000000000..a4aef627472682c6e9cac18f0375a95fd4c5041f
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/entity/SettleEntity.java
@@ -0,0 +1,71 @@
+package com.ruoyi.system.fantang.entity;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class SettleEntity {
+
+ // 床号
+ private String bedId;
+
+ // 科室名
+ private String departName;
+
+ // 住院号
+ private String hospitalId;
+
+ // 上次缴费日期
+ @JsonFormat(pattern = "yyyy-MM-dd")
+ private Date lastBillingDate;
+
+ // 病人姓名
+ private String name;
+
+ // 实收
+ private BigDecimal netPeceipt;
+
+ // 操作员
+ private String opera;
+
+ // 病人 id
+ private Long patientId;
+
+ // 预付款金额
+ private BigDecimal prepayment;
+
+ // 应收
+ private BigDecimal price;
+
+ // 用户自定义结算日期
+ @JsonFormat(pattern = "yyyy-MM-dd")
+ private Date selectBillingDate;
+
+ // 自上一次结算累计未结算天数
+ private Long days;
+
+ // 操作员
+ private String userName;
+
+ // 正餐总价
+ private BigDecimal dinnerTotalPrice;
+
+ // 营养餐总价
+ private BigDecimal nutritionTotalPrice;
+
+ // 正餐和营养餐总价
+ private BigDecimal sumTotalPrice;
+
+ // 付款方式
+ private Integer payType;
+ // 分页信息
+ private Integer pageNum;
+ private Integer pageSize;
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtCateringDaoMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtCateringDaoMapper.java
new file mode 100644
index 0000000000000000000000000000000000000000..3f8543762e45deaa4c2c3815d8dbff1a7060fb5b
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtCateringDaoMapper.java
@@ -0,0 +1,19 @@
+package com.ruoyi.system.fantang.mapper;
+
+import com.ruoyi.system.fantang.domain.FtCateringDao;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+import java.util.List;
+
+/**
+ * 配餐功能Mapper接口
+ *
+ * @author ft
+ * @date 2020-12-07
+ */
+public interface FtCateringDaoMapper extends BaseMapper {
+
+ List listNewFormatter(FtCateringDao ftCateringDao);
+
+ FtCateringDao getByIdNewFormatter(Long id);
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtConfigDaoMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtConfigDaoMapper.java
new file mode 100644
index 0000000000000000000000000000000000000000..406e382f6dc036b43f0cddc6378130cfcdeb8608
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtConfigDaoMapper.java
@@ -0,0 +1,14 @@
+package com.ruoyi.system.fantang.mapper;
+
+import com.ruoyi.system.fantang.domain.FtConfigDao;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 饭堂参数Mapper接口
+ *
+ * @author ft
+ * @date 2020-12-07
+ */
+public interface FtConfigDaoMapper extends BaseMapper {
+
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtDepartDaoMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtDepartDaoMapper.java
new file mode 100644
index 0000000000000000000000000000000000000000..7bd69d1682f8c89930bfa461c3c6a9b2a90726af
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtDepartDaoMapper.java
@@ -0,0 +1,14 @@
+package com.ruoyi.system.fantang.mapper;
+
+import com.ruoyi.system.fantang.domain.FtDepartDao;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 科室管理Mapper接口
+ *
+ * @author ft
+ * @date 2020-11-24
+ */
+public interface FtDepartDaoMapper extends BaseMapper {
+
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtFaceEventDaoMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtFaceEventDaoMapper.java
new file mode 100644
index 0000000000000000000000000000000000000000..46336b3ae49187eaafd11110790298965d6bed26
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtFaceEventDaoMapper.java
@@ -0,0 +1,9 @@
+package com.ruoyi.system.fantang.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ruoyi.system.fantang.domain.FtFaceEventDao;
+import org.springframework.stereotype.Repository;
+
+@Repository
+public interface FtFaceEventDaoMapper extends BaseMapper {
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtFaceinfoDaoMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtFaceinfoDaoMapper.java
new file mode 100644
index 0000000000000000000000000000000000000000..7722080280dbfcab0524b215543f854cfbda3824
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtFaceinfoDaoMapper.java
@@ -0,0 +1,14 @@
+package com.ruoyi.system.fantang.mapper;
+
+import com.ruoyi.system.fantang.domain.FtFaceinfoDao;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 人脸信息Mapper接口
+ *
+ * @author ryo
+ * @date 2021-01-11
+ */
+public interface FtFaceinfoDaoMapper extends BaseMapper {
+
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtFoodDaoMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtFoodDaoMapper.java
new file mode 100644
index 0000000000000000000000000000000000000000..ab347a71902c071e46396051d1efce443cc68c5b
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtFoodDaoMapper.java
@@ -0,0 +1,16 @@
+package com.ruoyi.system.fantang.mapper;
+
+import com.ruoyi.system.fantang.domain.FtFoodDao;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springframework.stereotype.Repository;
+
+/**
+ * 食品管理Mapper接口
+ *
+ * @author ft
+ * @date 2020-11-24
+ */
+@Repository
+public interface FtFoodDaoMapper extends BaseMapper {
+
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtFoodDefaultDaoMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtFoodDefaultDaoMapper.java
new file mode 100644
index 0000000000000000000000000000000000000000..82eba136df91600b5c9fe561e354f718795f2cb3
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtFoodDefaultDaoMapper.java
@@ -0,0 +1,14 @@
+package com.ruoyi.system.fantang.mapper;
+
+import com.ruoyi.system.fantang.domain.FtFoodDefaultDao;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 默认报餐管理Mapper接口
+ *
+ * @author ft
+ * @date 2020-11-25
+ */
+public interface FtFoodDefaultDaoMapper extends BaseMapper {
+
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtFoodDemandDaoMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtFoodDemandDaoMapper.java
new file mode 100644
index 0000000000000000000000000000000000000000..6a3f32aa1791bca5c6d1bdb74cd9cb91d9f9720f
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtFoodDemandDaoMapper.java
@@ -0,0 +1,65 @@
+package com.ruoyi.system.fantang.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ruoyi.system.fantang.domain.FtFoodDemandDao;
+import com.ruoyi.system.fantang.domain.FtOrderDao;
+import com.ruoyi.system.fantang.domain.FtReportMealsDao;
+import org.apache.ibatis.annotations.Insert;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.Update;
+
+import java.util.List;
+
+/**
+ * 病人报餐Mapper接口
+ *
+ * @author ft
+ * @date 2020-12-03
+ */
+public interface FtFoodDemandDaoMapper extends BaseMapper {
+ @Insert("insert into ft_food_demand (patient_id, foods, type, flag,create_at ) select #{patient_id}, food_list, type, 1, now() FROM ft_food_default")
+ public Integer GenerateOrderByPatientId(@Param("patient_id") Long patientId);
+
+ @Select("select a.patient_id from ft_patient a where a.patient_id not in (select patient_id from ft_food_demand c )")
+ public List getNewPatientNotDemand();
+
+ List listNewFormatter(FtFoodDemandDao ftFoodDemandDao);
+
+ FtFoodDemandDao getByIdNewFormatter(Long id);
+
+ @Select("SELECT\n" +
+ "\td.depart_name,\n" +
+ "\tcount(*) AS total,\n" +
+ "\ta.type \n" +
+ "FROM\n" +
+ "\tft_report_meals a\n" +
+ "\tLEFT JOIN ft_patient c ON a.patient_id = c.patient_id\n" +
+ "\tLEFT JOIN ft_depart d ON c.depart_id = d.depart_id \n" +
+ "WHERE\n" +
+ "\tc.depart_id = d.depart_id and a.create_at BETWEEN #{start} and #{end}\n" +
+ "\t\n" +
+ "GROUP BY\n" +
+ "\td.depart_name,\n" +
+ "\ta.type")
+ List getStatisticsOfDate(@Param("start") String start, @Param("end") String end);
+
+ @Select("SELECT\n" +
+ "\ta.type,\n" +
+ "\tc.depart_name,\n" +
+ "\tCOUNT(*) AS total \n" +
+ "FROM\n" +
+ "\tft_food_demand a\n" +
+ "\tLEFT JOIN ft_patient b ON b.patient_id = a.patient_id\n" +
+ "\tLEFT JOIN ft_depart c ON c.depart_id = b.depart_id \n" +
+ "WHERE\n" +
+ "\tb.depart_id = c.depart_id \n" +
+ "\tAND flag = 1 \n" +
+ "GROUP BY\n" +
+ "\ta.type,\n" +
+ "\tc.depart_name")
+ List getStatisticsFoodDemand();
+
+ @Update("UPDATE ft_food_demand set flag = 0 where patient_id = #{patientId} and type = 4 ")
+ void updateExtraByPatientId(@Param("patientId") Long patientId);
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtInvoiceDaoMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtInvoiceDaoMapper.java
new file mode 100644
index 0000000000000000000000000000000000000000..1271aca07ec95cb3a86ac9b501e91b46bc950d76
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtInvoiceDaoMapper.java
@@ -0,0 +1,14 @@
+package com.ruoyi.system.fantang.mapper;
+
+import com.ruoyi.system.fantang.domain.FtInvoiceDao;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 财务收费开票Mapper接口
+ *
+ * @author ft
+ * @date 2020-12-08
+ */
+public interface FtInvoiceDaoMapper extends BaseMapper {
+
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtNotifyDaoMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtNotifyDaoMapper.java
new file mode 100644
index 0000000000000000000000000000000000000000..636a26d2354786ef2939c371e043dd86947072ae
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtNotifyDaoMapper.java
@@ -0,0 +1,16 @@
+package com.ruoyi.system.fantang.mapper;
+
+import com.ruoyi.system.fantang.domain.FtNotifyDao;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springframework.stereotype.Repository;
+
+/**
+ * 系统信息Mapper接口
+ *
+ * @author ft
+ * @date 2020-12-17
+ */
+@Repository
+public interface FtNotifyDaoMapper extends BaseMapper {
+
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtNutritionFoodDaoMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtNutritionFoodDaoMapper.java
new file mode 100644
index 0000000000000000000000000000000000000000..fcd628d78a83b987d1871d357d92e898bd03ddcf
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtNutritionFoodDaoMapper.java
@@ -0,0 +1,14 @@
+package com.ruoyi.system.fantang.mapper;
+
+import com.ruoyi.system.fantang.domain.FtNutritionFoodDao;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 病患营养配餐Mapper接口
+ *
+ * @author ft
+ * @date 2020-12-03
+ */
+public interface FtNutritionFoodDaoMapper extends BaseMapper {
+
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtOrderDaoMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtOrderDaoMapper.java
new file mode 100644
index 0000000000000000000000000000000000000000..c2e77c84092765bb4dfec1f70f1ee4eb0a08a956
--- /dev/null
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtOrderDaoMapper.java
@@ -0,0 +1,150 @@
+package com.ruoyi.system.fantang.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.system.fantang.domain.FtFoodDemandDao;
+import com.ruoyi.system.fantang.domain.FtOrderDao;
+import com.ruoyi.system.fantang.domain.FtStaffDemandDao;
+import com.ruoyi.system.fantang.domain.FtStaffStopMealsDao;
+import org.apache.ibatis.annotations.Insert;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+
+import java.util.List;
+
+/**
+ * 订单管理Mapper接口
+ *
+ * @author ft
+ * @date 2020-11-19
+ */
+public interface FtOrderDaoMapper extends BaseMapper {
+
+ @Insert("insert into ft_order (order_type, staff_id, order_src, create_at, order_date, order_list, total_price) select type as order_type, staff_id, 1 as order_src, now() as create_at, date_add(now(), interval 1 day) as order_date, foods, (select sum(price) from ft_food f where FIND_IN_SET(f.food_id,d.foods)) as price from ft_staff_demand d where d.demand_mode = 1")
+ void GenerateStaffTomorrowOrder();
+
+ @Select("select a.order_type, count(a.order_type) as count_order , c.depart_name from ft_order a\n" +
+ " LEFT JOIN ft_staff_info b on a.staff_id = b.staff_id\n" +
+ " LEFT JOIN ft_depart c on b.depart_id = c.depart_id where b.depart_id = c.depart_id and a.order_date BETWEEN #{start} and #{end}\n" +
+ " GROUP BY a.order_type, c.depart_name")
+ IPage statisGetOrderOfDate(Page page, @Param("start") String start, @Param("end") String end);
+
+ @Select("SELECT\n" +
+ "\ta.order_type,\n" +
+ "\tcount( a.order_type ) AS count_order,\n" +
+ "\tc.depart_name,\n" +
+ "\tb.`name` AS staff_name,\n" +
+ "\tb.tel \n" +
+ "FROM\n" +
+ "\tft_order a\n" +
+ "\tLEFT JOIN ft_staff_info b ON a.staff_id = b.staff_id\n" +
+ "\tLEFT JOIN ft_depart c ON b.depart_id = c.depart_id \n" +
+ "WHERE\n" +
+ "\tb.depart_id = c.depart_id \n" +
+ "\tAND a.order_date BETWEEN #{start} \n" +
+ "\tAND #{end} \n" +
+ "GROUP BY\n" +
+ "\ta.order_type,\n" +
+ "\tc.depart_name,\n" +
+ "\tb.`name`,\n" +
+ "\tb.tel")
+ IPage statisGetOrderOfDateByPerson(Page page, @Param("start") String start, @Param("end") String end);
+
+ List listDetailedByDate(@Param("orderType") Integer orderType, @Param("start") String start, @Param("end") String end);
+
+ List listAllDetailedByDate(String start, String end);
+
+
+ @Select("SELECT\n" +
+ "\t* \n" +
+ "FROM\n" +
+ "\tft_order \n" +
+ "WHERE\n" +
+ "\tstaff_id = #{staffId} \n" +
+ "\tAND order_type = #{type} \n" +
+ "\tAND order_date BETWEEN DATE(\n" +
+ "\tNOW()) \n" +
+ "\tAND date_add(\n" +
+ "\tnow(),\n" +
+ "\tINTERVAL 1 DAY)")
+ FtOrderDao getNowOrder(@Param("staffId") Long staffId, @Param("type") int type);
+
+
+ @Insert("INSERT INTO ft_order ( order_type, staff_id, order_list, total_price, create_at, pay_type, pay_flag, write_off_flag, write_off_at, device_id, order_date ) SELECT\n" +
+ "#{type},\n" +
+ "#{staffId},\n" +
+ "b.food_list,\n" +
+ "b.price,\n" +
+ "now(),\n" +
+ "1,\n" +
+ "1,\n" +
+ "1,\n" +
+ "NOW(),\n" +
+ "#{deviceId},\n" +
+ "NOW() \n" +
+ "FROM\n" +
+ "\tft_food_default b \n" +
+ "WHERE\n" +
+ "\tb.type = #{type}")
+ void insertOrderAndWriteOff(@Param("staffId") Long staffId, @Param("type") int type, @Param("deviceId") Long deviceId);
+
+ @Select("SELECT\n" +
+ "\tc.depart_name,\n" +
+ "\ta.type,\n" +
+ "\ta.flag,\n" +
+ "count(*) as total\n" +
+ "FROM\n" +
+ "\tft_food_demand a\n" +
+ "LEFT JOIN ft_patient b ON a.patient_id = b.patient_id\n" +
+ "LEFT JOIN ft_depart c ON b.depart_id = c.depart_id\n" +
+ "WHERE\n" +
+ "\tb.off_flag = 0\n" +
+ "AND a.flag = 1\n" +
+ "GROUP BY a.type, c.depart_name")
+ List getStatisticsReportMealsOfTomorrow();
+
+ @Select("SELECT\n" +
+ "\tc.depart_name,\n" +
+ "\ta.type,\n" +
+ "\tcount(*) as total\n" +
+ "FROM\n" +
+ "\tft_staff_demand a\n" +
+ "LEFT JOIN ft_staff_info b ON a.staff_id = b.staff_id\n" +
+ "LEFT JOIN ft_depart c ON b.depart_id = c.depart_id\n" +
+ "WHERE\n" +
+ "\ta.demand_mode = 1\n" +
+ "GROUP BY\n" +
+ "\tc.depart_name,\n" +
+ "\ta.type")
+ List