From 54b61daf58037385cb8d46404b12a95786c7c8f3 Mon Sep 17 00:00:00 2001 From: czt <czt18638530771@163.com> Date: 星期五, 28 六月 2024 19:55:06 +0800 Subject: [PATCH] 上海省平台协议-增加数据相符性接口 --- src/main/java/com/fzzy/otherview/sh2023/pr/SHApi2103PR.java | 45 +++++++++++++++++++++------------------------ 1 files changed, 21 insertions(+), 24 deletions(-) diff --git a/src/main/java/com/fzzy/otherview/sh2023/pr/SHApi2103PR.java b/src/main/java/com/fzzy/otherview/sh2023/pr/SHApi2103PR.java index ccb10da..6fd38c7 100644 --- a/src/main/java/com/fzzy/otherview/sh2023/pr/SHApi2103PR.java +++ b/src/main/java/com/fzzy/otherview/sh2023/pr/SHApi2103PR.java @@ -130,7 +130,7 @@ infoData.setUpdateTime(new Date()); infoData.setDataId(data.getHwdm()); infoData.setData(JSON.toJSONString(data)); - infoData.setCzbz(Constant.CZBZ_I); + infoData.setCzbz(data.getCzbz()); infoData.setRemarks("澶囨敞淇℃伅"); apiInfoDataRep.save(infoData); @@ -158,7 +158,7 @@ @Expose public String pushData(List<SH2023Api2103> items) { - ResponseDto responseDto; + String result = ""; String kqdm = items.get(0).getHwdm().substring(0, 21); @@ -169,7 +169,7 @@ } //灏佽鍙傛暟 - ApiParam param = new ApiParam(apiConf, "21", SH2023Constant.SH_2023_API_CODE_2103); + ApiParam param = new ApiParam(apiConf, Constant.API_CATEGORY_13, SH2023Constant.SH_2023_API_CODE_2103); //鑾峰彇瀹炵幇鎺ュ彛 ApiRemoteService apiService = apiPushManager.getApiRemoteService(param.getPushProtocol()); @@ -177,31 +177,28 @@ return "绯荤粺娌℃湁褰撳墠鎺ㄩ�佸崗璁厤缃紝鎵ц澶辫触"; } - //鎺ㄩ�侊紝鏁版嵁涓洪泦鍚堝舰寮� - responseDto = apiService.pushData(param, apiConf, items); - if (responseDto.getSuccess() == 0) { - //鎺ㄩ�佹垚鍔燂紝鏇存柊鏁版嵁涓婁紶鐘舵�� + ResponseDto responseDto; + ApiInfoData infoData; + for (SH2023Api2103 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.getHwdm()); + infoData.setKqdm(data.getHwdm().substring(0, 21)); + infoData.setInteType("21"); + infoData.setInteId(SH2023Constant.SH_2023_API_CODE_2103); + infoData.setUpdateTime(new Date()); + infoData.setDataId(data.getHwdm()); - ApiInfoData infoData; - for (SH2023Api2103 data : items) { - - infoData = new ApiInfoData(); - infoData.setId(data.getHwdm()); - infoData.setKqdm(data.getHwdm().substring(0, 21)); - infoData.setInteType("21"); - infoData.setInteId(SH2023Constant.SH_2023_API_CODE_2103); - infoData.setUpdateTime(new Date()); - infoData.setDataId(data.getHwdm()); - - infoData.setCzbz(Constant.CZBZ_U); - infoData.setData(JSON.toJSONString(data)); - - apiInfoDataRep.save(infoData); - + infoData.setCzbz(Constant.CZBZ_U); + data.setCzbz(Constant.CZBZ_U); + infoData.setData(JSON.toJSONString(data)); + apiInfoDataRep.save(infoData); + } } result += responseDto.toString(); } return result; } - } -- Gitblit v1.9.3