Commit 609f982d authored by 莫林毅's avatar 莫林毅

关联配置明细

parent a91dc695
package com.hp.cmsz.entity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.Timestamp;
/**
*
*
* 组装 类 关联诊断结果查询 用
*/
public class AssociateDetail implements Serializable {
private BigInteger associationId;
private BigInteger provinceId;
private char associationType;
private String associationDesc;
private String provinceName;
private Timestamp warnBeginTime;
private Timestamp warnEndTime;
private String kpiCode;
private String kpiName;
private BigInteger kpiId;
private BigDecimal kpiWeight;
private BigInteger kpiNum;
private String influenceLevel;
public BigInteger getAssociationId() {
return associationId;
}
public void setAssociationId(BigInteger associationId) {
this.associationId = associationId;
}
public BigInteger getProvinceId() {
return provinceId;
}
public void setProvinceId(BigInteger provinceId) {
this.provinceId = provinceId;
}
public char getAssociationType() {
return associationType;
}
public void setAssociationType(char associationType) {
this.associationType = associationType;
}
public String getAssociationDesc() {
return associationDesc;
}
public void setAssociationDesc(String associationDesc) {
this.associationDesc = associationDesc;
}
public String getProvinceName() {
return provinceName;
}
public void setProvinceName(String provinceName) {
this.provinceName = provinceName;
}
public Timestamp getWarnBeginTime() {
return warnBeginTime;
}
public void setWarnBeginTime(Timestamp warnBeginTime) {
this.warnBeginTime = warnBeginTime;
}
public Timestamp getWarnEndTime() {
return warnEndTime;
}
public void setWarnEndTime(Timestamp warnEndTime) {
this.warnEndTime = warnEndTime;
}
public String getKpiCode() {
return kpiCode;
}
public void setKpiCode(String kpiCode) {
this.kpiCode = kpiCode;
}
public String getKpiName() {
return kpiName;
}
public void setKpiName(String kpiName) {
this.kpiName = kpiName;
}
public BigInteger getKpiId() {
return kpiId;
}
public void setKpiId(BigInteger kpiId) {
this.kpiId = kpiId;
}
public BigDecimal getKpiWeight() {
return kpiWeight;
}
public void setKpiWeight(BigDecimal kpiWeight) {
this.kpiWeight = kpiWeight;
}
public BigInteger getKpiNum() {
return kpiNum;
}
public void setKpiNum(BigInteger kpiNum) {
this.kpiNum = kpiNum;
}
public String getInfluenceLevel() {
return influenceLevel;
}
public void setInfluenceLevel(String influenceLevel) {
this.influenceLevel = influenceLevel;
}
}
......@@ -11,6 +11,37 @@ import java.util.List;
* @author Molinyi
*
*/
/*
@NamedNativeQueries({
@NamedNativeQuery(
name = "ReturnVariationInfoWithFullScalarType",
query = "SELECT ASSOCIATION_ID AS associationId ,D.PROVINCE_ID as provinceId,ASSOCIATION_TYPE AS associationType ," +
"ASSOCIATION_DESC AS associationDesc,PROVINCE_NAME AS provinceName,WARNING_BEGIN_TIME AS warningBeginTime," +
"WARNING_END_TIME as warningEndTime,COUNT(E.KPI_ID)AS warningNum FROM " +
"( SELECT A.ASSOCIATION_ID,A.PROVINCE_ID,A.ASSOCIATION_DESC,A.ASSOCIATION_TYPE,B.KPI_ID,C.PROVINCE_NAME,TO_TIMESTAMP(?1,'YYYY-MM-DD HH24:MI:SS') AS WARNING_BEGIN_TIME, " +
"TO_TIMESTAMP(?2,'YYYY-MM-DD HH24:MI:SS') AS WARNING_END_TIME FROM CCOLAP.DIM_ASSOCIATION_ANALYSIS_INFO_T A INNER JOIN CCOLAP.DIM_KPI_ASSOCIATION_RELATED_INFO_T B ON A.ASSOCIATION_ID=B.ASSOCIATION_ID" +
" INNER JOIN CCOLAP.DIM_PROVINCE_INFO_T C ON C.PROVINCE_ID= A.PROVINCE_ID) D LEFT JOIN CCOLAP.GJFX_WARNING_INFO_T E ON D.PROVINCE_ID=E.PROVINCE_ID AND D.KPI_ID =E.KPI_ID AND WARNING_ID LIKE 'J%' WHERE " +
"OCCUR_TIME >=TO_TIMESTAMP(?1,'YYYY-MM-DD HH24:MI:SS') AND OCCUR_TIME <=TO_TIMESTAMP(?2,'YYYY-MM-DD HH24:MI:SS') " +
"GROUP BY ASSOCIATION_ID,D.PROVINCE_ID,ASSOCIATION_TYPE ,ASSOCIATION_DESC,PROVINCE_NAME,WARNING_BEGIN_TIME,WARNING_END_TIME",
resultSetMapping = "ReturnVariationInfoWithFullScalarType"
)
})
@SqlResultSetMappings(
@SqlResultSetMapping(
name = "ReturnVariationInfoWithFullScalarType",
entities = {},
columns = {
@ColumnResult(name = "associationId"),
@ColumnResult(name = "provinceId"),
@ColumnResult(name = "associationType"),
@ColumnResult(name = "provinceName"),
@ColumnResult(name = "warningBeginTime"),
@ColumnResult(name = "warningEndTime"),
@ColumnResult(name = "warningNum")
}
)
)*/
@Entity
@Table(name = "DIM_ASSOCIATION_ANALYSIS_INFO_T",schema = "CCOLAP")
public class DimAssociationAnaInfo implements Serializable {
......
......@@ -7,6 +7,9 @@ import org.springframework.data.repository.PagingAndSortingRepository;
import com.hp.cmsz.entity.DimAssociationAnaInfo;
import org.springframework.data.repository.query.Param;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import java.sql.Timestamp;
import java.util.List;
public interface DimAssociationAnaInfoDao extends JpaSpecificationExecutor<DimAssociationAnaInfo>,
......@@ -35,4 +38,69 @@ public interface DimAssociationAnaInfoDao extends JpaSpecificationExecutor<DimAs
@Query("select anaInfo from DimAssociationAnaInfo anaInfo where anaInfo.associationId = :associationId ")
public DimAssociationAnaInfo findDimassociationAnaInfoByAssociationId(@Param(value = "associationId")Long associationId );
@Query(value = "SELECT ASSOCIATION_ID AS associationId ,D.PROVINCE_ID as provinceId,ASSOCIATION_TYPE AS associationType ," +
"ASSOCIATION_DESC AS associationDesc,PROVINCE_NAME AS provinceName,WARNING_BEGIN_TIME AS warningBeginTime," +
"WARNING_END_TIME as warningEndTime,COUNT(E.KPI_ID)AS warningNum FROM " +
"( SELECT A.ASSOCIATION_ID,A.PROVINCE_ID,A.ASSOCIATION_DESC,A.ASSOCIATION_TYPE,B.KPI_ID,C.PROVINCE_NAME,TO_TIMESTAMP(?1,'YYYY-MM-DD HH24:MI:SS') AS WARNING_BEGIN_TIME, " +
"TO_TIMESTAMP(?2,'YYYY-MM-DD HH24:MI:SS') AS WARNING_END_TIME FROM CCOLAP.DIM_ASSOCIATION_ANALYSIS_INFO_T A INNER JOIN CCOLAP.DIM_KPI_ASSOCIATION_RELATED_INFO_T B ON A.ASSOCIATION_ID=B.ASSOCIATION_ID" +
" INNER JOIN CCOLAP.DIM_PROVINCE_INFO_T C ON C.PROVINCE_ID= A.PROVINCE_ID) D LEFT JOIN CCOLAP.GJFX_WARNING_INFO_T E ON D.PROVINCE_ID=E.PROVINCE_ID AND D.KPI_ID =E.KPI_ID AND WARNING_ID LIKE 'J%' WHERE " +
"OCCUR_TIME >=TO_TIMESTAMP(?1,'YYYY-MM-DD HH24:MI:SS') AND OCCUR_TIME <=TO_TIMESTAMP(?2,'YYYY-MM-DD HH24:MI:SS') " +
"GROUP BY ASSOCIATION_ID,D.PROVINCE_ID,ASSOCIATION_TYPE ,ASSOCIATION_DESC,PROVINCE_NAME,WARNING_BEGIN_TIME,WARNING_END_TIME",nativeQuery = true)
public List<Object[]> findAssociateDiagosisDetailByWarnTimeBeginAndEnd( String warnBeginTime,String warnEndTime);
@Query(value = "SELECT ASSOCIATION_ID AS associationId ,D.PROVINCE_ID as provinceId,ASSOCIATION_TYPE AS associationType ," +
"ASSOCIATION_DESC AS associationDesc,PROVINCE_NAME AS provinceName,WARNING_BEGIN_TIME AS warningBeginTime," +
"WARNING_END_TIME as warningEndTime,COUNT(E.KPI_ID)AS warningNum FROM " +
"( SELECT A.ASSOCIATION_ID,A.PROVINCE_ID,A.ASSOCIATION_DESC,A.ASSOCIATION_TYPE,B.KPI_ID,C.PROVINCE_NAME,TO_TIMESTAMP(?1,'YYYY-MM-DD HH24:MI:SS') AS WARNING_BEGIN_TIME, " +
"TO_TIMESTAMP(?2,'YYYY-MM-DD HH24:MI:SS') AS WARNING_END_TIME FROM CCOLAP.DIM_ASSOCIATION_ANALYSIS_INFO_T A INNER JOIN CCOLAP.DIM_KPI_ASSOCIATION_RELATED_INFO_T B ON A.ASSOCIATION_ID=B.ASSOCIATION_ID" +
" INNER JOIN CCOLAP.DIM_PROVINCE_INFO_T C ON C.PROVINCE_ID= A.PROVINCE_ID) D LEFT JOIN CCOLAP.GJFX_WARNING_INFO_T E ON D.PROVINCE_ID=E.PROVINCE_ID AND D.KPI_ID =E.KPI_ID AND WARNING_ID LIKE 'J%' WHERE " +
"OCCUR_TIME >=TO_TIMESTAMP(?1,'YYYY-MM-DD HH24:MI:SS') AND OCCUR_TIME <=TO_TIMESTAMP(?2,'YYYY-MM-DD HH24:MI:SS') " +
"GROUP BY ASSOCIATION_ID,D.PROVINCE_ID,ASSOCIATION_TYPE ,ASSOCIATION_DESC,PROVINCE_NAME,WARNING_BEGIN_TIME,WARNING_END_TIME",nativeQuery = true)
public List<Object[]> findLastMathAssociateDiagosisDetailByWarnTimeBegin( String warnBeginTime, String warnEndTime);
/*@Query(value = "SELECT ASSOCIATION_ID AS associationId ,D.PROVINCE_ID as provinceId,ASSOCIATION_TYPE AS associationType ," +
"ASSOCIATION_DESC AS associationDesc,PROVINCE_NAME AS provinceName,WARNING_BEGIN_TIME AS warningBeginTime," +
"WARNING_END_TIME as warningEndTime,COUNT(E.KPI_ID)AS warningNum FROM " +
"( SELECT A.ASSOCIATION_ID,A.PROVINCE_ID,A.ASSOCIATION_DESC,A.ASSOCIATION_TYPE,B.KPI_ID,C.PROVINCE_NAME,TO_TIMESTAMP(?1,'YYYY-MM-DD HH24:MI:SS') AS WARNING_BEGIN_TIME, " +
"TO_TIMESTAMP(?2,'YYYY-MM-DD HH24:MI:SS') AS WARNING_END_TIME FROM CCOLAP.DIM_ASSOCIATION_ANALYSIS_INFO_T A INNER JOIN CCOLAP.DIM_KPI_ASSOCIATION_RELATED_INFO_T B ON A.ASSOCIATION_ID=B.ASSOCIATION_ID" +
" INNER JOIN CCOLAP.DIM_PROVINCE_INFO_T C ON C.PROVINCE_ID= A.PROVINCE_ID) D LEFT JOIN CCOLAP.GJFX_WARNING_INFO_T E ON D.PROVINCE_ID=E.PROVINCE_ID AND D.KPI_ID =E.KPI_ID AND WARNING_ID LIKE 'J%' WHERE " +
"OCCUR_TIME >=TO_TIMESTAMP(?1,'YYYY-MM-DD HH24:MI:SS') AND OCCUR_TIME <=TO_TIMESTAMP(?2,'YYYY-MM-DD HH24:MI:SS') " +
"AND A.ASSOCIATION_TYPE = ?3 "+
"AND D.PROVINCE_ID in (?4)"+
"GROUP BY ASSOCIATION_ID,D.PROVINCE_ID,ASSOCIATION_TYPE ,ASSOCIATION_DESC,PROVINCE_NAME,WARNING_BEGIN_TIME,WARNING_END_TIME",nativeQuery = true)*/
@Query(value = "SELECT ASSOCIATION_ID, D.PROVINCE_ID, ASSOCIATION_TYPE ,ASSOCIATION_DESC, PROVINCE_NAME, WARNING_BEGIN_TIME, WARNING_END_TIME," +
" COUNT(E.KPI_ID) AS WARNING_NUM FROM (" +
" SELECT A.ASSOCIATION_ID,A.PROVINCE_ID, A.ASSOCIATION_DESC, A.ASSOCIATION_TYPE, B.KPI_ID, C.PROVINCE_NAME, TO_TIMESTAMP(?1,'YYYY-MM-DD HH24:MI:SS') AS WARNING_BEGIN_TIME," +
" TO_TIMESTAMP(?2,'YYYY-MM-DD HH24:MI:SS') AS WARNING_END_TIME" +
" FROM CCOLAP.DIM_ASSOCIATION_ANALYSIS_INFO_T A INNER JOIN DIM_KPI_ASSOCIATION_RELATED_INFO_T B"+
" ON A.ASSOCIATION_ID=B.ASSOCIATION_ID INNER JOIN DIM_PROVINCE_INFO_T C ON C.PROVINCE_ID= A.PROVINCE_ID) D"+
" LEFT JOIN GJFX_WARNING_INFO_T E" +
" ON D.PROVINCE_ID = E.PROVINCE_ID AND D.KPI_ID =E.KPI_ID AND WARNING_ID LIKE 'J%'" +
" and OCCUR_TIME >= TO_TIMESTAMP(?1,'YYYY-MM-DD HH24:MI:SS')" +
" AND OCCUR_TIME <=TO_TIMESTAMP(?2,'YYYY-MM-DD HH24:MI:SS') WHERE ASSOCIATION_TYPE = ?3 and D.PROVINCE_ID in (?4) GROUP BY ASSOCIATION_ID,D.PROVINCE_ID, ASSOCIATION_TYPE ,ASSOCIATION_DESC,PROVINCE_NAME, WARNING_BEGIN_TIME, WARNING_END_TIME"
,nativeQuery = true)
public List<Object[]> findLastMathAssociateDiagosisDetailByWarnTimeBeginAndEndAndDimesionAndProvinceList(String warnBeginTime, String warnEndTime, char dimension, List<Long> provincelist);
@Query(value = "SELECT ASSOCIATION_ID, D.PROVINCE_ID, ASSOCIATION_TYPE ,ASSOCIATION_DESC, PROVINCE_NAME, WARNING_BEGIN_TIME, WARNING_END_TIME," +
" COUNT(E.KPI_ID) AS WARNING_NUM FROM (" +
" SELECT A.ASSOCIATION_ID,A.PROVINCE_ID, A.ASSOCIATION_DESC, A.ASSOCIATION_TYPE, B.KPI_ID, C.PROVINCE_NAME, TO_TIMESTAMP(?1,'YYYY-MM-DD HH24:MI:SS') AS WARNING_BEGIN_TIME," +
" TO_TIMESTAMP(?2,'YYYY-MM-DD HH24:MI:SS') AS WARNING_END_TIME" +
" FROM CCOLAP.DIM_ASSOCIATION_ANALYSIS_INFO_T A INNER JOIN DIM_KPI_ASSOCIATION_RELATED_INFO_T B"+
" ON A.ASSOCIATION_ID=B.ASSOCIATION_ID INNER JOIN DIM_PROVINCE_INFO_T C ON C.PROVINCE_ID= A.PROVINCE_ID) D"+
" LEFT JOIN GJFX_WARNING_INFO_T E" +
" ON D.PROVINCE_ID = E.PROVINCE_ID AND D.KPI_ID =E.KPI_ID AND WARNING_ID LIKE 'J%'" +
" and OCCUR_TIME >= TO_TIMESTAMP(?1,'YYYY-MM-DD HH24:MI:SS')" +
" AND OCCUR_TIME <=TO_TIMESTAMP(?2,'YYYY-MM-DD HH24:MI:SS') WHERE ASSOCIATION_TYPE = ?3 and D.PROVINCE_ID in (?4) GROUP BY ASSOCIATION_ID,D.PROVINCE_ID, ASSOCIATION_TYPE ,ASSOCIATION_DESC,PROVINCE_NAME, WARNING_BEGIN_TIME, WARNING_END_TIME"
,nativeQuery = true)
public Object[] findAssociateDiagosisDetailByAssociationId(Long associationId);
@Query(value = "SELECT ASSOCIATION_ID, PROVINCE_ID, ASSOCIATION_TYPE , ASSOCIATION_DESC, PROVINCE_NAME, WARNING_BEGIN_TIME, WARNING_END_TIME, KPI_CODE, KPI_NAME, KPI_ID, KPI_WEIGHT, WARNING_NUM, CASE WHEN INFLUENCE_LEVEL>0.8 THEN '高' WHEN INFLUENCE_LEVEL>0.5 AND INFLUENCE_LEVEL<0.5 THEN '中' ELSE '低' END AS INFLUENCE_LEVEL FROM ( SELECT ASSOCIATION_ID, D.PROVINCE_ID, ASSOCIATION_TYPE, ASSOCIATION_DESC, PROVINCE_NAME, WARNING_BEGIN_TIME, WARNING_END_TIME, D.KPI_CODE,D.KPI_NAME, D.KPI_ID, KPI_WEIGHT,COUNT(E.KPI_ID)AS WARNING_NUM, KPI_WEIGHT* COUNT(E.KPI_ID) AS INFLUENCE_LEVEL FROM ( SELECT A.ASSOCIATION_ID,A.PROVINCE_ID,A.ASSOCIATION_DESC,A.ASSOCIATION_TYPE, B.KPI_ID, D.KPI_CODE, D.KPI_NAME, B.KPI_WEIGHT, C.PROVINCE_NAME, TO_TIMESTAMP(?1,'YYYY-MM-DD HH24:MI:SS') AS WARNING_BEGIN_TIME, TO_TIMESTAMP(?2,'YYYY-MM-DD HH24:MI:SS') AS WARNING_END_TIME FROM CCOLAP.DIM_ASSOCIATION_ANALYSIS_INFO_T A INNER JOIN CCOLAP.DIM_KPI_ASSOCIATION_RELATED_INFO_T B ON A.ASSOCIATION_ID=B.ASSOCIATION_ID INNER JOIN CCOLAP.DIM_PROVINCE_INFO_T C ON C.PROVINCE_ID= A.PROVINCE_ID INNER JOIN CCOLAP.DIM_KPI_INFO_T D ON B.KPI_ID=D.KPI_ID) D LEFT JOIN CCOLAP.GJFX_WARNING_INFO_T E ON D.PROVINCE_ID=E.PROVINCE_ID AND D.KPI_ID =E.KPI_ID AND WARNING_ID LIKE 'J%' WHERE OCCUR_TIME >=TO_TIMESTAMP(?1,'YYYY-MM-DD HH24:MI:SS') AND OCCUR_TIME <=TO_TIMESTAMP(?2,'YYYY-MM-DD HH24:MI:SS') AND ASSOCIATION_ID= ?3 GROUP BY ASSOCIATION_ID, D.PROVINCE_ID, ASSOCIATION_TYPE , ASSOCIATION_DESC, PROVINCE_NAME, WARNING_BEGIN_TIME, WARNING_END_TIME, D.KPI_CODE, D.KPI_NAME,D.KPI_ID,KPI_WEIGHT)G"
,nativeQuery = true)
public Object[] findDetailByAssociationIdAndWarnBeginToEndTime(String beginTime,String endTime,Long associationId);
}
......@@ -83,6 +83,7 @@ public class PageURLController {
//监控运营>告警关联诊>关联诊断明细
//AssociateDiagosisDetail映射到WEB-INF/views下的MonitorOperation/AssociateDiagosisDetail.jsp页面
public static String AssociateDiagosisDetail="MonitorOperation/AssociateDiagosisDetail";
public static String AssociateDetails="MonitorOperation/AssociateDetails";
//监控运营>告警关联诊>关联诊断配置
//AssociateDiagosisConfiguration-INF/views下的MonitorOperation/AssociateDiagosisConfiguration.jsp页面
......
......@@ -5,10 +5,17 @@
<div id="timeLine" class="date">
<label for="">时间范围</label><!-- 最近3年 -->
<input id="d1" class="Wdate" type="text" style="width:137px;" value="" onFocus="var d2=$dp.$('d2');WdatePicker({onpicked:function(){d2.focus();},minDate:'{%y-3}-%M-%d %H:%m:%s',maxDate:'#F{$dp.$D(\'d2\')||\'%y-%M-%d %H:%m:%s\'}',dateFmt:'yyyy-MM-dd'})">
<input id="d1" class="Wdate" type="text" value="" onFocus="var d2=$dp.$('d2');WdatePicker({onpicked:function(){d2.focus();},minDate:'{%y-3}-%M-%d %H:%m:%s',maxDate:'#F{$dp.$D(\'d2\')||\'%y-%M-%d %H:%m:%s\'}'})">
--
<input id="d2" class="Wdate" type="text" style="width:137px;" value="" onFocus="WdatePicker({minDate:'#F{$dp.$D(\'d1\')||\'{%y-3}-%M-%d %H:%m:%s\'}',maxDate:'%y-%M-%d %H:%m:%s',dateFmt:'yyyy-MM-dd'})">
<input id="d2" class="Wdate" type="text" value="" onFocus="WdatePicker({minDate:'#F{$dp.$D(\'d1\')||\'{%y-3}-%M-%d %H:%m:%s\'}',maxDate:'%y-%M-%d %H:%m:%s'})">
<%--<input id="d1" class="Wdate" type="text" style="width:137px;" value="" onFocus="var d2=$dp.$('d2');WdatePicker({onpicked:function(){d2.focus();},minDate:'{%y-3}-%M-%d %H:%m:%s',maxDate:'#F{$dp.$D(\'d2\')||\'%y-%M-%d %H:%m:%s\'}',dateFmt:'yyyy-MM-dd'})">
--
<input id="d2" class="Wdate" type="text" style="width:137px;" value="" onFocus="WdatePicker({minDate:'#F{$dp.$D(\'d1\')||\'{%y-3}-%M-%d %H:%m:%s\'}',maxDate:'%y-%M-%d %H:%m:%s',dateFmt:'yyyy-MM-dd'})">
--%>
</div>
<div id="more-option" class="slide-menu-option">
......@@ -26,6 +33,7 @@
</div>
</div>
<%--省份筛选项 --%>
<div id="provinceDetail" class="slide-menu-option">
<label for="">省份</label>
<div class="checkbox-inline"><label><input type="checkbox" name="allProvinceDetail" id="allProvinceDetail" title="allSelect" checked />全选</label></div>
......@@ -40,6 +48,91 @@
</div>
</div>
<script type="text/javascript">
function initStartTime()
{
var now = new Date();
var year = now.getFullYear(); //年
var month = now.getMonth() + 1; //月
var day = now.getDate(); //日
var hh = now.getHours(); //时
var mm = now.getMinutes(); //分
var clock = year + "-";
if(month < 10)
clock += "0";
clock += month + "-";
if(day < 10)
clock += "0";
clock += day + " ";
if(hh < 10)
clock += "0";
clock += hh + ":";
if (mm < 10) clock += '0';
clock += mm;
clock += ":"+"00";
return(clock);
}
function initEndTime() {
var date = new Date();
var daysInMonth = new Array([0],[31],[28],[31],[30],[31],[30],[31],[31],[30],[31],[30],[31]);
var strYear = date.getFullYear();
var strDay = date.getDate();
var strMonth = date.getMonth()+1;
var hh = date.getHours(); //时
var mm = date.getMinutes(); //分
if(strYear%4 == 0 && strYear%100 != 0){
daysInMonth[2] = 29;
}
if(strMonth - 1 == 0)
{
strYear -= 1;
strMonth = 12;
}
else
{
strMonth -= 1;
}
strDay = daysInMonth[strMonth] >= strDay ? strDay : daysInMonth[strMonth];
if(strMonth<10)
{
strMonth="0"+strMonth;
}
if(strDay<10)
{
strDay="0"+strDay;
}
var clock = strYear+"-"+strMonth+"-"+strDay;
clock += " ";
if(hh < 10)
clock += "0";
clock += hh + ":";
if (mm < 10) clock += '0';
clock += mm;
clock += ":"+"00";
return(clock);
}
//初始化时间控件的默认值,需要在页面加载时调用此初始化方法
function initDate(){
$(".date #d1").val(initEndTime());
$(".date #d2").val(initStartTime());
}
var detailProviderCheckedValues=$(".providerDetail:checked");
$("#allProviderDetail").click(function(){
......@@ -175,10 +268,8 @@
//返回结果为一个数组,数组中包含选中的省份
function getDetailProvinceCheckedValues(){
var provinceArray=new Array();
var i=0;
detailProvinceCheckedValues.each(function(){
provinceArray[i]=$(this).val();
i++;
provinceArray.push($(this).val());
});
console.log("provinceArray "+provinceArray );
return provinceArray;
......
......@@ -5,6 +5,7 @@
<script language="javascript" type="text/javascript" src="${ctx}/static/My97DatePicker/WdatePicker.js"></script>
--%>
<div id="timeLine" class="date">
<label for="">时间范围</label><!-- 默认时间范围为最近1个月 -->
<input id="d1" class="Wdate" type="text" value="" onFocus="var d2=$dp.$('d2');WdatePicker({onpicked:function(){d2.focus();},minDate:'{%y-3}-%M-%d %H:%m:%s',maxDate:'#F{$dp.$D(\'d2\')||\'%y-%M-%d %H:%m:%s\'}'})">
......@@ -20,6 +21,7 @@
</div>
<script type="text/javascript">
function initStartTime()
{
var now = new Date();
......
......@@ -10,6 +10,7 @@
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<html>
<head>
......@@ -23,14 +24,18 @@
<script src="${ctx}/static/artDialog4.1.7/artDialog.source.js?skin=default"></script>
<script src="${ctx}/static/artDialog4.1.7/plugins/iframeTools.source.js"></script>
<script type="text/javascript" src="${ctx}/static/js/associatediagosisdetail.js"></script>
<script type="text/javascript">
$(document).ready(function(){
// alert(1);
// failureTable();
// initDateDetail();
//$("#businessSelectAreaDetail").hide();
initDate();
//初始化界面
initTable();
var v=document.getElementById('gzfxDetail').value;
console.log("v "+v);
});
</script>
......@@ -107,15 +112,6 @@
<div class="col-xs-12">
<div class="table-header">
关联诊断结果查询
<%--<shiro:hasAnyRoles name="admin,dataAnalysis,businessAnalysis">
<div id="time_div"
style="top: -6px;float: right;height: 0px;position: relative;">
<button id="deleteFailureBtn"
class="btn-sm btn btn-primary btn-sm btn-group btn-group-cog"
onclick="failureDelete()">删除故障
</button>
</div>
</shiro:hasAnyRoles>--%>
</div>
<!--写故障明细列表处-->
<table class="table table-hover table-striped"
......@@ -134,10 +130,11 @@
</div>
<form action="#" method="get" id="listForm"></form>
<input type="hidden" id="gzfxDetail" name="gzfxDetail" value='${gzfxDetailInfos}' />
<input type="hidden" id="gzfxDetail" name="gzfxDetail" value='${diagosisDetails}' />
</div>
</div>
</div>
${diagosisDetails}
</div>
<script type="text/javascript">
......@@ -244,6 +241,8 @@
}
//获取选取的时间段,返回结果为字符串数组
function getPeriod(){
var period=new Array();
......@@ -274,25 +273,28 @@
}else{
var detailProvince = getDetailProvinceCheckedValueString();
var dimension=getDetailCheckeddDimension();
console.log("detailProvince "+detailProvince);
console.log("dimension "+dimension);
console.log("detailtime "+detailtime);
//alert(dimension+"-pi-");
// alert(detailProvince);
//var href="${ctx}/MonitorOperation/FailureAnalysisDetail/changeTable?detailProvince="+detailProvince+"&detailProvider="+detailProvider+"&xcdStatus="+xcdStatus+"&detailDataSource="+detailDataSource+"&detailChannel="+detailChannel+"&detailBusiness="+detailBusiness+"&detailWarningSource="+detailWarningSource+"&failureTitle="+"-1";
/* $.ajax({
var href="${ctx}/MonitorOperation/AssociateDiagosisDetail/tableList?detailProvince="+detailProvince+"&detailtime="+detailtime+"&dimension="+dimension;
$.ajax({
type : 'GET',
contentType : 'application/json',
url: encodeURI(encodeURI(href))+"&detailTime="+detailTime,//href,
url: href,//encodeURI(encodeURI(href)),//href,
dataType : 'text',
beforeSend: function(data) {
},
success: function(data) {
$("#gzfxDetail").val(data);
failureTable();
checkFailureIds=[];
$("#deleteFailureBtn").attr("disabled", true);
toggleMenu('slidePushMenus2');//隐藏筛选项
// failureTable();
initTable();
//checkFailureIds=[];
//$("#deleteFailureBtn").attr("disabled", true);
//toggleMenu('slidePushMenus2');//隐藏筛选项
}
});*/
});
$("#detailPeriodTag").empty();
$("#detailProvinceTag").text("省份").append($("<span class='badge'></span>").text(detailProvinceSum)).attr('data-original-title',getDetailProvinceTag()).tooltip();
$("#detailDimensionTag").text("关联维度").append($("<span class='badge'></span>").text()).attr('data-original-title',getdetailDemensionTagValue()).tooltip();
......@@ -318,8 +320,10 @@
//重置detail中的筛选项
function detailReset(){
$("#d1").val('');
$("#d2").val('');
//$("#d1").val('');
//$("#d2").val('');
initDate();
detail_Province_Reset();
detail_Dimension_Reset();
judge = true;
......@@ -335,6 +339,29 @@
listForm.attr("action","#");
});
function goClick(e){
console.log("=-- e.tit name"+e.name);
//alert($(e).attr("title")+"---");
var beginTime="";
var endTime="";
var provinceName="";
var associationType="";
var associationDesc="";
var warningNum="";
$(e).parent().prevAll().each(function(ind,dom){
if(ind == 0){warningNum=$(dom).text()}
if(ind == 1){associationDesc=$(dom).text()}
if(ind == 2){associationType=$(dom).text()}
if(ind == 3){provinceName=$(dom).text()}
if(ind == 4){endTime=$(dom).text()}
if(ind == 5){beginTime=$(dom).text()}
});
window.location.href = "${ctx}/MonitorOperation/AssociateDiagosisDetail/details?associationId="+e.name+"&warningNum="+warningNum
+"&associationDesc="+associationDesc+"&associationType="+associationType+"&provinceName="+provinceName+"&endTime="endTime+"&beginTime="+beginTime;
}
</script>
</body>
......
function initTable(){
jsonStr = document.getElementById('gzfxDetail').value;
alert("jsonStr" +jsonStr);
var header = new Array();
header[0] = ["<input type='checkbox' name='ckAll' id='ckAll' class='ckAll' onclick='javascript:checkAll();'/>","checkbox","1%",""];
header[1] = ["开始时间","failureId","10%",""];
header[2] = ["结束时间","failureTitle","10%","16"];
header[1] = ["开始时间","warnBeginTime","10%",""];
header[2] = ["结束时间","warnEndTime","10%","16"];
header[3] = ["省份","provinceName","5%",""];
header[4] = ["类型","channelName","8%",""];
header[5] = ["名称","dataSourceName","8%",""];
header[6] = ["告警个数","warningSourceName","8%",""];
header[7] = ["指标告警明细","providerName","8%",""];
/*header[8] = ["发生时间","happenTime","10%",""];
header[9] = ["结束时间","closeTime","10%",""];
header[10] = ["详细原因","failureReason","14%","20"];
header[11] = ["解决方案","resolution","14%","20"];*/
header[4] = ["类型","associationType","8%",""];
header[5] = ["名称","associationDesc","8%",""];
header[6] = ["告警个数","warningNum","8%",""];
header[7] = ["指标告警明细","associationId","8%",""];
window.pagging = new table_pagging({limit:11,tableId:'failureAnalysisDetailTable',header:header});
pagging.pagging(jsonStr);
......@@ -178,38 +175,45 @@ table_pagging.prototype={
tdContext = context;
} else {
tdContext = this.getData(this.objectlist[i],this.header[k][1]);
if(tdContext==null){
tdContext = "&nbsp;";
}
if(k==1){
tdContext="<a href='javascript:openDialog("+this.getData(this.objectlist[i],"failureId")+")' alt='"+i+"'>"+this.getData(this.objectlist[i],this.header[k][1])+"</a>";
}
if(k==8){
if(tdContext=="&nbsp;"){
tdContext = "&nbsp;";
}else{
tdContext = df.format(new Date(tdContext));
if(k==1|| k==2){
tdContext=this.getData(this.objectlist[i],this.header[k][1]);
var d=new Date(tdContext);
tdContext=(d.getFullYear()+1)+"-"+d.getMonth()+"-"+d.getDate()+" "+d.getHours()+":"+d.getMinutes()+":"+d.getSeconds();
console.log("---"+(d.getFullYear()+1)+"-"+d.getMonth()+"-"+d.getDate()+" "+d.getHours()+":"+d.getMinutes()+":"+d.getSeconds());
console.log(tdContext+"--");
console.log("type "+ typeof tdContext);
}else if(k == 4){
tdContext=this.getData(this.objectlist[i],this.header[k][1]);
if(tdContext == 'c'){
tdContext="业务";
}
}else if(k==9){
if(tdContext=="&nbsp;"){
tdContext = "&nbsp;";
}else{
tdContext = df.format(new Date(tdContext));
if(tdContext == 'y'){
tdContext="渠道";
}
}
else if(k == 7){
//tdContext="<a name='"+this.getData(this.objectlist[i],this.header[0][1])+"' title='"+this.getData(this.objectlist[i],this.header[0][1])+"' onclick='goClick(this)'>详情</a>";
console.log(this.getData(this.objectlist[i],this.header[k][1])+" + == ");
tdContext="<a name='"+this.getData(this.objectlist[i],this.header[7][1])+"' onclick='goClick(this)'>详-情</a>";
}else{
tdContext = this.getData(this.objectlist[i],this.header[k][1]);
}
}
} else {
tdContext="<input type='checkbox' name='failureBox"+i+"' class='failureBox' onclick='javascript:checkFailureIdsChoose(this);'/>"+"<span style='display:none'>"+i+"</span>";
/*tdContext="<input type='checkbox' name='failureBox"+i+"' class='failureBox' onclick='javascript:checkFailureIdsChoose(this);'/>"+"<span style='display:none'>"+i+"</span>";
for ( var t = 0; t < checkFailureIds.length; t++) {
if (checkFailureIds[t] == this.getData(this.objectlist[i], "failureId")){
tdContext="<input type='checkbox' name='failureBox"+i+"' class='failureBox' checked onclick='javascript:checkFailureIdsChoose(this);'/>"+"<span style='display:none'>"+i+"</span>";
break;
}
}
}*/
}
} else {
tdContext = "&nbsp;";
......
......@@ -123,24 +123,20 @@ df.applyPattern("yyyy-MM-dd HH:mm:ss");
function failureTable() {
jsonStr = document.getElementById('gzfxDetail').value;
var header = new Array();
header[0] = ["<input type='checkbox' name='ckAll' id='ckAll' class='ckAll' onclick='javascript:checkAll();'/>","checkbox","1%",""];
header[1] = ["故障ID","failureId","4%",""];
header[2] = ["故障标题","failureTitle","10%","16"];
header[3] = ["省份","provinceName","5%",""];
header[4] = ["渠道","channelName","8%",""];
header[5] = ["数据来源","dataSourceName","8%",""];
header[6] = ["故障来源","warningSourceName","8%",""];
header[7] = ["集成商","providerName","8%",""];
header[8] = ["发生时间","happenTime","10%",""];
header[9] = ["结束时间","closeTime","10%",""];
header[10] = ["详细原因","failureReason","14%","20"];
header[11] = ["解决方案","resolution","14%","20"];
window.pagging = new table_pagging({limit:11,tableId:'failureAnalysisDetailTable',header:header});
pagging.pagging(jsonStr);
header[0] = ["<input type='checkbox' name='ckAll' id='ckAll' class='ckAll' onclick='javascript:checkAll();'/>","checkbox","1%",""];
header[1] = ["开始时间","warnBeginTime","10%",""];
header[2] = ["结束时间","warnEndTime","10%","16"];
header[3] = ["省份","provinceName","5%",""];
header[4] = ["类型","associationType","8%",""];
header[5] = ["名称","associationDesc","8%",""];
header[6] = ["告警个数","warningNum","8%",""];
header[7] = ["指标告警明细","providerName","8%",""];
window.pagging = new table_pagging({limit:11,tableId:'failureAnalysisDetailTable',header:header});
pagging.pagging(jsonStr);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment