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 438c138d
authored
Oct 13, 2023
by
谢海旭
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
【ID1012425】一个活动只能关联一个未禁用的实例
1 parent
01c6f081
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
3 deletions
platform-process/src/main/java/cn/com/glsx/process/modules/service/SopInstService.java
platform-process/src/main/resources/mapper/SopInstMapper.xml
platform-process/src/main/java/cn/com/glsx/process/modules/service/SopInstService.java
View file @
438c138
...
...
@@ -145,7 +145,11 @@ public class SopInstService {
if
(
CollectionUtils
.
isEmpty
(
sopInsts
))
{
return
null
;
}
Assert
.
state
(
sopInsts
.
size
()
<
2
,
"根据查询条件找到多条记录,请检查参数是否有误!"
);
if
(
sopInsts
.
size
()
>
1
)
{
throw
new
AdminException
(
ResultEnum
.
PARAM_ERROR
.
getCode
(),
"根据查询条件找到多条记录,请检查参数是否有误!"
);
}
return
getSopInstOtherInfo
(
sopInsts
.
get
(
0
));
}
...
...
@@ -195,6 +199,16 @@ public class SopInstService {
return
result
;
}
Object
activityId
=
customData
.
get
(
"activityId"
);
if
(!
Objects
.
isNull
(
activityId
))
{
HashMap
<
String
,
Object
>
tMap
=
new
HashMap
<>();
tMap
.
put
(
"activityId"
,
activityId
);
SopInstDTO
existInst
=
getOneByCustomData
(
tMap
);
if
(
Objects
.
nonNull
(
existInst
))
{
throw
new
AdminException
(
ResultEnum
.
PARAM_ERROR
.
getCode
(),
String
.
format
(
"该活动已关联‘%s’实例,不能再关联"
,
existInst
.
getInstName
()));
}
}
sopInstMapper
.
updateInstParamCustomData
(
instId
,
customData
);
//发送字段数据变更通知消息
...
...
@@ -260,7 +274,9 @@ public class SopInstService {
public
void
add
(
SopInstDTO
sopInstDTO
)
{
String
tplId
=
sopInstDTO
.
getTplId
();
SopTplDTO
sopTplDTO
=
sopTplMapper
.
getById
(
tplId
);
Assert
.
state
(
sopTplDTO
!=
null
,
"模板不存在!"
);
if
(
Objects
.
isNull
(
sopTplDTO
))
{
throw
new
AdminException
(
ResultEnum
.
PARAM_ERROR
.
getCode
(),
"模板不存在!"
);
}
SopTplNode
nodeQuery
=
new
SopTplNode
();
nodeQuery
.
setTplId
(
tplId
);
...
...
platform-process/src/main/resources/mapper/SopInstMapper.xml
View file @
438c138
...
...
@@ -56,7 +56,7 @@
ORDER BY si.inst_status DESC, si.create_time DESC
</select>
<select
id=
"selectByCustomData"
result
Type=
"cn.com.glsx.process.modules.entity.SopInst
"
>
<select
id=
"selectByCustomData"
result
Map=
"BaseResultMap
"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM sop_inst
...
...
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