商品映射新增商品货号查询

This commit is contained in:
liyj 2025-11-10 18:07:40 +08:00
parent c3414925a0
commit 5e45474807
7 changed files with 12 additions and 4 deletions

View File

@ -138,4 +138,8 @@ public class StoreDbConfig implements Serializable {
@TableField(value = "is_sync_member",updateStrategy = FieldStrategy.NOT_EMPTY)
@ApiModelProperty(value = "是否同步会员(0:否,1:是)")
private String isSyncMember;
@TableField(value = "automatic",updateStrategy = FieldStrategy.NOT_EMPTY)
@ApiModelProperty(value = "默认次日补全库存(思迅同步时配置)")
private Integer automatic;
}

View File

@ -69,6 +69,7 @@ public class ProductMappingController extends BaseControllerImpl {
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
ProductMapping productMapping=new ProductMapping();
productMapping.setProductName(getParameter("productName"));
productMapping.setProductNumber(getParameter("productNumber"));
productMapping.setStoreId(getParameter("storeId",Integer.class));
return productMappingService.findPageProductMapping(productMapping,pageNum,pageSize);
}

View File

@ -206,7 +206,7 @@ public interface SyncThirdDataService {
* @return
*/
int baseSaveOrUpdateGoodsBatch(JSONArray goodsListJSON,String storeId,String isNegativeAllowed,
Map<String,Integer> brandMaps);
Map<String,Integer> brandMaps,Integer automatic);
void syncPrimaryKey();
}

View File

@ -227,6 +227,7 @@ public class ShopSyncImportServiceImpl implements ShopSyncImportService {
shopBatchSubmitListener.setStoreId(storeId);
shopBatchSubmitListener.setBrandMaps(brandMaps);
shopBatchSubmitListener.setIsNegativeAllowed(isNegativeAllowed);
shopBatchSubmitListener.setAutomatic(storeDbConfig.getAutomatic());
EasyExcel.read(filePath,SxGoosModelExcel.class,shopBatchSubmitListener).sheet().doRead();
syncStoreSpecsService.dealSyncStoreSpecs(Integer.valueOf(storeId));
productMappingService.syncAllProductMapping(Integer.valueOf(storeId), DicEnum.YESORNO_0.getCode());

View File

@ -767,7 +767,7 @@ public abstract class SyncBaseThirdSxAbstract{
* @return
*/
public int baseSaveOrUpdateGoodsBatch(JSONArray goodsListJSON,String storeId,String isNegativeAllowed,
Map<String,Integer> brandMaps){
Map<String,Integer> brandMaps,Integer automatic){
AtomicInteger resultCount = new AtomicInteger();
Map categoryMap= productCategoryService.getCategoryListByStoreId(storeId);//热数据加载
List<ShopProductBase> shopProductBaseList=new ArrayList<>();
@ -825,7 +825,7 @@ public abstract class SyncBaseThirdSxAbstract{
}
BigDecimal stock= jsonObj.getBigDecimal("stock");//库存
if(ObjectUtil.equals(isNegativeAllowed,DicEnum.YESORNO_1.getCode())&&stock.compareTo(BigDecimal.ZERO)<=0){//允许负库存每次都加满就是一直有售卖
stock=new BigDecimal("500");
stock=new BigDecimal(automatic);
}
//商品总量
if(ObjectUtil.isNotEmpty(jsonObj.getStr("unit"))&&ObjectUtil.isNotEmpty(jsonObj.getStr("stock"))

View File

@ -620,6 +620,7 @@ public class SyncThirdDataServiceImpl extends SyncBaseThirdSxAbstract implements
for (int i = 0; i < newFolders.size(); i++) {
final int taskId = i;
final String isNegativeAllowed = storeDbConfig.getIsNegativeAllowed();
final Integer automatic=storeDbConfig.getAutomatic();
//String priorityMode = storeDbConfig.getPriorityMode();
//boolean isUpdatePrice= ObjectUtil.isNotEmpty(storeDbConfig.getRefreshTime());//是否更新所有切割价格
threadNum.incrementAndGet();
@ -633,7 +634,7 @@ public class SyncThirdDataServiceImpl extends SyncBaseThirdSxAbstract implements
String sycnDataId=DigestUtils.md5Hex(newFolders.get(taskId) + fileName);
JSONArray jsonArray = getSyncDataContent(finalSyncDataMap,sycnDataId);
try {
baseSaveOrUpdateGoodsBatch(jsonArray, storeId, isNegativeAllowed, brandMaps);
baseSaveOrUpdateGoodsBatch(jsonArray, storeId, isNegativeAllowed, brandMaps,automatic);
success.getAndIncrement();
threadNum.decrementAndGet();
return "成功" + taskId;

View File

@ -0,0 +1 @@
ALTER table store_db_config add `automatic` int DEFAULT '100' COMMENT '默认次日补全库存';