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
a9b58bd0
Commit
a9b58bd0
authored
Dec 24, 2017
by
liuna
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2017年12月24日 --智能分析平台
--解决数据质量规则遗留问题
parent
8b5b5a46
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
80 additions
and
5 deletions
+80
-5
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
+0
-1
No files found.
src/main/java/com/hp/cmsz/repository/KpiDao.java
View file @
a9b58bd0
...
...
@@ -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 @
a9b58bd0
...
...
@@ -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 @
a9b58bd0
...
...
@@ -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 @
a9b58bd0
...
...
@@ -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 @
a9b58bd0
...
...
@@ -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 @
a9b58bd0
...
...
@@ -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 @
a9b58bd0
...
...
@@ -110,7 +110,6 @@
}
else
{
var
list
=
a
.
split
(
"="
)[
1
];
list
=
list
.
substring
(
0
,
list
.
length
-
1
);
console
.
log
(
list
);
$
.
dialog
({
content
:
"已经存在"
+
list
+
"的数据质量规则!"
})
...
...
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