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
29444a6f
Commit
29444a6f
authored
Dec 02, 2017
by
liuna
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2017年12月2日 智能分析平台提交内容
--数据质量核查下过滤规则页面联动
parent
ea1d1e22
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
305 additions
and
98 deletions
+305
-98
workspace.xml
.idea/workspace.xml
+0
-0
AccuracyRuleDao.java
src/main/java/com/hp/cmsz/repository/AccuracyRuleDao.java
+1
-1
QualityRuleInfoDao.java
src/main/java/com/hp/cmsz/repository/QualityRuleInfoDao.java
+3
-1
AccuracyRuleService.java
.../hp/cmsz/service/analysissupport/AccuracyRuleService.java
+1
-1
QualityRuleInfoService.java
.../cmsz/service/analysissupport/QualityRuleInfoService.java
+4
-2
FilterRuleMaintainController.java
...msz/web/analysissupport/FilterRuleMaintainController.java
+49
-1
QualityRuleConfigurationController.java
...b/analysissupport/QualityRuleConfigurationController.java
+0
-0
QualityRuleMaintainController.java
...sz/web/analysissupport/QualityRuleMaintainController.java
+59
-75
QualityRuleOperationController.java
...z/web/analysissupport/QualityRuleOperationController.java
+9
-6
QualityRule_IfFilter.tag
src/main/webapp/WEB-INF/tags/QualityRule_IfFilter.tag
+5
-4
FilterRuleMaintain.jsp
...bapp/WEB-INF/views/AnalysisSupport/FilterRuleMaintain.jsp
+172
-5
QualityRuleConfiguration.jsp
...EB-INF/views/AnalysisSupport/QualityRuleConfiguration.jsp
+0
-0
QualityRuleMaintain.jsp
...app/WEB-INF/views/AnalysisSupport/QualityRuleMaintain.jsp
+0
-0
QualityRuleOperation.jsp
...pp/WEB-INF/views/AnalysisSupport/QualityRuleOperation.jsp
+2
-2
No files found.
.idea/workspace.xml
View file @
29444a6f
This diff is collapsed.
Click to expand it.
src/main/java/com/hp/cmsz/repository/AccuracyRuleDao.java
View file @
29444a6f
...
...
@@ -34,7 +34,7 @@ public interface AccuracyRuleDao extends JpaSpecificationExecutor<AccuracyRule>,
//根据准确性规则ID更新准确性规则信息
@Modifying
@Query
(
"update AccuracyRule ar set ar.ruleType=:ruleType, ar.scopeMaxValue=:scopeMaxValue, ar.scopeMinValue=:scopeMinValue, ar.repeatedCheckGranularity=:repeatedCheckGranularity, ar.repeatedCheckStartTime=:repeatedCheckStartTime, ar.repeatedCheckEndTime=:repeatedCheckEndTime, ar.ifRepeatedCheckSeries=:ifRepeatedCheckSeries, ar.repeatedCheckMaxTime=:repeatedCheckMaxTime, ar.ifRepeatedCheckSummation=:ifRepeatedCheckSummation where ar.accuracyRuleId =:accuracyRuleId"
)
void
updateAccuracyRuleByAccuracyRuleId
(
@Param
(
"ruleType"
)
String
ruleType
,
@Param
(
"scopeMaxValue"
)
String
scopeMaxValue
,
@Param
(
"scopeMinValue"
)
String
scopeMinValue
,
@Param
(
"repeatedCheckGranularity"
)
String
repeatedCheckGranularity
,
@Param
(
"repeatedCheckStartTime"
)
Date
repeatedCheckStartTime
,
@Param
(
"repeatedCheckEndTime"
)
Date
repeatedCheckEndTime
,
@Param
(
"ifRepeatedCheckSeries"
)
String
ifRepeatedCheckSeries
,
@Param
(
"repeatedCheckMaxTime"
)
Long
repeatedCheckMaxTime
,
@Param
(
"ifRepeatedCheckSummation"
)
String
ifRepeatedCheckSummation
,
@Param
(
"accuracyRuleId"
)
Long
accuracyRuleId
);
void
updateAccuracyRuleByAccuracyRuleId
(
@Param
(
"ruleType"
)
String
ruleType
,
@Param
(
"scopeMaxValue"
)
Double
scopeMaxValue
,
@Param
(
"scopeMinValue"
)
Double
scopeMinValue
,
@Param
(
"repeatedCheckGranularity"
)
String
repeatedCheckGranularity
,
@Param
(
"repeatedCheckStartTime"
)
Date
repeatedCheckStartTime
,
@Param
(
"repeatedCheckEndTime"
)
Date
repeatedCheckEndTime
,
@Param
(
"ifRepeatedCheckSeries"
)
String
ifRepeatedCheckSeries
,
@Param
(
"repeatedCheckMaxTime"
)
Long
repeatedCheckMaxTime
,
@Param
(
"ifRepeatedCheckSummation"
)
String
ifRepeatedCheckSummation
,
@Param
(
"accuracyRuleId"
)
Long
accuracyRuleId
);
//根据准确性规则ID删除一条准确性规则信息
@Modifying
...
...
src/main/java/com/hp/cmsz/repository/QualityRuleInfoDao.java
View file @
29444a6f
...
...
@@ -5,7 +5,9 @@ import org.springframework.data.jpa.domain.Specification;
import
org.springframework.data.jpa.repository.JpaSpecificationExecutor
;
import
org.springframework.data.jpa.repository.Query
;
import
org.springframework.data.repository.PagingAndSortingRepository
;
import
sun.security.krb5.internal.Ticket
;
import
java.sql.Timestamp
;
import
java.util.Date
;
import
java.util.List
;
...
...
@@ -16,5 +18,5 @@ public interface QualityRuleInfoDao extends JpaSpecificationExecutor<QualityRule
List
<
QualityRuleInfo
>
findQualityRuleInfo
();
//根据筛选项查找
List
<
QualityRuleInfo
>
findByBusinessTimeBetweenAnd
ChannelIdInAndBusinessIdInAndProvinceIdInAndIfFilterInAndDataSourceIdInOrderByBusinessTimeDesc
(
Date
time1
,
Date
time2
,
List
<
Long
>
dataSource
,
List
<
Long
>
chnnal
,
List
<
Long
>
busines
,
List
<
Long
>
province
,
List
<
Long
>
ifFilter
);
List
<
QualityRuleInfo
>
findByBusinessTimeBetweenAnd
DataSourceIdInAndChannelIdInAndBusinessIdInAndProvinceIdInAndIfFilterInOrderByBusinessTimeDesc
(
Timestamp
time1
,
Timestamp
time2
,
List
<
Long
>
dataSource
,
List
<
Long
>
chnnal
,
List
<
Long
>
busines
,
List
<
Long
>
province
,
List
<
Long
>
ifFilter
);
}
src/main/java/com/hp/cmsz/service/analysissupport/AccuracyRuleService.java
View file @
29444a6f
...
...
@@ -29,7 +29,7 @@ public class AccuracyRuleService {
//根据准确性规则ID更新准确性规则
@Transactional
(
readOnly
=
false
)
public
void
updateAccuracyRuleByAccuracyRuleId
(
String
ruleType
,
String
scopeMaxValue
,
String
scopeMinValue
,
String
repeatedCheckGranularity
,
Date
repeatedCheckStartTime
,
Date
repeatedCheckEndTime
,
String
ifRepeatedCheckSeries
,
Long
repeatedCheckMaxTime
,
String
ifRepeatedCheckSummation
,
Long
accuracyRuleId
){
public
void
updateAccuracyRuleByAccuracyRuleId
(
String
ruleType
,
Double
scopeMaxValue
,
Double
scopeMinValue
,
String
repeatedCheckGranularity
,
Date
repeatedCheckStartTime
,
Date
repeatedCheckEndTime
,
String
ifRepeatedCheckSeries
,
Long
repeatedCheckMaxTime
,
String
ifRepeatedCheckSummation
,
Long
accuracyRuleId
){
accuracyRuleDao
.
updateAccuracyRuleByAccuracyRuleId
(
ruleType
,
scopeMaxValue
,
scopeMinValue
,
repeatedCheckGranularity
,
repeatedCheckStartTime
,
repeatedCheckEndTime
,
ifRepeatedCheckSeries
,
repeatedCheckMaxTime
,
ifRepeatedCheckSummation
,
accuracyRuleId
);
}
...
...
src/main/java/com/hp/cmsz/service/analysissupport/QualityRuleInfoService.java
View file @
29444a6f
package
com
.
hp
.
cmsz
.
service
.
analysissupport
;
import
com.hp.cmsz.entity.QualityRuleInfo
;
import
com.hp.cmsz.entity.Time
;
import
com.hp.cmsz.repository.QualityRuleInfoDao
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.sql.Timestamp
;
import
java.util.Date
;
import
java.util.List
;
...
...
@@ -21,7 +23,7 @@ public class QualityRuleInfoService {
}
//根据筛选项获取质量规则
public
List
<
QualityRuleInfo
>
getQualityRuleInfoBy
(
Date
time1
,
Date
time2
,
List
<
Long
>
dataSource
,
List
<
Long
>
chnnal
,
List
<
Long
>
busines
,
List
<
Long
>
province
,
List
<
Long
>
ifFilter
){
return
qualityRuleInfoDao
.
findByBusinessTimeBetweenAnd
ChannelIdInAndBusinessIdInAndProvinceIdInAndIfFilterInAndDataSourceId
InOrderByBusinessTimeDesc
(
time1
,
time2
,
dataSource
,
chnnal
,
busines
,
province
,
ifFilter
);
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
.
findByBusinessTimeBetweenAnd
DataSourceIdInAndChannelIdInAndBusinessIdInAndProvinceIdInAndIfFilter
InOrderByBusinessTimeDesc
(
time1
,
time2
,
dataSource
,
chnnal
,
busines
,
province
,
ifFilter
);
}
}
src/main/java/com/hp/cmsz/web/analysissupport/FilterRuleMaintainController.java
View file @
29444a6f
package
com
.
hp
.
cmsz
.
web
.
analysissupport
;
import
java.util.List
;
import
java.util.Map
;
import
com.google.gson.Gson
;
import
com.hp.cmsz.entity.*
;
import
com.hp.cmsz.repository.*
;
import
com.hp.cmsz.service.BusinessService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -18,9 +24,51 @@ import com.hp.cmsz.web.PageURLController;
@RequestMapping
(
value
=
"AnalysisSupport/FilterRuleMaintain"
)
public
class
FilterRuleMaintainController
{
@Autowired
private
ProvinceDao
provinceDao
;
@Autowired
private
ChannelDao
channelDao
;
@Autowired
private
ChannelDataSourceMapDao
channelDataSourceMapDao
;
@Autowired
private
BusinessService
businessService
;
@Autowired
private
BusinessDao
businessDao
;
@Autowired
private
KpiDao
kpiDao
;
@Autowired
private
DataTypeDao
dataTypeDao
;
@Autowired
private
DataSourceDao
dataSourceDao
;
@RequestMapping
(
value
=
""
)
public
String
filterMaintainHome
(
Map
model
){
//查询出所有的省份
List
<
Province
>
provinceList
=(
List
<
Province
>)
provinceDao
.
findProvince
();
//查询出所有的渠道信息
List
<
Channel
>
channelList
=(
List
<
Channel
>)
channelDao
.
findChannel
();
//查询出所有的指标
List
<
Kpi
>
kpiList
=(
List
<
Kpi
>)
kpiDao
.
findAll
();
//查询出所有的业务
List
<
Object
[]>
businessList
=(
List
<
Object
[]>)
businessDao
.
findAllBusinessIdAndBusinessName
();
//查询出所有的数据类型
List
<
DataType
>
dataTypeList
=
(
List
<
DataType
>)
dataTypeDao
.
findAll
();
//查询出所有的数据来源
List
<
DataSource
>
dataSourceList
=(
List
<
DataSource
>)
dataSourceDao
.
findAll
();
Gson
gson
=
new
Gson
();
model
.
put
(
"provinceList"
,
provinceList
);
model
.
put
(
"channelList"
,
channelList
);
model
.
put
(
"kpiList"
,
kpiList
);
model
.
put
(
"businessList"
,
gson
.
toJson
(
businessList
));
model
.
put
(
"dataTypeList"
,
dataTypeList
);
model
.
put
(
"dataSourceList"
,
dataSourceList
);
return
PageURLController
.
FilterMaintain
;
}
}
src/main/java/com/hp/cmsz/web/analysissupport/QualityRuleConfigurationController.java
View file @
29444a6f
This diff is collapsed.
Click to expand it.
src/main/java/com/hp/cmsz/web/analysissupport/QualityRuleMaintainController.java
View file @
29444a6f
...
...
@@ -194,36 +194,47 @@ public class QualityRuleMaintainController {
@RequestParam
(
value
=
"repeatedCheckMaxTime"
)
String
repeatedCheckMaxTime
,
@RequestParam
(
value
=
"ifRepeatedCheckSummation"
)
String
ifRepeatedCheckSummation
,
HttpServletResponse
response
,
HttpServletRequest
request
)
{
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
.
trim
().
equals
(
""
))
{
if
(
ruleType
==
"1"
)
{
accuracyRule
.
setRuleType
(
"范围"
);
}
else
if
(
ruleType
==
"2"
)
{
accuracyRule
.
setRuleType
(
"重复"
);
}
if
(!
scopeMaxValue
.
trim
().
equals
(
""
))
{
accuracyRule
.
setScopeMaxValue
(
scopeMaxValue
);
}
SimpleDateFormat
sd
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
if
(!
scopeMaxValue
.
trim
().
equals
(
""
)){
accuracyRule
.
setScopeMaxValue
(
scopeMaxValue
);}
if
(!
scopeMinValue
.
trim
().
equals
(
""
)){
accuracyRule
.
setScopeMinValue
(
scopeMinValue
);}
if
(!
repeatedCheckGranularity
.
trim
().
equals
(
""
)){
accuracyRule
.
setRepeatedCheckGranularity
(
repeatedCheckGranularity
);}
if
(!
repeatedCheckStartTime
.
trim
().
equals
(
""
)){
if
(!
scopeMinValue
.
trim
().
equals
(
""
))
{
accuracyRule
.
setScopeMinValue
(
scopeMinValue
);
}
if
(!
repeatedCheckGranularity
.
trim
().
equals
(
""
))
{
accuracyRule
.
setRepeatedCheckGranularity
(
repeatedCheckGranularity
);
}
if
(!
repeatedCheckStartTime
.
trim
().
equals
(
""
))
{
try
{
accuracyRule
.
setRepeatedCheckStartTime
(
sd
.
parse
(
repeatedCheckStartTime
));
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
}
if
(!
repeatedCheckEndTime
.
trim
().
equals
(
""
))
{
if
(!
repeatedCheckEndTime
.
trim
().
equals
(
""
))
{
try
{
accuracyRule
.
setRepeatedCheckEndTime
(
sd
.
parse
(
repeatedCheckEndTime
));
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
}
if
(!
ifRepeatedCheckSeries
.
trim
().
equals
(
""
)){
accuracyRule
.
setIfRepeatedCheckSeries
(
ifRepeatedCheckSeries
);}
if
(!
repeatedCheckMaxTime
.
trim
().
equals
(
""
)){
accuracyRule
.
setRepeatedCheckMaxTime
(
Long
.
parseLong
(
repeatedCheckMaxTime
));}
if
(!
ifRepeatedCheckSummation
.
trim
().
equals
(
""
)){
accuracyRule
.
setIfRepeatedCheckSummation
(
ifRepeatedCheckSummation
);}
if
(!
ifRepeatedCheckSeries
.
trim
().
equals
(
""
))
{
accuracyRule
.
setIfRepeatedCheckSeries
(
ifRepeatedCheckSeries
);
}
if
(!
repeatedCheckMaxTime
.
trim
().
equals
(
""
))
{
accuracyRule
.
setRepeatedCheckMaxTime
(
Long
.
parseLong
(
repeatedCheckMaxTime
));
}
if
(!
ifRepeatedCheckSummation
.
trim
().
equals
(
""
))
{
accuracyRule
.
setIfRepeatedCheckSummation
(
ifRepeatedCheckSummation
);
}
accuracyRule
.
setRuleCrtTime
(
new
Date
());
accuracyRule
.
setRuleUpdateTime
(
new
Date
());
...
...
@@ -232,82 +243,55 @@ public class QualityRuleMaintainController {
Long
qualityRuleId
=
accuracyRule
.
getAccuracyRuleId
();
qualityRuleIdList
.
add
(
qualityRuleId
);
}
}
//新增质量模型
@RequestMapping
(
value
=
"/saveRuleDataForm"
,
method
=
RequestMethod
.
POST
)
public
String
saveRuleDataForm
(
// @RequestParam(value="channel") String channel,
// @RequestParam(value="dataSource") String dataSourceId,
// @RequestParam(value="kpiMonitorTime") String kpiMonitorTime,
// @RequestParam(value="businessTime") String businessTime,
// @RequestParam(value="ruleCrtTime") String ruleCrtTime,
// @RequestParam(value="ruleUpdateTime") String ruleUpdateTime,
HttpServletResponse
response
,
HttpServletRequest
request
)
throws
ParseException
{
// String province = request.getParameter("province");
// String businessValue = request.getParameter("businessinput");
String
channel
=
request
.
getParameter
(
"channel"
);
// String dataSourceId =request.getParameter("dataSource");
// String kpiValue = request.getParameter("kpiinput");
// String kpiMonitorTime=request.getParameter("kpiMonitorTime");
// String businessTime=request.getParameter("businessTime");
// String ruleCrtTime=request.getParameter("ruleCrtTime");
// String ruleUpdateTime=request.getParameter("ruleUpdateTime");
// String provinceId = "";
// String businessId = "";
// String kpiId = "";
public
String
saveRuleDataForm
(
@RequestParam
(
value
=
"businessinput"
)
String
business
,
@RequestParam
(
value
=
"province"
)
String
province
,
@RequestParam
(
value
=
"channel"
)
String
channel
,
@RequestParam
(
value
=
"dataSource"
)
String
dataSourceId
,
@RequestParam
(
value
=
"kpiinput"
)
String
kpi
,
@RequestParam
(
value
=
"kpiUnit"
)
String
kpiUnit
,
@RequestParam
(
value
=
"kpiMonitorTime"
)
String
kpiMonitorTime
,
@RequestParam
(
value
=
"businessTime"
)
String
businessTime
,
HttpServletResponse
response
,
HttpServletRequest
request
)
throws
ParseException
{
System
.
out
.
println
(
"0000"
+
kpiUnit
);
SimpleDateFormat
sd
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
QualityRule
qualityRule
=
new
QualityRule
();
// List<Long> provinceIdList = new ArrayList<Long>();
// for(int i=0;i<province.split(",").length;i++){
// provinceIdList.add(Long.parseLong(province.split(",")[i]));
// }
// List<Long> businessIdList = new ArrayList<Long>();
// for(int i=0;i<businessValue.split(",").length;i++){
// businessIdList.add(Long.parseLong(businessValue.split(",")[i]));
// }
// List<Long> kpiIdList = new ArrayList<Long>();
// for(int i=0;i<kpiValue.split(",").length;i++){
// kpiIdList.add(Long.parseLong(kpiValue.split(",")[i]));
// }
// System.out.println("provinceIdList:"+provinceIdList+"businessIdList:"+businessIdList+"kpiIdList:"+kpiIdList);
// for(int j=0; j<provinceIdList.size(); j++) {
// for(int k=0; k<businessIdList.size(); k++){
// for(int l=0; l<kpiIdList.size(); l++){
// provinceId = String.valueOf(provinceIdList.get(j));
// businessId = String.valueOf(businessIdList.get(k));
// kpiId = String.valueOf(kpiIdList.get(l));
// if(!provinceId.trim().equals("")){qualityRule.setProvinceId(Long.parseLong(provinceId));}
// if(!businessId.trim().equals("")){qualityRule.setBusinessId(Long.parseLong(businessId));}
// if(!kpiId.trim().equals("")){qualityRule.setKpiId(Long.parseLong(kpiId));}
qualityRule
.
setProvinceId
(
Long
.
parseLong
(
"1"
));
qualityRule
.
setBusinessId
(
Long
.
parseLong
(
"1490"
));
qualityRule
.
setKpiId
(
Long
.
parseLong
(
"2411"
));
if
(!
channel
.
trim
().
equals
(
""
)){
qualityRule
.
setChannelId
(
Long
.
parseLong
(
channel
));
List
<
Long
>
provinceIdList
=
new
ArrayList
<
Long
>();
for
(
int
i
=
0
;
i
<
province
.
split
(
","
).
length
;
i
++){
provinceIdList
.
add
(
Long
.
parseLong
(
province
.
split
(
","
)[
i
]));
}
List
<
Long
>
businessIdList
=
new
ArrayList
<
Long
>();
for
(
int
i
=
0
;
i
<
business
.
split
(
","
).
length
;
i
++){
businessIdList
.
add
(
Long
.
parseLong
(
business
.
split
(
","
)[
i
]));
}
//if(!dataSourceId.trim().equals("")){
qualityRule
.
setDataSourceId
(
Long
.
parseLong
(
"7"
));
//}
//if(!kpiMonitorTime.trim().equals("")){
qualityRule
.
setKpiMonitorTime
(
"4"
);
//}
List
<
Long
>
kpiIdList
=
new
ArrayList
<
Long
>();
for
(
int
i
=
0
;
i
<
kpi
.
split
(
","
).
length
;
i
++){
kpiIdList
.
add
(
Long
.
parseLong
(
kpi
.
split
(
","
)[
i
]));
}
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
));
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(!businessTime.trim().equals("")){
qualityRule
.
setBusinessTime
(
Timestamp
.
valueOf
(
sd
.
format
(
new
Date
())));
//}
if
(!
businessTime
.
trim
().
equals
(
""
)){
qualityRule
.
setBusinessTime
(
Timestamp
.
valueOf
(
businessTime
));
}
qualityRule
.
setRuleCrtTime
(
Timestamp
.
valueOf
(
sd
.
format
(
new
Date
())));
qualityRule
.
setRuleUpdateTime
(
Timestamp
.
valueOf
(
sd
.
format
(
new
Date
())));
qualityRule
.
setRuleValidFlag
(
"0"
);
qualityRule
.
setIfSystemValue
(
"0"
);
System
.
out
.
println
(
"qualityRule"
+
qualityRule
);
qualityRuleDao
.
save
(
qualityRule
);
// }
// }
// }
cmszOperationLogService
.
createLog
(
"增加"
,
"新建质量模型"
,
"quality_rule_warehouse_info_t. QUALITY_RULE_ID="
+
qualityRule
.
getQualityRuleId
().
toString
());
cmszOperationLogService
.
createLog
(
"增加"
,
"新建质量模型"
,
"quality_rule_warehouse_info_t. QUALITY_RULE_ID="
+
qualityRule
.
getQualityRuleId
().
toString
());
Long
qualityRuleId
=
qualityRule
.
getQualityRuleId
();
return
"redirect:AnalysisSupport/QualityRuleResult"
;
}
}
return
"redirect:/AnalysisSupport/QualityRuleResult"
;
}
}
src/main/java/com/hp/cmsz/web/analysissupport/QualityRuleOperationController.java
View file @
29444a6f
...
...
@@ -18,10 +18,12 @@ import org.springframework.web.bind.annotation.RequestMethod;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
javax.servlet.ServletOutputStream
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.io.PrintWriter
;
import
java.io.UnsupportedEncodingException
;
import
java.sql.Timestamp
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
...
...
@@ -97,7 +99,7 @@ public class QualityRuleOperationController {
}
//根据筛选项搜索
@RequestMapping
(
value
=
"/
changeTable*"
,
method
=
RequestMethod
.
POS
T
)
@RequestMapping
(
value
=
"/
operationChangeTable*"
,
method
=
RequestMethod
.
GE
T
)
@ResponseBody
public
void
changeTable
(
@RequestParam
(
value
=
"period"
)
String
period
,
// 时间
@RequestParam
(
value
=
"dataSource"
)
String
dataSource
,
// 数据来源
...
...
@@ -106,23 +108,24 @@ public class QualityRuleOperationController {
@RequestParam
(
value
=
"province"
)
String
province
,
//省份
@RequestParam
(
value
=
"ifFilter"
)
String
ifFilter
,
//是否过滤
HttpServletResponse
response
)
throws
ParseException
,
UnsupportedEncodingException
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH
:mm:ss"
);
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd hh
:mm:ss"
);
cmszOperationLogService
.
createLog
(
"查询"
,
"质量规则运营查询"
,
"质量规则运营页面查询"
);
List
<
QualityRuleInfo
>
qualityRuleInfoList
;
String
[]
time
=
period
.
split
(
"~"
);
String
[]
dates
=
period
.
split
(
"~"
);
String
[]
dataSourceS
=
dataSource
.
split
(
","
);
String
[]
chnnalS
=
chnnal
.
split
(
","
);
String
[]
bussinesS
=
bussines
.
split
(
","
);
String
[]
provinceS
=
province
.
split
(
","
);
String
[]
ifFilterS
=
province
.
split
(
","
);
Date
time1
=
sdf
.
parse
(
time
[
0
]
);
Date
time2
=
sdf
.
parse
(
time
[
1
]
);
String
[]
ifFilterS
=
ifFilter
.
split
(
","
);
Timestamp
time1
=
new
Timestamp
(
format
.
parse
(
dates
[
0
]).
getTime
()
);
Timestamp
time2
=
new
Timestamp
(
format
.
parse
(
dates
[
1
]).
getTime
()
);
List
<
Long
>
dataSourceList
=
changeStrToList
(
dataSourceS
);
List
<
Long
>
chnnalList
=
changeStrToList
(
chnnalS
);
List
<
Long
>
bussinesList
=
changeStrToList
(
bussinesS
);
List
<
Long
>
provinceList
=
changeStrToList
(
provinceS
);
List
<
Long
>
ifFilterList
=
changeStrToList
(
ifFilterS
);
System
.
out
.
println
(
"qualityRule:"
+
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/tags/QualityRule_IfFilter.tag
View file @
29444a6f
...
...
@@ -7,14 +7,14 @@
<div id="ws" class="slide-menu-option">
<label>是否过滤</label>
<select class="slide-menu-select" id="ifFilter" name="ifFilter">
<option value="'1'" title="是"><a href="#">是</a></option>
<option value="'0'" title="否"><a href="#">否</a></option>
<option value="0,1" title="全部"selected><a href="#">全部</a></option>
<option value="1" title="是"><a href="#">是</a></option>
<option value="0" title="否"><a href="#">否</a></option>
</select>
</div>
<script type="text/javascript">
//获取其被选中的value,若是0则代表不是关键配置,若是1则代表是关键配置
function getIfFilter(){
return $("#ifFilter").val();
}
...
...
@@ -25,6 +25,6 @@
}
function RelFilterRest() {
$("#ifFilter").val("1");
$("#ifFilter").val("
0,
1");
}
</script>
\ No newline at end of file
src/main/webapp/WEB-INF/views/AnalysisSupport/FilterRuleMaintain.jsp
View file @
29444a6f
...
...
@@ -53,16 +53,48 @@
<form
action=
"#"
class=
"form-horizontal"
id=
"filterMaintainForm"
method=
"post"
enctype=
"multipart/form-data"
>
<table
id=
"filterMaintainTable"
class=
"table-null"
>
<tr><td>
省份(
<font
color=
"red"
>
必填
</font>
):
</td>
<td><tags:ProvinceTag
/></td>
<td>
<c:forEach
var=
"province"
items=
"${provinceList}"
>
<input
type=
"checkbox"
name=
"province"
id=
"province"
value=
"${province.provinceId}"
checked
>
${province.provinceName}
</c:forEach>
</td>
</tr>
<tr><td>
数据来源(
<font
color=
"red"
>
必填
</font>
):
</td>
<td>
<select
class=
"form-control"
name=
"dataSource"
id=
"dataSource"
>
<c:forEach
var=
"dataSource"
items=
"${dataSourceList}"
>
<c:if
test=
"${dataSource.dataSourceId == '5'}"
>
<option
value=
"${dataSource.dataSourceId}"
selected
>
${dataSource.dataSourceName}
</option>
</c:if
>
<c:if
test=
"${dataSource.dataSourceId != '5'}"
>
<option
value=
"${dataSource.dataSourceId}"
>
${dataSource.dataSourceName}
</option>
</c:if
>
</c:forEach>
</select></td>
</tr>
<tr><td>
渠道(
<font
color=
"red"
>
必填
</font>
):
</td>
<td><tags:ChannelTag
/></td>
<td><select
class=
"form-control"
name=
"channel"
id=
"channel"
>
<c:forEach
var=
"channel"
items=
"${channelList}"
>
<c:if
test=
"${channel.channelId == '7'}"
>
<option
value=
"${channel.channelId}"
selected
>
${channel.channelName}
</option>
</c:if>
<c:if
test=
"${channel.channelId != '7'}"
>
<option
value=
"${channel.channelId}"
>
${channel.channelName}
</option>
</c:if>
</c:forEach>
</select></td>
</tr>
<tr><td>
业务(
<font
color=
"red"
>
必填
</font>
):
</td>
<td><tags:BusinessTag
/></td>
<td
>
<div
id=
"businesstd"
></div>
</td>
</tr>
<tr><td>
数据来源(
<font
color=
"red"
>
必填
</font>
):
</td>
<td><tags:DataSourceTag
/></td>
<tr><td>
指标(
<font
color=
"red"
>
必填
</font>
):
</td>
<td>
<div
id=
"kpitd"
></div>
</td>
</tr>
<!--<tr><td>影响开始时间(<font color="red">必填</font>):</td><td><input type="text" class="form-control" id="ruleCrtTime" name="ruleCrtTime" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'ruleCrtTime\')}'})" /></td></tr>
<tr><td>影响结束时间(<font color="red">必填</font>):</td><td><input id="ruleUpdateTime" name="ruleUpdateTime" class="form-control" type="text" onFocus="WdatePicker({maxDate:'#F{$dp.$D(\'ruleUpdateTime\')}'})"> </td></tr> -->
...
...
@@ -96,5 +128,139 @@ $(".ifRepeate").change(function (){
$
(
".period"
).
show
();
}
})
function
getProvinceCheckedValues
()
{
var
provinceArray
=
new
Array
();
var
i
=
0
;
$
(
"#province:checked"
).
each
(
function
(){
provinceArray
[
i
]
=
$
(
this
).
val
();
i
++
;
});
return
provinceArray
;
}
function
getProvinceCheckedValuesString
(){
var
provinceStr
=
""
;
var
provinceArray
=
getProvinceCheckedValues
();
for
(
var
i
=
0
;
i
<
provinceArray
.
length
;
i
++
){
if
(
i
==
provinceArray
.
length
-
1
){
provinceStr
+=
provinceArray
[
i
];
}
else
{
provinceStr
+=
provinceArray
[
i
]
+
","
;
}
}
return
provinceStr
;
}
var
dataSourceValue
=
$
(
"#dataSource"
).
val
();
var
channelValue
=
$
(
"#channel"
).
val
();
var
businessIds
=
getBusinessCheckedValues
();
var
calCycleValue
=
$
(
"#calCycle"
).
val
();
$
(
"#dataSource"
).
change
(
function
(){
dataSourceValue
=
$
(
"#dataSource"
).
val
();
updateBusiness
(
dataSourceValue
,
channelValue
);
});
$
(
"#channel"
).
change
(
function
(){
channelValue
=
$
(
"#channel"
).
val
();
updateBusiness
(
dataSourceValue
,
channelValue
);
});
function
updateKpi
(
businessIds
){
$
.
ajax
({
type
:
"GET"
,
contentType
:
"application/json"
,
url
:
"${ctx}/AnalysisSupport/QualityRuleMaintain/findKpiId?businessIds="
+
businessIds
,
async
:
false
,
beforeSend
:
function
(
data
)
{},
success
:
function
(
data
){
var
td
=
$
(
"#kpitd"
);
td
.
empty
();
data
=
JSON
.
parse
(
data
)
data
.
forEach
(
function
(
t
){
td
.
append
(
"<input type='checkbox' name='kpiinput' class='kpiItem' value='"
+
t
[
0
]
+
"' checked >"
+
t
[
1
]
+
"</input>"
)
});
}
});
}
function
updateBusiness
(
dataSource
,
channel
){
$
.
ajax
({
type
:
"GET"
,
contentType
:
"application/json"
,
url
:
"${ctx}/AnalysisSupport/QualityRuleMaintain/findBusinessId?dataSource="
+
dataSource
+
"&channel="
+
channel
,
async
:
false
,
beforeSend
:
function
(
data
)
{},
success
:
function
(
data
){
var
td
=
$
(
"#businesstd"
);
var
businessIds
=
new
Array
();
td
.
empty
();
data
=
JSON
.
parse
(
data
)
data
.
forEach
(
function
(
t
){
td
.
append
(
"<input type='checkbox' name='businessinput' class='businessItem' value='"
+
t
[
0
]
+
"' checked >"
+
t
[
1
]
+
"</input>"
)
businessIds
+=
t
[
0
]
+
","
;
});
updateKpi
(
businessIds
);
}
});
$
(
".businessItem"
).
click
(
function
(){
businessIds
=
""
;
$
(
"[name='businessinput']:checked"
).
each
(
function
(){
businessIds
+=
$
(
this
).
val
()
+
","
;
});
updateKpi
(
businessIds
);
});
}
updateBusiness
(
$
(
"#dataSource"
).
val
(),
$
(
"#channel"
).
val
());
function
getBusinessCheckedValues
(){
var
businessArray
=
new
Array
();
var
i
=
0
;
$
(
"[name='businessinput']:checked"
).
each
(
function
(){
businessArray
[
i
]
=
$
(
this
).
val
();
i
++
;
});
return
businessArray
;
}
function
getBusinessCheckedValuesString
(){
var
businessStr
=
""
;
var
businessArray
=
getBusinessCheckedValues
();
for
(
var
i
=
0
;
i
<
businessArray
.
length
;
i
++
){
if
(
i
==
businessArray
.
length
-
1
){
businessStr
+=
businessArray
[
i
];
}
else
{
businessStr
+=
businessArray
[
i
]
+
","
;
}
}
return
businessStr
;
}
function
getKpiCheckedValues
(){
var
kpiArray
=
new
Array
();
var
i
=
0
;
$
(
"[name='kpiinput']:checked"
).
each
(
function
(){
kpiArray
[
i
]
=
$
(
this
).
val
();
i
++
;
});
return
kpiArray
;
}
function
getKpiCheckedValuesString
(){
var
kpiStr
=
""
;
var
kpiArray
=
getKpiCheckedValues
();
for
(
var
i
=
0
;
i
<
kpiArray
.
length
;
i
++
){
if
(
i
==
kpiArray
.
length
-
1
){
kpiStr
+=
kpiArray
[
i
];
}
else
{
kpiStr
+=
kpiArray
[
i
]
+
","
;
}
}
return
kpiStr
;
}
</script>
\ No newline at end of file
src/main/webapp/WEB-INF/views/AnalysisSupport/QualityRuleConfiguration.jsp
View file @
29444a6f
This diff is collapsed.
Click to expand it.
src/main/webapp/WEB-INF/views/AnalysisSupport/QualityRuleMaintain.jsp
View file @
29444a6f
This diff is collapsed.
Click to expand it.
src/main/webapp/WEB-INF/views/AnalysisSupport/QualityRuleOperation.jsp
View file @
29444a6f
...
...
@@ -102,7 +102,7 @@
ruleOperationDetailTable
();
function
operResultSubmit
(){
var
period
=
getPeriodStr
()
;
var
period
=
getPeriodStr
()
var
dataSource
=
getStatsDataSourceCheckedValuesString
();
var
chnnal
=
getStatsChannelCheckedValuesString
();
var
bussines
=
getStatsBusinessCheckedValuesString
();
...
...
@@ -142,7 +142,7 @@
$
.
ajax
({
type
:
'GET'
,
contentType
:
'application/json'
,
url
:
"${ctx}/AnalysisSupport/QualityRuleOperation/
c
hangeTable?period="
+
period
+
"&province="
+
province
+
"&dataSource="
+
dataSource
+
"&chnnal="
+
chnnal
+
"&bussines="
+
bussines
+
"&ifFilter="
+
ifFilter
,
url
:
"${ctx}/AnalysisSupport/QualityRuleOperation/
operationC
hangeTable?period="
+
period
+
"&province="
+
province
+
"&dataSource="
+
dataSource
+
"&chnnal="
+
chnnal
+
"&bussines="
+
bussines
+
"&ifFilter="
+
ifFilter
,
dataType
:
'text'
,
async
:
false
,
beforeSend
:
function
(
data
)
{
...
...
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