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
Show 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
;
import
cn.iocoder.yudao.module.product.vo.productPrice.LineChannelVo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.Size
;
import
java.util.List
;
@ApiModel
(
"复制价格入参DTO"
)
@Data
public
class
CopyProductPriceDto
{
...
...
@@ -14,4 +18,8 @@ public class CopyProductPriceDto {
@ApiModelProperty
(
"商品id"
)
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,16 +3306,23 @@ public class ProductPriceServiceImpl extends AbstractService<ProductPriceMapper,
//列出要复制的商品价格
List
<
ProductPriceDO
>
productPriceDOList
=
this
.
productPriceMapper
.
selectList
(
new
LambdaQueryWrapper
<
ProductPriceDO
>().
in
(
ProductPriceDO:
:
getId
,
ids
));
if
(
productPriceDOList
.
size
()>
0
){
productPriceDOList
.
forEach
(
p
->{
ProductPriceAirCreateReqVO
createReqVO
=
new
ProductPriceAirCreateReqVO
()
;
BeanUtils
.
copyProperties
(
p
,
createReqVO
);
createReqVO
.
setProductId
(
Long
.
parseLong
(
dto
.
getProductId
())
);
List
<
LineChannelVo
>
lineChannelList
=
createReqVO
.
getLineChannelList
();
ProductDO
productDO
=
checkUpdateStatus
(
lineChannelList
,
createReqVO
.
getProductId
());
LineChannelVo
vo
=
new
LineChannelVo
();
vo
.
setShippingChannelId
(
p
.
getShippingChannelId
());
vo
.
setLineId
(
p
.
getWarehouseLineId
());
List
<
LineChannelVo
>
lineChannelList
=
new
ArrayList
<>();
lineChannelList
.
add
(
vo
);
createReqVO
.
setLineChannelList
(
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
);
...
...
@@ -3323,6 +3330,9 @@ public class ProductPriceServiceImpl extends AbstractService<ProductPriceMapper,
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