From c1da54ea6d5f875a2b5d27dc8f6162df39a989f5 Mon Sep 17 00:00:00 2001 From: wangbo <184677810@qq.com> Date: Thu, 9 May 2019 11:30:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=87=BA=E8=A1=80=E9=87=8F,=E5=B7=A8=E5=A4=A7?= =?UTF-8?q?=E5=84=BF,=E7=AA=92=E6=81=AF=E5=88=86=E9=92=9F=E6=95=B0?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/lyms/platform/query/BabyModelQuery.java | 47 ++- .../web/controller/MatDeliverController.java | 3 +- .../operate/web/facade/MatDeliverFacade.java | 319 +++++++++------------ .../operate/web/request/NewBabyManagerRequest.java | 29 ++ 4 files changed, 214 insertions(+), 184 deletions(-) diff --git a/platform-dal/src/main/java/com/lyms/platform/query/BabyModelQuery.java b/platform-dal/src/main/java/com/lyms/platform/query/BabyModelQuery.java index 83275ea..1238a02 100644 --- a/platform-dal/src/main/java/com/lyms/platform/query/BabyModelQuery.java +++ b/platform-dal/src/main/java/com/lyms/platform/query/BabyModelQuery.java @@ -192,6 +192,7 @@ public class BabyModelQuery extends BaseQuery implements IConvertToNativeQuery { //用来配合查询新筛实验室列表数据 private List sieveStatusList2; + public List getSieveStatusList2() { return sieveStatusList2; } @@ -239,6 +240,25 @@ public class BabyModelQuery extends BaseQuery implements IConvertToNativeQuery { private String babyHeightStart; private String babyHeightEnd; + private String asphyxiaMStart; + private String asphyxiaMEnd; + + public String getAsphyxiaMStart() { + return asphyxiaMStart; + } + + public void setAsphyxiaMStart(String asphyxiaMStart) { + this.asphyxiaMStart = asphyxiaMStart; + } + + public String getAsphyxiaMEnd() { + return asphyxiaMEnd; + } + + public void setAsphyxiaMEnd(String asphyxiaMEnd) { + this.asphyxiaMEnd = asphyxiaMEnd; + } + public List getParentIds() { return parentIds; } @@ -951,13 +971,13 @@ public class BabyModelQuery extends BaseQuery implements IConvertToNativeQuery { if (null != expVip) { condition = condition.and("expVip", expVip, MongoOper.IS); } - if(null != sieveStatus && !"0".equals(sieveStatus)){ + if (null != sieveStatus && !"0".equals(sieveStatus)) { condition = condition.and("sieveStatus", sieveStatus, MongoOper.IS); } - if(null != sieveStatusList){ + if (null != sieveStatusList) { condition = condition.and("sieveStatus", sieveStatusList, MongoOper.NIN); } - if(null != sieveStatusList2){ + if (null != sieveStatusList2) { condition = condition.and("sieveStatus", sieveStatusList2, MongoOper.IN); } @@ -1008,6 +1028,21 @@ public class BabyModelQuery extends BaseQuery implements IConvertToNativeQuery { } + if (null != asphyxiaMStart) { + if (null != c) { + c = c.and("asphyxiaM").gte(asphyxiaMStart); + } else { + c = Criteria.where("asphyxiaM").gte(asphyxiaMStart); + } + } + if (null != asphyxiaMEnd) { + if (null != c) { + c = c.lte(asphyxiaMEnd); + } else { + c = Criteria.where("asphyxiaM").lte(asphyxiaMEnd); + } + } + if (null != buildDateStart) { if (null != c) { c = c.and("buildDate").gte(buildDateStart); @@ -1064,10 +1099,10 @@ public class BabyModelQuery extends BaseQuery implements IConvertToNativeQuery { } } - if(null != createdTimeStart && createdTimeEnd != null){ - if(c != null){ + if (null != createdTimeStart && createdTimeEnd != null) { + if (c != null) { c = c.where("created").gte(createdTimeStart).lte(createdTimeEnd); - }else{ + } else { c = Criteria.where("created").gte(createdTimeStart).lte(createdTimeEnd); } } diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/MatDeliverController.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/MatDeliverController.java index 6254dc0..c5c4c4a 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/MatDeliverController.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/MatDeliverController.java @@ -563,8 +563,7 @@ public class MatDeliverController extends BaseController { @TokenRequired @ResponseBody @RequestMapping(value = "newBabyManager", method = RequestMethod.POST) - //@RequestBody - public BaseListResponse newBabyManager(HttpServletRequest httpServletRequest, NewBabyManagerRequest newBabyManagerRequest) { + public BaseListResponse newBabyManager(HttpServletRequest httpServletRequest, @RequestBody NewBabyManagerRequest newBabyManagerRequest) { BaseListResponse baseListResponse; try { newBabyManagerRequest.setOperatorId(((LoginContext) httpServletRequest.getAttribute("loginContext")).getId()); diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java index a546a0d..4b80392 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java @@ -473,8 +473,7 @@ public class MatDeliverFacade { } //育龄服务生孩统计 数据处理 - if (StringUtils.isNotEmpty(patients2.getPid())) - { + if (StringUtils.isNotEmpty(patients2.getPid())) { handleMatDeliver(patients2.getPid()); } @@ -482,9 +481,7 @@ public class MatDeliverFacade { } - - public void handleMatDeliver(final String pid) - { + public void handleMatDeliver(final String pid) { new Thread(new Runnable() { @Override public void run() { @@ -495,18 +492,15 @@ public class MatDeliverFacade { personModelQuery.setTypes(new Integer[]{1, 3}); //孕妇或者产妇基本信息 personModelQuery.setNeed("true"); personModelQuery.setLimit(limt); - if (StringUtils.isNotEmpty(pid)) - { + if (StringUtils.isNotEmpty(pid)) { personModelQuery.setId(pid); } - while (true) - { - System.out.println("page======"+page); + while (true) { + System.out.println("page======" + page); personModelQuery.setPage(page); List personModels = personService.queryPersons(personModelQuery, Sort.Direction.DESC, "created"); - if (CollectionUtils.isNotEmpty(personModels)) - { + if (CollectionUtils.isNotEmpty(personModels)) { System.out.println("sss"); int batchSize = 200; int end = 0; @@ -525,35 +519,29 @@ public class MatDeliverFacade { MatDeliverQuery matDeliverQuery = new MatDeliverQuery(); matDeliverQuery.setYn(YnEnums.YES.getId()); matDeliverQuery.setPid(person.getId()); - List maternalDeliverModels = matDeliverService.query(matDeliverQuery,Sort.Direction.ASC,"created"); - if (CollectionUtils.isNotEmpty(maternalDeliverModels)) - { - int upCount = 0; - for(int i = 0 ; i < maternalDeliverModels.size() ; i++) - { + List maternalDeliverModels = matDeliverService.query(matDeliverQuery, Sort.Direction.ASC, "created"); + if (CollectionUtils.isNotEmpty(maternalDeliverModels)) { + int upCount = 0; + for (int i = 0; i < maternalDeliverModels.size(); i++) { MaternalDeliverModel model = maternalDeliverModels.get(i); List babyList = model.getBaby(); List fmChildTimes = new ArrayList(); - if (CollectionUtils.isNotEmpty(babyList)) - { - for (int j = 0;j < babyList.size();j++) - { - upCount+=1; - if (upCount > 4) - { + if (CollectionUtils.isNotEmpty(babyList)) { + for (int j = 0; j < babyList.size(); j++) { + upCount += 1; + if (upCount > 4) { upCount = 4; } fmChildTimes.add(upCount); model.setFmChildTimes(fmChildTimes); } Patients patients = patientsService.findOnePatientById(model.getParentId()); - if (patients != null) - { - model.setFmAge(DateUtil.getAge(patients.getBirth(),model.getDueDate1())); + if (patients != null) { + model.setFmAge(DateUtil.getAge(patients.getBirth(), model.getDueDate1())); } } - matDeliverService.updateOne(model,model.getId()); + matDeliverService.updateOne(model, model.getId()); } } } @@ -561,9 +549,7 @@ public class MatDeliverFacade { } }); } - } - else - { + } else { break; } page++; @@ -573,7 +559,6 @@ public class MatDeliverFacade { } - /** * 分娩添加或更新追访信息 * @@ -762,11 +747,8 @@ public class MatDeliverFacade { } } } - } - else - { - if (CollectionUtils.isNotEmpty(updateBaby) && updateBaby.get(0).getDataStatus() == null) - { + } else { + if (CollectionUtils.isNotEmpty(updateBaby) && updateBaby.get(0).getDataStatus() == null) { babyModel1.setDataStatus(1); } } @@ -1129,9 +1111,7 @@ public class MatDeliverFacade { babyModel.setBlNo(baby.getBlNo()); babyModel.setBabyDiagnosis(baby.getBabyDiagnosis()); personModel.setYn(YnEnums.YES.getId()); - } - else - { + } else { personModel.setYn(YnEnums.NO.getId()); } babyModel.setPid(personService.addPerson(personModel).getId()); @@ -1200,7 +1180,7 @@ public class MatDeliverFacade { } else { return new BaseResponse().setErrormsg("该孕妇还未在本院建档不能进行分娩").setErrorcode(ErrorCodeConstants.NO_DATA); } - }else if("2100001635".equals(hospital) && StringUtils.isNotEmpty(deliverQueryRequest.getZhuYuanNo())){ + } else if ("2100001635".equals(hospital) && StringUtils.isNotEmpty(deliverQueryRequest.getZhuYuanNo())) { whfyHisModel = whfyHisService.getIdNo(deliverQueryRequest.getZhuYuanNo()); if (whfyHisModel != null && StringUtils.isNotEmpty(whfyHisModel.getIdno())) { deliverQueryRequest.setCardNo(whfyHisModel.getIdno()); @@ -1491,7 +1471,7 @@ public class MatDeliverFacade { map.put("getFmDzEnums", getFmDzEnums()); map.put("getRenShenJieJuEnums", getRenShenJieJuEnums()); map.put("organizations", convert()); - map.put("chFz",getchFzEnums()); + map.put("chFz", getchFzEnums()); // 新生儿畸形 List> deformity = EnumUtil.toJson(BabyDeformityEnums.class); map.put("deformity", deformity); @@ -1760,27 +1740,26 @@ public class MatDeliverFacade { MatDeliverQuery matDeliverQuery = new MatDeliverQuery(); - if(matdeliverFollowRequest.getFollowStarDate()!=null){ + if (matdeliverFollowRequest.getFollowStarDate() != null) { MatDeliverFollowQuery matDeliverFollowQuery = new MatDeliverFollowQuery(); matDeliverFollowQuery.setVisitStartDate(matdeliverFollowRequest.getFollowStarDate()); matDeliverFollowQuery.setVisitEndDate(matdeliverFollowRequest.getFollowEndDate()); List matdeliverFollowModels = matDeliverFollowService.query(matDeliverFollowQuery); List mfIds = new ArrayList<>(); - for(MatdeliverFollowModel md:matdeliverFollowModels){ + for (MatdeliverFollowModel md : matdeliverFollowModels) { mfIds.add(md.getDeliverId()); } matDeliverQuery.setIds(mfIds); } - //查询号不为空,则查询孕妇id if (StringUtils.isNotEmpty(matdeliverFollowRequest.getQueryNo())//查询号不为空 || StringUtils.isNotEmpty(matdeliverFollowRequest.getProvinceId())//居住地省 || StringUtils.isNotEmpty(matdeliverFollowRequest.getCityId())//居住地市 || StringUtils.isNotEmpty(matdeliverFollowRequest.getAreaId())//居住区 || StringUtils.isNotEmpty(matdeliverFollowRequest.getStreetId())//居住街道 - ) { + ) { PatientsQuery patientsQuery = new PatientsQuery(); patientsQuery.setQueryNo(matdeliverFollowRequest.getQueryNo()); patientsQuery.setYn(YnEnums.YES.getId()); @@ -1825,18 +1804,13 @@ public class MatDeliverFacade { matDeliverQuery.setCreatedStart(DateUtil.getSNDate(matdeliverFollowRequest.getBirthDate())[0]); matDeliverQuery.setEndStart(DateUtil.getSNDate(matdeliverFollowRequest.getBirthDate())[1]); } - if (matdeliverFollowRequest.getStartDay() != null && matdeliverFollowRequest.getEndDay() != null ) - { + if (matdeliverFollowRequest.getStartDay() != null && matdeliverFollowRequest.getEndDay() != null) { matDeliverQuery.setCreatedStart(DateUtil.formatDate(DateUtil.addDay(new Date(), -matdeliverFollowRequest.getEndDay()))); matDeliverQuery.setEndStart(DateUtil.formatDate(DateUtil.addDay(new Date(), -matdeliverFollowRequest.getStartDay()))); - } - else if (matdeliverFollowRequest.getStartDay() != null) - { + } else if (matdeliverFollowRequest.getStartDay() != null) { matDeliverQuery.setCreatedStart(DateUtil.formatDate(DateUtil.addDay(new Date(), -matdeliverFollowRequest.getStartDay()))); matDeliverQuery.setEndStart(DateUtil.formatDate(DateUtil.addDay(new Date(), -matdeliverFollowRequest.getStartDay()))); - } - else if(matdeliverFollowRequest.getEndDay() != null) - { + } else if (matdeliverFollowRequest.getEndDay() != null) { matDeliverQuery.setCreatedStart(DateUtil.formatDate(DateUtil.addDay(new Date(), -matdeliverFollowRequest.getEndDay()))); matDeliverQuery.setEndStart(DateUtil.formatDate(DateUtil.addDay(new Date(), -matdeliverFollowRequest.getEndDay()))); } @@ -1865,8 +1839,7 @@ public class MatDeliverFacade { matDeliverQuery.setMakeType(matdeliverFollowRequest.getMakeType()); List maternalDeliverModelList; - if (StringUtils.isNotEmpty(matdeliverFollowRequest.getRiskId())) - { + if (StringUtils.isNotEmpty(matdeliverFollowRequest.getRiskId())) { PatientsQuery patientsQuery = new PatientsQuery(); patientsQuery.setYn(YnEnums.YES.getId()); patientsQuery.setrFactor(matdeliverFollowRequest.getRiskId()); @@ -2101,8 +2074,7 @@ public class MatDeliverFacade { matDeliverQuery.setDeliveryModeQueryJson(StringUtils.isEmpty(childbirthManagerRequest.getDeliveryMode()) ? null : deliveryModeQueryJson); // matDeliverQuery.setWeight(childbirthManagerRequest.getWeight()); - if (childbirthManagerRequest.getWeight() != null) - { + if (childbirthManagerRequest.getWeight() != null) { BabyModelQuery babyModelQuery = new BabyModelQuery(); // babyModelQuery.setDataStatus(false); babyModelQuery.setHospitalId(hid); @@ -2130,28 +2102,28 @@ public class MatDeliverFacade { } /**********增加产后观察,观察状态条件查询**********/ - if(StringUtils.isNotEmpty(childbirthManagerRequest.getGcStatus())){ + if (StringUtils.isNotEmpty(childbirthManagerRequest.getGcStatus())) { PostpartumRecordsQuery prQuery = new PostpartumRecordsQuery(); prQuery.setGcStatus("1"); prQuery.setIsDelete("1"); List prList = postpartumRecordsService.getPostpartumRecordsQuery(prQuery); - if("0".equals(childbirthManagerRequest.getGcStatus())){//正在观察的产妇,填写完分娩记录默认为正在观察 - if(CollectionUtils.isNotEmpty(prList)){ + if ("0".equals(childbirthManagerRequest.getGcStatus())) {//正在观察的产妇,填写完分娩记录默认为正在观察 + if (CollectionUtils.isNotEmpty(prList)) { List sList = new ArrayList(); - for(PostpartumRecords p : prList){ + for (PostpartumRecords p : prList) { sList.add(p.getMaternalDeliverId()); } matDeliverQuery.setCunZai(sList); } - }else if("1".equals(childbirthManagerRequest.getGcStatus())){ + } else if ("1".equals(childbirthManagerRequest.getGcStatus())) { List sList = new ArrayList(); - if(CollectionUtils.isNotEmpty(prList)){ - for(PostpartumRecords p : prList){ + if (CollectionUtils.isNotEmpty(prList)) { + for (PostpartumRecords p : prList) { sList.add(p.getMaternalDeliverId()); } matDeliverQuery.setIds(sList); - }else{ - childbirthManagerResult.setPageInfo(new PageInfo(childbirthManagerRequest.getPage(),1,0,childbirthManagerRequest.getLimit())); + } else { + childbirthManagerResult.setPageInfo(new PageInfo(childbirthManagerRequest.getPage(), 1, 0, childbirthManagerRequest.getLimit())); childbirthManagerResult.setData(null); childbirthManagerResult.setErrorcode(ErrorCodeConstants.SUCCESS); childbirthManagerResult.setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION); @@ -2193,10 +2165,9 @@ public class MatDeliverFacade { List mlist = maternalDeliverModelList.subList(i, end); Callable c = new MaterDeliverWorker(organizationService, usersService, babyService, basicConfigService, childbirthManagerRequest.getInitQuery(), - mlist, patientsMap,postpartumRecordsService,recordsService); + mlist, patientsMap, postpartumRecordsService, recordsService); Future f = commonThreadPool.submit(c); - if (f != null) - { + if (f != null) { futures.add(f); } @@ -2219,7 +2190,7 @@ public class MatDeliverFacade { return childbirthManagerResult; } - public NewBabyManagerResult newBabyManager(NewBabyManagerRequest newBabyManagerRequest,Integer userId) { + public NewBabyManagerResult newBabyManager(NewBabyManagerRequest newBabyManagerRequest, Integer userId) { NewBabyManagerResult newBabyManagerResult = new NewBabyManagerResult(); BabyModelQuery babyModelQuery = new BabyModelQuery(); //babyModelQuery.setYn(YnEnums.YES.getId()); @@ -2244,7 +2215,18 @@ public class MatDeliverFacade { babyModelQuery.setBuildType(2); babyModelQuery.setOrder("birth"); babyModelQuery.setHospitalId(autoMatchFacade.getHospitalId(newBabyManagerRequest.getOperatorId())); + if (null != newBabyManagerRequest.getHuge() && 1 == newBabyManagerRequest.getHuge()) { + babyModelQuery.setBabyWeightStart("4"); + } else if (null != newBabyManagerRequest.getHuge() && 2 == newBabyManagerRequest.getHuge()) { + babyModelQuery.setBabyWeightEnd("3.99"); + } + if (null != newBabyManagerRequest.getAsphyxiaMStart()) { + babyModelQuery.setAsphyxiaMStart(newBabyManagerRequest.getAsphyxiaMStart()); + } + if (null != newBabyManagerRequest.getAsphyxiaMEnd()) { + babyModelQuery.setAsphyxiaMEnd(newBabyManagerRequest.getAsphyxiaMEnd()); + } List babyModelList = babyService.queryBabyWithQuery(babyModelQuery); if (CollectionUtils.isEmpty(babyModelList)) { newBabyManagerResult.setPageInfo(babyModelQuery.getPageInfo()); @@ -2277,7 +2259,7 @@ public class MatDeliverFacade { Date date = format.parse(time); newBabyManagerQueryModel.setBirthHM(new SimpleDateFormat("HH:mm").format(date)); newBabyManagerQueryModel.setBirthYMD(DateUtil.getyyyy_MM_dd(date)); - newBabyManagerQueryModel.setFmDate(DateUtil.getyyyy_MM_dd(date) +" "+ new SimpleDateFormat("HH:mm").format(date)); + newBabyManagerQueryModel.setFmDate(DateUtil.getyyyy_MM_dd(date) + " " + new SimpleDateFormat("HH:mm").format(date)); } catch (ParseException e) { ExceptionUtils.catchException(e, "新生儿管理娩出时间格式异常" + time); } @@ -2371,10 +2353,10 @@ public class MatDeliverFacade { } - public BaseObjectResponse getChildbearAgeCount(String birth, Integer userId,String hospitalId, - String proviceId,String cityId,String areaId) { - List> list = getChidbearAgeCountData( birth, userId, hospitalId, - proviceId, cityId, areaId); + public BaseObjectResponse getChildbearAgeCount(String birth, Integer userId, String hospitalId, + String proviceId, String cityId, String areaId) { + List> list = getChidbearAgeCountData(birth, userId, hospitalId, + proviceId, cityId, areaId); BaseObjectResponse objectResponse = new BaseObjectResponse(); objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); @@ -2383,9 +2365,8 @@ public class MatDeliverFacade { return objectResponse; } - private List> getChidbearAgeCountData(String birth, Integer userId,String hospitalId, - String proviceId,String cityId,String areaId) - { + private List> getChidbearAgeCountData(String birth, Integer userId, String hospitalId, + String proviceId, String cityId, String areaId) { List hospitalIds = new ArrayList<>(); if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(hospitalId)) { hospitalIds.add(hospitalId); @@ -2394,12 +2375,11 @@ public class MatDeliverFacade { hospitalIds = areaCountFacade.getCurrentUserHospPermissions(userId, proviceId, cityId, areaId); } - List> list = new ArrayList<>(); + List> list = new ArrayList<>(); //String hospitalId = autoMatchFacade.getHospitalId(userId); List ages = new ArrayList<>(); - for (int i = 15; i < 50; i ++) - { + for (int i = 15; i < 50; i++) { ages.add(i); } @@ -2413,7 +2393,7 @@ public class MatDeliverFacade { } List alist = ages.subList(i, end); Callable c = new ChildbearAgeWorker(birth, - alist,hospitalIds,matDeliverService); + alist, hospitalIds, matDeliverService); Future f = commonThreadPool.submit(c); futures.add(f); } @@ -2421,7 +2401,7 @@ public class MatDeliverFacade { if (CollectionUtils.isNotEmpty(futures)) { for (Future f : futures) { try { - list.addAll((List>) f.get()); + list.addAll((List>) f.get()); } catch (Exception e) { ExceptionUtils.catchException(e, "getChildbearAgeCount list error."); } @@ -2434,31 +2414,30 @@ public class MatDeliverFacade { Integer columnMoreCount = 0; Integer columnRowCount = 0; - for (Map map : list) - { + for (Map map : list) { Integer oneCount = Integer.parseInt(map.get("oneCount")); - columnOneCount+=oneCount; + columnOneCount += oneCount; Integer twoCount = Integer.parseInt(map.get("twoCount")); - columnTwoCount+=twoCount; + columnTwoCount += twoCount; Integer threeCount = Integer.parseInt(map.get("threeCount")); - columnThreeCount+=threeCount; + columnThreeCount += threeCount; Integer moreCount = Integer.parseInt(map.get("moreCount")); - columnMoreCount+=moreCount; + columnMoreCount += moreCount; Integer rowCount = Integer.parseInt(map.get("rowCount")); - columnRowCount+=rowCount; + columnRowCount += rowCount; } - Map allMap = new HashMap<>(); - allMap.put("name","合计"); - allMap.put("oneCount",String.valueOf(columnOneCount)); + Map allMap = new HashMap<>(); + allMap.put("name", "合计"); + allMap.put("oneCount", String.valueOf(columnOneCount)); allMap.put("twoCount", String.valueOf(columnTwoCount)); allMap.put("threeCount", String.valueOf(columnThreeCount)); - allMap.put("moreCount",String.valueOf(columnMoreCount)); + allMap.put("moreCount", String.valueOf(columnMoreCount)); allMap.put("rowCount", String.valueOf(columnRowCount)); list.add(allMap); @@ -2466,10 +2445,10 @@ public class MatDeliverFacade { } public void exportChildbearAgeCount(String birth, Integer userId, String hospitalId, - String proviceId, String cityId, String areaId, - HttpServletResponse httpServletResponse) { + String proviceId, String cityId, String areaId, + HttpServletResponse httpServletResponse) { try { - List> list = (ArrayList)getChidbearAgeCountData(birth, userId, hospitalId, + List> list = (ArrayList) getChidbearAgeCountData(birth, userId, hospitalId, proviceId, cityId, areaId); Map header = new LinkedHashMap<>(); header.put("name", "年龄"); @@ -2481,9 +2460,8 @@ public class MatDeliverFacade { httpServletResponse.setContentType("application/force-download"); httpServletResponse.setHeader("Content-Disposition", "attachment;filename=" + new String(("育龄服务生孩统计.xls").getBytes("UTF-8"), "ISO-8859-1")); ExcelUtil.toExcel(httpServletResponse.getOutputStream(), list, header); - }catch (Exception e) - { - ExceptionUtils.catchException(e,"exportChildbearAgeCount error"); + } catch (Exception e) { + ExceptionUtils.catchException(e, "exportChildbearAgeCount error"); } } @@ -2505,8 +2483,8 @@ public class MatDeliverFacade { } } - Map params = new HashMap<>(); - params.put("provinceId",provinceId); + Map params = new HashMap<>(); + params.put("provinceId", provinceId); params.put("cityId", cityId); params.put("areaId", areaId); @@ -2514,42 +2492,37 @@ public class MatDeliverFacade { List hospitalIds = areaCountFacade.getCurrentUserHospPermissions(userId, provinceId, cityId, areaId); - List> list = getDatas(hospitalIds, time,params, basicConfigs); + List> list = getDatas(hospitalIds, time, params, basicConfigs); httpServletResponse.setContentType("application/force-download"); httpServletResponse.setHeader("Content-Disposition", "attachment;filename=" + new String(("助产机构报表.xls").getBytes("UTF-8"), "ISO-8859-1")); - String path = this.getClass().getResource("/").getPath()+ "due_org_report.xls"; + String path = this.getClass().getResource("/").getPath() + "due_org_report.xls"; System.out.println(path); - String timeStr = DateUtil.getyyyy_MM_dd1(DateUtil.getSNDate(time)[0])+"-"+DateUtil.getyyyy_MM_dd1(DateUtil.getSNDate(time)[1]); + String timeStr = DateUtil.getyyyy_MM_dd1(DateUtil.getSNDate(time)[0]) + "-" + DateUtil.getyyyy_MM_dd1(DateUtil.getSNDate(time)[1]); String title = ""; String areaName = ""; - if (StringUtils.isNotEmpty(areaId)) - { + if (StringUtils.isNotEmpty(areaId)) { BasicConfigQuery basicConfigQuery1 = new BasicConfigQuery(); basicConfigQuery1.setYn(YnEnums.YES.getId()); basicConfigQuery1.setId(areaId); List areas = basicConfigService.queryBasicConfig(basicConfigQuery); - if (CollectionUtils.isNotEmpty(areas)) - { - title = areas.get(0).getName()+"助产机构相关数据月报表"; - areaName = "市县区:"+areas.get(0).getName(); + if (CollectionUtils.isNotEmpty(areas)) { + title = areas.get(0).getName() + "助产机构相关数据月报表"; + areaName = "市县区:" + areas.get(0).getName(); } - } - else - { + } else { BasicConfigQuery basicConfigQuery1 = new BasicConfigQuery(); basicConfigQuery1.setYn(YnEnums.YES.getId()); basicConfigQuery1.setId(cityId); List cities = basicConfigService.queryBasicConfig(basicConfigQuery); - if (CollectionUtils.isNotEmpty(cities)) - { - title = cities.get(0).getName()+"助产机构相关数据月报表"; - areaName = "市县区:"+cities.get(0).getName(); + if (CollectionUtils.isNotEmpty(cities)) { + title = cities.get(0).getName() + "助产机构相关数据月报表"; + areaName = "市县区:" + cities.get(0).getName(); } } - ExcelUtil.writeExclFile(path , httpServletResponse.getOutputStream(), areaNames,title,areaName,timeStr,list); + ExcelUtil.writeExclFile(path, httpServletResponse.getOutputStream(), areaNames, title, areaName, timeStr, list); } catch (IOException e) { ExceptionUtils.catchException(e, "exporDueOrgCount error"); } @@ -2571,20 +2544,20 @@ public class MatDeliverFacade { } } - Map params = new HashMap<>(); - params.put("provinceId",provinceId); + Map params = new HashMap<>(); + params.put("provinceId", provinceId); params.put("cityId", cityId); params.put("areaId", areaId); //获取用户拥有的权限医院和条件筛选的医院交集 List hospitalIds = areaCountFacade.getCurrentUserHospPermissions(userId, provinceId, - cityId, areaId); + cityId, areaId); - List> list = getDatas(hospitalIds, time,params, basicConfigs); + List> list = getDatas(hospitalIds, time, params, basicConfigs); - Map data = new HashMap<>(); - data.put("countData",list); - data.put("areaNames",areaNames); + Map data = new HashMap<>(); + data.put("countData", list); + data.put("areaNames", areaNames); BaseObjectResponse objectResponse = new BaseObjectResponse(); objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); @@ -2593,9 +2566,8 @@ public class MatDeliverFacade { return objectResponse; } - private List> getDatas(List hospitalIds,String time,Map params, List basicConfigs) - { - List> list = new ArrayList<>(); + private List> getDatas(List hospitalIds, String time, Map params, List basicConfigs) { + List> list = new ArrayList<>(); int batchSize = 5; int end = 0; @@ -2607,7 +2579,7 @@ public class MatDeliverFacade { } List hids = hospitalIds.subList(i, end); - Callable c = new DueOrgCountWorker(time,hids,matDeliverService,organizationService,patientsService,babyService,params,basicConfigs); + Callable c = new DueOrgCountWorker(time, hids, matDeliverService, organizationService, patientsService, babyService, params, basicConfigs); Future f = commonThreadPool.submit(c); futures.add(f); } @@ -2615,7 +2587,7 @@ public class MatDeliverFacade { if (CollectionUtils.isNotEmpty(futures)) { for (Future f : futures) { try { - list.addAll((List>) f.get()); + list.addAll((List>) f.get()); } catch (Exception e) { ExceptionUtils.catchException(e, "getChildbearAgeCount list error."); } @@ -2627,8 +2599,7 @@ public class MatDeliverFacade { return list; } - public void sum(List> list,List basicConfigs) - { + public void sum(List> list, List basicConfigs) { int fmPoGongCount = 0; //分娩方式 剖宫产 int wsCount = 0; //外省 @@ -2654,7 +2625,7 @@ public class MatDeliverFacade { int fzrDoubleCount = 0; //非自然妊娠双胎 - int bigBoyCount =0 ; //巨大儿数 + int bigBoyCount = 0; //巨大儿数 int lowWeightCount = 0; //低出生体重数 // int babySiWangCount = ; //新生儿死亡数 @@ -2663,10 +2634,8 @@ public class MatDeliverFacade { // int sieveFreeCount = ; //35岁以下免费筛查数 // int fmOtherCount = ; //分娩方式 其他 - if (CollectionUtils.isNotEmpty(list)) - { - for (Map map : list) - { + if (CollectionUtils.isNotEmpty(list)) { + for (Map map : list) { fmPoGongCount += Integer.parseInt(map.get("fmPoGongCount")); //分娩方式 剖宫产 wsCount += Integer.parseInt(map.get("wsCount")); //外省 chanCount += Integer.parseInt(map.get("chanCount")); //产妇数 @@ -2695,48 +2664,46 @@ public class MatDeliverFacade { } - Map totalMap = new LinkedHashMap<>(); - - totalMap.put("orgName","合计"); - totalMap.put("chanCount",String.valueOf(chanCount)); - totalMap.put("riskCount",String.valueOf(riskCount)); - totalMap.put("huoChanCount",String.valueOf(huoChanCount)); - totalMap.put("doubleCount",String.valueOf(doubleCount)); - totalMap.put("fzrDoubleCount",String.valueOf(fzrDoubleCount)); - totalMap.put("boyCount",String.valueOf(boyCount)); - totalMap.put("girlCount",String.valueOf(girlCount)); - totalMap.put("fmShunChanCount",String.valueOf(fmShunChanCount)); - totalMap.put("fmPoGongCount",String.valueOf(fmPoGongCount)); - totalMap.put("fmCount",String.valueOf(fmCount)); - totalMap.put("fmOtherCount",""); - totalMap.put("huiYinFullCount",String.valueOf(huiYinFullCount)); - totalMap.put("huiYinSpitCount",String.valueOf(huiYinSpitCount)); - totalMap.put("siLielevelCount",String.valueOf(siLielevelCount)); - totalMap.put("siLielevelYzCount",String.valueOf(siLielevelYzCount)); - totalMap.put("huiYingTotalCount",String.valueOf(huiYingTotalCount)); - totalMap.put("queXianBabyCount",String.valueOf(queXianBabyCount)); - totalMap.put("babySiWangCount",""); - totalMap.put("babySiChanCount",String.valueOf(babySiChanCount)); - totalMap.put("babySiTaiCount",String.valueOf(babySiTaiCount)); - totalMap.put("bigBoyCount",String.valueOf(bigBoyCount)); - totalMap.put("lowWeightCount",String.valueOf(lowWeightCount)); - totalMap.put("zcBabyCount",String.valueOf(zcBabyCount)); - totalMap.put("bswsCount",String.valueOf(bswsCount)); - totalMap.put("wsCount",String.valueOf(wsCount)); + Map totalMap = new LinkedHashMap<>(); + + totalMap.put("orgName", "合计"); + totalMap.put("chanCount", String.valueOf(chanCount)); + totalMap.put("riskCount", String.valueOf(riskCount)); + totalMap.put("huoChanCount", String.valueOf(huoChanCount)); + totalMap.put("doubleCount", String.valueOf(doubleCount)); + totalMap.put("fzrDoubleCount", String.valueOf(fzrDoubleCount)); + totalMap.put("boyCount", String.valueOf(boyCount)); + totalMap.put("girlCount", String.valueOf(girlCount)); + totalMap.put("fmShunChanCount", String.valueOf(fmShunChanCount)); + totalMap.put("fmPoGongCount", String.valueOf(fmPoGongCount)); + totalMap.put("fmCount", String.valueOf(fmCount)); + totalMap.put("fmOtherCount", ""); + totalMap.put("huiYinFullCount", String.valueOf(huiYinFullCount)); + totalMap.put("huiYinSpitCount", String.valueOf(huiYinSpitCount)); + totalMap.put("siLielevelCount", String.valueOf(siLielevelCount)); + totalMap.put("siLielevelYzCount", String.valueOf(siLielevelYzCount)); + totalMap.put("huiYingTotalCount", String.valueOf(huiYingTotalCount)); + totalMap.put("queXianBabyCount", String.valueOf(queXianBabyCount)); + totalMap.put("babySiWangCount", ""); + totalMap.put("babySiChanCount", String.valueOf(babySiChanCount)); + totalMap.put("babySiTaiCount", String.valueOf(babySiTaiCount)); + totalMap.put("bigBoyCount", String.valueOf(bigBoyCount)); + totalMap.put("lowWeightCount", String.valueOf(lowWeightCount)); + totalMap.put("zcBabyCount", String.valueOf(zcBabyCount)); + totalMap.put("bswsCount", String.valueOf(bswsCount)); + totalMap.put("wsCount", String.valueOf(wsCount)); //各个区总和计算 - for (int i = 1 ; i <= basicConfigs.size() ; i++) - { + for (int i = 1; i <= basicConfigs.size(); i++) { int total = 0; - for (Map map : list) - { - total += Integer.parseInt(map.get("areaCount"+i)); + for (Map map : list) { + total += Integer.parseInt(map.get("areaCount" + i)); } - totalMap.put("areaCount"+i,String.valueOf(total)); + totalMap.put("areaCount" + i, String.valueOf(total)); } - totalMap.put("sieveCount",""); - totalMap.put("sieveFreeCount",""); + totalMap.put("sieveCount", ""); + totalMap.put("sieveFreeCount", ""); list.add(totalMap); } } \ No newline at end of file diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/NewBabyManagerRequest.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/NewBabyManagerRequest.java index b54b6a5..161c25b 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/NewBabyManagerRequest.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/NewBabyManagerRequest.java @@ -35,7 +35,36 @@ public class NewBabyManagerRequest extends BasePageQueryRequest { private String patientId; //畸形key private String deformityKey; + //判断是否是巨大儿 + private Integer huge; + private String asphyxiaMStart; + + private String asphyxiaMEnd; + + public String getAsphyxiaMStart() { + return asphyxiaMStart; + } + + public void setAsphyxiaMStart(String asphyxiaMStart) { + this.asphyxiaMStart = asphyxiaMStart; + } + + public String getAsphyxiaMEnd() { + return asphyxiaMEnd; + } + + public void setAsphyxiaMEnd(String asphyxiaMEnd) { + this.asphyxiaMEnd = asphyxiaMEnd; + } + + public Integer getHuge() { + return huge; + } + + public void setHuge(Integer huge) { + this.huge = huge; + } public String getDeformityKey() { return deformityKey; -- 1.8.3.1