From 954480166aad6d24c9e9889906a0edf762f0da2a Mon Sep 17 00:00:00 2001 From: czt <czt18638530771@163.com> Date: 星期一, 10 二月 2025 16:32:56 +0800 Subject: [PATCH] 优化库存同步 --- src/main/java/com/fzzy/otherview/sh2023/pr/SHApi2102PR.java | 30 ++++++++++++------------------ 1 files changed, 12 insertions(+), 18 deletions(-) diff --git a/src/main/java/com/fzzy/otherview/sh2023/pr/SHApi2102PR.java b/src/main/java/com/fzzy/otherview/sh2023/pr/SHApi2102PR.java index 6babe56..4d35b98 100644 --- a/src/main/java/com/fzzy/otherview/sh2023/pr/SHApi2102PR.java +++ b/src/main/java/com/fzzy/otherview/sh2023/pr/SHApi2102PR.java @@ -151,7 +151,7 @@ @Expose public String pushData(List<SH2023Api2102> items) { - ResponseDto responseDto; + String result = ""; String kqdm = items.get(0).getDrhwdm().substring(0, 21); @@ -162,7 +162,7 @@ } //灏佽鍙傛暟 - ApiParam param = new ApiParam(apiConf, "21", SH2023Constant.SH_2023_API_CODE_2102); + ApiParam param = new ApiParam(apiConf, "90", Constant.API_CODE_9103); //鑾峰彇瀹炵幇鎺ュ彛 ApiRemoteService apiService = apiPushManager.getApiRemoteService(param.getPushProtocol()); @@ -170,27 +170,21 @@ return "绯荤粺娌℃湁褰撳墠鎺ㄩ�佸崗璁厤缃紝鎵ц澶辫触"; } - //鎺ㄩ�侊紝鏁版嵁涓洪泦鍚堝舰寮� - responseDto = apiService.pushData(param, apiConf, items); - if (responseDto.getSuccess() == 0) { - //鎺ㄩ�佹垚鍔燂紝鏇存柊鏁版嵁涓婁紶鐘舵�� - ApiInfoData infoData; - for (SH2023Api2102 data : items) { + ResponseDto responseDto; + ApiInfoData infoData; + for (SH2023Api2102 data : items) { + //鎺ㄩ�侊紝鏁版嵁涓洪泦鍚堝舰寮� + responseDto = apiService.pushData(param, apiConf, data); + if (responseDto.getSuccess() == 0) { + //鎺ㄩ�佹垚鍔燂紝鏇存柊鏁版嵁涓婁紶鐘舵�� if (Constant.CZBZ_I.equals(data.getCzbz())) { - - infoData = new ApiInfoData(); - infoData.setId(data.getDrdh()); - infoData.setKqdm(data.getDrhwdm().substring(0, 21)); - infoData.setInteType("21"); - infoData.setInteId(SH2023Constant.SH_2023_API_CODE_2102); - infoData.setUpdateTime(new Date()); - infoData.setDataId(data.getDrdh()); - + List<ApiInfoData> apiInfoList = apiInfoDataRep.getDataByInteAndData(SH2023Constant.SH_2023_API_CODE_2102, data.getDrdh(), data.getDrdw()); data.setCzbz(Constant.CZBZ_U); + infoData = apiInfoList.get(0); + infoData.setUpdateTime(new Date()); infoData.setCzbz(Constant.CZBZ_U); infoData.setData(JSON.toJSONString(data)); - apiInfoDataRep.save(infoData); } } -- Gitblit v1.9.3