Commit a4fbef9792bb20265bf4e8ed8c4daea90b451950
1 parent
de2327b1b6
Exists in
master
and in
1 other branch
修改风险因素
Showing 1 changed file with 27 additions and 16 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/DischargeAbstractFacade.java
View file @
a4fbef9
... | ... | @@ -3,15 +3,13 @@ |
3 | 3 | import com.lyms.platform.biz.service.*; |
4 | 4 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
5 | 5 | import com.lyms.platform.common.enums.RenShenJieJuEnums; |
6 | +import com.lyms.platform.common.enums.RiskDefaultTypeEnum; | |
6 | 7 | import com.lyms.platform.common.enums.YnEnums; |
7 | 8 | import com.lyms.platform.common.utils.BeanUtils; |
8 | 9 | import com.lyms.platform.common.utils.DateUtil; |
9 | 10 | import com.lyms.platform.operate.web.request.DischargeAbstractQueryRequest; |
10 | 11 | import com.lyms.platform.operate.web.request.DischargeAbstractSaveRequest; |
11 | -import com.lyms.platform.operate.web.result.DischargeAbstractBabyQueryModel; | |
12 | -import com.lyms.platform.operate.web.result.DischargeAbstractMotherQueryModel; | |
13 | -import com.lyms.platform.operate.web.result.DischargeAbstractQueryResult; | |
14 | -import com.lyms.platform.operate.web.result.DischargeAbstractSaveResult; | |
12 | +import com.lyms.platform.operate.web.result.*; | |
15 | 13 | import com.lyms.platform.pojo.DischargeAbstractBabyModel; |
16 | 14 | import com.lyms.platform.pojo.DischargeAbstractMotherModel; |
17 | 15 | import com.lyms.platform.pojo.Patients; |
... | ... | @@ -119,7 +117,8 @@ |
119 | 117 | dischargeAbstractQueryResult.setUserName(patients.getUsername()); |
120 | 118 | dischargeAbstractQueryResult.setAge(DateUtil.getAge(patients.getBirth(), new Date())); |
121 | 119 | dischargeAbstractQueryResult.setFmDate(DateUtil.getyyyy_MM_dd(patients.getFmDate())); |
122 | - dischargeAbstractQueryResult.setRiskFactor(getRiskFactor(patients.getRiskFactorId())); | |
120 | + List<RiskFactoryResultModel> riskFactoryResultModelList = getRiskFactory(patients.getRiskFactorId()); | |
121 | + dischargeAbstractQueryResult.setRiskFactoryResultModelList(riskFactoryResultModelList); | |
123 | 122 | dischargeAbstractQueryResult.setGestationalWeeks(PredictedStatisticsFacade.getGestationalWeeks(patients.getLastMenses(), patients.getType(), patients.getDueStatus())); |
124 | 123 | dischargeAbstractQueryResult.setDueDate(new SimpleDateFormat("yyyy年MM月dd日").format(patients.getDueDate())); |
125 | 124 | |
126 | 125 | |
127 | 126 | |
128 | 127 | |
... | ... | @@ -173,22 +172,34 @@ |
173 | 172 | return dischargeAbstractQueryResult; |
174 | 173 | } |
175 | 174 | |
176 | - private String getRiskFactor(List<String> list) { | |
177 | - String riskFactor = ""; | |
178 | - if (list != null && list.size() > 0) { | |
179 | - for (String s : list) { | |
175 | + private List<RiskFactoryResultModel> getRiskFactory(List<String> riskFactorIdList) { | |
176 | + | |
177 | + List<RiskFactoryResultModel> riskFactoryResultModelList = new ArrayList<>(); | |
178 | + | |
179 | + if (riskFactorIdList != null && riskFactorIdList.size() > 0) { | |
180 | + for (String riskFactoryId : riskFactorIdList) { | |
181 | + RiskFactoryResultModel riskFactoryResultModel = new RiskFactoryResultModel(); | |
180 | 182 | try { |
181 | - riskFactor += basicConfigService.getOneBasicConfigById(s).getName(); | |
182 | - riskFactor += ","; | |
183 | + String name = basicConfigService.getOneBasicConfigById(riskFactoryId).getName(); | |
184 | + boolean flag = true; | |
185 | + if (riskFactoryResultModelList.size() > 0) { | |
186 | + for (RiskFactoryResultModel factoryResultModel : riskFactoryResultModelList) { | |
187 | + if (factoryResultModel.getName().equals(name)) { | |
188 | + flag = false; | |
189 | + } | |
190 | + } | |
191 | + } | |
192 | + if (flag) { | |
193 | + riskFactoryResultModel.setName(name); | |
194 | + riskFactoryResultModel.setColor("risk_" + RiskDefaultTypeEnum.getColor(name)); | |
195 | + riskFactoryResultModelList.add(riskFactoryResultModel); | |
196 | + } | |
183 | 197 | } catch (Exception e) { |
184 | - riskFactor += ""; | |
198 | + // 什么都不干 | |
185 | 199 | } |
186 | 200 | } |
187 | 201 | } |
188 | - if (riskFactor.length() > 0) { | |
189 | - return riskFactor.substring(0, riskFactor.length() - 1); | |
190 | - } | |
191 | - return riskFactor; | |
202 | + return riskFactoryResultModelList; | |
192 | 203 | } |
193 | 204 | |
194 | 205 | } |