From fbd68b80cd160e05ce5562fa601c51fb5c82c772 Mon Sep 17 00:00:00 2001 From: liquanyu Date: Fri, 2 Jul 2021 13:56:12 +0800 Subject: [PATCH] update --- .../web/controller/BabyCheckController.java | 20 +- .../operate/web/facade/BabyCheckFacade.java | 66 ++- .../operate/web/result/BabyCountResult.java | 602 +++++++++++++++++++++ 3 files changed, 684 insertions(+), 4 deletions(-) create mode 100644 platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/BabyCountResult.java 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 e2a1d26..216e6fc 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 @@ -188,7 +188,7 @@ public class BabyCheckController extends BaseController { @RequestParam(value = "waskSon", required = false) Integer waskSon, @RequestParam(value = "checkDoctorId", required = false) String checkDoctorId, Integer page, Integer limit, HttpServletRequest request) { - return babyCheckFacade.babyCheckList(checkTime, queryNo, startCheckMonthAge, endCheckMonthAge, nextDate, highRisk, waskSon,checkDoctorId, page, limit, getUserId(request)); + return babyCheckFacade.babyCheckList(checkTime, queryNo, startCheckMonthAge, endCheckMonthAge, nextDate, highRisk, waskSon, checkDoctorId, page, limit, getUserId(request)); } /** @@ -317,7 +317,7 @@ public class BabyCheckController extends BaseController { @RequestParam(required = false) String type ) { BaseObjectResponse objectResponse = new BaseObjectResponse(); - objectResponse.setData(patientWeightService.getNls(month,xlvalue,ddz,sxdz, rs,yy,sqxw,type)); + objectResponse.setData(patientWeightService.getNls(month, xlvalue, ddz, sxdz, rs, yy, sqxw, type)); objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); objectResponse.setErrormsg("成功"); return objectResponse; @@ -546,4 +546,20 @@ public class BabyCheckController extends BaseController { public BaseResponse getBabyActualReport(@RequestParam String checkTime, HttpServletRequest request) { return babyCheckFacade.getBabyActualReport(checkTime, getUserId(request)); } + + + + @RequestMapping(method = RequestMethod.GET, value = "/getOrgBabyCount") + @ResponseBody + @TokenRequired + public BaseResponse getOrgBabyCount(@RequestParam(required = false) String checkTime, + @RequestParam(required = false) String hospitalId, + @RequestParam(required = false) String provinceId, + @RequestParam(required = false) String cityId, + @RequestParam(required = false) String areaId, + + HttpServletRequest request) { + return babyCheckFacade.getOrgBabyCount(checkTime,hospitalId,provinceId,cityId,areaId, getUserId(request)); + } + } \ 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 4bd7943..7f88686 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 @@ -17,6 +17,7 @@ import com.lyms.platform.operate.web.result.*; import com.lyms.platform.operate.web.service.BabyAfterVisitService; import com.lyms.platform.operate.web.service.PatientWeightService; import com.lyms.platform.operate.web.service.impl.BaseServiceImpl; +import com.lyms.platform.operate.web.utils.BabyListTask; import com.lyms.platform.operate.web.utils.MongoUtil; import com.lyms.platform.operate.web.utils.ReflectUtil; import com.lyms.platform.permission.dao.master.CouponMapper; @@ -39,9 +40,12 @@ import org.springframework.data.mongodb.core.aggregation.AggregationResults; import org.springframework.data.mongodb.core.query.Criteria; import org.springframework.data.mongodb.core.query.Query; import org.springframework.data.mongodb.core.query.Update; +import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; import org.springframework.stereotype.Component; import java.util.*; +import java.util.concurrent.Callable; +import java.util.concurrent.Future; import java.util.regex.Pattern; import static com.lyms.platform.operate.web.service.BabyAfterVisitService.*; @@ -2654,9 +2658,9 @@ public class BabyCheckFacade extends BaseServiceImpl { //体重 if (type == 0) { - res = getGrowthValueMapNew(birth, value, sex, dueDate, babyId, checkDate,null); + res = getGrowthValueMapNew(birth, value, sex, dueDate, babyId, checkDate, null); } else { - res = getGrowthValue1MapNew(birth, value, sex, type, dueDate, checkDate,null); + res = getGrowthValue1MapNew(birth, value, sex, type, dueDate, checkDate, null); } BaseObjectResponse objectResponse = new BaseObjectResponse(); @@ -4063,4 +4067,62 @@ public class BabyCheckFacade extends BaseServiceImpl { } } } + + public BaseResponse getOrgBabyCount(String checkTime,String hospitalId,String provinceId,String cityId,String areaId, Integer userId) { + Map param = new HashMap(); + + param.put("hospitalId",hospitalId); + param.put("provinceId",provinceId); + param.put("cityId",cityId); + param.put("areaId", areaId); + List list = new ArrayList <>(); + List organizations = mysqlAntexcService.getOrganizations(param); + if (CollectionUtils.isNotEmpty(organizations)) { + int batchSize = 5; + int end = 0; + List futures = new ArrayList <>(); + for (int i = 0; i < organizations.size(); i += batchSize) { + end = (end + batchSize); + if (end > organizations.size()) { + end = organizations.size(); + } + final List orgs = organizations.subList(i, end); + + Future f = commonThreadPool.submit(new Callable() { + @Override + public List call() throws Exception { + List datas = new ArrayList <>(); + if (CollectionUtils.isNotEmpty(orgs)) + { + for(Organization org : orgs) + { + BabyCountResult result = new BabyCountResult(); + result.setHospitalId(org.getId()+""); + result.setHospitalName(org.getName()); + datas.add(result); + } + } + return datas; + } + }); + futures.add(f); + } + if (CollectionUtils.isNotEmpty(futures)) { + for (Future f : futures) { + try { + list.addAll((List ) f.get()); + } catch (Exception e) { + ExceptionUtils.catchException(e, "baby getOrgBabyCount error."); + } + } + } + } + return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setData(list).setErrormsg("成功"); + } + + @Autowired + @Qualifier("commonThreadPool") + private ThreadPoolTaskExecutor commonThreadPool; + @Autowired + private MysqlAntexcService mysqlAntexcService; } \ No newline at end of file diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/BabyCountResult.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/BabyCountResult.java new file mode 100644 index 0000000..a403f11 --- /dev/null +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/BabyCountResult.java @@ -0,0 +1,602 @@ +package com.lyms.platform.operate.web.result; + +/** + * Created by lqy on 2016/6/17. + */ +public class BabyCountResult { + private String id; + private String hospitalId; + + //机构名称 + private String hospitalName; + + //活产数 合计 + private int hcshj; + //活产数 男 + private int hcsnan; + //活产数 女 + private int hcsnv; + //活产数 性别不明 + private int hcsxbum; + //儿童数 7岁以下 + private int ets7yx; + //儿童数 5岁以下 + private int ets5yx; + //儿童数 3岁以下 + private int ets3yx; + //5岁以下儿童死亡数 合计 + private int et5swhj; + //5岁以下儿童死亡数 男 + private int et5swnan; + //5岁以下儿童死亡数 女 + private int et5swnv; + //5岁以下儿童死亡数 性别不明 + private int et5swbm; + //5岁以下儿童死亡率 + private double et5swl; + //婴儿死亡数 合计 + private int yeswhj; + //婴儿死亡数 男 + private int yeswnan; + //婴儿死亡数 女 + private int yeswnv; + //婴儿死亡数 性别不明 + private int yeswbm; + //婴儿死亡率 + private double yeswlv; + //新生儿死亡数 合计 + private int xseswhj; + //婴儿死亡数 男 + private int xseswnan; + //婴儿死亡数 女 + private int xseswnv; + //婴儿死亡数 性别不明 + private int xseswxbm; + //新生儿死亡率 + private double xseswlv; + //调查人数 + private int dcrs; + //母乳喂养 人数 + private int mrwyrs; + //母乳喂养 率% + private double mrwylv; + //纯母乳喂养 人数 + private int cmrwyrs; + //纯母乳喂养 率 + private double cmrwylv; + + //新生儿访视 人数 + private int xsefsrs; + + //新生儿访视 率% + private double xsefslv; + + //7岁一下儿童健康管理 人数 + private int etjkgl7rs; + + //7岁一下儿童健康管理 率% + private double etjkgl7lv; + + //3岁一下儿童系统管理 人数 + private int etgl3rs; + + //3岁一下儿童系统管理 率% + private double etgl3lv; + + //身高(长)体重检查 检查人数 + private int gzjcrs; + + //身高(长)体重检查 低体重人数 + private int gzdtzrs; + + //身高(长)体重检查 低体重率 + private double gzdtzlv; + + //身高(长)体重检查 生长迟缓人数 + private int gzszchrs; + //身高(长)体重检查 生长迟缓率 + private double gzszchlv; + + //身高(长)体重检查 消瘦人数 + private int gzxsrs; + + //身高(长)体重检查 消瘦率 + private double gzxslv; + + //身高(长)体重检查 超重人数 + private int gzczrs; + + //身高(长)体重检查 超重率 + private double gzczlv; + + //身高(长)体重检查 肥胖人数 + private int gzfprs; + + //身高(长)体重检查 肥胖率 + private double gzfplv; + + //血红蛋白检查 检查人数 + private int xhdbrs; + + //血红蛋白检查 贫血患病人数 + private int xhdhbrs; + + //血红蛋白检查 贫血患病率 + private double xhdhblv; + + //血红蛋白检查 中重度贫血患病人数 + private int xhdzzrs; + //血红蛋白检查 中重度贫血患病率 + private double xhdzzlv; + + //0-6岁儿童眼保健和视力检查 人数 + private int ysrs; + + //0-6岁儿童眼保健和视力检查 覆盖率 + private double ysfglv; + + //6岁儿童视力检查 检查人数 + private int slrs; + + //6岁儿童视力检查 视力不良检出人数 + private int slblrs; + + //6岁儿童视力检查 视力不良检出率 + private double slbljcl; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getHospitalId() { + return hospitalId; + } + + public void setHospitalId(String hospitalId) { + this.hospitalId = hospitalId; + } + + public String getHospitalName() { + return hospitalName; + } + + public void setHospitalName(String hospitalName) { + this.hospitalName = hospitalName; + } + + public int getHcshj() { + return hcshj; + } + + public void setHcshj(int hcshj) { + this.hcshj = hcshj; + } + + public int getHcsnan() { + return hcsnan; + } + + public void setHcsnan(int hcsnan) { + this.hcsnan = hcsnan; + } + + public int getHcsnv() { + return hcsnv; + } + + public void setHcsnv(int hcsnv) { + this.hcsnv = hcsnv; + } + + public int getHcsxbum() { + return hcsxbum; + } + + public void setHcsxbum(int hcsxbum) { + this.hcsxbum = hcsxbum; + } + + public int getEts7yx() { + return ets7yx; + } + + public void setEts7yx(int ets7yx) { + this.ets7yx = ets7yx; + } + + public int getEts5yx() { + return ets5yx; + } + + public void setEts5yx(int ets5yx) { + this.ets5yx = ets5yx; + } + + public int getEts3yx() { + return ets3yx; + } + + public void setEts3yx(int ets3yx) { + this.ets3yx = ets3yx; + } + + public int getEt5swhj() { + return et5swhj; + } + + public void setEt5swhj(int et5swhj) { + this.et5swhj = et5swhj; + } + + public int getEt5swnan() { + return et5swnan; + } + + public void setEt5swnan(int et5swnan) { + this.et5swnan = et5swnan; + } + + public int getEt5swnv() { + return et5swnv; + } + + public void setEt5swnv(int et5swnv) { + this.et5swnv = et5swnv; + } + + public int getEt5swbm() { + return et5swbm; + } + + public void setEt5swbm(int et5swbm) { + this.et5swbm = et5swbm; + } + + public double getEt5swl() { + return et5swl; + } + + public void setEt5swl(double et5swl) { + this.et5swl = et5swl; + } + + public int getYeswhj() { + return yeswhj; + } + + public void setYeswhj(int yeswhj) { + this.yeswhj = yeswhj; + } + + public int getYeswnan() { + return yeswnan; + } + + public void setYeswnan(int yeswnan) { + this.yeswnan = yeswnan; + } + + public int getYeswnv() { + return yeswnv; + } + + public void setYeswnv(int yeswnv) { + this.yeswnv = yeswnv; + } + + public int getYeswbm() { + return yeswbm; + } + + public void setYeswbm(int yeswbm) { + this.yeswbm = yeswbm; + } + + public double getYeswlv() { + return yeswlv; + } + + public void setYeswlv(double yeswlv) { + this.yeswlv = yeswlv; + } + + public int getXseswhj() { + return xseswhj; + } + + public void setXseswhj(int xseswhj) { + this.xseswhj = xseswhj; + } + + public int getXseswnan() { + return xseswnan; + } + + public void setXseswnan(int xseswnan) { + this.xseswnan = xseswnan; + } + + public int getXseswnv() { + return xseswnv; + } + + public void setXseswnv(int xseswnv) { + this.xseswnv = xseswnv; + } + + public int getXseswxbm() { + return xseswxbm; + } + + public void setXseswxbm(int xseswxbm) { + this.xseswxbm = xseswxbm; + } + + public double getXseswlv() { + return xseswlv; + } + + public void setXseswlv(double xseswlv) { + this.xseswlv = xseswlv; + } + + public int getDcrs() { + return dcrs; + } + + public void setDcrs(int dcrs) { + this.dcrs = dcrs; + } + + public int getMrwyrs() { + return mrwyrs; + } + + public void setMrwyrs(int mrwyrs) { + this.mrwyrs = mrwyrs; + } + + public double getMrwylv() { + return mrwylv; + } + + public void setMrwylv(double mrwylv) { + this.mrwylv = mrwylv; + } + + public int getCmrwyrs() { + return cmrwyrs; + } + + public void setCmrwyrs(int cmrwyrs) { + this.cmrwyrs = cmrwyrs; + } + + public double getCmrwylv() { + return cmrwylv; + } + + public void setCmrwylv(double cmrwylv) { + this.cmrwylv = cmrwylv; + } + + public int getXsefsrs() { + return xsefsrs; + } + + public void setXsefsrs(int xsefsrs) { + this.xsefsrs = xsefsrs; + } + + public double getXsefslv() { + return xsefslv; + } + + public void setXsefslv(double xsefslv) { + this.xsefslv = xsefslv; + } + + public int getEtjkgl7rs() { + return etjkgl7rs; + } + + public void setEtjkgl7rs(int etjkgl7rs) { + this.etjkgl7rs = etjkgl7rs; + } + + public double getEtjkgl7lv() { + return etjkgl7lv; + } + + public void setEtjkgl7lv(double etjkgl7lv) { + this.etjkgl7lv = etjkgl7lv; + } + + public int getEtgl3rs() { + return etgl3rs; + } + + public void setEtgl3rs(int etgl3rs) { + this.etgl3rs = etgl3rs; + } + + public double getEtgl3lv() { + return etgl3lv; + } + + public void setEtgl3lv(double etgl3lv) { + this.etgl3lv = etgl3lv; + } + + public int getGzjcrs() { + return gzjcrs; + } + + public void setGzjcrs(int gzjcrs) { + this.gzjcrs = gzjcrs; + } + + public int getGzdtzrs() { + return gzdtzrs; + } + + public void setGzdtzrs(int gzdtzrs) { + this.gzdtzrs = gzdtzrs; + } + + public double getGzdtzlv() { + return gzdtzlv; + } + + public void setGzdtzlv(double gzdtzlv) { + this.gzdtzlv = gzdtzlv; + } + + public int getGzszchrs() { + return gzszchrs; + } + + public void setGzszchrs(int gzszchrs) { + this.gzszchrs = gzszchrs; + } + + public double getGzszchlv() { + return gzszchlv; + } + + public void setGzszchlv(double gzszchlv) { + this.gzszchlv = gzszchlv; + } + + public int getGzxsrs() { + return gzxsrs; + } + + public void setGzxsrs(int gzxsrs) { + this.gzxsrs = gzxsrs; + } + + public double getGzxslv() { + return gzxslv; + } + + public void setGzxslv(double gzxslv) { + this.gzxslv = gzxslv; + } + + public int getGzczrs() { + return gzczrs; + } + + public void setGzczrs(int gzczrs) { + this.gzczrs = gzczrs; + } + + public double getGzczlv() { + return gzczlv; + } + + public void setGzczlv(double gzczlv) { + this.gzczlv = gzczlv; + } + + public int getGzfprs() { + return gzfprs; + } + + public void setGzfprs(int gzfprs) { + this.gzfprs = gzfprs; + } + + public double getGzfplv() { + return gzfplv; + } + + public void setGzfplv(double gzfplv) { + this.gzfplv = gzfplv; + } + + public int getXhdbrs() { + return xhdbrs; + } + + public void setXhdbrs(int xhdbrs) { + this.xhdbrs = xhdbrs; + } + + public int getXhdhbrs() { + return xhdhbrs; + } + + public void setXhdhbrs(int xhdhbrs) { + this.xhdhbrs = xhdhbrs; + } + + public double getXhdhblv() { + return xhdhblv; + } + + public void setXhdhblv(double xhdhblv) { + this.xhdhblv = xhdhblv; + } + + public int getXhdzzrs() { + return xhdzzrs; + } + + public void setXhdzzrs(int xhdzzrs) { + this.xhdzzrs = xhdzzrs; + } + + public double getXhdzzlv() { + return xhdzzlv; + } + + public void setXhdzzlv(double xhdzzlv) { + this.xhdzzlv = xhdzzlv; + } + + public int getYsrs() { + return ysrs; + } + + public void setYsrs(int ysrs) { + this.ysrs = ysrs; + } + + public double getYsfglv() { + return ysfglv; + } + + public void setYsfglv(double ysfglv) { + this.ysfglv = ysfglv; + } + + public int getSlrs() { + return slrs; + } + + public void setSlrs(int slrs) { + this.slrs = slrs; + } + + public int getSlblrs() { + return slblrs; + } + + public void setSlblrs(int slblrs) { + this.slblrs = slblrs; + } + + public double getSlbljcl() { + return slbljcl; + } + + public void setSlbljcl(double slbljcl) { + this.slbljcl = slbljcl; + } +} -- 1.8.3.1