Commit ef751dcc9b2a64cd652149d0eabec349a702ffd8

Authored by jiangjiazhi
Exists in master and in 1 other branch dev

Merge remote-tracking branch 'origin/master'

Showing 10 changed files

platform-dal/src/main/java/com/lyms/platform/pojo/MaternalDeliverModel.java View file @ ef751dc
... ... @@ -199,6 +199,13 @@
199 199  
200 200 //分娩时间
201 201 private String dueTime;
  202 +
  203 + //儿童诊断
  204 + private String babyDiagnosis;
  205 +
  206 + //病历号(住院号)
  207 + private String blNo;
  208 +
202 209 public Baby(){
203 210  
204 211 }
... ... @@ -228,6 +235,22 @@
228 235 setContactStartM(babyModel.getContactStartM());
229 236 setEarlySuck(babyModel.getEarlySuck());
230 237 // setDueTime(babyModel.get);
  238 + }
  239 +
  240 + public String getBabyDiagnosis() {
  241 + return babyDiagnosis;
  242 + }
  243 +
  244 + public void setBabyDiagnosis(String babyDiagnosis) {
  245 + this.babyDiagnosis = babyDiagnosis;
  246 + }
  247 +
  248 + public String getBlNo() {
  249 + return blNo;
  250 + }
  251 +
  252 + public void setBlNo(String blNo) {
  253 + this.blNo = blNo;
231 254 }
232 255  
233 256 public String getApgarScore() {
platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java View file @ ef751dc
... ... @@ -211,7 +211,16 @@
211 211 private String queryNo;
212 212  
213 213 private String phoneOrCert;
  214 + private String[] pc;
214 215  
  216 + public String[] getPc() {
  217 + return pc;
  218 + }
  219 +
  220 + public void setPc(String[] pc) {
  221 + this.pc = pc;
  222 + }
  223 +
215 224 public String getPhoneOrCert() {
216 225 return phoneOrCert;
217 226 }
... ... @@ -1011,6 +1020,18 @@
1011 1020 MongoCondition c = MongoCondition.newInstance();
1012 1021 MongoCondition con1 = MongoCondition.newInstance("phone", phoneOrCert, MongoOper.IS);
1013 1022 MongoCondition con2 = MongoCondition.newInstance("cardNo", phoneOrCert, MongoOper.IS);
  1023 + if(c1!=null) {
  1024 + c1 = c1.andOperator(c.orCondition(new MongoCondition[]{con1, con2}).getCriteria());
  1025 + }else {
  1026 + c1 = c.orCondition(new MongoCondition[]{con1, con2}).getCriteria();
  1027 + }
  1028 + }
  1029 +
  1030 +
  1031 + if (null != pc) {
  1032 + MongoCondition c = MongoCondition.newInstance();
  1033 + MongoCondition con1 = MongoCondition.newInstance("phone", pc[0], MongoOper.IS);
  1034 + MongoCondition con2 = MongoCondition.newInstance("cardNo", pc[1], MongoOper.IS);
1014 1035 if(c1!=null) {
1015 1036 c1 = c1.andOperator(c.orCondition(new MongoCondition[]{con1, con2}).getCriteria());
1016 1037 }else {
platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/FmPatInfo.java View file @ ef751dc
... ... @@ -12,6 +12,15 @@
12 12 private String sex;
13 13 private String birth;
14 14 private String phone;
  15 + private String blh;
  16 +
  17 + public String getBlh() {
  18 + return blh;
  19 + }
  20 +
  21 + public void setBlh(String blh) {
  22 + this.blh = blh;
  23 + }
15 24  
16 25 public String getSyxh() {
17 26 return syxh;
platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdfyFmService.java View file @ ef751dc
... ... @@ -24,6 +24,7 @@
24 24  
25 25 import java.sql.Connection;
26 26 import java.sql.SQLException;
  27 +import java.text.DecimalFormat;
27 28 import java.text.ParseException;
28 29 import java.text.SimpleDateFormat;
29 30 import java.util.*;
... ... @@ -46,6 +47,9 @@
46 47 @Autowired
47 48 private BabyBookbuildingFacade babyBookbuildingFacade;
48 49  
  50 + @Autowired
  51 + private QhdfyHisService qhdfyHisService;
  52 +
49 53 public void fmTimerWork() {
50 54 SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
51 55 Date end = new Date();
... ... @@ -113,7 +117,7 @@
113 117 try {
114 118 String sql ="select "+cloumns+" from JHMK_FMJL where " +
115 119 " CONVERT(DATETIME,left(SSRQ,8)+' '+RIGHT(SSRQ,8),20) > CONVERT(DATETIME,'"+start+"', 120) and CONVERT(DATETIME,left(SSRQ,8)+' '+RIGHT(SSRQ,8),20) <= CONVERT(DATETIME,'"+end+"', 120)" +
116   - " and SYXH not in (select SYXH from JHMK_FMJL where JSZ is not null and SC is not null and TZ is not null and YFZ is not null and SH is not null" +
  120 + " and SYXH not in (select SYXH from JHMK_FMJL where JSZ is not null and SC is not null and TZ is not null and YFZ is not null and SH is not null and CCQK is not null and CCQK <> '' " +
117 121 " and (SFFZRSTDT = ' 是 ' or SFSTDT = ' 是 ')) ";
118 122  
119 123 if (StringUtils.isNotEmpty(syxh))
... ... @@ -126,6 +130,11 @@
126 130 if (CollectionUtils.isNotEmpty(list)) {
127 131 for (FmItem item : list) {
128 132 try {
  133 +
  134 + if (!("活产".equals(item.getCcqk()) || "死胎".equals(item.getCcqk())))
  135 + {
  136 + continue;
  137 + }
129 138 ExceptionUtils.catchException("item===" + item);
130 139 String dueDateStr = item.getSsrq();
131 140 if (!StringUtils.isNotEmpty(dueDateStr)) {
132 141  
133 142  
... ... @@ -133,14 +142,17 @@
133 142 }
134 143 Date dueDate = fmt.parse(dueDateStr);
135 144 FmPatInfo patInfo = getFmPatInfoById(item.getSyxh());
136   - if (patInfo != null && (StringUtils.isNotEmpty(patInfo.getPhone()) || StringUtils.isNotEmpty(patInfo.getCardNo())) ) {
  145 + if (patInfo != null && StringUtils.isNotEmpty(patInfo.getPhone())) {
137 146 PatientsQuery query = new PatientsQuery();
138 147 query.setYn(YnEnums.YES.getId());
139 148 query.setType(1); //孕妇
140 149 query.setDueStatus(0); //未终止妊娠
141   - query.setPhoneOrCert(StringUtils.isNotEmpty(patInfo.getPhone()) ? patInfo.getPhone() : patInfo.getCardNo());
  150 + ExceptionUtils.catchException("phone="+patInfo.getPhone()+" cardNo="+ patInfo.getCardNo());
  151 + String[] strs = new String[]{patInfo.getPhone(),patInfo.getCardNo()};
  152 + query.setPc(strs);
142 153 List<Patients> patientses = patientsService.queryPatient(query);
143 154 if (CollectionUtils.isNotEmpty(patientses)) {
  155 + ExceptionUtils.catchException("patientses"+patientses);
144 156 Patients patient = patientses.get(0);
145 157 UsersQuery usersQuery = new UsersQuery();
146 158 usersQuery.setName(item.getJsz());
147 159  
... ... @@ -161,8 +173,10 @@
161 173 deliverAddRequest.setDueDate(DateUtil.getyyyy_MM_dd(dueDate));
162 174 deliverAddRequest.setParentId(patient.getId());
163 175 deliverAddRequest.setPid(patient.getPid());
  176 + deliverAddRequest.setOperationCause("-");
  177 + String week = "";
164 178 if (StringUtils.isNotEmpty(item.getRc())) {
165   - String week = "";
  179 +
166 180 if (item.getRc().split("\\u002B").length > 1) {
167 181 week = item.getRc().split("\\u002B")[0] + "周";
168 182 week += item.getRc().split("\\u002B")[1] + "天";
169 183  
170 184  
... ... @@ -173,12 +187,12 @@
173 187 deliverAddRequest.setDueWeek(week);
174 188 }
175 189  
176   - deliverAddRequest.setTireNumber(1);//TODO 胎数
177   - deliverAddRequest.setPlacenta("1");//TODO 胎盘
  190 + deliverAddRequest.setTireNumber(1);// 胎数
  191 + deliverAddRequest.setPlacenta("1");// 胎盘
178 192  
179   - if ("完好".equals(item.getHyqk())) {
  193 + if ("完好".equals(item.getHyqk()) || "无".equals(item.getHyqk())) {
180 194 deliverAddRequest.setPerinealCondition("full");
181   - } else if ("会阴切开".equals(item.getHyqk())) {
  195 + } else if ("会阴切开".equals(item.getHyqk()) || "侧切".equals(item.getHyqk())) {
182 196 deliverAddRequest.setPerinealCondition("split");
183 197 }
184 198  
185 199  
186 200  
187 201  
188 202  
189 203  
190 204  
191 205  
192 206  
... ... @@ -194,36 +208,51 @@
194 208 deliverAddRequest.settHloseBloodL(Double.parseDouble(item.getChexxsxl()));
195 209 }
196 210  
  211 + Map deliveryMode = new HashMap(); //分娩方式
  212 +
  213 + String fmfs = "";
  214 + if (item.getFmfs() != null && "剖宫产".equals(item.getFmfs()))
  215 + {
  216 + fmfs = FmTypeEnums.O1.getId();
  217 + }
  218 + else
  219 + {
  220 + fmfs = FmTypeEnums.O.getId();
  221 + }
  222 + deliveryMode.put("fmfs",fmfs);
  223 + deliveryMode.put("scfs", "");
  224 + deliverAddRequest.setDeliveryMode(deliveryMode);
197 225 //胎盘信息
198 226 List<MaternalDeliverModel.ExtPlacenta> extPlacentas = new ArrayList<>();
199 227 MaternalDeliverModel.ExtPlacenta extPlacenta = new MaternalDeliverModel.ExtPlacenta();
200   - extPlacenta.setMcType(FmTypeEnums.getIdByName(item.getFmfs())); //分娩方式
201   - String tpmcType = "";
202   - if ("手术产".equals(item.getTpmcfs())) {
  228 + String tpmcType = ""; //胎盘娩出方式
  229 + if ("手术产".equals(item.getTpmcfs()) || "手取胎盘".equals(item.getTpmcfs())) {
203 230 tpmcType = TpmcTypeEnums.O2.getId();
204   - } else if ("自然产出".equals(item.getTpmcfs())) {
  231 + } else if ("自然产出".equals(item.getTpmcfs()) || "自然娩出".equals(item.getTpmcfs())) {
205 232 tpmcType = TpmcTypeEnums.O.getId();
206 233 }
207 234 extPlacenta.setTpmcType(tpmcType);
208 235 extPlacentas.add(extPlacenta);
  236 + deliverAddRequest.setExtPlacentas(extPlacentas);
209 237  
  238 +
210 239 //儿童
211   - List<MaternalDeliverModel.Baby> babies = new ArrayList<>();
212   - MaternalDeliverModel.Baby baby = new MaternalDeliverModel.Baby();
  240 + List<MatDeliverAddRequest.Baby> babies = new ArrayList<>();
  241 + MatDeliverAddRequest.Baby baby = new MatDeliverAddRequest.Baby();
213 242 Map<String, String> as = new HashMap<>();
214 243 as.put("pf1", item.getYfz());
215 244 as.put("pf5", item.getWfz());
216 245 as.put("pf10", item.getSfz());
217   - baby.setApgarScore(JsonUtil.obj2JsonString(as));
  246 + baby.setApgarScore(as);
218 247 baby.setBabyGender("男".equals(item.getYexb()) ? "1" : "0");
219 248 baby.setBabyHeight(item.getSc());//新生儿生长
220 249 baby.setBabyWeight(item.getTz());//新生儿重量
221 250 baby.setDeformity("无".equals(item.getJx()) ? 0 : 1); //畸形 0非畸形 1畸形
222 251 baby.setAsphyxiaM(item.getZx()); //窒息分钟
223 252 baby.setPregnancyOut(RenShenJieJuEnums.getIdByName(item.getCcqk())); // 妊娠结局
224   - baby.setBabyHealthy(item.getYeqk()); //新生儿疾病
225 253 baby.setDueTime(fmt1.format(dueDate));//分娩时间
226 254 babies.add(baby);
  255 + deliverAddRequest.setBabies(babies);
227 256 deliverAddRequest.setFmHospital("216"); //设置为秦皇岛分娩医院
228 257 ExceptionUtils.catchException("deliverAddRequest===" + deliverAddRequest);
229 258 matDeliverFacade.addOrUpdateMatDeliver(deliverAddRequest, users.get(0).getId());
230 259  
231 260  
... ... @@ -232,17 +261,15 @@
232 261 }
233 262 else
234 263 { //秦皇岛服务器有分娩记录,但是在这边系统没有对于孕妇 取分娩信息建档儿童数据
235   - buildBaby( item, patInfo, dueDateStr, dueDate);
  264 + buildBaby( item, patInfo, dueDate);
236 265 }
237 266 }
238 267 else
239 268 {
240   -
241 269 //没有找到孕妇建档的基本信息 记录下来
242 270 saveFmrecord(item.getSyxh());
243 271 }
244 272  
245   -
246 273 } catch (Exception e)
247 274 {
248 275 ExceptionUtils.catchException(e, "数据异常");
... ... @@ -251,7 +278,7 @@
251 278 }
252 279 }
253 280  
254   - String sql1="select * from JHMK_FMJL where JSZ is not null and SC is not null and TZ is not null and YFZ is not null " +
  281 + String sql1="select "+cloumns+" from JHMK_FMJL where JSZ is not null and SC is not null and TZ is not null and YFZ is not null and CCQK is not null and CCQK <> '' " +
255 282 " and SH is not null and (SFFZRSTDT = ' 是 ' or SFSTDT = ' 是 ') and " +
256 283 " CONVERT(DATETIME,left(SSRQ,8)+' '+RIGHT(SSRQ,8),20) > CONVERT(DATETIME,'"+start+"', 120) and CONVERT(DATETIME,left(SSRQ,8)+' '+RIGHT(SSRQ,8),20) <= CONVERT(DATETIME,'"+end+"', 120)";
257 284  
... ... @@ -290,6 +317,11 @@
290 317 List<FmItem> items = maps.get(key);
291 318 FmItem item = items.get(0);
292 319  
  320 + if (!("活产".equals(item.getCcqk()) || "死胎".equals(item.getCcqk())))
  321 + {
  322 + continue;
  323 + }
  324 +
293 325 String dueDateStr = item.getSsrq();
294 326 if (!StringUtils.isNotEmpty(dueDateStr))
295 327 {
296 328  
... ... @@ -297,13 +329,14 @@
297 329 }
298 330 Date dueDate = fmt.parse(dueDateStr);
299 331 FmPatInfo patInfo = getFmPatInfoById(item.getSyxh());
300   - if (patInfo != null && (StringUtils.isNotEmpty(patInfo.getPhone()) || StringUtils.isNotEmpty(patInfo.getCardNo())))
  332 + if (patInfo != null && StringUtils.isNotEmpty(patInfo.getPhone()))
301 333 {
302 334 PatientsQuery query = new PatientsQuery();
303 335 query.setYn(YnEnums.YES.getId());
304 336 query.setType(1); //孕妇
305 337 query.setDueStatus(0); //未终止妊娠
306   - query.setPhoneOrCert(StringUtils.isNotEmpty(patInfo.getPhone()) ? patInfo.getPhone() : patInfo.getCardNo());
  338 + String[] strs = new String[]{patInfo.getPhone(),patInfo.getCardNo()};
  339 + query.setPc(strs);
307 340 List<Patients> patientses = patientsService.queryPatient(query);
308 341 if (CollectionUtils.isNotEmpty(patientses))
309 342 {
... ... @@ -331,6 +364,7 @@
331 364 deliverAddRequest.setDueDate(DateUtil.getyyyy_MM_dd(dueDate));
332 365 deliverAddRequest.setParentId(patient.getId());
333 366 deliverAddRequest.setPid(patient.getPid());
  367 + deliverAddRequest.setOperationCause("-");
334 368 if (StringUtils.isNotEmpty(item.getRc()))
335 369 {
336 370 String week = "";
337 371  
... ... @@ -347,8 +381,11 @@
347 381 deliverAddRequest.setDueWeek(week);
348 382 }
349 383  
  384 +// deliverAddRequest.setTireNumber(items.size());
  385 +// deliverAddRequest.setPlacenta(items.size()+"");
  386 +
350 387 deliverAddRequest.setTireNumber(items.size());
351   - deliverAddRequest.setPlacenta(items.size()+"");
  388 + deliverAddRequest.setPlacenta("1");
352 389  
353 390 if ("完好".equals(item.getHyqk()))
354 391 {
355 392  
... ... @@ -379,9 +416,9 @@
379 416  
380 417 //胎盘信息
381 418 List<MaternalDeliverModel.ExtPlacenta> extPlacentas = new ArrayList<>();
382   - //儿童
383   - List<MaternalDeliverModel.Baby> babies = new ArrayList<>();
  419 + List<MatDeliverAddRequest.Baby> babies = new ArrayList<>();
384 420  
  421 +
385 422 for (FmItem item1 : items)
386 423 {
387 424  
388 425  
389 426  
390 427  
391 428  
392 429  
393 430  
394 431  
395 432  
396 433  
397 434  
... ... @@ -392,37 +429,54 @@
392 429 }
393 430 Date dueDate1 = fmt.parse(dueDateStr1);
394 431  
395   - MaternalDeliverModel.ExtPlacenta extPlacenta = new MaternalDeliverModel.ExtPlacenta();
396   - extPlacenta.setMcType(FmTypeEnums.getIdByName(item1.getFmfs())); //分娩方式
397   - String tpmcType = "";
398   - if ("手术产".equals(item1.getTpmcfs()))
  432 +
  433 +
  434 + Map deliveryMode = new HashMap(); //分娩方式
  435 +
  436 + String fmfs = "";
  437 + if (item.getFmfs() != null && "剖宫产".equals(item.getFmfs()))
399 438 {
400   - tpmcType = TpmcTypeEnums.O2.getId();
  439 + fmfs = FmTypeEnums.O1.getId();
401 440 }
402   - else if ("自然产出".equals(item1.getTpmcfs()))
  441 + else
403 442 {
  443 + fmfs = FmTypeEnums.O.getId();
  444 + }
  445 + deliveryMode.put("fmfs",fmfs);
  446 + deliveryMode.put("scfs", "");
  447 + deliverAddRequest.setDeliveryMode(deliveryMode);
  448 +
  449 + MaternalDeliverModel.ExtPlacenta extPlacenta = new MaternalDeliverModel.ExtPlacenta();
  450 + String tpmcType = "";
  451 + if ("手术产".equals(item.getTpmcfs()) || "手取胎盘".equals(item.getTpmcfs())) {
  452 + tpmcType = TpmcTypeEnums.O2.getId();
  453 + } else if ("自然产出".equals(item.getTpmcfs()) || "自然娩出".equals(item.getTpmcfs())) {
404 454 tpmcType = TpmcTypeEnums.O.getId();
405 455 }
406 456 extPlacenta.setTpmcType(tpmcType);
407 457 extPlacentas.add(extPlacenta);
  458 + deliverAddRequest.setExtPlacentas(extPlacentas);
408 459  
409   - MaternalDeliverModel.Baby baby = new MaternalDeliverModel.Baby();
  460 + MatDeliverAddRequest.Baby baby = new MatDeliverAddRequest.Baby();
410 461 Map<String,String> as = new HashMap<>();
411 462 as.put("pf1",item1.getYfz());
412 463 as.put("pf5",item1.getWfz());
413 464 as.put("pf10", item1.getSfz());
414   - baby.setApgarScore(JsonUtil.obj2JsonString(as));
  465 + baby.setApgarScore(as);
415 466 baby.setBabyGender("男".equals(item1.getYexb()) ? "1" : "0");
416 467 baby.setBabyHeight(item1.getSc());//新生儿生长
417 468 baby.setBabyWeight(item1.getTz());//新生儿重量
418   - baby.setDeformity("无".equals(item1.getJx()) ? 0 : 1); //畸形 0非畸形 1畸形
419 469 baby.setAsphyxiaM(item1.getZx()); //窒息分钟
  470 +
  471 + baby.setDeformity("无".equals(item1.getJx()) ? 0 : 1); //畸形 0非畸形 1畸形
  472 +
420 473 baby.setPregnancyOut(RenShenJieJuEnums.getIdByName(item1.getCcqk())); // 妊娠结局
421   - baby.setBabyHealthy(item1.getYeqk()); //新生儿疾病
  474 +// baby.setBabyHealthy(item1.getYeqk()); //新生儿疾病
422 475 baby.setDueTime(fmt1.format(dueDate1));//分娩时间
423 476 babies.add(baby);
424 477  
425 478 }
  479 + deliverAddRequest.setBabies(babies);
426 480 deliverAddRequest.setFmHospital("216");
427 481 ExceptionUtils.catchException("double deliverAddRequest===" + deliverAddRequest);
428 482 matDeliverFacade.addOrUpdateMatDeliver(deliverAddRequest, users.get(0).getId());
... ... @@ -439,7 +493,7 @@
439 493 continue;
440 494 }
441 495 Date dueDate1 = fmt.parse(dueDateStr1);
442   - buildBaby( i,patInfo, dueDateStr1, dueDate1);
  496 + buildBaby( i,patInfo, dueDate1);
443 497 }
444 498  
445 499 }
446 500  
... ... @@ -477,9 +531,16 @@
477 531 }
478 532  
479 533  
480   - public void buildBaby(FmItem item,FmPatInfo patInfo, String dueDateStr,Date dueDate)
  534 + public void buildBaby(FmItem item,FmPatInfo patInfo, Date dueDate)
481 535 {
482 536 try{
  537 + ExceptionUtils.catchException("buildBaby====");
  538 + // O("活产", "0"),O1("死胎", "1"),O2("浸软胎", "2"),O3("死产", "3");
  539 + if (!"活产".equals(item.getCcqk()))
  540 + {
  541 + return;
  542 + }
  543 +
483 544 UsersQuery usersQuery = new UsersQuery();
484 545 usersQuery.setYn(YnEnums.YES.getId());
485 546 usersQuery.setName("产房");
486 547  
487 548  
488 549  
... ... @@ -517,18 +578,18 @@
517 578 }
518 579  
519 580 request.setMommyPhone(patInfo.getPhone());
520   - String babyName = item.getYexb()+("男".equals(item.getYexb()) ? "之子" : "之女");
  581 + String babyName = patInfo.getName()+("男".equals(item.getYexb()) ? "之子" : "之女");
521 582 request.setBabyName(babyName);
522 583 request.setSex("男".equals(item.getYexb()) ? 1 : 0);
523 584  
524   - request.setBabyBirthday(dueDateStr); //生日
  585 + request.setBabyBirthday(DateUtil.getyyyy_MM_dd(dueDate)); //生日
525 586  
526 587 if (StringUtils.isNotEmpty(item.getRc())) {
527 588 String week = "";
528 589 if (item.getRc().split("\\u002B").length > 1) {
529   - week = item.getRc().split("\\u002B")[0] + "周";
  590 + week = item.getRc().split("\\u002B")[0];
530 591 } else {
531   - week = item.getRc() + "周";
  592 + week = item.getRc();
532 593 }
533 594 try {
534 595 request.setDueWeek(Integer.parseInt(week)); //分娩孕周
535 596  
536 597  
537 598  
538 599  
539 600  
540 601  
... ... @@ -538,33 +599,50 @@
538 599 }
539 600 }
540 601  
541   - String tpmcType = "";
542   - if ("手术产".equals(item.getTpmcfs())) {
543   - tpmcType = FmTypeEnums.O1.getId();
544   - } else if ("自然产出".equals(item.getTpmcfs())) {
545   - tpmcType = FmTypeEnums.O.getId();
  602 + String fmfs = "";
  603 + if (item.getFmfs() != null && "剖宫产".equals(item.getFmfs()))
  604 + {
  605 + fmfs = FmTypeEnums.O1.getId();
546 606 }
  607 + else
  608 + {
  609 + fmfs = FmTypeEnums.O.getId();
  610 + }
547 611  
548   - request.setDueType(tpmcType);//分娩方式
  612 + request.setDueType(fmfs);//分娩方式
549 613 request.setFetusCount(item.getDjt()); //第几胎
550 614 request.setDueCount(item.getCjc());//第几产
551   - request.setBabyWeight(item.getTz()); //体重
  615 + DecimalFormat df = new DecimalFormat("#.00");
  616 + double w = Double.parseDouble(item.getTz());
  617 + request.setBabyWeight(df.format(w/1000)); //体重
552 618 request.setBabyHeight(item.getSc()); //身长
553 619 Map<String,String> map = new HashMap<>();
554 620 map.put("pf1",item.getYfz());
555 621 map.put("pf5", item.getWfz());
556 622 map.put("pf10", item.getSfz());
557 623 request.setApgarScore(map);
  624 + request.setDeliverOrg("216");
558 625  
559 626 request.setBuildDoctor(users.get(0).getId() + "");
560 627 request.setBuildDate(DateUtil.getyyyy_MM_dd(dueDate));
561   - request.setHighRisk("是".equals(item.getSfgw()) ? 1 : 0);
  628 + request.setHighRisk("是".equals(item.getSfgw()) ? 1 : 0); ////是否高危 0 非高危 1高危
562 629 request.setMalformation("无".equals(item.getJx()) ? 0 : 1); //畸形 0非畸形 1畸形
563 630  
564 631 request.setServiceType(ServiceTypeEnums.STANDARD_SERVICE.getId()); //标准服务
565 632 request.setServiceStatus(ServiceStatusEnums.STANDARD_OPEN.getId()); //开通
566 633  
567 634 babyBookbuildingFacade.addBabyBookbuilding(request, users.get(0).getId());
  635 +
  636 + if (patInfo != null && StringUtils.isNotEmpty(patInfo.getBlh()))
  637 + {
  638 + Map<String,Object> diags = qhdfyHisService.queryHisBabyDiagnosis(patInfo.getBlh());
  639 + if (diags != null && diags.size() > 0)
  640 + {
  641 + request.setBlNo(patInfo.getBlh());
  642 + request.setBabyDiagnosis(diags.get("diagnosisItem") == null ? "" : diags.get("diagnosisItem").toString());
  643 + }
  644 + }
  645 +
568 646 }catch (Exception e)
569 647 {
570 648 ExceptionUtils.catchException(e, "buildBaby exception");
571 649  
572 650  
573 651  
574 652  
575 653  
... ... @@ -585,19 +663,22 @@
585 663 Connection conn = ConnTools.makeFmConnection();
586 664 QueryRunner queryRunner = new QueryRunner();
587 665 try {
  666 + FmPatInfo patInfo = null;
588 667  
589   - List<FmPatInfo> list = queryRunner.query(conn, "SELECT syxh,hzxm as name,sfzh as cardNo,sex as sex,birth,lxrdh as phone FROM THIS4_BASY WHERE lxrdh <> '' and hzxm is not null and hzxm <> '' and len(lxrdh) = 11 and syxh = '"+syxh+"'", new BeanListHandler<FmPatInfo>(FmPatInfo.class));
  668 + List<FmPatInfo> list = queryRunner.query(conn, "SELECT syxh,hzxm as name,sfzh as cardNo,sex as sex,birth,lxrdh as phone, blh FROM THIS4_BASY WHERE lxrdh <> '' and hzxm is not null and hzxm <> '' and len(lxrdh) = 11 and syxh = '"+syxh+"'", new BeanListHandler<FmPatInfo>(FmPatInfo.class));
590 669 if (CollectionUtils.isNotEmpty(list)) {
591   - return list.get(0);
  670 + patInfo = list.get(0);
592 671 }
593 672 else
594 673 {
595   - List<FmPatInfo> list1 = queryRunner.query(conn, "SELECT SYXH as syxh, BRXM as name,'' as cardNo,BRXB as sex,'' as birth,LXDH as phone FROM JHMK_BASY WHERE len(LXDH) = 11 and SYXH = '"+syxh+"'", new BeanListHandler<FmPatInfo>(FmPatInfo.class));
  674 + List<FmPatInfo> list1 = queryRunner.query(conn, "SELECT SYXH as syxh, BRXM as name,'' as cardNo,BRXB as sex,'' as birth,LXDH as phone,ZYHM as blh FROM JHMK_BASY WHERE len(LXDH) = 11 and SYXH = '"+syxh+"'", new BeanListHandler<FmPatInfo>(FmPatInfo.class));
596 675 if (CollectionUtils.isNotEmpty(list1)) {
597   - return list1.get(0);
  676 + patInfo = list1.get(0);
598 677 }
599 678 }
600 679 DbUtils.closeQuietly(conn);
  680 + return patInfo;
  681 +
601 682 } catch (SQLException e) {
602 683 DbUtils.closeQuietly(conn);
603 684 e.printStackTrace();
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/SmsConfigController.java View file @ ef751dc
... ... @@ -29,6 +29,7 @@
29 29 import org.springframework.stereotype.Controller;
30 30 import org.springframework.web.bind.annotation.*;
31 31  
  32 +import javax.servlet.http.HttpServletResponse;
32 33 import javax.validation.Valid;
33 34 import java.util.*;
34 35  
... ... @@ -210,6 +211,32 @@
210 211 @RequestParam(required = false) Integer limit) {
211 212 return smsConfigFacade.querySmsList(hospitalName, phone, smsType, smsStatus, content, planTime, actualTime, objType, page, limit);
212 213 }
  214 +
  215 +
  216 + /**
  217 + * 导出短信
  218 + * @param hospitalName
  219 + * @param phone
  220 + * @param smsType
  221 + * @param smsStatus
  222 + * @param objType
  223 + * @param content
  224 + * @param planTime
  225 + * @param actualTime
  226 +
  227 + */
  228 + @RequestMapping(value = "/exportSmsList", method = RequestMethod.GET)
  229 + public void exportSmsList(HttpServletResponse httpServletResponse,@RequestParam(required = false) String hospitalName,
  230 + @RequestParam(required = false) String phone,
  231 + @RequestParam(required = false) Integer smsType,
  232 + @RequestParam(required = false) Integer smsStatus,
  233 + @RequestParam(required = false) Integer objType,
  234 + @RequestParam(required = false) String content,
  235 + @RequestParam(required = false) String planTime,
  236 + @RequestParam(required = false) String actualTime) {
  237 + smsConfigFacade.exportSmsList(hospitalName, phone, smsType, smsStatus, content, planTime, actualTime, objType, httpServletResponse);
  238 + }
  239 +
213 240  
214 241  
215 242 @RequestMapping(value = "/sendBabyBuildSms", method = RequestMethod.GET)
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java View file @ ef751dc
... ... @@ -754,15 +754,19 @@
754 754 if (CollectionUtils.isNotEmpty(messages)) {
755 755 smsList.setTypeId(ProjectTypeEnums.YNXT.getId());
756 756 smsList.setMessages(messages);
757   -
758   - //秦皇岛建档
759   - if (syncDataService.savePostMsg(JsonUtil.obj2JsonString(smsList), messages.get(0).getExt1())) {
760   - ExceptionUtils.catchException("儿童建档3---------->"+babyModel.getMphone()+";name="+babyModel.getName());
  757 + if ("4".equals(HIS_VERSION))
  758 + {
  759 + //秦皇岛建档
  760 + if (syncDataService.savePostMsg(JsonUtil.obj2JsonString(smsList), messages.get(0).getExt1())) {
  761 + ExceptionUtils.catchException("儿童建档3---------->"+babyModel.getMphone()+";name="+babyModel.getName());
  762 + }
761 763 }
762   -
763   - //线上
764   -// MessageCenterService.saveSmsCenter(smsList);
765   -// ExceptionUtils.catchException("儿童建档3---------->"+babyModel.getMphone()+";name="+babyModel.getName());
  764 + else
  765 + {
  766 + //线上
  767 + MessageCenterService.saveSmsCenter(smsList);
  768 + ExceptionUtils.catchException("儿童建档3---------->" + babyModel.getMphone() + ";name=" + babyModel.getName());
  769 + }
766 770 }
767 771 }
768 772 }
... ... @@ -2157,6 +2161,7 @@
2157 2161 data.put("serviceStatus", StringUtils.emptyDeal(model.getServiceStatus() == null ? "" : ServiceStatusEnums.getNameById(model.getServiceStatus())));
2158 2162 data.put("nextDate", StringUtils.emptyDeal(DateUtil.getyyyy_MM_dd(model.getNextDate())));
2159 2163 data.put("monthAge", StringUtils.emptyDeal(DateUtil.getBabyMonthAge(model.getBirth(), new Date())));
  2164 + data.put("created", StringUtils.emptyDeal(DateUtil.getyyyy_MM_dd(model.getCreated())));
2160 2165  
2161 2166 String diagnose = "";
2162 2167 if (StringUtils.isNotEmpty(model.getPid())) {
... ... @@ -2236,6 +2241,7 @@
2236 2241 cnames.put("monthAge", "月龄");
2237 2242 cnames.put("diagnose", "高危诊断");
2238 2243 cnames.put("highRisk", "是否健康");
  2244 + cnames.put("created", "建档时间");
2239 2245 httpServletResponse.setContentType("application/octet-stream");
2240 2246 httpServletResponse.setCharacterEncoding("UTF-8");
2241 2247 httpServletResponse.setHeader("Content-Disposition", "attachment;fileName=" + "childDatas.xls");
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java View file @ ef751dc
... ... @@ -381,13 +381,17 @@
381 381 smsList.setMessages(messages);
382 382 //调用发送接口
383 383  
384   - //保存到同步表中
385   - syncDataService.savePostMsg(JsonUtil.obj2JsonString(smsList), messages.get(0).getExt1());
386   -
387   -
388   - //保存到短信中心
389   - //MessageCenterService.saveSmsCenter(smsList);
390   -
  384 + if ("4".equals(HIS_VERSION))
  385 + {
  386 + //秦皇岛
  387 + //保存到同步表中
  388 + syncDataService.savePostMsg(JsonUtil.obj2JsonString(smsList), messages.get(0).getExt1());
  389 + }
  390 + else
  391 + {
  392 + //保存到短信中心 线上
  393 + MessageCenterService.saveSmsCenter(smsList);
  394 + }
391 395 }
392 396 }
393 397 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java View file @ ef751dc
... ... @@ -593,6 +593,9 @@
593 593 personModel.setName(babyModel.getName());
594 594 personModel.setCreated(new Date());
595 595 babyModel.setPid(personService.addPerson(personModel).getId());
  596 + //add lqy start 2017-03-01
  597 + babyModel.setBlNo(baby.getBlNo());
  598 + babyModel.setBabyDiagnosis(baby.getBabyDiagnosis());
596 599 }
597 600 babyIds.add(babyService.addOneBaby(babyModel).getId());
598 601 baby1.setId(babyModel.getId());
... ... @@ -601,6 +604,8 @@
601 604 //儿童建档
602 605 babyBookbuildingFacade.createBuildSms(babyModel);
603 606 }
  607 +
  608 +
604 609 i++;
605 610 }
606 611 maternalDeliverModel.setBaby(babyList);
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/SmsConfigFacade.java View file @ ef751dc
... ... @@ -7,10 +7,7 @@
7 7 import com.lyms.platform.common.result.BaseListResponse;
8 8 import com.lyms.platform.common.result.BaseObjectResponse;
9 9 import com.lyms.platform.common.result.BaseResponse;
10   -import com.lyms.platform.common.utils.DateUtil;
11   -import com.lyms.platform.common.utils.JsonUtil;
12   -import com.lyms.platform.common.utils.StringUtils;
13   -import com.lyms.platform.common.utils.SystemConfig;
  10 +import com.lyms.platform.common.utils.*;
14 11 import com.lyms.platform.operate.web.request.SmsConfigRequest;
15 12 import com.lyms.platform.operate.web.result.*;
16 13 import com.lyms.platform.operate.web.utils.ConfigTask;
... ... @@ -26,6 +23,9 @@
26 23 import org.springframework.beans.factory.annotation.Autowired;
27 24 import org.springframework.stereotype.Component;
28 25  
  26 +import javax.servlet.http.HttpServletResponse;
  27 +import java.io.IOException;
  28 +import java.io.OutputStream;
29 29 import java.util.*;
30 30  
31 31 /**
... ... @@ -863,6 +863,65 @@
863 863 }
864 864 }
865 865 return "";
  866 + }
  867 +
  868 + /**
  869 + * 导出短信列表
  870 + *
  871 + * @param hospitalName 医院名称
  872 + * @param phone 手机号码
  873 + * @param smsType 短信类型
  874 + * @param smsStatus 短信状态
  875 + * @param content 短信内容
  876 + * @param planTime 计划发送时间
  877 + * @param actualTime 实际发送时间
  878 + * @param objType 发送短信
  879 + * @param httpServletResponse
  880 + */
  881 + public void exportSmsList(String hospitalName, String phone, Integer smsType, Integer smsStatus, String content, String planTime, String actualTime, Integer objType,HttpServletResponse httpServletResponse) {
  882 +
  883 + try
  884 + {
  885 + BaseListResponse list = querySmsList( hospitalName, phone, smsType, smsStatus, content, planTime, actualTime, objType, 1, 999999999);
  886 + List<Map<String, Object>> datas = new ArrayList<>();
  887 + List<Map<String,String>> results = list.getData();
  888 +
  889 + if (CollectionUtils.isNotEmpty(results))
  890 + {
  891 + for(Map<String,String> map : results)
  892 + {
  893 + Map<String, Object> data = new HashMap<>();
  894 + data.put("hospitalName",map.get("hospitalName"));
  895 + data.put("objType",map.get("objType"));
  896 + data.put("smsType",map.get("smsType"));
  897 + data.put("phone",map.get("phone"));
  898 + data.put("content",map.get("content"));
  899 + data.put("planTime",map.get("planTime"));
  900 + data.put("actualTime",map.get("actualTime"));
  901 + data.put("smsStatus",map.get("smsStatus"));
  902 + data.put("timeType",map.get("timeType"));
  903 + datas.add(data);
  904 + }
  905 + }
  906 +
  907 + OutputStream out = httpServletResponse.getOutputStream();
  908 + Map<String, String> cnames = new LinkedHashMap<>();
  909 + cnames.put("hospitalName", "医院");
  910 + cnames.put("objType", "发送对象");
  911 + cnames.put("smsType", "短信类型");
  912 + cnames.put("phone", "电话号码");
  913 + cnames.put("content", "短信内容");
  914 + cnames.put("planTime", "计划发送时间");
  915 + cnames.put("actualTime", "实际发送时间");
  916 + cnames.put("smsStatus", "状态");
  917 + cnames.put("timeType", "是否及时");
  918 + httpServletResponse.setContentType("application/octet-stream");
  919 + httpServletResponse.setCharacterEncoding("UTF-8");
  920 + httpServletResponse.setHeader("Content-Disposition", "attachment;fileName=sms.xls");
  921 + ExcelUtil.toExcel(out, datas, cnames);
  922 + } catch (IOException e) {
  923 + e.printStackTrace();
  924 + }
866 925 }
867 926 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/MatDeliverAddRequest.java View file @ ef751dc
... ... @@ -470,6 +470,12 @@
470 470 //分娩时间
471 471 private String dueTime;
472 472  
  473 + //儿童诊断
  474 + private String babyDiagnosis;
  475 +
  476 + //病历号(住院号)
  477 + private String blNo;
  478 +
473 479 @Override
474 480 public MaternalDeliverModel.Baby convertToDataModel() {
475 481 MaternalDeliverModel.Baby baby= new MaternalDeliverModel.Baby();
... ... @@ -491,6 +497,22 @@
491 497 baby.setEarlySuck(earlySuck);
492 498 baby.setDueTime(dueTime);
493 499 return baby;
  500 + }
  501 +
  502 + public String getBabyDiagnosis() {
  503 + return babyDiagnosis;
  504 + }
  505 +
  506 + public void setBabyDiagnosis(String babyDiagnosis) {
  507 + this.babyDiagnosis = babyDiagnosis;
  508 + }
  509 +
  510 + public String getBlNo() {
  511 + return blNo;
  512 + }
  513 +
  514 + public void setBlNo(String blNo) {
  515 + this.blNo = blNo;
494 516 }
495 517  
496 518 public String getDueTime() {