批量规格匹配规格错乱数据优化

This commit is contained in:
liyj 2025-07-31 15:28:07 +08:00
parent 1ed6cef902
commit b8f2c85cb0

View File

@ -288,7 +288,7 @@ public class ProductMappingServiceImpl extends BaseServiceImpl<ProductMappingMap
item.setItem_spec(item_spec);
shopProductInfo.setProduct_spec(productSpec);
}
String product_uniqid=ShopJsonUtils.generateJsonWithOrgJson(item.getSpec_item_ids(),new Object[]{item.getItem_id(),item.getItem_unit_price(),"",item.getItem_enable()});
String product_uniqid=ShopJsonUtils.generateJsonWithOrgJson(item.getSpec_item_ids(),new Object[]{item.getItem_id(),item.getItem_unit_price(),"","1001"});
shopProductInfo.setProduct_uniqid(product_uniqid);
}
@ -311,6 +311,7 @@ public class ProductMappingServiceImpl extends BaseServiceImpl<ProductMappingMap
query.or(q -> q.eq("store_id", base.getStore_id())
.eq("product_id", base.getProduct_id()));
});
query.orderByAsc("product_id");
return shopProductItemService.list(query);
}
@ -332,6 +333,7 @@ public class ProductMappingServiceImpl extends BaseServiceImpl<ProductMappingMap
shopProductBaseList.forEach(base -> {
query.or(q -> q.eq("product_id", base.getProduct_id()));
});
query.orderByAsc("product_id");
return shopProductInfoService.list(query);
}
@ -411,6 +413,8 @@ public class ProductMappingServiceImpl extends BaseServiceImpl<ProductMappingMap
QueryWrapper<ShopProductBase> queryWrapper= new QueryWrapper<>();
queryWrapper.eq("product_state_id", StateCode.PRODUCT_STATE_OFF_THE_SHELF_UNCHECK);
queryWrapper.eq("store_id", storeId);
queryWrapper.gt("unit_price", BigDecimal.ZERO);
queryWrapper.orderByAsc("product_id");
long total=shopProductBaseService.count(queryWrapper);
int pages= CommonUtil.getPagesCount(Math.toIntExact(total),SHOPBASEPAGE);