还原错误修改

This commit is contained in:
liyj 2025-08-04 11:30:19 +08:00
parent f2d1c45d32
commit 14f99acdb0

View File

@ -198,7 +198,7 @@ public class SyncThirdDataServiceImpl extends SyncBaseThirdSxAbstract implements
@Override @Override
public ThirdApiRes saveOrUpdateShopBaseProductCategoryBatch(String appKey, String sign, JSONArray categoryListJSON) { public ThirdApiRes saveOrUpdateShopBaseProductCategoryBatch(String appKey, String sign, JSONArray categoryListJSON) {
if (StrUtil.isBlank(appKey) || StrUtil.isBlank(sign) || ObjectUtil.isEmpty(categoryListJSON)) { if (StrUtil.isBlank(appKey) || StrUtil.isBlank(sign) || ObjectUtil.isEmpty(categoryListJSON)) {
return new ThirdApiRes().fail(1003, _("缺少必要参数!")); return new ThirdApiRes().fail(1003, I18nUtil._("缺少必要参数!"));
} }
//用gson保证与客户端的顺序一致 //用gson保证与客户端的顺序一致
List<SxCategoryModel> sxCategoryModelList = categoryListJSON.toList(SxCategoryModel.class); List<SxCategoryModel> sxCategoryModelList = categoryListJSON.toList(SxCategoryModel.class);
@ -207,17 +207,17 @@ public class SyncThirdDataServiceImpl extends SyncBaseThirdSxAbstract implements
// 验签appid必要参数判断 // 验签appid必要参数判断
SyncApp syncApp = syncAppService.checkAppSign(appKey, sign, jsonStr); SyncApp syncApp = syncAppService.checkAppSign(appKey, sign, jsonStr);
if (syncApp == null) { if (syncApp == null) {
return new ThirdApiRes().fail(1001, _("签名有误!")); return new ThirdApiRes().fail(1001, I18nUtil._("签名有误!"));
} }
String storeId = syncApp.getStore_id(); String storeId = syncApp.getStore_id();
List<ShopBaseProductCategory> list = JSONUtil.toList(categoryListJSON, ShopBaseProductCategory.class); List<ShopBaseProductCategory> list = JSONUtil.toList(categoryListJSON, ShopBaseProductCategory.class);
if (list == null) { if (list == null) {
return new ThirdApiRes().fail(1004, _("请求参数有误!")); return new ThirdApiRes().fail(1004, I18nUtil._("请求参数有误!"));
} }
if (list != null && list.size() > limitCnt) { if (list != null && list.size() > limitCnt) {
return new ThirdApiRes().fail(1004, _("单次同步记录最多" + limitCnt + "条!")); return new ThirdApiRes().fail(1004, I18nUtil._("单次同步记录最多" + limitCnt + "条!"));
} }
int count = baseSaveOrUpdateShopBaseProductCategoryBatch(list, categoryListJSON, storeId); int count = baseSaveOrUpdateShopBaseProductCategoryBatch(list, categoryListJSON, storeId);
@ -236,7 +236,7 @@ public class SyncThirdDataServiceImpl extends SyncBaseThirdSxAbstract implements
@Override @Override
public ThirdApiRes saveOrUpdateShopBaseProductBrandBatch(String appKey, String sign, JSONArray brandListJSON) { public ThirdApiRes saveOrUpdateShopBaseProductBrandBatch(String appKey, String sign, JSONArray brandListJSON) {
if (StrUtil.isBlank(appKey) || StrUtil.isBlank(sign) || ObjectUtil.isEmpty(brandListJSON)) { if (StrUtil.isBlank(appKey) || StrUtil.isBlank(sign) || ObjectUtil.isEmpty(brandListJSON)) {
return new ThirdApiRes().fail(1003, _("缺少必要参数!")); return new ThirdApiRes().fail(1003, I18nUtil._("缺少必要参数!"));
} }
//用gson保证与客户端的顺序一致 //用gson保证与客户端的顺序一致
List<BrandModel> brandModels = brandListJSON.toList(BrandModel.class); List<BrandModel> brandModels = brandListJSON.toList(BrandModel.class);
@ -245,17 +245,17 @@ public class SyncThirdDataServiceImpl extends SyncBaseThirdSxAbstract implements
// 验签appid必要参数判断 // 验签appid必要参数判断
SyncApp syncApp = syncAppService.checkAppSign(appKey, sign, jsonStr); SyncApp syncApp = syncAppService.checkAppSign(appKey, sign, jsonStr);
if (syncApp == null) { if (syncApp == null) {
return new ThirdApiRes().fail(1001, _("签名有误!")); return new ThirdApiRes().fail(1001, I18nUtil._("签名有误!"));
} }
String storeId = syncApp.getStore_id(); String storeId = syncApp.getStore_id();
List<ShopBaseProductBrand> goodBrandList = JSONUtil.toList(brandListJSON, ShopBaseProductBrand.class); List<ShopBaseProductBrand> goodBrandList = JSONUtil.toList(brandListJSON, ShopBaseProductBrand.class);
if (goodBrandList == null) { if (goodBrandList == null) {
return new ThirdApiRes().fail(1004, _("请求参数有误!")); return new ThirdApiRes().fail(1004, I18nUtil._("请求参数有误!"));
} }
if (goodBrandList != null && goodBrandList.size() > limitCnt) { if (goodBrandList != null && goodBrandList.size() > limitCnt) {
return new ThirdApiRes().fail(1004, _("单次同步记录最多" + limitCnt + "条!")); return new ThirdApiRes().fail(1004, I18nUtil._("单次同步记录最多" + limitCnt + "条!"));
} }
int count = baseSaveOrUpdateShopBaseProductBrandBatch(goodBrandList, storeId, brandListJSON); int count = baseSaveOrUpdateShopBaseProductBrandBatch(goodBrandList, storeId, brandListJSON);
@ -274,17 +274,17 @@ public class SyncThirdDataServiceImpl extends SyncBaseThirdSxAbstract implements
@Override @Override
public ThirdApiRes saveOrUpdateGoodsBatch(String appKey, String sign, JSONArray goodsListJSON) { public ThirdApiRes saveOrUpdateGoodsBatch(String appKey, String sign, JSONArray goodsListJSON) {
if (StrUtil.isBlank(appKey) || StrUtil.isBlank(sign) || ObjectUtil.isEmpty(goodsListJSON)) { if (StrUtil.isBlank(appKey) || StrUtil.isBlank(sign) || ObjectUtil.isEmpty(goodsListJSON)) {
return new ThirdApiRes().fail(1003, _("缺少必要参数!")); return new ThirdApiRes().fail(1003, I18nUtil._("缺少必要参数!"));
} }
// 验签appid必要参数判断 // 验签appid必要参数判断
SyncApp syncApp = syncAppService.checkAppSign(appKey, sign, goodsListJSON.toString()); SyncApp syncApp = syncAppService.checkAppSign(appKey, sign, goodsListJSON.toString());
if (syncApp == null) { if (syncApp == null) {
return new ThirdApiRes().fail(1001, _("签名有误!")); return new ThirdApiRes().fail(1001, I18nUtil._("签名有误!"));
} }
String storeId = syncApp.getStore_id(); String storeId = syncApp.getStore_id();
if (goodsListJSON.size() > limitCnt) { if (goodsListJSON.size() > limitCnt) {
return new ThirdApiRes().fail(1004, _("单次同步记录最多" + limitCnt + "条!")); return new ThirdApiRes().fail(1004, I18nUtil._("单次同步记录最多" + limitCnt + "条!"));
} }
int count = baseSaveOrUpdateGoods(goodsListJSON, storeId); int count = baseSaveOrUpdateGoods(goodsListJSON, storeId);
@ -305,7 +305,7 @@ public class SyncThirdDataServiceImpl extends SyncBaseThirdSxAbstract implements
// @Transactional // @Transactional
public ThirdApiRes saveOrUpdateMemberBatch(String appKey, String sign, List<SyncThirdMemberReq> memberList) { public ThirdApiRes saveOrUpdateMemberBatch(String appKey, String sign, List<SyncThirdMemberReq> memberList) {
if (StrUtil.isBlank(appKey) || StrUtil.isBlank(sign) || CollUtil.isEmpty(memberList)) { if (StrUtil.isBlank(appKey) || StrUtil.isBlank(sign) || CollUtil.isEmpty(memberList)) {
return new ThirdApiRes().fail(1003, _("缺少必要参数!")); return new ThirdApiRes().fail(1003, I18nUtil._("缺少必要参数!"));
} }
//用gson保证与客户端的顺序一致 //用gson保证与客户端的顺序一致
Gson gson = new Gson(); Gson gson = new Gson();
@ -313,12 +313,12 @@ public class SyncThirdDataServiceImpl extends SyncBaseThirdSxAbstract implements
// 验签appid必要参数判断 // 验签appid必要参数判断
SyncApp syncApp = syncAppService.checkAppSign(appKey, sign, jsonStr); SyncApp syncApp = syncAppService.checkAppSign(appKey, sign, jsonStr);
if (syncApp == null) { if (syncApp == null) {
return new ThirdApiRes().fail(1001, _("签名有误!")); return new ThirdApiRes().fail(1001, I18nUtil._("签名有误!"));
} }
String storeId = syncApp.getStore_id(); String storeId = syncApp.getStore_id();
if (memberList.size() > limitCnt) { if (memberList.size() > limitCnt) {
return new ThirdApiRes().fail(1004, _("单次同步记录最多" + limitCnt + "条!")); return new ThirdApiRes().fail(1004, I18nUtil._("单次同步记录最多" + limitCnt + "条!"));
} }
shopNumberSeqService.clearKeyStoreAccountBaseId(); shopNumberSeqService.clearKeyStoreAccountBaseId();
int count = 0; int count = 0;
@ -497,19 +497,19 @@ public class SyncThirdDataServiceImpl extends SyncBaseThirdSxAbstract implements
@Override @Override
public ThirdApiRes fileUpload(String appKey, String sign, String page, String syncType, MultipartFile multipartFile) { public ThirdApiRes fileUpload(String appKey, String sign, String page, String syncType, MultipartFile multipartFile) {
if (StrUtil.isBlank(appKey) || StrUtil.isBlank(sign)) { if (StrUtil.isBlank(appKey) || StrUtil.isBlank(sign)) {
return new ThirdApiRes().fail(1003, _("缺少必要参数!")); return new ThirdApiRes().fail(1003, I18nUtil._("缺少必要参数!"));
} }
// 验签appid必要参数判断 // 验签appid必要参数判断
SyncApp syncAppO = syncAppService.getOne(new LambdaQueryWrapper<SyncApp>() SyncApp syncAppO = syncAppService.getOne(new LambdaQueryWrapper<SyncApp>()
.select(SyncApp::getApp_key, SyncApp::getStore_id) .select(SyncApp::getApp_key, SyncApp::getStore_id)
.eq(SyncApp::getApp_key, appKey)); .eq(SyncApp::getApp_key, appKey));
if (syncAppO == null) { if (syncAppO == null) {
return new ThirdApiRes().fail(1001, _("签名有误!")); return new ThirdApiRes().fail(1001, I18nUtil._("签名有误!"));
} }
String storeId = syncAppO.getStore_id(); String storeId = syncAppO.getStore_id();
try { try {
if (multipartFile.isEmpty()) { if (multipartFile.isEmpty()) {
return new ThirdApiRes().fail(1001, _("文件不能为空!")); return new ThirdApiRes().fail(1001, I18nUtil._("文件不能为空!"));
} }
byte[] bytes = multipartFile.getBytes(); byte[] bytes = multipartFile.getBytes();
String folder = new FileUtils().getSyncTypeFlag(syncType, clientPath) + storeId + FileUtils.pathSeparator + page + FileUtils.pathSeparator; String folder = new FileUtils().getSyncTypeFlag(syncType, clientPath) + storeId + FileUtils.pathSeparator + page + FileUtils.pathSeparator;
@ -750,7 +750,7 @@ public class SyncThirdDataServiceImpl extends SyncBaseThirdSxAbstract implements
@Override @Override
public ThirdApiRes getStoreDbConfig(String appKey, String sign) { public ThirdApiRes getStoreDbConfig(String appKey, String sign) {
if (StrUtil.isBlank(appKey) || StrUtil.isBlank(sign)) { if (StrUtil.isBlank(appKey) || StrUtil.isBlank(sign)) {
return new ThirdApiRes().fail(1003, _("缺少必要参数!")); return new ThirdApiRes().fail(1003, I18nUtil._("缺少必要参数!"));
} }
// 验签appid必要参数判断 // 验签appid必要参数判断
SyncApp syncAppO = syncAppService.getOne(new LambdaQueryWrapper<SyncApp>() SyncApp syncAppO = syncAppService.getOne(new LambdaQueryWrapper<SyncApp>()
@ -758,7 +758,7 @@ public class SyncThirdDataServiceImpl extends SyncBaseThirdSxAbstract implements
.eq(SyncApp::getApp_key, appKey) .eq(SyncApp::getApp_key, appKey)
.eq(SyncApp::getApp_secret, sign)); .eq(SyncApp::getApp_secret, sign));
if (syncAppO == null) { if (syncAppO == null) {
return new ThirdApiRes().fail(1001, _("签名有误!")); return new ThirdApiRes().fail(1001, I18nUtil._("签名有误!"));
} }
String storeId = syncAppO.getStore_id(); String storeId = syncAppO.getStore_id();
QueryWrapper<StoreDbConfig> queryWrapper = new QueryWrapper<>(); QueryWrapper<StoreDbConfig> queryWrapper = new QueryWrapper<>();
@ -766,7 +766,7 @@ public class SyncThirdDataServiceImpl extends SyncBaseThirdSxAbstract implements
queryWrapper.eq("has_start", DicEnum.YESORNO_1.getCode()); queryWrapper.eq("has_start", DicEnum.YESORNO_1.getCode());
StoreDbConfig storeDbConfig = storeDbConfigService.getOne(queryWrapper); StoreDbConfig storeDbConfig = storeDbConfigService.getOne(queryWrapper);
if (storeDbConfig == null) { if (storeDbConfig == null) {
return new ThirdApiRes().fail(1003, _("服务器配置缺少配置信息!")); return new ThirdApiRes().fail(1003, I18nUtil._("服务器配置缺少配置信息!"));
} }
return new ThirdApiRes().success("成功", storeDbConfig); return new ThirdApiRes().success("成功", storeDbConfig);
} }
@ -774,7 +774,7 @@ public class SyncThirdDataServiceImpl extends SyncBaseThirdSxAbstract implements
@Override @Override
public ThirdApiRes getStoreDataRelease(String appKey, String sign) { public ThirdApiRes getStoreDataRelease(String appKey, String sign) {
if (StrUtil.isBlank(appKey) || StrUtil.isBlank(sign)) { if (StrUtil.isBlank(appKey) || StrUtil.isBlank(sign)) {
return new ThirdApiRes().fail(1003, _("缺少必要参数!")); return new ThirdApiRes().fail(1003, I18nUtil._("缺少必要参数!"));
} }
// 验签appid必要参数判断 // 验签appid必要参数判断
SyncApp syncAppO = syncAppService.getOne(new LambdaQueryWrapper<SyncApp>() SyncApp syncAppO = syncAppService.getOne(new LambdaQueryWrapper<SyncApp>()
@ -782,7 +782,7 @@ public class SyncThirdDataServiceImpl extends SyncBaseThirdSxAbstract implements
.eq(SyncApp::getApp_key, appKey) .eq(SyncApp::getApp_key, appKey)
.eq(SyncApp::getApp_secret, sign)); .eq(SyncApp::getApp_secret, sign));
if (syncAppO == null) { if (syncAppO == null) {
return new ThirdApiRes().fail(1001, _("签名有误!")); return new ThirdApiRes().fail(1001, I18nUtil._("签名有误!"));
} }
// Object obRst = redisService.get(RedisKey.STOREDATARELEASE);//商品库存扣减 // Object obRst = redisService.get(RedisKey.STOREDATARELEASE);//商品库存扣减
@ -923,7 +923,7 @@ public class SyncThirdDataServiceImpl extends SyncBaseThirdSxAbstract implements
@Override @Override
public ThirdApiRes fileUploadToOss(String appKey, String sign, String syncType, Date refreshDate, List<String> folders) { public ThirdApiRes fileUploadToOss(String appKey, String sign, String syncType, Date refreshDate, List<String> folders) {
if (StrUtil.isBlank(appKey) || StrUtil.isBlank(sign)) { if (StrUtil.isBlank(appKey) || StrUtil.isBlank(sign)) {
return new ThirdApiRes().fail(1003, _("缺少必要参数!")); return new ThirdApiRes().fail(1003, I18nUtil._("缺少必要参数!"));
} }
// 验签appid必要参数判断 // 验签appid必要参数判断
SyncApp syncApp = syncAppService.getOne(new LambdaQueryWrapper<SyncApp>() SyncApp syncApp = syncAppService.getOne(new LambdaQueryWrapper<SyncApp>()
@ -931,7 +931,7 @@ public class SyncThirdDataServiceImpl extends SyncBaseThirdSxAbstract implements
.eq(SyncApp::getApp_key, appKey) .eq(SyncApp::getApp_key, appKey)
.eq(SyncApp::getApp_secret, sign)); .eq(SyncApp::getApp_secret, sign));
if (syncApp == null) { if (syncApp == null) {
return new ThirdApiRes().fail(1001, _("签名有误!")); return new ThirdApiRes().fail(1001, I18nUtil._("签名有误!"));
} }
String storeId = syncApp.getStore_id(); String storeId = syncApp.getStore_id();
if (null == syncApp.getStore_id() || syncApp.getStore_id().isEmpty()) { if (null == syncApp.getStore_id() || syncApp.getStore_id().isEmpty()) {
@ -1326,7 +1326,7 @@ public class SyncThirdDataServiceImpl extends SyncBaseThirdSxAbstract implements
@Override @Override
public ThirdApiRes syncRefreshTime(@RequestParam String appKey, @RequestParam String sign) { public ThirdApiRes syncRefreshTime(@RequestParam String appKey, @RequestParam String sign) {
if (StrUtil.isBlank(appKey) || StrUtil.isBlank(sign) ) { if (StrUtil.isBlank(appKey) || StrUtil.isBlank(sign) ) {
return new ThirdApiRes().fail(1003, _("缺少必要参数!")); return new ThirdApiRes().fail(1003, I18nUtil._("缺少必要参数!"));
} }
// 验签appid必要参数判断 // 验签appid必要参数判断
SyncApp syncApp = syncAppService.getOne(new LambdaQueryWrapper<SyncApp>() SyncApp syncApp = syncAppService.getOne(new LambdaQueryWrapper<SyncApp>()
@ -1334,7 +1334,7 @@ public class SyncThirdDataServiceImpl extends SyncBaseThirdSxAbstract implements
.eq(SyncApp::getApp_key, appKey) .eq(SyncApp::getApp_key, appKey)
.eq(SyncApp::getApp_secret,sign)); .eq(SyncApp::getApp_secret,sign));
if (syncApp == null) { if (syncApp == null) {
return new ThirdApiRes().fail(1001, _("签名有误!")); return new ThirdApiRes().fail(1001, I18nUtil._("签名有误!"));
} }
Date tenMinutesAgo = Date.from(Instant.now().minus(Duration.ofMinutes(30)));//校准误差 Date tenMinutesAgo = Date.from(Instant.now().minus(Duration.ofMinutes(30)));//校准误差
Date refreshDate = DateUtil.date(tenMinutesAgo); Date refreshDate = DateUtil.date(tenMinutesAgo);