Commit 4630083b authored by lcl's avatar lcl

u

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