Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
fangshunjian
2018-10-18 16:09:12 +08:00
28 changed files with 1925 additions and 1584 deletions

View File

@@ -110,21 +110,24 @@ public class AutoRunForSocketServerServlet extends HttpServlet implements Servle
}});
System.out.println(port+">>SSL通讯监听 已启动");
//nms上报
String intervalStr = BaseAction.rb.getString("nms.report.interval");
//nms上报间隔
long interval = StringUtil.isBlank(intervalStr) ? 300000 : Long.parseLong(intervalStr)*1000;
//nms初次上报延时
long now = new Date().getTime();
long initInterval = 0l;
if(now%interval > 0) {
initInterval = interval-(now%interval);
String openStr = BaseAction.rb.getString("nms.report.open");
boolean open = StringUtil.isBlank(openStr) ? false : ("1".equals(openStr) ? true : false);
if (open) {
//nms上报
String intervalStr = BaseAction.rb.getString("nms.report.interval");
//nms上报间隔
long interval = StringUtil.isBlank(intervalStr) ? 300000 : Long.parseLong(intervalStr)*1000;
//nms初次上报延时
long now = new Date().getTime();
long initInterval = 0l;
if(now%interval > 0) {
initInterval = interval-(now%interval);
}
ThreadPoolCommon.scheduled.scheduleAtFixedRate(new NmsStatusThread(), initInterval, interval, TimeUnit.MILLISECONDS);
ThreadPoolCommon.scheduled.scheduleAtFixedRate(new NmsRuleThread(), initInterval, interval, TimeUnit.MILLISECONDS);
ThreadPoolCommon.scheduled.scheduleAtFixedRate(new NmsPortThread(), initInterval, interval, TimeUnit.MILLISECONDS);
}
ThreadPoolCommon.scheduled.scheduleAtFixedRate(new NmsStatusThread(), initInterval, interval, TimeUnit.MILLISECONDS);
ThreadPoolCommon.scheduled.scheduleAtFixedRate(new NmsRuleThread(), initInterval, interval, TimeUnit.MILLISECONDS);
ThreadPoolCommon.scheduled.scheduleAtFixedRate(new NmsPortThread(), initInterval, interval, TimeUnit.MILLISECONDS);
}
}

View File

@@ -2,10 +2,14 @@ package com.nms.thread;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import net.sf.json.JSONObject;
import nis.nms.util.BaseAction;
import nis.nms.util.ConnectionOracle;
import nis.nms.util.HttpClientUtil;
import org.apache.log4j.Logger;
@@ -30,7 +34,34 @@ public class NmsPortThread implements Runnable {
try {
connection = ConnectionOracle.getConnection();
NmsReportService service = new NmsReportService(connection);
//ArrayList<Map<String, String>> nmsRuleInfo = service.getNmsPortInfo(nowLong, nowLong-interval);
ArrayList<Map<String, String>> nmsPortInfo = service.getNmsPortInfo(nowLong, nowLong-interval);
if (nmsPortInfo != null && nmsPortInfo.size() > 0) {
Map<String, List<Map<String, String>>> data = new HashMap<String, List<Map<String, String>>>();
List<Map<String, String>> results = new ArrayList<Map<String, String>>();
for (Map<String, String> info : nmsPortInfo) {
Map<String, String> result = new HashMap<String, String>();
result.put("port", info.get("ifindex"));
result.put("nodeName", info.get("node_name"));
result.put("nodeIp", info.get("node_ip"));
result.put("portDesc", info.get("IFDESCR"));
result.put("bandwidth", info.get("IFSPEED"));
result.put("inoctets", info.get("IFINOCTETS"));
result.put("outoctets", info.get("IFOUTOCTETS"));
result.put("inoctetsSpeed", info.get("INOCTETSSPEED"));
result.put("outoctetsSpeed", info.get("OUTOCTETSSPEED"));
result.put("inpktsSpeed", info.get("INPKTSSPEED"));
result.put("outpktsSpeed", info.get("OUTPKTSSPEED"));
result.put("recvTime", info.get("DATA_CHECK_TIME"));
results.add(result);
}
data.put("trafficNetflowPortInfoList", results);
HttpClientUtil httpUtil = new HttpClientUtil();
JSONObject fromObject = JSONObject.fromObject(data);
httpUtil.post(BaseAction.rb.getString("nms.port.url"), fromObject.toString());
}
} catch (Exception e) {
logger.error(e);
} finally {

View File

@@ -2,11 +2,15 @@ package com.nms.thread;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import net.sf.json.JSONObject;
import nis.nms.util.BaseAction;
import nis.nms.util.ConnectionOracle;
import nis.nms.util.DateUtil;
import nis.nms.util.HttpClientUtil;
import org.apache.log4j.Logger;
@@ -31,7 +35,40 @@ public class NmsRuleThread implements Runnable {
try {
connection = ConnectionOracle.getConnection();
NmsReportService service = new NmsReportService(connection);
//ArrayList<Map<String, String>> nmsRuleInfo = service.getNmsRuleInfo(nowLong, nowLong-interval);
ArrayList<Map<String, String>> nmsRuleInfo = service.getNmsRuleInfo(nowLong, nowLong-interval);
if (nmsRuleInfo != null && nmsRuleInfo.size() > 0) {
Map<String, List<Map<String, String>>> data = new HashMap<String, List<Map<String, String>>>();
List<Map<String, String>> results = new ArrayList<Map<String, String>>();
for (Map<String, String> info : nmsRuleInfo) {
Map<String, String> result = new HashMap<String, String>();
result.put("detectionInfoId", info.get("detection_info_id"));
result.put("serviceIndex", info.get("ServiceIndex"));
result.put("serviceCode", info.get("ServiceCode"));
result.put("serviceDesc", info.get("ServiceDesc"));
result.put("agedTime", info.get("agedTime"));
result.put("clientNum", info.get("ClientNum"));
result.put("refluxPort", info.get("RefluxPort"));
result.put("ruleNumber", info.get("RuleNumber"));
result.put("usedRuleNum", info.get("usedRuleNum"));
result.put("leftRuleNum", info.get("leftRuleNum"));
result.put("hitTotalNum", info.get("HitTotalNum"));
result.put("detectionedState", info.get("DETECTIONED_STATE"));
result.put("seqId", info.get("SEQ_ID"));
result.put("detectionSetInfoId", info.get("DETECTION_SET_INFO_ID"));
result.put("dataCheckTime", info.get("data_check_time"));
result.put("dataArriveTime", info.get("data_arrive_time"));
result.put("dataCheckTimeDigital", info.get("data_check_time_digital"));
result.put("dataArriveTimeDigital", info.get("data_arrive_time_digital"));
results.add(result);
}
data.put("nmsDiRuleList", results);
HttpClientUtil httpUtil = new HttpClientUtil();
JSONObject fromObject = JSONObject.fromObject(data);
httpUtil.post(BaseAction.rb.getString("nms.rule.url"), fromObject.toString());
}
} catch (Exception e) {
logger.error(e);
} finally {

View File

@@ -41,12 +41,13 @@ public class NmsReportService {
}
public ArrayList<Map<String, String>> getNmsRuleInfo(Long end, Long start) {
String sql = "SELECT nt.node_ip, dr.ServiceIndex, dr.ServiceCode, dr.ServiceDesc, dr.agedTime, dr.ClientNum, dr.RefluxPort, dr.RuleNumber, dr.usedRuleNum, dr.leftRuleNum, dr.HitTotalNum, dr.DETECTIONED_STATE "
//end=1539073880004l, start=1539073579984l
String sql = "SELECT dr.detection_info_id, dr.ServiceIndex, dr.ServiceCode, dr.ServiceDesc, dr.agedTime, dr.ClientNum, dr.RefluxPort, dr.RuleNumber, dr.usedRuleNum, dr.leftRuleNum, dr.HitTotalNum, dr.DETECTIONED_STATE, dr.SEQ_ID, dr.DETECTION_SET_INFO_ID, dr.data_check_time, dr.data_arrive_time, dr.data_check_time_digital, dr.data_arrive_time_digital "
+ "FROM di_rule dr "
+ "LEFT JOIN node_table nt ON nt.seq_id=dr.seq_id "
+ "WHERE nt.node_state=0 AND dr.data_check_time_digital<" + end + " AND dr.data_check_time_digital>=" + start;
ArrayList<String> fields = new ArrayList<String>();
fields.add("node_ip");
fields.add("detection_info_id");
fields.add("ServiceIndex");
fields.add("ServiceCode");
fields.add("ServiceDesc");
@@ -58,6 +59,12 @@ public class NmsReportService {
fields.add("leftRuleNum");
fields.add("HitTotalNum");
fields.add("DETECTIONED_STATE");
fields.add("SEQ_ID");
fields.add("DETECTION_SET_INFO_ID");
fields.add("data_check_time");
fields.add("data_arrive_time");
fields.add("data_check_time_digital");
fields.add("data_arrive_time_digital");
try {
ArrayList<Map<String, String>> dbSelect = dao.dbSelect(sql, fields);
@@ -69,12 +76,24 @@ public class NmsReportService {
}
public ArrayList<Map<String, String>> getNmsPortInfo(Long end, Long start) {
String sql = "SELECT nt.node_ip, ds.* "
//end=1539073220004l,start=1539064699984l
String sql = "SELECT nt.node_ip, nt.node_name, ds.ifindex, ds.IFDESCR, ds.IFSPEED, ds.IFINOCTETS, ds.IFOUTOCTETS,ds.INOCTETSSPEED,ds.INPKTSSPEED,ds.OUTOCTETSSPEED, ds.OUTPKTSSPEED, ds.DATA_CHECK_TIME "
+ "FROM di_switchport ds "
+ "LEFT JOIN node_table nt ON nt.seq_id=ds.seq_id"
+ "LEFT JOIN node_table nt ON nt.seq_id=ds.seq_id "
+ "WHERE nt.node_state=0 AND ds.data_check_time_digital<" + end + " AND ds.data_check_time_digital>=" + start;
ArrayList<String> fields = new ArrayList<String>();
fields.add("node_ip");
fields.add("node_name");
fields.add("ifindex");
fields.add("IFDESCR");
fields.add("IFSPEED");
fields.add("IFINOCTETS");
fields.add("IFOUTOCTETS");
fields.add("INOCTETSSPEED");
fields.add("INPKTSSPEED");
fields.add("OUTOCTETSSPEED");
fields.add("OUTPKTSSPEED");
fields.add("DATA_CHECK_TIME");
try {
ArrayList<Map<String, String>> dbSelect = dao.dbSelect(sql, fields);

View File

@@ -87,7 +87,11 @@ nation.role.jsbh=224
dept.mk.id=280
#1:open 0:close
nms.report.open=1
#unit:s
nms.report.interval=20
nms.status.setId=7
nms.status.url=http\://10.0.6.242\:8080/galaxy/service/nms/v1/saveServerStatus
nms.status.url=http\://192.168.11.64\:8080/galaxy-service/service/nms/v1/saveServerStatus
nms.port.url=http\://192.168.11.64\:8080/galaxy-service/service/nms/v1/rafficNetflowPortInfo
nms.rule.url=http\://192.168.11.64\:8080/galaxy-service/service/nms/v1/saveNmsDiRule

View File

@@ -260,10 +260,11 @@ public abstract class BaseAction extends ActionSupport implements Serializable
* @return
*/
public boolean getAdminMark(){
if(StringUtils.isNotEmpty(rb.getString("common.admin.mark")) && getUser()!=null){
if(rb.getString("common.admin.mark").equals(getUser().getYhbh())
XtYhJbxx user =getUser1();
if(StringUtils.isNotEmpty(rb.getString("common.admin.mark")) && user!=null){
if(rb.getString("common.admin.mark").equals(getUser1().getYhbh())
|| getSystemID().equals(-1L)
||"admin".equalsIgnoreCase(getUser().getYhbh())){
||"admin".equalsIgnoreCase(getUser1().getYhbh())){
return true;
}else return false;
}else
@@ -430,6 +431,11 @@ public abstract class BaseAction extends ActionSupport implements Serializable
XtYhJbxx user = (XtYhJbxx)session.getAttribute(Constant.SESSION_CZY_NAME);
return user;
}
public XtYhJbxx getUser1(){
HttpSession session = getRequest().getSession(true);
XtYhJbxx user = (XtYhJbxx)session.getAttribute(Constant.SESSION_CZY_NAME);
return user;
}
public String getExp(List list,String name,String tem,List... lists) {
InputStream in = null;
OutputStream out = null;

View File

@@ -66,7 +66,8 @@ public class HttpClientUtil {
*/
public String post(String url, String json) throws ClientProtocolException, IOException{
//实例化httpClient
logger.info("发送post请求" + url + ":::" + json);
logger.info("发送post请求" + url);
logger.debug("发送post请求" + url + ":::" + json);
CloseableHttpClient httpclient = HttpClients.createDefault();
//实例化post方法
HttpPost httpPost = new HttpPost(url);
@@ -80,7 +81,8 @@ public class HttpClientUtil {
//执行post方法
response = httpclient.execute(httpPost);
content = EntityUtils.toString(response.getEntity(), "utf-8");
logger.info("post请求结束" + response.getStatusLine().getStatusCode() + ":::" + content);
logger.info("post请求结束" + response.getStatusLine().getStatusCode());
logger.debug("post请求结束" + response.getStatusLine().getStatusCode() + ":::" + content);
return content;
}
}

View File

@@ -687,10 +687,10 @@ public class CheckTypeSetAction extends BaseAction {
//执行添加字段
this.commonService.updateBatchBySql(sqlString.toString());
}
commonService.commit();
//与NMSServer通信
this.sendCheckTypeId(checkTypeInfo.getId()+"",commonService);
commonService.commit();
} catch (Exception e) {
e.printStackTrace();
logger.error(e.getStackTrace());

View File

@@ -804,9 +804,10 @@ public class DetectionSetAction extends BaseAction {
// 将更新操作写到操作日志中
this.addDBOperationRpt(commonService, "detection_Set_Info",
"INSERT", detectionSetInfo.getId());
commonService.commit();
// 用来实现即时向客户端发送配置信息
sendSetInfo(null, detectionSetInfo, commonService);
commonService.commit();
} catch (Exception e) {
e.printStackTrace();
commonService.rollback();
@@ -1249,7 +1250,6 @@ public class DetectionSetAction extends BaseAction {
}
errBuffer.append(getI18nText("i18n_DetectionSetAction.downloadExample.rangRepeat_n81i"));
}
}
// 判断数据是否存在
list = this.commonService
@@ -1337,6 +1337,17 @@ public class DetectionSetAction extends BaseAction {
.getGroupId());
detectionSetInfo.setNodegroup(ng);
}
if ((detectionSetInfo.getNodeIpsId() == null||"".equals(detectionSetInfo.getNodeGroupsId()))
&&(detectionSetInfo.getNodeIpsId()==null|| "".equals(detectionSetInfo.getNodeIpsId()))) {//节点组和节点都为空
detectionSetInfo.setNodeGroupsId(null);
detectionSetInfo.setNodeIpsId(null);
} else if ((detectionSetInfo.getNodeGroupsId() != null
&& !"".equals(detectionSetInfo.getNodeGroupsId()))
&&(detectionSetInfo.getNodeIpsId()==null|| "".equals(detectionSetInfo.getNodeIpsId()))) {//节点组不为空,节点为空
detectionSetInfo.setNodeIpsId(null);
}
detectionSetInfo.setNodeIp(detectionSetInfo.getNodeIpsName());
detectionSetInfo.setDetectionSetState("1");
detectionSetInfo.setCreateUserId(this.getUserID());
@@ -1345,7 +1356,7 @@ public class DetectionSetAction extends BaseAction {
// 将更新操作写到操作日志中
this.addDBOperationRpt(commonService, "detection_Set_Info",
"INSERT", detectionSetInfo.getId());
commonService.commit();
// 保存并更新上传的脚本文件
saveScriptFile(myFile, detectionSetInfo);
@@ -1364,7 +1375,7 @@ public class DetectionSetAction extends BaseAction {
outHtmlString("<script type=\"text/javascript\">alert('i18n_DetectionSetAction.downloadExample.success_n81i');this.location='detectionSet.do?action=query&pageNo="
+ pageNo + "&pageSize=" + pageSize + "'</script>");
}
commonService.commit();
} catch (Exception e) {
e.printStackTrace();
logger.error(e.getStackTrace());
@@ -1846,7 +1857,7 @@ public class DetectionSetAction extends BaseAction {
// 将更新操作写到操作日志中
this.addDBOperationRpt(commonService, "detection_Set_Info",
"UPDATE", setInfo.getId());
commonService.commit();
// 保存并更新上传的脚本文件
saveScriptFile(myFile, detectionSetInfo);
@@ -1859,12 +1870,14 @@ public class DetectionSetAction extends BaseAction {
outHtmlString("<script type=\"text/javascript\">alert('i18n_DetectionSetAction.downloadExample.success_n81i');this.location='detectionSet.do?action=query&pIden="+pIden+"&ctn="+ctn+"&ip="+ip+"&pageNo="
+ pageNo + "&pageSize=" + pageSize + "'</script>");
commonService.commit();
} catch (Exception e) {
e.printStackTrace();
logger.error(e.getStackTrace());
commonService.rollback();
outHtmlString("<script type=\"text/javascript\">alert('i18n_DetectionSetAction.downloadExample.faild_n81i');this.location='detectionSet.do?action=query&pIden="+pIden+"&ctn="+ctn+"&ip="+ip+"&pageNo="
+ pageNo + "&pageSize=" + pageSize + "'</script>");
}
}
@@ -2102,7 +2115,7 @@ public class DetectionSetAction extends BaseAction {
//将更新操作写到操作日志中
this.addDBOperationRpt(commonService, "detection_set_info", "UPDATE", ds.getId());
commonService.commit();
// 用来实现即时向客户端发送配置信息
sendSetInfo(dsOld, ds, commonService);
}
@@ -2112,6 +2125,7 @@ public class DetectionSetAction extends BaseAction {
outHtmlString("<script type=\"text/javascript\">alert('i18n_DetectionSetAction.downloadExample.success_n81i');this.location='detectionSet.do?action=query&pageNo="
+ pageNo + "&pageSize=" + pageSize + "'</script>");
commonService.commit();
} catch (Exception e) {
commonService.rollback();
logger.error(e.getStackTrace());
@@ -2165,7 +2179,7 @@ public class DetectionSetAction extends BaseAction {
//将更新操作写到操作日志中
this.addDBOperationRpt(commonService, "detection_set_info", "UPDATE", ds.getId());
commonService.commit();
// 用来实现即时向客户端发送脚本文件
sendPluginFile(dsOld, ds, myFile, commonService);
@@ -2177,6 +2191,7 @@ public class DetectionSetAction extends BaseAction {
outHtmlString("<script type=\"text/javascript\">alert('i18n_DetectionSetAction.downloadExample.success_n81i');this.location='detectionSet.do?action=query&pageNo="
+ pageNo + "&pageSize=" + pageSize + "'</script>");
commonService.commit();
} catch (Exception e) {
commonService.rollback();
logger.error(e.getStackTrace());

View File

@@ -330,9 +330,9 @@ public class MetaDataSetAction extends BaseAction {
}else{
outHtmlString("<script type=\"text/javascript\">alert('i18n_MetaDataSetAction.queryCheckTypeSource.success_n81i');this.location='metaDataSet.do?action=oppAdd&typeids="+checkTypeInfo.getId()+"'</script>");
}
commonService.commit();
//与NMSServer通信
this.sendCheckTypeId(typeInfo.getId()+"",commonService);
commonService.commit();
} catch (Exception e) {
commonService.rollback();
e.printStackTrace();

View File

@@ -3852,7 +3852,7 @@ public class MonitorDataAction extends BaseAction {
String nmsClientStr = objs[index2] == null ? "" : objs[index2].toString();
String state = "";
int initK = 1;// 默认第一个为握手监测其它监测从1开始取
if (!getI18nText("i18n_MonitorDataAction.emportCurrentXlsAbnormalSet.shakehands_n81i").equals(nmsClientStr) && StringUtils.isNotBlank(ip)) {// 如果ip没有握手监测则从数据库中进行查询
if (!"i18n_check_type_info.NMSClient.CHECK_TYPE_NAME1_n81i".equals(nmsClientStr) && StringUtils.isNotBlank(ip)) {// 如果ip没有握手监测则从数据库中进行查询
String sql = "select din.detectioned_state" + " from DETECTION_INFO_NEW din "
+ " left join DETECTION_SET_INFO dsi on din.detection_set_info_id = dsi.id"
+ " left join check_type_info cti on dsi.check_type_id = cti.id"

View File

@@ -248,6 +248,7 @@ public class PoliceSetAction extends BaseAction {
this.commonService.save(dataPoliceRelation);
// 将更新操作写到操作日志中
this.addDBOperationRpt(commonService,"data_police_relation", "INSERT", dataPoliceRelation.getId());
sendSetInfo(null,dsi,commonService);
commonService.commit();
outHtmlString("<script type=\"text/javascript\">alert('i18n_PoliceSetAction.queryPoliceSetInfo.success_n81i');this.location='policeSet.do?action=query&pIden="+pIden+"&ctn="+ctn+"&ip="+ip+"&pageNo="+pageNo+"&pageSize="+pageSize+"&setId="+setId+"'</script>");
} catch (Exception e) {
@@ -256,7 +257,7 @@ public class PoliceSetAction extends BaseAction {
logger.error(e.getStackTrace());
outHtmlString("<script type=\"text/javascript\">alert('i18n_PoliceSetAction.queryPoliceSetInfo.faild_n81i');this.location='policeSet.do?action=query&pIden="+pIden+"&ctn="+ctn+"&ip="+ip+"&pageNo="+pageNo+"&pageSize="+pageSize+"&setId="+setId+"'</script>");
}
sendSetInfo(null,dsi,commonService);
}
public String openUpdatePoliceSet() {
@@ -313,7 +314,7 @@ public class PoliceSetAction extends BaseAction {
dpRelation.setMarker(dataPoliceRelation.getMarker());
dpRelation.setMarkerFiledId(dataPoliceRelation.getMarkerFiledId());
this.commonService.update(dpRelation);
commonService.commit();
// 将更新操作写到操作日志中
this.addDBOperationRpt(commonService,"data_police_relation", "UPDATE", dpRelation.getId());
sendSetInfo(null,ds,commonService);
@@ -324,6 +325,7 @@ public class PoliceSetAction extends BaseAction {
String str = "<script type=\"text/javascript\">alert('i18n_PoliceSetAction.queryPoliceSetInfo.success_n81i');this.location='policeSet.do?action=query&pIden="+pIden+"&ctn="+ctn+"&ip="+ip+"&pageNo="+pageNo+"&pageSize="+pageSize+setIdStr+"'</script>";
outHtmlString(str);
commonService.commit();
} catch (Exception e) {
commonService.rollback();
e.printStackTrace();

View File

@@ -572,7 +572,7 @@ public class NmsTaskManagerAction extends BaseAction {
}
}
String[] title = { getI18nText("i18n_NmsTaskManagerAction.executeAction.title.missionName _n81i"),
String[] title = { getI18nText("i18n_NmsTaskManagerAction.executeAction.title.missionName_n81i"),
getI18nText("i18n_NmsTaskManagerAction.executeAction.title.missionType_n81i"),
getI18nText("i18n_NmsTaskManagerAction.executeAction.title.isLoop_n81i"),
getI18nText("i18n_NmsTaskManagerAction.executeAction.title.missionState_n81i"),
@@ -743,7 +743,7 @@ public class NmsTaskManagerAction extends BaseAction {
}
}
String[] title = { getI18nText("i18n_NmsTaskManagerAction.executeAction.title.missionName _n81i"),
String[] title = { getI18nText("i18n_NmsTaskManagerAction.executeAction.title.missionName_n81i"),
getI18nText("i18n_NmsTaskManagerAction.executeAction.title.missionType_n81i"),
getI18nText("i18n_NmsTaskManagerAction.executeAction.title.isLoop_n81i"),
getI18nText("i18n_NmsTaskManagerAction.executeAction.title.missionState_n81i"),
@@ -2381,7 +2381,7 @@ public class NmsTaskManagerAction extends BaseAction {
// 将更新操作写到操作日志中
this.addDBOperationRpt(commonService, "mission_state_table", "UPDATE", pid[i]);
commonService.commit();
sendMissionInfoId(pid[i], 0l, commonService);
// sendMissionInfoId(missionstatetable.getMissionId(),1l);
}
@@ -2393,7 +2393,7 @@ public class NmsTaskManagerAction extends BaseAction {
+ "this.location='nmsTaskManager.do?action=query&pageNo=" + pageNo + "&pageSize=" + pageSize
+ "'</script>");
}
commonService.commit();
} catch (Exception e) {
commonService.rollback();
outHtmlString("<script type=\"text/javascript\">alert('i18n_NmsTaskManagerAction.executeAction.faild_n81i');"
@@ -4250,8 +4250,8 @@ public class NmsTaskManagerAction extends BaseAction {
default:
break;
}
commonService.commit();
sendMissionInfoId(stateTable.getMissionId(), 0l, commonService);
commonService.commit();
} catch (Exception e) {
commonService.rollback();
e.printStackTrace();
@@ -4702,7 +4702,6 @@ public class NmsTaskManagerAction extends BaseAction {
missionstatetable.getMissionId());
// sendInfo(missionstatetable.getMissionId(),0l,new
// File(fileName));
commonService.commit();
logger.debug("开始发送任务信息任务id" + missionstatetable.getMissionId());
sendMissionInfoId(missionstatetable.getMissionId(), 0l, commonService);
}
@@ -4717,7 +4716,7 @@ public class NmsTaskManagerAction extends BaseAction {
outHtmlString(
"<script type=\"text/javascript\">alert('i18n_NmsTaskManagerAction.executeAction.success_n81i');this.location='nmsTaskManager.do?action=query'</script>");
}
commonService.commit();
} catch (Exception e) {
commonService.rollback();
e.printStackTrace();

View File

@@ -399,12 +399,12 @@ public class NodeGroupManageAction extends BaseAction {
//将添加操作写到操作日志中
this.addDBOperationRpt(commonService, "nodegroup_table", "INSERT", nodegroupTable.getGroupId());
commonService.commit();
// 用来实现即时向客户端发送脚本文件
this.sendPluginFile(nodegroupTable.getGroupId(), null,commonService);
this.sendNodeAndGroupId(nodegroupTable.getGroupId(), null,commonService);//通知NMSServer更新节点组的监控信息
commonService.commit();
} catch (Exception e) {
commonService.rollback();
e.printStackTrace();
@@ -886,7 +886,7 @@ public class NodeGroupManageAction extends BaseAction {
//将添加操作写到操作日志中
this.addDBOperationRpt(commonService, "nodegroup_table", "INSERT", nodeGroup.getGroupId());
commonService.commit();
// 用来实现即时向客户端发送脚本文件
this.sendPluginFile(nodeGroup.getGroupId(), null,commonService);
@@ -900,7 +900,7 @@ public class NodeGroupManageAction extends BaseAction {
}else{
this.outHtmlString("<script>alert('i18n_NodeGroupManageAction.downloadExample.success_n81i');this.location='nodeGroupManage!execute.do?action=queryNodeGroupInfo&showStopNGroup="+showStopNGroup+"'</script>");
}
commonService.commit();
}catch (Exception e){
commonService.rollback();
logger.error(e.getStackTrace());
@@ -975,7 +975,7 @@ public class NodeGroupManageAction extends BaseAction {
//将更新操作写到操作日志中
this.addDBOperationRpt(commonService, "nodegroup_table", "UPDATE", nodeGroup.getGroupId());
commonService.commit();
this.outHtmlString("<script>alert('i18n_NodeGroupManageAction.downloadExample.success_n81i');this.location='nodeGroupManage!execute.do?action=queryNodeGroupInfo&showStopNGroup="+showStopNGroup+"'</script>");
}
if(flag){
@@ -985,7 +985,7 @@ public class NodeGroupManageAction extends BaseAction {
this.sendNodeAndGroupId(group.getGroupId(), null,commonService); //通知NMSServer更新节点组的监控信息
this.getRequest().setAttribute("MSG","2");
}
commonService.commit();
}catch (Exception e){
commonService.rollback();
logger.error(e.getStackTrace());
@@ -1241,7 +1241,7 @@ public class NodeGroupManageAction extends BaseAction {
String sqlCondition = "where NODE_ID in (" + allIds + ")";
//将更新操作写到操作日志中
this.addDBOperationRpt(commonService, sqlCondition, "NODE_TABLE");
commonService.commit();
//通知NMSServer更新节点组的监控信息
for(String str : leafNodeGroupArray){
// 用来实现即时向客户端发送脚本文件
@@ -1250,7 +1250,7 @@ public class NodeGroupManageAction extends BaseAction {
this.sendNodeAndGroupId(Long.valueOf(str), null,commonService);
}
}
commonService.commit();
//this.outHtmlString("<script>alert('操作成功!');this.location='"+path+"/nodeGroupManage/nodeGroupManage.do?action=queryNodeGroupInfo'</script>");
} catch (Exception e) {
commonService.rollback();

View File

@@ -615,7 +615,7 @@ public class NodeManageAction extends BaseAction {
// 将添加操作写到操作日志中
this.addDBOperationRpt(commonService, "node_table",
"INSERT", nodeTable.getNodeId());
commonService.commit();
if (new Long(1).equals(group.getIsValid())) { // 节点组有效
// 用来实现即时向客户端发送脚本文件
@@ -643,7 +643,7 @@ public class NodeManageAction extends BaseAction {
.outHtmlString("<script>alert('i18n_NodeManageAction.addNodeInfo.nodeHadIp_n81i');history.back();</script>");
return;
}
commonService.commit();
} catch (Exception e) {
commonService.rollback();
e.printStackTrace();
@@ -1138,7 +1138,7 @@ public class NodeManageAction extends BaseAction {
// 将更新操作写到操作日志中
this.addDBOperationRpt(commonService, "node_table",
"UPDATE", nodeTable.getNodeId());
commonService.commit();
if (flag) {
// 用来实现即时向客户端发送脚本文件
this.sendPluginFile(nt.getGroupId(), nt
@@ -1159,6 +1159,7 @@ public class NodeManageAction extends BaseAction {
.outHtmlString("<script>alert('i18n_NodeManageAction.addNodeInfo.nodeHadIp_n81i');history.back();</script>");
return;
}
commonService.commit();
} catch (Exception e) {
commonService.rollback();
e.printStackTrace();
@@ -1186,7 +1187,7 @@ public class NodeManageAction extends BaseAction {
// 将更新操作写到操作日志中
this.addDBOperationRpt(commonService, "node_table", "UPDATE",
nd.getNodeId());
commonService.commit();
NodegroupTable group = (NodegroupTable) this.commonService.get(
NodegroupTable.class, nd.getGroupId());
if (new Long(1).equals(group.getIsValid())) { // 节点组有效
@@ -1205,7 +1206,7 @@ public class NodeManageAction extends BaseAction {
// this.outHtmlString("<script
// type=\"text/javascript\">alert('操作成功');this.location='nodeManage.do?action=query&nodeGroupId="+group.getGroupId()+"&isValid="+group.getIsValid()+"'</script>");
}
commonService.commit();
} catch (Exception e) {
commonService.rollback();
e.printStackTrace();
@@ -1225,7 +1226,7 @@ public class NodeManageAction extends BaseAction {
// 将更新操作写到操作日志中
this.addDBOperationRpt(commonService, "node_table", "UPDATE",
nodeId);
commonService.commit();
NodeTable nd = (NodeTable) this.commonService.get(NodeTable.class,
nodeId);
NodegroupTable group = (NodegroupTable) this.commonService.get(
@@ -1244,7 +1245,7 @@ public class NodeManageAction extends BaseAction {
this
.outHtmlString("<script type=\"text/javascript\">alert('i18n_NodeManageAction.addNodeInfo.success_n81i');this.location='nodeManage.do?action=query&nodeGroupId="
+ mkid + "&isValid=" + isValid + "&showStopNGroup=" + showStopNGroup + "&nodeIpVo="+nodeIpVo+"&nodeNameVo="+nodeNameVo+ "'</script>");
commonService.commit();
} catch (Exception e) {
commonService.rollback();
e.printStackTrace();

View File

@@ -134,23 +134,23 @@ public class TopoShowAction extends BaseAction
if(this.getAdminMark()){
sql = "SELECT * from ("
+ "select count(distinct nt.node_id) from detection_info_new diw left join node_table nt on diw.seq_id = nt.seq_id "
+ "where diw.DETECTIONED_STATE<>1 AND diw.police_emergent=0 and diw.DETECTION_SET_INFO_ID in "
+ "where diw.DETECTIONED_STATE<>1 AND diw.police_emergent=0 and diw.VALID=1 and diw.DETECTION_SET_INFO_ID in "
+ "(select dst.ID from DETECTION_SET_INFO dst where dst.DETECTION_SET_STATE=1) and nt.NODE_STATE = 0 "
+ "and nt.node_group_id in ("+gids+")"
+ ") alramNode,"
+ "(SELECT count(DISTINCT t.node_ip) from node_table t WHERE "
+ " t.node_group_id= " + nodegroupTable.getGroupId()
+ ") allNode";
+ " and node_state=0 ) allNode";
}else{
sql = "SELECT * from ("
+ "select count(distinct nt.node_id) from detection_info_new diw left join node_table nt on diw.seq_id = nt.seq_id "
+ "where diw.DETECTIONED_STATE<>1 AND diw.police_emergent=0 and diw.DETECTION_SET_INFO_ID in "
+ "where diw.DETECTIONED_STATE<>1 AND diw.police_emergent=0 and diw.VALID=1 and diw.DETECTION_SET_INFO_ID in "
+ "(select dst.ID from DETECTION_SET_INFO dst where dst.DETECTION_SET_STATE=1) and nt.NODE_STATE = 0 "
+ "and nt.node_group_id in ("+gids+")"
+ ") alramNode,"
+ "(SELECT count(DISTINCT t.node_ip) from node_table t WHERE t.system_id="
+ getSystemID() + " AND t.node_group_id= " + nodegroupTable.getGroupId()
+ ")allNode";
+ " and node_state=0 )allNode";
}
List countList = commonService.executeSQL(sql);
@@ -411,10 +411,13 @@ public class TopoShowAction extends BaseAction
String sql = null;
if(this.getAdminMark()){
sql = "select count(diw.seq_Id) from detection_info_new diw where diw.DETECTIONED_STATE<>1 AND diw.police_emergent=0 and diw.seq_id = "
+ seqId;
+ seqId
+" and diw.VALID=1 "
+ " and diw.DETECTION_SET_INFO_ID in (select dst.ID from DETECTION_SET_INFO dst where dst.DETECTION_SET_STATE=1 ) ";
}else{
sql = "select count(diw.seq_Id) from detection_info_new diw where diw.DETECTIONED_STATE<>1 AND diw.police_emergent=0 and diw.seq_id = "
+ seqId
+" and diw.VALID=1 "
+ " and diw.DETECTION_SET_INFO_ID in (select dst.ID from DETECTION_SET_INFO dst where dst.DETECTION_SET_STATE=1 "
+ " and ("
+ "dst.VIEW_LEVEL=4 "//无限制

View File

@@ -648,13 +648,13 @@ public class ServerManagerAction extends BaseAction {
//将更新操作写到操作日志中
this.addDBOperationRpt(commonService, "Server_Table", "UPDATE", st.getId());
ServerTable serverTable = (ServerTable) commonService.get(ServerTable.class, ids[i]);
commonService.commit();
//将DC变更发送到DC
this.sendDataControllerReset(ids[i], serverTable.getServerIp(), commonService);
}
}
}
commonService.commit();
} catch (Exception e) {
commonService.rollback();
e.printStackTrace();
@@ -682,13 +682,13 @@ public class ServerManagerAction extends BaseAction {
//将更新操作写到操作日志中
this.addDBOperationRpt(commonService, "Server_Table", "UPDATE", st.getId());
ServerTable serverTable = (ServerTable) commonService.get(ServerTable.class, ids[i]);
commonService.commit();
//将DC变更发送到DC
this.sendDataControllerReset(ids[i], serverTable.getServerIp(), commonService);
}
}
}
commonService.commit();
} catch (Exception e) {
commonService.rollback();
e.printStackTrace();
@@ -797,9 +797,10 @@ public class ServerManagerAction extends BaseAction {
}
}
}
commonService.commit();
//将DC变更发送到DC
this.sendDataControllerReset(serverTable.getId(), serverTable.getServerIp(), commonService);
commonService.commit();
} catch (Exception e) {
commonService.rollback();
e.printStackTrace();

View File

@@ -328,7 +328,7 @@ public class DataDictionaryAction extends BaseAction {
String sql="update xt_mk_jbxx set zxbz=? where id=?";
this.commonService.updateBySql(sql, deptflag,Constants.DEPT_MK_ID);
}
commonService.commit();
//改变是否显示主动告警的启用状态时需要和各个nc通信SHOW_AUTO_ALARM_FLAG
if(nbt.getTypeIdentity().toLowerCase().equals(Constants.SHOW_AUTO_ALARM_FLAG.toLowerCase())
&& typeTable.getTypeState()!=oldState) {
@@ -339,7 +339,7 @@ public class DataDictionaryAction extends BaseAction {
}
outHtmlString("<script type=\"text/javascript\">alert('i18n_DataDictionaryAction.queryDictionary.success_n81i');this.location='dataDictionary.do?action=query&pageNo="+pageNo+"&pageSize="+pageSize+"'</script>");
commonService.commit();
} catch (Exception e) {
commonService.rollback();
logger.error("Update failed",e);