|
|
|
@ -165,7 +165,7 @@ public class ObjectController extends BladeController { |
|
|
|
public R<Boolean> remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
|
|
|
public R<Boolean> remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
|
|
|
List<Long> delIdList = Func.toLongList(ids); |
|
|
|
List<Long> delIdList = Func.toLongList(ids); |
|
|
|
QueryWrapper<PlanObjectTemplateEntity> qw = new QueryWrapper<>(); |
|
|
|
QueryWrapper<PlanObjectTemplateEntity> qw = new QueryWrapper<>(); |
|
|
|
qw.lambda().in(PlanObjectTemplateEntity::getObjectId, delIdList); |
|
|
|
qw.lambda().in(PlanObjectTemplateEntity::getObjectId, delIdList).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("该巡检对象已关联模板,请先取消关联"); |
|
|
|
@ -183,7 +183,7 @@ public class ObjectController extends BladeController { |
|
|
|
@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<>(); |
|
|
|
QueryWrapper<PlanObjectTemplateEntity> qw = new QueryWrapper<>(); |
|
|
|
qw.lambda().eq(PlanObjectTemplateEntity::getObjectId, id); |
|
|
|
qw.lambda().eq(PlanObjectTemplateEntity::getObjectId, id).eq(PlanObjectTemplateEntity::getIsDeleted, 0); |
|
|
|
if (status == 1) { |
|
|
|
if (status == 1) { |
|
|
|
int count = planObjectTemplateService.count(qw); |
|
|
|
int count = planObjectTemplateService.count(qw); |
|
|
|
if (count > 0) { |
|
|
|
if (count > 0) { |
|
|
|
|