商品映射问题修复

This commit is contained in:
liyj 2025-07-09 17:23:07 +08:00
parent 5449540541
commit 2329a017b2
4 changed files with 13 additions and 6 deletions

View File

@ -10,6 +10,7 @@ import com.suisung.mall.common.modules.base.ShopBaseProductType;
import com.suisung.mall.common.modules.product.ShopProductBase; import com.suisung.mall.common.modules.product.ShopProductBase;
import com.suisung.mall.common.modules.product.ShopProductIndex; import com.suisung.mall.common.modules.product.ShopProductIndex;
import com.suisung.mall.common.utils.CheckUtil; import com.suisung.mall.common.utils.CheckUtil;
import com.suisung.mall.common.utils.ContextUtil;
import com.suisung.mall.common.utils.I18nUtil; import com.suisung.mall.common.utils.I18nUtil;
import com.suisung.mall.common.utils.UserInfoService; import com.suisung.mall.common.utils.UserInfoService;
import com.suisung.mall.core.web.service.impl.BaseServiceImpl; import com.suisung.mall.core.web.service.impl.BaseServiceImpl;
@ -80,7 +81,11 @@ public class ShopBaseProductTypeServiceImpl extends BaseServiceImpl<ShopBaseProd
@Override @Override
public Map getType(String type_id) { public Map getType(String type_id) {
ShopBaseProductType shopBaseProductType = get(type_id); String storeId = ContextUtil.getCurrentUser().getStore_id();
QueryWrapper<ShopBaseProductType> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type_id", type_id);
queryWrapper.eq("store_id", storeId);
ShopBaseProductType shopBaseProductType = findOne(queryWrapper);
Map data = new HashMap(); Map data = new HashMap();
data.put("assists", assistService.getAssistsByIds(shopBaseProductType.getType_assist_ids())); data.put("assists", assistService.getAssistsByIds(shopBaseProductType.getType_assist_ids()));
data.put("brands", brandService.getBrandsByIds(shopBaseProductType.getType_brand_ids())); data.put("brands", brandService.getBrandsByIds(shopBaseProductType.getType_brand_ids()));

View File

@ -196,8 +196,8 @@ public class ProductMappingController extends BaseControllerImpl {
*/ */
@ApiOperation(value = "查找为同步的商品数据", notes = "删除查找为同步的商品数据") @ApiOperation(value = "查找为同步的商品数据", notes = "删除查找为同步的商品数据")
@RequestMapping(value = "/getSyncBaseMapingProducts", method = RequestMethod.GET) @RequestMapping(value = "/getSyncBaseMapingProducts", method = RequestMethod.GET)
public CommonResult getSyncBaseMapingProducts() { public CommonResult getSyncBaseMapingProducts(Integer storeId) {
return productMappingService.getSyncProductUnchecked(); return productMappingService.getSyncProductUnchecked(storeId);
} }
/** /**

View File

@ -21,7 +21,7 @@ public interface ProductMappingService extends IBaseService<ProductMapping> {
CommonResult syncAllProductMapping(); CommonResult syncAllProductMapping();
CommonResult getSyncProductUnchecked(); CommonResult getSyncProductUnchecked(Integer storeId);
// 下载导入模板 // 下载导入模板
void downloadTemplate(HttpServletResponse response); void downloadTemplate(HttpServletResponse response);

View File

@ -422,8 +422,10 @@ public class ProductMappingServiceImpl extends BaseServiceImpl<ProductMappingMap
} }
@Override @Override
public CommonResult getSyncProductUnchecked() { public CommonResult getSyncProductUnchecked(Integer storeId) {
Integer storeId= Integer.valueOf(Objects.requireNonNull(ContextUtil.getCurrentUser()).getStore_id()); if(ObjectUtil.isNull(storeId)){
storeId= Integer.valueOf(Objects.requireNonNull(ContextUtil.getCurrentUser()).getStore_id());
}
//找出范围内的规格产品 //找出范围内的规格产品
QueryWrapper<ShopProductBase> queryWrapper= new QueryWrapper<>(); QueryWrapper<ShopProductBase> queryWrapper= new QueryWrapper<>();
queryWrapper.eq("product_state_id", StateCode.PRODUCT_STATE_OFF_THE_SHELF_UNCHECK); queryWrapper.eq("product_state_id", StateCode.PRODUCT_STATE_OFF_THE_SHELF_UNCHECK);