Commit 2a3d7a8d23ec85579a1974ef4b87caf83f29de41
1 parent
26080a4b31
Exists in
master
and in
3 other branches
增加创建时间
Showing 1 changed file with 13 additions and 2 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/VisitFacade.java
View file @
2a3d7a8
| ... | ... | @@ -27,6 +27,7 @@ |
| 27 | 27 | import org.springframework.stereotype.Component; |
| 28 | 28 | |
| 29 | 29 | import java.util.ArrayList; |
| 30 | +import java.util.Date; | |
| 30 | 31 | import java.util.List; |
| 31 | 32 | |
| 32 | 33 | /** |
| ... | ... | @@ -146,7 +147,10 @@ |
| 146 | 147 | SimpleVisitPuerpera srcModel = visitRequest.new SimpleVisitPuerpera(model); |
| 147 | 148 | // 和数据库里面的对象比较如果不等就表示有修改需存入到数据库中 |
| 148 | 149 | if (!destModel.equals(srcModel)) { |
| 149 | - patientsService.updatePatient(visitRequest.getPatients()/*.build()*/); | |
| 150 | + Patients patients = visitRequest.getPatients(); | |
| 151 | + patients.setCreated(new Date()); | |
| 152 | + patients.setModified(new Date()); | |
| 153 | + patientsService.updatePatient(patients/*.build()*/); | |
| 150 | 154 | } |
| 151 | 155 | } else { |
| 152 | 156 | return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("产妇信息不存在"); |
| ... | ... | @@ -158,6 +162,8 @@ |
| 158 | 162 | patients.setType(3); |
| 159 | 163 | patients.setYn(YnEnums.YES.getId()); |
| 160 | 164 | patients.setId(null); |
| 165 | + patients.setCreated(new Date()); | |
| 166 | + patients.setModified(new Date()); | |
| 161 | 167 | parentId = patientsService.addPatient(patients).getId(); |
| 162 | 168 | } |
| 163 | 169 | |
| 164 | 170 | |
| 165 | 171 | |
| ... | ... | @@ -167,13 +173,18 @@ |
| 167 | 173 | if (StringUtils.isNotBlank(parentId)) { |
| 168 | 174 | visitModel.setParentId(parentId); |
| 169 | 175 | } |
| 176 | + visitModel.setCreated(new Date()); | |
| 177 | + visitModel.setModified(new Date()); | |
| 170 | 178 | visitService.addVisit(visitModel); |
| 171 | 179 | } else { |
| 172 | - visitService.updateVisit(visitRequest.getRequestVisit()); | |
| 180 | + VisitModel visitModel = visitRequest.getRequestVisit(); | |
| 181 | + visitModel.setModified(new Date()); | |
| 182 | + visitService.updateVisit(visitModel); | |
| 173 | 183 | } |
| 174 | 184 | Patients patients = new Patients(); |
| 175 | 185 | patients.setId(parentId); |
| 176 | 186 | patients.setIsVisit(1); |
| 187 | + patients.setModified(new Date()); | |
| 177 | 188 | patientsService.updatePatient(patients); |
| 178 | 189 | return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); |
| 179 | 190 | } |