Commit 6107fd18 authored by liuna's avatar liuna

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

--解决数据质量规则新增和修改规则问题
parent 700c6ca7
...@@ -124,5 +124,24 @@ public class AccuracyRule implements Serializable { ...@@ -124,5 +124,24 @@ public class AccuracyRule implements Serializable {
public void setValidFlag(String validFlag) { public void setValidFlag(String validFlag) {
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,9 +33,14 @@ public interface AccuracyRuleDao extends JpaSpecificationExecutor<AccuracyRule>, ...@@ -33,9 +33,14 @@ 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
@Query("delete from AccuracyRule ar where ar.accuracyRuleId=:accuracyRuleId") @Query("delete from AccuracyRule ar where ar.accuracyRuleId=:accuracyRuleId")
......
...@@ -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);
//由指标名得到指标周期类型 //由指标名得到指标周期类型
......
...@@ -26,6 +26,10 @@ public interface QualityRuleDao extends JpaSpecificationExecutor<QualityRule>, ...@@ -26,6 +26,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
...@@ -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,9 +29,15 @@ public class AccuracyRuleService { ...@@ -29,9 +29,15 @@ 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)
......
...@@ -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);
} }
} }
...@@ -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"];
// header[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