| | |
| | | package com.fzzy.push.sh2023; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.fzzy.api.Constant; |
| | | import com.fzzy.api.data.ApiParam; |
| | | import com.fzzy.api.data.PushProtocol; |
| | |
| | | import com.fzzy.api.service.PushService11; |
| | | import com.fzzy.api.view.repository.*; |
| | | import com.fzzy.otherview.sh2023.dto.ShApi2101; |
| | | import com.fzzy.push.sh2023.dto.SH2023Api2101; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | private Api1211Rep api1211Rep; |
| | | @Autowired |
| | | private Api1212Rep api1212Rep; |
| | | @Autowired |
| | | private ApiInfoDataRep apiInfoDataRep; |
| | | |
| | | @Override |
| | | public String getProtocol() { |
| | |
| | | log.error("-----上海市平台2023版:未获取到合同信息,不推送-----"); |
| | | return; |
| | | } |
| | | |
| | | param.setInteId(SH2023Constant.SH_2023_API_CODE_1201); |
| | | //推送,数据为集合形式 |
| | | ResponseDto responseDto = apiRemoteService.pushData(param, list); |
| | | if (responseDto.getSuccess() == 0) { |
| | |
| | | log.error("-----上海市平台2023版:未获取到粮食入库信息,不推送-----"); |
| | | return; |
| | | } |
| | | |
| | | param.setInteId(SH2023Constant.SH_2023_API_CODE_1202); |
| | | //推送,数据为集合形式 |
| | | ResponseDto responseDto = apiRemoteService.pushData(param, list); |
| | | if (responseDto.getSuccess() == 0) { |
| | |
| | | log.error("-----上海市平台2023版:未获取到粮食入库检验信息,不推送-----"); |
| | | return; |
| | | } |
| | | |
| | | param.setInteId(SH2023Constant.SH_2023_API_CODE_1203); |
| | | //推送,数据为集合形式 |
| | | ResponseDto responseDto = apiRemoteService.pushData(param, list); |
| | | if (responseDto.getSuccess() == 0) { |
| | |
| | | log.error("-----上海市平台2023版:未获取到粮食入库结算信息,不推送-----"); |
| | | return; |
| | | } |
| | | |
| | | param.setInteId(SH2023Constant.SH_2023_API_CODE_1204); |
| | | //推送,数据为集合形式 |
| | | ResponseDto responseDto = apiRemoteService.pushData(param, list); |
| | | if (responseDto.getSuccess() == 0) { |
| | |
| | | log.error("-----上海市平台2023版:未获取到粮食出库信息,不推送-----"); |
| | | return; |
| | | } |
| | | |
| | | param.setInteId(SH2023Constant.SH_2023_API_CODE_1205); |
| | | //推送,数据为集合形式 |
| | | ResponseDto responseDto = apiRemoteService.pushData(param, list); |
| | | if (responseDto.getSuccess() == 0) { |
| | |
| | | log.error("-----上海市平台2023版:未获取到粮食出库结算信息,不推送-----"); |
| | | return; |
| | | } |
| | | |
| | | param.setInteId(SH2023Constant.SH_2023_API_CODE_1206); |
| | | //推送,数据为集合形式 |
| | | ResponseDto responseDto = apiRemoteService.pushData(param, list); |
| | | if (responseDto.getSuccess() == 0) { |
| | |
| | | * 2101 检斤单 |
| | | */ |
| | | public void pushData2101(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | // todo |
| | | |
| | | //获取 检斤单信息 |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |