Commit 38fe000a authored by 莫林毅's avatar 莫林毅

'指标告警明细 悬浮框' 功能

parent bd6fd4e6
This diff is collapsed.
......@@ -55,7 +55,7 @@ public class XcdWarningInfoView {
private String status;//关闭类型(未关闭,。。。。)
private String workingOrderCode;
private String riskPictureFileName; //隐患图片
private String influenceEndTime; //隐患图片
private String influenceEndTime; //告警结束时间
private Long ifFilter; //隐患图片
private Long dataModelTypeId;
private String dataModelName;
......
......@@ -89,4 +89,9 @@ public interface XcdWarningInfoViewDao extends PagingAndSortingRepository<XcdWa
@Query(value="SELECT TO_CHAR(DATE_VALUE,'yyyy-mm-dd') AS CATEGORY,COUNT(working_order_id) AS COUNT FROM (SELECT DATE_VALUE FROM dim_date_info_t WHERE DATE_VALUE between ?4 and ?5 )A left join(SELECT event_happen_time, working_order_id FROM XCD_WORKING_ORDER_INFO_T s WHERE not exists(select 1 from GJFX_WARNING_INFO_T where RELEVANT_WORKING_ORDER_ID = s.WORKING_ORDER_ID) and prov_code IN ( SELECT PROVINCE_CODE FROM DIM_PROVINCE_INFO_T WHERE PROVINCE_ID IN(?1)) AND channel_id IN(?2) AND data_source_id IN (?3) and provider_id in(?6))B ON A.DATE_VALUE=CAST(B.event_happen_time AS DATE) GROUP BY CATEGORY ORDER BY CATEGORY",nativeQuery=true)//change by eric 2014-08-13 22:07 外连接了日期
List<Object[]> findXcdAnalysisByAllOther(List<Long> proids,List<Long> channelids,List<Long> sourceids,Date startdate,Date enddate,List<Long> provider);
@Query(value = "select infov from XcdWarningInfoView infov where infov.kpiId = :kpiId and infov.provinceId = :provinceId and infov.occurTime >= :occurTime and infov.occurTime <= :closeTime")
List<XcdWarningInfoView> findXcdWarningInfoViewByKpiIdAndProvinceIdandBeginToEndTime(@Param(value = "kpiId")Long kpiId,@Param(value = "provinceId")Long provinceId,
@Param(value = "occurTime")Date occurTime,@Param(value = "closeTime") Date closeTime);
}
......@@ -2,8 +2,11 @@ package com.hp.cmsz.service.monitoroperation;
import com.hp.cmsz.entity.AssociateDiagosisDetail;
import com.hp.cmsz.entity.XcdWarningInfoView;
import com.hp.cmsz.repository.DimAssociationAnaInfoDao;
import com.hp.cmsz.repository.XcdWarningInfoViewDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -14,6 +17,7 @@ import javax.persistence.EntityManagerFactory;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
@Service
......@@ -25,6 +29,9 @@ public class AssociateDiagosisDetailService {
@Autowired
private DimAssociationAnaInfoDao dimAssociationAnaInfoDao;
@Autowired
private XcdWarningInfoViewDao xcdWarningInfoViewDao;
/*
public List<AssociateDiagosisDetail> findLastDiagosisDetail() {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd:HH:mm:ss");
......@@ -69,6 +76,10 @@ public class AssociateDiagosisDetailService {
System.out.println(beginTime+","+endTime+","+associationId);
return dimAssociationAnaInfoDao.findDetailByAssociationIdAndWarnBeginToEndTime(beginTime,endTime,associationId);
}
public List<XcdWarningInfoView> findXcdWarningInfoViewByKpiIdAndProvinceIdandBeginToEndTime(Long kpiId, Long provinceId,
Date occurTime, Date closeTime){
return xcdWarningInfoViewDao.findXcdWarningInfoViewByKpiIdAndProvinceIdandBeginToEndTime(kpiId, provinceId, occurTime, closeTime);
}
}
......@@ -88,7 +88,6 @@ public class ModelMaintainController {
model.put("deployedServerList", deployedServerList);
model.put("dataTypeList", dataTypeList);
//wei le 测试 自己的判断
return PageURLController.ModelMaintain;
}
......
......@@ -8,6 +8,7 @@ import com.hp.cmsz.repository.*;
import com.hp.cmsz.service.*;
import com.hp.cmsz.service.monitoroperation.*;
import com.hp.cmsz.web.PageURLController;
import net.sf.ehcache.transaction.xa.ExpiredXidTransactionIDImpl;
import org.apache.poi.hssf.usermodel.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
......@@ -218,6 +219,52 @@ public class AssociateDiagosisDetailController {
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();
try {
d=sdf.parse(str);
}catch (Exception e){
throw new Exception("日期格式不对");
}
return d;
}
public static String getOld(){
Calendar calendar=Calendar.getInstance();
......
function initTable(){
jsonStr = document.getElementById('gzfxDetail').value;
// alert("jsonStr" +jsonStr);
var header = new Array();
......
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