Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cmszMonitorAnalysis
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liuna
cmszMonitorAnalysis
Commits
dc3075b8
Commit
dc3075b8
authored
Dec 25, 2017
by
胡斌
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/liuna'
parents
dc21cad1
a9b58bd0
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
138 additions
and
10 deletions
+138
-10
KpiDao.java
src/main/java/com/hp/cmsz/repository/KpiDao.java
+3
-0
QualityRuleViewDao.java
src/main/java/com/hp/cmsz/repository/QualityRuleViewDao.java
+3
-0
QualityRuleViewService.java
.../cmsz/service/analysissupport/QualityRuleViewService.java
+5
-0
QualityRuleMaintainController.java
...sz/web/analysissupport/QualityRuleMaintainController.java
+63
-2
QualityRuleResultController.java
...cmsz/web/analysissupport/QualityRuleResultController.java
+5
-1
FailureStatisticsCriteriaController.java
...monitoroperation/FailureStatisticsCriteriaController.java
+1
-1
QualityRuleResult.jsp
...ebapp/WEB-INF/views/AnalysisSupport/QualityRuleResult.jsp
+58
-6
No files found.
src/main/java/com/hp/cmsz/repository/KpiDao.java
View file @
dc3075b8
...
...
@@ -41,6 +41,9 @@ public interface KpiDao extends JpaSpecificationExecutor<Kpi>,PagingAndSortingRe
@Query
(
"select businessId from Kpi kpi where kpiId=:kpiId"
)
Long
findBusinessIdByKpiId
(
@Param
(
"kpiId"
)
Long
kpiId
);
//由指标得到指标名
@Query
(
"select kpiCode from Kpi kpi where kpi.kpiId in :kpiIdList"
)
List
<
String
>
findKpiCodeByBusinessIds
(
@Param
(
"kpiIdList"
)
List
<
Long
>
kpiIdList
);
//由指标名得到指标周期类型
@Query
(
"select kpiCycleType.isHourKpi from Kpi kpi,KpiCycleType kpiCycleType where kpi.kpiCycleTypeId=kpiCycleType.kpiCycleTypeId and kpi.kpiName IN (:kpiName) and kpi.kpiId >=0"
)
...
...
src/main/java/com/hp/cmsz/repository/QualityRuleViewDao.java
View file @
dc3075b8
...
...
@@ -15,4 +15,7 @@ public interface QualityRuleViewDao extends JpaSpecificationExecutor<QualityRule
//根据筛选项得到质量规则
List
<
QualityRuleView
>
findByDataSourceIdInAndChannelIdInAndBusinessIdInOrderByQualityRuleIdAscBusinessTimeDesc
(
List
<
Long
>
dataSource
,
List
<
Long
>
chnnal
,
List
<
Long
>
busines
);
//筛选项加指标编码
List
<
QualityRuleView
>
findByDataSourceIdInAndChannelIdInAndBusinessIdInAndKpiCodeOrderByQualityRuleIdAscBusinessTimeDesc
(
List
<
Long
>
dataSource
,
List
<
Long
>
chnnal
,
List
<
Long
>
busines
,
String
kpiCode
);
}
src/main/java/com/hp/cmsz/service/analysissupport/QualityRuleViewService.java
View file @
dc3075b8
...
...
@@ -20,4 +20,9 @@ public class QualityRuleViewService {
return
qualityRuleViewDao
.
findByDataSourceIdInAndChannelIdInAndBusinessIdInOrderByQualityRuleIdAscBusinessTimeDesc
(
dataSource
,
chnnal
,
busines
);
}
//筛选项加指标编码查询
public
List
<
QualityRuleView
>
getBy
(
List
<
Long
>
dataSource
,
List
<
Long
>
chnnal
,
List
<
Long
>
busines
,
String
kpiCode
){
return
qualityRuleViewDao
.
findByDataSourceIdInAndChannelIdInAndBusinessIdInAndKpiCodeOrderByQualityRuleIdAscBusinessTimeDesc
(
dataSource
,
chnnal
,
busines
,
kpiCode
);
}
}
src/main/java/com/hp/cmsz/web/analysissupport/QualityRuleMaintainController.java
View file @
dc3075b8
...
...
@@ -2,6 +2,8 @@ package com.hp.cmsz.web.analysissupport;
import
java.io.IOException
;
import
java.io.PrintWriter
;
import
java.io.UnsupportedEncodingException
;
import
java.net.URLEncoder
;
import
java.sql.Timestamp
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
...
...
@@ -261,7 +263,7 @@ public class QualityRuleMaintainController {
List
<
Long
>
kList
=
qualityRuleDao
.
findByKpiIds
(
kpiIdList
);
System
.
out
.
println
(
kList
);
String
sr
=
null
;
String
sr
=
""
;
if
(
kList
==
null
||
kList
.
size
()==
0
)
{
for
(
int
j
=
0
;
j
<
provinceIdList
.
size
();
j
++)
{
for
(
int
l
=
0
;
l
<
kpiIdList
.
size
();
l
++)
{
...
...
@@ -319,7 +321,66 @@ public class QualityRuleMaintainController {
sr
=
"1"
;
}
else
{
sr
=
"2"
;
kpiIdList
.
removeAll
(
kList
);
System
.
out
.
println
(
kpiIdList
);
for
(
int
j
=
0
;
j
<
provinceIdList
.
size
();
j
++)
{
for
(
int
l
=
0
;
l
<
kpiIdList
.
size
();
l
++)
{
QualityRule
qualityRule
=
new
QualityRule
();
qualityRule
.
setProvinceId
(
provinceIdList
.
get
(
j
));
qualityRule
.
setKpiId
(
kpiIdList
.
get
(
l
));
Long
businessId
=
kpiDao
.
findBusinessIdByKpiId
(
kpiIdList
.
get
(
l
));
qualityRule
.
setBusinessId
(
businessId
);
if
(!
channel
.
trim
().
equals
(
""
))
{
qualityRule
.
setChannelId
(
Long
.
parseLong
(
channel
));
}
if
(!
dataSourceId
.
trim
().
equals
(
""
))
{
qualityRule
.
setDataSourceId
(
Long
.
parseLong
(
dataSourceId
));
}
if
(!
frequencyValue
.
trim
().
equals
(
""
))
{
qualityRule
.
setFrequencyValue
(
Long
.
parseLong
(
frequencyValue
));
qualityRule
.
setFrequencyType
(
Long
.
parseLong
(
frequencyType
));
if
(
frequencyType
.
equals
(
"0"
))
{
qualityRule
.
setKpiMonitorTime
(
frequencyValue
+
"/1440"
);
}
else
if
(
frequencyType
.
equals
(
"1"
))
{
qualityRule
.
setKpiMonitorTime
(
frequencyValue
+
"/24"
);
}
else
if
(
frequencyType
.
equals
(
"2"
))
{
qualityRule
.
setKpiMonitorTime
(
frequencyValue
);
}
else
if
(
frequencyType
.
equals
(
"3"
))
{
qualityRule
.
setKpiMonitorTime
(
"ADD_MONTH("
+
frequencyValue
+
")"
);
}
}
if
(!
businessTime
.
trim
().
equals
(
""
))
{
qualityRule
.
setBusinessTime
(
Timestamp
.
valueOf
(
businessTime
));
}
if
(!
frequencyValue
.
trim
().
equals
(
""
))
{
if
(
frequencyType
.
equals
(
"0"
))
{
qualityRule
.
setKpiMonitorRunTime
(
Timestamp
.
valueOf
(
sd
.
format
(
sd
.
parse
(
businessTime
).
getTime
()
+
Integer
.
parseInt
(
frequencyValue
)
*
60
*
1000
)));
}
else
if
(
frequencyType
.
equals
(
"1"
))
{
qualityRule
.
setKpiMonitorRunTime
(
Timestamp
.
valueOf
(
sd
.
format
(
sd
.
parse
(
businessTime
).
getTime
()
+
Integer
.
parseInt
(
frequencyValue
)
*
60
*
60
*
1000
)));
}
else
if
(
frequencyType
.
equals
(
"2"
))
{
qualityRule
.
setKpiMonitorRunTime
(
Timestamp
.
valueOf
(
sd
.
format
(
sd
.
parse
(
businessTime
).
getTime
()
+
Integer
.
parseInt
(
frequencyValue
)
*
24
*
60
*
60
*
1000
)));
}
else
if
(
frequencyType
.
equals
(
"3"
))
{
qualityRule
.
setKpiMonitorRunTime
(
Timestamp
.
valueOf
(
sd
.
format
(
sd
.
parse
(
businessTime
).
getMonth
()
+
Integer
.
parseInt
(
frequencyValue
))));
}
}
qualityRule
.
setRuleCrtTime
(
Timestamp
.
valueOf
(
sd
.
format
(
new
Date
())));
qualityRule
.
setRuleUpdateTime
(
Timestamp
.
valueOf
(
sd
.
format
(
new
Date
())));
qualityRule
.
setRuleValidFlag
(
"1"
);
qualityRule
.
setIfSystemValue
(
"1"
);
qualityRuleDao
.
save
(
qualityRule
);
cmszOperationLogService
.
createLog
(
"增加"
,
"新建质量模型"
,
""
);
Long
qualityRuleId
=
qualityRule
.
getQualityRuleId
();
if
(!
qualityRuleIdList
.
isEmpty
())
{
accuracyRuleService
.
updateAccuracyRuleByAccuracyRuleIds
(
qualityRuleId
,
qualityRuleIdList
);
qualityRuleIdList
.
clear
();
}
}
}
List
<
String
>
kpiNameList
=
kpiDao
.
findKpiCodeByBusinessIds
(
kList
);
for
(
int
i
=
0
;
i
<
kpiNameList
.
size
();
i
++)
{
sr
+=
kpiNameList
.
get
(
i
)+
","
;
}
System
.
out
.
println
(
"sr="
+
sr
);
}
return
"redirect:/AnalysisSupport/QualityRuleResult?sr="
+
sr
;
}
...
...
src/main/java/com/hp/cmsz/web/analysissupport/QualityRuleResultController.java
View file @
dc3075b8
...
...
@@ -115,6 +115,7 @@ public class QualityRuleResultController {
@RequestParam
(
value
=
"dataSource"
)
String
dataSource
,
// 数据来源
@RequestParam
(
value
=
"chnnal"
)
String
chnnal
,
//渠道
@RequestParam
(
value
=
"bussines"
)
String
bussines
,
//业务
@RequestParam
(
value
=
"code"
)
String
code
,
HttpServletResponse
response
)
throws
UnsupportedEncodingException
{
cmszOperationLogService
.
createLog
(
"查询"
,
"质量规则"
,
"由筛选项得到质量规则"
);
...
...
@@ -125,8 +126,11 @@ public class QualityRuleResultController {
List
<
Long
>
dataSourceList
=
changeStrToList
(
dataSourceS
);
List
<
Long
>
chnnalList
=
changeStrToList
(
chnnalS
);
List
<
Long
>
bussinesList
=
changeStrToList
(
bussinesS
);
if
(
code
.
equals
(
""
)){
qualityRuleViewList
=
qualityRuleViewService
.
getQualityRuleViewBy
(
dataSourceList
,
chnnalList
,
bussinesList
);
}
else
{
qualityRuleViewList
=
qualityRuleViewService
.
getBy
(
dataSourceList
,
chnnalList
,
bussinesList
,
code
);
}
Gson
gson
=
new
Gson
();
response
.
setContentType
(
"text/Xml;charset=gbk"
);
PrintWriter
out
=
null
;
...
...
src/main/java/com/hp/cmsz/web/monitoroperation/FailureStatisticsCriteriaController.java
View file @
dc3075b8
...
...
@@ -8,7 +8,7 @@ import java.util.List;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
com.hp.cmsz.entity.Kpi
;
import
com.hp.cmsz.repository.KpiDao
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
...
...
src/main/webapp/WEB-INF/views/AnalysisSupport/QualityRuleResult.jsp
View file @
dc3075b8
...
...
@@ -43,6 +43,10 @@
<div
class=
"form"
>
<tags:Quality
_dataSource_channel_business
/>
<div
id=
"kpiCodeDiv"
class=
"slide-menu-option"
>
<label
>
指标编码
</label>
<input
id=
"kpiCodeID"
class=
"form-control"
type=
"text"
style=
"width:250px;"
onFocus=
""
>
</div>
<button
id=
"submit"
class=
"btn btn-primary"
onclick=
"ruleResultSubmit()"
>
提交
</button>
<button
id=
"disable"
class=
"btn btn-warning"
onclick=
"ruleResultReset()"
>
重置
</button>
...
...
@@ -62,6 +66,7 @@
<span
id=
"ProvinceTag"
class=
"label label-info"
data-placement=
"bottom"
></span>
<span
id=
"DataSourceTag"
class=
"label label-info"
data-placement=
"bottom"
></span>
<span
id=
"BusinessTag"
class=
"label label-info"
data-placement=
"bottom"
></span>
<span
id=
"KpiCodeTag"
class=
"label label-info"
data-placement=
"bottom"
></span>
</div>
</div>
...
...
@@ -102,13 +107,13 @@
$
.
dialog
({
content
:
"成功生成数据质量规则!"
})
}
else
if
(
a
==
"sr=2"
){
}
else
{
var
list
=
a
.
split
(
"="
)[
1
];
list
=
list
.
substring
(
0
,
list
.
length
-
1
);
$
.
dialog
({
content
:
"已经存在此kpiId
的数据质量规则!"
content
:
"已经存在"
+
list
+
"
的数据质量规则!"
})
}
console
.
log
(
url
.
split
(
"?"
)[
1
]);
});
var
receiveRulePageNum
=
"${rulePageNum}"
;
...
...
@@ -128,7 +133,46 @@ $("#createRule").click(function(){
var
dataSource
=
getStatsDataSourceCheckedValuesString
();
var
chnnal
=
getStatsChannelCheckedValuesString
();
var
bussines
=
getStatsBusinessCheckedValuesString
();
var
code
=
$
.
trim
(
document
.
getElementById
(
"kpiCodeID"
).
value
);
if
(
code
===
""
){
if
(
dataSource
==
""
){
$
.
alert
(
"数据来源的选择不能为空"
);
}
else
if
(
chnnal
===
""
){
$
.
alert
(
"渠道的选择不能为空"
);
}
else
if
(
bussines
===
""
){
$
.
alert
(
"业务的选择不能为空"
);
}
else
{
toggleMenu
(
'slidePushMenus'
);
//隐藏筛选项
//数据来源标签
$
(
'#DataSourceTag'
).
text
(
"数据来源"
).
append
(
$
(
"<span class='badge'></span>"
).
text
(
getStatsDataSourceCheckedValues
().
length
)).
attr
(
'data-original-title'
,
getStatsDataSourceCheckedTitles
()).
tooltip
();
//渠道标签
$
(
'#ChannelTag'
).
text
(
"渠道"
).
append
(
$
(
"<span class='badge'></span>"
).
text
(
getStatsChannelCheckedValues
().
length
)).
attr
(
'data-original-title'
,
getStatsChannelCheckedTitles
()).
tooltip
();
//业务标签
$
(
'#BusinessTag'
).
text
(
"业务"
).
append
(
$
(
"<span class='badge'></span>"
).
text
(
getStatsBusinessCheckedValues
().
length
)).
attr
(
'data-original-title'
,
getStatsBusinessCheckedTitlesString
()).
tooltip
();
//指标编码
$
(
"#KpiCodeTag"
).
text
(
"指标编码"
).
attr
(
'data-original-title'
,
code
).
tooltip
();
$
.
ajax
({
type
:
'GET'
,
contentType
:
'application/json'
,
url
:
"${ctx}/AnalysisSupport/QualityRuleResult/ruleTableChange?dataSource="
+
dataSource
+
"&chnnal="
+
chnnal
+
"&bussines="
+
bussines
+
"&code"
+
code
,
dataType
:
'text'
,
async
:
false
,
beforeSend
:
function
(
data
)
{
},
success
:
function
(
data
)
{
$
(
"#qualityRuleView"
).
val
(
data
);
ruleResultDetailTable
();
qualityRuleId
=
""
;
$
(
"#updateRule"
).
attr
(
"disabled"
,
true
);
toggleMenu
(
'slidePushMenus2'
);
//隐藏筛选项
}
});
}
}
else
if
(
code
!==
""
){
if
(
dataSource
==
""
){
$
.
alert
(
"数据来源的选择不能为空"
);
}
else
if
(
chnnal
===
""
){
...
...
@@ -146,11 +190,13 @@ $("#createRule").click(function(){
//业务标签
$
(
'#BusinessTag'
).
text
(
"业务"
).
append
(
$
(
"<span class='badge'></span>"
).
text
(
getStatsBusinessCheckedValues
().
length
)).
attr
(
'data-original-title'
,
getStatsBusinessCheckedTitlesString
()).
tooltip
();
//指标编码
$
(
"#KpiCodeTag"
).
text
(
"指标编码"
).
attr
(
'data-original-title'
,
code
).
tooltip
();
$
.
ajax
({
type
:
'GET'
,
contentType
:
'application/json'
,
url
:
"${ctx}/AnalysisSupport/QualityRuleResult/ruleTableChange?dataSource="
+
dataSource
+
"&chnnal="
+
chnnal
+
"&bussines="
+
bussines
,
url
:
"${ctx}/AnalysisSupport/QualityRuleResult/ruleTableChange?dataSource="
+
dataSource
+
"&chnnal="
+
chnnal
+
"&bussines="
+
bussines
+
"&code="
+
code
,
dataType
:
'text'
,
async
:
false
,
beforeSend
:
function
(
data
)
{
...
...
@@ -164,11 +210,13 @@ $("#createRule").click(function(){
}
});
}
}
}
function
ruleResultReset
(){
$
(
"#kpiCodeID"
).
attr
(
"value"
,
''
);
statsDataSourceReset
();
//三级联动重置
}
$
(
"#updateRule"
).
click
(
function
(){
...
...
@@ -203,6 +251,9 @@ $("#deleteRule").click(function(){
});
});
</script>
</body>
</html>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment