Commit 620e6ff0 authored by afe's avatar afe

2017年11月02提交内容

--实现自定义协查单告警描述和内部协查单页面
parent 0897f6b5
This diff is collapsed.
......@@ -79,6 +79,7 @@ public class XcdWorkingOrderInfo implements Serializable{
public Long getWorkingOrderId() {
return workingOrderId;
}
public void setWorkingOrderId(Long workingOrderId) {
this.workingOrderId = workingOrderId;
}
......
......@@ -125,6 +125,16 @@ public class PageURLController {
//监控运营下的协查单管理
//WorkingOrderManage映射到WEB-INF/views下的MonitorOperation/WorkingOrderUpdate.jsp页面
public static String WorkingOrderUpdate="MonitorOperation/WorkingOrderUpdate";
//监控运营下的内部协查单管理
//WorkingOrderManage映射到WEB-INF/views下的MonitorOperation/WorkingOrderUpdate.jsp页面
public static String InsideXcd="MonitorOperation/InsideXcd";
//配置项分析
//PzxAnalysis映射到WEB-INF/views下的AnalysisSupport/PzxAnalysis.jsp页面
public static String PzxAnalysis="AnalysisSupport/PzxAnalysis";
......
/**
* Created by IntelliJ IDEA.
*User: afe
*Date: 2017/11/1
*Time: 17:06
*/
package com.hp.cmsz.web.monitoroperation;
import javax.servlet.ServletRequest;
import javax.servlet.http.HttpSession;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import com.hp.cmsz.web.PageURLController;
import java.util.Map;
/**
* WorkingOrderCreateControll类负责对协查单生成页面进行控制
*
* @author afe
*
*/
@Controller
@RequestMapping(value = "/MonitorOperation/InsideXcd")
public class InsideXcd {
private static Logger logger = LoggerFactory.getLogger(WorkingOrderCreateController.class);
//内部协查单列表页面
@RequestMapping(method = RequestMethod.GET)
public String WorkingOrderCreate( Map model,
ServletRequest request, HttpSession session) {
return PageURLController.InsideXcd;
}
}
......@@ -142,8 +142,13 @@ public class WorkingOrderCreateController {
@RequestMapping(method = RequestMethod.GET)
public String WorkingOrderCreate(@RequestParam(value = "warningId") String warningIds,@RequestParam(value = "msg") String msg, Map model,
ServletRequest request, HttpSession session) {
// System.out.println(warningIds.split(",").length);
alarmMsg = msg;
warningIdTwo = warningIds;
String[] warningid = warningIds.split(",");
List<String> wid = changeStrToList(warningid);
List<XcdWarningInfoView> xcdwarningdeattilinfo = xcdWarningInfoViewDao.findByWarningIdIn(wid);
......@@ -699,9 +704,13 @@ public class WorkingOrderCreateController {
int year = cal.get(Calendar.YEAR);//获取年份
int month = cal.get(Calendar.MONTH) + 1;//获取月份
System.out.println("@@@@@@@@@@@@@@@@@@@@"+alarmMsg);
String [] alarmMsgArr = alarmMsg.split("|");
String [] alarmMsgArr = alarmMsg.split(",");
String[] warningids = warningIdTwo.split(",|,");
System.out.println(alarmMsgArr.length);
List<String> ids = changeStrToList(warningids);
List<XcdWarningInfoView> xcdWarningInfoViews = xcdWarningInfoViewDao.findByWarningIdIn(ids);
......@@ -896,12 +905,60 @@ public class WorkingOrderCreateController {
wordMLPackage.getMainDocumentPart().addObject(p1);
//create by afe 01/11/2017 --添加告警描述↓
System.out.println(alarmMsgArr[i]);
P p3 = factory.createP();//创建段落P
// 创建默认的段落属性,并加入到段落对象中去
p3.setPPr(ppr);//段落属性PPr添加到P
R run12 = factory.createR();//创建文本段R
Text t12 = factory.createText();//创建文本段内容Text
t12.setValue("告警描述:");
run12.getRunContent().add(t12);//Text添加到R
run12.setRPr(rpr);//设置文本段R属性
p3.getParagraphContent().add(run12);//R添加到P
R run13 = factory.createR();//创建文本段R
Text t13 = factory.createText();//创建文本段内容Text
System.out.println(alarmMsgArr[i]);
//如果alarmsMsg是$占位符 就默认为空
if("$".equals(alarmMsgArr[i])){
t13.setValue(""); //告警描述
}else{
t13.setValue(alarmMsgArr[i]); //告警描述
}
run13.getRunContent().add(t13);//Text添加到R
run13.setRPr(rpr1);//设置文本段R属性
p3.getParagraphContent().add(run13);//R添加到P
wordMLPackage.getMainDocumentPart().addObject(p3);
//create by afe 01/11/2017 --添加告警描述↑
P p2 = factory.createP();//创建段落P
// 创建默认的段落属性,并加入到段落对象中去
p2.setPPr(ppr);//段落属性PPr添加到P
R run10 = factory.createR();//创建文本段R
Text t10 = factory.createText();//创建文本段内容Text
t10.setValue("涉及品牌:");
run10.getRunContent().add(t10);//Text添加到R
run10.setRPr(rpr);//设置文本段R属性
......@@ -977,19 +1034,24 @@ public class WorkingOrderCreateController {
for (int n = 0; n < solutions.size(); n++) {
if (solutions.get(n) != null) {
Object[] o = solutions.get(n);
ExportWordUtil.setParaContent(wordMLPackage, factory, "Normal", 93, 100, String.valueOf(n + 1) + "> "
+ (String) o[0], true, 22, "000000");
ExportWordUtil.setParaContent(wordMLPackage, factory, "Normal", 93, 100,
String.valueOf(n + 1) + "> " + (String) o[0], true, 22,
"000000");
// ExportWordUtil.addLineBreak(wordMLPackage,factory);//换行
ExportWordUtil.setParaContent(wordMLPackage, factory, "Normal", 93, 100, "协查单:" + (String) o[1], false,
ExportWordUtil.setParaContent(wordMLPackage, factory, "Normal", 93, 100,
"协查单:" + (String) o[1], false,
22, "000000");
// ExportWordUtil.addLineBreak(wordMLPackage,factory);
ExportWordUtil.setParaContent(wordMLPackage, factory, "Normal", 93, 100,
"时间:" + formatDate.format(o[2]), false, 22, "000000");
// ExportWordUtil.addLineBreak(wordMLPackage,factory);
ExportWordUtil.setParaContent(wordMLPackage, factory, "Normal", 93, 100, "详细原因:" + (String) o[3],
ExportWordUtil.setParaContent(wordMLPackage, factory, "Normal", 93, 100,
"详细原因:" + (String) o[3],
false, 22, "000000");
// ExportWordUtil.addLineBreak(wordMLPackage,factory);
ExportWordUtil.setParaContent(wordMLPackage, factory, "Normal", 93, 100, "建议解决方案:" + (String) o[4],
ExportWordUtil.setParaContent(wordMLPackage, factory, "Normal", 93, 100,
"建议解决方案:" + (String) o[4],
false, 22, "000000");
}
}
......
......@@ -140,8 +140,8 @@
<li><a href="${ctx}/MonitorOperation/WorkingOrderManage">预警和隐患维护</a></li>
<li><a href="${ctx}/MonitorOperation/WarnAnalysis">告警统计</a></li>
<li><a href="${ctx}/MonitorOperation/WarnAnalysisDetail">告警明细</a></li>
<%--create by hubin 2017-10-26 功能未实现 --%>
<li><a href="${ctx}/">内部协查单管理</a></li>
<%--create by hubin 2017-10-26 --%>
<li><a href="${ctx}/MonitorOperation/InsideXcd">内部协查单管理</a></li>
</ul>
</li>
......
This diff is collapsed.
......@@ -42,6 +42,8 @@ h3{font-size: 15px;}
<li ><a id="a_home1" href="${ctx}/MonitorOperation/WorkingOrderManage">预警和隐患维护</a></li>
<li class="active"><a id="a_home" href="#home" data-toggle="tab">告警统计</a> </li>
<li><a id="a_profile" href="${ctx}/MonitorOperation/WarnAnalysisDetail">告警明细</a> </li>
<li><a id="a_insideXcd" href="${ctx}/MonitorOperation/InsideXcd">内部协查单管理</a> </li>
</ul>
</div>
<div class="section">
......
......@@ -57,6 +57,7 @@ th{
<li ><a id="a_home1" href="${ctx}/MonitorOperation/WorkingOrderManage">预警和隐患维护</a></li>
<li><a id="a_home" href="${ctx}/MonitorOperation/WarnAnalysis">告警统计</a> </li>
<li class="active"><a id="a_profile" href="#profile" data-toggle="tab">告警明细</a> </li>
<li ><a id="a_insideXcd" href="${ctx}/MonitorOperation/InsideXcd">内部协查单管理</a> </li>
</ul>
</div>
<div class="section">
......
......@@ -366,11 +366,16 @@
//点击生成协查单按钮,跳转到生成协查单页面,并将相应的告警id传给生成协查单页面
$("#create").click(function(){
var warningIds="";
var msg =""
for(var i=0;i<ids.length;i++){
var ll ="$";//$作为一个占位符,防止后台无法识别数据
if(i<ids.length-1){
warningIds+=ids[i]+",";
msg+=ll+","
}else{
warningIds+=ids[i];
msg+=ll;
}
}
var k=0;
......@@ -427,7 +432,8 @@
$.alert("请选择同一省份同一渠道同一数据来源的告警来创建协查单!");
}else{
location.href="${ctx}/MonitorOperation/WorkingOrderCreate?warningId="+warningIds;
window.open("${ctx}/MonitorOperation/WorkingOrderCreate?warningId="+warningIds+"&msg="+msg);
}
}
......@@ -436,6 +442,7 @@
});
$("#preview").click(function () {
batchOpenDialog(ids)
});
......@@ -523,6 +530,8 @@ th{
<li class="active"><a id="a_home" href="#home" data-toggle="tab">预警和隐患维护</a></li>
<li><a id="a_home1" href="${ctx}/MonitorOperation/WarnAnalysis">告警统计</a> </li>
<li><a id="a_profile" href="${ctx}/MonitorOperation/WarnAnalysisDetail">告警明细</a> </li>
<li ><a id="a_insideXcd" href="${ctx}/MonitorOperation/InsideXcd">内部协查单管理</a> </li>
</ul>
</div>
<div class="section">
......@@ -1229,20 +1238,18 @@ function createWorkingDetail() {
}else{
var msgArr = document.getElementsByClassName("alarmMsg");
var msg = "";
for(var i=0;i<msgArr.length;i++){
if(i===msgArr.length-1){
msg = msg+msgArr[i].value
msg = msg+(msgArr[i].value===""?"$":msgArr[i].value)
}else{
msg = msg+ msgArr[i].value+"|"
msg = msg+ (msgArr[i].value===""?"$":msgArr[i].value)+","
}
}
console.log(msg)
location.href="${ctx}/MonitorOperation/WorkingOrderCreate?warningId="+warningIds+"&msg="+msg;
window.open("${ctx}/MonitorOperation/WorkingOrderCreate?warningId="+warningIds+"&msg="+msg);
}
}
......
This diff is collapsed.
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