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
c30ebd21
Commit
c30ebd21
authored
Dec 03, 2017
by
liuna
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2017年12月3日 智能分析平台提交内容
--数据质量核查下质量规则新增页面完成
parent
29444a6f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
97 additions
and
22 deletions
+97
-22
workspace.xml
.idea/workspace.xml
+0
-0
QualityRuleInfoService.java
.../cmsz/service/analysissupport/QualityRuleInfoService.java
+1
-0
QualityRuleConfigurationController.java
...b/analysissupport/QualityRuleConfigurationController.java
+10
-3
QualityRuleMaintainController.java
...sz/web/analysissupport/QualityRuleMaintainController.java
+41
-8
QualityRuleOperationController.java
...z/web/analysissupport/QualityRuleOperationController.java
+1
-1
QualityRuleConfiguration.jsp
...EB-INF/views/AnalysisSupport/QualityRuleConfiguration.jsp
+24
-2
QualityRuleMaintain.jsp
...app/WEB-INF/views/AnalysisSupport/QualityRuleMaintain.jsp
+2
-2
QualityRuleResult.jsp
...ebapp/WEB-INF/views/AnalysisSupport/QualityRuleResult.jsp
+1
-1
ruleResultDetailTable.js
src/main/webapp/static/js/ruleResultDetailTable.js
+17
-5
No files found.
.idea/workspace.xml
View file @
c30ebd21
This diff is collapsed.
Click to expand it.
src/main/java/com/hp/cmsz/service/analysissupport/QualityRuleInfoService.java
View file @
c30ebd21
...
...
@@ -26,4 +26,5 @@ public class QualityRuleInfoService {
public
List
<
QualityRuleInfo
>
getQualityRuleInfoBy
(
Timestamp
time1
,
Timestamp
time2
,
List
<
Long
>
dataSource
,
List
<
Long
>
chnnal
,
List
<
Long
>
busines
,
List
<
Long
>
province
,
List
<
Long
>
ifFilter
){
return
qualityRuleInfoDao
.
findByBusinessTimeBetweenAndDataSourceIdInAndChannelIdInAndBusinessIdInAndProvinceIdInAndIfFilterInOrderByBusinessTimeDesc
(
time1
,
time2
,
dataSource
,
chnnal
,
busines
,
province
,
ifFilter
);
}
}
src/main/java/com/hp/cmsz/web/analysissupport/QualityRuleConfigurationController.java
View file @
c30ebd21
...
...
@@ -2,6 +2,7 @@ package com.hp.cmsz.web.analysissupport;
import
java.io.IOException
;
import
java.io.PrintWriter
;
import
java.sql.Timestamp
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
...
...
@@ -118,6 +119,8 @@ public class QualityRuleConfigurationController {
model
.
put
(
"businessList"
,
gson
.
toJson
(
businessList
));
model
.
put
(
"dataTypeList"
,
dataTypeList
);
model
.
put
(
"dataSourceList"
,
dataSourceList
);
model
.
put
(
"qualityRule"
,
qualityRule
);
model
.
put
(
"accuracyRuleList"
,
accuracyRuleList
);
return
PageURLController
.
RuleConfiguration
;
}
...
...
@@ -246,18 +249,22 @@ public class QualityRuleConfigurationController {
}
@RequestMapping
(
value
=
"/updateQualityRuleForm"
,
method
=
RequestMethod
.
POST
)
public
String
updateQualityRuleForm
(
@RequestParam
(
value
=
"businessid"
)
String
businessId
,
public
String
updateQualityRuleForm
(
@RequestParam
(
value
=
"qualityRuleId"
)
String
qualityRuleId
,
@RequestParam
(
value
=
"businessid"
)
String
businessId
,
@RequestParam
(
value
=
"provinceid"
)
String
provinceId
,
@RequestParam
(
value
=
"channelid"
)
String
channelId
,
@RequestParam
(
value
=
"dataSourceid"
)
String
dataSourceId
,
@RequestParam
(
value
=
"kpiid"
)
String
kpiId
,
@RequestParam
(
value
=
"kpiMonitorTime"
)
String
kpiMonitorTime
,
@RequestParam
(
value
=
"kpiMonitorTimeValue"
)
String
kpiMonitorTimeValue
,
@RequestParam
(
value
=
"kpiUnit"
)
String
kpiUnit
,
@RequestParam
(
value
=
"businessTime"
)
String
businessTime
,
HttpServletResponse
response
,
HttpServletRequest
request
)
throws
ParseException
{
System
.
out
.
println
(
"businessId"
+
businessId
+
"provinceid"
+
provinceId
+
"channelId"
+
channelId
+
"dataSourceId"
+
dataSourceId
+
"kpi"
+
kpiId
+
"kpiMonitorTime"
+
kpiMonitorTime
+
"businessTime"
+
businessTime
);
SimpleDateFormat
sd
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
QualityRule
qualityRule
=
new
QualityRule
();
qualityRule
.
setRuleUpdateTime
(
Timestamp
.
valueOf
(
sd
.
format
(
new
Date
())));
qualityRule
.
setBusinessTime
(
Timestamp
.
valueOf
(
businessTime
));
return
PageURLController
.
RuleConfiguration
;
...
...
src/main/java/com/hp/cmsz/web/analysissupport/QualityRuleMaintainController.java
View file @
c30ebd21
...
...
@@ -13,6 +13,7 @@ import java.util.Map;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
com.hp.cmsz.service.analysissupport.AccuracyRuleService
;
import
com.hp.cmsz.service.analysissupport.QualityRuleService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
...
...
@@ -84,6 +85,9 @@ public class QualityRuleMaintainController {
private
AccuracyRuleDao
accuracyRuleDao
;
@Autowired
private
AccuracyRuleService
accuracyRuleService
;
@Autowired
private
CmszOperationLogService
cmszOperationLogService
;
@RequestMapping
(
value
=
""
)
...
...
@@ -194,13 +198,14 @@ public class QualityRuleMaintainController {
@RequestParam
(
value
=
"repeatedCheckMaxTime"
)
String
repeatedCheckMaxTime
,
@RequestParam
(
value
=
"ifRepeatedCheckSummation"
)
String
ifRepeatedCheckSummation
,
HttpServletResponse
response
,
HttpServletRequest
request
)
{
System
.
out
.
println
(
"ruleType"
+
ruleType
);
System
.
out
.
println
(
"ruleType"
+
ruleType
);
SimpleDateFormat
sd
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
AccuracyRule
accuracyRule
=
new
AccuracyRule
();
if
(!
ruleType
.
trim
().
equals
(
""
))
{
if
(
ruleType
==
"1"
)
{
if
(
ruleType
.
equals
(
"1"
)
)
{
accuracyRule
.
setRuleType
(
"范围"
);
}
else
if
(
ruleType
==
"2"
)
{
System
.
out
.
println
(
"rule"
+
accuracyRule
.
getRuleType
());
}
else
if
(
ruleType
.
equals
(
"2"
))
{
accuracyRule
.
setRuleType
(
"重复"
);
}
if
(!
scopeMaxValue
.
trim
().
equals
(
""
))
{
...
...
@@ -244,7 +249,6 @@ public class QualityRuleMaintainController {
qualityRuleIdList
.
add
(
qualityRuleId
);
}
}
//新增质量模型
@RequestMapping
(
value
=
"/saveRuleDataForm"
,
method
=
RequestMethod
.
POST
)
public
String
saveRuleDataForm
(
@RequestParam
(
value
=
"businessinput"
)
String
business
,
...
...
@@ -253,11 +257,11 @@ public class QualityRuleMaintainController {
@RequestParam
(
value
=
"dataSource"
)
String
dataSourceId
,
@RequestParam
(
value
=
"kpiinput"
)
String
kpi
,
@RequestParam
(
value
=
"kpiUnit"
)
String
kpiUnit
,
@RequestParam
(
value
=
"kpiMonitorTime
"
)
String
kpiMonitorTim
e
,
@RequestParam
(
value
=
"kpiMonitorTime
Value"
)
String
kpiMonitorTimeValu
e
,
@RequestParam
(
value
=
"businessTime"
)
String
businessTime
,
HttpServletResponse
response
,
HttpServletRequest
request
)
throws
ParseException
{
System
.
out
.
println
(
"
0000"
+
kpiUnit
);
System
.
out
.
println
(
"
kpiUnit:"
+
kpiUnit
+
"kpiMonitorTimeValue:"
+
kpiMonitorTimeValue
);
SimpleDateFormat
sd
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
List
<
Long
>
provinceIdList
=
new
ArrayList
<
Long
>();
...
...
@@ -279,9 +283,33 @@ public class QualityRuleMaintainController {
qualityRule
.
setKpiId
(
kpiIdList
.
get
(
l
));
if
(!
channel
.
trim
().
equals
(
""
)){
qualityRule
.
setChannelId
(
Long
.
parseLong
(
channel
));
}
if
(!
dataSourceId
.
trim
().
equals
(
""
)){
qualityRule
.
setDataSourceId
(
Long
.
parseLong
(
dataSourceId
));
}
if
(!
kpiMonitorTime
.
trim
().
equals
(
""
)){
qualityRule
.
setKpiMonitorTime
(
kpiMonitorTime
);
}
qualityRule
.
setKpiMonitorRunTime
(
Timestamp
.
valueOf
(
sd
.
format
(
new
Date
())));
if
(!
kpiMonitorTimeValue
.
trim
().
equals
(
""
)){
if
(
kpiUnit
.
equals
(
"0"
)){
qualityRule
.
setKpiMonitorTime
(
kpiMonitorTimeValue
+
"/1440"
);
}
else
if
(
kpiUnit
.
equals
(
"1"
)){
qualityRule
.
setKpiMonitorTime
(
kpiMonitorTimeValue
+
"/24"
);
}
else
if
(
kpiUnit
.
equals
(
"2"
)){
qualityRule
.
setKpiMonitorTime
(
kpiMonitorTimeValue
);
}
else
if
(
kpiUnit
.
equals
(
"3"
)){
qualityRule
.
setKpiMonitorTime
(
"ADD_MONTH("
+
kpiMonitorTimeValue
+
")"
);
}
}
if
(!
businessTime
.
trim
().
equals
(
""
)){
qualityRule
.
setBusinessTime
(
Timestamp
.
valueOf
(
businessTime
));
}
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd hh:mm:ss"
);
System
.
out
.
println
(
businessTime
);
System
.
out
.
println
(
"sdf.parse(businessTime)"
+
sdf
.
parse
(
businessTime
));
System
.
out
.
println
(
"毫秒:"
+
sdf
.
parse
(
businessTime
).
getTime
());
if
(!
kpiMonitorTimeValue
.
trim
().
equals
(
""
)){
if
(
kpiUnit
.
equals
(
"0"
)){
qualityRule
.
setKpiMonitorRunTime
(
Timestamp
.
valueOf
(
sd
.
format
(
sd
.
parse
(
businessTime
).
getTime
()+
Integer
.
parseInt
(
kpiMonitorTimeValue
)*
60
*
1000
)));
}
else
if
(
kpiUnit
.
equals
(
"1"
)){
qualityRule
.
setKpiMonitorRunTime
(
Timestamp
.
valueOf
(
sd
.
format
(
sd
.
parse
(
businessTime
).
getTime
()+
Integer
.
parseInt
(
kpiMonitorTimeValue
)*
60
*
60
*
1000
)));
}
else
if
(
kpiUnit
.
equals
(
"2"
)){
qualityRule
.
setKpiMonitorRunTime
(
Timestamp
.
valueOf
(
sd
.
format
(
sd
.
parse
(
businessTime
).
getTime
()+
Integer
.
parseInt
(
kpiMonitorTimeValue
)*
24
*
60
*
60
*
1000
)));
}
else
if
(
kpiUnit
.
equals
(
"3"
)){
qualityRule
.
setKpiMonitorRunTime
(
Timestamp
.
valueOf
(
sd
.
format
(
sd
.
parse
(
businessTime
).
getMonth
()+
Integer
.
parseInt
(
kpiMonitorTimeValue
))));
}
}
qualityRule
.
setRuleCrtTime
(
Timestamp
.
valueOf
(
sd
.
format
(
new
Date
())));
qualityRule
.
setRuleUpdateTime
(
Timestamp
.
valueOf
(
sd
.
format
(
new
Date
())));
qualityRule
.
setRuleValidFlag
(
"0"
);
...
...
@@ -289,6 +317,11 @@ public class QualityRuleMaintainController {
qualityRuleDao
.
save
(
qualityRule
);
cmszOperationLogService
.
createLog
(
"增加"
,
"新建质量模型"
,
"quality_rule_warehouse_info_t. QUALITY_RULE_ID="
+
qualityRule
.
getQualityRuleId
().
toString
());
Long
qualityRuleId
=
qualityRule
.
getQualityRuleId
();
if
(!
qualityRuleIdList
.
isEmpty
()){
accuracyRuleService
.
updateAccuracyRuleByAccuracyRuleIds
(
qualityRuleId
,
qualityRuleIdList
);
qualityRuleIdList
.
clear
();
}
}
}
...
...
src/main/java/com/hp/cmsz/web/analysissupport/QualityRuleOperationController.java
View file @
c30ebd21
...
...
@@ -125,7 +125,7 @@ public class QualityRuleOperationController {
List
<
Long
>
bussinesList
=
changeStrToList
(
bussinesS
);
List
<
Long
>
provinceList
=
changeStrToList
(
provinceS
);
List
<
Long
>
ifFilterList
=
changeStrToList
(
ifFilterS
);
System
.
out
.
println
(
"
qualityRul
e:"
+
time1
+
time2
+
"data"
+
dataSourceList
+
"busin"
+
bussinesList
+
"procin"
+
provinceList
+
"if"
+
ifFilterList
);
System
.
out
.
println
(
"
tim
e:"
+
time1
+
time2
+
"data"
+
dataSourceList
+
"busin"
+
bussinesList
+
"procin"
+
provinceList
+
"if"
+
ifFilterList
);
qualityRuleInfoList
=
qualityRuleInfoService
.
getQualityRuleInfoBy
(
time1
,
time2
,
dataSourceList
,
chnnalList
,
bussinesList
,
provinceList
,
ifFilterList
);
Gson
gson
=
new
Gson
();
response
.
setContentType
(
"text/Xml;charset=gbk"
);
...
...
src/main/webapp/WEB-INF/views/AnalysisSupport/QualityRuleConfiguration.jsp
View file @
c30ebd21
...
...
@@ -106,7 +106,7 @@
</tr>
<tr><td>
指标监控时间(
<font
color=
"red"
>
必填
</font>
):
</td>
<td>
<input
type=
"text"
style=
"width:200px"
name=
"kpiMonitorTime
"
id=
"kpiMonitorTime"
style=
"display: inline;
"
/>
<input
type=
"text"
style=
"width:200px"
name=
"kpiMonitorTime
Value"
id=
"kpiMonitorTimeValue
"
/>
<select
style=
"width:200px"
name=
"kpiUnit"
id=
"kpiUnit"
style=
"display: inline;"
>
<option
value=
"0"
>
分钟
</option>
<option
value=
"1"
>
小时
</option>
...
...
@@ -171,7 +171,29 @@
</div>
</div>
</div>
<script
type=
"text/javascript"
>
//加载页面时显示
var
getQualityRuleId
=
"${qualityRule.qualityRuleId}"
;
var
getProvince
=
"${qualityRule.provinceId}"
;
var
getDataSource
=
"${qualityRule.dataSourceId}"
;
var
getChannel
=
"${qualityRule.channelId}"
;
var
getBusinessinput
=
"${qualityRule.businessId}"
;
var
getKpiinput
=
"${qualityRule.kpiId}"
;
var
getCalCycle
=
"${qualityRule.calCycle}"
;
var
getKpiMonitorTimeValue
=
"${qualityRule.kpiMonitorTimeValue}"
;
var
getKpiUnit
=
"${qualityRule.kpiUnit}"
;
var
getBusinessTime
=
"${qualityRule.businessTime}"
;
$
(
"#qualityRuleId"
).
text
(
getQualityRuleId
);
$
(
"#province"
).
val
(
getProvince
);
$
(
"#dataSource"
).
val
(
getDataSource
);
$
(
"#channel"
).
val
(
getChannel
);
$
(
".businessinput"
).
val
(
getBusinessinput
);
$
(
".kpiinput"
).
val
(
getKpiinput
);
$
(
"#calCycle"
).
val
(
getCalCycle
);
$
(
"#kpiMonitorTimeValue"
).
val
(
getKpiMonitorTimeValue
);
$
(
"#kpiUnit"
).
val
(
getKpiUnit
);
$
(
"#businessTime"
).
val
(
getBusinessTime
);
</script>
<script
type=
"text/javascript"
>
$
(
".range"
).
hide
();
$
(
".repeate"
).
hide
();
...
...
src/main/webapp/WEB-INF/views/AnalysisSupport/QualityRuleMaintain.jsp
View file @
c30ebd21
...
...
@@ -99,7 +99,7 @@
</tr>
<tr><td>
指标监控时间(
<font
color=
"red"
>
必填
</font>
):
</td>
<td>
<input
type=
"text"
style=
"width:200px"
name=
"kpiMonitorTime"
id=
"kpiMonitorTim
e"
style=
"display: inline;"
/>
<input
type=
"text"
name=
"kpiMonitorTimeValue"
id=
"kpiMonitorTimeValu
e"
style=
"display: inline;"
/>
<select
name=
"kpiUnit"
id=
"kpiUnit"
>
<option
value=
"0"
>
分钟
</option>
<option
value=
"1"
>
小时
</option>
...
...
@@ -261,7 +261,7 @@ $("#addParam").click(function(){
//form表单提交
$
(
"#ruleSubmit"
).
click
(
function
(){
if
(
$
.
trim
(
$
(
"#kpiMonitorTime"
).
val
())
==
""
){
if
(
$
.
trim
(
$
(
"#kpiMonitorTime
Value
"
).
val
())
==
""
){
$
.
alert
(
"指标监控时间不能为空"
);
}
else
if
(
$
(
"#businessTime"
).
val
()
==
""
){
$
.
alert
(
"指标业务时间不能为空"
);
...
...
src/main/webapp/WEB-INF/views/AnalysisSupport/QualityRuleResult.jsp
View file @
c30ebd21
...
...
@@ -124,7 +124,7 @@ $("#createRule").click(function(){
$
.
dialog
({
title
:
"提醒"
,
content
:
"确定修改质量规则?"
,
ok
:
function
(){
location
.
href
=
"${ctx}/AnalysisSupport/RuleConfiguration?qualityRuleId="
+
qualityRuleId
;},
ok
:
function
(){
location
.
href
=
"${ctx}/AnalysisSupport/
Quality
RuleConfiguration?qualityRuleId="
+
qualityRuleId
;},
okValue
:
"确定"
,
cancel
:
function
(){},
cancelValue
:
"取消"
,
...
...
src/main/webapp/static/js/ruleResultDetailTable.js
View file @
c30ebd21
...
...
@@ -302,11 +302,23 @@ table_pagging.prototype = {
}
if
(
k
==
10
){
if
(
tdContext
!=
" "
){
tdContext
=
df
.
format
(
new
Date
(
tdContext
));
}
}
if
(
tdContext
.
indexOf
(
"/"
)
!=-
1
){
var
a
=
new
Array
();
a
=
tdContext
.
split
(
"/"
);
if
(
a
[
1
]
==
"1440"
)
{
tdContext
=
a
[
0
]
+
"分钟"
;
}
else
if
(
a
[
1
]
==
"24"
){
tdContext
=
a
[
0
]
+
"小时"
;
}
}
else
{
if
(
tdContext
.
indexOf
(
"ADD"
)
!=
-
1
)
{
tdContext
=
tdContext
.
substring
(
tdContext
.
indexOf
(
"("
)
+
1
,
tdContext
.
length
-
1
)
+
"个月"
}
else
{
tdContext
=
tdContext
+
"天"
;
}
}
}
if
(
k
==
11
){
if
(
tdContext
!=
" "
){
...
...
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