Browse Source

fix:对象取消和停用判断条件错误

master
luyie 9 hours ago
parent
commit
3bf4090666
  1. 4
      HZInfo-RIS-PXHD/hzinfo-ris-pxhd-service/hzinfo-inspect-service/src/main/java/org/springblade/hzinfo_inspect/obj/web/ObjectController.java

4
HZInfo-RIS-PXHD/hzinfo-ris-pxhd-service/hzinfo-inspect-service/src/main/java/org/springblade/hzinfo_inspect/obj/web/ObjectController.java

@ -165,7 +165,7 @@ public class ObjectController extends BladeController {
public R<Boolean> remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
List<Long> delIdList = Func.toLongList(ids);
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);
if (count > 0) {
return R.fail("该巡检对象已关联模板,请先取消关联");
@ -183,7 +183,7 @@ public class ObjectController extends BladeController {
@ApiOperation(value = "启用/停用", notes = "传入id,以及目标状态0-启用,1-停用")
public R<Boolean> disableOrEnable(@RequestParam Long id, @RequestParam Integer status) {
QueryWrapper<PlanObjectTemplateEntity> qw = new QueryWrapper<>();
qw.lambda().eq(PlanObjectTemplateEntity::getObjectId, id);
qw.lambda().eq(PlanObjectTemplateEntity::getObjectId, id).eq(PlanObjectTemplateEntity::getIsDeleted, 0);
if (status == 1) {
int count = planObjectTemplateService.count(qw);
if (count > 0) {

Loading…
Cancel
Save