Commit c9a97404ec9fe30b5edd8702211a84cc1c6c53e9
1 parent
7c21e58406
Exists in
master
and in
1 other branch
自测bug提交
Showing 3 changed files with 75 additions and 4 deletions
platform-common/src/main/java/com/lyms/platform/common/enums/HisptialRiskTypeEnum.java
View file @
c9a9740
| ... | ... | @@ -15,7 +15,7 @@ |
| 15 | 15 | JGFX("49a36aea-c5b6-4162-87d2-9eb3c6ec00c2", "较高风险", "risk_orange"), |
| 16 | 16 | GFX("eb146c03-b19f-4e28-b85f-fda574b2283b", "高风险", "risk_red"), |
| 17 | 17 | CRB("224b2329-cb82-4da3-a071-8527f8283aab", "传染病", "risk_purple"), |
| 18 | - JK("d42eec03-aa86-45b8-a4e0-78a0ff365fb6", "健康", "risk_green"); | |
| 18 | + JK("e637b361-99cf-41eb-84f2-f0dab596e928", "健康", "risk_green"); | |
| 19 | 19 | private String id; |
| 20 | 20 | private String name; |
| 21 | 21 | private String color; |
platform-dal/src/main/java/com/lyms/platform/pojo/TemporaryBloodModel.java
View file @
c9a9740
| ... | ... | @@ -49,8 +49,19 @@ |
| 49 | 49 | // 前囟 单胎/双胎/多胎 |
| 50 | 50 | private String bregmatic; |
| 51 | 51 | |
| 52 | + private String riskLevelId; | |
| 52 | 53 | |
| 54 | + | |
| 53 | 55 | private Integer yn; |
| 56 | + | |
| 57 | + public String getRiskLevelId() { | |
| 58 | + return riskLevelId; | |
| 59 | + } | |
| 60 | + | |
| 61 | + public void setRiskLevelId(String riskLevelId) { | |
| 62 | + this.riskLevelId = riskLevelId; | |
| 63 | + } | |
| 64 | + | |
| 54 | 65 | private Map<String, Map<String, Object>> infos; |
| 55 | 66 | |
| 56 | 67 | public Map<String, Map<String, Object>> getInfos() { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/TemporaryBloodServiceImpl.java
View file @
c9a9740
| ... | ... | @@ -4,14 +4,17 @@ |
| 4 | 4 | import com.lyms.platform.biz.service.BasicConfigService; |
| 5 | 5 | import com.lyms.platform.biz.service.CommonService; |
| 6 | 6 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| 7 | +import com.lyms.platform.common.enums.HisptialRiskTypeEnum; | |
| 7 | 8 | import com.lyms.platform.common.result.BaseObjectResponse; |
| 8 | 9 | import com.lyms.platform.common.result.BaseResponse; |
| 9 | 10 | import com.lyms.platform.common.result.PageResult; |
| 10 | 11 | import com.lyms.platform.common.result.RespBuilder; |
| 11 | 12 | import com.lyms.platform.common.utils.DateUtil; |
| 13 | +import com.lyms.platform.common.utils.JsonUtil; | |
| 12 | 14 | import com.lyms.platform.common.utils.StringUtils; |
| 13 | 15 | import com.lyms.platform.operate.web.service.ITemporaryBloodService; |
| 14 | 16 | import com.lyms.platform.operate.web.service.PatientWeightService; |
| 17 | +import com.lyms.platform.operate.web.utils.LisHandleTask; | |
| 15 | 18 | import com.lyms.platform.operate.web.utils.ReportConfig; |
| 16 | 19 | import com.lyms.platform.pojo.*; |
| 17 | 20 | import org.apache.commons.collections.CollectionUtils; |
| ... | ... | @@ -59,6 +62,15 @@ |
| 59 | 62 | Map<String, Map<String, Object>> infos = new LinkedHashMap<>(); |
| 60 | 63 | infos.put(DateUtil.getyyyy_MM_dd(new Date()), temp); |
| 61 | 64 | bloodModel.setInfos(infos); |
| 65 | + List<String> riskLevelIdList = new ArrayList<>(); | |
| 66 | + if (CollectionUtils.isNotEmpty(bloodModel.getRiskFactorId())) { | |
| 67 | + List<String> riskFactor = bloodModel.getRiskFactorId(); | |
| 68 | + for (String risk : riskFactor) { | |
| 69 | + BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(risk); | |
| 70 | + riskLevelIdList.add(basicConfig.getParentId()); | |
| 71 | + } | |
| 72 | + } | |
| 73 | + bloodModel.setRiskLevelId(JsonUtil.array2JsonString(riskLevelIdList)); | |
| 62 | 74 | TemporaryBloodModel temporaryBloodModel = temporaryBloodDao.addTemporaryBlood(bloodModel); |
| 63 | 75 | return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("添加成功").setData(temporaryBloodModel.getId()); |
| 64 | 76 | } else { |
| ... | ... | @@ -79,6 +91,15 @@ |
| 79 | 91 | Map<String, Map<String, Object>> infos = new LinkedHashMap<>(); |
| 80 | 92 | infos.put(DateUtil.getyyyy_MM_dd(new Date()), temp); |
| 81 | 93 | bloodModel.setInfos(infos); |
| 94 | + List<String> riskLevelIdList = new ArrayList<>(); | |
| 95 | + if (CollectionUtils.isNotEmpty(bloodModel.getRiskFactorId())) { | |
| 96 | + List<String> riskFactor = bloodModel.getRiskFactorId(); | |
| 97 | + for (String risk : riskFactor) { | |
| 98 | + BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(risk); | |
| 99 | + riskLevelIdList.add(basicConfig.getParentId()); | |
| 100 | + } | |
| 101 | + } | |
| 102 | + bloodModel.setRiskLevelId(JsonUtil.array2JsonString(riskLevelIdList)); | |
| 82 | 103 | TemporaryBloodModel temporaryBloodModel = temporaryBloodDao.addTemporaryBlood(bloodModel); |
| 83 | 104 | return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("添加成功").setData(temporaryBloodModel.getId()); |
| 84 | 105 | } |
| 85 | 106 | |
| 86 | 107 | |
| 87 | 108 | |
| ... | ... | @@ -134,13 +155,53 @@ |
| 134 | 155 | //Patients p = mongoTemplate.findById(bloodPressure.getParentId(), Patients.class); |
| 135 | 156 | temp.put("id", bloodPressure.getId()); |
| 136 | 157 | if (bloodPressure != null) { |
| 137 | - temp.put("username", bloodPressure.getUserName()); | |
| 158 | + temp.put("userName", bloodPressure.getUserName()); | |
| 138 | 159 | temp.put("time", DateUtil.getyyyy_MM_dd(bloodPressure.getModified())); |
| 139 | 160 | temp.put("age", bloodPressure.getAge()); |
| 140 | 161 | temp.put("week", DateUtil.getWeekDesc(bloodPressure.getLastMenses(), new Date())); |
| 162 | + List<String> riskList = bloodPressure.getRiskFactorId(); | |
| 163 | + Map<String, Object> riskLists = new HashMap(); | |
| 164 | + List<Map> list = new ArrayList<>(); | |
| 165 | + System.out.println("==========>" + riskList); | |
| 166 | + if (CollectionUtils.isNotEmpty(riskList)) { | |
| 167 | + for (String rist : riskList) { | |
| 141 | 168 | |
| 142 | - // temp.put("riskLevel", commonService.findRiskLevel(p.getRiskLevelId())); //高危等级(颜色) | |
| 169 | + BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(rist); | |
| 170 | + String ParentId = basicConfig.getParentId(); | |
| 171 | + if (StringUtils.isNotEmpty(ParentId) && basicConfig != null) { | |
| 172 | + if (basicConfig.getParentId().equals(HisptialRiskTypeEnum.JK.getId())) { | |
| 173 | + riskLists.put("id", HisptialRiskTypeEnum.JK.getId()); | |
| 174 | + riskLists.put("name", HisptialRiskTypeEnum.JK.getName()); | |
| 175 | + riskLists.put("color", HisptialRiskTypeEnum.JK.getColor()); | |
| 176 | + } | |
| 177 | + if (basicConfig.getParentId().equals(HisptialRiskTypeEnum.GFX.getId())) { | |
| 178 | + riskLists.put("id", HisptialRiskTypeEnum.JK.getId()); | |
| 179 | + riskLists.put("name", HisptialRiskTypeEnum.JK.getName()); | |
| 180 | + riskLists.put("color", HisptialRiskTypeEnum.JK.getColor()); | |
| 181 | + } | |
| 182 | + if (basicConfig.getParentId().equals(HisptialRiskTypeEnum.JGFX.getId())) { | |
| 183 | + riskLists.put("id", HisptialRiskTypeEnum.JK.getId()); | |
| 184 | + riskLists.put("name", HisptialRiskTypeEnum.JK.getName()); | |
| 185 | + riskLists.put("color", HisptialRiskTypeEnum.JK.getColor()); | |
| 186 | + } | |
| 187 | + if (basicConfig.getParentId().equals(HisptialRiskTypeEnum.CRB.getId())) { | |
| 188 | + riskLists.put("id", HisptialRiskTypeEnum.JK.getId()); | |
| 189 | + riskLists.put("name", HisptialRiskTypeEnum.JK.getName()); | |
| 190 | + riskLists.put("color", HisptialRiskTypeEnum.JK.getColor()); | |
| 191 | + } | |
| 192 | + if (basicConfig.getParentId().equals(HisptialRiskTypeEnum.YBFX.getId())) { | |
| 193 | + riskLists.put("id", HisptialRiskTypeEnum.JK.getId()); | |
| 194 | + riskLists.put("name", HisptialRiskTypeEnum.JK.getName()); | |
| 195 | + riskLists.put("color", HisptialRiskTypeEnum.JK.getColor()); | |
| 196 | + } | |
| 197 | + list.add(riskLists); | |
| 198 | + } | |
| 199 | + } | |
| 200 | + } else { | |
| 201 | + temp.put("riskLevel", ""); | |
| 202 | + } | |
| 143 | 203 | |
| 204 | + temp.put("riskLevel", list); | |
| 144 | 205 | String rFactor = commonService.resloveFactor(bloodPressure.getRiskFactorId()); |
| 145 | 206 | if (bloodPressure.getHighriskDesc() != null && !"null".equals(bloodPressure.getHighriskDesc())) { |
| 146 | 207 | if (StringUtils.isNotEmpty(rFactor)) { |
| ... | ... | @@ -150,7 +211,6 @@ |
| 150 | 211 | } |
| 151 | 212 | } |
| 152 | 213 | temp.put("riskFactor", rFactor); // 高危因素 |
| 153 | - | |
| 154 | 214 | // temp.put("dueDate", DateUtil.getyyyy_MM_dd(p.getDueDate())); |
| 155 | 215 | temp.put("bloodPressure", bloodPressure.getSsy() + "/" + bloodPressure.getSzy() + "mmHg"); |
| 156 | 216 | temp.put("pulse", bloodPressure.getPulse()); |