jiangping
2024-11-25 d0fe6ceb4dbb8531e5e7714c5d05d03ec211d3a2
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwWorkorderServiceImpl.java
@@ -57,6 +57,8 @@
    private YwRoomMapper ywRoomMapper;
    @Autowired
    private YwBuildingMapper ywBuildingMapper;
    @Autowired
    private YwFloorMapper ywFloorMapper;
    @Override
    @Transactional(rollbackFor = {BusinessException.class,Exception.class})
@@ -130,13 +132,14 @@
            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());
        }
    }