|  |  |  | 
|---|
|  |  |  | import com.fzzy.api.dto.ResponseDto; | 
|---|
|  |  |  | import com.fzzy.api.entity.*; | 
|---|
|  |  |  | import com.fzzy.api.service.ApiRemoteService; | 
|---|
|  |  |  | import com.fzzy.api.view.repository.Api1302Rep; | 
|---|
|  |  |  | import com.fzzy.api.view.repository.Api1303Rep; | 
|---|
|  |  |  | import com.fzzy.api.view.repository.Api1304Rep; | 
|---|
|  |  |  | import com.fzzy.api.view.repository.Api1310Rep; | 
|---|
|  |  |  | import com.fzzy.push.shjdjw2023.ShjdjwApiRemoteService2023; | 
|---|
|  |  |  | import com.fzzy.api.view.repository.*; | 
|---|
|  |  |  | import lombok.extern.slf4j.Slf4j; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.stereotype.Service; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | 
|---|
|  |  |  | public class ComPushService13 { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private Api1301Rep apiRep1301; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private Api1302Rep apiRep1302; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private Api1303Rep apiRep1303; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private Api1304Rep apiRep1304; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private Api1305Rep apiRep1305; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private Api1306Rep apiRep1306; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private Api1307Rep apiRep1307; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private Api1308Rep apiRep1308; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private Api1309Rep apiRep1309; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private Api1310Rep apiRep1310; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private ApiInfoDataRep apiInfoDataRep; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void pushData1301(ApiRemoteService apiRemoteService, ApiParam param) { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //获取需要推送的数据 | 
|---|
|  |  |  | List<Api1301> items = apiRep1301.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (null == items || items.isEmpty()) { | 
|---|
|  |  |  | log.info("-------------没有安全信息数据需要推送-----------"); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | param.setInteCategory(Constant.API_CATEGORY_13); | 
|---|
|  |  |  | param.setInteId(Constant.API_CODE_1301); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | ResponseDto responseDto; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | for (Api1301 data : items) { | 
|---|
|  |  |  | 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); | 
|---|
|  |  |  | apiRep1301.save(data); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void pushData1302(ApiRemoteService apiRemoteService, ApiParam param) { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //获取需要推送的数据 | 
|---|
|  |  |  | List<Api1302> items = apiRep1302.findPushData(param.getKqdm()); | 
|---|
|  |  |  | List<Api1302> items = apiRep1302.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (null == items || items.isEmpty()) { | 
|---|
|  |  |  | log.info("-------------没有粮情数据需要推送-----------"); | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void pushData1303(ApiRemoteService apiRemoteService, ApiParam param) { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //获取需要推送的数据 | 
|---|
|  |  |  | List<Api1303> items = apiRep1303.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (null == items || items.isEmpty()) { | 
|---|
|  |  |  | log.info("-------------没有虫害检测数据表表需要推送-----------"); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | param.setInteCategory(Constant.API_CATEGORY_13); | 
|---|
|  |  |  | param.setInteId(Constant.API_CODE_1303); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | ResponseDto responseDto; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | for (Api1303 data : items) { | 
|---|
|  |  |  | param.setBizId(data.getBizId()); | 
|---|
|  |  |  | responseDto = apiRemoteService.pushData(param, data); | 
|---|
|  |  |  | if (responseDto.getSuccess() == 0) { | 
|---|
|  |  |  | if (Constant.CZBZ_I.equals(data.getCzbz())) { | 
|---|
|  |  |  | apiRep1303.updateStatus(data.getHcjcdh(), Constant.CZBZ_U); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void pushData1304(ApiRemoteService apiRemoteService, ApiParam param) { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //获取需要推送的数据 | 
|---|
|  |  |  | List<Api1304> items = apiRep1304.findPushData(param.getKqdm()); | 
|---|
|  |  |  | List<Api1304> items = apiRep1304.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (null == items || items.isEmpty()) { | 
|---|
|  |  |  | log.info("-------------没有气体检测数据表需要推送-----------"); | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | param.setInteCategory(Constant.API_CATEGORY_13); | 
|---|
|  |  |  | param.setInteId(Constant.API_CODE_1302); | 
|---|
|  |  |  | param.setInteId(Constant.API_CODE_1304); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | ResponseDto responseDto; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void pushData1303(ApiRemoteService apiRemoteService, ApiParam param) { | 
|---|
|  |  |  | public void pushData1305(ApiRemoteService apiRemoteService, ApiParam param) { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //获取需要推送的数据 | 
|---|
|  |  |  | List<Api1303> items = apiRep1303.findPushData(param.getKqdm()); | 
|---|
|  |  |  | List<Api1305> items = apiRep1305.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (null == items || items.isEmpty()) { | 
|---|
|  |  |  | log.info("-------------没有虫害检测数据表表需要推送-----------"); | 
|---|
|  |  |  | log.info("-------------没有通风作业数据需要推送-----------"); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | param.setInteCategory(Constant.API_CATEGORY_13); | 
|---|
|  |  |  | param.setInteId(Constant.API_CODE_1302); | 
|---|
|  |  |  | param.setInteId(Constant.API_CODE_1305); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | ResponseDto responseDto; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | for (Api1303 data : items) { | 
|---|
|  |  |  | for (Api1305 data : items) { | 
|---|
|  |  |  | param.setBizId(data.getBizId()); | 
|---|
|  |  |  | responseDto = apiRemoteService.pushData(param, data); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (responseDto.getSuccess() == 0) { | 
|---|
|  |  |  | if (Constant.CZBZ_I.equals(data.getCzbz())) { | 
|---|
|  |  |  | apiRep1303.updateStatus(data.getHcjcdh(), Constant.CZBZ_U); | 
|---|
|  |  |  | apiRep1305.updateStatus(data.getTfzydh(), Constant.CZBZ_U); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void pushData1306(ApiRemoteService apiRemoteService, ApiParam param) { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //获取需要推送的数据 | 
|---|
|  |  |  | List<Api1306> items = apiRep1306.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (null == items || items.isEmpty()) { | 
|---|
|  |  |  | log.info("-------------没有熏蒸作业数据需要推送-----------"); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | param.setInteCategory(Constant.API_CATEGORY_13); | 
|---|
|  |  |  | param.setInteId(Constant.API_CODE_1306); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | ResponseDto responseDto; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | for (Api1306 data : items) { | 
|---|
|  |  |  | param.setBizId(data.getBizId()); | 
|---|
|  |  |  | responseDto = apiRemoteService.pushData(param, data); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (responseDto.getSuccess() == 0) { | 
|---|
|  |  |  | if (Constant.CZBZ_I.equals(data.getCzbz())) { | 
|---|
|  |  |  | apiRep1306.updateStatus(data.getXzzydh(), Constant.CZBZ_U); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void pushData1307(ApiRemoteService apiRemoteService, ApiParam param) { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //获取需要推送的数据 | 
|---|
|  |  |  | List<Api1307> items = apiRep1307.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (null == items || items.isEmpty()) { | 
|---|
|  |  |  | log.info("-------------没有仓内图像作业数据需要推送-----------"); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | param.setInteCategory(Constant.API_CATEGORY_13); | 
|---|
|  |  |  | param.setInteId(Constant.API_CODE_1307); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | ResponseDto responseDto; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | for (Api1307 data : items) { | 
|---|
|  |  |  | param.setBizId(data.getBizId()); | 
|---|
|  |  |  | responseDto = apiRemoteService.pushData(param, data); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (responseDto.getSuccess() == 0) { | 
|---|
|  |  |  | if (Constant.CZBZ_I.equals(data.getCzbz())) { | 
|---|
|  |  |  | data.setCzbz("u"); | 
|---|
|  |  |  | apiRep1307.save(data); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void pushData1308(ApiRemoteService apiRemoteService, ApiParam param) { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //获取需要推送的数据 | 
|---|
|  |  |  | List<Api1308> items = apiRep1308.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (null == items || items.isEmpty()) { | 
|---|
|  |  |  | log.info("-------------没有视频监控异常事件数据需要推送-----------"); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | param.setInteCategory(Constant.API_CATEGORY_13); | 
|---|
|  |  |  | param.setInteId(Constant.API_CODE_1308); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | ResponseDto responseDto; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | for (Api1308 data : items) { | 
|---|
|  |  |  | param.setBizId(data.getBizId()); | 
|---|
|  |  |  | responseDto = apiRemoteService.pushData(param, data); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (responseDto.getSuccess() == 0) { | 
|---|
|  |  |  | if (Constant.CZBZ_I.equals(data.getCzbz())) { | 
|---|
|  |  |  | data.setCzbz("u"); | 
|---|
|  |  |  | apiRep1308.save(data); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void pushData1309(ApiRemoteService apiRemoteService, ApiParam param) { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //获取需要推送的数据 | 
|---|
|  |  |  | List<Api1309> items = apiRep1309.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (null == items || items.isEmpty()) { | 
|---|
|  |  |  | log.info("-------------没有违规预警数据需要推送-----------"); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | param.setInteCategory(Constant.API_CATEGORY_13); | 
|---|
|  |  |  | param.setInteId(Constant.API_CODE_1309); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | ResponseDto responseDto; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | for (Api1309 data : items) { | 
|---|
|  |  |  | param.setBizId(data.getBizId()); | 
|---|
|  |  |  | responseDto = apiRemoteService.pushData(param, data); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (responseDto.getSuccess() == 0) { | 
|---|
|  |  |  | if (Constant.CZBZ_I.equals(data.getCzbz())) { | 
|---|
|  |  |  | data.setCzbz("u"); | 
|---|
|  |  |  | apiRep1309.save(data); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | public void pushData1310(ApiRemoteService apiRemoteService, ApiParam param) { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //获取需要推送的数据 | 
|---|
|  |  |  | List<Api1310> items = apiRep1310.findPushData(param.getKqdm()); | 
|---|
|  |  |  | List<Api1310> items = apiRep1310.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (null == items || items.isEmpty()) { | 
|---|
|  |  |  | log.info("-------------没有质检数据需要推送-----------"); | 
|---|