| | |
| | | private ResponseEntity<String> savedParkingSpaceInfo(IPageData pd, List<ImportParkingSpace> parkingSpaces, ComponentValidateResult result) { |
| | | String apiUrl = ""; |
| | | JSONObject paramIn = null; |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>("成功",HttpStatus.OK); |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>("成功", HttpStatus.OK); |
| | | ImportOwner owner = null; |
| | | for (ImportParkingSpace parkingSpace : parkingSpaces) { |
| | | JSONObject savedParkingSpaceInfo = getExistsParkSpace(pd, result, parkingSpace); |
| | |
| | | apiUrl = ServiceConstant.SERVICE_API_URL + "/api/parkingSpace.saveParkingSpace"; |
| | | |
| | | paramIn.put("communityId", result.getCommunityId()); |
| | | paramIn.put("userId", result.getUserId()); |
| | | paramIn.put("num", parkingSpace.getPsNum()); |
| | | paramIn.put("area", parkingSpace.getArea()); |
| | | paramIn.put("typeCd", parkingSpace.getTypeCd()); |
| | |
| | | } |
| | | |
| | | savedParkingSpaceInfo = getExistsParkSpace(pd, result, parkingSpace); |
| | | if (savedParkingSpaceInfo != null) { |
| | | if (savedParkingSpaceInfo == null) { |
| | | continue; |
| | | } |
| | | |
| | |
| | | |
| | | paramIn.put("communityId", result.getCommunityId()); |
| | | paramIn.put("ownerId", parkingSpace.getImportOwner().getOwnerId()); |
| | | paramIn.put("userId", result.getUserId()); |
| | | paramIn.put("carNum", parkingSpace.getCarNum()); |
| | | paramIn.put("carBrand", parkingSpace.getCarBrand()); |
| | | paramIn.put("carType", parkingSpace.getCarType()); |
| | |
| | | paramIn.put("psId", savedParkingSpaceInfo.getString("psId")); |
| | | paramIn.put("storeId", result.getStoreId()); |
| | | paramIn.put("sellOrHire", parkingSpace.getSellOrHire()); |
| | | |
| | | if("H".equals(parkingSpace.getSellOrHire())){ |
| | | paramIn.put("cycles", "0"); |
| | | } |
| | | |
| | | String feeTypeCd = "1001".equals(parkingSpace.getTypeCd()) |
| | | ? FeeTypeConstant.FEE_TYPE_SELL_UP_PARKING_SPACE : FeeTypeConstant.FEE_TYPE_SELL_DOWN_PARKING_SPACE; |
| | |
| | | continue; |
| | | } |
| | | |
| | | JSONObject configInfo = JSONObject.parseObject(responseEntity.getBody()); |
| | | if(!configInfo.containsKey("additionalAmount")){ |
| | | JSONObject configInfo = JSONArray.parseArray(responseEntity.getBody()).getJSONObject(0); |
| | | if (!configInfo.containsKey("additionalAmount")) { |
| | | continue; |
| | | } |
| | | |
| | |
| | | private ResponseEntity<String> savedRoomInfo(IPageData pd, List<ImportRoom> rooms, ComponentValidateResult result) { |
| | | String apiUrl = ""; |
| | | JSONObject paramIn = null; |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>("成功",HttpStatus.OK); |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>("成功", HttpStatus.OK); |
| | | ImportOwner owner = null; |
| | | for (ImportRoom room : rooms) { |
| | | JSONObject savedRoomInfo = getExistsRoom(pd, result, room); |
| | |
| | | private ResponseEntity<String> savedOwnerInfo(IPageData pd, List<ImportOwner> owners, ComponentValidateResult result) { |
| | | String apiUrl = ""; |
| | | JSONObject paramIn = null; |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>("成功",HttpStatus.OK); |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>("成功", HttpStatus.OK); |
| | | |
| | | for (ImportOwner owner : owners) { |
| | | JSONObject savedOwnerInfo = getExistsOwner(pd, result, owner); |
| | |
| | | private ResponseEntity<String> savedFloorAndUnitInfo(IPageData pd, List<ImportFloor> floors, ComponentValidateResult result) { |
| | | String apiUrl = ""; |
| | | JSONObject paramIn = null; |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>("成功",HttpStatus.OK); |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>("成功", HttpStatus.OK); |
| | | for (ImportFloor importFloor : floors) { |
| | | paramIn = new JSONObject(); |
| | | //先保存 楼栋信息 |
| | |
| | | paramIn.clear(); |
| | | //判断单元信息是否已经存在,如果存在则不保存数据unit.queryUnits |
| | | JSONObject savedUnitInfo = getExistsUnit(pd, result, importFloor); |
| | | if ( savedUnitInfo != null) { |
| | | if (savedUnitInfo != null) { |
| | | importFloor.setUnitId(savedUnitInfo.getString("unitId")); |
| | | continue; |
| | | } |
| | |
| | | responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(), apiUrl, HttpMethod.POST); |
| | | |
| | | //将unitId 刷入ImportFloor对象 |
| | | savedUnitInfo = getExistsUnit(pd, result, importFloor); |
| | | savedUnitInfo = getExistsUnit(pd, result, importFloor); |
| | | importFloor.setUnitId(savedUnitInfo.getString("unitId")); |
| | | |
| | | } |
| | |
| | | if (osIndex == 0) { // 第一行是 头部信息 直接跳过 |
| | | continue; |
| | | } |
| | | if(StringUtil.isNullOrNone(os[0])){ |
| | | if (StringUtil.isNullOrNone(os[0])) { |
| | | continue; |
| | | } |
| | | importParkingSpace = new ImportParkingSpace(); |
| | | importParkingSpace.setPsNum(os[0].toString()); |
| | | importParkingSpace.setTypeCd(os[1].toString()); |
| | | importParkingSpace.setArea(Double.parseDouble(os[2].toString())); |
| | | if(StringUtil.isNullOrNone(os[3])){ |
| | | if (StringUtil.isNullOrNone(os[3])) { |
| | | parkingSpaces.add(importParkingSpace); |
| | | continue; |
| | | } |
| | |
| | | if (osIndex == 0) { // 第一行是 头部信息 直接跳过 |
| | | continue; |
| | | } |
| | | if(StringUtil.isNullOrNone(os[0])){ |
| | | if (StringUtil.isNullOrNone(os[0])) { |
| | | continue; |
| | | } |
| | | importRoom = new ImportRoom(); |
| | |
| | | importRoom.setLayer(Integer.parseInt(os[3].toString())); |
| | | importRoom.setSection(os[4].toString()); |
| | | importRoom.setBuiltUpArea(Double.parseDouble(os[5].toString())); |
| | | if(StringUtil.isNullOrNone(os[6])){ |
| | | if (StringUtil.isNullOrNone(os[6])) { |
| | | rooms.add(importRoom); |
| | | continue; |
| | | } |
| | |
| | | if (osIndex == 0) { // 第一行是 头部信息 直接跳过 |
| | | continue; |
| | | } |
| | | if(StringUtil.isNullOrNone(os[0])){ |
| | | if (StringUtil.isNullOrNone(os[0])) { |
| | | continue; |
| | | } |
| | | importOwner = new ImportOwner(); |
| | |
| | | continue; |
| | | } |
| | | |
| | | if(StringUtil.isNullOrNone(os[0])){ |
| | | if (StringUtil.isNullOrNone(os[0])) { |
| | | continue; |
| | | } |
| | | importFloor = new ImportFloor(); |