Commit 98880f94 authored by 莫林毅's avatar 莫林毅

1 监控运营/协查单管理/协查单明细

修改 '分析报告' 字段 2 监控运营/协查单管理/定制分析 修改前台搜索项&修改后台SQL
parent d16b3545
...@@ -12,34 +12,44 @@ import org.springframework.data.repository.query.Param; ...@@ -12,34 +12,44 @@ import org.springframework.data.repository.query.Param;
import com.hp.cmsz.entity.DimKpi; import com.hp.cmsz.entity.DimKpi;
public interface DimKpiDao extends JpaSpecificationExecutor<DimKpi>, public interface DimKpiDao extends JpaSpecificationExecutor<DimKpi>,
PagingAndSortingRepository<DimKpi, Long>{ PagingAndSortingRepository<DimKpi, Long> {
List<DimKpi> findAllByIsActiveAndBusnameId(String active,Long businessId); List<DimKpi> findAllByIsActiveAndBusnameId(String active, Long businessId);
//通过kpiTypeId查找数据采集频率 //通过kpiTypeId查找数据采集频率
@Query("select dk.calCycle from DimKpi dk where dk.kpiTypeId = :kpiTypeId") @Query("select dk.calCycle from DimKpi dk where dk.kpiTypeId = :kpiTypeId")
List<String> findCayCycleByKpiTypeIdIn(@Param("kpiTypeId")Long kpiTypeId); List<String> findCayCycleByKpiTypeIdIn(@Param("kpiTypeId") Long kpiTypeId);
//通过kpiTypeId修改数据采集频率 //通过kpiTypeId修改数据采集频率
@Modifying @Modifying
@Query("update from DimKpi dk set dk.calCycle=:calCycle where dk.kpiTypeId=:kpiTypeId") @Query("update from DimKpi dk set dk.calCycle=:calCycle where dk.kpiTypeId=:kpiTypeId")
void updateDimKpiByKpiTypeId(@Param("calCycle")String calCycle,@Param("kpiTypeId")Long kpiTypeId); void updateDimKpiByKpiTypeId(@Param("calCycle") String calCycle, @Param("kpiTypeId") Long kpiTypeId);
@Query("select dimKpi from DimKpi dimKpi") @Query("select dimKpi from DimKpi dimKpi")
List<DimKpi> findAllDimKpi(); List<DimKpi> findAllDimKpi();
@Query("select dimKpi from DimKpi dimKpi where dimKpi.busnameId in (:busnameIdList)") @Query("select dimKpi from DimKpi dimKpi where dimKpi.busnameId in (:busnameIdList)")
public List<DimKpi> findDimKpiListBybusnameIdList(@Param(value = "busnameIdList") List<Long>busnameIdList); public List<DimKpi> findDimKpiListBybusnameIdList(@Param(value = "busnameIdList") List<Long> busnameIdList);
//本语句 所对应的表非 本实体类对应的表 [临时加] //本语句 所对应的表非 本实体类对应的表 [临时加]
@Query(value = "select kpi_name,kpi_id from dim_kpi_info_t where business_id in (:busnameIdList) and IS_ACTIVE= :isActive ",nativeQuery = true) @Query(value = "select kpi_name,kpi_id from dim_kpi_info_t where business_id in (:busnameIdList) and IS_ACTIVE= :isActive ", nativeQuery = true)
public List<Object[]> findDimKpiListBybusnameIdList2(@Param(value = "busnameIdList") List<Long>busnameIdList, public List<Object[]> findDimKpiListBybusnameIdList2(@Param(value = "busnameIdList") List<Long> busnameIdList,
@Param(value = "isActive")String isActive); @Param(value = "isActive") String isActive);
@Query("select dimKpi from DimKpi dimKpi where dimKpi.kpiId in (:kpiIdList)")
public List<DimKpi> findDimKpiListBykpiIdList(@Param(value = "kpiIdList") List<Long>kpiIdList); //本语句 所对应的表非 本实体类对应的表 [临时加] 2018/05/20 新加
@Query(value = "select kpi_name,kpi_id from dim_kpi_info_t where business_id in " +
"(select business_id from dim_business_info_t where business_id in" +
"( select distinct business_id from etl.run_task_t a ) and IS_ACTIVE= :isActive and " +
"CHANNEL_DATA_SOURCE_MAP_ID in (:channelDataSourceMapIdList)) and IS_ACTIVE= :isActive " +
"and kpi_id in(select distinct kpi_id from etl.run_task_t a where kpi_id is not null and valid_flg=1) ", nativeQuery = true)
public List<Object[]> findDimKpiListByChannelDataSourceMapIdList(@Param(value = "channelDataSourceMapIdList") List<Long> channelDataSourceMapIdList,
@Param(value = "isActive") String isActive);
@Query("select dimKpi from DimKpi dimKpi where dimKpi.kpiId in (:kpiIdList)")
public List<DimKpi> findDimKpiListBykpiIdList(@Param(value = "kpiIdList") List<Long> kpiIdList);
} }
...@@ -75,4 +75,48 @@ public class WorkingOrderCustomAnalysisService { ...@@ -75,4 +75,48 @@ public class WorkingOrderCustomAnalysisService {
return list1; return list1;
} }
public List<Map<String,Object>> getDimKpiListByDataSourceIdListAndChinnalIdList(List<Long> dataSourceIdList,List<Long> chinnalIdList,String isActive){
/**
*@编写人: m01
*@编写时间: 2018/5/20 0020 下午 8:18
*@描述: 新的kpi 查找方法 sql改变了
*@参数: [dataSourceIdList, chinnalIdList, isActive]
*@参数类型:
*@参数描述:
*@返回值:
*@返回类型:
*@返回值描述:
*@修改人: 暂无
*@修改时间: 2018/5/20 0020 下午 8:18
*@备注:
**/
List<Map<String,Object>>result=new ArrayList<Map<String, Object>>();
List<Object[]> list=new ArrayList<Object[]>();
//先查找DataSourceMapId 再根据dataSourceMapId 查找kpi
List<Long> longList = new ArrayList<Long>();
List<Object> objectList = channelDataSourceMapDao.findChannelDataSourceMapIdByChannelIdListAndDataSourceIdList(dataSourceIdList, chinnalIdList);
if (objectList == null || objectList.size() < 1) {
} else {
for (Object o : objectList) {
longList.add((Long) o);
}
}
if(longList.size() !=0){
list=dimKpiDao.findDimKpiListByChannelDataSourceMapIdList(longList,"Y");
for (Object[] objects : list) {
Map<String,Object>map=new HashMap<String,Object>();
map.put("kpiName",objects[0]);
map.put("kpiId",objects[1]);
System.out.println(objects[0]+" "+objects[1]);
result.add(map);
}
System.out.println("result "+result.size());
return result;
}else{
return result;
}
}
} }
...@@ -518,6 +518,56 @@ public class WorkingOrderCustomAnalysisController { ...@@ -518,6 +518,56 @@ public class WorkingOrderCustomAnalysisController {
} }
@RequestMapping("/getDimKpiListByDataSourceIdListAndChinnalIdList/{dataSourceIdStr}/{chinnalIdStr}")
@ResponseBody
public List<Map<String, Object>> getDimKpiListByDataSourceIdListAndChinnalIdList(
@PathVariable(value = "dataSourceIdStr") String dataSourceIdStr,
@PathVariable(value = "chinnalIdStr") String chinnalIdStr
) {
/**
*@编写人: m01
*@编写时间: 2018/5/20 0020 下午 8:16
*@描述:
*@参数: [dataSourceIdStr, chinnalIdStr]
*@参数类型:
*@参数描述:
*@返回值:
*@返回类型:
*@返回值描述:
*@修改人: 暂无
*@修改时间: 2018/5/20 0020 下午 8:16
*@备注:
**/
System.out.println("dataSourceIdStr =" + dataSourceIdStr);
System.out.println("chinnalIdStr =" + chinnalIdStr);
List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
String str = "";
if ("".equalsIgnoreCase(dataSourceIdStr)||"".equalsIgnoreCase(chinnalIdStr)) {
return list;
}
String[] dataSourceIdArr = dataSourceIdStr.split("-");
List<Long> dataSourceIdList = new CopyOnWriteArrayList<Long>();
for (int i = 0; i < dataSourceIdArr.length; i++) {
dataSourceIdList.add(Long.parseLong(dataSourceIdArr[i]));
}
String[] chinnalIdArr = chinnalIdStr.split("-");
List<Long> chinnalIdList = new CopyOnWriteArrayList<Long>();
for (int i = 0; i < chinnalIdArr.length; i++) {
chinnalIdList.add(Long.parseLong(chinnalIdArr[i]));
}
list = workingOrderCustomAnalysisService.getDimKpiListByDataSourceIdListAndChinnalIdList(dataSourceIdList,chinnalIdList, "Y");
return list;
}
@RequestMapping("/getDimKpiListByBusinessIdList/{businessIdList}") @RequestMapping("/getDimKpiListByBusinessIdList/{businessIdList}")
@ResponseBody @ResponseBody
public List<Map<String, Object>> getDimKpiListByBusinessIdList( public List<Map<String, Object>> getDimKpiListByBusinessIdList(
......
...@@ -188,6 +188,7 @@ ...@@ -188,6 +188,7 @@
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li><a href="${ctx}/MonitorOperation/WorkingOrderAnalysis">协查单统计</a></li> <li><a href="${ctx}/MonitorOperation/WorkingOrderAnalysis">协查单统计</a></li>
<li><a href="${ctx}/MonitorOperation/WorkingOrderReasult">协查单明细</a></li> <li><a href="${ctx}/MonitorOperation/WorkingOrderReasult">协查单明细</a></li>
<li><a href="${ctx}/MonitorOperation/CustomAnalysis">定制分析</a></li>
</ul> </ul>
</li> </li>
</shiro:hasPermission> </shiro:hasPermission>
......
<%@tag pageEncoding="UTF-8"%> <%@tag pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<div id="business_div" class="slide-menu-option"> <div id="business_div" class="slide-menu-option" style="display: none;">
<label for="">业务</label> <label for="">业务</label>
<div id ="allBusiness_div" class="checkbox-inline"> <div id ="allBusiness_div" class="checkbox-inline">
<label> <label>
......
...@@ -5,15 +5,56 @@ ...@@ -5,15 +5,56 @@
<label id="labelChannel" for="">渠道</label> <label id="labelChannel" for="">渠道</label>
<div class="checkbox-inline"> <div class="checkbox-inline">
<label> <label>
<input type="checkbox" name="allChannel" id="allChannel"> 全选 <input type="checkbox" name="allChannel" id="allChannel" > 全选
</label> </label>
</div> </div>
<div> <div>
<c:forEach var="channel" items="${channelList}"> <c:forEach var="channel" items="${channelList}">
<div class="checkbox-inline"> <c:choose>
<input type="checkbox" name="channel" <c:when test="${channel.channelName =='网厅'}">
title="${channel.channelName}" value="${channel.channelId}">${channel.channelName} <div class="checkbox-inline">
</div> <input type="checkbox" name="channel"
title="${channel.channelName}" value="${channel.channelId}" >${channel.channelName}
</div>
</c:when>
<c:when test="${channel.channelName =='IVR'}">
<div class="checkbox-inline">
<input type="checkbox" name="channel"
title="${channel.channelName}" value="${channel.channelId}" >${channel.channelName}
</div>
</c:when>
<c:when test="${channel.channelName =='平台'}">
<div class="checkbox-inline">
<input type="checkbox" name="channel"
title="${channel.channelName}" value="${channel.channelId}" >${channel.channelName}
</div>
</c:when>
<c:when test="${channel.channelName =='实体厅'}">
<div class="checkbox-inline">
<input type="checkbox" name="channel"
title="${channel.channelName}" value="${channel.channelId}" >${channel.channelName}
</div>
</c:when>
<c:when test="${channel.channelName =='WAP'}">
<div class="checkbox-inline">
<input type="checkbox" name="channel"
title="${channel.channelName}" value="${channel.channelId}" >${channel.channelName}
</div>
</c:when>
<c:when test="${channel.channelName =='短厅'}">
<div class="checkbox-inline">
<input type="checkbox" name="channel"
title="${channel.channelName}" value="${channel.channelId}" >${channel.channelName}
</div>
</c:when>
<c:when test="${channel.channelName =='所有渠道'}">
<div class="checkbox-inline">
<input type="checkbox" name="channel"
title="${channel.channelName}" value="${channel.channelId}" >${channel.channelName}
</div>
</c:when>
</c:choose>
</c:forEach> </c:forEach>
</div> </div>
</div> </div>
...@@ -26,24 +67,30 @@ ...@@ -26,24 +67,30 @@
$('input[name="channel"]').prop('checked',true); $('input[name="channel"]').prop('checked',true);
getBusinessByDatasource(); // getBusinessByDatasource();
getKpiByDatasource();
}else{ }else{
$('input[name="channel"]').prop('checked',false); $('input[name="channel"]').prop('checked',false);
getBusinessByDatasource(); // getBusinessByDatasource();
getKpiByDatasource();
} }
}); });
// 渠道 复选框 // 渠道 复选框
$('input[name="channel"]').on('click',function () { $('input[name="channel"]').on('click',function () {
cancelselectbusinessandkpi(); cancelselectbusinessandkpi();
if($(this).prop('checked')){ console.log(1);
$(this).prop('checked',true); /* if($(this).prop('checked')){
//$(this).prop('checked',true);
getBusinessByDatasource(); console.log(22);
// getBusinessByDatasource();
getKpiByDatasource();
}else{ }else{
console.log(3);
$(this).prop('checked',false); $(this).prop('checked',false);
getBusinessByDatasource(); // getBusinessByDatasource();
} getKpiByDatasource();
}*/
var isAll=true; var isAll=true;
$('input[name="channel"]').each(function () { $('input[name="channel"]').each(function () {
if(!$(this).prop('checked')){ if(!$(this).prop('checked')){
...@@ -55,6 +102,7 @@ ...@@ -55,6 +102,7 @@
}else{ }else{
$('input[name="allChannel"]').prop('checked',false); $('input[name="allChannel"]').prop('checked',false);
} }
getKpiByDatasource();
}); });
...@@ -63,8 +111,8 @@ ...@@ -63,8 +111,8 @@
function initChannel(){ function initChannel(){
$('input[name="allChannel"]').prop('checked',false); $('input[name="allChannel"]').prop('checked',true);
$('input[name="channel"]').prop('checked',false); $('input[name="channel"]').prop('checked',true);
} }
function getSelectedChannels(){ function getSelectedChannels(){
var channelArray=new Array(); var channelArray=new Array();
...@@ -76,7 +124,36 @@ ...@@ -76,7 +124,36 @@
return channelArray; return channelArray;
} }
// 联合 数据来源查找 指标
function getKpiByDatasource(){
initBusiness();
initKpi();
var selectedChannelsArr = getSelectedChannels();
if (selectedChannelsArr.length === 0) {
return;
}
var selectedChannelStr = selectedChannelsArr.join("-");
var selectedDataSourceArr = getSelectedDataSources();
if (selectedDataSourceArr.length === 0) {
return;
}
var selectedDataSourceStr = selectedDataSourceArr.join('-');
var url = "${ctx}/MonitorOperation/CustomAnalysis/getDimKpiListByDataSourceIdListAndChinnalIdList/" + selectedDataSourceStr + "/" + selectedChannelStr;
$.ajax({
url: url,
type: 'GET',
dataType: 'json',
timeout: 3000,
cache: false,
error: solveDataSourceError,
success: useDataSourceDataToKpi
});
}
// 联合 数据来源查找 业务 // 联合 数据来源查找 业务
function getBusinessByDatasource(){ function getBusinessByDatasource(){
...@@ -93,8 +170,8 @@ ...@@ -93,8 +170,8 @@
if (selectedChannelsArr.length ===0){return;} if (selectedChannelsArr.length ===0){return;}
var selectedChannelStr=selectedChannelsArr.join("-"); var selectedChannelStr=selectedChannelsArr.join("-");
// alert("selectedDataSourceStr "+selectedDataSourceStr);
// alert("selectedChannelStr "+selectedChannelStr);
var url = "${ctx}/MonitorOperation/CustomAnalysis/getBusinessByChannelIdListAndDataSourceIdList/"+selectedDataSourceStr+"/"+selectedChannelStr; var url = "${ctx}/MonitorOperation/CustomAnalysis/getBusinessByChannelIdListAndDataSourceIdList/"+selectedDataSourceStr+"/"+selectedChannelStr;
$.ajax({ $.ajax({
...@@ -109,11 +186,11 @@ ...@@ -109,11 +186,11 @@
} }
function solveDataSourceError() { function solveDataSourceError() {
initChannel();//初始化 渠道 initChannel();//初始化 渠道
initBusiness();//初始化 业务 //initBusiness();//初始化 业务
initKpi();//初始化 指标 initKpi();//初始化 指标
} }
function useDataSourceData(data){ function useDataSourceData(data){
// alert(data);
loadBusiness(data); loadBusiness(data);
} }
</script> </script>
<%@tag pageEncoding="UTF-8" %> <%@tag pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/> <c:set var="ctx" value="${pageContext.request.contextPath}"/>
<div class="slide-menu-option"> <div class="slide-menu-option">
<label for="">数据来源</label> <label for="">数据来源</label>
<div class="checkbox-inline"> <div class="checkbox-inline">
<label> <input type="checkbox" name="allDataSource" id="allDataSource" <label> <input type="checkbox" name="allDataSource" id="allDataSource"
> 全选 checked> 全选
</label> </label>
</div> </div>
<div > <div>
<c:forEach var="datasource" items="${datasourceList}"> <c:forEach var="datasource" items="${datasourceList}">
<div class="checkbox-inline"> <c:if test="${datasource.dataSourceName =='关键指标直采'}">
<label> <div class="checkbox-inline">
<input type="checkbox" name="datasource" class="datasource" <label>
title="${datasource.dataSourceName}" value="${datasource.dataSourceId}" <input type="checkbox" name="datasource" class="datasource" checked
>${datasource.dataSourceName} title="${datasource.dataSourceName}" value="${datasource.dataSourceId}"
</label> >${datasource.dataSourceName}
</div> </label>
</div>
</c:if>
</c:forEach> </c:forEach>
</div> </div>
...@@ -26,26 +29,28 @@ ...@@ -26,26 +29,28 @@
$('input[name="allDataSource"]').on('click', function () { $('input[name="allDataSource"]').on('click', function () {
cancelselectbusinessandkpi(); cancelselectbusinessandkpi();
if ($(this).prop("checked")) { if ($(this).prop("checked")) {
$("input[name='datasource']").prop("checked",true); $("input[name='datasource']").prop("checked", true);
getBusinessByChannel(); // getBusinessByChannel();
getKpiByChannel();
} else { } else {
$("input[name='datasource']").prop("checked",false); $("input[name='datasource']").prop("checked", false);
// alert('getBusinessByChannel all 2'); // alert('getBusinessByChannel all 2');
getBusinessByChannel(); // getBusinessByChannel();
getKpiByChannel();
} }
}); });
// 资源 复选框 // 资源 复选框
$("input[name='datasource']").on('click', function () { $("input[name='datasource']").on('click', function () {
cancelselectbusinessandkpi(); cancelselectbusinessandkpi();
if ($(this).prop("checked")) { if ($(this).prop("checked")) {
$(this).prop("checked",true); $(this).prop("checked", true);
// getBusinessByChannel();
getBusinessByChannel(); getKpiByChannel();
} else { } else {
$(this).prop("checked",false); $(this).prop("checked", false);
// getBusinessByChannel();
getBusinessByChannel(); getKpiByChannel();
} }
var clickFlag = true;//是否全部选中 var clickFlag = true;//是否全部选中
...@@ -55,48 +60,79 @@ ...@@ -55,48 +60,79 @@
} }
}); });
if (clickFlag) { if (clickFlag) {
$('input[name="allDataSource"]').prop("checked",true); $('input[name="allDataSource"]').prop("checked", true);
} else { } else {
$('input[name="allDataSource"]').prop("checked",false); $('input[name="allDataSource"]').prop("checked", false);
} }
}); });
// 初始化 // 初始化
function initDataSource(){ function initDataSource() {
$('input[name="allDataSource"]').prop("checked",false); $('input[name="allDataSource"]').prop("checked", false);
$('input[name="datasource"]').prop("checked",false); $('input[name="datasource"]').prop("checked", false);
} }
function getSelectedDataSources(){ function getSelectedDataSources() {
var dataSourceArray=new Array(); var dataSourceArray = new Array();
$("input[name='datasource']").each(function(){ $("input[name='datasource']").each(function () {
if($(this).prop('checked')){ if ($(this).prop('checked')) {
dataSourceArray.push($(this).val()); dataSourceArray.push($(this).val());
} }
}); });
return dataSourceArray; return dataSourceArray;
} }
// 联合 渠道查找指标
function getKpiByChannel() {
initBusiness();
initKpi();
var selectedChannelsArr = getSelectedChannels();
if (selectedChannelsArr.length === 0) {
return;
}
var selectedChannelStr = selectedChannelsArr.join("-");
var selectedDataSourceArr = getSelectedDataSources();
if (selectedDataSourceArr.length === 0) {
return;
}
var selectedDataSourceStr = selectedDataSourceArr.join('-');
var url = "${ctx}/MonitorOperation/CustomAnalysis/getDimKpiListByDataSourceIdListAndChinnalIdList/" + selectedDataSourceStr + "/" + selectedChannelStr;
$.ajax({
url: url,
type: 'GET',
dataType: 'json',
timeout: 3000,
cache: false,
error: solveDataSourceError,
success: useDataSourceDataToKpi
});
}
// 联合 渠道查找 业务 // 联合 渠道查找 业务
function getBusinessByChannel(){ function getBusinessByChannel() {
// 清空 业务 和指标 // 清空 业务 和指标
initBusiness(); initBusiness();
initKpi(); initKpi();
var selectedChannelsArr=getSelectedChannels(); var selectedChannelsArr = getSelectedChannels();
// alert("selectedChannelsArr.length ="+selectedChannelsArr.length ); if (selectedChannelsArr.length === 0) {
if (selectedChannelsArr.length ===0){return;} return;
var selectedChannelStr=selectedChannelsArr.join("-"); }
var selectedChannelStr = selectedChannelsArr.join("-");
var selectedDataSourceArr=getSelectedDataSources(); var selectedDataSourceArr = getSelectedDataSources();
// alert("selectedDataSourceArr.length ="+selectedDataSourceArr.length); if (selectedDataSourceArr.length === 0) {
if (selectedDataSourceArr.length ===0){return;} return;
var selectedDataSourceStr=selectedDataSourceArr.join('-'); }
// alert("selectedDataSourceStr "+selectedDataSourceStr); var selectedDataSourceStr = selectedDataSourceArr.join('-');
// alert("selectedChannelStr "+selectedChannelStr);
var url = "${ctx}/MonitorOperation/CustomAnalysis/getBusinessByChannelIdListAndDataSourceIdList/"+selectedDataSourceStr+"/"+selectedChannelStr; var url = "${ctx}/MonitorOperation/CustomAnalysis/getBusinessByChannelIdListAndDataSourceIdList/" + selectedDataSourceStr + "/" + selectedChannelStr;
$.ajax({ $.ajax({
url: url, url: url,
type: 'GET', type: 'GET',
...@@ -108,25 +144,33 @@ ...@@ -108,25 +144,33 @@
}); });
} }
function solveDataSourceError(){//若果请求 错误 就初始化 数据来源请求框
function solveDataSourceError() {//若果请求 错误 就初始化 数据来源请求框
initDataSource(); initDataSource();
initKpi();//初始化指标
} }
function useDataSourceData(data){//将业务数据 显示到界面上
// alert(data);
function useDataSourceData(data) {//将业务数据 显示到界面上
loadBusiness(data); loadBusiness(data);
} }
function loadBusiness(data){
function loadBusiness(data) {
$("#businessList_div").empty();//清除 已显示的业务 $("#businessList_div").empty();//清除 已显示的业务
var content=""; var content = "";
for (var key in data){ for (var key in data) {
var businessId=data[key].businessId; var businessId = data[key].businessId;
var businessName=data[key].businessName; var businessName = data[key].businessName;
var contentChild="<div class='checkbox-inline'>" + var contentChild = "<div class='checkbox-inline'>" +
"<label><input type='checkbox' class='businessStats' title='"+businessName+"' value='"+businessId+"' name='businesss' onclick='businessClick(this)'>"+businessName+ "</label></div>"; "<label><input type='checkbox' class='businessStats' title='" + businessName + "' value='" + businessId + "' name='businesss' onclick='businessClick(this)'>" + businessName + "</label></div>";
content=content+contentChild; content = content + contentChild;
} }
if(content !==''){ if (content !== '') {
$("#allBusiness_div").show(); $("#allBusiness_div").show();
} }
$("#businessList_div").append(content); $("#businessList_div").append(content);
......
...@@ -114,4 +114,33 @@ ...@@ -114,4 +114,33 @@
} }
function useDataSourceDataToKpi(data) {//将KPI数据显示到界面上
showKpiByDataSourceAndChinnel(data);
}
// 2018/05/20 通过datasourceId和chinnelId 显示KPI
function showKpiByDataSourceAndChinnel(data) {
$("#kpiList_div").empty();
var content = "";
for (var key in data) {
var kpiName = data[key].kpiName;
var kpiId = data[key].kpiId;
var contentChild = "<div class='checkbox-inline'>" +
"<label><input type='checkbox' class='businessStats' title='" + kpiName + "' value='" + kpiId + "' name='kpi' onclick='kpiClick(this)'>" + kpiName + "</label></div>";
content = content + contentChild;
}
if (content !== '') {
$("#allKpi_div").show();//显示全选
}
$("#kpiList_div").append(content);
}
</script> </script>
...@@ -24,11 +24,11 @@ ...@@ -24,11 +24,11 @@
//全选和不全选所有的省 //全选和不全选所有的省
$('input[name="allProvince"]').on('click', function () { $('input[name="allProvince"]').on('click', function () {
if ($("#allProvince").prop("checked")) {//已全选 if ($("#allProvince").prop("checked")) {//已全选
alert("1");
$('input[name="province"]').prop("checked", true); $('input[name="province"]').prop("checked", true);
} else { } else {
alert("122");
$('input[name="province"]').prop("checked", false); $('input[name="province"]').prop("checked", false);
} }
}); });
......
...@@ -47,6 +47,30 @@ ...@@ -47,6 +47,30 @@
return (clock); return (clock);
} }
function GetDateStr(AddDayCount) {
var dd = new Date();
dd.setDate(dd.getDate()+AddDayCount);//获取AddDayCount天后的日期
var y = dd.getFullYear();
var m = dd.getMonth()+1;//获取当前月份的日期
var d = dd.getDate();
var hh = dd.getHours(); //时
var mm = dd.getMinutes(); //分
if (m < 10){
m = "0"+m;
}
if (d < 10){
d = "0"+d;
}
if (hh < 10){
hh = "0"+hh;
}
if (mm < 10){
mm = "0"+mm;
}
return y+"-"+m+"-"+d+" "+hh+":"+mm+":00";
}
function initEndTimeStats() { function initEndTimeStats() {
var date = new Date(); var date = new Date();
var daysInMonth = new Array([0], [31], [28], [31], [30], [31], [30], [31], [31], [30], [31], [30], [31]); var daysInMonth = new Array([0], [31], [28], [31], [30], [31], [30], [31], [31], [30], [31], [30], [31]);
...@@ -92,9 +116,11 @@ ...@@ -92,9 +116,11 @@
//初始化时间控件的默认值,需要在页面加载时调用此初始化方法 //初始化时间控件的默认值,需要在页面加载时调用此初始化方法
function initDateStats() { function initDateStats() {
$("#timeStats #d1Stats").val(initEndTimeStats()); // $("#d1Stats").val(initEndTimeStats());
$("#d1Stats").val(GetDateStr(-1));
$("#timeStats #d2Stats").val(initStartTimeStats()); //$("#d2Stats").val(initStartTimeStats());
$("#d2Stats").val(GetDateStr(0));
} }
//获取选取的时间段,返回结果为字符串数组 //获取选取的时间段,返回结果为字符串数组
......
...@@ -186,12 +186,18 @@ ...@@ -186,12 +186,18 @@
<script type="text/javascript" src="${ctx}/static/js/dygraph-extra.js"></script> <script type="text/javascript" src="${ctx}/static/js/dygraph-extra.js"></script>
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {
initDateStats();//初始化时间
initChannel();//初始化渠道
initBusiness();//业务 initBusiness();//业务
initKpi();//指标 initKpi();//指标
$("#businessList_div").empty();//清空 业务 $("#businessList_div").empty();//清空 业务
$("#allBusiness").prop("checked",false);//取消选择 ‘全选’ $("#allBusiness").prop("checked",false);//取消选择 ‘全选’
$("#kpiList_div").empty();//清空 $("#kpiList_div").empty();//清空
$("#allKpi_div").prop("checked",false);//取消全选 $("#allKpi_div").prop("checked",false);//取消全选
console.log("1-");
getKpiByDatasource();//获取指标
console.log("12-");
}) })
</script> </script>
<script type="text/javascript"> <script type="text/javascript">
......
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
seajs.use(' seajs.use('
${ctx}/static/artDialog/src/dialog',function(dialog) { ${ctx}/static/artDialog/src/dialog',function(dialog) {
var d = dialog({ var d = dialog({
title : '更新协查单', title : '更新协查单',
...@@ -279,7 +280,13 @@ ...@@ -279,7 +280,13 @@
<td>${xcdWorkingOrderInfo.actualCompletionTime}</td> <td>${xcdWorkingOrderInfo.actualCompletionTime}</td>
<td>${xcdWorkingOrderInfo.ifClosed}</td> <td>${xcdWorkingOrderInfo.ifClosed}</td>
<td>${xcdWorkingOrderInfo.occurReason}</td> <td>${xcdWorkingOrderInfo.occurReason}</td>
<td>${xcdWorkingOrderInfo.resolvingStatus}</td> <c:if test="${xcdWorkingOrderInfo.ifReportFile == '0'}">
<td>无</td>
</c:if>
<c:if test="${xcdWorkingOrderInfo.ifReportFile == '1'}">
<td>有</td>
</c:if>
</tr> </tr>
...@@ -494,13 +501,13 @@ $(function () { ...@@ -494,13 +501,13 @@ $(function () {
//数据来源标签 //数据来源标签
$('#DataSourceTag').text('数据来源').append($("<span class='badge'></span>").text(getStatsDataSourceCheckedValues().length)).attr('data-original-title', getStatsDataSourceCheckedTitles()).tooltip(); $('#DataSourceTag').text('数据来源').append($("<span class='badge'></span>").text(getStatsDataSourceCheckedValues().length)).attr('data-original-title', getStatsDataSourceCheckedTitles()).tooltip();
reportStr = report; reportStr = report;
var reportText=''; var reportText = '';
if(reportStr === '1'){ if (reportStr === '1') {
reportText='有'; reportText = '有';
}else if(reportStr === '0'){ } else if (reportStr === '0') {
reportText='无'; reportText = '无';
} }
if(reportText !==''){ if (reportText !== '') {
$('#reportsTag').text('分析报告').append($("<span class='badge'></span>").text(1)).attr('data-original-title', reportText).tooltip(); $('#reportsTag').text('分析报告').append($("<span class='badge'></span>").text(1)).attr('data-original-title', reportText).tooltip();
} }
......
...@@ -147,7 +147,7 @@ function xcdFindTable(){ ...@@ -147,7 +147,7 @@ function xcdFindTable(){
header[9]=["原因子类一","woReasonSubTypeOne","7%",""]; header[9]=["原因子类一","woReasonSubTypeOne","7%",""];
header[10]=["原因子类二","woReasonSubTypeTwo","7%",""]; header[10]=["原因子类二","woReasonSubTypeTwo","7%",""];
header[11]=["解决方案","proposedResolution","9%","20"]; header[11]=["解决方案","proposedResolution","9%","20"];
header[12]=["分析报告","proposedResolution","9%","20"]; header[12]=["分析报告","ifReportFile","9%","20"];
// header[12]=["详细","","4%",""]; // header[12]=["详细","","4%",""];
window.pagging = new table_pagging({limit:12,tableId:'xcdResultTable',header:header}); window.pagging = new table_pagging({limit:12,tableId:'xcdResultTable',header:header});
...@@ -327,6 +327,14 @@ table_pagging.prototype = { ...@@ -327,6 +327,14 @@ table_pagging.prototype = {
tdContext = df.format(new Date(tdContext)); tdContext = df.format(new Date(tdContext));
} }
} }
if(k==12){
if(tdContext ==='1'){
tdContext='有';
}
if(tdContext ==='0'){
tdContext='无';
}
}
} }
} else { } else {
tdContext=this.header[k][1]+"<span style='display:none'>"+i+"</span>"; tdContext=this.header[k][1]+"<span style='display:none'>"+i+"</span>";
......
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