先看效果图
//任务完成
public int recommendManagementByIds(String [] ids);
//任务没有完成
public int boycottManagementByIds(String [] ids);
//任务完成
@Override
public int recommendManagementByIds(String ids){
return managementMapper.recommendManagementByIds(Convert.toStrArray(ids));
}
//任务未完成
@Override
public int boycottManagementByIds(String ids){
return managementMapper.boycottManagementByIds(Convert.toStrArray(ids));
}
//任务完成
@PostMapping("/recommend")
@ResponseBody
public AjaxResult recommend(String ids)
{
return toAjax(managementService.recommendManagementByIds(ids));
}
//任务没有完成
@PostMapping("/boycott")
@ResponseBody
public AjaxResult boycott(String ids)
{
return toAjax(managementService.boycottManagementByIds(ids));
}
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success " onclick="$.operate.recommendAll()" >
<!-- multiple--倍数 -->
<i class="fa fa-edit"></i>任务完成
</a>
<a class="btn btn-danger " onclick="$.operate.boycottAll()">
<!-- multiple--倍数 -->
<i class="fa fa-edit"></i>任务未完成
</a>
</div>
recommendUrl:ctx+"system/management/recommend",//任务完成
boycottUrl :ctx+"system/management/boycott",//任务未完成