商品添加规格问题下修复

This commit is contained in:
liyj 2025-07-12 10:20:52 +08:00
parent a16e8e4c42
commit 2eeb79f139
2 changed files with 31 additions and 33 deletions

View File

@ -133,10 +133,9 @@ public class ShopBaseProductBrandServiceImpl extends BaseServiceImpl<ShopBasePro
store_id = Convert.toInt(user.getStore_id()); store_id = Convert.toInt(user.getStore_id());
isPlatform = getCurrentUser().isPlatform(); isPlatform = getCurrentUser().isPlatform();
} }
shopBaseProductBrand.setBrand_apply(1);//申请通过
if (ObjectUtil.isEmpty(shopBaseProductBrand.getBrand_id())) { if (ObjectUtil.isEmpty(shopBaseProductBrand.getBrand_id())) {
if (!isPlatform) { if (!isPlatform) {
shopBaseProductBrand.setBrand_apply(0);
shopBaseProductBrand.setStore_id(store_id); shopBaseProductBrand.setStore_id(store_id);
} }
} }

View File

@ -745,7 +745,6 @@ public class ShopProductBaseServiceImpl extends BaseServiceImpl<ShopProductBaseM
} else { } else {
shopProductBase.setProduct_id(productId); shopProductBase.setProduct_id(productId);
} }
// begin 新增判断发布商品数量是否超限 // begin 新增判断发布商品数量是否超限
Integer store_grade_id = storeBase.getStore_grade_id(); Integer store_grade_id = storeBase.getStore_grade_id();
ShopBaseStoreGrade store_grade_row = baseStoreGradeService.get(store_grade_id); ShopBaseStoreGrade store_grade_row = baseStoreGradeService.get(store_grade_id);
@ -773,7 +772,7 @@ public class ShopProductBaseServiceImpl extends BaseServiceImpl<ShopProductBaseM
isUpdate = true; isUpdate = true;
} }
} }
shopProductBase.setProduct_src_id(productId);
if (verify_type) { if (verify_type) {
shopProductBase.setProduct_verify_id(StateCode.PRODUCT_VERIFY_WAITING); shopProductBase.setProduct_verify_id(StateCode.PRODUCT_VERIFY_WAITING);
} else { } else {
@ -1032,7 +1031,7 @@ public class ShopProductBaseServiceImpl extends BaseServiceImpl<ShopProductBaseM
} }
item_row.setItem_id(item_id); item_row.setItem_id(item_id);
item_row.setItem_src_id(String.valueOf(item_id));
// 修正默认价格 防止出现不合理价格 // 修正默认价格 防止出现不合理价格
BigDecimal item_platform_price = NumberUtil.max(item_row.getItem_cost_price(), item_row.getItem_platform_price()); BigDecimal item_platform_price = NumberUtil.max(item_row.getItem_cost_price(), item_row.getItem_platform_price());
BigDecimal _item_unit_price = NumberUtil.max(item_row.getItem_unit_price(), item_row.getItem_platform_price()); BigDecimal _item_unit_price = NumberUtil.max(item_row.getItem_unit_price(), item_row.getItem_platform_price());
@ -1066,34 +1065,34 @@ public class ShopProductBaseServiceImpl extends BaseServiceImpl<ShopProductBaseM
List<Serializable> item_ids_all = (List<Serializable>) CollUtil.union(item_ids_new, item_ids_old); List<Serializable> item_ids_all = (List<Serializable>) CollUtil.union(item_ids_new, item_ids_old);
List<Serializable> item_ids_deprecate = (List<Serializable>) CollUtil.disjunction(item_ids_all, item_ids_new); List<Serializable> item_ids_deprecate = (List<Serializable>) CollUtil.disjunction(item_ids_all, item_ids_new);
//start 清理sku相关数据 //start 清理sku相关数据 根据前端规则不做处理
if (CollUtil.isNotEmpty(item_ids_deprecate)) { // if (CollUtil.isNotEmpty(item_ids_deprecate)) {
QueryWrapper<ShopUserCart> cartQueryWrapper = new QueryWrapper<>(); // QueryWrapper<ShopUserCart> cartQueryWrapper = new QueryWrapper<>();
cartQueryWrapper.in("item_id", item_ids_deprecate); // cartQueryWrapper.in("item_id", item_ids_deprecate);
List<ShopUserCart> shopUserCarts=shopUserCartService.list(cartQueryWrapper); // List<ShopUserCart> shopUserCarts=shopUserCartService.list(cartQueryWrapper);
List<Integer> shopUserCartIds=shopUserCarts.stream().map(ShopUserCart::getCart_id).collect(Collectors.toList()); // List<Integer> shopUserCartIds=shopUserCarts.stream().map(ShopUserCart::getCart_id).collect(Collectors.toList());
if(CollectionUtil.isNotEmpty(shopUserCarts)){ // if(CollectionUtil.isNotEmpty(shopUserCarts)){
shopUserCartService.removeBatchByIds(shopUserCartIds); // shopUserCartService.removeBatchByIds(shopUserCartIds);
} // }
//
QueryWrapper<ShopProductItemSeq> seqQueryWrapper = new QueryWrapper<>(); // QueryWrapper<ShopProductItemSeq> seqQueryWrapper = new QueryWrapper<>();
seqQueryWrapper.in("item_id", item_ids_deprecate); // seqQueryWrapper.in("item_id", item_ids_deprecate);
List<ShopProductItemSeq> shopProductItemSeqs=shopProductItemSeqService.list(seqQueryWrapper); // List<ShopProductItemSeq> shopProductItemSeqs=shopProductItemSeqService.list(seqQueryWrapper);
List<String> shopProductItemSeqIds=shopProductItemSeqs.stream().map(ShopProductItemSeq::getProduct_item_seq_id).collect(Collectors.toList()); // List<String> shopProductItemSeqIds=shopProductItemSeqs.stream().map(ShopProductItemSeq::getProduct_item_seq_id).collect(Collectors.toList());
if(CollectionUtil.isNotEmpty(shopProductItemSeqIds)) { // if(CollectionUtil.isNotEmpty(shopProductItemSeqIds)) {
shopProductItemSeqService.removeBatchByIds(shopProductItemSeqIds); // shopProductItemSeqService.removeBatchByIds(shopProductItemSeqIds);
} // }
QueryWrapper<ShopStoreActivityItem> activityItemQueryWrapper = new QueryWrapper<>(); // QueryWrapper<ShopStoreActivityItem> activityItemQueryWrapper = new QueryWrapper<>();
activityItemQueryWrapper.in("item_id", item_ids_deprecate); // activityItemQueryWrapper.in("item_id", item_ids_deprecate);
List<ShopStoreActivityItem> shopStoreActivityItems= shopStoreActivityItemService.list(activityItemQueryWrapper); // List<ShopStoreActivityItem> shopStoreActivityItems= shopStoreActivityItemService.list(activityItemQueryWrapper);
List<Long> shopStoreActivityItemIds=shopStoreActivityItems.stream().map(ShopStoreActivityItem::getActivity_item_id).collect(Collectors.toList()); // List<Long> shopStoreActivityItemIds=shopStoreActivityItems.stream().map(ShopStoreActivityItem::getActivity_item_id).collect(Collectors.toList());
if(CollectionUtil.isNotEmpty(shopStoreActivityItemIds)) { // if(CollectionUtil.isNotEmpty(shopStoreActivityItemIds)) {
shopStoreActivityItemService.removeBatchByIds(shopStoreActivityItemIds); // shopStoreActivityItemService.removeBatchByIds(shopStoreActivityItemIds);
} // }
if (!shopProductItemService.remove(item_ids_deprecate)) { // if (!shopProductItemService.remove(item_ids_deprecate)) {
return Pair.of(false, I18nUtil._("删除废弃sku失败")); // return Pair.of(false, I18nUtil._("删除废弃sku失败"));
} // }
} // }
//end 清理sku相关数据 //end 清理sku相关数据
// shopProductInfo // shopProductInfo