| | |
| | | import com.fzzy.api.service.PushService11; |
| | | import com.fzzy.api.view.repository.*; |
| | | import com.fzzy.push.sh2023.dto.SH2023Api2101; |
| | | import com.fzzy.push.sh2023.dto.SH2023Api2104; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | 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); |
| | | |
| | | // //推送合同信息 |
| | | // 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); |
| | | |
| | | log.info("------->>>>粮食购销 接口模块上报结束"); |
| | | } |
| | |
| | | log.error("-----上海市平台2023版:未获取到合同信息,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteCategory(Constant.API_CATEGORY_12); |
| | | param.setInteId(SH2023Constant.SH_2023_API_CODE_1201); |
| | | //推送,数据为集合形式 |
| | | ResponseDto responseDto = apiRemoteService.pushData(param, list); |
| | | if (responseDto.getSuccess() == 0) { |
| | | //推送成功,更新数据上传状态 |
| | | for (Api1201 data : list) { |
| | | if (Constant.CZBZ_I.equals(data.getCzbz())) { |
| | | |
| | | 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); |
| | | } |
| | | } |
| | |
| | | log.error("-----上海市平台2023版:未获取到粮食入库信息,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteCategory(Constant.API_CATEGORY_12); |
| | | param.setInteId(SH2023Constant.SH_2023_API_CODE_1202); |
| | | //推送,数据为集合形式 |
| | | ResponseDto responseDto = apiRemoteService.pushData(param, list); |
| | | if (responseDto.getSuccess() == 0) { |
| | | //推送成功,更新数据上传状态 |
| | | for (Api1202 data : list) { |
| | | if (Constant.CZBZ_I.equals(data.getCzbz())) { |
| | | |
| | | 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); |
| | |
| | | log.error("-----上海市平台2023版:未获取到粮食入库检验信息,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteCategory(Constant.API_CATEGORY_12); |
| | | param.setInteId(SH2023Constant.SH_2023_API_CODE_1203); |
| | | //推送,数据为集合形式 |
| | | ResponseDto responseDto = apiRemoteService.pushData(param, list); |
| | | if (responseDto.getSuccess() == 0) { |
| | | //推送成功,更新数据上传状态 |
| | | for (Api1203 data : list) { |
| | | if (Constant.CZBZ_I.equals(data.getCzbz())) { |
| | | |
| | | 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); |
| | |
| | | log.error("-----上海市平台2023版:未获取到粮食入库结算信息,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteCategory(Constant.API_CATEGORY_12); |
| | | param.setInteId(SH2023Constant.SH_2023_API_CODE_1204); |
| | | //推送,数据为集合形式 |
| | | ResponseDto responseDto = apiRemoteService.pushData(param, list); |
| | | if (responseDto.getSuccess() == 0) { |
| | | //推送成功,更新数据上传状态 |
| | | for (Api1204 data : list) { |
| | | if (Constant.CZBZ_I.equals(data.getCzbz())) { |
| | | |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | log.error("-----上海市平台2023版:未获取到粮食出库信息,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteCategory(Constant.API_CATEGORY_12); |
| | | param.setInteId(SH2023Constant.SH_2023_API_CODE_1205); |
| | | //推送,数据为集合形式 |
| | | ResponseDto responseDto = apiRemoteService.pushData(param, list); |
| | | if (responseDto.getSuccess() == 0) { |
| | | //推送成功,更新数据上传状态 |
| | | for (Api1205 data : list) { |
| | | if (Constant.CZBZ_I.equals(data.getCzbz())) { |
| | | |
| | | 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); |
| | |
| | | log.error("-----上海市平台2023版:未获取到粮食出库结算信息,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteCategory(Constant.API_CATEGORY_12); |
| | | param.setInteId(SH2023Constant.SH_2023_API_CODE_1206); |
| | | //推送,数据为集合形式 |
| | | ResponseDto responseDto = apiRemoteService.pushData(param, list); |
| | | if (responseDto.getSuccess() == 0) { |
| | | //推送成功,更新数据上传状态 |
| | | for (Api1206 data : list) { |
| | | 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); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | log.error("-----上海市平台2023版:未获取到倒仓信息,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteCategory(Constant.API_CATEGORY_12); |
| | | param.setInteId(SH2023Constant.SH_2023_API_CODE_1207); |
| | | //推送,数据为集合形式 |
| | | ResponseDto responseDto = apiRemoteService.pushData(param, list); |
| | | if (responseDto.getSuccess() == 0) { |
| | | //推送成功,更新数据上传状态 |
| | | for (Api1207 data : list) { |
| | | if (Constant.CZBZ_I.equals(data.getCzbz())) { |
| | | |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | log.error("-----上海市平台2023版:未获取到粮食库存信息,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteCategory(Constant.API_CATEGORY_12); |
| | | param.setInteId(SH2023Constant.SH_2023_API_CODE_1208); |
| | | //推送,数据为集合形式 |
| | | ResponseDto responseDto = apiRemoteService.pushData(param, list); |
| | | if (responseDto.getSuccess() == 0) { |
| | | //推送成功,更新数据上传状态 |
| | | for (Api1208 data : list) { |
| | | |
| | | 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); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | log.error("-----上海市平台2023版:未获取到粮食库存信息,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteCategory(Constant.API_CATEGORY_12); |
| | | param.setInteId(SH2023Constant.SH_2023_API_CODE_1209); |
| | | //推送,数据为集合形式 |
| | | ResponseDto responseDto = apiRemoteService.pushData(param, list); |
| | | if (responseDto.getSuccess() == 0) { |
| | | //推送成功,更新数据上传状态 |
| | | for (Api1209 data : list) { |
| | | |
| | | 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); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | log.error("-----上海市平台2023版:未获取到粮食库存信息,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteCategory(Constant.API_CATEGORY_12); |
| | | param.setInteId(SH2023Constant.SH_2023_API_CODE_1210); |
| | | //推送,数据为集合形式 |
| | | ResponseDto responseDto = apiRemoteService.pushData(param, list); |
| | | if (responseDto.getSuccess() == 0) { |
| | | //推送成功,更新数据上传状态 |
| | | for (Api1210 data : list) { |
| | | if (Constant.CZBZ_I.equals(data.getCzbz())) { |
| | | |
| | | 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); |
| | |
| | | */ |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | log.error("-----上海市平台2023版:未获取到客户信息,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteCategory(Constant.API_CATEGORY_12); |
| | | param.setInteId(SH2023Constant.SH_2023_API_CODE_1212); |
| | | //推送,数据为集合形式 |
| | | ResponseDto responseDto = apiRemoteService.pushData(param, list); |
| | | if (responseDto.getSuccess() == 0) { |
| | | //推送成功,更新数据上传状态 |
| | | for (Api1212 data : list) { |
| | | if (Constant.CZBZ_I.equals(data.getCzbz())) { |
| | | |
| | | 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); |
| | | |
| | | SH2023Api2101 shApi2101; |
| | | List<SH2023Api2101> list = new ArrayList<>(); |
| | | |
| | | param.setInteId(SH2023Constant.SH_2023_API_CODE_2101); |
| | | for (ApiInfoData infoData : items) { |
| | | shApi2101 = JSONObject.parseObject(infoData.getData(), SH2023Api2101.class); |
| | | shApi2101.setCzbz(infoData.getCzbz()); |
| | | shApi2101.setZhgxsj(infoData.getUpdateTime()); |
| | | list.add(shApi2101); |
| | | } |
| | | ResponseDto responseDto = apiRemoteService.pushData(param, list); |
| | | if (responseDto.getSuccess() == 0) { |
| | | //推送成功,更新数据上传状态 |
| | | for (ApiInfoData data : items) { |
| | | if (Constant.CZBZ_I.equals(data.getCzbz())) { |
| | | |
| | | data.setCzbz(Constant.CZBZ_U); |
| | | apiInfoDataRep.save(data); |
| | | } |
| | | } |
| | | } |
| | | // 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); |
| | | // } |
| | | // } |
| | | // } |
| | | } |
| | | |
| | | /** |
| | |
| | | * 2104 市储驳运单 |
| | | */ |
| | | public void pushData2104(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //TODO |
| | | //获取 检斤单信息 |
| | | // 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); |
| | | // } |
| | | // } |
| | | // } |
| | | } |
| | | } |