| | |
| | | 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.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.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | public class SH2023PushService13 implements PushService11 { |
| | | public class SH2023PushService13 implements PushService13 { |
| | | |
| | | |
| | | @Autowired |
| | |
| | | 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("------->>>>粮库管理 接口模块上报结束"); |
| | | } |
| | |
| | | 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); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | 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); |
| | |
| | | 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) { |
| | | if (Constant.CZBZ_I.equals(data.getCzbz())) { |
| | | |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | 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) { |
| | | if (Constant.CZBZ_I.equals(data.getCzbz())) { |
| | | |
| | | 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); |
| | |
| | | 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) { |
| | | if (Constant.CZBZ_I.equals(data.getCzbz())) { |
| | | |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | 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) { |
| | | if (Constant.CZBZ_I.equals(data.getCzbz())) { |
| | | |
| | | 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); |
| | |
| | | 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) { |
| | | if (Constant.CZBZ_I.equals(data.getCzbz())) { |
| | | |
| | | 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); |
| | |
| | | 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); |
| | | //更新状态 |
| | |
| | | log.error("-----上海市平台2023版:未获取到视频监控,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteCategory(Constant.API_CATEGORY_13); |
| | | param.setInteId(SH2023Constant.SH_2023_API_CODE_1311); |
| | | |
| | | SH2023Api1311 shApi1311; |
| | | List<SH2023Api1311> list = new ArrayList<>(); |
| | | ResponseDto responseDto; |
| | | 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); |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | log.error("-----上海市平台2023版:未获取到粮情设备配置,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteCategory(Constant.API_CATEGORY_13); |
| | | param.setInteId(SH2023Constant.SH_2023_API_CODE_2103); |
| | | |
| | | SH2023Api2103 shApi2103; |
| | | List<SH2023Api2103> list = new ArrayList<>(); |
| | | ResponseDto responseDto; |
| | | 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())) { |
| | | param.setBizId(infoData.getDataId()); |
| | | responseDto = apiRemoteService.pushData(param, shApi2103); |
| | | if (responseDto.getSuccess() == 0) { |
| | | if (Constant.CZBZ_I.equals(infoData.getCzbz())) { |
| | | |
| | | data.setCzbz(Constant.CZBZ_U); |
| | | apiInfoDataRep.save(data); |
| | | infoData.setCzbz(Constant.CZBZ_U); |
| | | apiInfoDataRep.save(infoData); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |