调整批量审核错误提示,既保持查询条件也能提示错误

This commit is contained in:
wangxin
2019-06-24 16:43:06 +08:00
parent 240b10a05d
commit e23b638907

View File

@@ -31,10 +31,13 @@ import java.util.*;
public class ObjectGroupController extends BaseController {
@RequestMapping(value = { "/list" })
public String list(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, HttpServletRequest request,
HttpServletResponse response){
HttpServletResponse response,String tip){
Page<CfgIndexInfo> searchPage=new Page<CfgIndexInfo>(request,response,"a");
Page<CfgIndexInfo> page = objectGroupService.getPolicyListList(searchPage, cfg);
model.addAttribute("page", page);
if(StringUtils.isNotBlank(tip)){
addMessage("error",model,tip);
}
initPageCondition(model,cfg);
return "/cfg/objgroup/list";
}
@@ -270,7 +273,7 @@ public class ObjectGroupController extends BaseController {
objectGroupService.auditPolicy(entity,isAudit,Constants.INSERT_ACTION);
}
if(tip.toString().length()>0){
addMessage(redirectAttributes,"success", tip.toString());
addMessage(redirectAttributes,"error", tip.toString());
}else{
addMessage(redirectAttributes,"success", "audit_success");
}
@@ -289,12 +292,12 @@ public class ObjectGroupController extends BaseController {
}else {
Page<CfgIndexInfo> searchPage=new Page<CfgIndexInfo>(request,response,"r");
Page<CfgIndexInfo> auditPage=new Page<CfgIndexInfo>(request,response,"r");
String tip=null;
try {
BeanUtils.copyProperties(searchPage, auditPage);
String tip= auditAll(auditPage,isValid , cfg,props);
tip= auditAll(auditPage,isValid , cfg,props);
if(tip.toString().length()>0){
addMessage(redirectAttributes,"success", tip.toString());
addMessage(redirectAttributes,"error", tip.toString());
}else{
addMessage(redirectAttributes,"success", "audit_success");
}
@@ -310,7 +313,7 @@ public class ObjectGroupController extends BaseController {
}
//无法保存状态
// return list(model, cfg, request, response);
return list(model, cfg, request, response,tip);
}
return "redirect:" + adminPath +"/objgroup/list?functionId="+functionId;
}