Commit 5825fdf5 authored by yanghao's avatar yanghao

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

parent d4aad8ed
...@@ -13,4 +13,25 @@ CREATE TABLE `ecw_customer_competitor` ( ...@@ -13,4 +13,25 @@ CREATE TABLE `ecw_customer_competitor` (
`deleted` bit DEFAULT false COMMENT '是否删除', `deleted` bit DEFAULT false COMMENT '是否删除',
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
KEY (`create_time`) KEY (`create_time`)
) COMMENT='客户竞争对手表'; ) COMMENT='客户竞争对手表';
\ No newline at end of file
-- 添加新字段
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 { ...@@ -109,11 +109,11 @@ public class CustomerDO extends BaseDO {
/** /**
* 产品id * 产品id
*/ */
private Long productId; private String productIds;
/** /**
* 常用提货网点 * 常用提货网点
*/ */
private Long pickupPoint; private String pickupPoints;
/** /**
* 关联会员账号 * 关联会员账号
*/ */
...@@ -397,7 +397,7 @@ public class CustomerDO extends BaseDO { ...@@ -397,7 +397,7 @@ public class CustomerDO extends BaseDO {
* <p> * <p>
* 枚举 {@link TODO customer_role 字典} * 枚举 {@link TODO customer_role 字典}
*/ */
private Integer role; private String roles;
/** /**
...@@ -407,9 +407,9 @@ public class CustomerDO extends BaseDO { ...@@ -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> { ...@@ -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,", "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,", "(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,",
"n.title_zh as pickup_point_name_zh, n.title_en as pickup_point_name_en,", "(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,", "c.customer_service,",
"u.nickname as customer_service_name", "u.nickname as customer_service_name",
...@@ -88,9 +97,9 @@ public interface CustomerMapper extends BaseMapperX<CustomerDO> { ...@@ -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_customer_credit cc on c.credit_level = cc.id",
"left join ecw_country country on c.country = country.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_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 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}", "where c.id = #{id}",
"</script>" "</script>"
}) })
......
...@@ -46,11 +46,11 @@ public class CustomerCreateReqVO extends CustomerBaseVO { ...@@ -46,11 +46,11 @@ public class CustomerCreateReqVO extends CustomerBaseVO {
@ApiModelProperty(value = "产品类型id") @ApiModelProperty(value = "产品类型id")
private Long productType; private Long productType;
@ApiModelProperty(value = "产品id") @ApiModelProperty(value = "产品ids")
private Long productId; private String productIds;
@ApiModelProperty(value = "常用提货网点id") @ApiModelProperty(value = "常用提货网点ids")
private Long pickupPoint; private String pickupPoints;
@ApiModelProperty(value = "关联会员账号id") @ApiModelProperty(value = "关联会员账号id")
private Long memberId; private Long memberId;
...@@ -153,6 +153,51 @@ public class CustomerCreateReqVO extends CustomerBaseVO { ...@@ -153,6 +153,51 @@ public class CustomerCreateReqVO extends CustomerBaseVO {
@ApiModelProperty(value = "客户银行账户", notes = "参见CustomerBankCreateReqVO") @ApiModelProperty(value = "客户银行账户", notes = "参见CustomerBankCreateReqVO")
private List<CustomerBankCreateReqVO> customerBanks; 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 { ...@@ -63,11 +63,11 @@ public class CustomerDetailRespVO extends CustomerBaseVO {
@ApiModelProperty(value = "产品类型id") @ApiModelProperty(value = "产品类型id")
private Long productType; private Long productType;
@ApiModelProperty(value = "产品id") @ApiModelProperty(value = "产品ids")
private Long productId; private String productIds;
@ApiModelProperty(value = "常用提货网点id") @ApiModelProperty(value = "常用提货网点ids")
private Long pickupPoint; private String pickupPoints;
@ApiModelProperty(value = "关联会员账号id") @ApiModelProperty(value = "关联会员账号id")
private Long memberId; private Long memberId;
...@@ -96,9 +96,17 @@ public class CustomerDetailRespVO extends CustomerBaseVO { ...@@ -96,9 +96,17 @@ public class CustomerDetailRespVO extends CustomerBaseVO {
//客户创建日期格式化 //客户创建日期格式化
//@JsonFormat(value = "创建时间", example = "1652017501000") //@JsonFormat(value = "创建时间", example = "1652017501000")
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY, @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND,
timezone = TIME_ZONE_DEFAULT) timezone = TIME_ZONE_DEFAULT)
private Date createTime; 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 { ...@@ -182,6 +190,50 @@ public class CustomerDetailRespVO extends CustomerBaseVO {
private List<CustomerBankBackVO> customerBankBackVOList; 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 = "国家中文名称") @ApiModelProperty(value = "国家中文名称")
private String countryNameZh; private String countryNameZh;
...@@ -204,6 +256,22 @@ public class CustomerDetailRespVO extends CustomerBaseVO { ...@@ -204,6 +256,22 @@ public class CustomerDetailRespVO extends CustomerBaseVO {
@ApiModelProperty(value = "常用提货点英文名称") @ApiModelProperty(value = "常用提货点英文名称")
private String pickupPointNameEn; private String pickupPointNameEn;
@ApiModelProperty(value = "业务国家中文名称")
private String busiCountryNameZh;
@ApiModelProperty(value = "业务国家英文名称")
private String busiCountryNameEn;
/**
* 竞争对手IDs, 关联 customer_competitor 表主键
*/
@ApiModelProperty(value = "竞争对手名称")
private String competitorNames;
@ApiModelProperty(value = "付款人姓名") @ApiModelProperty(value = "付款人姓名")
private String payerName; private String payerName;
......
...@@ -53,11 +53,11 @@ public class CustomerUpdateReqVO extends CustomerBaseVO { ...@@ -53,11 +53,11 @@ public class CustomerUpdateReqVO extends CustomerBaseVO {
@ApiModelProperty(value = "产品类型") @ApiModelProperty(value = "产品类型")
private Long productType; private Long productType;
@ApiModelProperty(value = "产品id") @ApiModelProperty(value = "产品ids")
private Long productId; private String productIds;
@ApiModelProperty(value = "常用提货网点") @ApiModelProperty(value = "常用提货网点ids")
private Long pickupPoint; private String pickupPoints;
@ApiModelProperty(value = "关联会员账号") @ApiModelProperty(value = "关联会员账号")
private Long memberId; private Long memberId;
...@@ -181,4 +181,49 @@ public class CustomerUpdateReqVO extends CustomerBaseVO { ...@@ -181,4 +181,49 @@ public class CustomerUpdateReqVO extends CustomerBaseVO {
@ApiModelProperty(value = "是否潜在客户") @ApiModelProperty(value = "是否潜在客户")
private Boolean isPotential = false; 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