From d490c866d02659609270472e533235705613e5ab Mon Sep 17 00:00:00 2001 From: WS <1143478319@qq.com> Date: 星期三, 23 八月 2023 10:20:52 +0800 Subject: [PATCH] 上海接口接数据上报-轮换计划 轮换计划明细 --- src/main/java/com/fzzy/push/sh2023/SH2023PushService13.java | 97 +++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 79 insertions(+), 18 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..39c62dd 100644 --- a/src/main/java/com/fzzy/push/sh2023/SH2023PushService13.java +++ b/src/main/java/com/fzzy/push/sh2023/SH2023PushService13.java @@ -1,5 +1,6 @@ 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; @@ -9,12 +10,17 @@ import com.fzzy.api.service.PushService11; import com.fzzy.api.view.repository.*; import com.fzzy.otherview.sh2023.dto.ShApi1311; +import com.fzzy.otherview.sh2023.dto.ShApi2103; 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.codehaus.jackson.JsonParser; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import java.util.ArrayList; import java.util.List; /** @@ -50,6 +56,8 @@ private Api1309Rep api1309Rep; @Autowired private Api1310Rep api1310Rep; + @Autowired + private ApiInfoDataRep apiInfoDataRep; @Override public String getProtocol() { @@ -86,7 +94,7 @@ log.error("-----涓婃捣甯傚钩鍙�2023鐗堬細鏈幏鍙栧埌瀹夊叏绠$悊锛屼笉鎺ㄩ��-----"); return; } - + param.setInteId(SH2023Constant.SH_2023_API_CODE_1301); //鎺ㄩ�侊紝鏁版嵁涓洪泦鍚堝舰寮� ResponseDto responseDto = apiRemoteService.pushData(param, list); if (responseDto.getSuccess() == 0) { @@ -114,7 +122,7 @@ log.error("-----涓婃捣甯傚钩鍙�2023鐗堬細鏈幏鍙栧埌娓╂箍搴︽娴嬶紝涓嶆帹閫�-----"); return; } - + param.setInteId(SH2023Constant.SH_2023_API_CODE_1302); //鎺ㄩ�侊紝鏁版嵁涓洪泦鍚堝舰寮� ResponseDto responseDto = apiRemoteService.pushData(param, list); if (responseDto.getSuccess() == 0) { @@ -141,7 +149,7 @@ log.error("-----涓婃捣甯傚钩鍙�2023鐗堬細鏈幏鍙栧埌瀹宠櫕妫�娴嬶紝涓嶆帹閫�-----"); return; } - + param.setInteId(SH2023Constant.SH_2023_API_CODE_1303); //鎺ㄩ�侊紝鏁版嵁涓洪泦鍚堝舰寮� ResponseDto responseDto = apiRemoteService.pushData(param, list); if (responseDto.getSuccess() == 0) { @@ -169,7 +177,7 @@ log.error("-----涓婃捣甯傚钩鍙�2023鐗堬細鏈幏鍙栧埌姘斾綋妫�娴嬶紝涓嶆帹閫�-----"); return; } - + param.setInteId(SH2023Constant.SH_2023_API_CODE_1304); //鎺ㄩ�侊紝鏁版嵁涓洪泦鍚堝舰寮� ResponseDto responseDto = apiRemoteService.pushData(param, list); if (responseDto.getSuccess() == 0) { @@ -197,7 +205,7 @@ log.error("-----涓婃捣甯傚钩鍙�2023鐗堬細鏈幏鍙栧埌閫氶浣滀笟锛屼笉鎺ㄩ��-----"); return; } - + param.setInteId(SH2023Constant.SH_2023_API_CODE_1305); //鎺ㄩ�侊紝鏁版嵁涓洪泦鍚堝舰寮� ResponseDto responseDto = apiRemoteService.pushData(param, list); if (responseDto.getSuccess() == 0) { @@ -225,7 +233,7 @@ log.error("-----涓婃捣甯傚钩鍙�2023鐗堬細鏈幏鍙栧埌鐔忚捀浣滀笟锛屼笉鎺ㄩ��-----"); return; } - + param.setInteId(SH2023Constant.SH_2023_API_CODE_1306); //鎺ㄩ�侊紝鏁版嵁涓洪泦鍚堝舰寮� ResponseDto responseDto = apiRemoteService.pushData(param, list); if (responseDto.getSuccess() == 0) { @@ -252,7 +260,7 @@ log.error("-----涓婃捣甯傚钩鍙�2023鐗堬細鏈幏鍙栧埌浠撳唴瑙嗛鍥惧儚锛屼笉鎺ㄩ��-----"); return; } - + param.setInteId(SH2023Constant.SH_2023_API_CODE_1307); //鎺ㄩ�侊紝鏁版嵁涓洪泦鍚堝舰寮� ResponseDto responseDto = apiRemoteService.pushData(param, list); if (responseDto.getSuccess() == 0) { @@ -296,17 +304,51 @@ log.error("-----涓婃捣甯傚钩鍙�2023鐗堬細鏈幏鍙栧埌璐ㄦ鏁版嵁锛屼笉鎺ㄩ��-----"); return; } - + param.setInteId(SH2023Constant.SH_2023_API_CODE_1310); //鎺ㄩ�侊紝鏁版嵁涓洪泦鍚堝舰寮� ResponseDto responseDto = apiRemoteService.pushData(param, list); if (responseDto.getSuccess() == 0) { //鎺ㄩ�佹垚鍔燂紝鏇存柊鏁版嵁涓婁紶鐘舵�� for (Api1310 data : list) { if (Constant.CZBZ_I.equals(data.getCzbz())) { - data.setCzbz(Constant.CZBZ_U); //鏇存柊鐘舵�� api1310Rep.save(data); + } + } + } + } + + /** + * 1311 瑙嗛鐩戞帶鎺ュ彛 + */ + public void pushData1311(ApiRemoteService apiRemoteService, ApiParam param) { + // 鑾峰彇 瑙嗛鐩戞帶鎺ュ彛鏁版嵁 + List<ApiInfoData> items = apiInfoDataRep.getDataByInteId(SH2023Constant.SH_2023_API_CODE_1311); + + if (null == items || items.isEmpty()) { + log.error("-----涓婃捣甯傚钩鍙�2023鐗堬細鏈幏鍙栧埌瑙嗛鐩戞帶锛屼笉鎺ㄩ��-----"); + return; + } + param.setInteId(SH2023Constant.SH_2023_API_CODE_1311); + + SH2023Api1311 shApi1311; + List<SH2023Api1311> list = new ArrayList<>(); + for (ApiInfoData infoData : items) { + shApi1311 = JSONObject.parseObject(infoData.getData(), SH2023Api1311.class); + shApi1311.setCzbz(infoData.getCzbz()); + shApi1311.setZhgxsj(infoData.getUpdateTime()); + list.add(shApi1311); + } + //鎺ㄩ�侊紝鏁版嵁涓洪泦鍚堝舰寮� + ResponseDto responseDto = apiRemoteService.pushData(param, list); + if (responseDto.getSuccess() == 0) { + //鎺ㄩ�佹垚鍔燂紝鏇存柊鏁版嵁涓婁紶鐘舵�� + for (ApiInfoData data : items) { + if (Constant.CZBZ_I.equals(data.getCzbz())) { + + data.setCzbz(Constant.CZBZ_U); + apiInfoDataRep.save(data); } } } @@ -314,18 +356,37 @@ } /** - * 1311 瑙嗛鐩戞帶鎺ュ彛 - */ - public void pushData1311(ApiRemoteService apiRemoteService, ApiParam param) { - // todo - - } - - /** * 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.setInteId(SH2023Constant.SH_2023_API_CODE_2103); + SH2023Api2103 shApi2103; + List<SH2023Api2103> list = new ArrayList<>(); + for (ApiInfoData infoData : items) { + shApi2103 = JSONObject.parseObject(infoData.getData(), SH2023Api2103.class); + shApi2103.setZhgxsj(infoData.getUpdateTime()); + list.add(shApi2103); + } + //鎺ㄩ�侊紝鏁版嵁涓洪泦鍚堝舰寮� + ResponseDto responseDto = apiRemoteService.pushData(param, list); + if (responseDto.getSuccess() == 0) { + //鎺ㄩ�佹垚鍔燂紝鏇存柊鏁版嵁涓婁紶鐘舵�� + for (ApiInfoData data : items) { + if (Constant.CZBZ_I.equals(data.getCzbz())) { + + data.setCzbz(Constant.CZBZ_U); + apiInfoDataRep.save(data); + } + } + } } } -- Gitblit v1.9.3