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 5250bb00
authored
Jan 11, 2024
by
林永健
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix parse sql bug
1 parent
430b30f7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
14 deletions
platform-process/src/test/java/cn/com/glsx/test/service/TestSopService.java
platform-process/src/test/java/cn/com/glsx/test/service/TestSopService.java
View file @
5250bb0
...
...
@@ -3,16 +3,14 @@ package cn.com.glsx.test.service;
import
cn.com.glsx.Application
;
import
cn.com.glsx.process.job.xxljob.impl.SopInstNodeExecuteJobHandler
;
import
cn.com.glsx.process.modules.converter.SopInstConverter
;
import
cn.com.glsx.process.modules.entity.SopInst
;
import
cn.com.glsx.process.modules.model.SopDataActionDTO
;
import
cn.com.glsx.process.modules.model.SopDataActionSearch
;
import
cn.com.glsx.process.modules.model.SopInstDTO
;
import
cn.com.glsx.process.modules.model.SopStruct
;
import
cn.com.glsx.process.modules.model.*
;
import
cn.com.glsx.process.modules.service.SopDataService
;
import
cn.com.glsx.process.modules.service.SopInstService
;
import
cn.com.glsx.process.modules.service.SopService
;
import
cn.com.glsx.process.modules.service.SopTplService
;
import
cn.hutool.json.JSONUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.github.pagehelper.PageInfo
;
import
com.google.common.collect.ImmutableMap
;
import
lombok.extern.slf4j.Slf4j
;
import
org.assertj.core.util.Lists
;
...
...
@@ -23,7 +21,6 @@ import org.springframework.boot.test.context.SpringBootTest;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
java.util.List
;
import
java.util.Map
;
/**
* 测试spring cloud 服务调用方式
...
...
@@ -43,6 +40,9 @@ public class TestSopService {
private
SopDataService
sopDataService
;
@Autowired
private
SopTplService
sopTplService
;
@Autowired
private
SopInstService
instService
;
@Test
...
...
@@ -118,20 +118,25 @@ public class TestSopService {
.
getSubConditions
().
stream
().
filter
(
p
->
p
.
getName
().
equals
(
"页面停留时长"
)).
findFirst
().
get
()
.
getOperators
().
stream
().
filter
(
p
->
p
.
getName
().
equals
(
"大于"
)).
findFirst
().
get
().
setValue
(
"3"
);
actionDTOS
.
stream
().
filter
(
p
->
p
.
getName
().
equals
(
"基于页面行为"
)).
findFirst
().
get
()
.
getConditions
().
stream
().
filter
(
p
->
p
.
getName
().
equals
(
"页面停留"
)).
findFirst
().
get
()
.
getSubConditions
().
stream
().
filter
(
p
->
p
.
getName
().
equals
(
"页面停留时长"
)).
findFirst
().
get
()
.
getOperators
().
stream
().
filter
(
p
->
p
.
getName
().
equals
(
"小于"
)).
findFirst
().
get
().
setValue
(
"5"
);
.
getConditions
().
stream
().
filter
(
p
->
p
.
getName
().
equals
(
"页面配置"
)).
findFirst
().
get
()
.
getOperators
().
stream
().
filter
(
p
->
p
.
getName
().
equals
(
"等于"
)).
findFirst
().
get
().
setValue
(
"5+10892+test活动"
);
actionDTOS
.
stream
().
filter
(
p
->
p
.
getName
().
equals
(
"添加企微好友"
)).
findFirst
().
get
()
.
getConditions
().
stream
().
filter
(
p
->
p
.
getName
().
equals
(
"指定成员"
)).
findFirst
().
get
()
.
getOperators
().
stream
().
filter
(
p
->
p
.
getName
().
equals
(
"包含"
)).
findFirst
().
get
().
setValue
(
"1,2,3"
);
for
(
SopDataActionDTO
actionDTO
:
actionDTOS
)
{
String
res
=
sopDataService
.
parseSQL
(
actionDTO
,
"xx"
);
String
res
=
sopDataService
.
parseSQL
(
actionDTO
,
"xx"
,
"123"
);
System
.
out
.
println
(
JSON
.
toJSONString
(
res
));
}
}
@Test
public
void
testParseSqlByInst
()
{
SopInstDTO
instDTO
=
instService
.
findById
(
"72903157155"
);
SopInst
sopInst
=
SopInstConverter
.
INSTANCE
.
dto2do
(
instDTO
);
Map
<
String
,
String
>
sql
=
sopDataService
.
parseSQL
(
sopInst
);
System
.
out
.
println
(
sql
);
SopInstSearch
p
=
new
SopInstSearch
();
p
.
setPageSize
(
9999
);
PageInfo
<
SopInstDTO
>
instPages
=
instService
.
page
(
p
);
instPages
.
getList
().
forEach
(
i
->
{
System
.
out
.
println
(
sopDataService
.
parseSQL
(
SopInstConverter
.
INSTANCE
.
dto2do
(
i
)));
});
}
}
\ No newline at end of file
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