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

This commit is contained in:
duandongmei
2018-08-23 11:05:09 +08:00
11 changed files with 269 additions and 169 deletions

View File

@@ -248,6 +248,8 @@ public class FileTransferCfgController extends BaseController{
logger.info("获取文件摘要响应信息:"+result);
}
fileTransferCfgService.saveOrUpdateFileDigestCfg(entity,result,areaCfgIds);
} catch (MaatConvertException e) {
addMessage(redirectAttributes, e.getMessage());
} catch (IOException e) {
e.printStackTrace();
}

View File

@@ -300,7 +300,7 @@
r.SERVICE_ID,r.REQUEST_ID,r.COMPILE_ID,r.IS_AREA_EFFECTIVE,r.CLASSIFY,
r.ATTRIBUTE,r.LABLE,r.AREA_EFFECTIVE_IDS,r.RATELIMIT,r.FUNCTION_ID,
r.CFG_TYPE,r.CFG_REGION_CODE,r.EXPR_TYPE,r.MATCH_METHOD,r.IS_HEXBIN,r.USER_REGION1,r.USER_REGION2,
r.USER_REGION3,r.USER_REGION4,r.USER_REGION5,r.do_log
r.USER_REGION3,r.USER_REGION4,r.USER_REGION5,r.DO_LOG
</sql>
<sql id="AppIpCfg_Column" >

View File

@@ -121,6 +121,7 @@
<result column="function_id" property="functionId" jdbcType="INTEGER" />
<result column="cfg_region_code" property="cfgRegionCode" jdbcType="INTEGER" />
<result column="cfg_type" property="cfgType" jdbcType="VARCHAR" />
<result column="do_log" property="doLog" jdbcType="INTEGER" />
</resultMap>
<resultMap id="stringCfgMap" type="com.nis.domain.configuration.BaseStringCfg" >
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
@@ -187,7 +188,7 @@
<sql id="DigestCfg_Column" >
a.CFG_ID,a.CFG_DESC,a.raw_len,a.digest,a.cfds_level,a.file_url,a.ACTION,a.IS_VALID,a.IS_AUDIT,
a.CREATOR_ID,a.CREATE_TIME,a.EDITOR_ID,a.EDIT_TIME,a.AUDITOR_ID,a.AUDIT_TIME,
a.SERVICE_ID,a.REQUEST_ID,a.COMPILE_ID,a.IS_AREA_EFFECTIVE,a.CLASSIFY,
a.SERVICE_ID,a.REQUEST_ID,a.COMPILE_ID,a.IS_AREA_EFFECTIVE,a.CLASSIFY,a.DO_LOG,
a.ATTRIBUTE,a.LABLE,a.AREA_EFFECTIVE_IDS,a.function_id,cfg_type,cfg_region_code
</sql>
<select id="getFtpList" resultMap="CfgIndexInfoMap" parameterType="com.nis.domain.configuration.CfgIndexInfo" >
@@ -1225,6 +1226,9 @@
</if>
<if test="fileUrl != null and fileUrl != ''">
FILE_URL =#{fileUrl,jdbcType=VARCHAR},
</if>
<if test="doLog != null">
do_log =#{doLog,jdbcType=INTEGER},
</if>
</trim>
</set>

View File

@@ -581,7 +581,8 @@
function_id,
cfg_type,
cfg_region_code,
file_url
file_url,
do_log
)values (
#{cfgDesc,jdbcType=VARCHAR},
#{rawLen,jdbcType=BIGINT},
@@ -607,7 +608,8 @@
#{functionId,jdbcType=INTEGER},
#{cfgType,jdbcType=VARCHAR},
#{cfgRegionCode,jdbcType=INTEGER},
#{fileUrl,jdbcType=VARCHAR}
#{fileUrl,jdbcType=VARCHAR},
#{doLog,jdbcType=VARCHAR}
)
</insert>
<!-- 删除mail ip子配置 -->

View File

@@ -402,12 +402,16 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
}
entity.setCompileId(compileId);
entity.setCreatorId(entity.getCurrentUser().getId());
if(result!=null && result.getData()!=null){
entity.setRawLen(result.getData().getRawLen());
entity.setDigest(result.getData().getDigest());
Long rawLen = result.getData().getRawLen();
String digest = result.getData().getDigest();
if((result!=null && result.getData()!=null) && (rawLen != null && digest!= null)){
entity.setRawLen(rawLen);
entity.setDigest(digest);
entity.setFileUrl(result.getData().getAccessUrl());
}
}else {
logger.info("获取文件摘要属性有误");
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+null);
}
mailCfgDao.saveMailFileDigestCfg(entity);
//保存区域IP信息
@@ -619,11 +623,16 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
// 设置区域运营商信息
setAreaEffectiveIds(entity);
if(entity.getCfgId()==null){
Integer compileId = 0;
try {
List<Integer> idList = ConfigServiceUtil.getId(1, 1);
if(idList!=null && idList.size()>0){
compileId = idList.get(0);
Integer compileId = 0;
try {
List<Integer> idList = ConfigServiceUtil.getId(1, 1);
if(idList!=null && idList.size()>0){
compileId = idList.get(0);
}
} catch (Exception e) {
e.printStackTrace();
logger.info("获取编译ID出错");
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
}
entity.setCompileId(compileId);
entity.setCreateTime(new Date());
@@ -674,11 +683,7 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
} catch (Exception e) {
e.printStackTrace();
logger.info("获取编译ID出错");
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
}
}else{
// 审核未通过状态的配置 修改后状态改为未审核

View File

@@ -0,0 +1,2 @@
UPDATE function_service_dict SET is_valid=0 WHERE service_id IN (1057,1058)
UPDATE sys_menu SET del_flag=0 WHERE function_id IN (302,303)

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"));
@@ -191,6 +188,26 @@ var delContent = function(contentClassName, addBtnClassName) {
</div>
</div>
</div>
<!-- doLog -->
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><spring:message code="do_log" /></label>
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
<c:choose>
<c:when test="${dict.itemCode eq _cfg.doLog}">
<label class="radio-inline">
<input type="radio" name="doLog" checked value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</label>
</c:when>
<c:otherwise>
<label class="radio-inline">
<input type="radio" name="doLog" value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</label>
</c:otherwise>
</c:choose>
</c:forEach>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">

View File

@@ -10,6 +10,8 @@
//搜索框提示语初始化
if("${cfg.cfgDesc}"){
$("#intype").val("${cfg.cfgDesc}");
}else if("${cfg.compileId}"){
$("#intype").val("${cfg.compileId}");
}else{
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
}
@@ -142,6 +144,7 @@
<form:select path="seltype" class="selectpicker select2 input-small" >
<form:option value="cfgDesc"><spring:message code="config_describe"></spring:message></form:option>
<form:option value="compileId"><spring:message code="cfg_id"></spring:message></form:option>
</form:select>
</div>
@@ -321,6 +324,7 @@
<th><spring:message code="classification"/></th>
<th><spring:message code="attribute"/></th>
<th><spring:message code="label"/></th>
<th><spring:message code="do_log"/></th>
<th><spring:message code="valid_identifier"/></th>
<th><spring:message code="is_audit"/></th>
<th><spring:message code="log_total"/></th>
@@ -417,6 +421,13 @@
${fns:abbr(lableInfo,20)}
</a>
</td>
<td>
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
<c:if test="${dict.itemCode eq cfg.doLog }">
<spring:message code="${dict.itemValue }"/>
</c:if>
</c:forEach>
</td>
<td>
<c:if test="${cfg.isValid==0}"><spring:message code="no"/></c:if>
<c:if test="${cfg.isValid==1}"><spring:message code="yes"/></c:if>

View File

@@ -4,163 +4,211 @@
<head>
<title><spring:message code="${cfgName}"></spring:message></title>
<script type="text/javascript">
$(function(){
$("#uploadSrc,#fileInfo").on('click',function(){
$("#file").trigger("click");
$(function() {
$("#uploadSrc,#fileInfo").on('click', function() {
$("#file").trigger("click");
});
$("#file").on('change', function() {
$("#fileInfo").val($("#file").val());
});
$(".action").on("change", function() {
$("#serviceId").val($(this).attr("serviceId"));
});
$("#serviceId").val($(".action:checked").attr("serviceId"));
$("#cfgFrom").validate(
{
submitHandler : function(form) {
/* var srcFile = $("#srcFile").val();
var srcUrl = $("#srcUrl").val();
if((srcUrl==null||srcUrl=="") && (srcFile==null || srcFile=="")){
$("div[for='srcFile']").append("<label id='level-error' class='error' for='srcFile'><spring:message code='required'></spring:message></label>");
return false;
}else{
} */
loading('onloading...');
form.submit();
},
errorContainer : "#messageBox",
errorPlacement : function(error, element) {
$(element).parents(".form-group").find(
"div[for='" + element.attr("name") + "']")
.append(error);
},
});
});
$("#file").on('change',function(){
$("#fileInfo").val($("#file").val());
});
$(".action").on("change",function(){
$("#serviceId").val($(this).attr("serviceId"));
});
$("#serviceId").val($(".action:checked").attr("serviceId"));
$("#cfgFrom").validate({
submitHandler: function(form){
/* var srcFile = $("#srcFile").val();
var srcUrl = $("#srcUrl").val();
if((srcUrl==null||srcUrl=="") && (srcFile==null || srcFile=="")){
$("div[for='srcFile']").append("<label id='level-error' class='error' for='srcFile'><spring:message code='required'></spring:message></label>");
return false;
}else{
} */
loading('onloading...');
form.submit();
},
errorContainer: "#messageBox",
errorPlacement: function(error,element){
$(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error);
},
});
});
</script>
</head>
<body>
<div class="page-content">
<div class="page-content">
<h3 class="page-title">
<spring:message code="file_digest_control"></spring:message>
</h3>
<div class="row">
<div class="col-md-12">
<div class="portlet box blue">
<div class="portlet-title">
<div class="caption">
<i class="fa fa-gift"></i>
<c:if test="${empty _cfg.cfgId}"><spring:message code="add"></spring:message></c:if>
<c:if test="${not empty _cfg.cfgId}"><spring:message code="edit"></spring:message></c:if>
<h3 class="page-title">
<spring:message code="file_digest_control"></spring:message>
</h3>
<div class="row">
<div class="col-md-12">
<div class="portlet box blue">
<div class="portlet-title">
<div class="caption">
<i class="fa fa-gift"></i>
<c:if test="${empty _cfg.cfgId}">
<spring:message code="add"></spring:message>
</c:if>
<c:if test="${not empty _cfg.cfgId}">
<spring:message code="edit"></spring:message>
</c:if>
</div>
</div>
</div>
<div class="portlet-body form">
<!-- BEGIN FORM-->
<form id="cfgFrom" action="${ctx}/ntc/fileTransfer/saveFileDigestCfg" enctype="multipart/form-data" method="post" class="form-horizontal">
<input type="hidden" name="cfgId" value="${_cfg.cfgId}">
<input type="hidden" name="compileId" value="${_cfg.compileId}">
<input type="hidden" name="functionId" value="${_cfg.functionId}">
<input type="hidden" id="serviceId" name="serviceId" value="${_cfg.serviceId}">
<!-- 配置域类型 -->
<c:forEach items="${regionList}" var="region">
<c:if test="${_cfg.functionId eq region.functionId}">
<input type="hidden" name="cfgType" value="${region.configRegionValue}">
<input type="hidden" name="cfgRegionCode" value="${region.configRegionCode}">
</c:if>
</c:forEach>
<div class="form-body">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><spring:message code="config_describe"/></label>
<div class="col-md-6">
<input class="form-control" type="text" name="cfgDesc" value="${_cfg.cfgDesc}">
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="action"/></label>
<div class="col-md-6">
<c:forEach items="${serviceList}" var="service"
varStatus="satus">
<label class="radio-inline"> <c:if
test="${_cfg.functionId eq service.functionId}">
<input type="radio" name="action"
serviceId="${service.serviceId }"
protocolId="${service.protocolId }"
value="${service.action }" class="required action"
<c:if test="${_cfg.action==service.action || (_cfg.action==null && satus.index==0)}">checked</c:if>>
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">
<c:if test="${dict.itemCode eq service.action }">
<spring:message code="${dict.itemValue }"/>
</c:if>
</c:forEach>
</c:if>
</label>
</c:forEach>
</div>
<div for="action"></div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font>
<spring:message code="file" /></label>
<div class="col-md-6">
<input id="file" name="file" type="file" style="width: 330px;display:none" />
<div class="portlet-body form">
<!-- BEGIN FORM-->
<form id="cfgFrom"
action="${ctx}/ntc/fileTransfer/saveFileDigestCfg"
enctype="multipart/form-data" method="post"
class="form-horizontal">
<input type="hidden" name="cfgId" value="${_cfg.cfgId}">
<input type="hidden" name="compileId" value="${_cfg.compileId}">
<input type="hidden" name="functionId" value="${_cfg.functionId}">
<input type="hidden" id="serviceId" name="serviceId"
value="${_cfg.serviceId}">
<!-- 配置域类型 -->
<c:forEach items="${regionList}" var="region">
<c:if test="${_cfg.functionId eq region.functionId}">
<input type="hidden" name="cfgType"
value="${region.configRegionValue}">
<input type="hidden" name="cfgRegionCode"
value="${region.configRegionCode}">
</c:if>
</c:forEach>
<div class="form-body">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><spring:message
code="config_describe" /></label>
<div class="col-md-6">
<input class="form-control" type="text" name="cfgDesc"
value="${_cfg.cfgDesc}">
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font
color="red">*</font>
<spring:message code="action" /></label>
<div class="col-md-6">
<c:forEach items="${serviceList}" var="service"
varStatus="satus">
<label class="radio-inline"> <c:if
test="${_cfg.functionId eq service.functionId}">
<input type="radio" name="action"
serviceId="${service.serviceId }"
protocolId="${service.protocolId }"
value="${service.action }" class="required action"
<c:if test="${_cfg.action==service.action || (_cfg.action==null && satus.index==0)}">checked</c:if>>
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }"
var="dict">
<c:if test="${dict.itemCode eq service.action }">
<spring:message code="${dict.itemValue }" />
</c:if>
</c:forEach>
</c:if>
</label>
</c:forEach>
</div>
<div for="action"></div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font
color="red">*</font> <spring:message code="file" /></label>
<div class="col-md-6">
<input id="file" name="file" type="file"
style="width: 330px; display: none" />
<div class="input-group">
<input id="fileInfo" name="fileInfo" readonly="readonly" data-msg-required=""
placeholder="<spring:message code="select_file"/>" class="required form-control" style=" background-color:transparent"
aria-required="true" type="text" value="${_cfg.digest }">
<input id="fileInfo" name="fileInfo" readonly="readonly"
data-msg-required=""
placeholder="<spring:message code="select_file"/>"
class="required form-control"
style="background-color: transparent" aria-required="true"
type="text" value="${_cfg.digest }">
<div class="input-group-btn">
<a id="uploadSrc" class="btn btn-default btn-search" href="javascript:" style=""><i class="fa fa-search"></i></a>
<a id="uploadSrc" class="btn btn-default btn-search"
href="javascript:" style=""><i class="fa fa-search"></i></a>
</div>
</div>
<input id="rawLen" name="rawLen" type="hidden" value="${_cfg.rawLen }"/>
</div>
<input id="rawLen" name="rawLen" type="hidden"
value="${_cfg.rawLen }" />
</div>
<div for="fileInfo"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font
color="red">*</font> <spring:message code="cfds_level" /></label>
<div class="col-md-6">
<input class="form-control required digits" type="text"
range="[1,10]" name="cfdsLevel" value="${_cfg.cfdsLevel}">
</div>
<div for="cfdsLevel"></div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><spring:message code="do_log" /></label>
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
<c:choose>
<c:when test="${dict.itemCode eq _cfg.doLog}">
<label class="radio-inline">
<input type="radio" name="doLog" checked value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</label>
</c:when>
<c:otherwise>
<label class="radio-inline">
<input type="radio" name="doLog" value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</label>
</c:otherwise>
</c:choose>
</c:forEach>
</div>
<div for="fileInfo"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font>
<spring:message code="cfds_level" /></label>
<div class="col-md-6">
<input class="form-control required digits" type="text" range="[1,10]"
name="cfdsLevel"
value="${_cfg.cfdsLevel}">
</div>
<div for="cfdsLevel"></div>
</div>
</div>
<%@include file="/WEB-INF/include/form/areaInfo.jsp"%>
<%@include file="/WEB-INF/include/form/basicInfo.jsp"%>
</div>
<%@include file="/WEB-INF/include/form/areaInfo.jsp" %>
<%@include file="/WEB-INF/include/form/basicInfo.jsp" %>
</div>
<div class="form-actions">
<div class="row">
<div class="col-md-6">
<div class="row">
<div class="col-md-offset-3 col-md-8">
<button id="save" type="submit" class="btn green"><spring:message code="submit"/></button>
<button id="cancel" type="button" class="btn default"><spring:message code="cancel"/></button>
</div>
</div>
</div>
<div class="col-md-6"> </div>
</div>
</div>
</form>
<!-- END FORM-->
</div>
</div>
<div class="form-actions">
<div class="row">
<div class="col-md-6">
<div class="row">
<div class="col-md-offset-3 col-md-8">
<button id="save" type="submit" class="btn green">
<spring:message code="submit" />
</button>
<button id="cancel" type="button" class="btn default">
<spring:message code="cancel" />
</button>
</div>
</div>
</div>
<div class="col-md-6"></div>
</div>
</div>
</form>
<!-- END FORM-->
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@@ -12,6 +12,8 @@
$("#intype").val("${cfg.cfgDesc}");
}else if("${cfg.cfdsLevel}"){
$("#intype").val("${cfg.cfdsLevel}");
}else if("${cfg.compileId}"){
$("#intype").val("${cfg.compileId}");
}else{
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
}
@@ -59,7 +61,6 @@
<div class="portlet">
<div class="portlet-body">
<div class="row" >
<sys:message content="${message}"/>
<form:form id="searchForm" modelAttribute="cfg" action="${ctx}/ntc/fileTransfer/fileDigestList?functionId=${cfg.functionId}" method="post" class="form-search">
<input id="functionId" name="functionId" type="hidden" value="${cfg.functionId}"/>
<input id="audit" name="audit" type="hidden" value="${audit}"/>
@@ -89,6 +90,7 @@
<form:select path="seltype" class="selectpicker select2 input-small" >
<form:option value="cfgDesc"><spring:message code="config_describe"></spring:message></form:option>
<form:option value="compileId"><spring:message code="cfg_id"></spring:message></form:option>
<form:option value="cfdsLevel"><spring:message code="cfds_level"/></form:option>
</form:select>
@@ -271,6 +273,7 @@
<th><spring:message code="classification"/></th>
<th><spring:message code="attribute"/></th>
<th><spring:message code="label"/></th>
<th><spring:message code="do_log"/></th>
<th><spring:message code="valid_identifier"/></th>
<th><spring:message code="is_audit"/></th>
<th><spring:message code="log_total"/></th>
@@ -377,6 +380,13 @@
${fns:abbr(lableInfo,20)}
</a>
</td>
<td>
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
<c:if test="${dict.itemCode eq indexCfg.doLog }">
<spring:message code="${dict.itemValue }"/>
</c:if>
</c:forEach>
</td>
<td>
<c:if test="${indexCfg.isValid==0}"><spring:message code="no"/></c:if>
<c:if test="${indexCfg.isValid==1}"><spring:message code="yes"/></c:if>

View File

@@ -9,6 +9,8 @@
//搜索框提示语初始化
if("${cfg.cfgDesc}"){
$("#intype").val("${cfg.cfgDesc}");
}else if("${cfg.compileId}"){
$("#intype").val("${cfg.compileId}");
}else{
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
}
@@ -131,10 +133,7 @@
<form:select path="seltype" class="selectpicker select2 input-small" >
<form:option value="cfgDesc"><spring:message code="config_describe"></spring:message></form:option>
<%-- <form:option value="voipIp.srcIpAddress"><spring:message code="client_ip"/></form:option>
<form:option value="voipIp.srcPort"><spring:message code="client_port"/></form:option>
<form:option value="voipAccount.cfgKeywords"><spring:message code="key_word"/></form:option>
<form:option value="voipAccount.district"><spring:message code="strong_string"/></form:option> --%>
<form:option value="compileId"><spring:message code="cfg_id"></spring:message></form:option>
</form:select>
</div>