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
cffbc86e
Commit
cffbc86e
authored
Dec 12, 2025
by
王志超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 导出变更工单
parent
c1a3588c
Pipeline
#86862
passed with stages
in 1 minute 35 seconds
Changes
4
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
6 deletions
+46
-6
ChangeFlowBiz.java
...om/netease/mail/yanxuan/change/biz/biz/ChangeFlowBiz.java
+2
-6
ChangeFlowExportCallback.java
...yanxuan/change/biz/callback/ChangeFlowExportCallback.java
+27
-0
ChangeFlowExcelDTO.java
.../yanxuan/change/integration/excel/ChangeFlowExcelDTO.java
+7
-0
ChangeFlowExcelVo.java
...l/yanxuan/change/integration/excel/ChangeFlowExcelVo.java
+10
-0
No files found.
yanxuan-qc-change-system-biz/src/main/java/com/netease/mail/yanxuan/change/biz/biz/ChangeFlowBiz.java
View file @
cffbc86e
...
@@ -60,7 +60,6 @@ import com.netease.mail.yanxuan.change.dal.entity.ChangeSubFlowRecord;
...
@@ -60,7 +60,6 @@ import com.netease.mail.yanxuan.change.dal.entity.ChangeSubFlowRecord;
import
com.netease.mail.yanxuan.change.dal.entity.ChangeType
;
import
com.netease.mail.yanxuan.change.dal.entity.ChangeType
;
import
com.netease.mail.yanxuan.change.dal.mapper.ChangeExecRecordMapper
;
import
com.netease.mail.yanxuan.change.dal.mapper.ChangeExecRecordMapper
;
import
com.netease.mail.yanxuan.change.dal.mapper.ChangeRecordMapper
;
import
com.netease.mail.yanxuan.change.dal.mapper.ChangeRecordMapper
;
import
com.netease.mail.yanxuan.change.dal.mapper.ChangeSubFlowRecordMapper
;
import
com.netease.mail.yanxuan.change.dal.meta.model.po.ChangeCommanderPO
;
import
com.netease.mail.yanxuan.change.dal.meta.model.po.ChangeCommanderPO
;
import
com.netease.mail.yanxuan.change.dal.meta.model.po.ChangeConfigPo
;
import
com.netease.mail.yanxuan.change.dal.meta.model.po.ChangeConfigPo
;
import
com.netease.mail.yanxuan.change.dal.meta.model.po.ChangeGoodsPrincipalPO
;
import
com.netease.mail.yanxuan.change.dal.meta.model.po.ChangeGoodsPrincipalPO
;
...
@@ -137,9 +136,6 @@ public class ChangeFlowBiz {
...
@@ -137,9 +136,6 @@ public class ChangeFlowBiz {
private
ChangeExecRecordMapper
changeExecRecordMapper
;
private
ChangeExecRecordMapper
changeExecRecordMapper
;
@Autowired
@Autowired
private
ChangeSubFlowRecordMapper
changeSubFlowRecordMapper
;
@Autowired
private
ItemService
itemService
;
private
ItemService
itemService
;
@Autowired
@Autowired
...
@@ -924,7 +920,7 @@ public class ChangeFlowBiz {
...
@@ -924,7 +920,7 @@ public class ChangeFlowBiz {
* @return 所有子工单列表(包括已取消和已完成的)
* @return 所有子工单列表(包括已取消和已完成的)
*/
*/
private
List
<
ChangeSubFlowRecord
>
cancelAllSubFlows
(
Long
changeRecordId
,
String
cancelReason
,
String
uid
)
{
private
List
<
ChangeSubFlowRecord
>
cancelAllSubFlows
(
Long
changeRecordId
,
String
cancelReason
,
String
uid
)
{
List
<
ChangeSubFlowRecord
>
allSubFlows
=
changeSubFlowRecord
Mapper
.
selec
tByChangeRecordId
(
changeRecordId
);
List
<
ChangeSubFlowRecord
>
allSubFlows
=
changeSubFlowRecord
Service
.
ge
tByChangeRecordId
(
changeRecordId
);
if
(
CollectionUtils
.
isEmpty
(
allSubFlows
))
{
if
(
CollectionUtils
.
isEmpty
(
allSubFlows
))
{
log
.
info
(
"[cancelAllSubFlows] 主工单下没有行动工单,changeRecordId:{}"
,
changeRecordId
);
log
.
info
(
"[cancelAllSubFlows] 主工单下没有行动工单,changeRecordId:{}"
,
changeRecordId
);
return
allSubFlows
;
return
allSubFlows
;
...
@@ -1868,7 +1864,7 @@ public class ChangeFlowBiz {
...
@@ -1868,7 +1864,7 @@ public class ChangeFlowBiz {
*/
*/
private
List
<
ChangeSubFlowRecord
>
validateAndFilterSubFlowsToReject
(
Long
changeRecordId
,
List
<
String
>
rejectSubFlowIds
)
{
private
List
<
ChangeSubFlowRecord
>
validateAndFilterSubFlowsToReject
(
Long
changeRecordId
,
List
<
String
>
rejectSubFlowIds
)
{
// 查询该主工单下所有子单(只查询一次)
// 查询该主工单下所有子单(只查询一次)
List
<
ChangeSubFlowRecord
>
allSubFlows
=
changeSubFlowRecord
Mapper
.
selec
tByChangeRecordId
(
changeRecordId
);
List
<
ChangeSubFlowRecord
>
allSubFlows
=
changeSubFlowRecord
Service
.
ge
tByChangeRecordId
(
changeRecordId
);
if
(
CollectionUtils
.
isEmpty
(
allSubFlows
))
{
if
(
CollectionUtils
.
isEmpty
(
allSubFlows
))
{
throw
ExceptionFactory
.
createBiz
(
ResponseCode
.
BAD_REQUEST
,
throw
ExceptionFactory
.
createBiz
(
ResponseCode
.
BAD_REQUEST
,
"主工单下没有子单,无法驳回"
);
"主工单下没有子单,无法驳回"
);
...
...
yanxuan-qc-change-system-biz/src/main/java/com/netease/mail/yanxuan/change/biz/callback/ChangeFlowExportCallback.java
View file @
cffbc86e
...
@@ -15,6 +15,8 @@ import java.util.Optional;
...
@@ -15,6 +15,8 @@ import java.util.Optional;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
com.netease.mail.yanxuan.change.biz.service.ChangeFlowExecService
;
import
com.netease.mail.yanxuan.change.biz.service.ChangeFlowExecService
;
import
com.netease.mail.yanxuan.change.biz.service.ChangeSubFlowRecordService
;
import
com.netease.mail.yanxuan.change.dal.entity.ChangeSubFlowRecord
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
...
@@ -104,6 +106,9 @@ public class ChangeFlowExportCallback implements DesCallbackService {
...
@@ -104,6 +106,9 @@ public class ChangeFlowExportCallback implements DesCallbackService {
@Autowired
@Autowired
private
ChangeFlowExecService
changeFlowExecService
;
private
ChangeFlowExecService
changeFlowExecService
;
@Autowired
private
ChangeSubFlowRecordService
changeSubFlowRecordService
;
@Override
@Override
public
ExcelTitle
queryExcelTitle
(
CallbackQueryReq
req
)
{
public
ExcelTitle
queryExcelTitle
(
CallbackQueryReq
req
)
{
log
.
info
(
"[op: change flow export callback queryExcelTitle] req={}"
,
JSON
.
toJSONString
(
req
));
log
.
info
(
"[op: change flow export callback queryExcelTitle] req={}"
,
JSON
.
toJSONString
(
req
));
...
@@ -229,6 +234,22 @@ public class ChangeFlowExportCallback implements DesCallbackService {
...
@@ -229,6 +234,22 @@ public class ChangeFlowExportCallback implements DesCallbackService {
.
queryGoodsPrincipalInfo
(
allItemList
);
.
queryGoodsPrincipalInfo
(
allItemList
);
log
.
debug
(
"[getExportList] spuTOS:{}"
,
spuTOS
.
size
());
log
.
debug
(
"[getExportList] spuTOS:{}"
,
spuTOS
.
size
());
}
}
// 批量查询所有变更行动工单,构建 Map<changeRecordId, List<subFlowId>>,提升性能
Map
<
Long
,
List
<
String
>>
subFlowIdsMap
=
new
HashMap
<>();
List
<
Long
>
changeRecordIds
=
changeRecords
.
stream
()
.
map
(
ChangeRecord:
:
getId
)
.
collect
(
Collectors
.
toList
());
List
<
ChangeSubFlowRecord
>
subFlowRecords
=
changeSubFlowRecordService
.
getByChangeRecordIds
(
changeRecordIds
);
if
(
CollectionUtils
.
isNotEmpty
(
subFlowRecords
))
{
subFlowIdsMap
=
subFlowRecords
.
stream
()
.
filter
(
record
->
StringUtils
.
isNotBlank
(
record
.
getSubFlowId
()))
.
collect
(
Collectors
.
groupingBy
(
ChangeSubFlowRecord:
:
getChangeRecordId
,
Collectors
.
mapping
(
ChangeSubFlowRecord:
:
getSubFlowId
,
Collectors
.
toList
())
));
}
List
<
ChangeFlowExcelDTO
>
changeFlowExcelDTOList
=
new
ArrayList
<>();
List
<
ChangeFlowExcelDTO
>
changeFlowExcelDTOList
=
new
ArrayList
<>();
// 导出excel,按照商品/供应商和行动项,n*n重复拆分,例2个商品3个行动项,拆分成2*3=6行,其他属性一致
// 导出excel,按照商品/供应商和行动项,n*n重复拆分,例2个商品3个行动项,拆分成2*3=6行,其他属性一致
for
(
ChangeRecord
record
:
changeRecords
)
{
for
(
ChangeRecord
record
:
changeRecords
)
{
...
@@ -305,6 +326,9 @@ public class ChangeFlowExportCallback implements DesCallbackService {
...
@@ -305,6 +326,9 @@ public class ChangeFlowExportCallback implements DesCallbackService {
// 组装行动项相关信息
// 组装行动项相关信息
obtainChangeExec
(
changeExecRecord
,
changeFlowExcelDTO
,
userListInfo
);
obtainChangeExec
(
changeExecRecord
,
changeFlowExcelDTO
,
userListInfo
);
this
.
obtainOther
(
record
,
changeFlowExcelDTO
);
this
.
obtainOther
(
record
,
changeFlowExcelDTO
);
// 设置变更行动工单(用逗号分隔)
List
<
String
>
subFlowIds
=
subFlowIdsMap
.
getOrDefault
(
record
.
getId
(),
new
ArrayList
<>());
changeFlowExcelDTO
.
setSubFlowIds
(
CollectionUtils
.
isEmpty
(
subFlowIds
)
?
"/"
:
String
.
join
(
","
,
subFlowIds
));
changeFlowExcelDTOList
.
add
(
changeFlowExcelDTO
);
changeFlowExcelDTOList
.
add
(
changeFlowExcelDTO
);
}
}
}
}
...
@@ -342,6 +366,9 @@ public class ChangeFlowExportCallback implements DesCallbackService {
...
@@ -342,6 +366,9 @@ public class ChangeFlowExportCallback implements DesCallbackService {
// 组装行动项相关信息
// 组装行动项相关信息
this
.
obtainChangeExec
(
changeExecRecord
,
changeFlowExcelDTO
,
userListInfo
);
this
.
obtainChangeExec
(
changeExecRecord
,
changeFlowExcelDTO
,
userListInfo
);
this
.
obtainOther
(
record
,
changeFlowExcelDTO
);
this
.
obtainOther
(
record
,
changeFlowExcelDTO
);
// 设置变更行动工单(用逗号分隔)
List
<
String
>
subFlowIds
=
subFlowIdsMap
.
getOrDefault
(
record
.
getId
(),
new
ArrayList
<>());
changeFlowExcelDTO
.
setSubFlowIds
(
CollectionUtils
.
isEmpty
(
subFlowIds
)
?
"/"
:
String
.
join
(
","
,
subFlowIds
));
changeFlowExcelDTOList
.
add
(
changeFlowExcelDTO
);
changeFlowExcelDTOList
.
add
(
changeFlowExcelDTO
);
}
}
break
;
break
;
...
...
yanxuan-qc-change-system-integration/src/main/java/com/netease/mail/yanxuan/change/integration/excel/ChangeFlowExcelDTO.java
View file @
cffbc86e
...
@@ -223,4 +223,10 @@ public class ChangeFlowExcelDTO {
...
@@ -223,4 +223,10 @@ public class ChangeFlowExcelDTO {
*/
*/
@Excel
(
name
=
"变更完结时间"
)
@Excel
(
name
=
"变更完结时间"
)
private
String
changeEndTime
;
private
String
changeEndTime
;
/**
* 变更行动工单
*/
@Excel
(
name
=
"变更行动工单"
)
private
String
subFlowIds
;
}
}
\ No newline at end of file
yanxuan-qc-change-system-integration/src/main/java/com/netease/mail/yanxuan/change/integration/excel/ChangeFlowExcelVo.java
View file @
cffbc86e
...
@@ -229,6 +229,12 @@ public class ChangeFlowExcelVo {
...
@@ -229,6 +229,12 @@ public class ChangeFlowExcelVo {
@ExcelTitleName
(
title
=
"变更完结时间"
,
order
=
35
)
@ExcelTitleName
(
title
=
"变更完结时间"
,
order
=
35
)
private
Integer
changeEndTime
;
private
Integer
changeEndTime
;
/**
* 变更行动工单
*/
@ExcelTitleName
(
title
=
"变更行动工单"
,
order
=
36
)
private
String
subFlowIds
;
public
static
List
<
ExcelCell
>
init
(
ChangeFlowExcelDTO
dto
)
{
public
static
List
<
ExcelCell
>
init
(
ChangeFlowExcelDTO
dto
)
{
List
<
ExcelCell
>
cellInfo
=
new
ArrayList
<>();
List
<
ExcelCell
>
cellInfo
=
new
ArrayList
<>();
...
@@ -373,6 +379,10 @@ public class ChangeFlowExcelVo {
...
@@ -373,6 +379,10 @@ public class ChangeFlowExcelVo {
excelCell
=
new
ExcelCell
();
excelCell
=
new
ExcelCell
();
excelCell
.
setValue
(
dto
.
getChangeEndTime
());
excelCell
.
setValue
(
dto
.
getChangeEndTime
());
cellInfo
.
add
(
excelCell
);
cellInfo
.
add
(
excelCell
);
// 35.变更行动工单
excelCell
=
new
ExcelCell
();
excelCell
.
setValue
(
dto
.
getSubFlowIds
());
cellInfo
.
add
(
excelCell
);
return
cellInfo
;
return
cellInfo
;
}
}
...
...
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