Commit 0ce1b0f60975b10dff59f1b90f2d58ca1d7f641e
1 parent
61e56408b3
Exists in
master
and in
3 other branches
增加新生儿访视的时间判断
Showing 2 changed files with 12 additions and 2 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/VisitFacade.java
View file @
0ce1b0f
| ... | ... | @@ -240,6 +240,15 @@ |
| 240 | 240 | public BaseResponse addOrUpdateBabyAndVisit(BabyVisitAddRequest babyVisitAddRequest) { |
| 241 | 241 | |
| 242 | 242 | String babyId = babyVisitAddRequest.getParentId(); |
| 243 | + String currentTime = babyVisitAddRequest.getCurrentVisit(); | |
| 244 | + if (StringUtils.isNotEmpty(currentTime)&&StringUtils.isNotEmpty(babyVisitAddRequest.getBirth())) { | |
| 245 | + Date currentVisit = DateUtil.parseYMD(babyVisitAddRequest.getCurrentVisit()); | |
| 246 | + Date birth = DateUtil.parseYMD(babyVisitAddRequest.getBirth()); | |
| 247 | + boolean f = currentVisit.before(birth); | |
| 248 | + if (f) { | |
| 249 | + return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("检查时间必须大于小孩出生时间"); | |
| 250 | + } | |
| 251 | + } | |
| 243 | 252 | // 访视记录id为空表示新增 |
| 244 | 253 | BabyVisitModel babyVisitModel = babyVisitAddRequest.convertToDataModel(); |
| 245 | 254 | //表示需要新增小孩的数据 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/BabyVisitAddRequest.java
View file @
0ce1b0f
| ... | ... | @@ -9,6 +9,7 @@ |
| 9 | 9 | import com.lyms.platform.pojo.BabyVisitModel; |
| 10 | 10 | import com.lyms.platform.pojo.Patients; |
| 11 | 11 | import org.apache.commons.lang.StringUtils; |
| 12 | +import org.hibernate.validator.constraints.NotEmpty; | |
| 12 | 13 | |
| 13 | 14 | import java.util.Map; |
| 14 | 15 | |
| ... | ... | @@ -66,7 +67,7 @@ |
| 66 | 67 | |
| 67 | 68 | // 性别 |
| 68 | 69 | private int sex; |
| 69 | - | |
| 70 | + @NotEmpty(message = "生日不能为空") | |
| 70 | 71 | // 生日 |
| 71 | 72 | private String birth; |
| 72 | 73 | |
| ... | ... | @@ -203,7 +204,7 @@ |
| 203 | 204 | |
| 204 | 205 | // 指导 |
| 205 | 206 | private Map guide; |
| 206 | - | |
| 207 | + @NotEmpty(message = "本次访视时间不能为空") | |
| 207 | 208 | // 本次访视时间 |
| 208 | 209 | private String currentVisit; |
| 209 | 210 |