|  |  |  | 
|---|
|  |  |  | package com.fzzy.push.impl; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.alibaba.fastjson.JSON; | 
|---|
|  |  |  | import com.alibaba.fastjson.JSONArray; | 
|---|
|  |  |  | import com.alibaba.fastjson.JSONObject; | 
|---|
|  |  |  | import com.fzzy.api.Constant; | 
|---|
|  |  |  | import com.fzzy.api.data.ApiParam; | 
|---|
|  |  |  | 
|---|
|  |  |  | import com.fzzy.api.service.ApiRemoteService; | 
|---|
|  |  |  | import com.fzzy.api.view.repository.*; | 
|---|
|  |  |  | import com.fzzy.push.gd2022.dto.Gd2022Api1023; | 
|---|
|  |  |  | import com.fzzy.push.gd2022.dto.Gd2022Api1023Dtl; | 
|---|
|  |  |  | import com.fzzy.push.gd2022.dto.Gd2022Api1023People; | 
|---|
|  |  |  | import com.fzzy.push.gd2022.dto.Gd2022Api1023Way; | 
|---|
|  |  |  | import com.fzzy.push.gd2023.dto.Gd2023Api1023; | 
|---|
|  |  |  | import com.fzzy.push.sh2023.SH2023Constant; | 
|---|
|  |  |  | import com.fzzy.push.sh2023.dto.SH2023Api1115; | 
|---|
|  |  |  | import com.fzzy.push.sh2023.dto.SH2023Api1311; | 
|---|
|  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private ApiInfoDataRep apiInfoDataRep; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private Api9201Rep api9201Rep; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private Api9109Rep api9109Rep; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private Api9110Rep api9110Rep; | 
|---|
|  |  |  | 
|---|
|  |  |  | private Api9116Rep api9116Rep; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /*==========上海市平台定制接口 -- 开始==========*/ | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 9101 数据相符性接口--上海市平台 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public void pushData9101(ApiRemoteService apiRemoteService, ApiParam param) { | 
|---|
|  |  |  | // 获取 视频监控接口数据 | 
|---|
|  |  |  | // 获取 数据相符性接口数据 | 
|---|
|  |  |  | List<ApiInfoData> items = apiInfoDataRep.getDataByInteId(Constant.API_CODE_9101); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (null == items || items.isEmpty()) { | 
|---|
|  |  |  | 
|---|
|  |  |  | /*==========上海市平台定制接口 -- 结束==========*/ | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /*==========广东省平台定制接口 -- 开始==========*/ | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 9201 熏蒸备案接口 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public void pushData9201(ApiRemoteService apiRemoteService, ApiParam param) { | 
|---|
|  |  |  | //获取熏蒸备案信息 | 
|---|
|  |  |  | List<ApiInfoData> items = apiInfoDataRep.getDataByInteId(Constant.API_CODE_9201); | 
|---|
|  |  |  | //        List<ApiInfoData> items = apiInfoDataRep.getDataByInteId(Constant.API_CODE_9201); | 
|---|
|  |  |  | List<Api9201> items = api9201Rep.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (null == items || items.isEmpty()) { | 
|---|
|  |  |  | log.error("-----广东省平台2022版:未获取到熏蒸备案信息,不推送-----"); | 
|---|
|  |  |  | log.error("-----广东省平台2023版:未获取到熏蒸备案信息,不推送-----"); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | param.setInteCategory(Constant.API_CATEGORY_90); | 
|---|
|  |  |  | param.setInteId(Constant.API_CODE_9201); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Gd2022Api1023 gd2022Api1023; | 
|---|
|  |  |  | ResponseDto responseDto; | 
|---|
|  |  |  | for (ApiInfoData infoData : items) { | 
|---|
|  |  |  | gd2022Api1023 = JSONObject.parseObject(infoData.getData(), Gd2022Api1023.class); | 
|---|
|  |  |  | gd2022Api1023.setZhgxsj(infoData.getUpdateTime()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | param.setBizId(infoData.getDataId()); | 
|---|
|  |  |  | responseDto = apiRemoteService.pushData(param, gd2022Api1023); | 
|---|
|  |  |  | for (Api9201 api9201 : items) { | 
|---|
|  |  |  | api9201.setDtls(JSONArray.parseArray(api9201.getDtl(), Gd2022Api1023Dtl.class)); | 
|---|
|  |  |  | api9201.setPeoples(JSONArray.parseArray(api9201.getPeople(), Gd2022Api1023People.class)); | 
|---|
|  |  |  | api9201.setWays(JSONArray.parseArray(api9201.getWay(), Gd2022Api1023Way.class)); | 
|---|
|  |  |  | responseDto = apiRemoteService.pushData(param, api9201); | 
|---|
|  |  |  | if (responseDto.getSuccess() == 0) { | 
|---|
|  |  |  | if (Constant.CZBZ_I.equals(infoData.getCzbz())) { | 
|---|
|  |  |  | infoData.setCzbz(Constant.CZBZ_U); | 
|---|
|  |  |  | gd2022Api1023.setCzbz(Constant.CZBZ_U); | 
|---|
|  |  |  | infoData.setData(JSON.toJSONString(gd2022Api1023)); | 
|---|
|  |  |  | apiInfoDataRep.save(infoData); | 
|---|
|  |  |  | if (Constant.CZBZ_I.equals(api9201.getCzbz())) { | 
|---|
|  |  |  | api9201.setCzbz(Constant.CZBZ_U); | 
|---|
|  |  |  | api9201Rep.save(api9201); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|