|
|
|
@ -182,9 +182,9 @@ public class ObjectController extends BladeController { |
|
|
|
@ApiOperationSupport(order = 5) |
|
|
|
@ApiOperationSupport(order = 5) |
|
|
|
@ApiOperation(value = "启用/停用", notes = "传入id,以及目标状态0-启用,1-停用") |
|
|
|
@ApiOperation(value = "启用/停用", notes = "传入id,以及目标状态0-启用,1-停用") |
|
|
|
public R<Boolean> disableOrEnable(@RequestParam Long id, @RequestParam Integer status) { |
|
|
|
public R<Boolean> disableOrEnable(@RequestParam Long id, @RequestParam Integer status) { |
|
|
|
QueryWrapper<PlanObjectTemplateEntity> qw = new QueryWrapper<>(); |
|
|
|
|
|
|
|
qw.lambda().eq(PlanObjectTemplateEntity::getObjectId, id).eq(PlanObjectTemplateEntity::getIsDeleted, 0); |
|
|
|
|
|
|
|
if (status == 1) { |
|
|
|
if (status == 1) { |
|
|
|
|
|
|
|
QueryWrapper<PlanObjectTemplateEntity> qw = new QueryWrapper<>(); |
|
|
|
|
|
|
|
qw.lambda().eq(PlanObjectTemplateEntity::getObjectId, id).eq(PlanObjectTemplateEntity::getIsDeleted, 0); |
|
|
|
int count = planObjectTemplateService.count(qw); |
|
|
|
int count = planObjectTemplateService.count(qw); |
|
|
|
if (count > 0) { |
|
|
|
if (count > 0) { |
|
|
|
return R.fail("该巡检对象已关联模板,请先取消关联"); |
|
|
|
return R.fail("该巡检对象已关联模板,请先取消关联"); |
|
|
|
|