09-24-节点更新改为批量更新
This commit is contained in:
@ -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));
|
||||
}
|
||||
|
||||
|
||||
@ -56,7 +56,7 @@ public interface IOpsInspectionNodeService {
|
||||
* @param bo 运维-巡检-通用节点
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(OpsInspectionNodeBo bo);
|
||||
Boolean updateByBo(List<OpsInspectionNodeBo> bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除运维-巡检-通用节点信息
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user