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 1049866a
authored
Dec 25, 2023
by
谢海旭
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
增加更新模板接口
1 parent
9163161f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
17 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/SopTplController.java
platform-process/src/main/java/cn/com/glsx/process/modules/service/SopTplService.java
platform-process/src/main/java/cn/com/glsx/process/modules/assembler/KeHuLvChengAssembler.java
View file @
1049866
...
@@ -49,7 +49,6 @@ public class KeHuLvChengAssembler {
...
@@ -49,7 +49,6 @@ public class KeHuLvChengAssembler {
String
dataTypeCode
=
JacksonUtil
.
getStrValueInJsonStrByPath
(
tplParamDef
,
"dataTypeCode/defaultValue"
);
String
dataTypeCode
=
JacksonUtil
.
getStrValueInJsonStrByPath
(
tplParamDef
,
"dataTypeCode/defaultValue"
);
String
stagesStr
=
JacksonUtil
.
getStrValueInJsonStrByPath
(
tplParamDef
,
"stages/defaultValue"
);
String
stagesStr
=
JacksonUtil
.
getStrValueInJsonStrByPath
(
tplParamDef
,
"stages/defaultValue"
);
sopTplDTO
.
setTplId
(
StrUtil
.
sub
(
SnowFlake
.
nextSerialNumber
(),
0
,
8
));
sopTplDTO
.
setTplCron
(
"10 20 7 * * ?"
);
sopTplDTO
.
setTplCron
(
"10 20 7 * * ?"
);
sopTplDTO
.
setTplRemark
(
"运营端新增模板"
);
sopTplDTO
.
setTplRemark
(
"运营端新增模板"
);
sopTplDTO
.
setTplStatus
((
byte
)
1
);
sopTplDTO
.
setTplStatus
((
byte
)
1
);
...
...
platform-process/src/main/java/cn/com/glsx/process/modules/controller/SopTplController.java
View file @
1049866
...
@@ -46,7 +46,7 @@ public class SopTplController extends BaseController {
...
@@ -46,7 +46,7 @@ public class SopTplController extends BaseController {
return
sopTplService
.
getById
(
tplId
);
return
sopTplService
.
getById
(
tplId
);
}
}
@Operation
(
summary
=
"新增
模板"
,
description
=
"新增
模板"
)
@Operation
(
summary
=
"新增
/更新模板"
,
description
=
"新增/更新
模板"
)
@PostMapping
@PostMapping
public
SopTpl
add
(
@RequestBody
SopTplDTO
sopTplDTO
)
{
public
SopTpl
add
(
@RequestBody
SopTplDTO
sopTplDTO
)
{
return
sopTplService
.
add
(
sopTplDTO
);
return
sopTplService
.
add
(
sopTplDTO
);
...
...
platform-process/src/main/java/cn/com/glsx/process/modules/service/SopTplService.java
View file @
1049866
package
cn
.
com
.
glsx
.
process
.
modules
.
service
;
package
cn
.
com
.
glsx
.
process
.
modules
.
service
;
import
java.util.List
;
import
java.util.Objects
;
import
javax.annotation.Resource
;
import
cn.com.glsx.process.modules.assembler.KeHuLvChengAssembler
;
import
cn.com.glsx.process.modules.assembler.KeHuLvChengAssembler
;
import
cn.com.glsx.process.modules.converter.SopTplConverter
;
import
cn.com.glsx.process.modules.converter.SopTplConverter
;
import
cn.com.glsx.process.modules.entity.SopTpl
;
import
cn.com.glsx.process.modules.entity.SopTpl
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
cn.com.glsx.process.modules.entity.SopTplLink
;
import
cn.com.glsx.process.modules.entity.SopTplLink
;
import
cn.com.glsx.process.modules.entity.SopTplNode
;
import
cn.com.glsx.process.modules.entity.SopTplNode
;
import
cn.com.glsx.process.modules.mapper.SopTplLinkMapper
;
import
cn.com.glsx.process.modules.mapper.SopTplLinkMapper
;
...
@@ -21,7 +10,19 @@ import cn.com.glsx.process.modules.mapper.SopTplMapper;
...
@@ -21,7 +10,19 @@ import cn.com.glsx.process.modules.mapper.SopTplMapper;
import
cn.com.glsx.process.modules.mapper.SopTplNodeMapper
;
import
cn.com.glsx.process.modules.mapper.SopTplNodeMapper
;
import
cn.com.glsx.process.modules.model.SopTplDTO
;
import
cn.com.glsx.process.modules.model.SopTplDTO
;
import
cn.com.glsx.process.modules.model.SopTplSearch
;
import
cn.com.glsx.process.modules.model.SopTplSearch
;
import
cn.hutool.core.util.StrUtil
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.glsx.plat.common.utils.SnowFlake
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
tk.mybatis.mapper.entity.Example
;
import
tk.mybatis.mapper.util.Sqls
;
import
javax.annotation.Resource
;
import
java.util.List
;
import
java.util.Objects
;
@Service
@Service
public
class
SopTplService
{
public
class
SopTplService
{
...
@@ -82,15 +83,28 @@ public class SopTplService {
...
@@ -82,15 +83,28 @@ public class SopTplService {
keHuLvChengAssembler
.
assemble
(
sopTplDTO
);
keHuLvChengAssembler
.
assemble
(
sopTplDTO
);
SopTpl
sopTpl
=
SopTplConverter
.
INSTANCE
.
dto2do
(
sopTplDTO
);
SopTpl
sopTpl
=
SopTplConverter
.
INSTANCE
.
dto2do
(
sopTplDTO
);
sopTplMapper
.
insert
(
sopTpl
);
String
tplId
=
sopTpl
.
getTplId
();
String
tplId
=
sopTpl
.
getTplId
();
if
(
StrUtil
.
isEmpty
(
tplId
))
{
tplId
=
StrUtil
.
sub
(
SnowFlake
.
nextSerialNumber
(),
0
,
8
);
sopTpl
.
setTplId
(
tplId
);
sopTplMapper
.
insert
(
sopTpl
);
}
else
{
sopTplNodeMapper
.
deleteByExample
(
Example
.
builder
(
SopTplNode
.
class
).
where
(
Sqls
.
custom
().
andEqualTo
(
"tplId"
,
tplId
)).
build
());
sopTplLinkMapper
.
deleteByExample
(
Example
.
builder
(
SopTplLink
.
class
).
where
(
Sqls
.
custom
().
andEqualTo
(
"tplId"
,
tplId
)).
build
());
sopTplMapper
.
updateByPrimaryKey
(
sopTpl
);
}
List
<
SopTplNode
>
nodes
=
sopTplDTO
.
getNodes
();
List
<
SopTplNode
>
nodes
=
sopTplDTO
.
getNodes
();
nodes
.
forEach
(
sopTplNode
->
sopTplNode
.
setTplId
(
tplId
));
for
(
SopTplNode
sopTplNode
:
nodes
)
{
sopTplNode
.
setTplId
(
tplId
);
}
sopTplNodeMapper
.
insertList
(
nodes
);
sopTplNodeMapper
.
insertList
(
nodes
);
List
<
SopTplLink
>
links
=
sopTplDTO
.
getLinks
();
List
<
SopTplLink
>
links
=
sopTplDTO
.
getLinks
();
links
.
forEach
(
sopTplLink
->
sopTplLink
.
setTplId
(
tplId
));
for
(
SopTplLink
sopTplLink
:
links
)
{
sopTplLink
.
setTplId
(
tplId
);
}
sopTplLinkMapper
.
insertList
(
links
);
sopTplLinkMapper
.
insertList
(
links
);
return
sopTpl
;
return
sopTpl
;
}
}
...
...
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