Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-api-boot-master
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
lanbaoming
jiedao-api-boot-master
Commits
579c56d3
Commit
579c56d3
authored
Jun 12, 2024
by
liuzeheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
颜色标识
parent
44b45a50
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
29 deletions
+27
-29
ShipmentLoadExcelExportListener.java
...le/shipment/listener/ShipmentLoadExcelExportListener.java
+27
-29
No files found.
yudao-module-shipment/yudao-module-shipment-core/src/main/java/cn/iocoder/yudao/module/shipment/listener/ShipmentLoadExcelExportListener.java
View file @
579c56d3
...
@@ -273,7 +273,7 @@ public class ShipmentLoadExcelExportListener {
...
@@ -273,7 +273,7 @@ public class ShipmentLoadExcelExportListener {
List
<
Integer
>
mergeCountList
=
new
ArrayList
();
List
<
Integer
>
mergeCountList
=
new
ArrayList
();
List
<
Integer
>
colorRowList
=
new
ArrayList
<>();
List
<
Integer
>
colorRowList
=
new
ArrayList
<>();
AtomicInteger
colorRowNum
=
new
AtomicInteger
(
6
);
AtomicInteger
colorRowNum
=
new
AtomicInteger
(
8
);
Map
<
String
,
Integer
>
colorMap
=
new
HashMap
<>();
Map
<
String
,
Integer
>
colorMap
=
new
HashMap
<>();
Map
<
String
,
Integer
>
mergePkgCountMap
=
new
LinkedHashMap
<>();
Map
<
String
,
Integer
>
mergePkgCountMap
=
new
LinkedHashMap
<>();
int
colorIndex
=
0
;
int
colorIndex
=
0
;
...
@@ -288,14 +288,12 @@ public class ShipmentLoadExcelExportListener {
...
@@ -288,14 +288,12 @@ public class ShipmentLoadExcelExportListener {
for
(
Map
.
Entry
<
Long
,
List
<
BoxPreloadGoodsBackVO
>>
entry
:
orderMap
.
entrySet
())
{
for
(
Map
.
Entry
<
Long
,
List
<
BoxPreloadGoodsBackVO
>>
entry
:
orderMap
.
entrySet
())
{
Long
orderId
=
entry
.
getKey
();
Long
orderId
=
entry
.
getKey
();
Long
pkgId
=
entry
.
getValue
().
get
(
0
).
getPkgId
();
//OrderBackInfoDto orderInfo = orderQueryService.info(orderId);
//OrderDO orderDO = orderService.selectOne(OrderDO::getOrderId, orderId);
List
<
OrderWarehouseInBackItemVO
>
orderWarehouseInBackItemVOS
=
List
<
OrderWarehouseInBackItemVO
>
orderWarehouseInBackItemVOS
=
orderWarehouseInService
.
getOrderWarehouseInListOrderByInTime
(
orderId
);
orderWarehouseInService
.
getOrderWarehouseInListOrderByInTime
(
orderId
);
for
(
OrderWarehouseInBackItemVO
item
:
orderWarehouseInBackItemVOS
)
{
for
(
OrderWarehouseInBackItemVO
item
:
orderWarehouseInBackItemVOS
)
{
int
andIncrement
=
colorRowNum
.
getAndIncrement
();
int
andIncrement
=
colorRowNum
.
getAndIncrement
();
if
(
StringUtils
.
isNotBlank
(
item
.
getOrderWarehouseInDetails
()))
{
if
(
StringUtils
.
isNotBlank
(
item
.
getOrderWarehouseInDetails
()))
{
JSONArray
jsonArray
=
JSONArray
.
parseArray
(
item
.
getOrderWarehouseInDetails
());
JSONArray
jsonArray
=
JSONArray
.
parseArray
(
item
.
getOrderWarehouseInDetails
());
if
(
jsonArray
.
size
()
>
0
)
{
if
(
jsonArray
.
size
()
>
0
)
{
...
@@ -303,37 +301,37 @@ public class ShipmentLoadExcelExportListener {
...
@@ -303,37 +301,37 @@ public class ShipmentLoadExcelExportListener {
colorRowList
.
add
(
andIncrement
);
//这里加1是为了设置颜色时过滤掉入仓记录那条
colorRowList
.
add
(
andIncrement
);
//这里加1是为了设置颜色时过滤掉入仓记录那条
}
}
}
}
int
mergeCount
=
1
;
//
int mergeCount = 1;
if
(
StringUtils
.
isNotBlank
(
item
.
getOrderWarehouseInDetails
()))
{
//
if (StringUtils.isNotBlank(item.getOrderWarehouseInDetails())) {
item
.
setOrderWarehouseInDetailsVOList
(
JsonUtils
.
parseArray
(
item
.
getOrderWarehouseInDetails
(),
OrderWarehouseInDetailsVO
.
class
));
//
item.setOrderWarehouseInDetailsVOList(JsonUtils.parseArray(item.getOrderWarehouseInDetails(), OrderWarehouseInDetailsVO.class));
}
//
}
if
(
CollectionUtil
.
isNotEmpty
(
item
.
getOrderWarehouseInDetailsVOList
()))
{
//
if (CollectionUtil.isNotEmpty(item.getOrderWarehouseInDetailsVOList())) {
mergeCount
=
mergeCount
+
item
.
getOrderWarehouseInDetailsVOList
().
size
();
//
mergeCount = mergeCount + item.getOrderWarehouseInDetailsVOList().size();
List
<
OrderWarehouseInDetailsVO
>
orderWarehouseInDetailsVOList
=
//
List<OrderWarehouseInDetailsVO> orderWarehouseInDetailsVOList =
item
.
getOrderWarehouseInDetailsVOList
();
//
item.getOrderWarehouseInDetailsVOList();
for
(
int
j
=
0
;
j
<
orderWarehouseInDetailsVOList
.
size
();
j
++)
{
//
for (int j = 0; j < orderWarehouseInDetailsVOList.size(); j++) {
int
andIncrement1
=
colorRowNum
.
getAndIncrement
();
//
int andIncrement1 = colorRowNum.getAndIncrement();
colorMap
.
put
(
String
.
valueOf
(
andIncrement1
),
colorList
.
get
(
colorIndex
));
//
colorMap.put(String.valueOf(andIncrement1),colorList.get(colorIndex));
colorRowList
.
add
(
andIncrement1
);
//
colorRowList.add(andIncrement1);
}
//
}
}
//
}
mergeCountList
.
add
(
mergeCount
);
//
mergeCountList.add(mergeCount);
if
(
colorIndex
==
7
)
{
if
(
colorIndex
==
7
)
{
colorIndex
=
0
;
colorIndex
=
0
;
}
else
{
}
else
{
colorIndex
++;
colorIndex
++;
}
}
//合包那几个列合并单元格计算
//合包那几个列合并单元格计算
if
(
pkgId
.
longValue
()
!=
0L
)
{
//
if (pkgId.longValue() != 0L) {
if
(
mergePkgCountMap
.
get
(
String
.
valueOf
(
pkgId
))
==
null
)
{
//
if (mergePkgCountMap.get(String.valueOf(pkgId)) == null) {
mergePkgCountMap
.
put
(
String
.
valueOf
(
pkgId
),
mergeCount
);
//
mergePkgCountMap.put(String.valueOf(pkgId),mergeCount);
}
else
{
//
} else {
Integer
sumMergePkgCount
=
mergePkgCountMap
.
get
(
String
.
valueOf
(
pkgId
))
+
mergeCount
;
//
Integer sumMergePkgCount = mergePkgCountMap.get(String.valueOf(pkgId)) + mergeCount;
mergePkgCountMap
.
put
(
String
.
valueOf
(
pkgId
),
sumMergePkgCount
);
//
mergePkgCountMap.put(String.valueOf(pkgId),sumMergePkgCount);
}
//
}
}
else
{
//
} else {
mergePkgCountMap
.
put
(
String
.
valueOf
(
item
.
getId
()),
mergeCount
);
//
mergePkgCountMap.put(String.valueOf(item.getId()),mergeCount);
}
//
}
}
}
}
}
...
...
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