Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
platform
/
platform-process-server
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 db944e54
authored
Dec 28, 2023
by
谢海旭
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
新增模板接口:针对后续接入新圈人方式进行通用化调整
1 parent
77415feb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
21 deletions
platform-process/src/main/java/cn/com/glsx/process/modules/assembler/KeHuLvChengAssembler.java
platform-process/src/main/java/cn/com/glsx/process/modules/controller/SopInstController.java
platform-process/src/main/java/cn/com/glsx/process/modules/assembler/KeHuLvChengAssembler.java
View file @
db944e5
...
...
@@ -26,7 +26,7 @@ import java.util.stream.Collectors;
/**
* @Title:
* @Description:
* @Description:
客户旅程 模板节点组装器
* @Author xiehx
* @Date 2023/12/21
**/
...
...
@@ -34,12 +34,20 @@ import java.util.stream.Collectors;
@Component
public
class
KeHuLvChengAssembler
{
/**
* 模板 输入参数定义
*/
private
static
final
String
TPL_PARAM_DEF_TPL
=
"{\"customData\":{\"paramKey\":\"customData\",\"defaultValue\":{},\"required\":true,\"paramDesc\":\"门店相关自定义参数\",\"valueType\":\"Map\"},\"merchantId\":{\"paramKey\":\"merchantId\",\"defaultValue\":\"\",\"required\":true,\"paramDesc\":\"商户号\",\"valueType\":\"String\"},\"stages\":{\"paramKey\":\"stages\",\"defaultValue\":{},\"required\":true,\"paramDesc\":\"阶段集\",\"valueType\":\"Map\"},\"dataTypeCode\":{\"paramKey\":\"dataTypeCode\",\"defaultValue\":\"\",\"required\":true,\"paramDesc\":\"圈人方式标识码\",\"valueType\":\"String\"}}"
;
/**
* 模板阶段节点 输入参数
*/
private
static
final
String
STAGE_TPL_NODE_PARAM_DEF_TPL
=
"{\"stage\":{\"paramKey\":\"stage\",\"defaultValue\":\"\",\"required\":true,\"paramDesc\":\"stage\",\"valueType\":\"String\"}}"
;
@Autowired
private
SopTplNodeProtoMapper
sopTplNodeProtoMapper
;
/**
* 客户旅程模板组装
* TODO 需要增加 触发时间转换为cron表达式,保存到对应字段里
*
* @param sopTplDTO
*/
...
...
@@ -52,7 +60,7 @@ public class KeHuLvChengAssembler {
sopTplDTO
.
setTplRemark
(
"运营端新增模板"
);
sopTplDTO
.
setTplStatus
((
byte
)
1
);
sopTplDTO
.
setTplSingleton
((
byte
)
1
);
sopTplDTO
.
setTplParamDef
(
JacksonUtil
.
jsonStrDeepSub
(
getTplParamDef
(
dataTypeCode
)
,
tplParamDef
));
sopTplDTO
.
setTplParamDef
(
JacksonUtil
.
jsonStrDeepSub
(
TPL_PARAM_DEF_TPL
,
tplParamDef
));
List
<
SopTplNodeProto
>
tplNodeProtos
=
sopTplNodeProtoMapper
.
selectByExample
(
Example
.
builder
(
SopTplNodeProto
.
class
).
where
(
Sqls
.
custom
().
andEqualTo
(
"dataTypeCode"
,
dataTypeCode
).
orIsNull
(
"dataTypeCode"
)).
build
());
...
...
@@ -94,8 +102,6 @@ public class KeHuLvChengAssembler {
//阶段与其排序后的序号的对应关系
Map
<
String
,
Integer
>
stageOrderMap
=
new
HashMap
<>();
//创建阶段对应的节点
String
stageNodeParamDefModel
=
"{\"stage\":{\"paramKey\":\"stage\",\"defaultValue\":\"\",\"required\":true,\"paramDesc\":\"stage\",\"valueType\":\"String\"}}"
;
List
<
String
>
stageSortedKeys
=
new
ArrayList
<>(
stages
.
keySet
());
Collections
.
sort
(
stageSortedKeys
);
...
...
@@ -107,7 +113,7 @@ public class KeHuLvChengAssembler {
SopTplNode
stageNode
=
protoConverter
.
proto2tpl
(
stageProto
);
stageNode
.
setNodeId
(
tplNodeLastNum
++);
stageNode
.
setNodeParamDef
(
JacksonUtil
.
jsonStrDeepSub
(
stageNodeParamDefModel
,
String
.
format
(
"{\"stage\":{\"defaultValue\":\"%s\"}}"
,
stageValue
)));
stageNode
.
setNodeParamDef
(
JacksonUtil
.
jsonStrDeepSub
(
STAGE_TPL_NODE_PARAM_DEF_TPL
,
String
.
format
(
"{\"stage\":{\"defaultValue\":\"%s\"}}"
,
stageValue
)));
stageNode
.
setNodeKey
(
String
.
format
(
"%s%d"
,
stageProto
.
getNodeKey
(),
stageOrder
));
tplNodes
.
add
(
stageNode
);
...
...
@@ -186,20 +192,6 @@ public class KeHuLvChengAssembler {
}
/**
* 根据圈人方式获取预定义初始化参数 tplParamDef
*
* @param dataTypeCode
* @return
*/
private
String
getTplParamDef
(
String
dataTypeCode
)
{
if
(
"xbpzj"
.
equals
(
dataTypeCode
))
{
return
"{\"customData\":{\"paramKey\":\"customData\",\"defaultValue\":{\"textMessage\":null,\"activityName\":null,\"activityId\":null,\"activityUrl\":null,\"aiSpeech\":null},\"required\":true,\"paramDesc\":\"customData\",\"valueType\":\"Map\"},\"merchantId\":{\"paramKey\":\"merchantId\",\"defaultValue\":\"\",\"required\":true,\"paramDesc\":\"merchantId\",\"valueType\":\"String\"},\"stages\":{\"paramKey\":\"stages\",\"defaultValue\":{},\"required\":true,\"paramDesc\":\"stages\",\"valueType\":\"Map\"},\"dataTypeCode\":{\"paramKey\":\"dataTypeCode\",\"defaultValue\":\"圈人方式标识码\",\"required\":true,\"paramDesc\":\"dataTypeCode\",\"valueType\":\"String\"}}"
;
}
else
{
return
"{\"merchantId\":{\"paramKey\":\"merchantId\",\"defaultValue\":\"\",\"required\":true,\"paramDesc\":\"merchantId\",\"valueType\":\"String\"},\"stages\":{\"paramKey\":\"stages\",\"defaultValue\":{},\"required\":true,\"paramDesc\":\"stages\",\"valueType\":\"Map\"},\"dataTypeCode\":{\"paramKey\":\"dataTypeCode\",\"defaultValue\":\"圈人方式标识码\",\"required\":true,\"paramDesc\":\"dataTypeCode\",\"valueType\":\"String\"}}"
;
}
}
/**
* 获取指定 节点原型组 第一个 节点原型
*
* @param tplNodeProtos
...
...
platform-process/src/main/java/cn/com/glsx/process/modules/controller/SopInstController.java
View file @
db944e5
...
...
@@ -82,7 +82,7 @@ public class SopInstController extends BaseController {
return
instDTO
;
}
@Operation
(
summary
=
"更新SOP门店模板实例初始参数里的门店自定义参数(关联活动
)"
,
description
=
"更新SOP门店模板实例初始参数里的门店自定义参数(关联活动
)"
)
@Operation
(
summary
=
"更新SOP门店模板实例初始参数里的门店自定义参数(关联活动
等)"
,
description
=
"更新SOP门店模板实例初始参数里的门店自定义参数(关联活动等
)"
)
@PostMapping
(
"/{instId}/instParam/customData"
)
public
Result
<
String
>
updateInstParamCustomData
(
@PathVariable
(
"instId"
)
String
instId
,
@RequestBody
Map
<
String
,
Object
>
customData
)
{
return
sopInstService
.
updateInstParamCustomData
(
instId
,
customData
);
...
...
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