Commit 79b97463b8dfecebca4b27f92c6711d7690b7737

Authored by wtt
1 parent da28c10a26

住院管床大夫gcdfDoctorId增加入参校验

Showing 2 changed files with 12 additions and 4 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java View file @ 79b9746
... ... @@ -3627,11 +3627,17 @@
3627 3627 Map <String, Object> map = new HashMap <>();
3628 3628 map.put("id", data.getId());
3629 3629 if (StringUtils.isNotEmpty(data.getGcdfDoctorId())) {
3630   - Users users = usersService.getUsers(Integer.valueOf(data.getGcdfDoctorId()));
3631   - Map<String, String> map1 = new HashMap<>();
3632   - if (null != users) {
3633   - map.put("gcdfDoctorId", users.getName());
  3630 +
  3631 + try {
  3632 + Users users = usersService.getUsers(Integer.valueOf(data.getGcdfDoctorId()));
  3633 + Map<String, String> map1 = new HashMap<>();
  3634 + if (null != users) {
  3635 + map.put("gcdfDoctorId", users.getName());
  3636 + }
  3637 + } catch (NumberFormatException e) {
  3638 + e.printStackTrace();
3634 3639 }
  3640 +
3635 3641 }
3636 3642 if (StringUtils.isNotEmpty( data.getGcdfDoctorId())) {
3637 3643 Users users = usersService.getUsers(Integer.valueOf( data.getGcdfDoctorId()));
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/MatDeliverAddRequest.java View file @ 79b9746
... ... @@ -16,6 +16,7 @@
16 16 import org.springframework.data.mongodb.core.convert.MappingMongoConverter;
17 17 import org.springframework.data.mongodb.core.mapping.MongoMappingContext;
18 18  
  19 +import javax.validation.constraints.Pattern;
19 20 import java.io.Serializable;
20 21 import java.util.Date;
21 22 import java.util.HashMap;
... ... @@ -31,6 +32,7 @@
31 32  
32 33 private String id;
33 34 //分娩记录加住院管床大夫
  35 + @Pattern(regexp = ("[0-9]*"),message = "请传入id")
34 36 private String gcdfDoctorId;
35 37 /**
36 38 * 新加字段