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);
} }
...@@ -56,6 +56,28 @@ public class BusinessService { ...@@ -56,6 +56,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);
......
...@@ -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())));
......
...@@ -43,7 +43,7 @@ public class QualityRuleResultController { ...@@ -43,7 +43,7 @@ public class QualityRuleResultController {
@Autowired @Autowired
private ChannelService channelService; private ChannelService channelService;
@Autowired @Autowired
private BusinessService businessService; private BusinessService businessService;
...@@ -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,
......
<%@tag pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<%--数据来源,渠道,业务筛选项 --%>
<%--------------------------------------------------数据来源筛选项 --------------------------------------------------%>
<div id="StatsDataSource" class="slide-menu-option">
<label for="">数据来源</label>
<%--<div class="checkbox-inline"> <label> <input type="checkbox" name="allDataSourceStats" id="allDataSourceStats" checked> 全选 </label> </div>--%>
<div id="statsDataSourceSelectArea">
<div class="checkbox-inline">
<label>
<input type="checkbox" name="datasourceStats" class="datasourceStats" title="关键指标直采" value="5" checked>关键指标直采
</label>
</div>
</div>
</div>
<%--------------------------------------------------渠道筛选项---- --------------------------------------------------%>
<div id="StatsChannel" class="slide-menu-option">
<label id="statsChannel" for="">渠道</label>
<div class="checkbox-inline"><label><input type="checkbox" name="allChannelStats" id="allChannelStats" checked> 全选</label></div>
<div id="ChannelSelectAreaStats">
<c:forEach var="channels" items="${channelList}">
<div class="checkbox-inline">
<input type="checkbox" name="channelStats" class="channelStats" title="${channels.channelName}" value="${channels.channelId}" checked>${channels.channelName}
</div>
</c:forEach>
</div>
</div>
<%--------------------------------------------------业务筛选项---- --------------------------------------------------%>
<div id="StatsBusiness" class="slide-menu-option">
<label id="statsBusiness" for="">业务</label>
<div class="checkbox-inline"><label> <input type="checkbox" name="allBusinessStats" id="allBusinessStats" checked> 全选 </label></div>
<div id="businessSelectAreaStats">
<c:forEach items="${businessList}" varStatus="index" step="2">
<div class="checkbox-inline">
<label>
<input type="checkbox" class="businessStats" title="${businessList[index.index+1]}" value="${businessList[index.index]}" checked>${businessList[index.index+1]}
</label>
</div>
</c:forEach>
</div>
</div>
<%--------------------------------------------------数据来源JS代码块 --------------------------------------------------%>
<script type="text/javascript">
$("#allDataSourceStats").click(function(){
if($("#allDataSourceStats").attr("checked") == "checked"){//全选
$(".datasourceStats").attr("checked","checked");
statsDatasourceChange();
}else{//不全选
$(".datasourceStats").attr("checked",false);
statsDatasourceChange();
}
});
$(".datasourceStats").click(function(){
var clickFlag=true;//是否全部选中
$(".datasourceStats").each(function(){
if($(this).attr("checked") == null||$(this).attr("checked") == false){ clickFlag=false; }
});
$("#allDataSourceStats").attr("checked",clickFlag);
statsDatasourceChange();
});
//返回结果为一个数组,数组中包含选中的数据源类型
function getStatsDataSourceCheckedValues(){
var statsDataSourceArray=new Array();
var i=0;
$(".datasourceStats:checked").each(function(){
statsDataSourceArray[i]=$(this).val();
i++;
});
//if($("#allDataSourceStats").attr("checked") == "checked"&&statsDataSourceArray.length>0){statsDataSourceArray[0]+=",-1";}
return statsDataSourceArray;
}
//返回结果为逗号分隔的ID字串
function getStatsDataSourceCheckedValuesString(){
var statsDataSourceStr="";
var dataSourceArray=getStatsDataSourceCheckedValues();
for(var i=0;i<dataSourceArray.length;i++){
if(i==dataSourceArray.length-1){
statsDataSourceStr+=dataSourceArray[i];
}else{
statsDataSourceStr+=dataSourceArray[i]+",";
}
}
//if($("#allDataSourceStats").attr("checked") == "checked"&&statsDataSourceStr.length>0){statsDataSourceStr+=",-1";}
return statsDataSourceStr;
}
//返回结果为一个数组,数组中包含选中的数据源类型
function getStatsDataSourceCheckedTexts(){
var statsDataSourceArray=new Array();
var i=0;
$(".datasourceStats:checked").each(function(){
statsDataSourceArray[i]=$(this).text();
i++;
});
return statsDataSourceArray;
}
//返回结果为逗号分隔的ID字串
function getStatsDataSourceCheckedTextsString(){
var statsDataSourceStr="";
var dataSourceArray=getStatsDataSourceCheckedTexts();
for(var i=0;i<dataSourceArray.length;i++){
if(i==dataSourceArray.length-1){
statsDataSourceStr+=dataSourceArray[i];
}else{
statsDataSourceStr+=dataSourceArray[i]+",";
}
}
return statsDataSourceStr;
}
//返回结果为一个数组,数组中包含选中的数据源类型的标题
function getStatsDataSourceCheckedTitles(){
var statsDataSourceArray=new Array();
var i=0;
$(".datasourceStats:checked").each(function(){
statsDataSourceArray[i]=$(this).attr("title");
i++;
});
var statsDataSourceTitles="";
for(i=0;i<statsDataSourceArray.length;i++){
if(i==statsDataSourceArray.length-1){
statsDataSourceTitles += statsDataSourceArray[i];
}else{
statsDataSourceTitles += statsDataSourceArray[i]+" ";
}
}
return statsDataSourceTitles;
}
//数据来源,渠道,业务三级联动重置
function statsDataSourceReset(){
$("#allDataSourceStats").attr("checked","ckecked");
$(".datasourceStats").attr("checked","checked");
statsDatasourceChange();
}
</script>
<%--------------------------------------------------渠道JS代码块 --------------------------------------------------%>
<script type="text/javascript">
$("#allChannelStats").click(function(){
if($("#allChannelStats").attr("checked") == "checked"){//全选
$(".channelStats").attr("checked","checked");
statsChannelChange();
}else{//不全选
$(".channelStats").attr("checked",false);
statsChannelChange();
}
});
$(".channelStats").click(function(){
var clickFlag=true;//是否全部选中
$(".channelStats").each(function(){
if($(this).attr("checked") == null||$(this).attr("checked") == false){ clickFlag=false; }
});
$("#allChannelStats").attr("checked",clickFlag);
statsChannelChange();
});
//返回结果为一个数组,数组中包含选中的渠道类型
function getStatsChannelCheckedValues(){
var statsChannelArray=new Array();
var i=0;
$(".channelStats:checked").each(function(){
statsChannelArray[i]=$(this).val();
i++;
});
//if($("#allChannelStats").attr("checked") == "checked"&&statsChannelArray.length>0){statsChannelArray[0]+=",-1";}
return statsChannelArray;
}
//返回结果为逗号分隔的ID字串
function getStatsChannelCheckedValuesString(){
var statsChannelStr="";
var statsChannelArray=getStatsChannelCheckedValues();
for(var i=0;i<statsChannelArray.length;i++){
if(i==statsChannelArray.length-1){
statsChannelStr+=statsChannelArray[i];
}else{
statsChannelStr+=statsChannelArray[i]+",";
}
}
//if($("#allChannelStats").attr("checked") == "checked"&&statsChannelStr.length>0){statsChannelStr+=",-1";}
return statsChannelStr;
}
//返回结果为一个数组,数组中包含选中的渠道类型
function getStatsChannelCheckedTexts(){
var statsChannelArray=new Array();
var i=0;
$(".channelStats:checked").each(function(){
statsChannelArray[i]=$(this).text();
i++;
});
return statsChannelArray;
}
//返回结果为逗号分隔的ID字串
function getStatsChannelCheckedTextsString(){
var statsChannelStr="";
var statsChannelArray=getStatsChannelCheckedTexts();
for(var i=0;i<statsChannelArray.length;i++){
if(i==statsChannelArray.length-1){
statsChannelStr+=statsChannelArray[i];
}else{
statsChannelStr+=statsChannelArray[i]+",";
}
}
return statsChannelStr;
}
//返回结果为逗号分隔的渠道名称字串
function getStatsChannelCheckedTitles(){
var statsChannelArray=new Array();
var i=0;
$(".channelStats:checked").each(function(){
statsChannelArray[i]=$(this).attr("title");
i++;
});
var statsChannelTitles="";
for(var i=0;i<statsChannelArray.length;i++){
if(i==statsChannelArray.length-1){
statsChannelTitles+=statsChannelArray[i];
}else{
statsChannelTitles+=statsChannelArray[i]+" ";
}
}
return statsChannelTitles;
}
</script>
<%--------------------------------------------------业务JS代码块 --------------------------------------------------%>
<script type="text/javascript">
$("#allBusinessStats").click(function(){
if($("#allBusinessStats").attr("checked") == "checked"){//全选
$(".businessStats").attr("checked","checked");
}else{//不全选
$(".businessStats").attr("checked",false);
$(".businessStats").attr("disabled",false);
}
});
$(".businessStats").click(function(){
var clickFlag=true;//是否全部选中
$(".businessStats").each(function(){
if($(this).attr("checked") == null||$(this).attr("checked") == false){ clickFlag=false; }
});
$("#allBusinessStats").attr("checked",clickFlag);
});
//返回结果为一个数组,数组中包含选中的渠道类型
function getStatsBusinessCheckedValues(){
var statsBusinessArray=new Array();
var i=0;
$(".businessStats:checked").each(function(){
statsBusinessArray[i]=$(this).val();
i++;
});
//if($("#allBusinessStats").attr("checked") == "checked"&&statsBusinessArray.length>0){statsBusinessArray[0]+=",-1";}
return statsBusinessArray;
}
//返回结果为逗号分隔的ID字串
function getStatsBusinessCheckedValuesString(){
var statsBusinessStr="";
var statsBusinessArray=getStatsBusinessCheckedValues();
for(var i=0;i<statsBusinessArray.length;i++){
if(i==statsBusinessArray.length-1){
statsBusinessStr+=statsBusinessArray[i];
}else{
statsBusinessStr+=statsBusinessArray[i]+",";
}
}
//if($("#allBusinessStats").attr("checked") == "checked"&&statsBusinessStr.length>0){statsBusinessStr+=",-1";}
return statsBusinessStr;
}
////返回结果为逗号分隔的业务title
function getStatsBusinessCheckedTitlesString(){
var statsBusinessArray=new Array();
var i=0;
$(".businessStats:checked").each(function(){
statsBusinessArray[i]=$(this).attr("title");
i++;
});
var statsBusinessTitles="";
for(var i=0;i<statsBusinessArray.length;i++){
if(i==statsBusinessArray.length-1){
statsBusinessTitles+=statsBusinessArray[i];
}else{
statsBusinessTitles+=statsBusinessArray[i]+" ";
}
}
return statsBusinessTitles;
}
</script>
<%--------------------------------------------------数据来源变化--------------------------------------------------%>
<script type="text/javascript">
function statsDatasourceChange(){
$("#businessSelectAreaStats").empty();
var timestamp = Date.parse(new Date());
var dataSourceIds = "5";
if(dataSourceIds==""){dataSourceIds="0";}
$.ajax({
type : 'GET',
contentType : 'application/json',
url: '${ctx}/MonitorOperation/FailureStatisticsCriteria/datasource_select/'+dataSourceIds+'/'+timestamp,
async: false ,
dataType : 'text',
beforeSend: function(data) {},
success: function(data) {
for(var i=0;i<data.length;i++){
if(data[i]=='\"'){
data=data.replace('\"','\'');
}
}
data=eval("("+data+")");//获取从后台返回的数据,通常是Json格式
if(data == null || data == ""){
statsChannelChange();
$("#ChannelSelectAreaStats").empty();
}
else{
$("#allChannelStats").attr("checked",true);
$("#ChannelSelectAreaStats").empty();
for(var t=0;t<data.length;t++){
$("#ChannelSelectAreaStats").append('<div class="checkbox-inline"><label><input type="checkbox" name="channelStats" class="channelStats" title="'+data[t].channelName+'" value="'+data[t].channelId+'" checked>'+data[t].channelName+'</label></div>');
}
statsChannelChange();
}
$(".channelStats").click(function(){
var clickFlag=true;//是否全部选中
$(".channelStats").each(function(){
if($(this).attr("checked") == null||$(this).attr("checked") == false){ clickFlag=false; }
});
$("#allChannelStats").attr("checked",clickFlag);
statsChannelChange();
});
}
});
}
<%--------------------------------------------------渠道变化--------------------------------------------------%>
function statsChannelChange(){
var timestamp = Date.parse(new Date());
var dataSourceIds = "5";
var channelIds = getStatsChannelCheckedValuesString();
if(channelIds==""){channelIds="0";}
$.ajax({
type : 'GET',
contentType : 'application/json',
url: '${ctx}/MonitorOperation/FailureStatisticsCriteria/channel_select/'+dataSourceIds+'/channelId/'+channelIds+'/'+timestamp,
dataType : 'text',
beforeSend: function(data) {},
success: function(data) {
for(var i=0;i<data.length;i++){
if(data[i]=='\"'){
data=data.replace('\"','\'');
}
}
data=eval("("+data+")");//获取从后台返回的数据,通常是Json格式
if(data == null || data == ""){
$("#businessSelectAreaStats").empty();
}else{
$("#allBusinessStats").attr("checked",true);
$("#businessSelectAreaStats").show();
$("#businessSelectAreaStats").empty();
for(var t=0;t<data.length;t=t+2){
$("#businessSelectAreaStats").append('<div class="checkbox-inline"><label><input type="checkbox" name="businessStats" class="businessStats" title="'+data[t+1]+'" value="'+data[t]+'" checked>'+data[t+1]+'</label></div>');
}
}
$(".businessStats").click(function(){
var clickFlag=true;//是否全部选中
$(".businessStats").each(function(){
if($(this).attr("checked") == null||$(this).attr("checked") == false){ clickFlag=false; }
});
$("#allBusinessStats").attr("checked",clickFlag);
});
}
});
}
</script>
\ No newline at end of file
...@@ -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