From 4e1f90fb79b05f427681af860bc92116c21aab22 Mon Sep 17 00:00:00 2001 From: wtt Date: Thu, 22 Apr 2021 20:39:12 +0800 Subject: [PATCH] update --- .../web/controller/BabyNutritionController.java | 13 ++++---- .../operate/web/facade/BabyCheckFacade.java | 38 +++++++++++++++++++--- .../operate/web/facade/BabyNutritionFacade.java | 14 +++++--- 3 files changed, 51 insertions(+), 14 deletions(-) diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyNutritionController.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyNutritionController.java index 517afca..b2bc833 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyNutritionController.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyNutritionController.java @@ -176,9 +176,9 @@ public class BabyNutritionController extends BaseController { @ResponseBody @TokenRequired public BaseObjectResponse queryQhfyBabyDietReport(@PathVariable("id") String id, HttpServletRequest request, @RequestParam("doctorId")String doctorId - , @RequestParam(required = false)String oid,@RequestParam(required = false)String rid + , @RequestParam(required = false)String oid,@RequestParam(required = false)String rid, @RequestParam(required = false) Integer yyMonth ) { - return babyNutritionFacade.queryQhfyBabyDietReport(id, getUserId(request), doctorId, oid, rid); + return babyNutritionFacade.queryQhfyBabyDietReport(id, getUserId(request), doctorId, oid, rid,yyMonth); } @@ -196,23 +196,24 @@ public class BabyNutritionController extends BaseController { { return babyNutritionFacade.queryBabyDietReport(id, null, null); } - return babyNutritionFacade.queryQhfyBabyDietReport(id, null, null,null,null); + return babyNutritionFacade.queryQhfyBabyDietReport(id, null, null,null,null,null); } /** - * 查询选择 + * 查询选择 month * @param id + * @param yyMonth //如果选择了营养月龄,就按照营养月龄出报告的评价和文字内容 * @param request * @return */ @RequestMapping(value = "/queryQhdDeitSelect", method = RequestMethod.GET) @ResponseBody @TokenRequired - public BaseObjectResponse queryQhdDeitSelect(@RequestParam(required = true) String id, HttpServletRequest request + public BaseObjectResponse queryQhdDeitSelect(@RequestParam(required = true) String id, @RequestParam(required = false) Integer yyMonth, HttpServletRequest request ) { - return babyNutritionFacade.queryQhdDeitSelect(id, getUserId(request)); + return babyNutritionFacade.queryQhdDeitSelect(id, getUserId(request),yyMonth); } diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyCheckFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyCheckFacade.java index ce1d796..93693ac 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyCheckFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyCheckFacade.java @@ -2654,9 +2654,9 @@ public class BabyCheckFacade extends BaseServiceImpl { //体重 if (type == 0) { - res = getGrowthValueMapNew(birth, value, sex, dueDate, babyId, checkDate); + res = getGrowthValueMapNew(birth, value, sex, dueDate, babyId, checkDate,null); } else { - res = getGrowthValue1MapNew(birth, value, sex, type, dueDate, checkDate); + res = getGrowthValue1MapNew(birth, value, sex, type, dueDate, checkDate,null); } BaseObjectResponse objectResponse = new BaseObjectResponse(); @@ -2837,7 +2837,19 @@ public class BabyCheckFacade extends BaseServiceImpl { return map; } - public Map getGrowthValueMapNew(String birth, Double value, Integer sex, String dueDate, String babyId, String checkDate) { + /** + * + * @param birth + * @param value + * @param sex + * @param dueDate + * @param babyId + * @param checkDate + * @param yyMonth //如果选择了营养月龄,就按照营养月龄出报告的评价和文字内容 + * @Author: 武涛涛 + * @Date: 2021/4/22 20:03 + */ + public Map getGrowthValueMapNew(String birth, Double value, Integer sex, String dueDate, String babyId, String checkDate,Integer yyMonth) { Map map = new HashMap <>(); @@ -2898,6 +2910,9 @@ public class BabyCheckFacade extends BaseServiceImpl { } else { //计算儿童的月龄 int monthAge = DateUtil.getBabyAgeMonth(DateUtil.parseYMD(birth), DateUtil.parseYMD(checkDate)); + if(yyMonth != null){ + monthAge = yyMonth; //如果选择了营养月龄,就按照营养月龄出报告的评价和文字内容 + } //查询该月龄的年龄别体重值 list = babyCheckService.queryBabyHealthConfig(monthAge, sex, 0); } @@ -2979,8 +2994,20 @@ public class BabyCheckFacade extends BaseServiceImpl { return map; } + /** + * 增加參數注釋 + * @param birth + * @param value + * @param sex + * @param type + * @param dueDate + * @param checkDate + * @param yyMonth /如果选择了营养月龄,就按照营养月龄出报告的评价和文字内容 + * @Author: 武涛涛 + * @Date: 2021/4/22 20:05 + */ public Map getGrowthValue1MapNew(String birth, Double value, Integer sex, - Integer type, String dueDate, String checkDate) { + Integer type, String dueDate, String checkDate,Integer yyMonth) { Map map = new HashMap <>(); //计算儿童的月龄 int monthAge = 0; @@ -2991,6 +3018,9 @@ public class BabyCheckFacade extends BaseServiceImpl { } } else { monthAge = DateUtil.getBabyAgeMonth(DateUtil.parseYMD(birth), DateUtil.parseYMD(checkDate)); + if(yyMonth != null){ + monthAge = yyMonth; + } } diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyNutritionFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyNutritionFacade.java index 3b8683d..df506bb 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyNutritionFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyNutritionFacade.java @@ -1890,7 +1890,7 @@ public class BabyNutritionFacade { /** * 秦皇岛市妇幼精简版儿童膳食报告 */ - public BaseObjectResponse queryQhfyBabyDietReport(String id, Integer userId, String doctorId,String oid,String rid + public BaseObjectResponse queryQhfyBabyDietReport(String id, Integer userId, String doctorId,String oid,String rid,Integer yyMonth ) { BaseObjectResponse objectResponse = new BaseObjectResponse(); Map data = new HashMap(); @@ -1937,16 +1937,19 @@ public class BabyNutritionFacade { Map weightRes = babyCheckFacade.getGrowthValueMapNew(DateUtil.getyyyy_MM_dd(baby.getBirth()) - , model.getWeight(), baby.getSex(), null, baby.getId(), DateUtil.getyyyy_MM_dd(model.getNutritiTime())); + , model.getWeight(), baby.getSex(), null, baby.getId(), DateUtil.getyyyy_MM_dd(model.getNutritiTime()),yyMonth); Map heightRes = babyCheckFacade.getGrowthValue1MapNew(DateUtil.getyyyy_MM_dd(baby.getBirth()) - , model.getHeight(), baby.getSex(), 1, null, DateUtil.getyyyy_MM_dd(model.getNutritiTime())); + , model.getHeight(), baby.getSex(), 1, null, DateUtil.getyyyy_MM_dd(model.getNutritiTime()),yyMonth); //体重评价 map.put("weightEvaluate", weightRes.get("res")); //身高评价 map.put("heightEvaluate", heightRes.get("res")); int month = DateUtil.getMonth(baby.getBirth(), model.getNutritiTime()); + if(yyMonth != null){ + month = yyMonth; //如果选择了营养月龄,就按照营养月龄出报告的评价和文字内容 + } if (month > 60) { return new BaseObjectResponse().setData(data).setErrorcode(ErrorCodeConstants.NO_DATA).setErrormsg("月龄范围没有报告"); } @@ -2281,7 +2284,7 @@ public class BabyNutritionFacade { return objectResponse; } - public BaseObjectResponse queryQhdDeitSelect(String id, Integer userId) { + public BaseObjectResponse queryQhdDeitSelect(String id, Integer userId,Integer yyMonth) { BabyNutritionQuery babyQuery = new BabyNutritionQuery(); String hospitalId = autoMatchFacade.getHospitalId(userId); babyQuery.setHospitalId(hospitalId); @@ -2312,6 +2315,9 @@ public class BabyNutritionFacade { BabyModel baby = babyBookbuildingService.queryBabyBuildById(model.getBabyId()); int month = DateUtil.getMonth(baby.getBirth(), model.getNutritiTime()); + if(yyMonth != null){ + month = yyMonth; //如果选择了营养月龄,就按照营养月龄出报告的评价和文字内容 + } if (month > 60) { return new BaseObjectResponse().setData(data).setErrorcode(ErrorCodeConstants.NO_DATA).setErrormsg("月龄范围没有报告"); } -- 1.8.3.1