java110
2023-08-22 ded40ebbd1613490fc68190dbd92db5d7243267f
service-api/src/main/java/com/java110/api/smo/assetImport/impl/ImportOwnerCarSMOImpl.java
@@ -6,15 +6,11 @@
import com.java110.core.context.IPageData;
import com.java110.core.factory.GenerateCodeFactory;
import com.java110.core.log.LoggerFactory;
import com.java110.dto.FloorDto;
import com.java110.dto.RoomDto;
import com.java110.dto.UnitDto;
import com.java110.dto.owner.OwnerCarDto;
import com.java110.dto.owner.OwnerDto;
import com.java110.dto.owner.OwnerRoomRelDto;
import com.java110.dto.parking.ParkingAreaDto;
import com.java110.dto.parking.ParkingSpaceDto;
import com.java110.entity.component.ComponentValidateResult;
import com.java110.dto.system.ComponentValidateResult;
import com.java110.intf.community.*;
import com.java110.intf.user.IOwnerCarV1InnerServiceSMO;
import com.java110.intf.user.IOwnerInnerServiceSMO;
@@ -246,34 +242,27 @@
        for (OwnerCarDto ownerCarDto : ownerCars) {
            if(!"1001".equals(ownerCarDto.getTypeCd()) && !"2001".equals(ownerCarDto.getTypeCd())){
                throw new IllegalArgumentException(ownerCarDto.getCarNum()+"停车场类型应填写 1001(地上停车场)或者 2001 (地下停车场)");
            if (!"1001".equals(ownerCarDto.getTypeCd()) && !"2001".equals(ownerCarDto.getTypeCd())) {
                throw new IllegalArgumentException(ownerCarDto.getCarNum() + "停车场类型应填写 1001(地上停车场)或者 2001 (地下停车场)");
            }
            if(!"H".equals(ownerCarDto.getSpaceSate()) && !"S".equals(ownerCarDto.getSpaceSate())){
                throw new IllegalArgumentException(ownerCarDto.getCarNum()+"车位状态应填写 S(出售)或者 H (出租)");
            }
            //获取房屋名称
            String roomName = ownerCarDto.getRoomName().trim();
            if(!roomName.contains("-")){
                throw new IllegalArgumentException(ownerCarDto.getCarNum()+"房屋号格式错误 格式应为:楼栋-单元-房屋,如果是商铺 楼栋-0-商铺编号");
            }
            String[] split = roomName.split("-", 3);
            if(split.length != 3){
                throw new IllegalArgumentException(ownerCarDto.getCarNum()+"房屋号格式错误 格式应为:楼栋-单元-房屋,如果是商铺 楼栋-0-商铺编号");
            if (!"H".equals(ownerCarDto.getSpaceSate()) && !"S".equals(ownerCarDto.getSpaceSate())) {
                throw new IllegalArgumentException(ownerCarDto.getCarNum() + "车位状态应填写 S(出售)或者 H (出租)");
            }
            OwnerDto ownerDto = new OwnerDto();
            ownerDto.setName(ownerCarDto.getOwnerName());
            ownerDto.setLink(ownerCarDto.getLink());
            ownerDto.setCommunityId(reqJson.getString("communityId"));
            //查询业主
            List<OwnerDto> ownerDtos = ownerInnerServiceSMOImpl.queryOwners(ownerDto);
            Assert.listOnlyOne(ownerDtos, ownerCarDto.getCarNum() + "查询业主信息错误!");
            //Assert.listOnlyOne(ownerDtos, ownerCarDto.getCarNum() + "查询业主信息错误!");
            if (ownerDtos == null || ownerDtos.size() < 1) {
                throw new IllegalArgumentException(ownerCarDto.getCarNum() + "的业主不存在");
            }
            ownerCarDto.setOwnerId(ownerDtos.get(0).getOwnerId());
        }
    }
}
    //解析Excel日期格式
    public static String excelDoubleToDate(String strDate) {