Commit c5255ca4 authored by 胡斌's avatar 胡斌

Merge remote-tracking branch 'origin/moly'

parents bc1b51e5 570fb597
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -40,14 +40,56 @@ public interface DimAssociationAnaInfoDao extends JpaSpecificationExecutor<DimAs ...@@ -40,14 +40,56 @@ 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 ," + /*@Query(value = "SELECT ASSOCIATION_ID AS associationId ,D.PROVINCE_ID as provinceId,ASSOCIATION_TYPE AS associationType ," +
"ASSOCIATION_DESC AS associationDesc,d.PROVINCE_NAME AS provinceName,WARNING_BEGIN_TIME AS warningBeginTime," + "ASSOCIATION_DESC AS associationDesc,d.PROVINCE_NAME AS provinceName,WARNING_BEGIN_TIME AS warningBeginTime," +
"WARNING_END_TIME as warningEndTime,COUNT(E.KPI_ID)AS warningNum FROM " + "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, " + "( 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" + "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.xcd_warning_detail_info_v E ON D.PROVINCE_ID=E.PROVINCE_ID AND D.KPI_ID =E.KPI_ID WHERE " + " INNER JOIN CCOLAP.DIM_PROVINCE_INFO_T C ON C.PROVINCE_ID= A.PROVINCE_ID) D LEFT JOIN CCOLAP.xcd_warning_detail_info_v E ON D.PROVINCE_ID=E.PROVINCE_ID AND D.KPI_ID =E.KPI_ID WHERE " +
"OCCUR_TIME >=TO_TIMESTAMP(?1,'YYYY-MM-DD HH24:MI:SS') AND OCCUR_TIME <=TO_TIMESTAMP(?2,'YYYY-MM-DD HH24:MI:SS') " + "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,d.PROVINCE_NAME,WARNING_BEGIN_TIME,WARNING_END_TIME", nativeQuery = true) "GROUP BY ASSOCIATION_ID,D.PROVINCE_ID,ASSOCIATION_TYPE ,ASSOCIATION_DESC,d.PROVINCE_NAME,WARNING_BEGIN_TIME,WARNING_END_TIME", nativeQuery = true)*/
@Query(value = "SELECT" +
" ASSOCIATION_ID AS associationId , " +
" D.PROVINCE_ID AS provinceId, " +
" ASSOCIATION_TYPE AS associationType , " +
" ASSOCIATION_DESC AS associationDesc, " +
" d.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, " +
" C.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, CCOLAP.DIM_KPI_ASSOCIATION_RELATED_INFO_T B , " +
" CCOLAP.DIM_PROVINCE_INFO_T C " +
"WHERE " +
" A.ASSOCIATION_ID=B.ASSOCIATION_ID) D " +
" LEFT JOIN " +
" CCOLAP.xcd_warning_detail_info_v E " +
" ON " +
" D.PROVINCE_ID=E.PROVINCE_ID " +
" AND D.KPI_ID =E.KPI_ID " +
" 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, " +
" d.PROVINCE_NAME, " +
" WARNING_BEGIN_TIME, " +
" WARNING_END_TIME "
,nativeQuery = true)
public List<Object[]> findAssociateDiagosisDetailByWarnTimeBeginAndEnd(String warnBeginTime, String warnEndTime); public List<Object[]> findAssociateDiagosisDetailByWarnTimeBeginAndEnd(String warnBeginTime, String warnEndTime);
@Query(value = "SELECT ASSOCIATION_ID AS associationId ,D.PROVINCE_ID as provinceId,ASSOCIATION_TYPE AS associationType ," + @Query(value = "SELECT ASSOCIATION_ID AS associationId ,D.PROVINCE_ID as provinceId,ASSOCIATION_TYPE AS associationType ," +
...@@ -61,7 +103,7 @@ public interface DimAssociationAnaInfoDao extends JpaSpecificationExecutor<DimAs ...@@ -61,7 +103,7 @@ public interface DimAssociationAnaInfoDao extends JpaSpecificationExecutor<DimAs
public List<Object[]> findLastMathAssociateDiagosisDetailByWarnTimeBegin(String warnBeginTime, String warnEndTime); public List<Object[]> findLastMathAssociateDiagosisDetailByWarnTimeBegin(String warnBeginTime, String warnEndTime);
@Query(value = "SELECT ASSOCIATION_ID, D.PROVINCE_ID, ASSOCIATION_TYPE ,ASSOCIATION_DESC, PROVINCE_NAME, WARNING_BEGIN_TIME, WARNING_END_TIME," + /*@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 (" + " 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," + " 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" + " TO_TIMESTAMP(?2,'YYYY-MM-DD HH24:MI:SS') AS WARNING_END_TIME" +
...@@ -71,7 +113,49 @@ public interface DimAssociationAnaInfoDao extends JpaSpecificationExecutor<DimAs ...@@ -71,7 +113,49 @@ public interface DimAssociationAnaInfoDao extends JpaSpecificationExecutor<DimAs
" ON D.PROVINCE_ID = E.PROVINCE_ID AND D.KPI_ID =E.KPI_ID AND WARNING_ID LIKE 'J%'" + " 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(?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" " 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) , nativeQuery = true)*/
@Query(value = "SELECT" +
" ASSOCIATION_ID AS associationId , " +
" D.PROVINCE_ID AS provinceId, " +
" ASSOCIATION_TYPE AS associationType , " +
" ASSOCIATION_DESC AS associationDesc, " +
" d.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, " +
" C.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, CCOLAP.DIM_KPI_ASSOCIATION_RELATED_INFO_T B , " +
" CCOLAP.DIM_PROVINCE_INFO_T C " +
"WHERE " +
" A.ASSOCIATION_ID=B.ASSOCIATION_ID and A.ASSOCIATION_TYPE=?3 and C.PROVINCE_ID in(?4)) D " +
" LEFT JOIN " +
" CCOLAP.xcd_warning_detail_info_v E " +
" ON " +
" D.PROVINCE_ID=E.PROVINCE_ID " +
" AND D.KPI_ID =E.KPI_ID " +
" 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, " +
" d.PROVINCE_NAME, " +
" WARNING_BEGIN_TIME, " +
" WARNING_END_TIME "
,nativeQuery = true)
public List<Object[]> findLastMathAssociateDiagosisDetailByWarnTimeBeginAndEndAndDimesionAndProvinceList(String warnBeginTime, String warnEndTime, char dimension, List<Long> provincelist); public List<Object[]> findLastMathAssociateDiagosisDetailByWarnTimeBeginAndEndAndDimesionAndProvinceList(String warnBeginTime, String warnEndTime, char dimension, List<Long> provincelist);
...@@ -87,14 +171,149 @@ public interface DimAssociationAnaInfoDao extends JpaSpecificationExecutor<DimAs ...@@ -87,14 +171,149 @@ public interface DimAssociationAnaInfoDao extends JpaSpecificationExecutor<DimAs
" and OCCUR_TIME >= TO_TIMESTAMP(?3,'YYYY-MM-DD HH24:MI:SS')" + " and OCCUR_TIME >= TO_TIMESTAMP(?3,'YYYY-MM-DD HH24:MI:SS')" +
" AND OCCUR_TIME <=TO_TIMESTAMP(?4,'YYYY-MM-DD HH24:MI:SS') WHERE " + " AND OCCUR_TIME <=TO_TIMESTAMP(?4,'YYYY-MM-DD HH24:MI:SS') WHERE " +
" D.PROVINCE_ID = ?1 GROUP BY ASSOCIATION_ID,D.PROVINCE_ID, ASSOCIATION_TYPE ,ASSOCIATION_DESC,PROVINCE_NAME, WARNING_BEGIN_TIME, WARNING_END_TIME", nativeQuery = true) " D.PROVINCE_ID = ?1 GROUP BY ASSOCIATION_ID,D.PROVINCE_ID, ASSOCIATION_TYPE ,ASSOCIATION_DESC,PROVINCE_NAME, WARNING_BEGIN_TIME, WARNING_END_TIME", nativeQuery = true)
public Object[] findObjByProvinceIdAndKpiIdAndoccurTimeAndCloseTime(/*@Param(value = "provinceId")*/ Long provinceId, public Object[] findObjByProvinceIdAndKpiIdAndoccurTimeAndCloseTime( Long provinceId,
/*@Param(value = "kpiId")*/ Long kpiId, Long kpiId,
/*@Param(value = "occurTime")*/ String occurTime, String occurTime,
/*@Param(value = "closeTime")*/ String closeTime); String closeTime);
@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" @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) ,nativeQuery = true)
public List<Object[]> findDetailByAssociationIdAndWarnBeginToEndTime(String beginTime,String endTime,Long associationId); public List<Object[]> findDetailByAssociationIdAndWarnBeginToEndTime(String beginTime,String endTime,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, " +
" D.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, " +
" C.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, CCOLAP.DIM_KPI_ASSOCIATION_RELATED_INFO_T B , " +
" CCOLAP.DIM_PROVINCE_INFO_T C, CCOLAP.DIM_KPI_INFO_T D " +
" WHERE " +
" A.ASSOCIATION_ID=B.ASSOCIATION_ID " +
" and C.PROVINCE_ID=?4 " +
" and " +
" B.KPI_ID=D.KPI_ID) D " +
" LEFT JOIN " +
" CCOLAP.xcd_warning_detail_info_v E " +
" ON " +
" D.PROVINCE_ID=E.PROVINCE_ID " +
" AND D.KPI_ID =E.KPI_ID " +
" 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, " +
" d.PROVINCE_NAME, " +
" WARNING_BEGIN_TIME, " +
" WARNING_END_TIME, " +
" D.KPI_CODE, " +
" D.KPI_NAME, " +
" D.KPI_ID, " +
" KPI_WEIGHT)G",
nativeQuery = true)
public List<Object[]>findDetailByBeginTimeAndEndTimeAndAssociationIdAndProvinceId(String beginTime,String endTime,
Long associationId,Long provinceId);
@Query(value = "SELECT" +
" ASSOCIATION_ID AS associationId , " +
" D.PROVINCE_ID AS provinceId, " +
" ASSOCIATION_TYPE AS associationType , " +
" ASSOCIATION_DESC AS associationDesc, " +
" d.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, " +
" C.PROVINCE_ID, " +
" A.ASSOCIATION_DESC, " +
" A.ASSOCIATION_TYPE, " +
" B.KPI_ID, " +
" C.PROVINCE_NAME, " +
" TO_TIMESTAMP(?2,'YYYY-MM-DD HH24:MI:SS') AS WARNING_BEGIN_TIME, " +
" TO_TIMESTAMP(?3,'YYYY-MM-DD HH24:MI:SS') AS WARNING_END_TIME " +
" FROM " +
" CCOLAP.DIM_ASSOCIATION_ANALYSIS_INFO_T A, CCOLAP.DIM_KPI_ASSOCIATION_RELATED_INFO_T B , " +
" CCOLAP.DIM_PROVINCE_INFO_T C " +
"WHERE " +
" A.ASSOCIATION_ID=B.ASSOCIATION_ID and C.PROVINCE_ID =?1 ) D " +
" LEFT JOIN " +
" CCOLAP.xcd_warning_detail_info_v E " +
" ON " +
" D.PROVINCE_ID=E.PROVINCE_ID " +
" AND D.KPI_ID =E.KPI_ID " +
" WHERE " +
" OCCUR_TIME >=TO_TIMESTAMP(?2,'YYYY-MM-DD HH24:MI:SS') " +
" AND OCCUR_TIME <=TO_TIMESTAMP(?3,'YYYY-MM-DD HH24:MI:SS') " +
" GROUP BY " +
" ASSOCIATION_ID, " +
" D.PROVINCE_ID, " +
" ASSOCIATION_TYPE , " +
" ASSOCIATION_DESC, " +
" d.PROVINCE_NAME, " +
" WARNING_BEGIN_TIME, " +
" WARNING_END_TIME "
,nativeQuery = true)
public List<Object[]> findObjByProvinceIdAndoccurTimeAndCloseTime( Long provinceId,
String occurTime,
String closeTime);
} }
...@@ -51,4 +51,7 @@ public interface ProvinceDao extends JpaSpecificationExecutor<Province>, ...@@ -51,4 +51,7 @@ public interface ProvinceDao extends JpaSpecificationExecutor<Province>,
//由集成商Ids得到省份信息 //由集成商Ids得到省份信息
@Query("select province from Province province , ProvinceVersionConfig provinceVersionConfig where provinceVersionConfig.provinceId=province.provinceId and provinceVersionConfig.bossProviderId in (:bossProviderIds) order by province.provinceId") @Query("select province from Province province , ProvinceVersionConfig provinceVersionConfig where provinceVersionConfig.provinceId=province.provinceId and provinceVersionConfig.bossProviderId in (:bossProviderIds) order by province.provinceId")
List<Province> findProvinceByProviderIds(@Param("bossProviderIds")List<Long> bossProviderIds); List<Province> findProvinceByProviderIds(@Param("bossProviderIds")List<Long> bossProviderIds);
@Query("select provinceId from Province where provinceName= ?1")
public Long findProvinceIdByProvinceName(String provinceName);
} }
...@@ -43,4 +43,13 @@ public interface XcdChangeOrderDao extends JpaSpecificationExecutor<XcdChangeOrd ...@@ -43,4 +43,13 @@ public interface XcdChangeOrderDao extends JpaSpecificationExecutor<XcdChangeOrd
//根据告警id得到变更单信息 Add by Charmy //根据告警id得到变更单信息 Add by Charmy
@Query(value="select change_order_code , change_order_title , change_start_time, change_end_time from xcd_change_order_info_t cross join (select occur_time,warning_id,cast(parameter_value as number) parameter_value,province_id from gjfx_warning_info_t, dim_system_parameter_info_t where warning_id=:warningID and parameter_name='CHANGE_ORDER_SEARCH_HOURS') gjfx_warning_info_t where (change_start_time>occur_time-parameter_value/24 and change_start_time<occur_time+parameter_value/24 or change_end_time>occur_time-parameter_value/24 and change_end_time<occur_time+parameter_value/24) and gjfx_warning_info_t.province_id=xcd_change_order_info_t.province_id order by change_end_time desc",nativeQuery=true) @Query(value="select change_order_code , change_order_title , change_start_time, change_end_time from xcd_change_order_info_t cross join (select occur_time,warning_id,cast(parameter_value as number) parameter_value,province_id from gjfx_warning_info_t, dim_system_parameter_info_t where warning_id=:warningID and parameter_name='CHANGE_ORDER_SEARCH_HOURS') gjfx_warning_info_t where (change_start_time>occur_time-parameter_value/24 and change_start_time<occur_time+parameter_value/24 or change_end_time>occur_time-parameter_value/24 and change_end_time<occur_time+parameter_value/24) and gjfx_warning_info_t.province_id=xcd_change_order_info_t.province_id order by change_end_time desc",nativeQuery=true)
List<Object[]> findByWarningId(@Param("warningID")String warningID); List<Object[]> findByWarningId(@Param("warningID")String warningID);
@Query(value = "select t.* from ccolap.XCD_CHANGE_ORDER_INFO_T t" +
" where CHANGE_START_TIME>= ?1 " +
" and CHANGE_END_TIME<= ?2 " +
"and PROVINCE_ID = ?3 "
,nativeQuery = true)
List<XcdChangeOrder> findXcdChangeOrderListByChangeStartTimeAndChangeEndTimeAndProvinceId(
Date changeStartTime,Date changeEndTime,Long provinceId);
} }
...@@ -136,4 +136,7 @@ public interface XcdDetailInfoViewDao extends PagingAndSortingRepository<XcdDet ...@@ -136,4 +136,7 @@ public interface XcdDetailInfoViewDao extends PagingAndSortingRepository<XcdDet
List<XcdDetailInfoView> findWorkingOrderIdDistinctByProviderIdInAndDataSourceIdInAndChannelIdInAndProvinceIdInAndWorkingOrderIdIsNullAndRelevantFailureIdIsNullOrderByEventHappenTimeDesc(List<Long> provider,List<Long> datasource,List<Long> channel,List<Long> province); List<XcdDetailInfoView> findWorkingOrderIdDistinctByProviderIdInAndDataSourceIdInAndChannelIdInAndProvinceIdInAndWorkingOrderIdIsNullAndRelevantFailureIdIsNullOrderByEventHappenTimeDesc(List<Long> provider,List<Long> datasource,List<Long> channel,List<Long> province);
//根据协查单编号查找协查单,协查单明细展示 //根据协查单编号查找协查单,协查单明细展示
List <XcdDetailInfoView> findByWorkingOrderCode(String xcdCode);//加List <XcdDetailInfoView>是为了防止数据有问题,例如一个协查单编号对应几条协查单记录,但是在实际环境中一个协查单编号只对应一条记录 List <XcdDetailInfoView> findByWorkingOrderCode(String xcdCode);//加List <XcdDetailInfoView>是为了防止数据有问题,例如一个协查单编号对应几条协查单记录,但是在实际环境中一个协查单编号只对应一条记录
} }
...@@ -123,5 +123,14 @@ public interface XcdWorkingOrderInfoDao extends PagingAndSortingRepository<XcdW ...@@ -123,5 +123,14 @@ public interface XcdWorkingOrderInfoDao extends PagingAndSortingRepository<XcdW
@Query(value = "select a.* from ccolap.XCD_WORKING_ORDER_INFO_T a ,ccolap.DIM_PROVINCE_INFO_T b " +
" where WORKING_ORDER_CODE is not null and EVENT_HAPPEN_TIME>= ?1 " +
" and BUSINESS_RECOVERY_TIME<= ?2 " +
" and a.prov_code=b.province_code " +
" and b.province_id= ?3",nativeQuery = true)
List<XcdWorkingOrderInfo> findXcdWorkingOrderInfoByEventHappenTimeAndBusinessRecoveryTimeAndProvinceId(
Date eventHappenTime,Date businessRecoveryTime,Long provinceId );
} }
...@@ -2,6 +2,7 @@ package com.hp.cmsz.service.monitoroperation; ...@@ -2,6 +2,7 @@ package com.hp.cmsz.service.monitoroperation;
import com.hp.cmsz.entity.AssociateDiagosisDetail; import com.hp.cmsz.entity.AssociateDiagosisDetail;
import com.hp.cmsz.entity.AssociateDiagosisWarningDetail;
import com.hp.cmsz.entity.XcdWarningInfoView; import com.hp.cmsz.entity.XcdWarningInfoView;
import com.hp.cmsz.repository.DimAssociationAnaInfoDao; import com.hp.cmsz.repository.DimAssociationAnaInfoDao;
import com.hp.cmsz.repository.XcdWarningInfoViewDao; import com.hp.cmsz.repository.XcdWarningInfoViewDao;
...@@ -17,6 +18,7 @@ import javax.persistence.EntityManagerFactory; ...@@ -17,6 +18,7 @@ import javax.persistence.EntityManagerFactory;
import java.math.BigInteger; import java.math.BigInteger;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -33,30 +35,8 @@ public class AssociateDiagosisDetailService { ...@@ -33,30 +35,8 @@ public class AssociateDiagosisDetailService {
@Autowired @Autowired
private XcdWarningInfoViewDao xcdWarningInfoViewDao; private XcdWarningInfoViewDao xcdWarningInfoViewDao;
/*
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){ public List<Object[]> findLastMathAssociateDiagosisDetailByWarnTimeBegin( String warnBeginTime){
Calendar calendar=Calendar.getInstance(); Calendar calendar=Calendar.getInstance();
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
...@@ -84,13 +64,54 @@ public class AssociateDiagosisDetailService { ...@@ -84,13 +64,54 @@ public class AssociateDiagosisDetailService {
} }
} }
public List<Object[]> findLastMathAssociateDiagosisDetailByWarnTimeBeginAndEndAndDimesionAndProvinceList(String warnBeginTime, String warnEndTime, char dimension, List<Long> provincelist){ public List<AssociateDiagosisDetail> findAssociateDiagosisDetailByWarnTimeBeginAndEnd( String warnBeginTime, String warnEndTime){
return dimAssociationAnaInfoDao.findLastMathAssociateDiagosisDetailByWarnTimeBeginAndEndAndDimesionAndProvinceList(warnBeginTime, warnEndTime,dimension,provincelist); List<Object[]> list= dimAssociationAnaInfoDao.findAssociateDiagosisDetailByWarnTimeBeginAndEnd(warnBeginTime, warnEndTime);
List<AssociateDiagosisDetail>diagosisDetails=new ArrayList<AssociateDiagosisDetail>();
if(null!=list){
for (Object[] objects : list) {
AssociateDiagosisDetail detail=new AssociateDiagosisDetail();
detail.setAssociationId((BigInteger)objects[0]);
detail.setProvinceId((BigInteger)objects[1]);
detail.setAssociationType(objects[2].toString().toCharArray()[0]);
detail.setAssociationDesc((String)objects[3]);
detail.setProvinceName((String)objects[4]);
detail.setWarnBeginTime((Timestamp)objects[5]);
detail.setWarnEndTime((Timestamp)objects[6]);
detail.setWarningNum((BigInteger)objects[7]);
diagosisDetails.add(detail);
}
}
return diagosisDetails;
// return dimAssociationAnaInfoDao.findAssociateDiagosisDetailByWarnTimeBeginAndEnd(warnBeginTime, warnEndTime);
}
public List<AssociateDiagosisDetail> findLastMathAssociateDiagosisDetailByWarnTimeBeginAndEndAndDimesionAndProvinceList(String warnBeginTime, String warnEndTime, char dimension, List<Long> provincelist){
List<Object[]> list=dimAssociationAnaInfoDao.findLastMathAssociateDiagosisDetailByWarnTimeBeginAndEndAndDimesionAndProvinceList(warnBeginTime, warnEndTime,dimension,provincelist);
List<AssociateDiagosisDetail>diagosisDetails=new ArrayList<AssociateDiagosisDetail>();
if(null!=list){
for (Object[] objects : list) {
AssociateDiagosisDetail detail=new AssociateDiagosisDetail();
detail.setAssociationId((BigInteger)objects[0]);
detail.setProvinceId((BigInteger)objects[1]);
detail.setAssociationType(objects[2].toString().toCharArray()[0]);
detail.setAssociationDesc((String)objects[3]);
detail.setProvinceName((String)objects[4]);
detail.setWarnBeginTime((Timestamp)objects[5]);
detail.setWarnEndTime((Timestamp)objects[6]);
detail.setWarningNum((BigInteger)objects[7]);
diagosisDetails.add(detail);
}
}
return diagosisDetails;
// return dimAssociationAnaInfoDao.findLastMathAssociateDiagosisDetailByWarnTimeBeginAndEndAndDimesionAndProvinceList(warnBeginTime, warnEndTime,dimension,provincelist);
} }
// public Object[] findDetailByAssociationIdAndWarnBeginToEndTime(String beginTime,String endTime,Long associationId){
// return dimAssociationAnaInfoDao.findDetailByAssociationIdAndWarnBeginToEndTime(beginTime,endTime,associationId);
// }
public List<Object[]> findByWarningListDetail(String beginTime,String endTime,Long associationId){ public List<Object[]> findByWarningListDetail(String beginTime,String endTime,Long associationId){
...@@ -110,5 +131,55 @@ public class AssociateDiagosisDetailService { ...@@ -110,5 +131,55 @@ public class AssociateDiagosisDetailService {
return null; return null;
} }
public List<AssociateDiagosisWarningDetail>findDetailByBeginTimeAndEndTimeAndAssociationIdAndProvinceId(String beginTime,String endTime,
Long associationId,Long provinceId){
List<Object[]>list= dimAssociationAnaInfoDao.findDetailByBeginTimeAndEndTimeAndAssociationIdAndProvinceId(beginTime, endTime, associationId, provinceId);
List<AssociateDiagosisWarningDetail> adwdl = new ArrayList<AssociateDiagosisWarningDetail>();
if(list!=null&&list.size()>0){
if(list !=null){
for (Object[] objects : list) {
AssociateDiagosisWarningDetail adwd = new AssociateDiagosisWarningDetail();
adwd.setASSOCIATION_ID(String.valueOf(objects[0]) );
adwd.setASSOCIATION_TYPE(objects[2]+"");
adwd.setASSOCIATION_DESC(objects[3]+"");
adwd.setPROVINCE_NAME( objects[4]+"");
adwd.setPROVINCE_ID( objects[1]+"");
adwd.setKPI_CODE(objects[7]+"");
adwd.setKPI_NAME(objects[8]+"");
adwd.setKPI_ID(String.valueOf(objects[9]));
adwd.setKPI_WEIGHT(String.valueOf(objects[10]));
adwd.setWARNING_NUM(String.valueOf( objects[11]));
adwd.setINFLUENCE_LEVEL(String.valueOf( objects[12]));
adwdl.add(adwd);
}
}
}
return adwdl;
}
public List<AssociateDiagosisDetail> findDetailByProvinceIdAndoccurTimeAndCloseTime( Long provinceId,
String occurTime,
String closeTime){
List<Object[]>list= dimAssociationAnaInfoDao.findObjByProvinceIdAndoccurTimeAndCloseTime(provinceId, occurTime, closeTime);
List<AssociateDiagosisDetail> associateDiagosisDetails = new ArrayList<AssociateDiagosisDetail>();
if(list!=null&&list.size()>0){
for (Object[] objects : list) {
AssociateDiagosisDetail detail=new AssociateDiagosisDetail();
detail.setAssociationId((BigInteger)objects[0]);
detail.setProvinceId((BigInteger)objects[1]);
detail.setAssociationType(objects[2].toString().toCharArray()[0]);
detail.setAssociationDesc((String)objects[3]);
detail.setProvinceName((String)objects[4]);
detail.setWarnBeginTime((Timestamp)objects[5]);
detail.setWarnEndTime((Timestamp)objects[6]);
detail.setWarningNum((BigInteger)objects[7]);
associateDiagosisDetails.add(detail);
}
}
return associateDiagosisDetails;
}
} }
...@@ -31,13 +31,13 @@ import java.text.SimpleDateFormat; ...@@ -31,13 +31,13 @@ import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import com.hp.cmsz.service.monitoroperation.AssociateDiagosisDetailService; import com.hp.cmsz.service.monitoroperation.AssociateDiagosisDetailService;
import sun.org.mozilla.javascript.internal.EcmaError;
import sun.rmi.transport.ObjectTable; import sun.rmi.transport.ObjectTable;
/** /**
* AssociateDiagosisDetailControllerr 监控运营>告警关联诊>关联诊断明细 * AssociateDiagosisDetailControllerr 监控运营>告警关联诊>关联诊断明细
* *
* @author Molinyi * @author Molinyi
*
*/ */
@Controller @Controller
@RequestMapping(value = "/MonitorOperation/AssociateDiagosisDetail") @RequestMapping(value = "/MonitorOperation/AssociateDiagosisDetail")
...@@ -85,31 +85,25 @@ public class AssociateDiagosisDetailController { ...@@ -85,31 +85,25 @@ public class AssociateDiagosisDetailController {
@Autowired @Autowired
private XcdWarningInfoViewDao xcdWarningInfoViewDao; private XcdWarningInfoViewDao xcdWarningInfoViewDao;
@Autowired
private XcdDetailInfoViewDao xcdDetailInfoViewDao;
@Autowired
private XcdChangeOrderDao xcdChangeOrderDao;
/*@Autowired
private XcdWorkingOrderInfoDao xcdWorkingOrderInfoDao;*/
@RequestMapping("") @RequestMapping("")
public String lis(Map model, ServletRequest request, HttpSession session) public String lis(Map model, ServletRequest request, HttpSession session)
throws UnsupportedEncodingException, ParseException { throws UnsupportedEncodingException, ParseException {
List<Province> provinceList =(List<Province>) provinceDao.findProvince(); List<Province> provinceList = (List<Province>) provinceDao.findProvince();
String timestamp1=getLastMonth();//getOld(); String timestamp1 = getLastMonth();//getOld();
String timestamp2=getNow();//getNew(); String timestamp2 = getNow();//getNew();
List<Object[]> diagosisDetailsObj=associateDiagosisDetailService.findAssociateDiagosisDetailByWarnTimeBeginAndEnd(timestamp1,timestamp2); List<AssociateDiagosisDetail> associateDiagosisDetails = associateDiagosisDetailService.findAssociateDiagosisDetailByWarnTimeBeginAndEnd(timestamp1, timestamp2);
List<AssociateDiagosisDetail> associateDiagosisDetails=new ArrayList<AssociateDiagosisDetail>();
for (Object[] objects : diagosisDetailsObj) {
AssociateDiagosisDetail detail=new AssociateDiagosisDetail();
detail.setAssociationId((BigInteger)objects[0]);
detail.setProvinceId((BigInteger)objects[1]);
detail.setAssociationType(objects[2].toString().toCharArray()[0]);
detail.setAssociationDesc((String)objects[3]);
detail.setProvinceName((String)objects[4]);
detail.setWarnBeginTime((Timestamp)objects[5]);
detail.setWarnEndTime((Timestamp)objects[6]);
detail.setWarningNum((BigInteger)objects[7]);
associateDiagosisDetails.add(detail);
}
model.put("provinceList", provinceList); model.put("provinceList", provinceList);
Gson gson=new Gson(); Gson gson = new Gson();
model.put("diagosisDetails", gson.toJson(associateDiagosisDetails)); model.put("diagosisDetails", gson.toJson(associateDiagosisDetails));
return PageURLController.AssociateDiagosisDetail; return PageURLController.AssociateDiagosisDetail;
} }
...@@ -117,111 +111,98 @@ public class AssociateDiagosisDetailController { ...@@ -117,111 +111,98 @@ public class AssociateDiagosisDetailController {
@RequestMapping("/tableList") @RequestMapping("/tableList")
@ResponseBody @ResponseBody
public String tableList(@RequestParam(value = "detailtime",defaultValue = "") String detailtime, public String tableList(@RequestParam(value = "detailtime", defaultValue = "") String detailtime,
@RequestParam(value = "dimension",defaultValue = "")String dimension, @RequestParam(value = "dimension", defaultValue = "") String dimension,
@RequestParam(value = "detailProvince",defaultValue = "")String detailProvince){ @RequestParam(value = "detailProvince", defaultValue = "") String detailProvince) {
String str=""; String str = "";
if(detailtime.equalsIgnoreCase("") if (detailtime.equalsIgnoreCase("")
||dimension.equalsIgnoreCase("")||detailProvince.equalsIgnoreCase("")){ || dimension.equalsIgnoreCase("") || detailProvince.equalsIgnoreCase("")) {
return str; return str;
} }
String[]provinceStr=detailProvince.split(","); String[] provinceStr = detailProvince.split(",");
List<Long>provinceList=new ArrayList<Long>(); List<Long> provinceList = new ArrayList<Long>();
String[] times = detailtime.split("~"); String[] times = detailtime.split("~");
String warnBeginTime=""; String warnBeginTime = "";
String warnEndTime=""; String warnEndTime = "";
warnBeginTime = times[0]; warnBeginTime = times[0];
warnBeginTime.replaceAll("%"," "); warnBeginTime.replaceAll("%", " ");
warnEndTime = times[1]; warnEndTime = times[1];
warnEndTime.replaceAll("%"," "); warnEndTime.replaceAll("%", " ");
char dimensionc='d'; char dimensionc = 'd';
try { try {
for (String s : provinceStr) { for (String s : provinceStr) {
provinceList.add(Long.parseLong(s)); provinceList.add(Long.parseLong(s));
} }
dimensionc=dimension.charAt(0); dimensionc = dimension.charAt(0);
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
format.parse(warnBeginTime); format.parse(warnBeginTime);
format.parse(warnEndTime); format.parse(warnEndTime);
}catch (Exception e){ } catch (Exception e) {
e.getMessage(); e.getMessage();
System.out.println(e.getMessage()); System.out.println(e.getMessage());
return str; return str;
} }
List<Object[]>diagosisDetailsObj=associateDiagosisDetailService. List<AssociateDiagosisDetail> diagosisDetails = associateDiagosisDetailService.
findLastMathAssociateDiagosisDetailByWarnTimeBeginAndEndAndDimesionAndProvinceList(warnBeginTime,warnEndTime,dimensionc,provinceList); findLastMathAssociateDiagosisDetailByWarnTimeBeginAndEndAndDimesionAndProvinceList(warnBeginTime, warnEndTime, dimensionc, provinceList);
List<AssociateDiagosisDetail>diagosisDetails=new ArrayList<AssociateDiagosisDetail>();
for (Object[] objects : diagosisDetailsObj) { Gson gson = new Gson();
AssociateDiagosisDetail detail=new AssociateDiagosisDetail();
detail.setAssociationId((BigInteger)objects[0]);
detail.setProvinceId((BigInteger)objects[1]);
detail.setAssociationType(objects[2].toString().toCharArray()[0]);
detail.setAssociationDesc((String)objects[3]);
detail.setProvinceName((String)objects[4]);
detail.setWarnBeginTime((Timestamp)objects[5]);
detail.setWarnEndTime((Timestamp)objects[6]);
detail.setWarningNum((BigInteger)objects[7]);
diagosisDetails.add(detail);
}
Gson gson=new Gson();
System.out.println("gson.toJson(diagosisDetails) "+gson.toJson(diagosisDetails));
return gson.toJson(diagosisDetails); return gson.toJson(diagosisDetails);
} }
@RequestMapping(value ={"/details"}) // 详情超链接
@RequestMapping(value = {"/details"})
public String details( public String details(
@RequestParam(value = "associationId",defaultValue = "") String associationId, @RequestParam(value = "associationId", defaultValue = "") String associationId,
@RequestParam(value = "provinceName",defaultValue = "") String provinceName, @RequestParam(value = "provinceName", defaultValue = "") String provinceName,
@RequestParam(value = "associationType",defaultValue = "") String associationType, @RequestParam(value = "associationType", defaultValue = "") String associationType,
@RequestParam(value = "associationDesc",defaultValue = "") String associationDesc, @RequestParam(value = "associationDesc", defaultValue = "") String associationDesc,
@RequestParam(value = "warningNum",defaultValue = "") String warningNum, @RequestParam(value = "warningNum", defaultValue = "") String warningNum,
@RequestParam(value = "beginTime",defaultValue = "") String beginTime, @RequestParam(value = "beginTime", defaultValue = "") String beginTime,
@RequestParam(value = "endTime",defaultValue = "") String endTime, @RequestParam(value = "endTime", defaultValue = "") String endTime,
Map map){ Map map) throws Exception {
map.put("associationId",associationId); map.put("associationId", associationId);
map.put("beginTime",beginTime); map.put("beginTime", beginTime);
map.put("endTime",endTime); map.put("endTime", endTime);
map.put("provinceName",provinceName); map.put("provinceName", provinceName);
map.put("associationType",associationType); map.put("associationType", associationType);
map.put("associationDesc",associationDesc); map.put("associationDesc", associationDesc);
map.put("warningNum",warningNum); map.put("warningNum", warningNum);
List<Object []> WarningDetailList= null; List<Object[]> WarningDetailList = null;
List<Object []> point = null; List<Object[]> point = null;
List<Object []> relation = null; List<Object[]> relation = null;
if("".equalsIgnoreCase(associationId)||"".equalsIgnoreCase(beginTime)||"".equalsIgnoreCase(endTime)){
}else{
Long associationIdL=Long.parseLong(associationId);
WarningDetailList = associateDiagosisDetailService.findByWarningListDetail(beginTime,endTime,associationIdL);
point = associateDiagosisDetailService.findAllPoint(beginTime,endTime,associationId);
relation = associateDiagosisDetailService.findRelation(beginTime,endTime,associationId);
}
List<AssociateDiagosisWarningDetail> adwdl = new ArrayList<AssociateDiagosisWarningDetail>(); List<AssociateDiagosisWarningDetail> adwdl = new ArrayList<AssociateDiagosisWarningDetail>();
if ("".equalsIgnoreCase(associationId) || "".equalsIgnoreCase(beginTime) || "".equalsIgnoreCase(endTime)) {
} else {
Long provinceId = provinceDao.findProvinceIdByProvinceName(provinceName);
Long associationIdL = Long.parseLong(associationId);
// WarningDetailList = associateDiagosisDetailService.findByWarningListDetail(beginTime,endTime,associationIdL);
point = associateDiagosisDetailService.findAllPoint(beginTime, endTime, associationId);
relation = associateDiagosisDetailService.findRelation(beginTime, endTime, associationId);
adwdl = associateDiagosisDetailService.
findDetailByBeginTimeAndEndTimeAndAssociationIdAndProvinceId(beginTime, endTime, associationIdL, provinceId);
Date eventHappenTime=strToDate(beginTime);
Date businessRecoveryTime=strToDate(endTime);
getNewDate(eventHappenTime,-2*60);
getNewDate(businessRecoveryTime,2*60);
List<XcdWorkingOrderInfo> xcdWorkingOrderInfos=xcdWorkingOrderInfoDao.
findXcdWorkingOrderInfoByEventHappenTimeAndBusinessRecoveryTimeAndProvinceId(eventHappenTime,businessRecoveryTime,provinceId);
List<XcdChangeOrder> xcdChangeOrders=xcdChangeOrderDao.
findXcdChangeOrderListByChangeStartTimeAndChangeEndTimeAndProvinceId(eventHappenTime,businessRecoveryTime,provinceId);
System.out.println("xcdChangeOrders len ="+xcdChangeOrders.size());
System.out.println("xcdWorkingOrderInfos len ="+xcdWorkingOrderInfos.size());
map.put("xcdWorkingOrderInfos",xcdWorkingOrderInfos);
map.put("xcdChangeOrders",xcdChangeOrders);
if(WarningDetailList !=null){
for (Object[] objects : WarningDetailList) {
AssociateDiagosisWarningDetail adwd = new AssociateDiagosisWarningDetail();
adwd.setASSOCIATION_ID(String.valueOf(objects[0]) );
adwd.setASSOCIATION_TYPE(objects[2]+"");
adwd.setASSOCIATION_DESC(objects[3]+"");
adwd.setPROVINCE_NAME( objects[4]+"");
adwd.setPROVINCE_ID( objects[1]+"");
adwd.setKPI_CODE(objects[7]+"");
adwd.setKPI_NAME(objects[8]+"");
adwd.setKPI_ID(String.valueOf(objects[9]));
adwd.setKPI_WEIGHT(String.valueOf(objects[10]));
adwd.setWARNING_NUM(String.valueOf( objects[11]));
adwd.setINFLUENCE_LEVEL(String.valueOf( objects[12]));
adwdl.add(adwd);
}
} }
map.put("warningDetailList",adwdl);
map.put("warningDetailList", adwdl);
return PageURLController.AssociateDetails; return PageURLController.AssociateDetails;
} }
...@@ -229,184 +210,107 @@ public class AssociateDiagosisDetailController { ...@@ -229,184 +210,107 @@ public class AssociateDiagosisDetailController {
@RequestMapping("/getDetail") @RequestMapping("/getDetail")
@ResponseBody @ResponseBody
public String getDetail(@RequestParam(value = "kpiId", defaultValue = "") String kpiId, public String getDetail(@RequestParam(value = "kpiId", defaultValue = "") String kpiId,
@RequestParam(value = "provinceId", defaultValue = "")String provinceId, @RequestParam(value = "provinceId", defaultValue = "") String provinceId,
@RequestParam(value = "beginTime", defaultValue = "")String beginTime, @RequestParam(value = "beginTime", defaultValue = "") String beginTime,
@RequestParam(value = "endTime", defaultValue = "")String endTime){ @RequestParam(value = "endTime", defaultValue = "") String endTime) {
if("".equalsIgnoreCase(kpiId.trim())||"".equalsIgnoreCase(provinceId.trim())|| if ("".equalsIgnoreCase(kpiId.trim()) || "".equalsIgnoreCase(provinceId.trim()) ||
"".equalsIgnoreCase(beginTime.trim())||"".equalsIgnoreCase(endTime.trim())){ "".equalsIgnoreCase(beginTime.trim()) || "".equalsIgnoreCase(endTime.trim())) {
return ""; return "";
} }
Long kpiIdl=null; Long kpiIdl = null;
Long proviceIdl=null; Long proviceIdl = null;
Date beginTimeD=null; Date beginTimeD = null;
Date endTimeD=null; Date endTimeD = null;
try{ try {
kpiIdl=Long.parseLong(kpiId.trim()); kpiIdl = Long.parseLong(kpiId.trim());
proviceIdl=Long.parseLong(provinceId.trim()); proviceIdl = Long.parseLong(provinceId.trim());
beginTimeD=strToDate(beginTime.trim()); beginTimeD = strToDate(beginTime.trim());
endTimeD=strToDate(endTime.trim()); endTimeD = strToDate(endTime.trim());
}catch (Exception e){ } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
return ""; return "";
} }
List<XcdWarningInfoView> list =associateDiagosisDetailService. List<XcdWarningInfoView> list = associateDiagosisDetailService.
findXcdWarningInfoViewByKpiIdAndProvinceIdandBeginToEndTime(kpiIdl,proviceIdl,beginTimeD,endTimeD); findXcdWarningInfoViewByKpiIdAndProvinceIdandBeginToEndTime(kpiIdl, proviceIdl, beginTimeD, endTimeD);
Gson gson=new Gson(); Gson gson = new Gson();
System.out.println(list);
return gson.toJson(list); return gson.toJson(list);
} }
public static Date strToDate(String str) throws Exception{
SimpleDateFormat sdf = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss" );
Date d=new Date();
try {
d=sdf.parse(str);
}catch (Exception e){
throw new Exception("日期格式不对");
}
return d;
}
@RequestMapping("/createDiagosis")
public String createDiagosis() {
public static String getOld(){ return PageURLController.CreateDiagosis;
Calendar calendar=Calendar.getInstance();
calendar.add(Calendar.YEAR,-4);
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return format.format(calendar.getTime().getTime());
}
public static String getNew(){
Calendar calendar=Calendar.getInstance();
calendar.add(Calendar.YEAR,-2);
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return format.format(calendar.getTime().getTime());
}
public static String getLastMonth(){
Calendar calendar=Calendar.getInstance();
calendar.add(Calendar.MONTH,-1);
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return format.format(calendar.getTime().getTime());
}
public static String getNow(){
Calendar calendar=Calendar.getInstance();
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return format.format(calendar.getTime().getTime());
}
private static Timestamp strToTimestamp(String str) throws Exception {
String tsStr = "2011-05-09 11:49:45";
Timestamp timestamp=new Timestamp(0L);
timestamp.valueOf(tsStr);
return timestamp;
} }
@RequestMapping("/yinjingyinhuanToguanlianzhenduanmingxi")
public String yinjingyinhuanToguanlianzhenduanmingxi(
@RequestParam(value = "warningId", defaultValue = "") String warningId,
Map model, ServletRequest request, HttpSession session)
throws UnsupportedEncodingException, ParseException {
List<Province> provinceList = (List<Province>) provinceDao.findProvince();
private static void changeTimestampStyle(List<AssociateDiagosisDetail> diagosisDetails){ model.put("provinceList", provinceList);
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
int len=diagosisDetails.size();
for(int i=0;i<len;i++){
long timeWarnBeginTimel=diagosisDetails.get(i).getWarnBeginTime().getTime();
Date date=new Date(timeWarnBeginTimel);
String timeWarnBeginTimes=df.format(date);
diagosisDetails.get(i).setWarnBeginTime(Timestamp.valueOf(timeWarnBeginTimes));
long timeWarnEndTimel=diagosisDetails.get(i).getWarnEndTime().getTime();
date.setTime(timeWarnEndTimel);
diagosisDetails.get(i).setWarnEndTime(Timestamp.valueOf(df.format(date)));
}
}
//把关联诊断明细统计列表导出为Excel格式 List<XcdWarningInfoView> list = xcdWarningInfoViewDao.findByWarningId(warningId);
@RequestMapping(value = "/upLoadGzfxDetailExcel", method = RequestMethod.POST)
public void getFailuresExcel(HttpServletRequest request, HttpServletResponse response, HttpSession session, ModelMap model) throws Exception{
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date =new Date(); String occurTimes = "";
String fileName = "关联诊断明细列表"+format.format(date); String closeTimes = "";
try{ if (list == null || list.size() < 1) {
fileName = new String(fileName.getBytes("gb2312"), "ISO-8859-1"); return PageURLController.AssociateDiagosisDetail;
}catch(UnsupportedEncodingException e1){ } else {
e1.printStackTrace(); XcdWarningInfoView view = list.get(0);
} Long provinceId = view.getProvinceId();
Long kpiId = view.getKpiId();
Date occurTime = view.getOccurTime();
Date closeTime = view.getCloseTime();
if (occurTime != null) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(occurTime);
calendar.set(Calendar.HOUR, calendar.get(Calendar.HOUR) - 2);
//创建工作薄 occurTime = calendar.getTime();
HSSFWorkbook wb = new HSSFWorkbook(); occurTimes = format.format(calendar.getTime());
HSSFSheet sheet = wb.createSheet();
ExportExcelUtil exportExcel = new ExportExcelUtil(wb, sheet);
//创建列标头LIST
List<String> fialList = new ArrayList<String>();
fialList.add("故障ID");
fialList.add("故障标题");
fialList.add("省份");
fialList.add("渠道");
fialList.add("数据来源");
fialList.add("故障来源");
fialList.add("集成商");
fialList.add("开始时间");
fialList.add("结束时间");
fialList.add("详细原因");
fialList.add("解决方案");
//该报表的列数
int number = fialList.size();
//给工作表列定义列宽
for(int i = 0; i<number; i++){
sheet.setColumnWidth(i, 5500);
} }
//创建单元格样式 if (closeTime == null) {
HSSFCellStyle cellStyle = wb.createCellStyle(); Calendar calendar = Calendar.getInstance();
calendar.setTime(view.getOccurTime());
//指定单元格居中对齐 calendar.set(Calendar.HOUR, calendar.get(Calendar.HOUR) + 2);
cellStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER); closeTimes = format.format(calendar.getTime());
} else {
//指定单元格垂直居中对齐 closeTimes = format.format(closeTime);
cellStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); }
// AssociateDiagosisDetail detail=associateDiagosisDetailService.findObjByProvinceIdAndKpiIdAndoccurTimeAndCloseTime(provinceId,kpiId,occurTimes,closeTimes);
//指定当单元格内容显示不下时自动换行 List<AssociateDiagosisDetail> list1 = new ArrayList();
cellStyle.setWrapText(true); /*if(detail !=null){
list1.add(detail);
//设置单元格字体 }*/
HSSFFont font = wb.createFont(); list1 = associateDiagosisDetailService.findDetailByProvinceIdAndoccurTimeAndCloseTime(provinceId, occurTimes, closeTimes);
font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD); Gson gson = new Gson();
font.setFontName("宋体"); model.put("diagosisDetails", gson.toJson(list1));
font.setFontHeight((short) 220); return PageURLController.AssociateDiagosisDetail;
cellStyle.setFont(font); }
//创建报表头部
exportExcel.createNormalHead("关联诊断明细列表", number - 1);
//创建第二行
HSSFRow row2 = sheet.createRow(1);
//设置行高
row2.setHeight((short) 500);
//单元格
HSSFCell row2Cell = null;
//创建不同的LIST的列标题
for(int i = 0; i< number; i++){
row2Cell = row2.createCell(i);
row2Cell.setCellStyle(cellStyle);
row2Cell.setCellValue(new HSSFRichTextString(fialList.get(i).toString()));
}
} }
public static String getOld() {
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.YEAR, -4);
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return format.format(calendar.getTime().getTime());
}
//将string数据类型转换成List<Long>类型 //将string数据类型转换成List<Long>类型
public List<Long> changeStringToList(String str){ public List<Long> changeStringToList(String str) {
List<Long> list = new ArrayList<Long>(); List<Long> list = new ArrayList<Long>();
for(int i=0;i<str.split(",").length;i++){ for (int i = 0; i < str.split(",").length; i++) {
if(!str.split(",")[i].equals("")){ if (!str.split(",")[i].equals("")) {
list.add(Long.parseLong(str.split(",")[i])); list.add(Long.parseLong(str.split(",")[i]));
} }
...@@ -414,64 +318,61 @@ public class AssociateDiagosisDetailController { ...@@ -414,64 +318,61 @@ public class AssociateDiagosisDetailController {
return list; return list;
} }
@RequestMapping("/createDiagosis") private static void changeTimestampStyle(List<AssociateDiagosisDetail> diagosisDetails) {
public String createDiagosis(){
return PageURLController.CreateDiagosis;
}
@RequestMapping("/yinjingyinhuanToguanlianzhenduanmingxi")
public String yinjingyinhuanToguanlianzhenduanmingxi(
@RequestParam(value = "warningId",defaultValue = "") String warningId,
Map model, ServletRequest request, HttpSession session)
throws UnsupportedEncodingException, ParseException {
List<Province> provinceList =(List<Province>) provinceDao.findProvince();
model.put("provinceList", provinceList); SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
int len = diagosisDetails.size();
for (int i = 0; i < len; i++) {
long timeWarnBeginTimel = diagosisDetails.get(i).getWarnBeginTime().getTime();
Date date = new Date(timeWarnBeginTimel);
String timeWarnBeginTimes = df.format(date);
diagosisDetails.get(i).setWarnBeginTime(Timestamp.valueOf(timeWarnBeginTimes));
List <XcdWarningInfoView> list=xcdWarningInfoViewDao.findByWarningId(warningId); long timeWarnEndTimel = diagosisDetails.get(i).getWarnEndTime().getTime();
date.setTime(timeWarnEndTimel);
diagosisDetails.get(i).setWarnEndTime(Timestamp.valueOf(df.format(date)));
}
}
public static String getNow() {
Calendar calendar = Calendar.getInstance();
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return format.format(calendar.getTime().getTime());
}
SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); private static Timestamp strToTimestamp(String str) throws Exception {
String occurTimes=""; String tsStr = "2011-05-09 11:49:45";
String closeTimes=""; Timestamp timestamp = new Timestamp(0L);
if(list==null||list.size()<1){ timestamp.valueOf(tsStr);
return PageURLController.AssociateDiagosisDetail; return timestamp;
}else { }
XcdWarningInfoView view=list.get(0); public static String getNew() {
Long provinceId=view.getProvinceId(); Calendar calendar = Calendar.getInstance();
Long kpiId=view.getKpiId(); calendar.add(Calendar.YEAR, -2);
Date occurTime=view.getOccurTime(); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date closeTime=view.getCloseTime(); return format.format(calendar.getTime().getTime());
if(occurTime!=null){ }
Calendar calendar=Calendar.getInstance();
calendar.setTime(occurTime);
calendar.set(Calendar.HOUR,calendar.get(Calendar.HOUR)-2);
occurTime=calendar.getTime(); public static String getLastMonth() {
occurTimes=format.format(calendar.getTime()); Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.MONTH, -1);
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return format.format(calendar.getTime().getTime());
} }
if(closeTime == null){ public static Date strToDate(String str) throws Exception {
Calendar calendar=Calendar.getInstance(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
calendar.setTime(view.getOccurTime()); Date d = new Date();
calendar.set(Calendar.HOUR,calendar.get(Calendar.HOUR)+2); try {
closeTimes=format.format(calendar.getTime()); d = sdf.parse(str);
}else{ } catch (Exception e) {
closeTimes=format.format(closeTime); throw new Exception("日期格式不对");
} }
AssociateDiagosisDetail detail=associateDiagosisDetailService.findObjByProvinceIdAndKpiIdAndoccurTimeAndCloseTime(provinceId,kpiId,occurTimes,closeTimes); return d;
List<AssociateDiagosisDetail> list1=new ArrayList();
if(detail !=null){
list1.add(detail);
} }
Gson gson=new Gson(); public static void getNewDate(Date date,int minutes){
model.put("diagosisDetails", gson.toJson(list1)); date.setTime(date.getTime()+minutes*60000);
return PageURLController.AssociateDiagosisDetail;
} }
}
} }
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<label for="">关联维度:</label> <label for="">关联维度:</label>
<select name="xcdStatus" id="xcdStatusSelect" class="slide-menu-select" onChange="judge=false;"> <select name="xcdStatus" id="xcdStatusSelect" class="slide-menu-select" onChange="judge=false;">
<option value="c">业务</option> <option value="c">业务</option>
<option value="q" selected>渠道</option> <option value="y" selected>渠道</option>
<%--<c:forEach var="workingOrderStatus" items="${workingOrderStatusList}"> <%--<c:forEach var="workingOrderStatus" items="${workingOrderStatusList}">
<option value="${workingOrderStatus}" id="xcdStatus"> <option value="${workingOrderStatus}" id="xcdStatus">
${workingOrderStatus} ${workingOrderStatus}
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
<%@ 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" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/> <c:set var="ctx" value="${pageContext.request.contextPath}"/>
<html> <html>
<head> <head>
...@@ -26,127 +28,127 @@ ...@@ -26,127 +28,127 @@
<script> <script>
//格式化日期 //格式化日期
function Format(){ function Format() {
this.jsjava_class="jsjava.text.Format"; this.jsjava_class = "jsjava.text.Format";
} }
function DateFormat(){
this.jsjava_class="jsjava.text.DateFormat"; function DateFormat() {
} this.jsjava_class = "jsjava.text.DateFormat";
DateFormat.prototype=new Format(); }
DateFormat.prototype.constructor=DateFormat;
DateFormat.zh_cn_month2=["01","02","03","04","05","06","07","08","09","10","11","12"]; DateFormat.prototype = new Format();
DateFormat.zh_cn_month3=["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708",]; DateFormat.prototype.constructor = DateFormat;
DateFormat.zh_cn_month4=["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708",]; DateFormat.zh_cn_month2 = ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"];
DateFormat.en_us_month4=["Janu","Febr","Marc","Apri","May","Juhn","July","Augu","Sept","Octo","Nove","Dece"]; DateFormat.zh_cn_month3 = ["\u4e00\u6708", "\u4e8c\u6708", "\u4e09\u6708", "\u56db\u6708", "\u4e94\u6708", "\u516d\u6708", "\u4e03\u6708", "\u516b\u6708", "\u4e5d\u6708", "\u5341\u6708", "\u5341\u4e00\u6708", "\u5341\u4e8c\u6708",];
DateFormat.en_us_month3=["Jan","Feb","Mar","Apr","May","Juh","Jul","Aug","Sep","Oct","Nov","Dec"]; DateFormat.zh_cn_month4 = ["\u4e00\u6708", "\u4e8c\u6708", "\u4e09\u6708", "\u56db\u6708", "\u4e94\u6708", "\u516d\u6708", "\u4e03\u6708", "\u516b\u6708", "\u4e5d\u6708", "\u5341\u6708", "\u5341\u4e00\u6708", "\u5341\u4e8c\u6708",];
DateFormat.en_us_month2=["01","02","03","04","05","06","07","08","09","10","11","12"]; DateFormat.en_us_month4 = ["Janu", "Febr", "Marc", "Apri", "May", "Juhn", "July", "Augu", "Sept", "Octo", "Nove", "Dece"];
DateFormat.zh_cn_week=["\u661f\u671f\u65e5","\u661f\u671f\u4e00","\u661f\u671f\u4e8c","\u661f\u671f\u4e09","\u661f\u671f\u56db","\u661f\u671f\u4e94","\u661f\u671f\u516d"]; DateFormat.en_us_month3 = ["Jan", "Feb", "Mar", "Apr", "May", "Juh", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
DateFormat.zh_cn_am="\u4e0b\u5348"; DateFormat.en_us_month2 = ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"];
DateFormat.zh_cn_pm="\u4e0a\u5348"; DateFormat.zh_cn_week = ["\u661f\u671f\u65e5", "\u661f\u671f\u4e00", "\u661f\u671f\u4e8c", "\u661f\u671f\u4e09", "\u661f\u671f\u56db", "\u661f\u671f\u4e94", "\u661f\u671f\u516d"];
DateFormat.language=(navigator.userLanguage==undefined?navigator.language:navigator.userLanguage).replace("-","_").toLowerCase(); DateFormat.zh_cn_am = "\u4e0b\u5348";
DateFormat.zh_cn_pm = "\u4e0a\u5348";
DateFormat.prototype.format=function(date){ DateFormat.language = (navigator.userLanguage == undefined ? navigator.language : navigator.userLanguage).replace("-", "_").toLowerCase();
var year4=date.getFullYear();
var year2=year4.toString().substring(2); DateFormat.prototype.format = function (date) {
var pattern=this.pattern; var year4 = date.getFullYear();
pattern=pattern.replace(/yyyy/,year4); var year2 = year4.toString().substring(2);
pattern=pattern.replace(/yy/,year2); var pattern = this.pattern;
var month=date.getMonth(); pattern = pattern.replace(/yyyy/, year4);
pattern=pattern.replace(/MMMM/,eval("DateFormat."+DateFormat.language+"_month4[month]")); pattern = pattern.replace(/yy/, year2);
pattern=pattern.replace(/MMM/,eval("DateFormat."+DateFormat.language+"_month3[month]")); var month = date.getMonth();
pattern=pattern.replace(/MM/,eval("DateFormat."+DateFormat.language+"_month2[month]")); pattern = pattern.replace(/MMMM/, eval("DateFormat." + DateFormat.language + "_month4[month]"));
var dayOfMonth=date.getDate(); pattern = pattern.replace(/MMM/, eval("DateFormat." + DateFormat.language + "_month3[month]"));
var dayOfMonth2=dayOfMonth; pattern = pattern.replace(/MM/, eval("DateFormat." + DateFormat.language + "_month2[month]"));
var dayOfMonthLength=dayOfMonth.toString().length; var dayOfMonth = date.getDate();
if(dayOfMonthLength==1){ var dayOfMonth2 = dayOfMonth;
dayOfMonth2="0"+dayOfMonth; var dayOfMonthLength = dayOfMonth.toString().length;
} if (dayOfMonthLength == 1) {
pattern=pattern.replace(/dd/,dayOfMonth2); dayOfMonth2 = "0" + dayOfMonth;
pattern=pattern.replace(/d/,dayOfMonth); }
var hours=date.getHours(); pattern = pattern.replace(/dd/, dayOfMonth2);
var hours2=hours; pattern = pattern.replace(/d/, dayOfMonth);
var hoursLength=hours.toString().length; var hours = date.getHours();
if(hoursLength==1){ var hours2 = hours;
hours2="0"+hours; var hoursLength = hours.toString().length;
} if (hoursLength == 1) {
pattern=pattern.replace(/HH/,hours2); hours2 = "0" + hours;
pattern=pattern.replace(/H/,hours); }
var minutes=date.getMinutes(); pattern = pattern.replace(/HH/, hours2);
var minutes2=minutes; pattern = pattern.replace(/H/, hours);
var minutesLength=minutes.toString().length; var minutes = date.getMinutes();
if(minutesLength==1){ var minutes2 = minutes;
minutes2="0"+minutes; var minutesLength = minutes.toString().length;
} if (minutesLength == 1) {
pattern=pattern.replace(/mm/,minutes2); minutes2 = "0" + minutes;
pattern=pattern.replace(/m/,minutes); }
var seconds=date.getSeconds(); pattern = pattern.replace(/mm/, minutes2);
var seconds2=seconds; pattern = pattern.replace(/m/, minutes);
var secondsLength=seconds.toString().length; var seconds = date.getSeconds();
if(secondsLength==1){ var seconds2 = seconds;
seconds2="0"+seconds; var secondsLength = seconds.toString().length;
} if (secondsLength == 1) {
pattern=pattern.replace(/ss/,seconds2); seconds2 = "0" + seconds;
pattern=pattern.replace(/s/,seconds); }
var milliSeconds=date.getMilliseconds(); pattern = pattern.replace(/ss/, seconds2);
pattern=pattern.replace(/S+/,milliSeconds); pattern = pattern.replace(/s/, seconds);
var day=date.getDay(); var milliSeconds = date.getMilliseconds();
pattern = pattern.replace(/S+/, milliSeconds);
var day = date.getDay();
// pattern=pattern.replace(/E+/,eval("DateFormat."+DateFormat.language+"_week[day]")); // pattern=pattern.replace(/E+/,eval("DateFormat."+DateFormat.language+"_week[day]"));
if(hours>12){ if (hours > 12) {
pattern=pattern.replace(/a+/,eval("DateFormat."+DateFormat.language+"_am")); pattern = pattern.replace(/a+/, eval("DateFormat." + DateFormat.language + "_am"));
}else{ } else {
pattern=pattern.replace(/a+/,eval("DateFormat."+DateFormat.language+"_pm")); pattern = pattern.replace(/a+/, eval("DateFormat." + DateFormat.language + "_pm"));
} }
var kHours=hours; var kHours = hours;
if(kHours==0){ if (kHours == 0) {
kHours=24; kHours = 24;
} }
var kHours2=kHours; var kHours2 = kHours;
var kHoursLength=kHours.toString().length; var kHoursLength = kHours.toString().length;
if(kHoursLength==1){ if (kHoursLength == 1) {
kHours2="0"+kHours; kHours2 = "0" + kHours;
} }
pattern=pattern.replace(/kk/,kHours2); pattern = pattern.replace(/kk/, kHours2);
pattern=pattern.replace(/k/,kHours); pattern = pattern.replace(/k/, kHours);
var KHours=hours; var KHours = hours;
if(hours>11){ if (hours > 11) {
KHours=hours-12; KHours = hours - 12;
} }
var KHours2=KHours; var KHours2 = KHours;
var KHoursLength=KHours.toString().length; var KHoursLength = KHours.toString().length;
if(KHoursLength==1){ if (KHoursLength == 1) {
KHours2="0"+KHours; KHours2 = "0" + KHours;
} }
pattern=pattern.replace(/KK/,KHours2); pattern = pattern.replace(/KK/, KHours2);
pattern=pattern.replace(/K/,KHours); pattern = pattern.replace(/K/, KHours);
var hHours=KHours; var hHours = KHours;
if(hHours==0){ if (hHours == 0) {
hHours=12; hHours = 12;
} }
var hHours2=hHours; var hHours2 = hHours;
var hHoursLength=hHours.toString().length; var hHoursLength = hHours.toString().length;
if(KHoursLength==1){ if (KHoursLength == 1) {
hHours2="0"+hHours; hHours2 = "0" + hHours;
} }
pattern=pattern.replace(/hh/,hHours2); pattern = pattern.replace(/hh/, hHours2);
pattern=pattern.replace(/h/,hHours); pattern = pattern.replace(/h/, hHours);
return pattern; return pattern;
}; };
function SimpleDateFormat(){ function SimpleDateFormat() {
this.jsjava_class="jsjava.text.SimpleDateFormat"; this.jsjava_class = "jsjava.text.SimpleDateFormat";
} }
SimpleDateFormat.prototype=new DateFormat(); SimpleDateFormat.prototype = new DateFormat();
SimpleDateFormat.prototype.constructor=SimpleDateFormat; SimpleDateFormat.prototype.constructor = SimpleDateFormat;
SimpleDateFormat.prototype.applyPattern=function(pattern){ SimpleDateFormat.prototype.applyPattern = function (pattern) {
this.pattern=pattern; this.pattern = pattern;
}; };
var df=new SimpleDateFormat(); var df = new SimpleDateFormat();
df.applyPattern("yyyy-MM-dd HH:mm:ss"); df.applyPattern("yyyy-MM-dd HH:mm:ss");
</script> </script>
</head> </head>
<body> <body>
...@@ -196,14 +198,30 @@ ...@@ -196,14 +198,30 @@
<br> <br>
<table class='table table-vertical'> <table class='table table-vertical'>
<tr> <tr>
<th style='vertical-align: middle !important;text-align: center;'>省份</th> <th style='vertical-align: middle !important;text-align: center;'>
<th style='vertical-align: middle !important;text-align: center;'>指标名称</th> 省份
<th style='vertical-align: middle !important;text-align: center;'>指标编码</th> </th>
<th style='vertical-align: middle !important;text-align: center;'>类型</th> <th style='vertical-align: middle !important;text-align: center;'>
<th style='vertical-align: middle !important;text-align: center;'>名称</th> 指标名称
<th style='vertical-align: middle !important;text-align: center;'>告警个数</th> </th>
<th style='vertical-align: middle !important;text-align: center;'>异常程度</th> <th style='vertical-align: middle !important;text-align: center;'>
<th style='vertical-align: middle !important;text-align: center;'>指标告警明细</th> 指标编码
</th>
<th style='vertical-align: middle !important;text-align: center;'>
类型
</th>
<th style='vertical-align: middle !important;text-align: center;'>
名称
</th>
<th style='vertical-align: middle !important;text-align: center;'>
告警个数
</th>
<th style='vertical-align: middle !important;text-align: center;'>
异常程度
</th>
<th style='vertical-align: middle !important;text-align: center;'>
指标告警明细
</th>
</tr> </tr>
<c:forEach items="${warningDetailList}" var="item"> <c:forEach items="${warningDetailList}" var="item">
...@@ -222,14 +240,146 @@ ...@@ -222,14 +240,146 @@
<td style='vertical-align: middle !important;text-align: center;'>${item.ASSOCIATION_DESC}</td> <td style='vertical-align: middle !important;text-align: center;'>${item.ASSOCIATION_DESC}</td>
<td style='vertical-align: middle !important;text-align: center;'>${item.WARNING_NUM}</td> <td style='vertical-align: middle !important;text-align: center;'>${item.WARNING_NUM}</td>
<td style='vertical-align: middle !important;text-align: center;'>${item.INFLUENCE_LEVEL}</td> <td style='vertical-align: middle !important;text-align: center;'>${item.INFLUENCE_LEVEL}</td>
<td style='vertical-align: middle !important;text-align: center;'><a <td style='vertical-align: middle !important;text-align: center;'>
<a
<%--href="${ctx}/MonitorOperation/AssociateDiagosisDetailgetDetail?kpiId=${item.KPI_ID}&provinceId=${item.PROVINCE_ID}&beginTime=${beginTime}&endTime=${endTime}"--%> <%--href="${ctx}/MonitorOperation/AssociateDiagosisDetailgetDetail?kpiId=${item.KPI_ID}&provinceId=${item.PROVINCE_ID}&beginTime=${beginTime}&endTime=${endTime}"--%>
onclick="getdetails(this)" name="${item.KPI_ID}_${item.PROVINCE_ID}_${beginTime}_${endTime}">告警明细</a></td> onclick="getdetails(this)"
name="${item.KPI_ID}_${item.PROVINCE_ID}_${beginTime}_${endTime}">告警明细</a>
</td>
</tr> </tr>
</c:forEach> </c:forEach>
</table> </table>
<div class='col-xs-6'>
<div class='panel panel-default'>
<div class='panel-heading'>协查单</div>
<div class='panel-body'>
<table class='table table-hover table-striped'>
<thead>
<tr>
<th style='vertical-align: middle !important;text-align: center;'>
编号
</th>
<th style='vertical-align: middle !important;text-align: center;'>
协查单标题
</th>
<th style='vertical-align: middle !important;text-align: center;'>
开始时间
</th>
<th style='vertical-align: middle !important;text-align: center;'>
结束时间
</th>
</tr>
</thead>
<tfoot>
<tr>
<td style='vertical-align: middle !important;text-align: center;'>
<span id="itemsCount_1"></span>
</td>
<td style='vertical-align: middle !important;text-align: center;'>
<a onclick="nextPage_1()">下一页</a>&nbsp;&nbsp;&nbsp;&nbsp;
<a onclick="prePage_1()">上一页</a>
</td>
<td style='vertical-align: middle !important;text-align: center;'>
<span id="currentPageNum_1"
style="color:#F00"></span>
</td>
<td style='vertical-align: middle !important;text-align: center;'>
<span id="totalPageNum_1"
style="color:#0000ee"></span>
</td>
</tr>
</tfoot>
<tbody id="xcdWorkingOrderInfos_tbody">
<c:if test="${xcdWorkingOrderInfos != null}">
<c:forEach items="${xcdWorkingOrderInfos}" var="item">
<tr>
<td style='vertical-align: middle !important;text-align: center;'>${item.workingOrderCode}</td>
<td style='vertical-align: middle !important;text-align: center;'>${item.workingOrderTitle}</td>
<td style='vertical-align: middle !important;text-align: center;'>
<fmt:formatDate
value="${item.eventHappenTime}"
pattern="yyyy-MM-dd hh:mm:ss"
type="date"
dateStyle="long"/>
</td>
<td style='vertical-align: middle !important;text-align: center;'>
<fmt:formatDate
value="${item.businessRecoveryTime}"
pattern="yyyy-MM-dd hh:mm:ss"
type="date"
dateStyle="long"/></td>
</tr>
</c:forEach>
</c:if>
</tbody>
</table>
</div>
</div>
</div>
<div class='col-xs-6'>
<div class='panel panel-default'>
<div class='panel-heading'>变更单</div>
<div class='panel-body'>
<table class='table table-hover table-striped'>
<thead>
<tr>
<th style='vertical-align: middle !important;text-align: center;'>
编-号
</th>
<th style='vertical-align: middle !important;text-align: center;'>
变更单标题
</th>
<th style='vertical-align: middle !important;text-align: center;'>
开始时间
</th>
<th style='vertical-align: middle !important;text-align: center;'>
结束时间
</th>
</tr>
</thead>
<tfoot>
<tr>
<td style='vertical-align: middle !important;text-align: center;'>
<span id="itemsCount"></span>
</td>
<td style='vertical-align: middle !important;text-align: center;'>
<a onclick="nextPage()">下一页</a>&nbsp;&nbsp;&nbsp;
<a onclick="prePage()">上一页</a>
</td>
<td style='vertical-align: middle !important;text-align: center;'>
<span id="currentPageNum"
style="color:#F00"></span>
</td>
<td style='vertical-align: middle !important;text-align: center;'>
<span id="totalPageNum"
style="color:#0000ee"></span>
</td>
</tr>
</tfoot>
<tbody id="xcdChangeOrdersTable_tobody"
style="height: 450px">
<c:forEach items="${xcdChangeOrders}" var="item">
<tr>
<td style='vertical-align: middle !important;text-align: center;'>${item.changeOrderCode}</td>
<td style='vertical-align: middle !important;text-align: center;'>${item.changeOrderTitle}</td>
<td style='vertical-align: middle !important;text-align: center;'>
<fmt:formatDate value="${item.changeStartTime}"
pattern="yyyy-MM-dd hh:mm:ss"
type="date"
dateStyle="long"/></td>
<td style='vertical-align: middle !important;text-align: center;'>
<fmt:formatDate value="${item.changeEndTime}"
pattern="yyyy-MM-dd hh:mm:ss"
type="date"
dateStyle="long"/></td>
</td>
</tr>
</c:forEach>
</tbody>
</table>
</div>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -240,30 +390,28 @@ ...@@ -240,30 +390,28 @@
</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='${gzfxDetailInfos}'/>
<%-- <input type="hidden" id="listDimKpi" name="listDimKpi" value='${listDimKpi}' />--%><%-- 所有指标--%> <%-- <input type="hidden" id="listDimKpi" name="listDimKpi" value='${listDimKpi}' />--%><%-- 所有指标--%>
<input type="hidden" id="provinceAll" name="provinceAll" value='${provinces}' /> <input type="hidden" id="provinceAll" name="provinceAll" value='${provinces}'/>
<input type="hidden" id="indicatorsAll" name="indicatorsAll" value='${indicatorsAll}' /> <input type="hidden" id="indicatorsAll" name="indicatorsAll" value='${indicatorsAll}'/>
<input type="hidden" id="anaInfoSelected" name="anaInfoSelected" value='' /> <input type="hidden" id="anaInfoSelected" name="anaInfoSelected" value=''/>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<script> <script>
function getdetails(e) {
function getdetails(e){ var params = e.name.split("_");
var kpiId = params[0];
// alert($(e).name); var proviceId = params[1];
var params=e.name.split("_"); var beginTime = params[2];
var kpiId=params[0]; var endTime = params[3];
var proviceId=params[1];
var beginTime=params[2];
var endTime=params[3];
$.dialog({ $.dialog({
title:"", title: "",
content:"<div id='paramList' class='container' >"+ content: "<div id='paramList' class='container' >" +
"<div class='col-xs-12'><div class='panel panel-default'><div class='panel-heading' >指标告警明细</div><div class='panel-body'> <table class='table table-striped table-bordered '> <thead> <tr align='center'> " + "<div class='col-xs-12'><div class='panel panel-default'><div class='panel-heading' >指标告警明细</div><div class='panel-body'> <table class='table table-striped table-bordered '> <thead> <tr align='center'> " +
"<th style='vertical-align: middle !important;text-align: center;'>编号</th>" + "<th style='vertical-align: middle !important;text-align: center;'>编号</th>" +
"<th style='vertical-align: middle !important;text-align: center;'>省份</th> " + "<th style='vertical-align: middle !important;text-align: center;'>省份</th> " +
...@@ -280,87 +428,114 @@ ...@@ -280,87 +428,114 @@
"<th style='vertical-align: middle !important;text-align: center;' >故障单号</th>" + "<th style='vertical-align: middle !important;text-align: center;' >故障单号</th>" +
"<th style='vertical-align: middle !important;text-align: center;' >告警状态</th>" + "<th style='vertical-align: middle !important;text-align: center;' >告警状态</th>" +
"<th style='vertical-align: middle !important;text-align: center;' >关闭类型</th>" + "<th style='vertical-align: middle !important;text-align: center;' >关闭类型</th>" +
"</tr> </thead> <tbody> </tbody> </table> </div> </div> </div>"+ "</tr> </thead> <tbody> </tbody> </table> </div> </div> </div>" +
"</div>", "</div>",
lock:true, lock: true,
width:"1200px", width: "1200px",
height : "600px", height: "600px",
initialize:function(){ initialize: function () {
var paramTbody = $('#paramList tbody'); var paramTbody = $('#paramList tbody');
$.ajax({ $.ajax({
type : 'GET', type: 'GET',
async : false, async: false,
contentType : 'application/json', contentType: 'application/json',
url: "${ctx}/MonitorOperation/AssociateDiagosisDetail/getDetail?kpiId="+kpiId+"&provinceId="+proviceId+"&beginTime="+beginTime+"&endTime="+endTime, url: "${ctx}/MonitorOperation/AssociateDiagosisDetail/getDetail?kpiId=" + kpiId + "&provinceId=" + proviceId + "&beginTime=" + beginTime + "&endTime=" + endTime,
dataType : 'text', dataType: 'text',
success: function(data){ success: function (data) {
var jsonDa=eval('('+data+')'); var jsonDa = eval('(' + data + ')');
// console.log("data "+data);
$.each(jsonDa,function(n,val){
// alert(df.format(val.closeTime));
console.log(" val.closeTime "+val.closeTime);
console.log(" df.format(new Date(val.closeTime)) "+df.format(new Date(val.closeTime)));
console.log(" new Date(val.closeTime)) "+new Date(val.closeTime));
var warningId=val.warningId;
if(typeof warningId === 'undefined'){warningId=''}
var provinceName=val.provinceName;
if(typeof provinceName ==='undefined'){provinceName=''}
var channelName=val.channelName;
if(typeof channelName ==='undefined'){channelName=''}
var dataSourceName=val.dataSourceName;
if(typeof dataSourceName ==='undefined'){dataSourceName=''}
var warningSourceName=val.warningSourceName;
if(typeof warningSourceName ==='undefined'){warningSourceName=''}
var kpiName=val.dataSourceName;
if(typeof kpiName ==='undefined'){kpiName=''}
var riskEarlyWarningTypeName=val.riskEarlyWarningTypeName;
if(typeof riskEarlyWarningTypeName ==='undefined'){riskEarlyWarningTypeName=''}
var occurTime=val.occurTime;
if(typeof occurTime ==='undefined'){occurTime=''}else{ occurTime=df.format(new Date(val.occurTime));}
var influenceEndTime=val.influenceEndTime;
if(typeof influenceEndTime ==='undefined'){influenceEndTime=''}
var closeTime=val.closeTime;
if(typeof closeTime ==='undefined'){closeTime=''}else{closeTime=df.format(new Date(val.closeTime));}
var dataSourceName=val.dataSourceName;
if(typeof dataSourceName ==='undefined'){dataSourceName=''}
var relevantWorkingOrderId= val.relevantWorkingOrderId;
if(typeof relevantWorkingOrderId === 'undefined' ){relevantWorkingOrderId=''}
var relevantFailureId=val.relevantFailureId;
if( typeof relevantFailureId === 'undefined' ){relevantFailureId=''}
var type=val.type;
if( typeof type === 'undefined' ){type=''}
var status=val.status;
if( typeof status === 'undefined' ){status=''}
paramTbody.append($("<tr align='center' ></tr>") $.each(jsonDa, function (n, val) {
.append("<td style='vertical-align: middle !important;text-align: center;' ><a>"+warningId+"</a></td>")
.append("<td style='vertical-align: middle !important;text-align: center;' >"+provinceName+"</td>")
.append("<td style='vertical-align: middle !important;text-align: center;' >"+channelName+"</td>") var warningId = val.warningId;
.append("<td style='vertical-align: middle !important;text-align: center;' >"+dataSourceName+"</td>") if (typeof warningId === 'undefined') {
.append("<td style='vertical-align: middle !important;text-align: center;' >"+warningSourceName+"</td>") warningId = ''
.append("<td style='vertical-align: middle !important;text-align: center;' >"+kpiName+"</td>") }
.append("<td style='vertical-align: middle !important;text-align: center;' >"+riskEarlyWarningTypeName+"</td>") var provinceName = val.provinceName;
.append("<td style='vertical-align: middle !important;text-align: center;' >"+occurTime+"</td>") if (typeof provinceName === 'undefined') {
.append("<td style='vertical-align: middle !important;text-align: center;' >"+influenceEndTime+"</td>") provinceName = ''
.append("<td style='vertical-align: middle !important;text-align: center;' >"+closeTime+"</td>") }
var channelName = val.channelName;
if (typeof channelName === 'undefined') {
channelName = ''
}
var dataSourceName = val.dataSourceName;
if (typeof dataSourceName === 'undefined') {
dataSourceName = ''
}
var warningSourceName = val.warningSourceName;
if (typeof warningSourceName === 'undefined') {
warningSourceName = ''
}
var kpiName = val.dataSourceName;
if (typeof kpiName === 'undefined') {
kpiName = ''
}
var riskEarlyWarningTypeName = val.riskEarlyWarningTypeName;
if (typeof riskEarlyWarningTypeName === 'undefined') {
riskEarlyWarningTypeName = ''
}
var occurTime = val.occurTime;
if (typeof occurTime === 'undefined') {
occurTime = ''
} else {
occurTime = df.format(new Date(val.occurTime));
}
var influenceEndTime = val.influenceEndTime;
if (typeof influenceEndTime === 'undefined') {
influenceEndTime = ''
}
var closeTime = val.closeTime;
if (typeof closeTime === 'undefined') {
closeTime = ''
} else {
closeTime = df.format(new Date(val.closeTime));
}
.append("<td style='vertical-align: middle !important;text-align: center;' >"+relevantWorkingOrderId+"</td>") var dataSourceName = val.dataSourceName;
if (typeof dataSourceName === 'undefined') {
dataSourceName = ''
}
.append("<td style='vertical-align: middle !important;text-align: center;' >"+relevantFailureId+"</td>")
.append("<td style='vertical-align: middle !important;text-align: center;' >"+type+"</td>")
.append("<td style='vertical-align: middle !important;text-align: center;' >"+status+"</td>")
var relevantWorkingOrderId = val.relevantWorkingOrderId;
if (typeof relevantWorkingOrderId === 'undefined') {
relevantWorkingOrderId = ''
}
var relevantFailureId = val.relevantFailureId;
if (typeof relevantFailureId === 'undefined') {
relevantFailureId = ''
}
var type = val.type;
if (typeof type === 'undefined') {
type = ''
}
var status = val.status;
if (typeof status === 'undefined') {
status = ''
}
paramTbody.append($("<tr align='center' ></tr>")
.append("<td style='vertical-align: middle !important;text-align: center;' ><a>" + warningId + "</a></td>")
.append("<td style='vertical-align: middle !important;text-align: center;' >" + provinceName + "</td>")
.append("<td style='vertical-align: middle !important;text-align: center;' >" + channelName + "</td>")
.append("<td style='vertical-align: middle !important;text-align: center;' >" + dataSourceName + "</td>")
.append("<td style='vertical-align: middle !important;text-align: center;' >" + warningSourceName + "</td>")
.append("<td style='vertical-align: middle !important;text-align: center;' >" + kpiName + "</td>")
.append("<td style='vertical-align: middle !important;text-align: center;' >" + riskEarlyWarningTypeName + "</td>")
.append("<td style='vertical-align: middle !important;text-align: center;' >" + occurTime + "</td>")
.append("<td style='vertical-align: middle !important;text-align: center;' >" + influenceEndTime + "</td>")
.append("<td style='vertical-align: middle !important;text-align: center;' >" + closeTime + "</td>")
.append("<td style='vertical-align: middle !important;text-align: center;' >" + relevantWorkingOrderId + "</td>")
.append("<td style='vertical-align: middle !important;text-align: center;' >" + relevantFailureId + "</td>")
.append("<td style='vertical-align: middle !important;text-align: center;' >" + type + "</td>")
.append("<td style='vertical-align: middle !important;text-align: center;' >" + status + "</td>")
); );
}); });
//关闭类型 status //关闭类型 status
...@@ -376,7 +551,190 @@ ...@@ -376,7 +551,190 @@
}); });
} }
</script>
<script>
currentPageNum = 0;//[变更单]当前页
pageCount = 10;//[变更单]table显示条数
pageNum = 0;//[变更单]总页数
itemsCount = 0;//[变更单]总数据量
currentPageNum_1 = 0;//[协查单]当前页
pageCount_1 = 10;//[协查单]table显示条数
pageNum_1 = 0;//[协查单]总页数
itemsCount_1 = 0;//[协查单]总数据量
window.onload = function () {
//变更单
itemsCount = $("#xcdChangeOrdersTable_tobody").find("tr").length;//总数据量
pageNum = getPageNum(itemsCount, pageCount);
$("#itemsCount").html(itemsCount);//显示总数据量
showTotalPageNum();
showFirstPage();
//协查单
itemsCount_1 = $("#xcdWorkingOrderInfos_tbody").find("tr").length;//总数据量
pageNum_1 = getPageNum(itemsCount_1, pageCount_1);
$("#itemsCount_1").html(itemsCount_1);//显示总数据量
showTotalPageNum_1();//显示 总页数
showFirstPage_1();// 显示 第一页 数据
};
function getPageNum(itemsCount, pageCount) {
var pageNum = parseInt(itemsCount / pageCount);
if (0 != itemsCount % pageCount) {
pageNum += 1;
}
return pageNum;
}
function showFirstPage() {
hideRow();
currentPageNum = 1;
showCurrentPageNum(currentPageNum);
for (var i = 1; i <= pageCount; i++) {
var k = i - 1;
$("#xcdChangeOrdersTable_tobody tr:eq(" + k + ")").show();
}
}
//隐藏所有行
function hideRow() {
$("#xcdChangeOrdersTable_tobody").find("tr").each(function () {
this.style.display = 'none';
});
}
//显示当前页数
function showCurrentPageNum(currentPageNum) {
$("#currentPageNum").html(currentPageNum);
}
//显示总页数
function showTotalPageNum() {
$("#totalPageNum").html(pageNum);
}
//显示上一页
function prePage() {
if (currentPageNum === 1) {
return;
}
hideRow();
currentPageNum--;
showCurrentPageNum(currentPageNum);
var firstRow = getFirstRow(currentPageNum);
var lastRow = getLastRow(firstRow);
for (var i = firstRow; i <= lastRow; i++) {
var k = i - 1;
$("#xcdChangeOrdersTable_tobody tr:eq(" + k + ")").show();
}
}
//显示 下一页
function nextPage() {
if (currentPageNum === pageNum) {
return;
}
hideRow();
currentPageNum++;
showCurrentPageNum(currentPageNum);
var firstRow = getFirstRow(currentPageNum);
var lastRow = getLastRow(firstRow);
for (var i = firstRow; i <= lastRow; i++) {
var k = i - 1;
$("#xcdChangeOrdersTable_tobody tr:eq(" + k + ")").show();
}
}
//获取首行的实际位置
function getFirstRow(currentPageNum) {
return (currentPageNum - 1) * pageCount + 1;
}
//获取尾行的实际位置
function getLastRow(firstRow) {
var lastRow = firstRow + pageCount - 1;
if (lastRow > itemsCount) {
lastRow = itemsCount;
}
return lastRow;
}
//协查单 函数
function showTotalPageNum_1() {
$("#totalPageNum_1").html(pageNum_1);
}
function showFirstPage_1() {
hideRow_1();
currentPageNum_1 = 1;
showCurrentPageNum_1(currentPageNum_1);
for (var i = 1; i <= pageCount_1; i++) {
var k = i - 1;
$("#xcdWorkingOrderInfos_tbody tr:eq(" + k + ")").show();
}
}
function hideRow_1() {
$("#xcdWorkingOrderInfos_tbody").find("tr").each(function () {
this.style.display = 'none';
});
}
function showCurrentPageNum_1(currentPageNum_1) {
$("#currentPageNum_1").html(currentPageNum_1);
}
function nextPage_1() {
if (currentPageNum_1 === pageNum_1) {
return;
}
hideRow_1();
currentPageNum_1++;
showCurrentPageNum_1(currentPageNum_1);
var firstRow = getFirstRow_1(currentPageNum_1);
var lastRow = getLastRow_1(firstRow);
for (var i = firstRow; i <= lastRow; i++) {
var k = i - 1;
$("#xcdWorkingOrderInfos_tbody tr:eq(" + k + ")").show();
}
}
function prePage_1() {
if (currentPageNum_1 === 1) {
return;
}
hideRow_1();
currentPageNum_1--;
showCurrentPageNum_1(currentPageNum_1);
var firstRow = getFirstRow_1(currentPageNum_1);
var lastRow = getLastRow_1(firstRow);
for (var i = firstRow; i <= lastRow; i++) {
var k = i - 1;
$("#xcdWorkingOrderInfos_tbody tr:eq(" + k + ")").show();
}
}
function getFirstRow_1(currentPageNum_1) {
return (currentPageNum_1 - 1) * pageCount_1 + 1;
}
function getLastRow_1(firstRow) {
var lastRow = firstRow + pageCount_1 - 1;
if (lastRow > itemsCount_1) {
lastRow = itemsCount_1;
}
return lastRow;
}
</script> </script>
</body> </body>
......
...@@ -242,6 +242,7 @@ th{ ...@@ -242,6 +242,7 @@ th{
dataType : 'text', dataType : 'text',
beforeSend: function(data) {}, beforeSend: function(data) {},
success: function(data) { success: function(data) {
$("#wadt").val(data); $("#wadt").val(data);
warnAnalysisDetailTable(); warnAnalysisDetailTable();
toggleMenu('slidePushMenus2');//隐藏筛选项 toggleMenu('slidePushMenus2');//隐藏筛选项
......
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