| | |
| | | package com.fzzy.push.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.fzzy.api.Constant; |
| | | import com.fzzy.api.data.ApiParam; |
| | |
| | | import com.fzzy.api.entity.ApiInfoData; |
| | | import com.fzzy.api.service.ApiRemoteService; |
| | | import com.fzzy.api.view.repository.ApiInfoDataRep; |
| | | import com.fzzy.push.gd2022.ApiCodeConstant; |
| | | import com.fzzy.push.gd2022.dto.Gd2022Api1023; |
| | | import com.fzzy.push.gd2022.dto.Gd2022Api2001; |
| | | import com.fzzy.push.gd2022.dto.Gd2022Api2002; |
| | | import com.fzzy.push.sh2023.SH2023Constant; |
| | | import com.fzzy.push.sh2023.dto.SH2023Api1115; |
| | | import com.fzzy.push.sh2023.dto.SH2023Api1311; |
| | | import com.fzzy.push.sh2023.dto.SH2023Api2103; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | private ApiInfoDataRep apiInfoDataRep; |
| | | |
| | | /*==========上海市平台定制接口==========*/ |
| | | /** |
| | | * 1115 数据相符性接口--上海市平台 |
| | | */ |
| | | public void pushData1115(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | // 获取 视频监控接口数据 |
| | | List<ApiInfoData> items = apiInfoDataRep.getDataByInteId(SH2023Constant.SH_2023_API_CODE_1115); |
| | | |
| | | if (null == items || items.isEmpty()) { |
| | | log.error("-----上海市平台2023版:未获取到数据相符性,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteCategory(Constant.API_CATEGORY_11); |
| | | param.setInteId(SH2023Constant.SH_2023_API_CODE_1115); |
| | | |
| | | SH2023Api1115 shApi1115; |
| | | ResponseDto responseDto; |
| | | for (ApiInfoData infoData : items) { |
| | | shApi1115 = JSONObject.parseObject(infoData.getData(), SH2023Api1115.class); |
| | | shApi1115.setZhgxsj(infoData.getUpdateTime()); |
| | | |
| | | param.setBizId(infoData.getDataId()); |
| | | responseDto = apiRemoteService.pushData(param, shApi1115); |
| | | if (responseDto.getSuccess() == 0) { |
| | | if (Constant.CZBZ_I.equals(infoData.getCzbz())) { |
| | | infoData.setCzbz(Constant.CZBZ_U); |
| | | shApi1115.setCzbz(Constant.CZBZ_U); |
| | | infoData.setData(JSON.toJSONString(shApi1115)); |
| | | apiInfoDataRep.save(infoData); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | /** |
| | | * 2101 检斤单--上海市平台 |
| | | */ |
| | |
| | | //TODO |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | /*==========广东省平台定制接口==========*/ |
| | | /** |
| | | * 1023 熏蒸备案接口 |
| | | */ |
| | | public void pushData1023(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //获取熏蒸备案信息 |
| | | List<ApiInfoData> items = apiInfoDataRep.getDataByInteId(ApiCodeConstant.API_1023); |
| | | |
| | | if (null == items || items.isEmpty()) { |
| | | log.error("-----广东省平台2022版:未获取到熏蒸备案信息,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteCategory("21"); |
| | | param.setInteId(ApiCodeConstant.API_1023); |
| | | |
| | | 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); |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 2001 封仓确认单 |
| | | */ |
| | | public void pushData2001(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | // 获取 视频监控接口数据 |
| | | List<ApiInfoData> items = apiInfoDataRep.getDataByInteId(ApiCodeConstant.API_2001); |
| | | |
| | | if (null == items || items.isEmpty()) { |
| | | log.error("-----广东省平台2022版:未获取到封仓确认单,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteCategory("21"); |
| | | param.setInteId(ApiCodeConstant.API_2001); |
| | | |
| | | Gd2022Api2001 gd2022Api2001; |
| | | ResponseDto responseDto; |
| | | for (ApiInfoData infoData : items) { |
| | | gd2022Api2001 = JSONObject.parseObject(infoData.getData(), Gd2022Api2001.class); |
| | | gd2022Api2001.setZhgxsj(infoData.getUpdateTime()); |
| | | |
| | | param.setBizId(infoData.getDataId()); |
| | | responseDto = apiRemoteService.pushData(param, gd2022Api2001); |
| | | if (responseDto.getSuccess() == 0) { |
| | | if (Constant.CZBZ_I.equals(infoData.getCzbz())) { |
| | | infoData.setCzbz(Constant.CZBZ_U); |
| | | gd2022Api2001.setCzbz(Constant.CZBZ_U); |
| | | infoData.setData(JSON.toJSONString(gd2022Api2001)); |
| | | apiInfoDataRep.save(infoData); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 2002 出清确认单 |
| | | */ |
| | | public void pushData2002(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | // 获取 视频监控接口数据 |
| | | List<ApiInfoData> items = apiInfoDataRep.getDataByInteId(ApiCodeConstant.API_2002); |
| | | |
| | | if (null == items || items.isEmpty()) { |
| | | log.error("-----广东省平台2022版:未获取到出清确认单,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteCategory("21"); |
| | | param.setInteId(ApiCodeConstant.API_2002); |
| | | |
| | | Gd2022Api2002 gd2022Api2002; |
| | | ResponseDto responseDto; |
| | | for (ApiInfoData infoData : items) { |
| | | gd2022Api2002 = JSONObject.parseObject(infoData.getData(), Gd2022Api2002.class); |
| | | gd2022Api2002.setZhgxsj(infoData.getUpdateTime()); |
| | | |
| | | param.setBizId(infoData.getDataId()); |
| | | responseDto = apiRemoteService.pushData(param, gd2022Api2002); |
| | | if (responseDto.getSuccess() == 0) { |
| | | if (Constant.CZBZ_I.equals(infoData.getCzbz())) { |
| | | infoData.setCzbz(Constant.CZBZ_U); |
| | | gd2022Api2002.setCzbz(Constant.CZBZ_U); |
| | | infoData.setData(JSON.toJSONString(gd2022Api2002)); |
| | | apiInfoDataRep.save(infoData); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |