Commit 9ab692cac8db00b27013fc9757079d3ebacf4273
1 parent
7657f371da
Exists in
master
and in
1 other branch
修改高分评分默认为String
Showing 1 changed file with 14 additions and 6 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PredictedStatisticsFacade.java
View file @
9ab692c
... | ... | @@ -20,13 +20,14 @@ |
20 | 20 | import net.sf.json.JSONArray; |
21 | 21 | import org.springframework.beans.factory.annotation.Autowired; |
22 | 22 | import org.springframework.stereotype.Component; |
23 | -import org.springframework.util.StringUtils; | |
24 | 23 | |
25 | 24 | import java.text.SimpleDateFormat; |
26 | 25 | import java.util.ArrayList; |
27 | 26 | import java.util.Date; |
28 | 27 | import java.util.List; |
29 | 28 | |
29 | +import static org.springframework.util.StringUtils.isEmpty; | |
30 | + | |
30 | 31 | /** |
31 | 32 | * @auther HuJiaqi |
32 | 33 | * @createTime 2016年11月28日 11时36分 |
... | ... | @@ -54,7 +55,7 @@ |
54 | 55 | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM"); |
55 | 56 | String ym = predictedStatisticsRequest.getDate(); |
56 | 57 | Date date; |
57 | - if (!StringUtils.isEmpty(ym)) { | |
58 | + if (!isEmpty(ym)) { | |
58 | 59 | try { |
59 | 60 | date = simpleDateFormat.parse(predictedStatisticsRequest.getDate()); |
60 | 61 | } catch (Exception e) { |
... | ... | @@ -76,7 +77,7 @@ |
76 | 77 | patientsQuery.setTypeList(typeList); |
77 | 78 | patientsQuery.setSort("dueDate"); |
78 | 79 | String doctorId = predictedStatisticsRequest.getDoctorId(); |
79 | - if (!StringUtils.isEmpty(doctorId)) { | |
80 | + if (!isEmpty(doctorId)) { | |
80 | 81 | patientsQuery.setLastCheckEmployeeId(doctorId); |
81 | 82 | } |
82 | 83 | patientsQuery.setBuildTypeNot(1); |
... | ... | @@ -94,7 +95,7 @@ |
94 | 95 | predictedStatisticsQueryModel.setRiskFactor(getRiskFactor(patients.getRiskFactorId())); |
95 | 96 | predictedStatisticsQueryModel.setLastCheckEmployee(getLastCheckEmployee(patients.getLastCheckEmployeeId())); |
96 | 97 | predictedStatisticsQueryModel.setGestationalWeeks(getGestationalWeeks(patients.getLastMenses(), patients.getType(), patients.getDueStatus())); |
97 | - predictedStatisticsQueryModel.setRiskScore(StringUtils.isEmpty(patients.getRiskScore()) ? null : patients.getRiskScore().toString()); | |
98 | + predictedStatisticsQueryModel.setRiskScore(getRiskScore(patients.getRiskScore())); | |
98 | 99 | predictedStatisticsQueryModelList.add(predictedStatisticsQueryModel); |
99 | 100 | } |
100 | 101 | } |
... | ... | @@ -122,7 +123,7 @@ |
122 | 123 | patientsQuery.setTypeList(typeList); |
123 | 124 | patientsQuery.setHospitalId(autoMatchFacade.getHospitalId(predictedStatisticsRequest.getOperatorId())); |
124 | 125 | String doctorId = predictedStatisticsRequest.getDoctorId(); |
125 | - if (!StringUtils.isEmpty(doctorId)) { | |
126 | + if (!isEmpty(doctorId)) { | |
126 | 127 | patientsQuery.setLastCheckEmployeeId(doctorId); |
127 | 128 | } |
128 | 129 | patientsQuery.setBuildTypeNot(1); |
... | ... | @@ -248,7 +249,6 @@ |
248 | 249 | return riskFactor; |
249 | 250 | } |
250 | 251 | |
251 | - | |
252 | 252 | private String getLastCheckEmployee(String str) { |
253 | 253 | try { |
254 | 254 | return usersService.getUsers(Integer.valueOf(str)).getName(); |
... | ... | @@ -256,5 +256,13 @@ |
256 | 256 | return ""; |
257 | 257 | } |
258 | 258 | } |
259 | + | |
260 | + private String getRiskScore(Integer in) { | |
261 | + if (in == null || in == 0) { | |
262 | + return ""; | |
263 | + } | |
264 | + return in.toString(); | |
265 | + } | |
266 | + | |
259 | 267 | } |