Commit 8359cc80 authored by liuzeheng's avatar liuzeheng

复制价格调整

parent 7712ef74
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;
} }
...@@ -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);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment