可信证书增加导出

This commit is contained in:
leijun
2018-11-26 17:36:37 +08:00
parent d75ef7f4b0
commit 47dadcd9aa
5 changed files with 66 additions and 3 deletions

View File

@@ -1,5 +1,6 @@
package com.nis.domain.configuration;
import com.nis.util.excel.ExcelField;
/**
* 可信证书
@@ -13,8 +14,19 @@ public class PxyObjTrustedCaCert extends BaseCfg<PxyObjTrustedCaCert> {
*/
private static final long serialVersionUID = -2720862431960415564L;
private String indexTable="pxy_obj_trusted_ca_cert";
@ExcelField(title="issuer",sort=3)
private String issuer; //颁发者
@ExcelField(title="certificate_file",sort=2)
private String certFile;
@ExcelField(title="crl_file",sort=4)
private String crlFile;
public String getCrlFile() {
return crlFile;
}
public void setCrlFile(String crlFile) {
this.crlFile = crlFile;
}
public String getIssuer() {
return issuer;
}

View File

@@ -48,6 +48,7 @@ import com.nis.domain.maat.ToMaatResult.ResponseData;
import com.nis.exceptions.CallExternalProceduresException;
import com.nis.exceptions.MaatConvertException;
import com.nis.exceptions.MultiPartNewException;
import com.nis.util.ConfigDictUtils;
import com.nis.util.ConfigServiceUtil;
import com.nis.util.Constants;
import com.nis.util.FileUtils;
@@ -414,6 +415,52 @@ public class PxyObjKeyringController extends BaseController {
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
}
//pxyObjTrustedCert配置导出
@RequestMapping(value = "exportCert")
public void exportCert(Model model,HttpServletRequest request,HttpServletResponse response,
@ModelAttribute("cfg")PxyObjTrustedCaCert 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>();
/*//导出选中记录
* if(!StringUtil.isEmpty(ids)){
for(String id:ids.split(",")){
Long.parseLong(id);
}
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
}else{*/
//条件导出数据大于最大导出数,只导出最大导出条数
entity.setTableName(IpPortCfg.getTablename());
Page<PxyObjTrustedCaCert> pageInfo=new Page<PxyObjTrustedCaCert>(request, response,"r");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<PxyObjTrustedCaCert> page = pxyObjKeyringService.findTrustedCertPage(pageInfo, entity);
for (PxyObjTrustedCaCert cert:page.getList()) {
if(!StringUtil.isEmpty(cert.getCompileId())){
cert.setCrlFile(ConfigDictUtils.getTrustedCrlByCerId(cert.getCompileId()));
}
}
model.addAttribute("page", page);
titleList.add(entity.getMenuNameCode());
classMap.put(entity.getMenuNameCode(), PxyObjTrustedCaCert.class);
String cfgIndexInfoNoExport=",whether_area_block,block_type,valid_identifier,do_log,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,&config_describe:cert_name-";
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
dataMap.put(entity.getMenuNameCode(), page.getList());
/*}*/
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
} catch (Exception e) {
logger.error("pxyObjKeyring export failed",e);
addMessage(redirectAttributes, "error","export_failed");
}
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
}
@RequestMapping(value = {"/trustedCertList"})
public String trustedCertList(Model model,HttpServletRequest request,HttpServletResponse response
,@ModelAttribute("cfg")PxyObjTrustedCaCert entity

View File

@@ -1313,3 +1313,5 @@ action_cache=Cache
action_cache_whitelist=Cache Bypass
crl_issuer_null=Issuer of CRL file is empty
block_by_app_server_ip=Block by application server ip
certificate_file=Certificate File
crl_file=Crl File

View File

@@ -1309,3 +1309,5 @@ action_cache=\u7F13\u5B58
action_cache_whitelist=\u7F13\u5B58\u767D\u540D\u5355
crl_issuer_null=CRL\u6587\u4EF6\u7684\u9881\u53D1\u8005\u4E3A\u7A7A
block_by_app_server_ip=Block by application server ip
certificate_file=\u8BC1\u4E66\u6587\u4EF6
crl_file=Crl\u6587\u4EF6

View File

@@ -202,7 +202,7 @@
<shiro:hasPermission name="proxy:trustedCert:config">
<sys:delRow url="${ctx}/proxy/intercept/strateagy/trustedCertForm" id="contentTable" label="update"></sys:delRow>
<sys:delRow url="${ctx}/proxy/intercept/strateagy/trustedCertDelete?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
<%-- <sys:delRow url="${ctx}/proxy/intercept/strateagy/exportPxy?functionId=${cfg.functionId }" searchUrl="${ctx}/proxy/intercept/strateagy/trustedCertList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow> --%>
<sys:delRow url="${ctx}/proxy/intercept/strateagy/exportCert?functionId=${cfg.functionId }" searchUrl="${ctx}/proxy/intercept/strateagy/trustedCertList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow>
</shiro:hasPermission>
<shiro:hasPermission name="proxy:trustedCert:confirm">
<div class="btn-group">