Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yanxuan-qc-change-system
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yx-qc-change-flow
yanxuan-qc-change-system
Commits
18d27000
Commit
18d27000
authored
Dec 15, 2025
by
王志超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 变更配置导出
parent
867b210b
Pipeline
#86927
passed with stages
in 1 minute 43 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
121 additions
and
50 deletions
+121
-50
ChangeConfigExportCallback.java
...nxuan/change/biz/callback/ChangeConfigExportCallback.java
+42
-15
ChangeConfigMapper.java
...se/mail/yanxuan/change/dal/mapper/ChangeConfigMapper.java
+7
-0
ChangeTypeMapper.java
...ease/mail/yanxuan/change/dal/mapper/ChangeTypeMapper.java
+15
-0
ChangeConfigMapper.xml
.../src/main/resources/mybatis/mapper/ChangeConfigMapper.xml
+33
-0
ChangeConfigExcelDTO.java
...anxuan/change/integration/excel/ChangeConfigExcelDTO.java
+2
-5
ChangeConfigExcelVo.java
...yanxuan/change/integration/excel/ChangeConfigExcelVo.java
+22
-30
No files found.
yanxuan-qc-change-system-biz/src/main/java/com/netease/mail/yanxuan/change/biz/callback/ChangeConfigExportCallback.java
View file @
18d27000
package
com
.
netease
.
mail
.
yanxuan
.
change
.
biz
.
callback
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -14,7 +18,6 @@ import com.netease.mail.dp.des.process.api.entity.CallbackQueryReq;
import
com.netease.mail.dp.des.process.api.entity.ExcelCell
;
import
com.netease.mail.dp.des.process.api.entity.ExcelTitle
;
import
com.netease.mail.dp.des.starter.callback.DesCallbackService
;
import
com.netease.mail.yanxuan.change.biz.service.change.ChangeTypeService
;
import
com.netease.mail.yanxuan.change.common.enums.ChangeLevelEnum
;
import
com.netease.mail.yanxuan.change.common.enums.ChangeSubjectEnum
;
import
com.netease.mail.yanxuan.change.common.enums.ChangeCommanderEnum
;
...
...
@@ -23,6 +26,7 @@ import com.netease.mail.yanxuan.change.common.util.DateUtils;
import
com.netease.mail.yanxuan.change.common.util.ExcelUtil
;
import
com.netease.mail.yanxuan.change.dal.entity.ChangeType
;
import
com.netease.mail.yanxuan.change.dal.mapper.ChangeConfigMapper
;
import
com.netease.mail.yanxuan.change.dal.mapper.ChangeTypeMapper
;
import
com.netease.mail.yanxuan.change.dal.meta.model.po.ChangeConfigPo
;
import
com.netease.mail.yanxuan.change.dal.meta.model.req.ChangeConfigQueryReq
;
import
com.netease.mail.yanxuan.change.integration.excel.ChangeConfigExcelDTO
;
...
...
@@ -41,7 +45,7 @@ public class ChangeConfigExportCallback implements DesCallbackService {
private
ChangeConfigMapper
changeConfigMapper
;
@Autowired
private
ChangeType
Service
changeTypeService
;
private
ChangeType
Mapper
changeTypeMapper
;
@Override
public
ExcelTitle
queryExcelTitle
(
CallbackQueryReq
req
)
{
...
...
@@ -73,7 +77,7 @@ public class ChangeConfigExportCallback implements DesCallbackService {
}
private
List
<
ChangeConfigExcelDTO
>
getExportList
(
ChangeConfigQueryReq
query
)
{
List
<
ChangeConfigPo
>
changeConfigPos
=
changeConfigMapper
.
selectChangeConfigPo
(
query
);
List
<
ChangeConfigPo
>
changeConfigPos
=
changeConfigMapper
.
selectChangeConfigPo
WithLimit
(
query
);
// 处理执行部门格式
changeConfigPos
.
forEach
(
i
->
{
...
...
@@ -87,6 +91,30 @@ public class ChangeConfigExportCallback implements DesCallbackService {
}
});
// 批量查询变更类型:收集所有的 parentChangeClassId 和 sonChangeClassId
Set
<
Long
>
changeTypeIds
=
new
HashSet
<>();
for
(
ChangeConfigPo
po
:
changeConfigPos
)
{
if
(
po
.
getParentChangeClassId
()
!=
null
)
{
changeTypeIds
.
add
(
po
.
getParentChangeClassId
().
longValue
());
}
if
(
po
.
getSonChangeClassId
()
!=
null
)
{
changeTypeIds
.
add
(
po
.
getSonChangeClassId
().
longValue
());
}
}
Map
<
Long
,
ChangeType
>
changeTypeMap
=
new
HashMap
<>();
if
(!
changeTypeIds
.
isEmpty
())
{
List
<
Long
>
idList
=
new
java
.
util
.
ArrayList
<>(
changeTypeIds
);
List
<
ChangeType
>
changeTypes
=
changeTypeMapper
.
selectByIds
(
idList
);
if
(
changeTypes
!=
null
)
{
for
(
ChangeType
changeType
:
changeTypes
)
{
changeTypeMap
.
put
(
changeType
.
getId
(),
changeType
);
}
}
}
final
Map
<
Long
,
ChangeType
>
finalChangeTypeMap
=
changeTypeMap
;
return
changeConfigPos
.
stream
().
map
(
po
->
{
ChangeConfigExcelDTO
dto
=
new
ChangeConfigExcelDTO
();
dto
.
setId
(
po
.
getId
());
...
...
@@ -97,21 +125,20 @@ public class ChangeConfigExportCallback implements DesCallbackService {
?
ChangeSubjectEnum
.
getChangeSubjectEnum
(
po
.
getChangeSubject
()).
getDesc
()
:
""
);
}
// 变更类型
String
parentChangeType
=
""
;
String
sonChangeType
=
""
;
// 变更类型:从 Map 中获取,格式为"一级>二级"
String
changeType
=
""
;
if
(
po
.
getParentChangeClassId
()
!=
null
&&
po
.
getSonChangeClassId
()
!=
null
)
{
ChangeType
parentType
=
changeTypeService
.
getChangeTypeById
(
po
.
getParentChangeClassId
().
longValue
());
ChangeType
sonType
=
changeTypeService
.
getChangeTypeById
(
po
.
getSonChangeClassId
().
longValue
());
if
(
parentType
!=
null
)
{
parentChangeType
=
parentType
.
getTypeName
();
}
if
(
sonType
!=
null
)
{
sonChangeType
=
sonType
.
getTypeName
();
ChangeType
parentType
=
finalChangeTypeMap
.
get
(
po
.
getParentChangeClassId
().
longValue
());
ChangeType
sonType
=
finalChangeTypeMap
.
get
(
po
.
getSonChangeClassId
().
longValue
());
if
(
parentType
!=
null
&&
sonType
!=
null
)
{
changeType
=
parentType
.
getTypeName
()
+
">"
+
sonType
.
getTypeName
();
}
else
if
(
parentType
!=
null
)
{
changeType
=
parentType
.
getTypeName
();
}
else
if
(
sonType
!=
null
)
{
changeType
=
sonType
.
getTypeName
();
}
}
dto
.
setParentChangeType
(
parentChangeType
);
dto
.
setSonChangeType
(
sonChangeType
);
dto
.
setChangeType
(
changeType
);
// 变更等级
if
(
po
.
getChangeLevel
()
!=
null
)
{
...
...
yanxuan-qc-change-system-dal/src/main/java/com/netease/mail/yanxuan/change/dal/mapper/ChangeConfigMapper.java
View file @
18d27000
...
...
@@ -41,6 +41,13 @@ public interface ChangeConfigMapper extends tk.mybatis.mapper.common.Mapper<Chan
List
<
ChangeConfigPo
>
selectChangeConfigPo
(
ChangeConfigQueryReq
req
);
/**
* 分页查询变更配置
* @param req 查询请求,包含 offset 和 limit 分页参数
* @return 变更配置列表
*/
List
<
ChangeConfigPo
>
selectChangeConfigPoWithLimit
(
ChangeConfigQueryReq
req
);
List
<
ChangeType
>
queryByparentChangeClassId
();
//暂时弃用
//ChangeExecConfigPo queryChangeDepartment(@Param("id")Long id);
...
...
yanxuan-qc-change-system-dal/src/main/java/com/netease/mail/yanxuan/change/dal/mapper/ChangeTypeMapper.java
View file @
18d27000
...
...
@@ -36,4 +36,18 @@ public interface ChangeTypeMapper extends tk.mybatis.mapper.common.Mapper<Change
@Select
(
"select * from TB_YX_QC_CHANGE_TYPE where parent_id = #{id} and delete_type = 0"
)
List
<
ChangeType
>
queryParent
(
@Param
(
"id"
)
Long
id
);
/**
* 批量根据ID列表查询变更类型
* @param ids ID列表
* @return 变更类型列表
*/
@Select
(
"<script>"
+
"SELECT * FROM TB_YX_QC_CHANGE_TYPE WHERE id IN "
+
"<foreach collection='ids' item='id' open='(' separator=',' close=')'>"
+
"#{id}"
+
"</foreach>"
+
" AND delete_type = 0"
+
"</script>"
)
List
<
ChangeType
>
selectByIds
(
@Param
(
"ids"
)
List
<
Long
>
ids
);
}
\ No newline at end of file
yanxuan-qc-change-system-dal/src/main/resources/mybatis/mapper/ChangeConfigMapper.xml
View file @
18d27000
...
...
@@ -62,6 +62,39 @@
order by create_time desc
</select>
<select
id=
"selectChangeConfigPoWithLimit"
resultMap=
"BaseResultPoMap"
parameterType=
"com.netease.mail.yanxuan.change.dal.meta.model.req.ChangeConfigQueryReq"
>
select
<include
refid=
"Base_Column_List"
/>
from TB_YX_QC_CHANGE_CONFIG
<where>
<if
test=
"parentChangeClassId != null "
>
parent_change_class_id = #{parentChangeClassId} and
</if>
<if
test=
"sonChangeClassId != null "
>
son_change_class_id = #{sonChangeClassId} and
</if>
<if
test=
"changeLevel != null and changeLevel != ''"
>
change_level = #{changeLevel} and
</if>
<if
test=
"changeDepartment != null and changeDepartment != ''"
>
change_department = #{changeDepartment} and
</if>
<if
test=
"createTime != null"
>
create_time
<![CDATA[ > ]]>
#{createTime} and
</if>
<if
test=
"updateTime != null"
>
create_time
<![CDATA[ < ]]>
#{updateTime} and
</if>
<if
test=
"changeExecDepartment != null and changeExecDepartment != ''"
>
participate_change_exec_department like "%" #{changeExecDepartment} "%" and
</if>
1=1
</where>
order by create_time desc
<if
test=
"offset != null and limit != null"
>
limit #{offset},#{limit}
</if>
</select>
<select
id=
"queryByparentChangeClassId"
resultType=
"com.netease.mail.yanxuan.change.dal.entity.ChangeType"
>
select * from TB_YX_QC_CHANGE_TYPE where id = #{parentId} or id = #{sonId} and delete_type = 0 order by parent_id
</select>
...
...
yanxuan-qc-change-system-integration/src/main/java/com/netease/mail/yanxuan/change/integration/excel/ChangeConfigExcelDTO.java
View file @
18d27000
...
...
@@ -15,11 +15,8 @@ public class ChangeConfigExcelDTO {
@Excel
(
name
=
"变更主体"
)
private
String
changeSubject
;
@Excel
(
name
=
"一级变更类型"
)
private
String
parentChangeType
;
@Excel
(
name
=
"二级变更类型"
)
private
String
sonChangeType
;
@Excel
(
name
=
"变更类型"
)
private
String
changeType
;
@Excel
(
name
=
"变更等级"
)
private
String
changeLevel
;
...
...
yanxuan-qc-change-system-integration/src/main/java/com/netease/mail/yanxuan/change/integration/excel/ChangeConfigExcelVo.java
View file @
18d27000
...
...
@@ -21,37 +21,34 @@ public class ChangeConfigExcelVo {
@ExcelTitleName
(
title
=
"变更主体"
,
order
=
2
)
private
String
changeSubject
;
@ExcelTitleName
(
title
=
"
一级
变更类型"
,
order
=
3
)
private
String
parentC
hangeType
;
@ExcelTitleName
(
title
=
"变更类型"
,
order
=
3
)
private
String
c
hangeType
;
@ExcelTitleName
(
title
=
"二级变更类型"
,
order
=
4
)
private
String
sonChangeType
;
@ExcelTitleName
(
title
=
"变更等级"
,
order
=
5
)
@ExcelTitleName
(
title
=
"变更等级"
,
order
=
4
)
private
String
changeLevel
;
@ExcelTitleName
(
title
=
"变更负责部门"
,
order
=
6
)
@ExcelTitleName
(
title
=
"变更负责部门"
,
order
=
5
)
private
String
changeDepartment
;
@ExcelTitleName
(
title
=
"变更执行部门"
,
order
=
7
)
@ExcelTitleName
(
title
=
"变更执行部门"
,
order
=
6
)
private
String
participateChangeExecDepartment
;
@ExcelTitleName
(
title
=
"变更负责人类型"
,
order
=
8
)
@ExcelTitleName
(
title
=
"变更负责人类型"
,
order
=
7
)
private
String
changeCommanderType
;
@ExcelTitleName
(
title
=
"变更负责人"
,
order
=
9
)
@ExcelTitleName
(
title
=
"变更负责人"
,
order
=
8
)
private
String
changeCommander
;
@ExcelTitleName
(
title
=
"是否需要资料"
,
order
=
10
)
@ExcelTitleName
(
title
=
"是否需要资料"
,
order
=
9
)
private
String
needFile
;
@ExcelTitleName
(
title
=
"创建人"
,
order
=
1
1
)
@ExcelTitleName
(
title
=
"创建人"
,
order
=
1
0
)
private
String
creator
;
@ExcelTitleName
(
title
=
"创建时间"
,
order
=
1
2
)
@ExcelTitleName
(
title
=
"创建时间"
,
order
=
1
1
)
private
String
createTime
;
@ExcelTitleName
(
title
=
"更新时间"
,
order
=
1
3
)
@ExcelTitleName
(
title
=
"更新时间"
,
order
=
1
2
)
private
String
updateTime
;
public
static
List
<
ExcelCell
>
init
(
ChangeConfigExcelDTO
dto
)
{
...
...
@@ -69,57 +66,52 @@ public class ChangeConfigExcelVo {
excelCell
.
setValue
(
dto
.
getChangeSubject
()
!=
null
?
dto
.
getChangeSubject
()
:
""
);
cells
.
add
(
excelCell
);
// 3. 一级变更类型
excelCell
=
new
ExcelCell
();
excelCell
.
setValue
(
dto
.
getParentChangeType
()
!=
null
?
dto
.
getParentChangeType
()
:
""
);
cells
.
add
(
excelCell
);
// 4. 二级变更类型
// 3. 变更类型
excelCell
=
new
ExcelCell
();
excelCell
.
setValue
(
dto
.
get
SonChangeType
()
!=
null
?
dto
.
getSon
ChangeType
()
:
""
);
excelCell
.
setValue
(
dto
.
get
ChangeType
()
!=
null
?
dto
.
get
ChangeType
()
:
""
);
cells
.
add
(
excelCell
);
//
5
. 变更等级
//
4
. 变更等级
excelCell
=
new
ExcelCell
();
excelCell
.
setValue
(
dto
.
getChangeLevel
()
!=
null
?
dto
.
getChangeLevel
()
:
""
);
cells
.
add
(
excelCell
);
//
6
. 变更负责部门
//
5
. 变更负责部门
excelCell
=
new
ExcelCell
();
excelCell
.
setValue
(
dto
.
getChangeDepartment
()
!=
null
?
dto
.
getChangeDepartment
()
:
""
);
cells
.
add
(
excelCell
);
//
7
. 变更执行部门
//
6
. 变更执行部门
excelCell
=
new
ExcelCell
();
excelCell
.
setValue
(
dto
.
getParticipateChangeExecDepartment
()
!=
null
?
dto
.
getParticipateChangeExecDepartment
()
:
""
);
cells
.
add
(
excelCell
);
//
8
. 变更负责人类型
//
7
. 变更负责人类型
excelCell
=
new
ExcelCell
();
excelCell
.
setValue
(
dto
.
getChangeCommanderType
()
!=
null
?
dto
.
getChangeCommanderType
()
:
""
);
cells
.
add
(
excelCell
);
//
9
. 变更负责人
//
8
. 变更负责人
excelCell
=
new
ExcelCell
();
excelCell
.
setValue
(
dto
.
getChangeCommander
()
!=
null
?
dto
.
getChangeCommander
()
:
""
);
cells
.
add
(
excelCell
);
//
10
. 是否需要资料
//
9
. 是否需要资料
excelCell
=
new
ExcelCell
();
excelCell
.
setValue
(
dto
.
getNeedFile
()
!=
null
?
dto
.
getNeedFile
()
:
""
);
cells
.
add
(
excelCell
);
// 1
1
. 创建人
// 1
0
. 创建人
excelCell
=
new
ExcelCell
();
excelCell
.
setValue
(
dto
.
getCreator
()
!=
null
?
dto
.
getCreator
()
:
""
);
cells
.
add
(
excelCell
);
// 1
2
. 创建时间
// 1
1
. 创建时间
excelCell
=
new
ExcelCell
();
excelCell
.
setValue
(
dto
.
getCreateTime
()
!=
null
?
dto
.
getCreateTime
()
:
""
);
cells
.
add
(
excelCell
);
// 1
3
. 更新时间
// 1
2
. 更新时间
excelCell
=
new
ExcelCell
();
excelCell
.
setValue
(
dto
.
getUpdateTime
()
!=
null
?
dto
.
getUpdateTime
()
:
""
);
cells
.
add
(
excelCell
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment