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
@Query("select anaInfo from DimAssociationAnaInfo anaInfo where anaInfo.associationId = :associationId ")
public DimAssociationAnaInfo findDimassociationAnaInfoByAssociationId(@Param(value = "associationId") Long associationId);
@Query(value = "SELECT ASSOCIATION_ID AS associationId ,D.PROVINCE_ID as provinceId,ASSOCIATION_TYPE AS associationType ," +
/*@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,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.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)
"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);
@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
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 (" +
" 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" +
......@@ -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%'" +
" 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)
, 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);
......@@ -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(?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)
public Object[] findObjByProvinceIdAndKpiIdAndoccurTimeAndCloseTime(/*@Param(value = "provinceId")*/ Long provinceId,
/*@Param(value = "kpiId")*/ Long kpiId,
/*@Param(value = "occurTime")*/ String occurTime,
/*@Param(value = "closeTime")*/ String closeTime);
public Object[] findObjByProvinceIdAndKpiIdAndoccurTimeAndCloseTime( Long provinceId,
Long kpiId,
String occurTime,
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"
,nativeQuery = true)
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>,
//由集成商Ids得到省份信息
@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);
@Query("select provinceId from Province where provinceName= ?1")
public Long findProvinceIdByProvinceName(String provinceName);
}
......@@ -42,5 +42,14 @@ public interface XcdChangeOrderDao extends JpaSpecificationExecutor<XcdChangeOrd
//根据告警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)
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
List<XcdDetailInfoView> findWorkingOrderIdDistinctByProviderIdInAndDataSourceIdInAndChannelIdInAndProvinceIdInAndWorkingOrderIdIsNullAndRelevantFailureIdIsNullOrderByEventHappenTimeDesc(List<Long> provider,List<Long> datasource,List<Long> channel,List<Long> province);
//根据协查单编号查找协查单,协查单明细展示
List <XcdDetailInfoView> findByWorkingOrderCode(String xcdCode);//加List <XcdDetailInfoView>是为了防止数据有问题,例如一个协查单编号对应几条协查单记录,但是在实际环境中一个协查单编号只对应一条记录
}
......@@ -120,7 +120,16 @@ public interface XcdWorkingOrderInfoDao extends PagingAndSortingRepository<XcdW
@Modifying
@Query(value="delete from XCD_WORKING_ORDER_INFO_T where WORKING_ORDER_ID = ?1",nativeQuery=true)
void deleteByWorkingOrderId(Long xcdId);
@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;
import com.hp.cmsz.entity.AssociateDiagosisDetail;
import com.hp.cmsz.entity.AssociateDiagosisWarningDetail;
import com.hp.cmsz.entity.XcdWarningInfoView;
import com.hp.cmsz.repository.DimAssociationAnaInfoDao;
import com.hp.cmsz.repository.XcdWarningInfoViewDao;
......@@ -17,6 +18,7 @@ import javax.persistence.EntityManagerFactory;
import java.math.BigInteger;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
......@@ -33,30 +35,8 @@ public class AssociateDiagosisDetailService {
@Autowired
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){
Calendar calendar=Calendar.getInstance();
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
......@@ -84,13 +64,54 @@ public class AssociateDiagosisDetailService {
}
}
public List<Object[]> findLastMathAssociateDiagosisDetailByWarnTimeBeginAndEndAndDimesionAndProvinceList(String warnBeginTime, String warnEndTime, char dimension, List<Long> provincelist){
return dimAssociationAnaInfoDao.findLastMathAssociateDiagosisDetailByWarnTimeBeginAndEndAndDimesionAndProvinceList(warnBeginTime, warnEndTime,dimension,provincelist);
public List<AssociateDiagosisDetail> findAssociateDiagosisDetailByWarnTimeBeginAndEnd( String warnBeginTime, String warnEndTime){
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){
......@@ -110,5 +131,55 @@ public class AssociateDiagosisDetailService {
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;
import java.util.*;
import com.hp.cmsz.service.monitoroperation.AssociateDiagosisDetailService;
import sun.org.mozilla.javascript.internal.EcmaError;
import sun.rmi.transport.ObjectTable;
/**
* AssociateDiagosisDetailControllerr 监控运营>告警关联诊>关联诊断明细
*
* @author Molinyi
*
*/
@Controller
@RequestMapping(value = "/MonitorOperation/AssociateDiagosisDetail")
......@@ -83,33 +83,27 @@ public class AssociateDiagosisDetailController {
private AssociateDiagosisDetailService associateDiagosisDetailService;
@Autowired
private XcdWarningInfoViewDao xcdWarningInfoViewDao;
private XcdWarningInfoViewDao xcdWarningInfoViewDao;
@Autowired
private XcdDetailInfoViewDao xcdDetailInfoViewDao;
@Autowired
private XcdChangeOrderDao xcdChangeOrderDao;
/*@Autowired
private XcdWorkingOrderInfoDao xcdWorkingOrderInfoDao;*/
@RequestMapping("")
public String lis(Map model, ServletRequest request, HttpSession session)
throws UnsupportedEncodingException, ParseException {
List<Province> provinceList =(List<Province>) provinceDao.findProvince();
String timestamp1=getLastMonth();//getOld();
String timestamp2=getNow();//getNew();
List<Object[]> diagosisDetailsObj=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);
}
List<Province> provinceList = (List<Province>) provinceDao.findProvince();
String timestamp1 = getLastMonth();//getOld();
String timestamp2 = getNow();//getNew();
List<AssociateDiagosisDetail> associateDiagosisDetails = associateDiagosisDetailService.findAssociateDiagosisDetailByWarnTimeBeginAndEnd(timestamp1, timestamp2);
model.put("provinceList", provinceList);
Gson gson=new Gson();
Gson gson = new Gson();
model.put("diagosisDetails", gson.toJson(associateDiagosisDetails));
return PageURLController.AssociateDiagosisDetail;
}
......@@ -117,296 +111,206 @@ public class AssociateDiagosisDetailController {
@RequestMapping("/tableList")
@ResponseBody
public String tableList(@RequestParam(value = "detailtime",defaultValue = "") String detailtime,
@RequestParam(value = "dimension",defaultValue = "")String dimension,
@RequestParam(value = "detailProvince",defaultValue = "")String detailProvince){
String str="";
if(detailtime.equalsIgnoreCase("")
||dimension.equalsIgnoreCase("")||detailProvince.equalsIgnoreCase("")){
public String tableList(@RequestParam(value = "detailtime", defaultValue = "") String detailtime,
@RequestParam(value = "dimension", defaultValue = "") String dimension,
@RequestParam(value = "detailProvince", defaultValue = "") String detailProvince) {
String str = "";
if (detailtime.equalsIgnoreCase("")
|| dimension.equalsIgnoreCase("") || detailProvince.equalsIgnoreCase("")) {
return str;
}
String[]provinceStr=detailProvince.split(",");
List<Long>provinceList=new ArrayList<Long>();
String[] provinceStr = detailProvince.split(",");
List<Long> provinceList = new ArrayList<Long>();
String[] times = detailtime.split("~");
String warnBeginTime="";
String warnEndTime="";
String warnBeginTime = "";
String warnEndTime = "";
warnBeginTime = times[0];
warnBeginTime.replaceAll("%"," ");
warnBeginTime.replaceAll("%", " ");
warnEndTime = times[1];
warnEndTime.replaceAll("%"," ");
char dimensionc='d';
warnEndTime.replaceAll("%", " ");
char dimensionc = 'd';
try {
for (String s : provinceStr) {
provinceList.add(Long.parseLong(s));
}
dimensionc=dimension.charAt(0);
dimensionc = dimension.charAt(0);
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
format.parse(warnBeginTime);
format.parse(warnEndTime);
}catch (Exception e){
} catch (Exception e) {
e.getMessage();
System.out.println(e.getMessage());
return str;
}
List<Object[]>diagosisDetailsObj=associateDiagosisDetailService.
findLastMathAssociateDiagosisDetailByWarnTimeBeginAndEndAndDimesionAndProvinceList(warnBeginTime,warnEndTime,dimensionc,provinceList);
List<AssociateDiagosisDetail>diagosisDetails=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]);
diagosisDetails.add(detail);
}
Gson gson=new Gson();
System.out.println("gson.toJson(diagosisDetails) "+gson.toJson(diagosisDetails));
List<AssociateDiagosisDetail> diagosisDetails = associateDiagosisDetailService.
findLastMathAssociateDiagosisDetailByWarnTimeBeginAndEndAndDimesionAndProvinceList(warnBeginTime, warnEndTime, dimensionc, provinceList);
Gson gson = new Gson();
return gson.toJson(diagosisDetails);
}
@RequestMapping(value ={"/details"})
// 详情超链接
@RequestMapping(value = {"/details"})
public String details(
@RequestParam(value = "associationId",defaultValue = "") String associationId,
@RequestParam(value = "provinceName",defaultValue = "") String provinceName,
@RequestParam(value = "associationType",defaultValue = "") String associationType,
@RequestParam(value = "associationDesc",defaultValue = "") String associationDesc,
@RequestParam(value = "warningNum",defaultValue = "") String warningNum,
@RequestParam(value = "beginTime",defaultValue = "") String beginTime,
@RequestParam(value = "endTime",defaultValue = "") String endTime,
Map map){
map.put("associationId",associationId);
map.put("beginTime",beginTime);
map.put("endTime",endTime);
map.put("provinceName",provinceName);
map.put("associationType",associationType);
map.put("associationDesc",associationDesc);
map.put("warningNum",warningNum);
List<Object []> WarningDetailList= null;
List<Object []> point = 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);
}
@RequestParam(value = "associationId", defaultValue = "") String associationId,
@RequestParam(value = "provinceName", defaultValue = "") String provinceName,
@RequestParam(value = "associationType", defaultValue = "") String associationType,
@RequestParam(value = "associationDesc", defaultValue = "") String associationDesc,
@RequestParam(value = "warningNum", defaultValue = "") String warningNum,
@RequestParam(value = "beginTime", defaultValue = "") String beginTime,
@RequestParam(value = "endTime", defaultValue = "") String endTime,
Map map) throws Exception {
map.put("associationId", associationId);
map.put("beginTime", beginTime);
map.put("endTime", endTime);
map.put("provinceName", provinceName);
map.put("associationType", associationType);
map.put("associationDesc", associationDesc);
map.put("warningNum", warningNum);
List<Object[]> WarningDetailList = null;
List<Object[]> point = null;
List<Object[]> relation = null;
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;
}
@RequestMapping("/getDetail")
@ResponseBody
public String getDetail(@RequestParam(value = "kpiId", defaultValue = "") String kpiId,
@RequestParam(value = "provinceId", defaultValue = "")String provinceId,
@RequestParam(value = "beginTime", defaultValue = "")String beginTime,
@RequestParam(value = "endTime", defaultValue = "")String endTime){
if("".equalsIgnoreCase(kpiId.trim())||"".equalsIgnoreCase(provinceId.trim())||
"".equalsIgnoreCase(beginTime.trim())||"".equalsIgnoreCase(endTime.trim())){
return "";
}
Long kpiIdl=null;
Long proviceIdl=null;
Date beginTimeD=null;
Date endTimeD=null;
try{
kpiIdl=Long.parseLong(kpiId.trim());
proviceIdl=Long.parseLong(provinceId.trim());
beginTimeD=strToDate(beginTime.trim());
endTimeD=strToDate(endTime.trim());
}catch (Exception e){
e.printStackTrace();
return "";
}
List<XcdWarningInfoView> list =associateDiagosisDetailService.
findXcdWarningInfoViewByKpiIdAndProvinceIdandBeginToEndTime(kpiIdl,proviceIdl,beginTimeD,endTimeD);
Gson gson=new Gson();
System.out.println(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();
public String getDetail(@RequestParam(value = "kpiId", defaultValue = "") String kpiId,
@RequestParam(value = "provinceId", defaultValue = "") String provinceId,
@RequestParam(value = "beginTime", defaultValue = "") String beginTime,
@RequestParam(value = "endTime", defaultValue = "") String endTime) {
if ("".equalsIgnoreCase(kpiId.trim()) || "".equalsIgnoreCase(provinceId.trim()) ||
"".equalsIgnoreCase(beginTime.trim()) || "".equalsIgnoreCase(endTime.trim())) {
return "";
}
Long kpiIdl = null;
Long proviceIdl = null;
Date beginTimeD = null;
Date endTimeD = null;
try {
d=sdf.parse(str);
}catch (Exception e){
throw new Exception("日期格式不对");
kpiIdl = Long.parseLong(kpiId.trim());
proviceIdl = Long.parseLong(provinceId.trim());
beginTimeD = strToDate(beginTime.trim());
endTimeD = strToDate(endTime.trim());
} catch (Exception e) {
e.printStackTrace();
return "";
}
return d;
List<XcdWarningInfoView> list = associateDiagosisDetailService.
findXcdWarningInfoViewByKpiIdAndProvinceIdandBeginToEndTime(kpiIdl, proviceIdl, beginTimeD, endTimeD);
Gson gson = new Gson();
return gson.toJson(list);
}
@RequestMapping("/createDiagosis")
public String createDiagosis() {
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());
}
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;
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();
private static void changeTimestampStyle(List<AssociateDiagosisDetail> diagosisDetails){
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));
model.put("provinceList", provinceList);
long timeWarnEndTimel=diagosisDetails.get(i).getWarnEndTime().getTime();
date.setTime(timeWarnEndTimel);
diagosisDetails.get(i).setWarnEndTime(Timestamp.valueOf(df.format(date)));
}
}
//把关联诊断明细统计列表导出为Excel格式
@RequestMapping(value = "/upLoadGzfxDetailExcel", method = RequestMethod.POST)
public void getFailuresExcel(HttpServletRequest request, HttpServletResponse response, HttpSession session, ModelMap model) throws Exception{
List<XcdWarningInfoView> list = xcdWarningInfoViewDao.findByWarningId(warningId);
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date =new Date();
String fileName = "关联诊断明细列表"+format.format(date);
try{
fileName = new String(fileName.getBytes("gb2312"), "ISO-8859-1");
}catch(UnsupportedEncodingException e1){
e1.printStackTrace();
}
//创建工作薄
HSSFWorkbook wb = new HSSFWorkbook();
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);
}
//创建单元格样式
HSSFCellStyle cellStyle = wb.createCellStyle();
//指定单元格居中对齐
cellStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);
//指定单元格垂直居中对齐
cellStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
//指定当单元格内容显示不下时自动换行
cellStyle.setWrapText(true);
//设置单元格字体
HSSFFont font = wb.createFont();
font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
font.setFontName("宋体");
font.setFontHeight((short) 220);
cellStyle.setFont(font);
//创建报表头部
exportExcel.createNormalHead("关联诊断明细列表", number - 1);
String occurTimes = "";
String closeTimes = "";
if (list == null || list.size() < 1) {
return PageURLController.AssociateDiagosisDetail;
} else {
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);
//创建第二行
HSSFRow row2 = sheet.createRow(1);
occurTime = calendar.getTime();
occurTimes = format.format(calendar.getTime());
}
//设置行高
row2.setHeight((short) 500);
if (closeTime == null) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(view.getOccurTime());
calendar.set(Calendar.HOUR, calendar.get(Calendar.HOUR) + 2);
closeTimes = format.format(calendar.getTime());
} else {
closeTimes = format.format(closeTime);
}
// AssociateDiagosisDetail detail=associateDiagosisDetailService.findObjByProvinceIdAndKpiIdAndoccurTimeAndCloseTime(provinceId,kpiId,occurTimes,closeTimes);
List<AssociateDiagosisDetail> list1 = new ArrayList();
/*if(detail !=null){
list1.add(detail);
}*/
list1 = associateDiagosisDetailService.findDetailByProvinceIdAndoccurTimeAndCloseTime(provinceId, occurTimes, closeTimes);
Gson gson = new Gson();
model.put("diagosisDetails", gson.toJson(list1));
return PageURLController.AssociateDiagosisDetail;
}
//单元格
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>类型
public List<Long> changeStringToList(String str){
public List<Long> changeStringToList(String str) {
List<Long> list = new ArrayList<Long>();
for(int i=0;i<str.split(",").length;i++){
if(!str.split(",")[i].equals("")){
for (int i = 0; i < str.split(",").length; i++) {
if (!str.split(",")[i].equals("")) {
list.add(Long.parseLong(str.split(",")[i]));
}
......@@ -414,64 +318,61 @@ public class AssociateDiagosisDetailController {
return list;
}
@RequestMapping("/createDiagosis")
public String createDiagosis(){
private static void changeTimestampStyle(List<AssociateDiagosisDetail> diagosisDetails) {
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);
List <XcdWarningInfoView> list=xcdWarningInfoViewDao.findByWarningId(warningId);
SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String occurTimes="";
String closeTimes="";
if(list==null||list.size()<1){
return PageURLController.AssociateDiagosisDetail;
}else {
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);
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
occurTime=calendar.getTime();
occurTimes=format.format(calendar.getTime());
}
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));
if(closeTime == null){
Calendar calendar=Calendar.getInstance();
calendar.setTime(view.getOccurTime());
calendar.set(Calendar.HOUR,calendar.get(Calendar.HOUR)+2);
closeTimes=format.format(calendar.getTime());
}else{
closeTimes=format.format(closeTime);
}
AssociateDiagosisDetail detail=associateDiagosisDetailService.findObjByProvinceIdAndKpiIdAndoccurTimeAndCloseTime(provinceId,kpiId,occurTimes,closeTimes);
List<AssociateDiagosisDetail> list1=new ArrayList();
if(detail !=null){
list1.add(detail);
}
Gson gson=new Gson();
model.put("diagosisDetails", gson.toJson(list1));
return PageURLController.AssociateDiagosisDetail;
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());
}
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;
}
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 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;
}
public static void getNewDate(Date date,int minutes){
date.setTime(date.getTime()+minutes*60000);
}
}
......@@ -24,7 +24,7 @@
<label for="">关联维度:</label>
<select name="xcdStatus" id="xcdStatusSelect" class="slide-menu-select" onChange="judge=false;">
<option value="c">业务</option>
<option value="q" selected>渠道</option>
<option value="y" selected>渠道</option>
<%--<c:forEach var="workingOrderStatus" items="${workingOrderStatusList}">
<option value="${workingOrderStatus}" id="xcdStatus">
${workingOrderStatus}
......
......@@ -10,6 +10,8 @@
<%@ 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" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<html>
<head>
......@@ -26,127 +28,127 @@
<script>
//格式化日期
function Format(){
this.jsjava_class="jsjava.text.Format";
function 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.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.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_month4=["Janu","Febr","Marc","Apri","May","Juhn","July","Augu","Sept","Octo","Nove","Dece"];
DateFormat.en_us_month3=["Jan","Feb","Mar","Apr","May","Juh","Jul","Aug","Sep","Oct","Nov","Dec"];
DateFormat.en_us_month2=["01","02","03","04","05","06","07","08","09","10","11","12"];
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.zh_cn_am="\u4e0b\u5348";
DateFormat.zh_cn_pm="\u4e0a\u5348";
DateFormat.language=(navigator.userLanguage==undefined?navigator.language:navigator.userLanguage).replace("-","_").toLowerCase();
DateFormat.prototype.format=function(date){
var year4=date.getFullYear();
var year2=year4.toString().substring(2);
var pattern=this.pattern;
pattern=pattern.replace(/yyyy/,year4);
pattern=pattern.replace(/yy/,year2);
var month=date.getMonth();
pattern=pattern.replace(/MMMM/,eval("DateFormat."+DateFormat.language+"_month4[month]"));
pattern=pattern.replace(/MMM/,eval("DateFormat."+DateFormat.language+"_month3[month]"));
pattern=pattern.replace(/MM/,eval("DateFormat."+DateFormat.language+"_month2[month]"));
var dayOfMonth=date.getDate();
var dayOfMonth2=dayOfMonth;
var dayOfMonthLength=dayOfMonth.toString().length;
if(dayOfMonthLength==1){
dayOfMonth2="0"+dayOfMonth;
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.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.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_month4 = ["Janu", "Febr", "Marc", "Apri", "May", "Juhn", "July", "Augu", "Sept", "Octo", "Nove", "Dece"];
DateFormat.en_us_month3 = ["Jan", "Feb", "Mar", "Apr", "May", "Juh", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
DateFormat.en_us_month2 = ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"];
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.zh_cn_am = "\u4e0b\u5348";
DateFormat.zh_cn_pm = "\u4e0a\u5348";
DateFormat.language = (navigator.userLanguage == undefined ? navigator.language : navigator.userLanguage).replace("-", "_").toLowerCase();
DateFormat.prototype.format = function (date) {
var year4 = date.getFullYear();
var year2 = year4.toString().substring(2);
var pattern = this.pattern;
pattern = pattern.replace(/yyyy/, year4);
pattern = pattern.replace(/yy/, year2);
var month = date.getMonth();
pattern = pattern.replace(/MMMM/, eval("DateFormat." + DateFormat.language + "_month4[month]"));
pattern = pattern.replace(/MMM/, eval("DateFormat." + DateFormat.language + "_month3[month]"));
pattern = pattern.replace(/MM/, eval("DateFormat." + DateFormat.language + "_month2[month]"));
var dayOfMonth = date.getDate();
var dayOfMonth2 = dayOfMonth;
var dayOfMonthLength = dayOfMonth.toString().length;
if (dayOfMonthLength == 1) {
dayOfMonth2 = "0" + dayOfMonth;
}
pattern=pattern.replace(/dd/,dayOfMonth2);
pattern=pattern.replace(/d/,dayOfMonth);
var hours=date.getHours();
var hours2=hours;
var hoursLength=hours.toString().length;
if(hoursLength==1){
hours2="0"+hours;
pattern = pattern.replace(/dd/, dayOfMonth2);
pattern = pattern.replace(/d/, dayOfMonth);
var hours = date.getHours();
var hours2 = hours;
var hoursLength = hours.toString().length;
if (hoursLength == 1) {
hours2 = "0" + hours;
}
pattern=pattern.replace(/HH/,hours2);
pattern=pattern.replace(/H/,hours);
var minutes=date.getMinutes();
var minutes2=minutes;
var minutesLength=minutes.toString().length;
if(minutesLength==1){
minutes2="0"+minutes;
pattern = pattern.replace(/HH/, hours2);
pattern = pattern.replace(/H/, hours);
var minutes = date.getMinutes();
var minutes2 = minutes;
var minutesLength = minutes.toString().length;
if (minutesLength == 1) {
minutes2 = "0" + minutes;
}
pattern=pattern.replace(/mm/,minutes2);
pattern=pattern.replace(/m/,minutes);
var seconds=date.getSeconds();
var seconds2=seconds;
var secondsLength=seconds.toString().length;
if(secondsLength==1){
seconds2="0"+seconds;
pattern = pattern.replace(/mm/, minutes2);
pattern = pattern.replace(/m/, minutes);
var seconds = date.getSeconds();
var seconds2 = seconds;
var secondsLength = seconds.toString().length;
if (secondsLength == 1) {
seconds2 = "0" + seconds;
}
pattern=pattern.replace(/ss/,seconds2);
pattern=pattern.replace(/s/,seconds);
var milliSeconds=date.getMilliseconds();
pattern=pattern.replace(/S+/,milliSeconds);
var day=date.getDay();
pattern = pattern.replace(/ss/, seconds2);
pattern = pattern.replace(/s/, seconds);
var milliSeconds = date.getMilliseconds();
pattern = pattern.replace(/S+/, milliSeconds);
var day = date.getDay();
// pattern=pattern.replace(/E+/,eval("DateFormat."+DateFormat.language+"_week[day]"));
if(hours>12){
pattern=pattern.replace(/a+/,eval("DateFormat."+DateFormat.language+"_am"));
}else{
pattern=pattern.replace(/a+/,eval("DateFormat."+DateFormat.language+"_pm"));
if (hours > 12) {
pattern = pattern.replace(/a+/, eval("DateFormat." + DateFormat.language + "_am"));
} else {
pattern = pattern.replace(/a+/, eval("DateFormat." + DateFormat.language + "_pm"));
}
var kHours=hours;
if(kHours==0){
kHours=24;
var kHours = hours;
if (kHours == 0) {
kHours = 24;
}
var kHours2=kHours;
var kHoursLength=kHours.toString().length;
if(kHoursLength==1){
kHours2="0"+kHours;
var kHours2 = kHours;
var kHoursLength = kHours.toString().length;
if (kHoursLength == 1) {
kHours2 = "0" + kHours;
}
pattern=pattern.replace(/kk/,kHours2);
pattern=pattern.replace(/k/,kHours);
var KHours=hours;
if(hours>11){
KHours=hours-12;
pattern = pattern.replace(/kk/, kHours2);
pattern = pattern.replace(/k/, kHours);
var KHours = hours;
if (hours > 11) {
KHours = hours - 12;
}
var KHours2=KHours;
var KHoursLength=KHours.toString().length;
if(KHoursLength==1){
KHours2="0"+KHours;
var KHours2 = KHours;
var KHoursLength = KHours.toString().length;
if (KHoursLength == 1) {
KHours2 = "0" + KHours;
}
pattern=pattern.replace(/KK/,KHours2);
pattern=pattern.replace(/K/,KHours);
var hHours=KHours;
if(hHours==0){
hHours=12;
pattern = pattern.replace(/KK/, KHours2);
pattern = pattern.replace(/K/, KHours);
var hHours = KHours;
if (hHours == 0) {
hHours = 12;
}
var hHours2=hHours;
var hHoursLength=hHours.toString().length;
if(KHoursLength==1){
hHours2="0"+hHours;
var hHours2 = hHours;
var hHoursLength = hHours.toString().length;
if (KHoursLength == 1) {
hHours2 = "0" + hHours;
}
pattern=pattern.replace(/hh/,hHours2);
pattern=pattern.replace(/h/,hHours);
pattern = pattern.replace(/hh/, hHours2);
pattern = pattern.replace(/h/, hHours);
return pattern;
};
function SimpleDateFormat(){
this.jsjava_class="jsjava.text.SimpleDateFormat";
function SimpleDateFormat() {
this.jsjava_class = "jsjava.text.SimpleDateFormat";
}
SimpleDateFormat.prototype=new DateFormat();
SimpleDateFormat.prototype.constructor=SimpleDateFormat;
SimpleDateFormat.prototype = new DateFormat();
SimpleDateFormat.prototype.constructor = SimpleDateFormat;
SimpleDateFormat.prototype.applyPattern=function(pattern){
this.pattern=pattern;
SimpleDateFormat.prototype.applyPattern = function (pattern) {
this.pattern = pattern;
};
var df=new SimpleDateFormat();
var df = new SimpleDateFormat();
df.applyPattern("yyyy-MM-dd HH:mm:ss");
</script>
</head>
<body>
......@@ -196,14 +198,30 @@
<br>
<table class='table table-vertical'>
<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>
<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>
<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>
<c:forEach items="${warningDetailList}" var="item">
......@@ -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.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;'><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}"--%>
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>
</c:forEach>
</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>
......@@ -240,30 +390,28 @@
</div>
<form action="#" method="get" id="listForm"></form>
<input type="hidden" id="gzfxDetail" name="gzfxDetail" value='${gzfxDetailInfos}' />
<input type="hidden" id="gzfxDetail" name="gzfxDetail" value='${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='' />
<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>
<script>
function getdetails(e) {
function getdetails(e){
// alert($(e).name);
var params=e.name.split("_");
var kpiId=params[0];
var proviceId=params[1];
var beginTime=params[2];
var endTime=params[3];
var params = e.name.split("_");
var kpiId = params[0];
var proviceId = params[1];
var beginTime = params[2];
var endTime = params[3];
$.dialog({
title:"",
content:"<div id='paramList' class='container' >"+
title: "",
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'> " +
"<th style='vertical-align: middle !important;text-align: center;'>编号</th>" +
"<th style='vertical-align: middle !important;text-align: center;'>省份</th> " +
......@@ -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>" +
"</tr> </thead> <tbody> </tbody> </table> </div> </div> </div>"+
"</tr> </thead> <tbody> </tbody> </table> </div> </div> </div>" +
"</div>",
lock:true,
width:"1200px",
height : "600px",
initialize:function(){
lock: true,
width: "1200px",
height: "600px",
initialize: function () {
var paramTbody = $('#paramList tbody');
$.ajax({
type : 'GET',
async : false,
contentType : 'application/json',
url: "${ctx}/MonitorOperation/AssociateDiagosisDetail/getDetail?kpiId="+kpiId+"&provinceId="+proviceId+"&beginTime="+beginTime+"&endTime="+endTime,
dataType : 'text',
success: function(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=''}
type: 'GET',
async: false,
contentType: 'application/json',
url: "${ctx}/MonitorOperation/AssociateDiagosisDetail/getDetail?kpiId=" + kpiId + "&provinceId=" + proviceId + "&beginTime=" + beginTime + "&endTime=" + endTime,
dataType: 'text',
success: function (data) {
var jsonDa = eval('(' + data + ')');
$.each(jsonDa, function (n, val) {
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>")
.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>")
.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
......@@ -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>
</body>
......
......@@ -242,6 +242,7 @@ th{
dataType : 'text',
beforeSend: function(data) {},
success: function(data) {
$("#wadt").val(data);
warnAnalysisDetailTable();
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