From 7a253f16289ee1c06a9e4c571260939530301bb4 Mon Sep 17 00:00:00 2001 From: czx <28353131@qq.com> Date: Tue, 2 Feb 2021 18:20:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=9A=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E7=97=85=E6=82=A3=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8C=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E6=98=8E=E5=A4=A9=E7=9A=84=E6=8A=A5=E9=A4=90=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fantang/controller/FtPatientDaoController.java | 5 +++++ .../system/fantang/mapper/FtReportMealVoMapper.java | 11 +++++++++++ .../fantang/service/IFtReportMealsDaoService.java | 2 ++ .../service/impl/FtReportMealsDaoServiceImpl.java | 5 +++++ ruoyi-ui/package.json | 2 +- 5 files changed, 24 insertions(+), 1 deletion(-) 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 index 490fe2439..b0e1435ae 100644 --- 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 @@ -13,6 +13,7 @@ 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; @@ -37,6 +38,9 @@ public class FtPatientDaoController extends BaseController { private final IFtFoodDemandDaoService iFtFoodDemandDaoService; + @Autowired + private IFtReportMealsDaoService reportMealsDaoService; + /** * 查询病人管理列表 */ @@ -124,6 +128,7 @@ public class FtPatientDaoController extends BaseController { iFtPatientDaoService.save(ftPatientDao); iFtFoodDemandDaoService.GenerateOrderByPatientId(ftPatientDao.getPatientId()); + reportMealsDaoService.insertTomorrowReportMealByPatient(ftPatientDao.getPatientId()); return AjaxResult.success("已添加"); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtReportMealVoMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtReportMealVoMapper.java index baff63701..52ee2bf33 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtReportMealVoMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtReportMealVoMapper.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.system.fantang.domain.FtReportMealsDao; import com.ruoyi.system.fantang.vo.FtReportMealVo; 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 org.springframework.stereotype.Repository; @@ -39,6 +40,16 @@ public interface FtReportMealVoMapper extends BaseMapper { "LEFT JOIN ft_nutrition_food e ON e.id = d.nutrition_food_id") public void insertTomorrowReportMeal(); + // 为指定病患,生成次日报餐记录,并通过ft_food 菜品价格计算菜单总价 + @Insert("INSERT INTO ft_report_meals (create_at,type,patient_id,foods,settlement_flag,price,open_flag,nutrition_food_flag,nutrition_food_id,nutrition_food_price) " + + "SELECT date_add(now(), INTERVAL 1 DAY), d.type, d.patient_id, d.foods,0," + + "(SELECT sum(price) FROM ft_food f WHERE FIND_IN_SET(f.food_id, d.foods)) AS price," + + "d.open_flag,0,d.nutrition_food_id, e.price as nutrition_food_price " + + "FROM ft_food_demand d where d.patient_id = #{patientId}" + + "LEFT JOIN ft_patient p ON p.patient_id = d.patient_id AND p.off_flag = 0 " + + "LEFT JOIN ft_nutrition_food e ON e.id = d.nutrition_food_id") + public void insertTomorrowReportMealByPatient(@Param("patientId") Long patientId); + @Update("UPDATE ft_report_meals set dining_flag = 1, dining_at = now() where type = 1 and create_at =CURDATE()") Integer updateBreakfastDinnerFlag(); diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtReportMealsDaoService.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtReportMealsDaoService.java index ef8edcec6..ab7202bdd 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtReportMealsDaoService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtReportMealsDaoService.java @@ -42,5 +42,7 @@ public interface IFtReportMealsDaoService extends IService { List getStatisticsFoods(Integer departId, Date day); List listPatientReportMeals(FtReportMealsDao ftReportMealsDao); + + void insertTomorrowReportMealByPatient(Long patientId); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtReportMealsDaoServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtReportMealsDaoServiceImpl.java index 0aac27371..efe370779 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtReportMealsDaoServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtReportMealsDaoServiceImpl.java @@ -145,4 +145,9 @@ public class FtReportMealsDaoServiceImpl extends ServiceImpl listPatientReportMeals(FtReportMealsDao ftReportMealsDao) { return this.baseMapper.listPatientReportMeals(ftReportMealsDao); } + + @Override + public void insertTomorrowReportMealByPatient(Long patientId) { + ftReportMealVoMapper.insertTomorrowReportMealByPatient(patientId); + } } diff --git a/ruoyi-ui/package.json b/ruoyi-ui/package.json index 96096e223..6e9327100 100644 --- a/ruoyi-ui/package.json +++ b/ruoyi-ui/package.json @@ -41,7 +41,7 @@ "clipboard": "2.0.6", "core-js": "3.8.1", "echarts": "4.9.0", - "element-ui": "2.14.1", + "element-ui": "2.15.0", "file-saver": "2.0.4", "fuse.js": "6.4.3", "highlight.js": "10.4.1",