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 44b660e2
authored
Jun 18, 2026
by
章家宝
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat:客户录音画像标签定时任务
1 parent
f1154c72
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
108 additions
and
12 deletions
rpc-dj-strategy/pom.xml
rpc-dj-strategy/src/main/java/cn/com/glsx/dj/strategy/config/DubboConfig.java
rpc-dj-strategy/src/main/java/cn/com/glsx/dj/strategy/job/InspectionCustomerTagJob.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/service/CustomerTagProfileService.java
rpc-dj-strategy/src/main/java/cn/com/glsx/dj/strategy/service/InspectionCustomerTagSyncService.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/pom.xml
View file @
44b660e
...
...
@@ -32,7 +32,7 @@
<dependency>
<groupId>
cn.com.glsx
</groupId>
<artifactId>
rpc-dj-mindworkplate-api
</artifactId>
<version>
5.
6.1
-SNAPSHOT
</version>
<version>
5.
8.3
-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
org.oreframework
</groupId>
...
...
rpc-dj-strategy/src/main/java/cn/com/glsx/dj/strategy/config/DubboConfig.java
View file @
44b660e
package
cn
.
com
.
glsx
.
dj
.
strategy
.
config
;
import
cn.com.glsx.dj.mindworkplate.remote.InspectionCustomerTagRemote
;
import
cn.com.glsx.dj.mindworkplate.remote.MonitoringRemote
;
import
cn.com.glsx.dj.mindworkplate.remote.PadMessageBoxRemote
;
import
cn.com.glsx.dj.peanalysis.remote.BusinessSceneAnalysisRemote
;
...
...
@@ -91,4 +92,9 @@ public class DubboConfig {
return
factory
.
builder
(
SceneRemote
.
class
).
check
(
check
).
version
(
"1.0.0"
).
timeout
(
timeout
).
build
();
}
@Bean
public
InspectionCustomerTagRemote
inspectionCustomerTagRemote
()
{
return
factory
.
builder
(
InspectionCustomerTagRemote
.
class
).
check
(
check
).
timeout
(
timeout
).
build
();
}
}
rpc-dj-strategy/src/main/java/cn/com/glsx/dj/strategy/job/InspectionCustomerTagJob.java
0 → 100644
View file @
44b660e
package
cn
.
com
.
glsx
.
dj
.
strategy
.
job
;
import
cn.com.glsx.dj.strategy.service.InspectionCustomerTagSyncService
;
import
com.dangdang.ddframe.job.api.ShardingContext
;
import
com.dangdang.ddframe.job.api.simple.SimpleJob
;
import
lombok.extern.slf4j.Slf4j
;
import
org.oreframework.boot.autoconfigure.elasticjob.annotation.ElasticJobConf
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
/**
* AI客户标签同步定时任务
* 每天凌晨2点执行,从mindworkplate服务同步昨天的录音客户标签数据
*
* @author yangwei_by_claude
* @version 1.0
* @since 2026/06/18
*/
@Slf4j
@Component
@ElasticJobConf
(
name
=
"CustomerTagSyncJob"
,
cron
=
"0 0 2 * * ?"
,
description
=
"AI客户标签同步定时任务"
,
overwrite
=
false
)
public
class
InspectionCustomerTagJob
implements
SimpleJob
{
@Autowired
private
InspectionCustomerTagSyncService
inspectionCustomerTagSyncService
;
@Override
public
void
execute
(
ShardingContext
shardingContext
)
{
log
.
info
(
"AI客户标签同步定时任务开始执行"
);
try
{
inspectionCustomerTagSyncService
.
syncCustomerTagFromInspection
();
}
catch
(
Exception
e
)
{
log
.
error
(
"AI客户标签同步定时任务执行异常"
,
e
);
}
log
.
info
(
"AI客户标签同步定时任务执行结束"
);
}
}
rpc-dj-strategy/src/main/java/cn/com/glsx/dj/strategy/mapper/CustomerTagProfileMapper.java
View file @
44b660e
...
...
@@ -33,4 +33,33 @@ public interface CustomerTagProfileMapper extends OreMapper<CustomerTagProfile>
* @return 删除数量
*/
int
deleteByPhoneAndCategoryCode
(
@Param
(
"phone"
)
String
phone
,
@Param
(
"categoryCode"
)
String
categoryCode
);
/**
* 根据手机号和来源类型物理删除记录
*
* @param phone 手机号
* @param sourceType 来源类型
* @return 删除数量
*/
int
deleteByPhoneAndSourceType
(
@Param
(
"phone"
)
String
phone
,
@Param
(
"sourceType"
)
String
sourceType
);
/**
* 根据手机号、来源类型和维度代码列表物理删除记录
*
* @param phone 手机号
* @param sourceType 来源类型
* @param dimensionCodes 维度代码列表
* @return 删除数量
*/
int
deleteByPhoneAndSourceTypeAndDimensionCodes
(
@Param
(
"phone"
)
String
phone
,
@Param
(
"sourceType"
)
String
sourceType
,
@Param
(
"dimensionCodes"
)
List
<
String
>
dimensionCodes
);
/**
* 批量插入标签画像
*
* @param list 标签画像列表
* @return 插入数量
*/
int
batchInsert
(
@Param
(
"list"
)
List
<
CustomerTagProfile
>
list
);
}
rpc-dj-strategy/src/main/java/cn/com/glsx/dj/strategy/service/CustomerTagProfileService.java
View file @
44b660e
...
...
@@ -6,6 +6,7 @@ import cn.com.glsx.dj.strategy.enums.ArchiveTagEnum;
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
cn.hutool.core.bean.BeanUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -173,15 +174,6 @@ public class CustomerTagProfileService {
* @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
;
return
BeanUtil
.
copyProperties
(
profile
,
CustomerProfileRespDTO
.
class
);
}
}
rpc-dj-strategy/src/main/java/cn/com/glsx/dj/strategy/service/InspectionCustomerTagSyncService.java
0 → 100644
View file @
44b660e
This diff is collapsed.
Click to expand it.
rpc-dj-strategy/src/main/java/cn/com/glsx/dj/strategy/util/GopApiUtil.java
View file @
44b660e
...
...
@@ -167,6 +167,7 @@ public class GopApiUtil {
/**
* MD5加密(32位)
* 注意:使用平台默认编码,与 GopUtil 保持一致
*
* @param s 原字符串
* @return 加密后的字符串
...
...
@@ -174,7 +175,7 @@ public class GopApiUtil {
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
);
byte
[]
bytes
=
s
.
getBytes
();
MessageDigest
md
=
MessageDigest
.
getInstance
(
"MD5"
);
md
.
update
(
bytes
);
bytes
=
md
.
digest
();
...
...
rpc-dj-strategy/src/main/resources/META-INF/orm/CustomerTagProfileMapper.xml
View file @
44b660e
...
...
@@ -40,4 +40,34 @@
AND category_code = #{categoryCode}
</delete>
<!-- 根据手机号和来源类型物理删除记录 -->
<delete
id=
"deleteByPhoneAndSourceType"
>
DELETE FROM dj_car_life_customer_tag_profile
WHERE phone = #{phone}
AND source_type = #{sourceType}
</delete>
<!-- 根据手机号、来源类型和维度代码列表物理删除记录 -->
<delete
id=
"deleteByPhoneAndSourceTypeAndDimensionCodes"
>
DELETE FROM dj_car_life_customer_tag_profile
WHERE phone = #{phone}
AND source_type = #{sourceType}
AND dimension_code IN
<foreach
collection=
"dimensionCodes"
item=
"dimensionCode"
open=
"("
separator=
","
close=
")"
>
#{dimensionCode}
</foreach>
</delete>
<!-- 批量插入标签画像 -->
<insert
id=
"batchInsert"
>
INSERT INTO dj_car_life_customer_tag_profile
(phone, category_code, dimension_code, enum_code, score_basis, score, source_type, source_ref_id, create_time, update_time, deleted_flag)
VALUES
<foreach
collection=
"list"
item=
"item"
separator=
","
>
(#{item.phone}, #{item.categoryCode}, #{item.dimensionCode}, #{item.enumCode},
#{item.scoreBasis}, #{item.score}, #{item.sourceType}, #{item.sourceRefId},
NOW(), NOW(), 'N')
</foreach>
</insert>
</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