Commit 977749549e9db3e031cd812738bb0894af52cd99

Authored by liquanyu
1 parent 6a157df9ad

分娩查询

Showing 2 changed files with 350 additions and 339 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java View file @ 9777495
... ... @@ -1680,17 +1680,17 @@
1680 1680 }
1681 1681 if (matdeliverFollowRequest.getStartDay() != null && matdeliverFollowRequest.getEndDay() != null )
1682 1682 {
1683   - matDeliverQuery.setCreatedStart(DateUtil.formatDate(DateUtil.addDay(new Date(), -matdeliverFollowRequest.getEndDay()-1)));
  1683 + matDeliverQuery.setCreatedStart(DateUtil.formatDate(DateUtil.addDay(new Date(), -matdeliverFollowRequest.getEndDay())));
1684 1684 matDeliverQuery.setEndStart(DateUtil.formatDate(DateUtil.addDay(new Date(), -matdeliverFollowRequest.getStartDay()+1)));
1685 1685 }
1686 1686 else if (matdeliverFollowRequest.getStartDay() != null)
1687 1687 {
1688   - matDeliverQuery.setCreatedStart(DateUtil.formatDate(DateUtil.addDay(new Date(), -matdeliverFollowRequest.getStartDay()-1)));
  1688 + matDeliverQuery.setCreatedStart(DateUtil.formatDate(DateUtil.addDay(new Date(), -matdeliverFollowRequest.getStartDay())));
1689 1689 matDeliverQuery.setEndStart(DateUtil.formatDate(DateUtil.addDay(new Date(), -matdeliverFollowRequest.getStartDay()+1)));
1690 1690 }
1691 1691 else if(matdeliverFollowRequest.getEndDay() != null)
1692 1692 {
1693   - matDeliverQuery.setCreatedStart(DateUtil.formatDate(DateUtil.addDay(new Date(), -matdeliverFollowRequest.getEndDay()-1)));
  1693 + matDeliverQuery.setCreatedStart(DateUtil.formatDate(DateUtil.addDay(new Date(), -matdeliverFollowRequest.getEndDay())));
1694 1694 matDeliverQuery.setEndStart(DateUtil.formatDate(DateUtil.addDay(new Date(), -matdeliverFollowRequest.getEndDay()+1)));
1695 1695 }
1696 1696  
... ... @@ -1905,7 +1905,8 @@
1905 1905 }
1906 1906 }
1907 1907 }
1908   - if (!childbirthManagerRequest.isExcel() && childbirthManagerRequest.getHloseBloodType() == null && StringUtils.isEmpty(childbirthManagerRequest.getDeliveryMode())) {//导出excel和根据出血量查询
  1908 + if (!childbirthManagerRequest.isExcel() && childbirthManagerRequest.getHloseBloodType() == null
  1909 + && StringUtils.isEmpty(childbirthManagerRequest.getDeliveryMode()) && childbirthManagerRequest.getWeight() == null) {//导出excel和根据出血量查询
1909 1910 patientsQuery.setLimit(childbirthManagerRequest.getLimit());
1910 1911 patientsQuery.setPage(childbirthManagerRequest.getPage());
1911 1912 patientsQuery.setNeed("need");
... ... @@ -1924,8 +1925,6 @@
1924 1925 patientsQuery.setHusbandPhone(StringUtils.isEmpty(childbirthManagerRequest.getHusbandPhone()) ? null : childbirthManagerRequest.getHusbandPhone());
1925 1926 patientsQuery.setQueryNo(StringUtils.isEmpty(childbirthManagerRequest.getQueryNo()) ? null : childbirthManagerRequest.getQueryNo());
1926 1927 patientsQuery.setFmHospitalQueryList(hospitalList);
1927   - // String deliveryModeQueryJson = "fmfs\\\":\\\"" + childbirthManagerRequest.getDeliveryMode();
1928   - // patientsQuery.setFmType(StringUtils.isEmpty(childbirthManagerRequest.getDeliveryMode()) ? null : deliveryModeQueryJson);
1929 1928 patientsQuery.setFmAgeStart(StringUtils.isEmpty(childbirthManagerRequest.getStartAge()) ? null : Integer.valueOf(childbirthManagerRequest.getStartAge()));
1930 1929 patientsQuery.setFmAgeEnd(StringUtils.isEmpty(childbirthManagerRequest.getEndAge()) ? null : Integer.valueOf(childbirthManagerRequest.getEndAge()));
1931 1930 patientsQuery.setFmWeekStart(StringUtils.isEmpty(childbirthManagerRequest.getStartDueWeek()) ? null : Integer.valueOf(childbirthManagerRequest.getStartDueWeek()) * 7);
1932 1931  
... ... @@ -1933,8 +1932,9 @@
1933 1932 // 分娩方式去另外一张表查
1934 1933 patientsQuery.setDesc("fmDate");
1935 1934 patientsQuery.setSort("fmDate");
1936   - // System.out.println("分娩查询:" + patientsQuery.convertToQuery().convertToMongoQuery());
1937 1935 List<Patients> patientsList = patientsService.queryPatient(patientsQuery);
  1936 +
  1937 +
1938 1938 // 这里就设置分页内容
1939 1939 childbirthManagerResult.setPageInfo(patientsQuery.getPageInfo());
1940 1940 List<String> parentIdList = new ArrayList<>();
... ... @@ -1949,7 +1949,7 @@
1949 1949 }
1950 1950  
1951 1951 MatDeliverQuery matDeliverQuery = new MatDeliverQuery();
1952   -
  1952 + matDeliverQuery.setParentIdList(parentIdList);
1953 1953 matDeliverQuery.setYn(YnEnums.YES.getId());
1954 1954 matDeliverQuery.setHloseBloodType(childbirthManagerRequest.getHloseBloodType());
1955 1955 String deliveryModeQueryJson = "fmfs\\\":\\\"" + childbirthManagerRequest.getDeliveryMode();
1956 1956  
1957 1957  
... ... @@ -1962,15 +1962,12 @@
1962 1962 matDeliverQuery.setLimit(childbirthManagerRequest.getLimit());
1963 1963 matDeliverQuery.setPage(childbirthManagerRequest.getPage());
1964 1964 matDeliverQuery.setNeed("need");
1965   - // System.out.println("分娩查询条件:" + matDeliverQuery.convertToQuery().convertToMongoQuery());
1966 1965 maternalDeliverModelList = matDeliverService.pageQuery(matDeliverQuery);
1967 1966 // 这里就设置分页内容
1968 1967 childbirthManagerResult.setPageInfo(matDeliverQuery.getPageInfo());
1969 1968 } else {//否则按常规查询
1970   - // System.out.println("分娩查询条件:"+matDeliverQuery.convertToQuery().convertToMongoQuery());
1971 1969 maternalDeliverModelList = matDeliverService.query(matDeliverQuery);
1972 1970 }
1973   - // System.out.println("分娩表查询:"+matDeliverQuery.convertToQuery().convertToMongoQuery());
1974 1971  
1975 1972 Map<String, Patients> patientsMap = new HashedMap();
1976 1973  
1977 1974  
1978 1975  
... ... @@ -1992,15 +1989,20 @@
1992 1989 babyService, basicConfigService, childbirthManagerRequest.getInitQuery(),
1993 1990 mlist, patientsMap);
1994 1991 Future f = commonThreadPool.submit(c);
1995   - futures.add(f);
  1992 + if (f != null)
  1993 + {
  1994 + futures.add(f);
  1995 + }
  1996 +
1996 1997 }
1997 1998  
1998 1999 if (CollectionUtils.isNotEmpty(futures)) {
1999 2000 for (Future f : futures) {
2000 2001 try {
  2002 +
2001 2003 childbirthManagerQueryModelList.addAll((List<ChildbirthManagerQueryModel>) f.get());
2002 2004 } catch (Exception e) {
2003   - ExceptionUtils.catchException(e, "getCourseCount list error.");
  2005 + ExceptionUtils.catchException(e, "fm list error.");
2004 2006 }
2005 2007 }
2006 2008 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/MaterDeliverWorker.java View file @ 9777495
... ... @@ -59,406 +59,415 @@
59 59 @Override
60 60 public List<ChildbirthManagerQueryModel> call() {
61 61 List<ChildbirthManagerQueryModel> childbirthManagerQueryModelList = new ArrayList<>();
62   - for (MaternalDeliverModel maternalDeliverModel : maternalDeliverModelList) {
63   - Patients patients = patientsMap.get(maternalDeliverModel.getParentId());
64   - // 开始封装数据
65   - ChildbirthManagerQueryModel childbirthManagerQueryModel = new ChildbirthManagerQueryModel();
66   - if (maternalDeliverModel != null) {
67   - BeanUtils.copy(maternalDeliverModel, childbirthManagerQueryModel);
68   - }
69   - BeanUtils.copy(patients, childbirthManagerQueryModel);
70   - // 分娩孕周
71   - String week = (patients.getFmWeek() / 7) + "";
72   - int day = (patients.getFmWeek() % 7);
73   - childbirthManagerQueryModel.setDueWeek("孕" + week + "周" + (day > 0 ? "+" + day + "天" : ""));
74   - // 分娩日期
75   - childbirthManagerQueryModel.setDueDate(DateUtil.getyyyy_MM_dd(patients.getFmDate()));
76   - // name
77   - childbirthManagerQueryModel.setName(patients.getUsername());
78   - // 各种id
79   - childbirthManagerQueryModel.setPid(patients.getPid());
80   - childbirthManagerQueryModel.setPatientId(patients.getId());
81   - // 居住地
82   - if (initQuery.contains("address")) {
83   - childbirthManagerQueryModel.setAddress(CommonsHelper.getResidence(patients.getProvinceRegisterId(), patients.getCityRegisterId(), patients.getAreaRegisterId(), patients.getStreetRegisterId(), patients.getAddressRegister(), basicConfigService));
84   - }
85   - // 电话转换
86   - childbirthManagerQueryModel.setPhone(DefenceUtils.getPhone(patients.getPhone()));
87   - childbirthManagerQueryModel.setHusbandPhone(DefenceUtils.getPhone(patients.getHusbandPhone()));
88   - // 加密身份证号
89   - childbirthManagerQueryModel.setCardNo(DefenceUtils.getCardNo(patients.getCardNo()));
90   - // 年龄
91   - childbirthManagerQueryModel.setAge(DateUtil.getAge(patients.getBirth()));
  62 + try {
  63 + for (MaternalDeliverModel maternalDeliverModel : maternalDeliverModelList) {
  64 + Patients patients = patientsMap.get(maternalDeliverModel.getParentId());
  65 + if (patients == null)
  66 + {
  67 + continue;
  68 + }
  69 + // 开始封装数据
  70 + ChildbirthManagerQueryModel childbirthManagerQueryModel = new ChildbirthManagerQueryModel();
  71 + if (maternalDeliverModel != null) {
  72 + BeanUtils.copy(maternalDeliverModel, childbirthManagerQueryModel);
  73 + }
  74 + BeanUtils.copy(patients, childbirthManagerQueryModel);
  75 + // 分娩孕周
  76 + String week = (patients.getFmWeek() / 7) + "";
  77 + int day = (patients.getFmWeek() % 7);
  78 + childbirthManagerQueryModel.setDueWeek("孕" + week + "周" + (day > 0 ? "+" + day + "天" : ""));
  79 + // 分娩日期
  80 + childbirthManagerQueryModel.setDueDate(DateUtil.getyyyy_MM_dd(patients.getFmDate()));
  81 + // name
  82 + childbirthManagerQueryModel.setName(patients.getUsername());
  83 + // 各种id
  84 + childbirthManagerQueryModel.setPid(patients.getPid());
  85 + childbirthManagerQueryModel.setPatientId(patients.getId());
  86 + // 居住地
  87 + if (initQuery.contains("address")) {
  88 + childbirthManagerQueryModel.setAddress(CommonsHelper.getResidence(patients.getProvinceRegisterId(), patients.getCityRegisterId(), patients.getAreaRegisterId(), patients.getStreetRegisterId(), patients.getAddressRegister(), basicConfigService));
  89 + }
  90 + // 电话转换
  91 + childbirthManagerQueryModel.setPhone(DefenceUtils.getPhone(patients.getPhone()));
  92 + childbirthManagerQueryModel.setHusbandPhone(DefenceUtils.getPhone(patients.getHusbandPhone()));
  93 + // 加密身份证号
  94 + childbirthManagerQueryModel.setCardNo(DefenceUtils.getCardNo(patients.getCardNo()));
  95 + // 年龄
  96 + childbirthManagerQueryModel.setAge(DateUtil.getAge(patients.getBirth()));
92 97  
93   - // 居住类型
94   - if (initQuery.contains("pliveTypeId")) {
95   - try {
96   - if (org.apache.commons.lang.StringUtils.isNotEmpty(patients.getPliveTypeId())) {
97   - childbirthManagerQueryModel.setPliveTypeId(basicConfigService.getOneBasicConfigById(patients.getPliveTypeId()).getName());
  98 + // 居住类型
  99 + if (initQuery.contains("pliveTypeId")) {
  100 + try {
  101 + if (org.apache.commons.lang.StringUtils.isNotEmpty(patients.getPliveTypeId())) {
  102 + childbirthManagerQueryModel.setPliveTypeId(basicConfigService.getOneBasicConfigById(patients.getPliveTypeId()).getName());
  103 + }
  104 + } catch (Exception e) {
  105 + // 什么都不干
98 106 }
99   - } catch (Exception e) {
100   - // 什么都不干
101 107 }
102   - }
103 108  
104   - // 户口类型
105   - if (initQuery.contains("pcensusTypeId")) {
106   - try {
107   - if (org.apache.commons.lang.StringUtils.isNotEmpty(patients.getPcensusTypeId())) {
108   - childbirthManagerQueryModel.setPcensusTypeId(basicConfigService.getOneBasicConfigById(patients.getPcensusTypeId()).getName());
  109 + // 户口类型
  110 + if (initQuery.contains("pcensusTypeId")) {
  111 + try {
  112 + if (org.apache.commons.lang.StringUtils.isNotEmpty(patients.getPcensusTypeId())) {
  113 + childbirthManagerQueryModel.setPcensusTypeId(basicConfigService.getOneBasicConfigById(patients.getPcensusTypeId()).getName());
  114 + }
  115 + } catch (Exception e) {
  116 + // 什么都不干
109 117 }
110   - } catch (Exception e) {
111   - // 什么都不干
112 118 }
113   - }
114 119  
115   - // 查询活产数
116   - // 妊娠结局,儿童性别,儿童体重,儿童身长,Apgar1分钟,Apgar5分钟,Apgar10分钟,窒息分钟数,新生儿疾病,畸形
117   - if (initQuery.contains("livingNumber") || initQuery.contains("pregnancyOut")
118   - || initQuery.contains("sex") || initQuery.contains("babyWeight")
119   - || initQuery.contains("babyHeight") || initQuery.contains("apgarScorePf1") ||
120   - initQuery.contains("apgarScorePf5") || initQuery.contains("apgarScorePf10") ||
121   - initQuery.contains("asphyxiaM") || initQuery.contains("babyHealthy") ||
122   - initQuery.contains("malformation")) {
123   - BabyModelQuery babyModelQuery = new BabyModelQuery();
124   - // babyModelQuery.setYn(YnEnums.YES.getId());
125   - babyModelQuery.setParentId(patients.getId());
126   - babyModelQuery.setDataStatus(false);
127   - babyModelQuery.setPregnancyOut(RenShenJieJuEnums.O.getId());
128   - //System.out.println("查询调价n:"+babyModelQuery.convertToQuery().convertToMongoQuery());
129   - List<BabyModel> babyModelList = babyService.queryBabyWithQuery(babyModelQuery);
130   - if (CollectionUtils.isNotEmpty(babyModelList)) {
131   - childbirthManagerQueryModel.setLivingNumber(babyModelList.size());
132   - } else {
133   - if (childbirthManagerQueryModel.getTireNumber() == null) {
134   - childbirthManagerQueryModel.setLivingNumber(null);
  120 + // 查询活产数
  121 + // 妊娠结局,儿童性别,儿童体重,儿童身长,Apgar1分钟,Apgar5分钟,Apgar10分钟,窒息分钟数,新生儿疾病,畸形
  122 + if (initQuery.contains("livingNumber") || initQuery.contains("pregnancyOut")
  123 + || initQuery.contains("sex") || initQuery.contains("babyWeight")
  124 + || initQuery.contains("babyHeight") || initQuery.contains("apgarScorePf1") ||
  125 + initQuery.contains("apgarScorePf5") || initQuery.contains("apgarScorePf10") ||
  126 + initQuery.contains("asphyxiaM") || initQuery.contains("babyHealthy") ||
  127 + initQuery.contains("malformation")) {
  128 + BabyModelQuery babyModelQuery = new BabyModelQuery();
  129 + // babyModelQuery.setYn(YnEnums.YES.getId());
  130 + babyModelQuery.setParentId(patients.getId());
  131 + babyModelQuery.setDataStatus(false);
  132 + babyModelQuery.setPregnancyOut(RenShenJieJuEnums.O.getId());
  133 + //System.out.println("查询调价n:"+babyModelQuery.convertToQuery().convertToMongoQuery());
  134 + List<BabyModel> babyModelList = babyService.queryBabyWithQuery(babyModelQuery);
  135 + if (CollectionUtils.isNotEmpty(babyModelList)) {
  136 + childbirthManagerQueryModel.setLivingNumber(babyModelList.size());
135 137 } else {
136   - childbirthManagerQueryModel.setLivingNumber(0);
  138 + if (childbirthManagerQueryModel.getTireNumber() == null) {
  139 + childbirthManagerQueryModel.setLivingNumber(null);
  140 + } else {
  141 + childbirthManagerQueryModel.setLivingNumber(0);
  142 + }
137 143 }
138   - }
139 144  
140   - if (CollectionUtils.isNotEmpty(babyModelList)) {
141   - String pregnancyOut = "";
142   - String sex = "";
143   - String babyWeight = "";
144   - String babyHeight = "";
145   - String apgarScorePf1 = "";
146   - String apgarScorePf5 = "";
147   - String apgarScorePf10 = "";
148   - String asphyxiaM = "";
149   - String babyHealthy = "";
150   - String malformation = "";
151   - try {
152   - for (BabyModel babyModel : babyModelList) {
153   - if (initQuery.contains("pregnancyOut")) {
154   - for (RenShenJieJuEnums renShenJieJuEnums : RenShenJieJuEnums.values()) {
155   - if (renShenJieJuEnums.getId().equals(babyModel.getPregnancyOut())) {
156   - pregnancyOut += renShenJieJuEnums.getName() + ",";
157   - break;
  145 + if (CollectionUtils.isNotEmpty(babyModelList)) {
  146 + String pregnancyOut = "";
  147 + String sex = "";
  148 + String babyWeight = "";
  149 + String babyHeight = "";
  150 + String apgarScorePf1 = "";
  151 + String apgarScorePf5 = "";
  152 + String apgarScorePf10 = "";
  153 + String asphyxiaM = "";
  154 + String babyHealthy = "";
  155 + String malformation = "";
  156 + try {
  157 + for (BabyModel babyModel : babyModelList) {
  158 + if (initQuery.contains("pregnancyOut")) {
  159 + for (RenShenJieJuEnums renShenJieJuEnums : RenShenJieJuEnums.values()) {
  160 + if (renShenJieJuEnums.getId().equals(babyModel.getPregnancyOut())) {
  161 + pregnancyOut += renShenJieJuEnums.getName() + ",";
  162 + break;
  163 + }
  164 + if (org.apache.commons.lang.StringUtils.isEmpty(pregnancyOut)) {
  165 + pregnancyOut += "-,";
  166 + }
158 167 }
159   - if (org.apache.commons.lang.StringUtils.isEmpty(pregnancyOut)) {
160   - pregnancyOut += "-,";
161   - }
162 168 }
163   - }
164   - if (initQuery.contains("sex")) {
165   - for (SexEnum sexEnum : SexEnum.values()) {
166   - if (sexEnum.getId().equals(babyModel.getSex())) {
167   - sex += sexEnum.getText() + ",";
168   - break;
  169 + if (initQuery.contains("sex")) {
  170 + for (SexEnum sexEnum : SexEnum.values()) {
  171 + if (sexEnum.getId().equals(babyModel.getSex())) {
  172 + sex += sexEnum.getText() + ",";
  173 + break;
  174 + }
  175 + if (org.apache.commons.lang.StringUtils.isEmpty(sex)) {
  176 + sex += "-,";
  177 + }
169 178 }
170   - if (org.apache.commons.lang.StringUtils.isEmpty(sex)) {
171   - sex += "-,";
172   - }
173 179 }
  180 + babyWeight += babyModel.getBabyWeight() == null ? "-," : babyModel.getBabyWeight() + ",";
  181 + babyHeight += babyModel.getBabyHeight() == null ? "-," : babyModel.getBabyHeight() + ",";
  182 + asphyxiaM += babyModel.getAsphyxiaM() == null ? "-," : babyModel.getAsphyxiaM() + ",";
  183 + babyHealthy += babyModel.getBabyHealthy() == null ? "-," : babyModel.getBabyHealthy() + ",";
  184 + if (Integer.valueOf(0).equals(babyModel.getMalformation())) {
  185 + malformation += "非畸形" + ",";
  186 + } else if (Integer.valueOf(1).equals(babyModel.getMalformation())) {
  187 + malformation += "畸形" + ",";
  188 + } else {
  189 + malformation += "-,";
  190 + }
  191 + Map<String, String> map = JsonUtil.getMap(babyModel.getApgarScore());
  192 + if (MapUtils.isNotEmpty(map)) {
  193 + apgarScorePf1 += map.get("pf1") == null ? "-," : map.get("pf1") + ",";
  194 + apgarScorePf5 += map.get("pf5") == null ? "-," : map.get("pf5") + ",";
  195 + apgarScorePf10 += map.get("pf10") == null ? "-," : map.get("pf10") + ",";
  196 + }
174 197 }
175   - babyWeight += babyModel.getBabyWeight() == null ? "-," : babyModel.getBabyWeight() + ",";
176   - babyHeight += babyModel.getBabyHeight() == null ? "-," : babyModel.getBabyHeight() + ",";
177   - asphyxiaM += babyModel.getAsphyxiaM() == null ? "-," : babyModel.getAsphyxiaM() + ",";
178   - babyHealthy += babyModel.getBabyHealthy() == null ? "-," : babyModel.getBabyHealthy() + ",";
179   - if (Integer.valueOf(0).equals(babyModel.getMalformation())) {
180   - malformation += "非畸形" + ",";
181   - } else if (Integer.valueOf(1).equals(babyModel.getMalformation())) {
182   - malformation += "畸形" + ",";
183   - } else {
184   - malformation += "-,";
185   - }
186   - Map<String, String> map = JsonUtil.getMap(babyModel.getApgarScore());
187   - if (MapUtils.isNotEmpty(map)) {
188   - apgarScorePf1 += map.get("pf1") == null ? "-," : map.get("pf1") + ",";
189   - apgarScorePf5 += map.get("pf5") == null ? "-," : map.get("pf5") + ",";
190   - apgarScorePf10 += map.get("pf10") == null ? "-," : map.get("pf10") + ",";
191   - }
  198 + } catch (Exception e) {
  199 + // 什么都不干,这么干是为了避开原始数据的问题
192 200 }
193   - } catch (Exception e) {
194   - // 什么都不干,这么干是为了避开原始数据的问题
  201 + childbirthManagerQueryModel.setPregnancyOut(pregnancyOut.length() == 0 ? "" : pregnancyOut.substring(0, pregnancyOut.length() - 1));
  202 + childbirthManagerQueryModel.setSex(sex.length() == 0 ? "" : sex.substring(0, sex.length() - 1));
  203 + childbirthManagerQueryModel.setBabyWeight(babyWeight.length() == 0 ? "" : babyWeight.substring(0, babyWeight.length() - 1));
  204 + childbirthManagerQueryModel.setBabyHeight(babyHeight.length() == 0 ? "" : babyHeight.substring(0, babyHeight.length() - 1));
  205 + childbirthManagerQueryModel.setApgarScorePf1(apgarScorePf1.length() == 0 ? "" : apgarScorePf1.substring(0, apgarScorePf1.length() - 1));
  206 + childbirthManagerQueryModel.setApgarScorePf5(apgarScorePf5.length() == 0 ? "" : apgarScorePf5.substring(0, apgarScorePf5.length() - 1));
  207 + childbirthManagerQueryModel.setApgarScorePf10(apgarScorePf10.length() == 0 ? "" : apgarScorePf10.substring(0, apgarScorePf10.length() - 1));
  208 + childbirthManagerQueryModel.setAsphyxiaM(asphyxiaM.length() == 0 ? "" : asphyxiaM.substring(0, asphyxiaM.length() - 1));
  209 + childbirthManagerQueryModel.setBabyHealthy(babyHealthy.length() == 0 ? "" : babyHealthy.substring(0, babyHealthy.length() - 1));
  210 + childbirthManagerQueryModel.setMalformation(malformation.length() == 0 ? "" : malformation.substring(0, malformation.length() - 1));
195 211 }
196   - childbirthManagerQueryModel.setPregnancyOut(pregnancyOut.length() == 0 ? "" : pregnancyOut.substring(0, pregnancyOut.length() - 1));
197   - childbirthManagerQueryModel.setSex(sex.length() == 0 ? "" : sex.substring(0, sex.length() - 1));
198   - childbirthManagerQueryModel.setBabyWeight(babyWeight.length() == 0 ? "" : babyWeight.substring(0, babyWeight.length() - 1));
199   - childbirthManagerQueryModel.setBabyHeight(babyHeight.length() == 0 ? "" : babyHeight.substring(0, babyHeight.length() - 1));
200   - childbirthManagerQueryModel.setApgarScorePf1(apgarScorePf1.length() == 0 ? "" : apgarScorePf1.substring(0, apgarScorePf1.length() - 1));
201   - childbirthManagerQueryModel.setApgarScorePf5(apgarScorePf5.length() == 0 ? "" : apgarScorePf5.substring(0, apgarScorePf5.length() - 1));
202   - childbirthManagerQueryModel.setApgarScorePf10(apgarScorePf10.length() == 0 ? "" : apgarScorePf10.substring(0, apgarScorePf10.length() - 1));
203   - childbirthManagerQueryModel.setAsphyxiaM(asphyxiaM.length() == 0 ? "" : asphyxiaM.substring(0, asphyxiaM.length() - 1));
204   - childbirthManagerQueryModel.setBabyHealthy(babyHealthy.length() == 0 ? "" : babyHealthy.substring(0, babyHealthy.length() - 1));
205   - childbirthManagerQueryModel.setMalformation(malformation.length() == 0 ? "" : malformation.substring(0, malformation.length() - 1));
206 212 }
207   - }
208 213  
209   - if (maternalDeliverModel != null) {
210   - // 会阴情况
211   - if (initQuery.contains("perinealCondition")) {
212   - if (org.apache.commons.lang.StringUtils.isNotEmpty(maternalDeliverModel.getPerinealCondition())) {
213   - if ("split".equals(maternalDeliverModel.getPerinealCondition())) {
214   - childbirthManagerQueryModel.setPerinealCondition("切开");
215   - } else if ("full".equals(maternalDeliverModel.getPerinealCondition())) {
216   - childbirthManagerQueryModel.setPerinealCondition("完整");
217   - } else {
218   - childbirthManagerQueryModel.setPerinealCondition("-");
  214 + if (maternalDeliverModel != null) {
  215 + // 会阴情况
  216 + if (initQuery.contains("perinealCondition")) {
  217 + if (org.apache.commons.lang.StringUtils.isNotEmpty(maternalDeliverModel.getPerinealCondition())) {
  218 + if ("split".equals(maternalDeliverModel.getPerinealCondition())) {
  219 + childbirthManagerQueryModel.setPerinealCondition("切开");
  220 + } else if ("full".equals(maternalDeliverModel.getPerinealCondition())) {
  221 + childbirthManagerQueryModel.setPerinealCondition("完整");
  222 + } else {
  223 + childbirthManagerQueryModel.setPerinealCondition("-");
  224 + }
219 225 }
220 226 }
221   - }
222 227  
223   - // 失血原因
224   - if (initQuery.contains("loseBloodCause")) {
225   - String loseBloodCauseJson = maternalDeliverModel.getLoseBloodCause();
226   - Map<String, String> loseBloodCauseMap = JsonUtil.getMap(loseBloodCauseJson);
227   - if (MapUtils.isNotEmpty(loseBloodCauseMap) && org.apache.commons.lang.StringUtils.isNotEmpty(loseBloodCauseMap.get("select"))) {
228   - for (SXCauseEnums sxCauseEnums : SXCauseEnums.values()) {
229   - if (sxCauseEnums.getId().equals(loseBloodCauseMap.get("select"))) {
230   - childbirthManagerQueryModel.setLoseBloodCause(sxCauseEnums.getName());
231   - break;
  228 + // 失血原因
  229 + if (initQuery.contains("loseBloodCause")) {
  230 + String loseBloodCauseJson = maternalDeliverModel.getLoseBloodCause();
  231 + Map<String, String> loseBloodCauseMap = JsonUtil.getMap(loseBloodCauseJson);
  232 + if (MapUtils.isNotEmpty(loseBloodCauseMap) && org.apache.commons.lang.StringUtils.isNotEmpty(loseBloodCauseMap.get("select"))) {
  233 + for (SXCauseEnums sxCauseEnums : SXCauseEnums.values()) {
  234 + if (sxCauseEnums.getId().equals(loseBloodCauseMap.get("select"))) {
  235 + childbirthManagerQueryModel.setLoseBloodCause(sxCauseEnums.getName());
  236 + break;
  237 + }
232 238 }
  239 + if (SXCauseEnums.O5.getName().equals(childbirthManagerQueryModel.getLoseBloodCause()) && org.apache.commons.lang.StringUtils.isNotEmpty(loseBloodCauseMap.get("other"))) {
  240 + childbirthManagerQueryModel.setLoseBloodCause(loseBloodCauseMap.get("other"));
  241 + }
  242 + } else {
  243 + childbirthManagerQueryModel.setLoseBloodCause("");
233 244 }
234   - if (SXCauseEnums.O5.getName().equals(childbirthManagerQueryModel.getLoseBloodCause()) && org.apache.commons.lang.StringUtils.isNotEmpty(loseBloodCauseMap.get("other"))) {
235   - childbirthManagerQueryModel.setLoseBloodCause(loseBloodCauseMap.get("other"));
236   - }
237   - } else {
238   - childbirthManagerQueryModel.setLoseBloodCause("");
239 245 }
240   - }
241 246  
242   - // 查询分娩方式
243   - childbirthManagerQueryModel.setMaternalDeliverId(maternalDeliverModel.getId());
244   - if (initQuery.contains("deliveryMode")) {
245   - String deliveryModeJson = maternalDeliverModel.getDeliveryMode();
246   - Map<String, String> deliveryModeMap = JsonUtil.getMap(deliveryModeJson);
247   - if (MapUtils.isNotEmpty(deliveryModeMap) && org.apache.commons.lang.StringUtils.isNotEmpty(deliveryModeMap.get("fmfs"))) {
248   - for (FmTypeEnums fmTypeEnums : FmTypeEnums.values()) {
249   - if (fmTypeEnums.getId().equals(deliveryModeMap.get("fmfs"))) {
250   - childbirthManagerQueryModel.setDeliveryMode(fmTypeEnums.getName());
251   - break;
  247 + // 查询分娩方式
  248 + childbirthManagerQueryModel.setMaternalDeliverId(maternalDeliverModel.getId());
  249 + if (initQuery.contains("deliveryMode")) {
  250 + String deliveryModeJson = maternalDeliverModel.getDeliveryMode();
  251 + Map<String, String> deliveryModeMap = JsonUtil.getMap(deliveryModeJson);
  252 + if (MapUtils.isNotEmpty(deliveryModeMap) && org.apache.commons.lang.StringUtils.isNotEmpty(deliveryModeMap.get("fmfs"))) {
  253 + for (FmTypeEnums fmTypeEnums : FmTypeEnums.values()) {
  254 + if (fmTypeEnums.getId().equals(deliveryModeMap.get("fmfs"))) {
  255 + childbirthManagerQueryModel.setDeliveryMode(fmTypeEnums.getName());
  256 + break;
  257 + }
252 258 }
  259 + } else {
  260 + childbirthManagerQueryModel.setDeliveryMode("");
253 261 }
254   - } else {
255   - childbirthManagerQueryModel.setDeliveryMode("");
256 262 }
257   - }
258 263  
259   - // 产妇情况
260   - if (initQuery.contains("maternalInfo")) {
261   - if (org.apache.commons.lang.StringUtils.isNotBlank(maternalDeliverModel.getMaternalInfo())) {
262   - for (CfEnums cfEnums : CfEnums.values()) {
263   - if (cfEnums.getId().equals(maternalDeliverModel.getMaternalInfo())) {
264   - childbirthManagerQueryModel.setMaternalInfo(cfEnums.getName());
265   - break;
  264 + // 产妇情况
  265 + if (initQuery.contains("maternalInfo")) {
  266 + if (org.apache.commons.lang.StringUtils.isNotBlank(maternalDeliverModel.getMaternalInfo())) {
  267 + for (CfEnums cfEnums : CfEnums.values()) {
  268 + if (cfEnums.getId().equals(maternalDeliverModel.getMaternalInfo())) {
  269 + childbirthManagerQueryModel.setMaternalInfo(cfEnums.getName());
  270 + break;
  271 + }
266 272 }
267 273 }
268 274 }
269   - }
270 275  
271   - // 查询接生医生
272   - try {
273   - if (initQuery.contains("deliverDoctor")) {
274   - childbirthManagerQueryModel.setDeliverDoctor(usersService.getUsers(Integer.valueOf(maternalDeliverModel.getDeliverDoctor())).getName());
  276 + // 查询接生医生
  277 + try {
  278 + if (initQuery.contains("deliverDoctor")) {
  279 + childbirthManagerQueryModel.setDeliverDoctor(usersService.getUsers(Integer.valueOf(maternalDeliverModel.getDeliverDoctor())).getName());
  280 + }
  281 + } catch (Exception e) {
  282 + // 什么都不干,这么干是为了避开原始数据的问题
275 283 }
276   - } catch (Exception e) {
277   - // 什么都不干,这么干是为了避开原始数据的问题
278   - }
279 284  
280   - // 查分娩医院
281   - try {
282   - if (initQuery.contains("fmHospital")) {
283   - System.out.println("分娩医院:" + maternalDeliverModel.getFmHospital());
284   - if (org.apache.commons.lang.StringUtils.isNumeric(maternalDeliverModel.getFmHospital())) {
285   - childbirthManagerQueryModel.setFmHospital(organizationService.getOrganization(Integer.valueOf(maternalDeliverModel.getFmHospital())).getName());
286   - } else {
287   - childbirthManagerQueryModel.setFmHospital(maternalDeliverModel.getFmHospital());
  285 + // 查分娩医院
  286 + try {
  287 + if (initQuery.contains("fmHospital")) {
  288 + System.out.println("分娩医院:" + maternalDeliverModel.getFmHospital());
  289 + if (org.apache.commons.lang.StringUtils.isNumeric(maternalDeliverModel.getFmHospital())) {
  290 + childbirthManagerQueryModel.setFmHospital(organizationService.getOrganization(Integer.valueOf(maternalDeliverModel.getFmHospital())).getName());
  291 + } else {
  292 + childbirthManagerQueryModel.setFmHospital(maternalDeliverModel.getFmHospital());
  293 + }
288 294 }
  295 + } catch (Exception e) {
  296 + // 什么都不干,这么干是为了避开原始数据的问题
289 297 }
290   - } catch (Exception e) {
291   - // 什么都不干,这么干是为了避开原始数据的问题
292   - }
293 298  
294   - // 胎方位,胎心率,胎先露
295   - if (initQuery.contains("fetalPosition") || initQuery.contains("heartRate") || initQuery.contains("fetalPresentation")) {
296   - // 这个泛型不会出错,传入的就是这个
297   - @SuppressWarnings("unchecked")
298   - List<MatDeliverAddRequest.Placenta> placentaList = maternalDeliverModel.getPlacentas();
299   - if (CollectionUtils.isNotEmpty(placentaList)) {
300   - String fetalPosition = "";
301   - String heartRate = "";
302   - String fetalPresentation = "";
303   - for (Object obj : placentaList) {
304   - if ("com.lyms.platform.operate.web.request.MatDeliverAddRequest$Placenta".equals(obj.getClass().getName())) {
305   - MatDeliverAddRequest.Placenta placenta = (MatDeliverAddRequest.Placenta) obj;
306   - if (initQuery.contains("fetalPosition")) {
307   - for (FetalPositionEnums fetalPositionEnums : FetalPositionEnums.values()) {
308   - if (fetalPositionEnums.getId().equals(placenta.getFetalPosition())) {
309   - fetalPosition += fetalPositionEnums.getName() + ",";
310   - break;
311   - }
312   - }
313   - }
314   - heartRate += placenta.getHeartRate() == null ? "" : placenta.getHeartRate().toString() + ",";
315   - fetalPresentation += placenta.getFetalPresentation() == null ? "" : placenta.getFetalPresentation() + ",";
316   - }
317   - if ("java.util.LinkedHashMap".equals(obj.getClass().getName())) {
318   - Map<String, String> placenta = JsonUtil.getMap(obj.toString());
319   - if (initQuery.contains("fetalPosition")) {
320   - if (MapUtils.isNotEmpty(placenta)) {
  299 + // 胎方位,胎心率,胎先露
  300 + if (initQuery.contains("fetalPosition") || initQuery.contains("heartRate") || initQuery.contains("fetalPresentation")) {
  301 + // 这个泛型不会出错,传入的就是这个
  302 + @SuppressWarnings("unchecked")
  303 + List<MatDeliverAddRequest.Placenta> placentaList = maternalDeliverModel.getPlacentas();
  304 + if (CollectionUtils.isNotEmpty(placentaList)) {
  305 + String fetalPosition = "";
  306 + String heartRate = "";
  307 + String fetalPresentation = "";
  308 + for (Object obj : placentaList) {
  309 + if ("com.lyms.platform.operate.web.request.MatDeliverAddRequest$Placenta".equals(obj.getClass().getName())) {
  310 + MatDeliverAddRequest.Placenta placenta = (MatDeliverAddRequest.Placenta) obj;
  311 + if (initQuery.contains("fetalPosition")) {
321 312 for (FetalPositionEnums fetalPositionEnums : FetalPositionEnums.values()) {
322   - if (fetalPositionEnums.getId().equals(placenta.get("fetalPosition"))) {
  313 + if (fetalPositionEnums.getId().equals(placenta.getFetalPosition())) {
323 314 fetalPosition += fetalPositionEnums.getName() + ",";
324 315 break;
325 316 }
326 317 }
327   - heartRate += placenta.get("heartRate") == null ? "" : placenta.get("heartRate") + ",";
328   - for (FetalEnums fetalEnums : FetalEnums.values()) {
329   - if (fetalEnums.getId().equals(placenta.get("fetalPresentation"))) {
330   - fetalPresentation += fetalEnums.getName() + ",";
331   - break;
  318 + }
  319 + heartRate += placenta.getHeartRate() == null ? "" : placenta.getHeartRate().toString() + ",";
  320 + fetalPresentation += placenta.getFetalPresentation() == null ? "" : placenta.getFetalPresentation() + ",";
  321 + }
  322 + if ("java.util.LinkedHashMap".equals(obj.getClass().getName())) {
  323 + Map<String, String> placenta = JsonUtil.getMap(obj.toString());
  324 + if (initQuery.contains("fetalPosition")) {
  325 + if (MapUtils.isNotEmpty(placenta)) {
  326 + for (FetalPositionEnums fetalPositionEnums : FetalPositionEnums.values()) {
  327 + if (fetalPositionEnums.getId().equals(placenta.get("fetalPosition"))) {
  328 + fetalPosition += fetalPositionEnums.getName() + ",";
  329 + break;
  330 + }
332 331 }
  332 + heartRate += placenta.get("heartRate") == null ? "" : placenta.get("heartRate") + ",";
  333 + for (FetalEnums fetalEnums : FetalEnums.values()) {
  334 + if (fetalEnums.getId().equals(placenta.get("fetalPresentation"))) {
  335 + fetalPresentation += fetalEnums.getName() + ",";
  336 + break;
  337 + }
  338 + }
333 339 }
334 340 }
335 341 }
336 342 }
  343 + childbirthManagerQueryModel.setFetalPosition(fetalPosition.length() == 0 ? "" : fetalPosition.substring(0, fetalPosition.length() - 1));
  344 + childbirthManagerQueryModel.setHeartRate(heartRate.length() == 0 ? "" : heartRate.substring(0, heartRate.length() - 1));
  345 + childbirthManagerQueryModel.setFetalPresentation(fetalPresentation.length() == 0 ? "" : fetalPresentation.substring(0, fetalPresentation.length() - 1));
337 346 }
338   - childbirthManagerQueryModel.setFetalPosition(fetalPosition.length() == 0 ? "" : fetalPosition.substring(0, fetalPosition.length() - 1));
339   - childbirthManagerQueryModel.setHeartRate(heartRate.length() == 0 ? "" : heartRate.substring(0, heartRate.length() - 1));
340   - childbirthManagerQueryModel.setFetalPresentation(fetalPresentation.length() == 0 ? "" : fetalPresentation.substring(0, fetalPresentation.length() - 1));
341 347 }
342   - }
343 348  
344   - // 第一产程,第二产程,第三产程
345   - Map<String, Map<String, String>> prodprocessMap = JsonUtil.getDoubleMap(maternalDeliverModel.getProdprocess());
346   - if (MapUtils.isNotEmpty(prodprocessMap)) {
347   - Map<String, String> prodprocessOne = prodprocessMap.get("one");
348   - if (MapUtils.isNotEmpty(prodprocessOne)) {
349   - childbirthManagerQueryModel.setProdprocessOne(prodprocessOne.get("h") + "时," + prodprocessOne.get("m") + "分");
350   - } else {
351   - childbirthManagerQueryModel.setProdprocessOne("");
  349 + // 第一产程,第二产程,第三产程
  350 + Map<String, Map<String, String>> prodprocessMap = JsonUtil.getDoubleMap(maternalDeliverModel.getProdprocess());
  351 + if (MapUtils.isNotEmpty(prodprocessMap)) {
  352 + Map<String, String> prodprocessOne = prodprocessMap.get("one");
  353 + if (MapUtils.isNotEmpty(prodprocessOne)) {
  354 + childbirthManagerQueryModel.setProdprocessOne(prodprocessOne.get("h") + "时," + prodprocessOne.get("m") + "分");
  355 + } else {
  356 + childbirthManagerQueryModel.setProdprocessOne("");
  357 + }
  358 + Map<String, String> prodprocessTwo = prodprocessMap.get("two");
  359 + if (MapUtils.isNotEmpty(prodprocessTwo)) {
  360 + childbirthManagerQueryModel.setProdprocessTwo(prodprocessTwo.get("h") + "时," + prodprocessTwo.get("m") + "分");
  361 + } else {
  362 + childbirthManagerQueryModel.setProdprocessTwo("");
  363 + }
  364 + Map<String, String> prodprocessThree = prodprocessMap.get("three");
  365 + if (MapUtils.isNotEmpty(prodprocessThree)) {
  366 + childbirthManagerQueryModel.setProdprocessThree(prodprocessThree.get("h") + "时," + prodprocessThree.get("m") + "分");
  367 + } else {
  368 + childbirthManagerQueryModel.setProdprocessThree("");
  369 + }
352 370 }
353   - Map<String, String> prodprocessTwo = prodprocessMap.get("two");
354   - if (MapUtils.isNotEmpty(prodprocessTwo)) {
355   - childbirthManagerQueryModel.setProdprocessTwo(prodprocessTwo.get("h") + "时," + prodprocessTwo.get("m") + "分");
  371 +
  372 + // 总产程
  373 + Map<String, String> totalprocessMap = JsonUtil.getMap(maternalDeliverModel.getTotalprocess());
  374 + if (MapUtils.isNotEmpty(totalprocessMap)) {
  375 + childbirthManagerQueryModel.setTotalprocess(totalprocessMap.get("h") + "时" + totalprocessMap.get("m") + "分");
356 376 } else {
357   - childbirthManagerQueryModel.setProdprocessTwo("");
  377 + childbirthManagerQueryModel.setTotalprocess("");
358 378 }
359   - Map<String, String> prodprocessThree = prodprocessMap.get("three");
360   - if (MapUtils.isNotEmpty(prodprocessThree)) {
361   - childbirthManagerQueryModel.setProdprocessThree(prodprocessThree.get("h") + "时," + prodprocessThree.get("m") + "分");
362   - } else {
363   - childbirthManagerQueryModel.setProdprocessThree("");
364   - }
365   - }
366   -
367   - // 总产程
368   - Map<String, String> totalprocessMap = JsonUtil.getMap(maternalDeliverModel.getTotalprocess());
369   - if (MapUtils.isNotEmpty(totalprocessMap)) {
370   - childbirthManagerQueryModel.setTotalprocess(totalprocessMap.get("h") + "时" + totalprocessMap.get("m") + "分");
371   - } else {
372   - childbirthManagerQueryModel.setTotalprocess("");
373   - }
374   - // 死亡原因
375   - if (initQuery.contains("deathCause")) {
376   - for (DeathCauseEnums deathCauseEnums : DeathCauseEnums.values()) {
377   - if (deathCauseEnums.getId().equals(maternalDeliverModel.getDeathCause())) {
378   - childbirthManagerQueryModel.setDeathCause(deathCauseEnums.getName());
379   - break;
  379 + // 死亡原因
  380 + if (initQuery.contains("deathCause")) {
  381 + for (DeathCauseEnums deathCauseEnums : DeathCauseEnums.values()) {
  382 + if (deathCauseEnums.getId().equals(maternalDeliverModel.getDeathCause())) {
  383 + childbirthManagerQueryModel.setDeathCause(deathCauseEnums.getName());
  384 + break;
  385 + }
380 386 }
381 387 }
382   - }
383 388  
384   - // 收缩压,舒张压
385   - Map<String, String> chBpMap = JsonUtil.getMap(maternalDeliverModel.getChBp());
386   - if (MapUtils.isNotEmpty(chBpMap)) {
387   - childbirthManagerQueryModel.setChBpSsy1(chBpMap.get("ssy"));
388   - childbirthManagerQueryModel.setChBpSzy1(chBpMap.get("szy"));
  389 + // 收缩压,舒张压
  390 + Map<String, String> chBpMap = JsonUtil.getMap(maternalDeliverModel.getChBp());
  391 + if (MapUtils.isNotEmpty(chBpMap)) {
  392 + childbirthManagerQueryModel.setChBpSsy1(chBpMap.get("ssy"));
  393 + childbirthManagerQueryModel.setChBpSzy1(chBpMap.get("szy"));
389 394  
390   - }
  395 + }
391 396  
392   - // 产后1/2/24小时失血量
393   - childbirthManagerQueryModel.setOhloseBloodL(maternalDeliverModel.getoHloseBloodL());
394   - childbirthManagerQueryModel.setThloseBloodL(maternalDeliverModel.gettHloseBloodL());
395   - childbirthManagerQueryModel.setRhloseBloodL(maternalDeliverModel.getrHloseBloodL());
  397 + // 产后1/2/24小时失血量
  398 + childbirthManagerQueryModel.setOhloseBloodL(maternalDeliverModel.getoHloseBloodL());
  399 + childbirthManagerQueryModel.setThloseBloodL(maternalDeliverModel.gettHloseBloodL());
  400 + childbirthManagerQueryModel.setRhloseBloodL(maternalDeliverModel.getrHloseBloodL());
396 401  
397   - // 胎盘娩出方式,胎盘大小,胎盘重量,脐带长度,脐带是否异常,脐带异常类型
398   - if (initQuery.contains("tpmcType") || initQuery.contains("tpSize") || initQuery.contains("tpWeight") || initQuery.contains("umbilicalCordLength") || initQuery.contains("umbilicalCordEx") || initQuery.contains("umbilicalCordExType")) {
399   - List<MaternalDeliverModel.ExtPlacenta> extPlacentaList = maternalDeliverModel.getExtPlacentas();
400   - if (CollectionUtils.isNotEmpty(extPlacentaList)) {
401   - String tpmcType = "";
402   - String tpSize = "";
403   - String tpWeight = "";
404   - String umbilicalCordLength = "";
405   - String umbilicalCordEx = "";
406   - String umbilicalCordExType = "";
407   - try {
408   - for (MaternalDeliverModel.ExtPlacenta extPlacenta : extPlacentaList) {
409   - if (initQuery.contains("tpmcType")) {
410   - for (TpmcTypeEnums tpmcTypeEnums : TpmcTypeEnums.values()) {
411   - if (tpmcTypeEnums.getId().equals(extPlacenta.getTpmcType())) {
412   - tpmcType += tpmcTypeEnums.getName() + ",";
413   - break;
  402 + // 胎盘娩出方式,胎盘大小,胎盘重量,脐带长度,脐带是否异常,脐带异常类型
  403 + if (initQuery.contains("tpmcType") || initQuery.contains("tpSize") || initQuery.contains("tpWeight") || initQuery.contains("umbilicalCordLength") || initQuery.contains("umbilicalCordEx") || initQuery.contains("umbilicalCordExType")) {
  404 + List<MaternalDeliverModel.ExtPlacenta> extPlacentaList = maternalDeliverModel.getExtPlacentas();
  405 + if (CollectionUtils.isNotEmpty(extPlacentaList)) {
  406 + String tpmcType = "";
  407 + String tpSize = "";
  408 + String tpWeight = "";
  409 + String umbilicalCordLength = "";
  410 + String umbilicalCordEx = "";
  411 + String umbilicalCordExType = "";
  412 + try {
  413 + for (MaternalDeliverModel.ExtPlacenta extPlacenta : extPlacentaList) {
  414 + if (initQuery.contains("tpmcType")) {
  415 + for (TpmcTypeEnums tpmcTypeEnums : TpmcTypeEnums.values()) {
  416 + if (tpmcTypeEnums.getId().equals(extPlacenta.getTpmcType())) {
  417 + tpmcType += tpmcTypeEnums.getName() + ",";
  418 + break;
  419 + }
414 420 }
415 421 }
416   - }
417   - if (initQuery.contains("umbilicalCordExType")) {
418   - String umbilicalCordExTypeTemp = "";
419   - for (QiDaiEnums qiDaiEnums : QiDaiEnums.values()) {
420   - if (qiDaiEnums.getId().equals(extPlacenta.getUmbilicalCordExType())) {
421   - umbilicalCordExTypeTemp = qiDaiEnums.getName() + ",";
422   - break;
  422 + if (initQuery.contains("umbilicalCordExType")) {
  423 + String umbilicalCordExTypeTemp = "";
  424 + for (QiDaiEnums qiDaiEnums : QiDaiEnums.values()) {
  425 + if (qiDaiEnums.getId().equals(extPlacenta.getUmbilicalCordExType())) {
  426 + umbilicalCordExTypeTemp = qiDaiEnums.getName() + ",";
  427 + break;
  428 + }
423 429 }
  430 + if (org.apache.commons.lang.StringUtils.isEmpty(umbilicalCordExTypeTemp)) {
  431 + umbilicalCordExTypeTemp = "-,";
  432 + }
  433 + umbilicalCordExType += umbilicalCordExTypeTemp;
424 434 }
425   - if (org.apache.commons.lang.StringUtils.isEmpty(umbilicalCordExTypeTemp)) {
426   - umbilicalCordExTypeTemp = "-,";
  435 + if (initQuery.contains("umbilicalCordEx")) {
  436 + if ("yes".equals(extPlacenta.getUmbilicalCordEx())) {
  437 + umbilicalCordEx += "是" + ",";
  438 + } else if ("no".equals(extPlacenta.getUmbilicalCordEx())) {
  439 + umbilicalCordEx += "否" + ",";
  440 + } else {
  441 + umbilicalCordEx += "-" + ",";
  442 + }
427 443 }
428   - umbilicalCordExType += umbilicalCordExTypeTemp;
429   - }
430   - if (initQuery.contains("umbilicalCordEx")) {
431   - if ("yes".equals(extPlacenta.getUmbilicalCordEx())) {
432   - umbilicalCordEx += "是" + ",";
433   - } else if ("no".equals(extPlacenta.getUmbilicalCordEx())) {
434   - umbilicalCordEx += "否" + ",";
435   - } else {
436   - umbilicalCordEx += "-" + ",";
  444 + if (initQuery.contains("tpSize")) {
  445 + if (MapUtils.isNotEmpty(extPlacenta.getTpSize())) {
  446 + tpSize += "长:" + extPlacenta.getTpSize().get("c") + "宽:" + extPlacenta.getTpSize().get("k") + "高:" + extPlacenta.getTpSize().get("g") + ",";
  447 + }
437 448 }
  449 + tpWeight += extPlacenta.getTpWeight() == null ? "" : extPlacenta.getTpWeight() + ",";
  450 + umbilicalCordLength += extPlacenta.getUmbilicalCordLength() == null ? "" : extPlacenta.getUmbilicalCordLength() + ",";
438 451 }
439   - if (initQuery.contains("tpSize")) {
440   - if (MapUtils.isNotEmpty(extPlacenta.getTpSize())) {
441   - tpSize += "长:" + extPlacenta.getTpSize().get("c") + "宽:" + extPlacenta.getTpSize().get("k") + "高:" + extPlacenta.getTpSize().get("g") + ",";
442   - }
443   - }
444   - tpWeight += extPlacenta.getTpWeight() == null ? "" : extPlacenta.getTpWeight() + ",";
445   - umbilicalCordLength += extPlacenta.getUmbilicalCordLength() == null ? "" : extPlacenta.getUmbilicalCordLength() + ",";
  452 + } catch (Exception e) {
  453 + // 什么都不干,这么干是为了避开原始数据的问题
446 454 }
447   - } catch (Exception e) {
448   - // 什么都不干,这么干是为了避开原始数据的问题
  455 + childbirthManagerQueryModel.setTpmcType(tpmcType.length() == 0 ? "" : tpmcType.substring(0, tpmcType.length() - 1));
  456 + childbirthManagerQueryModel.setTpSize(tpSize.length() == 0 ? "" : tpSize.substring(0, tpSize.length() - 1));
  457 + childbirthManagerQueryModel.setTpWeight(tpWeight.length() == 0 ? "" : tpWeight.substring(0, tpWeight.length() - 1));
  458 + childbirthManagerQueryModel.setUmbilicalCordLength(umbilicalCordLength.length() == 0 ? "" : umbilicalCordLength.substring(0, umbilicalCordLength.length() - 1));
  459 + childbirthManagerQueryModel.setUmbilicalCordEx(umbilicalCordEx.length() == 0 ? "" : umbilicalCordEx.substring(0, umbilicalCordEx.length() - 1));
  460 + childbirthManagerQueryModel.setUmbilicalCordExType(umbilicalCordExType.length() == 0 ? "" : umbilicalCordExType.substring(0, umbilicalCordExType.length() - 1));
449 461 }
450   - childbirthManagerQueryModel.setTpmcType(tpmcType.length() == 0 ? "" : tpmcType.substring(0, tpmcType.length() - 1));
451   - childbirthManagerQueryModel.setTpSize(tpSize.length() == 0 ? "" : tpSize.substring(0, tpSize.length() - 1));
452   - childbirthManagerQueryModel.setTpWeight(tpWeight.length() == 0 ? "" : tpWeight.substring(0, tpWeight.length() - 1));
453   - childbirthManagerQueryModel.setUmbilicalCordLength(umbilicalCordLength.length() == 0 ? "" : umbilicalCordLength.substring(0, umbilicalCordLength.length() - 1));
454   - childbirthManagerQueryModel.setUmbilicalCordEx(umbilicalCordEx.length() == 0 ? "" : umbilicalCordEx.substring(0, umbilicalCordEx.length() - 1));
455   - childbirthManagerQueryModel.setUmbilicalCordExType(umbilicalCordExType.length() == 0 ? "" : umbilicalCordExType.substring(0, umbilicalCordExType.length() - 1));
456 462 }
457 463 }
458   - }
459 464  
460   - childbirthManagerQueryModelList.add(childbirthManagerQueryModel);
  465 + childbirthManagerQueryModelList.add(childbirthManagerQueryModel);
461 466  
  467 + }
  468 + }catch (Exception e)
  469 + {
  470 + e.printStackTrace();
462 471 }
463 472 return childbirthManagerQueryModelList;
464 473 }