去掉分组管理无用代码

This commit is contained in:
zhangwenqing
2019-06-05 10:40:36 +08:00
parent 2e2249ce15
commit c83472c508
20 changed files with 395 additions and 1065 deletions

View File

@@ -34,7 +34,7 @@ public class CommonGroupManageController extends BaseController {
@Autowired
private CommonGroupManageService commonGroupManageService;
@RequestMapping(value = {"list", ""})
@RequestMapping(value = {"list"})
public String policyGroupList(CommonGroupInfo cfg, Model model, HttpServletRequest request, HttpServletResponse response) {
if(cfg == null)cfg=new CommonGroupInfo();
Page<CommonGroupInfo> pageCondition = new Page<CommonGroupInfo>(request, response,"r");
@@ -59,7 +59,6 @@ public class CommonGroupManageController extends BaseController {
@RequestMapping(value = "saveOrUpdate")
public String saveOrUpdate(CommonGroupInfo cfg, Model model, RedirectAttributes redirectAttributes,
String itType,Integer groupType,HttpServletRequest request) {
try {
commonGroupManageService.saveOrUpdate(cfg);
addMessage(redirectAttributes,"success","save_success");
@@ -68,10 +67,7 @@ public class CommonGroupManageController extends BaseController {
addMessage(redirectAttributes,"error","save_failed");
LogUtils.saveLog(request, null, e, null);
}
return "redirect:" + adminPath + "/basics/commonGroup/list";
}
@RequestMapping(value={"delete"})
@@ -93,62 +89,63 @@ public class CommonGroupManageController extends BaseController {
return commonGroupManageService.checkIsIssued(groupIds);
}
//Group配置导出
@RequestMapping(value = "exportGroup")
public void exportGroup(Model model,HttpServletRequest request,HttpServletResponse response,
@ModelAttribute("cfg")CommonGroupInfo entity,String ids,RedirectAttributes redirectAttributes){
try {
//export data info
entity.setMenuNameCode("common_group_manage");
List<String> titleList=new ArrayList<String>();
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
Map<String, List> dataMap=new HashMap<String, List>();
Map<String, String> noExportMap=new HashMap<String, String>();
List<CommonGroupInfo> list = new ArrayList<CommonGroupInfo>();
if (!StringUtil.isEmpty(ids)) {
list = commonGroupManageService.findGroupInfoList(ids);
} else {
Page<CommonGroupInfo> pageInfo=new Page<CommonGroupInfo>(request, response,"r");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page page = commonGroupManageService.findCommonGroupInfoList(pageInfo,entity);
list=page.getList();
}
titleList.add(entity.getMenuNameCode());
classMap.put(entity.getMenuNameCode(), CommonGroupInfo.class);
String cfgIndexInfoNoExport=",config_describe,cfg_id,block_type,do_log,action,valid_identifier,is_audit"
+ ",auditor,audit_time,letter,whether_area_block,classification,attribute,label"
+",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,";
// 时间过滤
if (entity.getSearch_create_time_start() == null ) {
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
}
if (entity.getSearch_edit_time_start() == null) {
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
}
if (!StringUtil.isEmpty(entity.gethColumns())) {
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
}
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
dataMap.put(entity.getMenuNameCode(), list);
String timeRange = initTimeMap(entity);
noExportMap.put("timeRange", timeRange);
if ("csv".equals(entity.getExType())) {
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
classMap, dataMap, noExportMap);
} else {
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
classMap, dataMap, noExportMap);
}
} catch (Exception e) {
logger.error("Group export failed",e);
addMessage(redirectAttributes,"error","export_failed");
LogUtils.saveLog(request, null, e, null);
// 数据导出
@RequestMapping(value = "exportGroup")
public void exportGroup(Model model,@ModelAttribute("cfg")CommonGroupInfo entity,String ids,RedirectAttributes redirectAttributes,
HttpServletRequest request,HttpServletResponse response){
try {
entity.setMenuNameCode("common_group_manage");
List<String> titleList=new ArrayList<String>();
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
Map<String, List> dataMap=new HashMap<String, List>();
Map<String, String> noExportMap=new HashMap<String, String>();
List<CommonGroupInfo> list = new ArrayList<CommonGroupInfo>();
if (!StringUtil.isEmpty(ids)) {
list = commonGroupManageService.findGroupInfoList(ids);
} else {
Page<CommonGroupInfo> pageInfo=new Page<CommonGroupInfo>(request, response,"r");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page page = commonGroupManageService.findCommonGroupInfoList(pageInfo,entity);
list=page.getList();
}
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
titleList.add(entity.getMenuNameCode());
classMap.put(entity.getMenuNameCode(), CommonGroupInfo.class);
String cfgIndexInfoNoExport=",config_describe,cfg_id,block_type,do_log,action,valid_identifier,is_audit"
+ ",auditor,audit_time,letter,whether_area_block,classification,attribute,label"
+",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,";
// 时间过滤
if (entity.getSearch_create_time_start() == null ) {
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
}
if (entity.getSearch_edit_time_start() == null) {
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
}
if (!StringUtil.isEmpty(entity.gethColumns())) {
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
}
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
dataMap.put(entity.getMenuNameCode(), list);
String timeRange = initTimeMap(entity);
noExportMap.put("timeRange", timeRange);
if ("csv".equals(entity.getExType())) {
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
classMap, dataMap, noExportMap);
} else {
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
classMap, dataMap, noExportMap);
}
} catch (Exception e) {
logger.error("Group export failed",e);
addMessage(redirectAttributes,"error","export_failed");
LogUtils.saveLog(request, null, e, null);
}
}
}

View File

@@ -10,7 +10,6 @@ import java.util.concurrent.BlockingQueue;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jets3t.service.ServiceException;
import org.springframework.beans.factory.annotation.Autowired;
@@ -20,7 +19,6 @@ import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
@@ -30,12 +28,10 @@ import com.nis.domain.FunctionServiceDict;
import com.nis.domain.Page;
import com.nis.domain.basics.CommonGroupInfo;
import com.nis.domain.basics.IpCommCfg;
import com.nis.domain.basics.PolicyGroupInfo;
import com.nis.domain.configuration.BaseIpCfg;
import com.nis.domain.configuration.CfgIndexInfo;
import com.nis.domain.configuration.IpPortCfg;
import com.nis.domain.configuration.template.IpCommCfgTemplate;
import com.nis.domain.specific.ConfigGroupInfo;
import com.nis.exceptions.MaatConvertException;
import com.nis.util.Constants;
import com.nis.util.DictUtils;
@@ -70,7 +66,6 @@ public class IpCommGroupController extends BaseController {
@RequestMapping(value = { "/addForm" })
public String addForm(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, RedirectAttributes redirectAttributes,
HttpServletRequest request, HttpServletResponse response) {
// IP Group Tyep为5
cfg.setGroupType(5);
initFormCondition(model, cfg);
@@ -102,10 +97,10 @@ public class IpCommGroupController extends BaseController {
public String updateForm(Model model, @ModelAttribute("cfg") IpCommCfg cfg, RedirectAttributes redirectAttributes, String ids,
HttpServletRequest request, HttpServletResponse response) {
cfg = ipCommGroupCfgService.get(Long.parseLong(ids));
// initUpdateFormCondition(model, cfg);
cfg.setGroupType(5);
initUpdateFormCondition(model, cfg);
List<CommonGroupInfo> groupInfos=commonGroupManageService.findCommonGroupInfosByType(5);
List<CommonGroupInfo> groupInfos = commonGroupManageService.findCommonGroupInfosByType(5);
model.addAttribute("policyGroupInfos", groupInfos);
model.addAttribute("_cfg", cfg);
return "/basics/ipCommGroupFormUpdate";
@@ -113,8 +108,8 @@ public class IpCommGroupController extends BaseController {
@RequestMapping(value = { "/update" })
@RequiresPermissions(value = { "ip:common:config" })
public String update(Model model, HttpServletRequest request, HttpServletResponse response,
@ModelAttribute("cfg") IpCommCfg cfg, RedirectAttributes redirectAttributes) {
public String update(Model model, @ModelAttribute("cfg") IpCommCfg cfg, RedirectAttributes redirectAttributes,
HttpServletRequest request, HttpServletResponse response) {
try {
ipCommGroupCfgService.update(cfg);
addMessage(redirectAttributes, "success", "save_success");
@@ -126,47 +121,6 @@ public class IpCommGroupController extends BaseController {
return "redirect:" + adminPath + "/basics/ip/list?functionId=" + cfg.getFunctionId();
}
// @RequestMapping(value = { "/audit" })
// @RequiresPermissions(value = { "ip:common:config" })
// public String audit(Model model, @ModelAttribute("cfg") IpCommCfg cfg, Integer isAudit, Integer isValid,
// String ids, Integer functionId, HttpServletRequest request, HttpServletResponse response,
// RedirectAttributes redirectAttributes) {
// // 选中配置审核
// if (!StringUtil.isEmpty(ids)) {
// List<IpCommCfg> ipGroupCfgs = ipCommGroupCfgService.getByIds(ids);
// List<IpCommCfg> temp = Lists.newArrayList();
// try {
// ipCommGroupCfgService.audit(ipGroupCfgs, isAudit, isValid);
// } catch (Exception e) {
// logger.error("审核失败", e);
// addMessage(redirectAttributes, "error", "audit_failed");
// } finally {
// temp.clear();
// }
// return "redirect:" + adminPath + "/basics/ip/list?functionId=" + cfg.getFunctionId();
// } else {// 全部审核
// // 条件下所有配置审核
// Page<IpCommCfg> searchPage = new Page<IpCommCfg>(request, response, "a");
// Page<IpCommCfg> auditPage = new Page<IpCommCfg>(request, response, "a");
// BeanUtils.copyProperties(searchPage, auditPage);
//
// try {
// auditAll(auditPage, isValid, cfg);
// addMessage(redirectAttributes, "success", "audit_success");
// } catch (Exception e) {
// logger.error("配置下发失败:", e);
// if (e instanceof MaatConvertException) {
// addMessage(redirectAttributes, "error", "request_service_failed");
// } else {
// addMessage(redirectAttributes, "error", "audit_failed");
// }
//
// }
//
// return list(model, request, response, cfg);
// }
// }
@RequestMapping(value = { "/delete" })
@RequiresPermissions(value = { "ip:common:config" })
public String delete(Integer isValid, String ids, Integer functionId, RedirectAttributes redirectAttributes) {
@@ -185,12 +139,11 @@ public class IpCommGroupController extends BaseController {
return "redirect:" + adminPath + "/basics/ip/list?functionId=" + functionId;
}
// ipComm配置导出
// 数据导出
@RequestMapping(value = "/exportIpComm")
public void exportIpCommonCfg(Model model, HttpServletRequest request, HttpServletResponse response,
@ModelAttribute("cfg") IpCommCfg entity, String ids, RedirectAttributes redirectAttributes) {
public void exportIpCommonCfg(Model model, @ModelAttribute("cfg") IpCommCfg entity, String ids, RedirectAttributes redirectAttributes,
HttpServletRequest request, HttpServletResponse response) {
try {
// export data info
List<String> titleList = new ArrayList<String>();
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
Map<String, List> dataMap = new HashMap<String, List>();
@@ -205,7 +158,6 @@ public class IpCommGroupController extends BaseController {
Page<IpCommCfg> page = ipCommGroupCfgService.findPage(pageInfo, entity);
list = page.getList();
}
//
titleList.add(entity.getMenuNameCode());
classMap.put(entity.getMenuNameCode(), IpPortCfg.class);
String cfgIndexInfoNoExport = ",block_type,do_log,action"
@@ -237,139 +189,15 @@ public class IpCommGroupController extends BaseController {
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
classMap, dataMap, noExportMap);
}
} catch (Exception e) {
logger.error("IpCommGroupCfg export failed", e);
addMessage(redirectAttributes, "error", "export_failed");
}
// return "redirect:" + adminPath
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
}
/**
* 批量审核
*
* @param isAudit
* @param isValid
* @param ids
* @param functionId
* @param redirectAttributes
* @return
*/
// @Override
// public void auditAll(Page page, Integer auditType, Object entity) throws Exception {
// long start = System.currentTimeMillis();
// page.setOrderBy("");
// page.setPageSize(Constants.MAAT_JSON_SEND_SIZE);
// page.setPageNo(1);
// page.setLastPage(false);
// // 携带审核状态信息的BaseCfg
// BaseCfg auditBatchCfg = new BaseCfg();
// // 携带审核条件的BaseCfg
// IpCommCfg searchIpCommGroupCfg = new IpCommCfg();
// BeanUtils.copyProperties(entity, auditBatchCfg);
// BeanUtils.copyProperties(entity, searchIpCommGroupCfg);
//
// auditType = (Integer) Reflections.invokeGetter(entity, "isAudit");
//
// // 全部审核通过,只查询当前条件下的所有未审核的配置 -批量审核通过/不通过
// if (auditType.equals(1) || auditType.equals(2)) {
//
// searchIpCommGroupCfg.setIsValid(0);
// searchIpCommGroupCfg.setIsAudit(0);
//
// if (auditType.equals(1)) {
// auditBatchCfg.setIsAudit(1);
// auditBatchCfg.setIsValid(1);
// } else {
// auditBatchCfg.setIsAudit(2);
// auditBatchCfg.setIsValid(0);
// }
// auditBatchCfg.setAuditTime(new Date());
// auditBatchCfg.setAuditorId(UserUtils.getUser().getId());
// } else {
// // 全部取消通过,只查询当前条件下的所有审核通过的配置
// searchIpCommGroupCfg.setIsValid(1);
// searchIpCommGroupCfg.setIsAudit(1);
//
// auditBatchCfg.setIsAudit(3);
// auditBatchCfg.setIsValid(0);
// auditBatchCfg.setAuditTime(new Date());
// auditBatchCfg.setAuditorId(UserUtils.getUser().getId());
// }
//
// ServiceConfigTemplateUtil serviceTemplate = new ServiceConfigTemplateUtil();
// Integer functionId = 0;
// if (auditBatchCfg != null && !StringUtil.isEmpty(auditBatchCfg.getFunctionId())) {
// functionId = auditBatchCfg.getFunctionId();
// }
// List<Map<String, Object>> serviceList = serviceTemplate.getServiceListByFunctionId(functionId);
// for (Map<String, Object> service : serviceList) {
// String tableNameXml = service.get("tableName").toString(); // 获取业务主配置表
// String serviceTypeXml = service.get("serviceType").toString(); // 业务类型 1maat 2callback
// String classNameXml = service.get("className").toString(); // 主配置Java类
// String serviceIdXml = service.get("id").toString(); // service字典表 service_id字段
// auditBatchCfg.setServiceId(Integer.valueOf(serviceIdXml));
// auditBatchCfg.setTableName(tableNameXml);
// searchIpCommGroupCfg.setServiceId(Integer.valueOf(serviceIdXml));
// searchIpCommGroupCfg.setTableName(tableNameXml);
//
// if ("1".equals(serviceTypeXml)) {// maat类配置
// // 存放域配置类型 及 对应表名
// List<Map<String, Object>> cfgList = (List<Map<String, Object>>) service.get("cfgList");
// List<Map<String, Object>> userRegionList = (List<Map<String, Object>>) service.get("userRegionList");
// int cfgType = Integer.parseInt(service.get("cfgType").toString());
// if (auditBatchCfg.getIsAudit() == 1) {
// boolean hasData = true;
//
// while (hasData) {
// page.setPageNo(1);
// page.setLastPage(false);
// List list = ipCommGroupCfgService.findPage(page, searchIpCommGroupCfg).getList();
// if(CollectionUtils.isNotEmpty(list)){
// Map<Integer,List> groupIdMap=new HashMap();
// // 配置生效处理
// if(auditBatchCfg.getIsAudit().equals(1)) {
// hasData=commonPolicyService.auditReuseCommonConfigData(page, auditBatchCfg,groupIdMap,hasData);
// Map<Integer,List> groupIpMap=new HashMap();
// if(CollectionUtils.isNotEmpty(list)) {
// for (IpCommCfg obj : (List<IpCommCfg>)list) {
// BaseCfg baseCfg=(BaseCfg)obj;
// if(!StringUtil.isEmpty(obj.getGroupId())) {
// groupIdMap.get(obj.getGroupId()).add(baseCfg);
// }else {
// List newList=new ArrayList<>();
// newList.add(baseCfg);
// groupIdMap.put(obj.getGroupId(),newList);
// }
// }
// }
//
// }
// if(hasData) {
// page.setPageNo(1);
// page.setLastPage(false);
// }
// }else{
// hasData = false;
// }
// }
// }
// } else {
// throw new RuntimeException("wrong service type " + serviceTypeXml);
// }
// }
//
// // 批量审核通过时如果没有携带isValid检索条件返回界面需要将isValid置为null
// if (!StringUtil.isEmpty(entity)) {
// BaseCfg base = (BaseCfg) entity;
// if (!StringUtil.isEmpty(base.getSeltype()) && base.getSeltype().equals("isValid")) {
// base.setIsValid(null);
// BeanUtils.copyProperties(base, entity);
// }
// }
// long end = System.currentTimeMillis();
// logger.warn("配置批量生效/失效耗时:" + (end - start));
// }
@RequestMapping(value = "import", method=RequestMethod.POST)
public String importIp(HttpServletRequest request,HttpServletResponse response,RedirectAttributes redirectAttributes,
@RequestParam("files") MultipartFile[] files, Integer serviceDictId ,Integer requestId ,String attribute ,String classify
@@ -464,8 +292,9 @@ public class IpCommGroupController extends BaseController {
logger.warn("import finish,cost:"+(end-start));
return "redirect:" + adminPath+ importPath;
}
/*@ResponseBody
@RequestMapping(value="ajaxGetGroups",method=RequestMethod.POST)
@ResponseBody
public Map<Integer,String> ajaxGetGroups(Model model,@RequestParam(required=true,value="groupIds")String groupIds){
Map<Integer,String> groupIdList=new HashMap<Integer,String>();
if(StringUtils.isNotBlank(groupIds)) {
@@ -475,5 +304,5 @@ public class IpCommGroupController extends BaseController {
}
}
return groupIdList;
}
}*/
}

View File

@@ -8,7 +8,6 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
@@ -41,7 +40,7 @@ public class UrlCommGroupController extends BaseController{
Page<UrlCommCfg> page = urlCommGroupService.findPage(new Page<UrlCommCfg>(request, response,"r"), entity);
List<FunctionRegionDict> regionList = DictUtils.getFunctionRegionDictList(entity.getFunctionId());
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(entity.getFunctionId());
List<CommonGroupInfo> groupInfos=commonGroupManageService.findCommonGroupInfosByType(7);
List<CommonGroupInfo> groupInfos = commonGroupManageService.findCommonGroupInfosByType(7);
model.addAttribute("page", page);
model.addAttribute("regionList", regionList);
@@ -53,14 +52,6 @@ public class UrlCommGroupController extends BaseController{
@RequestMapping(value = {"/addForm"})
public String addForm(Model model, @ModelAttribute("cfg")CfgIndexInfo cfg, RedirectAttributes redirectAttributes,
HttpServletRequest request, HttpServletResponse response){
// UrlCommGroupCfg urlCfg = new UrlCommGroupCfg();
// urlCfg.setCfgType("NTC_URL_REGION");
// cfg.setUrlCommGroupCfg(urlCfg);
// List<UrlCommGroupCfg> urlList = new ArrayList<UrlCommGroupCfg>();
// urlList.add(urlCfg);
// cfg.setUrlCommGroupList(urlList);
// initFormCondition(model, entity);
cfg.setGroupType(11);
initFormCondition(model,cfg);
List<CommonGroupInfo> groupInfos=commonGroupManageService.findCommonGroupInfosByType(7);
@@ -73,7 +64,6 @@ public class UrlCommGroupController extends BaseController{
@RequestMapping(value = {"/save"})
public String save(Model model, @ModelAttribute("cfg")CfgIndexInfo cfg,RedirectAttributes redirectAttributes,
HttpServletRequest request,HttpServletResponse response){
try{
urlCommGroupService.saveUrlCommGroupCfg(cfg);
}catch(Exception e){
@@ -93,7 +83,6 @@ public class UrlCommGroupController extends BaseController{
,HttpServletResponse response,String ids,@ModelAttribute("cfg")UrlCommCfg cfg
,RedirectAttributes redirectAttributes){
cfg = urlCommGroupService.get(Long.parseLong(ids));
// initUpdateFormCondition(model, cfg);
cfg.setGroupType(11);
initUpdateFormCondition(model,cfg);
List<CommonGroupInfo> groupInfos=commonGroupManageService.findCommonGroupInfosByType(7);
@@ -101,6 +90,7 @@ public class UrlCommGroupController extends BaseController{
model.addAttribute("_cfg", cfg);
return "/basics/urlCommGroupFormUpdate";
}
@RequestMapping(value = {"/update"})
public String update(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")UrlCommCfg cfg,RedirectAttributes redirectAttributes){
try{
@@ -114,59 +104,6 @@ public class UrlCommGroupController extends BaseController{
return "redirect:" + adminPath +"/basics/url/list?functionId="+cfg.getFunctionId();
}
@RequestMapping(value = {"/audit"})
public String audit(Model model,@ModelAttribute("cfg")UrlCommCfg cfg
,Integer isAudit
,Integer isValid
,String ids
,Integer functionId
, HttpServletRequest request
,HttpServletResponse response
,RedirectAttributes redirectAttributes) {
//选中配置审核
if(!StringUtil.isEmpty(ids)) {
List<UrlCommCfg> urlGroupCfgs=urlCommGroupService.getByIds(ids);
// Map<Long,List<UrlCommGroupCfg>> urlcfgMap=Maps.newHashMap();
// for(UrlCommGroupCfg urlCommCfg:urlGroupCfgs) {
// urlCommCfg.setIsAudit(isAudit);
// urlCommCfg.setIsValid(isValid);
// urlCommCfg.setAuditorId(UserUtils.getUser().getId());
// urlCommCfg.setAuditTime(new Date());
// urlCommCfg.setFunctionId(functionId);
// if(urlcfgMap.containsKey(Long.parseLong(urlCommCfg.getUserRegion3()))) {
// urlcfgMap.get(Long.parseLong(urlCommCfg.getUserRegion3())).add(urlCommCfg);
// }else {
// List<UrlCommGroupCfg> _urlCfgs=Lists.newArrayList();
// _urlCfgs.add(urlCommCfg);
// urlcfgMap.put(Long.parseLong(urlCommCfg.getUserRegion3()), _urlCfgs);
// }
// }
/********************每次下发一个组的region保证事物********************/
// for (Long groupId : urlcfgMap.keySet()) {
// try {
// urlCommGroupService.audit(urlcfgMap.get(groupId),groupId,isValid);
// } catch (Exception e) {
// logger.error("配置下发失败:",e);
// if(e instanceof MaatConvertException) {
// addMessage(redirectAttributes,"error", "request_service_failed");
// }else {
// addMessage(redirectAttributes,"error", "audit_failed");
// }
//
// }
// }
for (UrlCommCfg urlCommGroup : urlGroupCfgs) {
try {
urlCommGroupService.audit(urlCommGroup,isAudit,isValid);
} catch (Exception e) {
logger.error("审核失败",e);
addMessage(redirectAttributes,"error","audit_failed");
}
}
}
return "redirect:" + adminPath +"/basics/url/list?functionId="+cfg.getFunctionId();
}
@RequestMapping(value = {"/delete"})
public String delete(Integer isValid
,String ids,Integer functionId
@@ -185,12 +122,12 @@ public class UrlCommGroupController extends BaseController{
return "redirect:" + adminPath +"/basics/url/list?functionId="+functionId;
}
//urlComm配置导出
// 数据导出
@RequestMapping(value = "/exportUrlComm")
public void exportAsnIp(Model model,HttpServletRequest request,HttpServletResponse response,
public void exportUrlComm(Model model,HttpServletRequest request,HttpServletResponse response,
@ModelAttribute("cfg")UrlCommCfg entity,String ids,RedirectAttributes redirectAttributes){
try {
//export data info
List<String> titleList=new ArrayList<String>();
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
Map<String, List> dataMap=new HashMap<String, List>();
@@ -205,7 +142,7 @@ public class UrlCommGroupController extends BaseController{
Page<UrlCommCfg> page = urlCommGroupService.findPage(pageInfo, entity);
list=page.getList();
}
//
titleList.add(entity.getMenuNameCode());
classMap.put(entity.getMenuNameCode(), UrlCommCfg.class);
String cfgIndexInfoNoExport=",block_type,do_log,action"
@@ -237,10 +174,12 @@ public class UrlCommGroupController extends BaseController{
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
classMap, dataMap, noExportMap);
}
} catch (Exception e) {
logger.error("urlGroupConfig export failed",e);
addMessage(redirectAttributes,"error","export_failed");
}
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
}
}