Commit aa514cb5 authored by 胡斌's avatar 胡斌

Merge remote-tracking branch 'origin/moly'

# Conflicts: # .idea/workspace.xml # src/main/webapp/WEB-INF/classes/com/hp/cmsz/web/PageURLController.class # src/main/webapp/WEB-INF/classes/com/hp/cmsz/web/modelmanage/ModelMaintainController.class
parents c96dd352 0e2565e1
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;
}
}
package com.hp.cmsz.entity;
import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.Timestamp;
/**
*ccolap.KPI_ASSOCIATION_ANALYSIS_v对应的实体类
*
* @author Molinyi
*
*/
public class AssociateDiagosisDetail implements Serializable {
private static final long serialVersionUID = 1L;
private BigInteger associationId;
private Timestamp warnBeginTime;
private Timestamp warnEndTime;
private BigInteger provinceId;
private String provinceName;
private char associationType;
private String associationDesc;
private BigInteger warningNum;
public BigInteger getAssociationId() {
return associationId;
}
public void setAssociationId(BigInteger associationId) {
this.associationId = associationId;
}
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 BigInteger getProvinceId() {
return provinceId;
}
public void setProvinceId(BigInteger provinceId) {
this.provinceId = provinceId;
}
public String getProvinceName() {
return provinceName;
}
public void setProvinceName(String provinceName) {
this.provinceName = provinceName;
}
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 BigInteger getWarningNum() {
return warningNum;
}
public void setWarningNum(BigInteger warningNum) {
this.warningNum = warningNum;
}
}
...@@ -11,6 +11,37 @@ import java.util.List; ...@@ -11,6 +11,37 @@ import java.util.List;
* @author Molinyi * @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 @Entity
@Table(name = "DIM_ASSOCIATION_ANALYSIS_INFO_T",schema = "CCOLAP") @Table(name = "DIM_ASSOCIATION_ANALYSIS_INFO_T",schema = "CCOLAP")
public class DimAssociationAnaInfo implements Serializable { public class DimAssociationAnaInfo implements Serializable {
......
package com.hp.cmsz.repository;
import com.hp.cmsz.entity.AssociateDiagosisDetail;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;
import java.sql.Timestamp;
import java.util.List;
public interface AssociateDiagosisDetailDao {
//@Query(" from AssociateDiagosisDetail detail where detail.warnBeginTime ")
//public List<AssociateDiagosisDetail> findLastDiagosisDetail(Timestamp lastMonthCurrentTime);
/* public List<AssociateDiagosisDetail>findByWarnBeginTimeGreaterThanEqual(Timestamp lastMonthCurrentTime);
@Query("from AssociateDiagosisDetail detail where detail.associationType =:type and detail.provinceId in (:proviceId) and detail.warnBeginTime >= :beginTime and detail.warnEndTime <= :endTime")
public List<AssociateDiagosisDetail> findByBeginToEndTimeAndAssociationTypeAndProvinceId(@Param(value = "beginTime") Timestamp beginTime,
@Param(value = "endTime")Timestamp endTime,
@Param(value = "type")String type,
@Param(value = "proviceId")List<Long> proviceIdList);
*/
}
...@@ -25,6 +25,9 @@ public interface BusinessDao extends JpaSpecificationExecutor<Business>, ...@@ -25,6 +25,9 @@ public interface BusinessDao extends JpaSpecificationExecutor<Business>,
@Query("from Business business where business.isActive = 'Y' and business.businessId >= 0 order by business.businessId") @Query("from Business business where business.isActive = 'Y' and business.businessId >= 0 order by business.businessId")
List<Business> findAllBusiness(); List<Business> findAllBusiness();
/*@Query(" from Business business where business.isActive = 'Y' and business.businessId >= 0 order by business.businessId")
public List<Business> findAllBusiness();*/
//加入isActive=N || add by August 2014-3-27 //加入isActive=N || add by August 2014-3-27
@Query("select business.businessId, business.businessName from Business business where business.isActive = 'Y' and business.businessId >= 0 order by business.businessId") @Query("select business.businessId, business.businessName from Business business where business.isActive = 'Y' and business.businessId >= 0 order by business.businessId")
List<Object[]> findAllBusinessIdAndBusinessName(); List<Object[]> findAllBusinessIdAndBusinessName();
...@@ -76,5 +79,7 @@ public interface BusinessDao extends JpaSpecificationExecutor<Business>, ...@@ -76,5 +79,7 @@ public interface BusinessDao extends JpaSpecificationExecutor<Business>,
@Query("select business from Business business where business.isActive = :isActived and business.channelDataSourceMapId in (:channelDataSourceMapIdList)") @Query("select business from Business business where business.isActive = :isActived and business.channelDataSourceMapId in (:channelDataSourceMapIdList)")
public List<Business> findBusinessListBychannelDataSourceMapIdListAndIsActived(@Param(value = "channelDataSourceMapIdList") List<Long>channelDataSourceMapIdList,@Param(value = "isActived") String isActived); public List<Business> findBusinessListBychannelDataSourceMapIdListAndIsActived(@Param(value = "channelDataSourceMapIdList") List<Long>channelDataSourceMapIdList,@Param(value = "isActived") String isActived);
} }
...@@ -7,6 +7,9 @@ import org.springframework.data.repository.PagingAndSortingRepository; ...@@ -7,6 +7,9 @@ import org.springframework.data.repository.PagingAndSortingRepository;
import com.hp.cmsz.entity.DimAssociationAnaInfo; import com.hp.cmsz.entity.DimAssociationAnaInfo;
import org.springframework.data.repository.query.Param; import org.springframework.data.repository.query.Param;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import java.sql.Timestamp;
import java.util.List; import java.util.List;
public interface DimAssociationAnaInfoDao extends JpaSpecificationExecutor<DimAssociationAnaInfo>, public interface DimAssociationAnaInfoDao extends JpaSpecificationExecutor<DimAssociationAnaInfo>,
...@@ -35,4 +38,69 @@ public interface DimAssociationAnaInfoDao extends JpaSpecificationExecutor<DimAs ...@@ -35,4 +38,69 @@ public interface DimAssociationAnaInfoDao extends JpaSpecificationExecutor<DimAs
@Query("select anaInfo from DimAssociationAnaInfo anaInfo where anaInfo.associationId = :associationId ") @Query("select anaInfo from DimAssociationAnaInfo anaInfo where anaInfo.associationId = :associationId ")
public DimAssociationAnaInfo findDimassociationAnaInfoByAssociationId(@Param(value = "associationId")Long 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);
} }
package com.hp.cmsz.service.monitoroperation;
import com.hp.cmsz.entity.AssociateDiagosisDetail;
import com.hp.cmsz.repository.DimAssociationAnaInfoDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.hp.cmsz.repository.AssociateDiagosisDetailDao;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.List;
@Service
@Transactional(readOnly = true)
public class AssociateDiagosisDetailService {
/* @Autowired
private AssociateDiagosisDetailDao associateDiagosisDetailDao;*/
@Autowired
private DimAssociationAnaInfoDao dimAssociationAnaInfoDao;
/*
public List<AssociateDiagosisDetail> findLastDiagosisDetail() {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd:HH:mm:ss");
Calendar calendar = Calendar.getInstance();
System.out.println(format.format(calendar.getTime()));
calendar.add(Calendar.MONTH, -1);
System.out.println(format.format(calendar.getTime()));
List<AssociateDiagosisDetail> list = associateDiagosisDetailDao.findByWarnBeginTimeGreaterThanEqual(new Timestamp(calendar.getTimeInMillis()));
System.out.println(list);
return null;// associateDiagosisDetailDao.findByWarnBeginTimeGreaterThanEqual(new Timestamp(calendar.getTimeInMillis()));
}
public List<AssociateDiagosisDetail> findByBeginToEndTimeAndAssociationTypeAndProvinceId(Timestamp beginTime, Timestamp endTime,
String type,List<Long> proviceIdList) {
return associateDiagosisDetailDao.findByBeginToEndTimeAndAssociationTypeAndProvinceId(beginTime, endTime, type, proviceIdList);
}
*/
public List<Object[]> findAssociateDiagosisDetailByWarnTimeBeginAndEnd( String warnBeginTime, String warnEndTime){
return dimAssociationAnaInfoDao.findAssociateDiagosisDetailByWarnTimeBeginAndEnd(warnBeginTime, warnEndTime);
}
public List<Object[]> findLastMathAssociateDiagosisDetailByWarnTimeBegin( String warnBeginTime){
Calendar calendar=Calendar.getInstance();
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String warnEndTime= format.format(calendar.getTime());
return dimAssociationAnaInfoDao.findAssociateDiagosisDetailByWarnTimeBeginAndEnd(warnBeginTime, warnEndTime);
}
public List<Object[]> findLastMathAssociateDiagosisDetailByWarnTimeBeginAndEndAndDimesionAndProvinceList(String warnBeginTime, String warnEndTime, char dimension, List<Long> provincelist){
return dimAssociationAnaInfoDao.findLastMathAssociateDiagosisDetailByWarnTimeBeginAndEndAndDimesionAndProvinceList(warnBeginTime, warnEndTime,dimension,provincelist);
}
public Object[] findDetailByAssociationIdAndWarnBeginToEndTime(String beginTime,String endTime,Long associationId){
return dimAssociationAnaInfoDao.findDetailByAssociationIdAndWarnBeginToEndTime(beginTime,endTime,associationId);
}
}
...@@ -87,6 +87,7 @@ public class PageURLController { ...@@ -87,6 +87,7 @@ public class PageURLController {
//监控运营>告警关联诊>关联诊断明细 //监控运营>告警关联诊>关联诊断明细
//AssociateDiagosisDetail映射到WEB-INF/views下的MonitorOperation/AssociateDiagosisDetail.jsp页面 //AssociateDiagosisDetail映射到WEB-INF/views下的MonitorOperation/AssociateDiagosisDetail.jsp页面
public static String AssociateDiagosisDetail="MonitorOperation/AssociateDiagosisDetail"; public static String AssociateDiagosisDetail="MonitorOperation/AssociateDiagosisDetail";
public static String AssociateDetails="MonitorOperation/AssociateDetails";
//监控运营>告警关联诊>关联诊断配置 //监控运营>告警关联诊>关联诊断配置
//AssociateDiagosisConfiguration-INF/views下的MonitorOperation/AssociateDiagosisConfiguration.jsp页面 //AssociateDiagosisConfiguration-INF/views下的MonitorOperation/AssociateDiagosisConfiguration.jsp页面
......
...@@ -208,9 +208,9 @@ public class ModelMaintainController { ...@@ -208,9 +208,9 @@ public class ModelMaintainController {
if(!modelExeScriptName.trim().equals("")){ if(!modelExeScriptName.trim().equals("")){
dataModel.setModelScriptName(modelExeScriptName); dataModel.setModelScriptName(modelExeScriptName);
File file = new File(modelSavePath,modelExeScriptName); File file = new File(modelSavePath,modelExeScriptName);
if(!file.exists()){ /* if(!file.exists()){
fm.write(file); fm.write(file);
} }*/
} }
} }
} }
......
...@@ -5,10 +5,17 @@ ...@@ -5,10 +5,17 @@
<div id="timeLine" class="date"> <div id="timeLine" class="date">
<label for="">时间范围</label><!-- 最近3年 --> <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>
<div id="more-option" class="slide-menu-option"> <div id="more-option" class="slide-menu-option">
...@@ -26,6 +33,7 @@ ...@@ -26,6 +33,7 @@
</div> </div>
</div> </div>
<%--省份筛选项 --%> <%--省份筛选项 --%>
<div id="provinceDetail" class="slide-menu-option"> <div id="provinceDetail" class="slide-menu-option">
<label for="">省份</label> <label for="">省份</label>
<div class="checkbox-inline"><label><input type="checkbox" name="allProvinceDetail" id="allProvinceDetail" title="allSelect" checked />全选</label></div> <div class="checkbox-inline"><label><input type="checkbox" name="allProvinceDetail" id="allProvinceDetail" title="allSelect" checked />全选</label></div>
...@@ -40,6 +48,91 @@ ...@@ -40,6 +48,91 @@
</div> </div>
</div> </div>
<script type="text/javascript"> <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"); var detailProviderCheckedValues=$(".providerDetail:checked");
$("#allProviderDetail").click(function(){ $("#allProviderDetail").click(function(){
...@@ -175,10 +268,8 @@ ...@@ -175,10 +268,8 @@
//返回结果为一个数组,数组中包含选中的省份 //返回结果为一个数组,数组中包含选中的省份
function getDetailProvinceCheckedValues(){ function getDetailProvinceCheckedValues(){
var provinceArray=new Array(); var provinceArray=new Array();
var i=0;
detailProvinceCheckedValues.each(function(){ detailProvinceCheckedValues.each(function(){
provinceArray[i]=$(this).val(); provinceArray.push($(this).val());
i++;
}); });
console.log("provinceArray "+provinceArray ); console.log("provinceArray "+provinceArray );
return provinceArray; return provinceArray;
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
<script language="javascript" type="text/javascript" src="${ctx}/static/My97DatePicker/WdatePicker.js"></script> <script language="javascript" type="text/javascript" src="${ctx}/static/My97DatePicker/WdatePicker.js"></script>
--%> --%>
<div id="timeLine" class="date"> <div id="timeLine" class="date">
<label for="">时间范围</label><!-- 默认时间范围为最近1个月 --> <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\'}'})"> <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 @@ ...@@ -20,6 +21,7 @@
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
function initStartTime() function initStartTime()
{ {
var now = new Date(); var now = new Date();
......
<%--
Created by IntelliJ IDEA.
User: Administrator
Date: 2017/12/9 0009
Time: 下午 3:29
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ 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>
<title>全网监控智能分析平台</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<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>
</head>
<body>
<div>
<div class="container">
<ol class="breadcrumb">
<li><a href="${ctx}/index">首页</a></li>
<li>监控运营</li>
<li class="active">告警关联诊断</li>
</ol>
</div>
</div>
<div id="main-container main-tab-container">
<div id="content" class="container">
<div class="section">
<div class="tab-content">
<div class="tab-pane fade in active" id="detail">
<div class="row me-row">
<div id="slidePushMenus2" class="cbp-spmenu-push">
<div class="main col-xs-12">
<!-- <table id="mainm2" class="mainm" onclick="hideMenu('showLeftPush2','slidePushMenus2')"></table> -->
<div id="mainm2" class="mainm"></div>
<div class="content clearfix">
<div class="row">
<div class="col-xs-12">
<table class='table table-vertical'>
<tr>
<td><label>开始时间:</label>aa${detail.warnBeginTime}</td>
<td><label>结束时间:</label>aa${detail.warnEndTime}</td>
</tr>
<tr>
<td><label>省份:</label>aa${detail.provinceName}</td>
<td><label>类型:</label>aa${detail.associationType}</td>
<c:choose >
<c:when test="${detail.associationType == 'c'}">
业务
</c:when>
<c:when test="${detail.associationType == 'y'}">
渠道
</c:when>
<c:otherwise>
未知
</c:otherwise>
</c:choose>
</tr>
<tr>
<td><label>名称:</label>aa${detail.associationDesc}</td>
<td><label>告警个数:</label>aa${detail.warningNum}</td>
</tr>
<tr>
<td><label>异常程度:</label>aa${detail.warnBeginTime}</td>
<td><label>指标告警明细:</label>"aa${detail.warnBeginTime}</td>
</tr>
</table>
<br>
<table class='table table-vertical'>
<tr>
<th>开始时间</th>
<th>结束时间</th>
<th>省份</th>
<th>类型</th>
<th>名称</th>
<th>告警个数</th>
<th>异常程度</th>
<th>指标告警明细</th>
</tr>
<c:forEach items="detailList" var="item">
<tr>
<td>${item.}</td>
<td>${item.}</td>
<td>${item.}</td>
<td>${item.}</td>
<td>${item.}</td>
<td>${item.}</td>
<td>${item.}</td>
<td>${item.}</td>
</tr>
</c:forEach>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<form action="#" method="get" id="listForm"></form>
<input type="hidden" id="gzfxDetail" name="gzfxDetail" value='${gzfxDetailInfos}' />
<%-- <input type="hidden" id="listDimKpi" name="listDimKpi" value='${listDimKpi}' />--%><%-- 所有指标--%>
<input type="hidden" id="provinceAll" name="provinceAll" value='${provinces}' />
<input type="hidden" id="indicatorsAll" name="indicatorsAll" value='${indicatorsAll}' />
<input type="hidden" id="anaInfoSelected" name="anaInfoSelected" value='' />
</div>
</div>
</div>
</div>
</body>
</html>
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %> <%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %> <%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/> <c:set var="ctx" value="${pageContext.request.contextPath}"/>
<html> <html>
<head> <head>
...@@ -23,14 +24,18 @@ ...@@ -23,14 +24,18 @@
<script src="${ctx}/static/artDialog4.1.7/artDialog.source.js?skin=default"></script> <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 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" src="${ctx}/static/js/associatediagosisdetail.js"></script>
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function(){ $(document).ready(function(){
// alert(1); // alert(1);
// failureTable(); // failureTable();
// initDateDetail(); // initDateDetail();
//$("#businessSelectAreaDetail").hide(); //$("#businessSelectAreaDetail").hide();
initDate();
//初始化界面 //初始化界面
initTable(); initTable();
var v=document.getElementById('gzfxDetail').value;
console.log("v "+v);
}); });
</script> </script>
...@@ -107,15 +112,6 @@ ...@@ -107,15 +112,6 @@
<div class="col-xs-12"> <div class="col-xs-12">
<div class="table-header"> <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> </div>
<!--写故障明细列表处--> <!--写故障明细列表处-->
<table class="table table-hover table-striped" <table class="table table-hover table-striped"
...@@ -134,10 +130,11 @@ ...@@ -134,10 +130,11 @@
</div> </div>
<form action="#" method="get" id="listForm"></form> <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> </div>
</div> </div>
${diagosisDetails}
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
...@@ -244,6 +241,8 @@ ...@@ -244,6 +241,8 @@
} }
//获取选取的时间段,返回结果为字符串数组 //获取选取的时间段,返回结果为字符串数组
function getPeriod(){ function getPeriod(){
var period=new Array(); var period=new Array();
...@@ -274,25 +273,28 @@ ...@@ -274,25 +273,28 @@
}else{ }else{
var detailProvince = getDetailProvinceCheckedValueString(); var detailProvince = getDetailProvinceCheckedValueString();
var dimension=getDetailCheckeddDimension(); var dimension=getDetailCheckeddDimension();
console.log("detailProvince "+detailProvince);
console.log("dimension "+dimension);
console.log("detailtime "+detailtime);
//alert(dimension+"-pi-"); //alert(dimension+"-pi-");
// alert(detailProvince); // alert(detailProvince);
//var href="${ctx}/MonitorOperation/FailureAnalysisDetail/changeTable?detailProvince="+detailProvince+"&detailProvider="+detailProvider+"&xcdStatus="+xcdStatus+"&detailDataSource="+detailDataSource+"&detailChannel="+detailChannel+"&detailBusiness="+detailBusiness+"&detailWarningSource="+detailWarningSource+"&failureTitle="+"-1"; var href="${ctx}/MonitorOperation/AssociateDiagosisDetail/tableList?detailProvince="+detailProvince+"&detailtime="+detailtime+"&dimension="+dimension;
/* $.ajax({ $.ajax({
type : 'GET', type : 'GET',
contentType : 'application/json', contentType : 'application/json',
url: encodeURI(encodeURI(href))+"&detailTime="+detailTime,//href, url: href,//encodeURI(encodeURI(href)),//href,
dataType : 'text', dataType : 'text',
beforeSend: function(data) { beforeSend: function(data) {
}, },
success: function(data) { success: function(data) {
$("#gzfxDetail").val(data); $("#gzfxDetail").val(data);
failureTable(); // failureTable();
checkFailureIds=[]; initTable();
$("#deleteFailureBtn").attr("disabled", true); //checkFailureIds=[];
toggleMenu('slidePushMenus2');//隐藏筛选项 //$("#deleteFailureBtn").attr("disabled", true);
//toggleMenu('slidePushMenus2');//隐藏筛选项
} }
});*/ });
$("#detailPeriodTag").empty(); $("#detailPeriodTag").empty();
$("#detailProvinceTag").text("省份").append($("<span class='badge'></span>").text(detailProvinceSum)).attr('data-original-title',getDetailProvinceTag()).tooltip(); $("#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(); $("#detailDimensionTag").text("关联维度").append($("<span class='badge'></span>").text()).attr('data-original-title',getdetailDemensionTagValue()).tooltip();
...@@ -318,8 +320,10 @@ ...@@ -318,8 +320,10 @@
//重置detail中的筛选项 //重置detail中的筛选项
function detailReset(){ function detailReset(){
$("#d1").val('');
$("#d2").val(''); //$("#d1").val('');
//$("#d2").val('');
initDate();
detail_Province_Reset(); detail_Province_Reset();
detail_Dimension_Reset(); detail_Dimension_Reset();
judge = true; judge = true;
...@@ -335,6 +339,29 @@ ...@@ -335,6 +339,29 @@
listForm.attr("action","#"); 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> </script>
</body> </body>
......
function initTable(){ function initTable(){
jsonStr = document.getElementById('gzfxDetail').value; jsonStr = document.getElementById('gzfxDetail').value;
alert("jsonStr" +jsonStr);
var header = new Array(); var header = new Array();
header[0] = ["<input type='checkbox' name='ckAll' id='ckAll' class='ckAll' onclick='javascript:checkAll();'/>","checkbox","1%",""]; header[0] = ["<input type='checkbox' name='ckAll' id='ckAll' class='ckAll' onclick='javascript:checkAll();'/>","checkbox","1%",""];
header[1] = ["开始时间","failureId","10%",""]; header[1] = ["开始时间","warnBeginTime","10%",""];
header[2] = ["结束时间","failureTitle","10%","16"]; header[2] = ["结束时间","warnEndTime","10%","16"];
header[3] = ["省份","provinceName","5%",""]; header[3] = ["省份","provinceName","5%",""];
header[4] = ["类型","channelName","8%",""]; header[4] = ["类型","associationType","8%",""];
header[5] = ["名称","dataSourceName","8%",""]; header[5] = ["名称","associationDesc","8%",""];
header[6] = ["告警个数","warningSourceName","8%",""]; header[6] = ["告警个数","warningNum","8%",""];
header[7] = ["指标告警明细","providerName","8%",""]; header[7] = ["指标告警明细","associationId","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}); window.pagging = new table_pagging({limit:11,tableId:'failureAnalysisDetailTable',header:header});
pagging.pagging(jsonStr); pagging.pagging(jsonStr);
...@@ -178,38 +175,45 @@ table_pagging.prototype={ ...@@ -178,38 +175,45 @@ table_pagging.prototype={
tdContext = context; tdContext = context;
} else { } else {
tdContext = this.getData(this.objectlist[i],this.header[k][1]);
if(tdContext==null){ if(tdContext==null){
tdContext = "&nbsp;"; tdContext = "&nbsp;";
} }
if(k==1){ if(k==1|| k==2){
tdContext="<a href='javascript:openDialog("+this.getData(this.objectlist[i],"failureId")+")' alt='"+i+"'>"+this.getData(this.objectlist[i],this.header[k][1])+"</a>"; tdContext=this.getData(this.objectlist[i],this.header[k][1]);
} var d=new Date(tdContext);
if(k==8){ tdContext=(d.getFullYear()+1)+"-"+d.getMonth()+"-"+d.getDate()+" "+d.getHours()+":"+d.getMinutes()+":"+d.getSeconds();
if(tdContext=="&nbsp;"){
tdContext = "&nbsp;"; console.log("---"+(d.getFullYear()+1)+"-"+d.getMonth()+"-"+d.getDate()+" "+d.getHours()+":"+d.getMinutes()+":"+d.getSeconds());
}else{ console.log(tdContext+"--");
tdContext = df.format(new Date(tdContext)); console.log("type "+ typeof tdContext);
}else if(k == 4){
tdContext=this.getData(this.objectlist[i],this.header[k][1]);
if(tdContext == 'c'){
tdContext="业务";
} }
if(tdContext == 'y'){
}else if(k==9){ tdContext="渠道";
if(tdContext=="&nbsp;"){
tdContext = "&nbsp;";
}else{
tdContext = df.format(new Date(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 { } 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++) { for ( var t = 0; t < checkFailureIds.length; t++) {
if (checkFailureIds[t] == this.getData(this.objectlist[i], "failureId")){ 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>"; tdContext="<input type='checkbox' name='failureBox"+i+"' class='failureBox' checked onclick='javascript:checkFailureIdsChoose(this);'/>"+"<span style='display:none'>"+i+"</span>";
break; break;
} }
} }*/
} }
} else { } else {
tdContext = "&nbsp;"; tdContext = "&nbsp;";
......
...@@ -123,24 +123,20 @@ df.applyPattern("yyyy-MM-dd HH:mm:ss"); ...@@ -123,24 +123,20 @@ df.applyPattern("yyyy-MM-dd HH:mm:ss");
function failureTable() { function failureTable() {
jsonStr = document.getElementById('gzfxDetail').value; jsonStr = document.getElementById('gzfxDetail').value;
var header = new Array(); var header = new Array();
header[0] = ["<input type='checkbox' name='ckAll' id='ckAll' class='ckAll' onclick='javascript:checkAll();'/>","checkbox","1%",""]; header[0] = ["<input type='checkbox' name='ckAll' id='ckAll' class='ckAll' onclick='javascript:checkAll();'/>","checkbox","1%",""];
header[1] = ["故障ID","failureId","4%",""]; header[1] = ["开始时间","warnBeginTime","10%",""];
header[2] = ["故障标题","failureTitle","10%","16"]; header[2] = ["结束时间","warnEndTime","10%","16"];
header[3] = ["省份","provinceName","5%",""]; header[3] = ["省份","provinceName","5%",""];
header[4] = ["渠道","channelName","8%",""]; header[4] = ["类型","associationType","8%",""];
header[5] = ["数据来源","dataSourceName","8%",""]; header[5] = ["名称","associationDesc","8%",""];
header[6] = ["故障来源","warningSourceName","8%",""]; header[6] = ["告警个数","warningNum","8%",""];
header[7] = ["集成商","providerName","8%",""]; header[7] = ["指标告警明细","providerName","8%",""];
header[8] = ["发生时间","happenTime","10%",""];
header[9] = ["结束时间","closeTime","10%",""];
header[10] = ["详细原因","failureReason","14%","20"]; window.pagging = new table_pagging({limit:11,tableId:'failureAnalysisDetailTable',header:header});
header[11] = ["解决方案","resolution","14%","20"]; pagging.pagging(jsonStr);
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