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