| | |
| | | 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.Api1310; |
| | | import com.fzzy.api.entity.Api1401; |
| | | import com.fzzy.api.entity.Api1403; |
| | | import com.fzzy.api.service.ApiRemoteService; |
| | | import com.fzzy.api.service.PushService11; |
| | | import com.fzzy.api.view.repository.Api1401Rep; |
| | | import com.fzzy.api.view.repository.Api1403Rep; |
| | | import com.fzzy.api.view.repository.Api1404Rep; |
| | | import com.fzzy.api.service.PushService14; |
| | | import com.fzzy.push.impl.ComPushService14; |
| | | 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版-基础数据上传 |
| | |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | public class SH2023PushService14 implements PushService11 { |
| | | public class SH2023PushService14 implements PushService14 { |
| | | |
| | | |
| | | @Autowired |
| | | private SH2023ApiRemoteService apiRemoteService; |
| | | @Autowired |
| | | private Api1401Rep api1401Rep; |
| | | private ComPushService14 pushService14; |
| | | @Autowired |
| | | private Api1403Rep api1403Rep; |
| | | @Autowired |
| | | private Api1404Rep api1404Rep; |
| | | private ComPushService99 pushService99; |
| | | |
| | | @Override |
| | | public String getProtocol() { |
| | |
| | | public void pushData(ApiParam param) { |
| | | log.info("------->>>>行政管理 接口模块上报开始"); |
| | | |
| | | //储备规模 |
| | | this.pushData1401(apiRemoteService, param); |
| | | pushService14.pushData1401(apiRemoteService, param); |
| | | |
| | | pushService14.pushData1402(apiRemoteService, param); |
| | | //轮换计划 |
| | | pushService14.pushData1403(apiRemoteService, param); |
| | | //轮换计划明细 |
| | | pushService14.pushData1404(apiRemoteService, param); |
| | | |
| | | pushService14.pushData1405(apiRemoteService, param); |
| | | |
| | | //其他接口 |
| | | pushService99.pushData2203(apiRemoteService, param); |
| | | pushService99.pushData2204(apiRemoteService, param); |
| | | |
| | | |
| | | log.info("------->>>>行政管理 接口模块上报结束"); |
| | | } |
| | | |
| | | /** |
| | | * 1401 储备规模 |
| | | */ |
| | | public void pushData1401(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //获取储备规模 |
| | | List<Api1401> list = api1401Rep.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd()); |
| | | |
| | | if (null == list || list.isEmpty()) { |
| | | log.error("-----上海市平台2023版:未获取到储备规模,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteId(SH2023Constant.SH_2023_API_CODE_1401); |
| | | //推送,数据为集合形式 |
| | | ResponseDto responseDto = apiRemoteService.pushData(param, list); |
| | | if (responseDto.getSuccess() == 0) { |
| | | //推送成功,更新数据上传状态 |
| | | for (Api1401 data : list) { |
| | | if (Constant.CZBZ_I.equals(data.getCzbz())) { |
| | | |
| | | data.setCzbz(Constant.CZBZ_U); |
| | | //更新状态 |
| | | api1401Rep.save(data); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 1402 储备计划信息 |
| | | */ |
| | | public void pushData1402(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //TODO |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 1403 轮换计划信息 |
| | | */ |
| | | public void pushData1403(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //获取储备规模 |
| | | List<Api1403> list = api1403Rep.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd()); |
| | | |
| | | if (null == list || list.isEmpty()) { |
| | | log.error("-----上海市平台2023版:未获取到储备规模,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteId(SH2023Constant.SH_2023_API_CODE_1403); |
| | | //推送,数据为集合形式 |
| | | ResponseDto responseDto = apiRemoteService.pushData(param, list); |
| | | if (responseDto.getSuccess() == 0) { |
| | | //推送成功,更新数据上传状态 |
| | | for (Api1403 data : list) { |
| | | if (Constant.CZBZ_I.equals(data.getCzbz())) { |
| | | data.setCzbz(Constant.CZBZ_U); |
| | | //更新状态 |
| | | api1403Rep.save(data); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 1404 轮换计划明细信息 |
| | | */ |
| | | public void pushData1404(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | ///获取储备规模 |
| | | List<Api1401> list = api1401Rep.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd()); |
| | | |
| | | if (null == list || list.isEmpty()) { |
| | | log.error("-----上海市平台2023版:未获取到储备规模,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteId(SH2023Constant.SH_2023_API_CODE_1401); |
| | | //推送,数据为集合形式 |
| | | ResponseDto responseDto = apiRemoteService.pushData(param, list); |
| | | if (responseDto.getSuccess() == 0) { |
| | | //推送成功,更新数据上传状态 |
| | | for (Api1401 data : list) { |
| | | if (Constant.CZBZ_I.equals(data.getCzbz())) { |
| | | |
| | | data.setCzbz(Constant.CZBZ_U); |
| | | //更新状态 |
| | | api1401Rep.save(data); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 1405 项目信息 |
| | | */ |
| | | public void pushData1405(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //TODO |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 2203 交易中心合同 |
| | | */ |
| | | public void pushData2203(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //TODO |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 2204 定化水检验 |
| | | */ |
| | | public void pushData2204(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //TODO |
| | | |
| | | } |
| | | } |