| | |
| | | package com.fzzy.push.nx2023; |
| | | |
| | | 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.PushService13; |
| | | import com.fzzy.api.view.repository.*; |
| | | import com.fzzy.push.impl.ComPushService13; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 宁夏省平台2023版-基础数据上传 |
| | |
| | | @Autowired |
| | | private NX2023ApiRemoteService apiRemoteService; |
| | | @Autowired |
| | | private Api1301Rep api1301Rep; |
| | | @Autowired |
| | | private Api1302Rep api1302Rep; |
| | | @Autowired |
| | | private Api1303Rep api1303Rep; |
| | | @Autowired |
| | | private Api1304Rep api1304Rep; |
| | | @Autowired |
| | | private Api1305Rep api1305Rep; |
| | | @Autowired |
| | | private Api1306Rep api1306Rep; |
| | | @Autowired |
| | | private Api1307Rep api1307Rep; |
| | | @Autowired |
| | | private Api1308Rep api1308Rep; |
| | | @Autowired |
| | | private Api1309Rep api1309Rep; |
| | | @Autowired |
| | | private Api1310Rep api1310Rep; |
| | | private ComPushService13 pushService13; |
| | | |
| | | @Override |
| | | public String getProtocol() { |
| | |
| | | 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); |
| | | pushService13.pushData1301(apiRemoteService, param); |
| | | //粮情 |
| | | pushService13.pushData1302(apiRemoteService, param); |
| | | |
| | | //气体 |
| | | pushService13.pushData1304(apiRemoteService, param); |
| | | |
| | | //虫害 |
| | | pushService13.pushData1303(apiRemoteService, param); |
| | | |
| | | //通风 |
| | | pushService13.pushData1305(apiRemoteService, param); |
| | | |
| | | //熏蒸 |
| | | pushService13.pushData1306(apiRemoteService, param); |
| | | //熏蒸 |
| | | pushService13.pushData1307(apiRemoteService, param); |
| | | |
| | | pushService13.pushData1308(apiRemoteService, param); |
| | | |
| | | pushService13.pushData1309(apiRemoteService, param); |
| | | |
| | | //质检 |
| | | pushService13.pushData1310(apiRemoteService, param); |
| | | |
| | | log.info("------->>>>粮库管理 接口模块上报结束"); |
| | | } |
| | | |
| | | /** |
| | | * 1301 安全管理 |
| | | */ |
| | | public void pushData1301(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //获取安全管理 |
| | | List<Api1301> list = api1301Rep.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd()); |
| | | |
| | | if (null == list || list.isEmpty()) { |
| | | log.error("-----宁夏省平台2023版:未获取到安全管理,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteCategory(Constant.API_CATEGORY_13); |
| | | param.setInteId(NX2023Constant.NX_2023_API_CODE_1301); |
| | | |
| | | 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); |
| | | //更新状态 |
| | | api1301Rep.save(data); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 1302 温湿度检测 |
| | | */ |
| | | public void pushData1302(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //获取温湿度检测 |
| | | List<Api1302> list = api1302Rep.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd()); |
| | | |
| | | if (null == list || list.isEmpty()) { |
| | | log.error("-----宁夏省平台2023版:未获取到温湿度检测,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteCategory(Constant.API_CATEGORY_13); |
| | | param.setInteId(NX2023Constant.NX_2023_API_CODE_1302); |
| | | |
| | | 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); |
| | | //更新状态 |
| | | api1302Rep.save(data); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 1303 害虫检测 |
| | | */ |
| | | public void pushData1303(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //获取害虫检测 |
| | | List<Api1303> list = api1303Rep.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd()); |
| | | |
| | | if (null == list || list.isEmpty()) { |
| | | log.error("-----宁夏省平台2023版:未获取到害虫检测,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteCategory(Constant.API_CATEGORY_13); |
| | | param.setInteId(NX2023Constant.NX_2023_API_CODE_1303); |
| | | |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 1304 气体检测 |
| | | */ |
| | | public void pushData1304(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //获取气体检测 |
| | | List<Api1304> list = api1304Rep.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd()); |
| | | |
| | | if (null == list || list.isEmpty()) { |
| | | log.error("-----宁夏省平台2023版:未获取到气体检测,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteCategory(Constant.API_CATEGORY_13); |
| | | param.setInteId(NX2023Constant.NX_2023_API_CODE_1304); |
| | | |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 1305 通风作业 |
| | | */ |
| | | public void pushData1305(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //获取通风作业 |
| | | List<Api1305> list = api1305Rep.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd()); |
| | | |
| | | if (null == list || list.isEmpty()) { |
| | | log.error("-----宁夏省平台2023版:未获取到通风作业,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteCategory(Constant.API_CATEGORY_13); |
| | | param.setInteId(NX2023Constant.NX_2023_API_CODE_1305); |
| | | |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 1306 熏蒸作业 |
| | | */ |
| | | public void pushData1306(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //获取熏蒸作业 |
| | | List<Api1306> list = api1306Rep.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd()); |
| | | |
| | | if (null == list || list.isEmpty()) { |
| | | log.error("-----宁夏省平台2023版:未获取到熏蒸作业,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteCategory(Constant.API_CATEGORY_13); |
| | | param.setInteId(NX2023Constant.NX_2023_API_CODE_1306); |
| | | |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 1307 仓内视频图像 |
| | | */ |
| | | public void pushData1307(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //获取仓内视频图像 |
| | | List<Api1307> list = api1307Rep.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd()); |
| | | |
| | | if (null == list || list.isEmpty()) { |
| | | log.error("-----宁夏省平台2023版:未获取到仓内视频图像,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteCategory(Constant.API_CATEGORY_13); |
| | | param.setInteId(NX2023Constant.NX_2023_API_CODE_1307); |
| | | |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 1308 视频监控异常事件告警 |
| | | */ |
| | | public void pushData1308(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //视频监控异常事件告警 |
| | | List<Api1308> list = api1308Rep.findAll(); |
| | | |
| | | if (null == list || list.isEmpty()) { |
| | | log.error("-----宁夏省平台2023版:未获取到视频监控异常事件告警,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteCategory(Constant.API_CATEGORY_13); |
| | | param.setInteId(NX2023Constant.NX_2023_API_CODE_1308); |
| | | |
| | | ResponseDto responseDto; |
| | | for (Api1308 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); |
| | | //更新状态 |
| | | api1308Rep.save(data); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 1309 违规预警信息 |
| | | */ |
| | | public void pushData1309(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //获取仓内视频图像 |
| | | List<Api1309> list = api1309Rep.findAll(); |
| | | |
| | | if (null == list || list.isEmpty()) { |
| | | log.error("-----宁夏省平台2023版:未获取到违规预警信息,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteCategory(Constant.API_CATEGORY_13); |
| | | param.setInteId(NX2023Constant.NX_2023_API_CODE_1307); |
| | | |
| | | ResponseDto responseDto; |
| | | for (Api1309 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); |
| | | //更新状态 |
| | | api1309Rep.save(data); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 1310 质检数据 |
| | | */ |
| | | public void pushData1310(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //获取质检数据 |
| | | List<Api1310> list = api1310Rep.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd()); |
| | | |
| | | if (null == list || list.isEmpty()) { |
| | | log.error("-----宁夏省平台2023版:未获取到质检数据,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteCategory(Constant.API_CATEGORY_13); |
| | | param.setInteId(NX2023Constant.NX_2023_API_CODE_1310); |
| | | |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |