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
4ec49d61
Commit
4ec49d61
authored
Aug 22, 2024
by
332784038@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
单询异常的空值线路价格下载业务对货币单位、计量单位的转化处理bug修复
parent
046fe455
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
71 deletions
+70
-71
ProductPriceExcelExportListener.java
...ule/product/listener/ProductPriceExcelExportListener.java
+68
-68
AchievementDetailExcelListener.java
...roller/admin/listener/AchievementDetailExcelListener.java
+2
-3
No files found.
yudao-module-product/yudao-module-product-core/src/main/java/cn/iocoder/yudao/module/product/listener/ProductPriceExcelExportListener.java
View file @
4ec49d61
...
@@ -78,7 +78,7 @@ public class ProductPriceExcelExportListener {
...
@@ -78,7 +78,7 @@ public class ProductPriceExcelExportListener {
String
nowTime
=
formatter
.
format
(
LocalDateTime
.
now
());
String
nowTime
=
formatter
.
format
(
LocalDateTime
.
now
());
String
dir
=
ueProperties
.
getTempDir
().
concat
(
"/productPrice/excel/"
);
String
dir
=
ueProperties
.
getTempDir
().
concat
(
"/productPrice/excel/"
);
File
fileDir
=
new
File
(
dir
);
File
fileDir
=
new
File
(
dir
);
if
(!
fileDir
.
exists
())
{
if
(!
fileDir
.
exists
())
{
fileDir
.
mkdirs
();
fileDir
.
mkdirs
();
}
}
...
@@ -93,7 +93,7 @@ public class ProductPriceExcelExportListener {
...
@@ -93,7 +93,7 @@ public class ProductPriceExcelExportListener {
List
<
CurrencyDO
>
currencyList
=
currencyService
.
getCurrencyList
();
List
<
CurrencyDO
>
currencyList
=
currencyService
.
getCurrencyList
();
Map
<
Integer
,
CurrencyDO
>
currencyMap
=
currencyList
.
stream
()
Map
<
Integer
,
CurrencyDO
>
currencyMap
=
currencyList
.
stream
()
.
collect
(
Collectors
.
toMap
(
CurrencyDO:
:
getId
,
v
->
v
));
.
collect
(
Collectors
.
toMap
(
CurrencyDO:
:
getId
,
v
->
v
));
List
<
UnitDO
>
unitList
=
unitService
.
getUnitList
();
List
<
UnitDO
>
unitList
=
unitService
.
getUnitList
();
Map
<
Integer
,
UnitDO
>
unitMap
=
unitList
.
stream
()
Map
<
Integer
,
UnitDO
>
unitMap
=
unitList
.
stream
()
...
@@ -113,7 +113,7 @@ public class ProductPriceExcelExportListener {
...
@@ -113,7 +113,7 @@ public class ProductPriceExcelExportListener {
List
<
ProductPriceExcelData
>
list
=
List
<
ProductPriceExcelData
>
list
=
productPriceService
.
getExcelList
(
pageSize
,
maxId
,
exportReqVO
);
productPriceService
.
getExcelList
(
pageSize
,
maxId
,
exportReqVO
);
log
.
error
(
"路线价格数据{}-{}处理成功"
,
start
,
end
);
log
.
error
(
"路线价格数据{}-{}处理成功"
,
start
,
end
);
if
(
CollectionUtil
.
isEmpty
(
list
))
continue
;
if
(
CollectionUtil
.
isEmpty
(
list
))
continue
;
maxId
=
list
.
get
(
list
.
size
()
-
1
).
getId
();
maxId
=
list
.
get
(
list
.
size
()
-
1
).
getId
();
for
(
ProductPriceExcelData
item
:
list
)
{
for
(
ProductPriceExcelData
item
:
list
)
{
...
@@ -121,7 +121,7 @@ public class ProductPriceExcelExportListener {
...
@@ -121,7 +121,7 @@ public class ProductPriceExcelExportListener {
String
transportPrice
=
""
;
String
transportPrice
=
""
;
String
clearancePrice
=
""
;
String
clearancePrice
=
""
;
if
(
item
.
getStepPrice
()
==
0
)
{
if
(
item
.
getStepPrice
()
==
0
)
{
transportPrice
=
getPrice
(
item
.
getTransportPrice
(),
transportPrice
=
getPrice
(
item
.
getTransportPrice
(),
item
.
getTransportPriceUnit
().
intValue
(),
item
.
getTransportPriceUnit
().
intValue
(),
item
.
getTransportVolumeUnit
().
intValue
(),
currencyMap
,
unitMap
);
item
.
getTransportVolumeUnit
().
intValue
(),
currencyMap
,
unitMap
);
...
@@ -132,13 +132,13 @@ public class ProductPriceExcelExportListener {
...
@@ -132,13 +132,13 @@ public class ProductPriceExcelExportListener {
String
allPrice
=
getPrice
(
item
.
getAllPrice
(),
item
.
getAllPriceUnit
().
intValue
(),
String
allPrice
=
getPrice
(
item
.
getAllPrice
(),
item
.
getAllPriceUnit
().
intValue
(),
item
.
getAllVolumeUnit
().
intValue
(),
currencyMap
,
unitMap
);
item
.
getAllVolumeUnit
().
intValue
(),
currencyMap
,
unitMap
);
if
(
item
.
getPriceType
()
==
1
)
{
if
(
item
.
getPriceType
()
==
1
)
{
transportPrice
=
allPrice
;
transportPrice
=
allPrice
;
clearancePrice
=
""
;
clearancePrice
=
""
;
}
}
List
<
ProductPriceSpecialDO
>
specialList
=
item
.
getSpecialList
();
List
<
ProductPriceSpecialDO
>
specialList
=
item
.
getSpecialList
();
if
(
CollectionUtil
.
isNotEmpty
(
specialList
))
{
if
(
CollectionUtil
.
isNotEmpty
(
specialList
))
{
for
(
ProductPriceSpecialDO
specialDO
:
specialList
)
{
for
(
ProductPriceSpecialDO
specialDO
:
specialList
)
{
String
key
=
specialDO
.
getSpecialDictType
();
String
key
=
specialDO
.
getSpecialDictType
();
String
specialTransportPrice
=
getPrice
(
specialDO
.
getTransportPrice
(),
String
specialTransportPrice
=
getPrice
(
specialDO
.
getTransportPrice
(),
...
@@ -151,31 +151,31 @@ public class ProductPriceExcelExportListener {
...
@@ -151,31 +151,31 @@ public class ProductPriceExcelExportListener {
String
specialAllPrice
=
getPrice
(
specialDO
.
getAllPrice
(),
specialDO
.
getAllPriceUnit
().
intValue
(),
String
specialAllPrice
=
getPrice
(
specialDO
.
getAllPrice
(),
specialDO
.
getAllPriceUnit
().
intValue
(),
specialDO
.
getAllVolumeUnit
().
intValue
(),
currencyMap
,
unitMap
);
specialDO
.
getAllVolumeUnit
().
intValue
(),
currencyMap
,
unitMap
);
if
(
item
.
getPriceType
()
==
1
)
{
if
(
item
.
getPriceType
()
==
1
)
{
specialTransportPrice
=
specialAllPrice
;
specialTransportPrice
=
specialAllPrice
;
specialClearancePrice
=
""
;
specialClearancePrice
=
""
;
}
}
if
(
key
.
equals
(
"licensed_price"
))
{
if
(
key
.
equals
(
"licensed_price"
))
{
item
.
setYpTransportPrice
(
specialTransportPrice
);
item
.
setYpTransportPrice
(
specialTransportPrice
);
item
.
setYpClearancePrice
(
specialClearancePrice
);
item
.
setYpClearancePrice
(
specialClearancePrice
);
}
else
if
(
key
.
equals
(
"neutral_brand_prices"
))
{
}
else
if
(
key
.
equals
(
"neutral_brand_prices"
))
{
item
.
setZxTransportPrice
(
specialTransportPrice
);
item
.
setZxTransportPrice
(
specialTransportPrice
);
item
.
setZxClearancePrice
(
specialClearancePrice
);
item
.
setZxClearancePrice
(
specialClearancePrice
);
}
else
if
(
key
.
equals
(
"liquid_price"
))
{
}
else
if
(
key
.
equals
(
"liquid_price"
))
{
item
.
setYtTransportPrice
(
specialTransportPrice
);
item
.
setYtTransportPrice
(
specialTransportPrice
);
item
.
setYtClearancePrice
(
specialClearancePrice
);
item
.
setYtClearancePrice
(
specialClearancePrice
);
}
else
if
(
key
.
equals
(
"live_price"
))
{
}
else
if
(
key
.
equals
(
"live_price"
))
{
item
.
setDdTransportPrice
(
specialTransportPrice
);
item
.
setDdTransportPrice
(
specialTransportPrice
);
item
.
setDdClearancePrice
(
specialClearancePrice
);
item
.
setDdClearancePrice
(
specialClearancePrice
);
}
}
}
}
}
}
}
else
if
(
item
.
getStepPrice
()
==
1
)
{
}
else
if
(
item
.
getStepPrice
()
==
1
)
{
//阶梯价格
//阶梯价格
List
<
ProductPriceStepDO
>
stepList
=
item
.
getStepList
();
List
<
ProductPriceStepDO
>
stepList
=
item
.
getStepList
();
if
(
CollectionUtil
.
isNotEmpty
(
stepList
))
{
if
(
CollectionUtil
.
isNotEmpty
(
stepList
))
{
Map
<
Integer
,
List
<
ProductPriceStepDO
>>
stepTypeMap
=
stepList
.
stream
()
Map
<
Integer
,
List
<
ProductPriceStepDO
>>
stepTypeMap
=
stepList
.
stream
()
.
collect
(
Collectors
.
groupingBy
(
ProductPriceStepDO:
:
getPriceType
));
.
collect
(
Collectors
.
groupingBy
(
ProductPriceStepDO:
:
getPriceType
));
List
<
ProductPriceStepDO
>
yfStepList
=
stepTypeMap
.
get
(
PriceTypeEnum
.
FREIGHT
.
getPriceType
());
List
<
ProductPriceStepDO
>
yfStepList
=
stepTypeMap
.
get
(
PriceTypeEnum
.
FREIGHT
.
getPriceType
());
...
@@ -194,14 +194,14 @@ public class ProductPriceExcelExportListener {
...
@@ -194,14 +194,14 @@ public class ProductPriceExcelExportListener {
StringBuilder
ddyfSb
=
new
StringBuilder
();
StringBuilder
ddyfSb
=
new
StringBuilder
();
StringBuilder
ddqgfSb
=
new
StringBuilder
();
StringBuilder
ddqgfSb
=
new
StringBuilder
();
if
(
CollectionUtil
.
isNotEmpty
(
yfStepList
))
{
if
(
CollectionUtil
.
isNotEmpty
(
yfStepList
))
{
yfStepList
.
sort
(
Comparator
.
comparing
(
ProductPriceStepDO:
:
getRankNum
));
yfStepList
.
sort
(
Comparator
.
comparing
(
ProductPriceStepDO:
:
getRankNum
));
for
(
int
j
=
1
;
j
<=
yfStepList
.
size
();
j
++)
{
for
(
int
j
=
1
;
j
<=
yfStepList
.
size
();
j
++)
{
ProductPriceStepDO
stepDO
=
yfStepList
.
get
(
j
-
1
);
ProductPriceStepDO
stepDO
=
yfStepList
.
get
(
j
-
1
);
List
<
ProductPriceStepSpecialDO
>
stepSpecialDOS
=
stepDO
.
getSpecialList
();
List
<
ProductPriceStepSpecialDO
>
stepSpecialDOS
=
stepDO
.
getSpecialList
();
if
(
CollectionUtil
.
isNotEmpty
(
stepSpecialDOS
))
{
if
(
CollectionUtil
.
isNotEmpty
(
stepSpecialDOS
))
{
Map
<
String
,
ProductPriceStepSpecialDO
>
stepSpecialDOMap
=
stepSpecialDOS
.
stream
()
Map
<
String
,
ProductPriceStepSpecialDO
>
stepSpecialDOMap
=
stepSpecialDOS
.
stream
()
.
collect
(
Collectors
.
toMap
(
ProductPriceStepSpecialDO:
:
getSpecialDictType
,
v
->
v
,
(
v1
,
v2
)
->
v2
));
.
collect
(
Collectors
.
toMap
(
ProductPriceStepSpecialDO:
:
getSpecialDictType
,
v
->
v
,
(
v1
,
v2
)
->
v2
));
//有牌
//有牌
ProductPriceStepSpecialDO
yp
=
stepSpecialDOMap
.
get
(
"licensed_price"
);
ProductPriceStepSpecialDO
yp
=
stepSpecialDOMap
.
get
(
"licensed_price"
);
//中性
//中性
...
@@ -216,11 +216,11 @@ public class ProductPriceExcelExportListener {
...
@@ -216,11 +216,11 @@ public class ProductPriceExcelExportListener {
addStepSpecialPrice
(
zx
,
currencyMap
,
unitMap
,
zxyfSb
,
stepInfo
,
PriceTypeEnum
.
FREIGHT
);
addStepSpecialPrice
(
zx
,
currencyMap
,
unitMap
,
zxyfSb
,
stepInfo
,
PriceTypeEnum
.
FREIGHT
);
addStepSpecialPrice
(
yt
,
currencyMap
,
unitMap
,
ytyfSb
,
stepInfo
,
PriceTypeEnum
.
FREIGHT
);
addStepSpecialPrice
(
yt
,
currencyMap
,
unitMap
,
ytyfSb
,
stepInfo
,
PriceTypeEnum
.
FREIGHT
);
addStepSpecialPrice
(
dd
,
currencyMap
,
unitMap
,
ddyfSb
,
stepInfo
,
PriceTypeEnum
.
FREIGHT
);
addStepSpecialPrice
(
dd
,
currencyMap
,
unitMap
,
ddyfSb
,
stepInfo
,
PriceTypeEnum
.
FREIGHT
);
if
(
i
!=
yfStepList
.
size
())
{
if
(
i
!=
yfStepList
.
size
())
{
ypyfSb
.
append
((
char
)
10
);
ypyfSb
.
append
((
char
)
10
);
zxyfSb
.
append
((
char
)
10
);
zxyfSb
.
append
((
char
)
10
);
ytyfSb
.
append
((
char
)
10
);
ytyfSb
.
append
((
char
)
10
);
ddyfSb
.
append
((
char
)
10
);
ddyfSb
.
append
((
char
)
10
);
}
}
}
}
...
@@ -230,28 +230,28 @@ public class ProductPriceExcelExportListener {
...
@@ -230,28 +230,28 @@ public class ProductPriceExcelExportListener {
Long
weightUnit
=
stepDO
.
getWeightUnit
();
Long
weightUnit
=
stepDO
.
getWeightUnit
();
String
unit
=
""
;
String
unit
=
""
;
if
(
weightUnit
!=
null
)
{
if
(
weightUnit
!=
null
)
{
UnitDO
unitDO
=
unitMap
.
get
(
weightUnit
.
intValue
());
UnitDO
unitDO
=
unitMap
.
get
(
weightUnit
.
intValue
());
unit
=
unitDO
.
getTitleZh
()
;
unit
=
Objects
.
nonNull
(
unitDO
)?
unitDO
.
getTitleZh
():
"空"
;
}
}
BigDecimal
startNum
=
stepDO
.
getStartNum
();
BigDecimal
startNum
=
stepDO
.
getStartNum
();
BigDecimal
endNum
=
stepDO
.
getEndNum
();
BigDecimal
endNum
=
stepDO
.
getEndNum
();
transportPriceSb
.
append
(
"第"
).
append
(
j
).
append
(
"阶梯:"
).
append
(
startNum
)
transportPriceSb
.
append
(
"第"
).
append
(
j
).
append
(
"阶梯:"
).
append
(
startNum
)
.
append
(
"-"
).
append
(
endNum
).
append
(
unit
).
append
(
" "
).
append
(
stepTransportPrice
);
.
append
(
"-"
).
append
(
endNum
).
append
(
unit
).
append
(
" "
).
append
(
stepTransportPrice
);
if
(
i
!=
stepList
.
size
())
{
if
(
i
!=
stepList
.
size
())
{
transportPriceSb
.
append
((
char
)
10
);
transportPriceSb
.
append
((
char
)
10
);
}
}
}
}
}
}
if
(
CollectionUtil
.
isNotEmpty
(
qgfStepList
))
{
if
(
CollectionUtil
.
isNotEmpty
(
qgfStepList
))
{
qgfStepList
.
sort
(
Comparator
.
comparing
(
ProductPriceStepDO:
:
getRankNum
));
qgfStepList
.
sort
(
Comparator
.
comparing
(
ProductPriceStepDO:
:
getRankNum
));
for
(
int
j
=
1
;
j
<=
qgfStepList
.
size
();
j
++)
{
for
(
int
j
=
1
;
j
<=
qgfStepList
.
size
();
j
++)
{
ProductPriceStepDO
stepDO
=
qgfStepList
.
get
(
j
-
1
);
ProductPriceStepDO
stepDO
=
qgfStepList
.
get
(
j
-
1
);
List
<
ProductPriceStepSpecialDO
>
stepSpecialDOS
=
stepDO
.
getSpecialList
();
List
<
ProductPriceStepSpecialDO
>
stepSpecialDOS
=
stepDO
.
getSpecialList
();
if
(
CollectionUtil
.
isNotEmpty
(
stepSpecialDOS
))
{
if
(
CollectionUtil
.
isNotEmpty
(
stepSpecialDOS
))
{
Map
<
String
,
ProductPriceStepSpecialDO
>
stepSpecialDOMap
=
stepSpecialDOS
.
stream
()
Map
<
String
,
ProductPriceStepSpecialDO
>
stepSpecialDOMap
=
stepSpecialDOS
.
stream
()
.
collect
(
Collectors
.
toMap
(
ProductPriceStepSpecialDO:
:
getSpecialDictType
,
v
->
v
,
(
v1
,
v2
)
->
v2
));
.
collect
(
Collectors
.
toMap
(
ProductPriceStepSpecialDO:
:
getSpecialDictType
,
v
->
v
,
(
v1
,
v2
)
->
v2
));
//有牌
//有牌
ProductPriceStepSpecialDO
yp
=
stepSpecialDOMap
.
get
(
"licensed_price"
);
ProductPriceStepSpecialDO
yp
=
stepSpecialDOMap
.
get
(
"licensed_price"
);
//中性
//中性
...
@@ -266,11 +266,11 @@ public class ProductPriceExcelExportListener {
...
@@ -266,11 +266,11 @@ public class ProductPriceExcelExportListener {
addStepSpecialPrice
(
zx
,
currencyMap
,
unitMap
,
zxqgfSb
,
stepInfo
,
PriceTypeEnum
.
CLEARANCE
);
addStepSpecialPrice
(
zx
,
currencyMap
,
unitMap
,
zxqgfSb
,
stepInfo
,
PriceTypeEnum
.
CLEARANCE
);
addStepSpecialPrice
(
yt
,
currencyMap
,
unitMap
,
ytqgfSb
,
stepInfo
,
PriceTypeEnum
.
CLEARANCE
);
addStepSpecialPrice
(
yt
,
currencyMap
,
unitMap
,
ytqgfSb
,
stepInfo
,
PriceTypeEnum
.
CLEARANCE
);
addStepSpecialPrice
(
dd
,
currencyMap
,
unitMap
,
ddqgfSb
,
stepInfo
,
PriceTypeEnum
.
CLEARANCE
);
addStepSpecialPrice
(
dd
,
currencyMap
,
unitMap
,
ddqgfSb
,
stepInfo
,
PriceTypeEnum
.
CLEARANCE
);
if
(
i
!=
qgfStepList
.
size
())
{
if
(
i
!=
qgfStepList
.
size
())
{
ypqgfSb
.
append
((
char
)
10
);
ypqgfSb
.
append
((
char
)
10
);
zxqgfSb
.
append
((
char
)
10
);
zxqgfSb
.
append
((
char
)
10
);
ytqgfSb
.
append
((
char
)
10
);
ytqgfSb
.
append
((
char
)
10
);
ddqgfSb
.
append
((
char
)
10
);
ddqgfSb
.
append
((
char
)
10
);
}
}
}
}
...
@@ -280,7 +280,7 @@ public class ProductPriceExcelExportListener {
...
@@ -280,7 +280,7 @@ public class ProductPriceExcelExportListener {
//
//
Long
weightUnit
=
stepDO
.
getWeightUnit
();
Long
weightUnit
=
stepDO
.
getWeightUnit
();
String
unit
=
""
;
String
unit
=
""
;
if
(
weightUnit
!=
null
)
{
if
(
weightUnit
!=
null
)
{
UnitDO
unitDO
=
unitMap
.
get
(
weightUnit
.
intValue
());
UnitDO
unitDO
=
unitMap
.
get
(
weightUnit
.
intValue
());
unit
=
unitDO
.
getTitleZh
();
unit
=
unitDO
.
getTitleZh
();
}
}
...
@@ -288,20 +288,20 @@ public class ProductPriceExcelExportListener {
...
@@ -288,20 +288,20 @@ public class ProductPriceExcelExportListener {
BigDecimal
endNum
=
stepDO
.
getEndNum
();
BigDecimal
endNum
=
stepDO
.
getEndNum
();
clearancePriceSb
.
append
(
"第"
).
append
(
j
).
append
(
"阶梯:"
).
append
(
startNum
)
clearancePriceSb
.
append
(
"第"
).
append
(
j
).
append
(
"阶梯:"
).
append
(
startNum
)
.
append
(
"-"
).
append
(
endNum
).
append
(
unit
).
append
(
" "
).
append
(
stepClearancePrice
);
.
append
(
"-"
).
append
(
endNum
).
append
(
unit
).
append
(
" "
).
append
(
stepClearancePrice
);
if
(
i
!=
stepList
.
size
())
{
if
(
i
!=
stepList
.
size
())
{
clearancePriceSb
.
append
((
char
)
10
);
clearancePriceSb
.
append
((
char
)
10
);
}
}
}
}
}
}
if
(
CollectionUtil
.
isNotEmpty
(
qbjStepList
)
&&
item
.
getPriceType
()
==
1
)
{
if
(
CollectionUtil
.
isNotEmpty
(
qbjStepList
)
&&
item
.
getPriceType
()
==
1
)
{
qbjStepList
.
sort
(
Comparator
.
comparing
(
ProductPriceStepDO:
:
getRankNum
));
qbjStepList
.
sort
(
Comparator
.
comparing
(
ProductPriceStepDO:
:
getRankNum
));
for
(
int
j
=
1
;
j
<=
qbjStepList
.
size
();
j
++)
{
for
(
int
j
=
1
;
j
<=
qbjStepList
.
size
();
j
++)
{
ProductPriceStepDO
stepDO
=
qbjStepList
.
get
(
j
-
1
);
ProductPriceStepDO
stepDO
=
qbjStepList
.
get
(
j
-
1
);
List
<
ProductPriceStepSpecialDO
>
stepSpecialDOS
=
stepDO
.
getSpecialList
();
List
<
ProductPriceStepSpecialDO
>
stepSpecialDOS
=
stepDO
.
getSpecialList
();
if
(
CollectionUtil
.
isNotEmpty
(
stepSpecialDOS
))
{
if
(
CollectionUtil
.
isNotEmpty
(
stepSpecialDOS
))
{
Map
<
String
,
ProductPriceStepSpecialDO
>
stepSpecialDOMap
=
stepSpecialDOS
.
stream
()
Map
<
String
,
ProductPriceStepSpecialDO
>
stepSpecialDOMap
=
stepSpecialDOS
.
stream
()
.
collect
(
Collectors
.
toMap
(
ProductPriceStepSpecialDO:
:
getSpecialDictType
,
v
->
v
,
(
v1
,
v2
)
->
v2
));
.
collect
(
Collectors
.
toMap
(
ProductPriceStepSpecialDO:
:
getSpecialDictType
,
v
->
v
,
(
v1
,
v2
)
->
v2
));
//有牌
//有牌
ProductPriceStepSpecialDO
yp
=
stepSpecialDOMap
.
get
(
"licensed_price"
);
ProductPriceStepSpecialDO
yp
=
stepSpecialDOMap
.
get
(
"licensed_price"
);
//中性
//中性
...
@@ -316,11 +316,11 @@ public class ProductPriceExcelExportListener {
...
@@ -316,11 +316,11 @@ public class ProductPriceExcelExportListener {
addStepSpecialPrice
(
zx
,
currencyMap
,
unitMap
,
zxyfSb
,
stepInfo
,
PriceTypeEnum
.
FULL_PRICE
);
addStepSpecialPrice
(
zx
,
currencyMap
,
unitMap
,
zxyfSb
,
stepInfo
,
PriceTypeEnum
.
FULL_PRICE
);
addStepSpecialPrice
(
yt
,
currencyMap
,
unitMap
,
ytyfSb
,
stepInfo
,
PriceTypeEnum
.
FULL_PRICE
);
addStepSpecialPrice
(
yt
,
currencyMap
,
unitMap
,
ytyfSb
,
stepInfo
,
PriceTypeEnum
.
FULL_PRICE
);
addStepSpecialPrice
(
dd
,
currencyMap
,
unitMap
,
ddyfSb
,
stepInfo
,
PriceTypeEnum
.
FULL_PRICE
);
addStepSpecialPrice
(
dd
,
currencyMap
,
unitMap
,
ddyfSb
,
stepInfo
,
PriceTypeEnum
.
FULL_PRICE
);
if
(
i
!=
qbjStepList
.
size
())
{
if
(
i
!=
qbjStepList
.
size
())
{
ypyfSb
.
append
((
char
)
10
);
ypyfSb
.
append
((
char
)
10
);
zxyfSb
.
append
((
char
)
10
);
zxyfSb
.
append
((
char
)
10
);
ytyfSb
.
append
((
char
)
10
);
ytyfSb
.
append
((
char
)
10
);
ddyfSb
.
append
((
char
)
10
);
ddyfSb
.
append
((
char
)
10
);
}
}
}
}
...
@@ -330,16 +330,16 @@ public class ProductPriceExcelExportListener {
...
@@ -330,16 +330,16 @@ public class ProductPriceExcelExportListener {
//
//
Long
weightUnit
=
stepDO
.
getWeightUnit
();
Long
weightUnit
=
stepDO
.
getWeightUnit
();
String
unit
=
""
;
String
unit
=
""
;
if
(
weightUnit
!=
null
)
{
if
(
weightUnit
!=
null
)
{
UnitDO
unitDO
=
unitMap
.
get
(
weightUnit
.
intValue
());
UnitDO
unitDO
=
unitMap
.
get
(
weightUnit
.
intValue
());
unit
=
unitDO
.
getTitleZh
()
;
unit
=
Objects
.
nonNull
(
unitDO
)
?
unitDO
.
getTitleZh
()
:
"空"
;
}
}
BigDecimal
startNum
=
stepDO
.
getStartNum
();
BigDecimal
startNum
=
stepDO
.
getStartNum
();
BigDecimal
endNum
=
stepDO
.
getEndNum
();
BigDecimal
endNum
=
stepDO
.
getEndNum
();
transportPriceSb
.
append
(
"第"
).
append
(
j
).
append
(
"阶梯:"
).
append
(
startNum
)
transportPriceSb
.
append
(
"第"
).
append
(
j
).
append
(
"阶梯:"
).
append
(
startNum
)
.
append
(
"-"
).
append
(
endNum
).
append
(
unit
).
append
(
" "
).
append
(
stepTransportPrice
);
.
append
(
"-"
).
append
(
endNum
).
append
(
unit
).
append
(
" "
).
append
(
stepTransportPrice
);
if
(
i
!=
stepList
.
size
())
{
if
(
i
!=
stepList
.
size
())
{
transportPriceSb
.
append
((
char
)
10
);
transportPriceSb
.
append
((
char
)
10
);
}
}
}
}
}
}
...
@@ -363,9 +363,9 @@ public class ProductPriceExcelExportListener {
...
@@ -363,9 +363,9 @@ public class ProductPriceExcelExportListener {
statusName
(
item
);
statusName
(
item
);
if
(
item
.
getNeedPay
()
==
0
)
{
if
(
item
.
getNeedPay
()
==
0
)
{
item
.
setPayType
(
"到付"
);
item
.
setPayType
(
"到付"
);
}
else
if
(
item
.
getNeedPay
()
==
1
)
{
}
else
if
(
item
.
getNeedPay
()
==
1
)
{
item
.
setPayType
(
"预付"
);
item
.
setPayType
(
"预付"
);
}
}
String
date
=
DateUtil
.
format
(
item
.
getUpdateTime
(),
"yyyy-MM-dd HH:mm:ss"
);
String
date
=
DateUtil
.
format
(
item
.
getUpdateTime
(),
"yyyy-MM-dd HH:mm:ss"
);
...
@@ -374,12 +374,12 @@ public class ProductPriceExcelExportListener {
...
@@ -374,12 +374,12 @@ public class ProductPriceExcelExportListener {
Date
startDate
=
item
.
getValidateStartDate
();
Date
startDate
=
item
.
getValidateStartDate
();
Date
endDate
=
item
.
getValidateEndDate
();
Date
endDate
=
item
.
getValidateEndDate
();
StringBuilder
expireSb
=
new
StringBuilder
();
StringBuilder
expireSb
=
new
StringBuilder
();
if
(
startDate
!=
null
)
{
if
(
startDate
!=
null
)
{
String
startDateStr
=
DateUtil
.
format
(
startDate
,
"yyyy-MM-dd"
);
String
startDateStr
=
DateUtil
.
format
(
startDate
,
"yyyy-MM-dd"
);
expireSb
.
append
(
startDateStr
);
expireSb
.
append
(
startDateStr
);
}
}
expireSb
.
append
(
"~"
);
expireSb
.
append
(
"~"
);
if
(
endDate
!=
null
)
{
if
(
endDate
!=
null
)
{
String
endDateStr
=
DateUtil
.
format
(
endDate
,
"yyyy-MM-dd"
);
String
endDateStr
=
DateUtil
.
format
(
endDate
,
"yyyy-MM-dd"
);
expireSb
.
append
(
endDateStr
);
expireSb
.
append
(
endDateStr
);
}
}
...
@@ -388,10 +388,10 @@ public class ProductPriceExcelExportListener {
...
@@ -388,10 +388,10 @@ public class ProductPriceExcelExportListener {
List
<
ProductPriceExcelVO
>
datas
=
ProductPriceConvert
.
INSTANCE
.
convertList02
(
list
);
List
<
ProductPriceExcelVO
>
datas
=
ProductPriceConvert
.
INSTANCE
.
convertList02
(
list
);
excelWriter
.
write
(
datas
,
writeSheet
);
excelWriter
.
write
(
datas
,
writeSheet
);
list
.
forEach
(
m
->
{
list
.
forEach
(
m
->
{
if
(
m
.
getSpecialList
()
!=
null
)
{
if
(
m
.
getSpecialList
()
!=
null
)
{
m
.
getSpecialList
().
clear
();
m
.
getSpecialList
().
clear
();
}
}
if
(
m
.
getStepList
()
!=
null
)
{
if
(
m
.
getStepList
()
!=
null
)
{
m
.
getStepList
().
clear
();
m
.
getStepList
().
clear
();
}
}
});
});
...
@@ -417,8 +417,8 @@ public class ProductPriceExcelExportListener {
...
@@ -417,8 +417,8 @@ public class ProductPriceExcelExportListener {
event
.
setFileId
(
fileDO
.
getId
());
event
.
setFileId
(
fileDO
.
getId
());
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
// TODO 测试阶段打印堆栈错误信息,便于分析原因
// TODO 测试阶段打印堆栈错误信息,便于分析原因
e
.
printStackTrace
(
);
log
.
error
(
e
+
""
);
event
.
setResult
(
e
.
getMessage
()
);
event
.
setResult
(
e
+
""
);
}
}
}
else
{
}
else
{
event
.
setResult
(
"param fail"
);
event
.
setResult
(
"param fail"
);
...
@@ -429,18 +429,18 @@ public class ProductPriceExcelExportListener {
...
@@ -429,18 +429,18 @@ public class ProductPriceExcelExportListener {
private
void
addStepSpecialPrice
(
ProductPriceStepSpecialDO
stepSpecialDO
,
Map
<
Integer
,
CurrencyDO
>
currencyMap
,
private
void
addStepSpecialPrice
(
ProductPriceStepSpecialDO
stepSpecialDO
,
Map
<
Integer
,
CurrencyDO
>
currencyMap
,
Map
<
Integer
,
UnitDO
>
unitMap
,
StringBuilder
sb
,
String
stepInfo
,
PriceTypeEnum
priceTypeEnum
)
{
Map
<
Integer
,
UnitDO
>
unitMap
,
StringBuilder
sb
,
String
stepInfo
,
PriceTypeEnum
priceTypeEnum
)
{
sb
.
append
(
stepInfo
);
sb
.
append
(
stepInfo
);
if
(
stepSpecialDO
!=
null
)
{
if
(
stepSpecialDO
!=
null
)
{
if
(
priceTypeEnum
==
PriceTypeEnum
.
FREIGHT
)
{
if
(
priceTypeEnum
==
PriceTypeEnum
.
FREIGHT
)
{
String
specialTransportPrice
=
getPrice
(
stepSpecialDO
.
getTransportPrice
(),
String
specialTransportPrice
=
getPrice
(
stepSpecialDO
.
getTransportPrice
(),
stepSpecialDO
.
getTransportPriceUnit
().
intValue
(),
stepSpecialDO
.
getTransportPriceUnit
().
intValue
(),
stepSpecialDO
.
getTransportVolumeUnit
().
intValue
(),
currencyMap
,
unitMap
);
stepSpecialDO
.
getTransportVolumeUnit
().
intValue
(),
currencyMap
,
unitMap
);
sb
.
append
(
specialTransportPrice
);
sb
.
append
(
specialTransportPrice
);
}
else
if
(
priceTypeEnum
==
PriceTypeEnum
.
CLEARANCE
)
{
}
else
if
(
priceTypeEnum
==
PriceTypeEnum
.
CLEARANCE
)
{
String
specialClearancePrice
=
getPrice
(
stepSpecialDO
.
getClearancePrice
(),
String
specialClearancePrice
=
getPrice
(
stepSpecialDO
.
getClearancePrice
(),
stepSpecialDO
.
getClearancePriceUnit
().
intValue
(),
stepSpecialDO
.
getClearancePriceUnit
().
intValue
(),
stepSpecialDO
.
getClearanceVolumeUnit
().
intValue
(),
currencyMap
,
unitMap
);
stepSpecialDO
.
getClearanceVolumeUnit
().
intValue
(),
currencyMap
,
unitMap
);
sb
.
append
(
specialClearancePrice
);
sb
.
append
(
specialClearancePrice
);
}
else
if
(
priceTypeEnum
==
PriceTypeEnum
.
FULL_PRICE
)
{
}
else
if
(
priceTypeEnum
==
PriceTypeEnum
.
FULL_PRICE
)
{
String
specialAllPrice
=
getPrice
(
stepSpecialDO
.
getAllPrice
(),
stepSpecialDO
.
getAllPriceUnit
().
intValue
(),
String
specialAllPrice
=
getPrice
(
stepSpecialDO
.
getAllPrice
(),
stepSpecialDO
.
getAllPriceUnit
().
intValue
(),
stepSpecialDO
.
getAllVolumeUnit
().
intValue
(),
currencyMap
,
unitMap
);
stepSpecialDO
.
getAllVolumeUnit
().
intValue
(),
currencyMap
,
unitMap
);
sb
.
append
(
specialAllPrice
);
sb
.
append
(
specialAllPrice
);
...
@@ -452,8 +452,8 @@ public class ProductPriceExcelExportListener {
...
@@ -452,8 +452,8 @@ public class ProductPriceExcelExportListener {
CurrencyDO
currencyDO
=
currencyMap
.
get
(
priceUnit
);
CurrencyDO
currencyDO
=
currencyMap
.
get
(
priceUnit
);
UnitDO
unitDO
=
unitMap
.
get
(
volumeUnit
);
UnitDO
unitDO
=
unitMap
.
get
(
volumeUnit
);
return
(
currencyDO
!=
null
?
currencyDO
.
getFuhao
()
:
"
"
)
+
price
.
toString
()
+
(
currencyDO
!=
null
?
currencyDO
.
getTitleZh
()
:
"
"
)
+
"/"
+
return
(
currencyDO
!=
null
?
currencyDO
.
getFuhao
()
:
"
空"
)
+
price
.
toString
()
+
(
currencyDO
!=
null
?
currencyDO
.
getTitleZh
()
:
"空
"
)
+
"/"
+
(
unitDO
!=
null
?
unitDO
.
getTitleZh
()
:
""
);
(
unitDO
!=
null
?
unitDO
.
getTitleZh
()
:
"
空
"
);
}
}
private
void
statusName
(
ProductPriceExcelData
item
)
{
private
void
statusName
(
ProductPriceExcelData
item
)
{
...
@@ -461,18 +461,18 @@ public class ProductPriceExcelExportListener {
...
@@ -461,18 +461,18 @@ public class ProductPriceExcelExportListener {
Date
endDate
=
item
.
getValidateEndDate
();
Date
endDate
=
item
.
getValidateEndDate
();
boolean
notSetPrice
=
false
;
boolean
notSetPrice
=
false
;
long
now
=
new
Date
().
getTime
();
long
now
=
new
Date
().
getTime
();
if
(
startDate
!=
null
&&
startDate
.
getTime
()
>
now
)
{
if
(
startDate
!=
null
&&
startDate
.
getTime
()
>
now
)
{
notSetPrice
=
true
;
notSetPrice
=
true
;
}
}
if
(
endDate
!=
null
&&
endDate
.
getTime
()
<
now
)
{
if
(
endDate
!=
null
&&
endDate
.
getTime
()
<
now
)
{
notSetPrice
=
true
;
notSetPrice
=
true
;
}
}
String
setPriceText
=
notSetPrice
?
"(未设置价格)"
:
""
;
String
setPriceText
=
notSetPrice
?
"(未设置价格)"
:
""
;
if
(
item
.
getBlacklist
()
==
1
)
{
if
(
item
.
getBlacklist
()
==
1
)
{
item
.
setStatusName
(
"黑名单"
+
setPriceText
);
item
.
setStatusName
(
"黑名单"
+
setPriceText
);
return
;
return
;
}
}
if
(
item
.
getAuditStatus
()
==
0
)
{
if
(
item
.
getAuditStatus
()
==
0
)
{
item
.
setStatusName
(
"已审核"
+
setPriceText
);
item
.
setStatusName
(
"已审核"
+
setPriceText
);
return
;
return
;
}
}
...
...
yudao-module-sale/yudao-module-sale-rest/src/main/java/cn/iocoder/yudao/module/sale/controller/admin/listener/AchievementDetailExcelListener.java
View file @
4ec49d61
...
@@ -69,9 +69,8 @@ public class AchievementDetailExcelListener {
...
@@ -69,9 +69,8 @@ public class AchievementDetailExcelListener {
event
.
setUrl
(
fileDO
.
getUrl
());
event
.
setUrl
(
fileDO
.
getUrl
());
event
.
setFileId
(
fileDO
.
getId
());
event
.
setFileId
(
fileDO
.
getId
());
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
info
(
"业绩明细导出失败"
,
e
);
log
.
error
(
"业绩明细导出失败"
,
e
);
e
.
printStackTrace
();
event
.
setResult
(
e
+
""
);
event
.
setResult
(
e
.
getMessage
());
}
}
}
}
}
}
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