From 86f687fe84d34d9291ed9e5c6ea45e04e11e3be2 Mon Sep 17 00:00:00 2001 From: czt <czt18638530771@163.com> Date: 星期日, 21 四月 2024 15:54:04 +0800 Subject: [PATCH] 国家统一编码-财务接口增加统一编码字段及页面调整 --- src/main/java/com/fzzy/push/sh2023/SH2023PushService13.java | 192 ++++++++++++++++++++++++++++++----------------- 1 files changed, 123 insertions(+), 69 deletions(-) diff --git a/src/main/java/com/fzzy/push/sh2023/SH2023PushService13.java b/src/main/java/com/fzzy/push/sh2023/SH2023PushService13.java index 26dd3f6..2cd9125 100644 --- a/src/main/java/com/fzzy/push/sh2023/SH2023PushService13.java +++ b/src/main/java/com/fzzy/push/sh2023/SH2023PushService13.java @@ -1,20 +1,19 @@ package com.fzzy.push.sh2023; +import com.alibaba.fastjson.JSONObject; import com.fzzy.api.Constant; import com.fzzy.api.data.ApiParam; import com.fzzy.api.data.PushProtocol; import com.fzzy.api.dto.ResponseDto; import com.fzzy.api.entity.*; import com.fzzy.api.service.ApiRemoteService; -import com.fzzy.api.service.PushService11; +import com.fzzy.api.service.PushService13; import com.fzzy.api.view.repository.*; -import com.fzzy.otherview.sh2023.dto.ShApi1311; -import com.fzzy.otherview.sh2023.repository.ShApi1311Rep; -import com.fzzy.push.impl.ComPushService11; +import com.fzzy.push.sh2023.dto.SH2023Api1311; +import com.fzzy.push.sh2023.dto.SH2023Api2103; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; - import java.util.List; /** @@ -25,7 +24,7 @@ */ @Slf4j @Component -public class SH2023PushService13 implements PushService11 { +public class SH2023PushService13 implements PushService13 { @Autowired @@ -50,6 +49,8 @@ private Api1309Rep api1309Rep; @Autowired private Api1310Rep api1310Rep; + @Autowired + private ApiInfoDataRep apiInfoDataRep; @Override public String getProtocol() { @@ -60,17 +61,17 @@ public void pushData(ApiParam param) { log.info("------->>>>绮簱绠$悊 鎺ュ彛妯″潡涓婃姤寮�濮�"); - this.pushData1301(apiRemoteService, param); - this.pushData1302(apiRemoteService, param); - this.pushData1303(apiRemoteService, param); - this.pushData1304(apiRemoteService, param); - this.pushData1305(apiRemoteService, param); - this.pushData1306(apiRemoteService, param); - this.pushData1307(apiRemoteService, param); - this.pushData1308(apiRemoteService, param); - this.pushData1309(apiRemoteService, param); - this.pushData1310(apiRemoteService, param); - this.pushData1311(apiRemoteService, param); +// this.pushData1301(apiRemoteService, param); +// this.pushData1302(apiRemoteService, param); +// this.pushData1303(apiRemoteService, param); +// this.pushData1304(apiRemoteService, param); +// this.pushData1305(apiRemoteService, param); +// this.pushData1306(apiRemoteService, param); +// this.pushData1307(apiRemoteService, param); +// this.pushData1308(apiRemoteService, param); +// this.pushData1309(apiRemoteService, param); +// this.pushData1310(apiRemoteService, param); +// this.pushData1311(apiRemoteService, param); log.info("------->>>>绮簱绠$悊 鎺ュ彛妯″潡涓婃姤缁撴潫"); } @@ -86,12 +87,14 @@ log.error("-----涓婃捣甯傚钩鍙�2023鐗堬細鏈幏鍙栧埌瀹夊叏绠$悊锛屼笉鎺ㄩ��-----"); return; } + param.setInteCategory(Constant.API_CATEGORY_13); + param.setInteId(SH2023Constant.SH_2023_API_CODE_1301); - //鎺ㄩ�侊紝鏁版嵁涓洪泦鍚堝舰寮� - ResponseDto responseDto = apiRemoteService.pushData(param, list); - if (responseDto.getSuccess() == 0) { - //鎺ㄩ�佹垚鍔燂紝鏇存柊鏁版嵁涓婁紶鐘舵�� - for (Api1301 data : list) { + ResponseDto responseDto; + for (Api1301 data : list) { + param.setBizId(data.getBizId()); + responseDto = apiRemoteService.pushData(param, data); + if (responseDto.getSuccess() == 0) { if (Constant.CZBZ_I.equals(data.getCzbz())) { data.setCzbz(Constant.CZBZ_U); @@ -100,7 +103,6 @@ } } } - } /** @@ -114,12 +116,14 @@ log.error("-----涓婃捣甯傚钩鍙�2023鐗堬細鏈幏鍙栧埌娓╂箍搴︽娴嬶紝涓嶆帹閫�-----"); return; } + param.setInteCategory(Constant.API_CATEGORY_13); + param.setInteId(SH2023Constant.SH_2023_API_CODE_1302); - //鎺ㄩ�侊紝鏁版嵁涓洪泦鍚堝舰寮� - ResponseDto responseDto = apiRemoteService.pushData(param, list); - if (responseDto.getSuccess() == 0) { - //鎺ㄩ�佹垚鍔燂紝鏇存柊鏁版嵁涓婁紶鐘舵�� - for (Api1302 data : list) { + ResponseDto responseDto; + for (Api1302 data : list) { + param.setBizId(data.getBizId()); + responseDto = apiRemoteService.pushData(param, data); + if (responseDto.getSuccess() == 0) { if (Constant.CZBZ_I.equals(data.getCzbz())) { data.setCzbz(Constant.CZBZ_U); @@ -141,21 +145,21 @@ log.error("-----涓婃捣甯傚钩鍙�2023鐗堬細鏈幏鍙栧埌瀹宠櫕妫�娴嬶紝涓嶆帹閫�-----"); return; } + param.setInteCategory(Constant.API_CATEGORY_13); + param.setInteId(SH2023Constant.SH_2023_API_CODE_1303); - //鎺ㄩ�侊紝鏁版嵁涓洪泦鍚堝舰寮� - ResponseDto responseDto = apiRemoteService.pushData(param, list); - if (responseDto.getSuccess() == 0) { - //鎺ㄩ�佹垚鍔燂紝鏇存柊鏁版嵁涓婁紶鐘舵�� - for (Api1303 data : list) { + ResponseDto responseDto; + for (Api1303 data : list) { + param.setBizId(data.getBizId()); + responseDto = apiRemoteService.pushData(param, data); + if (responseDto.getSuccess() == 0) { if (Constant.CZBZ_I.equals(data.getCzbz())) { - data.setCzbz(Constant.CZBZ_U); //鏇存柊鐘舵�� api1303Rep.save(data); } } } - } /** @@ -169,14 +173,15 @@ log.error("-----涓婃捣甯傚钩鍙�2023鐗堬細鏈幏鍙栧埌姘斾綋妫�娴嬶紝涓嶆帹閫�-----"); return; } + param.setInteCategory(Constant.API_CATEGORY_13); + param.setInteId(SH2023Constant.SH_2023_API_CODE_1304); - //鎺ㄩ�侊紝鏁版嵁涓洪泦鍚堝舰寮� - ResponseDto responseDto = apiRemoteService.pushData(param, list); - if (responseDto.getSuccess() == 0) { - //鎺ㄩ�佹垚鍔燂紝鏇存柊鏁版嵁涓婁紶鐘舵�� - for (Api1304 data : list) { + ResponseDto responseDto; + for (Api1304 data : list) { + param.setBizId(data.getBizId()); + responseDto = apiRemoteService.pushData(param, data); + if (responseDto.getSuccess() == 0) { if (Constant.CZBZ_I.equals(data.getCzbz())) { - data.setCzbz(Constant.CZBZ_U); //鏇存柊鐘舵�� api1304Rep.save(data); @@ -197,21 +202,21 @@ log.error("-----涓婃捣甯傚钩鍙�2023鐗堬細鏈幏鍙栧埌閫氶浣滀笟锛屼笉鎺ㄩ��-----"); return; } + param.setInteCategory(Constant.API_CATEGORY_13); + param.setInteId(SH2023Constant.SH_2023_API_CODE_1305); - //鎺ㄩ�侊紝鏁版嵁涓洪泦鍚堝舰寮� - ResponseDto responseDto = apiRemoteService.pushData(param, list); - if (responseDto.getSuccess() == 0) { - //鎺ㄩ�佹垚鍔燂紝鏇存柊鏁版嵁涓婁紶鐘舵�� - for (Api1305 data : list) { + ResponseDto responseDto; + for (Api1305 data : list) { + param.setBizId(data.getBizId()); + responseDto = apiRemoteService.pushData(param, data); + if (responseDto.getSuccess() == 0) { if (Constant.CZBZ_I.equals(data.getCzbz())) { - data.setCzbz(Constant.CZBZ_U); //鏇存柊鐘舵�� api1305Rep.save(data); } } } - } /** @@ -225,14 +230,15 @@ log.error("-----涓婃捣甯傚钩鍙�2023鐗堬細鏈幏鍙栧埌鐔忚捀浣滀笟锛屼笉鎺ㄩ��-----"); return; } + param.setInteCategory(Constant.API_CATEGORY_13); + param.setInteId(SH2023Constant.SH_2023_API_CODE_1306); - //鎺ㄩ�侊紝鏁版嵁涓洪泦鍚堝舰寮� - ResponseDto responseDto = apiRemoteService.pushData(param, list); - if (responseDto.getSuccess() == 0) { - //鎺ㄩ�佹垚鍔燂紝鏇存柊鏁版嵁涓婁紶鐘舵�� - for (Api1306 data : list) { + ResponseDto responseDto; + for (Api1306 data : list) { + param.setBizId(data.getBizId()); + responseDto = apiRemoteService.pushData(param, data); + if (responseDto.getSuccess() == 0) { if (Constant.CZBZ_I.equals(data.getCzbz())) { - data.setCzbz(Constant.CZBZ_U); //鏇存柊鐘舵�� api1306Rep.save(data); @@ -252,14 +258,15 @@ log.error("-----涓婃捣甯傚钩鍙�2023鐗堬細鏈幏鍙栧埌浠撳唴瑙嗛鍥惧儚锛屼笉鎺ㄩ��-----"); return; } + param.setInteCategory(Constant.API_CATEGORY_13); + param.setInteId(SH2023Constant.SH_2023_API_CODE_1307); - //鎺ㄩ�侊紝鏁版嵁涓洪泦鍚堝舰寮� - ResponseDto responseDto = apiRemoteService.pushData(param, list); - if (responseDto.getSuccess() == 0) { - //鎺ㄩ�佹垚鍔燂紝鏇存柊鏁版嵁涓婁紶鐘舵�� - for (Api1307 data : list) { + ResponseDto responseDto; + for (Api1307 data : list) { + param.setBizId(data.getBizId()); + responseDto = apiRemoteService.pushData(param, data); + if (responseDto.getSuccess() == 0) { if (Constant.CZBZ_I.equals(data.getCzbz())) { - data.setCzbz(Constant.CZBZ_U); //鏇存柊鐘舵�� api1307Rep.save(data); @@ -296,36 +303,83 @@ log.error("-----涓婃捣甯傚钩鍙�2023鐗堬細鏈幏鍙栧埌璐ㄦ鏁版嵁锛屼笉鎺ㄩ��-----"); return; } + param.setInteCategory(Constant.API_CATEGORY_13); + param.setInteId(SH2023Constant.SH_2023_API_CODE_1310); - //鎺ㄩ�侊紝鏁版嵁涓洪泦鍚堝舰寮� - ResponseDto responseDto = apiRemoteService.pushData(param, list); - if (responseDto.getSuccess() == 0) { - //鎺ㄩ�佹垚鍔燂紝鏇存柊鏁版嵁涓婁紶鐘舵�� - for (Api1310 data : list) { + ResponseDto responseDto; + for (Api1310 data : list) { + param.setBizId(data.getBizId()); + responseDto = apiRemoteService.pushData(param, data); + if (responseDto.getSuccess() == 0) { if (Constant.CZBZ_I.equals(data.getCzbz())) { - data.setCzbz(Constant.CZBZ_U); //鏇存柊鐘舵�� api1310Rep.save(data); } } } - } /** * 1311 瑙嗛鐩戞帶鎺ュ彛 */ public void pushData1311(ApiRemoteService apiRemoteService, ApiParam param) { - // todo + // 鑾峰彇 瑙嗛鐩戞帶鎺ュ彛鏁版嵁 + List<ApiInfoData> items = apiInfoDataRep.getDataByInteId(SH2023Constant.SH_2023_API_CODE_1311); + if (null == items || items.isEmpty()) { + log.error("-----涓婃捣甯傚钩鍙�2023鐗堬細鏈幏鍙栧埌瑙嗛鐩戞帶锛屼笉鎺ㄩ��-----"); + return; + } + param.setInteCategory(Constant.API_CATEGORY_13); + param.setInteId(SH2023Constant.SH_2023_API_CODE_1311); + + SH2023Api1311 shApi1311; + ResponseDto responseDto; + for (ApiInfoData infoData : items) { + shApi1311 = JSONObject.parseObject(infoData.getData(), SH2023Api1311.class); + shApi1311.setZhgxsj(infoData.getUpdateTime()); + + param.setBizId(infoData.getDataId()); + responseDto = apiRemoteService.pushData(param, shApi1311); + if (responseDto.getSuccess() == 0) { + if (Constant.CZBZ_I.equals(infoData.getCzbz())) { + infoData.setCzbz(Constant.CZBZ_U); + apiInfoDataRep.save(infoData); + } + } + } } /** * 2103 绮儏璁惧閰嶇疆 */ public void pushData2103(ApiRemoteService apiRemoteService, ApiParam param) { - //TODO + // 鑾峰彇绮儏璁惧閰嶇疆鏁版嵁 + List<ApiInfoData> items = apiInfoDataRep.getDataByInteId(SH2023Constant.SH_2023_API_CODE_2103); + + if (null == items || items.isEmpty()) { + log.error("-----涓婃捣甯傚钩鍙�2023鐗堬細鏈幏鍙栧埌绮儏璁惧閰嶇疆锛屼笉鎺ㄩ��-----"); + return; + } + param.setInteCategory(Constant.API_CATEGORY_13); + param.setInteId(SH2023Constant.SH_2023_API_CODE_2103); + + SH2023Api2103 shApi2103; + ResponseDto responseDto; + for (ApiInfoData infoData : items) { + shApi2103 = JSONObject.parseObject(infoData.getData(), SH2023Api2103.class); + shApi2103.setZhgxsj(infoData.getUpdateTime()); + param.setBizId(infoData.getDataId()); + responseDto = apiRemoteService.pushData(param, shApi2103); + if (responseDto.getSuccess() == 0) { + if (Constant.CZBZ_I.equals(infoData.getCzbz())) { + + infoData.setCzbz(Constant.CZBZ_U); + apiInfoDataRep.save(infoData); + } + } + } } } -- Gitblit v1.9.3