Commit 8359cc80 authored by liuzeheng's avatar liuzeheng

复制价格调整

parent 7712ef74
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;
}
......@@ -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);
});
}
}
......
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