Commit dc519c05 authored by Administrator's avatar Administrator

2018年5月3日 --智能分析平台

--协查单详情筛选项修改
parent 0469aae2
This diff is collapsed.
...@@ -24,13 +24,17 @@ public interface XcdDetailInfoViewDao extends PagingAndSortingRepository<XcdDet ...@@ -24,13 +24,17 @@ public interface XcdDetailInfoViewDao extends PagingAndSortingRepository<XcdDet
//根绝筛选条件从视图中去查找符合条件的协查单 //根绝筛选条件从视图中去查找符合条件的协查单
// List <XcdDetailInfoView> findDistinctWorkingOrderIdByEventHappenTimeBetweenAndChannelIdInAndWarningSourceIdInAndIncidenceInAndProvinceIdInOrderByEventHappenTimeDesc(Date time1,Date time2,Long[] channel, Long[] source,String[] level,Long[] province); // List <XcdDetailInfoView> findDistinctWorkingOrderIdByEventHappenTimeBetweenAndChannelIdInAndWarningSourceIdInAndIncidenceInAndProvinceIdInOrderByEventHappenTimeDesc(Date time1,Date time2,Long[] channel, Long[] source,String[] level,Long[] province);
List <XcdDetailInfoView> findWorkingOrderIdDistinctByEventHappenTimeBetweenAndProviderIdInAndDataSourceIdInAndChannelIdInAndWarningSourceIdInAndImportanceLevelIdInAndProvinceIdInOrderByEventHappenTimeDesc(Date time1,Date time2,Long[] provider,Long[] datasource,Long[] channel, Long[] source,Long[] level,Long[] province); @Query("from XcdDetailInfoView where eventHappenTime between ?1 AND ?2 and providerId in(?3) " +
"and dataSourceId in(?4) and channelId in(?5) and " +
"warningSourceId in(?6) and importanceLevelId in(?7) and provinceId in(?8) order by eventHappenTime desc")
List <XcdDetailInfoView> findAllOrderByTimeAndAll
(Date time1,Date time2,List<Long> provider,List<Long> datasource,List<Long> channel, List<Long> source,List<Long> level,List<Long> province);
//根绝筛选条件从视图中去查找符合条件的协查单(增加了告警来源为“其他”的筛选项) //根绝筛选条件从视图中去查找符合条件的协查单(增加了告警来源为“其他”的筛选项)
List <XcdDetailInfoView> findWorkingOrderIdDistinctByProviderIdInAndDataSourceIdInAndChannelIdInAndProvinceIdInAndWorkingOrderIdInOrderByEventHappenTimeDesc(Long[] provider,Long[] datasource,Long[] channel,Long[] province, List<Long> workingorderids); List <XcdDetailInfoView> findWorkingOrderIdDistinctByProviderIdInAndDataSourceIdInAndChannelIdInAndProvinceIdInAndWorkingOrderIdInOrderByEventHappenTimeDesc(List<Long> provider,List<Long> datasource,List<Long> channel,List<Long> province, List<Long> workingorderids);
//告警来源和告警级别同时全选就不再关联告警 //告警来源和告警级别同时全选就不再关联告警
List <XcdDetailInfoView> findWorkingOrderIdDistinctByEventHappenTimeBetweenAndProviderIdInAndDataSourceIdInAndChannelIdInAndProvinceIdInOrderByEventHappenTimeDesc(Date time1,Date time2,Long[] provider,Long[] datasource,Long[] channel,Long[] province); List <XcdDetailInfoView> findWorkingOrderIdDistinctByEventHappenTimeBetweenAndProviderIdInAndDataSourceIdInAndChannelIdInAndProvinceIdInOrderByEventHappenTimeDesc(Date time1,Date time2,List<Long> provider,List<Long> datasource,List<Long> channel,List<Long> province);
//end //end
//有协查单ID得到协查单 //有协查单ID得到协查单
...@@ -49,7 +53,7 @@ public interface XcdDetailInfoViewDao extends PagingAndSortingRepository<XcdDet ...@@ -49,7 +53,7 @@ public interface XcdDetailInfoViewDao extends PagingAndSortingRepository<XcdDet
//List <XcdDetailInfoView> findByEventHappenTimeBetweenAndChannelIdInAndWarningSourceIdInAndIncidenceInAndProvinceIdInAndRelevantFailureIdIsNullOrderByEventHappenTimeDesc(Date startTime, Date endTime, List<Long> channel, List<Long> warningSource, List<String> level, List<Long> province); //List <XcdDetailInfoView> findByEventHappenTimeBetweenAndChannelIdInAndWarningSourceIdInAndIncidenceInAndProvinceIdInAndRelevantFailureIdIsNullOrderByEventHappenTimeDesc(Date startTime, Date endTime, List<Long> channel, List<Long> warningSource, List<String> level, List<Long> province);
//根据协查单ID得到数据来源和渠道 add by August //根据协查单ID得到数据来源和渠道 add by August
@Query("select xcd.dataSourceName, xcd.channelName from XcdDetailInfoView xcd where xcd.dataSourceId is not null and xcd.channelId is not null and xcd.workingOrderId in (:xcdIds)") @Query(value="select xcd.dataSourceName, xcd.channelName from XcdDetailInfoView xcd where xcd.dataSourceId is not null and xcd.channelId is not null and xcd.workingOrderId in (:xcdIds)",nativeQuery=true)
List<Object[]> getDataSourceNameAndChannelNameByXcdId(@Param("xcdIds")List<Long> xcdIds); List<Object[]> getDataSourceNameAndChannelNameByXcdId(@Param("xcdIds")List<Long> xcdIds);
//根据协查单找最小的发生时间 //根据协查单找最小的发生时间
@Query("select min(xcd.eventHappenTime),max(xcd.actualCompletionTime) from XcdDetailInfoView xcd where xcd.workingOrderId in (:xcdIds)") @Query("select min(xcd.eventHappenTime),max(xcd.actualCompletionTime) from XcdDetailInfoView xcd where xcd.workingOrderId in (:xcdIds)")
......
...@@ -5,10 +5,7 @@ import java.math.BigInteger; ...@@ -5,10 +5,7 @@ import java.math.BigInteger;
import java.text.DateFormat; import java.text.DateFormat;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Calendar; import java.util.*;
import java.util.Date;
import java.util.List;
import java.util.Map;
import com.hp.cmsz.entity.InsideXcdWorkingOrderInfo; import com.hp.cmsz.entity.InsideXcdWorkingOrderInfo;
import com.hp.cmsz.repository.*; import com.hp.cmsz.repository.*;
...@@ -95,21 +92,29 @@ public class XcdWorkingOrderInfoService { ...@@ -95,21 +92,29 @@ public class XcdWorkingOrderInfoService {
// return (List<XcdWorkingOrderInfo>) xcdWorkingOrderInfoDao.findByEventHappenTimeBetweenAndChannelIdInAndWarningSourceIdInAndImportanceLevelIdInAndProvinceIdInAndIfClosedIn(time1,time2,channel,source,level ,province,cloesd); // return (List<XcdWorkingOrderInfo>) xcdWorkingOrderInfoDao.findByEventHappenTimeBetweenAndChannelIdInAndWarningSourceIdInAndImportanceLevelIdInAndProvinceIdInAndIfClosedIn(time1,time2,channel,source,level ,province,cloesd);
// } // }
//根据筛选条件从视图中查找对应的协查单 //根据筛选条件从视图中查找对应的协查单
public List<XcdDetailInfoView> getAllXcdWorkingOrderInfoBy(Date time1,Date time2,Long[] provider,Long[] datasource,Long[] channel,Long[] source,Long[] level ,Long[] province){ public List<XcdDetailInfoView> getAllXcdWorkingOrderInfoBy(Date time1,Date time2,List<Long> provider,List<Long> datasource,List<Long> channel,List<Long> source,List<Long> level ,List<Long> province){
System.out.println(time1);
System.out.println(time2);
System.out.println(provider);
System.out.println(datasource);
System.out.println(channel);
System.out.println(source);
System.out.println(level);
System.out.println(province);
// return xcdDetailInfoViewDao.findDistinctWorkingOrderIdByEventHappenTimeBetweenAndChannelIdInAndWarningSourceIdInAndIncidenceInAndProvinceIdInOrderByEventHappenTimeDesc(time1,time2,channel,source ,level,province); // return xcdDetailInfoViewDao.findDistinctWorkingOrderIdByEventHappenTimeBetweenAndChannelIdInAndWarningSourceIdInAndIncidenceInAndProvinceIdInOrderByEventHappenTimeDesc(time1,time2,channel,source ,level,province);
return xcdDetailInfoViewDao.findWorkingOrderIdDistinctByEventHappenTimeBetweenAndProviderIdInAndDataSourceIdInAndChannelIdInAndWarningSourceIdInAndImportanceLevelIdInAndProvinceIdInOrderByEventHappenTimeDesc(time1,time2,provider,datasource,channel,source ,level,province); return xcdDetailInfoViewDao.findAllOrderByTimeAndAll(time1,time2,provider,datasource,channel,source ,level,province);
} }
//根据筛选条件从视图中查找对应的协查单(增加了告警来源为“其他”的筛选项) //根据筛选条件从视图中查找对应的协查单(增加了告警来源为“其他”的筛选项)
public List<XcdDetailInfoView> getAllXcdWorkingOrderInfoByOther(Long[] provider,Long[] datasource,Long[] channel,Long[] province, List<Long>workingOrderIds){ public List<XcdDetailInfoView> getAllXcdWorkingOrderInfoByOther(List<Long> provider,List<Long> datasource,List<Long> channel,List<Long> province, List<Long>workingOrderIds){
return xcdDetailInfoViewDao.findWorkingOrderIdDistinctByProviderIdInAndDataSourceIdInAndChannelIdInAndProvinceIdInAndWorkingOrderIdInOrderByEventHappenTimeDesc(provider,datasource,channel,province,workingOrderIds); return xcdDetailInfoViewDao.findWorkingOrderIdDistinctByProviderIdInAndDataSourceIdInAndChannelIdInAndProvinceIdInAndWorkingOrderIdInOrderByEventHappenTimeDesc(provider,datasource,channel,province,workingOrderIds);
} }
//根据筛选条件从视图中查找对应的协查单,当告警来源和告警级别全选就不再关联告警 //根据筛选条件从视图中查找对应的协查单,当告警来源和告警级别全选就不再关联告警
public List<XcdDetailInfoView> getAllXcdWorkingOrderInfoNotRelBy(Date time1,Date time2,Long[] provider,Long[] datasource,Long[] channel,Long[] province){ public List<XcdDetailInfoView> getAllXcdWorkingOrderInfoNotRelBy(Date time1,Date time2,List<Long> provider,List<Long> datasource,List<Long> channel,List<Long> province){
return xcdDetailInfoViewDao.findWorkingOrderIdDistinctByEventHappenTimeBetweenAndProviderIdInAndDataSourceIdInAndChannelIdInAndProvinceIdInOrderByEventHappenTimeDesc(time1,time2,provider,datasource,channel,province); return xcdDetailInfoViewDao.findWorkingOrderIdDistinctByEventHappenTimeBetweenAndProviderIdInAndDataSourceIdInAndChannelIdInAndProvinceIdInOrderByEventHappenTimeDesc(time1,time2,provider,datasource,channel,province);
......
...@@ -9,11 +9,7 @@ import java.io.UnsupportedEncodingException; ...@@ -9,11 +9,7 @@ import java.io.UnsupportedEncodingException;
import java.math.BigInteger; import java.math.BigInteger;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.*;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.ServletRequest; import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
...@@ -378,6 +374,7 @@ public class WorkingOrderReasultController { ...@@ -378,6 +374,7 @@ public class WorkingOrderReasultController {
// @RequestParam(value = "ifClosed2") String ifClosed, // @RequestParam(value = "ifClosed2") String ifClosed,
@RequestParam(value = "xcdcode") String xcdcode, @RequestParam(value = "xcdcode") String xcdcode,
HttpServletResponse response) throws ParseException, UnsupportedEncodingException { HttpServletResponse response) throws ParseException, UnsupportedEncodingException {
System.out.println("warningSource"+warningSource);
List<XcdDetailInfoView> xcdWorkingOrderInfoS; //存到List中 List<XcdDetailInfoView> xcdWorkingOrderInfoS; //存到List中
//操作日志记录 //操作日志记录
cmszOperationLogService.createLog("查询","协查单明细","协查单明细查询"); cmszOperationLogService.createLog("查询","协查单明细","协查单明细查询");
...@@ -397,53 +394,81 @@ public class WorkingOrderReasultController { ...@@ -397,53 +394,81 @@ public class WorkingOrderReasultController {
String[] channels=channel.split(","); String[] channels=channel.split(",");
// List list1=new ArrayList(); // List list1=new ArrayList();
int size1=channels.length; int size1=channels.length;
Long[] channelS=new Long[size1]; List<Long> channelS = new ArrayList<Long>();
for(int i=0;i<channels.length;i++) for(int i=0;i<channels.length;i++){
{ channelS.add(Long.parseLong(channels[i]));
// list1.add(channels[i]); }
channelS[i]=Long.parseLong(channels[i]); // Long[] channelS=new Long[size1];
} // for(int i=0;i<channels.length;i++)
// {
//// list1.add(channels[i]);
// channelS[i]=Long.parseLong(channels[i]);
// }
String[] warningSources=warningSource.split(","); String[] warningSources=warningSource.split(",");
// List list2=new ArrayList(); int size2=warningSources.length;
int size2=warningSources.length; List<Long> warningSourceS = new ArrayList<Long>();
Long[] warningSourceS=new Long[size2]; for(int i=0;i<warningSources.length;i++){
for(int i=0;i<warningSources.length;i++) warningSourceS.add(Long.parseLong(warningSources[i]));
{ }
// list2.add(warningSources[i]); // System.out.println("string[]"+ Arrays.toString(warningSources));
warningSourceS[i]=Long.parseLong(warningSources[i]); //// List list2=new ArrayList();
} // int size2=warningSources.length;
// System.out.println("size2"+size2);
// Long[] warningSourceS=new Long[size2];
// for(int i=0;i<warningSources.length;i++)
// {
//// list2.add(warningSources[i]);
// warningSourceS[i]=Long.parseLong(warningSources[i]);
// }
// System.out.println("Long[]"+Arrays.toString(warningSourceS));
String[] importantLevels=importantLevel.split(","); String[] importantLevels=importantLevel.split(",");
int size3=importantLevels.length; int size3=importantLevels.length;
Long[] importantLevelS=new Long[size3]; List<Long> importantLevelS = new ArrayList<Long>();
for(int i=0;i<importantLevels.length;i++) for(int i=0;i<importantLevels.length;i++){
{ importantLevelS.add(Long.parseLong(importantLevels[i]));
// list1.add(channels[i]); }
importantLevelS[i]=Long.parseLong(importantLevels[i]); // Long[] importantLevelS=new Long[size3];
} // for(int i=0;i<importantLevels.length;i++)
// {
//// list1.add(channels[i]);
// importantLevelS[i]=Long.parseLong(importantLevels[i]);
// }
String[] provinces=province.split(","); String[] provinces=province.split(",");
int size4=provinces.length; int size4=provinces.length;
Long[] provinceS=new Long[size4]; List<Long> provinceS = new ArrayList<Long>();
for(int i=0;i<provinces.length;i++) for(int i=0;i<provinces.length;i++){
{ provinceS.add(Long.parseLong(provinces[i]));
provinceS[i]=Long.parseLong(provinces[i]); }
} // Long[] provinceS=new Long[size4];
// for(int i=0;i<provinces.length;i++)
// {
// provinceS[i]=Long.parseLong(provinces[i]);
// }
String[] datasourceid=datasource.split(","); String[] datasourceid=datasource.split(",");
int size5=datasourceid.length; int size5=datasourceid.length;
Long[] datasourceS=new Long[size5]; List<Long> datasourceS = new ArrayList<Long>();
for(int i=0;i<datasourceid.length;i++) for(int i=0;i<datasourceid.length;i++){
{ datasourceS.add(Long.parseLong(datasourceid[i]));
datasourceS[i]=Long.parseLong(datasourceid[i]); }
} // Long[] datasourceS=new Long[size5];
// for(int i=0;i<datasourceid.length;i++)
// {
// datasourceS[i]=Long.parseLong(datasourceid[i]);
// }
String[] providerid=provider.split(","); String[] providerid=provider.split(",");
int size6=providerid.length; int size6=providerid.length;
Long[] providerS=new Long[size6]; List<Long> providerS = new ArrayList<Long>();
for(int i=0;i<providerid.length;i++) for(int i=0;i<providerid.length;i++){
{ providerS.add(Long.parseLong(providerid[i]));
providerS[i]=Long.parseLong(providerid[i]); }
} // Long[] providerS=new Long[size6];
// for(int i=0;i<providerid.length;i++)
// {
// providerS[i]=Long.parseLong(providerid[i]);
// }
if(size2>=4){ if(size2>=4){
xcdWorkingOrderInfoS =xcdWorkingOrderInfoService.getAllXcdWorkingOrderInfoNotRelBy(time1,time2,providerS,datasourceS,channelS,provinceS); xcdWorkingOrderInfoS =xcdWorkingOrderInfoService.getAllXcdWorkingOrderInfoNotRelBy(time1,time2,providerS,datasourceS,channelS,provinceS);
staticXcdDetailInfoView=xcdWorkingOrderInfoS; staticXcdDetailInfoView=xcdWorkingOrderInfoS;
......
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
<div id="ws3" class="slide-menu-option"> <div id="ws3" class="slide-menu-option">
<label>告警来源</label> <!-- <div class="slide-select"> --> <label>告警来源</label> <!-- <div class="slide-select"> -->
<select class="slide-menu-select" id="warningSource3" name="warningSource3"> <select class="slide-menu-select" id="warningSource3" name="warningSource3">
<option value="2,3" title="全部"selected><a href="#">全部</a></option> <option value="1,2,3" title="全部"selected><a href="#">全部</a></option>
<option value="1" title="外部告警"><a href="#">外部告警</a></option>
<option value="2" title="预警"><a href="#">预警</a></option> <option value="2" title="预警"><a href="#">预警</a></option>
<option value="3" title="隐患"><a href="#">隐患</a></option> <option value="3" title="隐患"><a href="#">隐患</a></option>
</select> </select>
......
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