Commit 9a7aad19 authored by 胡斌's avatar 胡斌

Merge remote-tracking branch 'origin/liuna'

parents f400c2a2 cb77997a
...@@ -18,4 +18,6 @@ public interface QualityRuleReportDao extends JpaSpecificationExecutor<QualityRu ...@@ -18,4 +18,6 @@ public interface QualityRuleReportDao extends JpaSpecificationExecutor<QualityRu
//根据筛选项筛选出质量规则报告 //根据筛选项筛选出质量规则报告
List<QualityRuleReport> findByDataSourceIdInAndChannelIdInAndBusinessIdInAndProvinceIdInAndReportTypeInAndReportSumEndTimeBetweenOrderByReportSumEndTimeDesc(List<Long> dataSource, List<Long> chnnal, List<Long> busines, List<Long> province,List<String> reportType, Timestamp startTime, Timestamp endTime); List<QualityRuleReport> findByDataSourceIdInAndChannelIdInAndBusinessIdInAndProvinceIdInAndReportTypeInAndReportSumEndTimeBetweenOrderByReportSumEndTimeDesc(List<Long> dataSource, List<Long> chnnal, List<Long> busines, List<Long> province,List<String> reportType, Timestamp startTime, Timestamp endTime);
//根据ID查询质量规则报告
QualityRuleReport findByQualityVerificationReportId(Long qualityVerificationReportId);
} }
...@@ -184,7 +184,6 @@ public class QualityRuleMaintainController { ...@@ -184,7 +184,6 @@ public class QualityRuleMaintainController {
@RequestParam(value="repeatedCheckMaxTime") String repeatedCheckMaxTime, @RequestParam(value="repeatedCheckMaxTime") String repeatedCheckMaxTime,
@RequestParam(value="ifRepeatedCheckSummation") String ifRepeatedCheckSummation, @RequestParam(value="ifRepeatedCheckSummation") String ifRepeatedCheckSummation,
HttpServletResponse response,HttpServletRequest request) { HttpServletResponse response,HttpServletRequest request) {
System.out.println("ruleType" + ruleType);
SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
AccuracyRule accuracyRule = new AccuracyRule(); AccuracyRule accuracyRule = new AccuracyRule();
if (!ruleType.trim().equals("")) { if (!ruleType.trim().equals("")) {
...@@ -257,7 +256,7 @@ public class QualityRuleMaintainController { ...@@ -257,7 +256,7 @@ public class QualityRuleMaintainController {
for(int i=0;i<kpi.split(",").length;i++){ for(int i=0;i<kpi.split(",").length;i++){
kpiIdList.add(Long.parseLong(kpi.split(",")[i])); kpiIdList.add(Long.parseLong(kpi.split(",")[i]));
} }
List<QualityRule> qualityRuleList = new ArrayList<QualityRule>();
for(int j=0; j<provinceIdList.size(); j++) { for(int j=0; j<provinceIdList.size(); j++) {
for(int l=0; l<kpiIdList.size(); l++){ for(int l=0; l<kpiIdList.size(); l++){
QualityRule qualityRule = new QualityRule(); QualityRule qualityRule = new QualityRule();
...@@ -278,33 +277,32 @@ public class QualityRuleMaintainController { ...@@ -278,33 +277,32 @@ public class QualityRuleMaintainController {
qualityRule.setKpiMonitorTime("ADD_MONTH("+frequencyValue+")"); qualityRule.setKpiMonitorTime("ADD_MONTH("+frequencyValue+")");
} }
} }
if(!businessTime.trim().equals("")){ qualityRule.setBusinessTime(Timestamp.valueOf(businessTime)); } if(!businessTime.trim().equals("")){ qualityRule.setBusinessTime(Timestamp.valueOf(businessTime+" 00:00:00")); }
if(!frequencyValue.trim().equals("")){ if(!frequencyValue.trim().equals("")){
if(frequencyType.equals("0")){ if(frequencyType.equals("0")){
qualityRule.setKpiMonitorRunTime(Timestamp.valueOf(sd.format(sd.parse(businessTime).getTime()+Integer.parseInt(frequencyValue)*60*1000))); qualityRule.setKpiMonitorRunTime(Timestamp.valueOf(sd.format(sd.parse(businessTime+" 00:00:00").getTime()+Integer.parseInt(frequencyValue)*60*1000)));
} else if(frequencyType.equals("1")){ } else if(frequencyType.equals("1")){
qualityRule.setKpiMonitorRunTime(Timestamp.valueOf(sd.format(sd.parse(businessTime).getTime()+Integer.parseInt(frequencyValue)*60*60*1000))); qualityRule.setKpiMonitorRunTime(Timestamp.valueOf(sd.format(sd.parse(businessTime+" 00:00:00").getTime()+Integer.parseInt(frequencyValue)*60*60*1000)));
} else if(frequencyType.equals("2")){ } else if(frequencyType.equals("2")){
qualityRule.setKpiMonitorRunTime(Timestamp.valueOf(sd.format(sd.parse(businessTime).getTime()+Integer.parseInt(frequencyValue)*24*60*60*1000))); qualityRule.setKpiMonitorRunTime(Timestamp.valueOf(sd.format(sd.parse(businessTime+" 00:00:00").getTime()+Integer.parseInt(frequencyValue)*24*60*60*1000)));
} else if(frequencyType.equals("3")){ } else if(frequencyType.equals("3")){
qualityRule.setKpiMonitorRunTime(Timestamp.valueOf(sd.format(sd.parse(businessTime).getMonth()+Integer.parseInt(frequencyValue)))); qualityRule.setKpiMonitorRunTime(Timestamp.valueOf(sd.format(sd.parse(businessTime+" 00:00:00").getMonth()+Integer.parseInt(frequencyValue))));
} }
} }
qualityRule.setRuleCrtTime(Timestamp.valueOf(sd.format(new Date()))); qualityRule.setRuleCrtTime(Timestamp.valueOf(sd.format(new Date())));
qualityRule.setRuleUpdateTime(Timestamp.valueOf(sd.format(new Date()))); qualityRule.setRuleUpdateTime(Timestamp.valueOf(sd.format(new Date())));
qualityRule.setRuleValidFlag("1"); qualityRule.setRuleValidFlag("1");
qualityRule.setIfSystemValue("1"); qualityRule.setIfSystemValue("1");
qualityRuleDao.save(qualityRule);
cmszOperationLogService.createLog("增加", "新建质量模型",""); cmszOperationLogService.createLog("增加", "新建质量模型","");
Long qualityRuleId = qualityRule.getQualityRuleId(); Long qualityRuleId = qualityRule.getQualityRuleId();
if(!qualityRuleIdList.isEmpty()){ if(!qualityRuleIdList.isEmpty()){
accuracyRuleService.updateAccuracyRuleByAccuracyRuleIds(qualityRuleId, qualityRuleIdList); accuracyRuleService.updateAccuracyRuleByAccuracyRuleIds(qualityRuleId, qualityRuleIdList);
qualityRuleIdList.clear(); qualityRuleIdList.clear();
} }
qualityRuleList.add(qualityRule);
} }
} }
qualityRuleService.insertIntoRule(qualityRuleList);
return "redirect:/AnalysisSupport/QualityRuleResult"; return "redirect:/AnalysisSupport/QualityRuleResult";
} }
......
...@@ -3,10 +3,7 @@ package com.hp.cmsz.web.analysissupport; ...@@ -3,10 +3,7 @@ package com.hp.cmsz.web.analysissupport;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.hp.cmsz.commons.utils.ExportExcelUtil; import com.hp.cmsz.commons.utils.ExportExcelUtil;
import com.hp.cmsz.entity.*; import com.hp.cmsz.entity.*;
import com.hp.cmsz.repository.DataSourceDao; import com.hp.cmsz.repository.*;
import com.hp.cmsz.repository.KpiDao;
import com.hp.cmsz.repository.ProvinceDao;
import com.hp.cmsz.repository.QualityRuleReportInfoDao;
import com.hp.cmsz.service.BusinessService; import com.hp.cmsz.service.BusinessService;
import com.hp.cmsz.service.ChannelService; import com.hp.cmsz.service.ChannelService;
import com.hp.cmsz.service.CmszOperationLogService; import com.hp.cmsz.service.CmszOperationLogService;
...@@ -63,6 +60,9 @@ public class QualityRuleReportController { ...@@ -63,6 +60,9 @@ public class QualityRuleReportController {
private QualityRuleReportService qualityRuleReportService; private QualityRuleReportService qualityRuleReportService;
@Autowired @Autowired
private QualityRuleReportDao qualityRuleReportDao;
@Autowired
private QualityRuleInfoService qualityRuleInfoService; private QualityRuleInfoService qualityRuleInfoService;
@Autowired @Autowired
...@@ -168,6 +168,26 @@ public class QualityRuleReportController { ...@@ -168,6 +168,26 @@ public class QualityRuleReportController {
return list; return list;
} }
//查看表格
@RequestMapping(value="/findReport",method = RequestMethod.GET)
@ResponseBody
public void findQuality(
@RequestParam(value = "qualityVerificationReportId") String qualityVerificationReportId,
HttpServletResponse response){
QualityRuleReport qualityRuleReport = qualityRuleReportDao.findByQualityVerificationReportId(Long.parseLong(qualityVerificationReportId));
Gson gson = new Gson();
response.setContentType("text/Xml;charset=gbk");
PrintWriter out = null;
try {
out = response.getWriter();
out.println(gson.toJson(qualityRuleReport));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
//查看数据质量运营内容 //查看数据质量运营内容
@RequestMapping(value = "/findOperationFrame") @RequestMapping(value = "/findOperationFrame")
public ModelAndView findQuality( public ModelAndView findQuality(
......
...@@ -155,8 +155,7 @@ public class QualityRuleResultController { ...@@ -155,8 +155,7 @@ public class QualityRuleResultController {
//删掉质量规则 //删掉质量规则
@RequestMapping(value = "/deleteOneRule*",method = RequestMethod.GET) @RequestMapping(value = "/deleteOneRule*",method = RequestMethod.GET)
@ResponseBody public String deleteRule(
public void deleteRule(
@RequestParam(value = "qualityRuleId") String qualityRuleId, @RequestParam(value = "qualityRuleId") String qualityRuleId,
HttpServletResponse response){ HttpServletResponse response){
List<Long> qualityRuleIdList = new ArrayList<Long>(); List<Long> qualityRuleIdList = new ArrayList<Long>();
...@@ -168,21 +167,8 @@ public class QualityRuleResultController { ...@@ -168,21 +167,8 @@ public class QualityRuleResultController {
qualityRuleService.deleteByQualityRuleId(qualityRuleIdList); qualityRuleService.deleteByQualityRuleId(qualityRuleIdList);
accuracyRuleService.deleteAccuracyRuleByQualityRuleId(qualityRuleIdList); accuracyRuleService.deleteAccuracyRuleByQualityRuleId(qualityRuleIdList);
cmszOperationLogService.createLog("删除","更新质量规则","quality_rule_warehouse_info_t. QUALITY_RULE_ID="+qualityRuleId); cmszOperationLogService.createLog("删除","更新质量规则","quality_rule_warehouse_info_t. QUALITY_RULE_ID="+qualityRuleId);
//刷新模型表格
List<QualityRule> qualityRuleList = (List<QualityRule>) qualityRuleDao.findAll();
staticQualityRuleList = qualityRuleList;
Gson gson = new Gson();
response.setContentType("text/Xml;charset=gbk");
PrintWriter out = null;
try { return PageURLController.RuleResult;
out = response.getWriter();
out.println(gson.toJson(qualityRuleList));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} }
//查看准确性规则内容 //查看准确性规则内容
......
...@@ -62,9 +62,6 @@ ...@@ -62,9 +62,6 @@
<c:if test="${dataSource.dataSourceId == '5'}"> <c:if test="${dataSource.dataSourceId == '5'}">
<option value="${dataSource.dataSourceId}" selected>${dataSource.dataSourceName}</option> <option value="${dataSource.dataSourceId}" selected>${dataSource.dataSourceName}</option>
</c:if > </c:if >
<c:if test="${dataSource.dataSourceId != '5'}">
<option value="${dataSource.dataSourceId}" >${dataSource.dataSourceName}</option>
</c:if >
</c:forEach> </c:forEach>
</select></td> </select></td>
</tr> </tr>
...@@ -487,16 +484,20 @@ $("#calCycle").change(function () { ...@@ -487,16 +484,20 @@ $("#calCycle").change(function () {
updateBusiness($("#dataSource").val(),$("#channel").val()); updateBusiness($("#dataSource").val(),$("#channel").val());
$("#frequencyValue").val("30");
function updateBusinessTime(calCycleValue) { function updateBusinessTime(calCycleValue) {
if(calCycleValue == "30MI"){ if(calCycleValue == "30MI"){
$("#monitorTime"); $("#frequencyValue").val("30");
$("#frequencyType").val(0);
}else if(calCycleValue == "01HR"){ }else if(calCycleValue == "01HR"){
$("#monitorTime"); $("#frequencyValue").val("1");
$("#frequencyType").val(1);
}else if(calCycleValue == "01DY"){ }else if(calCycleValue == "01DY"){
$("#monitorTime"); $("#frequencyValue").val("1");
$("#frequencyType").val(2);
}else if(calCycleValue == "01MO"){ }else if(calCycleValue == "01MO"){
$("#monitorTime"); $("#frequencyValue").val("1");
$("#frequencyType").val(3);
} }
} }
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<table class="table table-hover table-striped"> <table class="table table-hover table-striped">
<thead> <thead>
<tr> <tr>
<th width="6.4%">质量规则ID</th> <%--<th width="6.4%">质量规则ID</th>--%>
<th width="6.4%">省份</th> <th width="6.4%">省份</th>
<th width="6.4%">数据来源</th> <th width="6.4%">数据来源</th>
<th width="6.4%">渠道</th> <th width="6.4%">渠道</th>
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
<th width="6.4%">告警原因</th> <th width="6.4%">告警原因</th>
<th width="6.4%">数据时间</th> <th width="6.4%">数据时间</th>
<th width="6.4%">告警时间</th> <th width="6.4%">告警时间</th>
<th width="6.4%">查看规则</th>
<%--<th width="6.4%">是否过滤</th>--%> <%--<th width="6.4%">是否过滤</th>--%>
</tr> </tr>
</thead> </thead>
...@@ -29,7 +30,7 @@ ...@@ -29,7 +30,7 @@
<c:forEach items="${qualityRuleInfoPage.content}" var="qualityRuleInfo"> <c:forEach items="${qualityRuleInfoPage.content}" var="qualityRuleInfo">
<tr> <tr>
<td><a href='javascript:;' onclick='selectRule(${qualityRuleInfo.qualityRuleId})'>${qualityRuleInfo.qualityRuleId}</a></td>
<td>${qualityRuleInfo.provinceName} </td> <td>${qualityRuleInfo.provinceName} </td>
<td>${qualityRuleInfo.dataSourceName}</td> <td>${qualityRuleInfo.dataSourceName}</td>
<td>${qualityRuleInfo.channelName}</td> <td>${qualityRuleInfo.channelName}</td>
...@@ -40,6 +41,7 @@ ...@@ -40,6 +41,7 @@
<td>${qualityRuleInfo.warningReason}</td> <td>${qualityRuleInfo.warningReason}</td>
<td><fmt:formatDate value="${qualityRuleInfo.kpiMonitorRunTime}" pattern="yyyy-MM-dd hh:mm" /></td> <td><fmt:formatDate value="${qualityRuleInfo.kpiMonitorRunTime}" pattern="yyyy-MM-dd hh:mm" /></td>
<td><fmt:formatDate value="${qualityRuleInfo.businessTime}" pattern="yyyy-MM-dd hh:mm" /></td> <td><fmt:formatDate value="${qualityRuleInfo.businessTime}" pattern="yyyy-MM-dd hh:mm" /></td>
<td><a href='javascript:;' onclick='selectRule(${qualityRuleInfo.qualityRuleId})'>查看规则</a></td>
<%--<td>--%> <%--<td>--%>
<%--<c:if test="${qualityRuleInfo.ifFilter == '1'}">无过滤规则</c:if>--%> <%--<c:if test="${qualityRuleInfo.ifFilter == '1'}">无过滤规则</c:if>--%>
<%--<c:if test="${qualityRuleInfo.ifFilter == '0'}">过滤</c:if>--%> <%--<c:if test="${qualityRuleInfo.ifFilter == '0'}">过滤</c:if>--%>
......
...@@ -331,7 +331,7 @@ table_pagging.prototype = { ...@@ -331,7 +331,7 @@ table_pagging.prototype = {
} }
if(k==1){ if(k==1){
tdContext = "<a href='javascript:;' onclick=\"selectOperation("+i+")\" alt='\"+i+\"'>"+this.getData(this.objectlist[i],this.header[k][1])+"</a>"; tdContext = "<a href='javascript:;' onclick='selectOperation(\""+this.getData(this.objectlist[i],"qualityVerificationReportId")+"\")'>"+this.getData(this.objectlist[i],this.header[k][1])+"</a>";
} }
} }
...@@ -555,73 +555,81 @@ function queryResult(page) { ...@@ -555,73 +555,81 @@ function queryResult(page) {
} }
//查看数据质量运营 //查看数据质量运营
function selectOperation(i){ function selectOperation(qualityVerificationReportId) {
console.log(jsonData[i]) $.ajax({
if(jsonData[i].integralityNum==undefined){ type: 'GET',
jsonData[i].integralityNum=""; contentType: 'application/json',
url: "/AnalysisSupport/QualityRuleReport/findReport?qualityVerificationReportId=" + qualityVerificationReportId,
dataType: 'text',
beforeSend: function (data) {
},
success: function (data) {
data = JSON.parse(data)
if (data.integralityNum == undefined) {
data.integralityNum = "";
} }
if(jsonData[i].integralityPro==undefined){ if (data.integralityPro == undefined) {
jsonData[i].integralityPro=""; data.integralityPro = "";
}else{ } else {
jsonData[i].integralityPro=(jsonData[i].integralityPro*100).toFixed(0)+"%"; data.integralityPro = (data.integralityPro * 100).toFixed(0) + "%";
} }
if(jsonData[i].timelyNum==undefined){ if (data.timelyNum == undefined) {
jsonData[i].timelyNum=""; data.timelyNum = "";
} }
if(jsonData[i].timelyPro==undefined){ if (data.timelyPro == undefined) {
jsonData[i].timelyPro=""; data.timelyPro = "";
}else { } else {
jsonData[i].timelyPro=(jsonData[i].timelyPro*100).toFixed(0)+"%"; data.timelyPro = (data.timelyPro * 100).toFixed(0) + "%";
} }
if(jsonData[i].accuracyNum==undefined){ if (data.accuracyNum == undefined) {
jsonData[i].accuracyNum=""; data.accuracyNum = "";
} }
if(jsonData[i].accuracyPro==undefined){ if (data.accuracyPro == undefined) {
jsonData[i].accuracyPro=""; data.accuracyPro = "";
}else { } else {
jsonData[i].accuracyPro=(jsonData[i].accuracyPro*100).toFixed(0)+"%"; data.accuracyPro = (data.accuracyPro * 100).toFixed(0) + "%";
} }
$.dialog({ $.dialog({
title:"数据质量运营明细", title: "数据质量运营明细",
content:"<div class='dialog-p' style='max-height: 560px; overflow-y: scroll; overflow-x: auto;'>" + content: "<div class='dialog-p' style='max-height: 560px; overflow-y: scroll; overflow-x: auto;'>" +
" <div class='col-xs-12'>" + " <div class='col-xs-12'>" +
" <div class='panel panel-default'>" + " <div class='panel panel-default'>" +
" <div class='panel-heading'>质量规则报告预览</div>" + " <div class='panel-heading'>质量规则报告预览</div>" +
" <div class='panel-body'>"+ " <div class='panel-body'>" +
" <table class='table table-vertical'>"+ " <table class='table table-vertical'>" +
" <tr><td>"+ " <tr><td>" +
" <table class='table table-vertical'>" + " <table class='table table-vertical'>" +
" <tr>" + " <tr>" +
" <td width='10%'>省份</td>" + " <td width='10%'>省份</td>" +
" <td>"+jsonData[i].provinceName+"</td>" + " <td>" + data.provinceName + "</td>" +
" <td width='10%'>数据来源</td>" + " <td width='10%'>数据来源</td>" +
" <td>"+jsonData[i].dataSourceName+"</td>" + " <td>" + data.dataSourceName + "</td>" +
" <td width='10%'>业务</td>" + " <td width='10%'>业务</td>" +
" <td>"+jsonData[i].businessName+"</td>" + " <td>" + data.businessName + "</td>" +
" </tr>" + " </tr>" +
" <tr>" + " <tr>" +
" <td width='10%'>渠道</td>" + " <td width='10%'>渠道</td>" +
" <td>"+jsonData[i].channelName+"</td>" + " <td>" + data.channelName + "</td>" +
" <td>指标名称</td>" + " <td>指标名称</td>" +
" <td>"+jsonData[i].kpiName+"</td>" + " <td>" + data.kpiName + "</td>" +
" <td>指标编码</td>" + " <td>指标编码</td>" +
" <td>"+jsonData[i].kpiCode+"</td>" + " <td>" + data.kpiCode + "</td>" +
" </tr>" + " </tr>" +
" <tr>" + " <tr>" +
" <td>完整性数量</td>" + " <td>完整性数量</td>" +
" <td>"+jsonData[i].integralityNum+"</td>" + " <td>" + data.integralityNum + "</td>" +
" <td>完整性占比</td>" + " <td>完整性占比</td>" +
" <td>"+jsonData[i].integralityPro+"</td>" + " <td>" + data.integralityPro + "</td>" +
" <td>及时性数量</td>" + " <td>及时性数量</td>" +
" <td>"+jsonData[i].timelyNum+"</td>" + " <td>" + data.timelyNum + "</td>" +
" </tr>" + " </tr>" +
" <tr>" + " <tr>" +
" <td>及时性占比</td>" + " <td>及时性占比</td>" +
" <td>"+jsonData[i].timelyPro+"</td>" + " <td>" + data.timelyPro + "</td>" +
" <td>准确性数量</td>" + " <td>准确性数量</td>" +
" <td>"+jsonData[i].accuracyNum+"</td>" + " <td>" + data.accuracyNum + "</td>" +
" <td>准确性占比</td>" + " <td>准确性占比</td>" +
" <td>"+jsonData[i].accuracyPro+"</td>" + " <td>" + data.accuracyPro + "</td>" +
" </tr>" + " </tr>" +
" <tr>" + " <tr>" +
" <td colspan='8' align='center'>质量异常明细展示</td>" + " <td colspan='8' align='center'>质量异常明细展示</td>" +
...@@ -629,15 +637,17 @@ function selectOperation(i){ ...@@ -629,15 +637,17 @@ function selectOperation(i){
" <tr>" + " <tr>" +
" <td colspan='8'>" + " <td colspan='8'>" +
" <div class='panel-body'>" + " <div class='panel-body'>" +
" <div style='width: 800px; height: 500px;overflow-y: scroll' id='dataForm' ></div>"+ " <div style='width: 800px; height: 500px;overflow-y: scroll' id='dataForm' ></div>" +
" </div>" + " </div>" +
" </td>" + " </td>" +
" </tr>" + " </tr>" +
"</table>", "</table>",
lock:true, lock: true,
width:800, width: 800,
initialize:function() { initialize: function () {
queryOperation(1,jsonData[i].provinceId,jsonData[i].kpiId,jsonData[i].reportSumStartTime,jsonData[i].reportSumEndTime); queryOperation(1, data.provinceId, data.kpiId, data.reportSumStartTime, data.reportSumEndTime);
}
});
} }
}); });
} }
\ 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