Commit 8d8fb696 authored by Administrator's avatar Administrator

Merge remote-tracking branch 'origin/V20231129-中建一局二公司' into V20231129-中建一局二公司

parents 514d85e1 7669331e
...@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dsk.cscec.domain.DSubcontract; import com.dsk.cscec.domain.DSubcontract;
import com.dsk.cscec.domain.vo.DCustomerListVo;
import com.dsk.cscec.domain.bo.CustomerCooperationBo; import com.dsk.cscec.domain.bo.CustomerCooperationBo;
import com.dsk.cscec.domain.vo.CustomerCooperationVo; import com.dsk.cscec.domain.vo.CustomerCooperationVo;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -21,7 +22,9 @@ public interface DSubcontractMapper extends BaseMapper<DSubcontract> { ...@@ -21,7 +22,9 @@ public interface DSubcontractMapper extends BaseMapper<DSubcontract> {
Integer selectProjectCountByCustomerId(String customerId); Integer selectProjectCountByCustomerId(String customerId);
/** DCustomerListVo selectStatisticByCustomerId(String customerId);
/**
* 供应商合作记录 * 供应商合作记录
* @param build * @param build
* @param bo * @param bo
......
...@@ -45,10 +45,11 @@ public class DCustomerServiceImpl extends ServiceImpl<DCustomerMapper, DCustomer ...@@ -45,10 +45,11 @@ public class DCustomerServiceImpl extends ServiceImpl<DCustomerMapper, DCustomer
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());
//企业合作数量 //企业合作数量
item.setEnterpriseCooperationCount(subcontractMapper.selectEnterpriseCountByCustomerId(item.getCustomerId())); item.setEnterpriseCooperationCount(vo.getEnterpriseCooperationCount());
//项目合作数量 //项目合作数量
item.setProjectCooperationCount(subcontractMapper.selectProjectCountByCustomerId(item.getCustomerId())); item.setProjectCooperationCount(vo.getProjectCooperationCount());
try { try {
Map<String, Object> map = opportunityRadarService.enterpriseByName(item.getCustomerName()); Map<String, Object> map = opportunityRadarService.enterpriseByName(item.getCustomerName());
if (!ObjectUtils.isEmpty(map.get("data"))) { if (!ObjectUtils.isEmpty(map.get("data"))) {
...@@ -71,10 +72,11 @@ public class DCustomerServiceImpl extends ServiceImpl<DCustomerMapper, DCustomer ...@@ -71,10 +72,11 @@ public class DCustomerServiceImpl extends ServiceImpl<DCustomerMapper, DCustomer
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());
//企业合作数量 //企业合作数量
item.setEnterpriseCooperationCount(subcontractMapper.selectEnterpriseCountByCustomerId(item.getCustomerId())); item.setEnterpriseCooperationCount(vo.getEnterpriseCooperationCount());
//项目合作数量 //项目合作数量
item.setProjectCooperationCount(subcontractMapper.selectProjectCountByCustomerId(item.getCustomerId())); item.setProjectCooperationCount(vo.getProjectCooperationCount());
}); });
} }
return records; return records;
......
...@@ -17,7 +17,17 @@ ...@@ -17,7 +17,17 @@
) a ) a
</select> </select>
<select id="selectCooperationList" resultType="com.dsk.cscec.domain.vo.CustomerCooperationVo"> <select id="selectStatisticByCustomerId" resultType="com.dsk.cscec.domain.vo.DCustomerListVo">
select
count(DISTINCT org.customer_id) enterpriseCooperationCount,
count(DISTINCT project.customer_id) projectCooperationCount
from d_customer dc
left join d_subcontract org on org.customer_id = dc.customer_id
left join d_subcontract project on project.customer_id = dc.customer_id
where dc.customer_id = #{customerId}
</select>
<select id="selectCooperationList" resultType="com.dsk.cscec.domain.vo.CustomerCooperationVo">
select ds.subcontract_key,ds.subcontract_id,ds.project_name,ds.sign_org_name,ds.sign_date,ds.subcontract_value,ds.settle_value,ds.job_scope, select ds.subcontract_key,ds.subcontract_id,ds.project_name,ds.sign_org_name,ds.sign_date,ds.subcontract_value,ds.settle_value,ds.job_scope,
dp.area_name,dp.province_name,dp.city_name,dp.project_manager_name,dp.project_manager_phone,dp.project_type2 dp.area_name,dp.province_name,dp.city_name,dp.project_manager_name,dp.project_manager_phone,dp.project_type2
from d_subcontract ds from d_subcontract ds
......
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