Commit 196722b8 authored by 胡斌's avatar 胡斌

智能分析平台备份

parent 96875115
No preview for this file type
......@@ -8,6 +8,9 @@ import org.springframework.data.repository.query.Param;
import com.hp.cmsz.entity.commonmanage.RunTask;
import javax.persistence.SequenceGenerator;
import java.util.List;
/**
* RunTask实体类对应的Dao层实现
*
......@@ -23,4 +26,7 @@ public interface RunTaskDao extends PagingAndSortingRepository<RunTask, Long>, J
@Modifying
@Query("update RunTask t set t.taskStatus='3' where t.taskType.tasktypeId=1 and t.dataModelView.dataModelId=:dataModelId ")
public void updateTaskStatusByModelId(@Param("dataModelId") Long dataModelId);
}
......@@ -44,8 +44,8 @@ public class PageURLController {
public static String ImgDisplay="MonitorOperation/ImgDisplay";
//模型监控下的预览图片展示
//ImgDisplay映射到WEB-INF/views下的MonitorOperation/ImgDisplay.jsp页面
public static String RunTaskImgDisplay="TaskManage/ImgDisplay";
//RunTaskImgDisplay-INF/TaskManage/RunTaskImage.jsp页面
public static String RunTaskImgDisplay="TaskManage/RunTaskImage";
//监控运营下的告警分析
//WarnAnalysis映射到WEB-INF/views下的MonitorOperation/WarnAnalysis.jsp页面
......
package com.hp.cmsz.web.commonmanage;
import com.hp.cmsz.repository.commonmanage.EWarningCalcResultDao;
import com.hp.cmsz.repository.commonmanage.RunTaskDao;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementer;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
......@@ -11,6 +13,10 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import javax.persistence.Query;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
......@@ -53,6 +59,8 @@ public class TaskManageController {
@Autowired
private BusinessDao businessDao;
@Autowired
private RunTaskDao runTaskDao;
@Autowired
private com.hp.cmsz.repository.PublicDao PublicDao;
......@@ -99,17 +107,10 @@ public class TaskManageController {
@RequestParam(value = "pageSize", defaultValue = "5") int pageSize,
RunTask runTask, String newTaskStatus) {
ModelAndView modelAndView = new ModelAndView(PageURLController.RunTaskList);
/*if (StringUtils.isNotEmpty(newTaskStatus) && runTask.getTaskId() != null) {
runTaskService.updateTaskStatus(runTask.getTaskId(), newTaskStatus);
}
Page<RunTask> taskList = runTaskService.getRunTaskPage(runTask, pageNumber, pageSize, sortType);
modelAndView.addObject("taskList", taskList);*/
modelAndView.addObject("queryCondition", runTask);
modelAndView.addObject("pageSize", pageSize);
modelAndView.addObject("sortType", sortType);
modelAndView.addObject("taskTypeList", runTaskService.getTaskTypeList());
// modelAndView.addObject("useType", defaultTaskType);
return modelAndView;
}
......@@ -342,7 +343,8 @@ public class TaskManageController {
@RequestMapping(value = "/modelPreview")
@ResponseBody
public APPEWarningDetail ModelPreview(String id){
APPEWarningDetail app =null;
// APPEWarningDetail app = null;
APPEWarningDetail app = new APPEWarningDetail();
String modelSavePath = systemParameterDao.findByParameterName("MODEL_SCRIPT_FILE_DIR").get(0).getParameterValue();
RunTask rt = runTaskService.getRunTask(Long.parseLong(id));
......@@ -390,7 +392,7 @@ public class TaskManageController {
String modelSavePath = systemParameterDao.findByParameterName("MODEL_SCRIPT_FILE_DIR").get(0).getParameterValue();
File file = new File(modelSavePath+path);
// File file = new File("d:\\rscript\\al.jpg");
// File file = new File("D:\\game\\Warcraft3\\361_ee8b12708735464225629f3200a93.gif");
FileInputStream fis;
try {
fis = new FileInputStream(file);
......
......@@ -121,13 +121,12 @@
</div>
</div>
</div>
</body>
<script type="text/javascript">
<script>
$("#ruleBack").click(function(){
location.href="${ctx}/AnalysisSupport/FilterRuleResult";
});
$(".period").hide();
$(".ifRepeate").change(function (){
$(".period").hide();
$(".ifRepeate").change(function (){
var selectValue = $("input:radio[name='ifRepeate']:checked").val();
if (selectValue == 0){
var alertMsg=[];
......@@ -171,13 +170,13 @@ $(".ifRepeate").change(function (){
$(".period").hide();
}
});
function changeDate() {
});
function changeDate() {
$("input[name='ifRepeate']:eq(1)").attr("checked",'checked');
$(".period").hide();
}
}
function getProvinceCheckedValues() {
function getProvinceCheckedValues() {
var provinceArray = [];
var i=0;
$("#province:checked").each(function(){
......@@ -185,9 +184,9 @@ function getProvinceCheckedValues() {
i++;
});
return provinceArray;
}
}
function getProvinceCheckedValuesString(){
function getProvinceCheckedValuesString(){
var provinceStr="";
var provinceArray=getProvinceCheckedValues();
for(var i=0;i<provinceArray.length;i++){
......@@ -198,23 +197,23 @@ function getProvinceCheckedValuesString(){
}
}
return provinceStr;
}
}
var dataSourceValue =$("#dataSource").val();
var channelValue = $("#channel").val();
var businessIds = getBusinessCheckedValues();
var calCycleValue =$("#calCycle").val();
$("#dataSource").change(function(){
var dataSourceValue =$("#dataSource").val();
var channelValue = $("#channel").val();
var businessIds = getBusinessCheckedValues();
var calCycleValue =$("#calCycle").val();
$("#dataSource").change(function(){
dataSourceValue = $("#dataSource").val();
updateBusiness(dataSourceValue,channelValue);
});
$("#channel").change(function(){
});
$("#channel").change(function(){
channelValue = $("#channel").val();
updateBusiness(dataSourceValue,channelValue);
});
});
function updateKpi(businessIds){
function updateKpi(businessIds){
$.ajax({
type : "GET",
......@@ -227,13 +226,13 @@ function updateKpi(businessIds){
td.empty();
data = JSON.parse(data)
data.forEach(function(t){
td.append("<input type='checkbox' name='kpiinput' class='kpiItem' value='"+t[0]+"' checked >"+t[1]+"</input>")
td.append("<input type='checkbox' name='kpiinput' class='kpiItem' value='"+t[0]+"' checked />"+t[1])
});
}
});
}
}
function updateBusiness(dataSource,channel){
function updateBusiness(dataSource,channel){
$.ajax({
type : "GET",
contentType : "application/json",
......@@ -246,7 +245,7 @@ function updateBusiness(dataSource,channel){
td.empty();
data = JSON.parse(data)
data.forEach(function(t){
td.append("<input type='checkbox' name='businessinput' class='businessItem' value='"+t[0]+"' checked >"+t[1]+"</input>")
td.append("<input type='checkbox' name='businessinput' class='businessItem' value='"+t[0]+"' checked />"+t[1])
businessIds+=t[0]+",";
});
updateKpi(businessIds);
......@@ -261,11 +260,11 @@ function updateBusiness(dataSource,channel){
updateKpi(businessIds);
});
}
}
updateBusiness($("#dataSource").val(),$("#channel").val());
updateBusiness($("#dataSource").val(),$("#channel").val());
function getBusinessCheckedValues(){
function getBusinessCheckedValues(){
var businessArray = [];
var i=0;
$("[name='businessinput']:checked").each(function(){
......@@ -273,9 +272,9 @@ function getBusinessCheckedValues(){
i++;
});
return businessArray;
}
}
function getBusinessCheckedValuesString(){
function getBusinessCheckedValuesString(){
var businessStr="";
var businessArray=getBusinessCheckedValues();
for(var i=0;i<businessArray.length;i++){
......@@ -286,9 +285,9 @@ function getBusinessCheckedValuesString(){
}
}
return businessStr;
}
}
function getKpiCheckedValues(){
function getKpiCheckedValues(){
var kpiArray = new Array();
var i=0;
$("[name='kpiinput']:checked").each(function(){
......@@ -296,9 +295,9 @@ function getKpiCheckedValues(){
i++;
});
return kpiArray;
}
}
function getKpiCheckedValuesString(){
function getKpiCheckedValuesString(){
var kpiStr="";
var kpiArray=getKpiCheckedValues();
for(var i=0;i<kpiArray.length;i++){
......@@ -309,11 +308,9 @@ function getKpiCheckedValuesString(){
}
}
return kpiStr;
}
}
$('#ruleSubmit').click(function () {
$('#ruleSubmit').click(function () {
var alertMsg = [];
var provinceArr = $("input:checkbox[name='province']:checked");
if(provinceArr.length ===0){
......@@ -392,9 +389,7 @@ $('#ruleSubmit').click(function () {
lock:true
});
}
})
})
</script>
\ No newline at end of file
</script>
</body>
......@@ -84,8 +84,19 @@
dilog.close();
document.getElementById("taskManageFrame").src='${ctx}'+"/BaseManage/TaskManage/taskFormFrame?defaultTaskType="+taskType+"&taskId=" + id+"&type=modify";
}
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(); //执行当前对象
}
function imgOnclick(e) {
openwin("${ctx}/BaseManage/TaskManage/ImgDisplay?"+e.src)
}
function OpenDialog(data,id,taskType) {
var df=new SimpleDateFormat();
......@@ -143,7 +154,7 @@
" <tr>" +
" <td colspan='8'>" +
" <div class=''>" +
" <a src='${ctx}/BaseManage/TaskManage/ImgDisplay?${ctx}/BaseManage/TaskManage/modelPreviewImg?path="+data.fileAddress+"'><img id='img' src='${ctx}/BaseManage/TaskManage/modelPreviewImg?path="+data.fileAddress+"'/></a>" +
" <img id='img' onclick='imgOnclick(this)' style='width:622px' src='${ctx}/BaseManage/TaskManage/modelPreviewImg?path="+data.fileAddress+"'/>" +
" </div>" +
" </td>" +
" </tr>" +
......
......@@ -217,18 +217,12 @@ var kpiOptions = new Array();
function submitForm() {
var url = '${ctx}/BaseManage/TaskManage/checkNameAndCode';
var data = 'name=' + $('#name').val() + "&code=" + $('#code').val() + "&id=" + $('#taskId').val() + "&defaultTaskType=" + $('#defaultTaskType').val() ;
/* if(!checkFrequency()) {
alert("运行频率允许的值为整数、小数、分数和格式为ADD_MONTHS(x)的字符串,其中x可以为整数、小数、分数");
$('#frequency').focus();
return;
} */
if (validate()) {
var i = $("#addTr").find("tr").size();
if(i==0){
checkAndSubmit(url, encodeURI(encodeURI(data)));
}else {
$("#addTr").find("tr").each(function () {
//alert($(this).find("td").eq(0).html());
var paramId = $(this).context.id;
var modelId = $('#modelId').val();
var paramName = $(this).find("td").eq(0).html();
......@@ -389,6 +383,9 @@ var kpiOptions = new Array();
$('#frequencyValue').append(monthOption);
}
}
function abandonTask(){
$.ajax({
type: "GET",
......
......@@ -47,7 +47,7 @@
<div class="content clearfix">
<div class="block clearfix">
<div class="tab-content">
<img id="img" src="${ctx}/static/images/loading.gif"/>
<img style="width: 100%" id="img" src="${ctx}/static/images/loading.gif"/>
</div>
</div>
</div>
......@@ -60,7 +60,8 @@
</div>
</div>
<script type="text/javascript">
var src=window.location.href.split('?')[1];
var src=window.location.href.split('?')[1]+"?"+window.location.href.split('?')[2];
$("#img").attr("src",src);
</script>
......
......@@ -319,15 +319,18 @@ table_pagging.prototype = {
+")' alt='"+i+"'>"+this.getData(this.objectlist[i],this.header[k][1])+"</a>";
}
if(k==11){
if(k==10){
if(tdContext!="&nbsp;"){
tdContext = df.format(new Date(tdContext));
}
}else if(k==11){
if(tdContext!="&nbsp;"){
tdContext = df.format(new Date(tdContext));
}else if(k==12){
if(tdContext!="&nbsp;"){
tdContext = df.format(new Date(tdContext));
}
}else if(k==15){
}else if(k==16){
if(tdContext=="已确认"){
tr.className="green-tr";
}else if(tdContext=="已关联协查单"){
......
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