Commit ae092c4d81397cc12192c6e340f071b4472d8f12

Authored by jiangjiazhi
1 parent 4bac2f20a0

孕妇分娩后 变成产妇

Showing 1 changed file with 47 additions and 29 deletions

platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/PatientsService.java View file @ ae092c4
... ... @@ -11,11 +11,9 @@
11 11 import com.lyms.platform.common.utils.LogUtil;
12 12 import com.lyms.platform.pojo.AntenatalExaminationModel;
13 13 import com.lyms.platform.pojo.Patients;
14   -import com.lyms.platform.pojo.SieveApplyOrderModel;
15 14 import com.lyms.platform.pojo.SieveModel;
16 15 import com.lyms.platform.query.AntExQuery;
17 16 import com.lyms.platform.query.PatientsQuery;
18   -import com.lyms.platform.query.SieveApplyOrderQuery;
19 17 import com.lyms.platform.query.SieveQuery;
20 18 import org.apache.commons.collections.CollectionUtils;
21 19 import org.apache.commons.lang.StringUtils;
... ... @@ -24,7 +22,6 @@
24 22 import org.springframework.data.domain.Sort;
25 23 import org.springframework.stereotype.Service;
26 24  
27   -import java.util.ArrayList;
28 25 import java.util.Date;
29 26 import java.util.List;
30 27  
31 28  
... ... @@ -121,32 +118,53 @@
121 118 }
122 119 }
123 120 /**
124   - SieveApplyOrderQuery sieveApplyOrderQuery = new SieveApplyOrderQuery();
125   - sieveApplyOrderQuery.setStatus(0);
126   - sieveApplyOrderQuery.setYn(YnEnums.YES.getId());
127   - //查询转诊申请单
128   - List<SieveApplyOrderModel> list = iSieveApplyOrderDao.queryList(sieveApplyOrderQuery.convertToQuery());
129   - if (CollectionUtils.isNotEmpty(list)) {
130   - List<String> idList = new ArrayList<>();
131   - for (SieveApplyOrderModel orderModel : list) {
132   - if (null != orderModel.getParentId()) {
133   - Patients patients = iPatientDao.getPatient(orderModel.getParentId());
134   - if (null != patients) {
135   - SieveModel sieveModel = convertToModel(patients);
136   - sieveDao.addChanQianSieve(sieveModel);
137   - }
138   - idList.add(orderModel.getId());
  121 + SieveApplyOrderQuery sieveApplyOrderQuery = new SieveApplyOrderQuery();
  122 + sieveApplyOrderQuery.setStatus(0);
  123 + sieveApplyOrderQuery.setYn(YnEnums.YES.getId());
  124 + //查询转诊申请单
  125 + List<SieveApplyOrderModel> list = iSieveApplyOrderDao.queryList(sieveApplyOrderQuery.convertToQuery());
  126 + if (CollectionUtils.isNotEmpty(list)) {
  127 + List<String> idList = new ArrayList<>();
  128 + for (SieveApplyOrderModel orderModel : list) {
  129 + if (null != orderModel.getParentId()) {
  130 + Patients patients = iPatientDao.getPatient(orderModel.getParentId());
  131 + if (null != patients) {
  132 + SieveModel sieveModel = convertToModel(patients);
  133 + sieveDao.addChanQianSieve(sieveModel);
  134 + }
  135 + idList.add(orderModel.getId());
  136 + }
  137 + }
  138 + SieveApplyOrderModel sieveApplyOrderModel = new SieveApplyOrderModel();
  139 + sieveApplyOrderModel.setStatus(1);
  140 + for (String str : idList) {
  141 + sieveApplyOrderModel.setId(str);
  142 + sieveApplyOrderModel.setModified(new Date());
  143 + sieveApplyOrderModel.setStatus(1);
  144 + iSieveApplyOrderDao.updateSieve(sieveApplyOrderModel);
  145 + }
  146 + }**/
  147 + }
  148 +
  149 + /**
  150 + * 孕妇建档时调用的方法
  151 + *
  152 + * @param patients
  153 + */
  154 + public void validata(Patients patients) {
  155 + if (null != patients && null != patients.getLastMenses()) {
  156 + int days = DateUtil.daysBetween(patients.getLastMenses(), new Date());
  157 + if (days >= 108 && days <= 146) {
  158 + SieveQuery sieveQuery = new SieveQuery();
  159 + sieveQuery.setYn(YnEnums.YES.getId());
  160 + sieveQuery.setParentId(patients.getId());
  161 + List<SieveModel> list = sieveDao.queryList(sieveQuery.convertToQuery());
  162 + if (CollectionUtils.isEmpty(list)) {
  163 + SieveModel sieveModel = convertToModel(patients);
  164 + sieveDao.addChanQianSieve(sieveModel);
139 165 }
140 166 }
141   - SieveApplyOrderModel sieveApplyOrderModel = new SieveApplyOrderModel();
142   - sieveApplyOrderModel.setStatus(1);
143   - for (String str : idList) {
144   - sieveApplyOrderModel.setId(str);
145   - sieveApplyOrderModel.setModified(new Date());
146   - sieveApplyOrderModel.setStatus(1);
147   - iSieveApplyOrderDao.updateSieve(sieveApplyOrderModel);
148   - }
149   - }**/
  167 + }
150 168 }
151 169  
152 170 public SieveModel convertToModel(Patients patients) {
153 171  
... ... @@ -175,11 +193,11 @@
175 193 }
176 194  
177 195 public Patients findLastBuildRecord(String pid, int yn) {
178   - return iPatientDao.findLastBuildRecord(pid,yn);
  196 + return iPatientDao.findLastBuildRecord(pid, yn);
179 197 }
180 198  
181 199 public void updatePatientByPid(Patients patientUpdate, String pid) {
182   - iPatientDao.updatePatientByPid(patientUpdate,pid);
  200 + iPatientDao.updatePatientByPid(patientUpdate, pid);
183 201 }
184 202  
185 203 private class PatientWorker extends Thread {