批量下发功能增加,delRow.tag中暂时不打开此功能。
app topic domain和app domain业务修改domain存储cfgkeyword属性。 摘要修改level属性存储为下发的最终数值。 同步的单域配置的增加时间和状态属性从entity中获取
This commit is contained in:
@@ -11,6 +11,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
@@ -162,32 +163,59 @@ public class BasicProtocolController extends BaseController {
|
||||
*/
|
||||
@RequestMapping(value = {"audit"})
|
||||
@RequiresPermissions(value={"basicprotocol:confirm"})
|
||||
public String auditAppPolicyCfg(Integer isAudit,Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes) {
|
||||
AppPolicyCfg entity = new AppPolicyCfg();
|
||||
String[] idArray = ids.split(",");
|
||||
for(String id :idArray){
|
||||
entity = appCfgService.getAppPolicyCfg(Long.parseLong(id),null);
|
||||
entity.setIsAudit(isAudit);
|
||||
entity.setIsValid(isValid);
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
entity.setAuditTime(new Date());
|
||||
entity.setFunctionId(functionId);
|
||||
entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_BASIC_PROTOCOL);
|
||||
public String auditAppPolicyCfg(Model model,@ModelAttribute("cfg")AppPolicyCfg cfg,
|
||||
Integer isValid,
|
||||
Integer isAudit,
|
||||
String ids,
|
||||
Integer functionId,
|
||||
RedirectAttributes redirectAttributes,
|
||||
HttpServletResponse response,
|
||||
HttpServletRequest request) {
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
AppPolicyCfg entity = new AppPolicyCfg();
|
||||
String[] idArray = ids.split(",");
|
||||
for(String id :idArray){
|
||||
entity = appCfgService.getAppPolicyCfg(Long.parseLong(id),null);
|
||||
entity.setIsAudit(isAudit);
|
||||
entity.setIsValid(isValid);
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
entity.setAuditTime(new Date());
|
||||
entity.setFunctionId(functionId);
|
||||
entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_BASIC_PROTOCOL);
|
||||
try {
|
||||
appCfgService.auditAppPolicyCfg(entity,isAudit);
|
||||
addMessage(redirectAttributes,"success","audit_success");
|
||||
} catch (Exception e) {
|
||||
if(e instanceof MaatConvertException) {
|
||||
e.printStackTrace();
|
||||
logger.info("app策略配置下发失败:"+e.getMessage());;
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}else {
|
||||
e.printStackTrace();
|
||||
logger.error("app策略配置下发失败",e);
|
||||
addMessage(redirectAttributes,"error","audit_failed");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}else {
|
||||
Page<AppPolicyCfg> searchPage=new Page<AppPolicyCfg>(request,response,"r");
|
||||
Page<AppPolicyCfg> auditPage=new Page<AppPolicyCfg>(request,response,"r");
|
||||
BeanUtils.copyProperties(searchPage, auditPage);
|
||||
|
||||
try {
|
||||
appCfgService.auditAppPolicyCfg(entity,isAudit);
|
||||
addMessage(redirectAttributes,"success","audit_success");
|
||||
auditAll(auditPage,isValid , cfg);
|
||||
} catch (Exception e) {
|
||||
logger.error("配置下发失败:",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
e.printStackTrace();
|
||||
logger.info("app策略配置下发失败:"+e.getMessage());;
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
e.printStackTrace();
|
||||
logger.error("app策略配置下发失败",e);
|
||||
addMessage(redirectAttributes,"error","audit_failed");
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return policyCfgList(model, cfg, request, response);
|
||||
}
|
||||
return "redirect:" + adminPath +"/basicprotocol/list?functionId="+functionId;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user