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

关联配置明细

parent a91dc695
package com.hp.cmsz.entity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.Timestamp;
/**
*
*
* 组装 类 关联诊断结果查询 用
*/
public class AssociateDetail implements Serializable {
private BigInteger associationId;
private BigInteger provinceId;
private char associationType;
private String associationDesc;
private String provinceName;
private Timestamp warnBeginTime;
private Timestamp warnEndTime;
private String kpiCode;
private String kpiName;
private BigInteger kpiId;
private BigDecimal kpiWeight;
private BigInteger kpiNum;
private String influenceLevel;
public BigInteger getAssociationId() {
return associationId;
}
public void setAssociationId(BigInteger associationId) {
this.associationId = associationId;
}
public BigInteger getProvinceId() {
return provinceId;
}
public void setProvinceId(BigInteger provinceId) {
this.provinceId = provinceId;
}
public char getAssociationType() {
return associationType;
}
public void setAssociationType(char associationType) {
this.associationType = associationType;
}
public String getAssociationDesc() {
return associationDesc;
}
public void setAssociationDesc(String associationDesc) {
this.associationDesc = associationDesc;
}
public String getProvinceName() {
return provinceName;
}
public void setProvinceName(String provinceName) {
this.provinceName = provinceName;
}
public Timestamp getWarnBeginTime() {
return warnBeginTime;
}
public void setWarnBeginTime(Timestamp warnBeginTime) {
this.warnBeginTime = warnBeginTime;
}
public Timestamp getWarnEndTime() {
return warnEndTime;
}
public void setWarnEndTime(Timestamp warnEndTime) {
this.warnEndTime = warnEndTime;
}
public String getKpiCode() {
return kpiCode;
}
public void setKpiCode(String kpiCode) {
this.kpiCode = kpiCode;
}
public String getKpiName() {
return kpiName;
}
public void setKpiName(String kpiName) {
this.kpiName = kpiName;
}
public BigInteger getKpiId() {
return kpiId;
}
public void setKpiId(BigInteger kpiId) {
this.kpiId = kpiId;
}
public BigDecimal getKpiWeight() {
return kpiWeight;
}
public void setKpiWeight(BigDecimal kpiWeight) {
this.kpiWeight = kpiWeight;
}
public BigInteger getKpiNum() {
return kpiNum;
}
public void setKpiNum(BigInteger kpiNum) {
this.kpiNum = kpiNum;
}
public String getInfluenceLevel() {
return influenceLevel;
}
public void setInfluenceLevel(String influenceLevel) {
this.influenceLevel = influenceLevel;
}
}
......@@ -11,6 +11,37 @@ import java.util.List;
* @author Molinyi
*
*/
/*
@NamedNativeQueries({
@NamedNativeQuery(
name = "ReturnVariationInfoWithFullScalarType",
query = "SELECT ASSOCIATION_ID AS associationId ,D.PROVINCE_ID as provinceId,ASSOCIATION_TYPE AS associationType ," +
"ASSOCIATION_DESC AS associationDesc,PROVINCE_NAME AS provinceName,WARNING_BEGIN_TIME AS warningBeginTime," +
"WARNING_END_TIME as warningEndTime,COUNT(E.KPI_ID)AS warningNum FROM " +
"( SELECT A.ASSOCIATION_ID,A.PROVINCE_ID,A.ASSOCIATION_DESC,A.ASSOCIATION_TYPE,B.KPI_ID,C.PROVINCE_NAME,TO_TIMESTAMP(?1,'YYYY-MM-DD HH24:MI:SS') AS WARNING_BEGIN_TIME, " +
"TO_TIMESTAMP(?2,'YYYY-MM-DD HH24:MI:SS') AS WARNING_END_TIME FROM CCOLAP.DIM_ASSOCIATION_ANALYSIS_INFO_T A INNER JOIN CCOLAP.DIM_KPI_ASSOCIATION_RELATED_INFO_T B ON A.ASSOCIATION_ID=B.ASSOCIATION_ID" +
" INNER JOIN CCOLAP.DIM_PROVINCE_INFO_T C ON C.PROVINCE_ID= A.PROVINCE_ID) D LEFT JOIN CCOLAP.GJFX_WARNING_INFO_T E ON D.PROVINCE_ID=E.PROVINCE_ID AND D.KPI_ID =E.KPI_ID AND WARNING_ID LIKE 'J%' WHERE " +
"OCCUR_TIME >=TO_TIMESTAMP(?1,'YYYY-MM-DD HH24:MI:SS') AND OCCUR_TIME <=TO_TIMESTAMP(?2,'YYYY-MM-DD HH24:MI:SS') " +
"GROUP BY ASSOCIATION_ID,D.PROVINCE_ID,ASSOCIATION_TYPE ,ASSOCIATION_DESC,PROVINCE_NAME,WARNING_BEGIN_TIME,WARNING_END_TIME",
resultSetMapping = "ReturnVariationInfoWithFullScalarType"
)
})
@SqlResultSetMappings(
@SqlResultSetMapping(
name = "ReturnVariationInfoWithFullScalarType",
entities = {},
columns = {
@ColumnResult(name = "associationId"),
@ColumnResult(name = "provinceId"),
@ColumnResult(name = "associationType"),
@ColumnResult(name = "provinceName"),
@ColumnResult(name = "warningBeginTime"),
@ColumnResult(name = "warningEndTime"),
@ColumnResult(name = "warningNum")
}
)
)*/
@Entity
@Table(name = "DIM_ASSOCIATION_ANALYSIS_INFO_T",schema = "CCOLAP")
public class DimAssociationAnaInfo implements Serializable {
......
......@@ -7,6 +7,9 @@ import org.springframework.data.repository.PagingAndSortingRepository;
import com.hp.cmsz.entity.DimAssociationAnaInfo;
import org.springframework.data.repository.query.Param;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import java.sql.Timestamp;
import java.util.List;
public interface DimAssociationAnaInfoDao extends JpaSpecificationExecutor<DimAssociationAnaInfo>,
......@@ -35,4 +38,69 @@ public interface DimAssociationAnaInfoDao extends JpaSpecificationExecutor<DimAs
@Query("select anaInfo from DimAssociationAnaInfo anaInfo where anaInfo.associationId = :associationId ")
public DimAssociationAnaInfo findDimassociationAnaInfoByAssociationId(@Param(value = "associationId")Long associationId );
@Query(value = "SELECT ASSOCIATION_ID AS associationId ,D.PROVINCE_ID as provinceId,ASSOCIATION_TYPE AS associationType ," +
"ASSOCIATION_DESC AS associationDesc,PROVINCE_NAME AS provinceName,WARNING_BEGIN_TIME AS warningBeginTime," +
"WARNING_END_TIME as warningEndTime,COUNT(E.KPI_ID)AS warningNum FROM " +
"( SELECT A.ASSOCIATION_ID,A.PROVINCE_ID,A.ASSOCIATION_DESC,A.ASSOCIATION_TYPE,B.KPI_ID,C.PROVINCE_NAME,TO_TIMESTAMP(?1,'YYYY-MM-DD HH24:MI:SS') AS WARNING_BEGIN_TIME, " +
"TO_TIMESTAMP(?2,'YYYY-MM-DD HH24:MI:SS') AS WARNING_END_TIME FROM CCOLAP.DIM_ASSOCIATION_ANALYSIS_INFO_T A INNER JOIN CCOLAP.DIM_KPI_ASSOCIATION_RELATED_INFO_T B ON A.ASSOCIATION_ID=B.ASSOCIATION_ID" +
" INNER JOIN CCOLAP.DIM_PROVINCE_INFO_T C ON C.PROVINCE_ID= A.PROVINCE_ID) D LEFT JOIN CCOLAP.GJFX_WARNING_INFO_T E ON D.PROVINCE_ID=E.PROVINCE_ID AND D.KPI_ID =E.KPI_ID AND WARNING_ID LIKE 'J%' WHERE " +
"OCCUR_TIME >=TO_TIMESTAMP(?1,'YYYY-MM-DD HH24:MI:SS') AND OCCUR_TIME <=TO_TIMESTAMP(?2,'YYYY-MM-DD HH24:MI:SS') " +
"GROUP BY ASSOCIATION_ID,D.PROVINCE_ID,ASSOCIATION_TYPE ,ASSOCIATION_DESC,PROVINCE_NAME,WARNING_BEGIN_TIME,WARNING_END_TIME",nativeQuery = true)
public List<Object[]> findAssociateDiagosisDetailByWarnTimeBeginAndEnd( String warnBeginTime,String warnEndTime);
@Query(value = "SELECT ASSOCIATION_ID AS associationId ,D.PROVINCE_ID as provinceId,ASSOCIATION_TYPE AS associationType ," +
"ASSOCIATION_DESC AS associationDesc,PROVINCE_NAME AS provinceName,WARNING_BEGIN_TIME AS warningBeginTime," +
"WARNING_END_TIME as warningEndTime,COUNT(E.KPI_ID)AS warningNum FROM " +
"( SELECT A.ASSOCIATION_ID,A.PROVINCE_ID,A.ASSOCIATION_DESC,A.ASSOCIATION_TYPE,B.KPI_ID,C.PROVINCE_NAME,TO_TIMESTAMP(?1,'YYYY-MM-DD HH24:MI:SS') AS WARNING_BEGIN_TIME, " +
"TO_TIMESTAMP(?2,'YYYY-MM-DD HH24:MI:SS') AS WARNING_END_TIME FROM CCOLAP.DIM_ASSOCIATION_ANALYSIS_INFO_T A INNER JOIN CCOLAP.DIM_KPI_ASSOCIATION_RELATED_INFO_T B ON A.ASSOCIATION_ID=B.ASSOCIATION_ID" +
" INNER JOIN CCOLAP.DIM_PROVINCE_INFO_T C ON C.PROVINCE_ID= A.PROVINCE_ID) D LEFT JOIN CCOLAP.GJFX_WARNING_INFO_T E ON D.PROVINCE_ID=E.PROVINCE_ID AND D.KPI_ID =E.KPI_ID AND WARNING_ID LIKE 'J%' WHERE " +
"OCCUR_TIME >=TO_TIMESTAMP(?1,'YYYY-MM-DD HH24:MI:SS') AND OCCUR_TIME <=TO_TIMESTAMP(?2,'YYYY-MM-DD HH24:MI:SS') " +
"GROUP BY ASSOCIATION_ID,D.PROVINCE_ID,ASSOCIATION_TYPE ,ASSOCIATION_DESC,PROVINCE_NAME,WARNING_BEGIN_TIME,WARNING_END_TIME",nativeQuery = true)
public List<Object[]> findLastMathAssociateDiagosisDetailByWarnTimeBegin( String warnBeginTime, String warnEndTime);
/*@Query(value = "SELECT ASSOCIATION_ID AS associationId ,D.PROVINCE_ID as provinceId,ASSOCIATION_TYPE AS associationType ," +
"ASSOCIATION_DESC AS associationDesc,PROVINCE_NAME AS provinceName,WARNING_BEGIN_TIME AS warningBeginTime," +
"WARNING_END_TIME as warningEndTime,COUNT(E.KPI_ID)AS warningNum FROM " +
"( SELECT A.ASSOCIATION_ID,A.PROVINCE_ID,A.ASSOCIATION_DESC,A.ASSOCIATION_TYPE,B.KPI_ID,C.PROVINCE_NAME,TO_TIMESTAMP(?1,'YYYY-MM-DD HH24:MI:SS') AS WARNING_BEGIN_TIME, " +
"TO_TIMESTAMP(?2,'YYYY-MM-DD HH24:MI:SS') AS WARNING_END_TIME FROM CCOLAP.DIM_ASSOCIATION_ANALYSIS_INFO_T A INNER JOIN CCOLAP.DIM_KPI_ASSOCIATION_RELATED_INFO_T B ON A.ASSOCIATION_ID=B.ASSOCIATION_ID" +
" INNER JOIN CCOLAP.DIM_PROVINCE_INFO_T C ON C.PROVINCE_ID= A.PROVINCE_ID) D LEFT JOIN CCOLAP.GJFX_WARNING_INFO_T E ON D.PROVINCE_ID=E.PROVINCE_ID AND D.KPI_ID =E.KPI_ID AND WARNING_ID LIKE 'J%' WHERE " +
"OCCUR_TIME >=TO_TIMESTAMP(?1,'YYYY-MM-DD HH24:MI:SS') AND OCCUR_TIME <=TO_TIMESTAMP(?2,'YYYY-MM-DD HH24:MI:SS') " +
"AND A.ASSOCIATION_TYPE = ?3 "+
"AND D.PROVINCE_ID in (?4)"+
"GROUP BY ASSOCIATION_ID,D.PROVINCE_ID,ASSOCIATION_TYPE ,ASSOCIATION_DESC,PROVINCE_NAME,WARNING_BEGIN_TIME,WARNING_END_TIME",nativeQuery = true)*/
@Query(value = "SELECT ASSOCIATION_ID, D.PROVINCE_ID, ASSOCIATION_TYPE ,ASSOCIATION_DESC, PROVINCE_NAME, WARNING_BEGIN_TIME, WARNING_END_TIME," +
" COUNT(E.KPI_ID) AS WARNING_NUM FROM (" +
" SELECT A.ASSOCIATION_ID,A.PROVINCE_ID, A.ASSOCIATION_DESC, A.ASSOCIATION_TYPE, B.KPI_ID, C.PROVINCE_NAME, TO_TIMESTAMP(?1,'YYYY-MM-DD HH24:MI:SS') AS WARNING_BEGIN_TIME," +
" TO_TIMESTAMP(?2,'YYYY-MM-DD HH24:MI:SS') AS WARNING_END_TIME" +
" FROM CCOLAP.DIM_ASSOCIATION_ANALYSIS_INFO_T A INNER JOIN DIM_KPI_ASSOCIATION_RELATED_INFO_T B"+
" ON A.ASSOCIATION_ID=B.ASSOCIATION_ID INNER JOIN DIM_PROVINCE_INFO_T C ON C.PROVINCE_ID= A.PROVINCE_ID) D"+
" LEFT JOIN GJFX_WARNING_INFO_T E" +
" ON D.PROVINCE_ID = E.PROVINCE_ID AND D.KPI_ID =E.KPI_ID AND WARNING_ID LIKE 'J%'" +
" and OCCUR_TIME >= TO_TIMESTAMP(?1,'YYYY-MM-DD HH24:MI:SS')" +
" AND OCCUR_TIME <=TO_TIMESTAMP(?2,'YYYY-MM-DD HH24:MI:SS') WHERE ASSOCIATION_TYPE = ?3 and D.PROVINCE_ID in (?4) GROUP BY ASSOCIATION_ID,D.PROVINCE_ID, ASSOCIATION_TYPE ,ASSOCIATION_DESC,PROVINCE_NAME, WARNING_BEGIN_TIME, WARNING_END_TIME"
,nativeQuery = true)
public List<Object[]> findLastMathAssociateDiagosisDetailByWarnTimeBeginAndEndAndDimesionAndProvinceList(String warnBeginTime, String warnEndTime, char dimension, List<Long> provincelist);
@Query(value = "SELECT ASSOCIATION_ID, D.PROVINCE_ID, ASSOCIATION_TYPE ,ASSOCIATION_DESC, PROVINCE_NAME, WARNING_BEGIN_TIME, WARNING_END_TIME," +
" COUNT(E.KPI_ID) AS WARNING_NUM FROM (" +
" SELECT A.ASSOCIATION_ID,A.PROVINCE_ID, A.ASSOCIATION_DESC, A.ASSOCIATION_TYPE, B.KPI_ID, C.PROVINCE_NAME, TO_TIMESTAMP(?1,'YYYY-MM-DD HH24:MI:SS') AS WARNING_BEGIN_TIME," +
" TO_TIMESTAMP(?2,'YYYY-MM-DD HH24:MI:SS') AS WARNING_END_TIME" +
" FROM CCOLAP.DIM_ASSOCIATION_ANALYSIS_INFO_T A INNER JOIN DIM_KPI_ASSOCIATION_RELATED_INFO_T B"+
" ON A.ASSOCIATION_ID=B.ASSOCIATION_ID INNER JOIN DIM_PROVINCE_INFO_T C ON C.PROVINCE_ID= A.PROVINCE_ID) D"+
" LEFT JOIN GJFX_WARNING_INFO_T E" +
" ON D.PROVINCE_ID = E.PROVINCE_ID AND D.KPI_ID =E.KPI_ID AND WARNING_ID LIKE 'J%'" +
" and OCCUR_TIME >= TO_TIMESTAMP(?1,'YYYY-MM-DD HH24:MI:SS')" +
" AND OCCUR_TIME <=TO_TIMESTAMP(?2,'YYYY-MM-DD HH24:MI:SS') WHERE ASSOCIATION_TYPE = ?3 and D.PROVINCE_ID in (?4) GROUP BY ASSOCIATION_ID,D.PROVINCE_ID, ASSOCIATION_TYPE ,ASSOCIATION_DESC,PROVINCE_NAME, WARNING_BEGIN_TIME, WARNING_END_TIME"
,nativeQuery = true)
public Object[] findAssociateDiagosisDetailByAssociationId(Long associationId);
@Query(value = "SELECT ASSOCIATION_ID, PROVINCE_ID, ASSOCIATION_TYPE , ASSOCIATION_DESC, PROVINCE_NAME, WARNING_BEGIN_TIME, WARNING_END_TIME, KPI_CODE, KPI_NAME, KPI_ID, KPI_WEIGHT, WARNING_NUM, CASE WHEN INFLUENCE_LEVEL>0.8 THEN '高' WHEN INFLUENCE_LEVEL>0.5 AND INFLUENCE_LEVEL<0.5 THEN '中' ELSE '低' END AS INFLUENCE_LEVEL FROM ( SELECT ASSOCIATION_ID, D.PROVINCE_ID, ASSOCIATION_TYPE, ASSOCIATION_DESC, PROVINCE_NAME, WARNING_BEGIN_TIME, WARNING_END_TIME, D.KPI_CODE,D.KPI_NAME, D.KPI_ID, KPI_WEIGHT,COUNT(E.KPI_ID)AS WARNING_NUM, KPI_WEIGHT* COUNT(E.KPI_ID) AS INFLUENCE_LEVEL FROM ( SELECT A.ASSOCIATION_ID,A.PROVINCE_ID,A.ASSOCIATION_DESC,A.ASSOCIATION_TYPE, B.KPI_ID, D.KPI_CODE, D.KPI_NAME, B.KPI_WEIGHT, C.PROVINCE_NAME, TO_TIMESTAMP(?1,'YYYY-MM-DD HH24:MI:SS') AS WARNING_BEGIN_TIME, TO_TIMESTAMP(?2,'YYYY-MM-DD HH24:MI:SS') AS WARNING_END_TIME FROM CCOLAP.DIM_ASSOCIATION_ANALYSIS_INFO_T A INNER JOIN CCOLAP.DIM_KPI_ASSOCIATION_RELATED_INFO_T B ON A.ASSOCIATION_ID=B.ASSOCIATION_ID INNER JOIN CCOLAP.DIM_PROVINCE_INFO_T C ON C.PROVINCE_ID= A.PROVINCE_ID INNER JOIN CCOLAP.DIM_KPI_INFO_T D ON B.KPI_ID=D.KPI_ID) D LEFT JOIN CCOLAP.GJFX_WARNING_INFO_T E ON D.PROVINCE_ID=E.PROVINCE_ID AND D.KPI_ID =E.KPI_ID AND WARNING_ID LIKE 'J%' WHERE OCCUR_TIME >=TO_TIMESTAMP(?1,'YYYY-MM-DD HH24:MI:SS') AND OCCUR_TIME <=TO_TIMESTAMP(?2,'YYYY-MM-DD HH24:MI:SS') AND ASSOCIATION_ID= ?3 GROUP BY ASSOCIATION_ID, D.PROVINCE_ID, ASSOCIATION_TYPE , ASSOCIATION_DESC, PROVINCE_NAME, WARNING_BEGIN_TIME, WARNING_END_TIME, D.KPI_CODE, D.KPI_NAME,D.KPI_ID,KPI_WEIGHT)G"
,nativeQuery = true)
public Object[] findDetailByAssociationIdAndWarnBeginToEndTime(String beginTime,String endTime,Long associationId);
}
......@@ -83,6 +83,7 @@ public class PageURLController {
//监控运营>告警关联诊>关联诊断明细
//AssociateDiagosisDetail映射到WEB-INF/views下的MonitorOperation/AssociateDiagosisDetail.jsp页面
public static String AssociateDiagosisDetail="MonitorOperation/AssociateDiagosisDetail";
public static String AssociateDetails="MonitorOperation/AssociateDetails";
//监控运营>告警关联诊>关联诊断配置
//AssociateDiagosisConfiguration-INF/views下的MonitorOperation/AssociateDiagosisConfiguration.jsp页面
......
......@@ -22,13 +22,14 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.Timestamp;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.*;
import com.hp.cmsz.service.monitoroperation.AssociateDiagosisDetailService;
/**
* AssociateDiagosisDetailControllerr 监控运营>告警关联诊>关联诊断明细
*
......@@ -76,289 +77,175 @@ public class AssociateDiagosisDetailController {
@Autowired
private FailureService failureService;
List<GzfxDetailInfo> uploadGzfxDetail = new ArrayList<GzfxDetailInfo>();
String staticFailureTitle ="";
String staticDetailTime ="";
String staticDetailProvince = "";
String staticDetailProvider = "";
String staticXcdStatus = "";
String staticDetailDataSource = "";
String staticDetailChannel = "";
String staticDetailBusiness = "";
String staticDetailWarningSource = "";
@Autowired
private AssociateDiagosisDetailService associateDiagosisDetailService;
public String lists(Map model,
@RequestParam(value = "xcdStatus", defaultValue="") String xcdStatus,
@RequestParam(value = "detailProvince",defaultValue = "") String detailProvince
){
return "";
}
@RequestMapping("")
public String lis(Map model, ServletRequest request, HttpSession session)
throws UnsupportedEncodingException, ParseException {
List<Province> provinceList =(List<Province>) provinceDao.findProvince();
model.put("provinceList", provinceList);
String timestamp1=getOld();//getLastMonth();
String timestamp2=getNew();//getNow();
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);
}
model.put("provinceList", provinceList);
Gson gson=new Gson();
model.put("diagosisDetails", gson.toJson(associateDiagosisDetails));
return PageURLController.AssociateDiagosisDetail;
}
}
@RequestMapping("/tableList")
@ResponseBody
public String tableList(){
return "";
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[] times = detailtime.split("~");
String warnBeginTime="";
String warnEndTime="";
warnBeginTime = times[0];
warnBeginTime.replaceAll("%"," ");
warnEndTime = times[1];
warnEndTime.replaceAll("%"," ");
char dimensionc='d';
try {
for (String s : provinceStr) {
provinceList.add(Long.parseLong(s));
}
dimensionc=dimension.charAt(0);
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
format.parse(warnBeginTime);
format.parse(warnEndTime);
}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));
return gson.toJson(diagosisDetails);
}
@RequestMapping(value ={"/details"})
public String details(
@RequestParam(value = "associationId",defaultValue = "") String associationId,
@RequestParam(value = "beginTime",defaultValue = "") String beginTime,
@RequestParam(value = "endTime",defaultValue = "") String endTime,
@RequestParam(value = "provinceName",defaultValue = "") String provinceName,
@RequestParam(value = "associationType",defaultValue = "") String associationType,
@RequestParam(value = "associationDesc",defaultValue = "") String associationDesc,
@RequestParam(value = "warningNum",defaultValue = "") String warningNum,
Map map){
@RequestMapping("/aaa")
public String list(Map model, ServletRequest request, HttpSession session)
throws UnsupportedEncodingException, ParseException {
List<GzfxDetailInfo> gzfxDetailInfos = new ArrayList<GzfxDetailInfo>();
//创建searchParams对象用来完成过滤操作
String timeTag = request.getParameter("timeTag");
String warningSourceTag = request.getParameter("warningSourceTag");
String dataSourceTag = request.getParameter("dataSourceTag");
String channelTag = request.getParameter("channelTag");
String businessTag = request.getParameter("businessTag");
String provinceTag = request.getParameter("provinceTag");
String providerTag = request.getParameter("providerTag");
String failureId = request.getParameter("failureId");
String provinceId = request.getParameter("provinceId");
String providerId = request.getParameter("providerId");
String dateVal = request.getParameter("dateVal");
System.out.println("timeTag="+timeTag+
"\nwarningSourceTag="+warningSourceTag+
"\ndataSourceTag="+dataSourceTag+
"\nchannelTag="+channelTag+
"\nbusinessTag="+businessTag+
"\nprovinceTag="+provinceTag+
"\nproviderTag="+providerTag+
"\nfailureId="+failureId+
"\nprovinceId="+provinceId+
"\nproviderId="+providerId+
"\ndateVal="+dateVal);
//根据ID查找故障
if(failureId!=null){
gzfxDetailInfos = gzfxDetailInfoDao.findByFailureId(Long.parseLong(failureId));
//标签
model.put("failureId", failureId);
cmszOperationLogService.createLog("查询","故障明细","点击相应故障ID:"+failureId+"得到故障相关信息");
}else{
//根据多图钻取得到相应故障
if(businessTag!=null && timeTag!=null && dataSourceTag!=null && warningSourceTag!=null){
String filterWarningSource = "";
List<Long> dataSource = changeStringToList(dataSourceTag);
List<Long> channel = changeStringToList(channelTag);
List<Long> business = changeStringToList(businessTag);
List<Long> province = changeStringToList(provinceTag);
List<Long> provider = changeStringToList(providerTag);
List<Long> extFailureList = new ArrayList<Long>();
List<Long> extXcdFailureIdList = new ArrayList<Long>();
if(warningSourceTag.indexOf("extFailure")>=0){
if(filterWarningSource.equals("")){
filterWarningSource = "省公司告知";
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);
if("".equalsIgnoreCase(associationId)||"".equalsIgnoreCase(beginTime)||"".equalsIgnoreCase(endTime)){
}else{
filterWarningSource += " 省公司告知";
}
Long associationIdL=Long.parseLong(associationId);
extFailureList = failureAdditionDao.findDistinctFailureIdByDataSourceIdInAndChannelIdIn(dataSource, channel);
warningSourceTag = warningSourceTag.replaceAll("extFailure", "");
}
if(warningSourceTag.indexOf("extXcd")>=0){
if(filterWarningSource.equals("")){
filterWarningSource = "其他";
}else{
filterWarningSource += " 其他";
}
extXcdFailureIdList = xcdWorkingOrderInfoDao.getRelevantFailureId(dataSource, channel);
extFailureList.addAll(extXcdFailureIdList);
warningSourceTag = warningSourceTag.replaceAll("extXcd", "");
}
List<Long> warningSource = changeStringToList(warningSourceTag);
if(timeTag.trim().equals("")){
if(!warningSource.isEmpty()){
List<Long> failureIdListByRelevantWarningSourceId = gjfxWarningInfoDao.getByWarningSourceAndDataSourceAndChannelAndBusiness(warningSource, dataSource, channel, business);
extFailureList.addAll(failureIdListByRelevantWarningSourceId);
}
if(extFailureList.isEmpty()){
gzfxDetailInfos = gzfxDetailInfoDao.findByFailureIdIsNull();
}else{
gzfxDetailInfos = gzfxDetailInfoService.getListMonthFailuresByFailureIdAndProvinceIdAndProviderId(extFailureList, province, provider);
}
//}
}else{
if(timeTag.split("~").length>1){
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String[] times = timeTag.split("~");
Date startTime = sdf.parse(times[0]);
Date endTime = sdf.parse(times[1]);
System.out.println("have time");
if(!warningSource.isEmpty()){
List<Long> failureIdListByRelevantWarningSourceId = gjfxWarningInfoDao.getByWarningSourceAndDataSourceAndChannelAndBusiness(warningSource, dataSource, channel, business);
extFailureList.addAll(failureIdListByRelevantWarningSourceId);
}
if(extFailureList.isEmpty()){
gzfxDetailInfos = gzfxDetailInfoDao.findByFailureIdIsNull();
}else{
gzfxDetailInfos = gzfxDetailInfoDao.findByHappenTimeBetweenAndFailureIdInAndProvinceIdInAndProviderIdInOrderByHappenTimeDesc(startTime, endTime, extFailureList, province, provider);
return PageURLController.AssociateDetails;
}
//}
}else{
if(!warningSource.isEmpty()){
List<Long> failureIdListByRelevantWarningSourceId = gjfxWarningInfoDao.getByWarningSourceAndDataSourceAndChannelAndBusiness(warningSource, dataSource, channel, business);
extFailureList.addAll(failureIdListByRelevantWarningSourceId);
}
if(extFailureList.isEmpty()){
gzfxDetailInfos = gzfxDetailInfoDao.findByFailureIdIsNull();
}else{
SimpleDateFormat timeFormat = new SimpleDateFormat("yyyy/MM/dd");
gzfxDetailInfos = gzfxDetailInfoDao.getByHappenTimeAndFailureIdAndProvinceIdAndProviderIdOrderByHappenTime(extFailureList, province, provider, timeFormat.parse(timeTag.trim()));
}
//}
//筛选后的报表时间转换
if(!gzfxDetailInfos.isEmpty()){
timeTag = gzfxDetailInfos.get(0).getHappenTime().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());
}
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());
}
//筛选项
String filterDataSource = dataSourceService.getDataSourceById(dataSource);
String filterChannel = channelService.getChannelNameByChannelId(channel);
String filterBusiness = businessService.getBusinessNameByBusinessId(business);
String filterProvince = provinceService.getProvinceNameByProvinceIds(province);
String filterProvider = providerService.getProviderById(provider);
if(!warningSource.isEmpty()){
if(filterWarningSource.equals("")){
filterWarningSource = warningSourcerService.getWarningSourceNameByWarningSourceId(warningSource);
}else{
filterWarningSource = filterWarningSource + " " + warningSourcerService.getWarningSourceNameByWarningSourceId(warningSource);
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());
}
model.put("filterDataSource", filterDataSource);
model.put("filterChannel", filterChannel);
model.put("filterBusiness", filterBusiness);
model.put("filterProvince", filterProvince);
model.put("filterProvider", filterProvider);
model.put("filterWarningSource", filterWarningSource);
model.put("filterTimeTag", timeTag);
cmszOperationLogService.createLog("查询","故障明细","故障统计分析钻取到故障明细");
}else if(businessTag==null && (timeTag!=null && timeTag!="") && (channelTag!=null && channelTag!="") && provinceTag!=null && providerTag!=null && (dataSourceTag!=null && dataSourceTag!="") && warningSourceTag==null){
//从集成商钻取之后的页面钻取到相应的故障
List<Long> channelIds = changeStringToList(channelTag);
List<Long> dataSourceIds = changeStringToList(dataSourceTag);
List<Long> relevantFailureId = gjfxWarningInfoDao.getByDataSourceAndChannel(dataSourceIds,channelIds);
List<Long> extFialrueId = failureAdditionDao.findDistinctFailureIdByDataSourceIdInAndChannelIdIn(dataSourceIds, channelIds);
relevantFailureId.addAll(extFialrueId);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date startTime = sdf.parse(timeTag.split("~")[0]);
Date endTime = sdf.parse(timeTag.split("~")[1]);
List<Long> providerIds = changeStringToList(providerTag);
List<Long> provinceIdByName = new ArrayList<Long>();
provinceIdByName.add(provinceDao.findByProvinceName(provinceTag).get(0).getProvinceId());
gzfxDetailInfos = gzfxDetailInfoDao.findByHappenTimeBetweenAndFailureIdInAndProvinceIdInAndProviderIdInOrderByHappenTimeDesc(startTime, endTime, relevantFailureId, provinceIdByName, providerIds);
//筛选项
String filterDataSource = dataSourceService.getDataSourceById(dataSourceIds);
String filterChannel = channelService.getChannelNameByChannelId(channelIds);
String filterProvince = provinceTag;
String filterProvider = providerService.getProviderById(providerIds);
model.put("filterDataSource", filterDataSource);
model.put("filterChannel", filterChannel);
model.put("filterProvince", filterProvince);
model.put("filterProvider", filterProvider);
model.put("filterTimeTag", timeTag);
cmszOperationLogService.createLog("查询","故障明细","故障统计分析钻取到故障明细");
}else if(businessTag==null && (timeTag==null || timeTag=="") && (channelTag==null || channelTag=="") && provinceTag!=null && providerTag!=null && (dataSourceTag==null || dataSourceTag=="") && warningSourceTag==null){
//从集成商首页钻取之后的页面钻取到相应的故障
List<Long> provinceIdByName = new ArrayList<Long>();
provinceIdByName.add(provinceDao.findByProvinceName(provinceTag).get(0).getProvinceId());
gzfxDetailInfos = gzfxDetailInfoService.getListMonthFailuresByProvinceIdAndProviderId(provinceIdByName, Long.parseLong(providerTag));
//标签
String filterProvince = provinceTag;
List<Long> providerList = new ArrayList<Long>();
providerList.add(Long.parseLong(providerTag));
String filterProvider = providerService.getProviderById(providerList);
model.put("filterProvince", filterProvince);
model.put("filterProvider", filterProvider);
cmszOperationLogService.createLog("查询","故障明细","故障统计分析钻取到故障明细");
}else if(timeTag==null && dataSourceTag==null && providerId==null && dateVal==null && provinceId!=null){
//故障首页省份的钻取
gzfxDetailInfos = gzfxDetailInfoService.getLastMonthFailureByprovinceId(Long.parseLong(provinceId));
//标签
model.put("driProvinceId", provinceId);
cmszOperationLogService.createLog("查询","故障明细","故障统计分析钻取到故障明细");
}else if(timeTag==null && dataSourceTag==null && provinceId==null && dateVal==null && providerId!=null){
//故障首页集成商的钻取
gzfxDetailInfos = gzfxDetailInfoService.getLastMonthFailureByProviderId(Long.parseLong(providerId));
//标签
model.put("driProviderId", providerId);
cmszOperationLogService.createLog("查询","故障明细","故障统计分析钻取到故障明细");
}else if(timeTag==null && dataSourceTag==null && provinceId==null && providerId==null && dateVal!=null){
//故障首页时间的钻取
SimpleDateFormat timeFormat = new SimpleDateFormat("yyyy/MM/dd");
//gzfxDetailInfos = gzfxDetailInfoDao.getByHappenTime((int)(Long.parseLong(dateVal.trim())/1000));
gzfxDetailInfos = gzfxDetailInfoDao.getByHappenTime(timeFormat.parse(dateVal.trim()));
if(!gzfxDetailInfos.isEmpty()){
Date indexTime = gzfxDetailInfos.get(0).getHappenTime();
model.put("driDateVal", indexTime);
}
cmszOperationLogService.createLog("查询","故障明细","故障统计分析钻取到故障明细");
}else{
//故障明细默认页面
gzfxDetailInfos = gzfxDetailInfoService.getLastMonthFailures();
cmszOperationLogService.createLog("查询","故障明细","故障明细首页");
}
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;
}
uploadGzfxDetail = gzfxDetailInfos;
Gson gson = new Gson();
model.put("gzfxDetailInfos", gson.toJson(gzfxDetailInfos));
//放入筛选项 || modify by August at 2014-05-16
List<Channel> channelList = channelService.getAllChannels();
List<DataSource> datasourceList = dataSourceService.getAllDataSources();
List<Provider> providerList = providerDao.findProvidersByProvinceVersionConfig();
List<WarningSource> warningSourceList = warningSourcerService.getAllWarningSource();
List<String> workingOrderStatusList = xcdWorkingOrderInfoDao.getXcdXcdStatus();
List<Province> provinceList =(List<Province>) provinceDao.findProvince();
List<String> businessList = businessService.getAllBusinessIdAndBusinessName();
model.put("channelList", channelList);
model.put("datasourceList", datasourceList);
model.put("providerList", providerList);
model.put("warningSourceList", warningSourceList);
model.put("workingOrderStatusList", workingOrderStatusList);
model.put("businessList", businessList);
model.put("provinceList", provinceList);
private static void changeTimestampStyle(List<AssociateDiagosisDetail> diagosisDetails){
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return PageURLController.AssociateDiagosisDetail;
}
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格式
@RequestMapping(value = "/upLoadGzfxDetailExcel", method = RequestMethod.POST)
......
......@@ -5,10 +5,17 @@
<div id="timeLine" class="date">
<label for="">时间范围</label><!-- 最近3年 -->
<input id="d1" class="Wdate" type="text" style="width:137px;" value="" onFocus="var d2=$dp.$('d2');WdatePicker({onpicked:function(){d2.focus();},minDate:'{%y-3}-%M-%d %H:%m:%s',maxDate:'#F{$dp.$D(\'d2\')||\'%y-%M-%d %H:%m:%s\'}',dateFmt:'yyyy-MM-dd'})">
<input id="d1" class="Wdate" type="text" value="" onFocus="var d2=$dp.$('d2');WdatePicker({onpicked:function(){d2.focus();},minDate:'{%y-3}-%M-%d %H:%m:%s',maxDate:'#F{$dp.$D(\'d2\')||\'%y-%M-%d %H:%m:%s\'}'})">
--
<input id="d2" class="Wdate" type="text" style="width:137px;" value="" onFocus="WdatePicker({minDate:'#F{$dp.$D(\'d1\')||\'{%y-3}-%M-%d %H:%m:%s\'}',maxDate:'%y-%M-%d %H:%m:%s',dateFmt:'yyyy-MM-dd'})">
<input id="d2" class="Wdate" type="text" value="" onFocus="WdatePicker({minDate:'#F{$dp.$D(\'d1\')||\'{%y-3}-%M-%d %H:%m:%s\'}',maxDate:'%y-%M-%d %H:%m:%s'})">
<%--<input id="d1" class="Wdate" type="text" style="width:137px;" value="" onFocus="var d2=$dp.$('d2');WdatePicker({onpicked:function(){d2.focus();},minDate:'{%y-3}-%M-%d %H:%m:%s',maxDate:'#F{$dp.$D(\'d2\')||\'%y-%M-%d %H:%m:%s\'}',dateFmt:'yyyy-MM-dd'})">
--
<input id="d2" class="Wdate" type="text" style="width:137px;" value="" onFocus="WdatePicker({minDate:'#F{$dp.$D(\'d1\')||\'{%y-3}-%M-%d %H:%m:%s\'}',maxDate:'%y-%M-%d %H:%m:%s',dateFmt:'yyyy-MM-dd'})">
--%>
</div>
<div id="more-option" class="slide-menu-option">
......@@ -26,6 +33,7 @@
</div>
</div>
<%--省份筛选项 --%>
<div id="provinceDetail" class="slide-menu-option">
<label for="">省份</label>
<div class="checkbox-inline"><label><input type="checkbox" name="allProvinceDetail" id="allProvinceDetail" title="allSelect" checked />全选</label></div>
......@@ -40,6 +48,91 @@
</div>
</div>
<script type="text/javascript">
function initStartTime()
{
var now = new Date();
var year = now.getFullYear(); //年
var month = now.getMonth() + 1; //月
var day = now.getDate(); //日
var hh = now.getHours(); //时
var mm = now.getMinutes(); //分
var clock = year + "-";
if(month < 10)
clock += "0";
clock += month + "-";
if(day < 10)
clock += "0";
clock += day + " ";
if(hh < 10)
clock += "0";
clock += hh + ":";
if (mm < 10) clock += '0';
clock += mm;
clock += ":"+"00";
return(clock);
}
function initEndTime() {
var date = new Date();
var daysInMonth = new Array([0],[31],[28],[31],[30],[31],[30],[31],[31],[30],[31],[30],[31]);
var strYear = date.getFullYear();
var strDay = date.getDate();
var strMonth = date.getMonth()+1;
var hh = date.getHours(); //时
var mm = date.getMinutes(); //分
if(strYear%4 == 0 && strYear%100 != 0){
daysInMonth[2] = 29;
}
if(strMonth - 1 == 0)
{
strYear -= 1;
strMonth = 12;
}
else
{
strMonth -= 1;
}
strDay = daysInMonth[strMonth] >= strDay ? strDay : daysInMonth[strMonth];
if(strMonth<10)
{
strMonth="0"+strMonth;
}
if(strDay<10)
{
strDay="0"+strDay;
}
var clock = strYear+"-"+strMonth+"-"+strDay;
clock += " ";
if(hh < 10)
clock += "0";
clock += hh + ":";
if (mm < 10) clock += '0';
clock += mm;
clock += ":"+"00";
return(clock);
}
//初始化时间控件的默认值,需要在页面加载时调用此初始化方法
function initDate(){
$(".date #d1").val(initEndTime());
$(".date #d2").val(initStartTime());
}
var detailProviderCheckedValues=$(".providerDetail:checked");
$("#allProviderDetail").click(function(){
......@@ -175,10 +268,8 @@
//返回结果为一个数组,数组中包含选中的省份
function getDetailProvinceCheckedValues(){
var provinceArray=new Array();
var i=0;
detailProvinceCheckedValues.each(function(){
provinceArray[i]=$(this).val();
i++;
provinceArray.push($(this).val());
});
console.log("provinceArray "+provinceArray );
return provinceArray;
......
......@@ -5,6 +5,7 @@
<script language="javascript" type="text/javascript" src="${ctx}/static/My97DatePicker/WdatePicker.js"></script>
--%>
<div id="timeLine" class="date">
<label for="">时间范围</label><!-- 默认时间范围为最近1个月 -->
<input id="d1" class="Wdate" type="text" value="" onFocus="var d2=$dp.$('d2');WdatePicker({onpicked:function(){d2.focus();},minDate:'{%y-3}-%M-%d %H:%m:%s',maxDate:'#F{$dp.$D(\'d2\')||\'%y-%M-%d %H:%m:%s\'}'})">
......@@ -20,6 +21,7 @@
</div>
<script type="text/javascript">
function initStartTime()
{
var now = new Date();
......
......@@ -10,6 +10,7 @@
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<html>
<head>
......@@ -23,14 +24,18 @@
<script src="${ctx}/static/artDialog4.1.7/artDialog.source.js?skin=default"></script>
<script src="${ctx}/static/artDialog4.1.7/plugins/iframeTools.source.js"></script>
<script type="text/javascript" src="${ctx}/static/js/associatediagosisdetail.js"></script>
<script type="text/javascript">
$(document).ready(function(){
// alert(1);
// failureTable();
// initDateDetail();
//$("#businessSelectAreaDetail").hide();
initDate();
//初始化界面
initTable();
var v=document.getElementById('gzfxDetail').value;
console.log("v "+v);
});
</script>
......@@ -107,15 +112,6 @@
<div class="col-xs-12">
<div class="table-header">
关联诊断结果查询
<%--<shiro:hasAnyRoles name="admin,dataAnalysis,businessAnalysis">
<div id="time_div"
style="top: -6px;float: right;height: 0px;position: relative;">
<button id="deleteFailureBtn"
class="btn-sm btn btn-primary btn-sm btn-group btn-group-cog"
onclick="failureDelete()">删除故障
</button>
</div>
</shiro:hasAnyRoles>--%>
</div>
<!--写故障明细列表处-->
<table class="table table-hover table-striped"
......@@ -134,10 +130,11 @@
</div>
<form action="#" method="get" id="listForm"></form>
<input type="hidden" id="gzfxDetail" name="gzfxDetail" value='${gzfxDetailInfos}' />
<input type="hidden" id="gzfxDetail" name="gzfxDetail" value='${diagosisDetails}' />
</div>
</div>
</div>
${diagosisDetails}
</div>
<script type="text/javascript">
......@@ -244,6 +241,8 @@
}
//获取选取的时间段,返回结果为字符串数组
function getPeriod(){
var period=new Array();
......@@ -274,25 +273,28 @@
}else{
var detailProvince = getDetailProvinceCheckedValueString();
var dimension=getDetailCheckeddDimension();
console.log("detailProvince "+detailProvince);
console.log("dimension "+dimension);
console.log("detailtime "+detailtime);
//alert(dimension+"-pi-");
// alert(detailProvince);
//var href="${ctx}/MonitorOperation/FailureAnalysisDetail/changeTable?detailProvince="+detailProvince+"&detailProvider="+detailProvider+"&xcdStatus="+xcdStatus+"&detailDataSource="+detailDataSource+"&detailChannel="+detailChannel+"&detailBusiness="+detailBusiness+"&detailWarningSource="+detailWarningSource+"&failureTitle="+"-1";
/* $.ajax({
var href="${ctx}/MonitorOperation/AssociateDiagosisDetail/tableList?detailProvince="+detailProvince+"&detailtime="+detailtime+"&dimension="+dimension;
$.ajax({
type : 'GET',
contentType : 'application/json',
url: encodeURI(encodeURI(href))+"&detailTime="+detailTime,//href,
url: href,//encodeURI(encodeURI(href)),//href,
dataType : 'text',
beforeSend: function(data) {
},
success: function(data) {
$("#gzfxDetail").val(data);
failureTable();
checkFailureIds=[];
$("#deleteFailureBtn").attr("disabled", true);
toggleMenu('slidePushMenus2');//隐藏筛选项
// failureTable();
initTable();
//checkFailureIds=[];
//$("#deleteFailureBtn").attr("disabled", true);
//toggleMenu('slidePushMenus2');//隐藏筛选项
}
});*/
});
$("#detailPeriodTag").empty();
$("#detailProvinceTag").text("省份").append($("<span class='badge'></span>").text(detailProvinceSum)).attr('data-original-title',getDetailProvinceTag()).tooltip();
$("#detailDimensionTag").text("关联维度").append($("<span class='badge'></span>").text()).attr('data-original-title',getdetailDemensionTagValue()).tooltip();
......@@ -318,8 +320,10 @@
//重置detail中的筛选项
function detailReset(){
$("#d1").val('');
$("#d2").val('');
//$("#d1").val('');
//$("#d2").val('');
initDate();
detail_Province_Reset();
detail_Dimension_Reset();
judge = true;
......@@ -335,6 +339,29 @@
listForm.attr("action","#");
});
function goClick(e){
console.log("=-- e.tit name"+e.name);
//alert($(e).attr("title")+"---");
var beginTime="";
var endTime="";
var provinceName="";
var associationType="";
var associationDesc="";
var warningNum="";
$(e).parent().prevAll().each(function(ind,dom){
if(ind == 0){warningNum=$(dom).text()}
if(ind == 1){associationDesc=$(dom).text()}
if(ind == 2){associationType=$(dom).text()}
if(ind == 3){provinceName=$(dom).text()}
if(ind == 4){endTime=$(dom).text()}
if(ind == 5){beginTime=$(dom).text()}
});
window.location.href = "${ctx}/MonitorOperation/AssociateDiagosisDetail/details?associationId="+e.name+"&warningNum="+warningNum
+"&associationDesc="+associationDesc+"&associationType="+associationType+"&provinceName="+provinceName+"&endTime="endTime+"&beginTime="+beginTime;
}
</script>
</body>
......
function initTable(){
jsonStr = document.getElementById('gzfxDetail').value;
alert("jsonStr" +jsonStr);
var header = new Array();
header[0] = ["<input type='checkbox' name='ckAll' id='ckAll' class='ckAll' onclick='javascript:checkAll();'/>","checkbox","1%",""];
header[1] = ["开始时间","failureId","10%",""];
header[2] = ["结束时间","failureTitle","10%","16"];
header[1] = ["开始时间","warnBeginTime","10%",""];
header[2] = ["结束时间","warnEndTime","10%","16"];
header[3] = ["省份","provinceName","5%",""];
header[4] = ["类型","channelName","8%",""];
header[5] = ["名称","dataSourceName","8%",""];
header[6] = ["告警个数","warningSourceName","8%",""];
header[7] = ["指标告警明细","providerName","8%",""];
/*header[8] = ["发生时间","happenTime","10%",""];
header[9] = ["结束时间","closeTime","10%",""];
header[10] = ["详细原因","failureReason","14%","20"];
header[11] = ["解决方案","resolution","14%","20"];*/
header[4] = ["类型","associationType","8%",""];
header[5] = ["名称","associationDesc","8%",""];
header[6] = ["告警个数","warningNum","8%",""];
header[7] = ["指标告警明细","associationId","8%",""];
window.pagging = new table_pagging({limit:11,tableId:'failureAnalysisDetailTable',header:header});
pagging.pagging(jsonStr);
......@@ -178,38 +175,45 @@ table_pagging.prototype={
tdContext = context;
} else {
tdContext = this.getData(this.objectlist[i],this.header[k][1]);
if(tdContext==null){
tdContext = "&nbsp;";
}
if(k==1){
tdContext="<a href='javascript:openDialog("+this.getData(this.objectlist[i],"failureId")+")' alt='"+i+"'>"+this.getData(this.objectlist[i],this.header[k][1])+"</a>";
if(k==1|| k==2){
tdContext=this.getData(this.objectlist[i],this.header[k][1]);
var d=new Date(tdContext);
tdContext=(d.getFullYear()+1)+"-"+d.getMonth()+"-"+d.getDate()+" "+d.getHours()+":"+d.getMinutes()+":"+d.getSeconds();
console.log("---"+(d.getFullYear()+1)+"-"+d.getMonth()+"-"+d.getDate()+" "+d.getHours()+":"+d.getMinutes()+":"+d.getSeconds());
console.log(tdContext+"--");
console.log("type "+ typeof tdContext);
}else if(k == 4){
tdContext=this.getData(this.objectlist[i],this.header[k][1]);
if(tdContext == 'c'){
tdContext="业务";
}
if(k==8){
if(tdContext=="&nbsp;"){
tdContext = "&nbsp;";
}else{
tdContext = df.format(new Date(tdContext));
if(tdContext == 'y'){
tdContext="渠道";
}
}else if(k==9){
if(tdContext=="&nbsp;"){
tdContext = "&nbsp;";
}
else if(k == 7){
//tdContext="<a name='"+this.getData(this.objectlist[i],this.header[0][1])+"' title='"+this.getData(this.objectlist[i],this.header[0][1])+"' onclick='goClick(this)'>详情</a>";
console.log(this.getData(this.objectlist[i],this.header[k][1])+" + == ");
tdContext="<a name='"+this.getData(this.objectlist[i],this.header[7][1])+"' onclick='goClick(this)'>详-情</a>";
}else{
tdContext = df.format(new Date(tdContext));
tdContext = this.getData(this.objectlist[i],this.header[k][1]);
}
}
}
} else {
tdContext="<input type='checkbox' name='failureBox"+i+"' class='failureBox' onclick='javascript:checkFailureIdsChoose(this);'/>"+"<span style='display:none'>"+i+"</span>";
/*tdContext="<input type='checkbox' name='failureBox"+i+"' class='failureBox' onclick='javascript:checkFailureIdsChoose(this);'/>"+"<span style='display:none'>"+i+"</span>";
for ( var t = 0; t < checkFailureIds.length; t++) {
if (checkFailureIds[t] == this.getData(this.objectlist[i], "failureId")){
tdContext="<input type='checkbox' name='failureBox"+i+"' class='failureBox' checked onclick='javascript:checkFailureIdsChoose(this);'/>"+"<span style='display:none'>"+i+"</span>";
break;
}
}
}*/
}
} else {
tdContext = "&nbsp;";
......
......@@ -123,21 +123,17 @@ df.applyPattern("yyyy-MM-dd HH:mm:ss");
function failureTable() {
jsonStr = document.getElementById('gzfxDetail').value;
var header = new Array();
header[0] = ["<input type='checkbox' name='ckAll' id='ckAll' class='ckAll' onclick='javascript:checkAll();'/>","checkbox","1%",""];
header[1] = ["故障ID","failureId","4%",""];
header[2] = ["故障标题","failureTitle","10%","16"];
header[1] = ["开始时间","warnBeginTime","10%",""];
header[2] = ["结束时间","warnEndTime","10%","16"];
header[3] = ["省份","provinceName","5%",""];
header[4] = ["渠道","channelName","8%",""];
header[5] = ["数据来源","dataSourceName","8%",""];
header[6] = ["故障来源","warningSourceName","8%",""];
header[7] = ["集成商","providerName","8%",""];
header[8] = ["发生时间","happenTime","10%",""];
header[9] = ["结束时间","closeTime","10%",""];
header[10] = ["详细原因","failureReason","14%","20"];
header[11] = ["解决方案","resolution","14%","20"];
header[4] = ["类型","associationType","8%",""];
header[5] = ["名称","associationDesc","8%",""];
header[6] = ["告警个数","warningNum","8%",""];
header[7] = ["指标告警明细","providerName","8%",""];
window.pagging = new table_pagging({limit:11,tableId:'failureAnalysisDetailTable',header:header});
pagging.pagging(jsonStr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment