Commit 3388a03f394c926eb2f6e801446753e3cd5ea01f
1 parent
f25e5fd69e
Exists in
master
and in
6 other branches
修复bug
Showing 4 changed files with 50 additions and 14 deletions
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyEvaluationCriterionController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/EvaluationCriterionNeuropsychologyListRequest.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/ExerciseAppraisalListRequest.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BabyEvaluationCriterionServiceImpl.java
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyEvaluationCriterionController.java
View file @
3388a03
... | ... | @@ -14,6 +14,7 @@ |
14 | 14 | import org.springframework.web.bind.annotation.ResponseBody; |
15 | 15 | |
16 | 16 | import javax.servlet.http.HttpServletRequest; |
17 | +import javax.validation.Valid; | |
17 | 18 | |
18 | 19 | /** |
19 | 20 | * 儿童量表 |
... | ... | @@ -80,7 +81,7 @@ |
80 | 81 | @ResponseBody |
81 | 82 | @TokenRequired |
82 | 83 | @RequestMapping(method = RequestMethod.POST, value = "/list") |
83 | - private BaseResponse neuropsychologylList(@RequestBody EvaluationCriterionNeuropsychologyListRequest param, HttpServletRequest request) { | |
84 | + private BaseResponse neuropsychologylList(@RequestBody @Valid EvaluationCriterionNeuropsychologyListRequest param, HttpServletRequest request) { | |
84 | 85 | return babyEvaluationCriterionService.neuropsychologylList(getUserId(request), param); |
85 | 86 | } |
86 | 87 | |
... | ... | @@ -184,7 +185,7 @@ |
184 | 185 | @ResponseBody |
185 | 186 | @TokenRequired |
186 | 187 | @RequestMapping(method = RequestMethod.POST, value = "/exerciseAppraisal/list") |
187 | - private BaseResponse exerciseAppraisalList(@RequestBody ExerciseAppraisalListRequest param, HttpServletRequest request) { | |
188 | + private BaseResponse exerciseAppraisalList(@RequestBody @Valid ExerciseAppraisalListRequest param, HttpServletRequest request) { | |
188 | 189 | return babyEvaluationCriterionService.exerciseAppraisalList(getUserId(request), param); |
189 | 190 | } |
190 | 191 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/EvaluationCriterionNeuropsychologyListRequest.java
View file @
3388a03
... | ... | @@ -2,6 +2,10 @@ |
2 | 2 | |
3 | 3 | import com.lyms.platform.common.dao.BaseQuery; |
4 | 4 | |
5 | +import javax.validation.constraints.Max; | |
6 | +import javax.validation.constraints.Min; | |
7 | +import javax.validation.constraints.Pattern; | |
8 | +import javax.validation.constraints.Size; | |
5 | 9 | import java.io.Serializable; |
6 | 10 | |
7 | 11 | /** |
8 | 12 | |
9 | 13 | |
10 | 14 | |
... | ... | @@ -12,17 +16,21 @@ |
12 | 16 | */ |
13 | 17 | public class EvaluationCriterionNeuropsychologyListRequest extends BaseQuery implements Serializable { |
14 | 18 | |
19 | + @Size(max = 24) | |
15 | 20 | private String queryNo; |
16 | 21 | |
17 | - private Integer checkMonth; | |
22 | + @Min(1) @Max(84) | |
23 | + private Integer startCheckMonth; | |
18 | 24 | |
25 | + @Min(1) @Max(84) | |
26 | + private Integer endCheckMonth; | |
27 | + | |
19 | 28 | /** |
20 | 29 | * 优秀\聪明\正常\偏低\低下 |
21 | 30 | */ |
22 | 31 | private String levelName; |
23 | 32 | |
24 | 33 | private String startCheckTime; |
25 | - | |
26 | 34 | private String endCheckTime; |
27 | 35 | |
28 | 36 | private String checkDoctor; |
29 | 37 | |
... | ... | @@ -47,12 +55,20 @@ |
47 | 55 | this.queryNo = queryNo; |
48 | 56 | } |
49 | 57 | |
50 | - public Integer getCheckMonth() { | |
51 | - return checkMonth; | |
58 | + public Integer getStartCheckMonth() { | |
59 | + return startCheckMonth; | |
52 | 60 | } |
53 | 61 | |
54 | - public void setCheckMonth(Integer checkMonth) { | |
55 | - this.checkMonth = checkMonth; | |
62 | + public void setStartCheckMonth(Integer startCheckMonth) { | |
63 | + this.startCheckMonth = startCheckMonth; | |
64 | + } | |
65 | + | |
66 | + public Integer getEndCheckMonth() { | |
67 | + return endCheckMonth; | |
68 | + } | |
69 | + | |
70 | + public void setEndCheckMonth(Integer endCheckMonth) { | |
71 | + this.endCheckMonth = endCheckMonth; | |
56 | 72 | } |
57 | 73 | |
58 | 74 | public String getLevelName() { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/ExerciseAppraisalListRequest.java
View file @
3388a03
... | ... | @@ -3,6 +3,10 @@ |
3 | 3 | import com.lyms.platform.common.dao.BaseQuery; |
4 | 4 | import com.lyms.platform.common.result.BaseResponse; |
5 | 5 | |
6 | +import javax.validation.constraints.DecimalMin; | |
7 | +import javax.validation.constraints.Max; | |
8 | +import javax.validation.constraints.Min; | |
9 | +import javax.validation.constraints.Size; | |
6 | 10 | import java.io.Serializable; |
7 | 11 | |
8 | 12 | /** |
9 | 13 | |
10 | 14 | |
11 | 15 | |
... | ... | @@ -24,13 +28,17 @@ |
24 | 28 | /** |
25 | 29 | * 起止:总分数 |
26 | 30 | */ |
31 | + @Min(0) @Max(9999) | |
27 | 32 | private Integer startScore; |
33 | + @Min(0) @Max(9999) | |
28 | 34 | private Integer endScore; |
29 | 35 | |
30 | 36 | /** |
31 | 37 | * 起止:百分位 |
32 | 38 | */ |
39 | + @Min(0) @Max(99) | |
33 | 40 | private Integer startPercentileScore; |
41 | + @Min(0) @Max(99) | |
34 | 42 | private Integer endPercentileScore; |
35 | 43 | |
36 | 44 | /** |
... | ... | @@ -38,6 +46,7 @@ |
38 | 46 | */ |
39 | 47 | private String checkDoctor; |
40 | 48 | |
49 | + @Size(max = 24) | |
41 | 50 | private String queryNo; |
42 | 51 | |
43 | 52 | public String getQueryNo() { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BabyEvaluationCriterionServiceImpl.java
View file @
3388a03
... | ... | @@ -845,14 +845,20 @@ |
845 | 845 | // 总分 |
846 | 846 | Integer startScore = param.getStartScore(); |
847 | 847 | Integer endScore = param.getEndScore(); |
848 | - if (startScore != null && endScore != null && endScore >= startScore) { | |
848 | + if (startScore != null && endScore != null) { | |
849 | + if (endScore < startScore || startScore < 0) { | |
850 | + return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("参数有误,请重新输入"); | |
851 | + } | |
849 | 852 | query.addCriteria(Criteria.where("totalScore").gte(startScore).lte(endScore)); |
850 | 853 | } |
851 | 854 | |
852 | 855 | // 百分位 |
853 | 856 | Integer startPercentileScore = param.getStartPercentileScore(); |
854 | 857 | Integer endPercentileScore = param.getEndPercentileScore(); |
855 | - if (startPercentileScore != null && endPercentileScore != null && endPercentileScore >= startPercentileScore) { | |
858 | + if (startPercentileScore != null && endPercentileScore != null) { | |
859 | + if (endPercentileScore < startPercentileScore || startPercentileScore < 0) { | |
860 | + return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("参数有误,请重新输入"); | |
861 | + } | |
856 | 862 | query.addCriteria(Criteria.where("percentileScore").gte(startPercentileScore).lte(endPercentileScore)); |
857 | 863 | } |
858 | 864 | |
... | ... | @@ -903,9 +909,10 @@ |
903 | 909 | } |
904 | 910 | |
905 | 911 | // 测量月龄 |
906 | - Integer checkMonth = param.getCheckMonth(); | |
907 | - if (checkMonth != null && checkMonth != 0) { | |
908 | - query.addCriteria(Criteria.where("checkMonth").is(checkMonth)); | |
912 | + Integer startCheckMonth = param.getStartCheckMonth(); | |
913 | + Integer endCheckMonth = param.getEndCheckMonth(); | |
914 | + if (startCheckMonth != null && endCheckMonth != null) { | |
915 | + query.addCriteria(Criteria.where("checkMonth").gte(startCheckMonth).lte(endCheckMonth)); | |
909 | 916 | } |
910 | 917 | |
911 | 918 | // 智能等级 |
912 | 919 | |
... | ... | @@ -940,12 +947,15 @@ |
940 | 947 | for (BabyNeuroPsychologicalModel model : models) { |
941 | 948 | Map<String, String> map = new HashedMap(); |
942 | 949 | map.put("name", model.getName()); |
943 | - map.put("age", model.getGender() == 0 ? "女" : model.getGender() == 1 ? "男" : "未知"); | |
950 | + map.put("sex", model.getGender() == 0 ? "女" : model.getGender() == 1 ? "男" : "未知"); | |
951 | + map.put("age", DateUtil.getBabyMonthAge(model.getBirth(), new Date())); | |
944 | 952 | map.put("birthStr", model.getBirth() != null ? DateUtil.getyyyy_MM_dd(model.getBirth()) : ""); |
945 | 953 | map.put("mcarNo", "1".equals(param.getIsEncrypt()) ? EncryptUtil.numberEncrypt(model.getMcertNo()) : model.getMcertNo()); |
946 | 954 | map.put("mphone", "1".equals(param.getIsEncrypt()) ? EncryptUtil.numberEncrypt(model.getMphone()) : model.getMphone()); |
947 | 955 | map.put("currentMonth", DateUtil.getBabyMonthAge(model.getBirth(), new Date())); |
948 | 956 | map.put("checkMonth", model.getCheckMonth().toString()); |
957 | + map.put("checkTimeStr", DateUtil.getyyyy_MM_dd(model.getCreateTime())); | |
958 | + map.put("score", model.getDevelopmentQuotient().toString()); | |
949 | 959 | map.put("levelName", model.getLevelName()); |
950 | 960 | Users users = usersMapper.getUsers(Integer.parseInt(model.getCreateUser())); |
951 | 961 | map.put("checkDoctorStr",users == null ? "" : users.getName()); |