From 64327ec26704ae4cd8aa2e00bb27528d81f9ee4c Mon Sep 17 00:00:00 2001 From: liquanyu Date: Thu, 23 Aug 2018 14:33:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A9=E4=BA=A7=E6=9C=BA=E6=9E=84=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/lyms/platform/common/utils/ExcelUtil.java | 31 +- .../com/lyms/platform/query/BabyModelQuery.java | 47 ++- .../platform/msg/remote/AmsMessageService.java | 2 +- .../operate/web/facade/AntExRecordFacade.java | 325 +++++++++++++++------ .../operate/web/facade/MatDeliverFacade.java | 99 ++++--- .../operate/web/worker/DueOrgCountWorker.java | 45 ++- 6 files changed, 386 insertions(+), 163 deletions(-) diff --git a/platform-common/src/main/java/com/lyms/platform/common/utils/ExcelUtil.java b/platform-common/src/main/java/com/lyms/platform/common/utils/ExcelUtil.java index 0c3ae82..0c6a561 100644 --- a/platform-common/src/main/java/com/lyms/platform/common/utils/ExcelUtil.java +++ b/platform-common/src/main/java/com/lyms/platform/common/utils/ExcelUtil.java @@ -268,16 +268,14 @@ public class ExcelUtil titleFormt.setVerticalAlignment(VerticalAlignment.CENTRE); int column = 25; - for (String key : areaNams) + for (int i = 0;i < areaNams.size() - 1;i++) { column++; ws.insertColumn(column); - ws.insertColumn(column); - ws.insertColumn(column); } - ws.mergeCells(26, 3, 26 + areaNams.size(), 3); + ws.mergeCells(26, 3, 25 + areaNams.size(), 3); ws.addCell(new Label(26, 3, "本市户籍", contentFormt)); int index = 25; @@ -311,17 +309,19 @@ public class ExcelUtil } } - for (int i = 5, len = values.size(); i < len; i++) + int arrayIndex = 0; + for (int i = 5, len = values.size()+5; i < len; i++, arrayIndex++) { - Set sets = values.get(i).keySet(); + Set sets = values.get(arrayIndex).keySet(); int j = 0; for (String key : sets) { - String value = values.get(i).get(key); + String value = values.get(arrayIndex).get(key); if (StringUtils.isNotEmpty(value) && StringUtils.isNum(value)) { WritableCellFormat wcfN = new WritableCellFormat(contentFont); + wcfN.setBorder(jxl.format.Border.ALL, jxl.format.BorderLineStyle.THIN); wcfN.setAlignment(jxl.format.Alignment.CENTRE); wcfN.setVerticalAlignment(VerticalAlignment.CENTRE); Number labelNF = new Number(j, i,Integer.parseInt(value), wcfN); @@ -333,18 +333,19 @@ public class ExcelUtil } j++; } + } - ws.addCell(new Label(0, 30, "注:统计时限:"+ time +";分娩方式中其他包括:吸引产、臀助产、臀牵引、产钳产等。", leftFormt)); + ws.addCell(new Label(0, values.size()+5, "注:统计时限:"+ time +";分娩方式中其他包括:吸引产、臀助产、臀牵引、产钳产等。", leftFormt)); - ws.mergeCells(0, 30, 36, 30); + ws.mergeCells(0, values.size()+5, 36, values.size()+5); - ws.addCell(new Label(0, 31, "填报单位:", leftFormt)); - ws.mergeCells(0, 31, 5, 31); - ws.addCell(new Label(6, 31, "填报人:", leftFormt)); - ws.mergeCells(6, 31, 10, 31); - ws.addCell(new Label(11, 31, "填报日期:", leftFormt)); - ws.mergeCells(11, 31,36, 31); + ws.addCell(new Label(0, values.size()+6, "填报单位:", leftFormt)); + ws.mergeCells(0, values.size()+6, 5, values.size()+6); + ws.addCell(new Label(6, values.size()+6, "填报人:", leftFormt)); + ws.mergeCells(6, values.size()+6, 10, values.size()+6); + ws.addCell(new Label(11, values.size()+6, "填报日期:", leftFormt)); + ws.mergeCells(11, values.size()+6,36, values.size()+6); book.write(); book.close(); 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 726b095..02ba4a1 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 @@ -198,6 +198,45 @@ public class BabyModelQuery extends BaseQuery implements IConvertToNativeQuery { this.modifiedEnd = modifiedEnd; } + //体重 + private String babyWeightStart; + private String babyWeightEnd; + //身高 + private String babyHeightStart; + private String babyHeightEnd; + + public String getBabyWeightStart() { + return babyWeightStart; + } + + public void setBabyWeightStart(String babyWeightStart) { + this.babyWeightStart = babyWeightStart; + } + + public String getBabyWeightEnd() { + return babyWeightEnd; + } + + public void setBabyWeightEnd(String babyWeightEnd) { + this.babyWeightEnd = babyWeightEnd; + } + + public String getBabyHeightStart() { + return babyHeightStart; + } + + public void setBabyHeightStart(String babyHeightStart) { + this.babyHeightStart = babyHeightStart; + } + + public String getBabyHeightEnd() { + return babyHeightEnd; + } + + public void setBabyHeightEnd(String babyHeightEnd) { + this.babyHeightEnd = babyHeightEnd; + } + public Integer getMalformation() { return malformation; } @@ -954,14 +993,6 @@ public class BabyModelQuery extends BaseQuery implements IConvertToNativeQuery { } } - if(null != modifiedStart && modifiedEnd != null){ - if(c != null){ - c = c.where("modified").gte(modifiedStart).lte(modifiedEnd); - }else{ - c = Criteria.where("modified").gte(modifiedStart).lte(modifiedEnd); - } - } - if (c != null) { return new MongoCondition(c.andOperator(condition.getCriteria())).toMongoQuery(); } diff --git a/platform-msg-generate/src/main/java/com/lyms/platform/msg/remote/AmsMessageService.java b/platform-msg-generate/src/main/java/com/lyms/platform/msg/remote/AmsMessageService.java index d7d9693..5aafd72 100644 --- a/platform-msg-generate/src/main/java/com/lyms/platform/msg/remote/AmsMessageService.java +++ b/platform-msg-generate/src/main/java/com/lyms/platform/msg/remote/AmsMessageService.java @@ -173,7 +173,7 @@ public class AmsMessageService { // } public static void main(String[] args) { - Map> list = getMessageTemplateMap("2100001718", + Map> list = getMessageTemplateMap("2100001635", AmsServiceTypeEnum.CHILD_GUIDE); List msgs = list.get("0周"); System.out.println(list); diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntExRecordFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntExRecordFacade.java index 1dc9a59..6178373 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntExRecordFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntExRecordFacade.java @@ -21,10 +21,7 @@ import com.lyms.platform.permission.model.Users; import com.lyms.platform.permission.service.OrganizationService; import com.lyms.platform.permission.service.UsersService; import com.lyms.platform.pojo.*; -import com.lyms.platform.query.AntExRecordQuery; -import com.lyms.platform.query.BasicConfigQuery; -import com.lyms.platform.query.DataPermissionsModelQuery; -import com.lyms.platform.query.PatientsQuery; +import com.lyms.platform.query.*; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang.math.NumberUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -37,6 +34,7 @@ import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.OutputStream; import java.util.*; +import java.util.concurrent.Callable; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; @@ -630,6 +628,7 @@ public class AntExRecordFacade { //antExRecordQuery.setLevelId(antExManagerQueryRequest.getLevel()); List antExRecordModelList = recordService.queryAntExRecords(antExRecordQuery, Sort.Direction.DESC,"created"); + System.out.println("antExRecordModelList===================="+antExRecordModelList.size()); Map> map = handleAntexRecord(antExRecordModelList); AntExRecordQuery pageAntExRecordsQuery = new AntExRecordQuery(); @@ -643,121 +642,255 @@ public class AntExRecordFacade { } - private List getIncrRiskAntexRecard(Map> map,AntExRecordQuery pageAntExRecordsQuery,AntExManagerQueryRequest request) + private List getIncrRiskAntexRecard(final Map> map,AntExRecordQuery pageAntExRecordsQuery,final AntExManagerQueryRequest request) { List ids = new ArrayList<>(); Map> incriskMap = new HashMap<>(); - AntExRecordQuery beforeRecordQuery = new AntExRecordQuery(); if (map.size() > 0) { + List parentIds = new ArrayList<>(); for (String patientId : map.keySet()) { - List list = map.get(patientId); - if (CollectionUtils.isNotEmpty(list)) - { - if (list.size() == 1) - { - AntExRecordModel oneRecord = list.get(0); - if (!(CollectionUtils.isNotEmpty(oneRecord.gethRisk()) && oneRecord.gethRisk().contains("d42eec03-aa86-45b8-a4e0-78a0ff365fb6"))) - { - if (CollectionUtils.isNotEmpty(oneRecord.gethRisk())) - { - beforeRecordQuery.setParentId(patientId); - beforeRecordQuery.setCheckTimeEnd(oneRecord.getCheckTime()); - beforeRecordQuery.setNeqId(oneRecord.getId()); - List beforeAntRecords = recordService.queryAntExRecords(beforeRecordQuery); - if (CollectionUtils.isNotEmpty(beforeAntRecords)) - { - AntExRecordModel twoRecord = beforeAntRecords.get(0); - List currentRiskList = oneRecord.gethRisk(); - List beforeRiskList = twoRecord.gethRisk(); - - if (CollectionUtils.isNotEmpty(beforeRiskList) && beforeRiskList.contains("d42eec03-aa86-45b8-a4e0-78a0ff365fb6") - && getConditionRisk(request.getRiskFactorId(),currentRiskList,request.getLevel())) - { - ids.add(oneRecord.getId()); - incriskMap.put(oneRecord.getId(), currentRiskList); - } - else if (CollectionUtils.isNotEmpty(beforeRiskList) ) - { - List incrHrisk = new ArrayList(); - for (Object riskId : currentRiskList) - { - if (!beforeRiskList.contains(riskId)) - { - incrHrisk.add(riskId); - } - } - if (CollectionUtils.isNotEmpty(incrHrisk) && getConditionRisk(request.getRiskFactorId(),incrHrisk,request.getLevel())) - { - ids.add(oneRecord.getId()); - incriskMap.put(oneRecord.getId(), incrHrisk); - } - } - } - else - { - if (CollectionUtils.isNotEmpty(oneRecord.gethRisk()) && getConditionRisk(request.getRiskFactorId(), - oneRecord.gethRisk(),request.getLevel())) - { - ids.add(oneRecord.getId()); - incriskMap.put(oneRecord.getId(), oneRecord.gethRisk()); - } - } - } - } + parentIds.add(patientId); + } + + if (CollectionUtils.isNotEmpty(parentIds)) + { + + List listFuture = new ArrayList<>(); + int batchSize = 50; + int end = 0; + for (int i = 0; i < parentIds.size(); i += batchSize) { + end = (end + batchSize); + if (end > parentIds.size()) { + end = parentIds.size(); } - else if (list.size() > 1) - { - AntExRecordModel oneRecord = list.get(0); + System.out.println("start:" + i + ",end:" + end); + final List tempList = parentIds.subList(i, end); + listFuture.add(commonThreadPool.submit(new Callable() { + @Override + public Map call() { + Map result = new HashMap(); + if (CollectionUtils.isNotEmpty(tempList)) { + List ids = new ArrayList<>(); + Map> incriskMap = new HashMap<>(); + AntExRecordQuery beforeRecordQuery = new AntExRecordQuery(); + for (String patientId : tempList) { + List list = map.get(patientId); + if (CollectionUtils.isNotEmpty(list)) { + if (list.size() == 1) { + AntExRecordModel oneRecord = list.get(0); + if (!(CollectionUtils.isNotEmpty(oneRecord.gethRisk()) && oneRecord.gethRisk().contains("d42eec03-aa86-45b8-a4e0-78a0ff365fb6"))) { + if (CollectionUtils.isNotEmpty(oneRecord.gethRisk())) { + beforeRecordQuery.setParentId(patientId); + beforeRecordQuery.setCheckTimeEnd(oneRecord.getCheckTime()); + beforeRecordQuery.setNeqId(oneRecord.getId()); + List beforeAntRecords = recordService.queryAntExRecords(beforeRecordQuery); + if (CollectionUtils.isNotEmpty(beforeAntRecords)) { + AntExRecordModel twoRecord = beforeAntRecords.get(0); + List currentRiskList = oneRecord.gethRisk(); + List beforeRiskList = twoRecord.gethRisk(); + + if (CollectionUtils.isNotEmpty(beforeRiskList) && beforeRiskList.contains("d42eec03-aa86-45b8-a4e0-78a0ff365fb6") + && getConditionRisk(request.getRiskFactorId(), currentRiskList, request.getLevel())) { + ids.add(oneRecord.getId()); + incriskMap.put(oneRecord.getId(), currentRiskList); + } else if (CollectionUtils.isNotEmpty(beforeRiskList)) { + List incrHrisk = new ArrayList(); + for (Object riskId : currentRiskList) { + if (!beforeRiskList.contains(riskId)) { + incrHrisk.add(riskId); + } + } + if (CollectionUtils.isNotEmpty(incrHrisk) && getConditionRisk(request.getRiskFactorId(), incrHrisk, request.getLevel())) { + ids.add(oneRecord.getId()); + incriskMap.put(oneRecord.getId(), incrHrisk); + } + } + } else { + if (CollectionUtils.isNotEmpty(oneRecord.gethRisk()) && getConditionRisk(request.getRiskFactorId(), + oneRecord.gethRisk(), request.getLevel())) { + ids.add(oneRecord.getId()); + incriskMap.put(oneRecord.getId(), oneRecord.gethRisk()); + } + } + } + } + } else if (list.size() > 1) { + AntExRecordModel oneRecord = list.get(0); - if (CollectionUtils.isNotEmpty(oneRecord.gethRisk()) && oneRecord.gethRisk().contains("d42eec03-aa86-45b8-a4e0-78a0ff365fb6")) - { - continue; - } + if (CollectionUtils.isNotEmpty(oneRecord.gethRisk()) && oneRecord.gethRisk().contains("d42eec03-aa86-45b8-a4e0-78a0ff365fb6")) { + continue; + } - AntExRecordModel twoRecord = list.get(1); + AntExRecordModel twoRecord = list.get(1); - List currentRiskList = oneRecord.gethRisk(); - List beforeRiskList = twoRecord.gethRisk(); + List currentRiskList = oneRecord.gethRisk(); + List beforeRiskList = twoRecord.gethRisk(); - if (CollectionUtils.isEmpty(currentRiskList) && CollectionUtils.isEmpty(beforeRiskList)) - { - continue; - } - if (CollectionUtils.isNotEmpty(beforeRiskList) && beforeRiskList.contains("d42eec03-aa86-45b8-a4e0-78a0ff365fb6") - && CollectionUtils.isEmpty(currentRiskList)) - { - continue; - } + if (CollectionUtils.isEmpty(currentRiskList) && CollectionUtils.isEmpty(beforeRiskList)) { + continue; + } + if (CollectionUtils.isNotEmpty(beforeRiskList) && beforeRiskList.contains("d42eec03-aa86-45b8-a4e0-78a0ff365fb6") + && CollectionUtils.isEmpty(currentRiskList)) { + continue; + } - if (CollectionUtils.isNotEmpty(beforeRiskList) && beforeRiskList.contains("d42eec03-aa86-45b8-a4e0-78a0ff365fb6") - && getConditionRisk(request.getRiskFactorId(),currentRiskList,request.getLevel())) - { - ids.add(oneRecord.getId()); - incriskMap.put(oneRecord.getId(), currentRiskList); + if (CollectionUtils.isNotEmpty(beforeRiskList) && beforeRiskList.contains("d42eec03-aa86-45b8-a4e0-78a0ff365fb6") + && getConditionRisk(request.getRiskFactorId(), currentRiskList, request.getLevel())) { + ids.add(oneRecord.getId()); + incriskMap.put(oneRecord.getId(), currentRiskList); + } else if (CollectionUtils.isNotEmpty(beforeRiskList)) { + List incrHrisk = new ArrayList(); + for (Object riskId : currentRiskList) { + if (!beforeRiskList.contains(riskId)) { + incrHrisk.add(String.valueOf(riskId)); + } + } + if (CollectionUtils.isNotEmpty(incrHrisk) && getConditionRisk(request.getRiskFactorId(), incrHrisk, request.getLevel())) { + + ids.add(oneRecord.getId()); + incriskMap.put(oneRecord.getId(), incrHrisk); + } + } + } + } + } + result.put("ids",ids); + result.put("inc",incriskMap); + } + return result; } - else if (CollectionUtils.isNotEmpty(beforeRiskList) ) - { - List incrHrisk = new ArrayList(); - for (Object riskId : currentRiskList) + })); + + for (Future f : listFuture) { + try { + Map fmap = (Map) f.get(30, TimeUnit.SECONDS); + if (fmap.get("ids") != null) { - if (!beforeRiskList.contains(riskId)) - { - incrHrisk.add(String.valueOf(riskId)); - } + ids.addAll((List)fmap.get("ids")); } - if (CollectionUtils.isNotEmpty(incrHrisk) && getConditionRisk(request.getRiskFactorId(),incrHrisk,request.getLevel())) + if (fmap.get("inc") != null) { - - ids.add(oneRecord.getId()); - incriskMap.put(oneRecord.getId(), incrHrisk); + incriskMap.putAll((Map)fmap.get("inc")); } + } catch (Exception e) { + ExceptionUtils.catchException(e, "antexrecord findList get result future error."); } } } } + + + +// for (String patientId : map.keySet()) +// { +// List list = map.get(patientId); +// if (CollectionUtils.isNotEmpty(list)) +// { +// if (list.size() == 1) +// { +// AntExRecordModel oneRecord = list.get(0); +// if (!(CollectionUtils.isNotEmpty(oneRecord.gethRisk()) && oneRecord.gethRisk().contains("d42eec03-aa86-45b8-a4e0-78a0ff365fb6"))) +// { +// if (CollectionUtils.isNotEmpty(oneRecord.gethRisk())) +// { +// beforeRecordQuery.setParentId(patientId); +// beforeRecordQuery.setCheckTimeEnd(oneRecord.getCheckTime()); +// beforeRecordQuery.setNeqId(oneRecord.getId()); +// List beforeAntRecords = recordService.queryAntExRecords(beforeRecordQuery); +// if (CollectionUtils.isNotEmpty(beforeAntRecords)) +// { +// AntExRecordModel twoRecord = beforeAntRecords.get(0); +// List currentRiskList = oneRecord.gethRisk(); +// List beforeRiskList = twoRecord.gethRisk(); +// +// if (CollectionUtils.isNotEmpty(beforeRiskList) && beforeRiskList.contains("d42eec03-aa86-45b8-a4e0-78a0ff365fb6") +// && getConditionRisk(request.getRiskFactorId(),currentRiskList,request.getLevel())) +// { +// ids.add(oneRecord.getId()); +// incriskMap.put(oneRecord.getId(), currentRiskList); +// } +// else if (CollectionUtils.isNotEmpty(beforeRiskList) ) +// { +// List incrHrisk = new ArrayList(); +// for (Object riskId : currentRiskList) +// { +// if (!beforeRiskList.contains(riskId)) +// { +// incrHrisk.add(riskId); +// } +// } +// if (CollectionUtils.isNotEmpty(incrHrisk) && getConditionRisk(request.getRiskFactorId(),incrHrisk,request.getLevel())) +// { +// ids.add(oneRecord.getId()); +// incriskMap.put(oneRecord.getId(), incrHrisk); +// } +// } +// } +// else +// { +// if (CollectionUtils.isNotEmpty(oneRecord.gethRisk()) && getConditionRisk(request.getRiskFactorId(), +// oneRecord.gethRisk(),request.getLevel())) +// { +// ids.add(oneRecord.getId()); +// incriskMap.put(oneRecord.getId(), oneRecord.gethRisk()); +// } +// } +// } +// } +// } +// else if (list.size() > 1) +// { +// AntExRecordModel oneRecord = list.get(0); +// +// if (CollectionUtils.isNotEmpty(oneRecord.gethRisk()) && oneRecord.gethRisk().contains("d42eec03-aa86-45b8-a4e0-78a0ff365fb6")) +// { +// continue; +// } +// +// AntExRecordModel twoRecord = list.get(1); +// +// List currentRiskList = oneRecord.gethRisk(); +// List beforeRiskList = twoRecord.gethRisk(); +// +// if (CollectionUtils.isEmpty(currentRiskList) && CollectionUtils.isEmpty(beforeRiskList)) +// { +// continue; +// } +// if (CollectionUtils.isNotEmpty(beforeRiskList) && beforeRiskList.contains("d42eec03-aa86-45b8-a4e0-78a0ff365fb6") +// && CollectionUtils.isEmpty(currentRiskList)) +// { +// continue; +// } +// +// if (CollectionUtils.isNotEmpty(beforeRiskList) && beforeRiskList.contains("d42eec03-aa86-45b8-a4e0-78a0ff365fb6") +// && getConditionRisk(request.getRiskFactorId(),currentRiskList,request.getLevel())) +// { +// ids.add(oneRecord.getId()); +// incriskMap.put(oneRecord.getId(), currentRiskList); +// } +// else if (CollectionUtils.isNotEmpty(beforeRiskList) ) +// { +// List incrHrisk = new ArrayList(); +// for (Object riskId : currentRiskList) +// { +// if (!beforeRiskList.contains(riskId)) +// { +// incrHrisk.add(String.valueOf(riskId)); +// } +// } +// if (CollectionUtils.isNotEmpty(incrHrisk) && getConditionRisk(request.getRiskFactorId(),incrHrisk,request.getLevel())) +// { +// +// ids.add(oneRecord.getId()); +// incriskMap.put(oneRecord.getId(), incrHrisk); +// } +// } +// } +// } +// } } if (CollectionUtils.isEmpty(ids)) 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 b7b0b8b..60343cc 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 @@ -2636,9 +2636,38 @@ public class MatDeliverFacade { 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); - ExcelUtil.writeExclFile(path , httpServletResponse.getOutputStream(), areaNames,"成都市","成都取",time,list); + + 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)) + { + 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(); + } + } + 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(); + } + } + + ExcelUtil.writeExclFile(path , httpServletResponse.getOutputStream(), areaNames,title,areaName,timeStr,list); } catch (IOException e) { ExceptionUtils.catchException(e, "exporDueOrgCount error"); } @@ -2742,10 +2771,13 @@ public class MatDeliverFacade { int huiYinSpitCount = 0; //会阴情况 切开 int fzrDoubleCount = 0; //非自然妊娠双胎 -// int lowWeightCount = ; //低出生体重数 + + int bigBoyCount =0 ; //巨大儿数 + int lowWeightCount = 0; //低出生体重数 + // int babySiWangCount = ; //新生儿死亡数 // int sieveCount = ; //筛查数 -// int bigBoyCount = ; //巨大儿数 + // int sieveFreeCount = ; //35岁以下免费筛查数 // int fmOtherCount = ; //分娩方式 其他 @@ -2774,12 +2806,42 @@ public class MatDeliverFacade { doubleCount += Integer.parseInt(map.get("doubleCount")); //双胎数 huiYinSpitCount += Integer.parseInt(map.get("huiYinSpitCount")); //会阴情况 切开 fzrDoubleCount += Integer.parseInt(map.get("fzrDoubleCount")); //非自然妊娠双胎 + + bigBoyCount += Integer.parseInt(map.get("bigBoyCount")); //巨大儿数 + lowWeightCount += Integer.parseInt(map.get("lowWeightCount")); //低出生体重数 } } 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++) { @@ -2791,37 +2853,8 @@ public class MatDeliverFacade { totalMap.put("areaCount"+i,String.valueOf(total)); } - - totalMap.put("orgName","合计"); - totalMap.put("fmPoGongCount",String.valueOf(fmPoGongCount)); - totalMap.put("wsCount",String.valueOf(wsCount)); - totalMap.put("chanCount",String.valueOf(chanCount)); - totalMap.put("babySiTaiCount",String.valueOf(babySiTaiCount)); - totalMap.put("girlCount",String.valueOf(girlCount)); - totalMap.put("boyCount",String.valueOf(boyCount)); - totalMap.put("bswsCount",String.valueOf(bswsCount)); - totalMap.put("huoChanCount",String.valueOf(huoChanCount)); - totalMap.put("babySiChanCount",String.valueOf(babySiChanCount)); - totalMap.put("zcBabyCount",String.valueOf(zcBabyCount)); - totalMap.put("huiYinFullCount",String.valueOf(huiYinFullCount)); - totalMap.put("siLielevelCount",String.valueOf(siLielevelCount)); - totalMap.put("siLielevelYzCount",String.valueOf(siLielevelYzCount)); - totalMap.put("queXianBabyCount",String.valueOf(queXianBabyCount)); - totalMap.put("huiYingTotalCount",String.valueOf(huiYingTotalCount)); - totalMap.put("fmShunChanCount",String.valueOf(fmShunChanCount)); - - totalMap.put("riskCount",String.valueOf(riskCount)); - totalMap.put("fmCount",String.valueOf(fmCount)); - totalMap.put("doubleCount",String.valueOf(doubleCount)); - totalMap.put("huiYinSpitCount",String.valueOf(huiYinSpitCount)); - totalMap.put("fzrDoubleCount",String.valueOf(fzrDoubleCount)); - - totalMap.put("lowWeightCount",""); - totalMap.put("babySiWangCount",""); totalMap.put("sieveCount",""); - totalMap.put("bigBoyCount",""); totalMap.put("sieveFreeCount",""); - totalMap.put("fmOtherCount",""); list.add(totalMap); } } \ No newline at end of file diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/DueOrgCountWorker.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/DueOrgCountWorker.java index 088ff27..29aa257 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/DueOrgCountWorker.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/DueOrgCountWorker.java @@ -95,6 +95,7 @@ public class DueOrgCountWorker implements Callable>> { patientsQuery.setCreatedTimeStart(DateUtil.getSNDate(time)[0]); patientsQuery.setCreatedTimeEnd(DateUtil.getSNDate(time)[1]); } + patientsQuery.setHospitalId(hospialId); int riskCount = patientsService.queryPatientCount(patientsQuery); map.put("riskCount", String.valueOf(riskCount)); @@ -104,8 +105,8 @@ public class DueOrgCountWorker implements Callable>> { babyModelQuery.setHospitalId(hospialId); if (StringUtils.isNotEmpty(time)) { - babyModelQuery.setBuildDateStart(DateUtil.getSNDate(time)[0]); - babyModelQuery.setBuildDateEnd(DateUtil.getSNDate(time)[1]); + babyModelQuery.setBirthStart(DateUtil.getSNDate(time)[0]); + babyModelQuery.setBirthEnd(DateUtil.getSNDate(time)[1]); } babyModelQuery.setBuildType(2); babyModelQuery.setOrder("birth"); @@ -147,8 +148,8 @@ public class DueOrgCountWorker implements Callable>> { babyModelQuery1.setBuildType(2); if (StringUtils.isNotEmpty(time)) { - babyModelQuery1.setBuildDateStart(DateUtil.getSNDate(time)[0]); - babyModelQuery1.setBuildDateEnd(DateUtil.getSNDate(time)[1]); + babyModelQuery1.setBirthStart(DateUtil.getSNDate(time)[0]); + babyModelQuery1.setBirthEnd(DateUtil.getSNDate(time)[1]); } babyModelQuery1.setOrder("birth"); babyModelQuery1.setSex(1); @@ -163,8 +164,8 @@ public class DueOrgCountWorker implements Callable>> { if (StringUtils.isNotEmpty(time)) { - babyModelQuery2.setBuildDateStart(DateUtil.getSNDate(time)[0]); - babyModelQuery2.setBuildDateEnd(DateUtil.getSNDate(time)[1]); + babyModelQuery2.setBirthStart(DateUtil.getSNDate(time)[0]); + babyModelQuery2.setBirthEnd(DateUtil.getSNDate(time)[1]); } babyModelQuery2.setBuildType(2); @@ -279,8 +280,8 @@ public class DueOrgCountWorker implements Callable>> { babyModelQuery3.setHospitalId(hospialId); if (StringUtils.isNotEmpty(time)) { - babyModelQuery3.setBuildDateStart(DateUtil.getSNDate(time)[0]); - babyModelQuery3.setBuildDateEnd(DateUtil.getSNDate(time)[1]); + babyModelQuery3.setBirthStart(DateUtil.getSNDate(time)[0]); + babyModelQuery3.setBirthEnd(DateUtil.getSNDate(time)[1]); } //0非畸形 1畸形 babyModelQuery3.setBuildType(2); @@ -335,10 +336,34 @@ public class DueOrgCountWorker implements Callable>> { map.put("babySiChanCount", String.valueOf(babySiChanCount)); map.put("babySiTaiCount", String.valueOf(babySiTaiCount)); + + BabyModelQuery babyModelQuery5 = new BabyModelQuery(); + babyModelQuery5.setDataStatus(false); + babyModelQuery5.setHospitalId(hospialId); + if (StringUtils.isNotEmpty(time)) + { + babyModelQuery5.setBirthStart(DateUtil.getSNDate(time)[0]); + babyModelQuery5.setBirthEnd(DateUtil.getSNDate(time)[1]); + } + babyModelQuery5.setBabyWeightStart("4"); + int bigBoyCount = babyService.queryBabyCount(babyModelQuery5); + //巨大儿数 - map.put("bigBoyCount", ""); + map.put("bigBoyCount", String.valueOf(bigBoyCount)); + + + BabyModelQuery babyModelQuery6 = new BabyModelQuery(); + babyModelQuery6.setDataStatus(false); + babyModelQuery6.setHospitalId(hospialId); + if (StringUtils.isNotEmpty(time)) + { + babyModelQuery5.setBirthStart(DateUtil.getSNDate(time)[0]); + babyModelQuery5.setBirthEnd(DateUtil.getSNDate(time)[1]); + } + babyModelQuery6.setBabyWeightEnd("2.5"); + int lowWeightCount = babyService.queryBabyCount(babyModelQuery5); //低出生体重数 - map.put("lowWeightCount", ""); + map.put("lowWeightCount", String.valueOf(lowWeightCount)); //早产儿数 int zcBabyCount = 0; -- 1.8.3.1