改item_src_id类型为String

This commit is contained in:
liyj 2025-07-04 18:10:35 +08:00
parent e4b6aaac02
commit fac29d5e2e
8 changed files with 23 additions and 21 deletions

View File

@ -161,7 +161,7 @@ public class ShopOrderItem implements Serializable {
private Integer order_item_saler_id; private Integer order_item_saler_id;
@ApiModelProperty(value = "分销商品编号") @ApiModelProperty(value = "分销商品编号")
private Long item_src_id; private String item_src_id;
@ApiModelProperty(value = "拆单同步状态") @ApiModelProperty(value = "拆单同步状态")
private Integer order_item_supplier_sync; private Integer order_item_supplier_sync;

View File

@ -126,7 +126,7 @@ public class ShopProductItem implements Serializable {
private Integer item_freetime; private Integer item_freetime;
@ApiModelProperty(value = "供应商SKU编号") @ApiModelProperty(value = "供应商SKU编号")
private Long item_src_id; private String item_src_id;
@ApiModelProperty(value = "商品分类") @ApiModelProperty(value = "商品分类")
private Integer category_id; private Integer category_id;

View File

@ -2596,8 +2596,8 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl<ShopOrderBaseMappe
Map tmp_filter_order_item = null; Map tmp_filter_order_item = null;
for (Map filter_order_item : filter_order_item_list) { for (Map filter_order_item : filter_order_item_list) {
Long item_src_id = Convert.toLong(filter_order_item.get("item_src_id")); String item_src_id = Convert.toStr(filter_order_item.get("item_src_id"));
Long _item_src_id = Convert.toLong(order_item.get("item_src_id")); String _item_src_id = Convert.toStr(order_item.get("item_src_id"));
if (item_src_id != null && ObjectUtil.equal(item_src_id, _item_src_id)) { if (item_src_id != null && ObjectUtil.equal(item_src_id, _item_src_id)) {
tmp_filter_order_item = filter_order_item; tmp_filter_order_item = filter_order_item;
break; break;
@ -3158,7 +3158,7 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl<ShopOrderBaseMappe
shopStoreAnalyticsService.edit(analytics); shopStoreAnalyticsService.edit(analytics);
Integer order_item_inventory_lock = order_item_row.getOrder_item_inventory_lock(); Integer order_item_inventory_lock = order_item_row.getOrder_item_inventory_lock();
Long item_src_id = order_item_row.getItem_src_id(); String item_src_id = order_item_row.getItem_src_id();
if (ObjectUtil.equal(1002, order_item_inventory_lock) && CheckUtil.isEmpty(item_src_id)) { if (ObjectUtil.equal(1002, order_item_inventory_lock) && CheckUtil.isEmpty(item_src_id)) {
Long item_id = order_item_row.getItem_id(); Long item_id = order_item_row.getItem_id();
if (shopProductItemService.lockSkuStock(item_id, order_item_row.getOrder_item_quantity()) <= 0) { if (shopProductItemService.lockSkuStock(item_id, order_item_row.getOrder_item_quantity()) <= 0) {
@ -4911,7 +4911,7 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl<ShopOrderBaseMappe
List<ShopProductItem> product_item_rows = shopProductItemService.find(productItemQueryWrapper); List<ShopProductItem> product_item_rows = shopProductItemService.find(productItemQueryWrapper);
for (ShopProductItem product_item_row : product_item_rows) { for (ShopProductItem product_item_row : product_item_rows) {
Long item_src_id = product_item_row.getItem_src_id(); String item_src_id = product_item_row.getItem_src_id();
Optional<ShopOrderItem> orderItemOpl = order_item_rows.stream().filter(s -> ObjectUtil.equal(s.getItem_id(), item_src_id)).findFirst(); Optional<ShopOrderItem> orderItemOpl = order_item_rows.stream().filter(s -> ObjectUtil.equal(s.getItem_id(), item_src_id)).findFirst();
if (orderItemOpl.isPresent()) { if (orderItemOpl.isPresent()) {
ShopOrderItem shopOrderItem = orderItemOpl.get(); ShopOrderItem shopOrderItem = orderItemOpl.get();
@ -5548,7 +5548,7 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl<ShopOrderBaseMappe
// end 剔除已出库/发货的商品 // end 剔除已出库/发货的商品
} }
List<Long> item_src_ids = order_item_rows.stream().map(s -> s.getItem_src_id()).distinct().collect(Collectors.toList()); List<String> item_src_ids = order_item_rows.stream().map(s -> s.getItem_src_id()).distinct().collect(Collectors.toList());
if (CollUtil.isNotEmpty(item_src_ids)) { if (CollUtil.isNotEmpty(item_src_ids)) {
List item_rows = new ArrayList(); List item_rows = new ArrayList();
@ -5580,7 +5580,7 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl<ShopOrderBaseMappe
} }
for (ShopOrderItem item_row : order_item_rows) { for (ShopOrderItem item_row : order_item_rows) {
Long item_src_id = item_row.getItem_src_id(); String item_src_id = item_row.getItem_src_id();
if (CheckUtil.isNotEmpty(item_src_id)) { if (CheckUtil.isNotEmpty(item_src_id)) {
HashMap tmp = new HashMap(); HashMap tmp = new HashMap();
tmp.put("item_id", item_row.getItem_src_id()); tmp.put("item_id", item_row.getItem_src_id());
@ -6613,9 +6613,9 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl<ShopOrderBaseMappe
Long product_id = Convert.toLong(_item.get("product_id")); Long product_id = Convert.toLong(_item.get("product_id"));
Long item_id = Convert.toLong(_item.get("item_id")); Long item_id = Convert.toLong(_item.get("item_id"));
Long item_src_id = Convert.toLong(_item.get("item_src_id")); // 商品 SKU id String item_src_id = Convert.toStr(_item.get("item_src_id")); // 商品 SKU id
if (CheckUtil.isEmpty(item_src_id)) { if (CheckUtil.isEmpty(item_src_id)) {
item_src_id = item_id; item_src_id = String.valueOf(item_id);
} }
String product_item_name = (String) _item.get("product_item_name"); String product_item_name = (String) _item.get("product_item_name");
@ -7069,7 +7069,7 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl<ShopOrderBaseMappe
Long pulse_product_id = (Long) pulse.get("product_id"); Long pulse_product_id = (Long) pulse.get("product_id");
Long pulse_item_id = (Long) pulse.get("item_id"); Long pulse_item_id = (Long) pulse.get("item_id");
Long pulse_item_src_id = (Long) pulse.get("item_src_id"); String pulse_item_src_id = (String) pulse.get("item_src_id");
Integer pulse_category_id = (Integer) pulse.get("category_id"); Integer pulse_category_id = (Integer) pulse.get("category_id");
String pulse_product_item_name = (String) pulse.get("product_item_name"); String pulse_product_item_name = (String) pulse.get("product_item_name");
String pulse_cart_file = (String) pulse.get("cart_file"); String pulse_cart_file = (String) pulse.get("cart_file");

View File

@ -2134,7 +2134,7 @@ public class ShopOrderReturnServiceImpl extends BaseServiceImpl<ShopOrderReturnM
if (shopOrderItem == null) { if (shopOrderItem == null) {
throw new ApiException(I18nUtil._("源订单商品信息不存在!")); throw new ApiException(I18nUtil._("源订单商品信息不存在!"));
} }
Long itemSrcId = shopOrderItem.getItem_src_id(); String itemSrcId = shopOrderItem.getItem_src_id();
QueryWrapper<ShopOrderItem> orderItemQueryWrapper = new QueryWrapper<>(); QueryWrapper<ShopOrderItem> orderItemQueryWrapper = new QueryWrapper<>();
orderItemQueryWrapper.eq("item_id", itemSrcId); orderItemQueryWrapper.eq("item_id", itemSrcId);
orderItemQueryWrapper.eq("src_order_id", order_id); orderItemQueryWrapper.eq("src_order_id", order_id);

View File

@ -502,6 +502,7 @@ public class ShopProductBaseServiceImpl extends BaseServiceImpl<ShopProductBaseM
BigDecimal item_sales_rate = Convert.toBigDecimal(productItemMap.get("item_sales_rate")); BigDecimal item_sales_rate = Convert.toBigDecimal(productItemMap.get("item_sales_rate"));
if (item_id != null) item.setItem_id(item_id); if (item_id != null) item.setItem_id(item_id);
item.setItem_src_id(String.valueOf(item_id));
item.setItem_number(item_number); item.setItem_number(item_number);
item.setItem_enable(item_enable); item.setItem_enable(item_enable);
item.setItem_barcode(item_barcode); item.setItem_barcode(item_barcode);
@ -1311,7 +1312,7 @@ public class ShopProductBaseServiceImpl extends BaseServiceImpl<ShopProductBaseM
if (CollUtil.isNotEmpty($product_item_rows)) { if (CollUtil.isNotEmpty($product_item_rows)) {
for (ShopProductItem $product_item_row : $product_item_rows) { for (ShopProductItem $product_item_row : $product_item_rows) {
if (dist_copy) { if (dist_copy) {
$product_item_row.setItem_src_id($product_item_row.getItem_id()); $product_item_row.setItem_src_id(String.valueOf($product_item_row.getItem_id()));
} }
$product_item_row.setItem_cost_price($product_item_row.getItem_unit_price()); $product_item_row.setItem_cost_price($product_item_row.getItem_unit_price());
@ -4682,12 +4683,12 @@ public class ShopProductBaseServiceImpl extends BaseServiceImpl<ShopProductBaseM
throw new ApiException(I18nUtil._("产品Item集合为空!")); throw new ApiException(I18nUtil._("产品Item集合为空!"));
} }
Map<Long, ShopProductItem> oneProductItemMap = oneProductItems.stream().collect(Collectors.toMap(ShopProductItem::getItem_src_id, ShopProductItem -> ShopProductItem, (k1, k2) -> k1)); Map<String, ShopProductItem> oneProductItemMap = oneProductItems.stream().collect(Collectors.toMap(ShopProductItem::getItem_src_id, ShopProductItem -> ShopProductItem, (k1, k2) -> k1));
if ($productItemMap.size() != oneProductItemMap.size()) { if ($productItemMap.size() != oneProductItemMap.size()) {
putDown = true; putDown = true;
} else { } else {
for (Long item_src_id : oneProductItemMap.keySet()) { for (String item_src_id : oneProductItemMap.keySet()) {
ShopProductItem $productItem = $productItemMap.get(item_src_id); ShopProductItem $productItem = $productItemMap.get(item_src_id);
if ($productItem == null) { if ($productItem == null) {
@ -4877,9 +4878,9 @@ public class ShopProductBaseServiceImpl extends BaseServiceImpl<ShopProductBaseM
throw new ApiException(I18nUtil._("产品Item集合为空!")); throw new ApiException(I18nUtil._("产品Item集合为空!"));
} }
Map<Long, ShopProductItem> productItemMap = shopProductItems.stream().collect(Collectors.toMap(ShopProductItem::getItem_src_id, ShopProductItem -> ShopProductItem, (k1, k2) -> k1)); Map<String, ShopProductItem> productItemMap = shopProductItems.stream().collect(Collectors.toMap(ShopProductItem::getItem_src_id, ShopProductItem -> ShopProductItem, (k1, k2) -> k1));
for (Long item_src_id : productItemMap.keySet()) { for (String item_src_id : productItemMap.keySet()) {
ShopProductItem $productItem = $productItemMap.get(item_src_id); ShopProductItem $productItem = $productItemMap.get(item_src_id);
if ($productItem == null) { if ($productItem == null) {
@ -4897,7 +4898,7 @@ public class ShopProductBaseServiceImpl extends BaseServiceImpl<ShopProductBaseM
newProductItem.setVersion(productItem.getVersion()); newProductItem.setVersion(productItem.getVersion());
} }
newProductItem.setItem_src_id(newProductItem.getItem_id()); newProductItem.setItem_src_id(String.valueOf(newProductItem.getItem_id()));
newProductItem.setItem_cost_price(newProductItem.getItem_unit_price()); newProductItem.setItem_cost_price(newProductItem.getItem_unit_price());
newProductItem.setStore_id(store_id); newProductItem.setStore_id(store_id);
newProductItem.setProduct_id(product_id); newProductItem.setProduct_id(product_id);

View File

@ -2014,7 +2014,7 @@ public class ShopProductItemServiceImpl extends BaseServiceImpl<ShopProductItemM
List<ShopProductItem> item_src_rows = new ArrayList<>(); List<ShopProductItem> item_src_rows = new ArrayList<>();
Boolean supplier_market_enable = accountBaseConfigService.getConfig("supplier_market_enable", false); Boolean supplier_market_enable = accountBaseConfigService.getConfig("supplier_market_enable", false);
if (supplier_market_enable) { if (supplier_market_enable) {
List<Long> item_src_ids = itemList.stream().map(ShopProductItem::getItem_src_id).distinct().collect(Collectors.toList()); List<String> item_src_ids = itemList.stream().map(ShopProductItem::getItem_src_id).distinct().collect(Collectors.toList());
if (CollUtil.isNotEmpty(item_src_ids)) { if (CollUtil.isNotEmpty(item_src_ids)) {
item_src_rows = gets(CollUtil.join(item_src_ids, ",")); item_src_rows = gets(CollUtil.join(item_src_ids, ","));
} }
@ -2126,7 +2126,7 @@ public class ShopProductItemServiceImpl extends BaseServiceImpl<ShopProductItemM
item_row.put("item_market_price", NumberUtil.mul(item_market_price, currency_exchange_rate)); item_row.put("item_market_price", NumberUtil.mul(item_market_price, currency_exchange_rate));
// 修正为供应商库存 // 修正为供应商库存
Long item_src_id = Convert.toLong(item_row.get("item_src_id")); String item_src_id = Convert.toStr(item_row.get("item_src_id"));
Optional<ShopProductItem> itemOpl = item_src_rows.stream().filter(s -> ObjectUtil.equal(item_src_id, s.getItem_id())).findFirst(); Optional<ShopProductItem> itemOpl = item_src_rows.stream().filter(s -> ObjectUtil.equal(item_src_id, s.getItem_id())).findFirst();
if (itemOpl.isPresent() && CheckUtil.isNotEmpty(item_src_id)) { if (itemOpl.isPresent() && CheckUtil.isNotEmpty(item_src_id)) {

View File

@ -788,7 +788,7 @@ public abstract class SyncBaseThirdSxAbstract{
ShopProductItem shopProductItem = new ShopProductItem(); ShopProductItem shopProductItem = new ShopProductItem();
shopProductItem.setStore_id(storeIdInt); shopProductItem.setStore_id(storeIdInt);
shopProductItem.setCategory_id(categoryId); shopProductItem.setCategory_id(categoryId);
shopProductItem.setItem_src_id(jsonObj.getLong("product_number")); shopProductItem.setItem_src_id(jsonObj.getStr("product_number"));
//零售价 //零售价
shopProductItem.setItem_unit_price(BigDecimal.valueOf(jsonObj.getDouble("retail_price"))); shopProductItem.setItem_unit_price(BigDecimal.valueOf(jsonObj.getDouble("retail_price")));
shopProductItem.setItem_advice_price(BigDecimal.valueOf(jsonObj.getDouble("retail_price"))); shopProductItem.setItem_advice_price(BigDecimal.valueOf(jsonObj.getDouble("retail_price")));

View File

@ -0,0 +1 @@
alter table shop_product_item modify `item_src_id` varchar(50) NOT NULL DEFAULT '0' COMMENT '供应商SKU编号';