Commit 38de5b19 authored by 莫林毅's avatar 莫林毅

Merge remote-tracking branch 'origin/master' into moly

# Conflicts: # src/main/java/com/hp/cmsz/entity/DimKpi.java # src/main/java/com/hp/cmsz/repository/BusinessDao.java
parents bb205033 bbae9c30
......@@ -3,7 +3,7 @@
### Example user template
# IntelliJ project files
.idea
*.iml
out
gen
......
......@@ -3,6 +3,13 @@
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES5" />
</component>
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" default="false" project-jdk-name="1.6" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
......
This diff is collapsed.
......@@ -1460,7 +1460,7 @@
<SOURCES />
</library>
</orderEntry>
<orderEntry type="jdk" jdkName="1.6" jdkType="JavaSDK" />
<orderEntry type="inheritedJdk" />
<orderEntry type="module-library">
<library>
<CLASSES>
......@@ -1470,7 +1470,14 @@
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" name="lib" level="project" />
<orderEntry type="library" name="servlet-api" level="application" />
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/servlet-api.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
</component>
</module>
\ No newline at end of file
No preview for this file type
//package com.hp.cmsz.entity;
//
//import javax.persistence.Entity;
//import javax.persistence.Table;
//
//@Entity
//@Table(name="etl.APP_EWARNING_DETAIL_T")
//public class APPEWarningDetail {
// private Long EwarningDetailId;
//// private Long EwarningDetailId;
//
//
//
//}
package com.hp.cmsz.entity;
import com.hp.cmsz.entity.commonmanage.EWarningCalcResult;
import javax.persistence.*;
import java.sql.Timestamp;
import java.util.List;
@Entity
@Table(name="Model_Preview_v",schema = "ccolap")
public class APPEWarningDetail {
private Long ewarningDetailId;
private String provinceName;
private String datasourceName;
private String busname;
private String channelName;
private String kpiName;
private String kpiCode;
private Timestamp busdatabegTime;
private Timestamp busdataendTime;
private String threshold1Val;
private String threshold2Val;
private String threshold3Val;
private String warn1Val;
private String warn2Val;
private String warn3Val;
private String fileAddress;
private List<EWarningCalcResult> eWarningCalcResult;
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public Long getEwarningDetailId() {
return ewarningDetailId;
}
public void setEwarningDetailId(Long ewarningDetailId) {
this.ewarningDetailId = ewarningDetailId;
}
public String getProvinceName() {
return provinceName;
}
public void setProvinceName(String provinceName) {
this.provinceName = provinceName;
}
public String getDatasourceName() {
return datasourceName;
}
public void setDatasourceName(String datasourceName) {
this.datasourceName = datasourceName;
}
public String getBusname() {
return busname;
}
public void setBusname(String busname) {
this.busname = busname;
}
public String getChannelName() {
return channelName;
}
public void setChannelName(String channelName) {
this.channelName = channelName;
}
public String getKpiName() {
return kpiName;
}
public void setKpiName(String kpiName) {
this.kpiName = kpiName;
}
public String getKpiCode() {
return kpiCode;
}
public void setKpiCode(String kpiCode) {
this.kpiCode = kpiCode;
}
public Timestamp getBusdatabegTime() {
return busdatabegTime;
}
public void setBusdatabegTime(Timestamp busdatabegTime) {
this.busdatabegTime = busdatabegTime;
}
public Timestamp getBusdataendTime() {
return busdataendTime;
}
public void setBusdataendTime(Timestamp busdataendTime) {
this.busdataendTime = busdataendTime;
}
@Column(name = "threshold1_val")
public String getThreshold1Val() {
return threshold1Val;
}
public void setThreshold1Val(String threshold1Val) {
this.threshold1Val = threshold1Val;
}
@Column(name = "threshold2_val")
public String getThreshold2Val() {
return threshold2Val;
}
public void setThreshold2Val(String threshold2Val) {
this.threshold2Val = threshold2Val;
}
@Column(name = "threshold3_val")
public String getThreshold3Val() {
return threshold3Val;
}
public void setThreshold3Val(String threshold3Val) {
this.threshold3Val = threshold3Val;
}
@Column(name = "warn1_val")
public String getWarn1Val() {
return warn1Val;
}
public void setWarn1Val(String warn1Val) {
this.warn1Val = warn1Val;
}
@Column(name = "warn2_Val")
public String getWarn2Val() {
return warn2Val;
}
public void setWarn2Val(String warn2Val) {
this.warn2Val = warn2Val;
}
@Column(name = "warn3_Val")
public String getWarn3Val() {
return warn3Val;
}
public void setWarn3Val(String warn3Val) {
this.warn3Val = warn3Val;
}
public String getFileAddress() {
return fileAddress;
}
public void setFileAddress(String fileAddress) {
this.fileAddress = fileAddress;
}
@Transient
public List<EWarningCalcResult> geteWarningCalcResult() {
return eWarningCalcResult;
}
public void seteWarningCalcResult(List<EWarningCalcResult> eWarningCalcResult) {
this.eWarningCalcResult = eWarningCalcResult;
}
}
......@@ -24,8 +24,8 @@ public class AccuracyRule implements Serializable {
private Long accuracyRuleId;//准确性规则ID
private Long qualityRuleId;//质量规则ID
private String ruleType;//规则类型
private double scopeMaxValue;//范围最大值
private double scopeMinValue;//范围最小值
private String scopeMaxValue;//范围最大值
private String scopeMinValue;//范围最小值
private String repeatedCheckGranularity;//重复考核粒度
private Date repeatedCheckStartTime;//重复考核开始时间
private Date repeatedCheckEndTime;//重复考核结束时间
......@@ -58,16 +58,16 @@ public class AccuracyRule implements Serializable {
public void setRuleType(String ruleType) {
this.ruleType = ruleType;
}
public double getScopeMaxValue() {
public String getScopeMaxValue() {
return scopeMaxValue;
}
public void setScopeMaxValue(double scopeMaxValue) {
public void setScopeMaxValue(String scopeMaxValue) {
this.scopeMaxValue = scopeMaxValue;
}
public double getScopeMinValue() {
public String getScopeMinValue() {
return scopeMinValue;
}
public void setScopeMinValue(double scopeMinValue) {
public void setScopeMinValue(String scopeMinValue) {
this.scopeMinValue = scopeMinValue;
}
public String getRepeatedCheckGranularity() {
......
......@@ -34,6 +34,7 @@ public class Business implements Serializable{
public Long getBusinessId() {
return businessId;
}
public void setBusinessId(Long businessId) {
this.businessId = businessId;
}
......
......@@ -27,13 +27,13 @@ public class Channel implements Serializable{
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="ChannelSequence")
@SequenceGenerator(name = "ChannelSequence", sequenceName = "dim_channel_info_t_seq", allocationSize=20)
public Long getChannelId() {
return channelId;
}
public String getChannelName() {
return channelName;
}
public Long getChannelId() {
return channelId;
}
public void setChannelId(Long channelId) {
this.channelId = channelId;
}
......
......@@ -26,12 +26,14 @@ public class DataSource implements Serializable{
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="DataSourceSequence")
@SequenceGenerator(name = "DataSourceSequence", sequenceName = "dim_data_source_info_t_seq", allocationSize=20)
public String getDataSourceName() {
return dataSourceName;
}
public Long getDataSourceId() {
return dataSourceId;
}
public String getDataSourceName() {
return dataSourceName;
}
public void setDataSourceId(Long dataSourceId) {
this.dataSourceId = dataSourceId;
}
......
package com.hp.cmsz.entity;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Date;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.*;
/**
* warning_filtering_rule_info_t表对应的实体类
......@@ -14,24 +13,26 @@ import javax.persistence.SequenceGenerator;
* @author Liu Na
*
*/
@Entity
@Table(name = "WARNING_FILTERING_RULE_INFO_T",schema = "ccolap")
public class FilterRule implements Serializable{
private Long warningFilteringRuleId;//过滤规则ID
private Long kpiId;//指标ID
private Long provinceId;//省份ID
private Long channelId;//渠道ID
private Long businessId;//业务ID
private Date filterStartTime;//过滤开始时间
private Date filterEndTime;//过滤结束时间
private String filterReason;//过滤原因
private String filterType;//过滤类型
private Date ruleCrtTime;//规则创建时间
private Date ruleUpdateTime;//规则更新时间
private Timestamp filteringStartTime;//过滤开始时间
private Timestamp filteringEndTime;//过滤结束时间
private String filteringReason;//过滤原因
private String filteringType;//过滤类型
private Timestamp ruleCrtTime;//规则创建时间
private Timestamp ruleUpdateTime;//规则更新时间
private String validFlag;//规则是否有效
private String frequency;//频率
private String ifRepeat;//是否重复
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="FilterRuleSequence")
@SequenceGenerator(name = "FilterRuleSequence", sequenceName = "warning_filtering_rule_info_t_seq", allocationSize=1)
@SequenceGenerator(name = "FilterRuleSequence", sequenceName = "WARNING_FILTERING_RULE_SEQ", allocationSize=1)
public Long getWarningFilteringRuleId() {
return warningFilteringRuleId;
......@@ -51,59 +52,76 @@ public class FilterRule implements Serializable{
public void setProvinceId(Long provinceId) {
this.provinceId = provinceId;
}
public Long getChannelId() {
return channelId;
}
public void setChannelId(Long channelId) {
this.channelId = channelId;
}
public Long getBusinessId() {
return businessId;
}
public void setBusinessId(Long businessId) {
this.businessId = businessId;
}
public Date getFilterStartTime() {
return filterStartTime;
public Timestamp getFilteringStartTime() {
return filteringStartTime;
}
public void setFilterStartTime(Date filterStartTime) {
this.filterStartTime = filterStartTime;
public void setFilteringStartTime(Timestamp filteringStartTime) {
this.filteringStartTime = filteringStartTime;
}
public Date getFilterEndTime() {
return filterEndTime;
public Timestamp getFilteringEndTime() {
return filteringEndTime;
}
public void setFilterEndTime(Date filterEndTime) {
this.filterEndTime = filterEndTime;
public void setFilteringEndTime(Timestamp filteringEndTime) {
this.filteringEndTime = filteringEndTime;
}
public String getFilterReason() {
return filterReason;
public String getFilteringReason() {
return filteringReason;
}
public void setFilterReason(String filterReason) {
this.filterReason = filterReason;
public void setFilteringReason(String filteringReason) {
this.filteringReason = filteringReason;
}
public String getFilterType() {
return filterType;
public String getFilteringType() {
return filteringType;
}
public void setFilterType(String filterType) {
this.filterType = filterType;
public void setFilteringType(String filteringType) {
this.filteringType = filteringType;
}
public Date getRuleCrtTime() {
public Timestamp getRuleCrtTime() {
return ruleCrtTime;
}
public void setRuleCrtTime(Date ruleCrtTime) {
public void setRuleCrtTime(Timestamp ruleCrtTime) {
this.ruleCrtTime = ruleCrtTime;
}
public Date getRuleUpdateTime() {
public Timestamp getRuleUpdateTime() {
return ruleUpdateTime;
}
public void setRuleUpdateTime(Date ruleUpdateTime) {
public void setRuleUpdateTime(Timestamp ruleUpdateTime) {
this.ruleUpdateTime = ruleUpdateTime;
}
public String getValidFlag() {
return validFlag;
}
public void setValidFlag(String validFlag) {
this.validFlag = validFlag;
}
public String getFrequency() {
return frequency;
}
public void setFrequency(String frequency) {
this.frequency = frequency;
}
public String getIfRepeat() {
return ifRepeat;
}
public void setIfRepeat(String ifRepeat) {
this.ifRepeat = ifRepeat;
}
}
......@@ -41,6 +41,7 @@ public class Kpi implements Serializable{
private Long kpiTypeId;
private Long kpiCycleTypeId;
private String isActive ; //是否有效,为Y时,才需要在筛选项中显示
private String calCycle;
public Long getKpiId() {
return kpiId;
......@@ -111,4 +112,7 @@ public class Kpi implements Serializable{
public void setIsActive(String isActive) {
this.isActive = isActive;
}
public String getCalCycle(){ return calCycle;}
public void setCalCycle(String calCycle) { this.calCycle = calCycle;}
}
......@@ -28,16 +28,16 @@ public class QualityRule {
private Long provinceId;//省份维表ID
private Long dataSourceId;//数据来源ID
private String kpiMonitorTime;//指标检测时间
private String kpiMonitorRunTime;
private String businessTime;//指标业务时间
private Date ruleCrtTime;//规则创建时间
private Date ruleUpdateTime;//规则更新时间
private Timestamp kpiMonitorRunTime;
private Timestamp businessTime;//指标业务时间
private Timestamp ruleCrtTime;//规则创建时间
private Timestamp ruleUpdateTime;//规则更新时间
private String ruleValidFlag;//规则是否有效
private String ifSystemValue;
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="QualityRuleSequence")
@SequenceGenerator(name = "QualityRuleSequence", sequenceName = "ccolap.quality_rule_deq", allocationSize=1)
@SequenceGenerator(name = "QualityRuleSequence", sequenceName = "ccolap.quality_rule_seq", allocationSize=1)
public Long getQualityRuleId() {
return qualityRuleId;
}
......@@ -80,28 +80,28 @@ public class QualityRule {
public void setKpiMonitorTime(String kpiMonitorTime) {
this.kpiMonitorTime = kpiMonitorTime;
}
public String getKpiMonitorRunTime() {
public Timestamp getKpiMonitorRunTime() {
return kpiMonitorRunTime;
}
public void setKpiMonitorRunTime(String kpiMonitorRunTime) {
public void setKpiMonitorRunTime(Timestamp kpiMonitorRunTime) {
this.kpiMonitorRunTime = kpiMonitorRunTime;
}
public String getBusinessTime() {
public Timestamp getBusinessTime() {
return businessTime;
}
public void setBusinessTime(String businessTime) {
public void setBusinessTime(Timestamp businessTime) {
this.businessTime = businessTime;
}
public Date getRuleCrtTime() {
public Timestamp getRuleCrtTime() {
return ruleCrtTime;
}
public void setRuleCrtTime(Date ruleCrtTime) {
public void setRuleCrtTime(Timestamp ruleCrtTime) {
this.ruleCrtTime = ruleCrtTime;
}
public Date getRuleUpdateTime() {
public Timestamp getRuleUpdateTime() {
return ruleUpdateTime;
}
public void setRuleUpdateTime(Date ruleUpdateTime) {
public void setRuleUpdateTime(Timestamp ruleUpdateTime) {
this.ruleUpdateTime = ruleUpdateTime;
}
public String getRuleValidFlag() {
......@@ -117,4 +117,22 @@ public class QualityRule {
this.ifSystemValue = ifSystemValue;
}
@Override
public String toString() {
return "QualityRule{" +
"qualityRuleId=" + qualityRuleId +
", businessId=" + businessId +
", kpiId=" + kpiId +
", channelId=" + channelId +
", provinceId=" + provinceId +
", dataSourceId=" + dataSourceId +
", kpiMonitorTime='" + kpiMonitorTime + '\'' +
", kpiMonitorRunTime='" + kpiMonitorRunTime + '\'' +
", businessTime=" + businessTime +
", ruleCrtTime=" + ruleCrtTime +
", ruleUpdateTime=" + ruleUpdateTime +
", ruleValidFlag='" + ruleValidFlag + '\'' +
", ifSystemValue='" + ifSystemValue + '\'' +
'}';
}
}
package com.hp.cmsz.entity;
import org.elasticsearch.cluster.metadata.MappingMetaData;
import javax.persistence.*;
import java.sql.Timestamp;
/**
* ccolap.quality_operation_detail_v视图对应的实体类
*
* @author Liu Na
*
*/
@Entity
@Table(name = "quality_operation_detail_v")
public class QualityRuleInfo {
private Long qualityRuleId;
private Long kpiId;
private Long businessId;
private Long channelId;
private Long dataSourceId;
private Long provinceId;
private Long qualityVerificationResultId;
private Timestamp kpiMonitorRunTime;
private Timestamp businessTime;
private String kpiName;
private String kpiCode;
private String businessName;
private String channelName;
private String dataSourceName;
private String provinceName;
private String warningType;
private Long ifFilter;
public Long getQualityRuleId() {
return qualityRuleId;
}
public void setQualityRuleId(Long qualityRuleId) {
this.qualityRuleId = qualityRuleId;
}
public Long getKpiId() {
return kpiId;
}
public void setKpiId(Long kpiId) {
this.kpiId = kpiId;
}
public Long getBusinessId() {
return businessId;
}
public void setBusinessId(Long businessId) {
this.businessId = businessId;
}
public Long getChannelId() {
return channelId;
}
public void setChannelId(Long channelId) {
this.channelId = channelId;
}
public Long getDataSourceId() {
return dataSourceId;
}
public void setDataSourceId(Long dataSourceId) {
this.dataSourceId = dataSourceId;
}
public Long getProvinceId() {
return provinceId;
}
public void setProvinceId(Long provinceId) {
this.provinceId = provinceId;
}
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public Long getQualityVerificationResultId() {
return qualityVerificationResultId;
}
public void setQualityVerificationResultId(Long qualityVerificationResultId) {
this.qualityVerificationResultId = qualityVerificationResultId;
}
public Timestamp getKpiMonitorRunTime() {
return kpiMonitorRunTime;
}
public void setKpiMonitorRunTime(Timestamp kpiMonitorRunTime) {
this.kpiMonitorRunTime = kpiMonitorRunTime;
}
public Timestamp getBusinessTime() {
return businessTime;
}
public void setBusinessTime(Timestamp businessTime) {
this.businessTime = businessTime;
}
public String getKpiName() {
return kpiName;
}
public void setKpiName(String kpiName) {
this.kpiName = kpiName;
}
public String getKpiCode() {
return kpiCode;
}
public void setKpiCode(String kpiCode) {
this.kpiCode = kpiCode;
}
public String getBusinessName() {
return businessName;
}
public void setBusinessName(String businessName) {
this.businessName = businessName;
}
public String getChannelName() {
return channelName;
}
public void setChannelName(String channelName) {
this.channelName = channelName;
}
public String getDataSourceName() {
return dataSourceName;
}
public void setDataSourceName(String dataSourceName) {
this.dataSourceName = dataSourceName;
}
public String getProvinceName() {
return provinceName;
}
public void setProvinceName(String provinceName) {
this.provinceName = provinceName;
}
public String getWarningType() {
return warningType;
}
public void setWarningType(String warningType) {
this.warningType = warningType;
}
public Long getIfFilter() {
return ifFilter;
}
public void setIfFilter(Long ifFilter) {
this.ifFilter = ifFilter;
}
@Override
public String toString() {
return "QualityRuleInfo{" +
"kpiId=" + kpiId +
", businessId=" + businessId +
", channelId=" + channelId +
", dataSourceId=" + dataSourceId +
", provinceId=" + provinceId +
", qualityVerificationResultId=" + qualityVerificationResultId +
", qualityRuleId=" + qualityRuleId +
", kpiMonitorRunTime=" + kpiMonitorRunTime +
", businessTime=" + businessTime +
", kpiName='" + kpiName + '\'' +
", kpiCode='" + kpiCode + '\'' +
", businessName='" + businessName + '\'' +
", channelName='" + channelName + '\'' +
", dataSourceName='" + dataSourceName + '\'' +
", provinceName='" + provinceName + '\'' +
", warningType='" + warningType + '\'' +
", ifFilter='" + ifFilter + '\'' +
'}';
}
}
package com.hp.cmsz.entity;
import javax.persistence.*;
import java.sql.Timestamp;
/**
* ccolap.quality_rule_detail_v视图对应的实体类
*
* @author Liu Na
*
*/
@Entity
@Table(name = "quality_rule_detail_v")
public class QualityRuleView {
private Long qualityRuleId;
private Long kpiId;
private Long businessId;
private Long channelId;
private Long dataSourceId;
private Long provinceId;
private String kpiMonitorTime;
private Timestamp businessTime;
private String kpiName;
private String kpiCode;
private String businessName;
private String channelName;
private String dataSourceName;
private String provinceName;
private String calCycle;
private String kpiTypeName;
public Long getKpiId() {
return kpiId;
}
public void setKpiId(Long kpiId) {
this.kpiId = kpiId;
}
public Long getBusinessId() {
return businessId;
}
public void setBusinessId(Long businessId) {
this.businessId = businessId;
}
public Long getChannelId() {
return channelId;
}
public void setChannelId(Long channelId) {
this.channelId = channelId;
}
public Long getDataSourceId() {
return dataSourceId;
}
public void setDataSourceId(Long dataSourceId) {
this.dataSourceId = dataSourceId;
}
public Long getProvinceId() {
return provinceId;
}
public void setProvinceId(Long provinceId) {
this.provinceId = provinceId;
}
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public Long getQualityRuleId() {
return qualityRuleId;
}
public void setQualityRuleId(Long qualityRuleId) {
this.qualityRuleId = qualityRuleId;
}
public String getKpiMonitorTime() {
return kpiMonitorTime;
}
public void setKpiMonitorTime(String kpiMonitorTime) {
this.kpiMonitorTime = kpiMonitorTime;
}
public Timestamp getBusinessTime() {
return businessTime;
}
public void setBusinessTime(Timestamp businessTime) {
this.businessTime = businessTime;
}
public String getKpiName() {
return kpiName;
}
public void setKpiName(String kpiName) {
this.kpiName = kpiName;
}
public String getKpiCode() {
return kpiCode;
}
public void setKpiCode(String kpiCode) {
this.kpiCode = kpiCode;
}
public String getBusinessName() {
return businessName;
}
public void setBusinessName(String businessName) {
this.businessName = businessName;
}
public String getChannelName() {
return channelName;
}
public void setChannelName(String channelName) {
this.channelName = channelName;
}
public String getDataSourceName() {
return dataSourceName;
}
public void setDataSourceName(String dataSourceName) {
this.dataSourceName = dataSourceName;
}
public String getProvinceName() {
return provinceName;
}
public void setProvinceName(String provinceName) {
this.provinceName = provinceName;
}
public String getCalCycle() {
return calCycle;
}
public void setCalCycle(String calCycle) {
this.calCycle = calCycle;
}
public String getKpiTypeName() {
return kpiTypeName;
}
public void setKpiTypeName(String kpiTypeName) {
this.kpiTypeName = kpiTypeName;
}
@Override
public String toString() {
return "QualityRuleView{" +
"kpiId=" + kpiId +
", businessId=" + businessId +
", channelId=" + channelId +
", dataSourceId=" + dataSourceId +
", provinceId=" + provinceId +
", qualityRuleId=" + qualityRuleId +
", kpiMonitorTime='" + kpiMonitorTime + '\'' +
", businessTime=" + businessTime +
", kpiName='" + kpiName + '\'' +
", kpiCode='" + kpiCode + '\'' +
", businessName='" + businessName + '\'' +
", channelName='" + channelName + '\'' +
", dataSourceName='" + dataSourceName + '\'' +
", provinceName='" + provinceName + '\'' +
", calCycle='" + calCycle + '\'' +
", kpiTypeName='" + kpiTypeName + '\'' +
'}';
}
}
package com.hp.cmsz.entity.commonmanage;
import javax.persistence.*;
import java.sql.Timestamp;
@Entity
@Table(name = "APP_EWARNING_CALC_RESULT_T", schema = "ETL")
public class EWarningCalcResult {
private Long ewarningDataresultId;
private Timestamp resultDate;
private Long dim1Val;
private Long dim2Val;
private Long ewarningDetailId;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "EWarningCalcResultSequence")
@SequenceGenerator(name = "EWarningCalcResultSequence", sequenceName = "SEQ_APP_EWARNING_CALC_RESULT", allocationSize = 1)
public Long getEwarningDataresultId() {
return ewarningDataresultId;
}
public void setEwarningDataresultId(Long ewarningDataresultId) {
this.ewarningDataresultId = ewarningDataresultId;
}
public Timestamp getResultDate() {
return resultDate;
}
public void setResultDate(Timestamp resultDate) {
this.resultDate = resultDate;
}
@Column(name = "dim1_val")
public Long getDim1Val() {
return dim1Val;
}
public void setDim1Val(Long dim1Val) {
this.dim1Val = dim1Val;
}
@Column(name = "dim2_val")
public Long getDim2Val() {
return dim2Val;
}
public void setDim2Val(Long dim2Val) {
this.dim2Val = dim2Val;
}
public Long getEwarningDetailId() {
return ewarningDetailId;
}
public void setEwarningDetailId(Long ewarningDetailId) {
this.ewarningDetailId = ewarningDetailId;
}
}
......@@ -53,21 +53,21 @@ public class RunTask {
@JoinColumn(name = "province_id")
private Province provinceView;
private Long kpiId;
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "kpi_id")
private DimKpi dimKpiView;
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "channel_id")
private Channel channelView;
// @ManyToOne(fetch = FetchType.EAGER)
// @JoinColumn(name = "channel_id")
// private Channel channelView;
//
// @ManyToOne(fetch = FetchType.EAGER)
// @JoinColumn(name = "dataSource_id")
// private DataSource dataSourceView;
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "data_source_id")
private DataSource dataSourceView;
// @ManyToOne(fetch = FetchType.EAGER)
// @JoinColumn(name = "business_id")
// private Business businessView;
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "business_id")
private Business businessView;
@Temporal(TemporalType.TIMESTAMP)
......@@ -204,37 +204,38 @@ public class RunTask {
this.provinceView = provinceView;
}
public Long getKpiId() {
return kpiId;
}
public void setKpiId(Long kpiId) {
this.kpiId = kpiId;
}
// public Channel getChannelView() {
// return channelView;
// }
//
// public void setChannelView(Channel channelView) {
// this.channelView = channelView;
// }
//
// public DataSource getDataSourceView() {
// return dataSourceView;
// }
//
// public void setDataSourceView(DataSource dataSourceView) {
// this.dataSourceView = dataSourceView;
// }
//
// public Business getBusinessView() {
// return businessView;
// }
//
// public void setBusinessView(Business businessView) {
// this.businessView = businessView;
// }
public DimKpi getDimKpiView() {
return dimKpiView;
}
public void setDimKpiView(DimKpi dimKpiView) {
this.dimKpiView = dimKpiView;
}
public Channel getChannelView() {
return channelView;
}
public void setChannelView(Channel channelView) {
this.channelView = channelView;
}
public DataSource getDataSourceView() {
return dataSourceView;
}
public void setDataSourceView(DataSource dataSourceView) {
this.dataSourceView = dataSourceView;
}
public Business getBusinessView() {
return businessView;
}
public void setBusinessView(Business businessView) {
this.businessView = businessView;
}
/*public String getParallelFlg() {
return parallelFlg;
}
......
......@@ -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")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);
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
......
......@@ -12,7 +12,10 @@ import org.springframework.data.repository.query.Param;
import com.hp.cmsz.entity.DimKpi;
public interface DimKpiDao extends JpaSpecificationExecutor<DimKpi>,
PagingAndSortingRepository<DimKpi, Long>{
PagingAndSortingRepository<DimKpi, Long>{
List<DimKpi> findAllByIsActiveAndBusnameId(String active,Long businessId);
//通过kpiTypeId查找数据采集频率
@Query("select dk.calCycle from DimKpi dk where dk.kpiTypeId = :kpiTypeId")
......
......@@ -26,9 +26,15 @@ public interface KpiDao extends JpaSpecificationExecutor<Kpi>,PagingAndSortingRe
List<Kpi> findByBusinessIdIn(List<Long> businessIdList);
List<Kpi> findByBusinessIdIn(Collection<Long> businessIdList);
@Query("select kpi.kpiName, kpi.kpiCode from Kpi kpi where kpi.kpiId = :kpiId")
List<Kpi> findKpiCodeAndKpiNameByKpiId(@Param("kpiId") Long kpiId);
List<Kpi> findAllByIsActive(String active);
@Query("select kpi.kpiId, kpi.kpiName from Kpi kpi where kpi.kpiId >=0")
List<Object[]> findAllKpiIdAndKpiName();
//由指标名得到指标周期类型
@Query("select kpiCycleType.isHourKpi from Kpi kpi,KpiCycleType kpiCycleType where kpi.kpiCycleTypeId=kpiCycleType.kpiCycleTypeId and kpi.kpiName IN (:kpiName) and kpi.kpiId >=0")
List<Object[]> findKpiCycleTypeByKpiName(@Param("kpiName") String kpiName);
......@@ -38,9 +44,9 @@ public interface KpiDao extends JpaSpecificationExecutor<Kpi>,PagingAndSortingRe
@Query("select kpi.kpiId, kpi.kpiName from Kpi kpi,Business business where kpi.businessId=business.businessId and business.businessId IN (:businessIdList) and kpi.kpiId >=0")
List<Object[]> findAllKpiIdAndKpiNameByBusinessId(@Param("businessIdList") List<Long> businessIdList);
//由业务联动得到指标
@Query("select kpi.kpiId, kpi.kpiName from Kpi kpi,Business business where business.businessId = kpi.businessId and kpi.isActive = 'Y' and business.businessId in (:businessIds) and kpi.kpiId>=0 order by kpi.kpiId ")
List<Object[]> findKpiIdAndKpiNameByBusinessIds(@Param("businessIds")List<Long> businessIdList);
//由业务,采集频率联动得到指标
@Query("select kpi.kpiId, kpi.kpiName from Kpi kpi,Business business where business.businessId = kpi.businessId and kpi.isActive = 'Y' and kpi.calCycle=:calCycleValue and business.businessId in (:businessIds) and kpi.kpiId>=0 order by kpi.kpiId ")
List<Object[]> findKpiIdAndKpiNameByBusinessIds(@Param("businessIds")List<Long> businessIdList, @Param("calCycleValue") String calCycleValue);
//由单个业务ID得到指标
@Query("select kpi.kpiId, kpi.kpiName from Kpi kpi,Business business where kpi.businessId=business.businessId and business.businessId = :businessIdList and kpi.kpiId >=0")
......
......@@ -34,6 +34,11 @@ public interface ModelParameterDao extends JpaSpecificationExecutor<ModelParamet
//根据数据模型ID查找系统默认的参数d
List<ModelParameter> findByDataModelIdAndIfSystemDefault(Long dataModelId, Long ifSystemDefault);
//根据任务ID查找系统默认的参数d
List<ModelParameter> findByTaskIdAndIfSystemDefault(Long taskId, Long ifSystemDefault);
//根据数据模型ID查找参数d
List<ModelParameter> findByDataModelIdIn(List<Long> dataModelId);
......
......@@ -4,6 +4,7 @@ package com.hp.cmsz.repository;
import java.util.Date;
import java.util.List;
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;
......@@ -22,6 +23,7 @@ public interface ProvinceDao extends JpaSpecificationExecutor<Province>,
List<Province> findByProvinceIdIn(List<Long> provinceIds);
List<Province> findByProvinceId(Long provinceId);
@Query("from Province p where p.provinceId>=0 order by p.provinceId")
List<Province> findProvince();
......
......@@ -21,8 +21,6 @@ import com.hp.cmsz.entity.QualityRule;
public interface QualityRuleDao extends JpaSpecificationExecutor<QualityRule>,
PagingAndSortingRepository<QualityRule, Long>{
//根据质量规则ID查找质量规则
QualityRule findByQualityRuleId(Long qualityRuleId);
......@@ -37,13 +35,12 @@ public interface QualityRuleDao extends JpaSpecificationExecutor<QualityRule>,
//根据质量规则ID修改质量规则
@Modifying
@Query("update from QualityRule qr set qr.businessId=:businessId, qr.kpiId=:kpiId, qr.channelId=:channelId, qr.provinceId=:provinceId, qr.dataSourceId=:dataSourceId, qr.kpiMonitorTime=:kpiMonitorTime, qr.kpiMonitorRunTime=:kpiMonitorRunTime, qr.businessTime=:businessTime, qr.ruleCrtTime=:ruleCrtTime, qr.ruleUpdateTime=:ruleUpdateTime where qr.qualityRuleId=:qualityRuleId")
void updateQualityRuleByQualityRuleId(@Param("businessId")Long businessId,@Param("kpiId")Long kpiId,@Param("channelId")Long channelId,@Param("provinceId")Long provinceId,@Param("dataSourceId")Long dataSourceId,@Param("kpiMonitorTime")String kpiMonitorTime,@Param("kpiMonitorRunTime")String kpiMonitorRunTime,@Param("businessTime")String businessTime,@Param("ruleCrtTime")Date ruleCrtTime,@Param("ruleUpdateTime")Date ruleUpdateTime,@Param("qualityRuleId")Long qualityRuleId);
void updateQualityRuleByQualityRuleId(@Param("businessId")Long businessId,@Param("kpiId")Long kpiId,@Param("channelId")Long channelId,@Param("provinceId")Long provinceId,@Param("dataSourceId")Long dataSourceId,@Param("kpiMonitorTime")String kpiMonitorTime,@Param("kpiMonitorRunTime")Timestamp kpiMonitorRunTime,@Param("businessTime")Timestamp businessTime,@Param("ruleCrtTime")Timestamp ruleCrtTime,@Param("ruleUpdateTime")Timestamp ruleUpdateTime,@Param("qualityRuleId")Long qualityRuleId);
//根据质量规则ID得到数据条数
@Query("select count(*) from QualityRule qualityRule where qualityRule.qualityRuleId=:qualityRuleId")
Long getNumOfQualityRuleByQualityRuleId(@Param("qualityRuleId")String qualityRuleId);
//根据省份、渠道、业务、数据来源筛选查询质量规则
List<QualityRule> findByProvinceIdInAndBusinessIdInAndDataSourceIdInAndChannelIdInOrderByQualityRuleIdDesc(Long[] province, Long[] business, Long[] datasource, Long[] channel);
}
package com.hp.cmsz.repository;
import com.hp.cmsz.entity.QualityRuleInfo;
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;
public interface QualityRuleInfoDao extends JpaSpecificationExecutor<QualityRuleInfo>,
PagingAndSortingRepository<QualityRuleInfo, Long> {
@Query("from QualityRuleInfo qualityRuleInfo where qualityRuleInfo.businessTime between timestampadd(M,-1,getdate()) and getdate() order by qualityRuleInfo.businessTime Desc")
List<QualityRuleInfo> findQualityRuleInfo();
//根据筛选项查找
List<QualityRuleInfo> findByBusinessTimeBetweenAndDataSourceIdInAndChannelIdInAndBusinessIdInAndProvinceIdInAndIfFilterInOrderByBusinessTimeDesc(Timestamp time1, Timestamp time2, List<Long> dataSource, List<Long> chnnal, List<Long> busines, List<Long> province, List<Long> ifFilter);
}
package com.hp.cmsz.repository;
import com.hp.cmsz.entity.QualityRuleView;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
public interface QualityRuleViewDao extends JpaSpecificationExecutor<QualityRuleView>,
PagingAndSortingRepository<QualityRuleView, Long> {
//根据筛选项得到质量规则
List<QualityRuleView> findByDataSourceIdInAndChannelIdInAndBusinessIdInAndProvinceIdInOrderByQualityRuleIdAscBusinessTimeDesc(List<Long> dataSource,List<Long> chnnal,List<Long> busines,List<Long>province);
}
package com.hp.cmsz.repository.commonmanage;
import com.hp.cmsz.entity.APPEWarningDetail;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
public interface APPEWarningDetailDao extends PagingAndSortingRepository<APPEWarningDetail,
Long>, JpaSpecificationExecutor<APPEWarningDetail> {
APPEWarningDetail findByEwarningDetailId(Long id);
}
package com.hp.cmsz.repository.commonmanage;
import com.hp.cmsz.entity.commonmanage.EWarningCalcResult;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
public interface EWarningCalcResultDao extends PagingAndSortingRepository<EWarningCalcResult, Long>,
JpaSpecificationExecutor<EWarningCalcResult> {
List<EWarningCalcResult> findByEwarningDetailId(Long id);
}
......@@ -29,7 +29,7 @@ public class AccuracyRuleService {
//根据准确性规则ID更新准确性规则
@Transactional(readOnly=false)
public void updateAccuracyRuleByAccuracyRuleId(String ruleType,double scopeMaxValue,double 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);
}
......
package com.hp.cmsz.service.analysissupport;
import com.hp.cmsz.entity.DimKpi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.hp.cmsz.repository.DimKpiDao;
import java.util.List;
@Service
@Transactional
public class DimKpiService {
......@@ -18,4 +21,9 @@ public class DimKpiService {
private void updateByKpiTypeId(String calCycle,Long kpiTypeId){
dimKpiDao.updateDimKpiByKpiTypeId(calCycle, kpiTypeId);
}
//查出active为Y的所以KPI指标
public List<DimKpi> findAllByIsActiveAAndBusnameId(Long businessId){
return dimKpiDao.findAllByIsActiveAndBusnameId("Y",businessId);
}
}
package com.hp.cmsz.service.analysissupport;
import com.hp.cmsz.entity.FilterRule;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.persistence.*;
import java.util.List;
/**
*
* @author Liu Na
......@@ -12,4 +16,22 @@ import org.springframework.transaction.annotation.Transactional;
@Transactional
public class FilterRuleService {
@PersistenceContext
protected EntityManager em;
@Transactional
public void insertIntoRule(List<FilterRule> filterRules){
long begin = System.currentTimeMillis();
for (int i = 0; i < filterRules.size(); i++) {
em.persist(filterRules.get(i));
if (i % 100 == 0) {
em.flush();
em.clear();
}
}
long end = System.currentTimeMillis();
System.out.println((end-begin)/1000.0);
}
}
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;
@Service
@Transactional
public class QualityRuleInfoService {
@Autowired
private QualityRuleInfoDao qualityRuleInfoDao;
public List<QualityRuleInfo> getQualityRuleInfoByLastMonth(){
return qualityRuleInfoDao.findQualityRuleInfo();
}
//根据筛选项获取质量规则
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);
}
}
package com.hp.cmsz.service.analysissupport;
import java.sql.Timestamp;
import java.util.Date;
import java.util.List;
import com.hp.cmsz.repository.QualityRuleDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.hp.cmsz.entity.QualityRule;
import com.hp.cmsz.repository.QualityRuleDao;
import java.sql.Timestamp;
import java.util.List;
/**
*
......@@ -23,11 +20,6 @@ public class QualityRuleService {
@Autowired
private QualityRuleDao qualityRuleDao;
//根据筛选条件查询出质量规则
public List<QualityRule> getAllQualityRuleByOther(Long[] province,Long[] datasource,Long[] channel,Long[] business){
return qualityRuleDao.findByProvinceIdInAndBusinessIdInAndDataSourceIdInAndChannelIdInOrderByQualityRuleIdDesc(province, business, datasource, channel);
}
//根据质量规则ID删除质量规则
@Transactional(readOnly=false)
public void deleteByQualityRuleId(List<Long> qualityRuleId){
......@@ -36,8 +28,7 @@ public class QualityRuleService {
//根据质量规则ID修改质量规则
@Transactional(readOnly=false)
public void updateByQualityRuleId(Long businessId, Long kpiId, Long channelId, Long provinceId, Long dataSourceId, String kpiMonitorTime,String kpiMonitorRunTime,String businessTime,Date ruleCrtTime,Date ruleUpdateTime,Long qualityRuleId){
qualityRuleDao.updateQualityRuleByQualityRuleId(businessId, kpiId, channelId, provinceId, dataSourceId, kpiMonitorTime, kpiMonitorRunTime, businessTime, ruleCrtTime, ruleUpdateTime, qualityRuleId);
public void updateByQualityRuleId(Long businessId,Long kpiId,Long channelId,Long provinceId,Long dataSourceId,String kpiMonitorTime,Timestamp kpiMonitorRunTime,Timestamp businessTime,Timestamp ruleCrtTime,Timestamp ruleUpdateTime,Long qualityRuleId){
qualityRuleDao.updateQualityRuleByQualityRuleId(businessId,kpiId,channelId,provinceId,dataSourceId,kpiMonitorTime,kpiMonitorRunTime,businessTime,ruleCrtTime,ruleUpdateTime,qualityRuleId);
}
}
package com.hp.cmsz.service.analysissupport;
import com.hp.cmsz.entity.QualityRuleView;
import com.hp.cmsz.repository.QualityRuleViewDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@Service
@Transactional
public class QualityRuleViewService {
@Autowired
private QualityRuleViewDao qualityRuleViewDao;
//根据筛选项得到质量规则
public List<QualityRuleView> getQualityRuleViewBy(List<Long> dataSource, List<Long> chnnal, List<Long> busines, List<Long>province){
return qualityRuleViewDao.findByDataSourceIdInAndChannelIdInAndBusinessIdInAndProvinceIdInOrderByQualityRuleIdAscBusinessTimeDesc(dataSource,chnnal,busines,province);
}
}
......@@ -194,6 +194,7 @@ public class PageURLController {
public static String FilterResult = "AnalysisSupport/FilterRuleResult";
public static String FilterMaintain = "AnalysisSupport/FilterRuleMaintain";
public static String FilterConfiguration = "AnalysisSupport/FilterRuleConfiguration";
public static String RuleOperation = "AnalysisSupport/QualityRuleOperation";
//基础管理
//AuthorityManage映射到WEB-INF/views下的AuthorityManage/AuthorityManage.jsp页面
......
package com.hp.cmsz.web.analysissupport;
import java.util.Map;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.*;
import com.google.gson.Gson;
import com.hp.cmsz.entity.*;
import com.hp.cmsz.repository.*;
import com.hp.cmsz.service.BusinessService;
import com.hp.cmsz.service.analysissupport.FilterRuleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.*;
import com.hp.cmsz.web.PageURLController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* 质量规则维护的新增过滤规则控制类
*
......@@ -18,9 +29,129 @@ 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;
@Autowired
private FilterRuleDao filterRuleDao;
@Autowired
private FilterRuleService filterRuleService;
@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.findAllByIsActive("Y");
//查询出所有的业务
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;
}
@RequestMapping(value = "/createRule",method = RequestMethod.POST)
public void createRule(
@RequestParam(value="province") String province,
@RequestParam(value="dataSource") String dataSource,
@RequestParam(value="channel") String channel,
@RequestParam(value="businessinput") String businessinput,
@RequestParam(value="kpiinput") String kpiinput,
@RequestParam(value="filterStartTime") String filterStartTime,
@RequestParam(value="filterEndTime") String filterEndTime,
@RequestParam(value="ifRepeate") String ifRepeate,
@RequestParam(value="cycle", required=false) String cycle,
@RequestParam(value="cycleUnit", required=false) String cycleUnit,
@RequestParam(value="filterReason") String filterReason,
HttpServletRequest request, HttpServletResponse response){
//查询出所有的数据来源
List<DataSource> dataSourceList=(List<DataSource>)dataSourceDao.findAll();
ifRepeate = ifRepeate.equals("0")?"1":"0";
String [] kpiArr = kpiinput.split(",");
String [] provinceArr = province.split(",");
List<FilterRule> filterRules = new ArrayList<FilterRule>();
for (String p : provinceArr) {
for (String s : kpiArr) {
FilterRule filterRule = new FilterRule();
filterRule.setKpiId(Long.parseLong(s));
filterRule.setFilteringEndTime(Timestamp.valueOf(filterEndTime));
filterRule.setFilteringStartTime(Timestamp.valueOf(filterStartTime));
filterRule.setProvinceId(Long.parseLong(p));
filterRule.setIfRepeat(ifRepeate);
filterRule.setFilteringType("1");
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
filterRule.setRuleCrtTime(Timestamp.valueOf(df.format(new Date())));
filterRule.setRuleUpdateTime(Timestamp.valueOf(df.format(new Date())));
filterRule.setValidFlag("1");
filterRule.setFilteringReason(filterReason);
if("1".equals(ifRepeate)){
if ("0".equals(cycleUnit)) {
filterRule.setFrequency(cycle+"/1440");
}else if ("1".equals(cycleUnit)) {
filterRule.setFrequency(cycle+"/24");
}else if ("2".equals(cycleUnit)) {
filterRule.setFrequency(cycle);
}else if ("3".equals(cycleUnit)) {
filterRule.setFrequency("ADD_MONTH("+cycle+")");
}
}
filterRules.add(filterRule);
}
}
// filterRuleService.insertIntoRule(filterRules);
}
}
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;
import org.springframework.web.bind.annotation.RequestParam;
......@@ -19,11 +25,67 @@ import com.hp.cmsz.web.PageURLController;
@RequestMapping(value="AnalysisSupport/FilterRuleResult")
public class FilterRuleResultController {
@Autowired
private FilterRuleDao filterRuleDao;
@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 ruleResultHome(
@RequestParam(value = "rulePageNum", defaultValue="1") String rulePageNum,
Map model){
List<FilterRule> FilterRuleList = (List<FilterRule>) filterRuleDao.findAll();
Gson gson = new Gson();
//查询出所有的省份
List<Province> provinceList=(List<Province>)provinceDao.findProvince();
//查询出所有的渠道信息
List<Channel> channelList=(List<Channel>)channelDao.findChannel();
//查询出所有的指标
List<Kpi> kpiList=(List<Kpi>)kpiDao.findAllByIsActive("Y");
//查询出所有的业务
List<Business> businessList=(List<Business>)businessDao.findAllBusiness();
//查询出所有的数据类型
List<DataType> dataTypeList= (List<DataType>)dataTypeDao.findAll();
//查询出所有的数据来源
List<DataSource> dataSourceList=(List<DataSource>)dataSourceDao.findAll();
List<ChannelDataSourceMap> channelDataSourceMapList = (List<ChannelDataSourceMap>) channelDataSourceMapDao.findAll();
model.put("channelDataSourceMapList", channelDataSourceMapList);
model.put("provinceList", provinceList);
model.put("channelList", channelList);
model.put("kpiList", kpiList);
model.put("businessList", businessList);
model.put("dataTypeList", dataTypeList);
model.put("dataSourceList", dataSourceList);
model.put("filterRuleViewList", gson.toJson(FilterRuleList));
return PageURLController.FilterResult;
}
......
package com.hp.cmsz.web.analysissupport;
import com.google.gson.Gson;
import com.hp.cmsz.entity.*;
import com.hp.cmsz.repository.DataSourceDao;
import com.hp.cmsz.repository.KpiDao;
import com.hp.cmsz.repository.ProvinceDao;
import com.hp.cmsz.service.BusinessService;
import com.hp.cmsz.service.ChannelService;
import com.hp.cmsz.service.CmszOperationLogService;
import com.hp.cmsz.service.analysissupport.QualityRuleInfoService;
import com.hp.cmsz.web.PageURLController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
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;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* 数据质量核查中的质量规则运营结果控制类
*
* @author Liu Na
*
*/
@Controller
@RequestMapping(value="AnalysisSupport/QualityRuleOperation")
public class QualityRuleOperationController {
@Autowired
private ProvinceDao provinceDao;
@Autowired
private ChannelService channelService;
@Autowired
private BusinessService businessService;
@Autowired
private KpiDao kpiDao;
@Autowired
private DataSourceDao dataSourceDao;
@Autowired
private QualityRuleInfoService qualityRuleInfoService;
@Autowired
private CmszOperationLogService cmszOperationLogService;
@RequestMapping(value = "")
public String ruleResultHome(
@RequestParam(value = "rulePageNum", defaultValue="1") String rulePageNum,
Map model){
List<QualityRuleInfo> qualityRuleInfoList = new ArrayList<QualityRuleInfo>();
//查询出所有省份的信息
List<Province> provinceList=(List<Province>)provinceDao.findAll();
//查询出所有的渠道信息
//List<Channel> channelList=(List<Channel>)channelDao.findChannel();
List<Channel> channelList = channelService.getAllChannels();
//查询出所有的指标
List<Kpi> kpiList=(List<Kpi>)kpiDao.findAll();
//查询出所有的业务
List<String> businessList=businessService.getAllBusinessIdAndBusinessName();
//查询出所有的数据来源信息
List<DataSource> datasourceList=dataSourceDao.findDataSource();
//查询出所有的运营质量规则
qualityRuleInfoList = qualityRuleInfoService.getQualityRuleInfoByLastMonth();
Gson gson = new Gson();
model.put("provinceList", provinceList);
model.put("channelList", channelList);
model.put("kpiList", kpiList);
model.put("businessList",businessList);
model.put("datasourceList", datasourceList);
model.put("qualityRuleInfoList", gson.toJson(qualityRuleInfoList));
model.put("rulePageNum", rulePageNum);
cmszOperationLogService.createLog("查询","质量规则运营","质量规则运营首页");
return PageURLController.RuleOperation;
}
//根据筛选项搜索
@RequestMapping(value = "/operationChangeTable*", method = RequestMethod.GET)
@ResponseBody
public void changeTable(@RequestParam(value = "period") String period,// 时间
@RequestParam(value = "dataSource") String dataSource,// 数据来源
@RequestParam(value = "chnnal") String chnnal,//渠道
@RequestParam(value = "bussines") String bussines,//业务
@RequestParam(value = "province") String province,//省份
@RequestParam(value = "ifFilter") String ifFilter,//是否过滤
HttpServletResponse response) throws ParseException, UnsupportedEncodingException {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
cmszOperationLogService.createLog("查询","质量规则运营查询","质量规则运营页面查询");
List<QualityRuleInfo> qualityRuleInfoList;
String[] dates=period.split("~");
String[] dataSourceS=dataSource.split(",");
String[] chnnalS=chnnal.split(",");
String[] bussinesS =bussines.split(",");
String[] provinceS=province.split(",");
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("time:"+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");
PrintWriter out = null;
try {
out = response.getWriter();
out.println(gson.toJson(qualityRuleInfoList));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
//将string数据类型转换成List<Long>类型
public List<Long> changeStrToList(String[] str){
List<Long> list = new ArrayList<Long>();
for(int i=0;i<str.length;i++){
list.add(Long.parseLong(str[i]));
}
return list;
}
}
......@@ -9,6 +9,10 @@ import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import com.hp.cmsz.entity.*;
import com.hp.cmsz.repository.*;
import com.hp.cmsz.service.analysissupport.QualityRuleService;
import com.hp.cmsz.service.analysissupport.QualityRuleViewService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -17,22 +21,10 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.google.gson.Gson;
import com.hp.cmsz.entity.AccuracyRule;
import com.hp.cmsz.entity.Channel;
import com.hp.cmsz.entity.DataSource;
import com.hp.cmsz.entity.Kpi;
import com.hp.cmsz.entity.Province;
import com.hp.cmsz.entity.QualityRule;
import com.hp.cmsz.repository.AccuracyRuleDao;
import com.hp.cmsz.repository.DataSourceDao;
import com.hp.cmsz.repository.KpiDao;
import com.hp.cmsz.repository.ProvinceDao;
import com.hp.cmsz.repository.QualityRuleDao;
import com.hp.cmsz.service.BusinessService;
import com.hp.cmsz.service.ChannelService;
import com.hp.cmsz.service.CmszOperationLogService;
import com.hp.cmsz.service.analysissupport.AccuracyRuleService;
import com.hp.cmsz.service.analysissupport.QualityRuleService;
import com.hp.cmsz.web.PageURLController;
/**
......@@ -68,6 +60,12 @@ public class QualityRuleResultController {
private QualityRuleService qualityRuleService;
@Autowired
private QualityRuleViewDao qualityRuleViewDao;
@Autowired
private QualityRuleViewService qualityRuleViewService;
@Autowired
private AccuracyRuleService accuracyRuleService;
@Autowired
......@@ -93,17 +91,17 @@ public class QualityRuleResultController {
//查询出所有的业务
List<String> businessList=businessService.getAllBusinessIdAndBusinessName();
//查询出所有的数据来源信息
List<DataSource> datasourceList=(List<DataSource>)dataSourceDao.findDataSource();
//查询出所有质量规则
List<QualityRule> qualityRuleList=(List<QualityRule>)qualityRuleDao.findAll();
List<DataSource> datasourceList=dataSourceDao.findDataSource();
//查询出所有质量规则
List<QualityRuleView> qualityRuleViewList= (List<QualityRuleView>) qualityRuleViewDao.findAll();
Gson gson = new Gson();
model.put("provinceList", gson.toJson(provinceList));
model.put("provinceList", provinceList);
model.put("channelList", channelList);
model.put("kpiList", kpiList);
model.put("businessList",businessList);
model.put("datasourceList", datasourceList);
model.put("qualityRuleList", qualityRuleList);
model.put("qualityRuleViewList", gson.toJson(qualityRuleViewList));
model.put("rulePageNum", rulePageNum);
cmszOperationLogService.createLog("查询","质量规则","质量规则首页");
......@@ -114,55 +112,30 @@ public class QualityRuleResultController {
@RequestMapping(value = "/ruleTableChange*",method = RequestMethod.GET)
@ResponseBody
public void modelTableChange(
@RequestParam(value = "province", defaultValue="") String province,
@RequestParam(value = "channel", defaultValue="") String channel,
@RequestParam(value = "datasource", defaultValue="") String datasource,
@RequestParam(value = "business", defaultValue="") String business,
@RequestParam(value = "dataSource") String dataSource,// 数据来源
@RequestParam(value = "chnnal") String chnnal,//渠道
@RequestParam(value = "bussines") String bussines,//业务
@RequestParam(value = "province") String province,//省份
HttpServletResponse response) throws UnsupportedEncodingException{
cmszOperationLogService.createLog("查询","质量规则","由筛选项得到质量规则");
List<QualityRule> qualityRuleS;
//将String型转换成List
String[] channels=channel.split(",");
int size1=channels.length;
Long[] channelS=new Long[size1];
for(int i=0;i<channels.length;i++)
{
channelS[i]=Long.parseLong(channels[i]);
}
//将String型转换成List
String[] dataSources=datasource.split(",");
int size2=dataSources.length;
Long[] dataSourceS=new Long[size2];
for(int i=0;i<dataSources.length;i++)
{
dataSourceS[i]=Long.parseLong(dataSources[i]);
}
//将String型转换成List
String[] businesss=business.split(",");
int size3=dataSources.length;
Long[] businessS=new Long[size3];
for(int i=0;i<businesss.length;i++)
{
businessS[i]=Long.parseLong(businesss[i]);
}
//将String型转换成List
String[] provinces=province.split(",");
int size4=dataSources.length;
Long[] provinceS=new Long[size4];
for(int i=0;i<provinces.length;i++)
{
provinceS[i]=Long.parseLong(provinces[i]);
}
qualityRuleS=qualityRuleService.getAllQualityRuleByOther(provinceS, dataSourceS, channelS, businessS);
List<QualityRuleView> qualityRuleViewList;
String[] dataSourceS=dataSource.split(",");
String[] chnnalS=chnnal.split(",");
String[] bussinesS =bussines.split(",");
String[] provinceS=province.split(",");
List<Long> dataSourceList=changeStrToList(dataSourceS);
List<Long> chnnalList=changeStrToList(chnnalS);
List<Long> bussinesList=changeStrToList(bussinesS);
List<Long> provinceList=changeStrToList(provinceS);
qualityRuleViewList = qualityRuleViewService.getQualityRuleViewBy(dataSourceList,chnnalList,bussinesList,provinceList);
Gson gson = new Gson();
response.setContentType("text/Xml;charset=gbk");
PrintWriter out = null;
try {
out = response.getWriter();
out.println(gson.toJson(qualityRuleS));
out.println(gson.toJson(qualityRuleViewList));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
......@@ -170,6 +143,16 @@ public class QualityRuleResultController {
}
//将string数据类型转换成List<Long>类型
public List<Long> changeStrToList(String[] str){
List<Long> list = new ArrayList<Long>();
for(int i=0;i<str.length;i++){
list.add(Long.parseLong(str[i]));
}
return list;
}
//删掉质量规则
@RequestMapping(value = "/deleteOneRule*",method = RequestMethod.GET)
@ResponseBody
......@@ -203,7 +186,7 @@ public class QualityRuleResultController {
}
//查看准确性规则内容
@RequestMapping(value = "/findAccuracy*",method = RequestMethod.GET)
@RequestMapping(value = "/findAccuracy*")
@ResponseBody
public void findAccuracy(
@RequestParam(value = "qualityRuleId") String qualityRuleId,
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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