新增病患报餐接口
This commit is contained in:
parent
82d980b09b
commit
3122699557
@ -2,6 +2,7 @@ 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;
|
||||
@ -33,7 +34,7 @@ public class ClientPatientController extends BaseController {
|
||||
private IFtDepartDaoService iFtDepartDaoService;
|
||||
|
||||
@Autowired
|
||||
private IFtReportMealsDaoService iFtReportMealsDaoService;
|
||||
private IFtReportMealsDaoService reportMealsDaoService;
|
||||
|
||||
@Autowired
|
||||
private IFtFoodDemandDaoService iFtFoodDemandDaoService;
|
||||
@ -123,7 +124,7 @@ public class ClientPatientController extends BaseController {
|
||||
*/
|
||||
@PutMapping("/batchUpdateReportMeals")
|
||||
public AjaxResult batchUpdateReportMeals(@RequestBody List<FtReportMealsDao> reportMealsDaoList) {
|
||||
return AjaxResult.success(iFtReportMealsDaoService.updateBatchById(reportMealsDaoList));
|
||||
return AjaxResult.success(reportMealsDaoService.updateBatchById(reportMealsDaoList));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -131,7 +132,7 @@ public class ClientPatientController extends BaseController {
|
||||
*/
|
||||
@PutMapping("/updateReportMeals")
|
||||
public AjaxResult updateReportMeals(@RequestBody FtReportMealsDao ftReportMealsDao) {
|
||||
return AjaxResult.success(iFtReportMealsDaoService.updateById(ftReportMealsDao));
|
||||
return AjaxResult.success(reportMealsDaoService.updateById(ftReportMealsDao));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -214,7 +215,20 @@ public class ClientPatientController extends BaseController {
|
||||
*/
|
||||
@GetMapping("/getStatisticsFoods")
|
||||
public AjaxResult getStatisticsFoods(@RequestParam("departId") Integer departId, @RequestParam("date") Date day) {
|
||||
List<FtReportMealVo> list = iFtReportMealsDaoService.getStatisticsFoods(departId, day);
|
||||
List<FtReportMealVo> list = reportMealsDaoService.getStatisticsFoods(departId, day);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@PostMapping("/tomorrowReport")
|
||||
public AjaxResult tomorrowReport(@RequestBody JSONArray list){
|
||||
System.out.println(list);
|
||||
List<JSONObject> objects = list.toJavaList(JSONObject.class);
|
||||
for (JSONObject object : objects) {
|
||||
FtReportMealsDao dao = JSONObject.toJavaObject(object, FtReportMealsDao.class);
|
||||
reportMealsDaoService.updateById(dao);
|
||||
}
|
||||
|
||||
AjaxResult result = AjaxResult.success();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
@ -50,8 +50,8 @@ public interface FtReportMealsDaoMapper extends BaseMapper<FtReportMealsDao> {
|
||||
"LEFT JOIN ft_depart c on b.depart_id = c.depart_id \n" +
|
||||
"where b.depart_id = #{departId} and a.dining_at BETWEEN #{beginOfDay} and #{endOfDay}\n" +
|
||||
"GROUP BY a.type, foods")
|
||||
List<FtReportMealVo> getStatisticsFoods(Integer departId, DateTime beginOfDay, DateTime endOfDay);
|
||||
List<FtReportMealVo> getStatisticsFoods(@Param("departId") Integer departId,@Param("beginOfDay") DateTime beginOfDay, @Param("endOfDay") DateTime endOfDay);
|
||||
|
||||
@Select("SELECT a.patient_id,sum(a.price) as dinner_total_price , sum(a.nutrition_food_price ) as nutrition_total_price , sum(a.total_price) as sum_total_price FROM ft_report_meals a where a.patient_id = #{patientId} AND a.settlement_flag = 0 AND a.dining_flag = 1")
|
||||
ReportMealsPriceEntity sumAllTotalPrice(Long patientId);
|
||||
ReportMealsPriceEntity sumAllTotalPrice(@Param("patientId") Long patientId);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user