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
2fcb0796
Commit
2fcb0796
authored
Aug 20, 2024
by
332784038@qq.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master-fix' into dev
parents
73fc4fec
910207c2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
90 additions
and
100 deletions
+90
-100
ProductPriceServiceImpl.java
...product/service/product/impl/ProductPriceServiceImpl.java
+90
-100
No files found.
yudao-module-product/yudao-module-product-core/src/main/java/cn/iocoder/yudao/module/product/service/product/impl/ProductPriceServiceImpl.java
View file @
2fcb0796
...
...
@@ -3448,8 +3448,6 @@ public class ProductPriceServiceImpl extends AbstractService<ProductPriceMapper,
if
(
productPriceDOList
.
size
()
>
0
)
{
for
(
ProductPriceDO
price
:
productPriceDOList
)
{
ProductPriceAirCreateReqVO
createReqVO
=
new
ProductPriceAirCreateReqVO
();
BeanUtils
.
copyProperties
(
price
,
createReqVO
);
createReqVO
.
setProductId
(
Long
.
parseLong
(
dto
.
getProductId
()));
...
...
@@ -3469,24 +3467,17 @@ public class ProductPriceServiceImpl extends AbstractService<ProductPriceMapper,
ProductPriceStepDO
freightPriceStep
=
new
ProductPriceStepDO
();
ProductPriceStepDO
clear
=
new
ProductPriceStepDO
();
if
(
createReqVO
.
getPriceType
()
==
1
)
{
if
(
CollectionUtil
.
isNotEmpty
(
respVO
.
getFullPricePackagingList
()))
{
List
<
ProductPriceStepPackagingDO
>
packagingList
=
new
ArrayList
<>();
respVO
.
getFullPricePackagingList
().
forEach
(
pack
->
{
createReqVO
.
setFreightPriceStepList
(
respVO
.
getFreightPriceStepList
());
ProductPriceStepDO
packagingDO
=
new
ProductPriceStepDO
();
BeanUtils
.
copyProperties
(
pack
,
packagingDO
);
packagingDO
.
setId
(
null
);
packagingDO
.
setStartNum
(
BigDecimal
.
valueOf
(
0
));
packagingDO
.
setEndNum
(
BigDecimal
.
valueOf
(
0
));
packagingDO
.
setWeightUnit
(
price
.
getTransportPriceUnit
());
// packagingDO.setTransportPrice(pack.getPackagingPrice());
// packagingDO.setTransportPriceUnit(pack.getPackagingPriceUnit());
// packagingDO.setTransportVolumeUnit(pack.getPackagingVolumeUnit());
packagingDO
.
setAllPrice
(
respVO
.
getAllPrice
());
packagingDO
.
setAllPriceUnit
(
respVO
.
getAllPriceUnit
());
packagingDO
.
setAllVolumeUnit
(
respVO
.
getAllVolumeUnit
());
if
(
CollectionUtil
.
isNotEmpty
(
respVO
.
getFullPriceStepList
()))
{
respVO
.
getFullPriceStepList
().
forEach
(
pack
->
{
ProductPriceStepDO
priceStepDO
=
new
ProductPriceStepDO
();
BeanUtils
.
copyProperties
(
pack
,
priceStepDO
);
priceStepDO
.
setId
(
null
);
priceStepDO
.
setStartNum
(
BigDecimal
.
valueOf
(
0
));
priceStepDO
.
setEndNum
(
BigDecimal
.
valueOf
(
0
));
priceStepDO
.
setWeightUnit
(
price
.
getTransportPriceUnit
());
priceStepDO
.
setAllPrice
(
respVO
.
getAllPrice
());
priceStepDO
.
setAllPriceUnit
(
respVO
.
getAllPriceUnit
());
priceStepDO
.
setAllVolumeUnit
(
respVO
.
getAllVolumeUnit
());
if
(
CollectionUtil
.
isNotEmpty
(
respVO
.
getSpecialList
()))
{
List
<
ProductPriceStepSpecialDO
>
specialList
=
new
ArrayList
<>();
respVO
.
getSpecialList
().
forEach
(
sp
->
{
...
...
@@ -3495,94 +3486,93 @@ public class ProductPriceServiceImpl extends AbstractService<ProductPriceMapper,
specialDO
.
setId
(
null
);
specialList
.
add
(
specialDO
);
});
p
ackaging
DO
.
setSpecialList
(
specialList
);
p
riceStep
DO
.
setSpecialList
(
specialList
);
}
ProductPriceStepPackagingDO
stepPackagingDO
=
new
ProductPriceStepPackagingDO
();
BeanUtils
.
copyProperties
(
pack
,
stepPackagingDO
);
packagingList
.
add
(
stepPackagingDO
);
packagingDO
.
setPackagingList
(
packagingList
);
fullPriceStepList
.
add
(
packagingDO
);
fullPriceStepList
.
add
(
priceStepDO
);
});
createReqVO
.
setFullPriceStepList
(
fullPriceStepList
);
}
}
else
{
if
(
CollectionUtil
.
isEmpty
(
respVO
.
getFreightPriceStepList
()))
{
BeanUtils
.
copyProperties
(
price
,
freightPriceStep
);
freightPriceStep
.
setStartNum
(
BigDecimal
.
valueOf
(
0
));
freightPriceStep
.
setEndNum
(
BigDecimal
.
valueOf
(
0
));
freightPriceStep
.
setRankNum
(
1
);
freightPriceStep
.
setWeightUnit
(
price
.
getTransportPriceUnit
());
freightPriceStep
.
setProductPriceId
(
price
.
getId
());
if
(
CollectionUtil
.
isNotEmpty
(
respVO
.
getSpecialList
()))
{
List
<
ProductPriceStepSpecialDO
>
specialDOList
=
new
ArrayList
<>();
respVO
.
getSpecialList
().
forEach
(
sp
->
{
ProductPriceStepSpecialDO
d
=
new
ProductPriceStepSpecialDO
();
BeanUtils
.
copyProperties
(
sp
,
d
);
specialDOList
.
add
(
d
);
});
specialDOList
.
stream
().
distinct
();
freightPriceStep
.
setSpecialList
(
specialDOList
);
}
//
if
(
CollectionUtil
.
isNotEmpty
(
respVO
.
getFreightPricePackagingList
()))
{
List
<
ProductPriceStepPackagingDO
>
stepPackagingDOS
=
new
ArrayList
<>();
respVO
.
getFreightPricePackagingList
().
forEach
(
pack
->
{
ProductPriceStepPackagingDO
packagingDO
=
new
ProductPriceStepPackagingDO
();
BeanUtils
.
copyProperties
(
pack
,
packagingDO
);
stepPackagingDOS
.
add
(
packagingDO
);
});
stepPackagingDOS
.
stream
().
distinct
();
freightPriceStep
.
setPackagingList
(
stepPackagingDOS
);
}
if
(
respVO
.
getPriceType
()
==
1
)
{
if
(
CollectionUtil
.
isNotEmpty
(
respVO
.
getFullPricePackagingList
()))
{
List
<
ProductPriceStepPackagingDO
>
specialDOList
=
new
ArrayList
<>();
respVO
.
getFullPricePackagingList
().
forEach
(
pack
->
{
ProductPriceStepPackagingDO
packagingDO
=
new
ProductPriceStepPackagingDO
();
BeanUtils
.
copyProperties
(
pack
,
packagingDO
);
packagingDO
.
setId
(
null
);
specialDOList
.
add
(
packagingDO
);
});
freightPriceStep
.
setPackagingList
(
specialDOList
);
}
}
else
{
}
freightPriceStepList
.
add
(
freightPriceStep
);
createReqVO
.
setFreightPriceStepList
(
freightPriceStepList
);
}
else
{
// if (CollectionUtil.isEmpty(respVO.getFreightPriceStepList())) {
// BeanUtils.copyProperties(price, freightPriceStep);
// freightPriceStep.setStartNum(BigDecimal.valueOf(0));
// freightPriceStep.setEndNum(BigDecimal.valueOf(0));
// freightPriceStep.setRankNum(1);
// freightPriceStep.setWeightUnit(price.getTransportPriceUnit());
// freightPriceStep.setProductPriceId(price.getId());
// if (CollectionUtil.isNotEmpty(respVO.getSpecialList())) {
// List<ProductPriceStepSpecialDO> specialDOList = new ArrayList<>();
// respVO.getSpecialList().forEach(sp -> {
// ProductPriceStepSpecialDO d = new ProductPriceStepSpecialDO();
// BeanUtils.copyProperties(sp, d);
// specialDOList.add(d);
// });
// specialDOList.stream().distinct();
// freightPriceStep.setSpecialList(specialDOList);
// }
// //
// if (CollectionUtil.isNotEmpty(respVO.getFreightPricePackagingList())) {
// List<ProductPriceStepPackagingDO> stepPackagingDOS = new ArrayList<>();
// respVO.getFreightPricePackagingList().forEach(pack -> {
// ProductPriceStepPackagingDO packagingDO = new ProductPriceStepPackagingDO();
// BeanUtils.copyProperties(pack, packagingDO);
// stepPackagingDOS.add(packagingDO);
// });
// stepPackagingDOS.stream().distinct();
// freightPriceStep.setPackagingList(stepPackagingDOS);
// }
// if (respVO.getPriceType() == 1) {
// if (CollectionUtil.isNotEmpty(respVO.getFullPricePackagingList())) {
// List<ProductPriceStepPackagingDO> specialDOList = new ArrayList<>();
// respVO.getFullPricePackagingList().forEach(pack -> {
// ProductPriceStepPackagingDO packagingDO = new ProductPriceStepPackagingDO();
// BeanUtils.copyProperties(pack, packagingDO);
// packagingDO.setId(null);
//
// specialDOList.add(packagingDO);
// });
//
// freightPriceStep.setPackagingList(specialDOList);
//
// }
// } else {
//
// }
// freightPriceStepList.add(freightPriceStep);
//
// createReqVO.setFreightPriceStepList(freightPriceStepList);
// } else {
// createReqVO.setFreightPriceStepList(respVO.getFreightPriceStepList());
// }
if
(
CollectionUtil
.
isNotEmpty
(
respVO
.
getFreightPriceStepList
()))
{
createReqVO
.
setFreightPriceStepList
(
respVO
.
getFreightPriceStepList
());
}
if
(
CollectionUtil
.
isEmpty
(
respVO
.
getClearancePriceStepList
()))
{
BeanUtils
.
copyProperties
(
price
,
clear
);
clear
.
setStartNum
(
BigDecimal
.
valueOf
(
0
));
clear
.
setEndNum
(
BigDecimal
.
valueOf
(
0
));
clear
.
setRankNum
(
2
);
clear
.
setWeightUnit
(
price
.
getClearancePriceUnit
());
clear
.
setProductPriceId
(
price
.
getId
());
if
(
CollectionUtil
.
isNotEmpty
(
respVO
.
getClearancePricePackagingList
()))
{
List
<
ProductPriceStepPackagingDO
>
stepPackagingDOS
=
new
ArrayList
<>();
respVO
.
getClearancePricePackagingList
().
forEach
(
pack
->
{
ProductPriceStepPackagingDO
packagingDO
=
new
ProductPriceStepPackagingDO
();
BeanUtils
.
copyProperties
(
pack
,
packagingDO
);
stepPackagingDOS
.
add
(
packagingDO
);
});
stepPackagingDOS
.
stream
().
distinct
();
clear
.
setPackagingList
(
stepPackagingDOS
);
}
clearancePriceStepList
.
add
(
clear
);
createReqVO
.
setClearancePriceStepList
(
clearancePriceStepList
);
}
else
{
// if (CollectionUtil.isEmpty(respVO.getClearancePriceStepList())) {
// BeanUtils.copyProperties(price, clear);
// clear.setStartNum(BigDecimal.valueOf(0));
// clear.setEndNum(BigDecimal.valueOf(0));
// clear.setRankNum(2);
// clear.setWeightUnit(price.getClearancePriceUnit());
// clear.setProductPriceId(price.getId());
//
// if (CollectionUtil.isNotEmpty(respVO.getClearancePricePackagingList())) {
// List<ProductPriceStepPackagingDO> stepPackagingDOS = new ArrayList<>();
// respVO.getClearancePricePackagingList().forEach(pack -> {
// ProductPriceStepPackagingDO packagingDO = new ProductPriceStepPackagingDO();
// BeanUtils.copyProperties(pack, packagingDO);
// stepPackagingDOS.add(packagingDO);
// });
// stepPackagingDOS.stream().distinct();
// clear.setPackagingList(stepPackagingDOS);
// }
//
// clearancePriceStepList.add(clear);
// createReqVO.setClearancePriceStepList(clearancePriceStepList);
// } else {
// createReqVO.setClearancePriceStepList(respVO.getClearancePriceStepList());
// }
if
(
CollectionUtil
.
isNotEmpty
(
respVO
.
getClearancePriceStepList
()))
{
createReqVO
.
setClearancePriceStepList
(
respVO
.
getClearancePriceStepList
());
}
}
...
...
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