diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/AvController.java b/src/main/java/com/nis/web/controller/configuration/ntc/AvController.java index 5763bc857..3b08b6883 100644 --- a/src/main/java/com/nis/web/controller/configuration/ntc/AvController.java +++ b/src/main/java/com/nis/web/controller/configuration/ntc/AvController.java @@ -131,9 +131,11 @@ public class AvController extends BaseController { entity.setResultPath(resultFileAllPath); File uploadSrcFile = new File(srcFileAllPath); - File uploadSampleFile = new File(sampleFileAllPath); +// File uploadSampleFile = new File(sampleFileAllPath); FileCopyUtils.copy(srcFile.getBytes(), uploadSrcFile);//保存源文件 - String host = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath(); + entity.setSrcUrl(""); + entity.setSampleUrl(""); + /*String host = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath(); String srcUrl = host+srcFilePath.substring(srcFilePath.indexOf(Constants.AV_FILE_PATH)+Constants.AV_FILE_PATH.length()-1)+sep+uploadSrcFile.getName(); String sampleUrl = host+sampleFilePath.substring(sampleFilePath.indexOf(Constants.AV_FILE_PATH)+Constants.AV_FILE_PATH.length()-1)+sep+uploadSampleFile.getName(); srcUrl = srcUrl.replace("\\", "/"); @@ -141,7 +143,7 @@ public class AvController extends BaseController { logger.info("srcUrl:"+srcUrl); logger.info("sampleUrl:"+sampleUrl); entity.setSrcUrl(srcUrl); - entity.setSampleUrl(sampleUrl); + entity.setSampleUrl(sampleUrl);*/ // File uploadSrcFile = new File(srcFilePath); // FileCopyUtils.copy(srcFile.getBytes(), uploadSrcFile); @@ -209,10 +211,10 @@ public class AvController extends BaseController { entity.setIsValid(isValid); entity.setAuditorId(UserUtils.getUser().getId()); entity.setAuditTime(new Date()); - String oldSrcUrl = entity.getSrcPath(); - String oldSampleUrl = entity.getSamplePath(); +// String oldSrcUrl = entity.getSrcPath(); +// String oldSampleUrl = entity.getSamplePath(); try { - if(isAudit==1){ + /*if(isAudit==1){ Date creatTime = entity.getCreateTime(); //音视频文件上传接口调用 File srcFile = new File(oldSrcUrl); @@ -254,15 +256,15 @@ public class AvController extends BaseController { // entity.setSamplePath(""); } - } + }*/ avCfgService.auditAvFileSample(entity,isAudit); //删除本地源文件和样例文件 - if(!oldSrcUrl.equals(entity.getSrcUrl())){ + /*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) { diff --git a/src/main/java/com/nis/web/service/configuration/AvCfgService.java b/src/main/java/com/nis/web/service/configuration/AvCfgService.java index 5a68dd1e0..1bde1abd0 100644 --- a/src/main/java/com/nis/web/service/configuration/AvCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/AvCfgService.java @@ -20,11 +20,13 @@ import com.nis.domain.Page; import com.nis.domain.configuration.AvFileSampleCfg; import com.nis.domain.configuration.AvSignSampleCfg; import com.nis.domain.maat.ToMaatResult; +import com.nis.domain.maat.ToMaatResult.ResponseData; import com.nis.exceptions.CallExternalProceduresException; import com.nis.exceptions.MaatConvertException; 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.dao.configuration.AvCfgDao; import com.nis.web.security.UserUtils; @@ -181,16 +183,62 @@ public class AvCfgService extends BaseService{ Integer fileId = resObject.getInt("fileId"); if(state==1 && fileSize>0){//成功 entity.setIsSampleCreated(1);//样例文件创建成功 + if(fileId.equals(entity.getCfgId().intValue())){ + File uploadSampleFile = new File(entity.getSamplePath()); + String sampleMd5 = FileUtils.getFileMD5(uploadSampleFile); + entity.setSampleMd5(sampleMd5); + }else{ + logger.error("调用外部程序返回fileId错误,输入的fileId为:"+entity.getCfgId()+",输出的fileId为:"+fileId); + throw new CallExternalProceduresException(); + } + //文件上传至综合服务 + Date creatTime = entity.getCreateTime(); + //音视频文件上传接口调用 + File srcFile = new File(entity.getSrcPath()); + Map 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.toString()); + //获取文件上传响应信息(新的文件访问路径) + String srcAccessUrl = null; + if(!StringUtil.isEmpty(result1)){ + ResponseData data = result1.getData(); + srcAccessUrl=data.getAccessUrl(); + entity.setSrcUrl(srcAccessUrl); + } + File sampleFile = new File(entity.getSamplePath()); + Map 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.toString()); + //获取文件上传响应信息(新的文件访问路径) + String sampleAccessUrl = null; + if(!StringUtil.isEmpty(result2)){ + ResponseData data = result2.getData(); + sampleAccessUrl = data.getAccessUrl(); + entity.setSampleUrl(sampleAccessUrl); + + } + //删除本地源文件和样例文件 + FileUtils.deleteFile(entity.getSrcPath()); + FileUtils.deleteFile(entity.getSamplePath()); }else{ entity.setIsSampleCreated(-1);//样例文件创建失败 + logger.error("样例文件生成失败"); + throw new CallExternalProceduresException(); } - if(fileId.equals(entity.getCfgId().intValue())){ - File uploadSampleFile = new File(entity.getSamplePath()); - String sampleMd5 = FileUtils.getFileMD5(uploadSampleFile); - entity.setSampleMd5(sampleMd5); - }else{ - logger.info("调用外部程序返回fileId错误,输入的fileId为:"+entity.getCfgId()+",输出的fileId为:"+fileId); - } + }else{ throw new CallExternalProceduresException(); } diff --git a/src/main/resources/messages/message_en.properties b/src/main/resources/messages/message_en.properties index 09886961e..f7401cd13 100644 --- a/src/main/resources/messages/message_en.properties +++ b/src/main/resources/messages/message_en.properties @@ -1096,8 +1096,8 @@ APP_SUBSCRIBE_ID=Certification Mark Configuration reply_file=Reply File app_topic_domain_cfg=Topic Website #=====================about app Tcp================================= -min_tcp=Minimum Session Number -max_tcp=Maximum Session Number +min_tcp=Minimum Session Size +max_tcp=Maximum Session Size tcp_unit=Unit / byte app_tcp_config=APP TCP Session Feature app_tcp_max_min=Maximum Session Should Not Exceed 4294967295 diff --git a/src/main/webapp/WEB-INF/views/basics/policyGroupForm.jsp b/src/main/webapp/WEB-INF/views/basics/policyGroupForm.jsp index e5cf8fc94..ec9e5fa6f 100644 --- a/src/main/webapp/WEB-INF/views/basics/policyGroupForm.jsp +++ b/src/main/webapp/WEB-INF/views/basics/policyGroupForm.jsp @@ -5,9 +5,6 @@ <spring:message code="${cfgName}"></spring:message> diff --git a/src/main/webapp/WEB-INF/views/cfg/av/contUrl/contUrlForm.jsp b/src/main/webapp/WEB-INF/views/cfg/av/contUrl/contUrlForm.jsp index 6af43eeb0..6fdb70057 100644 --- a/src/main/webapp/WEB-INF/views/cfg/av/contUrl/contUrlForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/av/contUrl/contUrlForm.jsp @@ -5,9 +5,6 @@ <spring:message code="${cfgName}"></spring:message> diff --git a/src/main/webapp/WEB-INF/views/cfg/av/voip/voipAccountForm.jsp b/src/main/webapp/WEB-INF/views/cfg/av/voip/voipAccountForm.jsp index 1dc0c6a4b..993f7e945 100644 --- a/src/main/webapp/WEB-INF/views/cfg/av/voip/voipAccountForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/av/voip/voipAccountForm.jsp @@ -13,9 +13,6 @@ $(document) .ready( function() { - $("#cancel").on("click", function() { - window.history.back(); - }); $(".action").on("change", function() { $("#serviceId").val($(this).attr("serviceId")); $("#protocolId").val($(this).attr("protocolId")); diff --git a/src/main/webapp/WEB-INF/views/cfg/common/domainForm.jsp b/src/main/webapp/WEB-INF/views/cfg/common/domainForm.jsp index 4e13ef004..e7152f5f0 100644 --- a/src/main/webapp/WEB-INF/views/cfg/common/domainForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/common/domainForm.jsp @@ -13,9 +13,6 @@ $("#cfgRegionCode").val($("#cfgRegionCodeMaat").val()); $("#cfgType").val($("#cfgTypeMaat").val()); } */ - $("#cancel").on("click", function() { - window.history.back(); - }); $(".action").on("change", function() { $("#serviceId").val($(this).attr("serviceId")); $("#protocolId").val($(this).attr("protocolId")); diff --git a/src/main/webapp/WEB-INF/views/cfg/dnsIpCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/dnsIpCfgForm.jsp index 9fc26d8e4..f63d58057 100644 --- a/src/main/webapp/WEB-INF/views/cfg/dnsIpCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/dnsIpCfgForm.jsp @@ -5,9 +5,6 @@ <spring:message code="${cfgName}"></spring:message> diff --git a/src/main/webapp/WEB-INF/views/cfg/other/bgpForm.jsp b/src/main/webapp/WEB-INF/views/cfg/other/bgpForm.jsp index 2135334a9..c2d9e962a 100644 --- a/src/main/webapp/WEB-INF/views/cfg/other/bgpForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/other/bgpForm.jsp @@ -13,9 +13,6 @@ $(document) .ready( function() { - $("#cancel").on("click", function() { - window.history.back(); - }); $(".action").on("change", function() { $("#serviceId").val($(this).attr("serviceId")); $("#protocolId").val($(this).attr("protocolId")); diff --git a/src/main/webapp/WEB-INF/views/cfg/other/xmppForm.jsp b/src/main/webapp/WEB-INF/views/cfg/other/xmppForm.jsp index 55e8643e0..548f97c89 100644 --- a/src/main/webapp/WEB-INF/views/cfg/other/xmppForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/other/xmppForm.jsp @@ -13,9 +13,6 @@ $(document) .ready( function() { - $("#cancel").on("click", function() { - window.history.back(); - }); $(".action").on("change", function() { $("#serviceId").val($(this).attr("serviceId")); $("#protocolId").val($(this).attr("protocolId")); diff --git a/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpReqReplaceForm.jsp b/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpReqReplaceForm.jsp index 868b0f21e..937fcf997 100644 --- a/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpReqReplaceForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/proxy/control/httpReqReplaceForm.jsp @@ -5,9 +5,6 @@ <spring:message code="${cfgName}"></spring:message>