Commit 42fe208865565bd1a51ee5648950c9cf99f08082
1 parent
710e19d947
Exists in
dev
#fix:优化小程序营养报告
Showing 1 changed file with 24 additions and 1 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PregnancyReportFacade.java
View file @
42fe208
| 1 | 1 | package com.lyms.platform.operate.web.facade; |
| 2 | 2 | |
| 3 | +import com.lyms.platform.biz.service.BasicConfigService; | |
| 3 | 4 | import com.lyms.platform.biz.service.PregnancyReportMattersService; |
| 4 | 5 | import com.lyms.platform.biz.service.PregnancyReportService; |
| 5 | 6 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| 6 | 7 | import com.lyms.platform.common.result.BaseListResponse; |
| 7 | 8 | import com.lyms.platform.common.result.BaseResponse; |
| 8 | 9 | import com.lyms.platform.operate.web.utils.CollectionUtils; |
| 10 | +import com.lyms.platform.pojo.BasicConfig; | |
| 9 | 11 | import com.lyms.platform.pojo.PregnancyReport; |
| 10 | 12 | import com.lyms.platform.pojo.PregnancyReportMatters; |
| 11 | 13 | import com.lyms.platform.query.PregnancyReportMattersQuery; |
| ... | ... | @@ -23,6 +25,8 @@ |
| 23 | 25 | private PregnancyReportService pregnancyReportService; |
| 24 | 26 | @Autowired |
| 25 | 27 | private PregnancyReportMattersService pregnancyReportMattersService; |
| 28 | + @Autowired | |
| 29 | + private BasicConfigService basicConfigService; | |
| 26 | 30 | |
| 27 | 31 | public BaseResponse add(PregnancyReport postpartumReport){ |
| 28 | 32 | postpartumReport.setWeek(postpartumReport.getWeek()); |
| 29 | 33 | |
| 30 | 34 | |
| 31 | 35 | |
| ... | ... | @@ -90,13 +94,32 @@ |
| 90 | 94 | return baseResponse; |
| 91 | 95 | } |
| 92 | 96 | |
| 97 | + private static String getReportName(String name){ | |
| 98 | + String str; | |
| 99 | + if (name.contains("健康")){ | |
| 100 | + str="健康"; | |
| 101 | + }else if (name.contains("糖尿病")){ | |
| 102 | + //妊娠期糖尿病(无需药物治疗)糖尿病合并妊娠(无需药物治疗)需药物治疗的糖尿病 | |
| 103 | + str="糖尿病"; | |
| 104 | + }else { | |
| 105 | + str="高危"; | |
| 106 | + } | |
| 107 | + return str; | |
| 108 | + } | |
| 93 | 109 | |
| 110 | + | |
| 94 | 111 | public BaseResponse getWxPatientReport(PregnancyReportQuery pregnancyReportQuery){ |
| 95 | 112 | pregnancyReportQuery.setYn(1); |
| 113 | + BaseResponse baseResponse=new BaseResponse(); | |
| 114 | + BasicConfig basicConfig= basicConfigService.getOneBasicConfigById(pregnancyReportQuery.getName()); | |
| 115 | + if (basicConfig==null){ | |
| 116 | + baseResponse.setErrorcode(ErrorCodeConstants.DATA_EXIST); | |
| 117 | + baseResponse.setErrormsg("模版异常"); | |
| 118 | + } | |
| 119 | + pregnancyReportQuery.setName(getReportName(basicConfig.getName())); | |
| 96 | 120 | Integer week= pregnancyReportQuery.getWeek(); |
| 97 | 121 | pregnancyReportQuery.setWeek(getWeek(week)); |
| 98 | 122 | List<PregnancyReport> list= pregnancyReportService.queryPregnancyReport(pregnancyReportQuery); |
| 99 | - BaseResponse baseResponse=new BaseResponse(); | |
| 100 | 123 | if (CollectionUtils.isNotEmpty(list)){ |
| 101 | 124 | PregnancyReport pregnancyReport= list.get(0); |
| 102 | 125 | PregnancyReportMattersQuery postpartumReportQuery=new PregnancyReportMattersQuery(); |