商品映射新增参数传值
This commit is contained in:
parent
2329a017b2
commit
d2b25780f5
@ -186,8 +186,8 @@ public class ProductMappingController extends BaseControllerImpl {
|
|||||||
*/
|
*/
|
||||||
@ApiOperation(value = "自动计算并上架商品", notes = "自动计算并上架商品")
|
@ApiOperation(value = "自动计算并上架商品", notes = "自动计算并上架商品")
|
||||||
@RequestMapping(value = "/syncProductMaping", method = RequestMethod.PUT)
|
@RequestMapping(value = "/syncProductMaping", method = RequestMethod.PUT)
|
||||||
public CommonResult syncProductMaping() {
|
public CommonResult syncProductMaping(Integer storeId) {
|
||||||
return productMappingService.syncAllProductMapping();
|
return productMappingService.syncAllProductMapping(storeId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -103,12 +103,12 @@ public class StoreDbConfigController extends BaseControllerImpl {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 生产密钥,用来放到app/bin目录,替换原来的密钥
|
* 生产密钥,用来放到app/bin目录,替换原来的密钥
|
||||||
* @param syncApp
|
* @param storeDbConfig
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "客户端primaryKey.txt生产", notes = "密钥生成器")
|
@ApiOperation(value = "客户端primaryKey.txt生产", notes = "密钥生成器")
|
||||||
@RequestMapping(value = "/getPrimaryKey", method = RequestMethod.PUT)
|
@RequestMapping(value = "/getPrimaryKey", method = RequestMethod.PUT)
|
||||||
public String getPrimaryKey(@RequestBody SyncApp syncApp) {
|
public String getPrimaryKey(@RequestBody StoreDbConfig storeDbConfig) {
|
||||||
return storeDbConfigService.getPrimaryKey(syncApp);
|
return storeDbConfigService.getPrimaryKey(storeDbConfig);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,7 +19,7 @@ public interface ProductMappingService extends IBaseService<ProductMapping> {
|
|||||||
|
|
||||||
Map getProductMapping(Integer storeId);
|
Map getProductMapping(Integer storeId);
|
||||||
|
|
||||||
CommonResult syncAllProductMapping();
|
CommonResult syncAllProductMapping(Integer storeId);
|
||||||
|
|
||||||
CommonResult getSyncProductUnchecked(Integer storeId);
|
CommonResult getSyncProductUnchecked(Integer storeId);
|
||||||
|
|
||||||
|
|||||||
@ -28,7 +28,7 @@ public interface StoreDbConfigService extends IBaseService<StoreDbConfig> {
|
|||||||
CommonResult updateStoreDbConfig(StoreDbConfig storeDbConfig);
|
CommonResult updateStoreDbConfig(StoreDbConfig storeDbConfig);
|
||||||
|
|
||||||
CommonResult delStoreDbConfig(StoreDbConfig storeDbConfig);
|
CommonResult delStoreDbConfig(StoreDbConfig storeDbConfig);
|
||||||
String getPrimaryKey(SyncApp syncApp);
|
String getPrimaryKey(StoreDbConfig storeDbConfig);
|
||||||
|
|
||||||
Map getPriorityModeCachByStoreId(Integer storeId);
|
Map getPriorityModeCachByStoreId(Integer storeId);
|
||||||
|
|
||||||
|
|||||||
@ -377,8 +377,10 @@ public class ProductMappingServiceImpl extends BaseServiceImpl<ProductMappingMap
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommonResult syncAllProductMapping() {
|
public CommonResult syncAllProductMapping(Integer storeId) {
|
||||||
Integer storeId= Integer.valueOf(Objects.requireNonNull(ContextUtil.getCurrentUser()).getStore_id());
|
if(ObjectUtil.isEmpty(storeId)){
|
||||||
|
storeId= Integer.valueOf(Objects.requireNonNull(ContextUtil.getCurrentUser()).getStore_id());
|
||||||
|
}
|
||||||
QueryWrapper<StoreDbConfig> storeDbConfigQueryWrapper = new QueryWrapper<>();
|
QueryWrapper<StoreDbConfig> storeDbConfigQueryWrapper = new QueryWrapper<>();
|
||||||
storeDbConfigQueryWrapper.select("priority_mode");
|
storeDbConfigQueryWrapper.select("priority_mode");
|
||||||
storeDbConfigQueryWrapper.eq("store_id", storeId);
|
storeDbConfigQueryWrapper.eq("store_id", storeId);
|
||||||
@ -401,8 +403,9 @@ public class ProductMappingServiceImpl extends BaseServiceImpl<ProductMappingMap
|
|||||||
List<Future<?>> futures = new ArrayList<>();
|
List<Future<?>> futures = new ArrayList<>();
|
||||||
for (int i=1;i<=pages;i++){
|
for (int i=1;i<=pages;i++){
|
||||||
int finalI = i;
|
int finalI = i;
|
||||||
|
Integer finalStoreId = storeId;
|
||||||
futures.add(executor.submit(() -> {
|
futures.add(executor.submit(() -> {
|
||||||
this.computeProductMapping(shopProductBaseService.lists(queryWrapper, finalI,SHOPBASEPAGE).getRecords(),storeId,false);
|
this.computeProductMapping(shopProductBaseService.lists(queryWrapper, finalI,SHOPBASEPAGE).getRecords(), finalStoreId,false);
|
||||||
return "成功" + finalI;
|
return "成功" + finalI;
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
@ -423,7 +426,7 @@ public class ProductMappingServiceImpl extends BaseServiceImpl<ProductMappingMap
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommonResult getSyncProductUnchecked(Integer storeId) {
|
public CommonResult getSyncProductUnchecked(Integer storeId) {
|
||||||
if(ObjectUtil.isNull(storeId)){
|
if(ObjectUtil.isEmpty(storeId)){
|
||||||
storeId= Integer.valueOf(Objects.requireNonNull(ContextUtil.getCurrentUser()).getStore_id());
|
storeId= Integer.valueOf(Objects.requireNonNull(ContextUtil.getCurrentUser()).getStore_id());
|
||||||
}
|
}
|
||||||
//找出范围内的规格产品
|
//找出范围内的规格产品
|
||||||
|
|||||||
@ -165,21 +165,21 @@ public class StoreDbConfigServiceImpl extends BaseServiceImpl<StoreDbConfigMappe
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getPrimaryKey(SyncApp syncApp) {
|
public String getPrimaryKey(StoreDbConfig storeDbConfig) {
|
||||||
checked();
|
checked();
|
||||||
if(ObjectUtil.isEmpty(syncApp)){
|
if(ObjectUtil.isEmpty(storeDbConfig)){
|
||||||
throw new RuntimeException("对象不能为空");
|
throw new RuntimeException("对象不能为空");
|
||||||
}
|
}
|
||||||
if(ObjectUtil.isEmpty(syncApp.getStore_id())){
|
if(ObjectUtil.isEmpty(storeDbConfig.getStoreId())){
|
||||||
throw new RuntimeException("商店编号不能为空");
|
throw new RuntimeException("商店编号不能为空");
|
||||||
}
|
}
|
||||||
String storeId= getStoreId(syncApp.getStore_id());//保证不能跨数据操作
|
String storeId= getStoreId(storeDbConfig.getStoreId());//保证不能跨数据操作
|
||||||
ShopStoreBase shopStoreBase=shopStoreBaseService.get(Convert.toInt(storeId));
|
ShopStoreBase shopStoreBase=shopStoreBaseService.get(Convert.toInt(storeId));
|
||||||
if(shopStoreBase==null){
|
if(shopStoreBase==null){
|
||||||
throw new RuntimeException("商品不存在");
|
throw new RuntimeException("商品不存在");
|
||||||
}
|
}
|
||||||
QueryWrapper<SyncApp> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<SyncApp> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq("store_id", storeId);
|
queryWrapper.eq("store_id", Integer.valueOf(storeId));
|
||||||
SyncApp result= syncAppService.getOne(queryWrapper);
|
SyncApp result= syncAppService.getOne(queryWrapper);
|
||||||
String primaryKey="";
|
String primaryKey="";
|
||||||
try {
|
try {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user