Commit 5825fdf5 authored by yanghao's avatar yanghao

chore: 1、更新客户字段 productId->productIds, pickupPoint->pickupPoints并业务实现 2、新增字段 3、更新返回sql查询 4、更新sql

parent d4aad8ed
......@@ -14,3 +14,24 @@ CREATE TABLE `ecw_customer_competitor` (
PRIMARY KEY (`id`),
KEY (`create_time`)
) COMMENT='客户竞争对手表';
-- 添加新字段
alter table `ecw_customer` add column `first_deal_time` datetime default null COMMENT '首次成交时间';
alter table `ecw_customer` add column `get_method` Integer default null COMMENT '获取方式';
alter table `ecw_customer` add column `create_from` Integer default null COMMENT '创建入口';
alter table `ecw_customer` add column `customer_service_confirmed_time` datetime default null COMMENT '确认接收时间';
alter table `ecw_customer` add column `busi_country_ids` varchar(100) default null COMMENT '业务国家ids';
alter table `ecw_customer` add column `roles` varchar(100) default null COMMENT '客户角色';
alter table `ecw_customer` add column `competitor_ids` varchar(100) default null COMMENT '竞争对手ids';
alter table `ecw_customer` add column `weight_yearly` decimal(15, 2) DEFAULT 0 COMMENT '年度发货量';
alter table `ecw_customer` add column `num_yearly` int DEFAULT 0 COMMENT '年度发货次数';
alter table `ecw_customer` add column `default_billing` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否默认开票';
-- 更新表
alter table `ecw_customer`
change column `pickup_point` `pickup_points` varchar(100) DEFAULT NULL COMMENT '常用提货网点ids';
alter table `ecw_customer`
change column `product_id` `product_ids` varchar(300) DEFAULT NULL COMMENT '主营产品ids';
......@@ -109,11 +109,11 @@ public class CustomerDO extends BaseDO {
/**
* 产品id
*/
private Long productId;
private String productIds;
/**
* 常用提货网点
*/
private Long pickupPoint;
private String pickupPoints;
/**
* 关联会员账号
*/
......@@ -397,7 +397,7 @@ public class CustomerDO extends BaseDO {
* <p>
* 枚举 {@link TODO customer_role 字典}
*/
private Integer role;
private String roles;
/**
......@@ -407,9 +407,9 @@ public class CustomerDO extends BaseDO {
/**
* 竞争对手ID
* 竞争对手ID, 关联 customer_competitor 表主键
*/
private Long competitorId;
private String competitorIds;
/**
* 年度发货量
......
......@@ -75,10 +75,19 @@ public interface CustomerMapper extends BaseMapperX<CustomerDO> {
"",
"pt.title_zh as product_type_name_zh, pt.title_en as product_type_name_en,",
"",
"p.title_zh as product_name_zh, p.title_en as product_name_en,",
"(SELECT GROUP_CONCAT(title_zh) FROM ecw_product p WHERE FIND_IN_SET(p.id,(SELECT product_ids FROM ecw_customer WHERE id=c.id))) AS product_name_zh, ",
"(SELECT GROUP_CONCAT(title_en) FROM ecw_product p WHERE FIND_IN_SET(p.id,(SELECT product_ids FROM ecw_customer WHERE id=c.id))) AS product_name_en, ",
"",
"c.pickup_point,",
"n.title_zh as pickup_point_name_zh, n.title_en as pickup_point_name_en,",
"(SELECT GROUP_CONCAT(title_zh) FROM ecw_node n WHERE FIND_IN_SET(n.id,(SELECT pickup_points FROM ecw_customer WHERE id=c.id))) AS pickup_point_name_zh,",
"(SELECT GROUP_CONCAT(title_en) FROM ecw_node n WHERE FIND_IN_SET(n.id,(SELECT pickup_points FROM ecw_customer WHERE id=c.id))) AS pickup_point_name_en,",
"",
"(SELECT GROUP_CONCAT(name_zh) FROM ecw_country ct WHERE FIND_IN_SET(ct.id,(SELECT busi_country_ids FROM ecw_customer WHERE id=c.id))) AS busi_country_name_zh,",
"(SELECT GROUP_CONCAT(name_en) FROM ecw_country ct WHERE FIND_IN_SET(ct.id,(SELECT busi_country_ids FROM ecw_customer WHERE id=c.id))) AS busi_country_name_en,",
"",
"(SELECT GROUP_CONCAT(name) FROM ecw_customer_competitor ccp WHERE FIND_IN_SET(ccp.id,(SELECT competitor_ids FROM ecw_customer WHERE id=c.id))) AS competitor_names,",
"",
"uc.nickname as creator_name,",
"uu.nickname as updater_name,",
"",
"c.customer_service,",
"u.nickname as customer_service_name",
......@@ -88,9 +97,9 @@ public interface CustomerMapper extends BaseMapperX<CustomerDO> {
"left join ecw_customer_credit cc on c.credit_level = cc.id",
"left join ecw_country country on c.country = country.id",
"left join ecw_product_type pt on c.product_type = pt.id",
"left join ecw_product p on c.product_id = p.id",
"left join ecw_node n on c.pickup_point = n.id",
"left join system_user u on c.customer_service = u.id",
"left join system_user uc on c.creator = u.id",
"left join system_user uu on c.updater = u.id",
"where c.id = #{id}",
"</script>"
})
......
......@@ -46,11 +46,11 @@ public class CustomerCreateReqVO extends CustomerBaseVO {
@ApiModelProperty(value = "产品类型id")
private Long productType;
@ApiModelProperty(value = "产品id")
private Long productId;
@ApiModelProperty(value = "产品ids")
private String productIds;
@ApiModelProperty(value = "常用提货网点id")
private Long pickupPoint;
@ApiModelProperty(value = "常用提货网点ids")
private String pickupPoints;
@ApiModelProperty(value = "关联会员账号id")
private Long memberId;
......@@ -153,6 +153,51 @@ public class CustomerCreateReqVO extends CustomerBaseVO {
@ApiModelProperty(value = "客户银行账户", notes = "参见CustomerBankCreateReqVO")
private List<CustomerBankCreateReqVO> customerBanks;
// ======== 20240821 add start
/**
* 客户角色
* <p>
* 枚举 {@link TODO customer_role 字典}
*/
@ApiModelProperty(value = "客户角色")
private String roles;
/**
* 业务国家 逗号分隔
*/
@ApiModelProperty(value = "业务国家ids")
private String busiCountryIds;
/**
* 竞争对手IDs, 关联 customer_competitor 表主键
*/
@ApiModelProperty(value = "竞争对手IDs")
private String competitorIds;
/**
* 年度发货量
*/
@ApiModelProperty(value = "年度发货量")
private BigDecimal weightYearly;
/**
* 年度发货次数
*/
@ApiModelProperty(value = "年度发货次数")
private Integer numYearly;
/**
* 默认开票,1-是,0-否
*/
@ApiModelProperty(value = "默认开票,1-是,0-否")
private Boolean defaultBilling;
// ======== 20240821 add end
/**
......
......@@ -63,11 +63,11 @@ public class CustomerDetailRespVO extends CustomerBaseVO {
@ApiModelProperty(value = "产品类型id")
private Long productType;
@ApiModelProperty(value = "产品id")
private Long productId;
@ApiModelProperty(value = "产品ids")
private String productIds;
@ApiModelProperty(value = "常用提货网点id")
private Long pickupPoint;
@ApiModelProperty(value = "常用提货网点ids")
private String pickupPoints;
@ApiModelProperty(value = "关联会员账号id")
private Long memberId;
......@@ -96,9 +96,17 @@ public class CustomerDetailRespVO extends CustomerBaseVO {
//客户创建日期格式化
//@JsonFormat(value = "创建时间", example = "1652017501000")
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY,
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND,
timezone = TIME_ZONE_DEFAULT)
private Date createTime;
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND,
timezone = TIME_ZONE_DEFAULT)
private Date updateTime;
@ApiModelProperty(value = "创建人名称")
private String creatorName;
@ApiModelProperty(value = "更新人名称")
private String updaterName;
//--------发票信息
......@@ -182,6 +190,50 @@ public class CustomerDetailRespVO extends CustomerBaseVO {
private List<CustomerBankBackVO> customerBankBackVOList;
// ======== 20240821 add start
/**
* 客户角色
* <p>
* 枚举 {@link TODO customer_role 字典}
*/
@ApiModelProperty(value = "客户角色")
private String roles;
/**
* 业务国家 逗号分隔
*/
@ApiModelProperty(value = "业务国家ids")
private String busiCountryIds;
/**
* 竞争对手IDs, 关联 customer_competitor 表主键
*/
@ApiModelProperty(value = "竞争对手IDs")
private String competitorIds;
/**
* 年度发货量
*/
@ApiModelProperty(value = "年度发货量")
private BigDecimal weightYearly;
/**
* 年度发货次数
*/
@ApiModelProperty(value = "年度发货次数")
private Integer numYearly;
/**
* 默认开票,1-是,0-否
*/
@ApiModelProperty(value = "默认开票,1-是,0-否")
private Boolean defaultBilling;
// ======== 20240821 add end
@ApiModelProperty(value = "国家中文名称")
private String countryNameZh;
......@@ -204,6 +256,22 @@ public class CustomerDetailRespVO extends CustomerBaseVO {
@ApiModelProperty(value = "常用提货点英文名称")
private String pickupPointNameEn;
@ApiModelProperty(value = "业务国家中文名称")
private String busiCountryNameZh;
@ApiModelProperty(value = "业务国家英文名称")
private String busiCountryNameEn;
/**
* 竞争对手IDs, 关联 customer_competitor 表主键
*/
@ApiModelProperty(value = "竞争对手名称")
private String competitorNames;
@ApiModelProperty(value = "付款人姓名")
private String payerName;
......
......@@ -53,11 +53,11 @@ public class CustomerUpdateReqVO extends CustomerBaseVO {
@ApiModelProperty(value = "产品类型")
private Long productType;
@ApiModelProperty(value = "产品id")
private Long productId;
@ApiModelProperty(value = "产品ids")
private String productIds;
@ApiModelProperty(value = "常用提货网点")
private Long pickupPoint;
@ApiModelProperty(value = "常用提货网点ids")
private String pickupPoints;
@ApiModelProperty(value = "关联会员账号")
private Long memberId;
......@@ -181,4 +181,49 @@ public class CustomerUpdateReqVO extends CustomerBaseVO {
@ApiModelProperty(value = "是否潜在客户")
private Boolean isPotential = false;
// ======== 20240821 add start
/**
* 客户角色
* <p>
* 枚举 {@link TODO customer_role 字典}
*/
@ApiModelProperty(value = "客户角色")
private String roles;
/**
* 业务国家 逗号分隔
*/
@ApiModelProperty(value = "业务国家ids")
private String busiCountryIds;
/**
* 竞争对手IDs, 关联 customer_competitor 表主键
*/
@ApiModelProperty(value = "竞争对手IDs")
private String competitorIds;
/**
* 年度发货量
*/
@ApiModelProperty(value = "年度发货量")
private BigDecimal weightYearly;
/**
* 年度发货次数
*/
@ApiModelProperty(value = "年度发货次数")
private Integer numYearly;
/**
* 默认开票,1-是,0-否
*/
@ApiModelProperty(value = "默认开票,1-是,0-否")
private Boolean defaultBilling;
// ======== 20240821 add end
}
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