Commit f8936a66a1d51bd93d8edf674ebf7c42e8e33df8
1 parent
856e14495f
Exists in
dev
#fix:新增孕期高危因素颜色反显
Showing 2 changed files with 37 additions and 0 deletions
platform-dal/src/main/java/com/lyms/platform/pojo/PregnancyReport.java
View file @
f8936a6
| ... | ... | @@ -24,6 +24,8 @@ |
| 24 | 24 | private Integer weightType; |
| 25 | 25 | //高危风险id |
| 26 | 26 | private List<String> riskFactorId; |
| 27 | + //风险等级颜色 | |
| 28 | + private List<String> riskLevelId; | |
| 27 | 29 | //高危风险名称 |
| 28 | 30 | private List<String> riskFactorName; |
| 29 | 31 | //综合营养指南 |
| ... | ... | @@ -43,6 +45,14 @@ |
| 43 | 45 | |
| 44 | 46 | private Date created; |
| 45 | 47 | private Date modified; |
| 48 | + | |
| 49 | + public List<String> getRiskLevelId() { | |
| 50 | + return riskLevelId; | |
| 51 | + } | |
| 52 | + | |
| 53 | + public void setRiskLevelId(List<String> riskLevelId) { | |
| 54 | + this.riskLevelId = riskLevelId; | |
| 55 | + } | |
| 46 | 56 | |
| 47 | 57 | public String getName() { |
| 48 | 58 | return name; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PregnancyReportFacade.java
View file @
f8936a6
| ... | ... | @@ -4,6 +4,7 @@ |
| 4 | 4 | import com.lyms.platform.biz.service.PregnancyReportMattersService; |
| 5 | 5 | import com.lyms.platform.biz.service.PregnancyReportService; |
| 6 | 6 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| 7 | +import com.lyms.platform.common.enums.RiskDefaultTypeEnum; | |
| 7 | 8 | import com.lyms.platform.common.result.BaseListResponse; |
| 8 | 9 | import com.lyms.platform.common.result.BaseResponse; |
| 9 | 10 | import com.lyms.platform.common.utils.StringUtils; |
| 10 | 11 | |
| 11 | 12 | |
| ... | ... | @@ -14,10 +15,14 @@ |
| 14 | 15 | import com.lyms.platform.query.BasicConfigQuery; |
| 15 | 16 | import com.lyms.platform.query.PregnancyReportMattersQuery; |
| 16 | 17 | import com.lyms.platform.query.PregnancyReportQuery; |
| 18 | +import org.apache.commons.lang.math.NumberUtils; | |
| 17 | 19 | import org.springframework.beans.factory.annotation.Autowired; |
| 18 | 20 | import org.springframework.stereotype.Component; |
| 19 | 21 | |
| 22 | +import java.util.ArrayList; | |
| 23 | +import java.util.HashMap; | |
| 20 | 24 | import java.util.List; |
| 25 | +import java.util.Map; | |
| 21 | 26 | |
| 22 | 27 | @Component |
| 23 | 28 | public class PregnancyReportFacade { |
| 24 | 29 | |
| ... | ... | @@ -158,8 +163,29 @@ |
| 158 | 163 | baseResponse.setErrormsg("模版异常"); |
| 159 | 164 | } |
| 160 | 165 | StringBuffer sb=new StringBuffer(); |
| 166 | + List<String> riskLevelId=new ArrayList<>(); | |
| 167 | + basicConfigQuery.setIds(null); | |
| 161 | 168 | for(BasicConfig basicConfig1:basicConfig){ |
| 162 | 169 | sb.append(basicConfig1.getName()).append(","); |
| 170 | + basicConfigQuery.setId(basicConfig1.getParentId()); | |
| 171 | + List <BasicConfig> basicConfigs2 = basicConfigService.queryBasicConfig(basicConfigQuery); | |
| 172 | + if (org.apache.commons.collections.CollectionUtils.isNotEmpty(basicConfigs2)) { | |
| 173 | + for (BasicConfig bc : basicConfigs2) { | |
| 174 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(bc.getName())) { | |
| 175 | + String name = bc.getName(); | |
| 176 | + if (name.indexOf("黄色") > -1) { | |
| 177 | + name = "黄色"; | |
| 178 | + } else if (name.indexOf("橙色") > -1) { | |
| 179 | + name = "橙色"; | |
| 180 | + } else if (name.indexOf("红色") > -1) { | |
| 181 | + name = "红色"; | |
| 182 | + } else if (name.indexOf("紫色") > -1) { | |
| 183 | + name = "紫色"; | |
| 184 | + } | |
| 185 | + riskLevelId.add("risk_" + RiskDefaultTypeEnum.getColor(name)); | |
| 186 | + } | |
| 187 | + } | |
| 188 | + } | |
| 163 | 189 | } |
| 164 | 190 | Integer week= pregnancyReportQuery.getWeek(); |
| 165 | 191 | pregnancyReportQuery.setName(getReportName(sb.toString(),getWeek(week),pregnancyReportQuery.getWeightType())); |
| ... | ... | @@ -167,6 +193,7 @@ |
| 167 | 193 | List<PregnancyReport> list= pregnancyReportService.queryPregnancyReport(pregnancyReportQuery); |
| 168 | 194 | if (CollectionUtils.isNotEmpty(list)){ |
| 169 | 195 | PregnancyReport pregnancyReport= list.get(0); |
| 196 | + pregnancyReport.setRiskLevelId(riskLevelId); | |
| 170 | 197 | PregnancyReportMattersQuery postpartumReportQuery=new PregnancyReportMattersQuery(); |
| 171 | 198 | postpartumReportQuery.setYn(1); |
| 172 | 199 | postpartumReportQuery.setHospitalId(pregnancyReportQuery.getHospitalId()); |