his-uncles-father
2021-04-21 fbc8d20f0ae2f663e1a13560f314f05b870c998c
service-front/src/main/java/com/java110/front/smo/assetImport/impl/AssetImportSMOImpl.java
@@ -4,17 +4,12 @@
import com.alibaba.fastjson.JSONObject;
import com.java110.core.component.BaseComponentSMO;
import com.java110.core.context.IPageData;
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.dto.RoomDto;
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.CommonUtil;
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;
@@ -48,34 +43,43 @@
    @Override
    public ResponseEntity<String> importExcelData(IPageData pd, MultipartFile uploadFile) throws Exception {
        ComponentValidateResult result = this.validateStoreStaffCommunityRelationship(pd, restTemplate);
        try {
            ComponentValidateResult result = this.validateStoreStaffCommunityRelationship(pd, restTemplate);
        //InputStream is = uploadFile.getInputStream();
            //InputStream is = uploadFile.getInputStream();
        Workbook workbook = null;  //工作簿
        //工作表
        String[] headers = null;   //表头信息
        List<ImportFloor> floors = new ArrayList<ImportFloor>();
        List<ImportOwner> owners = new ArrayList<ImportOwner>();
        List<ImportRoom> rooms = new ArrayList<ImportRoom>();
        List<ImportParkingSpace> parkingSpaces = new ArrayList<ImportParkingSpace>();
        workbook = ImportExcelUtils.createWorkbook(uploadFile);
        //获取楼信息
        getFloors(workbook, floors);
        //获取业主信息
        getOwners(workbook, owners);
            Workbook workbook = null;  //工作簿
            //工作表
            String[] headers = null;   //表头信息
            List<ImportFloor> floors = new ArrayList<ImportFloor>();
            List<ImportOwner> owners = new ArrayList<ImportOwner>();
            List<ImportFee> fees = new ArrayList<>();
            List<ImportRoom> rooms = new ArrayList<ImportRoom>();
            List<ImportParkingSpace> parkingSpaces = new ArrayList<ImportParkingSpace>();
            workbook = ImportExcelUtils.createWorkbook(uploadFile);
            //获取楼信息
            getFloors(workbook, floors);
            //获取业主信息
            getOwners(workbook, owners);
        //获取房屋信息
        getRooms(workbook, rooms, floors, owners);
        //获取车位信息
        getParkingSpaces(workbook, parkingSpaces, owners);
            getFee(workbook, fees);
        //数据校验
        importExcelDataValidate(floors, owners, rooms, parkingSpaces);
            //获取房屋信息
            getRooms(workbook, rooms, floors, owners);
        // 保存数据
        return dealExcelData(pd, floors, owners, rooms, parkingSpaces, result);
            //获取车位信息
            getParkingSpaces(workbook, parkingSpaces, owners);
            //数据校验
            importExcelDataValidate(floors, owners, rooms, fees, parkingSpaces);
            // 保存数据
            return dealExcelData(pd, floors, owners, rooms, parkingSpaces, fees, result);
        } catch (Exception e) {
            logger.error("导入失败 ", e);
            return new ResponseEntity<String>("非常抱歉,您填写的模板数据有误:" + e.getMessage(), HttpStatus.BAD_REQUEST);
        }
    }
    /**
@@ -86,7 +90,13 @@
     * @param rooms         房屋信息
     * @param parkingSpaces 车位信息
     */
    private ResponseEntity<String> dealExcelData(IPageData pd, List<ImportFloor> floors, List<ImportOwner> owners, List<ImportRoom> rooms, List<ImportParkingSpace> parkingSpaces, ComponentValidateResult result) {
    private ResponseEntity<String> dealExcelData(IPageData pd,
                                                 List<ImportFloor> floors,
                                                 List<ImportOwner> owners,
                                                 List<ImportRoom> rooms,
                                                 List<ImportParkingSpace> parkingSpaces,
                                                 List<ImportFee> fees,
                                                 ComponentValidateResult result) {
        ResponseEntity<String> responseEntity = null;
        //保存单元信息 和 楼栋信息
        responseEntity = savedFloorAndUnitInfo(pd, floors, result);
@@ -101,8 +111,14 @@
            return responseEntity;
        }
        // 保存费用项
        responseEntity = savedFeeInfo(pd, fees, result);
        if (responseEntity == null || responseEntity.getStatusCode() != HttpStatus.OK) {
            return responseEntity;
        }
        //保存房屋
        responseEntity = savedRoomInfo(pd, rooms, result);
        responseEntity = savedRoomInfo(pd, rooms, fees, result);
        if (responseEntity == null || responseEntity.getStatusCode() != HttpStatus.OK) {
            return responseEntity;
        }
@@ -112,6 +128,34 @@
        if (responseEntity == null || responseEntity.getStatusCode() != HttpStatus.OK) {
            return responseEntity;
        }
        return responseEntity;
    }
    private ResponseEntity<String> savedFeeInfo(IPageData pd, List<ImportFee> fees, ComponentValidateResult result) {
        String apiUrl = "";
        JSONObject paramIn = null;
        ResponseEntity<String> responseEntity = new ResponseEntity<String>("成功", HttpStatus.OK);
        ImportOwner owner = null;
        for (ImportFee fee : fees) {
            JSONObject savedFeeConfigInfo = getExistsFee(pd, result, fee);
            if (savedFeeConfigInfo != null) {
                continue;
            }
            //paramIn = new JSONObject();
            //保存 费用项
            apiUrl = ServiceConstant.SERVICE_API_URL + "/api/feeConfig.saveFeeConfig";
            paramIn = JSONObject.parseObject(JSONObject.toJSONString(fee));
            paramIn.put("communityId", result.getCommunityId());
            responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(), apiUrl, HttpMethod.POST);
            if (responseEntity.getStatusCode() != HttpStatus.OK) {
                continue;
            }
        }
        return responseEntity;
@@ -131,7 +175,7 @@
        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();
            // 如果不存在,才插入
@@ -140,6 +184,7 @@
                paramIn.put("communityId", result.getCommunityId());
                paramIn.put("typeCd", parkingSpace.getTypeCd());
                paramIn.put("num", parkingSpace.getPaNum());
                responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(), apiUrl, HttpMethod.POST);
                savedParkingAreaInfo = getExistsParkingArea(pd, result, parkingSpace);
            }
@@ -160,6 +205,7 @@
            paramIn.put("num", parkingSpace.getPsNum());
            paramIn.put("area", parkingSpace.getArea());
            paramIn.put("typeCd", parkingSpace.getTypeCd());
            paramIn.put("parkingType", "1");
            responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(), apiUrl, HttpMethod.POST);
            if (responseEntity.getStatusCode() != HttpStatus.OK) {
@@ -188,26 +234,12 @@
            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);
            if (responseEntity.getStatusCode() != HttpStatus.OK) {
                continue;
            }
            JSONObject configInfo = JSONObject.parseObject(responseEntity.getBody()).getJSONArray("feeConfigs").getJSONObject(0);
            if (!configInfo.containsKey("additionalAmount")) {
                continue;
            }
            paramIn.put("receivedAmount", configInfo.getString("additionalAmount"));
            apiUrl = ServiceConstant.SERVICE_API_URL + "/api/parkingSpace.sellParkingSpace";
            responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(), apiUrl, HttpMethod.POST);
@@ -225,7 +257,7 @@
     * @param result
     * @return
     */
    private ResponseEntity<String> savedRoomInfo(IPageData pd, List<ImportRoom> rooms, ComponentValidateResult result) {
    private ResponseEntity<String> savedRoomInfo(IPageData pd, List<ImportRoom> rooms, List<ImportFee> fees, ComponentValidateResult result) {
        String apiUrl = "";
        JSONObject paramIn = null;
        ResponseEntity<String> responseEntity = new ResponseEntity<String>("成功", HttpStatus.OK);
@@ -240,7 +272,6 @@
            //保存 房屋
            apiUrl = ServiceConstant.SERVICE_API_URL + "/api/room.saveRoom";
            paramIn.put("communityId", result.getCommunityId());
@@ -251,7 +282,9 @@
            paramIn.put("apartment", room.getSection());
            paramIn.put("state", "2002");
            paramIn.put("builtUpArea", room.getBuiltUpArea());
            paramIn.put("unitPrice", "1000.00");
            paramIn.put("feeCoefficient", "1.00");
            paramIn.put("roomType", "0".equals(room.getFloor().getUnitNum()) ? RoomDto.ROOM_TYPE_SHOPS : RoomDto.ROOM_TYPE_SHOPS);
            responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(), apiUrl, HttpMethod.POST);
            if (responseEntity.getStatusCode() != HttpStatus.OK) {
@@ -273,7 +306,49 @@
            paramIn.put("roomId", savedRoomInfo.getString("roomId"));
            paramIn.put("state", "2001");
            paramIn.put("storeId", result.getStoreId());
            if (!StringUtil.isEmpty(room.getRoomFeeId()) && "0".equals(room.getRoomFeeId())) {
                paramIn.put("feeEndDate", room.getFeeEndDate());
            }
            responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(), apiUrl, HttpMethod.POST);
            if (responseEntity.getStatusCode() != HttpStatus.OK) {
                continue;
            }
            //创建费用
            if (StringUtil.isEmpty(room.getRoomFeeId()) || "0".equals(room.getRoomFeeId())) {
                continue;
            }
            String[] feeIds = room.getRoomFeeId().split("#");
            for (int feeIndex = 0; feeIndex < feeIds.length; feeIndex++) {
                String feeId = feeIds[feeIndex];
                ImportFee tmpFee = null;
                for (ImportFee fee : fees) {
                    if (feeId.equals(fee.getId())) {
                        tmpFee = fee;
                    }
                }
                if (tmpFee == null) {
                    continue;//没有费用项,可能写错了
                }
                JSONObject ttFee = getExistsFee(pd, result, tmpFee);
                if (ttFee == null) {
                    continue;//没有费用项,可能写错了
                }
                apiUrl = ServiceConstant.SERVICE_API_URL + "/api/fee.saveRoomCreateFee";
                paramIn.put("communityId", result.getCommunityId());
                paramIn.put("locationTypeCd", "3000");
                paramIn.put("locationObjId", savedRoomInfo.getString("roomId"));
                paramIn.put("configId", ttFee.getString("configId"));
                paramIn.put("storeId", result.getStoreId());
                paramIn.put("feeEndDate", room.getFeeEndDate().split("#")[feeIndex]);
                paramIn.put("startTime", paramIn.getString("feeEndDate"));
                responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(), apiUrl, HttpMethod.POST);
            }
        }
@@ -293,7 +368,7 @@
        String apiUrl = "";
        ResponseEntity<String> responseEntity = null;
        apiUrl = ServiceConstant.SERVICE_API_URL + "/api/parkingSpace.queryParkingSpaces?page=1&row=1&communityId=" + result.getCommunityId()
                + "&num=" + parkingSpace.getPsNum();
                + "&num=" + parkingSpace.getPsNum() + "&areaNum=" + parkingSpace.getPaNum();
        responseEntity = this.callCenterService(restTemplate, pd, "", apiUrl, HttpMethod.GET);
        if (responseEntity.getStatusCode() != HttpStatus.OK) { //跳过 保存单元信息
@@ -311,6 +386,39 @@
        JSONObject savedParkingSpaceInfo = savedParkingSpaceInfoResults.getJSONArray("parkingSpaces").getJSONObject(0);
        return savedParkingSpaceInfo;
    }
    /**
     * 查询存在的房屋信息
     * room.queryRooms
     *
     * @param pd
     * @param result
     * @param fee
     * @return
     */
    private JSONObject getExistsFee(IPageData pd, ComponentValidateResult result, ImportFee fee) {
        String apiUrl = "";
        ResponseEntity<String> responseEntity = null;
        apiUrl = ServiceConstant.SERVICE_API_URL + "/api/feeConfig.listFeeConfigs?page=1&row=1&communityId=" + result.getCommunityId()
                + "&feeName=" + fee.getFeeName();
        responseEntity = this.callCenterService(restTemplate, pd, "", apiUrl, HttpMethod.GET);
        if (responseEntity.getStatusCode() != HttpStatus.OK) { //跳过 保存单元信息
            return null;
        }
        JSONObject savedRoomInfoResults = JSONObject.parseObject(responseEntity.getBody());
        if (!savedRoomInfoResults.containsKey("feeConfigs") || savedRoomInfoResults.getJSONArray("feeConfigs").size() != 1) {
            return null;
        }
        JSONObject savedFeeConfigInfo = savedRoomInfoResults.getJSONArray("feeConfigs").getJSONObject(0);
        return savedFeeConfigInfo;
    }
@@ -380,7 +488,12 @@
            paramIn.put("ownerTypeCd", "1001");
            paramIn.put("idCard", owner.getIdCard());
            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) {
                    throw new IllegalArgumentException(body.getString("msg"));
                }
                savedOwnerInfo = getExistsOwner(pd, result, owner);
                owner.setOwnerId(savedOwnerInfo.getString("ownerId"));
            }
@@ -412,6 +525,8 @@
                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);
            }
@@ -439,6 +554,7 @@
            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对象
@@ -560,7 +676,8 @@
     * @param rooms
     * @param parkingSpaces
     */
    private void importExcelDataValidate(List<ImportFloor> floors, List<ImportOwner> owners, List<ImportRoom> rooms, List<ImportParkingSpace> parkingSpaces) {
    private void importExcelDataValidate(List<ImportFloor> floors, List<ImportOwner> owners, List<ImportRoom> rooms, List<ImportFee> fees, List<ImportParkingSpace> parkingSpaces) {
    }
    /**
@@ -582,12 +699,16 @@
            if (StringUtil.isNullOrNone(os[0])) {
                continue;
            }
            Assert.hasValue(os[0], "车位信息选项中" + (osIndex + 1) + "行停车场编号为空");
            Assert.hasValue(os[1], "车位信息选项中" + (osIndex + 1) + "行车位编码为空");
            Assert.hasValue(os[2], "车位信息选项中" + (osIndex + 1) + "行停车场类型为空");
            Assert.hasValue(os[3], "车位信息选项中" + (osIndex + 1) + "行面积为空,没有请填写规定值 如10");
            importParkingSpace = new ImportParkingSpace();
            importParkingSpace.setPaNum(os[0].toString());
            importParkingSpace.setPsNum(os[1].toString());
            importParkingSpace.setTypeCd(os[2].toString());
            importParkingSpace.setArea(Double.parseDouble(os[3].toString()));
            if (StringUtil.isNullOrNone(os[4])) {
            if (os.length < 5 || StringUtil.isNullOrNone(os[4])) {
                parkingSpaces.add(importParkingSpace);
                continue;
            }
@@ -618,6 +739,58 @@
        List<Object[]> oList = ImportExcelUtils.listFromSheet(sheet);
        ImportRoom importRoom = null;
        for (int osIndex = 0; osIndex < oList.size(); osIndex++) {
            try {
                Object[] os = oList.get(osIndex);
                if (osIndex == 0) { // 第一行是 头部信息 直接跳过
                    continue;
                }
                if (StringUtil.isNullOrNone(os[0])) {
                    continue;
                }
                Assert.hasValue(os[1], "房屋信息选项中" + (osIndex + 1) + "行楼栋编号为空");
                Assert.hasValue(os[2], "房屋信息选项中" + (osIndex + 1) + "行单元编号为空");
                Assert.hasValue(os[3], "房屋信息选项中" + (osIndex + 1) + "行房屋楼层为空");
                Assert.hasValue(os[4], "房屋信息选项中" + (osIndex + 1) + "行房屋户型为空");
                Assert.hasValue(os[5], "房屋信息选项中" + (osIndex + 1) + "行建筑面积为空");
                if (!StringUtil.isNullOrNone(os[6])) {
                    Assert.hasValue(os[7], "房屋信息选项中" + (osIndex + 1) + "行房屋费用为空");
                    Assert.hasValue(os[8], "房屋信息选项中" + (osIndex + 1) + "行费用到期时间为空");
                }
                importRoom = new ImportRoom();
                importRoom.setRoomNum(os[0].toString());
                importRoom.setFloor(getImportFloor(floors, os[1].toString(), os[2].toString()));
                importRoom.setLayer(Integer.parseInt(os[3].toString()));
                importRoom.setSection(os[4].toString());
                importRoom.setBuiltUpArea(Double.parseDouble(os[5].toString()));
                if (!StringUtil.isNullOrNone(os[6])) {
                    importRoom.setRoomFeeId(os[7].toString());
                    importRoom.setFeeEndDate(os[8].toString());
                }
                if (StringUtil.isNullOrNone(os[6])) {
                    rooms.add(importRoom);
                    continue;
                }
                importRoom.setImportOwner(getImportOwner(owners, os[6].toString()));
                rooms.add(importRoom);
            } catch (Exception e) {
                throw new IllegalArgumentException("房屋信息sheet中第" + (osIndex + 1) + "行数据错误,请检查" + e.getLocalizedMessage());
            }
        }
    }
    /**
     * 获取 房屋信息
     *
     * @param workbook
     * @param importFees
     */
    private void getFee(Workbook workbook, List<ImportFee> importFees) {
        Sheet sheet = null;
        sheet = ImportExcelUtils.getSheet(workbook, "费用设置");
        List<Object[]> oList = ImportExcelUtils.listFromSheet(sheet);
        ImportFee importFee = null;
        for (int osIndex = 0; osIndex < oList.size(); osIndex++) {
            Object[] os = oList.get(osIndex);
            if (osIndex == 0) { // 第一行是 头部信息 直接跳过
                continue;
@@ -625,18 +798,46 @@
            if (StringUtil.isNullOrNone(os[0])) {
                continue;
            }
            importRoom = new ImportRoom();
            importRoom.setRoomNum(os[0].toString());
            importRoom.setFloor(getImportFloor(floors, os[1].toString(), os[2].toString()));
            importRoom.setLayer(Integer.parseInt(os[3].toString()));
            importRoom.setSection(os[4].toString());
            importRoom.setBuiltUpArea(Double.parseDouble(os[5].toString()));
            if (StringUtil.isNullOrNone(os[6])) {
                rooms.add(importRoom);
                continue;
            Assert.hasValue(os[0], "费用设置选项中" + (osIndex + 1) + "行费用编号为空");
            Assert.hasValue(os[1], "费用设置选项中" + (osIndex + 1) + "行费用类型为空");
            Assert.hasValue(os[2], "费用设置选项中" + (osIndex + 1) + "行收费项目为空");
            Assert.hasValue(os[3], "费用设置选项中" + (osIndex + 1) + "行费用标识为空");
            Assert.hasValue(os[4], "费用设置选项中" + (osIndex + 1) + "行费用类型为空");
            Assert.hasValue(os[5], "费用设置选项中" + (osIndex + 1) + "行缴费周期为空");
            Assert.isInteger(os[5].toString(), "费用设置选项中" + (osIndex + 1) + "行缴费周期不是正整数");
            Assert.hasValue(os[6], "费用设置选项中" + (osIndex + 1) + "行出账类型为空");
            Assert.isDate(os[7].toString(), DateUtil.DATE_FORMATE_STRING_B, "费用设置选项中" + (osIndex + 1) + "行计费起始时间不是有效时间格式 请输入类似2020-06-01");
            Assert.isDate(os[8].toString(), DateUtil.DATE_FORMATE_STRING_B, "费用设置选项中" + (osIndex + 1) + "行计费终止时间不是有效时间格式 请输入类似2037-01-01");
            Assert.hasValue(os[9], "费用设置选项中" + (osIndex + 1) + "行计算公式为空");
            if (!"1001".equals(os[9].toString()) && !"2002".equals(os[9].toString())) {
                throw new IllegalArgumentException("费用设置选项中" + (osIndex + 1) + "行计算公式错误 请填写1001 或者2002");
            }
            importRoom.setImportOwner(getImportOwner(owners, os[6].toString()));
            rooms.add(importRoom);
            Assert.hasValue(os[10], "费用设置选项中" + (osIndex + 1) + "行计费单价为空");
            Assert.hasValue(os[11], "费用设置选项中" + (osIndex + 1) + "行固定费用为空");
            importFee = new ImportFee();
            importFee.setId(os[0].toString());
            importFee.setFeeTypeCd("物业费".equals(os[1]) ? "888800010001" : "888800010002");
            importFee.setFeeName(os[2].toString());
            importFee.setFeeFlag("周期性费用".equals(os[3]) ? "1003006" : "2006012");
            importFee.setPaymentCd("预付费".equals(os[4]) ? "1200" : "2100");
            String billType = "";
            if ("每年1月1日".equals(os[6])) {
                billType = "001";
            } else if ("每月1日".equals(os[6])) {
                billType = "002";
            } else if ("每日".equals(os[6])) {
                billType = "003";
            } else {
                billType = "004";
            }
            importFee.setBillType(billType);
            importFee.setPaymentCycle(os[5].toString());
            importFee.setStartTime(os[7].toString());
            importFee.setEndTime(os[8].toString());
            importFee.setComputingFormula(os[9].toString());
            importFee.setSquarePrice(os[10].toString());
            importFee.setAdditionalAmount(os[11].toString());
            importFees.add(importFee);
        }
    }
@@ -686,24 +887,40 @@
        List<Object[]> oList = ImportExcelUtils.listFromSheet(sheet);
        ImportOwner importOwner = null;
        for (int osIndex = 0; osIndex < oList.size(); osIndex++) {
            Object[] os = oList.get(osIndex);
            if (osIndex == 0) { // 第一行是 头部信息 直接跳过
                continue;
            try {
                Object[] os = oList.get(osIndex);
                if (osIndex == 0) { // 第一行是 头部信息 直接跳过
                    continue;
                }
                if (StringUtil.isNullOrNone(os[0])) {
                    continue;
                }
                Assert.hasValue(os[0], "业主信息选项中" + (osIndex + 1) + "行业主编号为空");
                Assert.hasValue(os[1], "业主信息选项中" + (osIndex + 1) + "行业主名称为空");
                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());
                importOwner.setOwnerName(os[1].toString());
                importOwner.setSex("男".equals(os[2].toString()) ? "0" : "1");
                importOwner.setAge(Integer.parseInt(age));
                importOwner.setTel(tel);
                importOwner.setIdCard(idCard);
                owners.add(importOwner);
            } catch (Exception e) {
                logger.error("第" + (osIndex + 1) + "行数据出现问题", e);
                throw new IllegalArgumentException("第" + (osIndex + 1) + "行数据出现问题" + e.getLocalizedMessage(), e);
            }
            if (StringUtil.isNullOrNone(os[0])) {
                continue;
            }
            String tel = StringUtil.isNullOrNone(os[4]) ? "19999999999" : os[4].toString();
            String idCard = StringUtil.isNullOrNone(os[5]) ? "10000000000000000001" : os[5].toString();
            String age = StringUtil.isNullOrNone(os[2]) ? CommonUtil.getAgeByCertId(idCard) : os[2].toString();
            importOwner = new ImportOwner();
            importOwner.setOwnerNum(os[0].toString());
            importOwner.setOwnerName(os[1].toString());
            importOwner.setSex("男".equals(os[2].toString()) ? "0" : "1");
            importOwner.setAge(Integer.parseInt(age));
            importOwner.setTel(tel);
            importOwner.setIdCard(idCard);
            owners.add(importOwner);
        }
    }
@@ -727,6 +944,11 @@
            if (StringUtil.isNullOrNone(os[0])) {
                continue;
            }
            Assert.hasValue(os[0], "楼栋单元选项中" + (osIndex + 1) + "行楼栋号为空");
            Assert.hasValue(os[1], "楼栋单元选项中" + (osIndex + 1) + "行单元编号为空");
            Assert.hasValue(os[2], "楼栋单元选项中" + (osIndex + 1) + "行总楼层为空");
            Assert.hasValue(os[3], "楼栋单元选项中" + (osIndex + 1) + "行是否有电梯为空");
            importFloor = new ImportFloor();
            importFloor.setFloorNum(os[0].toString());
            importFloor.setUnitNum(os[1].toString());