Commit e5c1a6e2c5e83aff249c6d0cda50ff8afadc447e

Authored by zhangchao
1 parent e863e42cf5
Exists in dev

#fix:优化

Showing 1 changed file with 11 additions and 3 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PregnancyReportFacade.java View file @ e5c1a6e
... ... @@ -6,10 +6,12 @@
6 6 import com.lyms.platform.common.constants.ErrorCodeConstants;
7 7 import com.lyms.platform.common.result.BaseListResponse;
8 8 import com.lyms.platform.common.result.BaseResponse;
  9 +import com.lyms.platform.common.utils.StringUtils;
9 10 import com.lyms.platform.operate.web.utils.CollectionUtils;
10 11 import com.lyms.platform.pojo.BasicConfig;
11 12 import com.lyms.platform.pojo.PregnancyReport;
12 13 import com.lyms.platform.pojo.PregnancyReportMatters;
  14 +import com.lyms.platform.query.BasicConfigQuery;
13 15 import com.lyms.platform.query.PregnancyReportMattersQuery;
14 16 import com.lyms.platform.query.PregnancyReportQuery;
15 17 import org.springframework.beans.factory.annotation.Autowired;
16 18  
17 19  
... ... @@ -148,13 +150,19 @@
148 150 public BaseResponse getWxPatientReport(PregnancyReportQuery pregnancyReportQuery){
149 151 pregnancyReportQuery.setYn(1);
150 152 BaseResponse baseResponse=new BaseResponse();
151   - BasicConfig basicConfig= basicConfigService.getOneBasicConfigById(pregnancyReportQuery.getName());
152   - if (basicConfig==null){
  153 + BasicConfigQuery basicConfigQuery=new BasicConfigQuery();
  154 + basicConfigQuery.setIds(StringUtils.covertToList(pregnancyReportQuery.getName(), String.class));
  155 + List<BasicConfig> basicConfig= basicConfigService.queryBasicConfig(basicConfigQuery);
  156 + if (CollectionUtils.isEmpty(basicConfig)){
153 157 baseResponse.setErrorcode(ErrorCodeConstants.DATA_EXIST);
154 158 baseResponse.setErrormsg("模版异常");
155 159 }
  160 + StringBuffer sb=new StringBuffer();
  161 + for(BasicConfig basicConfig1:basicConfig){
  162 + sb.append(basicConfig1.getName()).append(",");
  163 + }
156 164 Integer week= pregnancyReportQuery.getWeek();
157   - pregnancyReportQuery.setName(getReportName(basicConfig.getName(),getWeek(week),pregnancyReportQuery.getWeightType()));
  165 + pregnancyReportQuery.setName(getReportName(sb.toString(),getWeek(week),pregnancyReportQuery.getWeightType()));
158 166 pregnancyReportQuery.setWeek(getWeek(week));
159 167 List<PregnancyReport> list= pregnancyReportService.queryPregnancyReport(pregnancyReportQuery);
160 168 if (CollectionUtils.isNotEmpty(list)){