Commit 3a23b76e authored by 施翔轲's avatar 施翔轲

查询供应商基本情况

parent 316ddee6
...@@ -20,6 +20,7 @@ import org.springframework.web.bind.annotation.*; ...@@ -20,6 +20,7 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 供应商相关 * 供应商相关
...@@ -78,7 +79,12 @@ public class CustomerInfoController extends BaseController { ...@@ -78,7 +79,12 @@ public class CustomerInfoController extends BaseController {
return iCustomerInfoService.queryCooperationList(bo, query); return iCustomerInfoService.queryCooperationList(bo, query);
} }
/**
* 查询供应商基本情况
*/
@GetMapping("/queryBasicInfo")
public R<Map<String,Long>> queryBasicInfo() {
return R.ok(iCustomerInfoService.queryBasicInfo());
}
} }
...@@ -59,4 +59,9 @@ public interface ICustomerInfoService extends IService<DCustomer> { ...@@ -59,4 +59,9 @@ public interface ICustomerInfoService extends IService<DCustomer> {
* @return * @return
*/ */
Map<String,Object> cooperationStatistic(String companyName); Map<String,Object> cooperationStatistic(String companyName);
/**
* 查询供应商基本情况
*/
Map<String, Long> queryBasicInfo();
} }
...@@ -54,23 +54,23 @@ public class CustomerInfoServiceImpl extends ServiceImpl<DCustomerMapper, DCusto ...@@ -54,23 +54,23 @@ public class CustomerInfoServiceImpl extends ServiceImpl<DCustomerMapper, DCusto
@Override @Override
public TableDataInfo<CustomerInfoVo> queryPageList(CustomerInfoBo bo, PageQuery query) { public TableDataInfo<CustomerInfoVo> queryPageList(CustomerInfoBo bo, PageQuery query) {
if("劳务分包".equals(bo.getCustomerClass())){ if ("劳务分包".equals(bo.getCustomerClass())) {
bo.setServiceTeamLogo("N"); bo.setServiceTeamLogo("N");
} }
if("劳务分包队伍".equals(bo.getCustomerClass())){ if ("劳务分包队伍".equals(bo.getCustomerClass())) {
bo.setCustomerClass("劳务分包"); bo.setCustomerClass("劳务分包");
bo.setServiceTeamLogo("Y"); bo.setServiceTeamLogo("Y");
} }
Page<CustomerInfoVo> page = baseMapper.queryListByType(query.build(), bo); Page<CustomerInfoVo> page = baseMapper.queryListByType(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());
//关键字标红 //关键字标红
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 {
...@@ -80,11 +80,11 @@ public class CustomerInfoServiceImpl extends ServiceImpl<DCustomerMapper, DCusto ...@@ -80,11 +80,11 @@ public class CustomerInfoServiceImpl extends ServiceImpl<DCustomerMapper, DCusto
Integer companyId = MapUtil.getInt(data, "jskEid"); Integer companyId = MapUtil.getInt(data, "jskEid");
item.setCompanyId(companyId); item.setCompanyId(companyId);
} }
}catch (Exception e){ } catch (Exception e) {
log.error("CustomerInfoServiceImpl.queryPageList() error:" + e); log.error("CustomerInfoServiceImpl.queryPageList() error:" + e);
} }
//关键字标红 //关键字标红
if(!ObjectUtils.isEmpty(bo.getLeaderName())){ if (!ObjectUtils.isEmpty(bo.getLeaderName())) {
item.setCustomerName(StringUtils.markInRed(item.getLeaderName(), bo.getLeaderName())); item.setCustomerName(StringUtils.markInRed(item.getLeaderName(), bo.getLeaderName()));
} }
}); });
...@@ -94,18 +94,18 @@ public class CustomerInfoServiceImpl extends ServiceImpl<DCustomerMapper, DCusto ...@@ -94,18 +94,18 @@ public class CustomerInfoServiceImpl extends ServiceImpl<DCustomerMapper, DCusto
@Override @Override
public CustomerApproveVo queryApproveByBo(CustomerInfoBo bo) { public CustomerApproveVo queryApproveByBo(CustomerInfoBo bo) {
if(ObjectUtil.isNull(bo.getCustomerKey()) && StringUtil.isBlank(bo.getCustomerName()) && StringUtil.isBlank(bo.getUnifySocialCode())){ if (ObjectUtil.isNull(bo.getCustomerKey()) && StringUtil.isBlank(bo.getCustomerName()) && StringUtil.isBlank(bo.getUnifySocialCode())) {
Assert.isTrue(false,"参数不能为空"); Assert.isTrue(false, "参数不能为空");
} }
LambdaQueryWrapper<DCustomer> lqw = Wrappers.lambdaQuery(); LambdaQueryWrapper<DCustomer> lqw = Wrappers.lambdaQuery();
lqw.eq(DCustomer::getRecommendOrgId, AdvisoryBodyManageQueryConstants.LEVEL1_COMPANY_ID); lqw.eq(DCustomer::getRecommendOrgId, AdvisoryBodyManageQueryConstants.LEVEL1_COMPANY_ID);
lqw.eq(ObjectUtil.isNotNull(bo.getCustomerKey()),DCustomer::getCustomerKey,bo.getCustomerKey()); lqw.eq(ObjectUtil.isNotNull(bo.getCustomerKey()), DCustomer::getCustomerKey, bo.getCustomerKey());
lqw.eq(StringUtil.isNotBlank(bo.getUnifySocialCode()),DCustomer::getUnifySocialCode,bo.getUnifySocialCode()); lqw.eq(StringUtil.isNotBlank(bo.getUnifySocialCode()), DCustomer::getUnifySocialCode, bo.getUnifySocialCode());
lqw.eq(StringUtil.isNotBlank(bo.getCustomerName()),DCustomer::getCustomerName,bo.getCustomerName()); lqw.eq(StringUtil.isNotBlank(bo.getCustomerName()), DCustomer::getCustomerName, bo.getCustomerName());
lqw.orderByDesc(DCustomer::getApproveDate2); lqw.orderByDesc(DCustomer::getApproveDate2);
lqw.last("limit 1"); lqw.last("limit 1");
DCustomer dCustomer = baseMapper.selectOne(lqw); DCustomer dCustomer = baseMapper.selectOne(lqw);
if(ObjectUtil.isNotEmpty(dCustomer)){ if (ObjectUtil.isNotEmpty(dCustomer)) {
//营业执照url //营业执照url
dCustomer.setBusinessLicenseList(baseMapper.selectBusinessLicense(dCustomer.getCustomerId())); dCustomer.setBusinessLicenseList(baseMapper.selectBusinessLicense(dCustomer.getCustomerId()));
//组织机构代码证url //组织机构代码证url
...@@ -133,7 +133,7 @@ public class CustomerInfoServiceImpl extends ServiceImpl<DCustomerMapper, DCusto ...@@ -133,7 +133,7 @@ public class CustomerInfoServiceImpl extends ServiceImpl<DCustomerMapper, DCusto
@Override @Override
public TableDataInfo<AdvisoryBodyVo> queryAdvisoryList(AdvisoryBodyBo bo, PageQuery query) { public TableDataInfo<AdvisoryBodyVo> queryAdvisoryList(AdvisoryBodyBo bo, PageQuery query) {
bo.setContractOrgId(AdvisoryBodyManageQueryConstants.LEVEL1_COMPANY_ID); bo.setContractOrgId(AdvisoryBodyManageQueryConstants.LEVEL1_COMPANY_ID);
Page<AdvisoryBodyVo> page = advisoryBodyMapper.queryListByBo(query.build(),bo); Page<AdvisoryBodyVo> page = advisoryBodyMapper.queryListByBo(query.build(), bo);
page.getRecords().parallelStream().forEach(vo -> { page.getRecords().parallelStream().forEach(vo -> {
try { try {
Map<String, Object> map = opportunityRadarService.enterpriseByName(vo.getOwnerName()); Map<String, Object> map = opportunityRadarService.enterpriseByName(vo.getOwnerName());
...@@ -157,11 +157,11 @@ public class CustomerInfoServiceImpl extends ServiceImpl<DCustomerMapper, DCusto ...@@ -157,11 +157,11 @@ public class CustomerInfoServiceImpl extends ServiceImpl<DCustomerMapper, DCusto
@Override @Override
public TableDataInfo<CustomerCooperationVo> queryCooperationList(CustomerCooperationBo bo, PageQuery query) { public TableDataInfo<CustomerCooperationVo> queryCooperationList(CustomerCooperationBo bo, PageQuery query) {
if(StringUtil.isBlank(bo.getCustomerId()) && StringUtil.isBlank(bo.getCustomerName())){ if (StringUtil.isBlank(bo.getCustomerId()) && StringUtil.isBlank(bo.getCustomerName())) {
Assert.isTrue(false,"供应商不能为空"); Assert.isTrue(false, "供应商不能为空");
} }
bo.setSignOrgId(AdvisoryBodyManageQueryConstants.LEVEL1_COMPANY_ID); bo.setSignOrgId(AdvisoryBodyManageQueryConstants.LEVEL1_COMPANY_ID);
Page<CustomerCooperationVo> page = dSubcontractMapper.selectCooperationList(query.build(),bo); Page<CustomerCooperationVo> page = dSubcontractMapper.selectCooperationList(query.build(), bo);
return TableDataInfo.build(page); return TableDataInfo.build(page);
} }
...@@ -190,4 +190,41 @@ public class CustomerInfoServiceImpl extends ServiceImpl<DCustomerMapper, DCusto ...@@ -190,4 +190,41 @@ public class CustomerInfoServiceImpl extends ServiceImpl<DCustomerMapper, DCusto
// result.put("在施工程情况", 0); // result.put("在施工程情况", 0);
return result; return result;
} }
/**
* 查询供应商基本情况
*/
@Override
public Map<String, Long> queryBasicInfo() {
HashMap<String, Long> infoMap = new HashMap<>();
//专业分包数量
Long zyfbCount = baseMapper.selectCount(new LambdaQueryWrapper<DCustomer>()
.eq(DCustomer::getRecommendOrgId, "F17305B4EA4444CBAB12892C7B99E475")
.eq(DCustomer::getCustomerClass, "专业分包"));
//机械施工数量
Long jxsgCount = baseMapper.selectCount(new LambdaQueryWrapper<DCustomer>()
.eq(DCustomer::getRecommendOrgId, "F17305B4EA4444CBAB12892C7B99E475")
.eq(DCustomer::getCustomerClass, "租赁"));
//物资设备数量
Long wzsbCount = baseMapper.selectCount(new LambdaQueryWrapper<DCustomer>()
.eq(DCustomer::getRecommendOrgId, "F17305B4EA4444CBAB12892C7B99E475")
.eq(DCustomer::getCustomerClass, "分供"));
//劳务分包数量
Long lwfbCount = baseMapper.selectCount(new LambdaQueryWrapper<DCustomer>()
.eq(DCustomer::getRecommendOrgId, "F17305B4EA4444CBAB12892C7B99E475")
.eq(DCustomer::getCustomerClass, "劳务分包")
.eq(DCustomer::getServiceTeamLogo,"N"));
//劳务分包队伍数量
Long lwfbdwCount = baseMapper.selectCount(new LambdaQueryWrapper<DCustomer>()
.eq(DCustomer::getRecommendOrgId, "F17305B4EA4444CBAB12892C7B99E475")
.eq(DCustomer::getCustomerClass, "劳务分包")
.eq(DCustomer::getServiceTeamLogo,"Y"));
infoMap.put("customerTotal", zyfbCount + jxsgCount + wzsbCount + lwfbCount + lwfbdwCount);
infoMap.put("zyfbCount", zyfbCount);
infoMap.put("jxsgCount", jxsgCount);
infoMap.put("wzsbCount", wzsbCount);
infoMap.put("lwfbCount", lwfbCount);
infoMap.put("lwfbdwCount", lwfbdwCount);
return infoMap;
}
} }
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