去掉分组管理无用代码

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

@@ -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();
}
}