| | |
| | | package com.fzzy.push.nx2023; |
| | | |
| | | 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.Api1403; |
| | | import com.fzzy.api.entity.Api1404; |
| | | import com.fzzy.api.service.ApiRemoteService; |
| | | import com.fzzy.api.service.PushService14; |
| | | import com.fzzy.api.view.repository.*; |
| | | import com.fzzy.push.impl.ComPushService14; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 宁夏省平台2023版-基础数据上传 |
| | |
| | | @Autowired |
| | | private NX2023ApiRemoteService apiRemoteService; |
| | | @Autowired |
| | | private Api1403Rep api1403Rep; |
| | | @Autowired |
| | | private Api1404Rep api1404Rep; |
| | | private ComPushService14 pushService14; |
| | | |
| | | |
| | | @Override |
| | |
| | | public void pushData(ApiParam param) { |
| | | log.info("------->>>>行政管理 接口模块上报开始"); |
| | | |
| | | pushService14.pushData1401(apiRemoteService, param); |
| | | |
| | | pushService14.pushData1402(apiRemoteService, param); |
| | | //轮换计划 |
| | | this.pushData1403(apiRemoteService, param); |
| | | pushService14.pushData1403(apiRemoteService, param); |
| | | //轮换计划明细 |
| | | this.pushData1404(apiRemoteService, param); |
| | | pushService14.pushData1404(apiRemoteService, param); |
| | | |
| | | pushService14.pushData1405(apiRemoteService, param); |
| | | |
| | | log.info("------->>>>行政管理 接口模块上报结束"); |
| | | } |
| | | |
| | | /** |
| | | * 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.setInteCategory(Constant.API_CATEGORY_14); |
| | | param.setInteId(NX2023Constant.NX_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) { |
| | | //获取轮换计划明细 |
| | | 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(NX2023Constant.NX_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); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |