Commit 7df04dec authored by 胡斌's avatar 胡斌

智能分析平台备份提交

parent 9a7aad19
......@@ -84,7 +84,7 @@ public class TSWBAnalysisService {
} catch (ParseException e) {
e.printStackTrace();
}
Specification<TSWB_YZDetailData> spec = buildYzDetailSpecification(startTime,endTime);
return tSWB_YZDetailDataDao.findAll(spec,pageRequest);
......
......@@ -309,9 +309,6 @@ public class TaskManageController {
}
@RequestMapping(value = "/taskDeleteFrame")
public String taskDeleteFrame(Long taskId, @RequestParam(required = false) String defaultTaskType) {
runTaskService.deleteRunTask(taskId);
......@@ -336,10 +333,6 @@ public class TaskManageController {
return runTaskService.checkNameAndCode(java.net.URLDecoder.decode(name, "UTF-8"), code, id, defaultTaskType);
}
@RequestMapping(value = "/modelPreview")
@ResponseBody
public APPEWarningDetail ModelPreview(String id){
......@@ -386,6 +379,7 @@ public class TaskManageController {
}
return app;
};
@RequestMapping(value = "/modelPreviewImg")
public void ModelPreview(HttpServletResponse response,String path){
// System.out.println("fileName:"+path);
......@@ -417,4 +411,32 @@ public class TaskManageController {
public String ImgDisplay(Map model) throws ParseException {
return PageURLController.RunTaskImgDisplay;
}
@RequestMapping(value = "/getParameterByTaskId*", method = RequestMethod.GET)
@ResponseBody
public List<ModelParameter> getParameter(String taskId ,Map model) throws ParseException {
List<ModelParameter> mpl = modelParameterDao.findByTaskIdAndIfSystemDefault(Long.parseLong(taskId),1L);
return mpl;
}
@RequestMapping(value = "/updateParameter*", method = RequestMethod.GET)
@ResponseBody
public String updateParameter(String parameterId,String parameterVal ,Map model) throws ParseException {
String [] paramIdArr = null;
String [] paramValArr = null;
if(",".contains(parameterId)){
paramIdArr = parameterId.split(",");
paramValArr = parameterVal.split(",");
}else{
if(StringUtils.isNotEmpty(parameterId)){
paramIdArr = new String[]{parameterId};
paramValArr = new String[]{parameterVal};
}
}
return "success";
}
}
\ No newline at end of file
......@@ -191,28 +191,12 @@
$("#createFilter").click(function(){
$.dialog({
title: "提醒",
content:"确定新建过滤规则?",
ok: function(){location.href="${ctx}/AnalysisSupport/FilterRuleMaintain";},
okValue:"确定",
cancel: function(){},
cancelValue:"取消",
lock:true
});
location.href="${ctx}/AnalysisSupport/FilterRuleMaintain";
});
$("#updateFilter").click(function(){
var filterRuleId = $("input[name='update']:checked").val();
$.dialog({
title: "提醒",
content:"确定修改过滤规则?",
ok: function(){location.href="${ctx}/AnalysisSupport/FilterRuleConfiguration?filterRuleId="+filterRuleId;},
okValue:"确定",
cancel: function(){},
cancelValue:"取消",
lock:true
});
location.href="${ctx}/AnalysisSupport/FilterRuleConfiguration?filterRuleId="+filterRuleId;
});
$("#deleteFilter").click(function(){
......@@ -229,7 +213,6 @@
async: false,
dataType : "json",
success: function(data){
console.log(data)
if(data.status === "success"){
location.href = "${ctx}/AnalysisSupport/FilterRuleResult"
}
......
......@@ -244,35 +244,62 @@
//删除一条参数
function deleteRow(elementTag, parameterId){
if(parameterId==""){
$(elementTag).parent().parent().remove();
}else{
$.ajax({
type : "GET",
contentType : "application/json",
url:"${ctx}/ModelManage/ModelParameterConfiguration/deleteParameter?parameterId="+parameterId,
dataType : "text",
beforeSend: function(data){},
success:function(){
$(elementTag).parent().parent().remove();
}
});
}
$.dialog({
title: "提醒",
content:"确定要删除该条参数吗<span style='color: red'>(该操作不可恢复)</span>?",
ok: function(){
if(parameterId==""){
$(elementTag).parent().parent().remove();
}else{
$.ajax({
type : "GET",
contentType : "application/json",
url:"${ctx}/ModelManage/ModelParameterConfiguration/deleteParameter?parameterId="+parameterId,
dataType : "text",
beforeSend: function(data){},
success:function(){
$(elementTag).parent().parent().remove();
}
});
}
},
okValue:"确定",
cancel: function(){},
cancelValue:"取消",
lock:true
});
}
//删除所有参数
function deleteAllTr(){
$.ajax({
type : "GET",
contentType : "application/json",
url:"${ctx}/ModelManage/ModelParameterConfiguration/deleteParameter?dataModelId="+getDataModelId,
dataType : "text",
beforeSend: function(data){},
success:function(){
$("#addTr").empty();
}
});
$.dialog({
title: "提醒",
content:"确定要删除所有参数吗<span style='color: red'>(该操作不可恢复)</span>?",
ok: function(){
$.ajax({
type : "GET",
contentType : "application/json",
url:"${ctx}/ModelManage/ModelParameterConfiguration/deleteParameter?dataModelId="+getDataModelId,
dataType : "text",
beforeSend: function(data){},
success:function(){
$("#addTr").empty();
}
});
},
okValue:"确定",
cancel: function(){},
cancelValue:"取消",
lock:true
});
};
//修改/增加一条参数
......
......@@ -127,28 +127,32 @@
" <td>"+data.kpiName+"</td>" +
" </tr>" +
" <tr>" +
" <td>预测开始时间</td>" +
" <td>"+df.format(new Date(data.busdatabegTime))+"</td>" +
" <td>预测结束时间</td>" +
" <td>"+df.format(new Date(data.busdataendTime))+"</td>" +
" <td>阈值1</td>" +
" <td>"+removeNull(data.threshold1Val)+"</td>" +
" <td>预测开始</td>" +
" <td colspan='3'>"+df.format(new Date(data.busdatabegTime))+"</td>" +
" <td>预测结束</td>" +
" <td colspan='3'>"+df.format(new Date(data.busdataendTime))+"</td>" +
" </tr>" +
" <tr>" +
" <td>阈值1</td>" +
" <td>"+removeNull(data.threshold1Val)+"</td>" +
" <td>阈值2</td>" +
" <td>"+removeNull(data.threshold2Val)+"</td>" +
" <td>阈值3</td>" +
" <td>"+removeNull(data.threshold3Val)+"</td>" +
" <td>阈值告警1</td>" +
" <td>"+removeNull(data.warn1Val)+"</td>" +
" </tr>" +
" <tr>" +
" <td>阈值告警1</td>" +
" <td>"+removeNull(data.warn1Val)+"</td>" +
" <td>阈值告警2</td>" +
" <td>"+removeNull(data.warn2Val)+"</td>" +
" <td>阈值告警3</td>" +
" <td>"+removeNull(data.warn3Val)+"</td>" +
" </tr>" +
" <tr>" +
" <td>模型评价</td>" +
" <td colspan='6' align='center'>"+data.evaluationResult+"</td>" +
" </tr>" +
" <tr>" +
" <td colspan='8' align='center'>图表展示</td>" +
" </tr>" +
" <tr>" +
......
......@@ -26,15 +26,7 @@ taskName = "沙盒任务";
taskName = "自定义任务";
</c:if>
function addTask() {
$.dialog({
title: "提醒",
content:"确定新增" + taskName + "?",
ok: function(){window.location.href='${ctx}/BaseManage/TaskManage/taskFormFrame?defaultTaskType=${queryCondition.defaultTaskType}'+"&type=new"},
okValue:"确定",
cancel: function(){},
cancelValue:"取消",
lock:true
});
window.location.href='${ctx}/BaseManage/TaskManage/taskFormFrame?defaultTaskType=${queryCondition.defaultTaskType}'+"&type=new"
}
function editTask() {
......@@ -43,15 +35,8 @@ taskName = "自定义任务";
alert("请选择一条记录");
return;
}
$.dialog({
title: "提醒",
content:"确定修改" + taskName + "?",
ok: function(){window.location.href = '${ctx}/BaseManage/TaskManage/taskFormFrame?defaultTaskType=${queryCondition.defaultTaskType}&taskId=' + id+"&type=modify";},
okValue:"确定",
cancel: function(){},
cancelValue:"取消",
lock:true
});
window.location.href = '${ctx}/BaseManage/TaskManage/taskFormFrame?defaultTaskType=${queryCondition.defaultTaskType}&taskId=' + id+"&type=modify";
}
function deleteTask() {
......@@ -104,22 +89,14 @@ taskName = "自定义任务";
} else if(status == '2') {
action = '暂停';
}
$.dialog({
title: "提醒",
content:"确定" + action + taskName + "?",
ok: function(){
$.ajax({
type : 'post',
'url' : '${ctx}/BaseManage/TaskManage/updateStatusFrame',
data : "newTaskStatus=" + status + "&defaultTaskType=" + $('#defaultTaskType').val() + "&taskId=" +id,
success : function(data) {
queryResult($('#currentPage').val()? $('#currentPage').val() : 1);
}
});},
okValue:"确定",
cancel: function(){},
cancelValue:"取消",
lock:true
$.ajax({
type : 'post',
'url' : '${ctx}/BaseManage/TaskManage/updateStatusFrame',
data : "newTaskStatus=" + status + "&defaultTaskType=" + $('#defaultTaskType').val() + "&taskId=" +id,
success : function(data) {
queryResult($('#currentPage').val()? $('#currentPage').val() : 1);
}
});
}
......@@ -134,7 +111,7 @@ taskName = "自定义任务";
}
});
}
function preview(e){
function preview(){
var id = $('input[name="taskId"]:checked').val();
var taskType = '${queryCondition.defaultTaskType}';
<%--${ctx}/static/images/loading.gif--%>
......@@ -154,8 +131,63 @@ taskName = "自定义任务";
}
function parameterChange() {
var id = $('input[name="taskId"]:checked').val();
$.ajax({
url:'${ctx}/BaseManage/TaskManage/getParameterByTaskId?taskId='+id,
type:'get',
success:function (data) {
var context = "<div style='width:420px;height: 130px;overflow: auto'>" +
"<table class='table table-hover table-striped' id='displayParam' >" +
"<thead>" +
"<tr><th>参数名</th><th>参数值</th><th>参数类型</th></tr>" +
"</thead>" +
"<tbody id='addTr'>";
data.forEach(function (t) {
context +='<tr class="parameterTr" id='+t.parameterId+'><td>'+t.parameterName+'</td><td><input type="text" class="parameterValue" value="'+t.parameterValue+'"/></td><td>'+t.parameterDataType+'</td></tr>';
});
context = context+
"</tbody>" +
"</table>" +
"<div><button class='btn-sm btn btn-success btn-sm btn-group btn-group-cog' onclick='changeParameter();'>确认</button></div>"+
"</div>";
$.dialog({
title:'参数修改',
content:context,
lock: true
});
}
})
}
function changeParameter() {
var paramId = "";
var paramVal = "";
var trL = $('tr[class="parameterTr"]').each(function(){
paramId+= $(this).context.id+",";
paramVal+= $(this).find("input").val()+",";
});
paramId = paramId.substring(0,paramId.length-1)
paramVal = paramVal.substring(0,paramVal.length-1)
$.ajax({
url:'${ctx}/BaseManage/TaskManage/updateParameter?parameterId='+paramId+"&parameterVal="+paramVal,
type:'get',
success:function (data) {
}
})
}
function choseTask(){
$("#ModelPreview").attr("disabled", false);
$("#parameterChange").attr("disabled", false);
}
$(document).ready(function(){
......
......@@ -6,7 +6,7 @@
<div class="table-header">任务列表
<div id="time_div" style="top: -6px;float: right;height: 0px;position: relative;">
<button class="btn-sm btn btn-primary btn-sm btn-group btn-group-cog" onclick="changeTaskStatus('1')">运行</button>
<button class="btn-sm btn btn-success btn-sm btn-group btn-group-cog" onclick="changeTaskStatus('1')">运行</button>
<button class="btn-sm btn btn-primary btn-sm btn-group btn-group-cog" onclick="changeTaskStatus('2')">暂停</button>
<button class="btn-sm btn btn-primary btn-sm btn-group btn-group-cog" onclick="editTask();">修改</button>
<button class="btn-sm btn btn-warning btn-sm btn-group btn-group-cog" onclick="deleteTask();">删除</button>
......@@ -14,6 +14,7 @@
<%--create by afe 2017-10-26--%>
<c:if test="${runTask.defaultTaskType == '1' || runTask.defaultTaskType == '5' }">
<button class="btn-sm btn btn-primary btn-sm btn-group btn-group-cog" id="ModelPreview" onclick="preview()" disabled>模型预览</button>
<button class="btn-sm btn btn-primary btn-sm btn-group btn-group-cog" id="parameterChange" onclick="parameterChange()" disabled>参数修改</button>
</c:if>
</div>
</div>
......
......@@ -127,16 +127,16 @@ function filterResultDetailTable(){
var header = new Array();
header[0] = ["","radio","1%",""];
header[1] = ["过滤规则ID","warningFilteringRuleId","7%","15"];
header[2] = ["省份","provinceId","7%","15"];
header[3] = ["渠道","channel","7%","15"];
header[4] = ["业务","business","7%","15"];
header[5] = ["数据来源","datasource","7%","15"];
header[6] = ["影响开始时间","filteringStartTime","7%","15"];
header[7] = ["影响结束时间","filteringEndTime","7%","15"];
header[8] = ["是否重复","ifRepeat","7%","15"];
header[9] = ["过滤周期","frequency","7%","15"];
header[10] = ["过滤原因","filteringReason","7%","15"];
// header[1] = ["过滤规则ID","warningFilteringRuleId","7%","15"];
header[1] = ["省份","provinceId","7%","15"];
header[2] = ["渠道","channel","7%","15"];
header[3] = ["业务","business","7%","15"];
header[4] = ["数据来源","datasource","7%","15"];
header[5] = ["影响开始时间","filteringStartTime","7%","15"];
header[6] = ["影响结束时间","filteringEndTime","7%","15"];
header[7] = ["是否重复","ifRepeat","7%","15"];
header[8] = ["过滤周期","frequency","7%","15"];
header[9] = ["过滤原因","filteringReason","7%","15"];
window.pagging = new table_pagging({limit:12,tableId:'filterResultTable',header:header});
pagging.pagging(jsonData);
}
......@@ -295,29 +295,29 @@ table_pagging.prototype = {
if(tdContext==null){
tdContext = "&nbsp;";
}
if(k===2){
if(k===1){
tdContext = this.getProvinceName(tdContext)
}
if(k===3){
if(k===2){
tdContext = this.getChannel(this.getData(this.objectlist[i],"kpiId"))
}
if(k===4){
if(k===3){
tdContext = this.getBusiness(this.getData(this.objectlist[i],"kpiId"))
}
if(k===5){
if(k===4){
tdContext = this.getDataSource(this.getData(this.objectlist[i],"kpiId"))
}
if(k===6){
if(k===5){
tdContext = df.format(new Date(tdContext))
}
if(k===7){
if(k===6){
tdContext = df.format(new Date(tdContext))
}
if(k===8){
if(k===7){
tdContext = (tdContext==1)?"是":"否";
}
if(k===9){
if(k===8){
if(tdContext.indexOf("/")!==-1){
var unit = tdContext.split("/")[1];
var value = tdContext.split("/")[0];
......
......@@ -134,11 +134,11 @@ function ruleResultDetailTable(){
header[2] = ["业务","businessName","7%","15"];
header[3] = ["指标名称","kpiName","7%","15"];
header[4] = ["指标编码","kpiCode","7%","15"];
header[5] = ["数据类型","kpiTypeName","7%","15"];
header[6] = ["数据采集频率","calCycle","7%","15"];
header[7] = ["监控延迟时间","kpiMonitorTime","7%","15"];
// header[11] = ["指标采集时间","businessTime","7%","15"];
header[8] = ["准确性规则","accuracyRuleId","7%","15"];
// header[5] = ["数据类型","kpiTypeName","7%","15"];
header[5] = ["数据采集频率","calCycle","7%","15"];
header[6] = ["监控延迟时间","kpiMonitorTime","7%","15"];
// headr[11] = ["指标采集时间","businessTime","7%","15"];
header[7] = ["准确性规则","accuracyRuleId","7%","15"];
window.pagging = new table_pagging({limit:12,tableId:'ruleResultTable',header:header});
pagging.pagging(jsonData);
......@@ -301,7 +301,7 @@ table_pagging.prototype = {
tdContext = "&nbsp;";
}
if(k==7){
if(k==6){
if(tdContext.indexOf("/")!=-1){
var a = new Array();
a = tdContext.split("/");
......@@ -325,7 +325,7 @@ table_pagging.prototype = {
// tdContext = df.format(new Date(tdContext));
// }
// }
if(k==8){
if(k==7){
tdContext = "<a href='javascript:;' onclick='selectRule(\""+this.getData(this.objectlist[i],"qualityRuleId")+"\")'>查看规则</a>";
}
......
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