商品类型问题修复&同步时间间隔字段新增

This commit is contained in:
liyj 2025-07-25 11:07:04 +08:00
parent bbf38e0f1b
commit 01d0a8a423
4 changed files with 12 additions and 5 deletions

View File

@ -122,4 +122,9 @@ public class StoreDbConfig implements Serializable {
@ApiModelProperty(value = "更新优先方式(1:手动优先,2:自动优先),自动优先时根据平台给的商品自动切分上架,更新是才发挥作用")
@NotBlank(message = "更新优先方式不能为空")
private String priorityMode="1";
@TableField(value = "shop_gap_time",updateStrategy = FieldStrategy.NOT_EMPTY)
@ApiModelProperty(value = "商品同步间隔时间,由于商品同步时异步,要等同步完成才同步商品和活动,所以要设置间隔时间")
@NotBlank(message = "商品同步间隔时间不能为空")
private String shopGapTime;
}

View File

@ -83,7 +83,7 @@ public class ShopBaseProductSpecServiceImpl extends BaseServiceImpl<ShopBaseProd
specs.forEach(item -> {
QueryWrapper<ShopProductSpecItem> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("spec_id", item.getSpec_id())
.eq("store_id", Integer.valueOf(store_id));
.eq("store_id", store_id);
queryWrapper.orderByAsc("spec_item_order");
queryWrapper.orderByAsc("spec_item_id");
item.setSpecItems(itemService.getItems(queryWrapper));

View File

@ -25,6 +25,7 @@ import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
@ -81,7 +82,7 @@ public class ShopBaseProductTypeServiceImpl extends BaseServiceImpl<ShopBaseProd
@Override
public Map getType(String type_id) {
String storeId = ContextUtil.getCurrentUser().getStore_id();
String storeId = Objects.requireNonNull(ContextUtil.getCurrentUser()).getStore_id();
QueryWrapper<ShopBaseProductType> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type_id", type_id);
queryWrapper.eq("store_id", storeId);
@ -91,8 +92,7 @@ public class ShopBaseProductTypeServiceImpl extends BaseServiceImpl<ShopBaseProd
data.put("brands", brandService.getBrandsByIds(shopBaseProductType.getType_brand_ids()));
// Integer store_id = Convert.toInt(userInfoService.getUser().getStore_id());
Integer store_id =1;
data.put("specs", specService.getSpecsByIds(shopBaseProductType.getType_spec_ids(), store_id));
data.put("specs", specService.getSpecsByIds(shopBaseProductType.getType_spec_ids(), Integer.valueOf(storeId)));
return data;
@ -102,10 +102,11 @@ public class ShopBaseProductTypeServiceImpl extends BaseServiceImpl<ShopBaseProd
public Map getType(String type_id, Long product_id) {
Map data = getType(type_id);
//todo 分销商业务去除吧
if (CheckUtil.isNotEmpty(product_id)) {
//读取商品判断是否为供应商分销商品
ShopProductBase shopProductBase = shopProductBaseService.get(product_id);
if (!shopProductBase.getProduct_src_id().equals(0)) {
if (!shopProductBase.getProduct_src_id().equals(0L)) {
ShopProductIndex shopProductIndex = shopProductIndexService.get(shopProductBase.getProduct_src_id());
if (shopProductIndex != null) {

View File

@ -0,0 +1 @@
alter table store_db_config add shop_gap_time varchar(64) NOT NULL DEFAULT '1000*60*2' COMMENT '商品间隔时间,由于商品同步时异步,要等同步完成才同步商品和活动,所以要设置间隔时间';