| | |
| | | package com.fzzy.push.sh2023; |
| | | |
| | | 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.PushService12; |
| | | import com.fzzy.api.view.repository.*; |
| | | import com.fzzy.push.impl.ComPushService12; |
| | | import com.fzzy.push.impl.ComPushService99; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 上海市平台2023版-基础数据上传 |
| | |
| | | @Autowired |
| | | private SH2023ApiRemoteService apiRemoteService; |
| | | @Autowired |
| | | private Api1201Rep api1201Rep; |
| | | private ComPushService12 pushService12; |
| | | @Autowired |
| | | private Api1202Rep api1202Rep; |
| | | @Autowired |
| | | private Api1203Rep api1203Rep; |
| | | @Autowired |
| | | private Api1204Rep api1204Rep; |
| | | @Autowired |
| | | private Api1205Rep api1205Rep; |
| | | @Autowired |
| | | private Api1206Rep api1206Rep; |
| | | @Autowired |
| | | private Api1207Rep api1207Rep; |
| | | @Autowired |
| | | private Api1208Rep api1208Rep; |
| | | @Autowired |
| | | private Api1209Rep api1209Rep; |
| | | @Autowired |
| | | private Api1210Rep api1210Rep; |
| | | @Autowired |
| | | private Api1211Rep api1211Rep; |
| | | @Autowired |
| | | private Api1212Rep api1212Rep; |
| | | @Autowired |
| | | private ApiInfoDataRep apiInfoDataRep; |
| | | |
| | | private ComPushService99 pushService99; |
| | | @Override |
| | | public String getProtocol() { |
| | | return PushProtocol.SB_SH_2023.getCode(); |
| | |
| | | public void pushData(ApiParam param) { |
| | | log.info("------->>>>粮食购销 接口模块上报开始"); |
| | | |
| | | // //推送合同信息 |
| | | // this.pushData1201(apiRemoteService, param); |
| | | // //粮食入库信息 |
| | | // this.pushData1202(apiRemoteService, param); |
| | | // //粮食入库检验信息 |
| | | // this.pushData1203(apiRemoteService, param); |
| | | // //粮食入库结算信息 |
| | | // this.pushData1204(apiRemoteService, param); |
| | | // //粮食出库信息 |
| | | // this.pushData1205(apiRemoteService, param); |
| | | // //粮食出库结算信息 |
| | | // this.pushData1206(apiRemoteService, param); |
| | | // //倒仓倒出 |
| | | // this.pushData1207(apiRemoteService, param); |
| | | // //粮食库存 |
| | | // this.pushData1208(apiRemoteService, param); |
| | | // //损溢单 |
| | | // this.pushData1209(apiRemoteService, param); |
| | | // //粮食性质转变单 |
| | | // this.pushData1210(apiRemoteService, param); |
| | | // //账面库存 |
| | | // this.pushData1211(apiRemoteService, param); |
| | | // //客户信息 |
| | | // this.pushData1212(apiRemoteService, param); |
| | | //客户信息 |
| | | pushService12.pushData1212(apiRemoteService, param); |
| | | |
| | | //合同 |
| | | pushService12.pushData1201(apiRemoteService, param); |
| | | |
| | | //入库数据 + 入库过磅 |
| | | pushService12.pushData1202(apiRemoteService, param); |
| | | |
| | | //入库质检 |
| | | pushService12.pushData1203(apiRemoteService, param); |
| | | |
| | | //入库结算 |
| | | pushService12.pushData1204(apiRemoteService, param); |
| | | |
| | | //出库数据 + 出库过磅 |
| | | pushService12.pushData1205(apiRemoteService, param); |
| | | |
| | | //出库结算 |
| | | pushService12.pushData1206(apiRemoteService, param); |
| | | |
| | | //倒仓 |
| | | pushService12.pushData1207(apiRemoteService, param); |
| | | |
| | | //损溢单 |
| | | pushService12.pushData1209(apiRemoteService, param); |
| | | |
| | | //粮食库存数据 |
| | | pushService12.pushData1208(apiRemoteService, param); |
| | | |
| | | //性质转变 |
| | | pushService12.pushData1210(apiRemoteService, param); |
| | | |
| | | //账面库存 |
| | | pushService12.pushData1211(apiRemoteService, param); |
| | | |
| | | //文件 |
| | | pushService12.pushData1109(apiRemoteService, param); |
| | | |
| | | pushService99.pushData2101(apiRemoteService, param); |
| | | pushService99.pushData2102(apiRemoteService, param); |
| | | pushService99.pushData2104(apiRemoteService, param); |
| | | |
| | | log.info("------->>>>粮食购销 接口模块上报结束"); |
| | | } |
| | | |
| | | /** |
| | | * 1201 合同信息 |
| | | */ |
| | | public void pushData1201(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //获取合同信息 |
| | | List<Api1201> list = api1201Rep.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd()); |
| | | |
| | | if (null == list || list.isEmpty()) { |
| | | log.error("-----上海市平台2023版:未获取到合同信息,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteCategory(Constant.API_CATEGORY_12); |
| | | param.setInteId(SH2023Constant.SH_2023_API_CODE_1201); |
| | | |
| | | ResponseDto responseDto; |
| | | for (Api1201 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); |
| | | api1201Rep.save(data); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 1202 粮食入库信息 |
| | | */ |
| | | public void pushData1202(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //获取粮食入库信息 |
| | | List<Api1202> list = api1202Rep.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd()); |
| | | |
| | | if (null == list || list.isEmpty()) { |
| | | log.error("-----上海市平台2023版:未获取到粮食入库信息,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteCategory(Constant.API_CATEGORY_12); |
| | | param.setInteId(SH2023Constant.SH_2023_API_CODE_1202); |
| | | |
| | | ResponseDto responseDto; |
| | | for (Api1202 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); |
| | | //更新状态 |
| | | api1202Rep.save(data); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 1203 粮食入库检验信息 |
| | | */ |
| | | public void pushData1203(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //获取粮食入库检验信息 |
| | | List<Api1203> list = api1203Rep.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd()); |
| | | |
| | | if (null == list || list.isEmpty()) { |
| | | log.error("-----上海市平台2023版:未获取到粮食入库检验信息,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteCategory(Constant.API_CATEGORY_12); |
| | | param.setInteId(SH2023Constant.SH_2023_API_CODE_1203); |
| | | |
| | | ResponseDto responseDto; |
| | | for (Api1203 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); |
| | | //更新状态 |
| | | api1203Rep.save(data); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 1204 粮食入库结算信息 |
| | | */ |
| | | public void pushData1204(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //获取粮食入库结算信息 |
| | | List<Api1204> list = api1204Rep.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd()); |
| | | |
| | | if (null == list || list.isEmpty()) { |
| | | log.error("-----上海市平台2023版:未获取到粮食入库结算信息,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteCategory(Constant.API_CATEGORY_12); |
| | | param.setInteId(SH2023Constant.SH_2023_API_CODE_1204); |
| | | |
| | | ResponseDto responseDto; |
| | | for (Api1204 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); |
| | | //更新状态 |
| | | api1204Rep.save(data); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 1205 粮食出库信息 |
| | | */ |
| | | public void pushData1205(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //获取粮食出库信息 |
| | | List<Api1205> list = api1205Rep.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd()); |
| | | |
| | | if (null == list || list.isEmpty()) { |
| | | log.error("-----上海市平台2023版:未获取到粮食出库信息,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteCategory(Constant.API_CATEGORY_12); |
| | | param.setInteId(SH2023Constant.SH_2023_API_CODE_1205); |
| | | |
| | | ResponseDto responseDto; |
| | | for (Api1205 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); |
| | | //更新状态 |
| | | api1205Rep.save(data); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 1206 粮食出库结算信息 |
| | | */ |
| | | public void pushData1206(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //获取粮食出库结算信息 |
| | | List<Api1206> list = api1206Rep.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd()); |
| | | |
| | | if (null == list || list.isEmpty()) { |
| | | log.error("-----上海市平台2023版:未获取到粮食出库结算信息,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteCategory(Constant.API_CATEGORY_12); |
| | | param.setInteId(SH2023Constant.SH_2023_API_CODE_1206); |
| | | ResponseDto responseDto; |
| | | for (Api1206 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); |
| | | //更新状态 |
| | | api1206Rep.save(data); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 1207 倒仓倒出 |
| | | */ |
| | | public void pushData1207(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //获取倒仓信息 |
| | | List<Api1207> list = api1207Rep.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd()); |
| | | |
| | | if (null == list || list.isEmpty()) { |
| | | log.error("-----上海市平台2023版:未获取到倒仓信息,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteCategory(Constant.API_CATEGORY_12); |
| | | param.setInteId(SH2023Constant.SH_2023_API_CODE_1207); |
| | | |
| | | ResponseDto responseDto; |
| | | for (Api1207 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); |
| | | //更新状态 |
| | | api1207Rep.save(data); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 1208 粮食库存 |
| | | */ |
| | | public void pushData1208(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //获取粮食库存信息 |
| | | List<Api1208> list = api1208Rep.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd()); |
| | | |
| | | if (null == list || list.isEmpty()) { |
| | | log.error("-----上海市平台2023版:未获取到粮食库存信息,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteCategory(Constant.API_CATEGORY_12); |
| | | param.setInteId(SH2023Constant.SH_2023_API_CODE_1208); |
| | | |
| | | ResponseDto responseDto; |
| | | for (Api1208 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); |
| | | //更新状态 |
| | | api1208Rep.save(data); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 1209 损溢单 |
| | | */ |
| | | public void pushData1209(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //获取损益单信息 |
| | | List<Api1209> list = api1209Rep.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd()); |
| | | |
| | | if (null == list || list.isEmpty()) { |
| | | log.error("-----上海市平台2023版:未获取到粮食库存信息,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteCategory(Constant.API_CATEGORY_12); |
| | | param.setInteId(SH2023Constant.SH_2023_API_CODE_1209); |
| | | |
| | | ResponseDto responseDto; |
| | | for (Api1209 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); |
| | | //更新状态 |
| | | api1209Rep.save(data); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 1210 粮食性质转变单 |
| | | */ |
| | | public void pushData1210(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //粮食性质转变单 |
| | | List<Api1210> list = api1210Rep.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd()); |
| | | |
| | | if (null == list || list.isEmpty()) { |
| | | log.error("-----上海市平台2023版:未获取到粮食库存信息,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteCategory(Constant.API_CATEGORY_12); |
| | | param.setInteId(SH2023Constant.SH_2023_API_CODE_1210); |
| | | |
| | | ResponseDto responseDto; |
| | | for (Api1210 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); |
| | | //更新状态 |
| | | api1210Rep.save(data); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 1211 账面库存 |
| | | */ |
| | | public void pushData1211(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //TODO |
| | | //粮食性质转变单 |
| | | List<Api1211> list = api1211Rep.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd()); |
| | | |
| | | if (null == list || list.isEmpty()) { |
| | | log.error("-----上海市平台2023版:未获取到粮食库存信息,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteCategory(Constant.API_CATEGORY_12); |
| | | param.setInteId(SH2023Constant.SH_2023_API_CODE_1210); |
| | | |
| | | ResponseDto responseDto; |
| | | for (Api1211 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); |
| | | //更新状态 |
| | | api1211Rep.save(data); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 1212 客户信息 |
| | | */ |
| | | public void pushData1212(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //获取客户信息 |
| | | List<Api1212> list = api1212Rep.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd()); |
| | | |
| | | if (null == list || list.isEmpty()) { |
| | | log.error("-----上海市平台2023版:未获取到客户信息,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteCategory(Constant.API_CATEGORY_12); |
| | | param.setInteId(SH2023Constant.SH_2023_API_CODE_1212); |
| | | |
| | | ResponseDto responseDto; |
| | | for (Api1212 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); |
| | | //更新状态 |
| | | api1212Rep.save(data); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 2101 检斤单 |
| | | */ |
| | | public void pushData2101(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //获取 检斤单信息 |
| | | // List<ApiInfoData> items = apiInfoDataRep.getDataByInteId(SH2023Constant.SH_2023_API_CODE_2101); |
| | | // |
| | | // param.setInteCategory(Constant.API_CATEGORY_12); |
| | | // param.setInteId(SH2023Constant.SH_2023_API_CODE_2101); |
| | | // |
| | | // ResponseDto responseDto; |
| | | // SH2023Api2101 shApi2101; |
| | | // for (ApiInfoData infoData : items) { |
| | | // shApi2101 = JSONObject.parseObject(infoData.getData(), SH2023Api2101.class); |
| | | // shApi2101.setCzbz(infoData.getCzbz()); |
| | | // shApi2101.setZhgxsj(infoData.getUpdateTime()); |
| | | // param.setBizId(infoData.getDataId()); |
| | | // responseDto = apiRemoteService.pushData(param, shApi2101); |
| | | // if (responseDto.getSuccess() == 0) { |
| | | // if (Constant.CZBZ_I.equals(infoData.getCzbz())) { |
| | | // infoData.setCzbz(Constant.CZBZ_U); |
| | | // apiInfoDataRep.save(infoData); |
| | | // } |
| | | // } |
| | | // } |
| | | } |
| | | |
| | | /** |
| | | * 2102 倒仓倒入 |
| | | */ |
| | | public void pushData2102(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //TODO |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 2104 市储驳运单 |
| | | */ |
| | | public void pushData2104(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //获取 检斤单信息 |
| | | // List<ApiInfoData> items = apiInfoDataRep.getDataByInteId(SH2023Constant.SH_2023_API_CODE_2104); |
| | | |
| | | // param.setInteCategory(Constant.API_CATEGORY_12); |
| | | // param.setInteId(SH2023Constant.SH_2023_API_CODE_2104); |
| | | // |
| | | // ResponseDto responseDto; |
| | | // SH2023Api2104 shApi2104; |
| | | // for (ApiInfoData infoData : items) { |
| | | // shApi2104 = JSONObject.parseObject(infoData.getData(), SH2023Api2104.class); |
| | | // shApi2104.setCzbz(infoData.getCzbz()); |
| | | // shApi2104.setZhgxsj(infoData.getUpdateTime()); |
| | | // |
| | | // param.setBizId(infoData.getDataId()); |
| | | // responseDto = apiRemoteService.pushData(param, shApi2104); |
| | | // if (responseDto.getSuccess() == 0) { |
| | | // if (Constant.CZBZ_I.equals(infoData.getCzbz())) { |
| | | // infoData.setCzbz(Constant.CZBZ_U); |
| | | // apiInfoDataRep.save(infoData); |
| | | // } |
| | | // } |
| | | // } |
| | | } |
| | | } |