|
@ -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())) { |
|
|