Merge branch 'develop' of http://10.0.6.99/gwall/gwall.git into develop

This commit is contained in:
wangxin
2018-08-27 17:32:34 +08:00
27 changed files with 72 additions and 94 deletions

View File

@@ -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) {

View File

@@ -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<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.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<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.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();
}

View File

@@ -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

View File

@@ -5,9 +5,6 @@
<title><spring:message code="${cfgName}"></spring:message></title>
<script type="text/javascript">
$(function(){
$("#cancel").on("click",function(){
window.history.back();
});
$(".action").on("change", function() {
$("#serviceId").val($(this).attr("serviceId"));
});

View File

@@ -53,9 +53,6 @@ $(function(){
</head>
<body>
<div class="page-content">
<c:forEach items="${fns:getDictList('SPECIFIC_SERVICE_CFG_TYPE') }" var="dict">
<c:if test="${dict.itemValue eq 'social_app'}"><c:set var="app" value="${dict.itemCode}"/></c:if>
</c:forEach>
<span id="keywordError" style="display:none"><spring:message code="required"></spring:message></span>
<span id="tagsinputTip" style="display:none"><spring:message code="multiple_keywords_tip"></spring:message></span>
<h3 class="page-title">
@@ -93,7 +90,7 @@ $(function(){
<sys:treeselect id="specServiceId" name="specServiceId" value="${_cfg.specServiceId}"
labelName="parent.specServiceName" notAllowSelectRoot="true" notAllowSelectParent="true" enableAddBtn="true"
labelValue="${empty _cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(_cfg.specServiceId).specServiceName}"
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId=""
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=1" extId=""
cssClass="form-control required"/>
</div>
<div for="parent.specServiceName"></div>

View File

@@ -49,9 +49,6 @@ $(function(){
$("#cfgFrom").attr("action","${ctx}/cfg/app/saveOrUpdateCfg");
$("#save").submit();
});
$("#cancel").on("click",function(){
window.history.back();
});
$("#cfgFrom").validate({
submitHandler: function(form){
//loading('onloading...');

View File

@@ -7,9 +7,6 @@
<script type="text/javascript">
$(function(){
$("#cfgFrom").find("input,select,radio").attr("disabled",true);
$("#cancel").on("click",function(){
window.history.back();
});
});
</script>

View File

@@ -5,9 +5,6 @@
<title><spring:message code="${cfgName}"></spring:message></title>
<script type="text/javascript">
$(function(){
$("#cancel").on("click",function(){
window.history.back();
});
$("input[name='cfgKeywords']").addClass("url");
$(".action").on("change", function() {
$("#serviceId").val($(this).attr("serviceId"));

View File

@@ -52,9 +52,6 @@ $(function(){
$("#areaIp").addClass("hidden");
}
});
$("#cancel").on("click",function(){
window.history.back();
});
$(".action").on("change",function(){
$("#serviceId").val($(this).attr("serviceId"));
});

View File

@@ -5,9 +5,6 @@
<title><spring:message code="${cfgName}"></spring:message></title>
<script type="text/javascript">
$(function(){
$("#cancel").on("click",function(){
window.history.back();
});
$(".action").on("change", function() {
$("#serviceId").val($(this).attr("serviceId"));
});

View File

@@ -42,9 +42,6 @@ $(function(){
$("#areaIp").addClass("hidden");
}
});
$("#cancel").on("click",function(){
window.history.back();
});
$(".action").on("change",function(){
$("#serviceId").val($(this).attr("serviceId"));
});

View File

@@ -25,9 +25,7 @@ $(function(){
},
errorContainer: "#messageBox",
});
$("#cancel").on("click",function(){
window.history.back();
});
});
</script>
</head>

View File

@@ -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"));

View File

@@ -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"));

View File

@@ -5,9 +5,6 @@
<title><spring:message code="${cfgName}"></spring:message></title>
<script type="text/javascript">
$(function(){
$("#cancel").on("click",function(){
window.history.back();
});
$(".action").on("change", function() {
$("#serviceId").val($(this).attr("serviceId"));
$("#protocolId").val($(this).attr("protocolId"));

View File

@@ -13,11 +13,7 @@
$(document)
.ready(
function() {
$("#cancel").on("click", function() {
window.history.back();
});
$(".action").on("change", function() {
$(".action").on("change", function() {
switchAction($("input[name=action]:checked").val());
//拦截根据action切换动作部分
setInterceptDefaultInfo("");

View File

@@ -48,9 +48,6 @@
$("#areaIp").addClass("hidden");
}
});
$("#cancel").on("click", function() {
window.history.back();
});
$("select[name$='ipType']").on("change", function() {
switchIpType($(this));
});

View File

@@ -12,9 +12,6 @@ $(function(){
$("#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"));

View File

@@ -5,9 +5,6 @@
<title><spring:message code="${cfgName}"></spring:message></title>
<script type="text/javascript">
$(function(){
$("#cancel").on("click",function(){
window.history.back();
});
$(".action").on("change", function() {
$("#serviceId").val($(this).attr("serviceId"));
});

View File

@@ -5,9 +5,6 @@
<title><spring:message code="${cfgName}"></spring:message></title>
<script type="text/javascript">
$(function(){
$("#cancel").on("click",function(){
window.history.back();
});
$(".action").on("change", function() {
$("#serviceId").val($(this).attr("serviceId"));
});

View File

@@ -172,9 +172,7 @@ $(function(){
var tableName=$(this).attr("name").replace(".ipType","");
switchIpType($(".ipType"));
});
$("#cancel").on("click",function(){
window.history.back();
});
});
</script>
</head>

View File

@@ -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"));

View File

@@ -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"));

View File

@@ -5,9 +5,6 @@
<title><spring:message code="${cfgName}"></spring:message></title>
<script type="text/javascript">
$(function(){
$("#cancel").on("click",function(){
window.history.back();
});
$(".action").on("change", function() {
$("#serviceId").val($(this).attr("serviceId"));
});

View File

@@ -5,9 +5,6 @@
<title><spring:message code="${cfgName}"></spring:message></title>
<script type="text/javascript">
$(function(){
$("#cancel").on("click",function(){
window.history.back();
});
$(".action").on("change", function() {
$("#serviceId").val($(this).attr("serviceId"));
});

View File

@@ -18,10 +18,6 @@
$("#cfgFile").on('change',function(){
$("#urlInfo").val($("#cfgFile").val());
});
$("#cancel").on("click", function() {
window.history.back();
});
$("#cfgFrom") .validate( {
submitHandler : function(form) {

View File

@@ -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"));