Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
dj
/
rpc-dj-strategy
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 27840676
authored
Jun 17, 2026
by
范富荣
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge remote-tracking branch 'origin/v5.8.3' into v5.8.3
2 parents
fd1d507f
29b82810
Show whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
717 additions
and
1 deletions
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/dto/ArchiveCustomerProfileReqDTO.java
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/dto/CarSeriesDetailDTO.java
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/dto/GoodsPageReqDTO.java
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/dto/GoodsRespDTO.java
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/dto/GoodsStoreReqDTO.java
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/dto/GoodsStoreRespDTO.java
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/dto/MarketingActivityLogPageReqDTO.java
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/dto/MarketingActivityProductPageReqDTO.java
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/dto/MarketingActivityStoreReqDTO.java
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/dto/MarketingActivityTagRespDTO.java
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/dto/OperationLogVO.java
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/dto/PackageItemRespDTO.java
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/dto/PackagePageReqDTO.java
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/dto/PackageRespDTO.java
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/dto/ProfileQueryReqDTO.java
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/dto/StoreVO.java
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/enums/ArchiveTagEnum.java
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/remote/CustomerTagProfileRemote.java
rpc-dj-strategy/src/main/java/cn/com/glsx/dj/strategy/mapper/CustomerTagProfileMapper.java
rpc-dj-strategy/src/main/java/cn/com/glsx/dj/strategy/remote/CustomerTagProfileRemoteImpl.java
rpc-dj-strategy/src/main/java/cn/com/glsx/dj/strategy/service/CustomerTagProfileService.java
rpc-dj-strategy/src/main/java/cn/com/glsx/dj/strategy/util/GopApiUtil.java
rpc-dj-strategy/src/main/resources/META-INF/orm/CustomerTagProfileMapper.xml
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/dto/ArchiveCustomerProfileReqDTO.java
View file @
2784067
...
@@ -2,6 +2,8 @@ package cn.com.glsx.dj.strategy.dto;
...
@@ -2,6 +2,8 @@ package cn.com.glsx.dj.strategy.dto;
import
lombok.Data
;
import
lombok.Data
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
import
java.io.Serializable
;
/**
/**
...
@@ -19,10 +21,12 @@ public class ArchiveCustomerProfileReqDTO implements Serializable {
...
@@ -19,10 +21,12 @@ public class ArchiveCustomerProfileReqDTO implements Serializable {
/**
/**
* 客户手机号
* 客户手机号
*/
*/
@NotBlank
(
message
=
"客户手机号不能为空"
)
private
String
phone
;
private
String
phone
;
/**
/**
* 车系id
* 车系id
*/
*/
@NotNull
(
message
=
"车系ID不能为空"
)
private
Integer
carSeriesId
;
private
Integer
carSeriesId
;
}
}
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/dto/CarSeriesDetailDTO.java
0 → 100644
View file @
2784067
package
cn
.
com
.
glsx
.
dj
.
strategy
.
dto
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
/**
* 车系详情DTO
*
* @author yangwei_by_claude
* @version 1.0
* @since 2026/06/17
*/
@Data
public
class
CarSeriesDetailDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 车系ID
*/
private
Integer
csid
;
/**
* 车系名称
*/
private
String
carseries
;
/**
* 品牌ID
*/
private
String
brandId
;
/**
* 最低价(单位:万)
*/
private
BigDecimal
lowerPrice
;
/**
* 最高价(单位:万)
*/
private
BigDecimal
higherPrice
;
/**
* 首字母
*/
private
String
seriesLetter
;
}
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/dto/GoodsPageReqDTO.java
View file @
2784067
package
cn
.
com
.
glsx
.
dj
.
strategy
.
dto
;
package
cn
.
com
.
glsx
.
dj
.
strategy
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.io.Serializable
;
...
@@ -13,28 +15,36 @@ import java.util.List;
...
@@ -13,28 +15,36 @@ import java.util.List;
* @since 2026/06/16
* @since 2026/06/16
*/
*/
@Data
@Data
@ApiModel
(
value
=
"上架商品分页查询请求"
)
public
class
GoodsPageReqDTO
implements
Serializable
{
public
class
GoodsPageReqDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
/** 页码 */
/** 页码 */
@ApiModelProperty
(
notes
=
"页码,默认1"
)
private
Integer
pageNum
;
private
Integer
pageNum
;
/** 每页条数 */
/** 每页条数 */
@ApiModelProperty
(
notes
=
"每页条数,默认10"
)
private
Integer
pageSize
;
private
Integer
pageSize
;
/** 适用门店号列表 */
/** 适用门店号列表 */
@ApiModelProperty
(
notes
=
"适用门店号列表"
,
required
=
true
)
private
List
<
Integer
>
merchantIds
;
private
List
<
Integer
>
merchantIds
;
/** 产品名称(模糊) */
/** 产品名称(模糊) */
@ApiModelProperty
(
notes
=
"产品名称(模糊查询)"
)
private
String
goodsName
;
private
String
goodsName
;
/** 产品ID/上架ID(模糊) */
/** 产品ID/上架ID(模糊) */
@ApiModelProperty
(
notes
=
"产品ID/上架ID(模糊查询)"
)
private
String
goodsCode
;
private
String
goodsCode
;
/** 场景筛选 */
/** 场景筛选 */
@ApiModelProperty
(
notes
=
"场景筛选"
)
private
String
scene
;
private
String
scene
;
/** 按指定门店筛选 */
/** 按指定门店筛选 */
@ApiModelProperty
(
notes
=
"按指定门店筛选"
)
private
Integer
merchantId
;
private
Integer
merchantId
;
}
}
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/dto/GoodsRespDTO.java
View file @
2784067
package
cn
.
com
.
glsx
.
dj
.
strategy
.
dto
;
package
cn
.
com
.
glsx
.
dj
.
strategy
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.io.Serializable
;
...
@@ -13,25 +15,32 @@ import java.math.BigDecimal;
...
@@ -13,25 +15,32 @@ import java.math.BigDecimal;
* @since 2026/06/16
* @since 2026/06/16
*/
*/
@Data
@Data
@ApiModel
(
value
=
"上架商品响应"
)
public
class
GoodsRespDTO
implements
Serializable
{
public
class
GoodsRespDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
/** 上架商品编码 */
/** 上架商品编码 */
@ApiModelProperty
(
notes
=
"上架商品编码"
)
private
String
goodsCode
;
private
String
goodsCode
;
/** 产品名称 */
/** 产品名称 */
@ApiModelProperty
(
notes
=
"产品名称"
)
private
String
goodsName
;
private
String
goodsName
;
/** 上架ID */
/** 上架ID */
@ApiModelProperty
(
notes
=
"上架ID"
)
private
String
listingId
;
private
String
listingId
;
/** 场景编号+名称 */
/** 场景编号+名称 */
@ApiModelProperty
(
notes
=
"场景"
)
private
String
scene
;
private
String
scene
;
/** 适用门店范围内销售门店数 */
/** 适用门店范围内销售门店数 */
@ApiModelProperty
(
notes
=
"适用门店范围内销售门店数"
)
private
Integer
storeCount
;
private
Integer
storeCount
;
/** 现售价 */
/** 现售价 */
@ApiModelProperty
(
notes
=
"现售价"
)
private
BigDecimal
currentPrice
;
private
BigDecimal
currentPrice
;
}
}
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/dto/GoodsStoreReqDTO.java
View file @
2784067
package
cn
.
com
.
glsx
.
dj
.
strategy
.
dto
;
package
cn
.
com
.
glsx
.
dj
.
strategy
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.io.Serializable
;
...
@@ -13,16 +15,20 @@ import java.util.List;
...
@@ -13,16 +15,20 @@ import java.util.List;
* @since 2026/06/16
* @since 2026/06/16
*/
*/
@Data
@Data
@ApiModel
(
value
=
"商品/套餐适用门店查询请求"
)
public
class
GoodsStoreReqDTO
implements
Serializable
{
public
class
GoodsStoreReqDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
/** 商品编码 */
/** 商品编码 */
@ApiModelProperty
(
notes
=
"商品编码"
)
private
String
goodsCode
;
private
String
goodsCode
;
/** 套餐编码 */
/** 套餐编码 */
@ApiModelProperty
(
notes
=
"套餐编码"
)
private
String
packageCode
;
private
String
packageCode
;
/** 适用门店号列表(取交集用) */
/** 适用门店号列表(取交集用) */
@ApiModelProperty
(
notes
=
"适用门店号列表"
,
required
=
true
)
private
List
<
Integer
>
merchantIds
;
private
List
<
Integer
>
merchantIds
;
}
}
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/dto/GoodsStoreRespDTO.java
View file @
2784067
package
cn
.
com
.
glsx
.
dj
.
strategy
.
dto
;
package
cn
.
com
.
glsx
.
dj
.
strategy
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.io.Serializable
;
...
@@ -12,16 +14,20 @@ import java.io.Serializable;
...
@@ -12,16 +14,20 @@ import java.io.Serializable;
* @since 2026/06/16
* @since 2026/06/16
*/
*/
@Data
@Data
@ApiModel
(
value
=
"商品/套餐适用门店响应"
)
public
class
GoodsStoreRespDTO
implements
Serializable
{
public
class
GoodsStoreRespDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
/** 门店号 */
/** 门店号 */
@ApiModelProperty
(
notes
=
"门店号"
)
private
Integer
merchantId
;
private
Integer
merchantId
;
/** 门店名称 */
/** 门店名称 */
@ApiModelProperty
(
notes
=
"门店名称"
)
private
String
merchantName
;
private
String
merchantName
;
/** 门店地址 */
/** 门店地址 */
@ApiModelProperty
(
notes
=
"门店地址"
)
private
String
merchantAddress
;
private
String
merchantAddress
;
}
}
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/dto/MarketingActivityLogPageReqDTO.java
View file @
2784067
package
cn
.
com
.
glsx
.
dj
.
strategy
.
dto
;
package
cn
.
com
.
glsx
.
dj
.
strategy
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.io.Serializable
;
...
@@ -8,15 +10,19 @@ import java.io.Serializable;
...
@@ -8,15 +10,19 @@ import java.io.Serializable;
* 活动操作日志分页查询请求DTO
* 活动操作日志分页查询请求DTO
*/
*/
@Data
@Data
@ApiModel
(
value
=
"活动操作日志分页查询请求"
)
public
class
MarketingActivityLogPageReqDTO
implements
Serializable
{
public
class
MarketingActivityLogPageReqDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
/** 活动ID */
/** 活动ID */
@ApiModelProperty
(
notes
=
"活动ID"
,
required
=
true
)
private
Integer
activityId
;
private
Integer
activityId
;
/** 页码 */
/** 页码 */
@ApiModelProperty
(
notes
=
"页码,默认1"
)
private
Integer
pageNum
;
private
Integer
pageNum
;
/** 每页条数 */
/** 每页条数 */
@ApiModelProperty
(
notes
=
"每页条数,默认10"
)
private
Integer
pageSize
;
private
Integer
pageSize
;
}
}
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/dto/MarketingActivityProductPageReqDTO.java
View file @
2784067
package
cn
.
com
.
glsx
.
dj
.
strategy
.
dto
;
package
cn
.
com
.
glsx
.
dj
.
strategy
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.io.Serializable
;
...
@@ -8,18 +10,23 @@ import java.io.Serializable;
...
@@ -8,18 +10,23 @@ import java.io.Serializable;
* 活动商品/套餐分页查询请求DTO
* 活动商品/套餐分页查询请求DTO
*/
*/
@Data
@Data
@ApiModel
(
value
=
"活动商品/套餐分页查询请求"
)
public
class
MarketingActivityProductPageReqDTO
implements
Serializable
{
public
class
MarketingActivityProductPageReqDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
/** 活动ID */
/** 活动ID */
@ApiModelProperty
(
notes
=
"活动ID"
,
required
=
true
)
private
Integer
activityId
;
private
Integer
activityId
;
/** 车系ID(可选,不分车系传-1) */
/** 车系ID(可选,不分车系传-1) */
@ApiModelProperty
(
notes
=
"车系ID,不分车系传-1"
)
private
Integer
carSeriesId
;
private
Integer
carSeriesId
;
/** 页码 */
/** 页码 */
@ApiModelProperty
(
notes
=
"页码,默认1"
)
private
Integer
pageNum
;
private
Integer
pageNum
;
/** 每页条数 */
/** 每页条数 */
@ApiModelProperty
(
notes
=
"每页条数,默认10"
)
private
Integer
pageSize
;
private
Integer
pageSize
;
}
}
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/dto/MarketingActivityStoreReqDTO.java
View file @
2784067
package
cn
.
com
.
glsx
.
dj
.
strategy
.
dto
;
package
cn
.
com
.
glsx
.
dj
.
strategy
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.io.Serializable
;
...
@@ -8,15 +10,19 @@ import java.io.Serializable;
...
@@ -8,15 +10,19 @@ import java.io.Serializable;
* 活动门店分页查询请求DTO
* 活动门店分页查询请求DTO
*/
*/
@Data
@Data
@ApiModel
(
value
=
"活动门店分页查询请求"
)
public
class
MarketingActivityStoreReqDTO
implements
Serializable
{
public
class
MarketingActivityStoreReqDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
/** 活动ID */
/** 活动ID */
@ApiModelProperty
(
notes
=
"活动ID"
,
required
=
true
)
private
Integer
activityId
;
private
Integer
activityId
;
/** 页码 */
/** 页码 */
@ApiModelProperty
(
notes
=
"页码,默认1"
)
private
Integer
pageNum
;
private
Integer
pageNum
;
/** 每页条数 */
/** 每页条数 */
@ApiModelProperty
(
notes
=
"每页条数,默认10"
)
private
Integer
pageSize
;
private
Integer
pageSize
;
}
}
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/dto/MarketingActivityTagRespDTO.java
View file @
2784067
package
cn
.
com
.
glsx
.
dj
.
strategy
.
dto
;
package
cn
.
com
.
glsx
.
dj
.
strategy
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.io.Serializable
;
...
@@ -12,13 +14,16 @@ import java.io.Serializable;
...
@@ -12,13 +14,16 @@ import java.io.Serializable;
* @since 2026/06/16
* @since 2026/06/16
*/
*/
@Data
@Data
@ApiModel
(
value
=
"活动标签响应"
)
public
class
MarketingActivityTagRespDTO
implements
Serializable
{
public
class
MarketingActivityTagRespDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
/** 标签ID */
/** 标签ID */
@ApiModelProperty
(
notes
=
"标签ID"
)
private
Integer
tagId
;
private
Integer
tagId
;
/** 标签名称 */
/** 标签名称 */
@ApiModelProperty
(
notes
=
"标签名称"
)
private
String
tagName
;
private
String
tagName
;
}
}
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/dto/OperationLogVO.java
View file @
2784067
package
cn
.
com
.
glsx
.
dj
.
strategy
.
dto
;
package
cn
.
com
.
glsx
.
dj
.
strategy
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.io.Serializable
;
...
@@ -8,13 +10,17 @@ import java.io.Serializable;
...
@@ -8,13 +10,17 @@ import java.io.Serializable;
* 活动操作日志响应VO
* 活动操作日志响应VO
*/
*/
@Data
@Data
@ApiModel
(
value
=
"活动操作日志响应"
)
public
class
OperationLogVO
implements
Serializable
{
public
class
OperationLogVO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
/** 事件显示内容 */
/** 事件显示内容 */
@ApiModelProperty
(
notes
=
"事件显示内容"
)
private
String
eventContent
;
private
String
eventContent
;
/** 操作人姓名 */
/** 操作人姓名 */
@ApiModelProperty
(
notes
=
"操作人姓名"
)
private
String
operatorName
;
private
String
operatorName
;
/** 操作时间 */
/** 操作时间 */
@ApiModelProperty
(
notes
=
"操作时间(yyyy-MM-dd HH:mm:ss)"
)
private
String
operateTime
;
private
String
operateTime
;
}
}
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/dto/PackageItemRespDTO.java
View file @
2784067
package
cn
.
com
.
glsx
.
dj
.
strategy
.
dto
;
package
cn
.
com
.
glsx
.
dj
.
strategy
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.io.Serializable
;
...
@@ -13,16 +15,20 @@ import java.math.BigDecimal;
...
@@ -13,16 +15,20 @@ import java.math.BigDecimal;
* @since 2026/06/16
* @since 2026/06/16
*/
*/
@Data
@Data
@ApiModel
(
value
=
"套餐子商品响应"
)
public
class
PackageItemRespDTO
implements
Serializable
{
public
class
PackageItemRespDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
/** 子商品编码 */
/** 子商品编码 */
@ApiModelProperty
(
notes
=
"子商品编码"
)
private
String
goodsCode
;
private
String
goodsCode
;
/** 子商品名称 */
/** 子商品名称 */
@ApiModelProperty
(
notes
=
"子商品名称"
)
private
String
goodsName
;
private
String
goodsName
;
/** 子商品现售价 */
/** 子商品现售价 */
@ApiModelProperty
(
notes
=
"子商品现售价"
)
private
BigDecimal
currentPrice
;
private
BigDecimal
currentPrice
;
}
}
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/dto/PackagePageReqDTO.java
View file @
2784067
package
cn
.
com
.
glsx
.
dj
.
strategy
.
dto
;
package
cn
.
com
.
glsx
.
dj
.
strategy
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.io.Serializable
;
...
@@ -13,28 +15,36 @@ import java.util.List;
...
@@ -13,28 +15,36 @@ import java.util.List;
* @since 2026/06/16
* @since 2026/06/16
*/
*/
@Data
@Data
@ApiModel
(
value
=
"套餐分页查询请求"
)
public
class
PackagePageReqDTO
implements
Serializable
{
public
class
PackagePageReqDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
/** 页码 */
/** 页码 */
@ApiModelProperty
(
notes
=
"页码,默认1"
)
private
Integer
pageNum
;
private
Integer
pageNum
;
/** 每页条数 */
/** 每页条数 */
@ApiModelProperty
(
notes
=
"每页条数,默认10"
)
private
Integer
pageSize
;
private
Integer
pageSize
;
/** 适用门店号列表 */
/** 适用门店号列表 */
@ApiModelProperty
(
notes
=
"适用门店号列表"
,
required
=
true
)
private
List
<
Integer
>
merchantIds
;
private
List
<
Integer
>
merchantIds
;
/** 套餐名称(模糊) */
/** 套餐名称(模糊) */
@ApiModelProperty
(
notes
=
"套餐名称(模糊查询)"
)
private
String
packageName
;
private
String
packageName
;
/** 套餐ID(模糊) */
/** 套餐ID(模糊) */
@ApiModelProperty
(
notes
=
"套餐ID(模糊查询)"
)
private
String
packageId
;
private
String
packageId
;
/** 场景筛选 */
/** 场景筛选 */
@ApiModelProperty
(
notes
=
"场景筛选"
)
private
String
scene
;
private
String
scene
;
/** 按指定门店筛选 */
/** 按指定门店筛选 */
@ApiModelProperty
(
notes
=
"按指定门店筛选"
)
private
Integer
merchantId
;
private
Integer
merchantId
;
}
}
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/dto/PackageRespDTO.java
View file @
2784067
package
cn
.
com
.
glsx
.
dj
.
strategy
.
dto
;
package
cn
.
com
.
glsx
.
dj
.
strategy
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.io.Serializable
;
...
@@ -13,22 +15,28 @@ import java.math.BigDecimal;
...
@@ -13,22 +15,28 @@ import java.math.BigDecimal;
* @since 2026/06/16
* @since 2026/06/16
*/
*/
@Data
@Data
@ApiModel
(
value
=
"套餐响应"
)
public
class
PackageRespDTO
implements
Serializable
{
public
class
PackageRespDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
/** 套餐ID */
/** 套餐ID */
@ApiModelProperty
(
notes
=
"套餐ID"
)
private
String
packageId
;
private
String
packageId
;
/** 套餐名称 */
/** 套餐名称 */
@ApiModelProperty
(
notes
=
"套餐名称"
)
private
String
packageName
;
private
String
packageName
;
/** 场景编号+名称 */
/** 场景编号+名称 */
@ApiModelProperty
(
notes
=
"场景"
)
private
String
scene
;
private
String
scene
;
/** 适用门店范围内销售门店数 */
/** 适用门店范围内销售门店数 */
@ApiModelProperty
(
notes
=
"适用门店范围内销售门店数"
)
private
Integer
storeCount
;
private
Integer
storeCount
;
/** 现售价 */
/** 现售价 */
@ApiModelProperty
(
notes
=
"现售价"
)
private
BigDecimal
currentPrice
;
private
BigDecimal
currentPrice
;
}
}
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/dto/ProfileQueryReqDTO.java
View file @
2784067
...
@@ -2,6 +2,7 @@ package cn.com.glsx.dj.strategy.dto;
...
@@ -2,6 +2,7 @@ package cn.com.glsx.dj.strategy.dto;
import
lombok.Data
;
import
lombok.Data
;
import
javax.validation.constraints.NotEmpty
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.List
;
import
java.util.List
;
...
@@ -20,5 +21,6 @@ public class ProfileQueryReqDTO implements Serializable {
...
@@ -20,5 +21,6 @@ public class ProfileQueryReqDTO implements Serializable {
/**
/**
* 手机号列表
* 手机号列表
*/
*/
@NotEmpty
(
message
=
"手机号列表不能为空"
)
private
List
<
String
>
phoneList
;
private
List
<
String
>
phoneList
;
}
}
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/dto/StoreVO.java
View file @
2784067
package
cn
.
com
.
glsx
.
dj
.
strategy
.
dto
;
package
cn
.
com
.
glsx
.
dj
.
strategy
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.io.Serializable
;
...
@@ -8,9 +10,11 @@ import java.io.Serializable;
...
@@ -8,9 +10,11 @@ import java.io.Serializable;
* 活动门店响应VO
* 活动门店响应VO
*/
*/
@Data
@Data
@ApiModel
(
value
=
"活动门店响应"
)
public
class
StoreVO
implements
Serializable
{
public
class
StoreVO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
/** 门店号 */
/** 门店号 */
@ApiModelProperty
(
notes
=
"门店号"
)
private
Integer
merchantId
;
private
Integer
merchantId
;
}
}
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/enums/ArchiveTagEnum.java
0 → 100644
View file @
2784067
package
cn
.
com
.
glsx
.
dj
.
strategy
.
enums
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
import
java.math.BigDecimal
;
/**
* 建档标签枚举
* 根据车系价格区间划分车型档次
*
* @author yangwei_by_claude
* @version 1.0
* @since 2026/06/17
*/
@Getter
@AllArgsConstructor
public
enum
ArchiveTagEnum
{
/**
* 高端车型:价格 > 25万
*/
HIGH_END
(
"INIT_E1"
,
"高端车型"
,
new
BigDecimal
(
"250001"
),
null
),
/**
* 中端车型:15万 <= 价格 < 25万
*/
MID_RANGE
(
"INIT_E2"
,
"中端车型"
,
new
BigDecimal
(
"150000"
),
new
BigDecimal
(
"250001"
)),
/**
* 低端车型:价格 < 15万
*/
LOW_END
(
"INIT_E3"
,
"低端车型"
,
null
,
new
BigDecimal
(
"150000"
));
/**
* 枚举代码
*/
private
final
String
enumCode
;
/**
* 描述
*/
private
final
String
desc
;
/**
* 最低价格(包含),单位:元
* null 表示无下限
*/
private
final
BigDecimal
minPrice
;
/**
* 最高价格(不包含),单位:元
* null 表示无上限
*/
private
final
BigDecimal
maxPrice
;
/**
* 根据价格获取对应的标签枚举
*
* @param price 价格,单位:元
* @return 标签枚举,如果价格不在任何区间则返回 null
*/
public
static
ArchiveTagEnum
getByPrice
(
BigDecimal
price
)
{
if
(
price
==
null
)
{
return
null
;
}
for
(
ArchiveTagEnum
tag
:
values
())
{
boolean
matchMin
=
tag
.
getMinPrice
()
==
null
||
price
.
compareTo
(
tag
.
getMinPrice
())
>=
0
;
boolean
matchMax
=
tag
.
getMaxPrice
()
==
null
||
price
.
compareTo
(
tag
.
getMaxPrice
())
<
0
;
if
(
matchMin
&&
matchMax
)
{
return
tag
;
}
}
return
null
;
}
/**
* 获取价格区间描述
*
* @return 价格区间描述,如 "大于25万"、"15万-25万"、"小于15万"
*/
public
String
getPriceRangeDesc
()
{
if
(
this
==
HIGH_END
)
{
return
"大于25万"
;
}
else
if
(
this
==
MID_RANGE
)
{
return
"15万-25万"
;
}
else
{
return
"小于15万"
;
}
}
}
rpc-dj-strategy-api/src/main/java/cn/com/glsx/dj/strategy/remote/CustomerTagProfileRemote.java
View file @
2784067
...
@@ -32,7 +32,7 @@ public interface CustomerTagProfileRemote {
...
@@ -32,7 +32,7 @@ public interface CustomerTagProfileRemote {
@ApiMethod
(
"建档时生成客户画像"
)
@ApiMethod
(
"建档时生成客户画像"
)
@ApiParam
(
name
=
"request"
,
notes
=
"请求对象,包含手机号和车系代码"
,
dataType
=
ApiParam
.
DataTypeEnum
.
OBJECT
,
required
=
true
)
@ApiParam
(
name
=
"request"
,
notes
=
"请求对象,包含手机号和车系代码"
,
dataType
=
ApiParam
.
DataTypeEnum
.
OBJECT
,
required
=
true
)
@ApiResponse
(
"操作结果"
)
@ApiResponse
(
"操作结果"
)
RpcResponse
<
Void
>
createCustomerProfileOnArchive
(
ArchiveCustomerProfileReqDTO
request
);
RpcResponse
<
Boolean
>
createCustomerProfileOnArchive
(
ArchiveCustomerProfileReqDTO
request
);
/**
/**
* 根据手机号列表批量查询客户画像
* 根据手机号列表批量查询客户画像
...
...
rpc-dj-strategy/src/main/java/cn/com/glsx/dj/strategy/mapper/CustomerTagProfileMapper.java
View file @
2784067
...
@@ -2,8 +2,11 @@ package cn.com.glsx.dj.strategy.mapper;
...
@@ -2,8 +2,11 @@ package cn.com.glsx.dj.strategy.mapper;
import
cn.com.glsx.dj.strategy.model.CustomerTagProfile
;
import
cn.com.glsx.dj.strategy.model.CustomerTagProfile
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.oreframework.datasource.mybatis.mapper.OreMapper
;
import
org.oreframework.datasource.mybatis.mapper.OreMapper
;
import
java.util.List
;
/**
/**
* 客户标签画像Mapper
* 客户标签画像Mapper
*
*
...
@@ -14,4 +17,20 @@ import org.oreframework.datasource.mybatis.mapper.OreMapper;
...
@@ -14,4 +17,20 @@ import org.oreframework.datasource.mybatis.mapper.OreMapper;
@Mapper
@Mapper
public
interface
CustomerTagProfileMapper
extends
OreMapper
<
CustomerTagProfile
>
{
public
interface
CustomerTagProfileMapper
extends
OreMapper
<
CustomerTagProfile
>
{
/**
* 根据手机号列表批量查询客户画像
*
* @param phoneList 手机号列表
* @return 客户画像列表
*/
List
<
CustomerTagProfile
>
selectByPhoneList
(
@Param
(
"phoneList"
)
List
<
String
>
phoneList
);
/**
* 根据手机号和类别代码物理删除记录
*
* @param phone 手机号
* @param categoryCode 类别代码
* @return 删除数量
*/
int
deleteByPhoneAndCategoryCode
(
@Param
(
"phone"
)
String
phone
,
@Param
(
"categoryCode"
)
String
categoryCode
);
}
}
rpc-dj-strategy/src/main/java/cn/com/glsx/dj/strategy/remote/CustomerTagProfileRemoteImpl.java
0 → 100644
View file @
2784067
package
cn
.
com
.
glsx
.
dj
.
strategy
.
remote
;
import
cn.com.glsx.dj.strategy.dto.ArchiveCustomerProfileReqDTO
;
import
cn.com.glsx.dj.strategy.dto.CustomerProfileRespDTO
;
import
cn.com.glsx.dj.strategy.dto.ProfileQueryReqDTO
;
import
cn.com.glsx.dj.strategy.service.CustomerTagProfileService
;
import
cn.com.glsx.dj.strategy.util.validation.BeanValidationUtils
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.dubbo.config.annotation.DubboService
;
import
java.util.List
;
/**
* 客户标签画像远程接口实现
*
* @author yangwei_by_claude
* @version 1.0
* @since 2026/06/17
*/
@Slf4j
@DubboService
@RequiredArgsConstructor
public
class
CustomerTagProfileRemoteImpl
implements
CustomerTagProfileRemote
{
private
final
CustomerTagProfileService
customerTagProfileService
;
/**
* 建档时生成客户画像
*
* @param request 请求对象,包含手机号和车系ID
* @return 操作结果
*/
@Override
public
RpcResponse
<
Boolean
>
createCustomerProfileOnArchive
(
ArchiveCustomerProfileReqDTO
request
)
{
try
{
log
.
info
(
"建档时生成客户画像开始:phone={}, carSeriesId={}"
,
request
!=
null
?
request
.
getPhone
()
:
null
,
request
!=
null
?
request
.
getCarSeriesId
()
:
null
);
// 参数校验
BeanValidationUtils
.
validateAndThrow
(
request
);
customerTagProfileService
.
createProfileOnArchive
(
request
.
getPhone
(),
request
.
getCarSeriesId
());
log
.
info
(
"建档时生成客户画像完成:phone={}"
,
request
.
getPhone
());
return
RpcResponse
.
success
(
true
);
}
catch
(
RpcServiceException
e
)
{
log
.
error
(
"建档时生成客户画像 occur RpcServiceException"
,
e
);
return
RpcResponse
.
error
(
e
);
}
catch
(
Exception
e
)
{
log
.
error
(
"建档时生成客户画像 occur Exception"
,
e
);
return
RpcResponse
.
error
(
e
);
}
}
/**
* 根据手机号列表批量查询客户画像
*
* @param request 请求对象,包含手机号列表
* @return 客户画像列表
*/
@Override
public
RpcResponse
<
List
<
CustomerProfileRespDTO
>>
queryCustomerProfileByPhones
(
ProfileQueryReqDTO
request
)
{
try
{
log
.
info
(
"批量查询客户画像开始:phoneList size={}"
,
request
!=
null
&&
request
.
getPhoneList
()
!=
null
?
request
.
getPhoneList
().
size
()
:
0
);
// 参数校验
BeanValidationUtils
.
validateAndThrow
(
request
);
List
<
CustomerProfileRespDTO
>
result
=
customerTagProfileService
.
queryProfileByPhones
(
request
.
getPhoneList
());
log
.
info
(
"批量查询客户画像完成:result size={}"
,
result
!=
null
?
result
.
size
()
:
0
);
return
RpcResponse
.
success
(
result
);
}
catch
(
RpcServiceException
e
)
{
log
.
error
(
"批量查询客户画像 occur RpcServiceException"
,
e
);
return
RpcResponse
.
error
(
e
);
}
catch
(
Exception
e
)
{
log
.
error
(
"批量查询客户画像 occur Exception"
,
e
);
return
RpcResponse
.
error
(
e
);
}
}
}
rpc-dj-strategy/src/main/java/cn/com/glsx/dj/strategy/service/CustomerTagProfileService.java
View file @
2784067
package
cn
.
com
.
glsx
.
dj
.
strategy
.
service
;
package
cn
.
com
.
glsx
.
dj
.
strategy
.
service
;
import
cn.com.glsx.dj.strategy.dto.CarSeriesDetailDTO
;
import
cn.com.glsx.dj.strategy.dto.CustomerProfileRespDTO
;
import
cn.com.glsx.dj.strategy.enums.ArchiveTagEnum
;
import
cn.com.glsx.dj.strategy.mapper.CustomerTagProfileMapper
;
import
cn.com.glsx.dj.strategy.mapper.CustomerTagProfileMapper
;
import
cn.com.glsx.dj.strategy.model.CustomerTagProfile
;
import
cn.com.glsx.dj.strategy.util.GopApiUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.List
;
/**
/**
* 客户标签画像服务
* 客户标签画像服务
...
@@ -16,7 +27,161 @@ import org.springframework.stereotype.Service;
...
@@ -16,7 +27,161 @@ import org.springframework.stereotype.Service;
@Service
@Service
public
class
CustomerTagProfileService
{
public
class
CustomerTagProfileService
{
private
static
final
String
CATEGORY_CODE_INIT
=
"INIT_C1"
;
private
static
final
String
SOURCE_TYPE_ARCHIVE
=
"ARCHIVE"
;
private
static
final
int
DEFAULT_SCORE
=
1
;
@Autowired
@Autowired
private
CustomerTagProfileMapper
customerTagProfileMapper
;
private
CustomerTagProfileMapper
customerTagProfileMapper
;
/**
* 建档时生成客户画像
*
* @param phone 客户手机号
* @param carSeriesId 车系ID
*/
public
void
createProfileOnArchive
(
String
phone
,
Integer
carSeriesId
)
{
log
.
info
(
"建档生成客户画像开始:phone={}, carSeriesId={}"
,
phone
,
carSeriesId
);
if
(
phone
==
null
||
carSeriesId
==
null
)
{
log
.
warn
(
"建档生成客户画像参数不完整:phone={}, carSeriesId={}"
,
phone
,
carSeriesId
);
return
;
}
// 查询车系详情
CarSeriesDetailDTO
carSeriesDetail
=
GopApiUtil
.
getCarSeriesDetail
(
carSeriesId
);
if
(
carSeriesDetail
==
null
)
{
log
.
warn
(
"查询车系详情失败:carSeriesId={}"
,
carSeriesId
);
return
;
}
// 计算平均价格(万元 -> 元)
BigDecimal
avgPrice
=
calculateAvgPrice
(
carSeriesDetail
);
if
(
avgPrice
==
null
)
{
log
.
warn
(
"计算平均价格失败:carSeriesId={}"
,
carSeriesId
);
return
;
}
// 根据价格获取标签枚举
ArchiveTagEnum
tagEnum
=
ArchiveTagEnum
.
getByPrice
(
avgPrice
);
if
(
tagEnum
==
null
)
{
log
.
warn
(
"无法匹配车型标签:avgPrice={}"
,
avgPrice
);
return
;
}
// 构建画像实体
CustomerTagProfile
profile
=
new
CustomerTagProfile
();
profile
.
setPhone
(
phone
);
profile
.
setCategoryCode
(
CATEGORY_CODE_INIT
);
profile
.
setDimensionCode
(
null
);
profile
.
setEnumCode
(
tagEnum
.
getEnumCode
());
profile
.
setScoreBasis
(
buildScoreBasis
(
tagEnum
,
carSeriesDetail
,
avgPrice
));
profile
.
setScore
(
DEFAULT_SCORE
);
profile
.
setSourceType
(
SOURCE_TYPE_ARCHIVE
);
profile
.
setSourceRefId
(
String
.
valueOf
(
carSeriesId
));
profile
.
setDeletedFlag
(
"N"
);
// 先删除该用户已有的建档标签(物理删除)
customerTagProfileMapper
.
deleteByPhoneAndCategoryCode
(
phone
,
CATEGORY_CODE_INIT
);
// 保存到数据库
customerTagProfileMapper
.
insertSelective
(
profile
);
log
.
info
(
"建档生成客户画像完成:phone={}, tagEnum={}, avgPrice={}"
,
phone
,
tagEnum
.
getEnumCode
(),
avgPrice
);
}
/**
* 批量查询客户画像
*
* @param phoneList 手机号列表
* @return 画像列表
*/
public
List
<
CustomerProfileRespDTO
>
queryProfileByPhones
(
List
<
String
>
phoneList
)
{
log
.
info
(
"批量查询客户画像:phoneList size={}"
,
phoneList
!=
null
?
phoneList
.
size
()
:
0
);
if
(
CollectionUtils
.
isEmpty
(
phoneList
))
{
return
Collections
.
emptyList
();
}
List
<
CustomerTagProfile
>
profileList
=
customerTagProfileMapper
.
selectByPhoneList
(
phoneList
);
if
(
CollectionUtils
.
isEmpty
(
profileList
))
{
return
Collections
.
emptyList
();
}
List
<
CustomerProfileRespDTO
>
result
=
new
ArrayList
<>();
for
(
CustomerTagProfile
profile
:
profileList
)
{
CustomerProfileRespDTO
dto
=
convertToDTO
(
profile
);
result
.
add
(
dto
);
}
log
.
info
(
"批量查询客户画像完成:result size={}"
,
result
.
size
());
return
result
;
}
/**
* 计算平均价格
*
* @param carSeriesDetail 车系详情
* @return 平均价格(元)
*/
private
BigDecimal
calculateAvgPrice
(
CarSeriesDetailDTO
carSeriesDetail
)
{
BigDecimal
lowerPrice
=
carSeriesDetail
.
getLowerPrice
();
BigDecimal
higherPrice
=
carSeriesDetail
.
getHigherPrice
();
if
(
lowerPrice
==
null
&&
higherPrice
==
null
)
{
return
null
;
}
// 如果只有一个价格,使用该价格
if
(
lowerPrice
==
null
)
{
return
higherPrice
.
multiply
(
new
BigDecimal
(
"10000"
));
}
if
(
higherPrice
==
null
)
{
return
lowerPrice
.
multiply
(
new
BigDecimal
(
"10000"
));
}
// 计算平均价格:((lowerPrice + higherPrice) / 2) * 10000
return
lowerPrice
.
add
(
higherPrice
)
.
divide
(
new
BigDecimal
(
"2"
),
2
,
BigDecimal
.
ROUND_HALF_UP
)
.
multiply
(
new
BigDecimal
(
"10000"
));
}
/**
* 构建评分依据
*
* @param tagEnum 标签枚举
* @param carSeriesDetail 车系详情
* @param avgPrice 平均价格
* @return 评分依据
*/
private
String
buildScoreBasis
(
ArchiveTagEnum
tagEnum
,
CarSeriesDetailDTO
carSeriesDetail
,
BigDecimal
avgPrice
)
{
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
carSeriesDetail
.
getCarseries
()
!=
null
?
carSeriesDetail
.
getCarseries
()
:
"未知车系"
);
sb
.
append
(
","
);
sb
.
append
(
tagEnum
.
getDesc
());
sb
.
append
(
"("
);
sb
.
append
(
tagEnum
.
getPriceRangeDesc
());
sb
.
append
(
"),均价:"
);
sb
.
append
(
avgPrice
.
divide
(
new
BigDecimal
(
"10000"
),
2
,
BigDecimal
.
ROUND_HALF_UP
));
sb
.
append
(
"万"
);
return
sb
.
toString
();
}
/**
* 转换为DTO
*
* @param profile 画像实体
* @return DTO
*/
private
CustomerProfileRespDTO
convertToDTO
(
CustomerTagProfile
profile
)
{
CustomerProfileRespDTO
dto
=
new
CustomerProfileRespDTO
();
dto
.
setPhone
(
profile
.
getPhone
());
dto
.
setCategoryCode
(
profile
.
getCategoryCode
());
dto
.
setDimensionCode
(
profile
.
getDimensionCode
());
dto
.
setEnumCode
(
profile
.
getEnumCode
());
dto
.
setScoreBasis
(
profile
.
getScoreBasis
());
dto
.
setScore
(
profile
.
getScore
());
dto
.
setSourceType
(
profile
.
getSourceType
());
dto
.
setCreateTime
(
profile
.
getCreateTime
());
return
dto
;
}
}
}
rpc-dj-strategy/src/main/java/cn/com/glsx/dj/strategy/util/GopApiUtil.java
0 → 100644
View file @
2784067
package
cn
.
com
.
glsx
.
dj
.
strategy
.
util
;
import
cn.com.glsx.dj.strategy.dto.CarSeriesDetailDTO
;
import
cn.hutool.json.JSONObject
;
import
cn.hutool.json.JSONUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.oreframework.util.http.HttpUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.core.env.Environment
;
import
org.springframework.stereotype.Component
;
import
java.io.IOException
;
import
java.net.URLEncoder
;
import
java.nio.charset.StandardCharsets
;
import
java.security.MessageDigest
;
import
java.util.*
;
/**
* GOP 接口调用工具类
*
* @author yangwei_by_claude
* @version 1.0
* @since 2026/06/17
*/
@Slf4j
@Component
public
class
GopApiUtil
{
private
static
final
String
VERSION
=
"1.0.0"
;
private
static
final
String
FORMAT
=
"json"
;
private
static
final
String
SOURCE
=
"rpc-dj-strategy"
;
private
static
final
String
METHOD_CAR_SERIES_DETAIL
=
"glsx.accounts.base.carseries.detail"
;
private
static
Environment
env
;
@Autowired
public
void
setEnv
(
Environment
env
)
{
GopApiUtil
.
env
=
env
;
}
/**
* 查询车系详情
*
* @param carSeriesId 车系ID
* @return 车系详情
*/
public
static
CarSeriesDetailDTO
getCarSeriesDetail
(
Integer
carSeriesId
)
{
if
(
carSeriesId
==
null
)
{
log
.
warn
(
"车系ID为空,无法查询车系详情"
);
return
null
;
}
try
{
Map
<
String
,
String
>
params
=
new
HashMap
<>();
params
.
put
(
"csId"
,
String
.
valueOf
(
carSeriesId
));
String
result
=
callApi
(
METHOD_CAR_SERIES_DETAIL
,
params
);
log
.
info
(
"查询车系详情结果:carSeriesId={}, result={}"
,
carSeriesId
,
result
);
if
(
result
==
null
)
{
return
null
;
}
JSONObject
json
=
JSONUtil
.
parseObj
(
result
);
if
(
json
.
getInt
(
"code"
)
==
0
)
{
JSONObject
data
=
json
.
getJSONObject
(
"data"
);
if
(
data
==
null
)
{
return
null
;
}
CarSeriesDetailDTO
dto
=
new
CarSeriesDetailDTO
();
dto
.
setCsid
(
data
.
getInt
(
"csid"
));
dto
.
setCarseries
(
data
.
getStr
(
"carseries"
));
dto
.
setBrandId
(
data
.
getStr
(
"brandId"
));
dto
.
setLowerPrice
(
data
.
getBigDecimal
(
"lowerPrice"
));
dto
.
setHigherPrice
(
data
.
getBigDecimal
(
"higherPrice"
));
dto
.
setSeriesLetter
(
data
.
getStr
(
"seriesLetter"
));
return
dto
;
}
else
{
log
.
warn
(
"查询车系详情失败:code={}, message={}"
,
json
.
get
(
"code"
),
json
.
get
(
"message"
));
return
null
;
}
}
catch
(
Exception
e
)
{
log
.
error
(
"查询车系详情异常:carSeriesId={}"
,
carSeriesId
,
e
);
return
null
;
}
}
/**
* 调用 GOP 接口
*
* @param method 方法名
* @param params 参数
* @return 响应结果
*/
private
static
String
callApi
(
String
method
,
Map
<
String
,
String
>
params
)
throws
IOException
{
if
(
params
==
null
)
{
params
=
new
HashMap
<>();
}
// 添加公共参数
params
.
put
(
"method"
,
method
);
params
.
put
(
"app_key"
,
env
.
getProperty
(
"gop.open.app.key"
));
params
.
put
(
"v"
,
VERSION
);
params
.
put
(
"format"
,
FORMAT
);
params
.
put
(
"source"
,
SOURCE
);
params
.
put
(
"timestamp"
,
String
.
valueOf
(
System
.
currentTimeMillis
()));
// 计算签名
String
sign
=
sign
(
params
,
env
.
getProperty
(
"gop.open.secret"
));
params
.
put
(
"sign"
,
sign
);
// 构建URL
String
url
=
buildUrl
(
params
);
log
.
info
(
"GOP接口调用URL:{}"
,
url
);
// 发送请求
return
HttpUtil
.
get
(
url
,
null
);
}
/**
* 构建请求URL
*
* @param params 参数
* @return URL
*/
private
static
String
buildUrl
(
Map
<
String
,
String
>
params
)
{
StringBuilder
url
=
new
StringBuilder
(
env
.
getProperty
(
"gop.open.url.prefix"
));
StringBuilder
paramStr
=
new
StringBuilder
();
for
(
Map
.
Entry
<
String
,
String
>
entry
:
params
.
entrySet
())
{
if
(
paramStr
.
length
()
>
0
)
{
paramStr
.
append
(
"&"
);
}
try
{
paramStr
.
append
(
entry
.
getKey
())
.
append
(
"="
)
.
append
(
URLEncoder
.
encode
(
entry
.
getValue
(),
StandardCharsets
.
UTF_8
.
name
()));
}
catch
(
Exception
e
)
{
log
.
warn
(
"URL编码失败:key={}, value={}"
,
entry
.
getKey
(),
entry
.
getValue
(),
e
);
}
}
url
.
append
(
paramStr
);
return
url
.
toString
();
}
/**
* 签名算法
*
* @param params 参数
* @param secret 密钥
* @return 签名
*/
private
static
String
sign
(
Map
<
String
,
String
>
params
,
String
secret
)
{
StringBuilder
sb
=
new
StringBuilder
();
List
<
String
>
paramNames
=
new
ArrayList
<>(
params
.
keySet
());
Collections
.
sort
(
paramNames
);
sb
.
append
(
secret
);
for
(
String
paramName
:
paramNames
)
{
sb
.
append
(
paramName
).
append
(
params
.
get
(
paramName
));
}
sb
.
append
(
secret
);
return
md5
(
sb
.
toString
());
}
/**
* MD5加密(32位)
*
* @param s 原字符串
* @return 加密后的字符串
*/
private
static
String
md5
(
String
s
)
{
char
[]
hexChars
=
{
'0'
,
'1'
,
'2'
,
'3'
,
'4'
,
'5'
,
'6'
,
'7'
,
'8'
,
'9'
,
'a'
,
'b'
,
'c'
,
'd'
,
'e'
,
'f'
};
try
{
byte
[]
bytes
=
s
.
getBytes
(
StandardCharsets
.
UTF_8
);
MessageDigest
md
=
MessageDigest
.
getInstance
(
"MD5"
);
md
.
update
(
bytes
);
bytes
=
md
.
digest
();
int
j
=
bytes
.
length
;
char
[]
chars
=
new
char
[
j
*
2
];
int
k
=
0
;
for
(
byte
b
:
bytes
)
{
chars
[
k
++]
=
hexChars
[
b
>>>
4
&
0xf
];
chars
[
k
++]
=
hexChars
[
b
&
0xf
];
}
return
new
String
(
chars
);
}
catch
(
Exception
e
)
{
return
null
;
}
}
}
rpc-dj-strategy/src/main/resources/META-INF/orm/CustomerTagProfileMapper.xml
View file @
2784067
...
@@ -22,4 +22,22 @@
...
@@ -22,4 +22,22 @@
source_type, source_ref_id, create_time, update_time, deleted_flag
source_type, source_ref_id, create_time, update_time, deleted_flag
</sql>
</sql>
<!-- 根据手机号列表批量查询客户画像 -->
<select
id=
"selectByPhoneList"
resultMap=
"BaseResultMap"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM dj_car_life_customer_tag_profile
WHERE deleted_flag = 'N'
AND phone IN
<foreach
collection=
"phoneList"
item=
"phone"
open=
"("
separator=
","
close=
")"
>
#{phone}
</foreach>
</select>
<!-- 根据手机号和类别代码物理删除记录 -->
<delete
id=
"deleteByPhoneAndCategoryCode"
>
DELETE FROM dj_car_life_customer_tag_profile
WHERE phone = #{phone}
AND category_code = #{categoryCode}
</delete>
</mapper>
</mapper>
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment