From 5f588423dc2300a7eeafdaf00ad7459f1c625a54 Mon Sep 17 00:00:00 2001 From: YYC <1833023622@qq.com> Date: 星期二, 22 八月 2023 11:09:11 +0800 Subject: [PATCH] 上海数据上报3 --- src/main/java/com/fzzy/push/sh2023/SH2023PushService12.java | 43 ++++++++++++++++++++++++++++++++++++------- 1 files changed, 36 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/fzzy/push/sh2023/SH2023PushService12.java b/src/main/java/com/fzzy/push/sh2023/SH2023PushService12.java index 454c99e..db90a98 100644 --- a/src/main/java/com/fzzy/push/sh2023/SH2023PushService12.java +++ b/src/main/java/com/fzzy/push/sh2023/SH2023PushService12.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,10 +10,12 @@ import com.fzzy.api.service.PushService11; import com.fzzy.api.view.repository.*; import com.fzzy.otherview.sh2023.dto.ShApi2101; +import com.fzzy.push.sh2023.dto.SH2023Api2101; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import java.util.ArrayList; import java.util.List; /** @@ -52,6 +55,8 @@ private Api1211Rep api1211Rep; @Autowired private Api1212Rep api1212Rep; + @Autowired + private ApiInfoDataRep apiInfoDataRep; @Override public String getProtocol() { @@ -102,7 +107,7 @@ log.error("-----涓婃捣甯傚钩鍙�2023鐗堬細鏈幏鍙栧埌鍚堝悓淇℃伅锛屼笉鎺ㄩ��-----"); return; } - + param.setInteId(SH2023Constant.SH_2023_API_CODE_1201); //鎺ㄩ�侊紝鏁版嵁涓洪泦鍚堝舰寮� ResponseDto responseDto = apiRemoteService.pushData(param, list); if (responseDto.getSuccess() == 0) { @@ -129,7 +134,7 @@ log.error("-----涓婃捣甯傚钩鍙�2023鐗堬細鏈幏鍙栧埌绮鍏ュ簱淇℃伅锛屼笉鎺ㄩ��-----"); return; } - + param.setInteId(SH2023Constant.SH_2023_API_CODE_1202); //鎺ㄩ�侊紝鏁版嵁涓洪泦鍚堝舰寮� ResponseDto responseDto = apiRemoteService.pushData(param, list); if (responseDto.getSuccess() == 0) { @@ -156,7 +161,7 @@ log.error("-----涓婃捣甯傚钩鍙�2023鐗堬細鏈幏鍙栧埌绮鍏ュ簱妫�楠屼俊鎭紝涓嶆帹閫�-----"); return; } - + param.setInteId(SH2023Constant.SH_2023_API_CODE_1203); //鎺ㄩ�侊紝鏁版嵁涓洪泦鍚堝舰寮� ResponseDto responseDto = apiRemoteService.pushData(param, list); if (responseDto.getSuccess() == 0) { @@ -184,7 +189,7 @@ log.error("-----涓婃捣甯傚钩鍙�2023鐗堬細鏈幏鍙栧埌绮鍏ュ簱缁撶畻淇℃伅锛屼笉鎺ㄩ��-----"); return; } - + param.setInteId(SH2023Constant.SH_2023_API_CODE_1204); //鎺ㄩ�侊紝鏁版嵁涓洪泦鍚堝舰寮� ResponseDto responseDto = apiRemoteService.pushData(param, list); if (responseDto.getSuccess() == 0) { @@ -212,7 +217,7 @@ log.error("-----涓婃捣甯傚钩鍙�2023鐗堬細鏈幏鍙栧埌绮鍑哄簱淇℃伅锛屼笉鎺ㄩ��-----"); return; } - + param.setInteId(SH2023Constant.SH_2023_API_CODE_1205); //鎺ㄩ�侊紝鏁版嵁涓洪泦鍚堝舰寮� ResponseDto responseDto = apiRemoteService.pushData(param, list); if (responseDto.getSuccess() == 0) { @@ -239,7 +244,7 @@ log.error("-----涓婃捣甯傚钩鍙�2023鐗堬細鏈幏鍙栧埌绮鍑哄簱缁撶畻淇℃伅锛屼笉鎺ㄩ��-----"); return; } - + param.setInteId(SH2023Constant.SH_2023_API_CODE_1206); //鎺ㄩ�侊紝鏁版嵁涓洪泦鍚堝舰寮� ResponseDto responseDto = apiRemoteService.pushData(param, list); if (responseDto.getSuccess() == 0) { @@ -308,7 +313,31 @@ * 2101 妫�鏂ゅ崟 */ public void pushData2101(ApiRemoteService apiRemoteService, ApiParam param) { - // todo + + //鑾峰彇 妫�鏂ゅ崟淇℃伅 + List<ApiInfoData> items = apiInfoDataRep.getDataByInteId(SH2023Constant.SH_2023_API_CODE_2101); + + SH2023Api2101 shApi2101; + List<SH2023Api2101> list = new ArrayList<>(); + + param.setInteId(SH2023Constant.SH_2023_API_CODE_2101); + for (ApiInfoData infoData : items) { + shApi2101 = JSONObject.parseObject(infoData.getData(), SH2023Api2101.class); + shApi2101.setCzbz(infoData.getCzbz()); + shApi2101.setZhgxsj(infoData.getUpdateTime()); + list.add(shApi2101); + } + 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