Commit d41b63d43396e380d056001286579e21603dc46a

Authored by cfl
1 parent a27e21d782
Exists in master and in 2 other branches dev, luanping

模板消息维护增加minContent字段

Showing 4 changed files with 69 additions and 34 deletions

platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/PatientsService.java View file @ d41b63d
... ... @@ -24,6 +24,7 @@
24 24 import org.springframework.stereotype.Service;
25 25  
26 26 import java.util.*;
  27 +import java.util.concurrent.ExecutionException;
27 28  
28 29 /**
29 30 * Created by Administrator on 2016/4/22 0022.
... ... @@ -466,6 +467,7 @@
466 467 * 自动分娩产妇的
467 468 */
468 469 public void autoMatDeliver() {
  470 + logger.info("自动分娩定时任务开始");
469 471 setAutoMatDeliver(null,null);
470 472  
471 473 }
472 474  
473 475  
474 476  
475 477  
476 478  
477 479  
478 480  
479 481  
... ... @@ -490,47 +492,56 @@
490 492 List<Patients> patientses = queryPatient(patientsQuery);
491 493 List<PersonModel> list = null;
492 494 for (Patients patients : patientses) {
493   - patients.setType(3);
494   - patients.setBuildType(2);
495   - Date fmDate = dueDate != null ? dueDate : DateUtil.addDay(patients.getLastMenses(), 294);
496   - patients.setFmDate(fmDate);
497   - patients.setModified(new Date());
498   - // hujiaqi添加,是否自动分娩
499   - patients.setIsAutoFm(YnEnums.YES.getId());
500   - // hujiaqi添加结束
501   - updatePatient(patients);
502   - //追访流转到产后访视
503   - addTrackDownInfo(patients.getOperator(), patients);
  495 + try{
504 496  
505   - /** 自动分娩 >> 作废未使用的产检券 */
506   -// remoteService.invalidCoupon(patients.getPid(), "2", RemoteUrlEnum.INVALID_COUPON_URL);
507 497  
508   - //作废产检劵
509   - /* patientCheckTicketService.cancelCheckTicket(patients.getHospitalId(), patients.getId());*/
510   - PersonModelQuery personYunModelQuery = new PersonModelQuery();
511   - personYunModelQuery.setYn(YnEnums.YES.getId());
512   - personYunModelQuery.setId(patients.getPid());
513   - list = personService.queryPersons(personYunModelQuery);
514   - if (CollectionUtils.isNotEmpty(list)) {
515   - PersonModel pm = list.get(0);
516   - pm.setType(3);//基本信息更新成产妇
517   - personService.updatePerson(pm, pm.getId());
518   - }
  498 + patients.setType(3);
  499 + patients.setBuildType(2);
  500 + Date fmDate = dueDate != null ? dueDate : DateUtil.addDay(patients.getLastMenses(), 294);
  501 + patients.setFmDate(fmDate);
  502 + patients.setModified(new Date());
  503 + // hujiaqi添加,是否自动分娩
  504 + patients.setIsAutoFm(YnEnums.YES.getId());
  505 + // hujiaqi添加结束
  506 + updatePatient(patients);
  507 + //追访流转到产后访视
  508 + addTrackDownInfo(patients.getOperator(), patients);
519 509  
  510 + /** 自动分娩 >> 作废未使用的产检券 */
  511 + // remoteService.invalidCoupon(patients.getPid(), "2", RemoteUrlEnum.INVALID_COUPON_URL);
520 512  
521   - //体重记录更新为产妇状态
522   - List<PatientWeight> patientWeights = patientWeightService2.queryPatientWeight(Query.query(Criteria.where("pid").is(patients.getPid())));
523   - if (CollectionUtils.isNotEmpty(patientWeights))
524   - {
525   - for (PatientWeight weight : patientWeights)
  513 + //作废产检劵
  514 + /* patientCheckTicketService.cancelCheckTicket(patients.getHospitalId(), patients.getId());*/
  515 + PersonModelQuery personYunModelQuery = new PersonModelQuery();
  516 + personYunModelQuery.setYn(YnEnums.YES.getId());
  517 + personYunModelQuery.setId(patients.getPid());
  518 + list = personService.queryPersons(personYunModelQuery);
  519 + if (CollectionUtils.isNotEmpty(list)) {
  520 + PersonModel pm = list.get(0);
  521 + pm.setType(3);//基本信息更新成产妇
  522 + personService.updatePerson(pm, pm.getId());
  523 + }
  524 +
  525 + //体重记录更新为产妇状态
  526 + List<PatientWeight> patientWeights = patientWeightService2.queryPatientWeight(Query.query(Criteria.where("pid").is(patients.getPid())));
  527 + if (CollectionUtils.isNotEmpty(patientWeights))
526 528 {
527   - weight.setType(3);
528   - patientWeightService2.update(Query.query(Criteria.where("id").is(weight.getId())), weight);
  529 + for (PatientWeight weight : patientWeights)
  530 + {
  531 + weight.setType(3);
  532 + patientWeightService2.update(Query.query(Criteria.where("id").is(weight.getId())), weight);
  533 + }
529 534 }
  535 + }catch (Exception e){
  536 + logger.error("自动分娩异常:"+patients.getCardNo(),e);
530 537 }
531 538 }
  539 + try{
  540 + setPostReviewRecord();
  541 + }catch (Exception e){
  542 + logger.error("自动分娩发送访视记录异常",e);
  543 + }
532 544  
533   - setPostReviewRecord();
534 545 }
535 546  
536 547  
platform-dal/src/main/java/com/lyms/platform/pojo/SmsTemplateModel.java View file @ d41b63d
... ... @@ -50,6 +50,8 @@
50 50 //内容
51 51 private String content;
52 52  
  53 + private String minContent;
  54 +
53 55 //医院id
54 56 private String hospitalId;
55 57  
... ... @@ -238,6 +240,14 @@
238 240  
239 241 public void setModified(Date modified) {
240 242 this.modified = modified;
  243 + }
  244 +
  245 + public String getMinContent() {
  246 + return minContent;
  247 + }
  248 +
  249 + public void setMinContent(String minContent) {
  250 + this.minContent = minContent;
241 251 }
242 252  
243 253 @Override
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/SmsTemplateFacade.java View file @ d41b63d
... ... @@ -94,6 +94,7 @@
94 94 model.setYn(YnEnums.YES.getId());
95 95  
96 96 model.setContent(request.getContent());
  97 + model.setMinContent(request.getMinContent());
97 98  
98 99 if (request.getSendFrequency() != null)
99 100 {
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/SmsTemplateRequest.java View file @ d41b63d
... ... @@ -57,6 +57,11 @@
57 57 @NotEmpty(message = "发送内容不能为空.")
58 58 private String content;
59 59  
  60 + /**
  61 + * 消息内容精简
  62 + */
  63 + private String minContent;
  64 +
60 65 //医院id
61 66 @FormParam
62 67 private String hospitalId;
... ... @@ -215,6 +220,14 @@
215 220  
216 221 public void setHospitalId(String hospitalId) {
217 222 this.hospitalId = hospitalId;
  223 + }
  224 +
  225 + public String getMinContent() {
  226 + return minContent;
  227 + }
  228 +
  229 + public void setMinContent(String minContent) {
  230 + this.minContent = minContent;
218 231 }
219 232 }