Commit 3ad08473 authored by lcl's avatar lcl

u

parent d3a8ce0d
......@@ -14,6 +14,7 @@ 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;
......@@ -43,6 +44,14 @@ public class DCustomerController extends BaseController {
return baseService.allSearchList(bo,query);
}
/**
* 供应商信息
*/
@GetMapping("/info/{customerKey}")
public R<DCustomer> info(@PathVariable String customerKey) {
return R.ok(baseService.info(customerKey));
}
}
......@@ -3,6 +3,8 @@ package com.dsk.cscec.domain;
import java.util.Date;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
/**
......@@ -19,6 +21,7 @@ public class DCustomer implements Serializable {
/**
* 客商主键
*/
@TableId(value = "customer_key")
private Long customerKey;
/**
* ipm供应商id
......@@ -528,5 +531,15 @@ public class DCustomer implements Serializable {
* 数据更新时间
*/
private Date loadTime;
/**
* 企业合作数量
*/
@TableField(exist = false)
private Integer enterpriseCooperationCount;
/**
* 项目合作数量
*/
@TableField(exist = false)
private Integer projectCooperationCount;
}
......@@ -2,6 +2,8 @@ package com.dsk.cscec.domain.bo;
import lombok.Data;
import java.util.List;
/**
* @Author lcl
* @Data 2023/12/8 16:07
......@@ -15,30 +17,42 @@ public class DCustomerSearchBo {
/**
* 区域
*/
private String[] region;
private List<String> region;
/**
* 省
*/
private String[] province;
private List<String> province;
/**
* 市
*/
private String[] city;
private List<String> city;
/**
* 供应商类别
*/
private String[] customerClass;
private List<String> customerClass;
/**
* 供应商状态
*/
private String[] customerState;
private List<String> customerState;
/**
* 评价等级
*/
private String[] creditLevel;
private List<String> creditLevel;
/**
* 资质等级
*/
private String[] credential;
private List<String> credential;
/**
* 准入时间(开始)
*/
private String approveDateBegion;
/**
* 准入时间(结束)
*/
private String approveDateEnd;
/**
* 是否队伍 0:否 1:是
*/
private Integer isTeam;
}
......@@ -16,5 +16,7 @@ public interface IDCustomerService extends IService<DCustomer> {
TableDataInfo<DCustomer> allSearchList(DCustomerSearchBo bo, PageQuery query);
DCustomer info(String customerKey);
}
package com.dsk.cscec.service.impl;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dsk.common.core.domain.PageQuery;
import com.dsk.common.core.page.TableDataInfo;
......@@ -8,6 +10,10 @@ import com.dsk.cscec.mapper.DCustomerMapper;
import com.dsk.cscec.domain.DCustomer;
import com.dsk.cscec.service.IDCustomerService;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.util.ArrayList;
import java.util.List;
/**
* 组织维表(DCustomer)表服务实现类
......@@ -20,7 +26,52 @@ public class DCustomerServiceImpl extends ServiceImpl<DCustomerMapper, DCustomer
@Override
public TableDataInfo<DCustomer> allSearchList(DCustomerSearchBo bo, PageQuery query) {
return TableDataInfo.build(baseMapper.allSearchList(query.build(),bo));
dealWithCustomerClass(bo);
Page<DCustomer> page = baseMapper.allSearchList(query.build(), bo);
if (CollectionUtils.isNotEmpty(page.getRecords())) {
for (DCustomer customer : page.getRecords()) {
}
}
return TableDataInfo.build(page);
}
@Override
public DCustomer info(String customerKey) {
return baseMapper.selectById(customerKey);
}
private void dealWithCustomerClass(DCustomerSearchBo bo) {
if (!ObjectUtils.isEmpty(bo.getCustomerClass())) {
List<String> list = new ArrayList<>();
Integer isTeam = null;
for (String customerClass : bo.getCustomerClass()) {
switch (customerClass){
case "专业分包":
list.add("专业分包");
break;
case "物资设备":
list.add("分供");
break;
case "施工机械":
list.add("租赁");
break;
case "劳务分包":
if(isTeam == null) isTeam = 0;
list.add("劳务分包");
break;
case "劳务队伍":
if(isTeam == null) isTeam = 1;
list.add("劳务分包");
break;
default:
break;
}
}
bo.setCustomerClass(list);
bo.setIsTeam(isTeam);
}
}
}
......@@ -6,13 +6,58 @@
<select id="allSearchList" resultType="com.dsk.cscec.domain.DCustomer">
select
customer_code, customer_name, recommend_org, register_region, register_province, register_city, customer_class, primary_business, paytax_type, tax_rate,
customer_state, leader_name, labor_captain_phone, labor_captain_idcard, service_team_personnum, service_team_speciality, construct_job_scope, credential,
register_capital, contact_person, contact_phone, approve_date2, credit_level
customer_key, customer_id, customer_code, customer_name, recommend_org, register_region, register_province, register_city, customer_class, primary_business,
paytax_type, tax_rate, customer_state, leader_name, labor_captain_phone, labor_captain_idcard, service_team_personnum, service_team_speciality,
construct_job_scope, credential, register_capital, contact_person, contact_phone, approve_date2, credit_level
from d_customer
where recommend_org_id = 'F17305B4EA4444CBAB12892C7B99E475'
<if test="bo.customerName != null and bo.customerName != '' "> and customer_name like concat('%',#{bo.customerName},'%')</if>
order by approve_date2 desc
<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.customerClass != null and bo.customerClass != '' ">
and customer_class in
<foreach collection="customerClass" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="bo.customerState != null and bo.customerState != '' ">
and customer_state in
<foreach collection="customerState" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="bo.creditLevel != null and bo.creditLevel != '' ">
and credit_level in
<foreach collection="creditLevel" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="bo.credential != null and bo.credential != '' ">
and credential in
<foreach collection="credential" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="bo.approveDateBegion != null and bo.approveDateBegion != '' ">and approve_date2 &gt;= #{bo.approveDateBegion}</if>
<if test="bo.approveDateEnd != null and bo.approveDateEnd != '' ">and approve_date2 &lt;= #{bo.approveDateBegion} </if>
<if test="bo.isTeam != null"> and leader_name is <if test="bo.isTeam == 0">not</if> null </if>
order by approve_date2 desc
</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