业务配置导出首行增加标题和时间范围
This commit is contained in:
@@ -64,6 +64,7 @@ import com.nis.web.security.UserUtils;
|
||||
|
||||
/**
|
||||
* 特定协议相关配置控制类
|
||||
*
|
||||
* @author zhangwei
|
||||
*
|
||||
*/
|
||||
@@ -72,48 +73,58 @@ import com.nis.web.security.UserUtils;
|
||||
public class AppFeatureCfgController extends BaseController {
|
||||
/**
|
||||
* app协议复杂特征配置列表
|
||||
*
|
||||
* @param model
|
||||
* @param cfg
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"multiFeatureCfgList"})
|
||||
public String multiFeatureCfgList(Model model,@ModelAttribute("cfg")AppFeatureIndex cfg,HttpServletRequest request,HttpServletResponse response) {
|
||||
Page<AppFeatureIndex> searchPage=new Page<AppFeatureIndex>(request,response,"r");
|
||||
@RequestMapping(value = { "multiFeatureCfgList" })
|
||||
public String multiFeatureCfgList(Model model, @ModelAttribute("cfg") AppFeatureIndex cfg,
|
||||
HttpServletRequest request, HttpServletResponse response) {
|
||||
Page<AppFeatureIndex> searchPage = new Page<AppFeatureIndex>(request, response, "r");
|
||||
Page<AppFeatureIndex> page = appMultiFeatureCfgService.findAppFeatureIndexList(searchPage, cfg);
|
||||
for(AppFeatureIndex entity:page.getList()){
|
||||
for (AppFeatureIndex entity : page.getList()) {
|
||||
SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId());
|
||||
entity.setAppName(app.getSpecServiceName());
|
||||
}
|
||||
model.addAttribute("page", page);
|
||||
initPageCondition(model,cfg);
|
||||
initPageCondition(model, cfg);
|
||||
return "/cfg/app/appMultiFeatureCfgList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 特征配置表单
|
||||
*
|
||||
* @param model
|
||||
* @param ids
|
||||
* @param entity
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"multiFeatureCfgForm"})
|
||||
public String multiFeatureCfgForm(Model model,String ids,AppFeatureIndex entity) {
|
||||
if(StringUtils.isNotBlank(ids)){
|
||||
@RequestMapping(value = { "multiFeatureCfgForm" })
|
||||
public String multiFeatureCfgForm(Model model, String ids, AppFeatureIndex entity) {
|
||||
if (StringUtils.isNotBlank(ids)) {
|
||||
entity = appMultiFeatureCfgService.getAppFeatureIndex(Long.parseLong(ids));
|
||||
entity.setIpPortList(appMultiFeatureCfgService.getAppIpRangeCfg(entity.getCompileId(), entity.getFunctionId()));
|
||||
entity.setStrList(appMultiFeatureCfgService.getAppStringFeatureCfg(entity.getCompileId(), entity.getFunctionId(),null));
|
||||
entity.setComplexList(appMultiFeatureCfgService.getAppComplexFeatureCfg(entity.getCompileId(), entity.getFunctionId(),null));
|
||||
entity.setNumCfgList(appMultiFeatureCfgService.getAppTcpCfg(entity.getCompileId(), entity.getFunctionId(),null));
|
||||
initUpdateFormCondition(model,entity);
|
||||
}else{
|
||||
initFormCondition(model,entity);
|
||||
entity.setIpPortList(
|
||||
appMultiFeatureCfgService.getAppIpRangeCfg(entity.getCompileId(), entity.getFunctionId()));
|
||||
entity.setStrList(appMultiFeatureCfgService.getAppStringFeatureCfg(entity.getCompileId(),
|
||||
entity.getFunctionId(), null));
|
||||
entity.setComplexList(appMultiFeatureCfgService.getAppComplexFeatureCfg(entity.getCompileId(),
|
||||
entity.getFunctionId(), null));
|
||||
entity.setNumCfgList(
|
||||
appMultiFeatureCfgService.getAppTcpCfg(entity.getCompileId(), entity.getFunctionId(), null));
|
||||
initUpdateFormCondition(model, entity);
|
||||
} else {
|
||||
initFormCondition(model, entity);
|
||||
}
|
||||
model.addAttribute("_cfg", entity);
|
||||
return "/cfg/app/appMultiFeatureCfgForm";
|
||||
}
|
||||
|
||||
/**
|
||||
* 特征配置新增修改
|
||||
*
|
||||
* @param model
|
||||
* @param request
|
||||
* @param response
|
||||
@@ -121,29 +132,32 @@ public class AppFeatureCfgController extends BaseController {
|
||||
* @param redirectAttributes
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"saveAppMultiFeatureCfg"})
|
||||
public String saveAppMultiFeatureCfg(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
AppFeatureIndex entity,RedirectAttributes redirectAttributes) {
|
||||
@RequestMapping(value = { "saveAppMultiFeatureCfg" })
|
||||
public String saveAppMultiFeatureCfg(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
AppFeatureIndex entity, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
SpecificServiceCfg specificService = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId());
|
||||
if(specificService!=null){
|
||||
SpecificServiceCfg specificService = specificServiceCfgService
|
||||
.getBySpecServiceId(entity.getSpecServiceId());
|
||||
if (specificService != null) {
|
||||
entity.setAppCode(specificService.getSpecServiceCode());
|
||||
}
|
||||
appMultiFeatureCfgService.saveOrUpdateAppFeatureCfg(entity);
|
||||
addMessage(redirectAttributes,"success", "save_success");
|
||||
addMessage(redirectAttributes, "success", "save_success");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "save_failed");
|
||||
if (e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} else {
|
||||
addMessage(redirectAttributes, "error", "save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/app/feature/multiFeatureCfgList?functionId="+entity.getFunctionId();
|
||||
|
||||
return "redirect:" + adminPath + "/app/feature/multiFeatureCfgList?functionId=" + entity.getFunctionId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 特征配置审核
|
||||
*
|
||||
* @param isAudit
|
||||
* @param isValid
|
||||
* @param ids
|
||||
@@ -151,19 +165,14 @@ public class AppFeatureCfgController extends BaseController {
|
||||
* @param redirectAttributes
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"auditAppFeatureCfg"})
|
||||
public String auditAppFeatureCfg(Model model,@ModelAttribute("cfg")AppFeatureIndex cfg,
|
||||
Integer isValid,
|
||||
Integer isAudit,
|
||||
String ids,
|
||||
Integer functionId,
|
||||
RedirectAttributes redirectAttributes,
|
||||
HttpServletResponse response,
|
||||
HttpServletRequest request) {
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
@RequestMapping(value = { "auditAppFeatureCfg" })
|
||||
public String auditAppFeatureCfg(Model model, @ModelAttribute("cfg") AppFeatureIndex cfg, Integer isValid,
|
||||
Integer isAudit, String ids, Integer functionId, RedirectAttributes redirectAttributes,
|
||||
HttpServletResponse response, HttpServletRequest request) {
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
AppFeatureIndex entity = new AppFeatureIndex();
|
||||
String[] idArray = ids.split(",");
|
||||
for(String id :idArray){
|
||||
for (String id : idArray) {
|
||||
entity = appMultiFeatureCfgService.getAppFeatureIndex(Long.parseLong(id));
|
||||
entity.setIsAudit(isAudit);
|
||||
entity.setIsValid(isValid);
|
||||
@@ -171,247 +180,264 @@ public class AppFeatureCfgController extends BaseController {
|
||||
entity.setAuditTime(new Date());
|
||||
entity.setFunctionId(functionId);
|
||||
try {
|
||||
appMultiFeatureCfgService.auditAppFeatureCfg(entity,isAudit);
|
||||
addMessage(redirectAttributes,"success", "audit_success");
|
||||
appMultiFeatureCfgService.auditAppFeatureCfg(entity, isAudit);
|
||||
addMessage(redirectAttributes, "success", "audit_success");
|
||||
} catch (MaatConvertException e) {
|
||||
e.printStackTrace();
|
||||
logger.error("app 特征配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
logger.error("app 特征配置下发失败:" + e.getMessage());
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("app 特征配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
logger.error("app 特征配置下发失败:" + e.getMessage());
|
||||
addMessage(redirectAttributes, "error", "audit_failed");
|
||||
}
|
||||
}
|
||||
}else {
|
||||
Page<AppPolicyCfg> searchPage=new Page<AppPolicyCfg>(request,response,"r");
|
||||
Page<AppPolicyCfg> auditPage=new Page<AppPolicyCfg>(request,response,"r");
|
||||
} else {
|
||||
Page<AppPolicyCfg> searchPage = new Page<AppPolicyCfg>(request, response, "r");
|
||||
Page<AppPolicyCfg> auditPage = new Page<AppPolicyCfg>(request, response, "r");
|
||||
|
||||
try {
|
||||
BeanUtils.copyProperties(searchPage, auditPage);
|
||||
auditAll(auditPage,isValid , cfg);
|
||||
addMessage(redirectAttributes,"success", "audit_success");
|
||||
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");
|
||||
logger.error("配置下发失败:", e);
|
||||
if (e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} else {
|
||||
addMessage(redirectAttributes, "error", "audit_failed");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
return multiFeatureCfgList(model, cfg, request, response);
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/app/feature/multiFeatureCfgList?functionId="+functionId;
|
||||
|
||||
return "redirect:" + adminPath + "/app/feature/multiFeatureCfgList?functionId=" + functionId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 特征配置删除
|
||||
*
|
||||
* @param isValid
|
||||
* @param ids
|
||||
* @param functionId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"updateAppFeatureCfgValid"})
|
||||
public String updateAppFeatureCfgValid(Integer isValid,String ids,Integer functionId) {
|
||||
appMultiFeatureCfgService.updateAppFeatureCfgValid(isValid,ids,functionId);
|
||||
return "redirect:" + adminPath +"/app/feature/multiFeatureCfgList?functionId="+functionId;
|
||||
@RequestMapping(value = { "updateAppFeatureCfgValid" })
|
||||
public String updateAppFeatureCfgValid(Integer isValid, String ids, Integer functionId) {
|
||||
appMultiFeatureCfgService.updateAppFeatureCfgValid(isValid, ids, functionId);
|
||||
return "redirect:" + adminPath + "/app/feature/multiFeatureCfgList?functionId=" + functionId;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询特征子配置
|
||||
*
|
||||
* @param model
|
||||
* @param cfgId
|
||||
* @param index
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"ajaxAppFeatureList"})
|
||||
public String ajaxAppFeatureList(Model model,Long cfgId,Integer compileId,Integer functionId,Integer index) {
|
||||
List<AppIpCfg> ipRangeList = appMultiFeatureCfgService.getAppIpRangeCfg(compileId,functionId);
|
||||
@RequestMapping(value = { "ajaxAppFeatureList" })
|
||||
public String ajaxAppFeatureList(Model model, Long cfgId, Integer compileId, Integer functionId, Integer index) {
|
||||
List<AppIpCfg> ipRangeList = appMultiFeatureCfgService.getAppIpRangeCfg(compileId, functionId);
|
||||
AppFeatureIndex cfg = appMultiFeatureCfgService.getAppFeatureIndex(cfgId);
|
||||
List<Map<String,Object>> tabList = new ArrayList();
|
||||
List<Map<String, Object>> tabList = new ArrayList();
|
||||
String[] cfgRegionValue = cfg.getCfgRegionValue().split(",");
|
||||
String[] cfgRegionType = cfg.getCfgRegionType().split(",");
|
||||
String[] cfgRegionCode = cfg.getCfgRegionCode1().split(",");
|
||||
if(cfgRegionValue.length == cfgRegionType.length && cfgRegionValue.length==cfgRegionCode.length){
|
||||
for(int i=0;i<cfgRegionValue.length;i++){
|
||||
Map<String,Object> map = new HashMap();
|
||||
if (cfgRegionValue.length == cfgRegionType.length && cfgRegionValue.length == cfgRegionCode.length) {
|
||||
for (int i = 0; i < cfgRegionValue.length; i++) {
|
||||
Map<String, Object> map = new HashMap();
|
||||
map.put("regionType", cfgRegionType[i]);
|
||||
map.put("regionValue", cfgRegionValue[i]);
|
||||
if("1".equals(cfgRegionType[i])){
|
||||
if ("1".equals(cfgRegionType[i])) {
|
||||
map.put("ipRangeList", ipRangeList);
|
||||
}
|
||||
if("2".equals(cfgRegionType[i])){
|
||||
List<AppStringFeatureCfg> strList = appMultiFeatureCfgService.getAppStringFeatureCfg(compileId,functionId,Integer.valueOf(cfgRegionCode[i]));
|
||||
if ("2".equals(cfgRegionType[i])) {
|
||||
List<AppStringFeatureCfg> strList = appMultiFeatureCfgService.getAppStringFeatureCfg(compileId,
|
||||
functionId, Integer.valueOf(cfgRegionCode[i]));
|
||||
map.put("strList", strList);
|
||||
}
|
||||
if("3".equals(cfgRegionType[i])){
|
||||
List<AppComplexFeatureCfg> complexList = appMultiFeatureCfgService.getAppComplexFeatureCfg(compileId,functionId,Integer.valueOf(cfgRegionCode[i]));
|
||||
if ("3".equals(cfgRegionType[i])) {
|
||||
List<AppComplexFeatureCfg> complexList = appMultiFeatureCfgService
|
||||
.getAppComplexFeatureCfg(compileId, functionId, Integer.valueOf(cfgRegionCode[i]));
|
||||
map.put("complexList", complexList);
|
||||
}
|
||||
if("4".equals(cfgRegionType[i])){
|
||||
List<AppTcpCfg> numCfgList = appMultiFeatureCfgService.getAppTcpCfg(compileId,functionId,Integer.valueOf(cfgRegionCode[i]));
|
||||
if ("4".equals(cfgRegionType[i])) {
|
||||
List<AppTcpCfg> numCfgList = appMultiFeatureCfgService.getAppTcpCfg(compileId, functionId,
|
||||
Integer.valueOf(cfgRegionCode[i]));
|
||||
map.put("numCfgList", numCfgList);
|
||||
}
|
||||
tabList.add(map);
|
||||
}
|
||||
}else{
|
||||
Map<String,Object> map = new HashMap();
|
||||
} else {
|
||||
Map<String, Object> map = new HashMap();
|
||||
map.put("regionType", "0");
|
||||
map.put("regionValue", "query config detail error");
|
||||
tabList.add(map);
|
||||
}
|
||||
|
||||
/*if(ipRangeList!=null){
|
||||
String cfgType = null;
|
||||
for(AppIpCfg ip:ipRangeList){
|
||||
if(!ip.getCfgType().equals(cfgType)){
|
||||
tabList.add(new String[]{"1",ip.getCfgType()});
|
||||
cfgType = ip.getCfgType();
|
||||
}
|
||||
}
|
||||
}
|
||||
if(strList!=null){
|
||||
String cfgType = null;
|
||||
for(AppStringFeatureCfg cfg:strList){
|
||||
if(!cfg.getCfgType().equals(cfgType)){
|
||||
tabList.add(new String[]{"2",cfg.getCfgType()});
|
||||
cfgType = cfg.getCfgType();
|
||||
}
|
||||
}
|
||||
}
|
||||
if(complexList!=null){
|
||||
String cfgType = null;
|
||||
for(AppComplexFeatureCfg cfg:complexList){
|
||||
if(!cfg.getCfgType().equals(cfgType)){
|
||||
tabList.add(new String[]{"3",cfg.getCfgType()});
|
||||
cfgType = cfg.getCfgType();0.
|
||||
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
/*
|
||||
* if(ipRangeList!=null){ String cfgType = null; for(AppIpCfg
|
||||
* ip:ipRangeList){ if(!ip.getCfgType().equals(cfgType)){
|
||||
* tabList.add(new String[]{"1",ip.getCfgType()}); cfgType =
|
||||
* ip.getCfgType(); } } } if(strList!=null){ String cfgType = null;
|
||||
* for(AppStringFeatureCfg cfg:strList){
|
||||
* if(!cfg.getCfgType().equals(cfgType)){ tabList.add(new
|
||||
* String[]{"2",cfg.getCfgType()}); cfgType = cfg.getCfgType(); } } }
|
||||
* if(complexList!=null){ String cfgType = null;
|
||||
* for(AppComplexFeatureCfg cfg:complexList){
|
||||
* if(!cfg.getCfgType().equals(cfgType)){ tabList.add(new
|
||||
* String[]{"3",cfg.getCfgType()}); cfgType = cfg.getCfgType();0.
|
||||
*
|
||||
* } } }
|
||||
*/
|
||||
model.addAttribute("index", index);
|
||||
model.addAttribute("tabList", tabList);
|
||||
return "/cfg/app/appSubFeatureList";
|
||||
}
|
||||
|
||||
//appfeature配置导出
|
||||
|
||||
// appfeature配置导出
|
||||
@RequestMapping(value = "exportFeature")
|
||||
public void exportFeature(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
@ModelAttribute("cfg")AppFeatureIndex entity,String ids,RedirectAttributes redirectAttributes){
|
||||
public void exportFeature(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") AppFeatureIndex 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>();
|
||||
Map<String, String> noExportMap=new HashMap<String, String>();
|
||||
List<AppFeatureIndex> ipLists=new ArrayList<AppFeatureIndex>();
|
||||
//导出选中记录
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
ipLists=appMultiFeatureCfgService.findAppByFeatureIndexList(ids);
|
||||
}else{
|
||||
Page<AppFeatureIndex> pageInfo=new Page<AppFeatureIndex>(request, response,"r");
|
||||
// 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>();
|
||||
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||
List<AppFeatureIndex> ipLists = new ArrayList<AppFeatureIndex>();
|
||||
// 导出选中记录
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
ipLists = appMultiFeatureCfgService.findAppByFeatureIndexList(ids);
|
||||
} else {
|
||||
Page<AppFeatureIndex> pageInfo = new Page<AppFeatureIndex>(request, response, "r");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page<AppFeatureIndex> page = appMultiFeatureCfgService.findAppFeatureIndexList(pageInfo, entity);
|
||||
ipLists=page.getList();
|
||||
ipLists = page.getList();
|
||||
}
|
||||
|
||||
for(AppFeatureIndex feature:ipLists){
|
||||
SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(feature.getSpecServiceId());
|
||||
feature.setAppName(app.getSpecServiceName());
|
||||
|
||||
for (AppFeatureIndex feature : ipLists) {
|
||||
SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(feature.getSpecServiceId());
|
||||
feature.setAppName(app.getSpecServiceName());
|
||||
}
|
||||
String cfgIndexInfoNoExport = ",letter,whether_area_block,classification,attribute,label,do_log,block_type,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String appComplexNoExport = ",do_log,block_type,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+ ",letter,whether_area_block,classification,attribute,label"
|
||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String ipPortInfoNoExport = ",do_log,block_type,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+ ",letter,whether_area_block,classification,attribute,label"
|
||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
||||
|
||||
// 时间过滤
|
||||
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||
}
|
||||
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
classMap.put(entity.getMenuNameCode(), AppFeatureIndex.class);
|
||||
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
||||
List<IpPortCfg> ipList = new ArrayList<IpPortCfg>();
|
||||
List<AppComplexFeatureCfg> keywordList = new ArrayList<AppComplexFeatureCfg>();
|
||||
List<AppStringFeatureCfg> strList = new ArrayList<AppStringFeatureCfg>();
|
||||
for (AppFeatureIndex cfg : ipLists) {
|
||||
Map<String, List> maps = appMultiFeatureCfgService.exportFeature(cfg);
|
||||
if (entity.getFunctionId() != 567) {
|
||||
keywordList.addAll(maps.get("APP_KEYWORDS"));
|
||||
} else {
|
||||
strList.addAll(maps.get("APP_DK_GL"));
|
||||
}
|
||||
String cfgIndexInfoNoExport=",letter,whether_area_block,classification,attribute,label,do_log,block_type,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String appComplexNoExport=",do_log,block_type,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+",letter,whether_area_block,classification,attribute,label"
|
||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String ipPortInfoNoExport=",do_log,block_type,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+",letter,whether_area_block,classification,attribute,label"
|
||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
classMap.put(entity.getMenuNameCode(), AppFeatureIndex.class);
|
||||
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
|
||||
List<IpPortCfg> ipList=new ArrayList<IpPortCfg>();
|
||||
List<AppComplexFeatureCfg> keywordList=new ArrayList<AppComplexFeatureCfg>();
|
||||
List<AppStringFeatureCfg> strList=new ArrayList<AppStringFeatureCfg>();
|
||||
for (AppFeatureIndex cfg : ipLists) {
|
||||
Map<String, List> maps=appMultiFeatureCfgService.exportFeature(cfg);
|
||||
if(entity.getFunctionId()!=567){
|
||||
keywordList.addAll(maps.get("APP_KEYWORDS"));
|
||||
}else{
|
||||
strList.addAll(maps.get("APP_DK_GL"));
|
||||
}
|
||||
ipList.addAll(maps.get("APP_IP_RANGE"));
|
||||
}
|
||||
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||
if(entity.getFunctionId()!=564 && entity.getFunctionId()!=567 ){
|
||||
keywordList=replaceKeyList(keywordList);
|
||||
titleList.add("APP_IP_RANGE");
|
||||
classMap.put("APP_IP_RANGE", IpPortCfg.class);
|
||||
noExportMap.put("APP_IP_RANGE",ipPortInfoNoExport);
|
||||
dataMap.put("APP_IP_RANGE", ipList);
|
||||
}
|
||||
if(entity.getFunctionId()==563){
|
||||
titleList.add("APP_PAYLOAD");
|
||||
classMap.put("APP_PAYLOAD", AppComplexFeatureCfg.class);
|
||||
noExportMap.put("APP_PAYLOAD",appComplexNoExport);
|
||||
dataMap.put("APP_PAYLOAD", keywordList);
|
||||
}else if(entity.getFunctionId()==565){
|
||||
titleList.add("APP_HTTP");
|
||||
classMap.put("APP_HTTP", AppComplexFeatureCfg.class);
|
||||
noExportMap.put("APP_HTTP",appComplexNoExport);
|
||||
dataMap.put("APP_HTTP", keywordList);
|
||||
}else if(entity.getFunctionId()==566){
|
||||
titleList.add("APP_SSL");
|
||||
classMap.put("APP_SSL", AppComplexFeatureCfg.class);
|
||||
noExportMap.put("APP_SSL",appComplexNoExport);
|
||||
dataMap.put("APP_SSL", keywordList);
|
||||
}else if(entity.getFunctionId()==564){
|
||||
keywordList=replaceKeyList(keywordList);
|
||||
titleList.add("APP_DNS");
|
||||
classMap.put("APP_DNS", AppComplexFeatureCfg.class);
|
||||
noExportMap.put("APP_DNS",appComplexNoExport);
|
||||
dataMap.put("APP_DNS", keywordList);
|
||||
}else if(entity.getFunctionId()==567){
|
||||
strList=replaceFeatureList(strList);
|
||||
appComplexNoExport=appComplexNoExport+"district,";
|
||||
titleList.add("APP_DK");
|
||||
classMap.put("APP_DK", AppStringFeatureCfg.class);
|
||||
noExportMap.put("APP_DK",appComplexNoExport);
|
||||
dataMap.put("APP_DK", strList);
|
||||
}
|
||||
|
||||
/*}*/
|
||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
||||
ipList.addAll(maps.get("APP_IP_RANGE"));
|
||||
}
|
||||
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||
if (entity.getFunctionId() != 564 && entity.getFunctionId() != 567) {
|
||||
keywordList = replaceKeyList(keywordList);
|
||||
titleList.add("APP_IP_RANGE");
|
||||
classMap.put("APP_IP_RANGE", IpPortCfg.class);
|
||||
noExportMap.put("APP_IP_RANGE", ipPortInfoNoExport);
|
||||
dataMap.put("APP_IP_RANGE", ipList);
|
||||
}
|
||||
if (entity.getFunctionId() == 563) {
|
||||
titleList.add("APP_PAYLOAD");
|
||||
classMap.put("APP_PAYLOAD", AppComplexFeatureCfg.class);
|
||||
noExportMap.put("APP_PAYLOAD", appComplexNoExport);
|
||||
dataMap.put("APP_PAYLOAD", keywordList);
|
||||
} else if (entity.getFunctionId() == 565) {
|
||||
titleList.add("APP_HTTP");
|
||||
classMap.put("APP_HTTP", AppComplexFeatureCfg.class);
|
||||
noExportMap.put("APP_HTTP", appComplexNoExport);
|
||||
dataMap.put("APP_HTTP", keywordList);
|
||||
} else if (entity.getFunctionId() == 566) {
|
||||
titleList.add("APP_SSL");
|
||||
classMap.put("APP_SSL", AppComplexFeatureCfg.class);
|
||||
noExportMap.put("APP_SSL", appComplexNoExport);
|
||||
dataMap.put("APP_SSL", keywordList);
|
||||
} else if (entity.getFunctionId() == 564) {
|
||||
keywordList = replaceKeyList(keywordList);
|
||||
titleList.add("APP_DNS");
|
||||
classMap.put("APP_DNS", AppComplexFeatureCfg.class);
|
||||
noExportMap.put("APP_DNS", appComplexNoExport);
|
||||
dataMap.put("APP_DNS", keywordList);
|
||||
} else if (entity.getFunctionId() == 567) {
|
||||
strList = replaceFeatureList(strList);
|
||||
appComplexNoExport = appComplexNoExport + "district,";
|
||||
titleList.add("APP_DK");
|
||||
classMap.put("APP_DK", AppStringFeatureCfg.class);
|
||||
noExportMap.put("APP_DK", appComplexNoExport);
|
||||
dataMap.put("APP_DK", strList);
|
||||
}
|
||||
|
||||
/* } */
|
||||
|
||||
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("Appfeature export failed",e);
|
||||
addMessage(redirectAttributes,"error","export_failed");
|
||||
logger.error("Appfeature export failed", e);
|
||||
addMessage(redirectAttributes, "error", "export_failed");
|
||||
}
|
||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
// return "redirect:" + adminPath
|
||||
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
}
|
||||
|
||||
public static List<AppComplexFeatureCfg> replaceKeyList(List<AppComplexFeatureCfg> list){
|
||||
|
||||
public static List<AppComplexFeatureCfg> replaceKeyList(List<AppComplexFeatureCfg> list) {
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
AppComplexFeatureCfg base=(AppComplexFeatureCfg)list.get(i);
|
||||
AppComplexFeatureCfg base = (AppComplexFeatureCfg) list.get(i);
|
||||
base.setIsHex(base.getIsHexbin());
|
||||
base.setIsCaseInsenstive(base.getIsHexbin());
|
||||
base.setCfgKeywords(Functions.replace(base.getCfgKeywords(), "***and***"," "));
|
||||
}
|
||||
base.setCfgKeywords(Functions.replace(base.getCfgKeywords(), "***and***", " "));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public static List<AppStringFeatureCfg> replaceFeatureList(List<AppStringFeatureCfg> list){
|
||||
|
||||
public static List<AppStringFeatureCfg> replaceFeatureList(List<AppStringFeatureCfg> list) {
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
AppStringFeatureCfg base=(AppStringFeatureCfg)list.get(i);
|
||||
AppStringFeatureCfg base = (AppStringFeatureCfg) list.get(i);
|
||||
base.setIsHex(base.getIsHexbin());
|
||||
base.setIsCaseInsenstive(base.getIsHexbin());
|
||||
base.setCfgKeywords(Functions.replace(base.getCfgKeywords(), "***and***"," "));
|
||||
}
|
||||
base.setCfgKeywords(Functions.replace(base.getCfgKeywords(), "***and***", " "));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user