可信证书增加导出

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