Commit ffde0bf7 authored by danfuman's avatar danfuman

Merge branch 'V20231129-中建一局二公司' of http://192.168.60.201/root/dsk-operate-sys...

Merge branch 'V20231129-中建一局二公司' of http://192.168.60.201/root/dsk-operate-sys into V20231129-中建一局二公司
parents 09cc08a2 e582487a
......@@ -20,6 +20,7 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 供应商相关
......@@ -78,7 +79,12 @@ public class CustomerInfoController extends BaseController {
return iCustomerInfoService.queryCooperationList(bo, query);
}
/**
* 查询供应商基本情况
*/
@GetMapping("/queryBasicInfo")
public R<Map<String,Long>> queryBasicInfo() {
return R.ok(iCustomerInfoService.queryBasicInfo());
}
}
......@@ -50,5 +50,7 @@ public interface DCustomerMapper extends BaseMapper<DCustomer> {
List<CertificateVo> selectOtherCertificate(String customerId);
//获取所有供应商的企业名称列表
List<String> allSearchCompanyNameList();
}
......@@ -59,4 +59,9 @@ public interface ICustomerInfoService extends IService<DCustomer> {
* @return
*/
Map<String,Object> cooperationStatistic(String companyName);
/**
* 查询供应商基本情况
*/
Map<String, Long> queryBasicInfo();
}
......@@ -54,23 +54,23 @@ public class CustomerInfoServiceImpl extends ServiceImpl<DCustomerMapper, DCusto
@Override
public TableDataInfo<CustomerInfoVo> queryPageList(CustomerInfoBo bo, PageQuery query) {
if("劳务分包".equals(bo.getCustomerClass())){
if ("劳务分包".equals(bo.getCustomerClass())) {
bo.setServiceTeamLogo("N");
}
if("劳务分包队伍".equals(bo.getCustomerClass())){
if ("劳务分包队伍".equals(bo.getCustomerClass())) {
bo.setCustomerClass("劳务分包");
bo.setServiceTeamLogo("Y");
}
Page<CustomerInfoVo> page = baseMapper.queryListByType(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());
//关键字标红
if(!ObjectUtils.isEmpty(bo.getCustomerName())){
if (!ObjectUtils.isEmpty(bo.getCustomerName())) {
item.setCustomerName(StringUtils.markInRed(item.getCustomerName(), bo.getCustomerName()));
}
try {
......@@ -80,11 +80,11 @@ public class CustomerInfoServiceImpl extends ServiceImpl<DCustomerMapper, DCusto
Integer companyId = MapUtil.getInt(data, "jskEid");
item.setCompanyId(companyId);
}
}catch (Exception e){
} catch (Exception 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()));
}
});
......@@ -94,18 +94,18 @@ public class CustomerInfoServiceImpl extends ServiceImpl<DCustomerMapper, DCusto
@Override
public CustomerApproveVo queryApproveByBo(CustomerInfoBo bo) {
if(ObjectUtil.isNull(bo.getCustomerKey()) && StringUtil.isBlank(bo.getCustomerName()) && StringUtil.isBlank(bo.getUnifySocialCode())){
Assert.isTrue(false,"参数不能为空");
if (ObjectUtil.isNull(bo.getCustomerKey()) && StringUtil.isBlank(bo.getCustomerName()) && StringUtil.isBlank(bo.getUnifySocialCode())) {
Assert.isTrue(false, "参数不能为空");
}
LambdaQueryWrapper<DCustomer> lqw = Wrappers.lambdaQuery();
lqw.eq(DCustomer::getRecommendOrgId, AdvisoryBodyManageQueryConstants.LEVEL1_COMPANY_ID);
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.getCustomerName()),DCustomer::getCustomerName,bo.getCustomerName());
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.getCustomerName()), DCustomer::getCustomerName, bo.getCustomerName());
lqw.orderByDesc(DCustomer::getApproveDate2);
lqw.last("limit 1");
DCustomer dCustomer = baseMapper.selectOne(lqw);
if(ObjectUtil.isNotEmpty(dCustomer)){
if (ObjectUtil.isNotEmpty(dCustomer)) {
//营业执照url
dCustomer.setBusinessLicenseList(baseMapper.selectBusinessLicense(dCustomer.getCustomerId()));
//组织机构代码证url
......@@ -133,7 +133,7 @@ public class CustomerInfoServiceImpl extends ServiceImpl<DCustomerMapper, DCusto
@Override
public TableDataInfo<AdvisoryBodyVo> queryAdvisoryList(AdvisoryBodyBo bo, PageQuery query) {
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 -> {
try {
Map<String, Object> map = opportunityRadarService.enterpriseByName(vo.getOwnerName());
......@@ -157,11 +157,11 @@ public class CustomerInfoServiceImpl extends ServiceImpl<DCustomerMapper, DCusto
@Override
public TableDataInfo<CustomerCooperationVo> queryCooperationList(CustomerCooperationBo bo, PageQuery query) {
if(StringUtil.isBlank(bo.getCustomerId()) && StringUtil.isBlank(bo.getCustomerName())){
Assert.isTrue(false,"供应商不能为空");
if (StringUtil.isBlank(bo.getCustomerId()) && StringUtil.isBlank(bo.getCustomerName())) {
Assert.isTrue(false, "供应商不能为空");
}
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);
}
......@@ -190,4 +190,41 @@ public class CustomerInfoServiceImpl extends ServiceImpl<DCustomerMapper, DCusto
// result.put("在施工程情况", 0);
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;
}
}
......@@ -113,4 +113,101 @@ public class EnterpriseCreditController {
return enterpriseCreditService.judicialFreezesPage(body);
}
/***
*@Description: 信用中国-行政许可信息
*@Param:
*@return: com.dsk.common.core.page.TableDataInfo
*@Author: Dgm
*@date: 2024/5/13 14:24
*/
@PostMapping(value = "/selectChinaXzxkPage")
public TableDataInfo selectChinaXzxkPage(@RequestBody @Valid EnterpriseCreditChinaPageBody body) throws Exception {
return enterpriseCreditService.selectChinaXzxkPage(body);
}
/***
*@Description: 信用中国-行政许可信息-详情
*@Param:
*@return: com.dsk.common.core.page.TableDataInfo
*@Author: Dgm
*@date: 2024/5/13 14:24
*/
@PostMapping(value = "/selectChinaXzxk/detail")
public R selectChinaXzxkDetail(@RequestBody @Valid EnterpriseCreditChinaDetailBody body) throws Exception {
return enterpriseCreditService.selectChinaXzxkDetail(body);
}
/***
*@Description: 信用中国-行政处罚信息
*@Param:
*@return: com.dsk.common.core.page.TableDataInfo
*@Author: Dgm
*@date: 2024/5/13 14:24
*/
@PostMapping(value = "/selectChinaXzcfPage")
public TableDataInfo selectChinaXzcfPage(@RequestBody @Valid EnterpriseCreditChinaPageBody body) throws Exception {
return enterpriseCreditService.selectChinaXzcfPage(body);
}
/***
*@Description: 信用中国-行政处罚信息详情
*@Param:
*@return: com.dsk.common.core.page.TableDataInfo
*@Author: Dgm
*@date: 2024/5/13 14:24
*/
@PostMapping(value = "/selectChinaXzcf/detail")
public R selectChinaXzcfDetail(@RequestBody @Valid EnterpriseCreditChinaDetailBody body) throws Exception {
return enterpriseCreditService.selectChinaXzcfDetail(body);
}
/***
*@Description: 信用中国-诚实守信-纳税信用等级信息
*@Param:
*@return: com.dsk.common.core.page.TableDataInfo
*@Author: Dgm
*@date: 2024/5/13 14:24
*/
@PostMapping(value = "/selectChinaNsxydjPage")
public TableDataInfo selectChinaNsxydjPage(@RequestBody @Valid EnterpriseCreditChinaPageBody body) throws Exception {
return enterpriseCreditService.selectChinaNsxydjPage(body);
}
/***
*@Description: 信用中国-诚实守信-海关高级认证企业
*@Param:
*@return: com.dsk.common.core.page.TableDataInfo
*@Author: Dgm
*@date: 2024/5/13 14:24
*/
@PostMapping(value = "/selectChinaHggjczqyPage")
public TableDataInfo selectChinaHggjczqyPage(@RequestBody @Valid EnterpriseCreditChinaPageBody body) throws Exception {
return enterpriseCreditService.selectChinaHggjczqyPage(body);
}
/***
*@Description: 信用中国-诚实守信-严重失信主体名单
*@Param:
*@return: com.dsk.common.core.page.TableDataInfo
*@Author: Dgm
*@date: 2024/5/13 14:24
*/
@PostMapping(value = "/selectChinaYzsxztmdPage")
public TableDataInfo selectChinaYzsxztmdPage(@RequestBody @Valid EnterpriseCreditChinaPageBody body) throws Exception {
return enterpriseCreditService.selectChinaYzsxztmdPage(body);
}
/***
*@Description: 信用中国-诚实守信-经营异常
*@Param:
*@return: com.dsk.common.core.page.TableDataInfo
*@Author: Dgm
*@date: 2024/5/13 14:24
*/
@PostMapping(value = "/selectChinaJyycPage")
public TableDataInfo selectChinaJyycPage(@RequestBody @Valid EnterpriseCreditChinaPageBody body) throws Exception {
return enterpriseCreditService.selectChinaJyycPage(body);
}
}
package com.dsk.jsk.domain;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import javax.validation.constraints.NotNull;
@Data
@ToString
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
public class EnterpriseCreditChinaDetailBody extends BasePage {
/**
* 企业id
*/
@NotNull(message = "id不能为空")
private String id;
}
package com.dsk.jsk.domain;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import javax.validation.constraints.NotNull;
@Data
@ToString
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
public class EnterpriseCreditChinaPageBody extends BasePage {
/**
* 企业id
*/
@NotNull(message = "企业id不能为空")
private Integer cid;
public boolean isVaildCid() {
return 0 == cid;
}
}
......@@ -144,4 +144,56 @@ public class EnterpriseCreditService {
Map<String, Object> map = dskOpenApiUtil.requestBody("/operate/enterpriseCredit/judicialFreezesPage", BeanUtil.beanToMap(body, false, false));
return dskOpenApiUtil.responsePage(map);
}
public TableDataInfo selectChinaXzxkPage(EnterpriseCreditChinaPageBody body) throws Exception{
body.setPageSize(1000);
if (body.isVaildCid()) return new TableDataInfo(new ArrayList<>(), 0);
Map<String, Object> map = dskOpenApiUtil.requestBody("/operate/enterpriseCredit/selectChinaXzxkPage", BeanUtil.beanToMap(body, false, false));
return dskOpenApiUtil.responsePage(map);
}
public R selectChinaXzxkDetail(EnterpriseCreditChinaDetailBody body) throws Exception{
Map<String, Object> map = dskOpenApiUtil.requestBody("/operate/enterpriseCredit/selectChinaXzxkDetail", BeanUtil.beanToMap(body, false, false));
return BeanUtil.toBean(map, R.class);
}
public TableDataInfo selectChinaXzcfPage(EnterpriseCreditChinaPageBody body) throws Exception{
body.setPageSize(1000);
if (body.isVaildCid()) return new TableDataInfo(new ArrayList<>(), 0);
Map<String, Object> map = dskOpenApiUtil.requestBody("/operate/enterpriseCredit/selectChinaXzcfPage", BeanUtil.beanToMap(body, false, false));
return dskOpenApiUtil.responsePage(map);
}
public R selectChinaXzcfDetail(EnterpriseCreditChinaDetailBody body) throws Exception{
Map<String, Object> map = dskOpenApiUtil.requestBody("/operate/enterpriseCredit/selectChinaXzcfDetail", BeanUtil.beanToMap(body, false, false));
return BeanUtil.toBean(map, R.class);
}
public TableDataInfo selectChinaNsxydjPage(EnterpriseCreditChinaPageBody body) throws Exception{
body.setPageSize(1000);
if (body.isVaildCid()) return new TableDataInfo(new ArrayList<>(), 0);
Map<String, Object> map = dskOpenApiUtil.requestBody("/operate/enterpriseCredit/selectChinaNsxydjPage", BeanUtil.beanToMap(body, false, false));
return dskOpenApiUtil.responsePage(map);
}
public TableDataInfo selectChinaHggjczqyPage(EnterpriseCreditChinaPageBody body) throws Exception{
body.setPageSize(1000);
if (body.isVaildCid()) return new TableDataInfo(new ArrayList<>(), 0);
Map<String, Object> map = dskOpenApiUtil.requestBody("/operate/enterpriseCredit/selectChinaHggjczqyPage", BeanUtil.beanToMap(body, false, false));
return dskOpenApiUtil.responsePage(map);
}
public TableDataInfo selectChinaYzsxztmdPage(EnterpriseCreditChinaPageBody body) throws Exception{
body.setPageSize(1000);
if (body.isVaildCid()) return new TableDataInfo(new ArrayList<>(), 0);
Map<String, Object> map = dskOpenApiUtil.requestBody("/operate/enterpriseCredit/selectChinaYzsxztmdPage", BeanUtil.beanToMap(body, false, false));
return dskOpenApiUtil.responsePage(map);
}
public TableDataInfo selectChinaJyycPage(EnterpriseCreditChinaPageBody body) throws Exception{
body.setPageSize(1000);
if (body.isVaildCid()) return new TableDataInfo(new ArrayList<>(), 0);
Map<String, Object> map = dskOpenApiUtil.requestBody("/operate/enterpriseCredit/selectChinaJyycPage", BeanUtil.beanToMap(body, false, false));
return dskOpenApiUtil.responsePage(map);
}
}
......@@ -451,7 +451,7 @@ public class EnterpriseService {
if (body.isVaildCid()) {
return new TableDataInfo(new ArrayList<>(), 0);
}
Map<String, Object> map = dskOpenApiUtil.requestBody("/api/jsk/enterpriseCert/certPage", BeanUtil.beanToMap(body, false, false));
Map<String, Object> map = dskOpenApiUtil.requestBody("/operate/enterpriseCert/certPage", BeanUtil.beanToMap(body, false, false));
return dskOpenApiUtil.responsePage(map);
}
......
......@@ -167,4 +167,14 @@ public class MonitorController {
return monitorService.systemDetail(detailVo);
}
/**
* 监控列表添加默认供应商企业
* @Author: lc
* @return
*/
@PostMapping(value = "/add/default")
public R addDefaultCompany() {
return monitorService.addDefaultCompany();
}
}
package com.dsk.monitor.domain.vo;
import lombok.Data;
import java.util.List;
/**
* @ClassName UpdateMonitorCompanyVo
* @Description 监控更新
* @Author lc
* @Date 2024/05/14 11:05
* @Version
*/
@Data
public class UpdateMonitorCompanyVo {
/**
* 新增加企业id
*/
private List<Integer> addList;
/**
* 被删除企业id
*/
private List<Integer> dropList;
private String systemCode = "zjyj";
}
package com.dsk.monitor.job;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.ObjectUtil;
import com.dsk.common.core.domain.R;
import com.dsk.common.helper.LoginHelper;
import com.dsk.common.utils.redis.RedisUtils;
import com.dsk.cscec.mapper.DCustomerMapper;
import com.dsk.monitor.domain.vo.PushMonitorCompanyAddVo;
import com.dsk.monitor.domain.vo.UpdateMonitorCompanyVo;
import com.dsk.search.service.BusinessOpportunityRadarService;
import com.dsk.system.utils.DskOpenApiUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* @author lc
* @date 2024/5/13 17:40
*/
@Component
@Slf4j
public class MonitorScheduledTask {
@Resource
private DCustomerMapper customerMapper;
@Autowired
private BusinessOpportunityRadarService opportunityRadarService;
@Resource
private DskOpenApiUtil dskOpenApiUtil;
/**
* 每天3点更新已监控企业
*/
// @Scheduled(cron = "0 0 0/2 * * ?")
@Scheduled(cron = "0 0 3 * * ?")
public void updateMonitorCompany(){
// 中建服务 查找当前供应商名单 传到监控服务
//获取所有供应商企业名称
List<String> list = customerMapper.allSearchCompanyNameList();
List<Integer> newList = new ArrayList<>();
for (String companyName : list) {
//循环匹配 得到能关联上的企业id
Map<String, Object> map = opportunityRadarService.enterpriseByName(companyName);
if (!ObjectUtils.isEmpty(map.get("data"))) {
Map<String, Object> data = BeanUtil.beanToMap(map.get("data"));
Integer companyId = MapUtil.getInt(data, "jskEid");
newList.add(companyId);
}
}
//如果没有上一次的企业id数据则直接返回
if (!RedisUtils.hasKey("monitorCompanyList")){
RedisUtils.setCacheList("monitorCompanyList",newList);
//设置过期时间两天
RedisUtils.expire("monitorCompanyList",172800);
log.info("redis没有上一次供应商数据 无需进行更新!");
return;
}
List<Integer> oldList = new ArrayList<>();
oldList = RedisUtils.getCacheList("monitorCompanyList");
RedisUtils.setCacheList("monitorCompanyList",newList);
//设置过期时间两天
RedisUtils.expire("monitorCompanyList",172800);
List<Integer> oldListCopy = oldList;
//被删除的
oldList.removeAll(newList);
//新旧list完全相同 无需更新
if (oldList.size()==0 && oldListCopy.size()==newList.size()){
log.info("供应商数据没有变化 无需更新监控!");
return;
}
//新增加的
newList.removeAll(oldListCopy);
UpdateMonitorCompanyVo updateVo = new UpdateMonitorCompanyVo();
updateVo.setAddList(newList);
updateVo.setDropList(oldList);
updateVo.setSystemCode("ZJYJ");
log.info("中建一局用户更新默认监控企业!");
dskOpenApiUtil.requestBody("/operate/monitor/company/zjyj/updateDefaultCompany", BeanUtil.beanToMap(updateVo, false, false));
}
}
......@@ -136,7 +136,6 @@ public interface MonitorService {
*@date: 2023/12/9 10:03
*/
R systemDetail(PushMonitorSystemDetailVo importAddVo);
/***
*@Description: 是否工作日
*@Param: holidayVo 信息
......@@ -145,4 +144,6 @@ public interface MonitorService {
*@date: 2023/12/9 10:03
*/
Map<String, Object> settingHoliday(PushSettingHolidayVo holidayVo) throws Exception;
R addDefaultCompany();
}
package com.dsk.monitor.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dsk.common.core.domain.R;
import com.dsk.common.core.page.TableDataInfo;
import com.dsk.common.helper.LoginHelper;
import com.dsk.common.utils.redis.RedisUtils;
import com.dsk.cscec.mapper.DCustomerMapper;
import com.dsk.monitor.domain.dto.PushMonitorRules;
import com.dsk.monitor.domain.vo.*;
import com.dsk.monitor.mapper.PushMonitorInfoMapper;
import com.dsk.monitor.mapper.PushMonitorRulesMapper;
import com.dsk.monitor.service.MonitorService;
import com.dsk.search.service.BusinessOpportunityRadarService;
import com.dsk.system.utils.DskOpenApiUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.MapUtils;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
......@@ -42,6 +47,12 @@ public class MonitorServiceImpl implements MonitorService {
@Resource
private PushMonitorRulesMapper rulesMapper;
@Resource
private DCustomerMapper customerMapper;
@Autowired
private BusinessOpportunityRadarService opportunityRadarService;
@Resource
private DskOpenApiUtil dskOpenApiUtil;
......@@ -327,4 +338,30 @@ public class MonitorServiceImpl implements MonitorService {
log.info("companyDynamicPage=============================>" + map);
return map;
}
@Override
public R addDefaultCompany() {
//获取所有供应商企业名称
List<String> list = customerMapper.allSearchCompanyNameList();
List<Integer> idList = new ArrayList<>();
for (String companyName : list) {
//循环匹配 得到能关联上的企业id
Map<String, Object> map = opportunityRadarService.enterpriseByName(companyName);
if (!ObjectUtils.isEmpty(map.get("data"))) {
Map<String, Object> data = BeanUtil.beanToMap(map.get("data"));
Integer companyId = MapUtil.getInt(data, "jskEid");
idList.add(companyId);
}
}
PushMonitorCompanyAddVo addVo = new PushMonitorCompanyAddVo();
addVo.setSystemCode("ZJYJ");
addVo.setCid(idList);
Long userId = LoginHelper.getUserId();
if (ObjectUtil.isNotEmpty(userId)) {
addVo.setUserId(userId);
}
log.info("中建一局用户添加默认监控企业!");
Map<String, Object> map = dskOpenApiUtil.requestBody("/operate/monitor/company/zjyj/addDefaultCompany", BeanUtil.beanToMap(addVo, false, false));
return BeanUtil.toBean(map, R.class);
}
}
......@@ -209,4 +209,18 @@
<select id="selectOtherCertificate" resultType="com.dsk.cscec.domain.vo.CertificateVo">
select * from d_customer_other_certificate where customer_id =#{customerId}
</select>
<select id="allSearchCompanyNameList" resultType="string">
select
dc.customer_name
from
d_customer dc
left join f_supplier_limited fsl on
(fsl.flaowufbid = dc.customer_id
or fsl.fzhuanyefbid = dc.customer_id
or fsl.ffgid = dc.customer_id
or fsl.fzlid = dc.customer_id)
where
dc.recommend_org_id = 'F17305B4EA4444CBAB12892C7B99E475'
</select>
</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