From d2ab14d58e7c7ce4f5837b6cab2133d6a2bef001 Mon Sep 17 00:00:00 2001 From: shiyang <316555390@qq.com> Date: Wed, 19 Jan 2022 08:56:09 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BE=8E=E7=94=9F=E5=8E=BF=E5=8C=BB=E9=99=A2?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E6=95=B0=E6=8D=AE=E5=88=86=E6=9E=90=E6=8A=A5?= =?UTF-8?q?=E5=91=8A-4.2-=E5=84=BF=E4=BF=9D=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/BabyCheckController.java | 18 ++++++ .../operate/web/facade/BabyCheckFacade.java | 65 ++++++++++++++++++++++ 2 files changed, 83 insertions(+) diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyCheckController.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyCheckController.java index c2b1a20..2fd10bb 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyCheckController.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyCheckController.java @@ -23,6 +23,7 @@ import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; import javax.validation.Valid; +import java.util.Date; /** @@ -660,4 +661,21 @@ public class BabyCheckController extends BaseController { @RequestParam(required = true) Integer limit) { return babyCheckFacade.getBabyCheckHemoglobinDetails(hospitalId,checkDate,ageType,hemoglobinType,page,limit); } + + /** + * 统计管理-孕产妇数据统计-儿保检查 + * + * @param hospitalId + * @param startDate + * @param endDate + * @return + */ + @RequestMapping(value = "/getBabyCheckStatis", method = RequestMethod.GET) + @ResponseBody + @TokenRequired + public BaseResponse getBabyCheckStatis(@RequestParam(required = true)String hospitalId, + @RequestParam(required = true) Date startDate, + @RequestParam(required = true)Date endDate) { + return babyCheckFacade.getBabyCheckStatis(hospitalId, startDate, endDate); + } } \ No newline at end of file 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 4f3db3c..3015278 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 @@ -4909,4 +4909,69 @@ public class BabyCheckFacade extends BaseServiceImpl { } return new BaseObjectResponse().setData(mapList).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setPageInfo(query.getPageInfo()); } + + public BaseResponse getBabyCheckStatis(String hospitalId, Date startDate, Date endDate) { + BaseResponse br=new BaseResponse(); + Map map=new HashMap<>(); +// long month0=0,month1=0,month0=0,month0=0,month0=0,month0=0,month0=0,month0=0,month0=0,month0=0,month0=0, +// month0=0,month0=0,month0=0,month0=0,month0=0,month0=0,month0=0month0=0month0=0,month0=0,month0=0, +// ; + BabyCheckModelQuery query = new BabyCheckModelQuery(); + query.setHospitalId(hospitalId); + query.setYn(YnEnums.YES.getId()); + query.setCheckDateStart(startDate); + query.setCheckDateEnd(endDate); + List babyCheckModels = babyCheckService.queryBabyCheckRecords(query); + int total=0; + for (BabyCheckModel babyCheckModel : babyCheckModels) { + for (int i=0;i<41;i++){ + if(map.get("month"+i)==null){ + map.put("month"+i,0); + } + switch (i){ + case 36: + if(babyCheckModel.getCheckMonth()>35&&babyCheckModel.getCheckMonth()<48){ + map.put("month"+i,map.get("month"+i)+1); + total++; + } + break; + case 37: + if(babyCheckModel.getCheckMonth()>47&&babyCheckModel.getCheckMonth()<60){ + map.put("month"+i,map.get("month"+i)+1); + total++; + } + break; + case 38: + if(babyCheckModel.getCheckMonth()>59&&babyCheckModel.getCheckMonth()<72){ + map.put("month"+i,map.get("month"+i)+1); + total++; + } + break; + case 39: + if(babyCheckModel.getCheckMonth()>71&&babyCheckModel.getCheckMonth()<84){ + map.put("month"+i,map.get("month"+i)+1); + total++; + } + break; + case 40: + if(babyCheckModel.getCheckMonth()>83){ + map.put("month"+i,map.get("month"+i)+1); + total++; + } + break; + default: + if(i==babyCheckModel.getCheckMonth()){ + map.put("month"+i,map.get("month"+i)+1); + total++; + } + break; + } + } + } + map.put("total", total); + br.setErrorcode(ErrorCodeConstants.SUCCESS); + br.setErrormsg("成功"); + br.setObject(map); + return br; + } } \ No newline at end of file -- 1.8.3.1