优化:初始化病患数据时,默认将加餐状态设置为禁用
This commit is contained in:
parent
7fa65bfe15
commit
a8a1b53794
@ -7,6 +7,7 @@ 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;
|
||||
|
||||
@ -58,4 +59,7 @@ public interface FtFoodDemandDaoMapper extends BaseMapper<FtFoodDemandDao> {
|
||||
"\ta.type,\n" +
|
||||
"\tc.depart_name")
|
||||
List<FtReportMealsDao> getStatisticsFoodDemand();
|
||||
|
||||
@Update("UPDATE ft_food_demand set flag = 0 where patient_id = #{patientId} and type = 4 ")
|
||||
void updateExtraByPatientId(@Param("patientId") Long patientId);
|
||||
}
|
||||
|
@ -32,7 +32,10 @@ public class FtFoodDemandDaoServiceImpl extends ServiceImpl<FtFoodDemandDaoMappe
|
||||
// 获取所有未设置默认订餐需求病人
|
||||
List<Long> newPatients = this.baseMapper.getNewPatientNotDemand();
|
||||
for (Long patientId : newPatients) {
|
||||
// 先创建四个用餐信息
|
||||
this.baseMapper.GenerateOrderByPatientId(patientId);
|
||||
// 更新加餐信息为禁用状态
|
||||
this.baseMapper.updateExtraByPatientId(patientId);
|
||||
}
|
||||
return newPatients.size();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user