回访记录
This commit is contained in:
parent
ff80866acf
commit
ce3da9354d
@ -155,4 +155,9 @@ public class PsCustomerRecordVo implements Serializable {
|
||||
* 免费工单审批失败描述
|
||||
*/
|
||||
private String freeFailDesc;
|
||||
|
||||
/**
|
||||
* 回访记录vo(已完成客户列表使用)
|
||||
*/
|
||||
private List<PsCustomCallbackVo> psCustomCallbackVo;
|
||||
}
|
||||
|
@ -389,10 +389,30 @@ public class PsCustomInfoServiceImpl implements IPsCustomInfoService {
|
||||
if (CollectionUtils.isEmpty(list.getRecords())) {
|
||||
return TableDataInfo.build(list);
|
||||
}
|
||||
//免费工单审批
|
||||
list.getRecords().forEach(item->{
|
||||
item.setFreeFailDesc(approverRecordService.getLastFail(item.getContractCode(),item.getContractCode(),List.of(ApproverTypeEnum.FREE.getCode())));
|
||||
|
||||
Map<Long, List<PsCustomCallbackVo>> id_callbackMap = new HashMap<>();
|
||||
//已完成客户的回访记录
|
||||
if (queryBo.getType() != null && queryBo.getType() == 2) {
|
||||
List<Long> ids = list.getRecords().stream().map(PsCustomerRecordVo::getId).collect(Collectors.toList());
|
||||
//查询回访记录详细
|
||||
List<PsCustomCallbackVo> callbacks = callbackMapper.selectVoList(Wrappers.<PsCustomCallback>lambdaQuery()
|
||||
.in(PsCustomCallback::getCustomId, ids)
|
||||
.eq(PsCustomCallback::getDelFlag, 0));
|
||||
if (CollectionUtils.isNotEmpty(callbacks)) {
|
||||
//分组
|
||||
id_callbackMap = callbacks.stream().collect((Collectors.groupingBy(PsCustomCallbackVo::getCustomId)));
|
||||
//排序
|
||||
id_callbackMap.entrySet().forEach(entry -> {
|
||||
entry.setValue(entry.getValue().stream().sorted(Comparator.comparingLong(PsCustomCallbackVo::getId).reversed()).collect(Collectors.toList()));
|
||||
});
|
||||
}
|
||||
}
|
||||
for (PsCustomerRecordVo item : list.getRecords()){
|
||||
//免费工单审批
|
||||
item.setFreeFailDesc(approverRecordService.getLastFail(item.getContractCode(), item.getContractCode(), List.of(ApproverTypeEnum.FREE.getCode())));
|
||||
//装填回访记录vo
|
||||
item.setPsCustomCallbackVo(id_callbackMap.get(item.getId()));
|
||||
}
|
||||
return TableDataInfo.build(list);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user