Browse Source

bug修改

dev_shibei_match
sunyuchao 4 years ago
parent
commit
ae2e9762ce
  1. 2
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/HomeStartPageResultDTO.java
  2. 22
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerStartPageServiceImpl.java

2
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/HomeStartPageResultDTO.java

@ -15,7 +15,7 @@ public class HomeStartPageResultDTO implements Serializable {
/** /**
* 居民端启动页文件url路径 * 居民端启动页文件url路径
*/ */
private String reisUrl; private String resiUrl;
/** /**
* 居民端启动页展示时间单位秒 * 居民端启动页展示时间单位秒
*/ */

22
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerStartPageServiceImpl.java

@ -47,10 +47,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList; import java.util.*;
import java.util.Arrays; import java.util.stream.Collectors;
import java.util.List;
import java.util.Map;
/** /**
* 客户小程序启动页配置 * 客户小程序启动页配置
@ -133,6 +131,20 @@ public class CustomerStartPageServiceImpl extends BaseServiceImpl<CustomerStartP
StartPageResultDTO work = new StartPageResultDTO(); StartPageResultDTO work = new StartPageResultDTO();
work.setClientType("work"); work.setClientType("work");
resultList.add(work); resultList.add(work);
}else {//缺失数据的补齐,保证返回两条
Map<String, String> map = resultList.stream().collect(Collectors.toMap(StartPageResultDTO::getClientType,StartPageResultDTO::getClientType,(value1,value2)->{
return value2;
}));
if(!map.containsKey("resi")){
StartPageResultDTO resi = new StartPageResultDTO();
resi.setClientType("resi");
resultList.add(resi);
}
if(!map.containsKey("work")){
StartPageResultDTO work = new StartPageResultDTO();
work.setClientType("work");
resultList.add(work);
}
} }
//2.查询默认客户数据 //2.查询默认客户数据
@ -188,7 +200,7 @@ public class CustomerStartPageServiceImpl extends BaseServiceImpl<CustomerStartP
//3.封装数据并返回 //3.封装数据并返回
defList.forEach(d -> { defList.forEach(d -> {
if ("resi".equals(d.getClientType())) { if ("resi".equals(d.getClientType())) {
resultDTO.setReisUrl(d.getUrl()); resultDTO.setResiUrl(d.getUrl());
resultDTO.setResiTime(d.getTime()); resultDTO.setResiTime(d.getTime());
} }
if ("work".equals(d.getClientType())) { if ("work".equals(d.getClientType())) {

Loading…
Cancel
Save