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
8359cc80
Commit
8359cc80
authored
Apr 24, 2024
by
liuzeheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
复制价格调整
parent
7712ef74
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
16 deletions
+34
-16
CopyProductPriceDto.java
...iocoder/yudao/module/product/dto/CopyProductPriceDto.java
+8
-0
ProductPriceServiceImpl.java
...product/service/product/impl/ProductPriceServiceImpl.java
+26
-16
No files found.
yudao-module-product/yudao-module-product-core/src/main/java/cn/iocoder/yudao/module/product/dto/CopyProductPriceDto.java
View file @
8359cc80
package
cn
.
iocoder
.
yudao
.
module
.
product
.
dto
;
package
cn
.
iocoder
.
yudao
.
module
.
product
.
dto
;
import
cn.iocoder.yudao.module.product.vo.productPrice.LineChannelVo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
javax.validation.constraints.Size
;
import
java.util.List
;
@ApiModel
(
"复制价格入参DTO"
)
@ApiModel
(
"复制价格入参DTO"
)
@Data
@Data
public
class
CopyProductPriceDto
{
public
class
CopyProductPriceDto
{
...
@@ -14,4 +18,8 @@ public class CopyProductPriceDto {
...
@@ -14,4 +18,8 @@ public class CopyProductPriceDto {
@ApiModelProperty
(
"商品id"
)
@ApiModelProperty
(
"商品id"
)
private
String
productId
;
private
String
productId
;
@ApiModelProperty
(
value
=
"线路渠道列表"
,
required
=
true
)
@Size
(
min
=
1
)
private
List
<
LineChannelVo
>
lineChannelList
;
}
}
yudao-module-product/yudao-module-product-core/src/main/java/cn/iocoder/yudao/module/product/service/product/impl/ProductPriceServiceImpl.java
View file @
8359cc80
...
@@ -3306,23 +3306,33 @@ public class ProductPriceServiceImpl extends AbstractService<ProductPriceMapper,
...
@@ -3306,23 +3306,33 @@ public class ProductPriceServiceImpl extends AbstractService<ProductPriceMapper,
//列出要复制的商品价格
//列出要复制的商品价格
List
<
ProductPriceDO
>
productPriceDOList
=
this
.
productPriceMapper
.
selectList
(
new
LambdaQueryWrapper
<
ProductPriceDO
>().
in
(
ProductPriceDO:
:
getId
,
ids
));
List
<
ProductPriceDO
>
productPriceDOList
=
this
.
productPriceMapper
.
selectList
(
new
LambdaQueryWrapper
<
ProductPriceDO
>().
in
(
ProductPriceDO:
:
getId
,
ids
));
ProductPriceAirCreateReqVO
createReqVO
=
new
ProductPriceAirCreateReqVO
()
;
if
(
productPriceDOList
.
size
()>
0
){
createReqVO
.
setProductId
(
Long
.
parseLong
(
dto
.
getProductId
())
);
productPriceDOList
.
forEach
(
p
->{
List
<
LineChannelVo
>
lineChannelList
=
createReqVO
.
getLineChannelList
();
ProductPriceAirCreateReqVO
createReqVO
=
new
ProductPriceAirCreateReqVO
()
;
ProductDO
productDO
=
checkUpdateStatus
(
lineChannelList
,
createReqVO
.
getProductId
());
BeanUtils
.
copyProperties
(
p
,
createReqVO
);
createReqVO
.
setProductId
(
Long
.
parseLong
(
dto
.
getProductId
())
);
WarehouseLineSearchVO
searchVO
=
new
WarehouseLineSearchVO
();
LineChannelVo
vo
=
new
LineChannelVo
();
List
<
WarehouseLineDO
>
warehouseLineList
=
warehouseService
.
openedRouterList
(
searchVO
);
vo
.
setShippingChannelId
(
p
.
getShippingChannelId
());
vo
.
setLineId
(
p
.
getWarehouseLineId
());
List
<
LineChannelVo
>
lineChannelList
=
new
ArrayList
<>();
List
<
ProductDO
>
productList
=
Collections
.
singletonList
(
productDO
);
lineChannelList
.
add
(
vo
);
//商品线路保存在redis。更新成功后移除
createReqVO
.
setLineChannelList
(
lineChannelList
);
batchSaveKeyInCache
(
productList
,
lineChannelList
);
//ProductDO productDO = checkUpdateStatus(lineChannelList, createReqVO.getProductId());
ProductDO
productDO
=
productService
.
getProduct
(
createReqVO
.
getProductId
());
WarehouseLineSearchVO
searchVO
=
new
WarehouseLineSearchVO
();
List
<
WarehouseLineDO
>
warehouseLineList
=
warehouseService
.
openedRouterList
(
searchVO
);
List
<
ProductDO
>
productList
=
Collections
.
singletonList
(
productDO
);
//商品线路保存在redis。更新成功后移除
batchSaveKeyInCache
(
productList
,
lineChannelList
);
createReqVO
.
setSync
(
true
);
createReqVO
.
setBatch
(
false
);
batchUpdateAir
(
createReqVO
,
warehouseLineList
,
productList
);
});
}
createReqVO
.
setSync
(
true
);
createReqVO
.
setBatch
(
false
);
batchUpdateAir
(
createReqVO
,
warehouseLineList
,
productList
);
}
}
...
...
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