批量下发功能增加,delRow.tag中暂时不打开此功能。
app topic domain和app domain业务修改domain存储cfgkeyword属性。 摘要修改level属性存储为下发的最终数值。 同步的单域配置的增加时间和状态属性从entity中获取
This commit is contained in:
@@ -12,6 +12,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
@@ -202,7 +203,14 @@ public class AvContentController extends BaseController {
|
||||
//修改VOIP IP配置审核状态
|
||||
@RequestMapping(value = {"/auditAvVoip"})
|
||||
@RequiresPermissions(value={"avVoip:confirm"})
|
||||
public String auditVoip(Integer isAudit,Integer isValid,String ids ,String compileIds,Integer functionId ,RedirectAttributes redirectAttributes) {
|
||||
public String auditVoip(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,
|
||||
Integer isValid,
|
||||
Integer isAudit,
|
||||
String ids,
|
||||
Integer functionId,
|
||||
RedirectAttributes redirectAttributes,
|
||||
HttpServletResponse response,
|
||||
HttpServletRequest request) {
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
String[] idArray = ids.split(",");
|
||||
Date auditTime=new Date();
|
||||
@@ -223,6 +231,23 @@ public class AvContentController extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
}else {
|
||||
Page<CfgIndexInfo> searchPage=new Page<CfgIndexInfo>(request,response,"r");
|
||||
Page<CfgIndexInfo> auditPage=new Page<CfgIndexInfo>(request,response,"r");
|
||||
BeanUtils.copyProperties(searchPage, auditPage);
|
||||
|
||||
try {
|
||||
auditAll(auditPage,isValid , cfg);
|
||||
} catch (Exception e) {
|
||||
logger.error("配置下发失败:",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
}
|
||||
|
||||
}
|
||||
return voipCfgList(model, request, response, cfg, redirectAttributes);
|
||||
}
|
||||
return "redirect:" + adminPath +"/ntc/av/voipList?functionId="+functionId;
|
||||
}
|
||||
@@ -639,9 +664,14 @@ public class AvContentController extends BaseController {
|
||||
//修改CONTUrl配置审核
|
||||
@RequestMapping(value = {"/auditAvContUrl"})
|
||||
@RequiresPermissions(value={"avContUrl:confirm"})
|
||||
public String auditContUrl(Integer isAudit,Integer isValid,String ids
|
||||
,String compileIds,Integer functionId
|
||||
, RedirectAttributes redirectAttributes) {
|
||||
public String auditContUrl(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,
|
||||
Integer isValid,
|
||||
Integer isAudit,
|
||||
String ids,
|
||||
Integer functionId,
|
||||
RedirectAttributes redirectAttributes,
|
||||
HttpServletResponse response,
|
||||
HttpServletRequest request) {
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
String[] idArray = ids.split(",");
|
||||
Date auditTime=new Date();
|
||||
@@ -659,6 +689,23 @@ public class AvContentController extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
}else {
|
||||
Page<CfgIndexInfo> searchPage=new Page<CfgIndexInfo>(request,response,"r");
|
||||
Page<CfgIndexInfo> auditPage=new Page<CfgIndexInfo>(request,response,"r");
|
||||
BeanUtils.copyProperties(searchPage, auditPage);
|
||||
|
||||
try {
|
||||
auditAll(auditPage,isValid , cfg);
|
||||
} catch (Exception e) {
|
||||
logger.error("配置下发失败:",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
}
|
||||
|
||||
}
|
||||
return contUrlList(model, request, response, cfg, redirectAttributes);
|
||||
}
|
||||
return "redirect:" + adminPath +"/ntc/av/contUrlList?functionId="+functionId;
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ import net.sf.json.JSONObject;
|
||||
|
||||
import org.apache.commons.io.filefilter.IOFileFilter;
|
||||
import org.apache.tools.zip.ZipOutputStream;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.mock.web.MockMultipartFile;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
@@ -35,6 +36,7 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
import com.nis.domain.FunctionRegionDict;
|
||||
import com.nis.domain.FunctionServiceDict;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.configuration.AppPolicyCfg;
|
||||
import com.nis.domain.configuration.AvFileSampleCfg;
|
||||
import com.nis.domain.configuration.AvSignSampleCfg;
|
||||
import com.nis.domain.configuration.AvSignSampleCfgModel;
|
||||
@@ -330,80 +332,107 @@ public class AvController extends BaseController {
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"/sample/auditAvFileSample"})
|
||||
public String auditAvFileSample(Integer isAudit,Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes){
|
||||
// avCfgService.auditAvFileSample(isAudit,isValid,ids);
|
||||
AvFileSampleCfg entity = new AvFileSampleCfg();
|
||||
String[] idArray = ids.split(",");
|
||||
for(String id :idArray){
|
||||
entity = avCfgService.getAvFileSampleById(Long.parseLong(id),null);
|
||||
entity.setIsAudit(isAudit);
|
||||
entity.setIsValid(isValid);
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
entity.setAuditTime(new Date());
|
||||
// String oldSrcUrl = entity.getSrcPath();
|
||||
// String oldSampleUrl = entity.getSamplePath();
|
||||
try {
|
||||
/*if(isAudit==1){
|
||||
Date creatTime = entity.getCreateTime();
|
||||
//音视频文件上传接口调用
|
||||
File srcFile = new File(oldSrcUrl);
|
||||
Map<String,Object> srcMap = new HashMap();
|
||||
srcMap.put("filetype", FileUtils.getSuffix(srcFile.getName(), false));
|
||||
srcMap.put("datatype", "dbSystem");//源文件存入数据中心
|
||||
|
||||
srcMap.put("createTime",creatTime);
|
||||
srcMap.put("key",FileUtils.getPrefix(srcFile.getName(), false));
|
||||
srcMap.put("fileName", srcFile.getName());
|
||||
srcMap.put("checksum", entity.getSrcMd5());
|
||||
ToMaatResult result1 = ConfigServiceUtil.postFileCfg(null, srcFile, JsonMapper.toJsonString(srcMap));
|
||||
logger.info("音视频源文件上传响应信息:"+result1);
|
||||
//获取文件上传响应信息(新的文件访问路径)
|
||||
String srcAccessUrl = null;
|
||||
if(!StringUtil.isEmpty(result1)){
|
||||
ResponseData data = result1.getData();
|
||||
srcAccessUrl=data.getAccessUrl();
|
||||
entity.setSrcUrl(srcAccessUrl);
|
||||
// entity.setSrcPath("");
|
||||
}
|
||||
File sampleFile = new File(oldSampleUrl);
|
||||
Map<String,Object> sampleMap = new HashMap();
|
||||
sampleMap.put("filetype", FileUtils.getSuffix(sampleFile.getName(), false));
|
||||
sampleMap.put("datatype", "fileSystem");//样例文件存入fastdfs
|
||||
sampleMap.put("createTime", creatTime);
|
||||
sampleMap.put("key",FileUtils.getPrefix(sampleFile.getName(), false));
|
||||
sampleMap.put("fileName", sampleFile.getName());
|
||||
sampleMap.put("checksum", entity.getSampleMd5());
|
||||
ToMaatResult result2 = ConfigServiceUtil.postFileCfg(null, sampleFile, JsonMapper.toJsonString(sampleMap));
|
||||
logger.info("音视频样例文件上传响应信息:"+result2);
|
||||
|
||||
//获取文件上传响应信息(新的文件访问路径)
|
||||
String sampleAccessUrl = null;
|
||||
if(!StringUtil.isEmpty(result2)){
|
||||
ResponseData data = result2.getData();
|
||||
sampleAccessUrl = data.getAccessUrl();
|
||||
entity.setSampleUrl(sampleAccessUrl);
|
||||
// entity.setSamplePath("");
|
||||
public String auditAvFileSample(Model model,@ModelAttribute("cfg")AvFileSampleCfg cfg,
|
||||
Integer isValid,
|
||||
Integer isAudit,
|
||||
String ids,
|
||||
Integer functionId,
|
||||
RedirectAttributes redirectAttributes,
|
||||
HttpServletResponse response,
|
||||
HttpServletRequest request){
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
//avCfgService.auditAvFileSample(isAudit,isValid,ids);
|
||||
AvFileSampleCfg entity = new AvFileSampleCfg();
|
||||
String[] idArray = ids.split(",");
|
||||
for(String id :idArray){
|
||||
entity = avCfgService.getAvFileSampleById(Long.parseLong(id),null);
|
||||
entity.setIsAudit(isAudit);
|
||||
entity.setIsValid(isValid);
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
entity.setAuditTime(new Date());
|
||||
// String oldSrcUrl = entity.getSrcPath();
|
||||
// String oldSampleUrl = entity.getSamplePath();
|
||||
try {
|
||||
/*if(isAudit==1){
|
||||
Date creatTime = entity.getCreateTime();
|
||||
//音视频文件上传接口调用
|
||||
File srcFile = new File(oldSrcUrl);
|
||||
Map<String,Object> srcMap = new HashMap();
|
||||
srcMap.put("filetype", FileUtils.getSuffix(srcFile.getName(), false));
|
||||
srcMap.put("datatype", "dbSystem");//源文件存入数据中心
|
||||
|
||||
srcMap.put("createTime",creatTime);
|
||||
srcMap.put("key",FileUtils.getPrefix(srcFile.getName(), false));
|
||||
srcMap.put("fileName", srcFile.getName());
|
||||
srcMap.put("checksum", entity.getSrcMd5());
|
||||
ToMaatResult result1 = ConfigServiceUtil.postFileCfg(null, srcFile, JsonMapper.toJsonString(srcMap));
|
||||
logger.info("音视频源文件上传响应信息:"+result1);
|
||||
//获取文件上传响应信息(新的文件访问路径)
|
||||
String srcAccessUrl = null;
|
||||
if(!StringUtil.isEmpty(result1)){
|
||||
ResponseData data = result1.getData();
|
||||
srcAccessUrl=data.getAccessUrl();
|
||||
entity.setSrcUrl(srcAccessUrl);
|
||||
// entity.setSrcPath("");
|
||||
}
|
||||
File sampleFile = new File(oldSampleUrl);
|
||||
Map<String,Object> sampleMap = new HashMap();
|
||||
sampleMap.put("filetype", FileUtils.getSuffix(sampleFile.getName(), false));
|
||||
sampleMap.put("datatype", "fileSystem");//样例文件存入fastdfs
|
||||
sampleMap.put("createTime", creatTime);
|
||||
sampleMap.put("key",FileUtils.getPrefix(sampleFile.getName(), false));
|
||||
sampleMap.put("fileName", sampleFile.getName());
|
||||
sampleMap.put("checksum", entity.getSampleMd5());
|
||||
ToMaatResult result2 = ConfigServiceUtil.postFileCfg(null, sampleFile, JsonMapper.toJsonString(sampleMap));
|
||||
logger.info("音视频样例文件上传响应信息:"+result2);
|
||||
|
||||
//获取文件上传响应信息(新的文件访问路径)
|
||||
String sampleAccessUrl = null;
|
||||
if(!StringUtil.isEmpty(result2)){
|
||||
ResponseData data = result2.getData();
|
||||
sampleAccessUrl = data.getAccessUrl();
|
||||
entity.setSampleUrl(sampleAccessUrl);
|
||||
// entity.setSamplePath("");
|
||||
|
||||
}
|
||||
}*/
|
||||
avCfgService.auditAvFileSample(entity,isAudit);
|
||||
//删除本地源文件和样例文件
|
||||
/*if(!oldSrcUrl.equals(entity.getSrcUrl())){
|
||||
FileUtils.deleteFile(oldSrcUrl);
|
||||
}
|
||||
if(!oldSampleUrl.equals(entity.getSampleUrl())){
|
||||
FileUtils.deleteFile(oldSampleUrl);
|
||||
}*/
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
if(e instanceof MaatConvertException) {
|
||||
logger.info("音视频文件样例配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}else {
|
||||
logger.error("auditAvFileSample failed",e);
|
||||
addMessage(redirectAttributes,"error","audit_failed");
|
||||
}
|
||||
}*/
|
||||
avCfgService.auditAvFileSample(entity,isAudit);
|
||||
//删除本地源文件和样例文件
|
||||
/*if(!oldSrcUrl.equals(entity.getSrcUrl())){
|
||||
FileUtils.deleteFile(oldSrcUrl);
|
||||
}
|
||||
if(!oldSampleUrl.equals(entity.getSampleUrl())){
|
||||
FileUtils.deleteFile(oldSampleUrl);
|
||||
}*/
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
if(e instanceof MaatConvertException) {
|
||||
logger.info("音视频文件样例配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}else {
|
||||
logger.error("auditAvFileSample failed",e);
|
||||
addMessage(redirectAttributes,"error","audit_failed");
|
||||
}
|
||||
}
|
||||
}else {
|
||||
Page<AvFileSampleCfg> searchPage=new Page<AvFileSampleCfg>(request,response,"a");
|
||||
Page<AvFileSampleCfg> auditPage=new Page<AvFileSampleCfg>(request,response,"a");
|
||||
BeanUtils.copyProperties(searchPage, auditPage);
|
||||
|
||||
try {
|
||||
auditAll(auditPage,isValid , cfg);
|
||||
} catch (Exception e) {
|
||||
logger.error("配置下发失败:",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return fileSampleList(model, request, response, cfg);
|
||||
}
|
||||
return "redirect:" + adminPath +"/ntc/av/sample/fileSampleList?functionId="+functionId;
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
@@ -26,6 +27,7 @@ import com.nis.domain.configuration.NtcBgpAsCfg;
|
||||
import com.nis.domain.configuration.NtcSubscribeIdCfg;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.util.StringUtils;
|
||||
import com.nis.web.controller.BaseController;
|
||||
import com.nis.web.security.UserUtils;
|
||||
@@ -41,9 +43,8 @@ public class BgpCfgController extends BaseController{
|
||||
|
||||
@RequestMapping(value = {"bgpList"})
|
||||
// @RequiresPermissions(value={"other:bgp:config"})
|
||||
public String httpList(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg
|
||||
,HttpServletRequest request,HttpServletResponse response
|
||||
,RedirectAttributes redirectAttributes) {
|
||||
public String bgpList(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg
|
||||
,HttpServletRequest request,HttpServletResponse response) {
|
||||
Page<CfgIndexInfo> searchPage=new Page<CfgIndexInfo>(request,response,"a");
|
||||
Page<CfgIndexInfo> page = bgpCfgService.getBgpList(searchPage, cfg);
|
||||
model.addAttribute("page", page);
|
||||
@@ -129,28 +130,54 @@ public class BgpCfgController extends BaseController{
|
||||
|
||||
@RequestMapping(value = {"auditBgpCfg"})
|
||||
@RequiresPermissions(value={"other:bgp:confirm"})
|
||||
public String auditBgpCfg(Integer isAudit,Integer isValid,String ids
|
||||
,Integer functionId, RedirectAttributes redirectAttributes) {
|
||||
CfgIndexInfo entity = new CfgIndexInfo();
|
||||
String[] idArray = ids.split(",");
|
||||
for(String id :idArray){
|
||||
entity = bgpCfgService.getBgpCfg(Long.parseLong(id),null);
|
||||
entity.setIsAudit(isAudit);
|
||||
entity.setIsValid(isValid);
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
entity.setAuditTime(new Date());
|
||||
entity.setFunctionId(functionId);
|
||||
try {
|
||||
bgpCfgService.auditBgpCfg(entity,isAudit);
|
||||
} catch (MaatConvertException e) {
|
||||
e.printStackTrace();
|
||||
logger.error("bgp配置下发失败",e);
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("bgp配置下发失败",e);
|
||||
addMessage(redirectAttributes,"error","audit_failed");
|
||||
public String auditBgpCfg(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,
|
||||
Integer isValid,
|
||||
Integer isAudit,
|
||||
String ids,
|
||||
Integer functionId,
|
||||
RedirectAttributes redirectAttributes,
|
||||
HttpServletResponse response,
|
||||
HttpServletRequest request) {
|
||||
if(!StringUtil.isEmpty(ids)) {
|
||||
CfgIndexInfo entity = new CfgIndexInfo();
|
||||
String[] idArray = ids.split(",");
|
||||
for(String id :idArray){
|
||||
entity = bgpCfgService.getBgpCfg(Long.parseLong(id),null);
|
||||
entity.setIsAudit(isAudit);
|
||||
entity.setIsValid(isValid);
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
entity.setAuditTime(new Date());
|
||||
entity.setFunctionId(functionId);
|
||||
try {
|
||||
bgpCfgService.auditBgpCfg(entity,isAudit);
|
||||
} catch (MaatConvertException e) {
|
||||
e.printStackTrace();
|
||||
logger.error("bgp配置下发失败",e);
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("bgp配置下发失败",e);
|
||||
addMessage(redirectAttributes,"error","audit_failed");
|
||||
}
|
||||
}
|
||||
}else {
|
||||
Page<CfgIndexInfo> searchPage=new Page<CfgIndexInfo>(request,response,"a");
|
||||
Page<CfgIndexInfo> auditPage=new Page<CfgIndexInfo>(request,response,"a");
|
||||
BeanUtils.copyProperties(searchPage, auditPage);
|
||||
|
||||
try {
|
||||
auditAll(auditPage,isValid , cfg);
|
||||
} catch (Exception e) {
|
||||
logger.error("配置下发失败:",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return bgpList(model, cfg, request, response);
|
||||
}
|
||||
return "redirect:" + adminPath +"/ntc/other/bgpList?functionId="+functionId;
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import org.apache.commons.codec.digest.DigestUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.apache.taglibs.standard.functions.Functions;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.util.FileCopyUtils;
|
||||
@@ -159,30 +160,56 @@ public class FileTransferCfgController extends BaseController{
|
||||
}
|
||||
@RequestMapping(value = {"auditFtpCfg"})
|
||||
@RequiresPermissions(value={"fileTransfer:ftp:confirm"})
|
||||
public String auditFtpCfg(Integer isAudit,Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes) {
|
||||
CfgIndexInfo entity = new CfgIndexInfo();
|
||||
String[] idArray = ids.split(",");
|
||||
for(String id :idArray){
|
||||
entity = fileTransferCfgService.getFtpCfg(Long.parseLong(id),null);
|
||||
entity.setIsAudit(isAudit);
|
||||
entity.setIsValid(isValid);
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
entity.setAuditTime(new Date());
|
||||
entity.setFunctionId(functionId);
|
||||
try {
|
||||
fileTransferCfgService.auditFtpCfg(entity,isAudit);
|
||||
addMessage(redirectAttributes,"success","audit_success");
|
||||
} catch ( Exception e) {
|
||||
if(e instanceof MaatConvertException) {
|
||||
e.printStackTrace();
|
||||
logger.error("ftp配置下发失败:"+e.getMessage());;
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}else {
|
||||
e.printStackTrace();
|
||||
logger.error("ftp配置下发失败",e);
|
||||
addMessage(redirectAttributes,"error","audit_failed");
|
||||
public String auditFtpCfg(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,
|
||||
Integer isValid,
|
||||
Integer isAudit,
|
||||
String ids,
|
||||
Integer functionId,
|
||||
RedirectAttributes redirectAttributes,
|
||||
HttpServletResponse response,
|
||||
HttpServletRequest request) {
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
CfgIndexInfo entity = new CfgIndexInfo();
|
||||
String[] idArray = ids.split(",");
|
||||
for(String id :idArray){
|
||||
entity = fileTransferCfgService.getFtpCfg(Long.parseLong(id),null);
|
||||
entity.setIsAudit(isAudit);
|
||||
entity.setIsValid(isValid);
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
entity.setAuditTime(new Date());
|
||||
entity.setFunctionId(functionId);
|
||||
try {
|
||||
fileTransferCfgService.auditFtpCfg(entity,isAudit);
|
||||
addMessage(redirectAttributes,"success","audit_success");
|
||||
} catch ( Exception e) {
|
||||
if(e instanceof MaatConvertException) {
|
||||
e.printStackTrace();
|
||||
logger.error("ftp配置下发失败:"+e.getMessage());;
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}else {
|
||||
e.printStackTrace();
|
||||
logger.error("ftp配置下发失败",e);
|
||||
addMessage(redirectAttributes,"error","audit_failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
}else {
|
||||
Page<CfgIndexInfo> searchPage=new Page<CfgIndexInfo>(request,response,"a");
|
||||
Page<CfgIndexInfo> auditPage=new Page<CfgIndexInfo>(request,response,"a");
|
||||
BeanUtils.copyProperties(searchPage, auditPage);
|
||||
|
||||
try {
|
||||
auditAll(auditPage,isValid , cfg);
|
||||
} catch (Exception e) {
|
||||
logger.error("配置下发失败:",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
}
|
||||
|
||||
}
|
||||
return ftpList(model, cfg, request, response);
|
||||
}
|
||||
return "redirect:" + adminPath +"/ntc/fileTransfer/ftpList?functionId="+functionId;
|
||||
}
|
||||
@@ -276,8 +303,14 @@ public class FileTransferCfgController extends BaseController{
|
||||
|
||||
@RequestMapping(value = {"auditFileDigestCfg"})
|
||||
@RequiresPermissions(value={"fileTransfer:fileDigest:confirm"})
|
||||
public String auditFileDigestCfg(Integer isAudit,Integer isValid
|
||||
,String ids,Integer functionId, RedirectAttributes redirectAttributes) {
|
||||
public String auditFileDigestCfg(Model model,@ModelAttribute("cfg")FileDigestCfg cfg,
|
||||
Integer isValid,
|
||||
Integer isAudit,
|
||||
String ids,
|
||||
Integer functionId,
|
||||
RedirectAttributes redirectAttributes,
|
||||
HttpServletResponse response,
|
||||
HttpServletRequest request) {
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
String[] idArray = ids.split(",");
|
||||
Date auditTime=new Date();
|
||||
@@ -298,6 +331,23 @@ public class FileTransferCfgController extends BaseController{
|
||||
}
|
||||
}
|
||||
|
||||
}else {
|
||||
Page<FileDigestCfg> searchPage=new Page<FileDigestCfg>(request,response,"a");
|
||||
Page<FileDigestCfg> auditPage=new Page<FileDigestCfg>(request,response,"a");
|
||||
BeanUtils.copyProperties(searchPage, auditPage);
|
||||
|
||||
try {
|
||||
auditAll(auditPage,isValid , cfg);
|
||||
} catch (Exception e) {
|
||||
logger.error("配置下发失败:",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
}
|
||||
|
||||
}
|
||||
return fileDigestList(model, cfg, request, response, redirectAttributes);
|
||||
}
|
||||
return "redirect:" + adminPath +"/ntc/fileTransfer/fileDigestList?functionId="+functionId;
|
||||
}
|
||||
@@ -450,30 +500,56 @@ public class FileTransferCfgController extends BaseController{
|
||||
|
||||
@RequestMapping(value = {"auditP2pCfg"})
|
||||
@RequiresPermissions(value={"fileTransfer:p2p:confirm"})
|
||||
public String auditP2pCfg(Integer isAudit,Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes) {
|
||||
CfgIndexInfo entity = new CfgIndexInfo();
|
||||
String[] idArray = ids.split(",");
|
||||
for(String id :idArray){
|
||||
entity = fileTransferCfgService.getP2pCfg(Long.parseLong(id),null);
|
||||
entity.setIsAudit(isAudit);
|
||||
entity.setIsValid(isValid);
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
entity.setAuditTime(new Date());
|
||||
entity.setFunctionId(functionId);
|
||||
try {
|
||||
fileTransferCfgService.auditP2pCfg(entity,isAudit);
|
||||
} catch ( Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.info("p2p配置下发失败:"+e.getMessage());
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
|
||||
}else if(e instanceof CallExternalProceduresException) {
|
||||
addMessage(redirectAttributes,"error","call_external_procedures_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","audit_failed");
|
||||
public String auditP2pCfg(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,
|
||||
Integer isValid,
|
||||
Integer isAudit,
|
||||
String ids,
|
||||
Integer functionId,
|
||||
RedirectAttributes redirectAttributes,
|
||||
HttpServletResponse response,
|
||||
HttpServletRequest request) {
|
||||
if(!StringUtil.isEmpty(ids)) {
|
||||
CfgIndexInfo entity = new CfgIndexInfo();
|
||||
String[] idArray = ids.split(",");
|
||||
for(String id :idArray){
|
||||
entity = fileTransferCfgService.getP2pCfg(Long.parseLong(id),null);
|
||||
entity.setIsAudit(isAudit);
|
||||
entity.setIsValid(isValid);
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
entity.setAuditTime(new Date());
|
||||
entity.setFunctionId(functionId);
|
||||
try {
|
||||
fileTransferCfgService.auditP2pCfg(entity,isAudit);
|
||||
} catch ( Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.info("p2p配置下发失败:"+e.getMessage());
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
|
||||
}else if(e instanceof CallExternalProceduresException) {
|
||||
addMessage(redirectAttributes,"error","call_external_procedures_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","audit_failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
}else {
|
||||
Page<CfgIndexInfo> searchPage=new Page<CfgIndexInfo>(request,response,"a");
|
||||
Page<CfgIndexInfo> auditPage=new Page<CfgIndexInfo>(request,response,"a");
|
||||
BeanUtils.copyProperties(searchPage, auditPage);
|
||||
|
||||
try {
|
||||
auditAll(auditPage,isValid , cfg);
|
||||
} catch (Exception e) {
|
||||
logger.error("配置下发失败:",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
}
|
||||
|
||||
}
|
||||
return p2pList(model, cfg, request, response);
|
||||
}
|
||||
return "redirect:" + adminPath +"/ntc/fileTransfer/p2pList?functionId="+functionId;
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
@@ -45,6 +46,7 @@ import com.nis.domain.configuration.template.SnatTemplate;
|
||||
import com.nis.domain.configuration.template.StringAllTemplate;
|
||||
import com.nis.domain.specific.ConfigGroupInfo;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.index.Configurations;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DictUtils;
|
||||
import com.nis.util.StringUtil;
|
||||
@@ -126,28 +128,67 @@ public class IpController extends BaseController{
|
||||
ipCfgService.updateIpCfgValid(isValid, ids, functionId);
|
||||
return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+functionId;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param model
|
||||
* @param cfg
|
||||
* @param auditType 审核类型 :批量审核时使用,1批量生效,0批量失效
|
||||
* @param isAudit
|
||||
* @param isValid
|
||||
* @param ids
|
||||
* @param functionId
|
||||
* @param request
|
||||
* @param response
|
||||
* @param redirectAttributes
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"audit"})
|
||||
@RequiresPermissions("iplist:confirm")
|
||||
public String audit(Integer isAudit,Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes) {
|
||||
CfgIndexInfo entity = new CfgIndexInfo();
|
||||
String[] idArray = ids.split(",");
|
||||
for(String id :idArray){
|
||||
entity = ipCfgService.getIpPortCfg(Long.parseLong(id),null);
|
||||
entity.setIsAudit(isAudit);
|
||||
entity.setIsValid(isValid);
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
entity.setAuditTime(new Date());
|
||||
entity.setFunctionId(functionId);
|
||||
try {
|
||||
if(StringUtils.isNoneBlank(entity.getUserRegion4())) {
|
||||
ipCfgService.auditAsnCfg(entity, isAudit);
|
||||
}else {
|
||||
ipCfgService.auditIpCfg(entity,isAudit);
|
||||
public String audit(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg
|
||||
,Integer isAudit
|
||||
,Integer isValid
|
||||
,String ids
|
||||
,Integer functionId
|
||||
, HttpServletRequest request
|
||||
,HttpServletResponse response
|
||||
,RedirectAttributes redirectAttributes) {
|
||||
//选中配置审核
|
||||
if(!StringUtil.isEmpty(ids)) {
|
||||
CfgIndexInfo entity = new CfgIndexInfo();
|
||||
String[] idArray = ids.split(",");
|
||||
for(String id :idArray){
|
||||
entity = ipCfgService.getIpPortCfg(Long.parseLong(id),null);
|
||||
entity.setIsAudit(isAudit);
|
||||
entity.setIsValid(isValid);
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
entity.setAuditTime(new Date());
|
||||
entity.setFunctionId(functionId);
|
||||
try {
|
||||
if(StringUtils.isNoneBlank(entity.getUserRegion4())) {
|
||||
ipCfgService.auditAsnCfg(entity, isAudit);
|
||||
}else {
|
||||
ipCfgService.auditIpCfg(entity,isAudit);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.info("ip配置下发失败:"+e.getMessage());
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}else{//条件下所有配置审核
|
||||
Page<CfgIndexInfo> searchPage=new Page<CfgIndexInfo>(request,response,"a");
|
||||
Page<CfgIndexInfo> auditPage=new Page<CfgIndexInfo>(request,response,"a");
|
||||
BeanUtils.copyProperties(searchPage, auditPage);
|
||||
|
||||
try {
|
||||
auditAll(auditPage,isValid , cfg);
|
||||
} catch (Exception e) {
|
||||
logger.info("ip配置下发失败:"+e.getMessage());
|
||||
logger.error("配置下发失败:",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
@@ -155,7 +196,10 @@ public class IpController extends BaseController{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return list(model, cfg, request, response);
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+functionId;
|
||||
}
|
||||
/*//ip配置导入
|
||||
|
||||
@@ -15,6 +15,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import org.apache.commons.codec.digest.DigestUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.util.FileCopyUtils;
|
||||
@@ -37,6 +38,7 @@ import com.nis.util.ConfigServiceUtil;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.FileUtils;
|
||||
import com.nis.util.JsonMapper;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.controller.BaseController;
|
||||
import com.nis.web.security.UserUtils;
|
||||
|
||||
@@ -164,30 +166,56 @@ public class MailCfgController extends BaseController{
|
||||
}
|
||||
@RequestMapping(value = {"auditMailCfg"})
|
||||
@RequiresPermissions(value={"mail:confirm"})
|
||||
public String auditMailCfg(Integer isAudit,Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes) {
|
||||
CfgIndexInfo entity = new CfgIndexInfo();
|
||||
String[] idArray = ids.split(",");
|
||||
for(String id :idArray){
|
||||
entity = mailCfgService.getMailCfg(Long.parseLong(id),null);
|
||||
entity.setIsAudit(isAudit);
|
||||
entity.setIsValid(isValid);
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
entity.setAuditTime(new Date());
|
||||
entity.setFunctionId(functionId);
|
||||
try {
|
||||
mailCfgService.auditMailCfg(entity,isAudit);
|
||||
} catch ( Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("mail配置下发失败:"+e.getMessage());
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
|
||||
}else if(e instanceof CallExternalProceduresException) {
|
||||
addMessage(redirectAttributes,"error","call_external_procedures_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
public String auditMailCfg(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,
|
||||
Integer isValid,
|
||||
Integer isAudit,
|
||||
String ids,
|
||||
Integer functionId,
|
||||
RedirectAttributes redirectAttributes,
|
||||
HttpServletResponse response,
|
||||
HttpServletRequest request) {
|
||||
if(!StringUtil.isEmpty(ids)) {
|
||||
CfgIndexInfo entity = new CfgIndexInfo();
|
||||
String[] idArray = ids.split(",");
|
||||
for(String id :idArray){
|
||||
entity = mailCfgService.getMailCfg(Long.parseLong(id),null);
|
||||
entity.setIsAudit(isAudit);
|
||||
entity.setIsValid(isValid);
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
entity.setAuditTime(new Date());
|
||||
entity.setFunctionId(functionId);
|
||||
try {
|
||||
mailCfgService.auditMailCfg(entity,isAudit);
|
||||
} catch ( Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("mail配置下发失败:"+e.getMessage());
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
|
||||
}else if(e instanceof CallExternalProceduresException) {
|
||||
addMessage(redirectAttributes,"error","call_external_procedures_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
}else {
|
||||
Page<CfgIndexInfo> searchPage=new Page<CfgIndexInfo>(request,response,"a");
|
||||
Page<CfgIndexInfo> auditPage=new Page<CfgIndexInfo>(request,response,"a");
|
||||
BeanUtils.copyProperties(searchPage, auditPage);
|
||||
|
||||
try {
|
||||
auditAll(auditPage,isValid , cfg);
|
||||
} catch (Exception e) {
|
||||
logger.error("配置下发失败:",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
}
|
||||
|
||||
}
|
||||
return mailList(model, cfg, request, response);
|
||||
}
|
||||
return "redirect:" + adminPath +"/ntc/mail/mailList?functionId="+functionId;
|
||||
}
|
||||
|
||||
@@ -208,25 +208,52 @@ public class WebsiteController extends BaseController{
|
||||
}
|
||||
@RequestMapping(value = {"auditHttpCfg"})
|
||||
@RequiresPermissions(value={"website:http:confirm"})
|
||||
public String auditHttpCfg(Integer isAudit,Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes) {
|
||||
CfgIndexInfo entity = new CfgIndexInfo();
|
||||
String[] idArray = ids.split(",");
|
||||
for(String id :idArray){
|
||||
entity = websiteCfgService.getHttpCfg(Long.parseLong(id),null);
|
||||
entity.setIsAudit(isAudit);
|
||||
entity.setIsValid(isValid);
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
entity.setAuditTime(new Date());
|
||||
entity.setFunctionId(functionId);
|
||||
try {
|
||||
websiteCfgService.auditHttpCfg(entity,isAudit);
|
||||
} catch (MaatConvertException e) {
|
||||
logger.error("http配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}catch (Exception e) {
|
||||
logger.error("http配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
public String auditHttpCfg(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,
|
||||
Integer isValid,
|
||||
Integer isAudit,
|
||||
String ids,
|
||||
Integer functionId,
|
||||
RedirectAttributes redirectAttributes,
|
||||
HttpServletResponse response,
|
||||
HttpServletRequest request) {
|
||||
if(!StringUtil.isEmpty(ids)) {
|
||||
CfgIndexInfo entity = new CfgIndexInfo();
|
||||
String[] idArray = ids.split(",");
|
||||
for(String id :idArray){
|
||||
entity = websiteCfgService.getHttpCfg(Long.parseLong(id),null);
|
||||
entity.setIsAudit(isAudit);
|
||||
entity.setIsValid(isValid);
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
entity.setAuditTime(new Date());
|
||||
entity.setFunctionId(functionId);
|
||||
try {
|
||||
websiteCfgService.auditHttpCfg(entity,isAudit);
|
||||
} catch (MaatConvertException e) {
|
||||
logger.error("http配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}catch (Exception e) {
|
||||
logger.error("http配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
}
|
||||
}
|
||||
}else{//条件下所有配置审核
|
||||
Page<CfgIndexInfo> searchPage=new Page<CfgIndexInfo>(request,response,"a");
|
||||
Page<CfgIndexInfo> auditPage=new Page<CfgIndexInfo>(request,response,"a");
|
||||
BeanUtils.copyProperties(searchPage, auditPage);
|
||||
|
||||
try {
|
||||
auditAll(auditPage,isValid , cfg);
|
||||
} catch (Exception e) {
|
||||
logger.error("配置下发失败:",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return httpList(model, cfg, request, response);
|
||||
}
|
||||
return "redirect:" + adminPath +"/ntc/website/httpList?functionId="+functionId;
|
||||
}
|
||||
@@ -303,30 +330,57 @@ public class WebsiteController extends BaseController{
|
||||
}
|
||||
@RequestMapping(value = {"auditSslCfg"})
|
||||
@RequiresPermissions(value={"website:ssl:confirm"})
|
||||
public String auditSslCfg(Integer isAudit,Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes) {
|
||||
CfgIndexInfo entity = new CfgIndexInfo();
|
||||
String[] idArray = ids.split(",");
|
||||
for(String id :idArray){
|
||||
entity = websiteCfgService.getSslCfg(Long.parseLong(id),null);
|
||||
entity.setIsAudit(isAudit);
|
||||
entity.setIsValid(isValid);
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
entity.setAuditTime(new Date());
|
||||
entity.setFunctionId(functionId);
|
||||
try {
|
||||
websiteCfgService.auditSslCfg(entity,isAudit);
|
||||
} catch ( Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("ssl配置下发失败:"+e.getMessage());
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
|
||||
}else if(e instanceof CallExternalProceduresException) {
|
||||
addMessage(redirectAttributes,"error","call_external_procedures_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
public String auditSslCfg(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,
|
||||
Integer isAudit,
|
||||
Integer isValid,
|
||||
String ids,
|
||||
Integer functionId,
|
||||
RedirectAttributes redirectAttributes,
|
||||
HttpServletRequest request,
|
||||
HttpServletResponse response) {
|
||||
if(!StringUtil.isEmpty(ids)) {
|
||||
CfgIndexInfo entity = new CfgIndexInfo();
|
||||
String[] idArray = ids.split(",");
|
||||
for(String id :idArray){
|
||||
entity = websiteCfgService.getSslCfg(Long.parseLong(id),null);
|
||||
entity.setIsAudit(isAudit);
|
||||
entity.setIsValid(isValid);
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
entity.setAuditTime(new Date());
|
||||
entity.setFunctionId(functionId);
|
||||
try {
|
||||
websiteCfgService.auditSslCfg(entity,isAudit);
|
||||
} catch ( Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("ssl配置下发失败:"+e.getMessage());
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
|
||||
}else if(e instanceof CallExternalProceduresException) {
|
||||
addMessage(redirectAttributes,"error","call_external_procedures_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{//条件下所有配置审核
|
||||
try {
|
||||
Page<CfgIndexInfo> searchPage=new Page<CfgIndexInfo>(request,response,"a");
|
||||
Page<CfgIndexInfo> auditPage=new Page<CfgIndexInfo>(request,response,"a");
|
||||
BeanUtils.copyProperties(searchPage, auditPage);
|
||||
|
||||
auditAll(auditPage,isValid , cfg);
|
||||
} catch (Exception e) {
|
||||
logger.error("配置下发失败:",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return sslList(model, cfg, request, response);
|
||||
}
|
||||
return "redirect:" + adminPath +"/ntc/website/sslList?functionId="+functionId;
|
||||
}
|
||||
@@ -396,27 +450,54 @@ public class WebsiteController extends BaseController{
|
||||
}
|
||||
@RequestMapping(value = {"auditDnsCfg"})
|
||||
@RequiresPermissions(value={"website:dns:confirm"})
|
||||
public String auditDnsCfg(Integer isAudit,Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes) {
|
||||
CfgIndexInfo entity = new CfgIndexInfo();
|
||||
String[] idArray = ids.split(",");
|
||||
for(String id :idArray){
|
||||
entity = websiteCfgService.getDnsCfg(Long.parseLong(id),null);
|
||||
entity.setIsAudit(isAudit);
|
||||
entity.setIsValid(isValid);
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
entity.setAuditTime(new Date());
|
||||
entity.setFunctionId(functionId);
|
||||
try {
|
||||
websiteCfgService.auditDnsCfg(entity,isAudit);
|
||||
} catch (MaatConvertException e) {
|
||||
e.printStackTrace();
|
||||
logger.info("dns配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.info("dns配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
public String auditDnsCfg(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,
|
||||
Integer isAudit,
|
||||
Integer isValid,
|
||||
String ids,
|
||||
Integer functionId,
|
||||
HttpServletRequest request,
|
||||
HttpServletResponse response,
|
||||
RedirectAttributes redirectAttributes) {
|
||||
if(!StringUtil.isEmpty(ids)) {
|
||||
CfgIndexInfo entity = new CfgIndexInfo();
|
||||
String[] idArray = ids.split(",");
|
||||
for(String id :idArray){
|
||||
entity = websiteCfgService.getDnsCfg(Long.parseLong(id),null);
|
||||
entity.setIsAudit(isAudit);
|
||||
entity.setIsValid(isValid);
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
entity.setAuditTime(new Date());
|
||||
entity.setFunctionId(functionId);
|
||||
try {
|
||||
websiteCfgService.auditDnsCfg(entity,isAudit);
|
||||
} catch (MaatConvertException e) {
|
||||
e.printStackTrace();
|
||||
logger.info("dns配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.info("dns配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
}
|
||||
}
|
||||
}else{//条件下所有配置审核
|
||||
Page<CfgIndexInfo> searchPage=new Page<CfgIndexInfo>(request,response,"a");
|
||||
Page<CfgIndexInfo> auditPage=new Page<CfgIndexInfo>(request,response,"a");
|
||||
BeanUtils.copyProperties(searchPage, auditPage);
|
||||
|
||||
try {
|
||||
auditAll(auditPage,isValid , cfg);
|
||||
} catch (Exception e) {
|
||||
logger.error("配置下发失败:",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return dnsList(model, cfg, request, response);
|
||||
}
|
||||
return "redirect:" + adminPath +"/ntc/website/dnsList?functionId="+functionId;
|
||||
}
|
||||
@@ -842,5 +923,4 @@ public class WebsiteController extends BaseController{
|
||||
}
|
||||
//return "redirect:" + adminPath +"/ntc/website/httpList?functionId="+entity.getFunctionId();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -96,28 +96,56 @@ public class WhiteListController extends CommonController{
|
||||
}
|
||||
@RequestMapping(value = {"ip/audit"})
|
||||
@RequiresPermissions("whitelist:ip:confirm")
|
||||
public String auditIp(Integer isAudit,Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes) {
|
||||
CfgIndexInfo entity = new CfgIndexInfo();
|
||||
String[] idArray = ids.split(",");
|
||||
for(String id :idArray){
|
||||
entity = ipCfgService.getIpPortCfg(Long.parseLong(id),null);
|
||||
entity.setIsAudit(isAudit);
|
||||
entity.setIsValid(isValid);
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
entity.setAuditTime(new Date());
|
||||
entity.setFunctionId(functionId);
|
||||
try {
|
||||
ipCfgService.auditIpCfg(entity,isAudit);
|
||||
addMessage(redirectAttributes,"success", "audit_success");
|
||||
} catch (MaatConvertException e) {
|
||||
logger.info("ip配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}catch (Exception e) {
|
||||
logger.info("ip配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
public String auditIp(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,
|
||||
Integer isValid,
|
||||
Integer isAudit,
|
||||
String ids,
|
||||
Integer functionId,
|
||||
RedirectAttributes redirectAttributes,
|
||||
HttpServletResponse response,
|
||||
HttpServletRequest request
|
||||
) {
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
CfgIndexInfo entity = new CfgIndexInfo();
|
||||
String[] idArray = ids.split(",");
|
||||
for(String id :idArray){
|
||||
entity = ipCfgService.getIpPortCfg(Long.parseLong(id),null);
|
||||
entity.setIsAudit(isAudit);
|
||||
entity.setIsValid(isValid);
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
entity.setAuditTime(new Date());
|
||||
entity.setFunctionId(functionId);
|
||||
try {
|
||||
ipCfgService.auditIpCfg(entity,isAudit);
|
||||
addMessage(redirectAttributes,"success", "audit_success");
|
||||
} catch (MaatConvertException e) {
|
||||
logger.info("ip配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}catch (Exception e) {
|
||||
logger.info("ip配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
}
|
||||
}
|
||||
}else{
|
||||
Page<CfgIndexInfo> searchPage=new Page<CfgIndexInfo>(request,response,"a");
|
||||
Page<CfgIndexInfo> auditPage=new Page<CfgIndexInfo>(request,response,"a");
|
||||
BeanUtils.copyProperties(searchPage, auditPage);
|
||||
|
||||
try {
|
||||
auditAll(auditPage,isValid , cfg);
|
||||
} catch (Exception e) {
|
||||
logger.error("配置下发失败:",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return ipList(model, cfg, request, response);
|
||||
}
|
||||
return "redirect:" + adminPath +"/ntc/whitelist/ip/list?functionId="+entity.getFunctionId();
|
||||
return "redirect:" + adminPath +"/ntc/whitelist/ip/list?functionId="+functionId;
|
||||
}
|
||||
@RequestMapping(value = {"updateIpValid"})
|
||||
@RequiresPermissions(value={"whitelist:ip:config"})
|
||||
@@ -230,27 +258,54 @@ public class WhiteListController extends CommonController{
|
||||
|
||||
@RequestMapping(value = {"domain/audit"})
|
||||
@RequiresPermissions("whitelist:domain:confirm")
|
||||
public String auditDomain(Integer isAudit,Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes) {
|
||||
CfgIndexInfo entity = new CfgIndexInfo();
|
||||
String[] idArray = ids.split(",");
|
||||
for(String id :idArray){
|
||||
entity = domainService.getDomainCfg(Long.parseLong(id),null);
|
||||
entity.setIsAudit(isAudit);
|
||||
entity.setIsValid(isValid);
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
entity.setAuditTime(new Date());
|
||||
entity.setFunctionId(functionId);
|
||||
try {
|
||||
domainService.auditDomainCfg(entity,isAudit);
|
||||
} catch (MaatConvertException e) {
|
||||
e.printStackTrace();
|
||||
logger.error("domain配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("domain配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes,"error","audit_failed");
|
||||
public String auditDomain(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,
|
||||
Integer isValid,
|
||||
Integer isAudit,
|
||||
String ids,
|
||||
Integer functionId,
|
||||
RedirectAttributes redirectAttributes,
|
||||
HttpServletResponse response,
|
||||
HttpServletRequest request) {
|
||||
if(!StringUtil.isEmpty(ids)) {
|
||||
CfgIndexInfo entity = new CfgIndexInfo();
|
||||
String[] idArray = ids.split(",");
|
||||
for(String id :idArray){
|
||||
entity = domainService.getDomainCfg(Long.parseLong(id),null);
|
||||
entity.setIsAudit(isAudit);
|
||||
entity.setIsValid(isValid);
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
entity.setAuditTime(new Date());
|
||||
entity.setFunctionId(functionId);
|
||||
try {
|
||||
domainService.auditDomainCfg(entity,isAudit);
|
||||
} catch (MaatConvertException e) {
|
||||
e.printStackTrace();
|
||||
logger.error("domain配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("domain配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes,"error","audit_failed");
|
||||
}
|
||||
}
|
||||
}else{//条件下所有配置审核
|
||||
Page<CfgIndexInfo> searchPage=new Page<CfgIndexInfo>(request,response,"a");
|
||||
Page<CfgIndexInfo> auditPage=new Page<CfgIndexInfo>(request,response,"a");
|
||||
BeanUtils.copyProperties(searchPage, auditPage);
|
||||
|
||||
try {
|
||||
auditAll(auditPage,isValid , cfg);
|
||||
} catch (Exception e) {
|
||||
logger.error("配置下发失败:",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return domainList(model, cfg, request, response);
|
||||
}
|
||||
return "redirect:" + adminPath +"/ntc/whitelist/domain/list?functionId="+functionId;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user