病患默认配餐配置表,报餐表添加营养配餐开通标志字段

This commit is contained in:
ryoeiken 2021-01-19 17:06:46 +08:00
parent e940708d52
commit d0f5c425b2
7 changed files with 20 additions and 5 deletions

View File

@ -190,17 +190,12 @@ public class FtCateringDaoController extends BaseController {
@PutMapping("/paste")
public AjaxResult paste(@RequestBody JSONObject params) {
System.out.println(params);
List<Long> ids = params.getJSONArray("ids").toJavaList(Long.class);
List<FtCateringDao> ftCateringDaoList = params.getJSONArray("copyItem").toJavaList(FtCateringDao.class);
for (Long id : ids) {
iFtCateringDaoService.paste(id,ftCateringDaoList);
}
return AjaxResult.success("已修改");
}

View File

@ -132,4 +132,6 @@ public class FtFoodDemandDao extends BasePatient implements Serializable {
*/
@TableField(exist = false)
private String nutritionFood;
private Boolean openFlag;
}

View File

@ -136,4 +136,6 @@ public class FtReportMealsDao implements Serializable {
@TableField(exist = false)
private Integer total;
private Boolean openFlag;
}

View File

@ -95,6 +95,7 @@ public class FtCateringDaoServiceImpl extends ServiceImpl<FtCateringDaoMapper, F
FtFoodDemandDao foodDemandDao = new FtFoodDemandDao();
foodDemandDao.setNutritionFoodFlag(false);
foodDemandDao.setOpenFlag(false);
for (Long id : ids) {
UpdateWrapper<FtCateringDao> wrapper = new UpdateWrapper<>();
@ -152,6 +153,7 @@ public class FtCateringDaoServiceImpl extends ServiceImpl<FtCateringDaoMapper, F
FtFoodDemandDao foodDemandDao = new FtFoodDemandDao();
foodDemandDao.setNutritionFoodId(cateringDao.getNumber());
foodDemandDao.setNutritionFoodFlag(true);
foodDemandDao.setOpenFlag(true);
QueryWrapper<FtFoodDemandDao> wrapper = new QueryWrapper<>();
wrapper.eq("patient_id", patientId);
wrapper.eq("type", cateringDao.getType());
@ -169,10 +171,20 @@ public class FtCateringDaoServiceImpl extends ServiceImpl<FtCateringDaoMapper, F
ftCateringDao.setUpdateAt(new Date());
ftCateringDao.setSuspendFlag(true);
FtFoodDemandDao ftFoodDemandDao = new FtFoodDemandDao();
ftFoodDemandDao.setOpenFlag(true);
ftFoodDemandDao.setUpdateAt(new Date());
for (Long id : ids) {
UpdateWrapper<FtCateringDao> wrapper = new UpdateWrapper<>();
wrapper.eq("patient_id", id);
rows += this.baseMapper.update(ftCateringDao, wrapper);
// 更新该病患的报餐配置记录
UpdateWrapper<FtFoodDemandDao> foodDemandWrapper = new UpdateWrapper<>();
foodDemandWrapper.eq("patient_id", id);
foodDemandDaoService.update(ftFoodDemandDao, foodDemandWrapper);
}
return rows;
@ -202,6 +214,7 @@ public class FtCateringDaoServiceImpl extends ServiceImpl<FtCateringDaoMapper, F
FtFoodDemandDao foodDemandDao = new FtFoodDemandDao();
foodDemandDao.setNutritionFoodId(ftCateringDao.getNumber());
foodDemandDao.setNutritionFoodFlag(ftCateringDao.getFlag());
foodDemandDao.setOpenFlag(ftCateringDao.getSuspendFlag());
QueryWrapper<FtFoodDemandDao> foodDemandWrapper = new QueryWrapper<>();
foodDemandWrapper.eq("patient_id", id);
foodDemandWrapper.eq("type", i + 1);

View File

@ -88,6 +88,7 @@ public class FtFoodDemandDaoServiceImpl extends ServiceImpl<FtFoodDemandDaoMappe
FtFoodDemandDao foodDemand = foodDemandList.get(i);
foodDemand.setNutritionFoodId(ftCateringList.get(i).getNumber());
foodDemand.setNutritionFoodFlag(ftCateringList.get(i).getFlag());
foodDemand.setOpenFlag(true);
foodDemand.setUpdateAt(new Date());
rows += this.baseMapper.updateById(foodDemand);
}

View File

@ -22,6 +22,7 @@
<result property="flag" column="flag"/>
<result property="nutritionFoodId" column="nutrition_food_id"/>
<result property="nutritionFoodFlag" column="nutrition_food_flag"/>
<result property="openFlag" column="open_flag"/>
</resultMap>
<select id="listNewFormatter" resultType="com.ruoyi.system.fantang.domain.FtFoodDemandDao">

View File

@ -25,6 +25,7 @@
<result property="meat" column="meat"/>
<result property="rice" column="rice"/>
<result property="egg" column="egg"/>
<result property="openFlag" column="open_flag"/>
</resultMap>
<select id="listMealsWithInSettle" resultType="com.ruoyi.system.fantang.domain.FtReportMealsDao">