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 5a20aefd
authored
Jun 25, 2026
by
chenxi
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge remote-tracking branch 'origin/v5.8.3' into v5.8.3
2 parents
950ea110
2974b347
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
27 deletions
rpc-dj-strategy/src/main/java/cn/com/glsx/dj/strategy/service/SopStrategyEventLogService.java
rpc-dj-strategy/src/main/java/cn/com/glsx/dj/strategy/service/StrategySopService.java
rpc-dj-strategy/src/test/java/cn/com/glsx/dj/strategy/service/SopStrategyEventLogServiceTest.java
rpc-dj-strategy/src/main/java/cn/com/glsx/dj/strategy/service/SopStrategyEventLogService.java
View file @
5a20aef
...
...
@@ -27,14 +27,14 @@ public class SopStrategyEventLogService {
public
static
final
String
EVENT_CODE_H5_PAGE_VIEW
=
"sop_strategy_h5_marketing_page_view"
;
public
void
recordMenuEntryEvent
()
{
recordEvent
(
null
,
null
,
"SOP策略"
,
EVENT_CODE_MENU_ENTRY
,
null
);
recordEvent
(
null
,
null
,
"SOP策略"
,
EVENT_CODE_MENU_ENTRY
,
null
,
null
);
}
public
void
recordSubmitChangeEvent
(
Integer
strategyId
,
Long
taskId
)
{
public
void
recordSubmitChangeEvent
(
Integer
strategyId
,
Long
taskId
,
String
createdBy
)
{
Map
<
String
,
Object
>
eventData
=
new
HashMap
<>();
eventData
.
put
(
"strategyId"
,
strategyId
);
eventData
.
put
(
"taskId"
,
taskId
);
recordEvent
(
strategyId
,
null
,
"SOP策略"
,
EVENT_CODE_SUBMIT_CHANGE
,
eventData
);
recordEvent
(
strategyId
,
null
,
"SOP策略"
,
EVENT_CODE_SUBMIT_CHANGE
,
eventData
,
createdBy
);
}
public
void
recordH5PageViewEvent
(
Integer
strategyId
,
Long
taskId
,
...
...
@@ -46,11 +46,12 @@ public class SopStrategyEventLogService {
eventData
.
put
(
"storeName"
,
storeName
);
eventData
.
put
(
"customerName"
,
customerName
);
eventData
.
put
(
"customerPhone"
,
customerPhone
);
recordEvent
(
strategyId
,
taskId
,
"SOP策略"
,
EVENT_CODE_H5_PAGE_VIEW
,
eventData
);
recordEvent
(
strategyId
,
taskId
,
"SOP策略"
,
EVENT_CODE_H5_PAGE_VIEW
,
eventData
,
null
);
}
private
void
recordEvent
(
Integer
strategyId
,
Long
taskId
,
String
eventType
,
String
eventCode
,
Map
<
String
,
Object
>
eventData
)
{
Long
taskId
,
String
eventType
,
String
eventCode
,
Map
<
String
,
Object
>
eventData
,
String
createdBy
)
{
try
{
SopStrategyEventLog
eventLog
=
new
SopStrategyEventLog
();
eventLog
.
setStrategyId
(
strategyId
);
...
...
@@ -65,6 +66,7 @@ public class SopStrategyEventLogService {
}
}
eventLog
.
setEventTime
(
new
Date
());
eventLog
.
setCreatedBy
(
createdBy
);
eventLog
.
setDeletedFlag
(
"N"
);
sopStrategyEventLogMapper
.
insertSelective
(
eventLog
);
log
.
info
(
"记录埋点事件成功, eventCode:{}, strategyId:{}"
,
...
...
rpc-dj-strategy/src/main/java/cn/com/glsx/dj/strategy/service/StrategySopService.java
View file @
5a20aef
...
...
@@ -78,7 +78,7 @@ public class StrategySopService {
saveStrategyBranches
(
strategyId
,
request
.
getBranches
(),
createdBy
);
sopStrategyEventLogService
.
recordSubmitChangeEvent
(
strategyId
,
null
);
sopStrategyEventLogService
.
recordSubmitChangeEvent
(
strategyId
,
null
,
createdBy
);
log
.
info
(
"创建策略成功, strategyId:{}, strategyCode:{}"
,
strategyId
,
strategyCode
);
return
strategyId
;
}
...
...
@@ -108,9 +108,10 @@ public class StrategySopService {
sopStrategyActionMediaMapper
.
deleteByStrategyId
(
request
.
getStrategyId
());
sopStrategyActionMapper
.
deleteByStrategyId
(
request
.
getStrategyId
());
sopStrategyBranchMapper
.
deleteByStrategyId
(
request
.
getStrategyId
());
sopStrategyConditionGroupMapper
.
deleteByStrategyIdAndStep
(
request
.
getStrategyId
(),
3
);
saveStrategyBranches
(
request
.
getStrategyId
(),
request
.
getBranches
(),
updatedBy
);
sopStrategyEventLogService
.
recordSubmitChangeEvent
(
request
.
getStrategyId
(),
null
);
sopStrategyEventLogService
.
recordSubmitChangeEvent
(
request
.
getStrategyId
(),
null
,
updatedBy
);
sopStrategySnapshotCacheService
.
evictStrategyCache
(
request
.
getStrategyId
());
log
.
info
(
"更新策略成功, strategyId:{}, version:{}"
,
request
.
getStrategyId
(),
strategy
.
getVersion
());
return
true
;
...
...
@@ -252,7 +253,6 @@ public class StrategySopService {
return
;
}
int
groupNo
=
1
;
sopStrategyConditionGroupMapper
.
deleteByStrategyIdAndStep
(
strategyId
,
3
);
for
(
SopConditionGroupReqDTO
groupReq
:
conditionGroups
)
{
SopStrategyConditionGroup
group
=
BeanUtil
.
copyProperties
(
groupReq
,
SopStrategyConditionGroup
.
class
);
group
.
setStrategyId
(
strategyId
);
...
...
rpc-dj-strategy/src/test/java/cn/com/glsx/dj/strategy/service/SopStrategyEventLogServiceTest.java
View file @
5a20aef
...
...
@@ -43,25 +43,6 @@ public class SopStrategyEventLogServiceTest {
}
@Test
public
void
testRecordSubmitChangeEvent
()
{
doNothing
().
when
(
sopStrategyEventLogMapper
).
insertSelective
(
any
(
SopStrategyEventLog
.
class
));
sopStrategyEventLogService
.
recordSubmitChangeEvent
(
1
,
100L
);
verify
(
sopStrategyEventLogMapper
,
times
(
1
)).
insertSelective
(
any
(
SopStrategyEventLog
.
class
));
}
@Test
public
void
testRecordSubmitChangeEvent_NullExecutionRecordId
()
{
doNothing
().
when
(
sopStrategyEventLogMapper
).
insertSelective
(
any
(
SopStrategyEventLog
.
class
));
sopStrategyEventLogService
.
recordSubmitChangeEvent
(
1
,
null
);
verify
(
sopStrategyEventLogMapper
,
times
(
1
)).
insertSelective
(
any
(
SopStrategyEventLog
.
class
));
}
@Test
public
void
testRecordEvent_Exception
()
{
doThrow
(
new
RuntimeException
(
"数据库异常"
)).
when
(
sopStrategyEventLogMapper
).
insertSelective
(
any
(
SopStrategyEventLog
.
class
));
...
...
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