多域表单替换配置说明,替换为servic_config_info的table_desc字段,该字段需要修改为I18N的code

This commit is contained in:
wangxin
2018-04-03 16:33:25 +08:00
parent f5a7708fa9
commit 85ef87ec6e
10 changed files with 132 additions and 25 deletions

View File

@@ -29,6 +29,7 @@ public class MultipleCfg extends BaseCfg<MultipleCfg> {
private static final long serialVersionUID = -8369567908781421920L;
private String mainTable;
private String mainTableType;
private String mainTableDesc;
private List<TableBean> otherTables;//key 表名value 类型
// private BaseCfg mainCfg;
//ip配置
@@ -153,4 +154,18 @@ public class MultipleCfg extends BaseCfg<MultipleCfg> {
public void setOtherTables(List<TableBean> otherTables) {
this.otherTables = otherTables;
}
/**
* mainTableDesc
* @return mainTableDesc
*/
public String getMainTableDesc() {
return mainTableDesc;
}
/**
* @param mainTableDesc the mainTableDesc to set
*/
public void setMainTableDesc(String mainTableDesc) {
this.mainTableDesc = mainTableDesc;
}
}

View File

@@ -28,6 +28,7 @@ public class MultipleSearchCfg extends BaseCfg<MultipleSearchCfg> {
private static final long serialVersionUID = -8369567908781421920L;
private String mainTable;//主表名
private String mainTableType;//主表类型
private String mainTableDesc;//主表类型
private String ipTable;//查询条件IP表名界面限制查询条件除了共用属性之外只能查一个条件
private String stringTable;//查询条件字符串表名,界面限制查询条件除了共用属性之外只能查一个条件
private String complexTable;//查询条件增强字符串串表名,界面限制查询条件除了共用属性之外只能查一个条件
@@ -196,5 +197,18 @@ public class MultipleSearchCfg extends BaseCfg<MultipleSearchCfg> {
public void setComplexTable(String complexTable) {
this.complexTable = complexTable;
}
/**
* mainTableDesc
* @return mainTableDesc
*/
public String getMainTableDesc() {
return mainTableDesc;
}
/**
* @param mainTableDesc the mainTableDesc to set
*/
public void setMainTableDesc(String mainTableDesc) {
this.mainTableDesc = mainTableDesc;
}
}

View File

@@ -27,13 +27,15 @@ public class TableBean implements Serializable{
private static final long serialVersionUID = -7276874824312210708L;
private String tableName;
private String tableType;
private String tableDesc;
private boolean canEmpty;
public TableBean(){
}
public TableBean(String tableName,String tableType){
public TableBean(String tableName,String tableType,String tableDesc){
this.tableName=tableName;
this.tableType=tableType;
this.tableDesc=tableDesc;
}
/**
* tableName
@@ -77,4 +79,19 @@ public class TableBean implements Serializable{
public void setCanEmpty(boolean canEmpty) {
this.canEmpty = canEmpty;
}
/**
* tableDesc
* @return tableDesc
*/
public String getTableDesc() {
return tableDesc;
}
/**
* @param tableDesc the tableDesc to set
*/
public void setTableDesc(String tableDesc) {
this.tableDesc = tableDesc;
}
}

View File

@@ -5,7 +5,18 @@ import java.util.Date;
import com.google.gson.GsonBuilder;
public final class Constants {
/**
* 字典表地域运营商
*/
public static final int ITEM_TYPE_AREA = 1;
public static final int ITEM_TYPE_ISP = 2;
/**
* action值
*/
public static final int ACTION_DF = 1;
public static final int ACTION_DJ = 2;
public static final int ACTION_BMD = 5;
public static final int ACTION_HMD = 8;
public static final int CFG_PAGE = 0;
public static final int AUDIT_PAGE = 1;
public static final String DEFAULT_CAPTCHA_PARAM = "captcha";

View File

@@ -20,7 +20,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import com.nis.domain.Page;
import com.nis.domain.ServiceConfigInfo;
import com.nis.domain.basics.ServiceDictInfo;
import com.nis.domain.basics.SysDictInfo;
import com.nis.domain.configuration.BaseCfg;
import com.nis.domain.configuration.BaseIpCfg;
import com.nis.domain.configuration.BaseStringCfg;
@@ -93,7 +92,9 @@ public class MultipleCfgController extends BaseController{
String tableName=info.getTableName();
if(mainTable.equals(tableName)){
model.addAttribute("mainTableType", String.valueOf(info.getTableType()));
model.addAttribute("mainTableDesc", info.getTableDesc());
cfg.setMainTableType(String.valueOf(type));
cfg.setMainTableDesc(info.getTableDesc());
if(Constants.TABLE_TYPE_COMPLEX==type){//增强字符串类型
ComplexkeywordCfg _cfg=cfg.getComplexCfg()==null?new ComplexkeywordCfg():cfg.getComplexCfg();
_cfg.setTableName(mainTable);
@@ -209,7 +210,7 @@ public class MultipleCfgController extends BaseController{
}
for(ServiceConfigInfo info:serviceConfigInfos){
int type=info.getTableType();
TableBean tableBean=new TableBean(info.getTableName(),String.valueOf(type));
TableBean tableBean=new TableBean(info.getTableName(),String.valueOf(type),info.getTableDesc());
if(!mainTable.equals(info.getTableName())){
otherTables.add(tableBean);
if(Constants.TABLE_TYPE_COMPLEX==type){//增强字符串类型
@@ -347,7 +348,7 @@ public class MultipleCfgController extends BaseController{
}else{
for(ServiceConfigInfo info:serviceConfigInfos){
int type=info.getTableType();
TableBean tableBean=new TableBean(info.getTableName(),String.valueOf(type));
TableBean tableBean=new TableBean(info.getTableName(),String.valueOf(type),info.getTableDesc());
if(!mainTable.equals(info.getTableName())){
otherTables.add(tableBean);
}
@@ -356,6 +357,7 @@ public class MultipleCfgController extends BaseController{
}
}
model.addAttribute("mainTableType", cfg.getMainTableType());
model.addAttribute("mainTableDesc", cfg.getMainTableDesc());
model.addAttribute("action", cfg.getAction());
model.addAttribute("page", resultPage);
List<RequestInfo> requestInfos=requestInfoService.getAllRequestInfo();
@@ -386,10 +388,12 @@ public class MultipleCfgController extends BaseController{
cfg.setOtherTables(otherTables);
for(ServiceConfigInfo info:serviceConfigInfos){
int type=info.getTableType();
TableBean tableBean=new TableBean(info.getTableName(), String.valueOf(type));
TableBean tableBean=new TableBean(info.getTableName(), String.valueOf(type),info.getTableDesc());
if(mainTable.equals(info.getTableName())){
cfg.setMainTableType(String.valueOf(type));
cfg.setMainTableDesc(info.getTableDesc());
model.addAttribute("mainTableType", String.valueOf(type));
model.addAttribute("mainTableDesc", info.getTableDesc());
}else{
otherTables.add(tableBean);
}
@@ -467,7 +471,9 @@ public class MultipleCfgController extends BaseController{
resultCfg.setMainTable(mainTable);
String mainTableType=cfg.getMainTableType();
model.addAttribute("mainTableType", mainTableType);
model.addAttribute("mainTableDesc", cfg.getMainTableDesc());
resultCfg.setMainTableType(mainTableType);
resultCfg.setMainTableDesc(cfg.getMainTableDesc());
resultCfg.setAction(cfg.getAction());
int serviceId=cfg.getServiceId();
cfg.setServiceId(serviceId);
@@ -480,7 +486,7 @@ public class MultipleCfgController extends BaseController{
String tableName=info.getTableName();
int type=info.getTableType();
if(!tableName.equals(mainTable)){
TableBean bean=new TableBean(tableName,String.valueOf(type));
TableBean bean=new TableBean(tableName,String.valueOf(type),info.getTableDesc());
if(Constants.TABLE_TYPE_IP==type){
bean.setCanEmpty(true);
}
@@ -603,7 +609,9 @@ public class MultipleCfgController extends BaseController{
resultCfg.setMainTable(mainTable);
String mainTableType=cfg.getMainTableType();
model.addAttribute("mainTableType", mainTableType);
model.addAttribute("mainTableDesc", cfg.getMainTableDesc());
resultCfg.setMainTableType(mainTableType);
resultCfg.setMainTableDesc(cfg.getMainTableDesc());
resultCfg.setAction(cfg.getAction());
int serviceId=cfg.getServiceId();
cfg.setServiceId(serviceId);
@@ -843,6 +851,7 @@ public class MultipleCfgController extends BaseController{
String tableName=info.getTableName();
if(cfg.getMainTable().equals(tableName)){
model.addAttribute("mainTableType", String.valueOf(type));
model.addAttribute("mainTableDesc", info.getTableDesc());
}
if(Constants.TABLE_TYPE_IP==type){
BaseIpCfg searchIpCfg=new BaseIpCfg();

View File

@@ -13,7 +13,17 @@ $(function(){
}
})
</script>
<h3 class="form-section">增强字符串<spring:message code="block_config"/><!-- <small><span class="glyphicon glyphicon-chevron-down" data-toggle="collapse" data-target=".complexCfg" title="add"></span></small> --></h3>
<h3 class="form-section">
<c:choose>
<c:when test="${mainTableType eq '4' and otherTable==null}">
<spring:message code="${mainTableDesc}"/>
</c:when>
<c:when test="${otherTable!=null and otherTable.tableType eq '4'}">
<spring:message code="${otherTable.tableDesc}"/>
</c:when>
<c:otherwise>增强字符串<spring:message code="block_config"/></c:otherwise>
</c:choose>
<!-- <small><span class="glyphicon glyphicon-chevron-down" data-toggle="collapse" data-target=".complexCfg" title="add"></span></small> --></h3>
<div class="row complexCfg">
<div class="col-md-6">
<div class="form-group">

View File

@@ -3,7 +3,17 @@
<style>
</style>
<h3 class="form-section">IP<spring:message code="block_config"/><small><span style="margin-left:10px"><input type="checkbox" id="ipSelect"/> 可选</span><!-- <span class="glyphicon glyphicon-plus" data-toggle="collapse" data-target=".ipCfg" title="add"></span> --></small></h3>
<h3 class="form-section">
<c:choose>
<c:when test="${mainTableType eq '1' and otherTable==null}">
<spring:message code="${mainTableDesc}"/>
</c:when>
<c:when test="${otherTable!=null and otherTable.tableType eq '1'}">
<spring:message code="${otherTable.tableDesc}"/>
</c:when>
<c:otherwise>IP<spring:message code="block_config"/></c:otherwise>
</c:choose>
<small><span style="margin-left:10px"><input type="checkbox" id="ipSelect"/> 可选</span><!-- <span class="glyphicon glyphicon-plus" data-toggle="collapse" data-target=".ipCfg" title="add"></span> --></small></h3>
<div class="row ipCfg collapse">
<div class="col-md-6">
<div class="form-group">

View File

@@ -1,6 +1,16 @@
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/include/taglib.jsp"%>
<h3 class="form-section">数值<spring:message code="block_config"/><small><span class="glyphicon glyphicon-chevron-down" data-toggle="collapse" data-target=".numCfg" title="add"></span></small></h3>
<h3 class="form-section">
<c:choose>
<c:when test="${mainTableType eq '3' and otherTable==null}">
<spring:message code="${mainTableDesc}"/>
</c:when>
<c:when test="${otherTable!=null and otherTable.tableType eq '3'}">
<spring:message code="${otherTable.tableDesc}"/>
</c:when>
<c:otherwise>数值<spring:message code="block_config"/></c:otherwise>
</c:choose>
<small><span class="glyphicon glyphicon-chevron-down" data-toggle="collapse" data-target=".numCfg" title="add"></span></small></h3>
<div class="row numCfg collapse">
<div class="col-md-6">
<div class="form-group">

View File

@@ -1,6 +1,16 @@
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/include/taglib.jsp"%>
<h3 class="form-section">字符串<spring:message code="block_config"/><!-- <small><span class="glyphicon glyphicon-chevron-down" data-toggle="collapse" data-target=".stringCfg" title="add"></span></small> --></h3>
<h3 class="form-section">
<c:choose>
<c:when test="${mainTableType eq '2' and otherTable==null}">
<spring:message code="${mainTableDesc}"/>
</c:when>
<c:when test="${otherTable!=null and otherTable.tableType eq '2'}">
<spring:message code="${otherTable.tableDesc}"/>
</c:when>
<c:otherwise>字符串<spring:message code="block_config"/></c:otherwise>
</c:choose>
<!-- <small><span class="glyphicon glyphicon-chevron-down" data-toggle="collapse" data-target=".stringCfg" title="add"></span></small> --></h3>
<div class="row stringCfg">
<div class="col-md-6">
<div class="form-group">

View File

@@ -72,6 +72,7 @@
<form:form id="searchForm" modelAttribute="cfg" action="${ctx}/cfg/multiple/list" method="post" class="form-search">
<input id="mainTable" name="mainTable" type="hidden" value="${mainTable}"/>
<input id="mainTableType" name="mainTableType" type="hidden" value="${mainTableType}"/>
<input id="mainTableDesc" name="mainTableDesc" type="hidden" value="${mainTableDesc}"/>
<input id="cfgType" name="cfgType" type="hidden" value="${cfgType}"/>
<input id="cfgName" name="cfgName" type="hidden" value="${cfgName}"/>
<input id="action" name="action" type="hidden" value="${action}"/>
@@ -269,24 +270,24 @@
<c:choose>
<%--增强字符串 --%>
<c:when test="${mainTableType eq '4'}">
<th>增强字符串<spring:message code="config_describe"/></th>
<th><spring:message code="${mainTableDesc}"/><spring:message code="config_describe"/></th>
<th><spring:message code="match_area"/></th>
<th><spring:message code="key_word"/></th>
</c:when>
<%--数值 --%>
<c:when test="${mainTableType eq '3'}">
<th><spring:message code="${mainTable}"/><spring:message code="config_describe"/></th>
<th><spring:message code="${mainTableDesc}"/><spring:message code="config_describe"/></th>
<th><spring:message code="数值下界"/></th>
<th><spring:message code="数值上界"/></th>
</c:when>
<%--字符串 --%>
<c:when test="${mainTableType eq '2'}">
<th>字符串<spring:message code="config_describe"/></th>
<th><spring:message code="${mainTableDesc}"/><spring:message code="config_describe"/></th>
<th><spring:message code="key_word"/></th>
</c:when>
<%--IP --%>
<c:when test="${mainTableType eq '1'}">
<th>ip<spring:message code="config_describe"/></th>
<th><spring:message code="${mainTableDesc}"/><spring:message code="config_describe"/></th>
<th>ip<spring:message code="type"/></th>
<th><spring:message code="client_ip"/></th>
<th><spring:message code="client_address_mask"/></th>
@@ -304,21 +305,21 @@
<%--遍历子表属性 --%>
<c:forEach items="${cfg.otherTables}" var="other" varStatus="status">
<c:if test="${other.tableType eq '4'}">
<th>增强字符串<spring:message code="config_describe"/></th>
<th><spring:message code="${other.tableDesc}"/><spring:message code="config_describe"/></th>
<th><spring:message code="match_area"/></th>
<th><spring:message code="key_word"/></th>
</c:if>
<c:if test="${other.tableType eq '3'}">
<th><spring:message code="${other.tableName}"/><spring:message code="config_describe"/></th>
<th><spring:message code="${other.tableDesc}"/><spring:message code="config_describe"/></th>
<th><spring:message code="数值下界"/></th>
<th><spring:message code="数值上界"/></th>
</c:if>
<c:if test="${other.tableType eq'2'}">
<th>字符串<spring:message code="config_describe"/></th>
<th><spring:message code="${other.tableDesc}"/><spring:message code="config_describe"/></th>
<th><spring:message code="key_word"/></th>
</c:if>
<c:if test="${other.tableType eq '1'}">
<th>ip<spring:message code="config_describe"/></th>
<th><spring:message code="${other.tableDesc}"/><spring:message code="config_describe"/></th>
<th>ip<spring:message code="type"/></th>
<th><spring:message code="client_ip"/></th>
<th><spring:message code="client_address_mask"/></th>
@@ -524,22 +525,22 @@
<c:if test="${audit==0}">
<c:choose>
<c:when test="${bean.isAudit eq '2'}">
<li><a href="${ctx}/cfg/multiple/updateForm?serviceId=${bean.serviceId}&action=${bean.action}&compileId=${bean.compileId}&cfgName=${cfgName}&mainTable=${mainTable}&mainTableType=${mainTableType}" onclick="javascript:return confirm('sure', this.href)"><spring:message code="edit"></spring:message></a></li>
<li><a href="${ctx}/cfg/multiple/updateForm?serviceId=${bean.serviceId}&action=${bean.action}&compileId=${bean.compileId}&cfgName=${cfgName}&mainTable=${mainTable}&mainTableType=${mainTableType}&mainTableDesc=${mainTableDesc}" onclick="javascript:return confirm('sure', this.href)"><spring:message code="edit"></spring:message></a></li>
</c:when>
<c:when test="${bean.isAudit eq '0'}">
<li><a href="${ctx}/cfg/multiple/updateForm?serviceId=${bean.serviceId}&action=${bean.action}&compileId=${bean.compileId}&cfgName=${cfgName}&mainTable=${mainTable}&mainTableType=${mainTableType}" onclick="javascript:return confirm('sure', this.href)"><spring:message code="edit"></spring:message></a></li>
<li><a href="${ctx}/cfg/multiple/deleteCfg?serviceId=${bean.serviceId}&action=${bean.action}&compileId=${bean.compileId}&cfgName=${cfgName}&mainTable=${mainTable}&mainTableType=${mainTableType}" onclick="return confirm('sure', this.href)"><spring:message code="delete"></spring:message></a></li>
<li><a href="${ctx}/cfg/multiple/updateForm?serviceId=${bean.serviceId}&action=${bean.action}&compileId=${bean.compileId}&cfgName=${cfgName}&mainTable=${mainTable}&mainTableType=${mainTableType}&mainTableDesc=${mainTableDesc}" onclick="javascript:return confirm('sure', this.href)"><spring:message code="edit"></spring:message></a></li>
<li><a href="${ctx}/cfg/multiple/deleteCfg?serviceId=${bean.serviceId}&action=${bean.action}&compileId=${bean.compileId}&cfgName=${cfgName}&mainTable=${mainTable}&mainTableType=${mainTableType}&mainTableDesc=${mainTableDesc}" onclick="return confirm('sure', this.href)"><spring:message code="delete"></spring:message></a></li>
</c:when>
</c:choose>
</c:if>
<c:if test="${audit==1}">
<c:choose>
<c:when test="${bean.isAudit eq '1'}">
<li><a href="${ctx}/cfg/multiple/auditCfg?serviceId=${bean.serviceId}&action=${bean.action}&compileId=${bean.compileId}&isAudit=3&cfgName=${cfgName}&mainTable=${mainTable}" onclick="return confirm('sure', this.href)"><spring:message code="cancel"></spring:message></a></li>
<li><a href="${ctx}/cfg/multiple/auditCfg?serviceId=${bean.serviceId}&action=${bean.action}&compileId=${bean.compileId}&isAudit=3&cfgName=${cfgName}&mainTable=${mainTable}&mainTableType=${mainTableType}&mainTableDesc=${mainTableDesc}" onclick="return confirm('sure', this.href)"><spring:message code="cancel"></spring:message></a></li>
</c:when>
<c:when test="${bean.isAudit eq '0'}">
<li><a href="${ctx}/cfg/multiple/auditCfg?serviceId=${bean.serviceId}&action=${bean.action}&compileId=${bean.compileId}&isAudit=1&cfgName=${cfgName}&mainTable=${mainTable}" onclick="return confirm('sure', this.href)"><spring:message code="approved"></spring:message></a></li>
<li><a href="${ctx}/cfg/multiple/auditCfg?serviceId=${bean.serviceId}&action=${bean.action}&compileId=${bean.compileId}&isAudit=2&cfgName=${cfgName}&mainTable=${mainTable}" onclick="return confirm('sure', this.href)"><spring:message code="unapproved"></spring:message></a></li>
<li><a href="${ctx}/cfg/multiple/auditCfg?serviceId=${bean.serviceId}&action=${bean.action}&compileId=${bean.compileId}&isAudit=1&cfgName=${cfgName}&mainTable=${mainTable}&mainTableType=${mainTableType}&mainTableDesc=${mainTableDesc}" onclick="return confirm('sure', this.href)"><spring:message code="approved"></spring:message></a></li>
<li><a href="${ctx}/cfg/multiple/auditCfg?serviceId=${bean.serviceId}&action=${bean.action}&compileId=${bean.compileId}&isAudit=2&cfgName=${cfgName}&mainTable=${mainTable}&mainTableType=${mainTableType}&mainTableDesc=${mainTableDesc}" onclick="return confirm('sure', this.href)"><spring:message code="unapproved"></spring:message></a></li>
</c:when>
</c:choose>
</c:if>