Merge branch 'cherry-pick-6704549d' into 'develop'

Merge branch 'bugfix-20190123-import' into 'dev-ycx'

See merge request K18_NTCS_WEB/NTC!15
This commit is contained in:
董晓燕
2019-01-23 18:45:54 +08:00
11 changed files with 149 additions and 21 deletions

View File

@@ -496,7 +496,7 @@ public class ExportExcel {
commentStr=commentStr+""+msgProp.getProperty("required")+"\n";
index++;
}
if(("domain_name".equals(headerStr)) && (region.getFunctionId().equals(560))){
if("domain_name".equals(headerStr)){
commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n";
index++;
//1、非空
@@ -1113,9 +1113,9 @@ public class ExportExcel {
commentStr="";
}
if(StringUtil.isEmpty(defaultValue)){
defaultValue="0";
defaultValue = region.getConfigDirection().split(",")[0];
}
defaultValue = region.getFunctionId().equals(301)?"1":defaultValue;
}
/*}*/
/*if(StringUtil.isEmpty(commentStr)){

View File

@@ -45,6 +45,7 @@ public class CheckAppFeatureComplexStringFormatThread implements Callable<String
public String call() throws Exception {
List<Object> dataList=Lists.newArrayList(Constants.MAAT_JSON_SEND_SIZE);
StringBuffer msg=new StringBuffer();
boolean error = false;
while(!srcQueue.isEmpty()) {
int size=srcQueue.drainTo(dataList,Constants.MAAT_JSON_SEND_SIZE);
if(regionDict.getRegionType().intValue()==3) {
@@ -57,10 +58,15 @@ public class CheckAppFeatureComplexStringFormatThread implements Callable<String
//msg=e.getMessage();
//msg.append(e.getMessage());
//break;
error = true;
}
}
dataList.clear();
}
if(error) {
msg.append("validate_error");
}
return msg.toString();
}
public List<AppComplexFeatureCfg> checkAppComplexFeatureCfg(StringBuffer msg,

View File

@@ -45,6 +45,7 @@ public class CheckComplexStringFormatThread implements Callable<String>{
public String call() throws Exception {
List<Object> dataList=Lists.newArrayList(Constants.MAAT_JSON_SEND_SIZE);
StringBuffer msg=new StringBuffer();
boolean error = false;
while(!srcQueue.isEmpty()) {
int size=srcQueue.drainTo(dataList,Constants.MAAT_JSON_SEND_SIZE);
if(regionDict.getRegionType().intValue()==3) {
@@ -57,10 +58,15 @@ public class CheckComplexStringFormatThread implements Callable<String>{
//msg=e.getMessage();
//msg.append(e.getMessage());
//break;
error = true;
}
}
dataList.clear();
}
if(error) {
msg.append("validate_error");
}
return msg.toString();
}
public List<ComplexkeywordCfg> checkComplexStringCfg(StringBuffer msg,

View File

@@ -42,6 +42,7 @@ public class CheckDnsResStrategyFormatThread implements Callable<String>{
public String call() throws Exception {
List<Object> dataList=Lists.newArrayList(Constants.MAAT_JSON_SEND_SIZE);
StringBuffer msg=new StringBuffer();
boolean error = false;
while(!srcQueue.isEmpty()) {
int size=srcQueue.drainTo(dataList,Constants.MAAT_JSON_SEND_SIZE);
if(regionDict.getRegionType().intValue()==6) {
@@ -53,10 +54,15 @@ public class CheckDnsResStrategyFormatThread implements Callable<String>{
// TODO: handle exception
//msg=e.getMessage();
//break;
error = true;
}
}
dataList.clear();
}
if(error) {
msg.append("validate_error");
}
return msg.toString();
}
public List<DnsResStrategy> checkDnsResStrategyCfg(StringBuffer msg,List<?> list)

View File

@@ -51,6 +51,7 @@ public class CheckIpFormatThread implements Callable<String>{
public String call() throws Exception {
List<Object> dataList=Lists.newArrayList(Constants.MAAT_JSON_SEND_SIZE);
StringBuffer msg=new StringBuffer();
boolean error = false;
while(!srcQueue.isEmpty()) {
int size=srcQueue.drainTo(dataList,Constants.MAAT_JSON_SEND_SIZE);
if(regionDict.getRegionType().intValue()==1) {
@@ -63,10 +64,15 @@ public class CheckIpFormatThread implements Callable<String>{
// TODO: handle exception
//msg.append(e.getMessage());
//break;
error = true;
}
}
dataList.clear();
}
if(error) {
msg.append("validate_error");
}
return msg.toString();
}
public List<BaseIpCfg> checkIpCfg(StringBuffer msg,List<Map<Long,AsnGroupInfo>> asnNos, List<Object> list)

View File

@@ -44,6 +44,7 @@ public class CheckStringFormatThread implements Callable<String>{
public String call() throws Exception {
List<Object> dataList=Lists.newArrayList(Constants.MAAT_JSON_SEND_SIZE);
StringBuffer msg=new StringBuffer();
boolean error = false;
while(!srcQueue.isEmpty()) {
int size=srcQueue.drainTo(dataList,Constants.MAAT_JSON_SEND_SIZE);
if(regionDict.getRegionType().intValue()==2) {
@@ -55,10 +56,15 @@ public class CheckStringFormatThread implements Callable<String>{
// TODO: handle exception
//msg=e.getMessage();
//break;
error = true;
}
}
dataList.clear();
}
if(error) {
msg.append("validate_error");
}
return msg.toString();
}
@@ -84,7 +90,7 @@ public class CheckStringFormatThread implements Callable<String>{
}
StringBuffer errTip = new StringBuffer();
Pattern pattern = Pattern.compile("\t|\r|\n|\b|\f");
Pattern domainPattern = Pattern.compile(Constants.DOMAIN_REGEXP);
Pattern domainPattern = Pattern.compile("^[a-zA-Z0-9.-]*$");
for (int i = 0; i < list.size(); i++) {
StringBuffer errInfo = new StringBuffer();
BaseStringCfg baseStringCfg = new BaseStringCfg();

View File

@@ -47,6 +47,7 @@ public class CheckTopicWebsiteFormatThread implements Callable<String>{
public String call() throws Exception {
List<Object> dataList=Lists.newArrayList(Constants.MAAT_JSON_SEND_SIZE);
StringBuffer msg=new StringBuffer();
boolean error = false;
while(!srcQueue.isEmpty()) {
int size=srcQueue.drainTo(dataList,Constants.MAAT_JSON_SEND_SIZE);
if(regionDict.getRegionType().intValue()==2) {
@@ -58,10 +59,15 @@ public class CheckTopicWebsiteFormatThread implements Callable<String>{
// TODO: handle exception
//msg=e.getMessage();
//break;
error = true;
}
}
dataList.clear();
}
if(error) {
msg.append("validate_error");
}
return msg.toString();
}
@@ -87,7 +93,7 @@ public class CheckTopicWebsiteFormatThread implements Callable<String>{
}
StringBuffer errTip = new StringBuffer();
Pattern pattern = Pattern.compile("\t|\r|\n|\b|\f");
Pattern domainPattern = Pattern.compile(Constants.DOMAIN_REGEXP);
Pattern domainPattern = Pattern.compile("^[a-zA-Z0-9.-]*$");
for (int i = 0; i < list.size(); i++) {
StringBuffer errInfo = new StringBuffer();
AppTopicDomainCfg baseStringCfg = new AppTopicDomainCfg();

View File

@@ -963,8 +963,10 @@ public class BaseController {
BlockingQueue<BaseIpCfg> queue=new ArrayBlockingQueue<>(list.size());
ExecutorService service=Executors.newFixedThreadPool(Constants.MULITY_THREAD_SIZE);
List<Future<String>> futures=new ArrayList<>();
Properties props=this.getMsgProp();
for(int i=0;i<Constants.MULITY_THREAD_SIZE;i++) {
CheckIpFormatThread t=new CheckIpFormatThread(serviceDict,regionDict, this.getMsgProp(), list, queue);
CheckIpFormatThread t=new CheckIpFormatThread(serviceDict,regionDict, props, list, queue);
t.setAsnNoMaps(asnNos);
t.setAsnGroupInfos(asnGroupInfos);
futures.add(service.submit(t));
@@ -978,13 +980,26 @@ public class BaseController {
e.printStackTrace();
}
}
boolean valideteError=false;
for(Future<String> future:futures) {
String msg = future.get();
if(StringUtils.isNotBlank(msg)) {
if(msg.equals("validate_error")) {
valideteError=true;
}else if(msg.endsWith("validate_error")) {
_msg.append(msg.substring(0, msg.length()-1-"validate_error".length()));
valideteError=true;
}else {
_msg.append(msg);
}
//throw new ServiceException(msg);
_msg.append(msg);
}
}
if(valideteError) {
_msg.append(props.getProperty("validate_error", "Unexpected error occurred while validating"));
}
long end=System.currentTimeMillis();
logger.warn("checkIpCfgMulity finish,cost:"+(end-start)+",size:"+queue.size());
return queue;
@@ -1005,8 +1020,10 @@ public class BaseController {
BlockingQueue<BaseStringCfg<?>> queue=new ArrayBlockingQueue<>(list.size());
ExecutorService service=Executors.newFixedThreadPool(Constants.MULITY_THREAD_SIZE);
List<Future<String>> futures=new ArrayList<>();
Properties props=this.getMsgProp();
for(int i=0;i<Constants.MULITY_THREAD_SIZE;i++) {
CheckStringFormatThread t=new CheckStringFormatThread(serviceDict,regionDict, this.getMsgProp(), list, queue);
CheckStringFormatThread t=new CheckStringFormatThread(serviceDict,regionDict, props, list, queue);
futures.add(service.submit(t));
}
service.shutdown();
@@ -1018,13 +1035,26 @@ public class BaseController {
e.printStackTrace();
}
}
boolean valideteError=false;
for(Future<String> future:futures) {
String msg = future.get();
if(StringUtils.isNotBlank(msg)) {
if(msg.equals("validate_error")) {
valideteError=true;
}else if(msg.endsWith("validate_error")) {
_msg.append(msg.substring(0, msg.length()-1-"validate_error".length()));
valideteError=true;
}else {
_msg.append(msg);
}
//throw new ServiceException(msg);
_msg.append(msg);
}
}
if(valideteError) {
_msg.append(props.getProperty("validate_error", "Unexpected error occurred while validating"));
}
long end=System.currentTimeMillis();
logger.warn("checkStringCfgMulity finish,cost:"+(end-start)+",size:"+queue.size());
return queue;
@@ -1045,8 +1075,10 @@ public class BaseController {
BlockingQueue<ComplexkeywordCfg> queue=new ArrayBlockingQueue<>(list.size());
ExecutorService service=Executors.newFixedThreadPool(Constants.MULITY_THREAD_SIZE);
List<Future<String>> futures=new ArrayList<>();
Properties props=this.getMsgProp();
for(int i=0;i<Constants.MULITY_THREAD_SIZE;i++) {
CheckComplexStringFormatThread t=new CheckComplexStringFormatThread(serviceDict,regionDict, this.getMsgProp(), list, queue);
CheckComplexStringFormatThread t=new CheckComplexStringFormatThread(serviceDict,regionDict, props, list, queue);
futures.add(service.submit(t));
}
service.shutdown();
@@ -1058,13 +1090,26 @@ public class BaseController {
e.printStackTrace();
}
}
boolean valideteError=false;
for(Future<String> future:futures) {
String msg = future.get();
if(StringUtils.isNotBlank(msg)) {
if(msg.equals("validate_error")) {
valideteError=true;
}else if(msg.endsWith("validate_error")) {
_msg.append(msg.substring(0, msg.length()-1-"validate_error".length()));
valideteError=true;
}else {
_msg.append(msg);
}
//throw new ServiceException(msg);
_msg.append(msg);
}
}
if(valideteError) {
_msg.append(props.getProperty("validate_error", "Unexpected error occurred while validating"));
}
long end=System.currentTimeMillis();
logger.warn("checkComplexStringCfgMulity finish,cost:"+(end-start)+",size:"+queue.size());
return queue;
@@ -1085,8 +1130,10 @@ public class BaseController {
BlockingQueue<DnsResStrategy> queue=new ArrayBlockingQueue<>(list.size());
ExecutorService service=Executors.newFixedThreadPool(Constants.MULITY_THREAD_SIZE);
List<Future<String>> futures=new ArrayList<>();
Properties props=this.getMsgProp();
for(int i=0;i<Constants.MULITY_THREAD_SIZE;i++) {
CheckDnsResStrategyFormatThread t=new CheckDnsResStrategyFormatThread(serviceDict,regionDict, this.getMsgProp(), list, queue);
CheckDnsResStrategyFormatThread t=new CheckDnsResStrategyFormatThread(serviceDict,regionDict, props, list, queue);
futures.add(service.submit(t));
}
service.shutdown();
@@ -1098,13 +1145,26 @@ public class BaseController {
e.printStackTrace();
}
}
boolean valideteError=false;
for(Future<String> future:futures) {
String msg = future.get();
if(StringUtils.isNotBlank(msg)) {
_msg.append(msg);
if(msg.equals("validate_error")) {
valideteError=true;
}else if(msg.endsWith("validate_error")) {
_msg.append(msg.substring(0, msg.length()-1-"validate_error".length()));
valideteError=true;
}else {
_msg.append(msg);
}
//throw new ServiceException(msg);
}
}
if(valideteError) {
_msg.append(props.getProperty("validate_error", "Unexpected error occurred while validating"));
}
long end=System.currentTimeMillis();
logger.warn("checkDnsResStrategyCfgMulity finish,cost:"+(end-start)+",size:"+queue.size());
return queue;
@@ -1127,8 +1187,10 @@ public class BaseController {
BlockingQueue<AppComplexFeatureCfg> queue=new ArrayBlockingQueue<>(list.size());
ExecutorService service=Executors.newFixedThreadPool(Constants.MULITY_THREAD_SIZE);
List<Future<String>> futures=new ArrayList<>();
Properties props=this.getMsgProp();
for(int i=0;i<Constants.MULITY_THREAD_SIZE;i++) {
CheckAppFeatureComplexStringFormatThread t = new CheckAppFeatureComplexStringFormatThread(serviceDict,regionDict, this.getMsgProp(), list, queue);
CheckAppFeatureComplexStringFormatThread t=new CheckAppFeatureComplexStringFormatThread(serviceDict,regionDict, props, list, queue);
futures.add(service.submit(t));
}
service.shutdown();
@@ -1140,13 +1202,26 @@ public class BaseController {
e.printStackTrace();
}
}
boolean valideteError=false;
for(Future<String> future:futures) {
String msg = future.get();
if(StringUtils.isNotBlank(msg)) {
_msg.append(msg);
if(msg.equals("validate_error")) {
valideteError=true;
}else if(msg.endsWith("validate_error")) {
_msg.append(msg.substring(0, msg.length()-1-"validate_error".length()));
valideteError=true;
}else {
_msg.append(msg);
}
//throw new ServiceException(msg);
}
}
if(valideteError) {
_msg.append(props.getProperty("validate_error", "Unexpected error occurred while validating"));
}
long end=System.currentTimeMillis();
logger.warn("checkAppComplexFeatureStringCfgMulity finish,cost:"+(end-start)+",size:"+queue.size());
return queue;
@@ -1168,10 +1243,11 @@ public class BaseController {
BlockingQueue<AppTopicDomainCfg> queue=new ArrayBlockingQueue<>(list.size());
ExecutorService service=Executors.newFixedThreadPool(Constants.MULITY_THREAD_SIZE);
List<Future<String>> futures=new ArrayList<>();
Properties props=this.getMsgProp();
for(int i=0;i<Constants.MULITY_THREAD_SIZE;i++) {
CheckTopicWebsiteFormatThread t=new CheckTopicWebsiteFormatThread(serviceDict,regionDict, this.getMsgProp(), list, queue);
CheckTopicWebsiteFormatThread t=new CheckTopicWebsiteFormatThread(serviceDict,regionDict, props, list, queue);
futures.add(service.submit(t));
}
service.shutdown();
while(!service.isTerminated()) {
@@ -1182,13 +1258,26 @@ public class BaseController {
e.printStackTrace();
}
}
boolean valideteError=false;
for(Future<String> future:futures) {
String msg = future.get();
if(StringUtils.isNotBlank(msg)) {
if(msg.equals("validate_error")) {
valideteError=true;
}else if(msg.endsWith("validate_error")) {
_msg.append(msg.substring(0, msg.length()-1-"validate_error".length()));
valideteError=true;
}else {
_msg.append(msg);
}
//throw new ServiceException(msg);
_msg.append(msg);
}
}
if(valideteError) {
_msg.append(props.getProperty("validate_error", "Unexpected error occurred while validating"));
}
long end=System.currentTimeMillis();
logger.warn("checkTopicWebsiteCfgMulity finish,cost:"+(end-start)+",size:"+queue.size());
return queue;

View File

@@ -1490,4 +1490,5 @@ endTime=End Time
single=Single
everyDay=Every Day
everyWeek=Every Week
everyMonth=Every Month
everyMonth=Every Month
validate_error=Unexpected error occurred while validating

View File

@@ -1494,4 +1494,5 @@ endTime=\u0417\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044C
single=\u041E\u0434\u043D\u043E\u043A\u0440\u0430\u0442\u043D\u043E
everyDay=\u0415\u0436\u0435\u0434\u043D\u0435\u0432\u043D\u043E
everyWeek=\u0415\u0436\u0435\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u043E
everyMonth=\u0415\u0436\u0435\u043C\u0435\u0441\u044F\u0447\u043D\u043E
everyMonth=\u0415\u0436\u0435\u043C\u0435\u0441\u044F\u0447\u043D\u043E
validate_error=Unexpected error occurred while validating

View File

@@ -1490,4 +1490,5 @@ endTime=\u7ED3\u675F\u65F6\u95F4
single=\u5355\u6B21
everyDay=\u6BCF\u5929
everyWeek=\u6BCF\u5468
everyMonth=\u6BCF\u6708
everyMonth=\u6BCF\u6708
validate_error=\u9A8C\u8BC1\u65F6\u53D1\u751F\u610F\u5916\u9519\u8BEF