Commit 606d1647 by 崔彦峰

fix(goods): 修复商品套餐类型的礼品成本设置问题

- 在商品基础服务中为套餐类型设置默认的礼品成本值
- 更新商品提交服务中的礼品成本逻辑以正确处理套餐产品
- 修正套餐产品的礼品成本字段映射避免数据不一致问题
1 parent fc007318
...@@ -473,8 +473,10 @@ public class GoodsListingProductBaseService { ...@@ -473,8 +473,10 @@ public class GoodsListingProductBaseService {
record.setPackageCode(oldRecord.getPackageCode()); record.setPackageCode(oldRecord.getPackageCode());
goodsListingProductBaseMapper.updateByPrimaryKey(record); goodsListingProductBaseMapper.updateByPrimaryKey(record);
}else{ }else{
record.setIsGiftCost(StatusEnum.YES.getValue());
if(Objects.equals(record.getProductType(), ProductTypeEnum.PACKAGE.getValue())) { if(Objects.equals(record.getProductType(), ProductTypeEnum.PACKAGE.getValue())) {
record.setPackageCode(createPackageCode()); record.setPackageCode(createPackageCode());
record.setIsGiftCost(StatusEnum.NO.getValue());
} }
record.setCreatedDate(record.getUpdatedDate()); record.setCreatedDate(record.getUpdatedDate());
record.setCreatedBy(record.getUpdatedBy()); record.setCreatedBy(record.getUpdatedBy());
......
...@@ -2933,8 +2933,8 @@ public class GoodsListingSubmitService { ...@@ -2933,8 +2933,8 @@ public class GoodsListingSubmitService {
.packageCode(product.getPackageCode()) .packageCode(product.getPackageCode())
.shelfStyle(product.getShelfStyle()) .shelfStyle(product.getShelfStyle())
.oldMerchantGoodsCode(product.getOldMerchantGoodsCode()) .oldMerchantGoodsCode(product.getOldMerchantGoodsCode())
// 基础表字段是 Y/N 存储,这里不能直接落“是/否”,否则和表结构定义不一致。 // 基础表字段是 Y/N 存储,这里不能直接落“是/否”,否则和表结构定义不一致。 套餐为N
.isGiftCost(toYN(product.getIsGiftCost())) .isGiftCost(Objects.equals(product.getProductType().intValue(), 1) ? toYN(product.getIsGiftCost()) : "N")
.salesProportionPercent(null) .salesProportionPercent(null)
.integrity(defaultIfBlank(product.getIntegrity(), "Y")) .integrity(defaultIfBlank(product.getIntegrity(), "Y"))
.build(); .build();
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!