修改业务类型和表名是否对应的关系从tableservice.pro里面获取

This commit is contained in:
RenKaiGe-Office
2018-06-02 14:55:42 +08:00
parent ba4e1ec4ef
commit 226cab3796
4 changed files with 82 additions and 56 deletions

View File

@@ -74,7 +74,8 @@ public class CompileVal {
} }
// int sizeCount = 0; // int sizeCount = 0;
// if (configCompile.getIpRegionList() == null && configCompile.getStrRegionList() == null // if (configCompile.getIpRegionList() == null &&
// configCompile.getStrRegionList() == null
// && configCompile.getNumRegionList() == null) { // && configCompile.getNumRegionList() == null) {
// return "编译配置id为" + configCompile.getCompileId() + "的配置中" // return "编译配置id为" + configCompile.getCompileId() + "的配置中"
// + CompileJudgeCode.CompileNotNull.getErrorReason(); // + CompileJudgeCode.CompileNotNull.getErrorReason();
@@ -315,7 +316,6 @@ public class CompileVal {
// 不验证表名和业务类型是否对应 // 不验证表名和业务类型是否对应
if (!isUpdate && digestRegion.getIsValid() != 1) { if (!isUpdate && digestRegion.getIsValid() != 1) {
return "配置id为" + configCompile.getCompileId() + "的配置中digestRegionList中的regionid为" return "配置id为" + configCompile.getCompileId() + "的配置中digestRegionList中的regionid为"
+ digestRegion.getRegionId() + "的域配置在添加时不能为无效"; + digestRegion.getRegionId() + "的域配置在添加时不能为无效";
@@ -360,14 +360,19 @@ public class CompileVal {
*/ */
public static boolean type2TableNameIsOk(Integer serviceType, String tableName) { public static boolean type2TableNameIsOk(Integer serviceType, String tableName) {
if (null != serviceType && null != tableName && !tableName.equals("")) { if (null != serviceType && null != tableName && !tableName.equals("")) {
Map<Integer, Map<String, String>> tableRelation = ConfigSourcesService.getTableRelation(); List<String> list = new ArrayList<String>();
Map<String, String> map = tableRelation.get(serviceType.intValue()); Map<Integer, String> sercieNameMap = ServiceAndRDBIndexReal.getSercieNameMap().get(serviceType);
if (null != map) { if (sercieNameMap != null && sercieNameMap.size() > 0) {
if (map.containsKey(tableName.toUpperCase())) { for (Integer type : sercieNameMap.keySet()) {
return true; list.add(sercieNameMap.get(type).toLowerCase());
} else {
return false;
} }
}
// Map<Integer, Map<String, String>> tableRelation =
// ConfigSourcesService.getTableRelation();
// Map<String, String> map = tableRelation.get(serviceType.intValue());
if (list.contains(tableName.toLowerCase())) {
return true;
} else { } else {
return false; return false;
} }
@@ -639,12 +644,14 @@ public class CompileVal {
// zdx protocol验证 // zdx protocol验证
// if (ipRegion.getTableName().toLowerCase().equals("dj_ip_port")) { // if (ipRegion.getTableName().toLowerCase().equals("dj_ip_port")) {
// if (ipRegion.getProtocol() < 0 || ipRegion.getProtocol() > 255) { // if (ipRegion.getProtocol() < 0 || ipRegion.getProtocol() > 255) {
// return "编译配置id为" + compileId + "的配置中ipRegionList中regionId为" + ipRegion.getRegionId() // return "编译配置id为" + compileId + "的配置中ipRegionList中regionId为" +
// ipRegion.getRegionId()
// + "的域配置tableName为dj_ip_port时,protocol的取值范围只能是0-255"; // + "的域配置tableName为dj_ip_port时,protocol的取值范围只能是0-255";
// } // }
// } else { // } else {
// if (ipRegion.getProtocol() != 0) { // if (ipRegion.getProtocol() != 0) {
// return "编译配置id为" + compileId + "的配置中ipRegionList中regionId为" + ipRegion.getRegionId() + "的域配置tableName为" // return "编译配置id为" + compileId + "的配置中ipRegionList中regionId为" +
// ipRegion.getRegionId() + "的域配置tableName为"
// + ipRegion.getTableName() + "时,protocol的值只能是0"; // + ipRegion.getTableName() + "时,protocol的值只能是0";
// } // }
// //
@@ -718,7 +725,6 @@ public class CompileVal {
} }
public static String serviceDigestRegionVal(DigestRegion digestRegion, Long compileId) { public static String serviceDigestRegionVal(DigestRegion digestRegion, Long compileId) {
Integer cfdsLevel = digestRegion.getCfdsLevel(); Integer cfdsLevel = digestRegion.getCfdsLevel();
@@ -729,6 +735,7 @@ public class CompileVal {
return "ok"; return "ok";
} }
/** /**
* 禁配词业务校验 * 禁配词业务校验
* *

View File

@@ -1,7 +1,6 @@
package com.nis.util; package com.nis.util;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@@ -89,4 +88,24 @@ public class ServiceAndRDBIndexReal {
} }
} }
public static Map<Integer, Map<Integer, String>> getSercieNameMap() {
return sercieNameMap;
}
public static void setSercieNameMap(Map<Integer, Map<Integer, String>> sercieNameMap) {
ServiceAndRDBIndexReal.sercieNameMap = sercieNameMap;
}
public static Map<Integer, List<Integer>> getServiceDBIndexmap() {
return serviceDBIndexmap;
}
public static void setServiceDBIndexmap(Map<Integer, List<Integer>> serviceDBIndexmap) {
ServiceAndRDBIndexReal.serviceDBIndexmap = serviceDBIndexmap;
}
} }

View File

@@ -45,7 +45,7 @@
</p:expressions> </p:expressions>
</p:maatType> </p:maatType>
<p:maatType service="3;15;80;82;84;144;146;148"> <p:maatType service="3;1;80;82;84;144;146;148">
<p:expressions> <p:expressions>
<p:keyExpression>EFFECTIVE_RULE;:;{compile_table_name};,;[compile_id]</p:keyExpression> <p:keyExpression>EFFECTIVE_RULE;:;{compile_table_name};,;[compile_id]</p:keyExpression>
<p:valueExpression>[compile_id];\t;[service];\t;[action];\t;[do_blacklist];\t;[do_log];\t;[effective_range];\t;[user_region];\t;[is_valid];\t;[group_num];\t;[father_cfg_id];\t;[op_time]</p:valueExpression> <p:valueExpression>[compile_id];\t;[service];\t;[action];\t;[do_blacklist];\t;[do_log];\t;[effective_range];\t;[user_region];\t;[is_valid];\t;[group_num];\t;[father_cfg_id];\t;[op_time]</p:valueExpression>

View File

@@ -5,12 +5,12 @@
####3:例如:80=10:MM_COMPILE;11:MM_GROUP;12:AV_CONT_IP_PORT ####3:例如:80=10:MM_COMPILE;11:MM_GROUP;12:AV_CONT_IP_PORT
####4:type中10代表是编译配置,11代表是分组配置,12代表是ip类域配置,13代表是数值类配置,14代表是字符串类域配置,15代表是增强字符串类域配置,16代表是文件摘要类域配置,17代表是文本相似性域配置 ####4:type中10代表是编译配置,11代表是分组配置,12代表是ip类域配置,13代表是数值类配置,14代表是字符串类域配置,15代表是增强字符串类域配置,16代表是文件摘要类域配置,17代表是文本相似性域配置
################################################################################# #################################################################################
service=3;15;80;81;82;83;84;85;144;145;146;147;148;149 service=3;1;80;81;82;83;84;85;144;145;146;147;148;149
3=10:NTC_COMPILE;11:NTC_GROUP;12:NTC_UNIVERSAL_IP 3=10:NTC_COMPILE;11:NTC_GROUP;12:NTC_UNIVERSAL_IP
15=10:WHITE_LIST_COMPILE;11:WHITE_LIST_GROUP;12:WHITE_LIST_IP 1=10:WHITE_LIST_COMPILE;11:WHITE_LIST_GROUP;12:WHITE_LIST_IP
80=10:MM_COMPILE;11:MM_GROUP;12:MM_AV_IP 80=10:MM_COMPILE;11:MM_GROUP;12:MM_AV_IP
81=10:MM_COMPILE;11:MM_GROUP;14:MM_AV_URL 81=10:MM_COMPILE;11:MM_GROUP;14:MM_AV_URL
82=10:MM_COMPILE;11:MM_GROUP;12:MM_PIC_IP 82=10:MM_COMPILE;11:MM_GROUP;12:MM_PIC_IP
@@ -31,7 +31,7 @@ service=3;15;80;81;82;83;84;85;144;145;146;147;148;149
##各业务类型对应的redisdb,业务类型:redisdb,多个业务以“;”分隔,多个db以“,”数量不能超过6个 ##各业务类型对应的redisdb,业务类型:redisdb,多个业务以“;”分隔,多个db以“,”数量不能超过6个
serviceDBIndex=3:2,3;15:2;80:2;81:2;82:2;83:2;84:2;85:2;144:2;145:2;146:2;147:2;148:2;149:2;96:3;97:3;98:3;99:3;160:3,4;161:3;162:3;163:3;100:3;101:3;164:3;165:3 serviceDBIndex=3:2,3;1:2;80:2;81:2;82:2;83:2;84:2;85:2;144:2;145:2;146:2;147:2;148:2;149:2;96:3;97:3;98:3;99:3;160:3,4;161:3;162:3;163:3;100:3;101:3;164:3;165:3