| | |
| | | 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.Api1101; |
| | | import com.fzzy.api.service.ApiRemoteService; |
| | | import com.fzzy.api.service.PushService11; |
| | | import com.fzzy.api.view.repository.Api1101Rep; |
| | | import com.fzzy.push.impl.ComPushService11; |
| | | 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版-基础数据上传 |
| | |
| | | @Component |
| | | public class SH2023PushService11 implements PushService11 { |
| | | |
| | | |
| | | @Autowired |
| | | private SH2023ApiRemoteService apiRemoteService; |
| | | @Autowired |
| | | private Api1101Rep api1101Rep; |
| | | |
| | | private ComPushService11 pushService11; |
| | | @Autowired |
| | | private ComPushService99 pushService99; |
| | | @Override |
| | | public String getProtocol() { |
| | | return PushProtocol.SB_SH_2023.getCode(); |
| | |
| | | |
| | | @Override |
| | | public void pushData(ApiParam param) { |
| | | log.info("------->>>>基础信息 接口模块上报开始"); |
| | | |
| | | //推送单位信息 |
| | | this.pushData1101(apiRemoteService, param); |
| | | //TODO 其他基础信息 |
| | | log.info("------->>>>上海2023接口不主动上报"); |
| | | |
| | | //单位信息 |
| | | pushService11.pushData1101(apiRemoteService, param); |
| | | //库区信息 |
| | | pushService11.pushData1102(apiRemoteService, param); |
| | | //仓房信息 |
| | | pushService11.pushData1103(apiRemoteService, param); |
| | | //廒间信息 |
| | | pushService11.pushData1104(apiRemoteService, param); |
| | | //货位信息 |
| | | pushService11.pushData1105(apiRemoteService, param); |
| | | //油罐信息 |
| | | pushService11.pushData1106(apiRemoteService, param); |
| | | //设备信息 |
| | | pushService11.pushData1107(apiRemoteService, param); |
| | | //药剂信息 |
| | | pushService11.pushData1108(apiRemoteService, param); |
| | | //库区图仓房点位信息 |
| | | pushService11.pushData1110(apiRemoteService, param); |
| | | |
| | | //库区图视频监控设备点位数据 |
| | | pushService11.pushData1111(apiRemoteService, param); |
| | | |
| | | //人员信息 |
| | | pushService11.pushData1112(apiRemoteService, param); |
| | | //企业信用信息 |
| | | pushService11.pushData1113(apiRemoteService, param); |
| | | //文件信息推送,转移到12大类进行推送 |
| | | |
| | | //财务报表数据推送 |
| | | pushService11.pushData1114(apiRemoteService, param); |
| | | pushService99.pushData1115(apiRemoteService, param); |
| | | |
| | | log.info("------->>>>基础信息 接口模块上报结束"); |
| | | } |
| | | |
| | | /** |
| | | * 1101 单位信息 |
| | | */ |
| | | private void pushData1101(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | |
| | | //TODO 获取单位信息 |
| | | List<Api1101> list = null; |
| | | |
| | | if (null == list || list.isEmpty()) { |
| | | return; |
| | | } |
| | | |
| | | //推送,数据为集合形式 |
| | | ResponseDto responseDto = apiRemoteService.pushData(param, list); |
| | | if (responseDto.getSuccess() == 0) { |
| | | //推送成功,更新数据上传状态 |
| | | for (Api1101 data : list) { |
| | | if (Constant.CZBZ_I.equals(data.getCzbz())) { |
| | | |
| | | data.setCzbz(Constant.CZBZ_U); |
| | | //更新状态 |
| | | api1101Rep.save(data); |
| | | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |