|
@@ -99,6 +99,10 @@ public class RoomServiceImpl extends ServiceImpl<IRoomMapper, Room> implements I
|
|
}
|
|
}
|
|
if(param.getRoomId() != null){
|
|
if(param.getRoomId() != null){
|
|
room.setUpdateTime(null);
|
|
room.setUpdateTime(null);
|
|
|
|
+ Room byId = this.getById(room.getRoomId());
|
|
|
|
+ if(byId.getRoomStatus() == 1){
|
|
|
|
+ throw new BusinessException(ResultCode.ROOM_ING);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
this.saveOrUpdate(room);
|
|
this.saveOrUpdate(room);
|
|
roomNumService.addBatch(room.getRoomId(),param.getNumList());
|
|
roomNumService.addBatch(room.getRoomId(),param.getNumList());
|
|
@@ -108,8 +112,14 @@ public class RoomServiceImpl extends ServiceImpl<IRoomMapper, Room> implements I
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void deleteById(Integer roomId) {
|
|
public void deleteById(Integer roomId) {
|
|
- roomNumService.deleteByRoomId(roomId);
|
|
|
|
Room room = this.getById(roomId);
|
|
Room room = this.getById(roomId);
|
|
|
|
+ if(room == null ){
|
|
|
|
+ throw new BusinessException(ResultCode.ROOM_MISS);
|
|
|
|
+ }
|
|
|
|
+ if(room.getRoomStatus() == 1){
|
|
|
|
+ throw new BusinessException(ResultCode.ROOM_ING);
|
|
|
|
+ }
|
|
|
|
+ roomNumService.deleteByRoomId(roomId);
|
|
if(StringUtils.isNotBlank(room.getRoomShareUrl())){
|
|
if(StringUtils.isNotBlank(room.getRoomShareUrl())){
|
|
uploadToOssUtil.delete(room.getRoomShareUrl());
|
|
uploadToOssUtil.delete(room.getRoomShareUrl());
|
|
}
|
|
}
|