Commit 4630083b authored by lcl's avatar lcl

u

parent 3c9eecaa
...@@ -45,14 +45,15 @@ public class DCustomerServiceImpl extends ServiceImpl<DCustomerMapper, DCustomer ...@@ -45,14 +45,15 @@ public class DCustomerServiceImpl extends ServiceImpl<DCustomerMapper, DCustomer
dealWithCustomerClass(bo); dealWithCustomerClass(bo);
Page<DCustomerListVo> page = baseMapper.allSearchList(query.build(), bo); Page<DCustomerListVo> page = baseMapper.allSearchList(query.build(), bo);
if (CollectionUtils.isNotEmpty(page.getRecords())) { if (CollectionUtils.isNotEmpty(page.getRecords())) {
page.getRecords().parallelStream().forEach(item->{ page.getRecords().parallelStream().forEach(item -> {
DCustomerListVo vo = subcontractMapper.selectStatisticByCustomerId(item.getCustomerId()); DCustomerListVo vo = subcontractMapper.selectStatisticByCustomerId(item.getCustomerId());
//企业合作数量 //企业合作数量
item.setEnterpriseCooperationCount(vo.getEnterpriseCooperationCount()); item.setEnterpriseCooperationCount(vo.getEnterpriseCooperationCount());
//项目合作数量 //项目合作数量
item.setProjectCooperationCount(vo.getProjectCooperationCount()); item.setProjectCooperationCount(vo.getProjectCooperationCount());
showCustomerClass(item);
//关键字标红 //关键字标红
if(!ObjectUtils.isEmpty(bo.getCustomerName())){ if (!ObjectUtils.isEmpty(bo.getCustomerName())) {
item.setCustomerName(StringUtils.markInRed(item.getCustomerName(), bo.getCustomerName())); item.setCustomerName(StringUtils.markInRed(item.getCustomerName(), bo.getCustomerName()));
} }
try { try {
...@@ -62,7 +63,7 @@ public class DCustomerServiceImpl extends ServiceImpl<DCustomerMapper, DCustomer ...@@ -62,7 +63,7 @@ public class DCustomerServiceImpl extends ServiceImpl<DCustomerMapper, DCustomer
Integer companyId = MapUtil.getInt(data, "jskEid"); Integer companyId = MapUtil.getInt(data, "jskEid");
item.setCompanyId(companyId); item.setCompanyId(companyId);
} }
}catch (Exception e){ } catch (Exception e) {
// //
} }
}); });
...@@ -75,13 +76,14 @@ public class DCustomerServiceImpl extends ServiceImpl<DCustomerMapper, DCustomer ...@@ -75,13 +76,14 @@ public class DCustomerServiceImpl extends ServiceImpl<DCustomerMapper, DCustomer
dealWithCustomerClass(bo); dealWithCustomerClass(bo);
PageQuery query = new PageQuery(); PageQuery query = new PageQuery();
List<DCustomerListVo> records = baseMapper.allSearchList(query.build(), bo).getRecords(); List<DCustomerListVo> records = baseMapper.allSearchList(query.build(), bo).getRecords();
if(CollectionUtils.isNotEmpty(records)){ if (CollectionUtils.isNotEmpty(records)) {
records.parallelStream().forEach(item->{ records.parallelStream().forEach(item -> {
DCustomerListVo vo = subcontractMapper.selectStatisticByCustomerId(item.getCustomerId()); DCustomerListVo vo = subcontractMapper.selectStatisticByCustomerId(item.getCustomerId());
//企业合作数量 //企业合作数量
item.setEnterpriseCooperationCount(vo.getEnterpriseCooperationCount()); item.setEnterpriseCooperationCount(vo.getEnterpriseCooperationCount());
//项目合作数量 //项目合作数量
item.setProjectCooperationCount(vo.getProjectCooperationCount()); item.setProjectCooperationCount(vo.getProjectCooperationCount());
showCustomerClass(item);
}); });
} }
return records; return records;
...@@ -92,7 +94,7 @@ public class DCustomerServiceImpl extends ServiceImpl<DCustomerMapper, DCustomer ...@@ -92,7 +94,7 @@ public class DCustomerServiceImpl extends ServiceImpl<DCustomerMapper, DCustomer
List<String> list = new ArrayList<>(); List<String> list = new ArrayList<>();
Integer isTeam = null; Integer isTeam = null;
for (String customerClass : bo.getCustomerClass()) { for (String customerClass : bo.getCustomerClass()) {
switch (customerClass){ switch (customerClass) {
case "专业分包": case "专业分包":
list.add("专业分包"); list.add("专业分包");
break; break;
...@@ -103,17 +105,17 @@ public class DCustomerServiceImpl extends ServiceImpl<DCustomerMapper, DCustomer ...@@ -103,17 +105,17 @@ public class DCustomerServiceImpl extends ServiceImpl<DCustomerMapper, DCustomer
list.add("租赁"); list.add("租赁");
break; break;
case "劳务分包": case "劳务分包":
if(isTeam == null){ if (isTeam == null) {
isTeam = 0; isTeam = 0;
}else if(isTeam == 1) { } else if (isTeam == 1) {
isTeam = null; isTeam = null;
} }
list.add("劳务分包"); list.add("劳务分包");
break; break;
case "劳务队伍": case "劳务队伍":
if(isTeam == null) { if (isTeam == null) {
isTeam = 1; isTeam = 1;
}else if(isTeam == 0) { } else if (isTeam == 0) {
isTeam = null; isTeam = null;
} }
list.add("劳务分包"); list.add("劳务分包");
...@@ -126,5 +128,25 @@ public class DCustomerServiceImpl extends ServiceImpl<DCustomerMapper, DCustomer ...@@ -126,5 +128,25 @@ public class DCustomerServiceImpl extends ServiceImpl<DCustomerMapper, DCustomer
bo.setIsTeam(isTeam); bo.setIsTeam(isTeam);
} }
} }
private void showCustomerClass(DCustomerListVo vo) {
if (!ObjectUtils.isEmpty(vo.getCustomerClass())) {
switch (vo.getCustomerClass()) {
case "分供":
vo.setCustomerClass("物资设备");
break;
case "租赁":
vo.setCustomerClass("施工机械");
break;
case "劳务分包":
if (!ObjectUtils.isEmpty(vo.getLeaderName())) {
vo.setCustomerClass("劳务队伍");
}
break;
default:
break;
}
}
}
} }
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