Commit 5df7e7af authored by liuna's avatar liuna

2017年12月4日 智能分析平台提交内容

--数据质量核查下质量规则运营页面数据展示改为一天
parent 98f37997
This diff is collapsed.
......@@ -14,7 +14,7 @@ import java.util.List;
public interface QualityRuleInfoDao extends JpaSpecificationExecutor<QualityRuleInfo>,
PagingAndSortingRepository<QualityRuleInfo, Long> {
@Query("from QualityRuleInfo qualityRuleInfo where qualityRuleInfo.businessTime between timestampadd(M,-1,getdate()) and getdate() order by qualityRuleInfo.businessTime Desc")
@Query("from QualityRuleInfo qualityRuleInfo where qualityRuleInfo.businessTime between timestampadd(D,-1,getdate()) and getdate() order by qualityRuleInfo.businessTime Desc")
List<QualityRuleInfo> findQualityRuleInfo();
//根据质量规则ID查找质量规则
......@@ -22,4 +22,8 @@ public interface QualityRuleInfoDao extends JpaSpecificationExecutor<QualityRule
//根据筛选项查找
List<QualityRuleInfo> findByDataSourceIdInAndChannelIdInAndBusinessIdInAndProvinceIdInAndIfFilterInAndWarningTypeInAndBusinessTimeBetweenOrderByBusinessTimeDesc(List<Long> dataSource, List<Long> chnnal, List<Long> busines, List<Long> province, List<Long> ifFilter,List<String> ifWarning,Timestamp startTime, Timestamp endTime);
@Query("from QualityRuleInfo qualityRuleInfo where qualityRuleInfo.warningType <> '正常'")
QualityRuleInfo findByProvinceIdAndKpiIdAndBusinessTimeBetween(Long provinceId, Long kpiId, Timestamp startTime, Timestamp endTime);
}
......@@ -18,7 +18,7 @@ public class QualityRuleInfoService {
@Autowired
private QualityRuleInfoDao qualityRuleInfoDao;
public List<QualityRuleInfo> getQualityRuleInfoByLastMonth(){
public List<QualityRuleInfo> getQualityRuleInfoByLastDay(){
return qualityRuleInfoDao.findQualityRuleInfo();
}
......@@ -27,4 +27,9 @@ public class QualityRuleInfoService {
return qualityRuleInfoDao.findByDataSourceIdInAndChannelIdInAndBusinessIdInAndProvinceIdInAndIfFilterInAndWarningTypeInAndBusinessTimeBetweenOrderByBusinessTimeDesc(dataSource,chnnal,busines,province,ifFilter,ifWarning,startTime, endTime);
}
//根据省份ID、指标ID和业务时间查询质量规则运营明细
public QualityRuleInfo findBy(Long provinceId, Long kpiId, Timestamp startTime, Timestamp endTime){
return qualityRuleInfoDao.findByProvinceIdAndKpiIdAndBusinessTimeBetween(provinceId,kpiId,startTime,endTime);
}
}
......@@ -83,7 +83,7 @@ public class QualityRuleOperationController {
//查询出所有的数据来源信息
List<DataSource> datasourceList=dataSourceDao.findDataSource();
//查询出所有的运营质量规则
qualityRuleInfoList = qualityRuleInfoService.getQualityRuleInfoByLastMonth();
qualityRuleInfoList = qualityRuleInfoService.getQualityRuleInfoByLastDay();
Gson gson = new Gson();
model.put("provinceList", provinceList);
......@@ -169,7 +169,6 @@ public class QualityRuleOperationController {
@RequestParam(value = "qualityRuleId") String qualityRuleId,
HttpServletResponse response){
QualityRuleView qualityRuleView = qualityRuleViewDao.findByQualityRuleId(Long.parseLong(qualityRuleId));
System.out.println(qualityRuleView);
cmszOperationLogService.createLog("查询","数据质量规则","查询数据质量规则");
Gson gson = new Gson();
response.setContentType("text/Xml;charset=gbk");
......
......@@ -8,6 +8,7 @@ import com.hp.cmsz.repository.ProvinceDao;
import com.hp.cmsz.service.BusinessService;
import com.hp.cmsz.service.ChannelService;
import com.hp.cmsz.service.CmszOperationLogService;
import com.hp.cmsz.service.analysissupport.QualityRuleInfoService;
import com.hp.cmsz.service.analysissupport.QualityRuleReportService;
import com.hp.cmsz.web.PageURLController;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -24,9 +25,7 @@ import java.io.UnsupportedEncodingException;
import java.sql.Timestamp;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* 数据质量核查中的质量规则报告结果控制类
......@@ -58,6 +57,9 @@ public class QualityRuleReportController {
private QualityRuleReportService qualityRuleReportService;
@Autowired
private QualityRuleInfoService qualityRuleInfoService;
@Autowired
private CmszOperationLogService cmszOperationLogService;
@RequestMapping(value = "")
......@@ -155,4 +157,37 @@ public class QualityRuleReportController {
return list;
}
//查看数据质量运营内容
@RequestMapping(value = "/findOperation*",method = RequestMethod.GET)
@ResponseBody
public void findQuality(
@RequestParam(value = "provinceId") String provinceId,
@RequestParam(value = "kpiId") String kpiId,
@RequestParam(value = "reportSumStartTime") String reportSumStartTime,
@RequestParam(value = "reportSumEndTime") String reportSumEndTime,
HttpServletResponse response) throws ParseException{
System.out.println(reportSumEndTime);
SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
SimpleDateFormat sdf= new SimpleDateFormat("MMM d, yyyy K:m:s a", Locale.ENGLISH);
Long province = Long.parseLong(provinceId);
Long kpi = Long.parseLong(kpiId);
Timestamp startTime = Timestamp.valueOf(sd.format(sdf.parse(reportSumStartTime)));
Timestamp endTime =Timestamp.valueOf(sd.format(sdf.parse(reportSumEndTime)));
System.out.println(startTime);
System.out.println(endTime);
QualityRuleInfo qualityRuleInfo = qualityRuleInfoService.findBy(province,kpi,startTime,endTime);
cmszOperationLogService.createLog("查询","数据质量规则运营","查询数据质量规则运营明细");
Gson gson = new Gson();
response.setContentType("text/Xml;charset=gbk");
PrintWriter out = null;
try {
out = response.getWriter();
out.println(gson.toJson(qualityRuleInfo));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
......@@ -308,6 +308,11 @@ table_pagging.prototype = {
tdContext = df.format(new Date(tdContext));
}
}
if(k==1){
tdContext = "<a href='javascript:;' onclick='selectOperation(\""+this.getData(this.objectlist[i],"provinceId")+"\",\""+this.getData(this.objectlist[i],"kpiId")+"\",\""+this.getData(this.objectlist[i],"reportSumStartTime")+"\",\""+this.getData(this.objectlist[i],"reportSumEndTime")+"\")'>"+this.getData(this.objectlist[i],this.header[k][1])+"</a>";
}
}
} else {
tdContext=this.header[k][1]+"<span style='display:none'>"+i+"</span>";
......@@ -504,3 +509,47 @@ table_pagging.prototype = {
}
}
//查看数据质量运营
function selectOperation(provinceId,kpiId,reportSumStartTime,reportSumEndTime){
$.dialog({
title:"数据质量规则运营明细",
content:"<div id='ruleList'>"+
"<div class='col-xs-12'><div class='panel panel-default'><div class='panel-heading'>明细参数列表</div><div class='panel-body'> <table class='table table-hover table-striped'> <thead> <tr> <th width=''>省份</th> <th width=''>数据来源</th> <th width=''>渠道</th> <th width=''>业务</th> <th width=''>指标名称</th> <th width=''>指标编码</th> <th width=''>告警类型</th> <th width=''>指标监控范围</th> <th width=''>指标采集时间</th> </tr> </thead> <tbody> </tbody> </table> </div> </div> </div>"+
"</div>",
lock:true,
width:800,
initialize:function(){
$.ajax({
type : 'GET',
contentType : 'application/json',
url: "/AnalysisSupport/QualityRuleReport/findOperation?provinceId="+provinceId+"&kpiId="+kpiId+"&reportSumStartTime="+reportSumStartTime+"&reportSumEndTime="+reportSumEndTime,
dataType : 'text',
beforeSend: function(data) {
},
success: function(data) {
var ruleTbody = $('#ruleList tbody');
data = JSON.parse(data)
if(data.kpiMonitorRunTime != null){
data.kpiMonitorRunTime = df.format(new Date(data.kpiMonitorRunTime));
}
if(data.businessTime != null){
data.businessTime = df.format(new Date(data.businessTime));
}
ruleTbody.append($("<tr></tr>")
.append("<td>" + data.provinceName + "</td>")
.append("<td>" + data.dataSourceName + "</td>")
.append("<td>" + data.channelName + "</td>")
.append("<td>" + data.businessName + "</td>")
.append("<td>" + data.kpiName + "</td>")
.append("<td>" + data.kpiCode + "</td>")
.append("<td>" + data.kpiTypeName + "</td>")
.append("<td>" + data.warningType + "</td>")
.append("<td>" + data.kpiMonitorRunTime + "</td>")
.append("<td>" + data.businessTime + "</td>"));
}
});
}
});
}
\ No newline at end of file
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