Commit 90a378e9 authored by 胡斌's avatar 胡斌

Merge remote-tracking branch 'origin/liuna'

# Conflicts: # src/main/webapp/static/js/ruleResultDetailTable.js
parents f896fa24 6107fd18
...@@ -125,4 +125,23 @@ public class AccuracyRule implements Serializable { ...@@ -125,4 +125,23 @@ public class AccuracyRule implements Serializable {
this.validFlag = validFlag; this.validFlag = validFlag;
} }
@Override
public String toString() {
return "AccuracyRule{" +
"accuracyRuleId=" + accuracyRuleId +
", qualityRuleId=" + qualityRuleId +
", ruleType='" + ruleType + '\'' +
", scopeMaxValue='" + scopeMaxValue + '\'' +
", scopeMinValue='" + scopeMinValue + '\'' +
", repeatedCheckGranularity='" + repeatedCheckGranularity + '\'' +
", repeatedCheckStartTime=" + repeatedCheckStartTime +
", repeatedCheckEndTime=" + repeatedCheckEndTime +
", ifRepeatedCheckSeries='" + ifRepeatedCheckSeries + '\'' +
", repeatedCheckMaxTime=" + repeatedCheckMaxTime +
", ifRepeatedCheckSummation='" + ifRepeatedCheckSummation + '\'' +
", ruleCrtTime=" + ruleCrtTime +
", ruleUpdateTime=" + ruleUpdateTime +
", validFlag='" + validFlag + '\'' +
'}';
}
} }
...@@ -33,8 +33,13 @@ public interface AccuracyRuleDao extends JpaSpecificationExecutor<AccuracyRule>, ...@@ -33,8 +33,13 @@ public interface AccuracyRuleDao extends JpaSpecificationExecutor<AccuracyRule>,
//根据准确性规则ID更新准确性规则信息 //根据准确性规则ID更新准确性规则信息
@Modifying @Modifying
@Query("update AccuracyRule ar set ar.ruleType=:ruleType, ar.scopeMaxValue=:scopeMaxValue, ar.scopeMinValue=:scopeMinValue, ar.repeatedCheckGranularity=:repeatedCheckGranularity, ar.repeatedCheckStartTime=:repeatedCheckStartTime, ar.repeatedCheckEndTime=:repeatedCheckEndTime, ar.ifRepeatedCheckSeries=:ifRepeatedCheckSeries, ar.repeatedCheckMaxTime=:repeatedCheckMaxTime, ar.ifRepeatedCheckSummation=:ifRepeatedCheckSummation where ar.accuracyRuleId =:accuracyRuleId") @Query("update AccuracyRule ar set ar.repeatedCheckGranularity=:repeatedCheckGranularity, ar.repeatedCheckStartTime=:repeatedCheckStartTime, ar.repeatedCheckEndTime=:repeatedCheckEndTime, ar.ifRepeatedCheckSeries=:ifRepeatedCheckSeries, ar.repeatedCheckMaxTime=:repeatedCheckMaxTime, ar.ifRepeatedCheckSummation=:ifRepeatedCheckSummation where ar.accuracyRuleId =:accuracyRuleId")
void updateAccuracyRuleByAccuracyRuleId(@Param("ruleType")String ruleType,@Param("scopeMaxValue")Double scopeMaxValue,@Param("scopeMinValue")Double scopeMinValue,@Param("repeatedCheckGranularity")String repeatedCheckGranularity,@Param("repeatedCheckStartTime")Date repeatedCheckStartTime,@Param("repeatedCheckEndTime")Date repeatedCheckEndTime,@Param("ifRepeatedCheckSeries")String ifRepeatedCheckSeries,@Param("repeatedCheckMaxTime")Long repeatedCheckMaxTime,@Param("ifRepeatedCheckSummation")String ifRepeatedCheckSummation,@Param("accuracyRuleId")Long accuracyRuleId); void updateAccuracyRuleByAccuracyRuleId(@Param("repeatedCheckGranularity")String repeatedCheckGranularity,@Param("repeatedCheckStartTime")Date repeatedCheckStartTime,@Param("repeatedCheckEndTime")Date repeatedCheckEndTime,@Param("ifRepeatedCheckSeries")String ifRepeatedCheckSeries,@Param("repeatedCheckMaxTime")Long repeatedCheckMaxTime,@Param("ifRepeatedCheckSummation")String ifRepeatedCheckSummation,@Param("accuracyRuleId")Long accuracyRuleId);
//根据准确性ID更新范围类信息
@Modifying
@Query("update AccuracyRule ar set ar.scopeMaxValue=:scopeMaxValue, ar.scopeMinValue=:scopeMinValue where ar.accuracyRuleId =:accuracyRuleId")
void updateByAccuracyRuleId(@Param("scopeMaxValue")Double scopeMaxValue,@Param("scopeMinValue")Double scopeMinValue);
//根据准确性规则ID删除一条准确性规则信息 //根据准确性规则ID删除一条准确性规则信息
@Modifying @Modifying
......
...@@ -37,7 +37,9 @@ public interface KpiDao extends JpaSpecificationExecutor<Kpi>,PagingAndSortingRe ...@@ -37,7 +37,9 @@ public interface KpiDao extends JpaSpecificationExecutor<Kpi>,PagingAndSortingRe
@Query("select kpi.kpiId, kpi.kpiName from Kpi kpi where kpi.kpiId >=0") @Query("select kpi.kpiId, kpi.kpiName from Kpi kpi where kpi.kpiId >=0")
List<Object[]> findAllKpiIdAndKpiName(); List<Object[]> findAllKpiIdAndKpiName();
//由数据来源得到指标 //由指标得到业务ID
@Query("select businessId from Kpi kpi where kpiId=:kpiId")
Long findBusinessIdByKpiId(@Param("kpiId") Long kpiId);
//由指标名得到指标周期类型 //由指标名得到指标周期类型
......
...@@ -27,6 +27,10 @@ public interface QualityRuleDao extends JpaSpecificationExecutor<QualityRule>, ...@@ -27,6 +27,10 @@ public interface QualityRuleDao extends JpaSpecificationExecutor<QualityRule>,
//根据质量规则ID查找质量规则 //根据质量规则ID查找质量规则
List<QualityRule> findByQualityRuleIdIn(List<Long> qualityRuleId); List<QualityRule> findByQualityRuleIdIn(List<Long> qualityRuleId);
//根据kpiId查看是否已经存在
@Query("select qr.kpiId from QualityRule qr where qr.kpiId in (:kpiIdList) ")
List<Long> findByKpiIds(@Param("kpiIdList") List<Long> kpiIdList);
//根据质量规则ID删除质量规则 //根据质量规则ID删除质量规则
@Modifying @Modifying
@Query("delete from QualityRule qr where qr.qualityRuleId in (:qualityRuleId)") @Query("delete from QualityRule qr where qr.qualityRuleId in (:qualityRuleId)")
...@@ -34,8 +38,8 @@ public interface QualityRuleDao extends JpaSpecificationExecutor<QualityRule>, ...@@ -34,8 +38,8 @@ public interface QualityRuleDao extends JpaSpecificationExecutor<QualityRule>,
//根据质量规则ID修改质量规则 //根据质量规则ID修改质量规则
@Modifying @Modifying
@Query("update from QualityRule qr set qr.kpiMonitorTime=:kpiMonitorTime, qr.kpiMonitorRunTime=:kpiMonitorRunTime, qr.businessTime=:businessTime, qr.ruleUpdateTime=:ruleUpdateTime where qr.qualityRuleId=:qualityRuleId") @Query("update from QualityRule qr set qr.kpiMonitorTime=:kpiMonitorTime, qr.kpiMonitorRunTime=:kpiMonitorRunTime, qr.businessTime=:businessTime, qr.ruleUpdateTime=:ruleUpdateTime, qr.frequencyValue=:frequencyValue,qr.frequencyType=:frequencyType where qr.qualityRuleId=:qualityRuleId")
void updateQualityRuleByQualityRuleId(@Param("kpiMonitorTime")String kpiMonitorTime,@Param("kpiMonitorRunTime")Timestamp kpiMonitorRunTime,@Param("businessTime")Timestamp businessTime,@Param("ruleUpdateTime")Timestamp ruleUpdateTime,@Param("qualityRuleId")Long qualityRuleId); void updateQualityRuleByQualityRuleId(@Param("kpiMonitorTime")String kpiMonitorTime,@Param("kpiMonitorRunTime")Timestamp kpiMonitorRunTime,@Param("businessTime")Timestamp businessTime,@Param("ruleUpdateTime")Timestamp ruleUpdateTime,@Param("frequencyValue")Long frequencyValue,@Param("frequencyType")Long frequencyType,@Param("qualityRuleId")Long qualityRuleId);
//根据质量规则ID得到数据条数 //根据质量规则ID得到数据条数
@Query("select count(*) from QualityRule qualityRule where qualityRule.qualityRuleId=:qualityRuleId") @Query("select count(*) from QualityRule qualityRule where qualityRule.qualityRuleId=:qualityRuleId")
......
...@@ -29,10 +29,16 @@ public class AccuracyRuleService { ...@@ -29,10 +29,16 @@ public class AccuracyRuleService {
//根据准确性规则ID更新准确性规则 //根据准确性规则ID更新准确性规则
@Transactional(readOnly=false) @Transactional(readOnly=false)
public void updateAccuracyRuleByAccuracyRuleId(String ruleType,Double scopeMaxValue,Double scopeMinValue,String repeatedCheckGranularity,Date repeatedCheckStartTime,Date repeatedCheckEndTime,String ifRepeatedCheckSeries,Long repeatedCheckMaxTime,String ifRepeatedCheckSummation,Long accuracyRuleId){ public void updateAccuracyRuleByAccuracyRuleId(String repeatedCheckGranularity,Date repeatedCheckStartTime,Date repeatedCheckEndTime,String ifRepeatedCheckSeries,Long repeatedCheckMaxTime,String ifRepeatedCheckSummation,Long accuracyRuleId){
accuracyRuleDao.updateAccuracyRuleByAccuracyRuleId(ruleType, scopeMaxValue, scopeMinValue, repeatedCheckGranularity, repeatedCheckStartTime, repeatedCheckEndTime, ifRepeatedCheckSeries, repeatedCheckMaxTime, ifRepeatedCheckSummation,accuracyRuleId); accuracyRuleDao.updateAccuracyRuleByAccuracyRuleId(repeatedCheckGranularity, repeatedCheckStartTime, repeatedCheckEndTime, ifRepeatedCheckSeries, repeatedCheckMaxTime, ifRepeatedCheckSummation,accuracyRuleId);
} }
@Transactional(readOnly = false)
public void updateByAccuracyRuleId(Double scopeMaxValue, Double scopeMinValue) {
accuracyRuleDao.updateByAccuracyRuleId(scopeMaxValue,scopeMinValue);
}
//根据准确性规则ID删除一条准确性规则信息 //根据准确性规则ID删除一条准确性规则信息
@Transactional(readOnly=false) @Transactional(readOnly=false)
public void deleteAccuracyRuleByAccuracyRuleId(Long accuracyRuleId){ public void deleteAccuracyRuleByAccuracyRuleId(Long accuracyRuleId){
......
...@@ -46,7 +46,7 @@ public class QualityRuleService { ...@@ -46,7 +46,7 @@ public class QualityRuleService {
//根据质量规则ID修改质量规则 //根据质量规则ID修改质量规则
@Transactional(readOnly=false) @Transactional(readOnly=false)
public void updateByQualityRuleId(String kpiMonitorTime,Timestamp kpiMonitorRunTime,Timestamp businessTime,Timestamp ruleUpdateTime,Long qualityRuleId){ public void updateByQualityRuleId(String kpiMonitorTime,Timestamp kpiMonitorRunTime,Timestamp businessTime,Timestamp ruleUpdateTime,Long frequencyValue,Long frequencyType,Long qualityRuleId){
qualityRuleDao.updateQualityRuleByQualityRuleId(kpiMonitorTime,kpiMonitorRunTime,businessTime,ruleUpdateTime,qualityRuleId); qualityRuleDao.updateQualityRuleByQualityRuleId(kpiMonitorTime,kpiMonitorRunTime,businessTime,ruleUpdateTime,frequencyValue,frequencyType,qualityRuleId);
} }
} }
...@@ -109,7 +109,7 @@ ...@@ -109,7 +109,7 @@
<option value="3"></option> <option value="3"></option>
</select></td> </select></td>
</tr> </tr>
<tr><td>监控时间(<font color="red">必填</font>):</td> <tr><td>核查时间(<font color="red">必填</font>):</td>
<td id="businessTimetd"> <td id="businessTimetd">
<input type='text' class='form-control' id='businessTime' name='businessTime' onfocus='WdatePicker({dateFmt:"yyyy-MM-dd HH:mm:00",startDate:"%y-%M-%d 00:00:00",readOnly:false,hmsMenuCfg : {H : [ 1, 6 ], m : [ 30, 2 ], s : [ 60, 0 ]},alwaysUseStartDate:true})'/> <input type='text' class='form-control' id='businessTime' name='businessTime' onfocus='WdatePicker({dateFmt:"yyyy-MM-dd HH:mm:00",startDate:"%y-%M-%d 00:00:00",readOnly:false,hmsMenuCfg : {H : [ 1, 6 ], m : [ 30, 2 ], s : [ 60, 0 ]},alwaysUseStartDate:true})'/>
</td> </td>
...@@ -263,6 +263,10 @@ $("#addParam").click(function(){ ...@@ -263,6 +263,10 @@ $("#addParam").click(function(){
//form表单提交 //form表单提交
$("#ruleSubmit").click(function(){ $("#ruleSubmit").click(function(){
$.dialog({
title: "提醒",
content:"确定新增该规则吗?",
ok: function(){
if($.trim($("#frequencyValue").val())==""){ if($.trim($("#frequencyValue").val())==""){
$.alert("监控延迟时间不能为空"); $.alert("监控延迟时间不能为空");
}else if($("#businessTime").val()==""){ }else if($("#businessTime").val()==""){
...@@ -309,7 +313,7 @@ $("#addParam").click(function(){ ...@@ -309,7 +313,7 @@ $("#addParam").click(function(){
$.ajax({ $.ajax({
type : "GET", type : "GET",
contentType : "application/json", contentType : "application/json",
url: "${ctx}/AnalysisSupport/QualityRuleMaintain/createAccuracyRule?ruleType="+ruleType+"&scopeMaxValue="+scopeMaxValue+"&scopeMinValue="+scopeMinValue+"&repeatedCheckGranularity="+repeatedCheckGranularity+"&repeatedCheckStartTime="+repeatedCheckStartTime+"&repeatedCheckEndTime="+repeatedCheckEndTime+"&scopeMinValue="+ifRepeatedCheckSeries+"&ifRepeatedCheckSeries="+repeatedCheckMaxTime+"&repeatedCheckMaxTime="+ifRepeatedCheckSummation+"&ifRepeatedCheckSummation=", url: "${ctx}/AnalysisSupport/QualityRuleMaintain/createAccuracyRule?ruleType="+ruleType+"&scopeMaxValue="+scopeMaxValue+"&scopeMinValue="+scopeMinValue+"&repeatedCheckGranularity="+repeatedCheckGranularity+"&repeatedCheckStartTime="+repeatedCheckStartTime+"&repeatedCheckEndTime="+repeatedCheckEndTime+"&ifRepeatedCheckSeries="+ifRepeatedCheckSeries+"&repeatedCheckMaxTime="+repeatedCheckMaxTime+"&ifRepeatedCheckSummation="+ifRepeatedCheckSummation,
dataType : "text", dataType : "text",
async: false, async: false,
beforeSend: function(data) {}, beforeSend: function(data) {},
...@@ -381,6 +385,13 @@ $("#addParam").click(function(){ ...@@ -381,6 +385,13 @@ $("#addParam").click(function(){
} }
} }
},
okValue:"确定",
cancel: function(){},
cancelValue:"返回",
lock:true
});
}); });
$("#ruleBack").click(function(){ $("#ruleBack").click(function(){
......
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
质量规则查询结果 质量规则查询结果
<shiro:hasAnyRoles name="admin,dataAnalysis,businessAnalysis"> <shiro:hasAnyRoles name="admin,dataAnalysis,businessAnalysis">
<div id="time_div" style="top: -6px;float: right;height: 0px;position: relative;"> <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" style="color: red" id="deleteRule" disabled>删除规则</button> <button class="btn-sm btn btn-primary btn-sm btn-group btn-group-cog" style="background-color: red" id="deleteRule" disabled>删除规则</button>
<button class="btn-sm btn btn-primary btn-sm btn-group btn-group-cog" id="updateRule" disabled>修改规则</button> <button class="btn-sm btn btn-primary btn-sm btn-group btn-group-cog" id="updateRule" disabled>修改规则</button>
<button class="btn-sm btn btn-primary btn-sm btn-group btn-group-cog" id="createRule">新建规则</button> <button class="btn-sm btn btn-primary btn-sm btn-group btn-group-cog" id="createRule">新建规则</button>
</div> </div>
...@@ -95,6 +95,21 @@ ...@@ -95,6 +95,21 @@
</div> </div>
<script type="text/javascript" src="${ctx}/static/js/ruleResultDetailTable.js"></script> <script type="text/javascript" src="${ctx}/static/js/ruleResultDetailTable.js"></script>
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function(){
var url = decodeURI(window.location.search);
var a = url.split("?")[1];
if (a =="sr=1"){
$.dialog({
content:"成功生成数据质量规则!"
})
}else if (a =="sr=2"){
$.dialog({
content:"已经存在此kpiId的数据质量规则!"
})
}
console.log(url.split("?")[1]);
});
var receiveRulePageNum = "${rulePageNum}"; var receiveRulePageNum = "${rulePageNum}";
ruleResultDetailTable(); ruleResultDetailTable();
......
...@@ -134,11 +134,11 @@ function ruleResultDetailTable(){ ...@@ -134,11 +134,11 @@ function ruleResultDetailTable(){
header[2] = ["业务","businessName","7%","15"]; header[2] = ["业务","businessName","7%","15"];
header[3] = ["指标名称","kpiName","7%","15"]; header[3] = ["指标名称","kpiName","7%","15"];
header[4] = ["指标编码","kpiCode","7%","15"]; header[4] = ["指标编码","kpiCode","7%","15"];
// header[5] = ["数据类型","kpiTypeName","7%","15"]; header[5] = ["数据类型","kpiTypeName","7%","15"];
header[5] = ["数据采集频率","calCycle","7%","15"]; header[6] = ["数据采集频率","calCycle","7%","15"];
header[6] = ["监控延迟时间","kpiMonitorTime","7%","15"]; header[7] = ["监控延迟时间","kpiMonitorTime","7%","15"];
// headr[11] = ["指标采集时间","businessTime","7%","15"]; header[8] = ["核查时间","businessTime","7%","15"];
header[7] = ["准确性规则","accuracyRuleId","7%","15"]; header[9] = ["准确性规则","accuracyRuleId","7%","15"];
window.pagging = new table_pagging({limit:12,tableId:'ruleResultTable',header:header}); window.pagging = new table_pagging({limit:12,tableId:'ruleResultTable',header:header});
pagging.pagging(jsonData); pagging.pagging(jsonData);
...@@ -301,7 +301,7 @@ table_pagging.prototype = { ...@@ -301,7 +301,7 @@ table_pagging.prototype = {
tdContext = "&nbsp;"; tdContext = "&nbsp;";
} }
if(k==6){ if(k==7){
if(tdContext.indexOf("/")!=-1){ if(tdContext.indexOf("/")!=-1){
var a = new Array(); var a = new Array();
a = tdContext.split("/"); a = tdContext.split("/");
...@@ -319,13 +319,13 @@ table_pagging.prototype = { ...@@ -319,13 +319,13 @@ table_pagging.prototype = {
} }
} }
// if(k==11){ if(k==8){
//
// if(tdContext!="&nbsp;"){ if(tdContext!="&nbsp;"){
// tdContext = df.format(new Date(tdContext)); tdContext = df.format(new Date(tdContext));
// } }
// } }
if(k==7){ if(k==9){
tdContext = "<a href='javascript:;' onclick='selectRule(\""+this.getData(this.objectlist[i],"qualityRuleId")+"\")'>查看规则</a>"; 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