Commit 4a5fa740 authored by wujipeng's avatar wujipeng
Browse files

优化

parent 5039e026
......@@ -52,14 +52,14 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CasesEntity> implem
//查看案件所有的excelData
List<ExcelDataVO> excelDataEntityList = excelDataService.queryByCaseId(caseDTO);
//过滤掉payeeName和payUserName一样的数据
List<ExcelDataVO> excelDataEntityList1 = Lists.newArrayList();
for (ExcelDataVO excelDataVO : excelDataEntityList) {
if (StringUtils.isNotEmpty(excelDataVO.getPayUserName())
&& StringUtils.isNotEmpty(excelDataVO.getPayeeName())) {
excelDataEntityList1.add(excelDataVO);
}
}
excelDataEntityList1.forEach(excelDataEntity -> {
// List<ExcelDataVO> excelDataEntityList1 = Lists.newArrayList();
// for (ExcelDataVO excelDataVO : excelDataEntityList) {
// if (StringUtils.isNotEmpty(excelDataVO.getPayUserName())
// && StringUtils.isNotEmpty(excelDataVO.getPayeeName())) {
// excelDataEntityList1.add(excelDataVO);
// }
// }
excelDataEntityList.forEach(excelDataEntity -> {
if (StringUtils.isNull(excelDataEntity.getPayUserName())) {
excelDataEntity.setPayUserName("无对应人员的数据");
}
......@@ -68,7 +68,7 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CasesEntity> implem
// 调用分组方法
userList.forEach(userName -> groupedMap.put(userName, Lists.newArrayList()));
groupByPayUserName(groupedMap, excelDataEntityList1);
groupByPayUserName(groupedMap, excelDataEntityList);
//初始化集合
List<CaseVO> caseVOList = Lists.newArrayList();
//遍历groupedMap
......@@ -79,11 +79,18 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CasesEntity> implem
userFlag = excelDataEntityListNew.get(0).getUserFlag();
}
UserEntity user = userService.getByUserName(entry.getKey(), caseDTO.getId());
if(!ObjectUtils.isEmpty( user)){
caseVOList.add(CaseVO.builder().excelDataList(excelDataEntityListNew)
.payUserName(entry.getKey())
.userFlag(userFlag)
.idCard(user.getIdCard())
.build());
}else if (CollUtil.isNotEmpty(excelDataEntityListNew)) {
caseVOList.add(CaseVO.builder().excelDataList(excelDataEntityListNew)
.payUserName(entry.getKey())
.userFlag(userFlag)
.build());
}
}
return caseVOList;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment