Commit 1f031902 authored by afe's avatar afe

2017年11月24 智能分析平台提交内容

--欲分析建模--数据模型管理--模型监控
parent e7202c9c
This diff is collapsed.
......@@ -12,7 +12,7 @@ local.ip.prefix=192.168
#jdbc.driver=com.vertica.jdbc.Driver
#vertica database ip address
jdbc.dbip=192.168.113.117
jdbc.dbip=hg-computer
jdbc.dbport=5433
......
//package com.hp.cmsz.entity;
//
//import javax.persistence.Entity;
//import javax.persistence.Table;
//
//@Entity
//@Table(name="etl.APP_EWARNING_DETAIL_T")
//public class APPEWarningDetail {
// private Long EwarningDetailId;
//// private Long EwarningDetailId;
//
//
//
//}
......@@ -17,7 +17,7 @@ import javax.persistence.Table;
*
*/
@Entity
@Table(name = "dim_business_info_t")
@Table(name = "dim_business_info_t",schema="ccolap")
public class Business implements Serializable{
private Long businessId ;//业务ID
......
......@@ -25,6 +25,8 @@ public class ModelParameter implements Serializable{
private String parameterValue;//参数值
private String parameterDataType;//参数数据类型
private Long dataModelId;//数据模型ID
private Long taskId;//任务表ID
private Long ifSystemDefault;//是否系统默认
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="ModelParameterSequence")
......@@ -59,7 +61,16 @@ public class ModelParameter implements Serializable{
public void setDataModelId(Long dataModelId) {
this.dataModelId = dataModelId;
}
public Long getTaskId() {
return taskId;
}
public void setTaskId(Long taskId) {
this.taskId = taskId;
}
public Long getIfSystemDefault() {
return ifSystemDefault;
}
public void setIfSystemDefault(Long ifSystemDefault) {
this.ifSystemDefault = ifSystemDefault;
}
}
......@@ -3,6 +3,7 @@ package com.hp.cmsz.entity.commonmanage;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.FetchType;
......@@ -17,18 +18,13 @@ import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import com.hp.cmsz.entity.DataModel;
import com.hp.cmsz.entity.*;
@Entity
@Table(name = "RUN_TASK_T", schema = "ETL")
public class RunTask {
@Id
//@TableGenerator(name = "ID_GENERATOR", table = "ID_GEN", pkColumnName = "GEN_NAME", pkColumnValue = "NBR_PK", valueColumnName = "GEN_VALUE", allocationSize = 1)
//@GeneratedValue(strategy = GenerationType.TABLE, generator = "ID_GENERATOR")
/*@GenericGenerator(name = "idGenerator", strategy = "uuid")
@GeneratedValue(generator = "idGenerator")*/
//@GeneratedValue(strategy = GenerationType.IDENTITY)
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "RunTaskSequence")
@SequenceGenerator(name = "RunTaskSequence", sequenceName = "run_task_t_seq", allocationSize = 1)
private Long taskId;
......@@ -53,6 +49,27 @@ public class RunTask {
@JoinColumn(name = "MODEL_ID")
private DataModel dataModelView;
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "province_id")
private Province provinceView;
private Long kpiId;
// @ManyToOne(fetch = FetchType.EAGER)
// @JoinColumn(name = "channel_id")
// private Channel channelView;
//
// @ManyToOne(fetch = FetchType.EAGER)
// @JoinColumn(name = "dataSource_id")
// private DataSource dataSourceView;
// @ManyToOne(fetch = FetchType.EAGER)
// @JoinColumn(name = "business_id")
// private Business businessView;
@Temporal(TemporalType.TIMESTAMP)
private Date taskNextrunTime;
......@@ -179,7 +196,46 @@ public class RunTask {
this.taskContext = taskContext;
}
/*public String getParallelFlg() {
public Province getProvinceView() {
return provinceView;
}
public void setProvinceView(Province provinceView) {
this.provinceView = provinceView;
}
public Long getKpiId() {
return kpiId;
}
public void setKpiId(Long kpiId) {
this.kpiId = kpiId;
}
// public Channel getChannelView() {
// return channelView;
// }
//
// public void setChannelView(Channel channelView) {
// this.channelView = channelView;
// }
//
// public DataSource getDataSourceView() {
// return dataSourceView;
// }
//
// public void setDataSourceView(DataSource dataSourceView) {
// this.dataSourceView = dataSourceView;
// }
//
// public Business getBusinessView() {
// return businessView;
// }
//
// public void setBusinessView(Business businessView) {
// this.businessView = businessView;
// }
/*public String getParallelFlg() {
return parallelFlg;
}
......
......@@ -27,10 +27,13 @@ public interface ModelParameterDao extends JpaSpecificationExecutor<ModelParamet
@Modifying
@Query("update ModelParameter mp set mp.parameterName=:parameterName,mp.parameterValue=:parameterValue, mp.parameterDataType=:parameterDataType where mp.parameterId =:parameterId")
void updateParamByParameterId(@Param("parameterName")String parameterName,@Param("parameterValue")String parameterValue,@Param("parameterDataType")String parameterDataType,@Param("parameterId")Long parameterId);
//根据数据模型ID查找参数d
List<ModelParameter> findByDataModelId(Long dataModelId);
//根据数据模型ID查找系统默认的参数d
List<ModelParameter> findByDataModelIdAndIfSystemDefault(Long dataModelId, Long ifSystemDefault);
//根据数据模型ID查找参数d
List<ModelParameter> findByDataModelIdIn(List<Long> dataModelId);
......
package com.hp.cmsz.web.commonmanage;
import java.io.UnsupportedEncodingException;
import java.util.List;
//import com.hp.cmsz.entity.APPEWarningDetail;
import com.hp.cmsz.entity.*;
import com.hp.cmsz.repository.*;
import com.hp.cmsz.service.PublicService;
import org.apache.commons.lang3.StringUtils;
import org.apache.regexp.RE;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Controller;
......@@ -19,6 +25,9 @@ import com.hp.cmsz.service.commonmanage.RunTaskService;
import com.hp.cmsz.service.commonmanage.TaskDetailService;
import com.hp.cmsz.web.PageURLController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Controller
@RequestMapping(value = "/BaseManage/TaskManage/*")
public class TaskManageController {
......@@ -31,6 +40,25 @@ public class TaskManageController {
@Autowired
private CmszOperationLogService cmszOperationLogService;
@Autowired
private ModelParameterDao modelParameterDao;
@Autowired
private ChannelDao channelDao;
@Autowired
private DataSourceDao dataSourceDao;
@Autowired
private BusinessDao businessDao;
@Autowired
private com.hp.cmsz.repository.PublicDao PublicDao;
@Autowired
private ChannelDataSourceMapDao channelDataSourceMapDao;
@RequestMapping(value = "/taskHome")
public ModelAndView taskHome(String selectTab) {
ModelAndView modelAndView = new ModelAndView(PageURLController.TaskHome);
......@@ -80,6 +108,7 @@ public class TaskManageController {
}
Page<RunTask> taskList = runTaskService.getRunTaskPage(runTask, pageNumber, pageSize, sortType);
System.out.println(taskList.getSize());
modelAndView.addObject("taskList", taskList);
//modelAndView.addObject("queryCondition", runTask);
modelAndView.addObject("pageSize", pageSize);
......@@ -125,19 +154,49 @@ public class TaskManageController {
runTask = runTaskService.getRunTask(taskId);
} else {
runTask = new RunTask();
runTaskService.saveRunTask(runTask);//能够让模型参数根据任务id来进行关联,先把taskId传到前端
}
if (StringUtils.isNotEmpty(defaultTaskType)) {
runTask.setDefaultTaskType(new Long(defaultTaskType));
}
//模型列表
List<DataModel> dataModelList = runTaskService.getDataModelViewList();
//默认第一个模型的参数列表
List<ModelParameter> modelParameterList = null;
if(dataModelList.size()!=0){
modelParameterList = modelParameterDao.findByDataModelIdAndIfSystemDefault(dataModelList.get(0).getDataModelId(),0L);
}
//查询出所以省份信息
List<Province> provinceList = (List<Province>) PublicDao.findAll();
//查询出所有的渠道信息
List<Channel> channelList=(List<Channel>)channelDao.findChannel();
//查询出所有的数据来源信息
List<DataSource> datasourceList=(List<DataSource>)dataSourceDao.findDataSource();
//查询出所有的业务
List<Business> businessList= (List<Business>) businessDao.findAll();
List<ChannelDataSourceMap> channelDataSourceMapList = (List<ChannelDataSourceMap>) channelDataSourceMapDao.findAll();
modelAndView.addObject("runTask", runTask);
modelAndView.addObject("provinceList", provinceList);
modelAndView.addObject("channelList", channelList);
modelAndView.addObject("datasourceList", datasourceList);
modelAndView.addObject("businessList", businessList);
modelAndView.addObject("channelDataSourceMapList", channelDataSourceMapList);
//modelAndView.addObject("isModel", isModel);
modelAndView.addObject("taskGroupList", runTaskService.getTaskGroupList());
/*modelAndView.addObject("taskTypeList", runTaskService.getTaskTypeList());*/
modelAndView.addObject("sanboxList", taskDetailService.findTaskList(RunTaskDetail.TASK_TYPE_SANDBOX));
modelAndView.addObject("recoverList", taskDetailService.findTaskList(RunTaskDetail.TASK_TYPE_RECOVER));
modelAndView.addObject("dataModelList", runTaskService.getDataModelViewList());
modelAndView.addObject("dataModelList", dataModelList);
modelAndView.addObject("dataModelParameterList", modelParameterList);
modelAndView.addObject("taskTypeList", runTaskService.getTaskTypeList());
cmszOperationLogService.createLog("新增", "模型任务", "RUN_TASK_T.taskId=" + runTask.getTaskId());
return modelAndView;
}
......@@ -175,6 +234,37 @@ public class TaskManageController {
return url;
}
@RequestMapping(value = "/getModelParameterList")
@ResponseBody
public List<ModelParameter> getModelParameterList(String modelId){
return modelParameterDao.findByDataModelIdAndIfSystemDefault(Long.parseLong(modelId),0L);
}
@RequestMapping(value = "/createModelParam*", method = RequestMethod.GET)
@ResponseBody
public void createModelParam(
@RequestParam(value="paramName") String paramName,
@RequestParam(value="paramValue") String paramValue,
@RequestParam(value="paramType") String paramType,
@RequestParam(value="taskId") String taskId,
@RequestParam(value="modelId") String modelId,
HttpServletResponse response, HttpServletRequest request) {
ModelParameter modelParameter = new ModelParameter();
if(!paramName.trim().equals("")){modelParameter.setParameterName(paramName);}
if(!paramValue.trim().equals("")){modelParameter.setParameterValue(paramValue);}
if(!paramType.trim().equals("")){modelParameter.setParameterDataType(paramType);}
if(!taskId.trim().equals("")){modelParameter.setTaskId(Long.parseLong(taskId));}
if(!modelId.trim().equals("")){modelParameter.setDataModelId(Long.parseLong(modelId));}
modelParameter.setIfSystemDefault(1L);
modelParameterDao.save(modelParameter);
}
@RequestMapping(value = "/taskDeleteFrame")
public String taskDeleteFrame(Long taskId, @RequestParam(required = false) String defaultTaskType) {
runTaskService.deleteRunTask(taskId);
......@@ -198,4 +288,13 @@ public class TaskManageController {
@RequestParam(required = false) String defaultTaskType) throws UnsupportedEncodingException {
return runTaskService.checkNameAndCode(java.net.URLDecoder.decode(name, "UTF-8"), code, id, defaultTaskType);
}
// public APPEWarningDetail ModelPreview(String id){
//
//
// return null;
// };
}
\ No newline at end of file
......@@ -109,9 +109,8 @@ public class ModelMaintainController {
if(!paramName.trim().equals("")){modelParameter.setParameterName(paramName);}
if(!paramValue.trim().equals("")){modelParameter.setParameterValue(paramValue);}
if(!paramType.trim().equals("")){modelParameter.setParameterDataType(paramType);}
modelParameter.setIfSystemDefault(0L);
modelParameterDao.save(modelParameter);
Long dataModelId = modelParameter.getParameterId();
dataModelIdList.add(dataModelId);
}
......
......@@ -103,7 +103,7 @@ public class ModelParameterConfigurationController {
if(!dataModelId.trim().equals("")){
dataModel = dataModelDao.findByDataModelId(Long.parseLong(dataModelId));
modelParameterList = modelParameterDao.findByDataModelId(Long.parseLong(dataModelId));
modelParameterList = modelParameterDao.findByDataModelIdAndIfSystemDefault(Long.parseLong(dataModelId),0L);
}
......
......@@ -428,6 +428,9 @@ public class RegularityAnalysisController {
//Comment by Huach on 20140731 begin
String dbConXml =Constant.CONFIG_FILE;// "/home/pentaho/conf" + System.getProperty("file.separator") + "application.properties";
//Comment by Huach on 20140731 end
System.out.println("-=====");
System.out.println(PropertiesUtil.readValue(dbConXml, "jdbc.dbip"));
System.out.println("======");
s.set("dbHost", PropertiesUtil.readValue(dbConXml, "jdbc.dbip"));
s.set("dbPort", Integer.valueOf(PropertiesUtil.readValue(dbConXml, "jdbc.dbport")));
......
......@@ -12,7 +12,7 @@ local.ip.prefix=192.168
#jdbc.driver=com.vertica.jdbc.Driver
#vertica database ip address
jdbc.dbip=192.168.113.117
jdbc.dbip=hg-computer
jdbc.dbport=5433
......
......@@ -12,7 +12,7 @@ local.ip.prefix=192.168
#jdbc.driver=com.vertica.jdbc.Driver
#vertica database ip address
jdbc.dbip=192.168.113.117
jdbc.dbip=hg-computer
jdbc.dbport=5433
......
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
......@@ -291,7 +291,8 @@
cancel: function(){},
cancelValue: "取消",
});
}else{
}
else{
$("#modelSubmit").attr("disabled",true);
var i = $("#addTr").find("tr").size();
......
......@@ -28,6 +28,10 @@
$("#taskLogFrame").attr('src', '${ctx}/BaseManage/TaskLogManage/taskLogListFrame');
}
});
});
</script>
......@@ -60,7 +64,7 @@
<div class="row me-row" style="margin-top:0px">
<div class="content clearfix">
<div class="row" style="margin-top:0px">
<iframe id="taskManageFrame" style="height:680px" scrolling="no" src="${ctx}/BaseManage/TaskManage/taskListFrame?defaultTaskType=1"> </iframe>
<iframe id="taskManageFrame" style="height:800px" src="${ctx}/BaseManage/TaskManage/taskListFrame?defaultTaskType=1"> </iframe>
</div>
</div>
</div>
......@@ -69,5 +73,60 @@
</div>
</div>
</div>
<script type="">
function OpenDialog(data) {
// var data = JSON.parse(data);
var content ="<div class='dialog-p' style='max-height: 560px; overflow-y: scroll; overflow-x: auto;'>" +
" <div class='col-xs-12'>" +
" <div class='panel panel-default'>" +
" <div class='panel-heading'>模型预览<input onclick='createWorkingDetail()' id='createWorkingDetail' style='float:right' type='button' class='btn btn-primary' value='参数修改'></div>" +
" <div class='panel-body'>"+
" <table class='table table-vertical'>"+
" <tr><td>"+
" <table class='table table-vertical'>" +
" <tr>" +
" <td width='10%'>省份</td>" +
" <td>自定义</td>" +
" <td width='10%'>数据来源</td>" +
" <td>自定义</td>" +
" <td width='10%'>业务</td>" +
" <td>自定义</td>" +
" <td width='10%'>渠道</td>" +
" <td>自定义</td>" +
" </tr>" +
" <tr>" +
" <td>指标编码</td>" +
" <td>自定义</td>" +
" <td>指标名称</td>" +
" <td>自定义</td>" +
" <td>预测开始时间</td>" +
" <td>自定义</td>" +
" <td>预测结束时间</td>" +
" <td>自定义</td>" +
" </tr>" +
" <tr>" +
" <td colspan='8' align='center'>图表展示</td>" +
" </tr>" +
" <tr>" +
" <td colspan='8'>" +
" <div class=''>" +
<%--" <iframe id='ewarningIf' style='height:560px;padding: 7px;' scrolling='no' src='${biserver_config}&path=MonitorOperation/WarnAnalysis&action=GJFX_DETAIL_RELATED_EWARN.xaction&wrapper=false&height=534&WarningID="+getCol(t1, 'warningId')+ "&WarningSourceTag="+getCol(t1, 'warningSourceId')+ "&ctx=${ctx}" +"'></iframe>" +--%>
" </div>" +
" </td>" +
" </tr>" +
"</table>";
$.dialog({
title:'模型预览结果',
content:content,
lock: true
});
}
function preview() {
OpenDialog();
}
</script>
</body>
</html>
\ No newline at end of file
......@@ -121,30 +121,7 @@ taskName = "自定义任务";
cancelValue:"取消",
lock:true
});
/* $('#newTaskStatus').val(status);
$('#targetTaskId').val(id);
$('#queryForm').submit();
$.ajax({
type : 'post',
'url' : '${ctx}/BaseManage/TaskManage/queryResultFrame',
data : $('#queryForm').serialize() + "&page=" + page,
success : function(data) {
alert("操作成功")
}
}); */
}
/* function updateStatus(status, id) {
$.ajax({
type : 'post',
'url' : '${ctx}/BaseManage/TaskManage/updateStatusFrame',
data : "newTaskStatus=" + status + "&taskId=" +id,
success : function(data) {
queryResult($('#currentPage').val);
}
});
} */
function queryResult(page) {
$.ajax({
......@@ -157,6 +134,11 @@ taskName = "自定义任务";
}
});
}
function preview(){
var id = $('input[name="taskId"]:checked').val();
parent.preview();
}
$(document).ready(function(){
queryResult(1);
......@@ -267,5 +249,6 @@ taskName = "自定义任务";
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
......@@ -12,9 +12,10 @@
<button class="btn-sm btn btn-warning btn-sm btn-group btn-group-cog" onclick="deleteTask();">删除</button>
<button class="btn-sm btn btn-primary btn-sm btn-group btn-group-cog" onclick="addTask();">新建</button>
<%--create by afe 2017-10-26--%>
<button class="btn-sm btn btn-primary btn-sm btn-group btn-group-cog" onclick="">模型预览</button>
<button class="btn-sm btn btn-primary btn-sm btn-group btn-group-cog" id="ModelPreview" onclick="preview()">模型预览</button>
</div>
</div>
<table class="table table-hover table-striped">
<thead>
<tr>
......@@ -39,6 +40,7 @@
</tr>
</thead>
<tbody>
<c:forEach items="${taskList.content}" var="runTask">
<tr>
<td><input type="radio" name="taskId" id="taskId" value="${runTask.taskId}" /></td>
......
......@@ -30,6 +30,11 @@
});
$("#${selectTab}").click();
});
</script>
</head>
......
......@@ -88,7 +88,7 @@ function checkKpi() {
}
function checkAndSubmit(url, data) {
if (validate()) {
$.ajax({
type : 'POST',
url: url,
......@@ -105,7 +105,7 @@ function checkAndSubmit(url, data) {
}
}
});
}
}
function saveForm(id) {
......
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