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 7d633235
authored
Sep 18, 2023
by
谢海旭
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
更名变量、微调查询模板详情接口逻辑
1 parent
84f61814
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
26 additions
and
20 deletions
platform-process-api/src/main/java/cn/com/glsx/process/modules/mapper/SopTplMapper.java
platform-process-api/src/main/java/cn/com/glsx/process/modules/model/SopTplSearch.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/resources/mapper/SopTplGrantMapper.xml
platform-process/src/main/resources/mapper/SopTplMapper.xml
platform-process-api/src/main/java/cn/com/glsx/process/modules/mapper/SopTplMapper.java
View file @
7d63323
...
@@ -5,6 +5,7 @@ import cn.com.glsx.process.modules.model.SopTplDTO;
...
@@ -5,6 +5,7 @@ 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
com.glsx.plat.mybatis.mapper.CommonBaseMapper
;
import
com.glsx.plat.mybatis.mapper.CommonBaseMapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.List
;
...
@@ -12,4 +13,6 @@ import java.util.List;
...
@@ -12,4 +13,6 @@ import java.util.List;
public
interface
SopTplMapper
extends
CommonBaseMapper
<
SopTpl
>
{
public
interface
SopTplMapper
extends
CommonBaseMapper
<
SopTpl
>
{
List
<
SopTplDTO
>
page
(
SopTplSearch
search
);
List
<
SopTplDTO
>
page
(
SopTplSearch
search
);
SopTplDTO
getById
(
@Param
(
"tplId"
)
String
tplId
);
}
}
\ No newline at end of file
\ No newline at end of file
platform-process-api/src/main/java/cn/com/glsx/process/modules/model/SopTplSearch.java
View file @
7d63323
...
@@ -6,9 +6,9 @@ import lombok.Data;
...
@@ -6,9 +6,9 @@ import lombok.Data;
@Data
@Data
public
class
SopTplSearch
extends
Page
{
public
class
SopTplSearch
extends
Page
{
private
String
i
d
;
private
String
tplI
d
;
private
String
n
ame
;
private
String
tplN
ame
;
private
Integer
s
tatus
;
private
Integer
tplS
tatus
;
}
}
platform-process/src/main/java/cn/com/glsx/process/modules/controller/SopTplController.java
View file @
7d63323
...
@@ -36,8 +36,8 @@ public class SopTplController extends BaseController {
...
@@ -36,8 +36,8 @@ public class SopTplController extends BaseController {
}
}
@Operation
(
summary
=
"SOP模板详情"
,
description
=
"SOP模板详情"
)
@Operation
(
summary
=
"SOP模板详情"
,
description
=
"SOP模板详情"
)
@GetMapping
(
"/{
i
d}"
)
@GetMapping
(
"/{
tplI
d}"
)
public
SopTplDTO
getById
(
@PathVariable
(
"
id"
)
String
i
d
)
{
public
SopTplDTO
getById
(
@PathVariable
(
"
tplId"
)
String
tplI
d
)
{
return
sopTplService
.
getById
(
i
d
);
return
sopTplService
.
getById
(
tplI
d
);
}
}
}
}
platform-process/src/main/java/cn/com/glsx/process/modules/service/SopTplService.java
View file @
7d63323
...
@@ -41,24 +41,22 @@ public class SopTplService {
...
@@ -41,24 +41,22 @@ public class SopTplService {
/**
/**
* 查询sop模板详情
* 查询sop模板详情
*
*
* @param
i
d
* @param
tplI
d
* @return
* @return
*/
*/
public
SopTplDTO
getById
(
String
i
d
)
{
public
SopTplDTO
getById
(
String
tplI
d
)
{
SopTpl
sopTpl
=
sopTplMapper
.
selectByPrimaryKey
(
i
d
);
SopTpl
DTO
sopTplDTO
=
sopTplMapper
.
getById
(
tplI
d
);
if
(
Objects
.
isNull
(
sopTpl
))
{
if
(
Objects
.
isNull
(
sopTpl
DTO
))
{
return
null
;
return
null
;
}
}
SopTplDTO
sopTplDTO
=
SopTplConverter
.
INSTANCE
.
do2dto
(
sopTpl
);
SopTplNode
nodeQuery
=
new
SopTplNode
();
SopTplNode
nodeQuery
=
new
SopTplNode
();
nodeQuery
.
setTplId
(
i
d
);
nodeQuery
.
setTplId
(
tplI
d
);
List
<
SopTplNode
>
nodes
=
sopTplNodeMapper
.
select
(
nodeQuery
);
List
<
SopTplNode
>
nodes
=
sopTplNodeMapper
.
select
(
nodeQuery
);
sopTplDTO
.
setNodes
(
nodes
);
sopTplDTO
.
setNodes
(
nodes
);
SopTplLink
linkQuery
=
new
SopTplLink
();
SopTplLink
linkQuery
=
new
SopTplLink
();
linkQuery
.
setTplId
(
i
d
);
linkQuery
.
setTplId
(
tplI
d
);
List
<
SopTplLink
>
links
=
sopTplLinkMapper
.
select
(
linkQuery
);
List
<
SopTplLink
>
links
=
sopTplLinkMapper
.
select
(
linkQuery
);
sopTplDTO
.
setLinks
(
links
);
sopTplDTO
.
setLinks
(
links
);
return
sopTplDTO
;
return
sopTplDTO
;
...
...
platform-process/src/main/resources/mapper/SopTplGrantMapper.xml
View file @
7d63323
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
<select
id=
"countByTplId"
resultType=
"java.lang.Integer"
>
<select
id=
"countByTplId"
resultType=
"java.lang.Integer"
>
SELECT COUNT(DISTINCT group_id) FROM sop_tpl_grant WHERE tpl_id = #{tplId} AND grant_status != -1;
SELECT COUNT(DISTINCT group_id) FROM sop_tpl_grant WHERE tpl_id = #{tplId} AND grant_status != -1;
</select>
</select>
<select
id=
"list"
resultMap=
"BaseResultMap"
>
<select
id=
"list"
resultMap=
"BaseResultMap"
>
select
select
<include
refid=
"Base_Column_List"
/>
<include
refid=
"Base_Column_List"
/>
...
...
platform-process/src/main/resources/mapper/SopTplMapper.xml
View file @
7d63323
...
@@ -32,17 +32,21 @@
...
@@ -32,17 +32,21 @@
<include
refid=
"Base_Column_List"
/>
<include
refid=
"Base_Column_List"
/>
from sop_tpl
from sop_tpl
<where>
<where>
<if
test=
"
id != null and i
d !=''"
>
<if
test=
"
tplId != null and tplI
d !=''"
>
and tpl_id = #{
i
d}
and tpl_id = #{
tplI
d}
</if>
</if>
<if
test=
"
name != null and n
ame !=''"
>
<if
test=
"
tplName != null and tplN
ame !=''"
>
and tpl_name = #{
n
ame}
and tpl_name = #{
tplN
ame}
</if>
</if>
<if
test=
"
s
tatus != null"
>
<if
test=
"
tplS
tatus != null"
>
and tpl_status = #{
s
tatus}
and tpl_status = #{
tplS
tatus}
</if>
</if>
</where>
</where>
order by update_time desc
order by update_time desc
</select>
</select>
<select
id=
"getById"
resultMap=
"BaseResultDTOMap"
>
select
<include
refid=
"Base_Column_List"
/>
from sop_tpl where tpl_id = #{tplId}
</select>
</mapper>
</mapper>
\ No newline at end of file
\ 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