Commit b7ead3d57df4c3fe03c38f936c4a1abe6e41426d

Authored by zhangchao
1 parent eb7d0c0853
Exists in dev

#fix:优化分娩时间

Showing 1 changed file with 7 additions and 6 deletions

platform-operate-api/src/main/java/com/lyms/hospitalapi/dtdyrm/DtdyrmFmService.java View file @ b7ead3d
... ... @@ -108,11 +108,12 @@
108 108 } catch (NumberFormatException e) {
109 109 e.printStackTrace();
110 110 }
  111 + Date fmDate= StringUtils.isNotEmpty(allFm.getBaby_DELIVERY_TIME())?fmt.parse(allFm.getBaby_DELIVERY_TIME()):new Date();
111 112 if (CollectionUtils.isNotEmpty(patientses) && patientses.size()>0) {
112 113 patient = patientses.get(0);
113 114 patient.setIsAutoFm(0);
114 115 patient.setFmHospital(HOSPITALID);
115   - patient.setFmDate(new Date());
  116 + patient.setFmDate(fmDate!=null?fmDate:new Date());
116 117 patient.setType(3);
117 118 patient.setBuildType(2);
118 119 patient.setDueStatus(0);
... ... @@ -137,7 +138,7 @@
137 138 patient.setIsAutoFm(0);
138 139 patient.setHospitalId(HOSPITALID);
139 140 patient.setFmHospital(HOSPITALID);
140   - patient.setFmDate(new Date());
  141 + patient.setFmDate(fmDate!=null?fmDate:new Date());
141 142 patient.setCardNo(allFm.getIdcard());
142 143 patient.setYn(1);
143 144 patient.setType(3);
... ... @@ -154,7 +155,6 @@
154 155 patient.setCreated(new Date());
155 156 patient.setModified(new Date());
156 157 patient=patientsService.addPatient(patient);
157   -
158 158 }else {
159 159 System.out.println("no idCardNo in database:"+ allFm.toString());
160 160 continue;
161 161  
162 162  
... ... @@ -163,16 +163,17 @@
163 163  
164 164 if (patient != null && StringUtils.isNotEmpty(patient.getId())) {
165 165 if (CollectionUtils.isNotEmpty(users) && users.get(0).getId() != null) {
166   - if (StringUtils.isNotEmpty(allFm.getBaby_DELIVERY_TIME())) {
  166 + dueDate=fmDate!=null?fmDate:new Date();
  167 + /* if (StringUtils.isNotEmpty(allFm.getBaby_DELIVERY_TIME())) {
167 168 Date dateTime = fmt.parse(allFm.getBaby_DELIVERY_TIME());
168 169 if (dateTime==null) {
169   - continue;
  170 + dueDate=new Date();
170 171 } else {
171 172 dueDate = dateTime;
172 173 }
173 174 } else {
174 175 continue;
175   - }
  176 + }*/
176 177  
177 178 Map <String, Map <String, String>> map = new HashMap <>();
178 179 Map <String, String> map1 = new HashMap <>();