| | |
| | | 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.*; |
| | | import com.fzzy.api.service.ApiRemoteService; |
| | | import com.fzzy.api.service.PushService11; |
| | | import com.fzzy.api.view.repository.*; |
| | | import com.fzzy.push.impl.ComPushService11; |
| | | 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; |
| | | @Autowired |
| | | private Api1102Rep api1102Rep; |
| | | @Autowired |
| | | private Api1103Rep api1103Rep; |
| | | @Autowired |
| | | private Api1104Rep api1104Rep; |
| | | @Autowired |
| | | private Api1105Rep api1105Rep; |
| | | @Autowired |
| | | private Api1106Rep api1106Rep; |
| | | @Autowired |
| | | private Api1107Rep api1107Rep; |
| | | @Autowired |
| | | private Api1108Rep api1108Rep; |
| | | @Autowired |
| | | private Api1109Rep api1109Rep; |
| | | @Autowired |
| | | private Api1110Rep api1110Rep; |
| | | @Autowired |
| | | private Api1111Rep api1111Rep; |
| | | @Autowired |
| | | private Api1112Rep api1112Rep; |
| | | @Autowired |
| | | private Api1113Rep api1113Rep; |
| | | private ComPushService11 pushService11; |
| | | |
| | | @Override |
| | | public String getProtocol() { |
| | |
| | | @Override |
| | | public void pushData(ApiParam param) { |
| | | |
| | | log.info("------->>>>基础信息 接口模块上报开始"); |
| | | log.info("------->>>>上海2023接口不主动上报"); |
| | | |
| | | //推送单位信息 |
| | | this.pushData1101(apiRemoteService, param); |
| | | //单位信息 |
| | | pushService11.pushData1101(apiRemoteService, param); |
| | | //库区信息 |
| | | this.pushData1102(apiRemoteService, param); |
| | | pushService11.pushData1102(apiRemoteService, param); |
| | | //仓房信息 |
| | | this.pushData1103(apiRemoteService, param); |
| | | pushService11.pushData1103(apiRemoteService, param); |
| | | //廒间信息 |
| | | this.pushData1104(apiRemoteService, param); |
| | | pushService11.pushData1104(apiRemoteService, param); |
| | | //货位信息 |
| | | this.pushData1105(apiRemoteService, param); |
| | | pushService11.pushData1105(apiRemoteService, param); |
| | | //油罐信息 |
| | | this.pushData1106(apiRemoteService, param); |
| | | pushService11.pushData1106(apiRemoteService, param); |
| | | //设备信息 |
| | | this.pushData1107(apiRemoteService, param); |
| | | pushService11.pushData1107(apiRemoteService, param); |
| | | //药剂信息 |
| | | this.pushData1108(apiRemoteService, param); |
| | | //文件信息 |
| | | this.pushData1109(apiRemoteService, param); |
| | | //库区图仓房点位标注 |
| | | this.pushData1110(apiRemoteService, param); |
| | | //库区图视频监控设备点位标注 |
| | | this.pushData1111(apiRemoteService, param); |
| | | pushService11.pushData1108(apiRemoteService, param); |
| | | //库区图仓房点位信息 |
| | | pushService11.pushData1110(apiRemoteService, param); |
| | | |
| | | //库区图视频监控设备点位数据 |
| | | pushService11.pushData1111(apiRemoteService, param); |
| | | |
| | | //人员信息 |
| | | this.pushData1112(apiRemoteService, param); |
| | | pushService11.pushData1112(apiRemoteService, param); |
| | | //企业信用信息 |
| | | this.pushData1113(apiRemoteService, param); |
| | | //财务报表 |
| | | this.pushData1114(apiRemoteService, param); |
| | | pushService11.pushData1113(apiRemoteService, param); |
| | | //文件信息推送,转移到12大类进行推送 |
| | | |
| | | //财务报表数据推送 |
| | | pushService11.pushData1114(apiRemoteService, param); |
| | | |
| | | log.info("------->>>>基础信息 接口模块上报结束"); |
| | | } |
| | | |
| | | /** |
| | | * 1101 单位信息 |
| | | */ |
| | | public void pushData1101(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | |
| | | //获取单位信息 |
| | | List<Api1101> list = api1101Rep.getDataByTime(param.getKqdm(), param.getStart(), param.getEnd()); |
| | | |
| | | if (null == list || list.isEmpty()) { |
| | | log.error("-----上海市平台2023版:未获取到单位信息,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteId(SH2023Constant.SH_2023_API_CODE_1101); |
| | | //推送,数据为集合形式 |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 1102 库区信息 |
| | | */ |
| | | public void pushData1102(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //获取库区信息 |
| | | List<Api1102> list = api1102Rep.findPushData(param.getKqdm()); |
| | | |
| | | if (null == list || list.isEmpty()) { |
| | | log.error("-----上海市平台2023版:未获取到库区信息,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteId(SH2023Constant.SH_2023_API_CODE_1102); |
| | | //推送,数据为集合形式 |
| | | ResponseDto responseDto = apiRemoteService.pushData(param, list); |
| | | if (responseDto.getSuccess() == 0) { |
| | | //推送成功,更新数据上传状态 |
| | | for (Api1102 data : list) { |
| | | if (Constant.CZBZ_I.equals(data.getCzbz())) { |
| | | |
| | | data.setCzbz(Constant.CZBZ_U); |
| | | //更新状态 |
| | | api1102Rep.save(data); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 1103 仓房信息 |
| | | */ |
| | | public void pushData1103(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //获取仓房信息 |
| | | List<Api1103> list = api1103Rep.findPushData(param.getKqdm()); |
| | | |
| | | if (null == list || list.isEmpty()) { |
| | | log.error("-----上海市平台2023版:未获取到仓房信息,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteId(SH2023Constant.SH_2023_API_CODE_1103); |
| | | //推送,数据为集合形式 |
| | | ResponseDto responseDto = apiRemoteService.pushData(param, list); |
| | | if (responseDto.getSuccess() == 0) { |
| | | //推送成功,更新数据上传状态 |
| | | for (Api1103 data : list) { |
| | | if (Constant.CZBZ_I.equals(data.getCzbz())) { |
| | | |
| | | data.setCzbz(Constant.CZBZ_U); |
| | | //更新状态 |
| | | api1103Rep.save(data); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 1104 廒间信息 |
| | | */ |
| | | public void pushData1104(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //获取廒间信息 |
| | | List<Api1104> list = api1104Rep.findPushData(param.getKqdm()); |
| | | |
| | | if (null == list || list.isEmpty()) { |
| | | log.error("-----上海市平台2023版:未获取到廒间信息,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteId(SH2023Constant.SH_2023_API_CODE_1104); |
| | | //推送,数据为集合形式 |
| | | ResponseDto responseDto = apiRemoteService.pushData(param, list); |
| | | if (responseDto.getSuccess() == 0) { |
| | | //推送成功,更新数据上传状态 |
| | | for (Api1104 data : list) { |
| | | if (Constant.CZBZ_I.equals(data.getCzbz())) { |
| | | |
| | | data.setCzbz(Constant.CZBZ_U); |
| | | //更新状态 |
| | | api1104Rep.save(data); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 1105 货位信息 |
| | | */ |
| | | public void pushData1105(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //获取货位信息 |
| | | List<Api1105> list = api1105Rep.findPushData(param.getKqdm()); |
| | | |
| | | if (null == list || list.isEmpty()) { |
| | | log.error("-----上海市平台2023版:未获取到货位信息,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteId(SH2023Constant.SH_2023_API_CODE_1105); |
| | | //推送,数据为集合形式 |
| | | ResponseDto responseDto = apiRemoteService.pushData(param, list); |
| | | if (responseDto.getSuccess() == 0) { |
| | | //推送成功,更新数据上传状态 |
| | | for (Api1105 data : list) { |
| | | if (Constant.CZBZ_I.equals(data.getCzbz())) { |
| | | |
| | | data.setCzbz(Constant.CZBZ_U); |
| | | //更新状态 |
| | | api1105Rep.save(data); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 1106 油罐信息 |
| | | */ |
| | | public void pushData1106(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //获取油罐信息 |
| | | List<Api1106> list = api1106Rep.findPushData(param.getKqdm()); |
| | | |
| | | if (null == list || list.isEmpty()) { |
| | | log.error("-----上海市平台2023版:未获取到油罐信息,不推送-----"); |
| | | return; |
| | | } |
| | | param.setInteId(SH2023Constant.SH_2023_API_CODE_1106); |
| | | //推送,数据为集合形式 |
| | | ResponseDto responseDto = apiRemoteService.pushData(param, list); |
| | | if (responseDto.getSuccess() == 0) { |
| | | //推送成功,更新数据上传状态 |
| | | for (Api1106 data : list) { |
| | | if (Constant.CZBZ_I.equals(data.getCzbz())) { |
| | | |
| | | data.setCzbz(Constant.CZBZ_U); |
| | | //更新状态 |
| | | api1106Rep.save(data); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 1107 设备信息 |
| | | */ |
| | | public void pushData1107(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //TODO |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 1108 药剂信息 |
| | | */ |
| | | public void pushData1108(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //TODO |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 1109 文件信息 |
| | | */ |
| | | public void pushData1109(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //TODO |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 1110 库区图仓房点位标注 |
| | | */ |
| | | public void pushData1110(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //TODO |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 1111 库区图视频监控设备点位标注 |
| | | */ |
| | | public void pushData1111(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //TODO |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 1112 人员信息 |
| | | */ |
| | | public void pushData1112(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //TODO |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 1113 企业信用信息 |
| | | */ |
| | | public void pushData1113(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //TODO |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 1114 财务报表 |
| | | */ |
| | | public void pushData1114(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //TODO |
| | | |
| | | } |
| | | } |