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
56745837
Commit
56745837
authored
Aug 04, 2024
by
huyf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
预装单bug
parent
5b48b9cd
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
2 deletions
+30
-2
SeaPreloadDto.java
...a/cn/iocoder/yudao/module/shipment/dto/SeaPreloadDto.java
+3
-0
ShipmentPreloadExcelExportListener.java
...shipment/listener/ShipmentPreloadExcelExportListener.java
+4
-2
ShipmentSeaPreloadExcelExportListener.java
...pment/listener/ShipmentSeaPreloadExcelExportListener.java
+23
-0
No files found.
yudao-module-shipment/yudao-module-shipment-core/src/main/java/cn/iocoder/yudao/module/shipment/dto/SeaPreloadDto.java
View file @
56745837
...
@@ -69,4 +69,7 @@ public class SeaPreloadDto {
...
@@ -69,4 +69,7 @@ public class SeaPreloadDto {
@ExcelProperty
(
"quantity"
)
@ExcelProperty
(
"quantity"
)
private
Integer
quantity
;
private
Integer
quantity
;
@ExcelProperty
(
"prodAttr"
)
private
String
prodAttr
;
//特性
}
}
yudao-module-shipment/yudao-module-shipment-core/src/main/java/cn/iocoder/yudao/module/shipment/listener/ShipmentPreloadExcelExportListener.java
View file @
56745837
...
@@ -305,8 +305,10 @@ public class ShipmentPreloadExcelExportListener {
...
@@ -305,8 +305,10 @@ public class ShipmentPreloadExcelExportListener {
preloadDto
.
setUsageIds
(
getUsageMsg
(
item
.
getUsageIds
()));
preloadDto
.
setUsageIds
(
getUsageMsg
(
item
.
getUsageIds
()));
BigDecimal
totalWorth
=
orderInfo
.
getOrderItemVOList
().
stream
().
map
(
OrderItemBackVO:
:
getWorth
).
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
BigDecimal
totalWorth
=
orderInfo
.
getOrderItemVOList
().
stream
().
map
(
OrderItemBackVO:
:
getWorth
).
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
preloadDto
.
setWorth
(
totalWorth
);
preloadDto
.
setWorth
(
totalWorth
);
preloadDto
.
setTotalVolume
(
orderInfo
.
getSumVolume
());
preloadDto
.
setTotalVolume
(
orderInfo
.
getSumVolumeFinishedWarehouseIn
().
compareTo
(
BigDecimal
.
ZERO
)
==
0
?
orderInfo
.
getSumVolume
():
orderInfo
.
getSumVolumeFinishedWarehouseIn
());
preloadDto
.
setTotalWeight
(
orderInfo
.
getSumWeight
());
preloadDto
.
setTotalWeight
(
orderInfo
.
getSumWeightFinishedWarehouseIn
().
compareTo
(
BigDecimal
.
ZERO
)
==
0
?
orderInfo
.
getSumWeight
():
orderInfo
.
getSumWeightFinishedWarehouseIn
());
// preloadDto.setTotalVolume(orderInfo.getSumVolume());
// preloadDto.setTotalWeight(orderInfo.getSumWeight());
preloadDtoList
.
add
(
preloadDto
);
preloadDtoList
.
add
(
preloadDto
);
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
));
...
...
yudao-module-shipment/yudao-module-shipment-core/src/main/java/cn/iocoder/yudao/module/shipment/listener/ShipmentSeaPreloadExcelExportListener.java
View file @
56745837
...
@@ -27,7 +27,9 @@ import cn.iocoder.yudao.module.order.service.order.*;
...
@@ -27,7 +27,9 @@ import cn.iocoder.yudao.module.order.service.order.*;
import
cn.iocoder.yudao.module.order.service.orderWarehouseIn.OrderWarehouseInService
;
import
cn.iocoder.yudao.module.order.service.orderWarehouseIn.OrderWarehouseInService
;
import
cn.iocoder.yudao.module.order.vo.orderWarehouseIn.OrderWarehouseInBackItemDo
;
import
cn.iocoder.yudao.module.order.vo.orderWarehouseIn.OrderWarehouseInBackItemDo
;
import
cn.iocoder.yudao.module.order.vo.orderWarehouseIn.OrderWarehouseInBackVO
;
import
cn.iocoder.yudao.module.order.vo.orderWarehouseIn.OrderWarehouseInBackVO
;
import
cn.iocoder.yudao.module.product.dal.dataobject.product.ProductAttrDO
;
import
cn.iocoder.yudao.module.product.dal.dataobject.productbrank.ProductBrankDO
;
import
cn.iocoder.yudao.module.product.dal.dataobject.productbrank.ProductBrankDO
;
import
cn.iocoder.yudao.module.product.service.product.ProductAttrService
;
import
cn.iocoder.yudao.module.product.service.productbrank.ProductBrankService
;
import
cn.iocoder.yudao.module.product.service.productbrank.ProductBrankService
;
import
cn.iocoder.yudao.module.shipment.dal.dataobject.BoxApprovalDO
;
import
cn.iocoder.yudao.module.shipment.dal.dataobject.BoxApprovalDO
;
import
cn.iocoder.yudao.module.shipment.dal.dataobject.BoxDO
;
import
cn.iocoder.yudao.module.shipment.dal.dataobject.BoxDO
;
...
@@ -107,6 +109,9 @@ public class ShipmentSeaPreloadExcelExportListener {
...
@@ -107,6 +109,9 @@ public class ShipmentSeaPreloadExcelExportListener {
@Resource
@Resource
private
OrderService
orderService
;
private
OrderService
orderService
;
@Resource
private
ProductAttrService
productAttrService
;
// @Value("${ue.templates-url}")
// @Value("${ue.templates-url}")
// private String path;
// private String path;
...
@@ -149,6 +154,9 @@ public class ShipmentSeaPreloadExcelExportListener {
...
@@ -149,6 +154,9 @@ public class ShipmentSeaPreloadExcelExportListener {
// 不存在则创建一个目录
// 不存在则创建一个目录
fileDir
.
mkdirs
();
fileDir
.
mkdirs
();
}
}
List
<
ProductAttrDO
>
productAttrDOList
=
productAttrService
.
getProductAttrList
();
Map
<
String
,
String
>
idNameMap
=
productAttrDOList
.
stream
()
.
collect
(
Collectors
.
toMap
(
attr
->
String
.
valueOf
(
attr
.
getId
()),
ProductAttrDO:
:
getAttrName
));
ExcelWriter
excelWriter
=
EasyExcel
.
write
(
dir
+
fileName
).
withTemplate
(
inputStream
).
build
();
ExcelWriter
excelWriter
=
EasyExcel
.
write
(
dir
+
fileName
).
withTemplate
(
inputStream
).
build
();
WriteSheet
sheet
=
EasyExcel
.
writerSheet
(
0
).
build
();
WriteSheet
sheet
=
EasyExcel
.
writerSheet
(
0
).
build
();
excelWriter
.
fill
(
headMap
,
sheet
);
excelWriter
.
fill
(
headMap
,
sheet
);
...
@@ -204,6 +212,7 @@ public class ShipmentSeaPreloadExcelExportListener {
...
@@ -204,6 +212,7 @@ public class ShipmentSeaPreloadExcelExportListener {
.
registerWriteHandler
(
new
CustomMergeStrategy
(
orderMap
,
orderWarehouseInService
,
orderItemService
,
17
,
true
))
.
registerWriteHandler
(
new
CustomMergeStrategy
(
orderMap
,
orderWarehouseInService
,
orderItemService
,
17
,
true
))
.
registerWriteHandler
(
new
CustomMergeStrategy
(
orderMap
,
orderWarehouseInService
,
orderItemService
,
18
,
false
))
.
registerWriteHandler
(
new
CustomMergeStrategy
(
orderMap
,
orderWarehouseInService
,
orderItemService
,
18
,
false
))
.
registerWriteHandler
(
new
CustomMergeStrategy
(
orderMap
,
orderWarehouseInService
,
orderItemService
,
20
,
false
))
.
registerWriteHandler
(
new
CustomMergeStrategy
(
orderMap
,
orderWarehouseInService
,
orderItemService
,
20
,
false
))
.
registerWriteHandler
(
new
CustomMergeStrategy
(
orderMap
,
orderWarehouseInService
,
orderItemService
,
21
,
false
))
.
automaticMergeHead
(
true
).
head
(
headList
).
needHead
(
true
).
build
();
.
automaticMergeHead
(
true
).
head
(
headList
).
needHead
(
true
).
build
();
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
();
...
@@ -287,6 +296,7 @@ public class ShipmentSeaPreloadExcelExportListener {
...
@@ -287,6 +296,7 @@ public class ShipmentSeaPreloadExcelExportListener {
// preloadDto.setQuantity(collect1.get(warehouse.getInTime()).get(warehouse.getUnit()).get(warehouse.getOrderLocationStr4Merge()).stream().mapToInt(OrderWarehouseInBackItemDo::getQuantityAll).sum());
// preloadDto.setQuantity(collect1.get(warehouse.getInTime()).get(warehouse.getUnit()).get(warehouse.getOrderLocationStr4Merge()).stream().mapToInt(OrderWarehouseInBackItemDo::getQuantityAll).sum());
preloadDto
.
setQuantity
(
collect1
.
get
(
warehouse
.
getInTime
()).
get
(
warehouse
.
getUnit
()).
get
(
warehouse
.
getOrderLocationStr4Merge
()).
stream
().
mapToInt
(
s
->
Objects
.
isNull
(
s
.
getQuantityAll
())
?
0
:
s
.
getQuantityAll
()).
sum
());
preloadDto
.
setQuantity
(
collect1
.
get
(
warehouse
.
getInTime
()).
get
(
warehouse
.
getUnit
()).
get
(
warehouse
.
getOrderLocationStr4Merge
()).
stream
().
mapToInt
(
s
->
Objects
.
isNull
(
s
.
getQuantityAll
())
?
0
:
s
.
getQuantityAll
()).
sum
());
// preloadDto.setQuantity(collect.get(warehouse.getInTime()).stream().filter(jj -> jj.getQuantityAll() !=null ).mapToInt(OrderWarehouseInBackItemDo::getQuantityAll).sum());
// preloadDto.setQuantity(collect.get(warehouse.getInTime()).stream().filter(jj -> jj.getQuantityAll() !=null ).mapToInt(OrderWarehouseInBackItemDo::getQuantityAll).sum());
preloadDto
.
setProdAttr
(
getAttrNameByIds
(
item
.
getProdAttrIds
(),
idNameMap
));
list
.
add
(
preloadDto
);
list
.
add
(
preloadDto
);
}
}
totalNum
=
totalNum
+
item
.
getWarehouseInInfoVO
().
getCartonsNum
();
totalNum
=
totalNum
+
item
.
getWarehouseInInfoVO
().
getCartonsNum
();
...
@@ -341,5 +351,18 @@ public class ShipmentSeaPreloadExcelExportListener {
...
@@ -341,5 +351,18 @@ public class ShipmentSeaPreloadExcelExportListener {
}
}
}
}
private
String
getAttrNameByIds
(
String
attrIds
,
Map
<
String
,
String
>
idNameMap
)
{
StringJoiner
labelJoiner
=
new
StringJoiner
(
","
);
if
(
StringUtils
.
isNotBlank
(
attrIds
))
{
String
[]
attrIdArray
=
attrIds
.
split
(
","
);
for
(
String
attrId
:
attrIdArray
)
{
//map一定包含数据,否则是数据错误
labelJoiner
.
add
(
idNameMap
.
get
(
attrId
));
}
return
labelJoiner
.
toString
();
}
return
""
;
}
}
}
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