删除
This commit is contained in:
parent
e2e9834c19
commit
fcfb36868a
@ -69,10 +69,9 @@ public class EmAreaController {
|
|||||||
EmArea area = entityService.getById(id);
|
EmArea area = entityService.getById(id);
|
||||||
List<EmScenic> emScenics = emScenicService.findByAreaId(id);
|
List<EmScenic> emScenics = emScenicService.findByAreaId(id);
|
||||||
if (null != emScenics && !emScenics.isEmpty()) {
|
if (null != emScenics && !emScenics.isEmpty()) {
|
||||||
throw new RuntimeException("机构下面还存在部门,无法删除");
|
throw new RuntimeException("区域下面还存在景区,无法删除");
|
||||||
}
|
}
|
||||||
area.setDelFlag(1);
|
entityService.removeById(area.getId());
|
||||||
entityService.updateById(area);
|
|
||||||
return new ResponseEntity<>(true, HttpStatus.OK);
|
return new ResponseEntity<>(true, HttpStatus.OK);
|
||||||
} catch (DataIntegrityViolationException e) {
|
} catch (DataIntegrityViolationException e) {
|
||||||
LOG.error("删除区域失败", e);
|
LOG.error("删除区域失败", e);
|
||||||
|
@ -73,8 +73,7 @@ public class EmScenicController {
|
|||||||
if (null != fdBaseUsers && !fdBaseUsers.isEmpty()) {
|
if (null != fdBaseUsers && !fdBaseUsers.isEmpty()) {
|
||||||
throw new RuntimeException("部门里面还存在用户,无法删除");
|
throw new RuntimeException("部门里面还存在用户,无法删除");
|
||||||
}
|
}
|
||||||
scenic.setDelFlag(1);
|
entityService.removeById(scenic.getId());
|
||||||
entityService.updateById(scenic);
|
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
} catch (DataIntegrityViolationException e) {
|
} catch (DataIntegrityViolationException e) {
|
||||||
LOG.error("删除景区失败", e);
|
LOG.error("删除景区失败", e);
|
||||||
|
Loading…
Reference in New Issue
Block a user