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 45736b39
authored
Sep 24, 2023
by
zhouhaibao
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[+]旅程节点执行添加
1 parent
d644d059
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
14 deletions
platform-process/src/main/java/cn/com/glsx/process/modules/sop/CustomerInfo.java
platform-process/src/main/java/cn/com/glsx/process/modules/sop/SopHelper.java
platform-process/src/main/java/cn/com/glsx/process/modules/sop/java/example/ControllerDisTasksDemo.java
platform-process/src/main/java/cn/com/glsx/process/modules/sop/java/example/ControllerScreenPersonDemo.java
platform-process/src/test/java/cn/com/glsx/test/JavaNodeTestApplication.java
platform-process/src/main/java/cn/com/glsx/process/modules/sop/CustomerInfo.java
View file @
45736b3
...
@@ -19,11 +19,11 @@ public class CustomerInfo {
...
@@ -19,11 +19,11 @@ public class CustomerInfo {
private
Date
sopJourneyEnterTime
;
private
Date
sopJourneyEnterTime
;
private
String
sop
_journey_s
tage
;
private
String
sop
JourneyS
tage
;
private
Date
sopJourneyStageEnterTime
;
private
Date
sopJourneyStageEnterTime
;
private
String
followStaff
Uuid
;
private
String
followStaff
Phone
;
private
String
messageContent
;
private
String
messageContent
;
...
...
platform-process/src/main/java/cn/com/glsx/process/modules/sop/SopHelper.java
View file @
45736b3
...
@@ -108,6 +108,7 @@ public class SopHelper {
...
@@ -108,6 +108,7 @@ public class SopHelper {
return
null
;
return
null
;
}
}
if
(
CollectionUtils
.
isNotEmpty
(
customerInfoList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
customerInfoList
))
{
// 距离旅程相差天数过滤
return
customerInfoList
.
stream
().
filter
(
index
->
SopHelper
.
diffDay
(
index
.
getSopJourneyStageEnterTime
(),
Integer
.
parseInt
(
diffday
))).
collect
(
Collectors
.
toList
());
return
customerInfoList
.
stream
().
filter
(
index
->
SopHelper
.
diffDay
(
index
.
getSopJourneyStageEnterTime
(),
Integer
.
parseInt
(
diffday
))).
collect
(
Collectors
.
toList
());
}
}
return
null
;
return
null
;
...
@@ -145,6 +146,20 @@ public class SopHelper {
...
@@ -145,6 +146,20 @@ public class SopHelper {
}
}
return
null
;
return
null
;
}
}
public
static
String
getValueFromJsonString
(
String
jsonString
,
String
objectName
,
String
objectNameTwo
,
String
fieldName
)
{
try
{
ObjectMapper
objectMapper
=
new
ObjectMapper
();
JsonNode
rootNode
=
objectMapper
.
readTree
(
jsonString
);
JsonNode
objectNode
=
rootNode
.
get
(
objectName
);
JsonNode
objectNodeTwo
=
objectNode
.
get
(
objectNameTwo
);
JsonNode
fieldNode
=
objectNodeTwo
.
get
(
fieldName
);
return
fieldNode
.
asText
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
null
;
}
public
static
String
getValueFromJsonString
(
String
jsonString
,
String
fieldName
)
{
public
static
String
getValueFromJsonString
(
String
jsonString
,
String
fieldName
)
{
try
{
try
{
...
...
platform-process/src/main/java/cn/com/glsx/process/modules/sop/java/example/ControllerDisTasksDemo.java
View file @
45736b3
...
@@ -42,25 +42,27 @@ public class ControllerDisTasksDemo {
...
@@ -42,25 +42,27 @@ public class ControllerDisTasksDemo {
if
(
CollectionUtils
.
isNotEmpty
(
customerInfoList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
customerInfoList
))
{
String
instSnapshot
=
sopInst
.
getInstSnapshot
();
String
instSnapshot
=
sopInst
.
getInstSnapshot
();
multiValueMap
.
add
(
"requestList[0].activityId"
,
SopHelper
.
getValueFromJsonString
(
instSnapshot
,
"initMap"
,
"customData"
,
"activityId"
));
multiValueMap
.
add
(
"requestList[0].activityId"
,
SopHelper
.
getValueFromJsonString
(
instSnapshot
,
"activityId"
));
multiValueMap
.
add
(
"requestList[0].nodeId"
,
sopInstNode
.
getNodeId
()
+
""
);
multiValueMap
.
add
(
"requestList[0].nodeId"
,
sopInstNode
.
getNodeId
()
+
""
);
multiValueMap
.
add
(
"requestList[0].nodeName"
,
sopInstNode
.
getNodeName
());
multiValueMap
.
add
(
"requestList[0].nodeName"
,
sopInstNode
.
getNodeName
());
multiValueMap
.
add
(
"requestList[0].stageId"
,
SopHelper
.
getValueFromJsonString
(
nodeParam
,
"stage"
));
multiValueMap
.
add
(
"requestList[0].stageId"
,
SopHelper
.
getValueFromJsonString
(
nodeParam
,
"stage"
));
multiValueMap
.
add
(
"requestList[0].stageName"
,
SopHelper
.
getValueFromJsonString
(
nodeParam
,
"stage"
));
multiValueMap
.
add
(
"requestList[0].stageName"
,
SopHelper
.
getValueFromJsonString
(
nodeParam
,
"stage"
));
multiValueMap
.
add
(
"requestList[0].taskId"
,
sopInst
.
getInstId
());
multiValueMap
.
add
(
"requestList[0].sopId"
,
sopInst
.
getInstId
());
multiValueMap
.
add
(
"requestList[0].taskName"
,
sopInst
.
getInstName
());
multiValueMap
.
add
(
"requestList[0].taskType"
,
SopHelper
.
getValueFromJsonString
(
nodeParam
,
"taskType"
));
multiValueMap
.
add
(
"requestList[0].taskType"
,
SopHelper
.
getValueFromJsonString
(
nodeParam
,
"taskType"
));
for
(
int
i
=
0
;
i
<
customerInfoList
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
customerInfoList
.
size
();
i
++)
{
CustomerInfo
customerInfo
=
customerInfoList
.
get
(
i
);
CustomerInfo
customerInfo
=
customerInfoList
.
get
(
i
);
multiValueMap
.
add
(
"requestList[0].customerList["
+
i
+
"].customerId"
,
customerInfo
.
getOneId
());
multiValueMap
.
add
(
"requestList[0].customerList["
+
i
+
"].customerId"
,
customerInfo
.
getOneId
());
multiValueMap
.
add
(
"requestList[0].customerList["
+
i
+
"].followStaff
Uuid"
,
customerInfo
.
getFollowStaffUuid
());
multiValueMap
.
add
(
"requestList[0].customerList["
+
i
+
"].followStaff
Phone"
,
customerInfo
.
getFollowStaffPhone
());
multiValueMap
.
add
(
"requestList[0].customerList["
+
i
+
"].messageContent"
,
customerInfo
.
getMessageContent
());
multiValueMap
.
add
(
"requestList[0].customerList["
+
i
+
"].messageContent"
,
customerInfo
.
getMessageContent
());
multiValueMap
.
add
(
"requestList[0].customerList["
+
i
+
"].messageId"
,
customerInfo
.
getMessageId
());
if
(
customerInfo
.
getMessageId
()!=
null
)
{
multiValueMap
.
add
(
"requestList[0].customerList["
+
i
+
"].talkId"
,
customerInfo
.
getTalkId
());
multiValueMap
.
add
(
"requestList[0].customerList["
+
i
+
"].messageId"
,
customerInfo
.
getMessageId
());
}
if
(
customerInfo
.
getTalkId
()!=
null
)
{
multiValueMap
.
add
(
"requestList[0].customerList["
+
i
+
"].talkId"
,
customerInfo
.
getTalkId
());
}
}
}
try
{
try
{
...
...
platform-process/src/main/java/cn/com/glsx/process/modules/sop/java/example/ControllerScreenPersonDemo.java
View file @
45736b3
...
@@ -31,7 +31,7 @@ public class ControllerScreenPersonDemo {
...
@@ -31,7 +31,7 @@ public class ControllerScreenPersonDemo {
List
<
CustomerInfo
>
customerInfoList
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
resultData
.
get
(
"users"
)),
CustomerInfo
.
class
);
List
<
CustomerInfo
>
customerInfoList
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
resultData
.
get
(
"users"
)),
CustomerInfo
.
class
);
if
(
CollectionUtils
.
isNotEmpty
(
customerInfoList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
customerInfoList
))
{
List
<
CustomerInfo
>
collect
=
customerInfoList
.
stream
().
filter
(
index
->
stage
.
equals
(
index
.
getSop
_journey_s
tage
())).
collect
(
Collectors
.
toList
());
List
<
CustomerInfo
>
collect
=
customerInfoList
.
stream
().
filter
(
index
->
stage
.
equals
(
index
.
getSop
JourneyS
tage
())).
collect
(
Collectors
.
toList
());
return
(
JSONArray
)
JSONObject
.
toJSON
(
collect
);
return
(
JSONArray
)
JSONObject
.
toJSON
(
collect
);
}
}
return
null
;
return
null
;
...
...
platform-process/src/test/java/cn/com/glsx/test/JavaNodeTestApplication.java
View file @
45736b3
...
@@ -45,7 +45,7 @@ public class JavaNodeTestApplication {
...
@@ -45,7 +45,7 @@ public class JavaNodeTestApplication {
customerInfo
.
setSopJourneyId
(
"xblc7"
);
customerInfo
.
setSopJourneyId
(
"xblc7"
);
customerInfo
.
setSopJourneyEnterTime
(
new
Date
());
customerInfo
.
setSopJourneyEnterTime
(
new
Date
());
customerInfo
.
setCustomerPhone
(
"13476670746"
);
customerInfo
.
setCustomerPhone
(
"13476670746"
);
customerInfo
.
setSop
_journey_s
tage
(
"潜客"
);
customerInfo
.
setSop
JourneyS
tage
(
"潜客"
);
customerInfo
.
setSopJourneyStageEnterTime
(
new
Date
());
customerInfo
.
setSopJourneyStageEnterTime
(
new
Date
());
resultData
.
put
(
"users"
,
Arrays
.
asList
(
customerInfo
));
resultData
.
put
(
"users"
,
Arrays
.
asList
(
customerInfo
));
SopStruct
sopStruct
=
sopService
.
loadSop
(
"xblc7"
);
SopStruct
sopStruct
=
sopService
.
loadSop
(
"xblc7"
);
...
@@ -71,8 +71,9 @@ public class JavaNodeTestApplication {
...
@@ -71,8 +71,9 @@ public class JavaNodeTestApplication {
customerInfo
.
setSopJourneyId
(
"xblc7"
);
customerInfo
.
setSopJourneyId
(
"xblc7"
);
customerInfo
.
setSopJourneyEnterTime
(
new
Date
());
customerInfo
.
setSopJourneyEnterTime
(
new
Date
());
customerInfo
.
setCustomerPhone
(
"13476670746"
);
customerInfo
.
setCustomerPhone
(
"13476670746"
);
customerInfo
.
setSop_journey_stage
(
"潜客"
);
customerInfo
.
setFollowStaffPhone
(
"13476670746"
);
customerInfo
.
setSopJourneyStageEnterTime
(
DateUtils
.
parse
(
"2023-09-22"
));
customerInfo
.
setSopJourneyStage
(
"潜客"
);
customerInfo
.
setSopJourneyStageEnterTime
(
DateUtils
.
parse
(
"2023-09-23"
));
resultData
.
put
(
"user1"
,
Arrays
.
asList
(
customerInfo
));
resultData
.
put
(
"user1"
,
Arrays
.
asList
(
customerInfo
));
SopStruct
sopStruct
=
sopService
.
loadSop
(
"xblc7"
);
SopStruct
sopStruct
=
sopService
.
loadSop
(
"xblc7"
);
SopInstNode
sopInstNode
=
sopStruct
.
getInstNodeMap
().
get
(
3
);
SopInstNode
sopInstNode
=
sopStruct
.
getInstNodeMap
().
get
(
3
);
...
@@ -98,7 +99,7 @@ public class JavaNodeTestApplication {
...
@@ -98,7 +99,7 @@ public class JavaNodeTestApplication {
customerInfo
.
setSopJourneyId
(
"xblc7"
);
customerInfo
.
setSopJourneyId
(
"xblc7"
);
customerInfo
.
setSopJourneyEnterTime
(
new
Date
());
customerInfo
.
setSopJourneyEnterTime
(
new
Date
());
customerInfo
.
setCustomerPhone
(
"13476670746"
);
customerInfo
.
setCustomerPhone
(
"13476670746"
);
customerInfo
.
setSop
_journey_s
tage
(
"潜在客户"
);
customerInfo
.
setSop
JourneyS
tage
(
"潜在客户"
);
customerInfo
.
setSopJourneyStageEnterTime
(
DateUtils
.
parse
(
"2023-09-22"
));
customerInfo
.
setSopJourneyStageEnterTime
(
DateUtils
.
parse
(
"2023-09-22"
));
customerInfo
.
setVin
(
"WAURFCF24MN013761"
);
customerInfo
.
setVin
(
"WAURFCF24MN013761"
);
resultData
.
put
(
"user1"
,
Arrays
.
asList
(
customerInfo
));
resultData
.
put
(
"user1"
,
Arrays
.
asList
(
customerInfo
));
...
...
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