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
胡园园
yanxuan-qc-change-system
Commits
9c6d24c4
Commit
9c6d24c4
authored
Dec 20, 2022
by
“zcwang”
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify:导出字段完善
parent
d57b1b0a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
105 additions
and
12 deletions
+105
-12
ChangeFlowExportCallback.java
...yanxuan/change/biz/callback/ChangeFlowExportCallback.java
+61
-11
ItemSetupTypeEnum.java
...e/mail/yanxuan/change/common/enums/ItemSetupTypeEnum.java
+43
-0
ChangeFlowExcelDTO.java
.../yanxuan/change/integration/excel/ChangeFlowExcelDTO.java
+1
-1
No files found.
yanxuan-qc-change-system-biz/src/main/java/com/netease/mail/yanxuan/change/biz/callback/ChangeFlowExportCallback.java
View file @
9c6d24c4
...
@@ -36,6 +36,7 @@ import com.netease.mail.yanxuan.change.biz.service.rpc.QCService;
...
@@ -36,6 +36,7 @@ import com.netease.mail.yanxuan.change.biz.service.rpc.QCService;
import
com.netease.mail.yanxuan.change.common.enums.BusinessFormEnum
;
import
com.netease.mail.yanxuan.change.common.enums.BusinessFormEnum
;
import
com.netease.mail.yanxuan.change.common.enums.ChangeStatusEnum
;
import
com.netease.mail.yanxuan.change.common.enums.ChangeStatusEnum
;
import
com.netease.mail.yanxuan.change.common.enums.ChangeSubjectEnum
;
import
com.netease.mail.yanxuan.change.common.enums.ChangeSubjectEnum
;
import
com.netease.mail.yanxuan.change.common.enums.ItemSetupTypeEnum
;
import
com.netease.mail.yanxuan.change.common.enums.MainSpuStatusEnum
;
import
com.netease.mail.yanxuan.change.common.enums.MainSpuStatusEnum
;
import
com.netease.mail.yanxuan.change.common.util.DateUtils
;
import
com.netease.mail.yanxuan.change.common.util.DateUtils
;
import
com.netease.mail.yanxuan.change.common.util.ExcelUtil
;
import
com.netease.mail.yanxuan.change.common.util.ExcelUtil
;
...
@@ -122,11 +123,6 @@ public class ChangeFlowExportCallback implements DesCallbackService {
...
@@ -122,11 +123,6 @@ public class ChangeFlowExportCallback implements DesCallbackService {
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
)
{
ChangeSubjectEnum
changeSubjectEnum
=
ChangeSubjectEnum
.
getChangeSubjectEnum
(
record
.
getChangeSubject
());
switch
(
changeSubjectEnum
)
{
case
PRODUCT:
String
changeItemJsonStr
=
record
.
getChangeItem
();
List
<
ItemVO
>
itemVOS
=
JSON
.
parseArray
(
changeItemJsonStr
,
ItemVO
.
class
);
List
<
ChangeExecRecord
>
changeExecRecords
=
changeExecRecordMapper
.
selectByChangeRecordId
(
record
.
getId
());
List
<
ChangeExecRecord
>
changeExecRecords
=
changeExecRecordMapper
.
selectByChangeRecordId
(
record
.
getId
());
List
<
IusUserInfoRsp
>
userListInfo
=
new
ArrayList
<>();
List
<
IusUserInfoRsp
>
userListInfo
=
new
ArrayList
<>();
try
{
try
{
...
@@ -135,6 +131,11 @@ public class ChangeFlowExportCallback implements DesCallbackService {
...
@@ -135,6 +131,11 @@ public class ChangeFlowExportCallback implements DesCallbackService {
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
log
.
info
(
"query user info has ex"
,
ex
);
log
.
info
(
"query user info has ex"
,
ex
);
}
}
ChangeSubjectEnum
changeSubjectEnum
=
ChangeSubjectEnum
.
getChangeSubjectEnum
(
record
.
getChangeSubject
());
switch
(
changeSubjectEnum
)
{
case
PRODUCT:
String
changeItemJsonStr
=
record
.
getChangeItem
();
List
<
ItemVO
>
itemVOS
=
JSON
.
parseArray
(
changeItemJsonStr
,
ItemVO
.
class
);
List
<
Long
>
itemIds
=
itemVOS
.
stream
().
map
(
ItemVO:
:
getItemId
).
collect
(
Collectors
.
toList
());
List
<
Long
>
itemIds
=
itemVOS
.
stream
().
map
(
ItemVO:
:
getItemId
).
collect
(
Collectors
.
toList
());
// 批量查询spu信息
// 批量查询spu信息
List
<
SpuTO
>
spuTOS
=
itemService
.
batchQuerySpuInfo
(
BatchQuerySpuInfoParam
.
builder
().
ids
(
itemIds
)
List
<
SpuTO
>
spuTOS
=
itemService
.
batchQuerySpuInfo
(
BatchQuerySpuInfoParam
.
builder
().
ids
(
itemIds
)
...
@@ -172,11 +173,14 @@ public class ChangeFlowExportCallback implements DesCallbackService {
...
@@ -172,11 +173,14 @@ public class ChangeFlowExportCallback implements DesCallbackService {
}
}
Optional
<
SpuTO
>
optionalSpuTO
=
spuTOS
.
stream
().
filter
(
spu
->
spu
.
getId
()
==
itemId
).
findAny
();
Optional
<
SpuTO
>
optionalSpuTO
=
spuTOS
.
stream
().
filter
(
spu
->
spu
.
getId
()
==
itemId
).
findAny
();
if
(!
optionalSpuTO
.
isPresent
())
{
if
(!
optionalSpuTO
.
isPresent
())
{
changeFlowExcelDTO
.
setItemSetupType
(
null
);
changeFlowExcelDTO
.
setBusinessForm
(
null
);
changeFlowExcelDTO
.
setStatus
(
null
);
}
else
{
}
else
{
SpuTO
spuTO
=
optionalSpuTO
.
get
();
SpuTO
spuTO
=
optionalSpuTO
.
get
();
Map
<
String
,
String
>
propertyMap
=
spuTO
.
getPropertyMap
();
Map
<
String
,
String
>
propertyMap
=
spuTO
.
getPropertyMap
();
changeFlowExcelDTO
.
setItemSetupType
(
Integer
.
valueOf
(
propertyMap
.
get
(
"itemSetupType"
)));
Integer
itemSetupType
=
Integer
.
valueOf
(
propertyMap
.
get
(
"itemSetupType"
));
changeFlowExcelDTO
.
setItemSetupType
(
ItemSetupTypeEnum
.
getByType
(
itemSetupType
));
String
businessForm
=
propertyMap
.
get
(
"businessForm"
);
String
businessForm
=
propertyMap
.
get
(
"businessForm"
);
int
business
=
StringUtils
.
isBlank
(
businessForm
)
?
0
:
Integer
.
parseInt
(
businessForm
);
int
business
=
StringUtils
.
isBlank
(
businessForm
)
?
0
:
Integer
.
parseInt
(
businessForm
);
changeFlowExcelDTO
.
setBusinessForm
(
BusinessFormEnum
.
getByType
(
business
));
changeFlowExcelDTO
.
setBusinessForm
(
BusinessFormEnum
.
getByType
(
business
));
...
@@ -203,15 +207,61 @@ public class ChangeFlowExportCallback implements DesCallbackService {
...
@@ -203,15 +207,61 @@ public class ChangeFlowExportCallback implements DesCallbackService {
}
}
case
SUPPLIER:
case
SUPPLIER:
// 供应商变更,以行动项循环
// 供应商变更,以行动项循环
for
(
ChangeExecRecord
changeExecRecord
:
changeExecRecords
)
{
// 组装通用信息,除商品信息,行动项以外其他字段一致
ChangeFlowExcelDTO
changeFlowExcelDTO
=
this
.
obtainCommon
(
record
,
changeSubjectEnum
);
changeFlowExcelDTO
.
setSupplier
(
record
.
getChangeSupplier
());
changeFlowExcelDTO
.
setChangeItem
(
null
);
changeFlowExcelDTO
.
setSPUId
(
null
);
changeFlowExcelDTO
.
setQcCategory
(
null
);
changeFlowExcelDTO
.
setPhyCategory
(
null
);
changeFlowExcelDTO
.
setItemSetupType
(
null
);
changeFlowExcelDTO
.
setBusinessForm
(
null
);
changeFlowExcelDTO
.
setStatus
(
null
);
changeFlowExcelDTO
.
setFunctionary
(
null
);
changeFlowExcelDTO
.
setPurchase
(
null
);
changeFlowExcelDTO
.
setGoodsSqe
(
null
);
changeFlowExcelDTO
.
setGoodsProjectName
(
null
);
// 组装行动项相关信息
this
.
obtainChangeExec
(
changeExecRecord
,
changeFlowExcelDTO
,
userListInfo
);
changeFlowExcelDTO
.
setChangeResult
(
record
.
getChangeResult
());
changeFlowExcelDTO
.
setChangeEndTime
(
record
.
getState
().
equals
(
ChangeStatusEnum
.
END
.
getStatus
())
?
DateUtils
.
parseLongToString
(
record
.
getUpdateTime
(),
DateUtils
.
DATE_TIME_FORMAT
)
:
""
);
changeFlowExcelDTOList
.
add
(
changeFlowExcelDTO
);
}
case
OTHER:
case
OTHER:
default
:
default
:
// 供应商变更,以行动项循环
for
(
ChangeExecRecord
changeExecRecord
:
changeExecRecords
)
{
// 组装通用信息,除商品信息,行动项以外其他字段一致
ChangeFlowExcelDTO
changeFlowExcelDTO
=
this
.
obtainCommon
(
record
,
changeSubjectEnum
);
changeFlowExcelDTO
.
setSupplier
(
null
);
changeFlowExcelDTO
.
setChangeItem
(
null
);
changeFlowExcelDTO
.
setSPUId
(
null
);
changeFlowExcelDTO
.
setQcCategory
(
null
);
changeFlowExcelDTO
.
setPhyCategory
(
null
);
changeFlowExcelDTO
.
setItemSetupType
(
null
);
changeFlowExcelDTO
.
setBusinessForm
(
null
);
changeFlowExcelDTO
.
setStatus
(
null
);
changeFlowExcelDTO
.
setFunctionary
(
null
);
changeFlowExcelDTO
.
setPurchase
(
null
);
changeFlowExcelDTO
.
setGoodsSqe
(
null
);
changeFlowExcelDTO
.
setGoodsProjectName
(
null
);
// 组装行动项相关信息
this
.
obtainChangeExec
(
changeExecRecord
,
changeFlowExcelDTO
,
userListInfo
);
changeFlowExcelDTO
.
setChangeResult
(
record
.
getChangeResult
());
changeFlowExcelDTO
.
setChangeEndTime
(
record
.
getState
().
equals
(
ChangeStatusEnum
.
END
.
getStatus
())
?
DateUtils
.
parseLongToString
(
record
.
getUpdateTime
(),
DateUtils
.
DATE_TIME_FORMAT
)
:
""
);
changeFlowExcelDTOList
.
add
(
changeFlowExcelDTO
);
}
}
}
}
}
return
changeRecords
.
stream
().
map
(
record
->
{
return
changeFlowExcelDTOList
;
ChangeFlowExcelDTO
changeFlowExcelDTO
=
new
ChangeFlowExcelDTO
();
return
changeFlowExcelDTO
;
}).
collect
(
Collectors
.
toList
());
}
}
...
...
yanxuan-qc-change-system-common/src/main/java/com/netease/mail/yanxuan/change/common/enums/ItemSetupTypeEnum.java
0 → 100644
View file @
9c6d24c4
/**
* @(#)ItemSetupTypeEnum.java, 2022/12/20.
* <p/>
* Copyright 2022 Netease, Inc. All rights reserved.
* NETEASE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package
com
.
netease
.
mail
.
yanxuan
.
change
.
common
.
enums
;
/**
* @Author zcwang
* @Date 2022/12/20
*/
public
enum
ItemSetupTypeEnum
{
normal
(
0
,
"正常立项商品"
),
special
(
2
,
"特殊免立项商品"
),
combination
(
3
,
"组合装"
);
private
Integer
type
;
private
String
desc
;
ItemSetupTypeEnum
(
Integer
type
,
String
desc
)
{
this
.
type
=
type
;
this
.
desc
=
desc
;
}
public
Integer
getType
()
{
return
type
;
}
public
String
getDesc
()
{
return
desc
;
}
public
static
String
getByType
(
Integer
type
)
{
for
(
ItemSetupTypeEnum
value
:
ItemSetupTypeEnum
.
values
())
{
if
(
value
.
getType
().
equals
(
type
))
{
return
value
.
getDesc
();
}
}
return
""
;
}
}
\ No newline at end of file
yanxuan-qc-change-system-integration/src/main/java/com/netease/mail/yanxuan/change/integration/excel/ChangeFlowExcelDTO.java
View file @
9c6d24c4
...
@@ -129,7 +129,7 @@ public class ChangeFlowExcelDTO {
...
@@ -129,7 +129,7 @@ public class ChangeFlowExcelDTO {
* 商品立项类型,0-正常立项商品,2-特殊免立项商品 3-组合装
* 商品立项类型,0-正常立项商品,2-特殊免立项商品 3-组合装
*/
*/
@Excel
(
name
=
"商品立项类型"
)
@Excel
(
name
=
"商品立项类型"
)
private
Integer
itemSetupType
;
private
String
itemSetupType
;
/**
/**
* 经营形式,0-自营,3-严选贴牌代销,4-他方品牌代销,5-代销2.0
* 经营形式,0-自营,3-严选贴牌代销,4-他方品牌代销,5-代销2.0
...
...
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