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
910207c2
Commit
910207c2
authored
Aug 20, 2024
by
332784038@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
复制价格业务重构
parent
58df3636
Changes
1
Show 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 @
910207c2
...
@@ -3448,8 +3448,6 @@ public class ProductPriceServiceImpl extends AbstractService<ProductPriceMapper,
...
@@ -3448,8 +3448,6 @@ public class ProductPriceServiceImpl extends AbstractService<ProductPriceMapper,
if
(
productPriceDOList
.
size
()
>
0
)
{
if
(
productPriceDOList
.
size
()
>
0
)
{
for
(
ProductPriceDO
price
:
productPriceDOList
)
{
for
(
ProductPriceDO
price
:
productPriceDOList
)
{
ProductPriceAirCreateReqVO
createReqVO
=
new
ProductPriceAirCreateReqVO
();
ProductPriceAirCreateReqVO
createReqVO
=
new
ProductPriceAirCreateReqVO
();
BeanUtils
.
copyProperties
(
price
,
createReqVO
);
BeanUtils
.
copyProperties
(
price
,
createReqVO
);
createReqVO
.
setProductId
(
Long
.
parseLong
(
dto
.
getProductId
()));
createReqVO
.
setProductId
(
Long
.
parseLong
(
dto
.
getProductId
()));
...
@@ -3469,24 +3467,17 @@ public class ProductPriceServiceImpl extends AbstractService<ProductPriceMapper,
...
@@ -3469,24 +3467,17 @@ public class ProductPriceServiceImpl extends AbstractService<ProductPriceMapper,
ProductPriceStepDO
freightPriceStep
=
new
ProductPriceStepDO
();
ProductPriceStepDO
freightPriceStep
=
new
ProductPriceStepDO
();
ProductPriceStepDO
clear
=
new
ProductPriceStepDO
();
ProductPriceStepDO
clear
=
new
ProductPriceStepDO
();
if
(
createReqVO
.
getPriceType
()
==
1
)
{
if
(
createReqVO
.
getPriceType
()
==
1
)
{
if
(
CollectionUtil
.
isNotEmpty
(
respVO
.
getFullPricePackagingList
()))
{
if
(
CollectionUtil
.
isNotEmpty
(
respVO
.
getFullPriceStepList
()))
{
List
<
ProductPriceStepPackagingDO
>
packagingList
=
new
ArrayList
<>();
respVO
.
getFullPriceStepList
().
forEach
(
pack
->
{
respVO
.
getFullPricePackagingList
().
forEach
(
pack
->
{
ProductPriceStepDO
priceStepDO
=
new
ProductPriceStepDO
();
BeanUtils
.
copyProperties
(
pack
,
priceStepDO
);
createReqVO
.
setFreightPriceStepList
(
respVO
.
getFreightPriceStepList
());
priceStepDO
.
setId
(
null
);
priceStepDO
.
setStartNum
(
BigDecimal
.
valueOf
(
0
));
ProductPriceStepDO
packagingDO
=
new
ProductPriceStepDO
();
priceStepDO
.
setEndNum
(
BigDecimal
.
valueOf
(
0
));
BeanUtils
.
copyProperties
(
pack
,
packagingDO
);
priceStepDO
.
setWeightUnit
(
price
.
getTransportPriceUnit
());
packagingDO
.
setId
(
null
);
priceStepDO
.
setAllPrice
(
respVO
.
getAllPrice
());
packagingDO
.
setStartNum
(
BigDecimal
.
valueOf
(
0
));
priceStepDO
.
setAllPriceUnit
(
respVO
.
getAllPriceUnit
());
packagingDO
.
setEndNum
(
BigDecimal
.
valueOf
(
0
));
priceStepDO
.
setAllVolumeUnit
(
respVO
.
getAllVolumeUnit
());
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
.
getSpecialList
()))
{
if
(
CollectionUtil
.
isNotEmpty
(
respVO
.
getSpecialList
()))
{
List
<
ProductPriceStepSpecialDO
>
specialList
=
new
ArrayList
<>();
List
<
ProductPriceStepSpecialDO
>
specialList
=
new
ArrayList
<>();
respVO
.
getSpecialList
().
forEach
(
sp
->
{
respVO
.
getSpecialList
().
forEach
(
sp
->
{
...
@@ -3495,94 +3486,93 @@ public class ProductPriceServiceImpl extends AbstractService<ProductPriceMapper,
...
@@ -3495,94 +3486,93 @@ public class ProductPriceServiceImpl extends AbstractService<ProductPriceMapper,
specialDO
.
setId
(
null
);
specialDO
.
setId
(
null
);
specialList
.
add
(
specialDO
);
specialList
.
add
(
specialDO
);
});
});
p
ackaging
DO
.
setSpecialList
(
specialList
);
p
riceStep
DO
.
setSpecialList
(
specialList
);
}
}
fullPriceStepList
.
add
(
priceStepDO
);
ProductPriceStepPackagingDO
stepPackagingDO
=
new
ProductPriceStepPackagingDO
();
BeanUtils
.
copyProperties
(
pack
,
stepPackagingDO
);
packagingList
.
add
(
stepPackagingDO
);
packagingDO
.
setPackagingList
(
packagingList
);
fullPriceStepList
.
add
(
packagingDO
);
});
});
createReqVO
.
setFullPriceStepList
(
fullPriceStepList
);
createReqVO
.
setFullPriceStepList
(
fullPriceStepList
);
}
}
}
else
{
}
else
{
if
(
CollectionUtil
.
isEmpty
(
respVO
.
getFreightPriceStepList
()))
{
// if (CollectionUtil.isEmpty(respVO.getFreightPriceStepList())) {
BeanUtils
.
copyProperties
(
price
,
freightPriceStep
);
// BeanUtils.copyProperties(price, freightPriceStep);
freightPriceStep
.
setStartNum
(
BigDecimal
.
valueOf
(
0
));
// freightPriceStep.setStartNum(BigDecimal.valueOf(0));
freightPriceStep
.
setEndNum
(
BigDecimal
.
valueOf
(
0
));
// freightPriceStep.setEndNum(BigDecimal.valueOf(0));
freightPriceStep
.
setRankNum
(
1
);
// freightPriceStep.setRankNum(1);
freightPriceStep
.
setWeightUnit
(
price
.
getTransportPriceUnit
());
// freightPriceStep.setWeightUnit(price.getTransportPriceUnit());
freightPriceStep
.
setProductPriceId
(
price
.
getId
());
// freightPriceStep.setProductPriceId(price.getId());
if
(
CollectionUtil
.
isNotEmpty
(
respVO
.
getSpecialList
()))
{
// if (CollectionUtil.isNotEmpty(respVO.getSpecialList())) {
List
<
ProductPriceStepSpecialDO
>
specialDOList
=
new
ArrayList
<>();
// List<ProductPriceStepSpecialDO> specialDOList = new ArrayList<>();
respVO
.
getSpecialList
().
forEach
(
sp
->
{
// respVO.getSpecialList().forEach(sp -> {
ProductPriceStepSpecialDO
d
=
new
ProductPriceStepSpecialDO
();
// ProductPriceStepSpecialDO d = new ProductPriceStepSpecialDO();
BeanUtils
.
copyProperties
(
sp
,
d
);
// BeanUtils.copyProperties(sp, d);
specialDOList
.
add
(
d
);
// specialDOList.add(d);
});
// });
specialDOList
.
stream
().
distinct
();
// specialDOList.stream().distinct();
freightPriceStep
.
setSpecialList
(
specialDOList
);
// freightPriceStep.setSpecialList(specialDOList);
}
// }
//
// //
if
(
CollectionUtil
.
isNotEmpty
(
respVO
.
getFreightPricePackagingList
()))
{
// if (CollectionUtil.isNotEmpty(respVO.getFreightPricePackagingList())) {
List
<
ProductPriceStepPackagingDO
>
stepPackagingDOS
=
new
ArrayList
<>();
// List<ProductPriceStepPackagingDO> stepPackagingDOS = new ArrayList<>();
respVO
.
getFreightPricePackagingList
().
forEach
(
pack
->
{
// respVO.getFreightPricePackagingList().forEach(pack -> {
ProductPriceStepPackagingDO
packagingDO
=
new
ProductPriceStepPackagingDO
();
// ProductPriceStepPackagingDO packagingDO = new ProductPriceStepPackagingDO();
BeanUtils
.
copyProperties
(
pack
,
packagingDO
);
// BeanUtils.copyProperties(pack, packagingDO);
stepPackagingDOS
.
add
(
packagingDO
);
// stepPackagingDOS.add(packagingDO);
});
// });
stepPackagingDOS
.
stream
().
distinct
();
// stepPackagingDOS.stream().distinct();
freightPriceStep
.
setPackagingList
(
stepPackagingDOS
);
// freightPriceStep.setPackagingList(stepPackagingDOS);
}
// }
if
(
respVO
.
getPriceType
()
==
1
)
{
// if (respVO.getPriceType() == 1) {
if
(
CollectionUtil
.
isNotEmpty
(
respVO
.
getFullPricePackagingList
()))
{
// if (CollectionUtil.isNotEmpty(respVO.getFullPricePackagingList())) {
List
<
ProductPriceStepPackagingDO
>
specialDOList
=
new
ArrayList
<>();
// List<ProductPriceStepPackagingDO> specialDOList = new ArrayList<>();
respVO
.
getFullPricePackagingList
().
forEach
(
pack
->
{
// respVO.getFullPricePackagingList().forEach(pack -> {
ProductPriceStepPackagingDO
packagingDO
=
new
ProductPriceStepPackagingDO
();
// ProductPriceStepPackagingDO packagingDO = new ProductPriceStepPackagingDO();
BeanUtils
.
copyProperties
(
pack
,
packagingDO
);
// BeanUtils.copyProperties(pack, packagingDO);
packagingDO
.
setId
(
null
);
// packagingDO.setId(null);
//
specialDOList
.
add
(
packagingDO
);
// specialDOList.add(packagingDO);
});
// });
//
freightPriceStep
.
setPackagingList
(
specialDOList
);
// freightPriceStep.setPackagingList(specialDOList);
//
}
// }
}
else
{
// } else {
//
}
// }
freightPriceStepList
.
add
(
freightPriceStep
);
// freightPriceStepList.add(freightPriceStep);
//
createReqVO
.
setFreightPriceStepList
(
freightPriceStepList
);
// createReqVO.setFreightPriceStepList(freightPriceStepList);
}
else
{
// } else {
// createReqVO.setFreightPriceStepList(respVO.getFreightPriceStepList());
// }
if
(
CollectionUtil
.
isNotEmpty
(
respVO
.
getFreightPriceStepList
()))
{
createReqVO
.
setFreightPriceStepList
(
respVO
.
getFreightPriceStepList
());
createReqVO
.
setFreightPriceStepList
(
respVO
.
getFreightPriceStepList
());
}
}
// if (CollectionUtil.isEmpty(respVO.getClearancePriceStepList())) {
if
(
CollectionUtil
.
isEmpty
(
respVO
.
getClearancePriceStepList
()))
{
// BeanUtils.copyProperties(price, clear);
BeanUtils
.
copyProperties
(
price
,
clear
);
// clear.setStartNum(BigDecimal.valueOf(0));
clear
.
setStartNum
(
BigDecimal
.
valueOf
(
0
));
// clear.setEndNum(BigDecimal.valueOf(0));
clear
.
setEndNum
(
BigDecimal
.
valueOf
(
0
));
// clear.setRankNum(2);
clear
.
setRankNum
(
2
);
// clear.setWeightUnit(price.getClearancePriceUnit());
clear
.
setWeightUnit
(
price
.
getClearancePriceUnit
());
// clear.setProductPriceId(price.getId());
clear
.
setProductPriceId
(
price
.
getId
());
//
// if (CollectionUtil.isNotEmpty(respVO.getClearancePricePackagingList())) {
if
(
CollectionUtil
.
isNotEmpty
(
respVO
.
getClearancePricePackagingList
()))
{
// List<ProductPriceStepPackagingDO> stepPackagingDOS = new ArrayList<>();
List
<
ProductPriceStepPackagingDO
>
stepPackagingDOS
=
new
ArrayList
<>();
// respVO.getClearancePricePackagingList().forEach(pack -> {
respVO
.
getClearancePricePackagingList
().
forEach
(
pack
->
{
// ProductPriceStepPackagingDO packagingDO = new ProductPriceStepPackagingDO();
ProductPriceStepPackagingDO
packagingDO
=
new
ProductPriceStepPackagingDO
();
// BeanUtils.copyProperties(pack, packagingDO);
BeanUtils
.
copyProperties
(
pack
,
packagingDO
);
// stepPackagingDOS.add(packagingDO);
stepPackagingDOS
.
add
(
packagingDO
);
// });
});
// stepPackagingDOS.stream().distinct();
stepPackagingDOS
.
stream
().
distinct
();
// clear.setPackagingList(stepPackagingDOS);
clear
.
setPackagingList
(
stepPackagingDOS
);
// }
}
//
// clearancePriceStepList.add(clear);
clearancePriceStepList
.
add
(
clear
);
// createReqVO.setClearancePriceStepList(clearancePriceStepList);
createReqVO
.
setClearancePriceStepList
(
clearancePriceStepList
);
// } else {
}
else
{
// createReqVO.setClearancePriceStepList(respVO.getClearancePriceStepList());
// }
if
(
CollectionUtil
.
isNotEmpty
(
respVO
.
getClearancePriceStepList
()))
{
createReqVO
.
setClearancePriceStepList
(
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