| | |
| | | import com.fzzy.api.data.ApiParam; |
| | | import com.fzzy.api.data.PushProtocol; |
| | | import com.fzzy.api.dto.ResponseDto; |
| | | import com.fzzy.api.entity.Api1310; |
| | | import com.fzzy.api.entity.Api1401; |
| | | import com.fzzy.api.entity.*; |
| | | import com.fzzy.api.service.ApiRemoteService; |
| | | import com.fzzy.api.service.PushService11; |
| | | import com.fzzy.api.view.repository.Api1401Rep; |
| | | import com.fzzy.api.service.PushService14; |
| | | import com.fzzy.api.view.repository.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | public class SH2023PushService14 implements PushService11 { |
| | | public class SH2023PushService14 implements PushService14 { |
| | | |
| | | |
| | | @Autowired |
| | | private SH2023ApiRemoteService apiRemoteService; |
| | | @Autowired |
| | | private Api1401Rep api1401Rep; |
| | | @Autowired |
| | | private Api1402Rep api1402Rep; |
| | | @Autowired |
| | | private Api1403Rep api1403Rep; |
| | | @Autowired |
| | | private Api1404Rep api1404Rep; |
| | | @Autowired |
| | | private Api1405Rep api1405Rep; |
| | | @Autowired |
| | | private Api1201Rep api1201Rep; |
| | | @Autowired |
| | | private Api1310Rep api1310Rep; |
| | | |
| | | @Override |
| | | public String getProtocol() { |
| | |
| | | log.error("-----上海市平台2023版:未获取到储备规模,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteCategory(Constant.API_CATEGORY_14); |
| | | param.setInteId(SH2023Constant.SH_2023_API_CODE_1401); |
| | | |
| | | //推送,数据为集合形式 |
| | | ResponseDto responseDto = apiRemoteService.pushData(param, list); |
| | | if (responseDto.getSuccess() == 0) { |
| | | //推送成功,更新数据上传状态 |
| | | for (Api1401 data : list) { |
| | | ResponseDto responseDto; |
| | | for (Api1401 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); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 1402 储备计划信息 |
| | | */ |
| | | public void pushData1402(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //TODO |
| | | //获取储备计划 |
| | | List<Api1402> list = api1402Rep.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd()); |
| | | |
| | | if (null == list || list.isEmpty()) { |
| | | log.error("-----上海市平台2023版:未获取到储备计划,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteCategory(Constant.API_CATEGORY_14); |
| | | param.setInteId(SH2023Constant.SH_2023_API_CODE_1402); |
| | | |
| | | ResponseDto responseDto; |
| | | for (Api1402 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); |
| | | //更新状态 |
| | | api1402Rep.save(data); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 1403 轮换计划信息 |
| | | */ |
| | | public void pushData1403(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //TODO |
| | | //获取轮换计划 |
| | | List<Api1403> list = api1403Rep.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd()); |
| | | |
| | | if (null == list || list.isEmpty()) { |
| | | log.error("-----上海市平台2023版:未获取到轮换计划,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteCategory(Constant.API_CATEGORY_14); |
| | | param.setInteId(SH2023Constant.SH_2023_API_CODE_1403); |
| | | |
| | | ResponseDto responseDto; |
| | | for (Api1403 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); |
| | | //更新状态 |
| | | api1403Rep.save(data); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 1404 轮换计划明细信息 |
| | | */ |
| | | public void pushData1404(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //TODO |
| | | //获取轮换计划明细 |
| | | List<Api1404> list = api1404Rep.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd()); |
| | | |
| | | if (null == list || list.isEmpty()) { |
| | | log.error("-----上海市平台2023版:未获取到轮换计划明细,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteCategory(Constant.API_CATEGORY_14); |
| | | param.setInteId(SH2023Constant.SH_2023_API_CODE_1404); |
| | | |
| | | ResponseDto responseDto; |
| | | for (Api1404 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); |
| | | //更新状态 |
| | | api1404Rep.save(data); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 1405 项目信息 |
| | | */ |
| | | public void pushData1405(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //TODO |
| | | // TODO 项目信息 待定 |
| | | // //获取项目信息 |
| | | // List<Api1405> list = api1405Rep.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd()); |
| | | // |
| | | // if (null == list || list.isEmpty()) { |
| | | // log.error("-----上海市平台2023版:未获取到项目信息,不推送-----"); |
| | | // return; |
| | | // } |
| | | // param.setInteId(SH2023Constant.SH_2023_API_CODE_1405); |
| | | // //推送,数据为集合形式 |
| | | // ResponseDto responseDto = apiRemoteService.pushData(param, list); |
| | | // if (responseDto.getSuccess() == 0) { |
| | | // //推送成功,更新数据上传状态 |
| | | // for (Api1405 data : list) { |
| | | // if (Constant.CZBZ_I.equals(data.getCzbz())) { |
| | | // |
| | | // data.setCzbz(Constant.CZBZ_U); |
| | | // //更新状态 |
| | | // api1405Rep.save(data); |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | } |
| | | |
| | |
| | | * 2203 交易中心合同 |
| | | */ |
| | | public void pushData2203(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //TODO |
| | | |
| | | //获取交易中心合同 |
| | | // 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_14); |
| | | // param.setInteId(SH2023Constant.SH_2023_API_CODE_2203); |
| | | // |
| | | // 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); |
| | | // } |
| | | // } |
| | | // } |
| | | } |
| | | |
| | | /** |
| | | * 2204 定化水检验 |
| | | */ |
| | | public void pushData2204(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //TODO |
| | | |
| | | //获取定化水检验 |
| | | // List<Api1310> list = api1310Rep.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd()); |
| | | // |
| | | // if (null == list || list.isEmpty()) { |
| | | // log.error("-----上海市平台2023版:未获取到定化水检验,不推送-----"); |
| | | // return; |
| | | // } |
| | | // param.setInteCategory(Constant.API_CATEGORY_14); |
| | | // param.setInteId(SH2023Constant.SH_2023_API_CODE_2204); |
| | | // |
| | | // ResponseDto responseDto; |
| | | // for (Api1310 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); |
| | | // //更新状态 |
| | | // api1310Rep.save(data); |
| | | // } |
| | | // } |
| | | // } |
| | | } |
| | | } |