| | |
| | | private ResponseEntity<String> savedParkingSpaceInfo(IPageData pd, List<ImportParkingSpace> parkingSpaces, ComponentValidateResult result) { |
| | | String apiUrl = ""; |
| | | JSONObject paramIn = null; |
| | | ResponseEntity<String> responseEntity = null; |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>("成功",HttpStatus.OK); |
| | | ImportOwner owner = null; |
| | | for (ImportParkingSpace parkingSpace : parkingSpaces) { |
| | | JSONObject savedParkingSpaceInfo = getExistsParkSpace(pd, result, parkingSpace); |
| | |
| | | private ResponseEntity<String> savedRoomInfo(IPageData pd, List<ImportRoom> rooms, ComponentValidateResult result) { |
| | | String apiUrl = ""; |
| | | JSONObject paramIn = null; |
| | | ResponseEntity<String> responseEntity = null; |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>("成功",HttpStatus.OK); |
| | | ImportOwner owner = null; |
| | | for (ImportRoom room : rooms) { |
| | | JSONObject savedRoomInfo = getExistsRoom(pd, result, room); |
| | |
| | | paramIn.put("unitId", room.getFloor().getUnitId()); |
| | | paramIn.put("roomNum", room.getRoomNum()); |
| | | paramIn.put("layer", room.getLayer()); |
| | | paramIn.put("section", room.getSection()); |
| | | paramIn.put("apartment", "1"); |
| | | paramIn.put("state", "1000"); |
| | | paramIn.put("section", "1"); |
| | | paramIn.put("apartment", room.getSection()); |
| | | paramIn.put("state", "2002"); |
| | | paramIn.put("builtUpArea", room.getBuiltUpArea()); |
| | | paramIn.put("unitPrice", "1000.00"); |
| | | |
| | |
| | | paramIn.put("communityId", result.getCommunityId()); |
| | | paramIn.put("ownerId", room.getImportOwner().getOwnerId()); |
| | | paramIn.put("roomId", savedRoomInfo.getString("roomId")); |
| | | paramIn.put("state", "2002"); |
| | | paramIn.put("state", "2001"); |
| | | paramIn.put("storeId", result.getStoreId()); |
| | | responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(), apiUrl, HttpMethod.POST); |
| | | |
| | |
| | | private JSONObject getExistsRoom(IPageData pd, ComponentValidateResult result, ImportRoom room) { |
| | | String apiUrl = ""; |
| | | ResponseEntity<String> responseEntity = null; |
| | | apiUrl = ServiceConstant.SERVICE_API_URL + "/api/room.queryRooms?communityId=" + result.getCommunityId() |
| | | apiUrl = ServiceConstant.SERVICE_API_URL + "/api/room.queryRooms?page=1&row=1&communityId=" + result.getCommunityId() |
| | | + "&floorId=" + room.getFloor().getFloorId() + "&unitId=" + room.getFloor().getUnitId() + "&roomNum=" + room.getRoomNum(); |
| | | responseEntity = this.callCenterService(restTemplate, pd, "", apiUrl, HttpMethod.GET); |
| | | |
| | |
| | | private ResponseEntity<String> savedOwnerInfo(IPageData pd, List<ImportOwner> owners, ComponentValidateResult result) { |
| | | String apiUrl = ""; |
| | | JSONObject paramIn = null; |
| | | ResponseEntity<String> responseEntity = null; |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>("成功",HttpStatus.OK); |
| | | |
| | | for (ImportOwner owner : owners) { |
| | | JSONObject savedOwnerInfo = getExistsOwner(pd, result, owner); |
| | | |
| | | if (savedOwnerInfo != null) { |
| | | owner.setOwnerId(savedOwnerInfo.getString("ownerId")); |
| | | continue; |
| | | } |
| | | paramIn = new JSONObject(); |
| | |
| | | paramIn.put("sex", owner.getSex()); |
| | | paramIn.put("ownerTypeCd", "1001"); |
| | | responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(), apiUrl, HttpMethod.POST); |
| | | if (responseEntity.getStatusCode() != HttpStatus.OK) { |
| | | if (responseEntity.getStatusCode() == HttpStatus.OK) { |
| | | savedOwnerInfo = getExistsOwner(pd, result, owner); |
| | | owner.setOwnerId(savedOwnerInfo.getString("ownerId")); |
| | | } |
| | |
| | | private ResponseEntity<String> savedFloorAndUnitInfo(IPageData pd, List<ImportFloor> floors, ComponentValidateResult result) { |
| | | String apiUrl = ""; |
| | | JSONObject paramIn = null; |
| | | ResponseEntity<String> responseEntity = null; |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>("成功",HttpStatus.OK); |
| | | for (ImportFloor importFloor : floors) { |
| | | paramIn = new JSONObject(); |
| | | //先保存 楼栋信息 |
| | |
| | | paramIn.put("name", importFloor.getFloorNum() + "号楼"); |
| | | responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(), apiUrl, HttpMethod.POST); |
| | | } |
| | | if (responseEntity.getStatusCode() != HttpStatus.OK) { //跳过 保存单元信息 |
| | | if (responseEntity != null && responseEntity.getStatusCode() != HttpStatus.OK) { //跳过 保存单元信息 |
| | | continue; |
| | | } |
| | | |
| | |
| | | importFloor.setFloorId(savedFloorInfo.getString("floorId")); |
| | | paramIn.clear(); |
| | | //判断单元信息是否已经存在,如果存在则不保存数据unit.queryUnits |
| | | if (getExistsUnit(pd, result, importFloor) != null) { |
| | | JSONObject savedUnitInfo = getExistsUnit(pd, result, importFloor); |
| | | if ( savedUnitInfo != null) { |
| | | importFloor.setUnitId(savedUnitInfo.getString("unitId")); |
| | | continue; |
| | | } |
| | | |
| | |
| | | responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(), apiUrl, HttpMethod.POST); |
| | | |
| | | //将unitId 刷入ImportFloor对象 |
| | | JSONObject savedUnitInfo = getExistsUnit(pd, result, importFloor); |
| | | savedUnitInfo = getExistsUnit(pd, result, importFloor); |
| | | importFloor.setUnitId(savedUnitInfo.getString("unitId")); |
| | | |
| | | } |
| | |
| | | String apiUrl = ""; |
| | | ResponseEntity<String> responseEntity = null; |
| | | apiUrl = ServiceConstant.SERVICE_API_URL + "/api/unit.queryUnits?communityId=" + result.getCommunityId() |
| | | + "&floorId=" + importFloor.getFloorId() + "&unitNum=" + importFloor.getFloorNum(); |
| | | + "&floorId=" + importFloor.getFloorId() + "&unitNum=" + importFloor.getUnitNum(); |
| | | responseEntity = this.callCenterService(restTemplate, pd, "", apiUrl, HttpMethod.GET); |
| | | |
| | | if (responseEntity.getStatusCode() != HttpStatus.OK) { //跳过 保存单元信息 |
| | |
| | | importFloor.setFloorNum(os[0].toString()); |
| | | importFloor.setUnitNum(os[1].toString()); |
| | | importFloor.setLayerCount(os[2].toString()); |
| | | importFloor.setLift("有".equals(os[3].toString()) ? "Y" : "N"); |
| | | importFloor.setLift("有".equals(os[3].toString()) ? "1010" : "2020"); |
| | | floors.add(importFloor); |
| | | } |
| | | } |