Commit b223b09a4f976c8c363965f074604517a99a1dc5
1 parent
bf3e565d25
Exists in
dev
#fix:新增小程序营养报告高危因素颜色展示
Showing 1 changed file with 23 additions and 4 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java
View file @
b223b09
... | ... | @@ -24,10 +24,7 @@ |
24 | 24 | import com.lyms.platform.permission.service.PatientServiceService; |
25 | 25 | import com.lyms.platform.permission.service.UsersService; |
26 | 26 | import com.lyms.platform.pojo.*; |
27 | -import com.lyms.platform.query.MatDeliverQuery; | |
28 | -import com.lyms.platform.query.PatientsQuery; | |
29 | -import com.lyms.platform.query.SmsConfigQuery; | |
30 | -import com.lyms.platform.query.SmsTemplateQuery; | |
27 | +import com.lyms.platform.query.*; | |
31 | 28 | import net.sf.json.JSONArray; |
32 | 29 | import net.sf.json.JSONObject; |
33 | 30 | import org.apache.commons.collections.MapUtils; |
34 | 31 | |
35 | 32 | |
... | ... | @@ -1055,13 +1052,34 @@ |
1055 | 1052 | map.put("yunqi", "孕周"); |
1056 | 1053 | List<String> factor = patients.getRiskFactorId(); |
1057 | 1054 | String risk = ""; |
1055 | + List<String> riskLevelId=new ArrayList<>(); | |
1058 | 1056 | if (CollectionUtils.isNotEmpty(factor)) { |
1059 | 1057 | StringBuilder sb = new StringBuilder(56); |
1058 | + BasicConfigQuery basicConfigQuery=new BasicConfigQuery(); | |
1060 | 1059 | for (String srt : factor) { |
1061 | 1060 | if (StringUtils.isNotEmpty(srt)) { |
1062 | 1061 | BasicConfig basicConfig1 = basicConfigService.getOneBasicConfigById(srt); |
1063 | 1062 | if (null != basicConfig1 && sb.indexOf(basicConfig1.getName()) == -1) { |
1064 | 1063 | sb.append(basicConfig1.getName()).append(','); |
1064 | + basicConfigQuery.setId(basicConfig1.getParentId()); | |
1065 | + List <BasicConfig> basicConfigs2 = basicConfigService.queryBasicConfig(basicConfigQuery); | |
1066 | + if (org.apache.commons.collections.CollectionUtils.isNotEmpty(basicConfigs2)) { | |
1067 | + for (BasicConfig bc : basicConfigs2) { | |
1068 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(bc.getName())) { | |
1069 | + String name = bc.getName(); | |
1070 | + if (name.indexOf("黄色") > -1) { | |
1071 | + name = "黄色"; | |
1072 | + } else if (name.indexOf("橙色") > -1) { | |
1073 | + name = "橙色"; | |
1074 | + } else if (name.indexOf("红色") > -1) { | |
1075 | + name = "红色"; | |
1076 | + } else if (name.indexOf("紫色") > -1) { | |
1077 | + name = "紫色"; | |
1078 | + } | |
1079 | + riskLevelId.add("risk_" + RiskDefaultTypeEnum.getColor(name)); | |
1080 | + } | |
1081 | + } | |
1082 | + } | |
1065 | 1083 | } |
1066 | 1084 | } |
1067 | 1085 | } |
... | ... | @@ -1072,6 +1090,7 @@ |
1072 | 1090 | } |
1073 | 1091 | } |
1074 | 1092 | map.put("risk", risk); |
1093 | + map.put("riskLevelId",riskLevelId); | |
1075 | 1094 | } |
1076 | 1095 | //map.put("height", patientWeight.getBeforeHeight() == null ? "" : MathUtil.doubleFormat(Double.parseDouble(patientWeight.getBeforeHeight()) / 100) + " 米"); |
1077 | 1096 | map.put("height", patientWeight.getBeforeHeight() == null ? "" : patientWeight.getBeforeHeight() + "cm"); |