| | |
| | | import com.fzzy.api.service.PushService11; |
| | | import com.fzzy.api.view.repository.ApiInfoDataRep; |
| | | import com.fzzy.whjl.WhjlConstant; |
| | | import com.fzzy.whjl.dto.WhjlApi1101; |
| | | import com.fzzy.whjl.dto.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | //推送军工企业信息 |
| | | this.pushData1101(apiRemoteService, param); |
| | | |
| | | //TODO 推送军工站点信息 |
| | | |
| | | //TODO 推送军粮人员信息 |
| | | |
| | | //TODO 推送仓房信息 |
| | | |
| | | //TODO 推送廒间信息 |
| | | |
| | | //TODO 推送货位信息 |
| | | |
| | | //TODO 推送仓储设备信息 |
| | | |
| | | // 推送军工站点信息 |
| | | this.pushData1102(apiRemoteService, param); |
| | | // 推送军粮人员信息 |
| | | this.pushData1103(apiRemoteService, param); |
| | | // 推送仓房信息 |
| | | this.pushData1105(apiRemoteService, param); |
| | | // 推送廒间信息 |
| | | this.pushData1106(apiRemoteService, param); |
| | | // 推送货位信息 |
| | | this.pushData1107(apiRemoteService, param); |
| | | // 推送仓储设备信息 |
| | | this.pushData1111(apiRemoteService, param); |
| | | |
| | | log.info("武汉军粮省平台--->>>基础信息 上报结束"); |
| | | } |
| | |
| | | List<WhjlApi1101> list = new ArrayList<>(); |
| | | WhjlApi1101 whjlApi1101; |
| | | for (ApiInfoData infoData : items) { |
| | | whjlApi1101 = JSONObject.parseObject(infoData.getData().toString(), WhjlApi1101.class); |
| | | whjlApi1101 = JSONObject.parseObject(infoData.getData(), WhjlApi1101.class); |
| | | whjlApi1101.setKqdm(infoData.getKqdm()); |
| | | whjlApi1101.setCzbz(infoData.getCzbz()); |
| | | whjlApi1101.setUpdateTime(infoData.getUpdateTime()); |
| | |
| | | if (responseDto.getSuccess() == 0) { |
| | | //推送成功,更新数据上传状态 |
| | | for (ApiInfoData data : items) { |
| | | if(Constant.CZBZ_I.equals(data.getCzbz())){ |
| | | if (Constant.CZBZ_I.equals(data.getCzbz())) { |
| | | |
| | | data.setCzbz(Constant.CZBZ_U); |
| | | apiInfoDataRep.save(data); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 1102 军供站点信息 |
| | | */ |
| | | private void pushData1102(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | |
| | | //获取军工企业信息 |
| | | List<ApiInfoData> items = apiInfoDataRep.getDataByInteId(WhjlConstant.API_CODE_1102); |
| | | |
| | | if (null == items || items.isEmpty()) { |
| | | return; |
| | | } |
| | | param.setInteCategory(WhjlConstant.API_CATEGORY_11); |
| | | param.setInteId(WhjlConstant.API_CODE_1102); |
| | | List<WhjlApi1102> list = new ArrayList<>(); |
| | | WhjlApi1102 whjlApi1102; |
| | | for (ApiInfoData infoData : items) { |
| | | whjlApi1102 = JSONObject.parseObject(infoData.getData(), WhjlApi1102.class); |
| | | whjlApi1102.setKqdm(infoData.getKqdm()); |
| | | whjlApi1102.setCzbz(infoData.getCzbz()); |
| | | whjlApi1102.setUpdateTime(infoData.getUpdateTime()); |
| | | whjlApi1102.setBizId(infoData.getDataId()); |
| | | list.add(whjlApi1102); |
| | | } |
| | | |
| | | //推送,数据为集合形式 |
| | | ResponseDto responseDto = apiRemoteService.pushData(param, list); |
| | | if (responseDto.getSuccess() == 0) { |
| | | //推送成功,更新数据上传状态 |
| | | for (ApiInfoData data : items) { |
| | | if (Constant.CZBZ_I.equals(data.getCzbz())) { |
| | | |
| | | data.setCzbz(Constant.CZBZ_U); |
| | | apiInfoDataRep.save(data); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 1103 军工人员信息 |
| | | */ |
| | | private void pushData1103(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | |
| | | //获取军工企业信息 |
| | | List<ApiInfoData> items = apiInfoDataRep.getDataByInteId(WhjlConstant.API_CODE_1103); |
| | | |
| | | if (null == items || items.isEmpty()) { |
| | | return; |
| | | } |
| | | param.setInteCategory(WhjlConstant.API_CATEGORY_11); |
| | | param.setInteId(WhjlConstant.API_CODE_1103); |
| | | List<WhjlApi1103> list = new ArrayList<>(); |
| | | WhjlApi1103 whjlApi1103; |
| | | for (ApiInfoData infoData : items) { |
| | | whjlApi1103 = JSONObject.parseObject(infoData.getData(), WhjlApi1103.class); |
| | | whjlApi1103.setKqdm(infoData.getKqdm()); |
| | | whjlApi1103.setCzbz(infoData.getCzbz()); |
| | | whjlApi1103.setUpdateTime(infoData.getUpdateTime()); |
| | | whjlApi1103.setBizId(infoData.getDataId()); |
| | | list.add(whjlApi1103); |
| | | } |
| | | |
| | | //推送,数据为集合形式 |
| | | ResponseDto responseDto = apiRemoteService.pushData(param, list); |
| | | if (responseDto.getSuccess() == 0) { |
| | | //推送成功,更新数据上传状态 |
| | | for (ApiInfoData data : items) { |
| | | if (Constant.CZBZ_I.equals(data.getCzbz())) { |
| | | |
| | | data.setCzbz(Constant.CZBZ_U); |
| | | apiInfoDataRep.save(data); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 1105 仓房信息 |
| | | */ |
| | | private void pushData1105(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | |
| | | //获取军工企业信息 |
| | | List<ApiInfoData> items = apiInfoDataRep.getDataByInteId(WhjlConstant.API_CODE_1105); |
| | | |
| | | if (null == items || items.isEmpty()) { |
| | | return; |
| | | } |
| | | param.setInteCategory(WhjlConstant.API_CATEGORY_11); |
| | | param.setInteId(WhjlConstant.API_CODE_1105); |
| | | List<WhjlApi1105> list = new ArrayList<>(); |
| | | WhjlApi1105 whjlApi1105; |
| | | for (ApiInfoData infoData : items) { |
| | | whjlApi1105 = JSONObject.parseObject(infoData.getData(), WhjlApi1105.class); |
| | | whjlApi1105.setKqdm(infoData.getKqdm()); |
| | | whjlApi1105.setCzbz(infoData.getCzbz()); |
| | | whjlApi1105.setUpdateTime(infoData.getUpdateTime()); |
| | | whjlApi1105.setBizId(infoData.getDataId()); |
| | | list.add(whjlApi1105); |
| | | } |
| | | |
| | | //推送,数据为集合形式 |
| | | ResponseDto responseDto = apiRemoteService.pushData(param, list); |
| | | if (responseDto.getSuccess() == 0) { |
| | | //推送成功,更新数据上传状态 |
| | | for (ApiInfoData data : items) { |
| | | if (Constant.CZBZ_I.equals(data.getCzbz())) { |
| | | |
| | | data.setCzbz(Constant.CZBZ_U); |
| | | apiInfoDataRep.save(data); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 1106 廒间信息 |
| | | */ |
| | | private void pushData1106(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | |
| | | //获取军工企业信息 |
| | | List<ApiInfoData> items = apiInfoDataRep.getDataByInteId(WhjlConstant.API_CODE_1106); |
| | | |
| | | if (null == items || items.isEmpty()) { |
| | | return; |
| | | } |
| | | param.setInteCategory(WhjlConstant.API_CATEGORY_11); |
| | | param.setInteId(WhjlConstant.API_CODE_1106); |
| | | List<WhjlApi1106> list = new ArrayList<>(); |
| | | WhjlApi1106 whjlApi1106; |
| | | for (ApiInfoData infoData : items) { |
| | | whjlApi1106 = JSONObject.parseObject(infoData.getData(), WhjlApi1106.class); |
| | | whjlApi1106.setKqdm(infoData.getKqdm()); |
| | | whjlApi1106.setCzbz(infoData.getCzbz()); |
| | | whjlApi1106.setUpdateTime(infoData.getUpdateTime()); |
| | | whjlApi1106.setBizId(infoData.getDataId()); |
| | | list.add(whjlApi1106); |
| | | } |
| | | |
| | | //推送,数据为集合形式 |
| | | ResponseDto responseDto = apiRemoteService.pushData(param, list); |
| | | if (responseDto.getSuccess() == 0) { |
| | | //推送成功,更新数据上传状态 |
| | | for (ApiInfoData data : items) { |
| | | if (Constant.CZBZ_I.equals(data.getCzbz())) { |
| | | |
| | | data.setCzbz(Constant.CZBZ_U); |
| | | apiInfoDataRep.save(data); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 1107 货位信息 |
| | | */ |
| | | private void pushData1107(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | |
| | | //获取军工企业信息 |
| | | List<ApiInfoData> items = apiInfoDataRep.getDataByInteId(WhjlConstant.API_CODE_1107); |
| | | |
| | | if (null == items || items.isEmpty()) { |
| | | return; |
| | | } |
| | | param.setInteCategory(WhjlConstant.API_CATEGORY_11); |
| | | param.setInteId(WhjlConstant.API_CODE_1107); |
| | | List<WhjlApi1107> list = new ArrayList<>(); |
| | | WhjlApi1107 whjlApi1107; |
| | | for (ApiInfoData infoData : items) { |
| | | whjlApi1107 = JSONObject.parseObject(infoData.getData(), WhjlApi1107.class); |
| | | whjlApi1107.setKqdm(infoData.getKqdm()); |
| | | whjlApi1107.setCzbz(infoData.getCzbz()); |
| | | whjlApi1107.setUpdateTime(infoData.getUpdateTime()); |
| | | whjlApi1107.setBizId(infoData.getDataId()); |
| | | list.add(whjlApi1107); |
| | | } |
| | | |
| | | //推送,数据为集合形式 |
| | | ResponseDto responseDto = apiRemoteService.pushData(param, list); |
| | | if (responseDto.getSuccess() == 0) { |
| | | //推送成功,更新数据上传状态 |
| | | for (ApiInfoData data : items) { |
| | | if (Constant.CZBZ_I.equals(data.getCzbz())) { |
| | | |
| | | data.setCzbz(Constant.CZBZ_U); |
| | | apiInfoDataRep.save(data); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 1111 仓储设备信息 |
| | | */ |
| | | private void pushData1111(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | |
| | | //获取军工企业信息 |
| | | List<ApiInfoData> items = apiInfoDataRep.getDataByInteId(WhjlConstant.API_CODE_1111); |
| | | |
| | | if (null == items || items.isEmpty()) { |
| | | return; |
| | | } |
| | | param.setInteCategory(WhjlConstant.API_CATEGORY_11); |
| | | param.setInteId(WhjlConstant.API_CODE_1111); |
| | | List<WhjlApi1111> list = new ArrayList<>(); |
| | | WhjlApi1111 whjlApi1111; |
| | | for (ApiInfoData infoData : items) { |
| | | whjlApi1111 = JSONObject.parseObject(infoData.getData(), WhjlApi1111.class); |
| | | whjlApi1111.setKqdm(infoData.getKqdm()); |
| | | whjlApi1111.setCzbz(infoData.getCzbz()); |
| | | whjlApi1111.setUpdateTime(infoData.getUpdateTime()); |
| | | whjlApi1111.setBizId(infoData.getDataId()); |
| | | list.add(whjlApi1111); |
| | | } |
| | | |
| | | //推送,数据为集合形式 |
| | | ResponseDto responseDto = apiRemoteService.pushData(param, list); |
| | | if (responseDto.getSuccess() == 0) { |
| | | //推送成功,更新数据上传状态 |
| | | for (ApiInfoData data : items) { |
| | | if (Constant.CZBZ_I.equals(data.getCzbz())) { |
| | | |
| | | data.setCzbz(Constant.CZBZ_U); |
| | | apiInfoDataRep.save(data); |