Commit 62bdc25c authored by liuChang's avatar liuChang

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

parents 2b216453 332b71b1
......@@ -142,6 +142,7 @@ security:
# actuator 监控配置
- /api/**
- /actuator/**
- /monitor/push/insert/**
# 多租户配置
......
......@@ -13,10 +13,7 @@ import com.dsk.cscec.service.IDCustomerService;
import com.dsk.system.domain.SysDept;
import com.dsk.system.domain.vo.SysDeptVo;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
......@@ -39,8 +36,8 @@ public class DCustomerController extends BaseController {
/**
* 供应商总台账筛选
*/
@GetMapping("/all/searchList")
public TableDataInfo<DCustomer> allSearchList(DCustomerSearchBo bo, PageQuery query) {
@PostMapping("/all/searchList")
public TableDataInfo<DCustomer> allSearchList(@RequestBody DCustomerSearchBo bo, PageQuery query) {
return baseService.allSearchList(bo,query);
}
......
......@@ -541,5 +541,10 @@ public class DCustomer implements Serializable {
*/
@TableField(exist = false)
private Integer projectCooperationCount;
/**
* jsk企业id
*/
@TableField(exist = false)
private Integer companyId;
}
package com.dsk.cscec.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.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
......@@ -10,12 +13,17 @@ import com.dsk.cscec.mapper.DCustomerMapper;
import com.dsk.cscec.domain.DCustomer;
import com.dsk.cscec.mapper.DSubcontractMapper;
import com.dsk.cscec.service.IDCustomerService;
import com.dsk.search.service.BusinessOpportunityRadarService;
import lombok.extern.slf4j.Slf4j;
import org.springdoc.core.converters.models.PageableAsQueryParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* 组织维表(DCustomer)表服务实现类
......@@ -23,11 +31,14 @@ import java.util.List;
* @author lcl
* @since 2023-12-08 14:57:26
*/
@Slf4j
@Service
public class DCustomerServiceImpl extends ServiceImpl<DCustomerMapper, DCustomer> implements IDCustomerService {
@Resource
private DSubcontractMapper subcontractMapper;
@Autowired
private BusinessOpportunityRadarService opportunityRadarService;
@Override
public TableDataInfo<DCustomer> allSearchList(DCustomerSearchBo bo, PageQuery query) {
......@@ -39,6 +50,16 @@ public class DCustomerServiceImpl extends ServiceImpl<DCustomerMapper, DCustomer
customer.setEnterpriseCooperationCount(subcontractMapper.selectEnterpriseCountByCustomerId(customer.getCustomerId()));
//项目合作数量
customer.setProjectCooperationCount(subcontractMapper.selectProjectCountByCustomerId(customer.getCustomerId()));
try {
Map<String, Object> map = opportunityRadarService.enterpriseByName(customer.getCustomerName());
if (!ObjectUtils.isEmpty(map.get("data"))) {
Map<String, Object> data = BeanUtil.beanToMap(map.get("data"));
Integer companyId = MapUtil.getInt(data, "jskEid");
customer.setCompanyId(companyId);
}
}catch (Exception e){
//
}
}
}
return TableDataInfo.build(page);
......
......@@ -16,4 +16,9 @@ public class PushMonitorCompanyPageVo extends BasePage {
* 查询条件
*/
private ConditionVo condition;
/**
* 用户id
*/
private Long userId = 98L;
}
......@@ -13,5 +13,10 @@ import lombok.Data;
@Data
public class PushMonitorDynamicPageVo extends BasePage {
/**
* 用户id
*/
private Long userId = 98L;
private ConditionVo condition;
}
......@@ -16,4 +16,9 @@ public class PushMonitorReportPageVo extends BasePage {
* 查询条件
*/
private ConditionVo condition;
/**
* 用户id
*/
private Long userId = 98L;
}
......@@ -64,9 +64,13 @@ public class MonitorServiceImpl implements MonitorService {
if (ObjectUtil.isNotEmpty(userId)) {
monitorRulesDto.setUserId(userId);
}
if (ObjectUtil.isEmpty(monitorRulesDto.getId())) {
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("user_id", monitorRulesDto.getUserId());
PushMonitorRules detail = rulesMapper.selectOne(queryWrapper);
if (ObjectUtil.isEmpty(detail)) {
rulesMapper.insert(monitorRulesDto);
} else {
monitorRulesDto.setId(detail.getId());
rulesMapper.updateById(monitorRulesDto);
}
return R.ok();
......@@ -88,6 +92,7 @@ public class MonitorServiceImpl implements MonitorService {
public TableDataInfo companyDynamicPage(PushMonitorDynamicPageVo pageVo) throws Exception {
Long userId = LoginHelper.getUserId();
if (ObjectUtil.isNotEmpty(userId)) {
pageVo.setUserId(userId);
pageVo.getCondition().setUserId(userId);
}
Map<String, Object> map = dskOpenApiUtil.requestBody("/operate/monitor/company/info/companyDynamicList", BeanUtil.beanToMap(pageVo, false, false));
......@@ -106,6 +111,7 @@ public class MonitorServiceImpl implements MonitorService {
public TableDataInfo reportPage(PushMonitorReportPageVo pageVo) throws Exception {
Long userId = LoginHelper.getUserId();
if (ObjectUtil.isNotEmpty(userId)) {
pageVo.setUserId(userId);
pageVo.getCondition().setUserId(userId);
}
Map<String, Object> map = dskOpenApiUtil.requestBody("/operate/monitor/company/info/monitor/report", BeanUtil.beanToMap(pageVo, false, false));
......@@ -116,6 +122,7 @@ public class MonitorServiceImpl implements MonitorService {
public TableDataInfo companyPage(PushMonitorCompanyPageVo pageVo) throws Exception {
Long userId = LoginHelper.getUserId();
if (ObjectUtil.isNotEmpty(userId)) {
pageVo.setUserId(userId);
pageVo.getCondition().setUserId(userId);
}
Map<String, Object> map = dskOpenApiUtil.requestBody("/operate/monitor/company/supplier/system/paging", BeanUtil.beanToMap(pageVo, false, false));
......@@ -208,6 +215,7 @@ public class MonitorServiceImpl implements MonitorService {
}
importAddVo.setNames(companyList);
Map<String, Object> map = dskOpenApiUtil.requestBody("/operate/monitor/company/supplier/system/addPatch", BeanUtil.beanToMap(importAddVo, false, false));
log.info("systemImport==================================>" + map);
return BeanUtil.toBean(map, R.class);
}
......
......@@ -12,24 +12,37 @@
from d_customer
where recommend_org_id = 'F17305B4EA4444CBAB12892C7B99E475'
<if test="bo.customerName != null and bo.customerName != '' "> and customer_name like concat('%',#{bo.customerName},'%')</if>
<if test="bo.region != null and bo.region != '' ">
and register_region in
<foreach collection="region" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="bo.province != null and bo.province != '' ">
and register_province in
<foreach collection="province" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="bo.city != null and bo.city != '' ">
and register_city in
<foreach collection="city" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<!-- <if test="bo.region != null and bo.region != '' ">-->
<!-- and register_region in-->
<!-- <foreach collection="region" item="item" open="(" separator="," close=")">-->
<!-- #{item}-->
<!-- </foreach>-->
<!-- </if>-->
<choose>
<when test="bo.province != null and bo.province.size > 0 and (bo.city == null or bo.city.size == 0) ">
and register_province in
<foreach collection="province" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</when>
<when test="bo.city != null and bo.city.size > 0 ">
and register_city in
<foreach collection="city" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</when>
<otherwise>
and ( register_province in
<foreach collection="province" item="item" open="(" separator="," close=")">
#{item}
</foreach>
or register_city in
<foreach collection="city" item="item" open="(" separator="," close=")">
#{item}
</foreach>
)
</otherwise>
</choose>
<if test="bo.customerClass != null and bo.customerClass != '' ">
and customer_class in
<foreach collection="customerClass" item="item" open="(" separator="," close=")">
......
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