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
66cef53e
Commit
66cef53e
authored
Aug 10, 2024
by
huyf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
海运应收汇总bug&海运已装单需求
parent
d5c60328
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
273 additions
and
265 deletions
+273
-265
LoadDto.java
...in/java/cn/iocoder/yudao/module/shipment/dto/LoadDto.java
+9
-3
ShipmentLoadExcelExportListener2.java
...e/shipment/listener/ShipmentLoadExcelExportListener2.java
+159
-258
ShipmentReceivableExcelExportListener2.java
...ment/listener/ShipmentReceivableExcelExportListener2.java
+3
-2
CustomLoadMergeStrategyNew.java
...dao/module/shipment/utils/CustomLoadMergeStrategyNew.java
+100
-0
DownloadLogServiceImpl.java
...le/system/service/downloadLog/DownloadLogServiceImpl.java
+2
-2
No files found.
yudao-module-shipment/yudao-module-shipment-core/src/main/java/cn/iocoder/yudao/module/shipment/dto/LoadDto.java
View file @
66cef53e
...
@@ -21,12 +21,18 @@ public class LoadDto {
...
@@ -21,12 +21,18 @@ public class LoadDto {
@ExcelProperty
(
"prodTitleZh"
)
@ExcelProperty
(
"prodTitleZh"
)
private
String
prodTitleZh
;
private
String
prodTitleZh
;
@ExcelProperty
(
"quantity"
)
private
Integer
quantity
;
@ExcelProperty
(
"brand"
)
@ExcelProperty
(
"brand"
)
private
String
brand
;
private
String
brand
;
@ExcelProperty
(
"productRecord"
)
@ExcelProperty
(
"productRecord"
)
private
String
productRecord
;
private
String
productRecord
;
@ExcelProperty
(
"prodAttr"
)
private
String
prodAttr
;
//特性
@ExcelProperty
(
"sumNum"
)
@ExcelProperty
(
"sumNum"
)
private
Integer
sumNum
;
private
Integer
sumNum
;
...
@@ -45,6 +51,9 @@ public class LoadDto {
...
@@ -45,6 +51,9 @@ public class LoadDto {
@ExcelProperty
(
"material"
)
@ExcelProperty
(
"material"
)
private
String
material
;
private
String
material
;
@ExcelProperty
(
"usageIds"
)
private
String
usageIds
;
//用途
@ExcelProperty
(
"merge"
)
@ExcelProperty
(
"merge"
)
private
String
merge
;
private
String
merge
;
...
@@ -57,7 +66,4 @@ public class LoadDto {
...
@@ -57,7 +66,4 @@ public class LoadDto {
@ExcelProperty
(
"worth"
)
@ExcelProperty
(
"worth"
)
private
BigDecimal
worth
;
private
BigDecimal
worth
;
@ExcelProperty
(
"quantity"
)
private
Integer
quantity
;
}
}
yudao-module-shipment/yudao-module-shipment-core/src/main/java/cn/iocoder/yudao/module/shipment/listener/ShipmentLoadExcelExportListener2.java
View file @
66cef53e
This diff is collapsed.
Click to expand it.
yudao-module-shipment/yudao-module-shipment-core/src/main/java/cn/iocoder/yudao/module/shipment/listener/ShipmentReceivableExcelExportListener2.java
View file @
66cef53e
...
@@ -470,9 +470,10 @@ public class ShipmentReceivableExcelExportListener2 {
...
@@ -470,9 +470,10 @@ public class ShipmentReceivableExcelExportListener2 {
map
.
put
(
"sumNum"
,
orderInfo
.
getSumNum
());
map
.
put
(
"sumNum"
,
orderInfo
.
getSumNum
());
sum14
=
sum14
+
orderInfo
.
getSumNum
();
sum14
=
sum14
+
orderInfo
.
getSumNum
();
}
}
map
.
put
(
"sumVolume"
,
orderInfo
.
getOrderItemVOList
().
stream
().
map
(
OrderItemBackVO:
:
getChargeVolume
).
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
));
BigDecimal
volume
=
orderInfo
.
getOrderItemVOList
().
stream
().
map
(
OrderItemBackVO:
:
getChargeVolume
).
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
map
.
put
(
"sumVolume"
,
volume
);
// map.put("sumVolume", orderInfo.getSumVolume());
// map.put("sumVolume", orderInfo.getSumVolume());
sum15
=
sum15
.
add
(
orderInfo
.
getSumVolume
()
);
sum15
=
sum15
.
add
(
volume
);
map
.
put
(
"sumWeight"
,
orderInfo
.
getSumWeight
());
map
.
put
(
"sumWeight"
,
orderInfo
.
getSumWeight
());
sum16
=
sum16
.
add
(
orderInfo
.
getSumWeight
());
sum16
=
sum16
.
add
(
orderInfo
.
getSumWeight
());
map
.
put
(
"vWeight"
,
orderInfo
.
getVWeight
());
map
.
put
(
"vWeight"
,
orderInfo
.
getVWeight
());
...
...
yudao-module-shipment/yudao-module-shipment-core/src/main/java/cn/iocoder/yudao/module/shipment/utils/CustomLoadMergeStrategyNew.java
0 → 100644
View file @
66cef53e
package
cn
.
iocoder
.
yudao
.
module
.
shipment
.
utils
;
import
cn.iocoder.yudao.module.shipment.dto.AirLoadDto
;
import
cn.iocoder.yudao.module.shipment.dto.LoadDto
;
import
com.alibaba.excel.metadata.Head
;
import
com.alibaba.excel.write.merge.AbstractMergeStrategy
;
import
org.apache.poi.ss.usermodel.Cell
;
import
org.apache.poi.ss.usermodel.Sheet
;
import
org.apache.poi.ss.util.CellRangeAddress
;
import
org.springframework.util.CollectionUtils
;
import
java.util.ArrayList
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
* @author huyufeng
* @date 2022/12/14
* @description 自定义单元格合并策略
*/
public
class
CustomLoadMergeStrategyNew
extends
AbstractMergeStrategy
{
/**
* 分组,每几行合并一次
*/
private
List
<
Integer
>
exportFieldGroupCountList
;
private
List
<
Integer
>
partMergeList
;
private
int
mergeType
;
/**
* 目标合并列index
*/
private
Integer
targetColumnIndex
;
// 需要开始合并单元格的首行index
private
Integer
rowIndex
;
// exportDataList为待合并目标列的值 partMerge为另外一种合并方式计算好的合并行数,mergeType 合并类型 1为订单维度合并 2为入仓记录维度的合并
public
CustomLoadMergeStrategyNew
(
List
<
LoadDto
>
exportDataList
,
List
<
Integer
>
partMergeList
,
Integer
targetColumnIndex
,
int
mergeType
)
{
this
.
exportFieldGroupCountList
=
getGroupCountList
(
exportDataList
,
targetColumnIndex
);
this
.
partMergeList
=
partMergeList
;
this
.
mergeType
=
mergeType
;
this
.
targetColumnIndex
=
targetColumnIndex
;
}
@Override
protected
void
merge
(
Sheet
sheet
,
Cell
cell
,
Head
head
,
Integer
relativeRowIndex
)
{
if
(
null
==
rowIndex
)
{
rowIndex
=
cell
.
getRowIndex
();
}
// 仅从首行以及目标列的单元格开始合并,忽略其他
if
(
cell
.
getRowIndex
()
==
rowIndex
&&
cell
.
getColumnIndex
()
==
targetColumnIndex
)
{
if
(
mergeType
==
1
)
{
mergeGroupColumn
(
sheet
,
exportFieldGroupCountList
);
}
else
if
(
mergeType
==
2
)
{
mergeGroupColumn
(
sheet
,
partMergeList
);
}
}
}
private
void
mergeGroupColumn
(
Sheet
sheet
,
List
<
Integer
>
list
)
{
int
rowCount
=
rowIndex
;
for
(
Integer
count
:
list
)
{
if
(
count
==
1
)
{
rowCount
+=
count
;
continue
;
}
// 合并单元格
CellRangeAddress
cellRangeAddress
=
new
CellRangeAddress
(
rowCount
,
rowCount
+
count
-
1
,
targetColumnIndex
,
targetColumnIndex
);
sheet
.
addMergedRegionUnsafe
(
cellRangeAddress
);
rowCount
+=
count
;
}
}
// 该方法将目标列根据值是否相同连续可合并,存储可合并的行数
private
List
<
Integer
>
getGroupCountList
(
List
<
LoadDto
>
exportDataList
,
Integer
targetColumnIndex
)
{
if
(
CollectionUtils
.
isEmpty
(
exportDataList
))
{
return
new
ArrayList
<>();
}
List
<
Integer
>
groupCountList
=
new
ArrayList
<>();
int
count
=
1
;
LinkedHashMap
<
String
,
List
<
LoadDto
>>
collect
=
exportDataList
.
stream
().
collect
(
Collectors
.
groupingBy
(
LoadDto:
:
getId
,
LinkedHashMap:
:
new
,
Collectors
.
toList
()));
for
(
Map
.
Entry
<
String
,
List
<
LoadDto
>>
entry
:
collect
.
entrySet
())
{
groupCountList
.
add
(
entry
.
getValue
().
size
());
}
return
groupCountList
;
}
}
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/downloadLog/DownloadLogServiceImpl.java
View file @
66cef53e
...
@@ -282,9 +282,9 @@ public class DownloadLogServiceImpl extends AbstractService<DownloadLogMapper, D
...
@@ -282,9 +282,9 @@ public class DownloadLogServiceImpl extends AbstractService<DownloadLogMapper, D
break
;
break
;
//已装单导出
//已装单导出
case
SHIPMENT_LOAD_EXCEL_EXPORT:
case
SHIPMENT_LOAD_EXCEL_EXPORT:
shipmentLoadExcelExportPushEvent
(
downloadLog
);
//
shipmentLoadExcelExportPushEvent(downloadLog);
//总体切换
//总体切换
//
shipmentLoadExcelExportPushEvent2(downloadLog);
shipmentLoadExcelExportPushEvent2
(
downloadLog
);
break
;
break
;
//应收汇总导出修改导出Excel样式
//应收汇总导出修改导出Excel样式
case
SHIPMENT_RECEIVABLE_EXCEL_EXPORT:
case
SHIPMENT_RECEIVABLE_EXCEL_EXPORT:
...
...
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