Commit 1a4c46a4 authored by afe's avatar afe

2017年11月20日

--增加预警与隐患分析内部协查等筛选 --预警与隐患分析状态一栏增加内部协查等 --内部协查单跳转到下发协查单页面 --过滤以下发的内部协查等不让重复下发
parent 55b5bbd8
This diff is collapsed.
No preview for this file type
......@@ -10,5 +10,6 @@ import java.util.List;
public interface GjfxRelatedInsideWorkingOrderDao extends PagingAndSortingRepository<GjfxRelatedInsideWorkingOrder, Long>,
JpaSpecificationExecutor<GjfxRelatedInsideWorkingOrder> {
List<GjfxRelatedInsideWorkingOrder> findAllByInnerWorkingOrderId(Long id);
List<GjfxRelatedInsideWorkingOrder> findAllByWarningIdIn(List id);
}
......@@ -5,12 +5,7 @@ import java.math.BigInteger;
import java.sql.Timestamp;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.*;
import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest;
......@@ -46,6 +41,7 @@ import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import org.elasticsearch.index.mapper.SourceToParse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -133,6 +129,7 @@ public class WorkingOrderCreateController {
String[] warningid = warningIds.split(",");
List<String> wid = changeStrToList(warningid);
System.out.println();
List<XcdWarningInfoView> xcdwarningdeattilinfo = xcdWarningInfoViewDao.findByWarningIdIn(wid);
String riskEarlyType = xcdwarningdeattilinfo.get(0).getRiskEarlyWarningTypeName();//根据告警id去查找对应的隐患id再查找出对应的隐患name
String channel = xcdwarningdeattilinfo.get(0).getChannelName();
......@@ -625,24 +622,14 @@ public class WorkingOrderCreateController {
xcdWorkingOrderInfo.setIfGeneratedBySystem('Y');//生成协查单时,将该字段置为Y,即是由系统触发生成
xcdWorkingOrderInfo.setWorkingOrderCode(strList.get(11));
gjfxWarningInfoService.updateRelXcdIdByWarningId('2', workingId, warningids);
for (int j = 0; j < modelIds.size(); j++) {
XcdWoRelatedModel xcdWoRelatedModel = new XcdWoRelatedModel();
xcdWoRelatedModel.setWorkingOrderId(workingId);
xcdWoRelatedModel.setDataModelId(Long.parseLong(modelIds.get(j)));
xcdWoRelatedModelDao.save(xcdWoRelatedModel);
}
//操作日志记录 start
/*CmszOperationLog cmszOperationLog=new CmszOperationLog();
UserInfo userinfo=(UserInfo) SecurityUtils.getSubject().getSession().getAttribute("CURRENT_USER_SESSION");
System.out.println(userinfo.getUserId());
cmszOperationLog.setUserId(userinfo.getUserId());
cmszOperationLog.setUserOperation("增加");
Date date=new Date();
System.out.println(date);
cmszOperationLog.setOperationDate(date);
cmszOperationLog.setOperationPage("WorkingOrderCreate.jsp");
cmszOperationLog.setOperationDesc("WORKING_ORDER_ID="+workingId);
cmszOperationLogDao.save(cmszOperationLog);*/
cmszOperationLogService.createLog("增加", "触发sm7生成协查单", "xcd_working_order_info_t.WORKING_ORDER_ID="
+ workingId);
//操作日志记录 end
......@@ -679,10 +666,28 @@ public class WorkingOrderCreateController {
throws ParseException, UnsupportedEncodingException {
String province = request.getParameter("province");
System.out.println("province: " + province);
String[] warningid = warningIdTwo.split(",|,"); //将传过来的以分号分隔的id字符串拆分成一个个的id并存到数组中
List<String> warnId = changeStrToList(warningid);
List<GjfxRelatedInsideWorkingOrder> related = gjfxRelatedInsideWorkingOrderDao.findAllByWarningIdIn(warnId);
Long relatedId = null;
String returninfo="";
if(related.size()!=0){
for (GjfxRelatedInsideWorkingOrder aRelated : related) {
relatedId = aRelated.getInnerWorkingOrderId();
}
}
if(relatedId !=null){
returninfo="已经创建过内部协查单 协查单单编码:";
return "redirect:/MonitorOperation/InsideXcd?returninfo=" + java.net.URLEncoder.encode(returninfo,"utf-8")+"&relatedId="+relatedId;
}else{
System.out.println("@@@@@@@@@@@");
gjfxWarningInfoService.warningStatusGjfxDetailInfo('3', warnId);
System.out.println("@@@@@@@@@@@");
// gjfxWarningInfoService.updateRelXcdIdByWarningId('2', workingId, warningids);
String xcdtitle = "";//9
String xcddescription = "";//10
String xcdprovince = "";//1
......@@ -758,7 +763,7 @@ public class WorkingOrderCreateController {
);
xcdWorkingOrderInfoService.saveInsideXcdInfo(info); //vertica有自动增长
List<String> warnId = changeStrToList(warningid);
Long workingId = info.getInnerWorkingOrderId();
try {
......@@ -777,10 +782,16 @@ public class WorkingOrderCreateController {
gjfxRelatedInsideWorkingOrderDao.save(gjfxRelatedInsideWorkingOrder);
}
String returninfo = "创建内部协查单成功,协查单单编码:" + workingId;
returninfo = "创建内部协查单成功,协查单单编码:" + workingId;
return "redirect:/MonitorOperation/WorkingOrderManage?returninfo=" + java.net.URLEncoder.encode(returninfo,"utf-8");
}
}
......
......@@ -7,10 +7,11 @@
<div id="ws2" class="slide-menu-option">
<label>告警状态</label> <!-- <div class="slide-select"> -->
<select class="slide-menu-select" id="relStatus" name="relStatus">
<option value="未确认,已确认,已关联协查单" title="全部"selected ><a href="#">全部</a></option>
<option value="未确认,已确认,已关联协查单,已关联内部协查单" title="全部"selected ><a href="#">全部</a></option>
<option value="未确认" title="未确认"><a href="#">未确认</a></option>
<option value="已确认" title="已确认"><a href="#">已确认</a></option>
<option value="已关联协查单" title="已关联协查单"><a href="#">已关联协查单</a></option>
<option value="已关联内部协查单" title="已关联内部协查单"><a href="#">已关联内部协查单</a></option>
</select>
<!-- </div> -->
</div>
......
......@@ -142,7 +142,7 @@
<div class="table-header">协查单列表
<shiro:hasAnyRoles name="admin,dataAnalysis,businessAnalysis">
<div class="bt-list-import" >
<input type="button" id="createXcd"class="btn btn-primary" style="margin-right:13px;" value="下发协查单" disabled=true onclick="">
<input type="button" id="createXcd" class="btn btn-primary" style="margin-right:13px;" value="下发协查单" disabled=true onclick="">
</div>
</shiro:hasAnyRoles>
</div>
......@@ -186,10 +186,10 @@
$(function(){
//初始化
xcdFindTable();
initDate()
initDate();
//筛选项提交按钮
$("#submit").click(function(){
$("#submit").click(searchTable);
function searchTable(){
var href;
if($('#workingOrderID').val()==null||$('#workingOrderID').val()==""){//协查单编号为空
if(getStatsDataSourceCheckedValues().length==0){ $.alert('数据来源选择不能为空!');}
......@@ -237,8 +237,72 @@
});
}
}
function getUrlParams() {
//获取当前URL地址
var search = window.location.search;
//从search中抽取从 1 开始到search.length字符,并以&分割获取写入字符串
var tmparray = search.substr(1, search.length).split("&");
var paramsArray = new Array;
if (tmparray != null) {
for (var i = 0; i < tmparray.length; i++) {
// 用=进行拆分,但不包括==
var reg = /[=|^==]/;
//用&替换reg
var set1 = tmparray[i].replace(reg, '&');
//以&分割获取
var tmpStr2 = set1.split('&');
var array = new Array;
array[tmpStr2[0]] = tmpStr2[1];
// 将array添加到paramsArray中,并返回长度
paramsArray.push(array);
}
}
// 返回参数数组
return paramsArray;
}
//根据参数名称获取参数值
function getParamValue(name) {
var paramsArray = getUrlParams();
if (paramsArray != null) {
for (var i = 0 ; i < paramsArray.length ; i++) {
for (var j in paramsArray[i]) {
if (j == name) {
return paramsArray[i][j];
}
}
}
}
return null;
}
var returninfo2;
returninfo2=getParamValue("returninfo");
var relatedId = getParamValue("relatedId");
if(returninfo2!=null){
$.alert(decodeURIComponent(returninfo2)+relatedId);
}
if(relatedId !=null){
$('#workingOrderID').val(relatedId);
searchTable();
toggleMenu('slidePushMenus');//隐藏筛选项
}
});
$("#createXcd").click(function(){
console.log(xcdId)
var xcdids = xcdId.split(",");
var msg ="";
for(var i=0;i<xcdids.length;i++) {
if (i == xcdids.length - 1) {
msg += "$"
} else {
msg += "$,"
}
}
openwin("${ctx}/MonitorOperation/WorkingOrderCreate?warningId="+xcdId+"&msg="+msg);
});
function getCol(json,name){return (json[name]!=null)?json[name]:'';}//防止空值时出现undefined
function batchOpenDialog(ids) {
......@@ -358,7 +422,15 @@
form.appendTo('body').submit().remove();
}
function openwin(url) {
var a = document.createElement("a"); //创建a对象
a.setAttribute("href", url);
a.setAttribute("target", "_blank");
a.setAttribute("id", "camnpr");
document.body.appendChild(a);
a.click(); //执行当前对象
}
</script>
......
......@@ -408,7 +408,6 @@
if(json[i].provinceId!=json[j].provinceId){
m++;
}
}
}
for(var p=0;p<json.length;p++){
......@@ -1006,13 +1005,11 @@ th{
var returninfo2;
returninfo2=getParamValue("returninfo");
console.log(returninfo2)
if(returninfo2!=null){
$.alert(decodeURIComponent(returninfo2));
}
});
......
......@@ -575,8 +575,17 @@ function radioChoose(clickObj){
if(clickObj.checked){
//alert(clickObj);
//alert(clickObj.nextSibling.innerHTML);
$("#updateButton").attr("disabled", false);
xcdId=parseInt(obj[parseInt(clickObj.nextSibling.innerHTML)].workingOrderId);
$("#createXcd").attr("disabled", false);
xcdId="";
var warningDataArr = obj[parseInt(clickObj.nextSibling.innerHTML)].alarmListRelation;
warningDataArr.forEach(function (t,i) {
if(i==warningDataArr.length-1){
xcdId +=t.warningId
}else{
xcdId +=t.warningId+","
}
});
// xcdId=parseInt(obj[parseInt(clickObj.nextSibling.innerHTML)].workingOrderId);
}
}
......
......@@ -332,6 +332,8 @@ table_pagging.prototype = {
tr.className="green-tr";
}else if(tdContext=="已关联协查单"){
tr.className="blue-tr";
}else if(tdContext == "已关联内部协查单"){
tr.className="orange-tr";
}else{
tr.className="white-tr";
}
......
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