Commit 523251bb authored by chenyuefang's avatar chenyuefang

内部合作统计

parent a78281c3
...@@ -33,6 +33,13 @@ public interface AdvisoryBodyMapper extends BaseMapper<AdvisoryBody> { ...@@ -33,6 +33,13 @@ public interface AdvisoryBodyMapper extends BaseMapper<AdvisoryBody> {
*/ */
Page<AdvisoryBodyVo> queryListByBo(IPage<AdvisoryBodyBo> build, @Param("bo") AdvisoryBodyBo bo); Page<AdvisoryBodyVo> queryListByBo(IPage<AdvisoryBodyBo> build, @Param("bo") AdvisoryBodyBo bo);
/**
* 咨询机构合作记录数量
* @param bo
* @return
*/
int countByBo(@Param("bo") AdvisoryBodyBo bo);
/** /**
* 根据咨询机构名称查询咨询机构Cids * 根据咨询机构名称查询咨询机构Cids
* @param advisoryBodyName 咨询机构名称 * @param advisoryBodyName 咨询机构名称
......
...@@ -31,5 +31,12 @@ public interface DSubcontractMapper extends BaseMapper<DSubcontract> { ...@@ -31,5 +31,12 @@ public interface DSubcontractMapper extends BaseMapper<DSubcontract> {
* @return * @return
*/ */
Page<CustomerCooperationVo> selectCooperationList(IPage<CustomerCooperationBo> build, @Param("bo")CustomerCooperationBo bo); Page<CustomerCooperationVo> selectCooperationList(IPage<CustomerCooperationBo> build, @Param("bo")CustomerCooperationBo bo);
/**
* 供应商合作记录数量
* @param bo
* @return
*/
int countByBo(@Param("bo")CustomerCooperationBo bo);
} }
...@@ -12,6 +12,8 @@ import com.dsk.cscec.domain.vo.CustomerApproveVo; ...@@ -12,6 +12,8 @@ import com.dsk.cscec.domain.vo.CustomerApproveVo;
import com.dsk.cscec.domain.vo.CustomerCooperationVo; import com.dsk.cscec.domain.vo.CustomerCooperationVo;
import com.dsk.cscec.domain.vo.CustomerInfoVo; import com.dsk.cscec.domain.vo.CustomerInfoVo;
import java.util.Map;
/** /**
* 组织维表(DCustomer)表服务接口 * 组织维表(DCustomer)表服务接口
* *
...@@ -20,10 +22,27 @@ import com.dsk.cscec.domain.vo.CustomerInfoVo; ...@@ -20,10 +22,27 @@ import com.dsk.cscec.domain.vo.CustomerInfoVo;
*/ */
public interface ICustomerInfoService extends IService<DCustomer> { public interface ICustomerInfoService extends IService<DCustomer> {
/**
* 供应商分类列表
* @param bo
* @param query
* @return
*/
TableDataInfo<CustomerInfoVo> queryPageList(CustomerInfoBo bo, PageQuery query); TableDataInfo<CustomerInfoVo> queryPageList(CustomerInfoBo bo, PageQuery query);
/**
* 供应商准入情况
* @param bo
* @return
*/
CustomerApproveVo queryApproveByBo(CustomerInfoBo bo); CustomerApproveVo queryApproveByBo(CustomerInfoBo bo);
/**
* 咨询机构合作记录
* @param bo
* @param query
* @return
*/
TableDataInfo<AdvisoryBodyVo> queryAdvisoryList(AdvisoryBodyBo bo, PageQuery query); TableDataInfo<AdvisoryBodyVo> queryAdvisoryList(AdvisoryBodyBo bo, PageQuery query);
/** /**
...@@ -33,4 +52,11 @@ public interface ICustomerInfoService extends IService<DCustomer> { ...@@ -33,4 +52,11 @@ public interface ICustomerInfoService extends IService<DCustomer> {
* @return * @return
*/ */
TableDataInfo<CustomerCooperationVo> queryCooperationList(CustomerCooperationBo bo,PageQuery query); TableDataInfo<CustomerCooperationVo> queryCooperationList(CustomerCooperationBo bo,PageQuery query);
/**
* 内部合作统计
* @param companyName
* @return
*/
Map<String,Object> cooperationStatistic(String companyName);
} }
...@@ -28,6 +28,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -28,6 +28,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import java.util.HashMap;
import java.util.Map; import java.util.Map;
/** /**
...@@ -97,6 +98,7 @@ public class CustomerInfoServiceImpl extends ServiceImpl<DCustomerMapper, DCusto ...@@ -97,6 +98,7 @@ public class CustomerInfoServiceImpl extends ServiceImpl<DCustomerMapper, DCusto
Assert.isTrue(false,"参数不能为空"); Assert.isTrue(false,"参数不能为空");
} }
LambdaQueryWrapper<DCustomer> lqw = Wrappers.lambdaQuery(); LambdaQueryWrapper<DCustomer> lqw = Wrappers.lambdaQuery();
lqw.eq(DCustomer::getRecommendOrgId,QueryConstants.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());
...@@ -123,4 +125,30 @@ public class CustomerInfoServiceImpl extends ServiceImpl<DCustomerMapper, DCusto ...@@ -123,4 +125,30 @@ public class CustomerInfoServiceImpl extends ServiceImpl<DCustomerMapper, DCusto
Page<CustomerCooperationVo> page = dSubcontractMapper.selectCooperationList(query.build(),bo); Page<CustomerCooperationVo> page = dSubcontractMapper.selectCooperationList(query.build(),bo);
return TableDataInfo.build(page); return TableDataInfo.build(page);
} }
@Override
public Map<String, Object> cooperationStatistic(String companyName) {
if (StringUtil.isBlank(companyName)) {
return new HashMap<>();
}
AdvisoryBodyBo advisoryBodyBo = new AdvisoryBodyBo();
advisoryBodyBo.setContractOrgId(QueryConstants.LEVEL1_COMPANY_ID);
advisoryBodyBo.setAdvisoryBodyName(companyName);
LambdaQueryWrapper<DCustomer> lqw = Wrappers.lambdaQuery();
lqw.eq(DCustomer::getRecommendOrgId,QueryConstants.LEVEL1_COMPANY_ID);
lqw.eq(StringUtil.isNotBlank(companyName), DCustomer::getCustomerName, companyName);
CustomerCooperationBo customerCooperationBo = new CustomerCooperationBo();
customerCooperationBo.setSignOrgId(QueryConstants.LEVEL1_COMPANY_ID);
customerCooperationBo.setCustomerName(companyName);
Map<String, Object> result = new HashMap<>();
result.put("advisoryList", advisoryBodyMapper.countByBo(advisoryBodyBo));
result.put("cooperationList", subcontractMapper.countByBo(customerCooperationBo));
result.put("approveInfo", baseMapper.exists(lqw) ? 1 : 0);
// result.put("施工业绩", 0);
// result.put("在施工程情况", 0);
return result;
}
} }
...@@ -18,6 +18,7 @@ public class EnterpriseStatisticBody ...@@ -18,6 +18,7 @@ public class EnterpriseStatisticBody
*/ */
@NotNull(message = "企业id不能为空") @NotNull(message = "企业id不能为空")
private Integer companyId; private Integer companyId;
private String companyName;
private Boolean isFy = false; private Boolean isFy = false;
......
...@@ -8,6 +8,7 @@ import com.dsk.common.core.domain.R; ...@@ -8,6 +8,7 @@ import com.dsk.common.core.domain.R;
import com.dsk.common.core.page.TableDataInfo; import com.dsk.common.core.page.TableDataInfo;
import com.dsk.common.utils.EncodeIdUtil; import com.dsk.common.utils.EncodeIdUtil;
import com.dsk.common.utils.redis.RedisUtils; import com.dsk.common.utils.redis.RedisUtils;
import com.dsk.cscec.service.ICustomerInfoService;
import com.dsk.jsk.domain.*; import com.dsk.jsk.domain.*;
import com.dsk.system.utils.DskOpenApiUtil; import com.dsk.system.utils.DskOpenApiUtil;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
...@@ -39,6 +40,9 @@ public class EnterpriseService { ...@@ -39,6 +40,9 @@ public class EnterpriseService {
@Autowired @Autowired
private DskOpenApiUtil dskOpenApiUtil; private DskOpenApiUtil dskOpenApiUtil;
@Autowired
private ICustomerInfoService iCustomerInfoService;
public R label(EnterpriseInfoLabelBody body) throws Exception { public R label(EnterpriseInfoLabelBody body) throws Exception {
List<Map<String, Object>> mapList = new ArrayList<>(); List<Map<String, Object>> mapList = new ArrayList<>();
if (body.isVaildCid()) { if (body.isVaildCid()) {
...@@ -104,6 +108,10 @@ public class EnterpriseService { ...@@ -104,6 +108,10 @@ public class EnterpriseService {
Map statisticMapData = MapUtils.getMap(statisticMap, "data", null); Map statisticMapData = MapUtils.getMap(statisticMap, "data", null);
if (MapUtils.isEmpty(statisticMapData)) return R.ok(); if (MapUtils.isEmpty(statisticMapData)) return R.ok();
//内部合作
Map<String,Object> cooperation = iCustomerInfoService.cooperationStatistic(body.getCompanyName());
statisticMapData.put("cooperation",cooperation);
Map performance = MapUtils.getMap(statisticMapData, "performance"); Map performance = MapUtils.getMap(statisticMapData, "performance");
Map business = MapUtils.getMap(statisticMapData, "business"); Map business = MapUtils.getMap(statisticMapData, "business");
......
...@@ -61,6 +61,30 @@ ...@@ -61,6 +61,30 @@
order by dp.contract_sign_date desc order by dp.contract_sign_date desc
</select> </select>
<select id="countByBo" resultType="int">
select count(1)
from advisory_body_project abp
left join advisory_body ab on ab.advisory_body_id = abp.advisory_body_id
left join d_project dp on dp.project_key = abp.project_key
<where>
<if test="bo.advisoryBodyId != null and bo.advisoryBodyId != ''">
and ab.advisory_body_id = #{bo.advisoryBodyId}
</if>
<if test="bo.advisoryBodyCid != null and bo.advisoryBodyCid != ''">
and ab.advisory_body_cid = #{bo.advisoryBodyCid}
</if>
<if test="bo.advisoryBodyName != null and bo.advisoryBodyName != ''">
and ab.advisory_body_name = #{bo.advisoryBodyName}
</if>
<if test="bo.contractOrgId != null and bo.contractOrgId != ''">
and dp.contract_org_id = #{bo.contractOrgId}
</if>
<if test="bo.contractOrgName != null and bo.contractOrgName != ''">
and dp.contract_org_name = #{bo.contractOrgName}
</if>
</where>
</select>
<select id="selectAdvisoryBodyCidsByName" resultType="java.lang.Long"> <select id="selectAdvisoryBodyCidsByName" resultType="java.lang.Long">
select select
ab.advisory_body_cid ab.advisory_body_cid
......
...@@ -71,4 +71,24 @@ ...@@ -71,4 +71,24 @@
</where> </where>
order by ds.sign_date desc order by ds.sign_date desc
</select> </select>
<select id="countByBo" resultType="int">
select count (1)
from d_subcontract ds
left join d_project dp on dp.project_id = ds.project_id
<where>
<if test="bo.signOrgId != null and bo.signOrgId != ''">
and ds.sign_org_id =#{bo.signOrgId}
</if>
<if test="bo.signOrgName != null and bo.signOrgName != ''">
and ds.sign_org_name =#{bo.signOrgName}
</if>
<if test="bo.customerId != null and bo.customerId != ''">
and ds.customer_id =#{bo.customerId}
</if>
<if test="bo.customerName != null and bo.customerName != ''">
and ds.customer_name =#{bo.customerName}
</if>
</where>
</select>
</mapper> </mapper>
\ No newline at end of file
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