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 cf6855ab
authored
Sep 21, 2023
by
zhouhaibao
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[+]数据源修复
1 parent
096e8ab0
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
17 additions
and
14 deletions
platform-process-api/src/main/java/cn/com/glsx/process/modules/mapper/SopDataSourceMapper.java
platform-process/src/main/java/cn/com/glsx/process/modules/controller/SopTplController.java
platform-process/src/main/java/cn/com/glsx/process/modules/controller/TestXXLJobController.java
platform-process/src/main/java/cn/com/glsx/process/modules/service/SopDataSourceService.java
platform-process/src/main/java/cn/com/glsx/process/modules/sop/execute/executor/SqlExecutor.java
platform-process/src/main/java/cn/com/glsx/process/modules/sop/execute/executor/SqlQueryExecutor.java
platform-process/src/main/java/cn/com/glsx/process/modules/sop/java/example/ControllerRopHttpDemo.java
platform-process/src/main/resources/mapper/SopDataSourceMapper.xml
platform-process-api/src/main/java/cn/com/glsx/process/modules/mapper/SopDataSourceMapper.java
View file @
cf6855a
...
...
@@ -7,5 +7,5 @@ import org.apache.ibatis.annotations.Param;
@Mapper
public
interface
SopDataSourceMapper
extends
CommonBaseMapper
<
SopDataSource
>
{
SopDataSource
findBy
Name
(
@Param
(
"name"
)
String
name
);
SopDataSource
findBy
DataSourceId
(
@Param
(
"dataSourceId"
)
String
dataSourceId
);
}
\ No newline at end of file
platform-process/src/main/java/cn/com/glsx/process/modules/controller/SopTplController.java
View file @
cf6855a
...
...
@@ -21,7 +21,7 @@ import lombok.extern.slf4j.Slf4j;
@Slf4j
@Tag
(
name
=
"SOP模板开放接口"
)
@RestController
@RequestMapping
(
value
=
"/sop/sopTpls"
)
@RequestMapping
(
value
=
"/sop/
api/
sopTpls"
)
@ResponseResultBody
public
class
SopTplController
extends
BaseController
{
...
...
platform-process/src/main/java/cn/com/glsx/process/modules/controller/TestXXLJobController.java
View file @
cf6855a
...
...
@@ -44,11 +44,11 @@ public class TestXXLJobController {
@PostMapping
(
"/jobtestupdate"
)
@Operation
(
summary
=
"动态任务更新"
,
description
=
"动态任务更新"
)
public
void
updatetest
(
@RequestParam
(
"cron"
)
String
cron
,
public
void
updatetest
(
@RequestParam
(
value
=
"cron"
,
required
=
false
)
String
cron
,
@RequestParam
(
"id"
)
String
id
,
@RequestParam
(
"executorParam"
)
String
executorParam
,
@RequestParam
(
"jobDesc"
)
String
jobDesc
,
@RequestParam
(
"triggerStatus"
)
Integer
triggerStatus
)
{
@RequestParam
(
value
=
"executorParam"
,
required
=
false
)
String
executorParam
,
@RequestParam
(
value
=
"jobDesc"
,
required
=
false
)
String
jobDesc
,
@RequestParam
(
value
=
"triggerStatus"
,
required
=
false
)
Integer
triggerStatus
)
{
XxlJobInfo
jobInfo
=
new
XxlJobInfo
();
jobInfo
.
setBusKey
(
id
);
jobInfo
.
setScheduleConf
(
cron
);
...
...
platform-process/src/main/java/cn/com/glsx/process/modules/service/SopDataSourceService.java
View file @
cf6855a
...
...
@@ -16,8 +16,8 @@ public class SopDataSourceService {
return
sopDataSourceMapper
.
selectByPrimaryKey
(
id
);
};
public
SopDataSource
findBy
Name
(
String
name
)
{
return
sopDataSourceMapper
.
findBy
Name
(
name
);
public
SopDataSource
findBy
DataSourceId
(
String
dataSourceId
)
{
return
sopDataSourceMapper
.
findBy
DataSourceId
(
dataSourceId
);
}
}
platform-process/src/main/java/cn/com/glsx/process/modules/sop/execute/executor/SqlExecutor.java
View file @
cf6855a
...
...
@@ -40,7 +40,7 @@ public class SqlExecutor implements SopNodeExecutor {
String
dataSourceId
=
paramMap
.
get
(
"dataSourceId"
)
+
""
;
// 执行sql插件
SopDataSource
byId
=
sopDataSourceService
.
findBy
Name
(
dataSourceId
);
SopDataSource
byId
=
sopDataSourceService
.
findBy
DataSourceId
(
dataSourceId
);
SopBizAdapter
mcgBizAdapter
=
new
FlowDataAdapterImpl
(
byId
);
String
sql
=
FreemarkerUtil
.
processContent
(
sqlTemplate
,
executeStruct
.
toMap
());
...
...
platform-process/src/main/java/cn/com/glsx/process/modules/sop/execute/executor/SqlQueryExecutor.java
View file @
cf6855a
...
...
@@ -38,7 +38,7 @@ public class SqlQueryExecutor implements SopNodeExecutor {
String
dataSourceId
=
paramMap
.
get
(
"dataSourceId"
)
+
""
;
// 执行sql插件
SopDataSource
byId
=
sopDataSourceService
.
findBy
Name
(
dataSourceId
);
SopDataSource
byId
=
sopDataSourceService
.
findBy
DataSourceId
(
dataSourceId
);
SopBizAdapter
mcgBizAdapter
=
new
FlowDataAdapterImpl
(
byId
);
String
sql
=
FreemarkerUtil
.
processContent
(
sqlTemplate
,
executeStruct
.
toMap
());
...
...
platform-process/src/main/java/cn/com/glsx/process/modules/sop/java/example/ControllerRopHttpDemo.java
View file @
cf6855a
...
...
@@ -33,6 +33,11 @@ public class ControllerRopHttpDemo {
String
nodeName
=
jsonObject
.
get
(
"nodeName"
)
+
""
;
// TODO 组装任务需要的参数
JSONObject
instSnapshotData
=
JSONObject
.
parseObject
(
instSnapshot
);
//
MultiValueMap
<
String
,
String
>
multiValueMap
=
new
LinkedMultiValueMap
<>();
...
...
@@ -49,6 +54,4 @@ public class ControllerRopHttpDemo {
return
(
JSONObject
)
JSONObject
.
toJSON
(
post
);
}
}
\ No newline at end of file
platform-process/src/main/resources/mapper/SopDataSourceMapper.xml
View file @
cf6855a
...
...
@@ -14,11 +14,11 @@
<result
column=
"name"
jdbcType=
"VARCHAR"
property=
"name"
/>
<result
column=
"db_name"
jdbcType=
"VARCHAR"
property=
"dbName"
/>
</resultMap>
<select
id=
"findBy
Name
"
resultMap=
"BaseResultMap"
<select
id=
"findBy
DataSourceId
"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select *
from sop_data_source
where
name = #{name
}
where
data_source_id = #{dataSourceId
}
</select>
</mapper>
\ 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