| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.component.BaseComponentSMO; |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.entity.assetImport.ImportFee; |
| | | import com.java110.entity.assetImport.ImportFloor; |
| | | import com.java110.entity.assetImport.ImportOwner; |
| | | import com.java110.entity.assetImport.ImportParkingSpace; |
| | | import com.java110.entity.assetImport.ImportRoom; |
| | | import com.java110.entity.assetImport.*; |
| | | import com.java110.entity.component.ComponentValidateResult; |
| | | import com.java110.front.smo.assetImport.IAssetImportSMO; |
| | | import com.java110.utils.constant.FeeTypeConstant; |
| | | import com.java110.utils.constant.ServiceConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.CommonUtil; |
| | | import com.java110.utils.util.DateUtil; |
| | | import com.java110.utils.util.ImportExcelUtils; |
| | | import com.java110.utils.util.StringUtil; |
| | | import com.java110.utils.util.*; |
| | | import org.apache.poi.ss.usermodel.Sheet; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.slf4j.Logger; |
| | |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>("成功", HttpStatus.OK); |
| | | ImportOwner owner = null; |
| | | for (ImportParkingSpace parkingSpace : parkingSpaces) { |
| | | |
| | | responseEntity = new ResponseEntity<String>("成功", HttpStatus.OK); |
| | | JSONObject savedParkingAreaInfo = getExistsParkingArea(pd, result, parkingSpace); |
| | | paramIn = new JSONObject(); |
| | | // 如果不存在,才插入 |
| | |
| | | paramIn.put("psId", savedParkingSpaceInfo.getString("psId")); |
| | | paramIn.put("storeId", result.getStoreId()); |
| | | paramIn.put("sellOrHire", parkingSpace.getSellOrHire()); |
| | | paramIn.put("startTime", DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A)); |
| | | paramIn.put("endTime", DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A)); |
| | | |
| | | 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; |
| | | apiUrl = ServiceConstant.SERVICE_API_URL + "/api/feeConfig.listFeeConfigs?page=1&row=1&communityId=" + result.getCommunityId() + "&feeTypeCd=" + feeTypeCd + "&isDefault=T"; |
| | | responseEntity = this.callCenterService(restTemplate, pd, "", apiUrl, HttpMethod.GET); |
| | | // String feeTypeCd = "1001".equals(parkingSpace.getTypeCd()) |
| | | // ? FeeTypeConstant.FEE_TYPE_SELL_UP_PARKING_SPACE : FeeTypeConstant.FEE_TYPE_SELL_DOWN_PARKING_SPACE; |
| | | // apiUrl = ServiceConstant.SERVICE_API_URL + "/api/feeConfig.listFeeConfigs?page=1&row=1&communityId=" + result.getCommunityId() + "&feeTypeCd=" + feeTypeCd + "&isDefault=T"; |
| | | // responseEntity = this.callCenterService(restTemplate, pd, "", apiUrl, HttpMethod.GET); |
| | | // |
| | | // if (responseEntity.getStatusCode() != HttpStatus.OK) { |
| | | // continue; |
| | | // } |
| | | |
| | | if (responseEntity.getStatusCode() != HttpStatus.OK) { |
| | | continue; |
| | | } |
| | | // JSONObject configInfo = JSONObject.parseObject(responseEntity.getBody()).getJSONArray("feeConfigs").getJSONObject(0); |
| | | // if (!configInfo.containsKey("additionalAmount")) { |
| | | // continue; |
| | | // } |
| | | |
| | | JSONObject configInfo = JSONObject.parseObject(responseEntity.getBody()).getJSONArray("feeConfigs").getJSONObject(0); |
| | | if (!configInfo.containsKey("additionalAmount")) { |
| | | continue; |
| | | } |
| | | |
| | | paramIn.put("receivedAmount", configInfo.getString("additionalAmount")); |
| | | // paramIn.put("receivedAmount", configInfo.getString("additionalAmount")); |
| | | |
| | | apiUrl = ServiceConstant.SERVICE_API_URL + "/api/parkingSpace.sellParkingSpace"; |
| | | responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(), apiUrl, HttpMethod.POST); |
| | |
| | | paramIn.put("apartment", room.getSection()); |
| | | paramIn.put("state", "2002"); |
| | | paramIn.put("builtUpArea", room.getBuiltUpArea()); |
| | | paramIn.put("unitPrice", "1000.00"); |
| | | paramIn.put("feeCoefficient", "1.00"); |
| | | |
| | | |
| | | responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(), apiUrl, HttpMethod.POST); |
| | |
| | | |
| | | if (responseEntity.getStatusCode() == HttpStatus.OK) { |
| | | JSONObject body = JSONObject.parseObject(responseEntity.getBody()); |
| | | if(body.containsKey("code") && body.getIntValue("code") != 0){ |
| | | if (body.containsKey("code") && body.getIntValue("code") != 0) { |
| | | throw new IllegalArgumentException(body.getString("msg")); |
| | | } |
| | | savedOwnerInfo = getExistsOwner(pd, result, owner); |
| | |
| | | paramIn.put("floorNum", importFloor.getFloorNum()); |
| | | paramIn.put("userId", result.getUserId()); |
| | | paramIn.put("name", importFloor.getFloorNum() + "号楼"); |
| | | paramIn.put("floorArea", 1.00); |
| | | |
| | | responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(), apiUrl, HttpMethod.POST); |
| | | savedFloorInfo = getExistsFloor(pd, result, importFloor); |
| | | } |
| | |
| | | paramIn.put("unitNum", importFloor.getUnitNum()); |
| | | paramIn.put("layerCount", importFloor.getLayerCount()); |
| | | paramIn.put("lift", importFloor.getLift()); |
| | | paramIn.put("unitArea", 1.00); |
| | | responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(), apiUrl, HttpMethod.POST); |
| | | |
| | | //将unitId 刷入ImportFloor对象 |
| | |
| | | Assert.hasValue(os[2], "业主信息选项中" + (osIndex + 1) + "行业主性别为空"); |
| | | String tel = StringUtil.isNullOrNone(os[4]) ? "19999999999" : os[4].toString(); |
| | | String idCard = StringUtil.isNullOrNone(os[5]) ? "10000000000000000001" : os[5].toString(); |
| | | |
| | | if (os[4].toString().length() > 11) { |
| | | throw new IllegalArgumentException(os[1].toString() + " 的手机号超过11位,请核实"); |
| | | } |
| | | if (os[5].toString().length() > 18) { |
| | | throw new IllegalArgumentException(os[1].toString() + " 的身份证超过18位,请核实"); |
| | | } |
| | | |
| | | String age = StringUtil.isNullOrNone(os[3]) ? CommonUtil.getAgeByCertId(idCard) : os[3].toString(); |
| | | importOwner = new ImportOwner(); |
| | | importOwner.setOwnerNum(os[0].toString()); |