1.事务添加

2.亦庄bug修改
3.业务系统添加逻辑变更
This commit is contained in:
wangwenrui
2018-09-29 09:52:11 +08:00
parent dc91c4c987
commit dc168fa9b9
270 changed files with 128480 additions and 128056 deletions

View File

@@ -448,7 +448,7 @@
   
</div> </div>
<div class="box_2"> <div class="box_2">
<input type="button" class=btn3_mouseout <!-- <input type="button" class=btn3_mouseout
onmouseover="this.className='btn3_mouseover'" onmouseover="this.className='btn3_mouseover'"
onmouseout="this.className='btn3_mouseout'" onmouseout="this.className='btn3_mouseout'"
onmousedown="this.className='btn3_mousedown'" onmousedown="this.className='btn3_mousedown'"
@@ -464,13 +464,14 @@
onmousedown="this.className='btn3_mousedown'" onmousedown="this.className='btn3_mousedown'"
onmouseup="this.className='btn3_mouseup'" onmouseup="this.className='btn3_mouseup'"
onclick="javascript:importXls();" value="i18n_dsil.button.importXls_n81i"/> onclick="javascript:importXls();" value="i18n_dsil.button.importXls_n81i"/>
&nbsp; &nbsp;-->
<input type="button" class=btn3_mouseout <input type="button" class=btn3_mouseout
onmouseover="this.className='btn3_mouseover'" onmouseover="this.className='btn3_mouseover'"
onmouseout="this.className='btn3_mouseout'" onmouseout="this.className='btn3_mouseout'"
onmousedown="this.className='btn3_mousedown'" onmousedown="this.className='btn3_mousedown'"
onmouseup="this.className='btn3_mouseup'" onmouseup="this.className='btn3_mouseup'"
onclick="javascript:showDiv();" value="i18n_dsil.button.showDiv_n81i"/> onclick="javascript:showDiv();" value="i18n_dsil.button.showDiv_n81i" style="float: right"/>
<br/> <br/>
<div style="float: left"> <div style="float: left">
<jsp:include page="/include/include.jsp" /> <jsp:include page="/include/include.jsp" />

View File

@@ -16,6 +16,8 @@
src="<c:url value='/js/jquery-1.4.2.min.js'/>"></script> src="<c:url value='/js/jquery-1.4.2.min.js'/>"></script>
<script language="javascript" type="text/javascript" <script language="javascript" type="text/javascript"
src="<c:url value='/js/onmouse.js'/>"></script> src="<c:url value='/js/onmouse.js'/>"></script>
<script language="javascript" type="text/javascript"
src="<c:url value='/js/layer.js'/>"></script>
<script language="javascript" type="text/javascript" <script language="javascript" type="text/javascript"
src="<c:url value='/js/raphael.js'/>"></script> src="<c:url value='/js/raphael.js'/>"></script>
<link rel="stylesheet" <link rel="stylesheet"
@@ -221,9 +223,16 @@ body {
success:function (data,textStatus){ success:function (data,textStatus){
if(textStatus == "success" && (data!= null && data!= "" )){ if(textStatus == "success" && (data!= null && data!= "" )){
$("#nodeBoxs").html(""); $("#nodeBoxs").html("");
var t =$("#nodeBox").dialog("options").title; // var t =$("#nodeBox").dialog("options").title;
$("#nodeBox").dialog("setTitle", params[1]); /* $("#nodeBox").dialog("setTitle", params[1]);
$("#nodeBox").dialog("open"); $("#nodeBox").dialog("open"); */
window.top.layer.open({
title:params[1],
type:1,
content:$("#nodeBox"),
shade:0.3
});
var length = $(data).length; var length = $(data).length;
var raphaelBox = Raphael("nodeBoxs",boxWidth,boxHeight); var raphaelBox = Raphael("nodeBoxs",boxWidth,boxHeight);
//raphaelBox.rect(0,0,boxWidth,boxHeight).attr({'stroke-width':1,stroke: "#FFFFFF", fill: "#FBFBEA"}); //raphaelBox.rect(0,0,boxWidth,boxHeight).attr({'stroke-width':1,stroke: "#FFFFFF", fill: "#FBFBEA"});
@@ -308,6 +317,7 @@ body {
nodeIndex++; nodeIndex++;
nodeIndexs[nodeIndex]={"x":subBoxStartX-5,"y":subBoxY+5}; nodeIndexs[nodeIndex]={"x":subBoxStartX-5,"y":subBoxY+5};
} }
console.log("rephaelBox:"+raphaelBox);
}else{ }else{
var title="i18n_snr.message.UBit_n81i"+item.nodeposition; var title="i18n_snr.message.UBit_n81i"+item.nodeposition;
raphaelBox.rect(subBoxStartX,subBoxY,subWidth,newHeight).attr({stroke: "#CEDBEF",'stroke-width':0.1,title:title, fill: "#ffffff"}) raphaelBox.rect(subBoxStartX,subBoxY,subWidth,newHeight).attr({stroke: "#CEDBEF",'stroke-width':0.1,title:title, fill: "#ffffff"})

View File

@@ -39,16 +39,20 @@
} }
function doUpdate(yhid,yhbh){ function doUpdate(yhid,yhbh){
if(yhForm.email.value!=""){ var emailFlag=${session.emailFlag};
if(!checkEmail(yhForm.email.value.toLowerCase())){ if(emailFlag==0){
$("#email").next().html('i18n_usi.message.email_n81i'); if(yhForm.email.value!=""){
yhForm.email.focus(); if(!checkEmail(yhForm.email.value.toLowerCase())){
return false; $("#email").next().html('i18n_usi.message.email_n81i');
yhForm.email.focus();
return false;
}
}else{
$("#email").next().html('i18n_usi.message.emailInput_n81i');
return;
} }
}else{
$("#email").next().html('i18n_usi.message.emailInput_n81i');
return;
} }
if($("#y").attr('checked')==true){ if($("#y").attr('checked')==true){
if($id("yhmm","","i18n_usi.text.yhmm_n81i")&&$id("confirm","","i18n_usi.text.confirm_n81i")){ if($id("yhmm","","i18n_usi.text.yhmm_n81i")&&$id("confirm","","i18n_usi.text.confirm_n81i")){
var yhmm = document.getElementById("yhmm").value; var yhmm = document.getElementById("yhmm").value;

View File

@@ -350,8 +350,10 @@
</c:if> </c:if>
</td> </td>
<td class="${tdClassR }"> <td class="${tdClassR }">
<c:if test="${aji.jsbh gt 100100}">
<img src="<c:url value='/images/logo_1.png'/>" class="img_middle" />&nbsp; <img src="<c:url value='/images/logo_1.png'/>" class="img_middle" />&nbsp;
<a href="javascript:openUpdateRecord('${aji.jsbh}')">i18n_gil.text.updateInfo_n81i</a> <a href="javascript:openUpdateRecord('${aji.jsbh}')">i18n_gil.text.updateInfo_n81i</a>
</c:if>
</td > </td >
</tr> </tr>
<c:set var="index" value="${index + 1}" /> <c:set var="index" value="${index + 1}" />

View File

@@ -450,7 +450,6 @@
if(type == 9){ if(type == 9){
if(da[3]!=null && da[3]==0){//服务器/pc if(da[3]!=null && da[3]==0){//服务器/pc
td1 ="<input id='nodeIds' name='nodeCheckBoxName' class='alldisabled' type='checkbox' disabled='disabled' value='"+da[0]+"'/>"+index; td1 ="<input id='nodeIds' name='nodeCheckBoxName' class='alldisabled' type='checkbox' disabled='disabled' value='"+da[0]+"'/>"+index;
tit="这特么是服务器!";
}else if(da[3]!=null && da[3]==1 ){//交换机 }else if(da[3]!=null && da[3]==1 ){//交换机
td1 ="<input id='nodeIds' name='nodeCheckBoxName' type='checkbox' value='"+da[0]+"' checked />"+index; td1 ="<input id='nodeIds' name='nodeCheckBoxName' type='checkbox' value='"+da[0]+"' checked />"+index;
} }

View File

@@ -85,6 +85,7 @@ public class DeptManageAction extends BaseAction {
// 进行修改模块信息操作 // 进行修改模块信息操作
public void update() { public void update() {
try { try {
commonService.beginTransaction();
if(dept.getDeptid()!=null && !dept.getDeptid().toString().equals("1")){ if(dept.getDeptid()!=null && !dept.getDeptid().toString().equals("1")){
if(dept.getDeptstate()!=null){ if(dept.getDeptstate()!=null){
if(dept.getDeptstate().equals("1")){//置为无效,则其下部门全部职位无效 if(dept.getDeptstate().equals("1")){//置为无效,则其下部门全部职位无效
@@ -128,10 +129,12 @@ public class DeptManageAction extends BaseAction {
} }
} }
} }
commonService.commit();
outHtmlString("<script type=\"text/javascript\">alert('i18n_DeptManageAction.update.success_n81i');this.location='deptManage!execute.do?action=queryDeptInfo'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_DeptManageAction.update.success_n81i');this.location='deptManage!execute.do?action=queryDeptInfo'</script>");
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
commonService.rollback();
outHtmlString("<script type=\"text/javascript\">alert('i18n_DeptManageAction.update.faild_n81i');this.location='deptManage!execute.do?action=queryDeptInfo'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_DeptManageAction.update.faild_n81i');this.location='deptManage!execute.do?action=queryDeptInfo'</script>");
} }
} }
@@ -139,6 +142,7 @@ public class DeptManageAction extends BaseAction {
// 添加模块信息操作 // 添加模块信息操作
public void add() { public void add() {
try { try {
commonService.beginTransaction();
TableDepartment dptDepartment = new TableDepartment(); TableDepartment dptDepartment = new TableDepartment();
dptDepartment.setDeptname(dept.getDeptname()); dptDepartment.setDeptname(dept.getDeptname());
dptDepartment.setDeptstate(dept.getDeptstate()); dptDepartment.setDeptstate(dept.getDeptstate());
@@ -151,10 +155,12 @@ public class DeptManageAction extends BaseAction {
this.commonService.save(dptDepartment); this.commonService.save(dptDepartment);
// 将添加操作写到操作日志中 // 将添加操作写到操作日志中
this.addDBOperationRpt(commonService, "TABLEDEPARTMENT", "INSERT",dptDepartment.getDeptid()); this.addDBOperationRpt(commonService, "TABLEDEPARTMENT", "INSERT",dptDepartment.getDeptid());
commonService.commit();
outHtmlString("<script type=\"text/javascript\">alert('i18n_DeptManageAction.update.success_n81i');this.location='deptManage!execute.do?action=queryDeptInfo'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_DeptManageAction.update.success_n81i');this.location='deptManage!execute.do?action=queryDeptInfo'</script>");
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
commonService.rollback();
outHtmlString("<script type=\"text/javascript\">alert('i18n_DeptManageAction.update.faild_n81i');this.location='deptManage!execute.do?action=queryDeptInfo'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_DeptManageAction.update.faild_n81i');this.location='deptManage!execute.do?action=queryDeptInfo'</script>");
} }
} }

View File

@@ -592,6 +592,7 @@ public class CheckTypeSetAction extends BaseAction {
String desc = ""; String desc = "";
Metadata metadata = new Metadata(); Metadata metadata = new Metadata();
try { try {
commonService.beginTransaction();
String hql = "from CheckTypeInfo where checkTypeName1=?"; String hql = "from CheckTypeInfo where checkTypeName1=?";
List<CheckTypeInfo> list = commonService.find(hql, checkTypeName1); List<CheckTypeInfo> list = commonService.find(hql, checkTypeName1);
if(list==null||list.size()==0){ if(list==null||list.size()==0){
@@ -672,8 +673,7 @@ public class CheckTypeSetAction extends BaseAction {
this.commonService.save(metadata); this.commonService.save(metadata);
// 将更新操作写到操作日志中 // 将更新操作写到操作日志中
this.addDBOperationRpt(commonService,"metadata", "INSERT", metadata.getId()); this.addDBOperationRpt(commonService,"metadata", "INSERT", metadata.getId());
//与NMSServer通信
this.sendCheckTypeId(checkTypeInfo.getId()+"",commonService);
//如果表已经生成,则需要修改表的结构 //如果表已经生成,则需要修改表的结构
if(new MetaDataSetAction().hasCreatedTable(checkTypeInfo.getTableName())){ if(new MetaDataSetAction().hasCreatedTable(checkTypeInfo.getTableName())){
@@ -687,9 +687,14 @@ public class CheckTypeSetAction extends BaseAction {
//执行添加字段 //执行添加字段
this.commonService.updateBatchBySql(sqlString.toString()); this.commonService.updateBatchBySql(sqlString.toString());
} }
commonService.commit();
//与NMSServer通信
this.sendCheckTypeId(checkTypeInfo.getId()+"",commonService);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
logger.error(e.getStackTrace()); logger.error(e.getStackTrace());
commonService.rollback();
desc = getI18nText("i18n_CheckTypeSetAction.downloadExample.importInfo_n81i"); desc = getI18nText("i18n_CheckTypeSetAction.downloadExample.importInfo_n81i");
} }
return desc; return desc;
@@ -699,6 +704,7 @@ public class CheckTypeSetAction extends BaseAction {
String desc = ""; String desc = "";
CheckTypeInfo checkTypeInfo = new CheckTypeInfo(); CheckTypeInfo checkTypeInfo = new CheckTypeInfo();
try { try {
commonService.beginTransaction();
// 保存节点信息 // 保存节点信息
checkTypeInfo.setCheckTypeName(checkTypeName); checkTypeInfo.setCheckTypeName(checkTypeName);
checkTypeInfo.setCheckTypeName1(checkTypeName1); checkTypeInfo.setCheckTypeName1(checkTypeName1);
@@ -800,8 +806,10 @@ public class CheckTypeSetAction extends BaseAction {
}else{ }else{
this.commonService.save(checkTypeInfo); this.commonService.save(checkTypeInfo);
} }
commonService.commit();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
commonService.rollback();
// logger.error(e.getStackTrace());//i18nlog // logger.error(e.getStackTrace());//i18nlog
desc = getI18nText("i18n_CheckTypeSetAction.downloadExample.importInfo_n81i"); desc = getI18nText("i18n_CheckTypeSetAction.downloadExample.importInfo_n81i");
} }
@@ -1086,6 +1094,7 @@ public class CheckTypeSetAction extends BaseAction {
Date createDate = null; Date createDate = null;
Date dNow=null; Date dNow=null;
try { try {
commonService.beginTransaction();
sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
dNow = new Date(); dNow = new Date();
createDate = sdf.parse(sdf.format(dNow)); createDate = sdf.parse(sdf.format(dNow));
@@ -1216,9 +1225,11 @@ public class CheckTypeSetAction extends BaseAction {
// outHtmlString("<script type=\"text/javascript\">alert('操作成功');this.location='boxSet.do?action=query'</script>"); // outHtmlString("<script type=\"text/javascript\">alert('操作成功');this.location='boxSet.do?action=query'</script>");
// } // }
} }
commonService.commit();
} catch (Exception e) { } catch (Exception e) {
logger.error(e.getStackTrace()); logger.error(e.getStackTrace());
e.printStackTrace(); e.printStackTrace();
commonService.rollback();
outHtmlString("<script type=\"text/javascript\">alert('i18n_DeptManageAction.update.faild_n81i');this.location='checkTypeSet.do?action=query&pageNo="+pageNo+"&pageSize="+pageSize+"'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_DeptManageAction.update.faild_n81i');this.location='checkTypeSet.do?action=query&pageNo="+pageNo+"&pageSize="+pageSize+"'</script>");
} }
} }
@@ -1313,6 +1324,7 @@ public class CheckTypeSetAction extends BaseAction {
public void doUpdateCheckTypeSet()throws Exception{ public void doUpdateCheckTypeSet()throws Exception{
try { try {
commonService.beginTransaction();
CheckTypeInfo cti = (CheckTypeInfo)this.commonService.get(CheckTypeInfo.class, checkTypeInfo.getId()); CheckTypeInfo cti = (CheckTypeInfo)this.commonService.get(CheckTypeInfo.class, checkTypeInfo.getId());
if(!cti.getTableName().equals(checkTypeInfo.getTableName().trim().toUpperCase())){ if(!cti.getTableName().equals(checkTypeInfo.getTableName().trim().toUpperCase())){
//与NMSServer通信 //与NMSServer通信
@@ -1331,16 +1343,19 @@ public class CheckTypeSetAction extends BaseAction {
this.commonService.update(cti); this.commonService.update(cti);
// 将更新操作写到操作日志中 // 将更新操作写到操作日志中
this.addDBOperationRpt(commonService,"check_type_info", "UPDATE", checkTypeInfo.getId()); this.addDBOperationRpt(commonService,"check_type_info", "UPDATE", checkTypeInfo.getId());
commonService.commit();
outHtmlString("<script type=\"text/javascript\">alert('i18n_CheckTypeSetAction.downloadExample.success_n81i');this.location='checkTypeSet.do?action=query&pageNo="+pageNo+"&pageSize="+pageSize+"'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_CheckTypeSetAction.downloadExample.success_n81i');this.location='checkTypeSet.do?action=query&pageNo="+pageNo+"&pageSize="+pageSize+"'</script>");
} catch (Exception e) { } catch (Exception e) {
logger.error(e.getStackTrace()); logger.error(e.getStackTrace());
e.printStackTrace(); e.printStackTrace();
commonService.rollback();
outHtmlString("<script type=\"text/javascript\">alert('i18n_DeptManageAction.update.faild_n81i');this.location='checkTypeSet.do?action=query&pageNo="+pageNo+"&pageSize="+pageSize+"'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_DeptManageAction.update.faild_n81i');this.location='checkTypeSet.do?action=query&pageNo="+pageNo+"&pageSize="+pageSize+"'</script>");
} }
} }
public void delCheckTypeSetInfo()throws Exception{ public void delCheckTypeSetInfo()throws Exception{
try { try {
commonService.beginTransaction();
if(ids!=null && ids.length>0){ if(ids!=null && ids.length>0){
for(Long setid : ids){ for(Long setid : ids){
CheckTypeInfo cti = (CheckTypeInfo)this.commonService.get(CheckTypeInfo.class,setid); CheckTypeInfo cti = (CheckTypeInfo)this.commonService.get(CheckTypeInfo.class,setid);
@@ -1374,9 +1389,11 @@ public class CheckTypeSetAction extends BaseAction {
} }
} }
} }
commonService.commit();
outHtmlString("<script type=\"text/javascript\">alert('i18n_CheckTypeSetAction.downloadExample.success_n81i');this.location='checkTypeSet.do?action=query&pageNo="+pageNo+"&pageSize="+pageSize+"'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_CheckTypeSetAction.downloadExample.success_n81i');this.location='checkTypeSet.do?action=query&pageNo="+pageNo+"&pageSize="+pageSize+"'</script>");
} catch (Exception e) { } catch (Exception e) {
logger.error(e.getStackTrace()); logger.error(e.getStackTrace());
commonService.rollback();
outHtmlString("<script type=\"text/javascript\">alert('i18n_DeptManageAction.update.faild_n81i');this.location='checkTypeSet.do?action=query&pageNo="+pageNo+"&pageSize="+pageSize+"'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_DeptManageAction.update.faild_n81i');this.location='checkTypeSet.do?action=query&pageNo="+pageNo+"&pageSize="+pageSize+"'</script>");
} }
} }

View File

@@ -587,6 +587,7 @@ public class DetectionSetAction extends BaseAction {
String desc = ""; String desc = "";
DetectionSetInfo detectionSetInfo = new DetectionSetInfo(); DetectionSetInfo detectionSetInfo = new DetectionSetInfo();
try { try {
commonService.beginTransaction();
// 保存节点信息 // 保存节点信息
detectionSetInfo.setProcessIdenName(processIdenName); detectionSetInfo.setProcessIdenName(processIdenName);
detectionSetInfo.setProcessIden(processIden); detectionSetInfo.setProcessIden(processIden);
@@ -803,10 +804,12 @@ public class DetectionSetAction extends BaseAction {
// 将更新操作写到操作日志中 // 将更新操作写到操作日志中
this.addDBOperationRpt(commonService, "detection_Set_Info", this.addDBOperationRpt(commonService, "detection_Set_Info",
"INSERT", detectionSetInfo.getId()); "INSERT", detectionSetInfo.getId());
commonService.commit();
// 用来实现即时向客户端发送配置信息 // 用来实现即时向客户端发送配置信息
sendSetInfo(null, detectionSetInfo, commonService); sendSetInfo(null, detectionSetInfo, commonService);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
commonService.rollback();
desc = getI18nText("i18n_DetectionSetAction.downloadExample.nodeInfoImportErr_n81i"); desc = getI18nText("i18n_DetectionSetAction.downloadExample.nodeInfoImportErr_n81i");
} }
return desc; return desc;
@@ -1205,6 +1208,7 @@ public class DetectionSetAction extends BaseAction {
StringBuffer hqlBuffer = null; StringBuffer hqlBuffer = null;
StringBuffer errBuffer = null; StringBuffer errBuffer = null;
try { try {
commonService.beginTransaction();
//先判断设置的节点范围是否重复 //先判断设置的节点范围是否重复
if (detectionSetInfo.getNodeIpsId() != null if (detectionSetInfo.getNodeIpsId() != null
&& !"".equals(detectionSetInfo.getNodeIpsId())) {//节点组和节点都不为空 && !"".equals(detectionSetInfo.getNodeIpsId())) {//节点组和节点都不为空
@@ -1341,7 +1345,7 @@ public class DetectionSetAction extends BaseAction {
// 将更新操作写到操作日志中 // 将更新操作写到操作日志中
this.addDBOperationRpt(commonService, "detection_Set_Info", this.addDBOperationRpt(commonService, "detection_Set_Info",
"INSERT", detectionSetInfo.getId()); "INSERT", detectionSetInfo.getId());
commonService.commit();
// 保存并更新上传的脚本文件 // 保存并更新上传的脚本文件
saveScriptFile(myFile, detectionSetInfo); saveScriptFile(myFile, detectionSetInfo);
@@ -1360,9 +1364,11 @@ public class DetectionSetAction extends BaseAction {
outHtmlString("<script type=\"text/javascript\">alert('i18n_DetectionSetAction.downloadExample.success_n81i');this.location='detectionSet.do?action=query&pageNo=" outHtmlString("<script type=\"text/javascript\">alert('i18n_DetectionSetAction.downloadExample.success_n81i');this.location='detectionSet.do?action=query&pageNo="
+ pageNo + "&pageSize=" + pageSize + "'</script>"); + pageNo + "&pageSize=" + pageSize + "'</script>");
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
logger.error(e.getStackTrace()); logger.error(e.getStackTrace());
commonService.rollback();
outHtmlString("<script type=\"text/javascript\">alert('i18n_DetectionSetAction.downloadExample.faild_n81i');this.location='detectionSet.do?action=query&pageNo=" outHtmlString("<script type=\"text/javascript\">alert('i18n_DetectionSetAction.downloadExample.faild_n81i');this.location='detectionSet.do?action=query&pageNo="
+ pageNo + "&pageSize=" + pageSize + "'</script>"); + pageNo + "&pageSize=" + pageSize + "'</script>");
} }
@@ -1758,7 +1764,7 @@ public class DetectionSetAction extends BaseAction {
// String hql=""; // String hql="";
try { try {
commonService.beginTransaction();
// 判断记录是否存在-end // 判断记录是否存在-end
// 获取修改后检测类别信息 // 获取修改后检测类别信息
@@ -1840,7 +1846,7 @@ public class DetectionSetAction extends BaseAction {
// 将更新操作写到操作日志中 // 将更新操作写到操作日志中
this.addDBOperationRpt(commonService, "detection_Set_Info", this.addDBOperationRpt(commonService, "detection_Set_Info",
"UPDATE", setInfo.getId()); "UPDATE", setInfo.getId());
commonService.commit();
// 保存并更新上传的脚本文件 // 保存并更新上传的脚本文件
saveScriptFile(myFile, detectionSetInfo); saveScriptFile(myFile, detectionSetInfo);
@@ -1850,11 +1856,13 @@ public class DetectionSetAction extends BaseAction {
// 用来实现即时向客户端发送配置信息 // 用来实现即时向客户端发送配置信息
sendSetInfo(setInfo2, setInfo, commonService); sendSetInfo(setInfo2, setInfo, commonService);
} }
outHtmlString("<script type=\"text/javascript\">alert('i18n_DetectionSetAction.downloadExample.success_n81i');this.location='detectionSet.do?action=query&pIden="+pIden+"&ctn="+ctn+"&ip="+ip+"&pageNo=" 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>"); + pageNo + "&pageSize=" + pageSize + "'</script>");
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
logger.error(e.getStackTrace()); 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=" 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>"); + pageNo + "&pageSize=" + pageSize + "'</script>");
} }
@@ -1865,6 +1873,7 @@ public class DetectionSetAction extends BaseAction {
public void handleDetectInfoValid(Long detectSetId,String newSeqIds,String tableName) { public void handleDetectInfoValid(Long detectSetId,String newSeqIds,String tableName) {
if(detectSetId!=null&&tableName!=null&&!"".equals(tableName)) { if(detectSetId!=null&&tableName!=null&&!"".equals(tableName)) {
try { try {
commonService.beginTransaction();
String updateValidSeqIds = ""; String updateValidSeqIds = "";
String updateInvalidSeqIds = ""; String updateInvalidSeqIds = "";
//监测数据表:数据是否有效的更新 //监测数据表:数据是否有效的更新
@@ -1896,7 +1905,9 @@ public class DetectionSetAction extends BaseAction {
this.commonService.updateBySql(updateDetectSql); this.commonService.updateBySql(updateDetectSql);
} }
} }
commonService.commit();
}catch(Exception e) { }catch(Exception e) {
commonService.rollback();
logger.error("Update monitoring data validity",e); logger.error("Update monitoring data validity",e);
} }
} }
@@ -2049,6 +2060,7 @@ public class DetectionSetAction extends BaseAction {
public String stop(){ public String stop(){
try { try {
commonService.beginTransaction();
if(ids !=null && ids.length>0){ if(ids !=null && ids.length>0){
for(int i= 0;i<ids.length;i++){ for(int i= 0;i<ids.length;i++){
List dsList = this.commonService.find( List dsList = this.commonService.find(
@@ -2090,16 +2102,18 @@ public class DetectionSetAction extends BaseAction {
//将更新操作写到操作日志中 //将更新操作写到操作日志中
this.addDBOperationRpt(commonService, "detection_set_info", "UPDATE", ds.getId()); this.addDBOperationRpt(commonService, "detection_set_info", "UPDATE", ds.getId());
commonService.commit();
// 用来实现即时向客户端发送配置信息 // 用来实现即时向客户端发送配置信息
sendSetInfo(dsOld, ds, commonService); sendSetInfo(dsOld, ds, commonService);
} }
} }
} }
outHtmlString("<script type=\"text/javascript\">alert('i18n_DetectionSetAction.downloadExample.success_n81i');this.location='detectionSet.do?action=query&pageNo=" outHtmlString("<script type=\"text/javascript\">alert('i18n_DetectionSetAction.downloadExample.success_n81i');this.location='detectionSet.do?action=query&pageNo="
+ pageNo + "&pageSize=" + pageSize + "'</script>"); + pageNo + "&pageSize=" + pageSize + "'</script>");
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
logger.error(e.getStackTrace()); logger.error(e.getStackTrace());
e.printStackTrace(); e.printStackTrace();
} }
@@ -2108,6 +2122,7 @@ public class DetectionSetAction extends BaseAction {
public String start(){ public String start(){
try { try {
commonService.beginTransaction();
if(ids !=null && ids.length>0){ if(ids !=null && ids.length>0){
for(int i= 0;i<ids.length;i++){ for(int i= 0;i<ids.length;i++){
List dsList = this.commonService.find( List dsList = this.commonService.find(
@@ -2150,18 +2165,20 @@ public class DetectionSetAction extends BaseAction {
//将更新操作写到操作日志中 //将更新操作写到操作日志中
this.addDBOperationRpt(commonService, "detection_set_info", "UPDATE", ds.getId()); this.addDBOperationRpt(commonService, "detection_set_info", "UPDATE", ds.getId());
commonService.commit();
// 用来实现即时向客户端发送脚本文件 // 用来实现即时向客户端发送脚本文件
sendPluginFile(dsOld, ds, myFile, commonService); sendPluginFile(dsOld, ds, myFile, commonService);
// 用来实现即时向客户端发送配置信息 // 用来实现即时向客户端发送配置信息
sendSetInfo(dsOld, ds, commonService); sendSetInfo(dsOld, ds, commonService);
} }
} }
} }
outHtmlString("<script type=\"text/javascript\">alert('i18n_DetectionSetAction.downloadExample.success_n81i');this.location='detectionSet.do?action=query&pageNo=" outHtmlString("<script type=\"text/javascript\">alert('i18n_DetectionSetAction.downloadExample.success_n81i');this.location='detectionSet.do?action=query&pageNo="
+ pageNo + "&pageSize=" + pageSize + "'</script>"); + pageNo + "&pageSize=" + pageSize + "'</script>");
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
logger.error(e.getStackTrace()); logger.error(e.getStackTrace());
e.printStackTrace(); e.printStackTrace();
} }

View File

@@ -278,6 +278,7 @@ public class MetaDataSetAction extends BaseAction {
HttpSession session =null; HttpSession session =null;
try { try {
commonService.beginTransaction();
sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
dNow = new Date(); dNow = new Date();
createDate = sdf.parse(sdf.format(dNow)); createDate = sdf.parse(sdf.format(dNow));
@@ -306,8 +307,7 @@ public class MetaDataSetAction extends BaseAction {
this.commonService.save(metadata); this.commonService.save(metadata);
// 将更新操作写到操作日志中 // 将更新操作写到操作日志中
this.addDBOperationRpt(commonService,"metadata", "INSERT", metadata.getId()); this.addDBOperationRpt(commonService,"metadata", "INSERT", metadata.getId());
//与NMSServer通信
this.sendCheckTypeId(typeInfo.getId()+"",commonService);
//如果表已经生成,则需要修改表的结构 //如果表已经生成,则需要修改表的结构
if(hasCreatedTable(typeInfo.getTableName())){ if(hasCreatedTable(typeInfo.getTableName())){
@@ -330,8 +330,11 @@ public class MetaDataSetAction extends BaseAction {
}else{ }else{
outHtmlString("<script type=\"text/javascript\">alert('i18n_MetaDataSetAction.queryCheckTypeSource.success_n81i');this.location='metaDataSet.do?action=oppAdd&typeids="+checkTypeInfo.getId()+"'</script>"); 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);
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
logger.error(e.getStackTrace()); logger.error(e.getStackTrace());
outHtmlString("<script type=\"text/javascript\">alert('i18n_MetaDataSetAction.queryCheckTypeSource.faild_n81i');this.location='checkTypeSet.do?action=query'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_MetaDataSetAction.queryCheckTypeSource.faild_n81i');this.location='checkTypeSet.do?action=query'</script>");
@@ -496,6 +499,7 @@ public class MetaDataSetAction extends BaseAction {
int max =0; int max =0;
boolean d = false; boolean d = false;
try { try {
commonService.beginTransaction();
sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
dNow = new Date(); dNow = new Date();
updateDate = sdf.parse(sdf.format(dNow)); updateDate = sdf.parse(sdf.format(dNow));
@@ -631,9 +635,11 @@ public class MetaDataSetAction extends BaseAction {
this.outHtmlString("<script>alert('i18n_MetaDataSetAction.queryCheckTypeSource.updateTable_n81i');history.back();</script>"); this.outHtmlString("<script>alert('i18n_MetaDataSetAction.queryCheckTypeSource.updateTable_n81i');history.back();</script>");
return; return;
} }
commonService.commit();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
logger.error(e.getStackTrace()); logger.error(e.getStackTrace());
commonService.rollback();
outHtmlString("<script type=\"text/javascript\">alert('i18n_MetaDataSetAction.queryCheckTypeSource.faild_n81i');this.location='metaDataSet.do?action=query&typeids="+checkTypeInfo.getId()+"'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_MetaDataSetAction.queryCheckTypeSource.faild_n81i');this.location='metaDataSet.do?action=query&typeids="+checkTypeInfo.getId()+"'</script>");
} }
this.checkTable(); this.checkTable();
@@ -674,6 +680,7 @@ public class MetaDataSetAction extends BaseAction {
public void doUpdateMetaDataInfoList()throws Exception{ public void doUpdateMetaDataInfoList()throws Exception{
if(metadataList!=null){ if(metadataList!=null){
try { try {
commonService.beginTransaction();
Map<String,String> map = this.getAllDictionary(); Map<String,String> map = this.getAllDictionary();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date dNow = new Date(); Date dNow = new Date();
@@ -761,9 +768,11 @@ public class MetaDataSetAction extends BaseAction {
// return null; // return null;
// } // }
} }
commonService.commit();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
logger.error(e.getStackTrace()); logger.error(e.getStackTrace());
commonService.rollback();
outHtmlString("<script type=\"text/javascript\">alert('i18n_MetaDataSetAction.queryCheckTypeSource.faild_n81i');this.location='metaDataSet.do?action=query&typeids="+typeids[0]+"'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_MetaDataSetAction.queryCheckTypeSource.faild_n81i');this.location='metaDataSet.do?action=query&typeids="+typeids[0]+"'</script>");
} }
this.checkTable(); this.checkTable();
@@ -880,6 +889,7 @@ public class MetaDataSetAction extends BaseAction {
String oneFiledString=""; String oneFiledString="";
StringBuffer fileds = new StringBuffer(); StringBuffer fileds = new StringBuffer();
try { try {
commonService.beginTransaction();
if(typeids!=null && typeids.length>0){ if(typeids!=null && typeids.length>0){
String hql = "from Metadata where 1=1 and checkTypeInfo.id="+typeids[0]; String hql = "from Metadata where 1=1 and checkTypeInfo.id="+typeids[0];
metaList = this.commonService.find(hql); metaList = this.commonService.find(hql);
@@ -936,10 +946,11 @@ public class MetaDataSetAction extends BaseAction {
} }
} }
commonService.commit();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
logger.error(e.getStackTrace()); logger.error(e.getStackTrace());
commonService.rollback();
} }
return this.queryCheckTypeSource(); return this.queryCheckTypeSource();
} }
@@ -954,6 +965,7 @@ public class MetaDataSetAction extends BaseAction {
StringBuffer sql= new StringBuffer(); StringBuffer sql= new StringBuffer();
StringBuffer cIndexFileds = new StringBuffer("data_check_time:seq_id:detection_set_info_id:"); StringBuffer cIndexFileds = new StringBuffer("data_check_time:seq_id:detection_set_info_id:");
try { try {
commonService.beginTransaction();
//所有的字段名均不可为空 //所有的字段名均不可为空
if(typeids!=null&&typeids.length>0) { if(typeids!=null&&typeids.length>0) {
String isFieldNullHql = "from Metadata where checkTypeInfo.id = " + typeids[0] + " and state = '0' and filedName is null "; String isFieldNullHql = "from Metadata where checkTypeInfo.id = " + typeids[0] + " and state = '0' and filedName is null ";
@@ -1011,10 +1023,11 @@ public class MetaDataSetAction extends BaseAction {
this.outHtmlString("<script>alert('i18n_MetaDataSetAction.queryCheckTypeSource.pleaseAddField_n81i');history.back();</script>"); this.outHtmlString("<script>alert('i18n_MetaDataSetAction.queryCheckTypeSource.pleaseAddField_n81i');history.back();</script>");
return; return;
} }
commonService.commit();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
logger.error(e.getStackTrace()); logger.error(e.getStackTrace());
commonService.rollback();
outHtmlString("<script type=\"text/javascript\">alert('i18n_MetaDataSetAction.queryCheckTypeSource.faild_n81i');this.location='metaDataSet.do?action=query&typeids="+typeids[0]+"'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_MetaDataSetAction.queryCheckTypeSource.faild_n81i');this.location='metaDataSet.do?action=query&typeids="+typeids[0]+"'</script>");
} }
this.checkTable(); this.checkTable();

View File

@@ -80,6 +80,7 @@ public class OidDictionaryAction extends BaseAction {
public void addOidDictionary(){ public void addOidDictionary(){
try { try {
commonService.beginTransaction();
if(checkOid(od.getOid())){ if(checkOid(od.getOid())){
this.commonService.save(od); this.commonService.save(od);
// 将添加操作写到操作日志中 // 将添加操作写到操作日志中
@@ -90,7 +91,9 @@ public class OidDictionaryAction extends BaseAction {
this.outHtmlString("<script>alert('i18n_OidDictionaryAction.queryDictionary.oidExists_n81i');history.back();</script>"); this.outHtmlString("<script>alert('i18n_OidDictionaryAction.queryDictionary.oidExists_n81i');history.back();</script>");
return; return;
} }
commonService.commit();
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
logger.error(e.getStackTrace()); logger.error(e.getStackTrace());
this.outHtmlString("<script>alert('i18n_OidDictionaryAction.queryDictionary.addBoxFaild_n81i');history.back();</script>"); this.outHtmlString("<script>alert('i18n_OidDictionaryAction.queryDictionary.addBoxFaild_n81i');history.back();</script>");
return; return;
@@ -118,6 +121,7 @@ public class OidDictionaryAction extends BaseAction {
public void doUpdOidDictionary(){ public void doUpdOidDictionary(){
try { try {
commonService.beginTransaction();
List list = this.commonService.find("from OidDictionary where oid=? and id<>?", List list = this.commonService.find("from OidDictionary where oid=? and id<>?",
od.getOid().trim(),od.getId()); od.getOid().trim(),od.getId());
if (list != null && list.size() > 0){ if (list != null && list.size() > 0){
@@ -132,8 +136,10 @@ public class OidDictionaryAction extends BaseAction {
// 将更新操作写到操作日志中 // 将更新操作写到操作日志中
this.addDBOperationRpt(commonService, "oid_dictionary", "UPDATE", this.addDBOperationRpt(commonService, "oid_dictionary", "UPDATE",
md.getId()); md.getId());
commonService.commit();
outHtmlString("<script type=\"text/javascript\">alert('i18n_OidDictionaryAction.queryDictionary.success_n81i');this.location='oidDictionary.do?action=query&pageNo="+pageNo+"&pageSize="+pageSize+"'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_OidDictionaryAction.queryDictionary.success_n81i');this.location='oidDictionary.do?action=query&pageNo="+pageNo+"&pageSize="+pageSize+"'</script>");
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
logger.error(e.getStackTrace()); logger.error(e.getStackTrace());
this.outHtmlString("<script>alert('i18n_OidDictionaryAction.queryDictionary.updateFaild_n81i');history.back();</script>"); this.outHtmlString("<script>alert('i18n_OidDictionaryAction.queryDictionary.updateFaild_n81i');history.back();</script>");
return; return;

View File

@@ -228,6 +228,7 @@ public class PoliceSetAction extends BaseAction {
public void addPoliceSetInfo() throws Exception{ public void addPoliceSetInfo() throws Exception{
DetectionSetInfo dsi = null; DetectionSetInfo dsi = null;
try { try {
commonService.beginTransaction();
String sql = "select count(*) from data_police_relation t where DETECTION_SET_INFO_ID =" String sql = "select count(*) from data_police_relation t where DETECTION_SET_INFO_ID ="
+ setId + setId
+ " and METADATA_ID =" + " and METADATA_ID ="
@@ -247,8 +248,10 @@ public class PoliceSetAction extends BaseAction {
this.commonService.save(dataPoliceRelation); this.commonService.save(dataPoliceRelation);
// 将更新操作写到操作日志中 // 将更新操作写到操作日志中
this.addDBOperationRpt(commonService,"data_police_relation", "INSERT", dataPoliceRelation.getId()); this.addDBOperationRpt(commonService,"data_police_relation", "INSERT", dataPoliceRelation.getId());
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>"); 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) { } catch (Exception e) {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
logger.error(e.getStackTrace()); 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>"); 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>");
@@ -276,6 +279,7 @@ public class PoliceSetAction extends BaseAction {
public void doUpdatePoliceSet() throws Exception{ public void doUpdatePoliceSet() throws Exception{
try { try {
commonService.beginTransaction();
List list = this.commonService List list = this.commonService
.find( .find(
"from DataPoliceRelation where detectionSetInfo.id=? and metadata.id=? and id<>?", "from DataPoliceRelation where detectionSetInfo.id=? and metadata.id=? and id<>?",
@@ -309,6 +313,7 @@ public class PoliceSetAction extends BaseAction {
dpRelation.setMarker(dataPoliceRelation.getMarker()); dpRelation.setMarker(dataPoliceRelation.getMarker());
dpRelation.setMarkerFiledId(dataPoliceRelation.getMarkerFiledId()); dpRelation.setMarkerFiledId(dataPoliceRelation.getMarkerFiledId());
this.commonService.update(dpRelation); this.commonService.update(dpRelation);
commonService.commit();
// 将更新操作写到操作日志中 // 将更新操作写到操作日志中
this.addDBOperationRpt(commonService,"data_police_relation", "UPDATE", dpRelation.getId()); this.addDBOperationRpt(commonService,"data_police_relation", "UPDATE", dpRelation.getId());
sendSetInfo(null,ds,commonService); sendSetInfo(null,ds,commonService);
@@ -316,9 +321,11 @@ public class PoliceSetAction extends BaseAction {
if(setId != null){ if(setId != null){
setIdStr = "&setId="+setId; setIdStr = "&setId="+setId;
} }
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>"; 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); outHtmlString(str);
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
logger.error(e.getStackTrace()); logger.error(e.getStackTrace());
String setIdStr = ""; String setIdStr = "";

View File

@@ -2512,6 +2512,7 @@ public class SwitchDetectionAction extends BaseAction {
public void addSpecialDeviceConfig() { public void addSpecialDeviceConfig() {
try { try {
commonService.beginTransaction();
if (StringUtils.isNotBlank(seqId) && rootDevice != null && deviceConfigList.size() > 0) { if (StringUtils.isNotBlank(seqId) && rootDevice != null && deviceConfigList.size() > 0) {
// 第一步配置之前先从node_figure_info表里删除seqId的相应配置 // 第一步配置之前先从node_figure_info表里删除seqId的相应配置
this.commonService.delete(NodeFigureInfo.class, "seqid", Long.parseLong(seqId)); this.commonService.delete(NodeFigureInfo.class, "seqid", Long.parseLong(seqId));
@@ -2562,9 +2563,11 @@ public class SwitchDetectionAction extends BaseAction {
} }
} }
} }
commonService.commit();
outHtmlString( outHtmlString(
"<script type=\"text/javascript\">alert(\"i18n_SwitchDetectionAction.emportXls.configSuccess_n81i\");this.location='switchDetection.do?action=toConfigSpecialDevice'</script>"); "<script type=\"text/javascript\">alert(\"i18n_SwitchDetectionAction.emportXls.configSuccess_n81i\");this.location='switchDetection.do?action=toConfigSpecialDevice'</script>");
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
logger.error("Get subdevice of device model " + deviceBrandTypeCode + " exception", e); logger.error("Get subdevice of device model " + deviceBrandTypeCode + " exception", e);
} }
} }
@@ -2723,6 +2726,7 @@ public class SwitchDetectionAction extends BaseAction {
private void configAndSaveNodeFigureInfo(List<DeviceInfo> devConfigList, Date createDate, Long nodePid, private void configAndSaveNodeFigureInfo(List<DeviceInfo> devConfigList, Date createDate, Long nodePid,
String devParShowIndex, String parDevCode, String posiIndex, Long parX, Long parY) { String devParShowIndex, String parDevCode, String posiIndex, Long parX, Long parY) {
try { try {
commonService.beginTransaction();
if (devConfigList != null && devConfigList.size() > 0 && StringUtils.isNotBlank(devParShowIndex) if (devConfigList != null && devConfigList.size() > 0 && StringUtils.isNotBlank(devParShowIndex)
&& StringUtils.isNotBlank(parDevCode) && nodePid != null && createDate != null) { && StringUtils.isNotBlank(parDevCode) && nodePid != null && createDate != null) {
@@ -2750,7 +2754,9 @@ public class SwitchDetectionAction extends BaseAction {
} }
} }
} }
commonService.commit();
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
logger.error("Recursive generation of nodeFigureInfo records exception", e); logger.error("Recursive generation of nodeFigureInfo records exception", e);
} }
} }

View File

@@ -69,6 +69,7 @@ public class FunctionManagerAction extends BaseAction {
XtMkJbxx xt = null; XtMkJbxx xt = null;
List<XtMkJbxx> newFunctionlists = null; List<XtMkJbxx> newFunctionlists = null;
try { try {
commonService.beginTransaction();
// 判断是否是修改排序 // 判断是否是修改排序
if (sort != null) { if (sort != null) {
// 上升 // 上升
@@ -134,8 +135,9 @@ public class FunctionManagerAction extends BaseAction {
}else{ }else{
updateMKInfo(); updateMKInfo();
} }
commonService.commit();
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
outHtmlString("2"); outHtmlString("2");
//outHtmlString("<script type=\"text/javascript\">alert('操作失败');this.location='functionManager.do?action=queryMkInfo'</script>"); //outHtmlString("<script type=\"text/javascript\">alert('操作失败');this.location='functionManager.do?action=queryMkInfo'</script>");
@@ -168,6 +170,7 @@ public class FunctionManagerAction extends BaseAction {
public String updateMKInfo(){ public String updateMKInfo(){
try { try {
commonService.beginTransaction();
XtMkJbxx md = (XtMkJbxx) commonService.get(XtMkJbxx.class, module XtMkJbxx md = (XtMkJbxx) commonService.get(XtMkJbxx.class, module
.getId()); .getId());
md.setMkmc(module.getMkmc()); md.setMkmc(module.getMkmc());
@@ -202,8 +205,10 @@ public class FunctionManagerAction extends BaseAction {
// 将更新操作写到操作日志中 // 将更新操作写到操作日志中
this.addDBOperationRpt(commonService, "XT_MK_JBXX", "UPDATE",module.getId()); this.addDBOperationRpt(commonService, "XT_MK_JBXX", "UPDATE",module.getId());
outHtmlString("<script type=\"text/javascript\">alert('i18n_FunctionManagerAction.updateMKInfo.success_n81i');this.location='functionManager.do?action=queryMkInfo'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_FunctionManagerAction.updateMKInfo.success_n81i');this.location='functionManager.do?action=queryMkInfo'</script>");
commonService.commit();
return null; return null;
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
outHtmlString("<script type=\"text/javascript\">alert('i18n_FunctionManagerAction.updateMKInfo.faild_n81i');this.location='functionManager.do?action=queryMkInfo'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_FunctionManagerAction.updateMKInfo.faild_n81i');this.location='functionManager.do?action=queryMkInfo'</script>");
return null; return null;
@@ -213,6 +218,7 @@ public class FunctionManagerAction extends BaseAction {
// 添加模块信息操作 // 添加模块信息操作
public String addMk() { public String addMk() {
try { try {
commonService.beginTransaction();
if(module.getPid()==null){ if(module.getPid()==null){
module.setPid(0l); module.setPid(0l);
} }
@@ -226,9 +232,11 @@ public class FunctionManagerAction extends BaseAction {
this.commonService.save(module); this.commonService.save(module);
// 将添加操作写到操作日志中 // 将添加操作写到操作日志中
this.addDBOperationRpt(commonService, "XT_MK_JBXX", "INSERT",module.getId()); this.addDBOperationRpt(commonService, "XT_MK_JBXX", "INSERT",module.getId());
commonService.commit();
outHtmlString("<script type=\"text/javascript\">alert('i18n_FunctionManagerAction.updateMKInfo.success_n81i');this.location='functionManager.do?action=queryMkInfo'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_FunctionManagerAction.updateMKInfo.success_n81i');this.location='functionManager.do?action=queryMkInfo'</script>");
return null; return null;
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
outHtmlString("<script type=\"text/javascript\">alert('i18n_FunctionManagerAction.updateMKInfo.faild_n81i');this.location='functionManager.do?action=queryMkInfo'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_FunctionManagerAction.updateMKInfo.faild_n81i');this.location='functionManager.do?action=queryMkInfo'</script>");
return null; return null;
@@ -238,6 +246,7 @@ public class FunctionManagerAction extends BaseAction {
// 注销模块信息操作 // 注销模块信息操作
public String delMk() { public String delMk() {
try { try {
commonService.beginTransaction();
XtMkJbxx md = (XtMkJbxx) commonService.get(XtMkJbxx.class, module.getId()); XtMkJbxx md = (XtMkJbxx) commonService.get(XtMkJbxx.class, module.getId());
md.setZxbz("1"); md.setZxbz("1");
this.commonService.update(md); this.commonService.update(md);
@@ -246,8 +255,10 @@ public class FunctionManagerAction extends BaseAction {
module.getId()); module.getId());
this.addDBOperationRpt(commonService, "XT_MK_JBXX", "INSERT",module.getId()); this.addDBOperationRpt(commonService, "XT_MK_JBXX", "INSERT",module.getId());
outHtmlString("<script type=\"text/javascript\">alert('i18n_FunctionManagerAction.updateMKInfo.success_n81i');this.location='functionManager.do?action=queryMkInfo'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_FunctionManagerAction.updateMKInfo.success_n81i');this.location='functionManager.do?action=queryMkInfo'</script>");
commonService.commit();
return null; return null;
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
outHtmlString("<script type=\"text/javascript\">alert('i18n_FunctionManagerAction.updateMKInfo.faild_n81i');this.location='functionManager.do?action=queryMkInfo'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_FunctionManagerAction.updateMKInfo.faild_n81i');this.location='functionManager.do?action=queryMkInfo'</script>");
return null; return null;

View File

@@ -293,6 +293,7 @@ public class SimpleMissionAction extends BaseAction{
@SuppressWarnings("static-access") @SuppressWarnings("static-access")
private String addMissionParameter1(){ private String addMissionParameter1(){
try { try {
commonService.beginTransaction();
XtYhJbxx user = this.getUser(); XtYhJbxx user = this.getUser();
//保存上传文件 //保存上传文件
String uploadFilePath = getConfigValue("uploadServerPath"); String uploadFilePath = getConfigValue("uploadServerPath");
@@ -343,7 +344,9 @@ public class SimpleMissionAction extends BaseAction{
MSG = "i18n_SimpleMissionAction.check.message1_n81i"; MSG = "i18n_SimpleMissionAction.check.message1_n81i";
outHtmlString("<script type=\"text/javascript\">alert('"+MSG+"');this.history.go(-1);</script>"); outHtmlString("<script type=\"text/javascript\">alert('"+MSG+"');this.history.go(-1);</script>");
} }
commonService.commit();
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
} }
return null; return null;
@@ -351,6 +354,7 @@ public class SimpleMissionAction extends BaseAction{
//配置验证任务添加方法 //配置验证任务添加方法
private String addMissionParameter2(){ private String addMissionParameter2(){
try { try {
commonService.beginTransaction();
XtYhJbxx user = this.getUser(); XtYhJbxx user = this.getUser();
// String uploadFilePath = getConfigValue("uploadServerPath"); // String uploadFilePath = getConfigValue("uploadServerPath");
@@ -410,7 +414,9 @@ public class SimpleMissionAction extends BaseAction{
MSG = "i18n_SimpleMissionAction.check.message2_n81i"; MSG = "i18n_SimpleMissionAction.check.message2_n81i";
outHtmlString("<script type=\"text/javascript\">alert('"+MSG+"');this.history.go(-1);</script>"); outHtmlString("<script type=\"text/javascript\">alert('"+MSG+"');this.history.go(-1);</script>");
} }
commonService.commit();
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
} }
return null; return null;

View File

@@ -129,6 +129,7 @@ public class NmsErrorInfoAction extends BaseAction {
private String changeState(){ private String changeState(){
if(ids != null){ if(ids != null){
try { try {
commonService.beginTransaction();
/* 当前用户ID */ /* 当前用户ID */
this.getUserID(); this.getUserID();
/* 当前用户ID */ /* 当前用户ID */
@@ -159,8 +160,10 @@ public class NmsErrorInfoAction extends BaseAction {
outHtmlString("<script type=\"text/javascript\">alert('i18n_NmsErrorInfoAction.query.faild_n81i');" outHtmlString("<script type=\"text/javascript\">alert('i18n_NmsErrorInfoAction.query.faild_n81i');"
+ "this.location='nmsErrorInfo.do?action=query&pageNo=" + "this.location='nmsErrorInfo.do?action=query&pageNo="
+ pageNo + "&pageSize=" + pageSize + "&position=" + position + "&errorCodeStr=" + errorCodeStr + "&errorIp=" + errorIp + "&eiState=" + (eiState==null?"":eiState) + "'</script>"); + pageNo + "&pageSize=" + pageSize + "&position=" + position + "&errorCodeStr=" + errorCodeStr + "&errorIp=" + errorIp + "&eiState=" + (eiState==null?"":eiState) + "'</script>");
commonService.commit();
return null; return null;
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
this.outHtmlString("<script>alert('i18n_NmsErrorInfoAction.query.queryFaild_n81i');history.back();</script>"); this.outHtmlString("<script>alert('i18n_NmsErrorInfoAction.query.queryFaild_n81i');history.back();</script>");
return null; return null;

View File

@@ -1386,6 +1386,7 @@ public class NmsTaskManagerAction extends BaseAction {
private void updateLoopMissionStateAndDescByMissId(String missionId) { private void updateLoopMissionStateAndDescByMissId(String missionId) {
if (StringUtils.isNotBlank(missionId)) { if (StringUtils.isNotBlank(missionId)) {
try { try {
commonService.beginTransaction();
// 第一步--更新任务的状态描述 // 第一步--更新任务的状态描述
/* /*
* String selectSql = * String selectSql =
@@ -1520,8 +1521,9 @@ public class NmsTaskManagerAction extends BaseAction {
// 发送邮件------------------- // 发送邮件-------------------
commonService.sendEmailForMission(Long.parseLong(missionId), getI18nText("i18n_NmsTaskManagerAction.executeAction.missionExec_n81i"), getI18nText("i18n_NmsTaskManagerAction.executeAction.missionComplete_n81i")); commonService.sendEmailForMission(Long.parseLong(missionId), getI18nText("i18n_NmsTaskManagerAction.executeAction.missionExec_n81i"), getI18nText("i18n_NmsTaskManagerAction.executeAction.missionComplete_n81i"));
} }
commonService.commit();
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
logger.error("After determining failure,the state of the current task is recounted and the status description(non cyclical) exception is described", e); logger.error("After determining failure,the state of the current task is recounted and the status description(non cyclical) exception is described", e);
} }
} }
@@ -2225,6 +2227,7 @@ public class NmsTaskManagerAction extends BaseAction {
public void updateDate() { public void updateDate() {
try { try {
commonService.beginTransaction();
if (missionstatetable.getMissionType() == 1) {// 文件推送 if (missionstatetable.getMissionType() == 1) {// 文件推送
MissionStateTable missionstate = (MissionStateTable) this.commonService.get(MissionStateTable.class, MissionStateTable missionstate = (MissionStateTable) this.commonService.get(MissionStateTable.class,
missionstatetable.getMissionId()); missionstatetable.getMissionId());
@@ -2277,7 +2280,9 @@ public class NmsTaskManagerAction extends BaseAction {
this.addDBOperationRpt(commonService, "mission_parameter_table1", "UPDATE", this.addDBOperationRpt(commonService, "mission_parameter_table1", "UPDATE",
missionstatetable.getMissionId()); missionstatetable.getMissionId());
} }
commonService.commit();
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
outHtmlString( outHtmlString(
"<script type=\"text/javascript\">alert('i18n_NmsTaskManagerAction.executeAction.faild_n81i');this.location='nmsTaskManager.do?action=query'</script>"); "<script type=\"text/javascript\">alert('i18n_NmsTaskManagerAction.executeAction.faild_n81i');this.location='nmsTaskManager.do?action=query'</script>");
@@ -2303,6 +2308,7 @@ public class NmsTaskManagerAction extends BaseAction {
*/ */
public String updateState() { public String updateState() {
try { try {
commonService.beginTransaction();
// - 状态变更操作标识 1(已创建) <--> (准备撤销)5 // - 状态变更操作标识 1(已创建) <--> (准备撤销)5
String curstate = this.getRequest().getParameter("curstate"); String curstate = this.getRequest().getParameter("curstate");
@@ -2375,6 +2381,7 @@ public class NmsTaskManagerAction extends BaseAction {
// 将更新操作写到操作日志中 // 将更新操作写到操作日志中
this.addDBOperationRpt(commonService, "mission_state_table", "UPDATE", pid[i]); this.addDBOperationRpt(commonService, "mission_state_table", "UPDATE", pid[i]);
commonService.commit();
sendMissionInfoId(pid[i], 0l, commonService); sendMissionInfoId(pid[i], 0l, commonService);
// sendMissionInfoId(missionstatetable.getMissionId(),1l); // sendMissionInfoId(missionstatetable.getMissionId(),1l);
} }
@@ -2388,6 +2395,7 @@ public class NmsTaskManagerAction extends BaseAction {
} }
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
outHtmlString("<script type=\"text/javascript\">alert('i18n_NmsTaskManagerAction.executeAction.faild_n81i');" outHtmlString("<script type=\"text/javascript\">alert('i18n_NmsTaskManagerAction.executeAction.faild_n81i');"
+ "this.location='nmsTaskManager.do?action=query&pageNo=" + pageNo + "&pageSize=" + pageSize + "this.location='nmsTaskManager.do?action=query&pageNo=" + pageNo + "&pageSize=" + pageSize
+ "'</script>"); + "'</script>");
@@ -4144,6 +4152,7 @@ public class NmsTaskManagerAction extends BaseAction {
public void saveFailedNodesTask() { public void saveFailedNodesTask() {
try { try {
commonService.beginTransaction();
String oldMissionIdStr = this.getRequest().getParameter("oldMissionId"); String oldMissionIdStr = this.getRequest().getParameter("oldMissionId");
Long oldMissionId = Long.parseLong(oldMissionIdStr); Long oldMissionId = Long.parseLong(oldMissionIdStr);
MissionStateTable missionStateTable0 = (MissionStateTable) this.commonService.get(MissionStateTable.class, MissionStateTable missionStateTable0 = (MissionStateTable) this.commonService.get(MissionStateTable.class,
@@ -4241,8 +4250,10 @@ public class NmsTaskManagerAction extends BaseAction {
default: default:
break; break;
} }
commonService.commit();
sendMissionInfoId(stateTable.getMissionId(), 0l, commonService); sendMissionInfoId(stateTable.getMissionId(), 0l, commonService);
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
outHtmlString("<script type=\"text/javascript\">alert('i18n_NmsTaskManagerAction.executeAction.faild_n81i');window.history.go(-1);</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_NmsTaskManagerAction.executeAction.faild_n81i');window.history.go(-1);</script>");
} }
@@ -4253,6 +4264,7 @@ public class NmsTaskManagerAction extends BaseAction {
@SuppressWarnings("static-access") @SuppressWarnings("static-access")
public void saveTaskbyType() { public void saveTaskbyType() {
try { try {
commonService.beginTransaction();
// -- 命令参数格式校验 // -- 命令参数格式校验
// -- 2012-3-7 修改界面参数显示形式后不在进行格式校验默认设置值为0 // -- 2012-3-7 修改界面参数显示形式后不在进行格式校验默认设置值为0
commandParaCheck = 0; commandParaCheck = 0;
@@ -4690,6 +4702,7 @@ public class NmsTaskManagerAction extends BaseAction {
missionstatetable.getMissionId()); missionstatetable.getMissionId());
// sendInfo(missionstatetable.getMissionId(),0l,new // sendInfo(missionstatetable.getMissionId(),0l,new
// File(fileName)); // File(fileName));
commonService.commit();
logger.debug("开始发送任务信息任务id" + missionstatetable.getMissionId()); logger.debug("开始发送任务信息任务id" + missionstatetable.getMissionId());
sendMissionInfoId(missionstatetable.getMissionId(), 0l, commonService); sendMissionInfoId(missionstatetable.getMissionId(), 0l, commonService);
} }
@@ -4704,7 +4717,9 @@ public class NmsTaskManagerAction extends BaseAction {
outHtmlString( outHtmlString(
"<script type=\"text/javascript\">alert('i18n_NmsTaskManagerAction.executeAction.success_n81i');this.location='nmsTaskManager.do?action=query'</script>"); "<script type=\"text/javascript\">alert('i18n_NmsTaskManagerAction.executeAction.success_n81i');this.location='nmsTaskManager.do?action=query'</script>");
} }
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
outHtmlString( outHtmlString(
"<script type=\"text/javascript\">alert('i18n_NmsTaskManagerAction.executeAction.faild_n81i');this.location='nmsTaskManager.do?action=query'</script>"); "<script type=\"text/javascript\">alert('i18n_NmsTaskManagerAction.executeAction.faild_n81i');this.location='nmsTaskManager.do?action=query'</script>");
@@ -4720,6 +4735,7 @@ public class NmsTaskManagerAction extends BaseAction {
*/ */
public void saveConverseTask() { public void saveConverseTask() {
try { try {
commonService.beginTransaction();
// -- 2012-3-9 // -- 2012-3-9
// 修改界面参数显示形式后相应参数的处理为有文件推送的List列表的各对象设置文件名并将各对象转换为JSon字符串 // 修改界面参数显示形式后相应参数的处理为有文件推送的List列表的各对象设置文件名并将各对象转换为JSon字符串
@@ -4847,8 +4863,9 @@ public class NmsTaskManagerAction extends BaseAction {
outHtmlString( outHtmlString(
"<script type=\"text/javascript\">alert('i18n_NmsTaskManagerAction.executeAction.success_n81i');this.location='nmsTaskManager.do?action=query'</script>"); "<script type=\"text/javascript\">alert('i18n_NmsTaskManagerAction.executeAction.success_n81i');this.location='nmsTaskManager.do?action=query'</script>");
} }
commonService.commit();
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
outHtmlString( outHtmlString(
"<script type=\"text/javascript\">alert('操作失败');this.location='nmsTaskManager.do?action=query'</script>"); "<script type=\"text/javascript\">alert('操作失败');this.location='nmsTaskManager.do?action=query'</script>");

View File

@@ -293,6 +293,7 @@ public class NodeGroupManageAction extends BaseAction {
String desc = ""; String desc = "";
NodegroupTable nodegroupTable=new NodegroupTable(); NodegroupTable nodegroupTable=new NodegroupTable();
try { try {
commonService.beginTransaction();
// 保存节点信息 // 保存节点信息
nodegroupTable.setGroupName(groupName); nodegroupTable.setGroupName(groupName);
nodegroupTable.setViewLevel(3l); nodegroupTable.setViewLevel(3l);
@@ -398,13 +399,14 @@ public class NodeGroupManageAction extends BaseAction {
//将添加操作写到操作日志中 //将添加操作写到操作日志中
this.addDBOperationRpt(commonService, "nodegroup_table", "INSERT", nodegroupTable.getGroupId()); this.addDBOperationRpt(commonService, "nodegroup_table", "INSERT", nodegroupTable.getGroupId());
commonService.commit();
// 用来实现即时向客户端发送脚本文件 // 用来实现即时向客户端发送脚本文件
this.sendPluginFile(nodegroupTable.getGroupId(), null,commonService); this.sendPluginFile(nodegroupTable.getGroupId(), null,commonService);
this.sendNodeAndGroupId(nodegroupTable.getGroupId(), null,commonService);//通知NMSServer更新节点组的监控信息 this.sendNodeAndGroupId(nodegroupTable.getGroupId(), null,commonService);//通知NMSServer更新节点组的监控信息
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
desc = getI18nText("i18n_NodeGroupManageAction.downloadExample.nodeInfoExportErr_n81i"); desc = getI18nText("i18n_NodeGroupManageAction.downloadExample.nodeInfoExportErr_n81i");
} }
@@ -792,7 +794,7 @@ public class NodeGroupManageAction extends BaseAction {
//添加节点组 //添加节点组
public String addNodeGroupInfo(){ public String addNodeGroupInfo(){
try{ try{
commonService.beginTransaction();
//创建子节点组父节点id!=0时有节点的节点组不能添加子节点组 //创建子节点组父节点id!=0时有节点的节点组不能添加子节点组
if(nodeGroup.getParentGroupId()!=0) { if(nodeGroup.getParentGroupId()!=0) {
List subNodeList = this.commonService.find("from NodeTable where groupId=?", nodeGroup.getParentGroupId()); List subNodeList = this.commonService.find("from NodeTable where groupId=?", nodeGroup.getParentGroupId());
@@ -884,7 +886,7 @@ public class NodeGroupManageAction extends BaseAction {
//将添加操作写到操作日志中 //将添加操作写到操作日志中
this.addDBOperationRpt(commonService, "nodegroup_table", "INSERT", nodeGroup.getGroupId()); this.addDBOperationRpt(commonService, "nodegroup_table", "INSERT", nodeGroup.getGroupId());
commonService.commit();
// 用来实现即时向客户端发送脚本文件 // 用来实现即时向客户端发送脚本文件
this.sendPluginFile(nodeGroup.getGroupId(), null,commonService); this.sendPluginFile(nodeGroup.getGroupId(), null,commonService);
@@ -898,7 +900,9 @@ public class NodeGroupManageAction extends BaseAction {
}else{ }else{
this.outHtmlString("<script>alert('i18n_NodeGroupManageAction.downloadExample.success_n81i');this.location='nodeGroupManage!execute.do?action=queryNodeGroupInfo&showStopNGroup="+showStopNGroup+"'</script>"); this.outHtmlString("<script>alert('i18n_NodeGroupManageAction.downloadExample.success_n81i');this.location='nodeGroupManage!execute.do?action=queryNodeGroupInfo&showStopNGroup="+showStopNGroup+"'</script>");
} }
}catch (Exception e){ }catch (Exception e){
commonService.rollback();
logger.error(e.getStackTrace()); logger.error(e.getStackTrace());
e.printStackTrace(); e.printStackTrace();
this.outHtmlString("<script>alert('i18n_NodeGroupManageAction.downloadExample.faild_n81i');this.location='nodeGroupManage!execute.do?action=queryNodeGroupInfo&showStopNGroup="+showStopNGroup+"'</script>"); this.outHtmlString("<script>alert('i18n_NodeGroupManageAction.downloadExample.faild_n81i');this.location='nodeGroupManage!execute.do?action=queryNodeGroupInfo&showStopNGroup="+showStopNGroup+"'</script>");
@@ -910,6 +914,7 @@ public class NodeGroupManageAction extends BaseAction {
//修改节点组 //修改节点组
public String updateNodeGroupInfo(){ public String updateNodeGroupInfo(){
try{ try{
commonService.beginTransaction();
//判断同一父亲节点组下的子节点组是否重名 //判断同一父亲节点组下的子节点组是否重名
List list = this.commonService.find("from NodegroupTable where groupName=? and parentGroupId=? and systemId =? and groupId <>?", List list = this.commonService.find("from NodegroupTable where groupName=? and parentGroupId=? and systemId =? and groupId <>?",
nodeGroup.getGroupName(),nodeGroup.getParentGroupId(),this.getSystemID(),nodeGroup.getGroupId()); nodeGroup.getGroupName(),nodeGroup.getParentGroupId(),this.getSystemID(),nodeGroup.getGroupId());
@@ -970,6 +975,7 @@ public class NodeGroupManageAction extends BaseAction {
//将更新操作写到操作日志中 //将更新操作写到操作日志中
this.addDBOperationRpt(commonService, "nodegroup_table", "UPDATE", nodeGroup.getGroupId()); 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>"); this.outHtmlString("<script>alert('i18n_NodeGroupManageAction.downloadExample.success_n81i');this.location='nodeGroupManage!execute.do?action=queryNodeGroupInfo&showStopNGroup="+showStopNGroup+"'</script>");
} }
if(flag){ if(flag){
@@ -981,6 +987,7 @@ public class NodeGroupManageAction extends BaseAction {
} }
}catch (Exception e){ }catch (Exception e){
commonService.rollback();
logger.error(e.getStackTrace()); logger.error(e.getStackTrace());
e.printStackTrace(); e.printStackTrace();
this.outHtmlString("<script>alert('i18n_NodeGroupManageAction.downloadExample.faild_n81i');this.location='nodeGroupManage!execute.do?action=queryNodeGroupInfo&showStopNGroup="+showStopNGroup+"'</script>"); this.outHtmlString("<script>alert('i18n_NodeGroupManageAction.downloadExample.faild_n81i');this.location='nodeGroupManage!execute.do?action=queryNodeGroupInfo&showStopNGroup="+showStopNGroup+"'</script>");
@@ -1036,6 +1043,7 @@ public class NodeGroupManageAction extends BaseAction {
//停用节点组: //停用节点组:
public String stopNodeGroupInfo(){ public String stopNodeGroupInfo(){
try{ try{
commonService.beginTransaction();
if(ids!=null && ids.length>0){ if(ids!=null && ids.length>0){
String allIds = ""; String allIds = "";
//获得所有节点组及子节点组的id //获得所有节点组及子节点组的id
@@ -1053,7 +1061,9 @@ public class NodeGroupManageAction extends BaseAction {
stopNode(allIds); stopNode(allIds);
} }
this.outHtmlString("<script>alert('i18n_NodeGroupManageAction.downloadExample.success_n81i');this.location='nodeGroupManage!execute.do?action=queryNodeGroupInfo&showStopNGroup="+showStopNGroup+"'</script>"); this.outHtmlString("<script>alert('i18n_NodeGroupManageAction.downloadExample.success_n81i');this.location='nodeGroupManage!execute.do?action=queryNodeGroupInfo&showStopNGroup="+showStopNGroup+"'</script>");
commonService.commit();
}catch (Exception e){ }catch (Exception e){
commonService.rollback();
logger.error(e.getStackTrace()); logger.error(e.getStackTrace());
e.printStackTrace(); e.printStackTrace();
this.outHtmlString("<script>alert('i18n_NodeGroupManageAction.downloadExample.faild_n81i');this.location='nodeGroupManage!execute.do?action=queryNodeGroupInfo&showStopNGroup="+showStopNGroup+"'</script>"); this.outHtmlString("<script>alert('i18n_NodeGroupManageAction.downloadExample.faild_n81i');this.location='nodeGroupManage!execute.do?action=queryNodeGroupInfo&showStopNGroup="+showStopNGroup+"'</script>");
@@ -1117,6 +1127,7 @@ public class NodeGroupManageAction extends BaseAction {
// 停用节点先找出叶子节点再找出所有叶子节点的节点id再进行更新. NODE_STATE=1表示节点为下线停用状态此时显示可以的操作为上线 // 停用节点先找出叶子节点再找出所有叶子节点的节点id再进行更新. NODE_STATE=1表示节点为下线停用状态此时显示可以的操作为上线
private String stopNode(String allIds) { private String stopNode(String allIds) {
try { try {
commonService.beginTransaction();
String leafNodeGroupIds = getLeafNodeGroupId(allIds); String leafNodeGroupIds = getLeafNodeGroupId(allIds);
String[] leafNodeGroupArray = leafNodeGroupIds.split(",");//所有叶子节点 String[] leafNodeGroupArray = leafNodeGroupIds.split(",");//所有叶子节点
for(int i=0;i<leafNodeGroupArray.length;i++) { for(int i=0;i<leafNodeGroupArray.length;i++) {
@@ -1146,7 +1157,9 @@ public class NodeGroupManageAction extends BaseAction {
//将更新操作写到操作日志中 //将更新操作写到操作日志中
this.addDBOperationRpt(commonService, sqlCondition, "NODE_TABLE"); this.addDBOperationRpt(commonService, sqlCondition, "NODE_TABLE");
} }
commonService.commit();
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
logger.error(e.getStackTrace()); logger.error(e.getStackTrace());
e.printStackTrace(); e.printStackTrace();
return null; return null;
@@ -1157,6 +1170,7 @@ public class NodeGroupManageAction extends BaseAction {
//启用节点组 //启用节点组
public String startNodeGroupInfo(){ public String startNodeGroupInfo(){
try{ try{
commonService.beginTransaction();
if(ids!=null && ids.length>0){ if(ids!=null && ids.length>0){
if(isStartSubNodeGroup!=null&&"1".equals(isStartSubNodeGroup)) {//启用节点组的同时启用子节点组?? if(isStartSubNodeGroup!=null&&"1".equals(isStartSubNodeGroup)) {//启用节点组的同时启用子节点组??
String allIds = ""; String allIds = "";
@@ -1185,7 +1199,9 @@ public class NodeGroupManageAction extends BaseAction {
} }
this.outHtmlString("<script>alert('i18n_NodeGroupManageAction.downloadExample.success_n81i');this.location='nodeGroupManage!execute.do?action=queryNodeGroupInfo&showStopNGroup="+showStopNGroup+"'</script>"); this.outHtmlString("<script>alert('i18n_NodeGroupManageAction.downloadExample.success_n81i');this.location='nodeGroupManage!execute.do?action=queryNodeGroupInfo&showStopNGroup="+showStopNGroup+"'</script>");
} }
commonService.commit();
}catch (Exception e){ }catch (Exception e){
commonService.rollback();
logger.error(e.getStackTrace()); logger.error(e.getStackTrace());
e.printStackTrace(); e.printStackTrace();
this.outHtmlString("<script>alert('i18n_NodeGroupManageAction.downloadExample.faild_n81i');this.location='nodeGroupManage!execute.do?action=queryNodeGroupInfo&showStopNGroup="+showStopNGroup+"'</script>"); this.outHtmlString("<script>alert('i18n_NodeGroupManageAction.downloadExample.faild_n81i');this.location='nodeGroupManage!execute.do?action=queryNodeGroupInfo&showStopNGroup="+showStopNGroup+"'</script>");
@@ -1197,6 +1213,7 @@ public class NodeGroupManageAction extends BaseAction {
// 启用节点: NODE_STATE=0表示节点为上线启用状态此时显示可以的操作为下线 // 启用节点: NODE_STATE=0表示节点为上线启用状态此时显示可以的操作为下线
public String startNode(String allIds) { public String startNode(String allIds) {
try { try {
commonService.beginTransaction();
String leafNodeGroupIds = getLeafNodeGroupId(allIds);//获取所有叶子节点组id String leafNodeGroupIds = getLeafNodeGroupId(allIds);//获取所有叶子节点组id
String[] leafNodeGroupArray = leafNodeGroupIds.split(",");//所有叶子节点 String[] leafNodeGroupArray = leafNodeGroupIds.split(",");//所有叶子节点
for(int i=0;i<leafNodeGroupArray.length;i++) { for(int i=0;i<leafNodeGroupArray.length;i++) {
@@ -1224,7 +1241,7 @@ public class NodeGroupManageAction extends BaseAction {
String sqlCondition = "where NODE_ID in (" + allIds + ")"; String sqlCondition = "where NODE_ID in (" + allIds + ")";
//将更新操作写到操作日志中 //将更新操作写到操作日志中
this.addDBOperationRpt(commonService, sqlCondition, "NODE_TABLE"); this.addDBOperationRpt(commonService, sqlCondition, "NODE_TABLE");
commonService.commit();
//通知NMSServer更新节点组的监控信息 //通知NMSServer更新节点组的监控信息
for(String str : leafNodeGroupArray){ for(String str : leafNodeGroupArray){
// 用来实现即时向客户端发送脚本文件 // 用来实现即时向客户端发送脚本文件
@@ -1233,8 +1250,10 @@ public class NodeGroupManageAction extends BaseAction {
this.sendNodeAndGroupId(Long.valueOf(str), null,commonService); this.sendNodeAndGroupId(Long.valueOf(str), null,commonService);
} }
} }
//this.outHtmlString("<script>alert('操作成功!');this.location='"+path+"/nodeGroupManage/nodeGroupManage.do?action=queryNodeGroupInfo'</script>"); //this.outHtmlString("<script>alert('操作成功!');this.location='"+path+"/nodeGroupManage/nodeGroupManage.do?action=queryNodeGroupInfo'</script>");
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
logger.error(e.getStackTrace()); logger.error(e.getStackTrace());
e.printStackTrace(); e.printStackTrace();
//this.outHtmlString("<script>alert('操作失败!');this.location='"+path+"/nodeGroupManage/nodeGroupManage.do?action=queryNodeGroupInfo'</script>"); //this.outHtmlString("<script>alert('操作失败!');this.location='"+path+"/nodeGroupManage/nodeGroupManage.do?action=queryNodeGroupInfo'</script>");

View File

@@ -408,6 +408,7 @@ public class NodeManageAction extends BaseAction {
// 打开添加节点页面 // 打开添加节点页面
public String openAddNodeInfo() { public String openAddNodeInfo() {
try { try {
commonService.beginTransaction();
// 如果没有指定具体的节点组,即不在节点组查看详情页面点击新增 // 如果没有指定具体的节点组,即不在节点组查看详情页面点击新增
if (nodeGroupId == null || nodeGroupId.equals("")) { if (nodeGroupId == null || nodeGroupId.equals("")) {
// 查询节点组 // 查询节点组
@@ -454,7 +455,9 @@ public class NodeManageAction extends BaseAction {
this.getRequest().setAttribute("jsbh",true); this.getRequest().setAttribute("jsbh",true);
} }
this.addDBOperationRpt(commonService, sql, "option_table"); this.addDBOperationRpt(commonService, sql, "option_table");
commonService.commit();
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
logger.error(e.getStackTrace()); logger.error(e.getStackTrace());
} }
@@ -467,6 +470,7 @@ public class NodeManageAction extends BaseAction {
*/ */
public void addNodeInfo() { public void addNodeInfo() {
try { try {
commonService.beginTransaction();
if (nodeGroupId != null && !nodeGroupId.equals("")) { if (nodeGroupId != null && !nodeGroupId.equals("")) {
mkid = nodeGroupId; mkid = nodeGroupId;
} }
@@ -608,7 +612,10 @@ public class NodeManageAction extends BaseAction {
} }
} }
} }
// 将添加操作写到操作日志中
this.addDBOperationRpt(commonService, "node_table",
"INSERT", nodeTable.getNodeId());
commonService.commit();
if (new Long(1).equals(group.getIsValid())) { // 节点组有效 if (new Long(1).equals(group.getIsValid())) { // 节点组有效
// 用来实现即时向客户端发送脚本文件 // 用来实现即时向客户端发送脚本文件
@@ -619,9 +626,7 @@ public class NodeManageAction extends BaseAction {
nodeTable.getNodeId(), commonService); // 通知NMSServer更新节点组的监控信息 nodeTable.getNodeId(), commonService); // 通知NMSServer更新节点组的监控信息
} }
// 将添加操作写到操作日志中
this.addDBOperationRpt(commonService, "node_table",
"INSERT", nodeTable.getNodeId());
} }
// 记录用户操作用于设置向导 // 记录用户操作用于设置向导
if (fromWhere != null && !"".equals(fromWhere)) { if (fromWhere != null && !"".equals(fromWhere)) {
@@ -638,7 +643,9 @@ public class NodeManageAction extends BaseAction {
.outHtmlString("<script>alert('i18n_NodeManageAction.addNodeInfo.nodeHadIp_n81i');history.back();</script>"); .outHtmlString("<script>alert('i18n_NodeManageAction.addNodeInfo.nodeHadIp_n81i');history.back();</script>");
return; return;
} }
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
outHtmlString("<script type=\"text/javascript\">alert('i18n_NodeManageAction.addNodeInfo.faild_n81i');this.location='nodeManage.do?action=query&nodeGroupId=" outHtmlString("<script type=\"text/javascript\">alert('i18n_NodeManageAction.addNodeInfo.faild_n81i');this.location='nodeManage.do?action=query&nodeGroupId="
+ mkid + "&isValid=" + isValid + "&showStopNGroup="+showStopNGroup+ "'</script>"); + mkid + "&isValid=" + isValid + "&showStopNGroup="+showStopNGroup+ "'</script>");
@@ -975,6 +982,7 @@ public class NodeManageAction extends BaseAction {
*/ */
public void updateNodeInfo() { public void updateNodeInfo() {
try { try {
commonService.beginTransaction();
if (nodeGroupId != null && !nodeGroupId.equals("")) { if (nodeGroupId != null && !nodeGroupId.equals("")) {
mkid = nodeGroupId; mkid = nodeGroupId;
} }
@@ -1127,7 +1135,10 @@ public class NodeManageAction extends BaseAction {
sb.append(" ,t.special_server_type="+nodeTable.getSpecialServerType()); sb.append(" ,t.special_server_type="+nodeTable.getSpecialServerType());
sb.append(" WHERE t.seq_id=" + seqId); sb.append(" WHERE t.seq_id=" + seqId);
commonService.updateBySql(sb.toString()); commonService.updateBySql(sb.toString());
// 将更新操作写到操作日志中
this.addDBOperationRpt(commonService, "node_table",
"UPDATE", nodeTable.getNodeId());
commonService.commit();
if (flag) { if (flag) {
// 用来实现即时向客户端发送脚本文件 // 用来实现即时向客户端发送脚本文件
this.sendPluginFile(nt.getGroupId(), nt this.sendPluginFile(nt.getGroupId(), nt
@@ -1138,18 +1149,18 @@ public class NodeManageAction extends BaseAction {
.getNodeId(), commonService); // 通知NMSServer更新节点组的监控信息 .getNodeId(), commonService); // 通知NMSServer更新节点组的监控信息
} }
} }
// 将更新操作写到操作日志中
this.addDBOperationRpt(commonService, "node_table",
"UPDATE", nodeTable.getNodeId());
} }
outHtmlString("<script type=\"text/javascript\">alert('i18n_NodeManageAction.addNodeInfo.success_n81i');this.location='nodeManage.do?action=query&nodeGroupId=" outHtmlString("<script type=\"text/javascript\">alert('i18n_NodeManageAction.addNodeInfo.success_n81i');this.location='nodeManage.do?action=query&nodeGroupId="
+ mkid + "&isValid=" + isValid + "&fromWhere=" + fromWhere + "&type=" + type + "&showStopNGroup=" + showStopNGroup +"&nodeIpVo="+nodeIpVo+"&nodeNameVo="+nodeNameVo+ "'</script>"); + mkid + "&isValid=" + isValid + "&fromWhere=" + fromWhere + "&type=" + type + "&showStopNGroup=" + showStopNGroup +"&nodeIpVo="+nodeIpVo+"&nodeNameVo="+nodeNameVo+ "'</script>");
} else { } else {
this this
.outHtmlString("<script>alert('i18n_NodeManageAction.addNodeInfo.nodeHadIp_n81i');history.back();</script>"); .outHtmlString("<script>alert('i18n_NodeManageAction.addNodeInfo.nodeHadIp_n81i');history.back();</script>");
return; return;
} }
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
logger.error(e.getStackTrace()); logger.error(e.getStackTrace());
outHtmlString("<script type=\"text/javascript\">alert('i18n_NodeManageAction.addNodeInfo.faild_n81i');this.location='nodeManage.do?action=query&nodeGroupId=" outHtmlString("<script type=\"text/javascript\">alert('i18n_NodeManageAction.addNodeInfo.faild_n81i');this.location='nodeManage.do?action=query&nodeGroupId="
@@ -1161,6 +1172,7 @@ public class NodeManageAction extends BaseAction {
// 停用节点 // 停用节点
public void stopNodeInfo() { public void stopNodeInfo() {
try { try {
commonService.beginTransaction();
List noList = this.commonService.find( List noList = this.commonService.find(
"from NodeTable where nodeId=?", nodeId); "from NodeTable where nodeId=?", nodeId);
@@ -1171,6 +1183,10 @@ public class NodeManageAction extends BaseAction {
nd.setNodeStoptime(new Date()); nd.setNodeStoptime(new Date());
this.commonService.update(nd); this.commonService.update(nd);
// 将更新操作写到操作日志中
this.addDBOperationRpt(commonService, "node_table", "UPDATE",
nd.getNodeId());
commonService.commit();
NodegroupTable group = (NodegroupTable) this.commonService.get( NodegroupTable group = (NodegroupTable) this.commonService.get(
NodegroupTable.class, nd.getGroupId()); NodegroupTable.class, nd.getGroupId());
if (new Long(1).equals(group.getIsValid())) { // 节点组有效 if (new Long(1).equals(group.getIsValid())) { // 节点组有效
@@ -1182,16 +1198,16 @@ public class NodeManageAction extends BaseAction {
} }
mkid = group.getGroupId(); mkid = group.getGroupId();
isValid = group.getIsValid().toString(); isValid = group.getIsValid().toString();
// 将更新操作写到操作日志中
this.addDBOperationRpt(commonService, "node_table", "UPDATE",
nd.getNodeId());
this this
.outHtmlString("<script type=\"text/javascript\">alert('i18n_NodeManageAction.addNodeInfo.success_n81i');this.location='nodeManage.do?action=query&nodeGroupId=" .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>"); + mkid + "&isValid=" + isValid + "&showStopNGroup=" + showStopNGroup +"&nodeIpVo="+nodeIpVo+"&nodeNameVo="+nodeNameVo+ "'</script>");
// this.outHtmlString("<script // this.outHtmlString("<script
// type=\"text/javascript\">alert('操作成功');this.location='nodeManage.do?action=query&nodeGroupId="+group.getGroupId()+"&isValid="+group.getIsValid()+"'</script>"); // type=\"text/javascript\">alert('操作成功');this.location='nodeManage.do?action=query&nodeGroupId="+group.getGroupId()+"&isValid="+group.getIsValid()+"'</script>");
} }
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
logger.error(e.getStackTrace()); logger.error(e.getStackTrace());
this this
@@ -1203,8 +1219,13 @@ public class NodeManageAction extends BaseAction {
// 启用节点 // 启用节点
public void startNodeInfo() { public void startNodeInfo() {
try { try {
commonService.beginTransaction();
this.commonService.updateByHql( this.commonService.updateByHql(
"update NodeTable set nodeState=0 where nodeId=?", nodeId); "update NodeTable set nodeState=0 where nodeId=?", nodeId);
// 将更新操作写到操作日志中
this.addDBOperationRpt(commonService, "node_table", "UPDATE",
nodeId);
commonService.commit();
NodeTable nd = (NodeTable) this.commonService.get(NodeTable.class, NodeTable nd = (NodeTable) this.commonService.get(NodeTable.class,
nodeId); nodeId);
NodegroupTable group = (NodegroupTable) this.commonService.get( NodegroupTable group = (NodegroupTable) this.commonService.get(
@@ -1219,13 +1240,13 @@ public class NodeManageAction extends BaseAction {
mkid = group.getGroupId(); mkid = group.getGroupId();
isValid = group.getIsValid().toString(); isValid = group.getIsValid().toString();
// 将更新操作写到操作日志中
this.addDBOperationRpt(commonService, "node_table", "UPDATE",
nodeId);
this this
.outHtmlString("<script type=\"text/javascript\">alert('i18n_NodeManageAction.addNodeInfo.success_n81i');this.location='nodeManage.do?action=query&nodeGroupId=" .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>"); + mkid + "&isValid=" + isValid + "&showStopNGroup=" + showStopNGroup + "&nodeIpVo="+nodeIpVo+"&nodeNameVo="+nodeNameVo+ "'</script>");
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
logger.error(e.getStackTrace()); logger.error(e.getStackTrace());
outHtmlString("<script>alert('i18n_NodeManageAction.addNodeInfo.faild_n81i');this.location='nodeManage.do?action=query&nodeGroupId=" outHtmlString("<script>alert('i18n_NodeManageAction.addNodeInfo.faild_n81i');this.location='nodeManage.do?action=query&nodeGroupId="
@@ -1760,6 +1781,7 @@ public class NodeManageAction extends BaseAction {
// "节点U位","机柜编号","机柜起始U位","SNMP版本", // "节点U位","机柜编号","机柜起始U位","SNMP版本",
// "节点状态0 正常、1 已删除或停用)","节点IP信息","节点描述" // "节点状态0 正常、1 已删除或停用)","节点IP信息","节点描述"
try { try {
commonService.beginTransaction();
if (group != null) { if (group != null) {
// IP在同一节点组下不重复 // IP在同一节点组下不重复
if (!groupNodeIpIsRepeat(vo.getNodeIp(), group.getGroupId())) { if (!groupNodeIpIsRepeat(vo.getNodeIp(), group.getGroupId())) {
@@ -1868,8 +1890,10 @@ public class NodeManageAction extends BaseAction {
} else { } else {
desc = getI18nText("i18n_NodeManageAction.addNodeInfo.importFaild_n81i"); desc = getI18nText("i18n_NodeManageAction.addNodeInfo.importFaild_n81i");
} }
commonService.commit();
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
desc = getI18nText("i18n_NodeManageAction.addNodeInfo.nodeInfoImportFaild_n81i"); desc = getI18nText("i18n_NodeManageAction.addNodeInfo.nodeInfoImportFaild_n81i");
} }

View File

@@ -192,6 +192,7 @@ public class BoxSetAction extends BaseAction {
public String addBoxInfo(){ public String addBoxInfo(){
List list = null; List list = null;
try { try {
commonService.beginTransaction();
//判断数据是否存在 //判断数据是否存在
/*list = this.commonService.find("from NodeBoxTable where ispn=?",nodeBox.getIspn()); /*list = this.commonService.find("from NodeBoxTable where ispn=?",nodeBox.getIspn());
if(list!=null && list.size()>0){ if(list!=null && list.size()>0){
@@ -230,7 +231,9 @@ public class BoxSetAction extends BaseAction {
String str= "<script type=\"text/javascript\">alert('i18n_BoxSetAction.queryBoxInfo.success_n81i');this.location='boxSet.do?action=query&roomIspn="+roomIspn+"&roomid="+roomid+"'</script>"; String str= "<script type=\"text/javascript\">alert('i18n_BoxSetAction.queryBoxInfo.success_n81i');this.location='boxSet.do?action=query&roomIspn="+roomIspn+"&roomid="+roomid+"'</script>";
outHtmlString(str); outHtmlString(str);
} }
commonService.commit();
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
logger.error(e.getStackTrace()); logger.error(e.getStackTrace());
this.outHtmlString("<script>alert('i18n_BoxSetAction.queryBoxInfo.addBoxFaild_n81i');history.back();</script>"); this.outHtmlString("<script>alert('i18n_BoxSetAction.queryBoxInfo.addBoxFaild_n81i');history.back();</script>");
return null; return null;
@@ -281,6 +284,7 @@ public class BoxSetAction extends BaseAction {
*/ */
public String doUpdBox(){ public String doUpdBox(){
try { try {
commonService.beginTransaction();
List list =null; List list =null;
/*List list = this.commonService.find("from NodeBoxTable where ispn='"+nodeBox.getIspn()+"' and nodeBoxId <> "+nodeBox.getNodeBoxId()); /*List list = this.commonService.find("from NodeBoxTable where ispn='"+nodeBox.getIspn()+"' and nodeBoxId <> "+nodeBox.getNodeBoxId());
if (list != null && list.size() > 0) { if (list != null && list.size() > 0) {
@@ -352,7 +356,9 @@ public class BoxSetAction extends BaseAction {
this.commonService.update(nbt); this.commonService.update(nbt);
this.getRequest().setAttribute("MSG", 1); this.getRequest().setAttribute("MSG", 1);
commonService.commit();
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
logger.error(e.getStackTrace()); logger.error(e.getStackTrace());
this.outHtmlString("<script>alert('i18n_BoxSetAction.queryBoxInfo.updateFaild_n81i');history.back();</script>"); this.outHtmlString("<script>alert('i18n_BoxSetAction.queryBoxInfo.updateFaild_n81i');history.back();</script>");
return null; return null;
@@ -365,6 +371,7 @@ public class BoxSetAction extends BaseAction {
public String delBoxInfo(){ public String delBoxInfo(){
try { try {
if(ids!=null && ids.length>0){ if(ids!=null && ids.length>0){
commonService.beginTransaction();
for(Long id : ids){ for(Long id : ids){
List list = this.commonService.find( List list = this.commonService.find(
"from NodeLatticeTable where nodeBoxId=? and nodeSeqId is not null", id); "from NodeLatticeTable where nodeBoxId=? and nodeSeqId is not null", id);
@@ -379,8 +386,10 @@ public class BoxSetAction extends BaseAction {
//删除记录 //删除记录
this.commonService.updateBatchBySql("delete from NODE_BOX_TABLE where BOX_ID=?", Arrays.asList(ids)); this.commonService.updateBatchBySql("delete from NODE_BOX_TABLE where BOX_ID=?", Arrays.asList(ids));
outHtmlString("<script type=\"text/javascript\">alert('i18n_BoxSetAction.queryBoxInfo.success_n81i');this.location='boxSet.do?action=query&pageNo="+pageNo+"&pageSize="+pageSize+"&roomid="+roomid+"&roomIspn="+roomIspn+"'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_BoxSetAction.queryBoxInfo.success_n81i');this.location='boxSet.do?action=query&pageNo="+pageNo+"&pageSize="+pageSize+"&roomid="+roomid+"&roomIspn="+roomIspn+"'</script>");
commonService.commit();
} }
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
logger.error(e.getStackTrace()); logger.error(e.getStackTrace());
this.outHtmlString("<script>alert('i18n_BoxSetAction.queryBoxInfo.deleteFaild_n81i');history.back();</script>"); this.outHtmlString("<script>alert('i18n_BoxSetAction.queryBoxInfo.deleteFaild_n81i');history.back();</script>");
return null; return null;
@@ -642,6 +651,7 @@ public class BoxSetAction extends BaseAction {
private String saveNode(NodeBoxTableVo vo) { private String saveNode(NodeBoxTableVo vo) {
String desc = ""; String desc = "";
try { try {
commonService.beginTransaction();
// 保存节点信息 // 保存节点信息
NodeBoxTable nodeT = new NodeBoxTable(); NodeBoxTable nodeT = new NodeBoxTable();
nodeT.setIspn(vo.getIspn()); nodeT.setIspn(vo.getIspn());
@@ -698,7 +708,9 @@ public class BoxSetAction extends BaseAction {
nodeT.getNodeBoxId(), nodeT.getRoomIspn(), nodeT.getNodeBoxId(), nodeT.getRoomIspn(),
nodeT.getRoomRowPosition(), nodeT nodeT.getRoomRowPosition(), nodeT
.getRoomColPosition()); .getRoomColPosition());
commonService.commit();
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
desc = getI18nText("i18n_BoxSetAction.queryBoxInfo.nodeInfoErr_n81i"); desc = getI18nText("i18n_BoxSetAction.queryBoxInfo.nodeInfoErr_n81i");
} }

View File

@@ -80,6 +80,7 @@ public class NodeGroupPositionAction extends BaseAction
{ {
try try
{ {
commonService.beginTransaction();
System.out.println("nodegroupBgImgPositions:"+nodegroupBgImgPositions); System.out.println("nodegroupBgImgPositions:"+nodegroupBgImgPositions);
System.out.println("nodegroupArrowPositions:"+nodegroupArrowPositions); System.out.println("nodegroupArrowPositions:"+nodegroupArrowPositions);
String[] nodegroupBgImgPositionInfos = nodegroupBgImgPositions.split(":"); String[] nodegroupBgImgPositionInfos = nodegroupBgImgPositions.split(":");
@@ -179,8 +180,10 @@ public class NodeGroupPositionAction extends BaseAction
commonService.saveOrUpdate(nodegroupBgimgPositionList); commonService.saveOrUpdate(nodegroupBgimgPositionList);
commonService.saveOrUpdate(nodeGroupPositionList); commonService.saveOrUpdate(nodeGroupPositionList);
commonService.saveOrUpdate(nodegroupArrowPositionList); commonService.saveOrUpdate(nodegroupArrowPositionList);
commonService.commit();
} catch (Exception e) } catch (Exception e)
{ {
commonService.rollback();
logger.error("Failed to save topology map configuration information", e); logger.error("Failed to save topology map configuration information", e);
} }
return configTopo(); return configTopo();

View File

@@ -1240,6 +1240,7 @@ public class NodePositionAction extends BaseAction {
private String saveBoxInfo(){ private String saveBoxInfo(){
try { try {
commonService.beginTransaction();
//保存格子和节点表格子ID //保存格子和节点表格子ID
String nodeGroupId = this.getRequest().getParameter("nodeGroupId"); String nodeGroupId = this.getRequest().getParameter("nodeGroupId");
String boxId = this.getRequest().getParameter("boxId"); String boxId = this.getRequest().getParameter("boxId");
@@ -1425,7 +1426,9 @@ public class NodePositionAction extends BaseAction {
}else{ }else{
outHtmlString("2"); outHtmlString("2");
} }
commonService.commit();
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
logger.error("The saveBoxInfo method, error saving cabinet information"+e.getMessage()); logger.error("The saveBoxInfo method, error saving cabinet information"+e.getMessage());
e.printStackTrace(); e.printStackTrace();
} }
@@ -1436,6 +1439,7 @@ public class NodePositionAction extends BaseAction {
private String updateNodes(){ private String updateNodes(){
try { try {
commonService.beginTransaction();
if(nodeM!=null){ if(nodeM!=null){
if (nodeM.getId() != null if (nodeM.getId() != null
&& !"0".equals(nodeM.getId().toString()) && !"0".equals(nodeM.getId().toString())
@@ -1494,8 +1498,9 @@ public class NodePositionAction extends BaseAction {
} }
} }
} }
commonService.commit();
}catch (Exception e) { }catch (Exception e) {
commonService.rollback();
logger.error("The updateNodes method, error saving location information"+e.getMessage()); logger.error("The updateNodes method, error saving location information"+e.getMessage());
outHtmlString("2"); outHtmlString("2");
} }
@@ -1505,6 +1510,7 @@ public class NodePositionAction extends BaseAction {
List ngtList = null; List ngtList = null;
String sql =""; String sql ="";
try { try {
commonService.beginTransaction();
//nodeposition ids //nodeposition ids
String ids = this.getRequest().getParameter("npids"); String ids = this.getRequest().getParameter("npids");
//nodegroup ids //nodegroup ids
@@ -1533,7 +1539,9 @@ public class NodePositionAction extends BaseAction {
//this.commonService.delete("delete from NodePosition np where np.id in ("+ids+")"); //this.commonService.delete("delete from NodePosition np where np.id in ("+ids+")");
} }
outHtmlString("1"); outHtmlString("1");
commonService.commit();
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
logger.error("The deleteNodes method, error deleting node"+e.getMessage()); logger.error("The deleteNodes method, error deleting node"+e.getMessage());
outHtmlString("2"); outHtmlString("2");
} }
@@ -1543,6 +1551,7 @@ public class NodePositionAction extends BaseAction {
private String updateLines(){ private String updateLines(){
try { try {
commonService.beginTransaction();
String tableName1 = this.getRequest().getParameter("tableName1"); String tableName1 = this.getRequest().getParameter("tableName1");
String nodeId1 = this.getRequest().getParameter("nodeId1"); String nodeId1 = this.getRequest().getParameter("nodeId1");
String tableName2 = this.getRequest().getParameter("tableName2"); String tableName2 = this.getRequest().getParameter("tableName2");
@@ -1565,7 +1574,9 @@ public class NodePositionAction extends BaseAction {
} }
} }
outHtmlString("1"); outHtmlString("1");
commonService.commit();
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
logger.error("The updateLines method, update connection error"+e.getMessage()); logger.error("The updateLines method, update connection error"+e.getMessage());
outHtmlString("2"); outHtmlString("2");
} }
@@ -1575,6 +1586,7 @@ public class NodePositionAction extends BaseAction {
//删除机柜内节点 //删除机柜内节点
private String deleteLatt(){ private String deleteLatt(){
try { try {
commonService.beginTransaction();
String seqId= this.getRequest().getParameter("seqId"); String seqId= this.getRequest().getParameter("seqId");
System.out.println(seqId); System.out.println(seqId);
if(seqId!=null && !"".equals(seqId)){ if(seqId!=null && !"".equals(seqId)){
@@ -1589,7 +1601,9 @@ public class NodePositionAction extends BaseAction {
} }
} }
commonService.commit();
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
logger.error("The deleteLatt method, delete the node in the cabinet"+e.getMessage()); logger.error("The deleteLatt method, delete the node in the cabinet"+e.getMessage());
} }
return null; return null;

View File

@@ -116,6 +116,7 @@ public class RoomManageAction extends BaseAction {
resultpage = this.openUpdRoom(); resultpage = this.openUpdRoom();
}else if("doUpdate".equals(this.action)){ }else if("doUpdate".equals(this.action)){
this.doUpdRoom(); this.doUpdRoom();
resultpage = this.queryRoomInfo();
}else if("del".equals(this.action)){ }else if("del".equals(this.action)){
resultpage = this.delRoomInfo(); resultpage = this.delRoomInfo();
}else if ("downloadExample".equals(this.action)) { }else if ("downloadExample".equals(this.action)) {
@@ -298,6 +299,7 @@ public class RoomManageAction extends BaseAction {
String desc = ""; String desc = "";
NodeRoomTable nodeRoomTable = new NodeRoomTable(); NodeRoomTable nodeRoomTable = new NodeRoomTable();
try { try {
commonService.beginTransaction();
// 保存节点信息 // 保存节点信息
nodeRoomTable.setCreateDatetime(new Date()); nodeRoomTable.setCreateDatetime(new Date());
nodeRoomTable.setCreateUserId(getUserID()); nodeRoomTable.setCreateUserId(getUserID());
@@ -326,7 +328,9 @@ public class RoomManageAction extends BaseAction {
} }
} }
this.commonService.saveOrUpdate(list2); this.commonService.saveOrUpdate(list2);
commonService.commit();
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
desc = getI18nText("i18n_RoomManageAction.downloadExample.nodeInfoImportErr_n81i"); desc = getI18nText("i18n_RoomManageAction.downloadExample.nodeInfoImportErr_n81i");
} }
@@ -431,6 +435,7 @@ public class RoomManageAction extends BaseAction {
public String addRoomInfo(){ public String addRoomInfo(){
// List list = null; // List list = null;
try { try {
commonService.beginTransaction();
//判断数据是否存在 //判断数据是否存在
/*list = this.commonService.find("from NodeRoomTable where roomIspn=?",nodeRoom.getRoomIspn()); /*list = this.commonService.find("from NodeRoomTable where roomIspn=?",nodeRoom.getRoomIspn());
if(list!=null && list.size()>0){ if(list!=null && list.size()>0){
@@ -463,7 +468,9 @@ public class RoomManageAction extends BaseAction {
}else{ }else{
outHtmlString("<script type=\"text/javascript\">alert('i18n_RoomManageAction.downloadExample.success_n81i');this.location='roomManage.do?action=query'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_RoomManageAction.downloadExample.success_n81i');this.location='roomManage.do?action=query'</script>");
} }
commonService.commit();
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
logger.error("Failed to add room information", e); logger.error("Failed to add room information", e);
} }
return null; return null;
@@ -511,6 +518,7 @@ public class RoomManageAction extends BaseAction {
*/ */
public void doUpdRoom(){ public void doUpdRoom(){
try { try {
commonService.beginTransaction();
NodeRoomTable nrt = (NodeRoomTable) this.commonService.get( NodeRoomTable nrt = (NodeRoomTable) this.commonService.get(
NodeRoomTable.class, nodeRoom.getRoomId()); NodeRoomTable.class, nodeRoom.getRoomId());
String ispn = nrt.getRoomIspn(); String ispn = nrt.getRoomIspn();
@@ -586,7 +594,9 @@ public class RoomManageAction extends BaseAction {
String sql = "update node_box_table set ROOM_ISPN = ? where ROOM_ISPN = ?"; String sql = "update node_box_table set ROOM_ISPN = ? where ROOM_ISPN = ?";
this.commonService.updateBySql(sql, nodeRoom.getRoomIspn(),ispn); this.commonService.updateBySql(sql, nodeRoom.getRoomIspn(),ispn);
} }
commonService.commit();
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
logger.error("Failed to update room information", e); logger.error("Failed to update room information", e);
} }
outHtmlString("<script type=\"text/javascript\">alert('i18n_RoomManageAction.downloadExample.success_n81i');this.location='roomManage.do?action=query&rIspn="+rIspn+"&pageNo="+pageNo+"&pageSize="+pageSize+"'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_RoomManageAction.downloadExample.success_n81i');this.location='roomManage.do?action=query&rIspn="+rIspn+"&pageNo="+pageNo+"&pageSize="+pageSize+"'</script>");
@@ -594,6 +604,7 @@ public class RoomManageAction extends BaseAction {
public String delRoomInfo(){ public String delRoomInfo(){
try { try {
commonService.beginTransaction();
if(ids!=null && ids.length>0){ if(ids!=null && ids.length>0){
for(Long id : ids){ for(Long id : ids){
List list = this.commonService.find( List list = this.commonService.find(
@@ -611,7 +622,9 @@ public class RoomManageAction extends BaseAction {
this.commonService.updateBatchBySql("delete from NODE_ROOM_TABLE where ROOM_ID=?", Arrays.asList(ids)); this.commonService.updateBatchBySql("delete from NODE_ROOM_TABLE where ROOM_ID=?", Arrays.asList(ids));
outHtmlString("<script type=\"text/javascript\">alert('i18n_RoomManageAction.downloadExample.success_n81i');this.location='roomManage.do?action=query&pageNo="+pageNo+"&pageSize="+pageSize+"'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_RoomManageAction.downloadExample.success_n81i');this.location='roomManage.do?action=query&pageNo="+pageNo+"&pageSize="+pageSize+"'</script>");
} }
commonService.commit();
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
logger.error("Failed to delete room information", e); logger.error("Failed to delete room information", e);
return "error"; return "error";
} }

View File

@@ -157,7 +157,7 @@ public class TopoShowAction extends BaseAction
Object[] countObjs = (Object[]) countList.get(0); Object[] countObjs = (Object[]) countList.get(0);
BigDecimal bigDecimal = new BigDecimal(1); BigDecimal bigDecimal = new BigDecimal(1);
int alramNodeSize = Integer.valueOf(countObjs[0].toString());//((BigDecimal) countObjs[0]).intValue(); int alramNodeSize = Integer.valueOf(countObjs[0].toString());//((BigDecimal) countObjs[0]).intValue();
int allNodeSize = Integer.valueOf(countObjs[0].toString());//((BigDecimal) countObjs[1]).intValue(); int allNodeSize = Integer.valueOf(countObjs[1].toString());//((BigDecimal) countObjs[1]).intValue();
if (alramNodeSize > 0) if (alramNodeSize > 0)
{ {
nodegroupTable.setStatus(1); nodegroupTable.setStatus(1);

View File

@@ -355,6 +355,7 @@ public class PluginManageAction extends BaseAction {
public String doUpdatePlugin() throws Exception { public String doUpdatePlugin() throws Exception {
try { try {
commonService.beginTransaction();
PluginInfo info = (PluginInfo) commonService.get(PluginInfo.class, pluginInfo.getId()); PluginInfo info = (PluginInfo) commonService.get(PluginInfo.class, pluginInfo.getId());
info.setUpdateTime(new Date()); info.setUpdateTime(new Date());
info.setUpdateUserId(getUserID()); info.setUpdateUserId(getUserID());
@@ -389,7 +390,9 @@ public class PluginManageAction extends BaseAction {
} else { } else {
commonService.saveOrUpdate(info); commonService.saveOrUpdate(info);
} }
commonService.commit();
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
logger.error(e.getStackTrace()); logger.error(e.getStackTrace());
e.printStackTrace(); e.printStackTrace();
outHtmlString("<script type=\"text/javascript\">alert('i18n_PluginManageAction.downloadPlugin.faild_n81i');this.location='pluginManage.do?action=queryInfo&pageNo=" outHtmlString("<script type=\"text/javascript\">alert('i18n_PluginManageAction.downloadPlugin.faild_n81i');this.location='pluginManage.do?action=queryInfo&pageNo="

View File

@@ -633,6 +633,7 @@ public class ServerManagerAction extends BaseAction {
public String stop(){ public String stop(){
try { try {
commonService.beginTransaction();
if(ids !=null && ids.length>0){ if(ids !=null && ids.length>0){
for(int i= 0;i<ids.length;i++){ for(int i= 0;i<ids.length;i++){
List serverList = this.commonService.find( List serverList = this.commonService.find(
@@ -647,6 +648,7 @@ public class ServerManagerAction extends BaseAction {
//将更新操作写到操作日志中 //将更新操作写到操作日志中
this.addDBOperationRpt(commonService, "Server_Table", "UPDATE", st.getId()); this.addDBOperationRpt(commonService, "Server_Table", "UPDATE", st.getId());
ServerTable serverTable = (ServerTable) commonService.get(ServerTable.class, ids[i]); ServerTable serverTable = (ServerTable) commonService.get(ServerTable.class, ids[i]);
commonService.commit();
//将DC变更发送到DC //将DC变更发送到DC
this.sendDataControllerReset(ids[i], serverTable.getServerIp(), commonService); this.sendDataControllerReset(ids[i], serverTable.getServerIp(), commonService);
} }
@@ -654,6 +656,7 @@ public class ServerManagerAction extends BaseAction {
} }
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
} }
outHtmlString("<script type=\"text/javascript\">alert('i18n_ServerManagerAction.downloadExample.success_n81i');" + outHtmlString("<script type=\"text/javascript\">alert('i18n_ServerManagerAction.downloadExample.success_n81i');" +
@@ -664,6 +667,7 @@ public class ServerManagerAction extends BaseAction {
public String start(){ public String start(){
try { try {
commonService.beginTransaction();
if(ids !=null && ids.length>0){ if(ids !=null && ids.length>0){
for(int i= 0;i<ids.length;i++){ for(int i= 0;i<ids.length;i++){
List serverList = this.commonService.find( List serverList = this.commonService.find(
@@ -678,12 +682,15 @@ public class ServerManagerAction extends BaseAction {
//将更新操作写到操作日志中 //将更新操作写到操作日志中
this.addDBOperationRpt(commonService, "Server_Table", "UPDATE", st.getId()); this.addDBOperationRpt(commonService, "Server_Table", "UPDATE", st.getId());
ServerTable serverTable = (ServerTable) commonService.get(ServerTable.class, ids[i]); ServerTable serverTable = (ServerTable) commonService.get(ServerTable.class, ids[i]);
commonService.commit();
//将DC变更发送到DC //将DC变更发送到DC
this.sendDataControllerReset(ids[i], serverTable.getServerIp(), commonService); this.sendDataControllerReset(ids[i], serverTable.getServerIp(), commonService);
} }
} }
} }
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
} }
outHtmlString("<script type=\"text/javascript\">alert('i18n_ServerManagerAction.downloadExample.success_n81i');" + outHtmlString("<script type=\"text/javascript\">alert('i18n_ServerManagerAction.downloadExample.success_n81i');" +
@@ -763,6 +770,7 @@ public class ServerManagerAction extends BaseAction {
public String doAdd(){ public String doAdd(){
try { try {
commonService.beginTransaction();
/*List list = commonService.find("from ServerTable where serverIp = ? or serverName = ? ", serverTable.getServerIp(),serverTable.getServerName()); /*List list = commonService.find("from ServerTable where serverIp = ? or serverName = ? ", serverTable.getServerIp(),serverTable.getServerName());
if(list!=null && list.size()>0){ if(list!=null && list.size()>0){
@@ -789,9 +797,11 @@ public class ServerManagerAction extends BaseAction {
} }
} }
} }
commonService.commit();
//将DC变更发送到DC //将DC变更发送到DC
this.sendDataControllerReset(serverTable.getId(), serverTable.getServerIp(), commonService); this.sendDataControllerReset(serverTable.getId(), serverTable.getServerIp(), commonService);
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
logger.info("DC范围配置新增失败", e); logger.info("DC范围配置新增失败", e);
outHtmlString("<script type=\"text/javascript\">alert('i18n_ServerManagerAction.downloadExample.faild_n81i');" + outHtmlString("<script type=\"text/javascript\">alert('i18n_ServerManagerAction.downloadExample.faild_n81i');" +
@@ -866,6 +876,7 @@ public class ServerManagerAction extends BaseAction {
public String doUpdate(){ public String doUpdate(){
try { try {
commonService.beginTransaction();
/*List list = commonService.find("from ServerTable where (serverIp = ? or serverName = ?) and id <> ?", serverTable.getServerIp(),serverTable.getServerName(),serverTable.getId()); /*List list = commonService.find("from ServerTable where (serverIp = ? or serverName = ?) and id <> ?", serverTable.getServerIp(),serverTable.getServerName(),serverTable.getId());
if(list!=null && list.size()>0){ if(list!=null && list.size()>0){
@@ -929,7 +940,9 @@ public class ServerManagerAction extends BaseAction {
//将DC变更发送到DC //将DC变更发送到DC
// this.sendDataControllerReset(table.getId(), oldIP, commonService); // this.sendDataControllerReset(table.getId(), oldIP, commonService);
} }
commonService.commit();
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
logger.info("DC范围配置修改失败",e); logger.info("DC范围配置修改失败",e);
outHtmlString("<script type=\"text/javascript\">alert('i18n_ServerManagerAction.downloadExample.faild_n81i');" + outHtmlString("<script type=\"text/javascript\">alert('i18n_ServerManagerAction.downloadExample.faild_n81i');" +

View File

@@ -115,13 +115,16 @@ public class BrandManageAction extends BaseAction {
//添加品牌信息操作 //添加品牌信息操作
public String addBrand() { public String addBrand() {
try { try {
commonService.beginTransaction();
if(brand!=null){ if(brand!=null){
this.commonService.save(brand); this.commonService.save(brand);
// 将添加操作写到操作日志中 // 将添加操作写到操作日志中
this.addDBOperationRpt(commonService, "Brand", "INSERT",brand.getId()); this.addDBOperationRpt(commonService, "Brand", "INSERT",brand.getId());
outHtmlString("<script type=\"text/javascript\">alert('i18n_BrandManageAction.addBrand.success_n81i');this.location='brandManage.do?action=queryBrandInfo'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_BrandManageAction.addBrand.success_n81i');this.location='brandManage.do?action=queryBrandInfo'</script>");
} }
commonService.commit();
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
outHtmlString("<script type=\"text/javascript\">alert('i18n_BrandManageAction.addBrand.faild_n81i');this.location='brandManage.do?action=queryBrandInfo'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_BrandManageAction.addBrand.faild_n81i');this.location='brandManage.do?action=queryBrandInfo'</script>");
} }
@@ -147,6 +150,7 @@ public class BrandManageAction extends BaseAction {
// 进行修改品牌信息操作 // 进行修改品牌信息操作
public String updateBrand() { public String updateBrand() {
try { try {
commonService.beginTransaction();
Brand brandForUpdate = (Brand) commonService.get(Brand.class, brand.getId()); Brand brandForUpdate = (Brand) commonService.get(Brand.class, brand.getId());
brandForUpdate.setBrandDesc(brand.getBrandDesc()); brandForUpdate.setBrandDesc(brand.getBrandDesc());
brandForUpdate.setBrandName(brand.getBrandName()); brandForUpdate.setBrandName(brand.getBrandName());
@@ -155,8 +159,10 @@ public class BrandManageAction extends BaseAction {
// 将更新操作写到操作日志中 // 将更新操作写到操作日志中
this.addDBOperationRpt(commonService, "Brand", "UPDATE",brandForUpdate.getId()); this.addDBOperationRpt(commonService, "Brand", "UPDATE",brandForUpdate.getId());
outHtmlString("<script type=\"text/javascript\">alert('i18n_BrandManageAction.addBrand.success_n81i');this.location='brandManage.do?action=queryBrandInfo&pageNo="+pageNo+"&pageSize="+pageSize+"'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_BrandManageAction.addBrand.success_n81i');this.location='brandManage.do?action=queryBrandInfo&pageNo="+pageNo+"&pageSize="+pageSize+"'</script>");
commonService.commit();
return null; return null;
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
outHtmlString("<script type=\"text/javascript\">alert('i18n_BrandManageAction.addBrand.faild_n81i');this.location='brandManage.do?action=queryBrandInfo&pageNo="+pageNo+"&pageSize="+pageSize+"'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_BrandManageAction.addBrand.faild_n81i');this.location='brandManage.do?action=queryBrandInfo&pageNo="+pageNo+"&pageSize="+pageSize+"'</script>");
return null; return null;

View File

@@ -307,6 +307,7 @@ public class DataDictionaryAction extends BaseAction {
public void doUpdData(){ public void doUpdData(){
try { try {
commonService.beginTransaction();
TypeTable nbt = (TypeTable) this.commonService.get( TypeTable nbt = (TypeTable) this.commonService.get(
TypeTable.class, typeTable.getId()); TypeTable.class, typeTable.getId());
nbt.setShowNum(typeTable.getShowNum()); nbt.setShowNum(typeTable.getShowNum());
@@ -327,7 +328,7 @@ public class DataDictionaryAction extends BaseAction {
String sql="update xt_mk_jbxx set zxbz=? where id=?"; String sql="update xt_mk_jbxx set zxbz=? where id=?";
this.commonService.updateBySql(sql, deptflag,Constants.DEPT_MK_ID); this.commonService.updateBySql(sql, deptflag,Constants.DEPT_MK_ID);
} }
commonService.commit();
//改变是否显示主动告警的启用状态时需要和各个nc通信SHOW_AUTO_ALARM_FLAG //改变是否显示主动告警的启用状态时需要和各个nc通信SHOW_AUTO_ALARM_FLAG
if(nbt.getTypeIdentity().toLowerCase().equals(Constants.SHOW_AUTO_ALARM_FLAG.toLowerCase()) if(nbt.getTypeIdentity().toLowerCase().equals(Constants.SHOW_AUTO_ALARM_FLAG.toLowerCase())
&& typeTable.getTypeState()!=oldState) { && typeTable.getTypeState()!=oldState) {
@@ -338,7 +339,9 @@ 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>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_DataDictionaryAction.queryDictionary.success_n81i');this.location='dataDictionary.do?action=query&pageNo="+pageNo+"&pageSize="+pageSize+"'</script>");
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
logger.error("Update failed",e); logger.error("Update failed",e);
this.outHtmlString("<script>alert('i18n_DataDictionaryAction.queryDictionary.updateErr_n81i');history.back();</script>"); this.outHtmlString("<script>alert('i18n_DataDictionaryAction.queryDictionary.updateErr_n81i');history.back();</script>");
return; return;
@@ -347,7 +350,6 @@ public class DataDictionaryAction extends BaseAction {
public void updateDetectConditionSet(){ public void updateDetectConditionSet(){
try { try {
SetDetDataCon set = (SetDetDataCon) this.commonService.get( SetDetDataCon set = (SetDetDataCon) this.commonService.get(
SetDetDataCon.class, detDataConSet.getId()); SetDetDataCon.class, detDataConSet.getId());
//根据多选组合值??????? //根据多选组合值???????

View File

@@ -993,6 +993,7 @@ public class DeviceBrandManageAction extends BaseAction {
String desc = ""; String desc = "";
DeviceTypeInfo devType1=null; DeviceTypeInfo devType1=null;
try { try {
commonService.beginTransaction();
String operator="save"; String operator="save";
// 设备型号不能重复:不同品牌可以重复吗? // 设备型号不能重复:不同品牌可以重复吗?
List<DeviceTypeInfo> list = this.commonService List<DeviceTypeInfo> list = this.commonService
@@ -1076,7 +1077,9 @@ public class DeviceBrandManageAction extends BaseAction {
commonService.clear(); commonService.clear();
this.commonService.update(devType); this.commonService.update(devType);
} }
commonService.commit();
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
desc = getI18nText("BrandManageAction.downloadExampleType.nodeInfoImportErr_n81i")+";"; desc = getI18nText("BrandManageAction.downloadExampleType.nodeInfoImportErr_n81i")+";";
} }
@@ -1086,6 +1089,7 @@ public class DeviceBrandManageAction extends BaseAction {
private String saveNodeBrandType(DeviceBrandType deviceBrandType) { private String saveNodeBrandType(DeviceBrandType deviceBrandType) {
String desc = ""; String desc = "";
try { try {
commonService.beginTransaction();
List<DeviceBrandInfo> DeviceBrandInfolist = commonService.find("from DeviceBrandInfo where deviceRandCode=?",deviceBrandType.getDeviceBrandCode()); List<DeviceBrandInfo> DeviceBrandInfolist = commonService.find("from DeviceBrandInfo where deviceRandCode=?",deviceBrandType.getDeviceBrandCode());
if(DeviceBrandInfolist==null||DeviceBrandInfolist.size()==0){ if(DeviceBrandInfolist==null||DeviceBrandInfolist.size()==0){
return getI18nText("i18n_DeviceBrandManageAction.downloadExampleType.deviceBrandCodeNotExists_n81i"); return getI18nText("i18n_DeviceBrandManageAction.downloadExampleType.deviceBrandCodeNotExists_n81i");
@@ -1119,7 +1123,9 @@ public class DeviceBrandManageAction extends BaseAction {
} }
commonService.save(deviceBrandType); commonService.save(deviceBrandType);
commonService.commit();
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
desc = getI18nText("i18n_DeviceBrandManageAction.downloadExampleType.nodeInfoImportErr_n81i"); desc = getI18nText("i18n_DeviceBrandManageAction.downloadExampleType.nodeInfoImportErr_n81i");
} }
@@ -1501,6 +1507,7 @@ public class DeviceBrandManageAction extends BaseAction {
//添加品牌信息操作 //添加品牌信息操作
public void addDevBrand() { public void addDevBrand() {
try { try {
commonService.beginTransaction();
if(devBrand!=null && StringUtils.isNotBlank(devBrand.getDeviceRandCode())){ if(devBrand!=null && StringUtils.isNotBlank(devBrand.getDeviceRandCode())){
//品牌编号不能重复 //品牌编号不能重复
List list = this.commonService.find("from DeviceBrandInfo where deviceRandCode='"+devBrand.getDeviceRandCode().trim()+"'"); List list = this.commonService.find("from DeviceBrandInfo where deviceRandCode='"+devBrand.getDeviceRandCode().trim()+"'");
@@ -1522,7 +1529,9 @@ public class DeviceBrandManageAction extends BaseAction {
}else { }else {
outHtmlString("<script type=\"text/javascript\">alert('i18n_DeviceBrandManageAction.emportCurrentXls.brandIdIsNotNull_n81i');this.location='deviceBrandManage.do?action=toAddDevBrand';</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_DeviceBrandManageAction.emportCurrentXls.brandIdIsNotNull_n81i');this.location='deviceBrandManage.do?action=toAddDevBrand';</script>");
} }
commonService.commit();
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
outHtmlString("<script type=\"text/javascript\">alert('i18n_DeviceBrandManageAction.importXls.faild_n81i');this.location='deviceBrandManage.do?action=queryDeviceBrandInfo'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_DeviceBrandManageAction.importXls.faild_n81i');this.location='deviceBrandManage.do?action=queryDeviceBrandInfo'</script>");
} }
@@ -1556,6 +1565,7 @@ public class DeviceBrandManageAction extends BaseAction {
// 进行修改品牌信息操作 // 进行修改品牌信息操作
public String updateDevBrand() { public String updateDevBrand() {
try { try {
commonService.beginTransaction();
if(devBrand!=null && StringUtils.isNotBlank(devBrand.getDeviceRandCode())) { if(devBrand!=null && StringUtils.isNotBlank(devBrand.getDeviceRandCode())) {
//品牌编号不能重复 //品牌编号不能重复
List list = this.commonService.find("from DeviceBrandInfo where deviceRandCode='"+devBrand.getDeviceRandCode().trim()+"' and id<>"+devBrand.getId()); List list = this.commonService.find("from DeviceBrandInfo where deviceRandCode='"+devBrand.getDeviceRandCode().trim()+"' and id<>"+devBrand.getId());
@@ -1588,8 +1598,10 @@ public class DeviceBrandManageAction extends BaseAction {
}else { }else {
outHtmlString("<script type=\"text/javascript\">alert('i18n_DeviceBrandManageAction.emportCurrentXls.brandCodeIsNotNull_n81i');window.history.go(-1);</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_DeviceBrandManageAction.emportCurrentXls.brandCodeIsNotNull_n81i');window.history.go(-1);</script>");
} }
commonService.commit();
return null; return null;
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
outHtmlString("<script type=\"text/javascript\">alert('i18n_DeviceBrandManageAction.importXls.faild_n81i');this.location='deviceBrandManage.do?action=queryDeviceBrandInfo&pageNo="+pageNo+"&pageSize="+pageSize+"'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_DeviceBrandManageAction.importXls.faild_n81i');this.location='deviceBrandManage.do?action=queryDeviceBrandInfo&pageNo="+pageNo+"&pageSize="+pageSize+"'</script>");
return null; return null;
@@ -1939,6 +1951,7 @@ public class DeviceBrandManageAction extends BaseAction {
//配置设备的位置 //配置设备的位置
public void configDevicePos(){ public void configDevicePos(){
try { try {
commonService.beginTransaction();
if(devTypeForPosList!=null && devTypeForPosList.size()>0){ if(devTypeForPosList!=null && devTypeForPosList.size()>0){
List<DeviceTypeInfo> updateBatchDevList = new ArrayList<DeviceTypeInfo>(); //更新板槽位置信息 List<DeviceTypeInfo> updateBatchDevList = new ArrayList<DeviceTypeInfo>(); //更新板槽位置信息
List<DeviceBoardsoltBoard> updateDBBList = new ArrayList<DeviceBoardsoltBoard>(); List<DeviceBoardsoltBoard> updateDBBList = new ArrayList<DeviceBoardsoltBoard>();
@@ -1983,7 +1996,9 @@ public class DeviceBrandManageAction extends BaseAction {
this.addDBOperationRpt(commonService, "DeviceTypeInfo", "UPDATE",null); this.addDBOperationRpt(commonService, "DeviceTypeInfo", "UPDATE",null);
} }
outHtmlString("<script type=\"text/javascript\">alert('i18n_DeviceBrandManageAction.importXls.success_n81i');this.location='deviceBrandManage.do?action=queryDeviceTypeInfo'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_DeviceBrandManageAction.importXls.success_n81i');this.location='deviceBrandManage.do?action=queryDeviceTypeInfo'</script>");
}catch(Exception e){ commonService.commit();
}catch(Exception e){
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
outHtmlString("<script type=\"text/javascript\">alert('i18n_DeviceBrandManageAction.importXls.faild_n81i');this.location='deviceBrandManage.do?action=queryDeviceTypeInfo'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_DeviceBrandManageAction.importXls.faild_n81i');this.location='deviceBrandManage.do?action=queryDeviceTypeInfo'</script>");
} }
@@ -1993,6 +2008,7 @@ public class DeviceBrandManageAction extends BaseAction {
System.out.println("right here!"); System.out.println("right here!");
//System.out.println("banka bancao关系:"+pzbkbc+"size:"+devTypeForPosList.size()); //System.out.println("banka bancao关系:"+pzbkbc+"size:"+devTypeForPosList.size());
try { try {
commonService.beginTransaction();
if(devTypeForPosList!=null && devTypeForPosList.size()>0){ if(devTypeForPosList!=null && devTypeForPosList.size()>0){
// String[] strGroup = new String[0]; // String[] strGroup = new String[0];
List<DeviceTypeInfo> updateBatchDevList = new ArrayList<DeviceTypeInfo>(); //更新板卡位置信息 List<DeviceTypeInfo> updateBatchDevList = new ArrayList<DeviceTypeInfo>(); //更新板卡位置信息
@@ -2056,7 +2072,9 @@ public class DeviceBrandManageAction extends BaseAction {
this.addDBOperationRpt(commonService, "DeviceTypeInfo", "UPDATE",null); this.addDBOperationRpt(commonService, "DeviceTypeInfo", "UPDATE",null);
} }
outHtmlString("<script type=\"text/javascript\">alert('i18n_DeviceBrandManageAction.importXls.success_n81i');this.location='deviceBrandManage.do?action=queryDeviceTypeInfo'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_DeviceBrandManageAction.importXls.success_n81i');this.location='deviceBrandManage.do?action=queryDeviceTypeInfo'</script>");
commonService.commit();
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
outHtmlString("<script type=\"text/javascript\">alert('i18n_DeviceBrandManageAction.importXls.faild_n81i');this.location='deviceBrandManage.do?action=queryDeviceTypeInfo'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_DeviceBrandManageAction.importXls.faild_n81i');this.location='deviceBrandManage.do?action=queryDeviceTypeInfo'</script>");
} }
@@ -2065,6 +2083,7 @@ public class DeviceBrandManageAction extends BaseAction {
public void addDevType() { public void addDevType() {
try { try {
commonService.beginTransaction();
if(devType!=null && StringUtils.isNotBlank(devType.getDeviceTypeCode())){ if(devType!=null && StringUtils.isNotBlank(devType.getDeviceTypeCode())){
//设备型号不能重复:不同品牌可以重复吗? //设备型号不能重复:不同品牌可以重复吗?
List list = this.commonService.find("from DeviceTypeInfo where deviceTypeCode='"+devType.getDeviceTypeCode().trim()+"' and deviceRandCode='"+devType.getDeviceRandCode()+"'"); List list = this.commonService.find("from DeviceTypeInfo where deviceTypeCode='"+devType.getDeviceTypeCode().trim()+"' and deviceRandCode='"+devType.getDeviceRandCode()+"'");
@@ -2186,7 +2205,9 @@ public class DeviceBrandManageAction extends BaseAction {
}else { }else {
outHtmlString("<script type=\"text/javascript\">alert('i18n_DeviceBrandManageAction.toConfDevPos.deviceBrandIsNotNull_n81i');window.history.go(-1);</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_DeviceBrandManageAction.toConfDevPos.deviceBrandIsNotNull_n81i');window.history.go(-1);</script>");
} }
commonService.commit();
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
outHtmlString("<script type=\"text/javascript\">alert('i18n_DeviceBrandManageAction.importXls.faild_n81i');this.location='deviceBrandManage.do?action=queryDeviceTypeInfo'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_DeviceBrandManageAction.importXls.faild_n81i');this.location='deviceBrandManage.do?action=queryDeviceTypeInfo'</script>");
} }
@@ -4314,6 +4335,7 @@ public class DeviceBrandManageAction extends BaseAction {
//新增槽位设备 //新增槽位设备
public void addPosDevType() { public void addPosDevType() {
try { try {
commonService.beginTransaction();
if(devType!=null && StringUtils.isNotBlank(devType.getDeviceTypeCode())){ if(devType!=null && StringUtils.isNotBlank(devType.getDeviceTypeCode())){
Integer indexStart = devType.getShowIndexStart(); Integer indexStart = devType.getShowIndexStart();
Integer indexEnd = devType.getShowIndexEnd(); Integer indexEnd = devType.getShowIndexEnd();
@@ -4384,7 +4406,9 @@ public class DeviceBrandManageAction extends BaseAction {
}else { }else {
outHtmlString("<script type=\"text/javascript\">alert('i18n_DeviceBrandManageAction.toConfDevPos.deviceBrandIsNotNull_n81i');window.history.go(-1);</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_DeviceBrandManageAction.toConfDevPos.deviceBrandIsNotNull_n81i');window.history.go(-1);</script>");
} }
commonService.commit();
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
outHtmlString("<script type=\"text/javascript\">alert('i18n_DeviceBrandManageAction.importXls.faild_n81i');this.location='deviceBrandManage.do?action=queryDeviceTypeInfo'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_DeviceBrandManageAction.importXls.faild_n81i');this.location='deviceBrandManage.do?action=queryDeviceTypeInfo'</script>");
} }
@@ -4393,6 +4417,7 @@ public class DeviceBrandManageAction extends BaseAction {
//批量新增设备型号(一级设备没有批量新增,也不需要):编号是一个范围,无最大叠加数,需要上传多个图片(图片和设备如何对应呢???):批量插入多条 //批量新增设备型号(一级设备没有批量新增,也不需要):编号是一个范围,无最大叠加数,需要上传多个图片(图片和设备如何对应呢???):批量插入多条
public void addBatchDevType() { public void addBatchDevType() {
try { try {
commonService.beginTransaction();
if(devType!=null && StringUtils.isNotBlank(devType.getDeviceTypeCode()) if(devType!=null && StringUtils.isNotBlank(devType.getDeviceTypeCode())
&& StringUtils.isNotBlank(devType.getPid())){ && StringUtils.isNotBlank(devType.getPid())){
//设备型号不能重复:不同品牌可以重复吗? //设备型号不能重复:不同品牌可以重复吗?
@@ -4505,7 +4530,9 @@ public class DeviceBrandManageAction extends BaseAction {
}else { }else {
outHtmlString("<script type=\"text/javascript\">alert('i18n_DeviceBrandManageAction.toConfDevPos.deviceBrandIsNotNull_n81i');window.history.go(-1);</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_DeviceBrandManageAction.toConfDevPos.deviceBrandIsNotNull_n81i');window.history.go(-1);</script>");
} }
commonService.commit();
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
outHtmlString("<script type=\"text/javascript\">alert('i18n_DeviceBrandManageAction.importXls.faild_n81i');this.location='deviceBrandManage.do?action=queryDeviceTypeInfo'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_DeviceBrandManageAction.importXls.faild_n81i');this.location='deviceBrandManage.do?action=queryDeviceTypeInfo'</script>");
} }
@@ -4597,6 +4624,7 @@ public class DeviceBrandManageAction extends BaseAction {
public String deleteDevType()throws Exception{ public String deleteDevType()throws Exception{
try { try {
commonService.beginTransaction();
if(ids!=null&&!"".equals(ids)) { if(ids!=null&&!"".equals(ids)) {
//不能删除有设备型号的品牌 //不能删除有设备型号的品牌
List list = this.commonService.find("from DeviceTypeInfo where pid in( "+ids+")"); List list = this.commonService.find("from DeviceTypeInfo where pid in( "+ids+")");
@@ -4631,7 +4659,9 @@ public class DeviceBrandManageAction extends BaseAction {
} }
} }
outHtmlString("<script type=\"text/javascript\">alert('i18n_DeviceBrandManageAction.importXls.success_n81i');this.location='deviceBrandManage.do?action=queryDeviceTypeInfo&devTypeCodeForSearch="+devTypeCodeForSearch+"&devRandCodeForSearch="+devRandCodeForSearch+"&parDevId="+parDevId+"'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_DeviceBrandManageAction.importXls.success_n81i');this.location='deviceBrandManage.do?action=queryDeviceTypeInfo&devTypeCodeForSearch="+devTypeCodeForSearch+"&devRandCodeForSearch="+devRandCodeForSearch+"&parDevId="+parDevId+"'</script>");
commonService.commit();
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
outHtmlString("<script type=\"text/javascript\">alert('i18n_DeviceBrandManageAction.importXls.faild_n81i');this.location='deviceBrandManage.do?action=queryDeviceTypeInfo'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_DeviceBrandManageAction.importXls.faild_n81i');this.location='deviceBrandManage.do?action=queryDeviceTypeInfo'</script>");
} }
@@ -4690,6 +4720,7 @@ public class DeviceBrandManageAction extends BaseAction {
//jsp界面控制只可以修改叶子设备 //jsp界面控制只可以修改叶子设备
public void updateDevType() { public void updateDevType() {
try { try {
commonService.beginTransaction();
if(devType!=null && StringUtils.isNotBlank(devType.getDeviceTypeCode())){ if(devType!=null && StringUtils.isNotBlank(devType.getDeviceTypeCode())){
//设备型号不能重复:不同品牌可以重复吗? //设备型号不能重复:不同品牌可以重复吗?
/*List list = this.commonService.find("from DeviceTypeInfo where deviceTypeCode='"+devType.getDeviceTypeCode().trim()+"' and deviceRandCode='"+devType.getDeviceRandCode()+"' and id<>"+devType.getId()); /*List list = this.commonService.find("from DeviceTypeInfo where deviceTypeCode='"+devType.getDeviceTypeCode().trim()+"' and deviceRandCode='"+devType.getDeviceRandCode()+"' and id<>"+devType.getId());
@@ -4842,7 +4873,9 @@ public class DeviceBrandManageAction extends BaseAction {
this.addDBOperationRpt(commonService, "DeviceTypeInfo", "UPDATE",devType.getId()); this.addDBOperationRpt(commonService, "DeviceTypeInfo", "UPDATE",devType.getId());
outHtmlString("<script type=\"text/javascript\">alert('i18n_DeviceBrandManageAction.importXls.success_n81i');this.location='deviceBrandManage.do?action=queryDeviceTypeInfo&devTypeCodeForSearch="+devTypeCodeForSearch+"&devRandCodeForSearch="+devRandCodeForSearch+"&parDevId="+parDevId+"'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_DeviceBrandManageAction.importXls.success_n81i');this.location='deviceBrandManage.do?action=queryDeviceTypeInfo&devTypeCodeForSearch="+devTypeCodeForSearch+"&devRandCodeForSearch="+devRandCodeForSearch+"&parDevId="+parDevId+"'</script>");
} }
commonService.commit();
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
outHtmlString("<script type=\"text/javascript\">alert('i18n_DeviceBrandManageAction.importXls.faild_n81i');this.location='deviceBrandManage.do?action=queryDeviceTypeInfo'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_DeviceBrandManageAction.importXls.faild_n81i');this.location='deviceBrandManage.do?action=queryDeviceTypeInfo'</script>");
} }

View File

@@ -177,6 +177,7 @@ public class NodeGroupManageAction extends BaseAction{
//添加节点组 //添加节点组
public String addNodeGroupInfo(){ public String addNodeGroupInfo(){
try{ try{
commonService.beginTransaction();
List list = this.commonService.find("from NodegroupTable where groupName=?", nodeGroup.getGroupName()); List list = this.commonService.find("from NodegroupTable where groupName=?", nodeGroup.getGroupName());
if(list!=null && list.size()>0){ if(list!=null && list.size()>0){
this.outHtmlString("<script>alert('i18n_NodeGroupManageAction.addNodeGroupInfo.nodeGroupExists_n81i');history.back();</script>"); this.outHtmlString("<script>alert('i18n_NodeGroupManageAction.addNodeGroupInfo.nodeGroupExists_n81i');history.back();</script>");
@@ -232,9 +233,12 @@ public class NodeGroupManageAction extends BaseAction{
//将添加操作写到操作日志中 //将添加操作写到操作日志中
this.addDBOperationRpt(commonService, "nodegroup_table", "INSERT", nodeGroup.getGroupId()); this.addDBOperationRpt(commonService, "nodegroup_table", "INSERT", nodeGroup.getGroupId());
commonService.commit();
this.sendNodeAndGroupId(nodeGroup.getGroupId(), null,commonService); //通知NMSServer更新节点组的监控信息 this.sendNodeAndGroupId(nodeGroup.getGroupId(), null,commonService); //通知NMSServer更新节点组的监控信息
this.getRequest().setAttribute("MSG", 1); this.getRequest().setAttribute("MSG", 1);
}catch (Exception e){ }catch (Exception e){
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
outHtmlString("<script type=\"text/javascript\">alert('i18n_NodeGroupManageAction.openAddNodeGroupInfo.faild_n81i');" + outHtmlString("<script type=\"text/javascript\">alert('i18n_NodeGroupManageAction.openAddNodeGroupInfo.faild_n81i');" +
"this.location='nodeGroupManage.do?action=query'</script>"); "this.location='nodeGroupManage.do?action=query'</script>");
@@ -300,6 +304,7 @@ public class NodeGroupManageAction extends BaseAction{
//修改节点组 //修改节点组
public String updateNodeGroupInfo(){ public String updateNodeGroupInfo(){
try{ try{
commonService.beginTransaction();
List list = this.commonService.find("from NodegroupTable where groupName=? and groupId<>?", List list = this.commonService.find("from NodegroupTable where groupName=? and groupId<>?",
nodeGroup.getGroupName(),nodeGroup.getGroupId()); nodeGroup.getGroupName(),nodeGroup.getGroupId());
if(list!=null && list.size()>0){ if(list!=null && list.size()>0){
@@ -327,12 +332,15 @@ public class NodeGroupManageAction extends BaseAction{
//将更新操作写到操作日志中 //将更新操作写到操作日志中
this.addDBOperationRpt(commonService, "nodegroup_table", "UPDATE", nodeGroup.getGroupId()); this.addDBOperationRpt(commonService, "nodegroup_table", "UPDATE", nodeGroup.getGroupId());
commonService.commit();
} }
if(flag){ if(flag){
this.sendNodeAndGroupId(group.getGroupId(), null,commonService); //通知NMSServer更新节点组的监控信息 this.sendNodeAndGroupId(group.getGroupId(), null,commonService); //通知NMSServer更新节点组的监控信息
} }
this.getRequest().setAttribute("MSG", 1); this.getRequest().setAttribute("MSG", 1);
}catch (Exception e){ }catch (Exception e){
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
outHtmlString("<script type=\"text/javascript\">alert('i18n_NodeGroupManageAction.openAddNodeGroupInfo.faild_n81i');" + outHtmlString("<script type=\"text/javascript\">alert('i18n_NodeGroupManageAction.openAddNodeGroupInfo.faild_n81i');" +
"this.location='nodeGroupManage.do?action=query'</script>"); "this.location='nodeGroupManage.do?action=query'</script>");
@@ -343,18 +351,22 @@ public class NodeGroupManageAction extends BaseAction{
//停用节点组 //停用节点组
public String stopNodeGroupInfo(){ public String stopNodeGroupInfo(){
try{ try{
commonService.beginTransaction();
if(ids!=null && ids.length>0){ if(ids!=null && ids.length>0){
for(int i=0; i<ids.length; i++){ for(int i=0; i<ids.length; i++){
this.commonService.updateByHql( this.commonService.updateByHql(
"update NodegroupTable set isValid=0 where groupId=?", ids[i]); "update NodegroupTable set isValid=0 where groupId=?", ids[i]);
this.sendNodeAndGroupId(ids[i], null,commonService); //通知NMSServer更新节点组的监控信息
//将更新操作写到操作日志中 //将更新操作写到操作日志中
this.addDBOperationRpt(commonService, "nodegroup_table", "UPDATE", ids[i]); this.addDBOperationRpt(commonService, "nodegroup_table", "UPDATE", ids[i]);
commonService.commit();
this.sendNodeAndGroupId(ids[i], null,commonService); //通知NMSServer更新节点组的监控信息
} }
} }
//this.getRequest().setAttribute("MSG", 1); //this.getRequest().setAttribute("MSG", 1);
}catch (Exception e){ }catch (Exception e){
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
outHtmlString("<script type=\"text/javascript\">alert('i18n_NodeGroupManageAction.openAddNodeGroupInfo.faild_n81i');" + outHtmlString("<script type=\"text/javascript\">alert('i18n_NodeGroupManageAction.openAddNodeGroupInfo.faild_n81i');" +
"this.location='nodeGroupManage.do?action=query'</script>"); "this.location='nodeGroupManage.do?action=query'</script>");
@@ -369,17 +381,22 @@ public class NodeGroupManageAction extends BaseAction{
//启用节点组 //启用节点组
public String startNodeGroupInfo(){ public String startNodeGroupInfo(){
try{ try{
commonService.beginTransaction();
if(ids!=null && ids.length>0){ if(ids!=null && ids.length>0){
for(int i=0; i<ids.length; i++){ for(int i=0; i<ids.length; i++){
this.commonService.updateByHql( this.commonService.updateByHql(
"update NodegroupTable set isValid=1 where groupId=?", ids[i]); "update NodegroupTable set isValid=1 where groupId=?", ids[i]);
this.sendNodeAndGroupId(ids[i], null,commonService); //通知NMSServer更新节点组的监控信息
//将更新操作写到操作日志中 //将更新操作写到操作日志中
this.addDBOperationRpt(commonService, "nodegroup_table", "UPDATE", ids[i]); this.addDBOperationRpt(commonService, "nodegroup_table", "UPDATE", ids[i]);
commonService.commit();
this.sendNodeAndGroupId(ids[i], null,commonService); //通知NMSServer更新节点组的监控信息
} }
} }
}catch (Exception e){ }catch (Exception e){
e.printStackTrace(); e.printStackTrace();
commonService.rollback();
outHtmlString("<script type=\"text/javascript\">alert('i18n_NodeGroupManageAction.openAddNodeGroupInfo.faild_n81i');" + outHtmlString("<script type=\"text/javascript\">alert('i18n_NodeGroupManageAction.openAddNodeGroupInfo.faild_n81i');" +
"this.location='nodeGroupManage.do?action=query'</script>"); "this.location='nodeGroupManage.do?action=query'</script>");
} }

View File

@@ -205,6 +205,7 @@ public class NodeManageAction extends BaseAction {
} }
//IP在同一节点组下不重复 //IP在同一节点组下不重复
if(!groupNodeIpIsRepeat(nodeTable.getNodeIp(),mkid)){ if(!groupNodeIpIsRepeat(nodeTable.getNodeIp(),mkid)){
commonService.beginTransaction();
NodegroupTable group = (NodegroupTable) this.commonService.get(NodegroupTable.class, mkid); NodegroupTable group = (NodegroupTable) this.commonService.get(NodegroupTable.class, mkid);
if (group != null ) { if (group != null ) {
//处理节点类型与节点U位为了保证拓扑图的正常显示 //处理节点类型与节点U位为了保证拓扑图的正常显示
@@ -260,19 +261,22 @@ public class NodeManageAction extends BaseAction {
} }
} }
} }
// 将添加操作写到操作日志中
this.addDBOperationRpt(commonService, "node_table", "INSERT",nodeTable.getNodeId());
commonService.commit();
if(new Long(1).equals(group.getIsValid())){ //节点组有效 if(new Long(1).equals(group.getIsValid())){ //节点组有效
this.sendNodeAndGroupId(nodeTable.getGroupId(), nodeTable.getNodeId(),commonService); //通知NMSServer更新节点组的监控信息 this.sendNodeAndGroupId(nodeTable.getGroupId(), nodeTable.getNodeId(),commonService); //通知NMSServer更新节点组的监控信息
} }
// 将添加操作写到操作日志中
this.addDBOperationRpt(commonService, "node_table", "INSERT",nodeTable.getNodeId());
} }
this.getRequest().setAttribute("MSG", 1); this.getRequest().setAttribute("MSG", 1);
}else{ }else{
this.outHtmlString("<script>alert('i18n_NodeManageAction.addNodeInfo.nodeGroupHadIp_n81i');history.back();</script>"); this.outHtmlString("<script>alert('i18n_NodeManageAction.addNodeInfo.nodeGroupHadIp_n81i');history.back();</script>");
return null; return null;
} }
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
return "error"; return "error";
} }
@@ -542,6 +546,7 @@ public class NodeManageAction extends BaseAction {
} }
//IP在同一节点组下不重复 //IP在同一节点组下不重复
if(!groupNodeIpIsRepeat(nodeTable.getNodeIp(),mkid,nodeTable.getNodeId())){ if(!groupNodeIpIsRepeat(nodeTable.getNodeIp(),mkid,nodeTable.getNodeId())){
commonService.beginTransaction();
NodeTable nt = (NodeTable) this.commonService.get(NodeTable.class, nodeTable.getNodeId()); NodeTable nt = (NodeTable) this.commonService.get(NodeTable.class, nodeTable.getNodeId());
if (nt != null ) { if (nt != null ) {
boolean flag =false; boolean flag =false;
@@ -588,22 +593,26 @@ public class NodeManageAction extends BaseAction {
} }
this.commonService.update(nt); this.commonService.update(nt);
// 将更新操作写到操作日志中
this.addDBOperationRpt(commonService, "node_table", "UPDATE",
nodeTable.getNodeId());
commonService.commit();
if(flag){ if(flag){
if(new Long(1).equals(group.getIsValid())){ //节点组有效 if(new Long(1).equals(group.getIsValid())){ //节点组有效
this.sendNodeAndGroupId(nt.getGroupId(), nt.getNodeId(),commonService); //通知NMSServer更新节点组的监控信息 this.sendNodeAndGroupId(nt.getGroupId(), nt.getNodeId(),commonService); //通知NMSServer更新节点组的监控信息
} }
} }
// 将更新操作写到操作日志中
this.addDBOperationRpt(commonService, "node_table", "UPDATE",
nodeTable.getNodeId());
} }
this.getRequest().setAttribute("MSG", 1); this.getRequest().setAttribute("MSG", 1);
}else{ }else{
this.outHtmlString("<script>alert('i18n_NodeManageAction.addNodeInfo.nodeGroupHadIp_n81i');history.back();</script>"); this.outHtmlString("<script>alert('i18n_NodeManageAction.addNodeInfo.nodeGroupHadIp_n81i');history.back();</script>");
return null; return null;
} }
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
return "error"; return "error";
} }
@@ -613,6 +622,7 @@ public class NodeManageAction extends BaseAction {
// 停用节点 // 停用节点
public String stopNodeInfo() { public String stopNodeInfo() {
try { try {
commonService.beginTransaction();
List noList = this.commonService.find( List noList = this.commonService.find(
"from NodeTable where nodeId=?", nodeId); "from NodeTable where nodeId=?", nodeId);
@@ -623,18 +633,23 @@ public class NodeManageAction extends BaseAction {
nd.setNodeStoptime(new Date()); nd.setNodeStoptime(new Date());
this.commonService.update(nd); this.commonService.update(nd);
// 将更新操作写到操作日志中
this.addDBOperationRpt(commonService, "node_table", "UPDATE",
nd.getNodeId());
commonService.commit();
NodegroupTable group = (NodegroupTable) this.commonService.get(NodegroupTable.class, nd.getGroupId()); NodegroupTable group = (NodegroupTable) this.commonService.get(NodegroupTable.class, nd.getGroupId());
if(new Long(1).equals(group.getIsValid())){ //节点组有效 if(new Long(1).equals(group.getIsValid())){ //节点组有效
this.sendNodeAndGroupId(nd.getGroupId(), nd.getNodeId(),commonService); //通知NMSServer更新节点组的监控信息 this.sendNodeAndGroupId(nd.getGroupId(), nd.getNodeId(),commonService); //通知NMSServer更新节点组的监控信息
} }
// 将更新操作写到操作日志中
this.addDBOperationRpt(commonService, "node_table", "UPDATE",
nd.getNodeId());
} }
this.getRequest().setAttribute("MSG", 1); this.getRequest().setAttribute("MSG", 1);
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
return "error"; return "error";
} }
@@ -644,17 +659,21 @@ public class NodeManageAction extends BaseAction {
// 启用节点 // 启用节点
public String startNodeInfo() { public String startNodeInfo() {
try { try {
commonService.beginTransaction();
this.commonService.updateByHql( this.commonService.updateByHql(
"update NodeTable set nodeState=0 where nodeId=?", nodeId); "update NodeTable set nodeState=0 where nodeId=?", nodeId);
NodeTable nd = (NodeTable) this.commonService.get(NodeTable.class, nodeId); NodeTable nd = (NodeTable) this.commonService.get(NodeTable.class, nodeId);
NodegroupTable group = (NodegroupTable) this.commonService.get(NodegroupTable.class, nd.getGroupId()); NodegroupTable group = (NodegroupTable) this.commonService.get(NodegroupTable.class, nd.getGroupId());
if(new Long(1).equals(group.getIsValid())){ //节点组有效
this.sendNodeAndGroupId(nd.getGroupId(), nd.getNodeId(),commonService); //通知NMSServer更新节点组的监控信息
}
// 将更新操作写到操作日志中 // 将更新操作写到操作日志中
this.addDBOperationRpt(commonService, "node_table", "UPDATE", this.addDBOperationRpt(commonService, "node_table", "UPDATE",
nodeId); nodeId);
commonService.commit();
if(new Long(1).equals(group.getIsValid())){ //节点组有效
this.sendNodeAndGroupId(nd.getGroupId(), nd.getNodeId(),commonService); //通知NMSServer更新节点组的监控信息
}
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
return "error"; return "error";
} }
@@ -871,6 +890,7 @@ public class NodeManageAction extends BaseAction {
private String saveNode(NodeTableVo vo, NodegroupTable group) { private String saveNode(NodeTableVo vo, NodegroupTable group) {
String desc = ""; String desc = "";
try { try {
commonService.beginTransaction();
if (group != null) { if (group != null) {
// IP在同一节点组下不重复 // IP在同一节点组下不重复
if (!groupNodeIpIsRepeat(vo.getNodeIp(), group if (!groupNodeIpIsRepeat(vo.getNodeIp(), group
@@ -899,8 +919,9 @@ public class NodeManageAction extends BaseAction {
}else { }else {
desc = getI18nText("i18n_NodeManageAction.downloadExample.nodeGroupIsNull_n81i"); desc = getI18nText("i18n_NodeManageAction.downloadExample.nodeGroupIsNull_n81i");
} }
commonService.commit();
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
desc =getI18nText("i18n_NodeManageAction.downloadExample.nodeInfoImportErr_n81i"); desc =getI18nText("i18n_NodeManageAction.downloadExample.nodeInfoImportErr_n81i");
} }

View File

@@ -115,13 +115,16 @@ public class SnmpDetectManageAction extends BaseAction {
// 添加snmp监测项操作 // 添加snmp监测项操作
public String addSnmpDetectType() { public String addSnmpDetectType() {
try { try {
commonService.beginTransaction();
if(sortInfo!=null){ if(sortInfo!=null){
this.commonService.save(sortInfo); this.commonService.save(sortInfo);
// 将添加操作写到操作日志中 // 将添加操作写到操作日志中
this.addDBOperationRpt(commonService, "SortInfo", "INSERT",sortInfo.getId()); this.addDBOperationRpt(commonService, "SortInfo", "INSERT",sortInfo.getId());
outHtmlString("<script type=\"text/javascript\">alert('i18n_SnmpDetectManageAction.addSnmpDetectType.success_n81i');this.location='snmpDetectManage.do?action=querySnmpDetectTypeInfo'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_SnmpDetectManageAction.addSnmpDetectType.success_n81i');this.location='snmpDetectManage.do?action=querySnmpDetectTypeInfo'</script>");
} }
commonService.commit();
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
outHtmlString("<script type=\"text/javascript\">alert('i18n_SnmpDetectManageAction.addSnmpDetectType.faild_n81i');this.location='snmpDetectManage.do?action=querySnmpDetectTypeInfo'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_SnmpDetectManageAction.addSnmpDetectType.faild_n81i');this.location='snmpDetectManage.do?action=querySnmpDetectTypeInfo'</script>");
} }
@@ -147,6 +150,7 @@ public class SnmpDetectManageAction extends BaseAction {
// 进行修改snmp监测项操作 // 进行修改snmp监测项操作
public String updateSnmpDetectType() { public String updateSnmpDetectType() {
try { try {
commonService.beginTransaction();
SortInfo sortForUpdate = (SortInfo) commonService.get(SortInfo.class, sortInfo.getId()); SortInfo sortForUpdate = (SortInfo) commonService.get(SortInfo.class, sortInfo.getId());
sortForUpdate.setSortName(sortInfo.getSortName()); sortForUpdate.setSortName(sortInfo.getSortName());
sortForUpdate.setSortDesc(sortInfo.getSortDesc()); sortForUpdate.setSortDesc(sortInfo.getSortDesc());
@@ -154,8 +158,10 @@ public class SnmpDetectManageAction extends BaseAction {
// 将更新操作写到操作日志中 // 将更新操作写到操作日志中
this.addDBOperationRpt(commonService, "SortInfo", "UPDATE",sortForUpdate.getId()); this.addDBOperationRpt(commonService, "SortInfo", "UPDATE",sortForUpdate.getId());
outHtmlString("<script type=\"text/javascript\">alert('i18n_SnmpDetectManageAction.addSnmpDetectType.success_n81i');this.location='snmpDetectManage.do?action=querySnmpDetectTypeInfo&pageNo="+pageNo+"&pageSize="+pageSize+"'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_SnmpDetectManageAction.addSnmpDetectType.success_n81i');this.location='snmpDetectManage.do?action=querySnmpDetectTypeInfo&pageNo="+pageNo+"&pageSize="+pageSize+"'</script>");
commonService.commit();
return null; return null;
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
outHtmlString("<script type=\"text/javascript\">alert('i18n_SnmpDetectManageAction.addSnmpDetectType.faild_n81i');this.location='snmpDetectManage.do?action=querySnmpDetectTypeInfo&pageNo="+pageNo+"&pageSize="+pageSize+"'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_SnmpDetectManageAction.addSnmpDetectType.faild_n81i');this.location='snmpDetectManage.do?action=querySnmpDetectTypeInfo&pageNo="+pageNo+"&pageSize="+pageSize+"'</script>");
return null; return null;
@@ -179,13 +185,17 @@ public class SnmpDetectManageAction extends BaseAction {
//删除snmp监测项 //删除snmp监测项
public String deleteSnmpDetectType()throws Exception{ public String deleteSnmpDetectType()throws Exception{
try { try {
commonService.beginTransaction();
if(ids!=null&&!"".equals(ids)) { if(ids!=null&&!"".equals(ids)) {
String hql = "DELETE FROM SortInfo WHERE ID IN ("+ ids + ")"; String hql = "DELETE FROM SortInfo WHERE ID IN ("+ ids + ")";
this.commonService.delete(hql); this.commonService.delete(hql);
} }
commonService.commit();
// this.getRequest().setAttribute("MSG", 1); // this.getRequest().setAttribute("MSG", 1);
// outHtmlString("<script type=\"text/javascript\">this.location='brandManage.do?action=queryBrandInfo'</script>"); // outHtmlString("<script type=\"text/javascript\">this.location='brandManage.do?action=queryBrandInfo'</script>");
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
//outHtmlString("<script type=\"text/javascript\">alert('操作失败');this.location='checkTypeSet.do?action=query'</script>"); //outHtmlString("<script type=\"text/javascript\">alert('操作失败');this.location='checkTypeSet.do?action=query'</script>");
} }

View File

@@ -104,6 +104,7 @@ public class SysErrorManageAction extends BaseAction {
public void addErrorInfo() { public void addErrorInfo() {
try { try {
commonService.beginTransaction();
// if(checkCode(troubleState.getTroubleCode())){ // if(checkCode(troubleState.getTroubleCode())){
SystemTable sys = null; SystemTable sys = null;
if(this.getAdminMark()){//是 if(this.getAdminMark()){//是
@@ -126,7 +127,9 @@ public class SysErrorManageAction extends BaseAction {
this.outHtmlString("<script>alert('故障代码已存在,请重新输入!');history.back();</script>"); this.outHtmlString("<script>alert('故障代码已存在,请重新输入!');history.back();</script>");
return; return;
}*/ }*/
commonService.commit();
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
outHtmlString("<script type=\"text/javascript\">alert('i18n_SysErrorManageAction.addErrorInfo.faild_n81i');this.location='sysErrorManage!execute.do?action=query&pageNo="+pageNo+"&pageSize="+pageSize+"'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_SysErrorManageAction.addErrorInfo.faild_n81i');this.location='sysErrorManage!execute.do?action=query&pageNo="+pageNo+"&pageSize="+pageSize+"'</script>");
} }
@@ -184,6 +187,7 @@ public class SysErrorManageAction extends BaseAction {
public void doUpdate() { public void doUpdate() {
try { try {
commonService.beginTransaction();
TroubleState md = (TroubleState) commonService.get(TroubleState.class, troubleState TroubleState md = (TroubleState) commonService.get(TroubleState.class, troubleState
.getId()); .getId());
SystemTable sys = null; SystemTable sys = null;
@@ -207,7 +211,9 @@ public class SysErrorManageAction extends BaseAction {
this.addDBOperationRpt(commonService, "Trouble_State", "UPDATE", this.addDBOperationRpt(commonService, "Trouble_State", "UPDATE",
troubleState.getId()); troubleState.getId());
outHtmlString("<script type=\"text/javascript\">alert('i18n_SysErrorManageAction.addErrorInfo.success_n81i');this.location='sysErrorManage!execute.do?action=query&pageNo="+pageNo+"&pageSize="+pageSize+"'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_SysErrorManageAction.addErrorInfo.success_n81i');this.location='sysErrorManage!execute.do?action=query&pageNo="+pageNo+"&pageSize="+pageSize+"'</script>");
commonService.commit();
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
outHtmlString("<script type=\"text/javascript\">alert('i18n_SysErrorManageAction.addErrorInfo.faild_n81i');this.location='sysErrorManage!execute.do?action=query&pageNo="+pageNo+"&pageSize="+pageSize+"'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_SysErrorManageAction.addErrorInfo.faild_n81i');this.location='sysErrorManage!execute.do?action=query&pageNo="+pageNo+"&pageSize="+pageSize+"'</script>");
} }

View File

@@ -317,13 +317,16 @@ public class SysPopedomManageAction extends BaseAction
{ {
try try
{ {
commonService.beginTransaction();
module.setCtime(new Date()); module.setCtime(new Date());
this.commonService.save(module); this.commonService.save(module);
// 将添加操作写到操作日志中 // 将添加操作写到操作日志中
this.addDBOperationRpt(commonService, "XT_MK_JBXX", "INSERT", module.getId()); this.addDBOperationRpt(commonService, "XT_MK_JBXX", "INSERT", module.getId());
this.getRequest().setAttribute("MSG", "1");// 操作成功 this.getRequest().setAttribute("MSG", "1");// 操作成功
commonService.commit();
} catch (Exception e) } catch (Exception e)
{ {
commonService.rollback();
this.getRequest().setAttribute("MSG", "2");// 操作失败 this.getRequest().setAttribute("MSG", "2");// 操作失败
e.printStackTrace(); e.printStackTrace();
@@ -378,6 +381,7 @@ public class SysPopedomManageAction extends BaseAction
{ {
try try
{ {
commonService.beginTransaction();
XtMkJbxx md = (XtMkJbxx) commonService.get(XtMkJbxx.class, module.getId()); XtMkJbxx md = (XtMkJbxx) commonService.get(XtMkJbxx.class, module.getId());
// md.setMkbh(module.getMkbh()); // md.setMkbh(module.getMkbh());
md.setMkmc(module.getMkmc()); md.setMkmc(module.getMkmc());
@@ -388,8 +392,10 @@ public class SysPopedomManageAction extends BaseAction
// 将更新操作写到操作日志中 // 将更新操作写到操作日志中
this.addDBOperationRpt(commonService, "XT_MK_JBXX", "UPDATE", module.getId()); this.addDBOperationRpt(commonService, "XT_MK_JBXX", "UPDATE", module.getId());
this.getRequest().setAttribute("MSG", "1"); this.getRequest().setAttribute("MSG", "1");
commonService.commit();
} catch (Exception e) } catch (Exception e)
{ {
commonService.rollback();
this.getRequest().setAttribute("MSG", "2"); this.getRequest().setAttribute("MSG", "2");
updateMkInfo(); updateMkInfo();
e.printStackTrace(); e.printStackTrace();
@@ -521,6 +527,7 @@ public class SysPopedomManageAction extends BaseAction
{ {
try try
{ {
commonService.beginTransaction();
role.setZxbz("0"); role.setZxbz("0");
this.commonService.save(role); this.commonService.save(role);
// 将添加操作写到操作日志中 // 将添加操作写到操作日志中
@@ -536,8 +543,10 @@ public class SysPopedomManageAction extends BaseAction
this.commonService.save(roleModule); this.commonService.save(roleModule);
} }
outHtmlString("<script type=\"text/javascript\">alert('i18n_SysPopedomManageAction.addJsInfo.success_n81i');this.location='sysPopedomManage.do?action=queryJsInfo'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_SysPopedomManageAction.addJsInfo.success_n81i');this.location='sysPopedomManage.do?action=queryJsInfo'</script>");
commonService.commit();
} catch (Exception e) } catch (Exception e)
{ {
commonService.rollback();
outHtmlString("<script type=\"text/javascript\">alert('i18n_SysPopedomManageAction.addJsInfo.faild_n81i');this.location='sysPopedomManage.do?action=queryJsInfo'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_SysPopedomManageAction.addJsInfo.faild_n81i');this.location='sysPopedomManage.do?action=queryJsInfo'</script>");
e.printStackTrace(); e.printStackTrace();
} }
@@ -678,6 +687,7 @@ public class SysPopedomManageAction extends BaseAction
{ {
try try
{ {
commonService.beginTransaction();
String[] sMk = mkid.split(","); String[] sMk = mkid.split(",");
// 删除旧的角色模块信息 // 删除旧的角色模块信息
this.commonService.delete("delete XtJsMkIndex where jsbh=" + role.getJsbh()); this.commonService.delete("delete XtJsMkIndex where jsbh=" + role.getJsbh());
@@ -699,8 +709,10 @@ public class SysPopedomManageAction extends BaseAction
this.commonService.save(roleModule); this.commonService.save(roleModule);
} }
outHtmlString("<script type=\"text/javascript\">alert('i18n_SysPopedomManageAction.addJsInfo.success_n81i');this.location='sysPopedomManage.do?action=queryJsInfo'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_SysPopedomManageAction.addJsInfo.success_n81i');this.location='sysPopedomManage.do?action=queryJsInfo'</script>");
commonService.commit();
} catch (Exception e) } catch (Exception e)
{ {
commonService.rollback();
queryJsInfoByid(); queryJsInfoByid();
queryJsMkInfoByJsbh(); queryJsMkInfoByJsbh();
outHtmlString("<script type=\"text/javascript\">alert('i18n_SysPopedomManageAction.addJsInfo.faild_n81i');this.location='sysPopedomManage.do?action=queryJsInfo'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_SysPopedomManageAction.addJsInfo.faild_n81i');this.location='sysPopedomManage.do?action=queryJsInfo'</script>");
@@ -728,6 +740,7 @@ public class SysPopedomManageAction extends BaseAction
String pwdString = ""; String pwdString = "";
try try
{ {
commonService.beginTransaction();
/*List list = this.commonService.find("from XtYhJbxx where yhbh=?", user.getYhbh()); /*List list = this.commonService.find("from XtYhJbxx where yhbh=?", user.getYhbh());
if (list != null && list.size() > 0) if (list != null && list.size() > 0)
{ {
@@ -823,8 +836,10 @@ public class SysPopedomManageAction extends BaseAction
} }
outHtmlString("<script type=\"text/javascript\">alert('i18n_SysPopedomManageAction.addJsInfo.success_n81i');this.location='sysPopedomManage.do?action=queryUserInfo'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_SysPopedomManageAction.addJsInfo.success_n81i');this.location='sysPopedomManage.do?action=queryUserInfo'</script>");
// } // }
commonService.commit();
} catch (Exception e) } catch (Exception e)
{ {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
outHtmlString("<script type=\"text/javascript\">alert('i18n_SysPopedomManageAction.addJsInfo.faild_n81i');this.location='sysPopedomManage.do?action=queryUserInfo'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_SysPopedomManageAction.addJsInfo.faild_n81i');this.location='sysPopedomManage.do?action=queryUserInfo'</script>");
} }
@@ -1022,6 +1037,7 @@ public class SysPopedomManageAction extends BaseAction
{ {
try try
{ {
commonService.beginTransaction();
XtYhJbxx userNew = (XtYhJbxx) this.commonService.get(XtYhJbxx.class, this.getUserID()); XtYhJbxx userNew = (XtYhJbxx) this.commonService.get(XtYhJbxx.class, this.getUserID());
if (isUpdatePwd == 0l) if (isUpdatePwd == 0l)
{// 修改密码 {// 修改密码
@@ -1036,8 +1052,10 @@ public class SysPopedomManageAction extends BaseAction
// 将删除操作写到操作日志中 // 将删除操作写到操作日志中
this.addDBOperationRpt(commonService, "XT_YH_JBXX", "UPDATE", this.getUserID()); this.addDBOperationRpt(commonService, "XT_YH_JBXX", "UPDATE", this.getUserID());
this.getRequest().setAttribute("MSG", 1); this.getRequest().setAttribute("MSG", 1);
commonService.commit();
} catch (Exception e) } catch (Exception e)
{ {
commonService.rollback();
this.getRequest().setAttribute("MSG", 2); this.getRequest().setAttribute("MSG", 2);
queryUserInfoById(); queryUserInfoById();
e.printStackTrace(); e.printStackTrace();
@@ -1049,6 +1067,7 @@ public class SysPopedomManageAction extends BaseAction
{ {
try try
{ {
commonService.beginTransaction();
// 删除旧的用户角色信息 // 删除旧的用户角色信息
this.commonService.delete("delete XtYhJsIndex where type is null and yhbh='" this.commonService.delete("delete XtYhJsIndex where type is null and yhbh='"
+ new String(yhbh.getBytes("ISO-8859-1"), "UTF-8") + "'"); + new String(yhbh.getBytes("ISO-8859-1"), "UTF-8") + "'");
@@ -1118,8 +1137,10 @@ public class SysPopedomManageAction extends BaseAction
} }
outHtmlString("<script type=\"text/javascript\">alert('i18n_SysPopedomManageAction.addJsInfo.success_n81i');this.location='sysPopedomManage.do?action=queryUserInfo'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_SysPopedomManageAction.addJsInfo.success_n81i');this.location='sysPopedomManage.do?action=queryUserInfo'</script>");
commonService.commit();
} catch (Exception e) } catch (Exception e)
{ {
commonService.rollback();
queryUserInfoById(); queryUserInfoById();
e.printStackTrace(); e.printStackTrace();
outHtmlString("<script type=\"text/javascript\">alert('i18n_SysPopedomManageAction.addJsInfo.faild_n81i');this.location='sysPopedomManage.do?action=queryUserInfo'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_SysPopedomManageAction.addJsInfo.faild_n81i');this.location='sysPopedomManage.do?action=queryUserInfo'</script>");
@@ -1131,6 +1152,7 @@ public class SysPopedomManageAction extends BaseAction
{ {
try try
{ {
commonService.beginTransaction();
XtYhJbxx userNew = (XtYhJbxx) this.commonService.get(XtYhJbxx.class, Long XtYhJbxx userNew = (XtYhJbxx) this.commonService.get(XtYhJbxx.class, Long
.parseLong(yhid.trim())); .parseLong(yhid.trim()));
userNew.setYhmc(user.getYhmc()); userNew.setYhmc(user.getYhmc());
@@ -1150,8 +1172,10 @@ public class SysPopedomManageAction extends BaseAction
// //将删除操作写到操作日志中 // //将删除操作写到操作日志中
this.addDBOperationRpt(commonService, "XT_YH_JBXX", "UPDATE", userNew.getYhid()); this.addDBOperationRpt(commonService, "XT_YH_JBXX", "UPDATE", userNew.getYhid());
outHtmlString("<script type=\"text/javascript\">alert('i18n_SysPopedomManageAction.addJsInfo.success_n81i');this.location='sysPopedomManage.do?action=queryUserInfo'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_SysPopedomManageAction.addJsInfo.success_n81i');this.location='sysPopedomManage.do?action=queryUserInfo'</script>");
commonService.commit();
} catch (Exception e) } catch (Exception e)
{ {
commonService.rollback();
queryUserInfoById(); queryUserInfoById();
e.printStackTrace(); e.printStackTrace();
outHtmlString("<script type=\"text/javascript\">alert('i18n_SysPopedomManageAction.addJsInfo.faild_n81i');this.location='sysPopedomManage.do?action=queryUserInfo'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_SysPopedomManageAction.addJsInfo.faild_n81i');this.location='sysPopedomManage.do?action=queryUserInfo'</script>");
@@ -1375,6 +1399,7 @@ public class SysPopedomManageAction extends BaseAction
{ {
try try
{ {
commonService.beginTransaction();
if (dept.getUpperlayer() == null) if (dept.getUpperlayer() == null)
{ {
dept.setUpperlayer(-1l); dept.setUpperlayer(-1l);
@@ -1385,8 +1410,10 @@ public class SysPopedomManageAction extends BaseAction
this.addDBOperationRpt(commonService, "TABLEDEPARTMENT", "INSERT", dept.getDeptid()); this.addDBOperationRpt(commonService, "TABLEDEPARTMENT", "INSERT", dept.getDeptid());
this.getRequest().setAttribute("MSG", "1");// 操作成功 this.getRequest().setAttribute("MSG", "1");// 操作成功
commonService.commit();
} catch (Exception e) } catch (Exception e)
{ {
commonService.rollback();
this.getRequest().setAttribute("MSG", "2");// 操作失败 this.getRequest().setAttribute("MSG", "2");// 操作失败
e.printStackTrace(); e.printStackTrace();
} }
@@ -1417,6 +1444,7 @@ public class SysPopedomManageAction extends BaseAction
{ {
try try
{ {
commonService.beginTransaction();
TableDepartment deptNew = (TableDepartment) commonService.get(TableDepartment.class, TableDepartment deptNew = (TableDepartment) commonService.get(TableDepartment.class,
Long.parseLong(deptid.trim())); Long.parseLong(deptid.trim()));
if (dept.getUpperlayer() == null) if (dept.getUpperlayer() == null)
@@ -1432,8 +1460,10 @@ public class SysPopedomManageAction extends BaseAction
this.addDBOperationRpt(commonService, "TABLEDEPARTMENT", "UPDATE", dept.getDeptid()); this.addDBOperationRpt(commonService, "TABLEDEPARTMENT", "UPDATE", dept.getDeptid());
this.getRequest().setAttribute("MSG", "1"); this.getRequest().setAttribute("MSG", "1");
commonService.commit();
} catch (Exception e) } catch (Exception e)
{ {
commonService.rollback();
this.getRequest().setAttribute("MSG", "2"); this.getRequest().setAttribute("MSG", "2");
updateMkInfo(); updateMkInfo();
e.printStackTrace(); e.printStackTrace();
@@ -1875,6 +1905,7 @@ public class SysPopedomManageAction extends BaseAction
String pwdString = ""; String pwdString = "";
try try
{ {
commonService.beginTransaction();
List list = this.commonService.find("from XtYhJbxx where yhbh=?", user.getYhbh()); List list = this.commonService.find("from XtYhJbxx where yhbh=?", user.getYhbh());
if (list != null && list.size() > 0) if (list != null && list.size() > 0)
{ {
@@ -1906,8 +1937,10 @@ public class SysPopedomManageAction extends BaseAction
this.addDBOperationRpt(commonService, "XT_YH_JBXX", "INSERT", user.getYhid()); this.addDBOperationRpt(commonService, "XT_YH_JBXX", "INSERT", user.getYhid());
this.getRequest().setAttribute("MSG", 1); this.getRequest().setAttribute("MSG", 1);
} }
commonService.commit();
} catch (Exception e) } catch (Exception e)
{ {
commonService.rollback();
this.getRequest().setAttribute("MSG", 2); this.getRequest().setAttribute("MSG", 2);
e.printStackTrace(); e.printStackTrace();
resu = getI18nText("i18n_SysPopedomManageAction.addJsInfo.userInfoImportErr_n81i"); resu = getI18nText("i18n_SysPopedomManageAction.addJsInfo.userInfoImportErr_n81i");

View File

@@ -1,9 +1,12 @@
package nis.nms.web.actions.sysManage; package nis.nms.web.actions.sysManage;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import nis.nms.core.Constants;
import nis.nms.core.Resource; import nis.nms.core.Resource;
import nis.nms.domains.GorupSystemTable; import nis.nms.domains.GorupSystemTable;
import nis.nms.domains.NodePosition; import nis.nms.domains.NodePosition;
@@ -12,6 +15,7 @@ import nis.nms.domains.NodegroupTable;
import nis.nms.domains.SystemTable; import nis.nms.domains.SystemTable;
import nis.nms.domains.XtJsJbxx; import nis.nms.domains.XtJsJbxx;
import nis.nms.domains.XtYhJbxx; import nis.nms.domains.XtYhJbxx;
import nis.nms.domains.XtYhJsIndex;
import nis.nms.service.CommonService; import nis.nms.service.CommonService;
import nis.nms.util.BaseAction; import nis.nms.util.BaseAction;
import nis.nms.util.IpCovert; import nis.nms.util.IpCovert;
@@ -269,6 +273,7 @@ public class SystemManageAction extends BaseAction{
//添加业务系统 //添加业务系统
public String addSystemInfo(){ public String addSystemInfo(){
try{ try{
commonService.beginTransaction();
List list =null; List list =null;
/*List list = this.commonService.find("from SystemTable where systemName=?", system.getSystemName()); /*List list = this.commonService.find("from SystemTable where systemName=?", system.getSystemName());
if(list!=null && list.size()>0){ if(list!=null && list.size()>0){
@@ -297,6 +302,19 @@ public class SystemManageAction extends BaseAction{
//将添加操作写到操作日志中 //将添加操作写到操作日志中
this.addDBOperationRpt(commonService, "system_table", "INSERT", system.getSystemId()); this.addDBOperationRpt(commonService, "system_table", "INSERT", system.getSystemId());
//2018-09-28新增创建业务系统时创建同名用户组并将该用户组权限赋给nationRole用户
XtJsJbxx role=new XtJsJbxx();
role.setCtime(system.getSystemCreatetime());
role.setZxbz("0");
role.setType(1l);
role.setJsbh(commonService.getSequenceValue("SEQ_XT_JS_JBXX"));
role.setJsmc(system.getSystemName());
role.setJsms(system.getSystemDesc());
commonService.save(role);
//将添加操作写到操作日志中
this.addDBOperationRpt(commonService, "xt_js_jbxx", "INSERT", system.getSystemId());
//保存用户组到关联表 //保存用户组到关联表
if(mkid!=null && !mkid.equals("")){ if(mkid!=null && !mkid.equals("")){
String[] sMk = mkid.split(","); String[] sMk = mkid.split(",");
@@ -307,7 +325,33 @@ public class SystemManageAction extends BaseAction{
groupSys.setUserGroupId(Long.parseLong(sMk[i].trim())); groupSys.setUserGroupId(Long.parseLong(sMk[i].trim()));
this.commonService.save(groupSys); this.commonService.save(groupSys);
} }
GorupSystemTable groupSys= new GorupSystemTable();
groupSys.setSystemId(system.getSystemId());
groupSys.setUserGroupId(role.getJsbh());
this.commonService.save(groupSys);
} }
}else{
GorupSystemTable groupSys= new GorupSystemTable();
groupSys.setSystemId(system.getSystemId());
groupSys.setUserGroupId(role.getJsbh());
this.commonService.save(groupSys);
}
//获取角色为nationoRole的用户
String sql="select yhbh,yhid from xt_yh_jbxx where yhbh in(select yhbh from xt_yh_js_index where jsbh="+Constants.NATION_ROLE+") ";
List<Object[]> users = commonService.executeSQL(sql);
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
for (Object[] user : users) {
XtYhJsIndex xtYhJsIndex=new XtYhJsIndex();
xtYhJsIndex.setCtime(role.getCtime());
xtYhJsIndex.setId(commonService.getSequenceValue("SEQ_XT_YH_JS_INDEX"));
xtYhJsIndex.setJsbh(role.getJsbh());
xtYhJsIndex.setType(role.getType());
xtYhJsIndex.setYhbh((String)user[0]);
xtYhJsIndex.setYhId(((BigDecimal)user[1]).longValue());
commonService.save(xtYhJsIndex);
} }
//拓扑图的数据维护 //拓扑图的数据维护
@@ -335,7 +379,9 @@ public class SystemManageAction extends BaseAction{
}else{ }else{
outHtmlString("<script type=\"text/javascript\">alert('i18n_SystemManageAction.ajaxCheck.success_n81i');this.location='systemManage.do?action=query'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_SystemManageAction.ajaxCheck.success_n81i');this.location='systemManage.do?action=query'</script>");
} }
commonService.commit();
}catch (Exception e){ }catch (Exception e){
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
logger.error(e.getStackTrace()); logger.error(e.getStackTrace());
outHtmlString("<script type=\"text/javascript\">alert('i18n_SystemManageAction.ajaxCheck.faild_n81i');" + outHtmlString("<script type=\"text/javascript\">alert('i18n_SystemManageAction.ajaxCheck.faild_n81i');" +
@@ -384,6 +430,7 @@ public class SystemManageAction extends BaseAction{
//修改业务系统 //修改业务系统
public String updateSystemInfo(){ public String updateSystemInfo(){
try{ try{
commonService.beginTransaction();
/*List list = this.commonService.find( /*List list = this.commonService.find(
"from SystemTable where systemName=? and systemId<>?", "from SystemTable where systemName=? and systemId<>?",
system.getSystemName(), system.getSystemId()); system.getSystemName(), system.getSystemId());
@@ -429,7 +476,9 @@ public class SystemManageAction extends BaseAction{
outHtmlString("<script type=\"text/javascript\">alert('i18n_SystemManageAction.ajaxCheck.success_n81i');" + outHtmlString("<script type=\"text/javascript\">alert('i18n_SystemManageAction.ajaxCheck.success_n81i');" +
"this.location='systemManage.do?action=query&pageNo=" + pageNo + "this.location='systemManage.do?action=query&pageNo=" + pageNo +
"&pageSize=" + pageSize + "'</script>"); "&pageSize=" + pageSize + "'</script>");
commonService.commit();
}catch (Exception e){ }catch (Exception e){
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
logger.error(e.getStackTrace()); logger.error(e.getStackTrace());
outHtmlString("<script type=\"text/javascript\">alert('i18n_SystemManageAction.ajaxCheck.faild_n81i');" + outHtmlString("<script type=\"text/javascript\">alert('i18n_SystemManageAction.ajaxCheck.faild_n81i');" +
@@ -443,6 +492,7 @@ public class SystemManageAction extends BaseAction{
//停用业务系统 //停用业务系统
public String stopSystemInfo(){ public String stopSystemInfo(){
try{ try{
commonService.beginTransaction();
if(ids!=null && ids.length>0){ if(ids!=null && ids.length>0){
for(int i=0; i<ids.length; i++){ for(int i=0; i<ids.length; i++){
List sysList = this.commonService.find( List sysList = this.commonService.find(
@@ -465,7 +515,9 @@ public class SystemManageAction extends BaseAction{
outHtmlString("<script type=\"text/javascript\">alert('i18n_SystemManageAction.ajaxCheck.success_n81i');" + outHtmlString("<script type=\"text/javascript\">alert('i18n_SystemManageAction.ajaxCheck.success_n81i');" +
"this.location='systemManage.do?action=query&pageNo=" + pageNo + "this.location='systemManage.do?action=query&pageNo=" + pageNo +
"&pageSize=" + pageSize + "'</script>"); "&pageSize=" + pageSize + "'</script>");
commonService.commit();
}catch (Exception e){ }catch (Exception e){
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
logger.error(e.getStackTrace()); logger.error(e.getStackTrace());
outHtmlString("<script type=\"text/javascript\">alert('i18n_SystemManageAction.ajaxCheck.faild_n81i');" + outHtmlString("<script type=\"text/javascript\">alert('i18n_SystemManageAction.ajaxCheck.faild_n81i');" +
@@ -478,6 +530,7 @@ public class SystemManageAction extends BaseAction{
//启用业务系统 //启用业务系统
public String startSystemInfo(){ public String startSystemInfo(){
try{ try{
commonService.beginTransaction();
if(ids!=null && ids.length>0){ if(ids!=null && ids.length>0){
for(int i=0; i<ids.length; i++){ for(int i=0; i<ids.length; i++){
this.commonService.updateByHql( this.commonService.updateByHql(
@@ -491,7 +544,9 @@ public class SystemManageAction extends BaseAction{
outHtmlString("<script type=\"text/javascript\">alert('i18n_SystemManageAction.ajaxCheck.success_n81i');" + outHtmlString("<script type=\"text/javascript\">alert('i18n_SystemManageAction.ajaxCheck.success_n81i');" +
"this.location='systemManage.do?action=query&pageNo=" + pageNo + "this.location='systemManage.do?action=query&pageNo=" + pageNo +
"&pageSize=" + pageSize + "'</script>"); "&pageSize=" + pageSize + "'</script>");
commonService.commit();
}catch (Exception e){ }catch (Exception e){
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
logger.error(e.getStackTrace()); logger.error(e.getStackTrace());
outHtmlString("<script type=\"text/javascript\">alert('i18n_SystemManageAction.ajaxCheck.faild_n81i');" + outHtmlString("<script type=\"text/javascript\">alert('i18n_SystemManageAction.ajaxCheck.faild_n81i');" +

View File

@@ -159,6 +159,7 @@ public class TopoManageAction extends BaseAction{
JSONArray fromObject = JSONArray.fromObject(parameter); JSONArray fromObject = JSONArray.fromObject(parameter);
List<TopoManageInfo> results = (List) JSONArray.toCollection(fromObject, TopoManageInfo.class); List<TopoManageInfo> results = (List) JSONArray.toCollection(fromObject, TopoManageInfo.class);
try { try {
commonService.beginTransaction();
TopoInfo topoInfo = (TopoInfo) this.commonService.get(TopoInfo.class, topoInfoId); TopoInfo topoInfo = (TopoInfo) this.commonService.get(TopoInfo.class, topoInfoId);
if(!topoInfo.getSystemId().equals(systemId)){ if(!topoInfo.getSystemId().equals(systemId)){
//将之前的topotu指向业务系统设为null //将之前的topotu指向业务系统设为null
@@ -179,7 +180,9 @@ public class TopoManageAction extends BaseAction{
topoNodeInfo.setTypeId(data.getNodeTypeId()); topoNodeInfo.setTypeId(data.getNodeTypeId());
this.commonService.update(topoNodeInfo); this.commonService.update(topoNodeInfo);
} }
commonService.commit();
}catch (Exception e) { }catch (Exception e) {
commonService.rollback();
try { try {
this.getResponse().sendError(500); this.getResponse().sendError(500);
} catch (IOException e1) { } catch (IOException e1) {

View File

@@ -2,6 +2,8 @@ package nis.nms.web.actions.sysManage;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@@ -16,10 +18,15 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.apache.struts2.config.Result; import org.apache.struts2.config.Result;
import org.apache.struts2.config.Results; import org.apache.struts2.config.Results;
import com.sun.xml.internal.ws.policy.privateutil.PolicyUtils.Commons;
import nis.nms.core.Constants;
import nis.nms.core.Resource; import nis.nms.core.Resource;
import nis.nms.domains.GorupSystemTable; import nis.nms.domains.GorupSystemTable;
import nis.nms.domains.SystemTable; import nis.nms.domains.SystemTable;
import nis.nms.domains.XtJsJbxx; import nis.nms.domains.XtJsJbxx;
import nis.nms.domains.XtYhJbxx;
import nis.nms.domains.XtYhJsIndex;
import nis.nms.service.CommonService; import nis.nms.service.CommonService;
import nis.nms.util.BaseAction; import nis.nms.util.BaseAction;
import nis.nms.util.Constant; import nis.nms.util.Constant;
@@ -301,6 +308,7 @@ public class UserGroupPerssionAction extends BaseAction {
XtJsJbxx xtJsJbxx = new XtJsJbxx(); XtJsJbxx xtJsJbxx = new XtJsJbxx();
String operate="save"; String operate="save";
try { try {
commonService.beginTransaction();
// 保存节点信息 // 保存节点信息
xtJsJbxx.setCtime(new Date()); xtJsJbxx.setCtime(new Date());
xtJsJbxx.setJsmc(JSMC); xtJsJbxx.setJsmc(JSMC);
@@ -337,7 +345,9 @@ public class UserGroupPerssionAction extends BaseAction {
gorupSystemTable.setSystemId(Long.parseLong(SYSTEMID)); gorupSystemTable.setSystemId(Long.parseLong(SYSTEMID));
gorupSystemTable.setUserGroupId(xtJsJbxx.getJsbh()); gorupSystemTable.setUserGroupId(xtJsJbxx.getJsbh());
this.commonService.save(gorupSystemTable); this.commonService.save(gorupSystemTable);
commonService.commit();
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
e.printStackTrace(); e.printStackTrace();
desc = getI18nText("i18n_UserGroupPerssionAction.downloadExample.nodeInfoImportErr_n81i"); desc = getI18nText("i18n_UserGroupPerssionAction.downloadExample.nodeInfoImportErr_n81i");
} }
@@ -436,6 +446,7 @@ public class UserGroupPerssionAction extends BaseAction {
// 新增用户组信息 // 新增用户组信息
public void addgroupInfo() { public void addgroupInfo() {
try { try {
commonService.beginTransaction();
/*List list = this.commonService.find("from XtJsJbxx where type=1 and jsmc=?", role.getJsmc()); /*List list = this.commonService.find("from XtJsJbxx where type=1 and jsmc=?", role.getJsmc());
if(list!=null && list.size()>0){ if(list!=null && list.size()>0){
this.outHtmlString("<script>alert('用户组已存在,请重新输入!');history.back();</script>"); this.outHtmlString("<script>alert('用户组已存在,请重新输入!');history.back();</script>");
@@ -458,7 +469,6 @@ public class UserGroupPerssionAction extends BaseAction {
} }
this.getRequest().setAttribute("MSG", 1); this.getRequest().setAttribute("MSG", 1);
} }
//记录用户操作用于设置向导 //记录用户操作用于设置向导
if(fromWhere!=null && !"".equals(fromWhere)){ if(fromWhere!=null && !"".equals(fromWhere)){
if(fromWhere.equals("formGuide")){ if(fromWhere.equals("formGuide")){
@@ -467,7 +477,9 @@ public class UserGroupPerssionAction extends BaseAction {
}else{ }else{
outHtmlString("<script type=\"text/javascript\">alert('i18n_UserGroupPerssionAction.downloadExample.success_n81i');this.location='userGroupPerssion.do?action=query'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_UserGroupPerssionAction.downloadExample.success_n81i');this.location='userGroupPerssion.do?action=query'</script>");
} }
commonService.commit();
} catch (Exception e) { } catch (Exception e) {
commonService.rollback();
outHtmlString("<script type=\"text/javascript\">alert('i18n_UserGroupPerssionAction.giveGroupPerssions.faild_n81i');this.location='userGroupPerssion.do?action=query'</script>"); outHtmlString("<script type=\"text/javascript\">alert('i18n_UserGroupPerssionAction.giveGroupPerssions.faild_n81i');this.location='userGroupPerssion.do?action=query'</script>");
this.getRequest().setAttribute("MSG", 2); this.getRequest().setAttribute("MSG", 2);
e.printStackTrace(); e.printStackTrace();