Commit 700c6ca7 authored by liuna's avatar liuna

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

--解决数据质量规则筛选项等问题
parent cb77997a
...@@ -32,6 +32,9 @@ public interface BusinessDao extends JpaSpecificationExecutor<Business>, ...@@ -32,6 +32,9 @@ public interface BusinessDao extends JpaSpecificationExecutor<Business>,
@Query("select business.businessId, business.businessName from Business business where business.isActive = 'Y' and business.businessId >= 0 order by business.businessId") @Query("select business.businessId, business.businessName from Business business where business.isActive = 'Y' and business.businessId >= 0 order by business.businessId")
List<Object[]> findAllBusinessIdAndBusinessName(); List<Object[]> findAllBusinessIdAndBusinessName();
@Query("select business.businessId, business.businessName from Business business where business.isActive = 'Y' and business.businessId >= 0 and channelDataSourceMapId in(9,12,13,14,15,16) order by business.businessId")
List<Object[]> findBusiness();
//加入isActive=N || add by August 2014-3-27 //加入isActive=N || add by August 2014-3-27
//由数据来源和渠道得到业务 //由数据来源和渠道得到业务
@Query("select business.businessId, business.businessName from Business business,ChannelDataSourceMap channelDataSourceMap where business.channelDataSourceMapId=channelDataSourceMap.channelDataSourceMapId and channelDataSourceMap.channelId IN (:channelIdList) and channelDataSourceMap.dataSourceId IN (:datasourceIdList) and business.isActive = 'Y' and business.businessId >= 0 order by business.businessId ") @Query("select business.businessId, business.businessName from Business business,ChannelDataSourceMap channelDataSourceMap where business.channelDataSourceMapId=channelDataSourceMap.channelDataSourceMapId and channelDataSourceMap.channelId IN (:channelIdList) and channelDataSourceMap.dataSourceId IN (:datasourceIdList) and business.isActive = 'Y' and business.businessId >= 0 order by business.businessId ")
......
...@@ -37,6 +37,8 @@ public interface KpiDao extends JpaSpecificationExecutor<Kpi>,PagingAndSortingRe ...@@ -37,6 +37,8 @@ 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();
//由数据来源得到指标
//由指标名得到指标周期类型 //由指标名得到指标周期类型
@Query("select kpiCycleType.isHourKpi from Kpi kpi,KpiCycleType kpiCycleType where kpi.kpiCycleTypeId=kpiCycleType.kpiCycleTypeId and kpi.kpiName IN (:kpiName) and kpi.kpiId >=0") @Query("select kpiCycleType.isHourKpi from Kpi kpi,KpiCycleType kpiCycleType where kpi.kpiCycleTypeId=kpiCycleType.kpiCycleTypeId and kpi.kpiName IN (:kpiName) and kpi.kpiId >=0")
......
...@@ -14,5 +14,5 @@ public interface QualityRuleViewDao extends JpaSpecificationExecutor<QualityRule ...@@ -14,5 +14,5 @@ public interface QualityRuleViewDao extends JpaSpecificationExecutor<QualityRule
QualityRuleView findByQualityRuleId(Long qualityRuleId); QualityRuleView findByQualityRuleId(Long qualityRuleId);
//根据筛选项得到质量规则 //根据筛选项得到质量规则
List<QualityRuleView> findByDataSourceIdInAndChannelIdInAndBusinessIdInAndProvinceIdInOrderByQualityRuleIdAscBusinessTimeDesc(List<Long> dataSource,List<Long> chnnal,List<Long> busines,List<Long>province); List<QualityRuleView> findByDataSourceIdInAndChannelIdInAndBusinessIdInOrderByQualityRuleIdAscBusinessTimeDesc(List<Long> dataSource,List<Long> chnnal,List<Long> busines);
} }
...@@ -57,6 +57,28 @@ public class BusinessService { ...@@ -57,6 +57,28 @@ public class BusinessService {
return businessList; return businessList;
} }
public List<String> getBusinessIdAndBusinessName(){
List<Object[]> list = businessDao.findBusiness();
List<String> businessList = new ArrayList<String>();
for(int i=0;i<list.size();i++){
Object[] obj1 = list.get(i);
for(int j=0;j<list.size();j++){
if(j!=i){
Object[] obj2 = list.get(j);
if(obj1[1].equals(obj2[1])){
obj1[0] = obj1[0]+","+obj2[0];
list.remove(j);
j--;
}
}
}
businessList.add(obj1[0].toString());
businessList.add(obj1[1].toString());
}
return businessList;
}
public List<String> getBusinessByChannelName(String channelName){ public List<String> getBusinessByChannelName(String channelName){
List<Object[]> list = businessDao.findBusinessByChannelName(channelName); List<Object[]> list = businessDao.findBusinessByChannelName(channelName);
List<String> businessList = new ArrayList<String>(); List<String> businessList = new ArrayList<String>();
......
...@@ -16,8 +16,8 @@ public class QualityRuleViewService { ...@@ -16,8 +16,8 @@ public class QualityRuleViewService {
private QualityRuleViewDao qualityRuleViewDao; private QualityRuleViewDao qualityRuleViewDao;
//根据筛选项得到质量规则 //根据筛选项得到质量规则
public List<QualityRuleView> getQualityRuleViewBy(List<Long> dataSource, List<Long> chnnal, List<Long> busines, List<Long>province){ public List<QualityRuleView> getQualityRuleViewBy(List<Long> dataSource, List<Long> chnnal, List<Long> busines){
return qualityRuleViewDao.findByDataSourceIdInAndChannelIdInAndBusinessIdInAndProvinceIdInOrderByQualityRuleIdAscBusinessTimeDesc(dataSource,chnnal,busines,province); return qualityRuleViewDao.findByDataSourceIdInAndChannelIdInAndBusinessIdInOrderByQualityRuleIdAscBusinessTimeDesc(dataSource,chnnal,busines);
} }
} }
...@@ -277,16 +277,16 @@ public class QualityRuleMaintainController { ...@@ -277,16 +277,16 @@ public class QualityRuleMaintainController {
qualityRule.setKpiMonitorTime("ADD_MONTH("+frequencyValue+")"); qualityRule.setKpiMonitorTime("ADD_MONTH("+frequencyValue+")");
} }
} }
if(!businessTime.trim().equals("")){ qualityRule.setBusinessTime(Timestamp.valueOf(businessTime+" 00:00:00")); } if(!businessTime.trim().equals("")){ qualityRule.setBusinessTime(Timestamp.valueOf(businessTime)); }
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+" 00:00:00").getTime()+Integer.parseInt(frequencyValue)*60*1000))); qualityRule.setKpiMonitorRunTime(Timestamp.valueOf(sd.format(sd.parse(businessTime).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+" 00:00:00").getTime()+Integer.parseInt(frequencyValue)*60*60*1000))); qualityRule.setKpiMonitorRunTime(Timestamp.valueOf(sd.format(sd.parse(businessTime).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+" 00:00:00").getTime()+Integer.parseInt(frequencyValue)*24*60*60*1000))); qualityRule.setKpiMonitorRunTime(Timestamp.valueOf(sd.format(sd.parse(businessTime).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+" 00:00:00").getMonth()+Integer.parseInt(frequencyValue)))); qualityRule.setKpiMonitorRunTime(Timestamp.valueOf(sd.format(sd.parse(businessTime).getMonth()+Integer.parseInt(frequencyValue))));
} }
} }
qualityRule.setRuleCrtTime(Timestamp.valueOf(sd.format(new Date()))); qualityRule.setRuleCrtTime(Timestamp.valueOf(sd.format(new Date())));
......
...@@ -89,7 +89,7 @@ public class QualityRuleResultController { ...@@ -89,7 +89,7 @@ public class QualityRuleResultController {
//查询出所有的指标 //查询出所有的指标
List<Kpi> kpiList=(List<Kpi>)kpiDao.findAll(); List<Kpi> kpiList=(List<Kpi>)kpiDao.findAll();
//查询出所有的业务 //查询出所有的业务
List<String> businessList=businessService.getAllBusinessIdAndBusinessName(); List<String> businessList=businessService.getBusinessIdAndBusinessName();
//查询出所有的数据来源信息 //查询出所有的数据来源信息
List<DataSource> datasourceList=dataSourceDao.findDataSource(); List<DataSource> datasourceList=dataSourceDao.findDataSource();
//查询出所有质量规则 //查询出所有质量规则
...@@ -115,7 +115,6 @@ public class QualityRuleResultController { ...@@ -115,7 +115,6 @@ public class QualityRuleResultController {
@RequestParam(value = "dataSource") String dataSource,// 数据来源 @RequestParam(value = "dataSource") String dataSource,// 数据来源
@RequestParam(value = "chnnal") String chnnal,//渠道 @RequestParam(value = "chnnal") String chnnal,//渠道
@RequestParam(value = "bussines") String bussines,//业务 @RequestParam(value = "bussines") String bussines,//业务
@RequestParam(value = "province") String province,//省份
HttpServletResponse response) throws UnsupportedEncodingException{ HttpServletResponse response) throws UnsupportedEncodingException{
cmszOperationLogService.createLog("查询","质量规则","由筛选项得到质量规则"); cmszOperationLogService.createLog("查询","质量规则","由筛选项得到质量规则");
...@@ -123,12 +122,10 @@ public class QualityRuleResultController { ...@@ -123,12 +122,10 @@ public class QualityRuleResultController {
String[] dataSourceS=dataSource.split(","); String[] dataSourceS=dataSource.split(",");
String[] chnnalS=chnnal.split(","); String[] chnnalS=chnnal.split(",");
String[] bussinesS =bussines.split(","); String[] bussinesS =bussines.split(",");
String[] provinceS=province.split(",");
List<Long> dataSourceList=changeStrToList(dataSourceS); List<Long> dataSourceList=changeStrToList(dataSourceS);
List<Long> chnnalList=changeStrToList(chnnalS); List<Long> chnnalList=changeStrToList(chnnalS);
List<Long> bussinesList=changeStrToList(bussinesS); List<Long> bussinesList=changeStrToList(bussinesS);
List<Long> provinceList=changeStrToList(provinceS); qualityRuleViewList = qualityRuleViewService.getQualityRuleViewBy(dataSourceList,chnnalList,bussinesList);
qualityRuleViewList = qualityRuleViewService.getQualityRuleViewBy(dataSourceList,chnnalList,bussinesList,provinceList);
Gson gson = new Gson(); Gson gson = new Gson();
response.setContentType("text/Xml;charset=gbk"); response.setContentType("text/Xml;charset=gbk");
...@@ -172,7 +169,7 @@ public class QualityRuleResultController { ...@@ -172,7 +169,7 @@ public class QualityRuleResultController {
} }
//查看准确性规则内容 //查看准确性规则内容
@RequestMapping(value = "/findAccuracy*") @RequestMapping(value = "/findAccuracy*",method = RequestMethod.GET)
@ResponseBody @ResponseBody
public void findAccuracy( public void findAccuracy(
@RequestParam(value = "qualityRuleId") String qualityRuleId, @RequestParam(value = "qualityRuleId") String qualityRuleId,
......
...@@ -109,9 +109,9 @@ ...@@ -109,9 +109,9 @@
<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",defaultDate:new Date()})'/> <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>
</tr> </tr>
<tr><td>添加准确性规则:</td> <tr><td>添加准确性规则:</td>
...@@ -477,15 +477,28 @@ $("#calCycle").change(function () { ...@@ -477,15 +477,28 @@ $("#calCycle").change(function () {
$("[name='businessinput']:checked").each(function (){ $("[name='businessinput']:checked").each(function (){
businessIds += $(this).val()+","; businessIds += $(this).val()+",";
}); });
updateKpi(businessIds,calCycleValue) updateKpi(businessIds,calCycleValue);
updateBusinessTime(calCycleValue) updateBusinessTime(calCycleValue);
updateMonitorTimeTime(calCycleValue);
}); });
updateBusiness($("#dataSource").val(),$("#channel").val()); updateBusiness($("#dataSource").val(),$("#channel").val());
function updateBusinessTime(calCycleValue) {
$("#businessTimetd").empty()
if(calCycleValue == "30MI"){
$("#businessTimetd").append("<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\",alwaysUseStartDate:true,readOnly:false,hmsMenuCfg : {H : [ 1, 6 ], m : [ 30, 2 ], s : [ 60, 0 ]}})'/>");
}else if(calCycleValue == "01HR"){
$("#businessTimetd").append("<input type='text' class='form-control' id='businessTime' name='businessTime' onfocus='WdatePicker({dateFmt:\"yyyy-MM-dd HH:00:00\",startDate:\"%y-%M-%d 00:00:00\",alwaysUseStartDate:true,readOnly:false,hmsMenuCfg : {H : [ 1, 6 ], m : [ 60, 0 ], s : [ 60, 0 ]}})'/>");
}else if(calCycleValue == "01DY"){
$("#businessTimetd").append("<input type='text' class='form-control' id='businessTime' name='businessTime' onfocus='WdatePicker({dateFmt:\"yyyy-MM-dd 00:00:00\",startDate:\"%y-%M-%d 00:00:00\",alwaysUseStartDate:true,readOnly:false,hmsMenuCfg : {H : [ 24, 0 ], m : [ 60, 0 ], s : [ 60, 0 ]}})'/>");
}else if(calCycleValue == "01MO"){
$("#businessTimetd").append("<input type='text' class='form-control' id='businessTime' name='businessTime' onfocus='WdatePicker({dateFmt:\"yyyy-MM-01 00:00:00\",startDate:\"%y-%M-%d 00:00:00\",alwaysUseStartDate:true,readOnly:false,hmsMenuCfg : {H : [ 24, 0 ], m : [ 60, 0 ], s : [ 60, 0 ]}})' />");
}
}
$("#frequencyValue").val("30"); $("#frequencyValue").val("30");
function updateBusinessTime(calCycleValue) { function updateMonitorTimeTime(calCycleValue) {
if(calCycleValue == "30MI"){ if(calCycleValue == "30MI"){
$("#frequencyValue").val("30"); $("#frequencyValue").val("30");
$("#frequencyType").val(0); $("#frequencyType").val(0);
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
<div class="slideMenu" id="cbp-spmenu-s2" style=""> <div class="slideMenu" id="cbp-spmenu-s2" style="">
<div class="form"> <div class="form">
<tags:GJFX_datasource_channle_business/> <tags:Quality_dataSource_channel_business/>
<button id="submit" class="btn btn-primary" onclick="ruleResultSubmit()">提交</button> <button id="submit" class="btn btn-primary" onclick="ruleResultSubmit()">提交</button>
<button id="disable" class="btn btn-warning" onclick="ruleResultReset()">重置</button> <button id="disable" class="btn btn-warning" onclick="ruleResultReset()">重置</button>
...@@ -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" id="deleteRule" disabled>删除规则</button> <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" 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>
...@@ -146,7 +146,6 @@ $("#createRule").click(function(){ ...@@ -146,7 +146,6 @@ $("#createRule").click(function(){
qualityRuleId=""; qualityRuleId="";
$("#updateRule").attr("disabled", true); $("#updateRule").attr("disabled", true);
toggleMenu('slidePushMenus2');//隐藏筛选项 toggleMenu('slidePushMenus2');//隐藏筛选项
updateTag(true);
} }
}); });
} }
......
...@@ -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[6] = ["数据采集频率","calCycle","7%","15"]; header[5] = ["数据采集频率","calCycle","7%","15"];
header[7] = ["监控延迟时间","kpiMonitorTime","7%","15"]; header[6] = ["监控延迟时间","kpiMonitorTime","7%","15"];
// header[11] = ["指标采集时间","businessTime","7%","15"]; // header[11] = ["指标采集时间","businessTime","7%","15"];
header[8] = ["准确性规则","accuracyRuleId","7%","15"]; header[7] = ["准确性规则","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==7){ if(k==6){
if(tdContext.indexOf("/")!=-1){ if(tdContext.indexOf("/")!=-1){
var a = new Array(); var a = new Array();
a = tdContext.split("/"); a = tdContext.split("/");
...@@ -325,7 +325,7 @@ table_pagging.prototype = { ...@@ -325,7 +325,7 @@ table_pagging.prototype = {
// tdContext = df.format(new Date(tdContext)); // tdContext = df.format(new Date(tdContext));
// } // }
// } // }
if(k==8){ if(k==7){
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>";
} }
...@@ -555,7 +555,7 @@ function selectRule(qualityRuleId){ ...@@ -555,7 +555,7 @@ function selectRule(qualityRuleId){
$.ajax({ $.ajax({
type : 'GET', type : 'GET',
contentType : 'application/json', contentType : 'application/json',
url: "${ctx}/AnalysisSupport/QualityRuleResult/findAccuracy?qualityRuleId="+qualityRuleId, url: "/AnalysisSupport/QualityRuleResult/findAccuracy?qualityRuleId="+qualityRuleId,
dataType : 'text', dataType : 'text',
beforeSend: function(data) { beforeSend: function(data) {
}, },
......
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