| | |
| | | private YwRoomMapper ywRoomMapper; |
| | | @Autowired |
| | | private YwBuildingMapper ywBuildingMapper; |
| | | @Autowired |
| | | private YwFloorMapper ywFloorMapper; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | |
| | | model.setProjectId(room.getProjectId()); |
| | | }else{ |
| | | //如果是公共区域装修,必须选择楼宇信息 |
| | | if(model.getBuildingId()==null){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"对不起,请选择正确的楼宇信息!"); |
| | | if(model.getFloorId()==null){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"对不起,请选择正确的楼层信息!"); |
| | | } |
| | | YwBuilding room = ywBuildingMapper.selectById(model.getRoomId()); |
| | | YwFloor room = ywFloorMapper.selectById(model.getFloorId()); |
| | | if(room ==null || Constants.equalsInteger(room.getIsdeleted(),Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"对不起,请选择正确的楼宇信息!"); |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"对不起,请选择正确的楼层信息!"); |
| | | } |
| | | model.setBuildingId(room.getBuildingId()); |
| | | model.setProjectId(room.getProjectId()); |
| | | } |
| | | } |