Compare commits
2 Commits
c1d3eed342
...
1260d288a2
Author | SHA1 | Date | |
---|---|---|---|
1260d288a2 | |||
30f9e6aa85 |
@ -119,4 +119,9 @@ public class InspectionPlanController {
|
|||||||
BeanUtils.toBean(list, InspectionPlanRespVO.class));
|
BeanUtils.toBean(list, InspectionPlanRespVO.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/hasChild")
|
||||||
|
@Operation(summary = "是否有子节点")
|
||||||
|
public CommonResult<Boolean> hasInspectionPlan(@RequestParam("id") Long id) {
|
||||||
|
return success(inspectionPlanService.hasChildInspectionPlan(id));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -77,4 +77,9 @@ public interface InspectionPlanService {
|
|||||||
* @return java.util.List<com.inspur.module.system.dal.dataobject.inspection.InspectionPlanDO>
|
* @return java.util.List<com.inspur.module.system.dal.dataobject.inspection.InspectionPlanDO>
|
||||||
*/
|
*/
|
||||||
List<InspectionPlanDO> getInspectionPlanHaveFeedbackList(InspectionPlanListReqVO reqVO);
|
List<InspectionPlanDO> getInspectionPlanHaveFeedbackList(InspectionPlanListReqVO reqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否有子节点
|
||||||
|
*/
|
||||||
|
Boolean hasChildInspectionPlan(Long id);
|
||||||
}
|
}
|
||||||
|
@ -127,4 +127,15 @@ public class InspectionPlanServiceImpl implements InspectionPlanService {
|
|||||||
}
|
}
|
||||||
return inspectionPlanDOS;
|
return inspectionPlanDOS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
/**
|
||||||
|
* 是否有子节点
|
||||||
|
*/
|
||||||
|
public Boolean hasChildInspectionPlan(Long id){
|
||||||
|
QueryWrapper<InspectionPlanDO> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.apply("find_in_set("+id+",ancestors)")
|
||||||
|
.eq("deleted",0);
|
||||||
|
return inspectionPlanMapper.selectCount(queryWrapper) > 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -77,3 +77,11 @@ export function getInspectionPlanListHaveFeedback(params) {
|
|||||||
params,
|
params,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//是否有子节点
|
||||||
|
export function hasInspectionPlanChild(id) {
|
||||||
|
return request({
|
||||||
|
url: "/imt/inspection-plan/hasChild?id=" + id,
|
||||||
|
method: "get",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
@ -109,7 +109,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div class="item-title">
|
<div class="item-title">
|
||||||
<div class="title"><span style="margin-left:3%">设备运行情况</span>
|
<div class="title"><span style="margin-left:3%">设备报警</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="underline"></div>
|
<div class="underline"></div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -257,9 +257,19 @@ export default {
|
|||||||
'是否确认删除点检方案编号为"' + inspectionPlanId + '"的数据项?'
|
'是否确认删除点检方案编号为"' + inspectionPlanId + '"的数据项?'
|
||||||
);
|
);
|
||||||
try {
|
try {
|
||||||
|
const hasChildRes = await InspectionPlanApi.hasInspectionPlanChild(
|
||||||
|
inspectionPlanId
|
||||||
|
);
|
||||||
|
if (hasChildRes.data) {
|
||||||
|
this.$message({
|
||||||
|
message: "该节点存在子节点,请先删除子节点!",
|
||||||
|
type: "warning",
|
||||||
|
});
|
||||||
|
} else {
|
||||||
await InspectionPlanApi.deleteInspectionPlan(inspectionPlanId);
|
await InspectionPlanApi.deleteInspectionPlan(inspectionPlanId);
|
||||||
await this.getList();
|
await this.getList();
|
||||||
this.$modal.msgSuccess("删除成功");
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
}
|
||||||
} catch {}
|
} catch {}
|
||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
|
Loading…
Reference in New Issue
Block a user