Commit 308bcc9d authored by 莫林毅's avatar 莫林毅

监控运营->告警监控 ->预警和隐患维护 界面

1 增加 ‘关联诊断’ 按钮 2 删除部分 废代码
parent 8f5dfe95
......@@ -14,6 +14,7 @@ import com.hp.cmsz.repository.AssociateDiagosisDetailDao;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import java.math.BigInteger;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Calendar;
......@@ -63,6 +64,26 @@ public class AssociateDiagosisDetailService {
return dimAssociationAnaInfoDao.findAssociateDiagosisDetailByWarnTimeBeginAndEnd(warnBeginTime, warnEndTime);
}
public AssociateDiagosisDetail findObjByProvinceIdAndKpiIdAndoccurTimeAndCloseTime(Long provinceId, Long kpiId, String occurTime, String closeTime){
Object[] objects= dimAssociationAnaInfoDao.findObjByProvinceIdAndKpiIdAndoccurTimeAndCloseTime(provinceId, kpiId, occurTime, closeTime);
AssociateDiagosisDetail detail=new AssociateDiagosisDetail();
if(objects==null||objects.length<1){
return null;
}else{
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]);
return detail;
}
}
public List<Object[]> findLastMathAssociateDiagosisDetailByWarnTimeBeginAndEndAndDimesionAndProvinceList(String warnBeginTime, String warnEndTime, char dimension, List<Long> provincelist){
return dimAssociationAnaInfoDao.findLastMathAssociateDiagosisDetailByWarnTimeBeginAndEndAndDimesionAndProvinceList(warnBeginTime, warnEndTime,dimension,provincelist);
}
......
......@@ -82,6 +82,9 @@ public class AssociateDiagosisDetailController {
@Autowired
private AssociateDiagosisDetailService associateDiagosisDetailService;
@Autowired
private XcdWarningInfoViewDao xcdWarningInfoViewDao;
@RequestMapping("")
......@@ -200,6 +203,7 @@ public class AssociateDiagosisDetailController {
}
List<AssociateDiagosisWarningDetail> adwdl = new ArrayList<AssociateDiagosisWarningDetail>();
if(WarningDetailList !=null){
for (Object[] objects : WarningDetailList) {
AssociateDiagosisWarningDetail adwd = new AssociateDiagosisWarningDetail();
adwd.setASSOCIATION_ID(String.valueOf(objects[0]) );
......@@ -215,12 +219,7 @@ public class AssociateDiagosisDetailController {
adwd.setINFLUENCE_LEVEL(String.valueOf( objects[12]));
adwdl.add(adwd);
}
}
map.put("warningDetailList",adwdl);
......@@ -422,30 +421,57 @@ public class AssociateDiagosisDetailController {
}
@RequestMapping("/yinjingyinhuanToguanlianzhenduanmingxi")
public String yinjingyinhuanToguanlianzhenduanmingxi(Map model, ServletRequest request, HttpSession session)
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();
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);
}
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);
occurTime=calendar.getTime();
occurTimes=format.format(calendar.getTime());
}
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(associateDiagosisDetails));
model.put("diagosisDetails", gson.toJson(list1));
return PageURLController.AssociateDiagosisDetail;
}
}
}
......@@ -27,10 +27,6 @@
<script type="text/javascript">
$(document).ready(function(){
// alert(1);
// failureTable();
// initDateDetail();
//$("#businessSelectAreaDetail").hide();
initDate();
//初始化界面
initTable();
......@@ -143,10 +139,7 @@
<!--写故障明细列表处-->
<table class="table table-hover table-striped"
id="failureAnalysisDetailTable">
</table>
</div>
</div>
</div>
......
......@@ -710,12 +710,13 @@ th{
*/
$("#guanlian").click(function(){
alert(ids[0]);
if(ids.length>10){
// alert(ids[0]);
if(ids.length>1){
$.alert("最多只能选一个");
return;
}
window.location.href="${ctx}/MonitorOperation/AssociateDiagosisDetail/yinjingyinhuanToguanlianzhenduanmingxi";
//window.location.href="${ctx}/MonitorOperation/AssociateDiagosisDetail/yinjingyinhuanToguanlianzhenduanmingxi?warningId="+ids[0];
window.open("${ctx}/MonitorOperation/AssociateDiagosisDetail/yinjingyinhuanToguanlianzhenduanmingxi?warningId="+ids[0]);
});
$(function(){
......
......@@ -4,7 +4,6 @@ function initTable(){
jsonStr = document.getElementById('gzfxDetail').value;
// alert("jsonStr" +jsonStr);
var header = new Array();
header[0] = ["","1","1%",""];
header[1] = ["省份","provinceName","5%",""];
header[2] = ["类型","associationType","8%",""];
......
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