09-24-节点更新改为批量更新

This commit is contained in:
2025-09-24 19:18:53 +08:00
parent 2033a7d3c6
commit 25188a80de
3 changed files with 9 additions and 6 deletions

View File

@ -89,7 +89,7 @@ public class OpsInspectionNodeController extends BaseController {
@Log(title = "运维-巡检-通用节点", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody OpsInspectionNodeBo bo) {
public R<Void> edit(@Validated(EditGroup.class) @RequestBody List<OpsInspectionNodeBo> bo) {
return toAjax(opsInspectionNodeService.updateByBo(bo));
}

View File

@ -56,7 +56,7 @@ public interface IOpsInspectionNodeService {
* @param bo 运维-巡检-通用节点
* @return 是否修改成功
*/
Boolean updateByBo(OpsInspectionNodeBo bo);
Boolean updateByBo(List<OpsInspectionNodeBo> bo);
/**
* 校验并批量删除运维-巡检-通用节点信息

View File

@ -117,10 +117,13 @@ public class OpsInspectionNodeServiceImpl implements IOpsInspectionNodeService {
* @return 是否修改成功
*/
@Override
public Boolean updateByBo(OpsInspectionNodeBo bo) {
OpsInspectionNode update = MapstructUtils.convert(bo, OpsInspectionNode.class);
validEntityBeforeSave(update);
return baseMapper.updateById(update) > 0;
public Boolean updateByBo(List<OpsInspectionNodeBo> bo) {
for (OpsInspectionNodeBo nodeBo : bo) {
OpsInspectionNode update = MapstructUtils.convert(nodeBo, OpsInspectionNode.class);
validEntityBeforeSave(update);
baseMapper.updateById(update);
}
return true;
}
/**