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