Commit b6b7b0662f343e5c970a9a10519d733df4d80977

Authored by liquanyu
1 parent 72399d6bc5

update

Showing 10 changed files with 761 additions and 4 deletions

platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/PostReviewStatusDao.java View file @ b6b7b06
  1 +package com.lyms.platform.biz.dal;
  2 +
  3 +import com.lyms.platform.common.dao.operator.MongoQuery;
  4 +import com.lyms.platform.pojo.AmniocentesisRecordModel;
  5 +import com.lyms.platform.pojo.PostReviewStatusModel;
  6 +
  7 +import java.util.List;
  8 +
  9 +/**
  10 + * Created by Administrator on 2019-10-14.
  11 + */
  12 +public interface PostReviewStatusDao {
  13 + List<PostReviewStatusModel> queryRecord(MongoQuery query);
  14 +
  15 + int count(MongoQuery query);
  16 +
  17 + PostReviewStatusModel add(PostReviewStatusModel model);
  18 +
  19 + void update(PostReviewStatusModel model);
  20 +}
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/PostReviewStatusDaoImpl.java View file @ b6b7b06
  1 +package com.lyms.platform.biz.dal.impl;
  2 +
  3 +import com.lyms.platform.biz.dal.PostReviewStatusDao;
  4 +import com.lyms.platform.common.dao.BaseMongoDAOImpl;
  5 +import com.lyms.platform.common.dao.operator.MongoCondition;
  6 +import com.lyms.platform.common.dao.operator.MongoOper;
  7 +import com.lyms.platform.common.dao.operator.MongoQuery;
  8 +import com.lyms.platform.pojo.PostReviewStatusModel;
  9 +import org.springframework.stereotype.Repository;
  10 +
  11 +import java.util.List;
  12 +
  13 +/**
  14 + * Created by Administrator on 2019-10-14.
  15 + */
  16 +@Repository("postReviewStatusDao")
  17 +public class PostReviewStatusDaoImpl extends BaseMongoDAOImpl<PostReviewStatusModel> implements PostReviewStatusDao {
  18 + @Override
  19 + public List<PostReviewStatusModel> queryRecord(MongoQuery query) {
  20 + return find(query.convertToMongoQuery());
  21 + }
  22 +
  23 + @Override
  24 + public int count(MongoQuery query) {
  25 + return (int)count(query.convertToMongoQuery());
  26 + }
  27 +
  28 + @Override
  29 + public PostReviewStatusModel add(PostReviewStatusModel model) {
  30 + return save(model);
  31 + }
  32 +
  33 + @Override
  34 + public void update(PostReviewStatusModel model) {
  35 + update(new MongoQuery(new MongoCondition("id", model.getId(), MongoOper.IS)).convertToMongoQuery(), model);
  36 + }
  37 +}
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/PatientsService.java View file @ b6b7b06
... ... @@ -2,10 +2,12 @@
2 2  
3 3 import com.lyms.platform.biz.dal.*;
4 4 import com.lyms.platform.common.dao.operator.MongoQuery;
  5 +import com.lyms.platform.common.enums.FmTypeEnums;
5 6 import com.lyms.platform.common.enums.SieveStatusEnums;
6 7 import com.lyms.platform.common.enums.TrackDownDateEnums;
7 8 import com.lyms.platform.common.enums.YnEnums;
8 9 import com.lyms.platform.common.utils.DateUtil;
  10 +import com.lyms.platform.common.utils.JsonUtil;
9 11 import com.lyms.platform.common.utils.PropertiesUtils;
10 12 import com.lyms.platform.pojo.*;
11 13 import com.lyms.platform.query.*;
... ... @@ -22,6 +24,7 @@
22 24 import java.util.Arrays;
23 25 import java.util.Date;
24 26 import java.util.List;
  27 +import java.util.Map;
25 28  
26 29 /**
27 30 * Created by Administrator on 2016/4/22 0022.
28 31  
... ... @@ -31,8 +34,9 @@
31 34 private Logger logger = LoggerFactory.getLogger("SIEVE-JOB");
32 35  
33 36 public static final String his_version = PropertiesUtils.getPropertyValue("his_version");
34   -
35 37 @Autowired
  38 + private MatDeliverService matDeliverService;
  39 + @Autowired
36 40 private IPatientDao iPatientDao;
37 41 @Autowired
38 42 private ISieveDao sieveDao;
... ... @@ -47,6 +51,8 @@
47 51 @Autowired
48 52 private PatientWeightService2 patientWeightService2;
49 53 @Autowired
  54 + private PostReviewStatusService postReviewStatusService;
  55 + @Autowired
50 56 private PersonService personService;
51 57 @Autowired
52 58 private IAntExRecordDao iAntExRecordDao;
... ... @@ -67,7 +73,7 @@
67 73  
68 74  
69 75 public void updatePatientHusbandBirth(String id,String value) {
70   - iPatientDao.updatePatientHusbandBirth(id,value);
  76 + iPatientDao.updatePatientHusbandBirth(id, value);
71 77 }
72 78  
73 79  
74 80  
... ... @@ -517,7 +523,108 @@
517 523 }
518 524 }
519 525 }
  526 +
  527 + setPostReviewRecord();
520 528 }
  529 +
  530 +
  531 +
  532 +
  533 + /**
  534 + * 根据分娩方式 如果是顺产 42天进入列表 如果是剖宫产 56天进入列表
  535 + */
  536 + public void setPostReviewRecord()
  537 + {
  538 + Date currentDate = DateUtil.getYMDTime();
  539 + Date startDate = DateUtil.addDay(currentDate,-42);
  540 + Date endDate = DateUtil.addDay(currentDate, -43);
  541 +
  542 + Date startDate1 = DateUtil.addDay(currentDate,-56);
  543 + Date endDate1 = DateUtil.addDay(currentDate, -57);
  544 +
  545 + MatDeliverQuery deliverQuery = new MatDeliverQuery();
  546 + deliverQuery.setYn(YnEnums.YES.getId());
  547 + deliverQuery.setCreatedStart(endDate);
  548 + deliverQuery.setEndStart(startDate);
  549 + List<MaternalDeliverModel> models = matDeliverService.query(deliverQuery);
  550 + if (CollectionUtils.isNotEmpty(models))
  551 + {
  552 + for (MaternalDeliverModel model : models)
  553 + {
  554 + savePostReviewStatus(model, FmTypeEnums.O.getId());
  555 + }
  556 + }
  557 +
  558 + deliverQuery.setCreatedStart(endDate1);
  559 + deliverQuery.setEndStart(startDate1);
  560 + List<MaternalDeliverModel> models1 = matDeliverService.query(deliverQuery);
  561 + if (CollectionUtils.isNotEmpty(models1))
  562 + {
  563 + for (MaternalDeliverModel model : models1)
  564 + {
  565 + savePostReviewStatus( model,FmTypeEnums.O1.getId());
  566 + }
  567 + }
  568 +
  569 + }
  570 +
  571 + private void savePostReviewStatus(MaternalDeliverModel model,String fmType)
  572 + {
  573 + PostReviewStatusQuery postReviewStatusQuery = new PostReviewStatusQuery();
  574 + postReviewStatusQuery.setDeliverId(model.getId());
  575 + List<PostReviewStatusModel> list = postReviewStatusService.queryPostReviewStatus(postReviewStatusQuery);
  576 + if (CollectionUtils.isNotEmpty(list))
  577 + {
  578 + return;
  579 + }
  580 +
  581 + PostReviewStatusModel postReviewStatusModel = new PostReviewStatusModel();
  582 +
  583 + String deliveryMode = "";
  584 + if (StringUtils.isNotEmpty(model.getDeliveryMode()))
  585 + {
  586 + Map m = JsonUtil.str2Obj(model.getDeliveryMode(), Map.class);
  587 + if (m != null) {
  588 + Object b = m.get("fmfs");
  589 + if (b != null && fmType.equals(b.toString()))
  590 + {
  591 + deliveryMode = b.toString();
  592 + }
  593 + else
  594 + {
  595 + return;
  596 + }
  597 + }
  598 + }
  599 + postReviewStatusModel.setDeliveryMode(deliveryMode);
  600 +
  601 + postReviewStatusModel.setDeliverId(model.getId());
  602 + postReviewStatusModel.setYn(YnEnums.YES.getId());
  603 + postReviewStatusModel.setParentId(model.getParentId());
  604 + postReviewStatusModel.setPid(model.getPid());
  605 + postReviewStatusModel.setCreated(new Date());
  606 + postReviewStatusModel.setModified(new Date());
  607 + postReviewStatusModel.setHospitalId(model.getHospitalId());
  608 + postReviewStatusModel.setFmDoctor(model.getDeliverDoctor());
  609 + postReviewStatusModel.setFmDate(model.getDueDate1());
  610 + Patients pat = findOnePatientById(model.getParentId());
  611 + if (pat == null)
  612 + {
  613 + return;
  614 + }
  615 + postReviewStatusModel.setName(pat.getUsername());
  616 + postReviewStatusModel.setBirthday(pat.getBirth());
  617 + postReviewStatusModel.setCardNo(pat.getCardNo());
  618 + postReviewStatusModel.setVcCardNo(pat.getVcCardNo());
  619 + postReviewStatusModel.setDueWeek(model.getDueWeek());
  620 + postReviewStatusModel.setTireNumber(model.getTireNumber());
  621 + postReviewStatusModel.setFmHospital(model.getFmHospital());
  622 + postReviewStatusModel.setLiveNum(model.getBaby().size());
  623 + postReviewStatusModel.setPhone(pat.getPhone());
  624 + postReviewStatusModel.setStatus(1);
  625 + postReviewStatusService.add(postReviewStatusModel);
  626 + }
  627 +
521 628  
522 629 /**
523 630 * 分娩添加或更新追访信息
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/PostReviewStatusService.java View file @ b6b7b06
  1 +package com.lyms.platform.biz.service;
  2 +
  3 +import com.lyms.platform.biz.dal.IAmniocentesisRecordDao;
  4 +import com.lyms.platform.biz.dal.PostReviewStatusDao;
  5 +import com.lyms.platform.common.dao.operator.MongoQuery;
  6 +import com.lyms.platform.pojo.AmniocentesisRecordModel;
  7 +import com.lyms.platform.pojo.PostReviewStatusModel;
  8 +import com.lyms.platform.query.AmniocentesisRecordQuery;
  9 +import com.lyms.platform.query.PostReviewStatusQuery;
  10 +import org.apache.commons.collections.CollectionUtils;
  11 +import org.apache.commons.lang.StringUtils;
  12 +import org.springframework.beans.factory.annotation.Autowired;
  13 +import org.springframework.data.domain.Sort;
  14 +import org.springframework.stereotype.Service;
  15 +
  16 +import java.util.List;
  17 +
  18 +/**
  19 + * Created by Administrator on 2019-10-14.
  20 + */
  21 +@Service
  22 +public class PostReviewStatusService {
  23 + @Autowired
  24 + private PostReviewStatusDao postReviewStatusDao;
  25 +
  26 + public List<PostReviewStatusModel> queryPostReviewStatus(PostReviewStatusQuery postReviewStatusQuery) {
  27 +
  28 + MongoQuery query = postReviewStatusQuery.convertToQuery();
  29 + if (StringUtils.isNotEmpty(postReviewStatusQuery.getNeed())) {
  30 + postReviewStatusQuery.mysqlBuild(postReviewStatusDao.count(query));
  31 + query.start(postReviewStatusQuery.getOffset()).end(postReviewStatusQuery.getLimit());
  32 + }
  33 + query.addOrder(Sort.Direction.DESC, StringUtils.isNotEmpty(postReviewStatusQuery.getSort()) ? postReviewStatusQuery.getSort() : "created");
  34 +
  35 +
  36 + return postReviewStatusDao.queryRecord(query);
  37 + }
  38 +
  39 +
  40 + public PostReviewStatusModel queryOne(PostReviewStatusQuery postReviewStatusQuery) {
  41 + List<PostReviewStatusModel> list = queryPostReviewStatus(postReviewStatusQuery);
  42 + if (CollectionUtils.isNotEmpty(list))
  43 + {
  44 + return list.get(0);
  45 + }
  46 + return null;
  47 + }
  48 +
  49 + public void update(PostReviewStatusModel model) {
  50 + postReviewStatusDao.update(model);
  51 + }
  52 +
  53 + public void add(PostReviewStatusModel model) {
  54 + postReviewStatusDao.add(model);
  55 + }
  56 +}
platform-dal/src/main/java/com/lyms/platform/beans/SerialIdEnum.java View file @ b6b7b06
... ... @@ -66,6 +66,7 @@
66 66 ExtPlacenta("ExtPlacenta", 97531000263L),
67 67 PersonModel("PersonModel", 97531000270L),
68 68 PostReviewModel("PostReviewModel", 97531000280L),
  69 + PostReviewStatusModel("PostReviewStatusModel", 97551000280L),
69 70 PredictedStatisticsCountModel("PredictedStatisticsCountModel", 97531000290L),
70 71 PremaritalCheckup("PremaritalCheckup", 97531000300L),
71 72 PuerperaModel("PuerperaModel", 97531000310L),
platform-dal/src/main/java/com/lyms/platform/pojo/PostReviewStatusModel.java View file @ b6b7b06
  1 +package com.lyms.platform.pojo;
  2 +
  3 +import com.lyms.platform.beans.SerialIdEnum;
  4 +import com.lyms.platform.common.result.BaseModel;
  5 +import org.springframework.data.mongodb.core.mapping.Document;
  6 +
  7 +import java.util.Date;
  8 +import java.util.List;
  9 +
  10 +/**
  11 + * 产后复查状态
  12 + * <p>
  13 + *
  14 + */
  15 +@Document(collection = "lyms_postreview_status")
  16 +public class PostReviewStatusModel extends BaseModel {
  17 +
  18 + private static final long serialVersionUID = SerialIdEnum.PostReviewStatusModel.getCid();
  19 +
  20 + private String id;
  21 + //产妇档案id
  22 + private String parentId;
  23 + private String pid;
  24 + private Integer yn;
  25 + private Date created;
  26 + private Date modified;
  27 + private String hospitalId;
  28 + //分娩记录id
  29 + private String deliverId;
  30 +
  31 + //分娩医生
  32 + private String fmDoctor;
  33 + //分娩日期
  34 + private Date fmDate;
  35 + //分娩方式
  36 + private String deliveryMode;
  37 + private String name;
  38 + private Date birthday;
  39 + //证件号
  40 + private String cardNo;
  41 + //就诊卡号
  42 + private String vcCardNo;
  43 + //分娩孕周
  44 + private String dueWeek;
  45 + //台数
  46 + private Integer tireNumber;
  47 + //分娩医院
  48 + private String fmHospital;
  49 +
  50 + //活产数
  51 + private Integer liveNum;
  52 +
  53 + private String phone;
  54 +
  55 + //1 未复查 2 已复查
  56 + private Integer status;
  57 +
  58 + public String getDeliverId() {
  59 + return deliverId;
  60 + }
  61 +
  62 + public void setDeliverId(String deliverId) {
  63 + this.deliverId = deliverId;
  64 + }
  65 +
  66 + public Integer getStatus() {
  67 + return status;
  68 + }
  69 +
  70 + public void setStatus(Integer status) {
  71 + this.status = status;
  72 + }
  73 +
  74 + public String getId() {
  75 + return id;
  76 + }
  77 +
  78 + public void setId(String id) {
  79 + this.id = id;
  80 + }
  81 +
  82 + public String getParentId() {
  83 + return parentId;
  84 + }
  85 +
  86 + public void setParentId(String parentId) {
  87 + this.parentId = parentId;
  88 + }
  89 +
  90 + public String getPid() {
  91 + return pid;
  92 + }
  93 +
  94 + public void setPid(String pid) {
  95 + this.pid = pid;
  96 + }
  97 +
  98 + public Integer getYn() {
  99 + return yn;
  100 + }
  101 +
  102 + public void setYn(Integer yn) {
  103 + this.yn = yn;
  104 + }
  105 +
  106 + public Date getCreated() {
  107 + return created;
  108 + }
  109 +
  110 + public void setCreated(Date created) {
  111 + this.created = created;
  112 + }
  113 +
  114 + public Date getModified() {
  115 + return modified;
  116 + }
  117 +
  118 + public void setModified(Date modified) {
  119 + this.modified = modified;
  120 + }
  121 +
  122 + public String getHospitalId() {
  123 + return hospitalId;
  124 + }
  125 +
  126 + public void setHospitalId(String hospitalId) {
  127 + this.hospitalId = hospitalId;
  128 + }
  129 +
  130 + public String getFmDoctor() {
  131 + return fmDoctor;
  132 + }
  133 +
  134 + public void setFmDoctor(String fmDoctor) {
  135 + this.fmDoctor = fmDoctor;
  136 + }
  137 +
  138 + public Date getFmDate() {
  139 + return fmDate;
  140 + }
  141 +
  142 + public void setFmDate(Date fmDate) {
  143 + this.fmDate = fmDate;
  144 + }
  145 +
  146 + public String getDeliveryMode() {
  147 + return deliveryMode;
  148 + }
  149 +
  150 + public void setDeliveryMode(String deliveryMode) {
  151 + this.deliveryMode = deliveryMode;
  152 + }
  153 +
  154 + public String getName() {
  155 + return name;
  156 + }
  157 +
  158 + public void setName(String name) {
  159 + this.name = name;
  160 + }
  161 +
  162 + public Date getBirthday() {
  163 + return birthday;
  164 + }
  165 +
  166 + public void setBirthday(Date birthday) {
  167 + this.birthday = birthday;
  168 + }
  169 +
  170 + public String getCardNo() {
  171 + return cardNo;
  172 + }
  173 +
  174 + public void setCardNo(String cardNo) {
  175 + this.cardNo = cardNo;
  176 + }
  177 +
  178 + public String getVcCardNo() {
  179 + return vcCardNo;
  180 + }
  181 +
  182 + public void setVcCardNo(String vcCardNo) {
  183 + this.vcCardNo = vcCardNo;
  184 + }
  185 +
  186 + public String getDueWeek() {
  187 + return dueWeek;
  188 + }
  189 +
  190 + public void setDueWeek(String dueWeek) {
  191 + this.dueWeek = dueWeek;
  192 + }
  193 +
  194 + public Integer getTireNumber() {
  195 + return tireNumber;
  196 + }
  197 +
  198 + public void setTireNumber(Integer tireNumber) {
  199 + this.tireNumber = tireNumber;
  200 + }
  201 +
  202 + public String getFmHospital() {
  203 + return fmHospital;
  204 + }
  205 +
  206 + public void setFmHospital(String fmHospital) {
  207 + this.fmHospital = fmHospital;
  208 + }
  209 +
  210 + public Integer getLiveNum() {
  211 + return liveNum;
  212 + }
  213 +
  214 + public void setLiveNum(Integer liveNum) {
  215 + this.liveNum = liveNum;
  216 + }
  217 +
  218 + public String getPhone() {
  219 + return phone;
  220 + }
  221 +
  222 + public void setPhone(String phone) {
  223 + this.phone = phone;
  224 + }
  225 +}
platform-dal/src/main/java/com/lyms/platform/query/PostReviewStatusQuery.java View file @ b6b7b06
  1 +package com.lyms.platform.query;
  2 +
  3 +import com.lyms.platform.common.base.IConvertToNativeQuery;
  4 +import com.lyms.platform.common.dao.BaseQuery;
  5 +import com.lyms.platform.common.dao.operator.MongoCondition;
  6 +import com.lyms.platform.common.dao.operator.MongoOper;
  7 +import com.lyms.platform.common.dao.operator.MongoQuery;
  8 +import com.lyms.platform.common.utils.StringUtils;
  9 +import org.springframework.data.mongodb.core.query.Criteria;
  10 +
  11 +import java.util.Date;
  12 +
  13 +/**
  14 + * Created by Administrator on 2019-10-14.
  15 + */
  16 +public class PostReviewStatusQuery extends BaseQuery implements IConvertToNativeQuery {
  17 + private String id;
  18 + //产妇档案id
  19 + private String parentId;
  20 + private String pid;
  21 + private Integer yn;
  22 +
  23 + private String hospitalId;
  24 +
  25 + //分娩日期
  26 + private Date fmDateStart;
  27 + private Date fmDateEnd;
  28 + //分娩方式
  29 + private String deliveryMode;
  30 +
  31 + //分娩医院
  32 + private String fmHospital;
  33 + //1 未复查 2 已复查
  34 + private Integer status;
  35 + private String queryNo;
  36 +
  37 + //分娩记录id
  38 + private String deliverId;
  39 +
  40 + @Override
  41 + public MongoQuery convertToQuery() {
  42 + MongoCondition condition = MongoCondition.newInstance();
  43 +
  44 + if (null != id) {
  45 + condition = condition.and("id", id, MongoOper.IS);
  46 + }
  47 +
  48 + if (null != hospitalId) {
  49 + condition = condition.and("hospitalId", hospitalId, MongoOper.IS);
  50 + }
  51 + if (null != deliverId) {
  52 + condition = condition.and("deliverId", deliverId, MongoOper.IS);
  53 + }
  54 +
  55 + if (null != fmHospital) {
  56 + condition = condition.and("fmHospital", fmHospital, MongoOper.IS);
  57 + }
  58 + if (null != status) {
  59 + condition = condition.and("status", status, MongoOper.IS);
  60 + }
  61 + if (null != parentId) {
  62 + condition = condition.and("parentId", parentId, MongoOper.IS);
  63 + }
  64 + if (null != pid) {
  65 + condition = condition.and("pid", pid, MongoOper.IS);
  66 + }
  67 + if (null != deliveryMode) {
  68 + condition = condition.and("deliveryMode", deliveryMode, MongoOper.IS);
  69 + }
  70 +
  71 +
  72 + Criteria c = null;
  73 +
  74 + if (StringUtils.isNotEmpty(queryNo)) {
  75 + MongoCondition c1 = MongoCondition.newInstance();
  76 + MongoCondition con1 = MongoCondition.newInstance("phone", queryNo, MongoOper.IS);
  77 + MongoCondition con2 = MongoCondition.newInstance("username", "^" + queryNo, MongoOper.LIKE);
  78 + MongoCondition con3 = MongoCondition.newInstance("cardNo", queryNo, MongoOper.IS);
  79 + MongoCondition con5 = MongoCondition.newInstance("vcCardNo", queryNo, MongoOper.IS);
  80 + if (c != null) {
  81 + c = c.andOperator(c1.orCondition(new MongoCondition[]{con1, con2, con3, con5}).getCriteria());
  82 + } else {
  83 + c = c1.orCondition(new MongoCondition[]{con1, con2, con3, con5}).getCriteria();
  84 + }
  85 + }
  86 +
  87 + if (null != fmDateStart && fmDateEnd != null) {
  88 + if (null != c) {
  89 + c = c.where("fmDate").gte(fmDateStart).lte(fmDateEnd);
  90 + } else {
  91 + c = Criteria.where("fmDate").gte(fmDateStart).lte(fmDateEnd);
  92 + }
  93 + }
  94 +
  95 + if (null != c) {
  96 + condition = condition.andCondition(new MongoCondition(c));
  97 + }
  98 + return condition.toMongoQuery();
  99 + }
  100 +
  101 + public String getDeliverId() {
  102 + return deliverId;
  103 + }
  104 +
  105 + public void setDeliverId(String deliverId) {
  106 + this.deliverId = deliverId;
  107 + }
  108 +
  109 + public String getId() {
  110 + return id;
  111 + }
  112 +
  113 + public void setId(String id) {
  114 + this.id = id;
  115 + }
  116 +
  117 + public String getParentId() {
  118 + return parentId;
  119 + }
  120 +
  121 + public void setParentId(String parentId) {
  122 + this.parentId = parentId;
  123 + }
  124 +
  125 + public String getPid() {
  126 + return pid;
  127 + }
  128 +
  129 + public void setPid(String pid) {
  130 + this.pid = pid;
  131 + }
  132 +
  133 + public Integer getYn() {
  134 + return yn;
  135 + }
  136 +
  137 + public void setYn(Integer yn) {
  138 + this.yn = yn;
  139 + }
  140 +
  141 + public String getHospitalId() {
  142 + return hospitalId;
  143 + }
  144 +
  145 + public void setHospitalId(String hospitalId) {
  146 + this.hospitalId = hospitalId;
  147 + }
  148 +
  149 + public Date getFmDateStart() {
  150 + return fmDateStart;
  151 + }
  152 +
  153 + public void setFmDateStart(Date fmDateStart) {
  154 + this.fmDateStart = fmDateStart;
  155 + }
  156 +
  157 + public Date getFmDateEnd() {
  158 + return fmDateEnd;
  159 + }
  160 +
  161 + public void setFmDateEnd(Date fmDateEnd) {
  162 + this.fmDateEnd = fmDateEnd;
  163 + }
  164 +
  165 + public String getDeliveryMode() {
  166 + return deliveryMode;
  167 + }
  168 +
  169 + public void setDeliveryMode(String deliveryMode) {
  170 + this.deliveryMode = deliveryMode;
  171 + }
  172 +
  173 + public String getFmHospital() {
  174 + return fmHospital;
  175 + }
  176 +
  177 + public void setFmHospital(String fmHospital) {
  178 + this.fmHospital = fmHospital;
  179 + }
  180 +
  181 + public Integer getStatus() {
  182 + return status;
  183 + }
  184 +
  185 + public void setStatus(Integer status) {
  186 + this.status = status;
  187 + }
  188 +
  189 + public String getQueryNo() {
  190 + return queryNo;
  191 + }
  192 +
  193 + public void setQueryNo(String queryNo) {
  194 + this.queryNo = queryNo;
  195 + }
  196 +}
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PostReviewController.java View file @ b6b7b06
... ... @@ -130,7 +130,7 @@
130 130 return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("id不能为空.");
131 131 }
132 132 LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
133   - return postReviewFacade.updateOnePost(id,loginState.getId());
  133 + return postReviewFacade.updateOnePost(id, loginState.getId());
134 134 }
135 135  
136 136 /**
... ... @@ -149,7 +149,7 @@
149 149 public BaseObjectResponse postpartumReview(Date startDate, Date endDate, String doctorId,
150 150 Integer startDay, Integer endDay, String zyList, String jcxList,
151 151 String key, Integer page, Integer limit, HttpServletRequest request) {
152   - return postReviewService.postpartumReview(getUserId(request), startDate, endDate, doctorId, key, page, limit, startDay, endDay,zyList,jcxList);
  152 + return postReviewService.postpartumReview(getUserId(request), startDate, endDate, doctorId, key, page, limit, startDay, endDay, zyList, jcxList);
153 153 }
154 154  
155 155 /**
... ... @@ -166,6 +166,39 @@
166 166 Integer startDay, Integer endDay,
167 167 String key, HttpServletRequest request, HttpServletResponse response) {
168 168 postReviewService.postpartumReviewExport(getUserId(request), startDate, endDate, doctorId, key, response,startDay, endDay);
  169 + }
  170 +
  171 +
  172 + /**
  173 + * 获取产后复查状态
  174 + * @param fmDate
  175 + * @param deliveryMode
  176 + * @param queryNo
  177 + * @param request
  178 + */
  179 + @RequestMapping(method = RequestMethod.GET, value = "/getPostReviewStatusList")
  180 + @TokenRequired
  181 + public BaseResponse getPostReviewStatusList(String fmDate, String deliveryMode,
  182 + String queryNo,
  183 + Integer page,
  184 + Integer limit,
  185 + HttpServletRequest request) {
  186 + return postReviewFacade.getPostReviewStatusList(getUserId(request), fmDate, deliveryMode, queryNo,page,limit);
  187 + }
  188 +
  189 +
  190 + /**
  191 + * 设置产后复查状态
  192 + * @param id
  193 + * @param status
  194 + * @param request
  195 + */
  196 + @RequestMapping(method = RequestMethod.GET, value = "/setPostReviewStatus")
  197 + @TokenRequired
  198 + public BaseResponse setPostReviewStatus(String id,
  199 + Integer status,
  200 + HttpServletRequest request) {
  201 + return postReviewFacade.setPostReviewStatus( id, status);
169 202 }
170 203 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java View file @ b6b7b06
... ... @@ -322,6 +322,13 @@
322 322 }
323 323  
324 324  
  325 + @ResponseBody
  326 + @RequestMapping("/setPostReviewRecord")
  327 + public void initBloodPressure() {
  328 + patientsService.setPostReviewRecord();
  329 + }
  330 +
  331 +
325 332 @RequestMapping("/area")
326 333 @ResponseBody
327 334 public Object getArea() {
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PostReviewFacade.java View file @ b6b7b06
... ... @@ -41,7 +41,11 @@
41 41  
42 42 @Autowired
43 43 private PostReviewService postReviewService;
  44 +
44 45 @Autowired
  46 + private PostReviewStatusService postReviewStatusService;
  47 +
  48 + @Autowired
45 49 private PatientsService patientsService;
46 50 @Autowired
47 51 private MatDeliverService matDeliverService;
... ... @@ -529,6 +533,77 @@
529 533 patientsService.setAutoMatDeliver(patients.getCardNo(),DateUtil.parseYMD(postReviewRequest.getDueDate()));
530 534 }
531 535  
  536 + return new BaseResponse().setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS);
  537 + }
  538 +
  539 + public BaseResponse getPostReviewStatusList(Integer userId,
  540 + String fmDate,
  541 + String deliveryMode, String queryNo,
  542 + Integer page,Integer limit) {
  543 + String hospitalId = autoMatchFacade.getHospitalId(userId);
  544 +
  545 + PostReviewStatusQuery postReviewStatusQuery = new PostReviewStatusQuery();
  546 + postReviewStatusQuery.setQueryNo(queryNo);
  547 + postReviewStatusQuery.setLimit(limit);
  548 + postReviewStatusQuery.setPage(page);
  549 + postReviewStatusQuery.setFmHospital(hospitalId);
  550 + postReviewStatusQuery.setDeliveryMode(deliveryMode);
  551 +
  552 + if (StringUtils.isNotEmpty(fmDate))
  553 + {
  554 + String[] arrs = fmDate.split(" - ");
  555 + postReviewStatusQuery.setFmDateStart(DateUtil.parseYYYYMMDD(arrs[0]));
  556 + postReviewStatusQuery.setFmDateEnd(DateUtil.parseYYYYMMDD(arrs[1]));
  557 + }
  558 +
  559 + List<Map> datas = new ArrayList<>();
  560 +
  561 + List<PostReviewStatusModel> postReviewStatusModels = postReviewStatusService.queryPostReviewStatus(postReviewStatusQuery);
  562 + if (CollectionUtils.isNotEmpty(postReviewStatusModels))
  563 + {
  564 + for(PostReviewStatusModel model : postReviewStatusModels)
  565 + {
  566 + Map data = new HashMap();
  567 + data.put("id",model.getId());
  568 + data.put("fmDate",DateUtil.getyyyy_MM_dd(model.getFmDate()));
  569 + data.put("name",model.getName());
  570 + data.put("age",DateUtil.getAge(model.getBirthday(), model.getFmDate()));
  571 + data.put("cardNo",model.getCardNo());
  572 + data.put("dueWeek",model.getDueWeek());
  573 + data.put("deliveryMode", FmTypeEnums.getFmNameById(model.getDeliveryMode()));
  574 + data.put("chDays",DateUtil.getDays(model.getFmDate(), new Date()));
  575 + data.put("tireNumber",model.getTireNumber());
  576 +
  577 + data.put("liveNum",model.getLiveNum());
  578 + String fmDoctor = "";
  579 + try {
  580 + fmDoctor = usersService.getUsers(Integer.parseInt(model.getFmDoctor())).getName();
  581 + }catch (Exception e)
  582 + {
  583 + fmDoctor = model.getFmDoctor();
  584 + }
  585 +
  586 + data.put("fmDoctor",fmDoctor);
  587 + data.put("phone",model.getPhone());
  588 + data.put("status",model.getPhone());
  589 + datas.add(data);
  590 + }
  591 + }
  592 + return new BaseObjectResponse().setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS).setData(datas);
  593 +
  594 + }
  595 +
  596 + public BaseResponse setPostReviewStatus(String id, Integer status) {
  597 +
  598 + PostReviewStatusQuery postReviewStatusQuery = new PostReviewStatusQuery();
  599 + postReviewStatusQuery.setId(id);
  600 + PostReviewStatusModel postReviewStatusModel = postReviewStatusService.queryOne(postReviewStatusQuery);
  601 + if (postReviewStatusModel != null)
  602 + {
  603 + postReviewStatusModel.setStatus(status);
  604 + postReviewStatusModel.setModified(new Date());
  605 + postReviewStatusService.update(postReviewStatusModel);
  606 + }
532 607 return new BaseResponse().setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS);
533 608 }
534 609 }