diff --git a/mall-admin/src/main/java/com/macro/mall/service/impl/PmsProductServiceImpl.java b/mall-admin/src/main/java/com/macro/mall/service/impl/PmsProductServiceImpl.java index 48c08cb..f348b5b 100644 --- a/mall-admin/src/main/java/com/macro/mall/service/impl/PmsProductServiceImpl.java +++ b/mall-admin/src/main/java/com/macro/mall/service/impl/PmsProductServiceImpl.java @@ -17,6 +17,7 @@ import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; import java.lang.reflect.Method; +import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -78,6 +79,8 @@ public class PmsProductServiceImpl implements PmsProductService { relateAndInsertList(productLadderDao, productParam.getProductLadderList(), productId); //满减价格 relateAndInsertList(productFullReductionDao, productParam.getProductFullReductionList(), productId); + //处理sku的编码 + handleSkuStockCode(productParam.getSkuStockList(),productId); //添加sku库存信息 relateAndInsertList(skuStockDao, productParam.getSkuStockList(), productId); //添加商品参数,添加自定义商品规格 @@ -90,6 +93,24 @@ public class PmsProductServiceImpl implements PmsProductService { return count; } + private void handleSkuStockCode(List skuStockList, Long productId) { + if(CollectionUtils.isEmpty(skuStockList))return; + for(int i=0;i - INSERT INTO pms_member_price (product_id, member_level_id, member_price) VALUES + INSERT INTO pms_member_price (product_id, member_level_id, member_price,member_level_name) VALUES (#{item.productId,jdbcType=BIGINT}, #{item.memberLevelId,jdbcType=BIGINT}, - #{item.memberPrice,jdbcType=DECIMAL}) + #{item.memberPrice,jdbcType=DECIMAL}, + #{item.memberLevelName,jdbcType=VARCHAR}) \ No newline at end of file