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
6ecc3b1e
Commit
6ecc3b1e
authored
Aug 22, 2024
by
332784038@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
阶梯价格导出bug修复,区分费用模式来分开处理导出数据
parent
307f3775
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
133 additions
and
132 deletions
+133
-132
ProductPriceExcelExportListener.java
...ule/product/listener/ProductPriceExcelExportListener.java
+133
-132
No files found.
yudao-module-product/yudao-module-product-core/src/main/java/cn/iocoder/yudao/module/product/listener/ProductPriceExcelExportListener.java
View file @
6ecc3b1e
...
...
@@ -193,157 +193,158 @@ public class ProductPriceExcelExportListener {
StringBuilder
ytqgfSb
=
new
StringBuilder
();
StringBuilder
ddyfSb
=
new
StringBuilder
();
StringBuilder
ddqgfSb
=
new
StringBuilder
();
if
(
CollectionUtil
.
isNotEmpty
(
yfStepList
))
{
yfStepList
.
sort
(
Comparator
.
comparing
(
ProductPriceStepDO:
:
getRankNum
));
for
(
int
j
=
1
;
j
<=
yfStepList
.
size
();
j
++)
{
ProductPriceStepDO
stepDO
=
yfStepList
.
get
(
j
-
1
);
List
<
ProductPriceStepSpecialDO
>
stepSpecialDOS
=
stepDO
.
getSpecialList
();
if
(
CollectionUtil
.
isNotEmpty
(
stepSpecialDOS
))
{
Map
<
String
,
ProductPriceStepSpecialDO
>
stepSpecialDOMap
=
stepSpecialDOS
.
stream
()
.
collect
(
Collectors
.
toMap
(
ProductPriceStepSpecialDO:
:
getSpecialDictType
,
v
->
v
,
(
v1
,
v2
)
->
v2
));
//有牌
ProductPriceStepSpecialDO
yp
=
stepSpecialDOMap
.
get
(
"licensed_price"
);
//中性
ProductPriceStepSpecialDO
zx
=
stepSpecialDOMap
.
get
(
"neutral_brand_prices"
);
//液体
ProductPriceStepSpecialDO
yt
=
stepSpecialDOMap
.
get
(
"liquid_price"
);
//带电
ProductPriceStepSpecialDO
dd
=
stepSpecialDOMap
.
get
(
"live_price"
);
String
stepInfo
=
"第"
+
j
+
"阶梯: "
;
addStepSpecialPrice
(
yp
,
currencyMap
,
unitMap
,
ypyfSb
,
stepInfo
,
PriceTypeEnum
.
FREIGHT
);
addStepSpecialPrice
(
zx
,
currencyMap
,
unitMap
,
zxyfSb
,
stepInfo
,
PriceTypeEnum
.
FREIGHT
);
addStepSpecialPrice
(
yt
,
currencyMap
,
unitMap
,
ytyfSb
,
stepInfo
,
PriceTypeEnum
.
FREIGHT
);
addStepSpecialPrice
(
dd
,
currencyMap
,
unitMap
,
ddyfSb
,
stepInfo
,
PriceTypeEnum
.
FREIGHT
);
if
(
i
!=
yfStepList
.
size
())
{
ypyfSb
.
append
((
char
)
10
);
zxyfSb
.
append
((
char
)
10
);
ytyfSb
.
append
((
char
)
10
);
ddyfSb
.
append
((
char
)
10
);
if
(
item
.
getPriceType
()
==
0
)
{
if
(
CollectionUtil
.
isNotEmpty
(
yfStepList
))
{
yfStepList
.
sort
(
Comparator
.
comparing
(
ProductPriceStepDO:
:
getRankNum
));
for
(
int
j
=
1
;
j
<=
yfStepList
.
size
();
j
++)
{
ProductPriceStepDO
stepDO
=
yfStepList
.
get
(
j
-
1
);
List
<
ProductPriceStepSpecialDO
>
stepSpecialDOS
=
stepDO
.
getSpecialList
();
if
(
CollectionUtil
.
isNotEmpty
(
stepSpecialDOS
))
{
Map
<
String
,
ProductPriceStepSpecialDO
>
stepSpecialDOMap
=
stepSpecialDOS
.
stream
()
.
collect
(
Collectors
.
toMap
(
ProductPriceStepSpecialDO:
:
getSpecialDictType
,
v
->
v
,
(
v1
,
v2
)
->
v2
));
//有牌
ProductPriceStepSpecialDO
yp
=
stepSpecialDOMap
.
get
(
"licensed_price"
);
//中性
ProductPriceStepSpecialDO
zx
=
stepSpecialDOMap
.
get
(
"neutral_brand_prices"
);
//液体
ProductPriceStepSpecialDO
yt
=
stepSpecialDOMap
.
get
(
"liquid_price"
);
//带电
ProductPriceStepSpecialDO
dd
=
stepSpecialDOMap
.
get
(
"live_price"
);
String
stepInfo
=
"第"
+
j
+
"阶梯: "
;
addStepSpecialPrice
(
yp
,
currencyMap
,
unitMap
,
ypyfSb
,
stepInfo
,
PriceTypeEnum
.
FREIGHT
);
addStepSpecialPrice
(
zx
,
currencyMap
,
unitMap
,
zxyfSb
,
stepInfo
,
PriceTypeEnum
.
FREIGHT
);
addStepSpecialPrice
(
yt
,
currencyMap
,
unitMap
,
ytyfSb
,
stepInfo
,
PriceTypeEnum
.
FREIGHT
);
addStepSpecialPrice
(
dd
,
currencyMap
,
unitMap
,
ddyfSb
,
stepInfo
,
PriceTypeEnum
.
FREIGHT
);
if
(
i
!=
yfStepList
.
size
())
{
ypyfSb
.
append
((
char
)
10
);
zxyfSb
.
append
((
char
)
10
);
ytyfSb
.
append
((
char
)
10
);
ddyfSb
.
append
((
char
)
10
);
}
}
}
String
stepTransportPrice
=
getPrice
(
stepDO
.
getTransportPrice
(),
stepDO
.
getTransportPriceUnit
().
intValue
(),
stepDO
.
getTransportVolumeUnit
().
intValue
(),
currencyMap
,
unitMap
);
String
stepTransportPrice
=
getPrice
(
stepDO
.
getTransportPrice
(),
stepDO
.
getTransportPriceUnit
().
intValue
(),
stepDO
.
getTransportVolumeUnit
().
intValue
(),
currencyMap
,
unitMap
);
Long
weightUnit
=
stepDO
.
getWeightUnit
();
String
unit
=
""
;
if
(
weightUnit
!=
null
)
{
UnitDO
unitDO
=
unitMap
.
get
(
weightUnit
.
intValue
());
unit
=
Objects
.
nonNull
(
unitDO
)?
unitDO
.
getTitleZh
():
"空"
;
}
BigDecimal
startNum
=
stepDO
.
getStartNum
();
BigDecimal
endNum
=
stepDO
.
getEndNum
();
transportPriceSb
.
append
(
"第"
).
append
(
j
).
append
(
"阶梯:"
).
append
(
startNum
)
.
append
(
"-"
).
append
(
endNum
).
append
(
unit
).
append
(
" "
).
append
(
stepTransportPrice
);
if
(
i
!=
stepList
.
size
())
{
transportPriceSb
.
append
((
char
)
10
);
Long
weightUnit
=
stepDO
.
getWeightUnit
();
String
unit
=
""
;
if
(
weightUnit
!=
null
)
{
UnitDO
unitDO
=
unitMap
.
get
(
weightUnit
.
intValue
());
unit
=
Objects
.
nonNull
(
unitDO
)
?
unitDO
.
getTitleZh
()
:
"空"
;
}
BigDecimal
startNum
=
stepDO
.
getStartNum
();
BigDecimal
endNum
=
stepDO
.
getEndNum
();
transportPriceSb
.
append
(
"第"
).
append
(
j
).
append
(
"阶梯:"
).
append
(
startNum
)
.
append
(
"-"
).
append
(
endNum
).
append
(
unit
).
append
(
" "
).
append
(
stepTransportPrice
);
if
(
i
!=
stepList
.
size
())
{
transportPriceSb
.
append
((
char
)
10
);
}
}
}
}
if
(
CollectionUtil
.
isNotEmpty
(
qgfStepList
))
{
qgfStepList
.
sort
(
Comparator
.
comparing
(
ProductPriceStepDO:
:
getRankNum
));
for
(
int
j
=
1
;
j
<=
qgfStepList
.
size
();
j
++)
{
ProductPriceStepDO
stepDO
=
qgfStepList
.
get
(
j
-
1
);
List
<
ProductPriceStepSpecialDO
>
stepSpecialDOS
=
stepDO
.
getSpecialList
();
if
(
CollectionUtil
.
isNotEmpty
(
stepSpecialDOS
))
{
Map
<
String
,
ProductPriceStepSpecialDO
>
stepSpecialDOMap
=
stepSpecialDOS
.
stream
()
.
collect
(
Collectors
.
toMap
(
ProductPriceStepSpecialDO:
:
getSpecialDictType
,
v
->
v
,
(
v1
,
v2
)
->
v2
));
//有牌
ProductPriceStepSpecialDO
yp
=
stepSpecialDOMap
.
get
(
"licensed_price"
);
//中性
ProductPriceStepSpecialDO
zx
=
stepSpecialDOMap
.
get
(
"neutral_brand_prices"
);
//液体
ProductPriceStepSpecialDO
yt
=
stepSpecialDOMap
.
get
(
"liquid_price"
);
//带电
ProductPriceStepSpecialDO
dd
=
stepSpecialDOMap
.
get
(
"live_price"
);
String
stepInfo
=
"第"
+
j
+
"阶梯: "
;
addStepSpecialPrice
(
yp
,
currencyMap
,
unitMap
,
ypqgfSb
,
stepInfo
,
PriceTypeEnum
.
CLEARANCE
);
addStepSpecialPrice
(
zx
,
currencyMap
,
unitMap
,
zxqgfSb
,
stepInfo
,
PriceTypeEnum
.
CLEARANCE
);
addStepSpecialPrice
(
yt
,
currencyMap
,
unitMap
,
ytqgfSb
,
stepInfo
,
PriceTypeEnum
.
CLEARANCE
);
addStepSpecialPrice
(
dd
,
currencyMap
,
unitMap
,
ddqgfSb
,
stepInfo
,
PriceTypeEnum
.
CLEARANCE
);
if
(
i
!=
qgfStepList
.
size
())
{
ypqgfSb
.
append
((
char
)
10
);
zxqgfSb
.
append
((
char
)
10
);
ytqgfSb
.
append
((
char
)
10
);
ddqgfSb
.
append
((
char
)
10
);
if
(
CollectionUtil
.
isNotEmpty
(
qgfStepList
))
{
qgfStepList
.
sort
(
Comparator
.
comparing
(
ProductPriceStepDO:
:
getRankNum
));
for
(
int
j
=
1
;
j
<=
qgfStepList
.
size
();
j
++)
{
ProductPriceStepDO
stepDO
=
qgfStepList
.
get
(
j
-
1
);
List
<
ProductPriceStepSpecialDO
>
stepSpecialDOS
=
stepDO
.
getSpecialList
();
if
(
CollectionUtil
.
isNotEmpty
(
stepSpecialDOS
))
{
Map
<
String
,
ProductPriceStepSpecialDO
>
stepSpecialDOMap
=
stepSpecialDOS
.
stream
()
.
collect
(
Collectors
.
toMap
(
ProductPriceStepSpecialDO:
:
getSpecialDictType
,
v
->
v
,
(
v1
,
v2
)
->
v2
));
//有牌
ProductPriceStepSpecialDO
yp
=
stepSpecialDOMap
.
get
(
"licensed_price"
);
//中性
ProductPriceStepSpecialDO
zx
=
stepSpecialDOMap
.
get
(
"neutral_brand_prices"
);
//液体
ProductPriceStepSpecialDO
yt
=
stepSpecialDOMap
.
get
(
"liquid_price"
);
//带电
ProductPriceStepSpecialDO
dd
=
stepSpecialDOMap
.
get
(
"live_price"
);
String
stepInfo
=
"第"
+
j
+
"阶梯: "
;
addStepSpecialPrice
(
yp
,
currencyMap
,
unitMap
,
ypqgfSb
,
stepInfo
,
PriceTypeEnum
.
CLEARANCE
);
addStepSpecialPrice
(
zx
,
currencyMap
,
unitMap
,
zxqgfSb
,
stepInfo
,
PriceTypeEnum
.
CLEARANCE
);
addStepSpecialPrice
(
yt
,
currencyMap
,
unitMap
,
ytqgfSb
,
stepInfo
,
PriceTypeEnum
.
CLEARANCE
);
addStepSpecialPrice
(
dd
,
currencyMap
,
unitMap
,
ddqgfSb
,
stepInfo
,
PriceTypeEnum
.
CLEARANCE
);
if
(
i
!=
qgfStepList
.
size
())
{
ypqgfSb
.
append
((
char
)
10
);
zxqgfSb
.
append
((
char
)
10
);
ytqgfSb
.
append
((
char
)
10
);
ddqgfSb
.
append
((
char
)
10
);
}
}
}
String
stepClearancePrice
=
getPrice
(
stepDO
.
getClearancePrice
(),
stepDO
.
getClearancePriceUnit
().
intValue
(),
stepDO
.
getClearanceVolumeUnit
().
intValue
(),
currencyMap
,
unitMap
);
String
stepClearancePrice
=
getPrice
(
stepDO
.
getClearancePrice
(),
stepDO
.
getClearancePriceUnit
().
intValue
(),
stepDO
.
getClearanceVolumeUnit
().
intValue
(),
currencyMap
,
unitMap
);
//
Long
weightUnit
=
stepDO
.
getWeightUnit
();
String
unit
=
""
;
if
(
weightUnit
!=
null
)
{
UnitDO
unitDO
=
unitMap
.
get
(
weightUnit
.
intValue
());
unit
=
unitDO
.
getTitleZh
();
}
BigDecimal
startNum
=
stepDO
.
getStartNum
();
BigDecimal
endNum
=
stepDO
.
getEndNum
();
clearancePriceSb
.
append
(
"第"
).
append
(
j
).
append
(
"阶梯:"
).
append
(
startNum
)
.
append
(
"-"
).
append
(
endNum
).
append
(
unit
).
append
(
" "
).
append
(
stepClearancePrice
);
if
(
i
!=
stepList
.
size
())
{
clearancePriceSb
.
append
((
char
)
10
);
Long
weightUnit
=
stepDO
.
getWeightUnit
();
String
unit
=
""
;
if
(
weightUnit
!=
null
)
{
UnitDO
unitDO
=
unitMap
.
get
(
weightUnit
.
intValue
());
unit
=
unitDO
.
getTitleZh
();
}
BigDecimal
startNum
=
stepDO
.
getStartNum
();
BigDecimal
endNum
=
stepDO
.
getEndNum
();
clearancePriceSb
.
append
(
"第"
).
append
(
j
).
append
(
"阶梯:"
).
append
(
startNum
)
.
append
(
"-"
).
append
(
endNum
).
append
(
unit
).
append
(
" "
).
append
(
stepClearancePrice
);
if
(
i
!=
stepList
.
size
())
{
clearancePriceSb
.
append
((
char
)
10
);
}
}
}
}
if
(
CollectionUtil
.
isNotEmpty
(
qbjStepList
)
&&
item
.
getPriceType
()
==
1
)
{
qbjStepList
.
sort
(
Comparator
.
comparing
(
ProductPriceStepDO:
:
getRankNum
));
for
(
int
j
=
1
;
j
<=
qbjStepList
.
size
();
j
++)
{
ProductPriceStepDO
stepDO
=
qbjStepList
.
get
(
j
-
1
);
List
<
ProductPriceStepSpecialDO
>
stepSpecialDOS
=
stepDO
.
getSpecialList
();
if
(
CollectionUtil
.
isNotEmpty
(
stepSpecialDOS
))
{
Map
<
String
,
ProductPriceStepSpecialDO
>
stepSpecialDOMap
=
stepSpecialDOS
.
stream
()
.
collect
(
Collectors
.
toMap
(
ProductPriceStepSpecialDO:
:
getSpecialDictType
,
v
->
v
,
(
v1
,
v2
)
->
v2
));
//有牌
ProductPriceStepSpecialDO
yp
=
stepSpecialDOMap
.
get
(
"licensed_price"
);
//中性
ProductPriceStepSpecialDO
zx
=
stepSpecialDOMap
.
get
(
"neutral_brand_prices"
);
//液体
ProductPriceStepSpecialDO
yt
=
stepSpecialDOMap
.
get
(
"liquid_price"
);
//带电
ProductPriceStepSpecialDO
dd
=
stepSpecialDOMap
.
get
(
"live_price"
);
String
stepInfo
=
"第"
+
j
+
"阶梯: "
;
addStepSpecialPrice
(
yp
,
currencyMap
,
unitMap
,
ypyfSb
,
stepInfo
,
PriceTypeEnum
.
FULL_PRICE
);
addStepSpecialPrice
(
zx
,
currencyMap
,
unitMap
,
zxyfSb
,
stepInfo
,
PriceTypeEnum
.
FULL_PRICE
);
addStepSpecialPrice
(
yt
,
currencyMap
,
unitMap
,
ytyfSb
,
stepInfo
,
PriceTypeEnum
.
FULL_PRICE
);
addStepSpecialPrice
(
dd
,
currencyMap
,
unitMap
,
ddyfSb
,
stepInfo
,
PriceTypeEnum
.
FULL_PRICE
);
if
(
i
!=
qbjStepList
.
size
())
{
ypyfSb
.
append
((
char
)
10
);
zxyfSb
.
append
((
char
)
10
);
ytyfSb
.
append
((
char
)
10
);
ddyfSb
.
append
((
char
)
10
);
if
(
item
.
getPriceType
()
==
1
)
{
if
(
CollectionUtil
.
isNotEmpty
(
qbjStepList
)
&&
item
.
getPriceType
()
==
1
)
{
qbjStepList
.
sort
(
Comparator
.
comparing
(
ProductPriceStepDO:
:
getRankNum
));
for
(
int
j
=
1
;
j
<=
qbjStepList
.
size
();
j
++)
{
ProductPriceStepDO
stepDO
=
qbjStepList
.
get
(
j
-
1
);
List
<
ProductPriceStepSpecialDO
>
stepSpecialDOS
=
stepDO
.
getSpecialList
();
if
(
CollectionUtil
.
isNotEmpty
(
stepSpecialDOS
))
{
Map
<
String
,
ProductPriceStepSpecialDO
>
stepSpecialDOMap
=
stepSpecialDOS
.
stream
()
.
collect
(
Collectors
.
toMap
(
ProductPriceStepSpecialDO:
:
getSpecialDictType
,
v
->
v
,
(
v1
,
v2
)
->
v2
));
//有牌
ProductPriceStepSpecialDO
yp
=
stepSpecialDOMap
.
get
(
"licensed_price"
);
//中性
ProductPriceStepSpecialDO
zx
=
stepSpecialDOMap
.
get
(
"neutral_brand_prices"
);
//液体
ProductPriceStepSpecialDO
yt
=
stepSpecialDOMap
.
get
(
"liquid_price"
);
//带电
ProductPriceStepSpecialDO
dd
=
stepSpecialDOMap
.
get
(
"live_price"
);
String
stepInfo
=
"第"
+
j
+
"阶梯: "
;
addStepSpecialPrice
(
yp
,
currencyMap
,
unitMap
,
ypyfSb
,
stepInfo
,
PriceTypeEnum
.
FULL_PRICE
);
addStepSpecialPrice
(
zx
,
currencyMap
,
unitMap
,
zxyfSb
,
stepInfo
,
PriceTypeEnum
.
FULL_PRICE
);
addStepSpecialPrice
(
yt
,
currencyMap
,
unitMap
,
ytyfSb
,
stepInfo
,
PriceTypeEnum
.
FULL_PRICE
);
addStepSpecialPrice
(
dd
,
currencyMap
,
unitMap
,
ddyfSb
,
stepInfo
,
PriceTypeEnum
.
FULL_PRICE
);
if
(
i
!=
qbjStepList
.
size
())
{
ypyfSb
.
append
((
char
)
10
);
zxyfSb
.
append
((
char
)
10
);
ytyfSb
.
append
((
char
)
10
);
ddyfSb
.
append
((
char
)
10
);
}
}
}
//
String
stepTransportPrice
=
getPrice
(
stepDO
.
getAllPrice
(),
stepDO
.
getAllPriceUnit
().
intValue
(),
stepDO
.
getAllVolumeUnit
().
intValue
(),
currencyMap
,
unitMap
);
String
stepTransportPrice
=
getPrice
(
stepDO
.
getAllPrice
(),
stepDO
.
getAllPriceUnit
().
intValue
(),
stepDO
.
getAllVolumeUnit
().
intValue
(),
currencyMap
,
unitMap
);
//
Long
weightUnit
=
stepDO
.
getWeightUnit
();
String
unit
=
""
;
if
(
weightUnit
!=
null
)
{
UnitDO
unitDO
=
unitMap
.
get
(
weightUnit
.
intValue
());
unit
=
Objects
.
nonNull
(
unitDO
)
?
unitDO
.
getTitleZh
()
:
"空"
;
}
BigDecimal
startNum
=
stepDO
.
getStartNum
();
BigDecimal
endNum
=
stepDO
.
getEndNum
();
transportPriceSb
.
append
(
"第"
).
append
(
j
).
append
(
"阶梯:"
).
append
(
startNum
)
.
append
(
"-"
).
append
(
endNum
).
append
(
unit
).
append
(
" "
).
append
(
stepTransportPrice
);
if
(
i
!=
stepList
.
size
())
{
transportPriceSb
.
append
((
char
)
10
);
Long
weightUnit
=
stepDO
.
getWeightUnit
();
String
unit
=
""
;
if
(
weightUnit
!=
null
)
{
UnitDO
unitDO
=
unitMap
.
get
(
weightUnit
.
intValue
());
unit
=
Objects
.
nonNull
(
unitDO
)
?
unitDO
.
getTitleZh
()
:
"空"
;
}
BigDecimal
startNum
=
stepDO
.
getStartNum
();
BigDecimal
endNum
=
stepDO
.
getEndNum
();
transportPriceSb
.
append
(
"第"
).
append
(
j
).
append
(
"阶梯:"
).
append
(
startNum
)
.
append
(
"-"
).
append
(
endNum
).
append
(
unit
).
append
(
" "
).
append
(
stepTransportPrice
);
if
(
i
!=
stepList
.
size
())
{
transportPriceSb
.
append
((
char
)
10
);
}
}
}
}
transportPrice
=
transportPriceSb
.
toString
();
clearancePrice
=
clearancePriceSb
.
toString
();
...
...
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