商品映射新增商品货号查询
This commit is contained in:
parent
41b339e825
commit
197c6272f9
@ -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;
|
||||
}
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -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();
|
||||
}
|
||||
|
||||
@ -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());
|
||||
|
||||
@ -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"))
|
||||
|
||||
@ -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;
|
||||
|
||||
1
sql/shop/dev/20251110_2_dml.sql
Normal file
1
sql/shop/dev/20251110_2_dml.sql
Normal file
@ -0,0 +1 @@
|
||||
ALTER table store_db_config add `automatic` int DEFAULT '100' COMMENT '默认次日补全库存';
|
||||
Loading…
Reference in New Issue
Block a user