From 9607a83c355cb61a35b412019091374bb7d6829c Mon Sep 17 00:00:00 2001 From: YYC <1833023622@qq.com> Date: 星期二, 08 八月 2023 16:41:11 +0800 Subject: [PATCH] 武汉军粮省平台-推送基础信息 --- src/main/java/com/fzzy/push/whhpjl/WhjlPushService11.java | 257 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 243 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/fzzy/push/whhpjl/WhjlPushService11.java b/src/main/java/com/fzzy/push/whhpjl/WhjlPushService11.java index 479be20..ecf3f89 100644 --- a/src/main/java/com/fzzy/push/whhpjl/WhjlPushService11.java +++ b/src/main/java/com/fzzy/push/whhpjl/WhjlPushService11.java @@ -11,11 +11,12 @@ import com.fzzy.api.service.PushService11; import com.fzzy.api.view.repository.ApiInfoDataRep; import com.fzzy.whjl.WhjlConstant; -import com.fzzy.whjl.dto.WhjlApi1101; +import com.fzzy.whjl.dto.*; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; + import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -47,18 +48,18 @@ //鎺ㄩ�佸啗宸ヤ紒涓氫俊鎭� this.pushData1101(apiRemoteService, param); - //TODO 鎺ㄩ�佸啗宸ョ珯鐐逛俊鎭� - - //TODO 鎺ㄩ�佸啗绮汉鍛樹俊鎭� - - //TODO 鎺ㄩ�佷粨鎴夸俊鎭� - - //TODO 鎺ㄩ�佸粧闂翠俊鎭� - - //TODO 鎺ㄩ�佽揣浣嶄俊鎭� - - //TODO 鎺ㄩ�佷粨鍌ㄨ澶囦俊鎭� - + // 鎺ㄩ�佸啗宸ョ珯鐐逛俊鎭� + this.pushData1102(apiRemoteService, param); + // 鎺ㄩ�佸啗绮汉鍛樹俊鎭� + this.pushData1103(apiRemoteService, param); + // 鎺ㄩ�佷粨鎴夸俊鎭� + this.pushData1105(apiRemoteService, param); + // 鎺ㄩ�佸粧闂翠俊鎭� + this.pushData1106(apiRemoteService, param); + // 鎺ㄩ�佽揣浣嶄俊鎭� + this.pushData1107(apiRemoteService, param); + // 鎺ㄩ�佷粨鍌ㄨ澶囦俊鎭� + this.pushData1111(apiRemoteService, param); log.info("姝︽眽鍐涚伯鐪佸钩鍙�--->>>鍩虹淇℃伅 涓婃姤缁撴潫"); } @@ -92,7 +93,235 @@ if (responseDto.getSuccess() == 0) { //鎺ㄩ�佹垚鍔燂紝鏇存柊鏁版嵁涓婁紶鐘舵�� for (ApiInfoData data : items) { - if(Constant.CZBZ_I.equals(data.getCzbz())){ + if (Constant.CZBZ_I.equals(data.getCzbz())) { + + data.setCzbz(Constant.CZBZ_U); + apiInfoDataRep.save(data); + } + } + } + } + + /** + * 1102 鍐涗緵绔欑偣淇℃伅 + */ + private void pushData1102(ApiRemoteService apiRemoteService, ApiParam param) { + + //鑾峰彇鍐涘伐浼佷笟淇℃伅 + List<ApiInfoData> items = apiInfoDataRep.getDataByInteId(WhjlConstant.API_CODE_1102); + + if (null == items || items.isEmpty()) { + return; + } + param.setInteCategory(WhjlConstant.API_CATEGORY_11); + param.setInteId(WhjlConstant.API_CODE_1102); + List<WhjlApi1102> list = new ArrayList<>(); + WhjlApi1102 whjlApi1102; + for (ApiInfoData infoData : items) { + whjlApi1102 = JSONObject.parseObject(infoData.getData(), WhjlApi1102.class); + whjlApi1102.setKqdm(infoData.getKqdm()); + whjlApi1102.setCzbz(infoData.getCzbz()); + whjlApi1102.setUpdateTime(infoData.getUpdateTime()); + whjlApi1102.setBizId(infoData.getDataId()); + list.add(whjlApi1102); + } + + //鎺ㄩ�侊紝鏁版嵁涓洪泦鍚堝舰寮� + 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); + } + } + } + } + + /** + * 1103 鍐涘伐浜哄憳淇℃伅 + */ + private void pushData1103(ApiRemoteService apiRemoteService, ApiParam param) { + + //鑾峰彇鍐涘伐浼佷笟淇℃伅 + List<ApiInfoData> items = apiInfoDataRep.getDataByInteId(WhjlConstant.API_CODE_1103); + + if (null == items || items.isEmpty()) { + return; + } + param.setInteCategory(WhjlConstant.API_CATEGORY_11); + param.setInteId(WhjlConstant.API_CODE_1103); + List<WhjlApi1103> list = new ArrayList<>(); + WhjlApi1103 whjlApi1103; + for (ApiInfoData infoData : items) { + whjlApi1103 = JSONObject.parseObject(infoData.getData(), WhjlApi1103.class); + whjlApi1103.setKqdm(infoData.getKqdm()); + whjlApi1103.setCzbz(infoData.getCzbz()); + whjlApi1103.setUpdateTime(infoData.getUpdateTime()); + whjlApi1103.setBizId(infoData.getDataId()); + list.add(whjlApi1103); + } + + //鎺ㄩ�侊紝鏁版嵁涓洪泦鍚堝舰寮� + 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); + } + } + } + } + + /** + * 1105 浠撴埧淇℃伅 + */ + private void pushData1105(ApiRemoteService apiRemoteService, ApiParam param) { + + //鑾峰彇鍐涘伐浼佷笟淇℃伅 + List<ApiInfoData> items = apiInfoDataRep.getDataByInteId(WhjlConstant.API_CODE_1105); + + if (null == items || items.isEmpty()) { + return; + } + param.setInteCategory(WhjlConstant.API_CATEGORY_11); + param.setInteId(WhjlConstant.API_CODE_1105); + List<WhjlApi1105> list = new ArrayList<>(); + WhjlApi1105 whjlApi1105; + for (ApiInfoData infoData : items) { + whjlApi1105 = JSONObject.parseObject(infoData.getData(), WhjlApi1105.class); + whjlApi1105.setKqdm(infoData.getKqdm()); + whjlApi1105.setCzbz(infoData.getCzbz()); + whjlApi1105.setUpdateTime(infoData.getUpdateTime()); + whjlApi1105.setBizId(infoData.getDataId()); + list.add(whjlApi1105); + } + + //鎺ㄩ�侊紝鏁版嵁涓洪泦鍚堝舰寮� + 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); + } + } + } + } + + /** + * 1106 寤掗棿淇℃伅 + */ + private void pushData1106(ApiRemoteService apiRemoteService, ApiParam param) { + + //鑾峰彇鍐涘伐浼佷笟淇℃伅 + List<ApiInfoData> items = apiInfoDataRep.getDataByInteId(WhjlConstant.API_CODE_1106); + + if (null == items || items.isEmpty()) { + return; + } + param.setInteCategory(WhjlConstant.API_CATEGORY_11); + param.setInteId(WhjlConstant.API_CODE_1106); + List<WhjlApi1106> list = new ArrayList<>(); + WhjlApi1106 whjlApi1106; + for (ApiInfoData infoData : items) { + whjlApi1106 = JSONObject.parseObject(infoData.getData(), WhjlApi1106.class); + whjlApi1106.setKqdm(infoData.getKqdm()); + whjlApi1106.setCzbz(infoData.getCzbz()); + whjlApi1106.setUpdateTime(infoData.getUpdateTime()); + whjlApi1106.setBizId(infoData.getDataId()); + list.add(whjlApi1106); + } + + //鎺ㄩ�侊紝鏁版嵁涓洪泦鍚堝舰寮� + 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); + } + } + } + } + + /** + * 1107 璐т綅淇℃伅 + */ + private void pushData1107(ApiRemoteService apiRemoteService, ApiParam param) { + + //鑾峰彇鍐涘伐浼佷笟淇℃伅 + List<ApiInfoData> items = apiInfoDataRep.getDataByInteId(WhjlConstant.API_CODE_1107); + + if (null == items || items.isEmpty()) { + return; + } + param.setInteCategory(WhjlConstant.API_CATEGORY_11); + param.setInteId(WhjlConstant.API_CODE_1107); + List<WhjlApi1107> list = new ArrayList<>(); + WhjlApi1107 whjlApi1107; + for (ApiInfoData infoData : items) { + whjlApi1107 = JSONObject.parseObject(infoData.getData(), WhjlApi1107.class); + whjlApi1107.setKqdm(infoData.getKqdm()); + whjlApi1107.setCzbz(infoData.getCzbz()); + whjlApi1107.setUpdateTime(infoData.getUpdateTime()); + whjlApi1107.setBizId(infoData.getDataId()); + list.add(whjlApi1107); + } + + //鎺ㄩ�侊紝鏁版嵁涓洪泦鍚堝舰寮� + 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); + } + } + } + } + + /** + * 1111 浠撳偍璁惧淇℃伅 + */ + private void pushData1111(ApiRemoteService apiRemoteService, ApiParam param) { + + //鑾峰彇鍐涘伐浼佷笟淇℃伅 + List<ApiInfoData> items = apiInfoDataRep.getDataByInteId(WhjlConstant.API_CODE_1111); + + if (null == items || items.isEmpty()) { + return; + } + param.setInteCategory(WhjlConstant.API_CATEGORY_11); + param.setInteId(WhjlConstant.API_CODE_1111); + List<WhjlApi1111> list = new ArrayList<>(); + WhjlApi1111 whjlApi1111; + for (ApiInfoData infoData : items) { + whjlApi1111 = JSONObject.parseObject(infoData.getData(), WhjlApi1111.class); + whjlApi1111.setKqdm(infoData.getKqdm()); + whjlApi1111.setCzbz(infoData.getCzbz()); + whjlApi1111.setUpdateTime(infoData.getUpdateTime()); + whjlApi1111.setBizId(infoData.getDataId()); + list.add(whjlApi1111); + } + + //鎺ㄩ�侊紝鏁版嵁涓洪泦鍚堝舰寮� + 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