186 lines
6.9 KiB
Plaintext
186 lines
6.9 KiB
Plaintext
<%@ page contentType="text/html; charset=GBK"%>
|
|
<%@ include file="/IncludeBegin.jsp"%>
|
|
<%@page import="com.amarsoft.app.alarm.*"%>
|
|
<%@page import="com.tenwa.alarm.*"%>
|
|
<%@page import="com.amarsoft.awe.util.ObjectConverts"%>
|
|
<%@page import="java.util.List"%>
|
|
<%@page import="java.util.ArrayList"%>
|
|
<link rel="stylesheet" type="text/css" href="<%=sWebRootPath%>/AppConfig/AutoRiskDetect/resources/scenario.css">
|
|
<%
|
|
//获得组件参数
|
|
String sScenarioNo = CurPage.getParameter("ScenarioNo");
|
|
String sBizArg = CurPage.getParameter("BizArg");
|
|
System.out.println(sBizArg);
|
|
String sSubTypeNo = CurPage.getParameter("SubTypeNo");
|
|
String autoCommit="false";
|
|
ARE.getLog().debug("传入业务参数:"+sBizArg);
|
|
if(sBizArg.indexOf("isAutoCommit=true")>=0){
|
|
autoCommit="true";
|
|
}
|
|
//加载器
|
|
// ScenarioContextLoader loader = AlarmScenarioFactory.createScenarioContextLoader(sBizArg);
|
|
// ((ProductScenarioContextLoader)loader).init(Sqlca,sScenarioNo,sBizArg,sSubTypeNo);
|
|
DefaultScenarioContextLoader loader= AlarmScenarioFactory.createScenarioContextLoader(sBizArg);
|
|
loader.init(Sqlca,sScenarioNo,sBizArg,sSubTypeNo);
|
|
|
|
ScenarioContext context = loader.getContext(); //获取下文容器
|
|
context.setCheckItemRunner(new DefaultCheckItemRunner()); //模型运行器
|
|
|
|
String scenarioSerializable = ObjectConverts.getString(context); //序列化
|
|
%>
|
|
<body style="overflow:hidden;overflow-y:auto;height:100%">
|
|
<div class="r_main">
|
|
<%
|
|
List<ItemGroup> gList0 = context.getScenario().getGroupList();
|
|
List<ItemGroup> gList = new ArrayList<ItemGroup>();
|
|
|
|
//根据运行条件进行预处理,分组下检查项检查条件均没通过,则不显示该分组
|
|
for(int i=0;i<gList0.size();i++){
|
|
ItemGroup group = gList0.get(i);
|
|
List<CheckItem> ckList0 = group.getCheckItemList();
|
|
List<CheckItem> ckList1 = new ArrayList<CheckItem>(); //存放检查通过的
|
|
for(int j=0;j<ckList0.size();j++){
|
|
CheckItem ckItem = ckList0.get(j);
|
|
String sCondition = ckItem.getRunCondition(); //运行条件
|
|
if(sCondition!=null&&sCondition.length()>0){
|
|
boolean bCondition = StringTool.runAmarScript(Sqlca, sCondition, context.getParameter()).booleanValue();
|
|
if(!bCondition)continue;
|
|
else ckList1.add(ckItem);
|
|
}else{
|
|
ckList1.add(ckItem);
|
|
}
|
|
}
|
|
if(ckList1.size()>0){ //重组分组
|
|
group.getCheckItemList().clear();
|
|
group.getCheckItemList().addAll(ckList1);
|
|
gList.add(group);
|
|
}
|
|
}
|
|
//生成界面
|
|
for(int i=0;i<gList.size();i++){
|
|
ItemGroup group = gList.get(i);
|
|
List<CheckItem> ckList = group.getCheckItemList();
|
|
%>
|
|
<div class="r_group" id="Group<%=group.getGroupID()%>" groupID="<%=group.getGroupID()%>" groupName="<%=group.getGroupName()%>">
|
|
<div class="r_info">
|
|
<div style="float:left;"><%=group.getGroupName()%></div>
|
|
<div class="group_result"></div>
|
|
</div>
|
|
<div class="r_head"></div>
|
|
<div class="r_x">
|
|
<table class="r_tb">
|
|
<thead>
|
|
<tr>
|
|
<td class="r_35 r_tb_tit">处理的任务</td>
|
|
<td class="r_9 r_tb_tit">处理结果</td>
|
|
<td class="r_55 r_tb_tit">提示信息</td>
|
|
<!-- <td class="r_6 r_tb_tit">操作</td> -->
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<%for(int j=0;j<ckList.size();j++){
|
|
CheckItem ckItem = ckList.get(j);
|
|
String viewerScript = ckItem.getBizViewer();
|
|
if(viewerScript==null)viewerScript="";
|
|
else viewerScript = StringTool.pretreat(context.getParameter(), viewerScript);
|
|
String viewNode = " ";
|
|
if(viewerScript.length()>0){
|
|
viewNode = "<a href='javascript:void(0);'>修改</a>";
|
|
}
|
|
%>
|
|
<tr class="ck_item default" groupID="<%=group.getGroupID()%>" itemID="<%=ckItem.getItemID()%>" noPassDeal="<%=ckItem.getNoPassDeal()%>">
|
|
<%if(ckItem.getItemID().equals("0027")||ckItem.getItemID().equals("0028")){
|
|
autoCommit="fales";
|
|
%>
|
|
<td class="r_35" style="color:red"><%=ckItem.getItemName()%></td>
|
|
<%}else{ %>
|
|
<td class="r_35" ><%=ckItem.getItemName()%></td>
|
|
<%} %>
|
|
<td class="r_9"><div class="icon"></div></td>
|
|
<td class="r_55 message"> </td>
|
|
<!-- <td class="r_6 viewer"><span class="label"><%=viewNode%></span><span class="script"><%=viewerScript%></span></td>-->
|
|
</tr>
|
|
<%}%>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="r_footer"></div>
|
|
</div>
|
|
<%}%>
|
|
<div class="r_ending">
|
|
<table style="width: 820px">
|
|
|
|
<tr>
|
|
<td colspan="3" id="scenario-message" height="50px" vAlign="middle" style="display: none">
|
|
</td>
|
|
</tr>
|
|
|
|
<tr id="scenario-button">
|
|
<td align="center">
|
|
<table>
|
|
<tr>
|
|
<td><%=new Button("重新检查","重新检查","reRun()","","btn_icon_refresh").getHtmlText()%></td>
|
|
<td><%=new Button("确定","确定","alarm_ok()","","btn_icon_submit").getHtmlText()%></td>
|
|
<td><%=new Button("取消","取消","alarm_exit()","","btn_icon_close").getHtmlText()%></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
<script type="text/javascript">
|
|
function alarm_exit(){
|
|
parent.AsDialog.ClosePage();
|
|
}
|
|
|
|
function alarm_ok(){
|
|
var ctx = $(".r_main");
|
|
var bComplete = ctx.isComplete();
|
|
if(bComplete){
|
|
returnValue = (bComplete&&ctx.isPass());
|
|
parent.AsDialog.ClosePage(returnValue);
|
|
}else{
|
|
alert("没有运行完毕");
|
|
}
|
|
}
|
|
|
|
$(document).ready(function(){
|
|
run();
|
|
});
|
|
var autoCommit= null;
|
|
|
|
function run(){
|
|
var url = "<%=sWebRootPath%>/AppConfig/AutoRiskDetect/AlarmModelInvoker.jsp?CompClientID=<%=sCompClientID%>&randp="+randomNumber();
|
|
var ser = "<%=scenarioSerializable%>";
|
|
$(".r_main").riskScan({
|
|
modelInvoker:url,
|
|
scenarioSerial:ser
|
|
});
|
|
var isautoCommit="<%=autoCommit%>";
|
|
if(isautoCommit=="true"){
|
|
autoCommit=setInterval("autoCommitAlarm()",1000);
|
|
}
|
|
}
|
|
function autoCommitAlarm(){
|
|
var ctx = $(".r_main");
|
|
var bComplete = ctx.isComplete();
|
|
if(bComplete){
|
|
clearInterval(autoCommit);
|
|
returnValue = (bComplete&&ctx.isPass());
|
|
if(returnValue=="true"||returnValue==true){
|
|
parent.AsDialog.ClosePage(true);
|
|
}
|
|
}
|
|
}
|
|
function reRun(){
|
|
var scenarioMessage = $("#scenario-message");
|
|
scenarioMessage.attr("idx",0);
|
|
scenarioMessage.attr("Spaned","false");
|
|
scenarioMessage.attr("groupIDS","");
|
|
scenarioMessage.html("");
|
|
run();
|
|
}
|
|
</script>
|
|
<%@ include file="/IncludeEnd.jsp"%> |