Commit 50f4355d authored by 莫林毅's avatar 莫林毅

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

parents 1ad6ab05 009b18e1
...@@ -12,7 +12,7 @@ local.ip.prefix=192.168 ...@@ -12,7 +12,7 @@ local.ip.prefix=192.168
#jdbc.driver=com.vertica.jdbc.Driver #jdbc.driver=com.vertica.jdbc.Driver
#vertica database ip address #vertica database ip address
jdbc.dbip=192.168.113.117 jdbc.dbip=hg-computer
jdbc.dbport=5433 jdbc.dbport=5433
......
//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;
//
//
//
//}
...@@ -38,7 +38,7 @@ public class AccuracyRule implements Serializable { ...@@ -38,7 +38,7 @@ public class AccuracyRule implements Serializable {
@Id @Id
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="AccuracyRuleSequence") @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="AccuracyRuleSequence")
@SequenceGenerator(name = "AccuracyRuleSequence", sequenceName = "accuracy_rule_info_t_seq", allocationSize=1) @SequenceGenerator(name = "AccuracyRuleSequence", sequenceName = "ccolap.accuracy_rule_seq", allocationSize=1)
public Long getAccuracyRuleId() { public Long getAccuracyRuleId() {
return accuracyRuleId; return accuracyRuleId;
......
...@@ -17,7 +17,7 @@ import javax.persistence.Table; ...@@ -17,7 +17,7 @@ import javax.persistence.Table;
* *
*/ */
@Entity @Entity
@Table(name = "dim_business_info_t") @Table(name = "dim_business_info_t",schema="ccolap")
public class Business implements Serializable{ public class Business implements Serializable{
private Long businessId ;//业务ID private Long businessId ;//业务ID
......
package com.hp.cmsz.entity;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
/**
* dim_kpi_t表对应的实体类
*
* @author Ma Wenmeng
*
*/
@Entity
@Table(name = "etl.dim_kpi_t")
public class DimKpi implements Serializable{
/**
*
*/
private Long kpiId;
private String code;
private String name;
private Long busnameId;
private Date crtTime;
private String crtUser;
private String currentVersion;
private Date invalidTime;
private Long origKpiId;
private Long kpiTypeId;
private String bacType;
private String isActive;
private Long kpiCycleTypeId;
private String calCycle;
private String ifPercentageKpi;
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="DimKpiSequence")
@SequenceGenerator(name = "DimKpiSequence", sequenceName = "dim_kpi_seq", allocationSize=1)
public Long getKpiId() {
return kpiId;
}
public void setKpiId(Long kpiId) {
this.kpiId = kpiId;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Long getBusnameId() {
return busnameId;
}
public void setBusnameId(Long busnameId) {
this.busnameId = busnameId;
}
public Date getCrtTime() {
return crtTime;
}
public void setCrtTime(Date crtTime) {
this.crtTime = crtTime;
}
public String getCrtUser() {
return crtUser;
}
public void setCrtUser(String crtUser) {
this.crtUser = crtUser;
}
public String getCurrentVersion() {
return currentVersion;
}
public void setCurrentVersion(String currentVersion) {
this.currentVersion = currentVersion;
}
public Date getInvalidTime() {
return invalidTime;
}
public void setInvalidTime(Date invalidTime) {
this.invalidTime = invalidTime;
}
public Long getOrigKpiId() {
return origKpiId;
}
public void setOrigKpiId(Long origKpiId) {
this.origKpiId = origKpiId;
}
public Long getKpiTypeId() {
return kpiTypeId;
}
public void setKpiTypeId(Long kpiTypeId) {
this.kpiTypeId = kpiTypeId;
}
public String getBacType() {
return bacType;
}
public void setBacType(String bacType) {
this.bacType = bacType;
}
public String getIsActive() {
return isActive;
}
public void setIsActive(String isActive) {
this.isActive = isActive;
}
public Long getKpiCycleTypeId() {
return kpiCycleTypeId;
}
public void setKpiCycleTypeId(Long kpiCycleTypeId) {
this.kpiCycleTypeId = kpiCycleTypeId;
}
public String getCalCycle() {
return calCycle;
}
public void setCalCycle(String calCycle) {
this.calCycle = calCycle;
}
public String getIfPercentageKpi() {
return ifPercentageKpi;
}
public void setIfPercentageKpi(String ifPercentageKpi) {
this.ifPercentageKpi = ifPercentageKpi;
}
}
...@@ -60,7 +60,6 @@ public class InsideXcdWorkingOrderInfo { ...@@ -60,7 +60,6 @@ public class InsideXcdWorkingOrderInfo {
@Id @Id
@GeneratedValue(strategy= GenerationType.SEQUENCE, generator="XcdWorkingOrderInfoSequence") @GeneratedValue(strategy= GenerationType.SEQUENCE, generator="XcdWorkingOrderInfoSequence")
@SequenceGenerator(name = "XcdWorkingOrderInfoSequence", sequenceName = "seq_inner_Working_Order_id", allocationSize=1) @SequenceGenerator(name = "XcdWorkingOrderInfoSequence", sequenceName = "seq_inner_Working_Order_id", allocationSize=1)
public Long getInnerWorkingOrderId() { public Long getInnerWorkingOrderId() {
return innerWorkingOrderId; return innerWorkingOrderId;
} }
......
...@@ -25,6 +25,8 @@ public class ModelParameter implements Serializable{ ...@@ -25,6 +25,8 @@ public class ModelParameter implements Serializable{
private String parameterValue;//参数值 private String parameterValue;//参数值
private String parameterDataType;//参数数据类型 private String parameterDataType;//参数数据类型
private Long dataModelId;//数据模型ID private Long dataModelId;//数据模型ID
private Long taskId;//任务表ID
private Long ifSystemDefault;//是否系统默认
@Id @Id
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="ModelParameterSequence") @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="ModelParameterSequence")
...@@ -59,7 +61,16 @@ public class ModelParameter implements Serializable{ ...@@ -59,7 +61,16 @@ public class ModelParameter implements Serializable{
public void setDataModelId(Long dataModelId) { public void setDataModelId(Long dataModelId) {
this.dataModelId = dataModelId; this.dataModelId = dataModelId;
} }
public Long getTaskId() {
return taskId;
}
public void setTaskId(Long taskId) {
this.taskId = taskId;
}
public Long getIfSystemDefault() {
return ifSystemDefault;
}
public void setIfSystemDefault(Long ifSystemDefault) {
this.ifSystemDefault = ifSystemDefault;
}
} }
package com.hp.cmsz.entity; package com.hp.cmsz.entity;
import java.io.Serializable; import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Date; import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue; import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType; import javax.persistence.GenerationType;
import javax.persistence.Id; import javax.persistence.Id;
import javax.persistence.SequenceGenerator; import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
/** /**
* quality_rule_warehouse_info_t表对应的实体类 * quality_rule_warehouse_info_t表对应的实体类
...@@ -14,27 +17,27 @@ import javax.persistence.SequenceGenerator; ...@@ -14,27 +17,27 @@ import javax.persistence.SequenceGenerator;
* @author Liu Na * @author Liu Na
* *
*/ */
@Entity
public class QualityRule implements Serializable { @Table(name = "quality_rule_warehouse_info_t")
public class QualityRule {
private Long qualityRuleId;//质量规则ID private Long qualityRuleId;//质量规则ID
private Long businessId;//业务ID private Long businessId;//业务ID
private Long kpiId;//指标ID private Long kpiId;//指标ID
private Long channelId;//渠道ID private Long channelId;//渠道ID
private Long provinceId;//省份维表ID private Long provinceId;//省份维表ID
private Long taskId;//任务ID
private Long dataSourceId;//数据来源ID private Long dataSourceId;//数据来源ID
private String kpiMonitorTime;//指标检测时间 private String kpiMonitorTime;//指标检测时间
private String kpiMonitorRange;//指标检查范围 private String kpiMonitorRunTime;
private double integrityThresholdValue;//完整性阈值 private String businessTime;//指标业务时间
private Long timelinessThresholdValue;//及时性阈值
private Date ruleCrtTime;//规则创建时间 private Date ruleCrtTime;//规则创建时间
private Date ruleUpdateTime;//规则更新时间 private Date ruleUpdateTime;//规则更新时间
private String rileValidFlag;//规则是否有效 private String ruleValidFlag;//规则是否有效
private String ifSystemValue;
@Id @Id
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="QualityRuleSequence") @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="QualityRuleSequence")
@SequenceGenerator(name = "QualityRuleSequence", sequenceName = "quality_rule_warehouse_info_t_seq", allocationSize=1) @SequenceGenerator(name = "QualityRuleSequence", sequenceName = "ccolap.quality_rule_deq", allocationSize=1)
public Long getQualityRuleId() { public Long getQualityRuleId() {
return qualityRuleId; return qualityRuleId;
} }
...@@ -65,12 +68,6 @@ public class QualityRule implements Serializable { ...@@ -65,12 +68,6 @@ public class QualityRule implements Serializable {
public void setProvinceId(Long provinceId) { public void setProvinceId(Long provinceId) {
this.provinceId = provinceId; this.provinceId = provinceId;
} }
public Long getTaskId() {
return taskId;
}
public void setTaskId(Long taskId) {
this.taskId = taskId;
}
public Long getDataSourceId() { public Long getDataSourceId() {
return dataSourceId; return dataSourceId;
} }
...@@ -83,23 +80,17 @@ public class QualityRule implements Serializable { ...@@ -83,23 +80,17 @@ public class QualityRule implements Serializable {
public void setKpiMonitorTime(String kpiMonitorTime) { public void setKpiMonitorTime(String kpiMonitorTime) {
this.kpiMonitorTime = kpiMonitorTime; this.kpiMonitorTime = kpiMonitorTime;
} }
public String getKpiMonitorRange() { public String getKpiMonitorRunTime() {
return kpiMonitorRange; return kpiMonitorRunTime;
}
public void setKpiMonitorRange(String kpiMonitorRange) {
this.kpiMonitorRange = kpiMonitorRange;
}
public double getIntegrityThresholdValue() {
return integrityThresholdValue;
} }
public void setIntegrityThresholdValue(double integrityThresholdValue) { public void setKpiMonitorRunTime(String kpiMonitorRunTime) {
this.integrityThresholdValue = integrityThresholdValue; this.kpiMonitorRunTime = kpiMonitorRunTime;
} }
public Long getTimelinessThresholdValue() { public String getBusinessTime() {
return timelinessThresholdValue; return businessTime;
} }
public void setTimelinessThresholdValue(Long timelinessThresholdValue) { public void setBusinessTime(String businessTime) {
this.timelinessThresholdValue = timelinessThresholdValue; this.businessTime = businessTime;
} }
public Date getRuleCrtTime() { public Date getRuleCrtTime() {
return ruleCrtTime; return ruleCrtTime;
...@@ -113,13 +104,17 @@ public class QualityRule implements Serializable { ...@@ -113,13 +104,17 @@ public class QualityRule implements Serializable {
public void setRuleUpdateTime(Date ruleUpdateTime) { public void setRuleUpdateTime(Date ruleUpdateTime) {
this.ruleUpdateTime = ruleUpdateTime; this.ruleUpdateTime = ruleUpdateTime;
} }
public String getRileValidFlag() { public String getRuleValidFlag() {
return rileValidFlag; return ruleValidFlag;
} }
public void setRileValidFlag(String rileValidFlag) { public void setRuleValidFlag(String ruleValidFlag) {
this.rileValidFlag = rileValidFlag; this.ruleValidFlag = ruleValidFlag;
}
public String getIfSystemValue() {
return ifSystemValue;
}
public void setIfSystemValue(String ifSystemValue) {
this.ifSystemValue = ifSystemValue;
} }
} }
...@@ -3,6 +3,7 @@ package com.hp.cmsz.entity.commonmanage; ...@@ -3,6 +3,7 @@ package com.hp.cmsz.entity.commonmanage;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.List;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.FetchType; import javax.persistence.FetchType;
...@@ -17,18 +18,13 @@ import javax.persistence.Temporal; ...@@ -17,18 +18,13 @@ import javax.persistence.Temporal;
import javax.persistence.TemporalType; import javax.persistence.TemporalType;
import javax.persistence.Transient; import javax.persistence.Transient;
import com.hp.cmsz.entity.DataModel; import com.hp.cmsz.entity.*;
@Entity @Entity
@Table(name = "RUN_TASK_T", schema = "ETL") @Table(name = "RUN_TASK_T", schema = "ETL")
public class RunTask { public class RunTask {
@Id @Id
//@TableGenerator(name = "ID_GENERATOR", table = "ID_GEN", pkColumnName = "GEN_NAME", pkColumnValue = "NBR_PK", valueColumnName = "GEN_VALUE", allocationSize = 1)
//@GeneratedValue(strategy = GenerationType.TABLE, generator = "ID_GENERATOR")
/*@GenericGenerator(name = "idGenerator", strategy = "uuid")
@GeneratedValue(generator = "idGenerator")*/
//@GeneratedValue(strategy = GenerationType.IDENTITY)
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "RunTaskSequence") @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "RunTaskSequence")
@SequenceGenerator(name = "RunTaskSequence", sequenceName = "run_task_t_seq", allocationSize = 1) @SequenceGenerator(name = "RunTaskSequence", sequenceName = "run_task_t_seq", allocationSize = 1)
private Long taskId; private Long taskId;
...@@ -53,6 +49,27 @@ public class RunTask { ...@@ -53,6 +49,27 @@ public class RunTask {
@JoinColumn(name = "MODEL_ID") @JoinColumn(name = "MODEL_ID")
private DataModel dataModelView; private DataModel dataModelView;
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "province_id")
private Province provinceView;
private Long kpiId;
// @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 = "business_id")
// private Business businessView;
@Temporal(TemporalType.TIMESTAMP) @Temporal(TemporalType.TIMESTAMP)
private Date taskNextrunTime; private Date taskNextrunTime;
...@@ -179,7 +196,46 @@ public class RunTask { ...@@ -179,7 +196,46 @@ public class RunTask {
this.taskContext = taskContext; this.taskContext = taskContext;
} }
/*public String getParallelFlg() { public Province getProvinceView() {
return provinceView;
}
public void setProvinceView(Province provinceView) {
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 String getParallelFlg() {
return parallelFlg; return parallelFlg;
} }
......
...@@ -34,7 +34,7 @@ public interface AccuracyRuleDao extends JpaSpecificationExecutor<AccuracyRule>, ...@@ -34,7 +34,7 @@ public interface AccuracyRuleDao extends JpaSpecificationExecutor<AccuracyRule>,
//根据准确性规则ID更新准确性规则信息 //根据准确性规则ID更新准确性规则信息
@Modifying @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") @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); 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删除一条准确性规则信息 //根据准确性规则ID删除一条准确性规则信息
@Modifying @Modifying
......
...@@ -39,6 +39,10 @@ public interface BusinessDao extends JpaSpecificationExecutor<Business>, ...@@ -39,6 +39,10 @@ public interface BusinessDao extends JpaSpecificationExecutor<Business>,
@Query("select business.businessId, business.businessName from Business business,ChannelDataSourceMap channelDataSourceMap where business.channelDataSourceMapId=channelDataSourceMap.channelDataSourceMapId and channelDataSourceMap.channelId = :channelIdList and channelDataSourceMap.dataSourceId =:datasourceIdList and business.businessId >= 0 order by business.businessId") @Query("select business.businessId, business.businessName from Business business,ChannelDataSourceMap channelDataSourceMap where business.channelDataSourceMapId=channelDataSourceMap.channelDataSourceMapId and channelDataSourceMap.channelId = :channelIdList and channelDataSourceMap.dataSourceId =:datasourceIdList and business.businessId >= 0 order by business.businessId")
List<Object[]> findBusinessIdAndBusinessNameByDataSourceIdAndChannelId(@Param("channelIdList") Long channelIdList,@Param("datasourceIdList") Long datasourceIdList); List<Object[]> findBusinessIdAndBusinessNameByDataSourceIdAndChannelId(@Param("channelIdList") Long channelIdList,@Param("datasourceIdList") Long datasourceIdList);
//由单个数据来源ID和单个渠道ID得到业务,加入isActive=N
@Query("select business.businessId, business.businessName from Business business,ChannelDataSourceMap channelDataSourceMap where business.isActive = 'Y' and business.channelDataSourceMapId=channelDataSourceMap.channelDataSourceMapId and channelDataSourceMap.channelId = :channelId and channelDataSourceMap.dataSourceId =:datasourceId and business.businessId >= 0 order by business.businessId")
List<Object[]> findBusinessIdAndBusinessNameByDataSourceIdAndChannelIdWithIsActive(@Param("channelId") Long channelId,@Param("datasourceId") Long datasourceId);
@Query("select business.businessId, business.businessName from Business business,ChannelDataSourceMap channelDataSourceMap,Channel channel where channel.channelId=channelDataSourceMap.channelId and business.channelDataSourceMapId=channelDataSourceMap.channelDataSourceMapId and channel.channelName=:channelName and business.businessId >= 0 order by business.businessId") @Query("select business.businessId, business.businessName from Business business,ChannelDataSourceMap channelDataSourceMap,Channel channel where channel.channelId=channelDataSourceMap.channelId and business.channelDataSourceMapId=channelDataSourceMap.channelDataSourceMapId and channel.channelName=:channelName and business.businessId >= 0 order by business.businessId")
List<Object[]> findBusinessByChannelName(@Param("channelName")String channelName); List<Object[]> findBusinessByChannelName(@Param("channelName")String channelName);
......
...@@ -19,6 +19,9 @@ public interface ChannelDao extends JpaSpecificationExecutor<Channel>, ...@@ -19,6 +19,9 @@ public interface ChannelDao extends JpaSpecificationExecutor<Channel>,
@Query("from Channel channel where channel.channelId >=0 order by channel.channelId") @Query("from Channel channel where channel.channelId >=0 order by channel.channelId")
List<Channel> findChannel(); List<Channel> findChannel();
@Query("from Channel channel where channel.channelId >=0 and channel.channelId <>7 order by channel.channelId")
List<Channel> findChannelWithoutAll();
List<Channel> findByChannelIdInOrderByChannelIdAsc(List<Long> channelIdList); List<Channel> findByChannelIdInOrderByChannelIdAsc(List<Long> channelIdList);
@Query("select channel from Channel channel, ChannelDataSourceMap channelDataSourceMap where channelDataSourceMap.channelId=channel.channelId and channelDataSourceMap.dataSourceId =:datasourceId and channel.channelId >=0 order by channel.channelId") @Query("select channel from Channel channel, ChannelDataSourceMap channelDataSourceMap where channelDataSourceMap.channelId=channel.channelId and channelDataSourceMap.dataSourceId =:datasourceId and channel.channelId >=0 order by channel.channelId")
......
package com.hp.cmsz.repository;
import java.util.List;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;
import com.hp.cmsz.entity.DimKpi;
public interface DimKpiDao extends JpaSpecificationExecutor<DimKpi>,
PagingAndSortingRepository<DimKpi, Long>{
//通过kpiTypeId查找数据采集频率
@Query("select dk.calCycle from DimKpi dk where dk.kpiTypeId = ?1")
List<String> findCayCycleByKpiTypeIdIn(@Param("kpiTypeId")Long kpiTypeId);
//通过kpiTypeId修改数据采集频率
@Modifying
@Query("update from DimKpi dk set dk.calCycle=:calCycle where dk.kpiTypeId=:kpiTypeId")
void updateDimKpiByKpiTypeId(@Param("calCycle")String calCycle,@Param("kpiTypeId")Long kpiTypeId);
}
...@@ -38,6 +38,10 @@ public interface KpiDao extends JpaSpecificationExecutor<Kpi>,PagingAndSortingRe ...@@ -38,6 +38,10 @@ 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") @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); 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);
//由单个业务ID得到指标 //由单个业务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") @Query("select kpi.kpiId, kpi.kpiName from Kpi kpi,Business business where kpi.businessId=business.businessId and business.businessId = :businessIdList and kpi.kpiId >=0")
List<Object[]> findKpiIdAndKpiNameByBusinessId(@Param("businessIdList") Long businessIdList); List<Object[]> findKpiIdAndKpiNameByBusinessId(@Param("businessIdList") Long businessIdList);
......
...@@ -27,10 +27,13 @@ public interface ModelParameterDao extends JpaSpecificationExecutor<ModelParamet ...@@ -27,10 +27,13 @@ public interface ModelParameterDao extends JpaSpecificationExecutor<ModelParamet
@Modifying @Modifying
@Query("update ModelParameter mp set mp.parameterName=:parameterName,mp.parameterValue=:parameterValue, mp.parameterDataType=:parameterDataType where mp.parameterId =:parameterId") @Query("update ModelParameter mp set mp.parameterName=:parameterName,mp.parameterValue=:parameterValue, mp.parameterDataType=:parameterDataType where mp.parameterId =:parameterId")
void updateParamByParameterId(@Param("parameterName")String parameterName,@Param("parameterValue")String parameterValue,@Param("parameterDataType")String parameterDataType,@Param("parameterId")Long parameterId); void updateParamByParameterId(@Param("parameterName")String parameterName,@Param("parameterValue")String parameterValue,@Param("parameterDataType")String parameterDataType,@Param("parameterId")Long parameterId);
//根据数据模型ID查找参数d //根据数据模型ID查找参数d
List<ModelParameter> findByDataModelId(Long dataModelId); List<ModelParameter> findByDataModelId(Long dataModelId);
//根据数据模型ID查找系统默认的参数d
List<ModelParameter> findByDataModelIdAndIfSystemDefault(Long dataModelId, Long ifSystemDefault);
//根据数据模型ID查找参数d //根据数据模型ID查找参数d
List<ModelParameter> findByDataModelIdIn(List<Long> dataModelId); List<ModelParameter> findByDataModelIdIn(List<Long> dataModelId);
......
package com.hp.cmsz.repository; package com.hp.cmsz.repository;
import java.sql.Timestamp;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -20,7 +21,7 @@ import com.hp.cmsz.entity.QualityRule; ...@@ -20,7 +21,7 @@ import com.hp.cmsz.entity.QualityRule;
public interface QualityRuleDao extends JpaSpecificationExecutor<QualityRule>, public interface QualityRuleDao extends JpaSpecificationExecutor<QualityRule>,
PagingAndSortingRepository<QualityRule, Long>{ PagingAndSortingRepository<QualityRule, Long>{
List<QualityRule> findAll();
//根据质量规则ID查找质量规则 //根据质量规则ID查找质量规则
QualityRule findByQualityRuleId(Long qualityRuleId); QualityRule findByQualityRuleId(Long qualityRuleId);
...@@ -35,14 +36,14 @@ public interface QualityRuleDao extends JpaSpecificationExecutor<QualityRule>, ...@@ -35,14 +36,14 @@ public interface QualityRuleDao extends JpaSpecificationExecutor<QualityRule>,
//根据质量规则ID修改质量规则 //根据质量规则ID修改质量规则
@Modifying @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.kpiMonitorRange=:kpiMonitorRange,dm.integrityThresholdValue=:integrityThresholdValue, qr.timelinessThresholdValue=:timelinessThresholdValue, qr.ruleCrtTime=:ruleCrtTime, qr.ruleUpdateTime=:ruleUpdateTime where qr.qualityRuleId=:qualityRuleId") @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("kpiMonitorRange")String kpiMonitorRange,@Param("integrityThresholdValue")double integrityThresholdValue,@Param("timelinessThresholdValue")Long timelinessThresholdValue,@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")String kpiMonitorRunTime,@Param("businessTime")String businessTime,@Param("ruleCrtTime")Date ruleCrtTime,@Param("ruleUpdateTime")Date ruleUpdateTime,@Param("qualityRuleId")Long qualityRuleId);
//根据质量规则ID得到数据条数 //根据质量规则ID得到数据条数
@Query("select count(*) from QualityRule qualityRule where qualityRule.qualityRuleId=:qualityRuleId") @Query("select count(*) from QualityRule qualityRule where qualityRule.qualityRuleId=:qualityRuleId")
Long getNumOfQualityRuleByQualityRuleId(@Param("qualityRuleId")String qualityRuleId); Long getNumOfQualityRuleByQualityRuleId(@Param("qualityRuleId")String qualityRuleId);
//根据省份、渠道、业务、指标查询质量规则 //根据省份、渠道、业务、数据来源筛选查询质量规则
List<QualityRule> findByProvinceIdInAndBusinessIdInAndKpiIdInAndChannelIdInOrderByQualityRuleIdDesc(List<Long> provinceId, List<Long> businessId, List<Long> kpiId, List<Long> channelId); List<QualityRule> findByProvinceIdInAndBusinessIdInAndDataSourceIdInAndChannelIdInOrderByQualityRuleIdDesc(Long[] province, Long[] business, Long[] datasource, Long[] channel);
} }
...@@ -30,6 +30,8 @@ public class BusinessService { ...@@ -30,6 +30,8 @@ public class BusinessService {
} }
public List<Business> getByChannelDataSourceMapIdIn(List<Long> channelDataSourceMapIdList){ public List<Business> getByChannelDataSourceMapIdIn(List<Long> channelDataSourceMapIdList){
return (List<Business>)businessDao.findByChannelDataSourceMapIdIn(channelDataSourceMapIdList); return (List<Business>)businessDao.findByChannelDataSourceMapIdIn(channelDataSourceMapIdList);
} }
......
...@@ -29,8 +29,8 @@ public class AccuracyRuleService { ...@@ -29,8 +29,8 @@ public class AccuracyRuleService {
//根据准确性规则ID更新准确性规则 //根据准确性规则ID更新准确性规则
@Transactional(readOnly=false) @Transactional(readOnly=false)
public void updateAccuracyRuleByAccuracyRuleId(String ruleType,double scopeMaxValue,double scopeMinValue,String repeatedCheckGranularity,Date repeatedCheckStartTime,Date repeatedCheckEndTime,String ifRepeatedCheckSeries,Long repeatedCheckMaxTime,String ifRepeatedCheckSummation){ 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);; accuracyRuleDao.updateAccuracyRuleByAccuracyRuleId(ruleType, scopeMaxValue, scopeMinValue, repeatedCheckGranularity, repeatedCheckStartTime, repeatedCheckEndTime, ifRepeatedCheckSeries, repeatedCheckMaxTime, ifRepeatedCheckSummation,accuracyRuleId);
} }
//根据准确性规则ID删除一条准确性规则信息 //根据准确性规则ID删除一条准确性规则信息
......
package com.hp.cmsz.service.analysissupport;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.hp.cmsz.repository.DimKpiDao;
@Service
@Transactional
public class DimKpiService {
@Autowired
private DimKpiDao dimKpiDao;
//根据kpiTypeId修改数据采集频率
@Transactional(readOnly=false)
private void updateByKpiTypeId(String calCycle,Long kpiTypeId){
dimKpiDao.updateDimKpiByKpiTypeId(calCycle, kpiTypeId);
}
}
package com.hp.cmsz.service.analysissupport; package com.hp.cmsz.service.analysissupport;
import java.sql.Timestamp;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -7,6 +8,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -7,6 +8,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import com.hp.cmsz.entity.QualityRule;
import com.hp.cmsz.repository.QualityRuleDao; import com.hp.cmsz.repository.QualityRuleDao;
/** /**
...@@ -21,6 +23,11 @@ public class QualityRuleService { ...@@ -21,6 +23,11 @@ public class QualityRuleService {
@Autowired @Autowired
private QualityRuleDao qualityRuleDao; private QualityRuleDao qualityRuleDao;
//根据筛选条件查询出质量规则
public List<QualityRule> getAllQualityRuleByOther(Long[] province,Long[] datasource,Long[] channel,Long[] business){
return qualityRuleDao.findByProvinceIdInAndBusinessIdInAndDataSourceIdInAndChannelIdInOrderByQualityRuleIdDesc(province, business, datasource, channel);
}
//根据质量规则ID删除质量规则 //根据质量规则ID删除质量规则
@Transactional(readOnly=false) @Transactional(readOnly=false)
public void deleteByQualityRuleId(List<Long> qualityRuleId){ public void deleteByQualityRuleId(List<Long> qualityRuleId){
...@@ -29,8 +36,8 @@ public class QualityRuleService { ...@@ -29,8 +36,8 @@ public class QualityRuleService {
//根据质量规则ID修改质量规则 //根据质量规则ID修改质量规则
@Transactional(readOnly=false) @Transactional(readOnly=false)
public void updateByQualityRuleId(Long businessId, Long kpiId, Long channelId, Long provinceId, Long dataSourceId, String kpiMonitorTime,String kpiMonitorRange,double integrityThresholdValue,Long timelinessThresholdValue ,Date ruleCrtTime,Date ruleUpdateTime,Long qualityRuleId){ 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, kpiMonitorRange, integrityThresholdValue, timelinessThresholdValue, ruleCrtTime, ruleUpdateTime, qualityRuleId); qualityRuleDao.updateQualityRuleByQualityRuleId(businessId, kpiId, channelId, provinceId, dataSourceId, kpiMonitorTime, kpiMonitorRunTime, businessTime, ruleCrtTime, ruleUpdateTime, qualityRuleId);
} }
} }
package com.hp.cmsz.web.analysissupport; package com.hp.cmsz.web.analysissupport;
import java.text.ParseException; import java.text.ParseException;
import java.util.Date;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
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.Business;
import com.hp.cmsz.entity.Channel;
import com.hp.cmsz.entity.DataSource;
import com.hp.cmsz.entity.DataType;
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.BusinessDao;
import com.hp.cmsz.repository.ChannelDao;
import com.hp.cmsz.repository.DataSourceDao;
import com.hp.cmsz.repository.DataTypeDao;
import com.hp.cmsz.repository.KpiDao;
import com.hp.cmsz.repository.ProvinceDao;
import com.hp.cmsz.repository.QualityRuleDao;
import com.hp.cmsz.service.analysissupport.AccuracyRuleService;
import com.hp.cmsz.web.PageURLController; import com.hp.cmsz.web.PageURLController;
/** /**
...@@ -22,6 +46,109 @@ import com.hp.cmsz.web.PageURLController; ...@@ -22,6 +46,109 @@ import com.hp.cmsz.web.PageURLController;
@RequestMapping(value="AnalysisSupport/QualityRuleConfiguration") @RequestMapping(value="AnalysisSupport/QualityRuleConfiguration")
public class QualityRuleConfigurationController { public class QualityRuleConfigurationController {
// @Autowired
// private ProvinceDao provinceDao;
//
// @Autowired
// private ChannelDao channelDao;
//
// @Autowired
// private BusinessDao businessDao;
//
// @Autowired
// private KpiDao kpiDao;
//
// @Autowired
// private DataTypeDao dataTypeDao;
//
// @Autowired
// private DataSourceDao dataSourceDao;
//
// @Autowired
// private QualityRuleDao qualityRuleDao;
//
//// @Autowired
//// private QualityRuleService qualityRuleService;
//
// @Autowired
// private AccuracyRuleDao accuracyRuleDao;
//
// @Autowired
// private AccuracyRuleService accuracyRuleService;
////
//// @Autowired
//// private CmszOperationLogService cmszOperationLogService;
//
// @RequestMapping(value = "")
// public String ruleMaintainHome(@RequestParam(value = "qualityRuleId", defaultValue ="") String qualityRuleId,
// Map model){
//
// QualityRule qualityRule = null;
// List<AccuracyRule> accuracyRuleList = null;
// if(!qualityRuleId.trim().equals("")){
// qualityRule = qualityRuleDao.findByQualityRuleId(Long.parseLong(qualityRuleId));
// accuracyRuleList = accuracyRuleDao.findByQualityRuleId(Long.parseLong(qualityRuleId));
// }
//
// //查询出所有的省份
// List<Province> provinceList=(List<Province>)provinceDao.findProvince();
// //查询出所有的渠道信息
// List<Channel> channelList=(List<Channel>)channelDao.findChannelWithoutAll();
// //查询出所有的指标
// List<Kpi> kpiList=(List<Kpi>)kpiDao.findAll();
// //查询出所有的业务
// List<Business> businessList=(List<Business>)businessDao.findAll();
// //查询出所有的数据类型
// 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.RuleConfiguration;
// }
//
// //修改准确性规则信息
// @RequestMapping(value = "/updateAccuracyRule*",method=RequestMethod.GET)
// @ResponseBody
// public void updateParameter(
// @RequestParam(value="ruleType") String ruleType,
// @RequestParam(value="scopeMaxValue") double scopeMaxValue,
// @RequestParam(value="scopeMinValue") double scopeMinValue,
// @RequestParam(value="repeatedCheckGranularity") String repeatedCheckGranularity,
// @RequestParam(value="repeatedCheckStartTime") Date repeatedCheckStartTime,
// @RequestParam(value="repeatedCheckEndTime") Date repeatedCheckEndTime,
// @RequestParam(value="ifRepeatedCheckSeries") String ifRepeatedCheckSeries,
// @RequestParam(value="repeatedCheckMaxTime") Long repeatedCheckMaxTime,
// @RequestParam(value="ifRepeatedCheckSummation") String ifRepeatedCheckSummation,
// @RequestParam(value="qualityRuleId")String qualityRuleId,
// @RequestParam(value="accuracyRuleId")String accuracyRuleId){
//
// if(qualityRuleId.trim().equals("")){
// AccuracyRule accuracyRule = new AccuracyRule();
// accuracyRule.setAccuracyRuleId(Long.parseLong(qualityRuleId));
// accuracyRule.setRuleType(ruleType);
// accuracyRule.setScopeMinValue(scopeMaxValue);
// accuracyRule.setScopeMinValue(scopeMinValue);
// accuracyRule.setRepeatedCheckGranularity(repeatedCheckGranularity);
// accuracyRule.setRepeatedCheckStartTime(repeatedCheckStartTime);
// accuracyRule.setRepeatedCheckEndTime(repeatedCheckEndTime);
// accuracyRule.setIfRepeatedCheckSeries(ifRepeatedCheckSeries);
// accuracyRule.setRepeatedCheckMaxTime(repeatedCheckMaxTime);
// accuracyRule.setIfRepeatedCheckSummation(ifRepeatedCheckSummation);
//
// accuracyRuleDao.save(accuracyRule);
// }else{
// accuracyRuleService.updateAccuracyRuleByAccuracyRuleId(ruleType, scopeMaxValue, scopeMinValue, repeatedCheckGranularity, repeatedCheckStartTime, repeatedCheckEndTime, ifRepeatedCheckSeries, repeatedCheckMaxTime, ifRepeatedCheckSummation, Long.parseLong(accuracyRuleId));;
// }
//
// }
@RequestMapping() @RequestMapping()
public String updateQualityRuleForm() { public String updateQualityRuleForm() {
......
package com.hp.cmsz.web.analysissupport; package com.hp.cmsz.web.analysissupport;
import java.io.IOException;
import java.io.PrintWriter;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -11,13 +13,18 @@ import javax.servlet.http.HttpServletRequest; ...@@ -11,13 +13,18 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import com.google.gson.Gson;
import com.hp.cmsz.entity.Business;
import com.hp.cmsz.entity.Channel; import com.hp.cmsz.entity.Channel;
import com.hp.cmsz.entity.ChannelDataSourceMap;
import com.hp.cmsz.entity.DataModel; import com.hp.cmsz.entity.DataModel;
import com.hp.cmsz.entity.DataSource; import com.hp.cmsz.entity.DataSource;
import com.hp.cmsz.entity.DataType; import com.hp.cmsz.entity.DataType;
...@@ -27,6 +34,7 @@ import com.hp.cmsz.entity.Province; ...@@ -27,6 +34,7 @@ import com.hp.cmsz.entity.Province;
import com.hp.cmsz.repository.AccuracyRuleDao; import com.hp.cmsz.repository.AccuracyRuleDao;
import com.hp.cmsz.repository.BusinessDao; import com.hp.cmsz.repository.BusinessDao;
import com.hp.cmsz.repository.ChannelDao; import com.hp.cmsz.repository.ChannelDao;
import com.hp.cmsz.repository.ChannelDataSourceMapDao;
import com.hp.cmsz.repository.DataSourceDao; import com.hp.cmsz.repository.DataSourceDao;
import com.hp.cmsz.repository.DataTypeDao; import com.hp.cmsz.repository.DataTypeDao;
import com.hp.cmsz.repository.KpiDao; import com.hp.cmsz.repository.KpiDao;
...@@ -34,6 +42,7 @@ import com.hp.cmsz.repository.ProvinceDao; ...@@ -34,6 +42,7 @@ import com.hp.cmsz.repository.ProvinceDao;
import com.hp.cmsz.repository.QualityRuleDao; import com.hp.cmsz.repository.QualityRuleDao;
import com.hp.cmsz.service.BusinessService; import com.hp.cmsz.service.BusinessService;
import com.hp.cmsz.service.CmszOperationLogService; import com.hp.cmsz.service.CmszOperationLogService;
import com.hp.cmsz.service.KpiService;
import com.hp.cmsz.service.analysissupport.QualityRuleService; import com.hp.cmsz.service.analysissupport.QualityRuleService;
import com.hp.cmsz.web.PageURLController; import com.hp.cmsz.web.PageURLController;
...@@ -55,9 +64,15 @@ public class QualityRuleMaintainController { ...@@ -55,9 +64,15 @@ public class QualityRuleMaintainController {
private ChannelDao channelDao; private ChannelDao channelDao;
@Autowired @Autowired
private ChannelDataSourceMapDao channelDataSourceMapDao;
@Autowired
private BusinessService businessService; private BusinessService businessService;
@Autowired @Autowired
private BusinessDao businessDao;
@Autowired
private KpiDao kpiDao; private KpiDao kpiDao;
@Autowired @Autowired
...@@ -88,89 +103,182 @@ public class QualityRuleMaintainController { ...@@ -88,89 +103,182 @@ public class QualityRuleMaintainController {
//查询出所有的指标 //查询出所有的指标
List<Kpi> kpiList=(List<Kpi>)kpiDao.findAll(); List<Kpi> kpiList=(List<Kpi>)kpiDao.findAll();
//查询出所有的业务 //查询出所有的业务
List<String> businessList=businessService.getAllBusinessIdAndBusinessName(); List<Object[]> businessList=(List<Object[]>)businessDao.findAllBusinessIdAndBusinessName();
//查询出所有的数据类型 //查询出所有的数据类型
List<DataType> dataTypeList= (List<DataType>)dataTypeDao.findAll(); List<DataType> dataTypeList= (List<DataType>)dataTypeDao.findAll();
//查询出所有的数据来源 //查询出所有的数据来源
List<DataSource> dataSourceList=(List<DataSource>)dataSourceDao.findAll(); List<DataSource> dataSourceList=(List<DataSource>)dataSourceDao.findAll();
Gson gson = new Gson();
model.put("provinceList", provinceList); model.put("provinceList", provinceList);
model.put("channelList", channelList); model.put("channelList", channelList);
model.put("kpiList", kpiList); model.put("kpiList", kpiList);
model.put("businessList", businessList); model.put("businessList", gson.toJson(businessList));
model.put("dataTypeList", dataTypeList); model.put("dataTypeList", dataTypeList);
model.put("dataSourceList", dataSourceList); model.put("dataSourceList", dataSourceList);
return PageURLController.RuleMaintain; return PageURLController.RuleMaintain;
} }
@RequestMapping(value = "/findBusinessId*")
@ResponseBody
public void datasource_select(@RequestParam(value = "dataSource", defaultValue ="" ) String dataSource,
@RequestParam(value = "channel", defaultValue ="" ) String channel,
HttpServletResponse response) {
System.out.println(dataSource);
List<Object []> resultList = new ArrayList<Object []>();
List<Object[]> list = (List<Object[]>)businessDao.findBusinessIdAndBusinessNameByDataSourceIdAndChannelIdWithIsActive(Long.parseLong(channel),Long.parseLong(dataSource));
for(int i=0;i<list.size();i++){
Object[] objs = list.get(i);
//将重复的业务名的Id写在同一个对象中
for(int j=0;j<list.size();j++){
if(i == j){}else{
Object[] objs1 = list.get(j);
if(objs[1].equals(objs1[1])){
objs[0] = objs[0] +","+ objs1[0];
list.remove(j);
j--;
}
}
}
resultList.add(objs);
}
Gson gson = new Gson();
response.setContentType("text/Xml;chartset=gbk");
PrintWriter out = null;
try{
out = response.getWriter();
out.println(gson.toJson(resultList));
}
catch(IOException ex){
ex.printStackTrace();
}
finally{
out.close();
}
}
// @RequestMapping(value="/findBusinessId*")
// @ResponseBody
// public void findBusinessId(@RequestParam(value = "dataSource", defaultValue ="" ) String dataSource,
// @RequestParam(value = "channelId", defaultValue ="" ) String channelId,
// HttpServletResponse response){
// List<Object[]> channelDataSourceMapIdList = (List<Object[]>)businessDao.findBusinessIdAndBusinessNameByDataSourceIdAndChannelIdWithIsActive(Long.parseLong(dataSource),Long.parseLong(channel));
// Gson gson = new Gson();
// response.setContentType("text/Xml;charset=gbk");
// PrintWriter out = null;
// try {
// out = response.getWriter();
// out.println(gson.toJson(dataSceAndBus));
// }
// catch (IOException ex1) {
// ex1.printStackTrace();
// }finally{ out.close(); }
// }
@RequestMapping(value="/findKpiId*")
@ResponseBody
public void findKpiId(@RequestParam(value = "businessIds", defaultValue ="" ) String businessIds,
HttpServletResponse response){
String[] strs = businessIds.split(",");
List<Long> businessIdlist = new ArrayList<Long>();
for(int i=0;i<strs.length;i++){
businessIdlist.add(Long.valueOf(strs[i]));
List<Object[]> businessKpiList = (List<Object[]>)kpiDao.findKpiIdAndKpiNameByBusinessIds(businessIdlist);
Gson gson = new Gson();
response.setContentType("text/Xml;charset=gbk");
PrintWriter out = null;
try {
out = response.getWriter();
out.println(gson.toJson(businessKpiList));
}
catch (IOException ex1) {
ex1.printStackTrace();
}finally{ out.close(); }
}
// private List<Long> qualityRuleIdList = new ArrayList<Long>(); // private List<Long> qualityRuleIdList = new ArrayList<Long>();
// //新增准确性规则 // //新增准确性规则
// @RequestMapping(value = "/createAccuracyRule*", method = RequestMethod.GET) // @RequestMapping(value = "/createAccuracyRule*", method = RequestMethod.GET)
// @ResponseBody // @ResponseBody
// public void createAccuracyRule( // public void createAccuracyRule(
// @RequestParam(value="paramName") String paramName, // @RequestParam(value="ruleType") String ruleType,
// @RequestParam(value="paramValue") String paramValue, // @RequestParam(value="scopeMaxValue") String scopeMaxValue,
// @RequestParam(value="paramType") String paramType, // @RequestParam(value="scopeMinValue") String scopeMinValue,
// @RequestParam(value="paramName") String paramName, // @RequestParam(value="repeatedCheckGranularity") String repeatedCheckGranularity,
// @RequestParam(value="paramValue") String paramValue, // @RequestParam(value="repeatedCheckStartTime") String repeatedCheckStartTime,
// @RequestParam(value="paramType") String paramType, // @RequestParam(value="repeatedCheckEndTime") String repeatedCheckEndTime,
// @RequestParam(value="paramName") String paramName, // @RequestParam(value="ifRepeatedCheckSeries") String ifRepeatedCheckSeries,
// @RequestParam(value="paramValue") String paramValue, // @RequestParam(value="repeatedCheckMaxTime") String repeatedCheckMaxTime,
// @RequestParam(value="paramType") String paramType, // @RequestParam(value="ifRepeatedCheckSummation") String ifRepeatedCheckSummation,
// HttpServletResponse response,HttpServletRequest request) { // HttpServletResponse response,HttpServletRequest request) {
// //
// ModelParameter modelParameter = new ModelParameter(); // AccuracyRule accuracyRule = new accuracyRule();
// if(!paramName.trim().equals("")){modelParameter.setParameterName(paramName);} // if(!ruleType.trim().equals("")){
// if(!paramValue.trim().equals("")){modelParameter.setParameterValue(paramValue);} // if(ruleType == 1){
// if(!paramType.trim().equals("")){modelParameter.setParameterDataType(paramType);} // accuracyRule.setruleType("范围");
// }else if(ruleType == 2){
// accuracyRule.setruleType("重复");
// }
// }
// 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("")){accuracyRule.setrepeatedCheckStartTime(repeatedCheckStartTime);}
// if(!repeatedCheckEndTime.trim().equals("")){accuracyRule.setrepeatedCheckEndTime(repeatedCheckEndTime);}
// if(!ifRepeatedCheckSeries.trim().equals("")){accuracyRule.setifRepeatedCheckSeries(ifRepeatedCheckSeries);}
// if(!repeatedCheckMaxTime.trim().equals("")){accuracyRule.setrepeatedCheckMaxTime(repeatedCheckMaxTime);}
// if(!ifRepeatedCheckSummation.trim().equals("")){accuracyRule.setifRepeatedCheckSummation(ifRepeatedCheckSummation);}
// //
// modelParameterDao.save(modelParameter); // accuracyRuleDao.save(accuracyRule);
// //
// Long dataModelId = modelParameter.getParameterId(); // Long accuracyRuleId = accuracyRule.getaccuracyRuleId();
// dataModelIdList.add(dataModelId); // qualityRuleIdList.add(qualityRuleId);
// } // }
// //新增质量模型 // //新增质量模型
// @RequestMapping(value = "/saveModelDataForm", method = RequestMethod.POST) // @RequestMapping(value = "/saveRuleDataForm", method = RequestMethod.POST)
// public String saveModelDataForm(HttpServletResponse response,HttpServletRequest request) throws ParseException{ // public String saveRuleDataForm(HttpServletResponse response,HttpServletRequest request) throws ParseException{
// String dataModelName = ""; // Long qualityRuleId = "";
// String modelDesc = ""; // Long businessId = "";
// String ruleDefinition = ""; // Long kpiId = "";
// String evaluationMethod = ""; // Long channelId = "";
// String evaluationStandard = ""; // Long provinceId = "";
// String modelType = ""; // Long dataSourceId = "";
// String deployedServer = ""; // String kpiMonitorTime = "";
// String modelStatus = ""; // String kpiMonitorRunTime = "";
// //String cycleMinutes = ""; // String businessTime = "";
// String modelExeScriptName = ""; // Date ruleCrtTime = "";
// String kpiTypeId = ""; // Date ruleUpdateTime = "";
// String businessEndTime = ""; // String ruleValidFlag = "";
// String businessStartTime = ""; // String ifSystemValue = "";
// Date publishTime = new Date();
// Date updateTime = new Date(); // QualityRule qualityRule = new qualityRule();
// DataModel dataModel = new DataModel();
// SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// SimpleDateFormat batchFormat = new SimpleDateFormat("yyyyMMdd000001"); // if(!qualityRuleId.trim().equals("")){qualityRule.setqualityRuleId(Long.parseLong(qualityRuleId));}
// dataModel.setBatchNo(Long.parseLong(batchFormat.format(sd.parse(businessStartTime)))); // if(!businessId.trim().equals("")){qualityRule.setbusinessId(Long.parseLong(businessId));}
// dataModel.setDataModelName(dataModelName); // if(!kpiId.trim().equals("")){qualityRule.setkpiId(Long.parseLong(kpiId));}
// if(!modelDesc.trim().equals("")){dataModel.setModelDesc(modelDesc);} // if(!channelId.trim().equals("")){qualityRule.setchannelId(Long.parseLong(channelId));}
// if(!ruleDefinition.trim().equals("")){dataModel.setRuleDefinition(ruleDefinition);} // if(!provinceId.trim().equals("")){qualityRule.setprovinceId(Long.parseLong(provinceId));}
// if(!evaluationMethod.trim().equals("")){dataModel.setEvaluationMethod(evaluationMethod);} // if(!dataSourceId.trim().equals("")){qualityRule.setdataSourceId(Long.parseLong(dataSourceId));}
// if(!evaluationStandard.trim().equals("")){dataModel.setEvaluationStandard(evaluationStandard);} // if(!kpiMonitorTime.trim().equals("")){qualityRule.setkpiMonitorTime(kpiMonitorTime);}
// if(!modelType.trim().equals("")){dataModel.setDataModelTypeId(Long.parseLong(modelType));} // qualityRule.setkpiMonitorRunTime(kpiMonitorTime);
// if(!deployedServer.trim().equals("")){dataModel.setServerId(Long.parseLong(deployedServer));} // if(!businessTime.trim().equals("")){qualityRule.setbusinessTime(businessTime);}
// if(!modelStatus.trim().equals("")){dataModel.setModelStatus(Long.parseLong(modelStatus));} // qualityRule.setruleCrtTime(sd.parse(ruleCrtTime));
// if(!kpiTypeId.trim().equals("")){dataModel.setKpiTypeId(Long.parseLong(kpiTypeId));} // qualityRule.setruleUpdateTime(sd.parse(ruleUpdateTime));
// /*if(!cycleMinutes.trim().equals("")){dataModel.setCycleMinutes(Long.parseLong(cycleMinutes));}*/ // qualityRule.setruleValidFlag(1);
// dataModel.setModelPublishTime(publishTime); // qualityRule.setifSystemValue(1);
// dataModel.setModelUpdateTime(updateTime);
// dataModel.setBusinessStartTime(sd.parse(businessStartTime));
// dataModel.setBusinessEndTime(sd.parse(businessEndTime));
// qualityRuleDao.save(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 dataModelId = dataModel.getDataModelId(); // Long qualityRuleId = qualityRule.getqualityRuleId();
// return "redirect:AnalysisSupport/QualityRuleResult"; // return "redirect:AnalysisSupport/QualityRuleResult";
// } // }
}
} }
...@@ -19,15 +19,17 @@ import org.springframework.web.bind.annotation.ResponseBody; ...@@ -19,15 +19,17 @@ import org.springframework.web.bind.annotation.ResponseBody;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.hp.cmsz.entity.AccuracyRule; import com.hp.cmsz.entity.AccuracyRule;
import com.hp.cmsz.entity.Channel; import com.hp.cmsz.entity.Channel;
import com.hp.cmsz.entity.DataSource;
import com.hp.cmsz.entity.Kpi; import com.hp.cmsz.entity.Kpi;
import com.hp.cmsz.entity.Province; import com.hp.cmsz.entity.Province;
import com.hp.cmsz.entity.QualityRule; import com.hp.cmsz.entity.QualityRule;
import com.hp.cmsz.repository.AccuracyRuleDao; import com.hp.cmsz.repository.AccuracyRuleDao;
import com.hp.cmsz.repository.ChannelDao; import com.hp.cmsz.repository.DataSourceDao;
import com.hp.cmsz.repository.KpiDao; import com.hp.cmsz.repository.KpiDao;
import com.hp.cmsz.repository.ProvinceDao; import com.hp.cmsz.repository.ProvinceDao;
import com.hp.cmsz.repository.QualityRuleDao; import com.hp.cmsz.repository.QualityRuleDao;
import com.hp.cmsz.service.BusinessService; import com.hp.cmsz.service.BusinessService;
import com.hp.cmsz.service.ChannelService;
import com.hp.cmsz.service.CmszOperationLogService; import com.hp.cmsz.service.CmszOperationLogService;
import com.hp.cmsz.service.analysissupport.AccuracyRuleService; import com.hp.cmsz.service.analysissupport.AccuracyRuleService;
import com.hp.cmsz.service.analysissupport.QualityRuleService; import com.hp.cmsz.service.analysissupport.QualityRuleService;
...@@ -44,172 +46,180 @@ import com.hp.cmsz.web.PageURLController; ...@@ -44,172 +46,180 @@ import com.hp.cmsz.web.PageURLController;
@RequestMapping(value="AnalysisSupport/QualityRuleResult") @RequestMapping(value="AnalysisSupport/QualityRuleResult")
public class QualityRuleResultController { public class QualityRuleResultController {
// @Autowired @Autowired
// private ProvinceDao provinceDao; private ProvinceDao provinceDao;
//
// @Autowired @Autowired
// private ChannelDao channelDao; private ChannelService channelService;
//
// @Autowired @Autowired
// private BusinessService businessService; private BusinessService businessService;
//
// @Autowired @Autowired
// private KpiDao kpiDao; private KpiDao kpiDao;
//
// @Autowired @Autowired
// private QualityRuleDao qualityRuleDao; private DataSourceDao dataSourceDao;
//
// @Autowired @Autowired
// private QualityRuleService qualityRuleService; private QualityRuleDao qualityRuleDao;
//
// @Autowired @Autowired
// private AccuracyRuleService accuracyRuleService; private QualityRuleService qualityRuleService;
//
// @Autowired @Autowired
// private AccuracyRuleDao accuracyRuleDao; private AccuracyRuleService accuracyRuleService;
//
// @Autowired @Autowired
// private CmszOperationLogService cmszOperationLogService; private AccuracyRuleDao accuracyRuleDao;
//
// private String staticProvinceId = ""; @Autowired
// private String staticChannelId = ""; private CmszOperationLogService cmszOperationLogService;
// private String staticKpiId = "";
// private String staticBusinessId = ""; List<QualityRule> staticQualityRuleList = new ArrayList<QualityRule>();
// List<QualityRule> staticQualityRuleList = new ArrayList<QualityRule>();
@RequestMapping(value = "") @RequestMapping(value = "")
public String ruleResultHome( public String ruleResultHome(
@RequestParam(value = "rulePageNum", defaultValue="1") String rulePageNum, @RequestParam(value = "rulePageNum", defaultValue="1") String rulePageNum,
Map model){ Map model){
// //查询出所有的省份 //查询出所有省份的信息
// List<Province> provinceList=(List<Province>)provinceDao.findProvince(); List<Province> provinceList=(List<Province>)provinceDao.findAll();
// //查询出所有的渠道信息 //查询出所有的渠道信息
// List<Channel> channelList=(List<Channel>)channelDao.findChannel(); //List<Channel> channelList=(List<Channel>)channelDao.findChannel();
// //查询出所有的指标 List<Channel> channelList = channelService.getAllChannels();
// List<Kpi> kpiList=(List<Kpi>)kpiDao.findAll(); //查询出所有的指标
// //查询出所有的业务 List<Kpi> kpiList=(List<Kpi>)kpiDao.findAll();
// List<String> businessList=businessService.getAllBusinessIdAndBusinessName(); //查询出所有的业务
// //查询出所有的质量规则 List<String> businessList=businessService.getAllBusinessIdAndBusinessName();
// List<QualityRule> qualityRuleList=(List<QualityRule>)qualityRuleDao.findAll(); //查询出所有的数据来源信息
// List<DataSource> datasourceList=(List<DataSource>)dataSourceDao.findDataSource();
// Gson gson = new Gson(); //查询出所有的质量规则
// model.put("provinceList", gson.toJson(provinceList)); List<QualityRule> qualityRuleList=(List<QualityRule>)qualityRuleDao.findAll();
// model.put("channelList", gson.toJson(channelList));
// model.put("kpiList", gson.toJson(kpiList)); Gson gson = new Gson();
// model.put("businessList", gson.toJson(businessList)); model.put("provinceList", gson.toJson(provinceList));
// model.put("qualityRuleList", gson.toJson(qualityRuleList)); model.put("channelList", channelList);
// model.put("rulePageNum", rulePageNum); model.put("kpiList", kpiList);
// cmszOperationLogService.createLog("查询","质量规则","质量规则首页"); model.put("businessList",businessList);
model.put("datasourceList", datasourceList);
model.put("qualityRuleList", qualityRuleList);
model.put("rulePageNum", rulePageNum);
cmszOperationLogService.createLog("查询","质量规则","质量规则首页");
return PageURLController.RuleResult; return PageURLController.RuleResult;
} }
// //根据筛选项更新表格 //根据筛选项更新表格
// @RequestMapping(value = "/ruleTableChange*",method = RequestMethod.GET) @RequestMapping(value = "/ruleTableChange*",method = RequestMethod.GET)
// @ResponseBody @ResponseBody
// public void modelTableChange( public void modelTableChange(
// @RequestParam(value = "provinceId", defaultValue="") String provinceId, @RequestParam(value = "province", defaultValue="") String province,
// @RequestParam(value = "channelId", defaultValue="") String channelId, @RequestParam(value = "channel", defaultValue="") String channel,
// @RequestParam(value = "kpiId", defaultValue="") String kpiId, @RequestParam(value = "datasource", defaultValue="") String datasource,
// @RequestParam(value = "businessId", defaultValue="") String businessId, @RequestParam(value = "business", defaultValue="") String business,
// HttpServletResponse response) throws UnsupportedEncodingException{ HttpServletResponse response) throws UnsupportedEncodingException{
// staticProvinceId = provinceId;
// staticChannelId = channelId; cmszOperationLogService.createLog("查询","质量规则","由筛选项得到质量规则");
// staticKpiId = kpiId; List<QualityRule> qualityRuleS;
// staticBusinessId = businessId; //将String型转换成List
// List<QualityRule> qualityRuleList = new ArrayList<QualityRule>(); String[] channels=channel.split(",");
// int size1=channels.length;
// List<Long> provinceIdList = new ArrayList<Long>(); Long[] channelS=new Long[size1];
// for(int i=0;i<provinceId.split(",").length;i++){ for(int i=0;i<channels.length;i++)
// provinceIdList.add(Long.parseLong(provinceId.split(",")[i])); {
// } channelS[i]=Long.parseLong(channels[i]);
// List<Long> channelIdList = new ArrayList<Long>(); }
// for(int i=0;i<channelId.split(",").length;i++){ //将String型转换成List
// channelIdList.add(Long.parseLong(channelId.split(",")[i])); String[] dataSources=datasource.split(",");
// } int size2=dataSources.length;
// List<Long> kpiIdList = new ArrayList<Long>(); Long[] dataSourceS=new Long[size2];
// for(int i=0;i<kpiId.split(",").length;i++){ for(int i=0;i<dataSources.length;i++)
// kpiIdList.add(Long.parseLong(kpiId.split(",")[i])); {
// } dataSourceS[i]=Long.parseLong(dataSources[i]);
// List<Long> businessIdList = new ArrayList<Long>(); }
// for(int i=0;i<businessId.split(",").length;i++){ //将String型转换成List
// businessIdList.add(Long.parseLong(businessId.split(",")[i])); String[] businesss=business.split(",");
// } int size3=dataSources.length;
// Long[] businessS=new Long[size3];
// if(provinceId.equals("") && channelId.equals("") && businessId.equals("") && kpiId.equals("")){ for(int i=0;i<businesss.length;i++)
// qualityRuleList = qualityRuleDao.findAll(); {
// } else { businessS[i]=Long.parseLong(businesss[i]);
// qualityRuleList = qualityRuleDao.findByProvinceIdInAndBusinessIdInAndKpiIdInAndChannelIdInOrderByQualityRuleIdDesc(provinceIdList, businessIdList, kpiIdList, channelIdList); }
// } //将String型转换成List
// String[] provinces=province.split(",");
// cmszOperationLogService.createLog("查询","质量规则","由筛选项得到质量规则"); int size4=dataSources.length;
// staticQualityRuleList = qualityRuleList; Long[] provinceS=new Long[size4];
// for(int i=0;i<provinces.length;i++)
// Gson gson = new Gson(); {
// response.setContentType("text/Xml;charset=gbk"); provinceS[i]=Long.parseLong(provinces[i]);
// PrintWriter out = null; }
// try {
// out = response.getWriter(); qualityRuleS=qualityRuleService.getAllQualityRuleByOther(provinceS, dataSourceS, channelS, businessS);
// out.println(gson.toJson(qualityRuleList));
// } catch (IOException e) { Gson gson = new Gson();
// // TODO Auto-generated catch block response.setContentType("text/Xml;charset=gbk");
// e.printStackTrace(); PrintWriter out = null;
// } try {
// out = response.getWriter();
// } out.println(gson.toJson(qualityRuleS));
// } catch (IOException e) {
// //删掉质量规则 // TODO Auto-generated catch block
// @RequestMapping(value = "/deleteOneRule*",method = RequestMethod.GET) e.printStackTrace();
// @ResponseBody }
// public void deleteRule(
// @RequestParam(value = "qualityRuleId") String qualityRuleId, }
// HttpServletResponse response){
// List<Long> qualityRuleIdList = new ArrayList<Long>(); //删掉质量规则
// String[] qualityRuleIdStr = qualityRuleId.split(","); @RequestMapping(value = "/deleteOneRule*",method = RequestMethod.GET)
// for(int i=0; i<qualityRuleIdStr.length; i++){ @ResponseBody
// qualityRuleIdList.add(Long.parseLong(qualityRuleIdStr[i])); public void deleteRule(
// } @RequestParam(value = "qualityRuleId") String qualityRuleId,
// HttpServletResponse response){
// qualityRuleService.deleteByQualityRuleId(qualityRuleIdList); List<Long> qualityRuleIdList = new ArrayList<Long>();
// accuracyRuleService.deleteAccuracyRuleByQualityRuleId(qualityRuleIdList); String[] qualityRuleIdStr = qualityRuleId.split(",");
// cmszOperationLogService.createLog("删除","更新质量规则","quality_rule_warehouse_info_t. QUALITY_RULE_ID="+qualityRuleId); for(int i=0; i<qualityRuleIdStr.length; i++){
// //刷新模型表格 qualityRuleIdList.add(Long.parseLong(qualityRuleIdStr[i]));
// List<QualityRule> qualityRuleList = new ArrayList<QualityRule>(); }
// qualityRuleList = qualityRuleDao.findAll();
// staticQualityRuleList = qualityRuleList; qualityRuleService.deleteByQualityRuleId(qualityRuleIdList);
// accuracyRuleService.deleteAccuracyRuleByQualityRuleId(qualityRuleIdList);
// Gson gson = new Gson(); cmszOperationLogService.createLog("删除","更新质量规则","quality_rule_warehouse_info_t. QUALITY_RULE_ID="+qualityRuleId);
// response.setContentType("text/Xml;charset=gbk"); //刷新模型表格
// PrintWriter out = null; List<QualityRule> qualityRuleList = (List<QualityRule>) qualityRuleDao.findAll();
// staticQualityRuleList = qualityRuleList;
// try {
// out = response.getWriter(); Gson gson = new Gson();
// out.println(gson.toJson(qualityRuleList)); response.setContentType("text/Xml;charset=gbk");
// } catch (IOException e) { PrintWriter out = null;
// // TODO Auto-generated catch block
// e.printStackTrace(); try {
// } out = response.getWriter();
// } out.println(gson.toJson(qualityRuleList));
// } catch (IOException e) {
// //查看准确性规则内容 // TODO Auto-generated catch block
// @RequestMapping(value = "/findAccuracy*",method = RequestMethod.GET) e.printStackTrace();
// @ResponseBody }
// public void findAccuracy( }
// @RequestParam(value = "qualityRuleId") String qualityRuleId,
// HttpServletResponse response){ //查看准确性规则内容
// List<AccuracyRule> accuracyRuleList = accuracyRuleDao.findByQualityRuleId(Long.parseLong(qualityRuleId)); @RequestMapping(value = "/findAccuracy*",method = RequestMethod.GET)
// cmszOperationLogService.createLog("查询","准确性规则","查询准确性规则"); @ResponseBody
// Gson gson = new Gson(); public void findAccuracy(
// response.setContentType("text/Xml;charset=gbk"); @RequestParam(value = "qualityRuleId") String qualityRuleId,
// PrintWriter out = null; HttpServletResponse response){
// List<AccuracyRule> accuracyRuleList = accuracyRuleDao.findByQualityRuleId(Long.parseLong(qualityRuleId));
// try { cmszOperationLogService.createLog("查询","准确性规则","查询准确性规则");
// out = response.getWriter(); Gson gson = new Gson();
// out.println(gson.toJson(accuracyRuleList)); response.setContentType("text/Xml;charset=gbk");
// } catch (IOException e) { PrintWriter out = null;
// // TODO Auto-generated catch block
// e.printStackTrace(); try {
// } out = response.getWriter();
// } out.println(gson.toJson(accuracyRuleList));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
} }
package com.hp.cmsz.web.commonmanage; package com.hp.cmsz.web.commonmanage;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.util.List;
//import com.hp.cmsz.entity.APPEWarningDetail;
import com.hp.cmsz.entity.*;
import com.hp.cmsz.repository.*;
import com.hp.cmsz.service.PublicService;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.regexp.RE;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
...@@ -19,6 +25,9 @@ import com.hp.cmsz.service.commonmanage.RunTaskService; ...@@ -19,6 +25,9 @@ import com.hp.cmsz.service.commonmanage.RunTaskService;
import com.hp.cmsz.service.commonmanage.TaskDetailService; import com.hp.cmsz.service.commonmanage.TaskDetailService;
import com.hp.cmsz.web.PageURLController; import com.hp.cmsz.web.PageURLController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Controller @Controller
@RequestMapping(value = "/BaseManage/TaskManage/*") @RequestMapping(value = "/BaseManage/TaskManage/*")
public class TaskManageController { public class TaskManageController {
...@@ -31,6 +40,25 @@ public class TaskManageController { ...@@ -31,6 +40,25 @@ public class TaskManageController {
@Autowired @Autowired
private CmszOperationLogService cmszOperationLogService; private CmszOperationLogService cmszOperationLogService;
@Autowired
private ModelParameterDao modelParameterDao;
@Autowired
private ChannelDao channelDao;
@Autowired
private DataSourceDao dataSourceDao;
@Autowired
private BusinessDao businessDao;
@Autowired
private com.hp.cmsz.repository.PublicDao PublicDao;
@Autowired
private ChannelDataSourceMapDao channelDataSourceMapDao;
@RequestMapping(value = "/taskHome") @RequestMapping(value = "/taskHome")
public ModelAndView taskHome(String selectTab) { public ModelAndView taskHome(String selectTab) {
ModelAndView modelAndView = new ModelAndView(PageURLController.TaskHome); ModelAndView modelAndView = new ModelAndView(PageURLController.TaskHome);
...@@ -80,6 +108,7 @@ public class TaskManageController { ...@@ -80,6 +108,7 @@ public class TaskManageController {
} }
Page<RunTask> taskList = runTaskService.getRunTaskPage(runTask, pageNumber, pageSize, sortType); Page<RunTask> taskList = runTaskService.getRunTaskPage(runTask, pageNumber, pageSize, sortType);
System.out.println(taskList.getSize());
modelAndView.addObject("taskList", taskList); modelAndView.addObject("taskList", taskList);
//modelAndView.addObject("queryCondition", runTask); //modelAndView.addObject("queryCondition", runTask);
modelAndView.addObject("pageSize", pageSize); modelAndView.addObject("pageSize", pageSize);
...@@ -125,19 +154,49 @@ public class TaskManageController { ...@@ -125,19 +154,49 @@ public class TaskManageController {
runTask = runTaskService.getRunTask(taskId); runTask = runTaskService.getRunTask(taskId);
} else { } else {
runTask = new RunTask(); runTask = new RunTask();
runTaskService.saveRunTask(runTask);//能够让模型参数根据任务id来进行关联,先把taskId传到前端
} }
if (StringUtils.isNotEmpty(defaultTaskType)) { if (StringUtils.isNotEmpty(defaultTaskType)) {
runTask.setDefaultTaskType(new Long(defaultTaskType)); runTask.setDefaultTaskType(new Long(defaultTaskType));
} }
//模型列表
List<DataModel> dataModelList = runTaskService.getDataModelViewList();
//默认第一个模型的参数列表
List<ModelParameter> modelParameterList = null;
if(dataModelList.size()!=0){
modelParameterList = modelParameterDao.findByDataModelIdAndIfSystemDefault(dataModelList.get(0).getDataModelId(),0L);
}
//查询出所以省份信息
List<Province> provinceList = (List<Province>) PublicDao.findAll();
//查询出所有的渠道信息
List<Channel> channelList=(List<Channel>)channelDao.findChannel();
//查询出所有的数据来源信息
List<DataSource> datasourceList=(List<DataSource>)dataSourceDao.findDataSource();
//查询出所有的业务
List<Business> businessList= (List<Business>) businessDao.findAll();
List<ChannelDataSourceMap> channelDataSourceMapList = (List<ChannelDataSourceMap>) channelDataSourceMapDao.findAll();
modelAndView.addObject("runTask", runTask); modelAndView.addObject("runTask", runTask);
modelAndView.addObject("provinceList", provinceList);
modelAndView.addObject("channelList", channelList);
modelAndView.addObject("datasourceList", datasourceList);
modelAndView.addObject("businessList", businessList);
modelAndView.addObject("channelDataSourceMapList", channelDataSourceMapList);
//modelAndView.addObject("isModel", isModel); //modelAndView.addObject("isModel", isModel);
modelAndView.addObject("taskGroupList", runTaskService.getTaskGroupList()); modelAndView.addObject("taskGroupList", runTaskService.getTaskGroupList());
/*modelAndView.addObject("taskTypeList", runTaskService.getTaskTypeList());*/ /*modelAndView.addObject("taskTypeList", runTaskService.getTaskTypeList());*/
modelAndView.addObject("sanboxList", taskDetailService.findTaskList(RunTaskDetail.TASK_TYPE_SANDBOX)); modelAndView.addObject("sanboxList", taskDetailService.findTaskList(RunTaskDetail.TASK_TYPE_SANDBOX));
modelAndView.addObject("recoverList", taskDetailService.findTaskList(RunTaskDetail.TASK_TYPE_RECOVER)); modelAndView.addObject("recoverList", taskDetailService.findTaskList(RunTaskDetail.TASK_TYPE_RECOVER));
modelAndView.addObject("dataModelList", runTaskService.getDataModelViewList()); modelAndView.addObject("dataModelList", dataModelList);
modelAndView.addObject("dataModelParameterList", modelParameterList);
modelAndView.addObject("taskTypeList", runTaskService.getTaskTypeList()); modelAndView.addObject("taskTypeList", runTaskService.getTaskTypeList());
cmszOperationLogService.createLog("新增", "模型任务", "RUN_TASK_T.taskId=" + runTask.getTaskId());
return modelAndView; return modelAndView;
} }
...@@ -175,6 +234,37 @@ public class TaskManageController { ...@@ -175,6 +234,37 @@ public class TaskManageController {
return url; return url;
} }
@RequestMapping(value = "/getModelParameterList")
@ResponseBody
public List<ModelParameter> getModelParameterList(String modelId){
return modelParameterDao.findByDataModelIdAndIfSystemDefault(Long.parseLong(modelId),0L);
}
@RequestMapping(value = "/createModelParam*", method = RequestMethod.GET)
@ResponseBody
public void createModelParam(
@RequestParam(value="paramName") String paramName,
@RequestParam(value="paramValue") String paramValue,
@RequestParam(value="paramType") String paramType,
@RequestParam(value="taskId") String taskId,
@RequestParam(value="modelId") String modelId,
HttpServletResponse response, HttpServletRequest request) {
ModelParameter modelParameter = new ModelParameter();
if(!paramName.trim().equals("")){modelParameter.setParameterName(paramName);}
if(!paramValue.trim().equals("")){modelParameter.setParameterValue(paramValue);}
if(!paramType.trim().equals("")){modelParameter.setParameterDataType(paramType);}
if(!taskId.trim().equals("")){modelParameter.setTaskId(Long.parseLong(taskId));}
if(!modelId.trim().equals("")){modelParameter.setDataModelId(Long.parseLong(modelId));}
modelParameter.setIfSystemDefault(1L);
modelParameterDao.save(modelParameter);
}
@RequestMapping(value = "/taskDeleteFrame") @RequestMapping(value = "/taskDeleteFrame")
public String taskDeleteFrame(Long taskId, @RequestParam(required = false) String defaultTaskType) { public String taskDeleteFrame(Long taskId, @RequestParam(required = false) String defaultTaskType) {
runTaskService.deleteRunTask(taskId); runTaskService.deleteRunTask(taskId);
...@@ -198,4 +288,13 @@ public class TaskManageController { ...@@ -198,4 +288,13 @@ public class TaskManageController {
@RequestParam(required = false) String defaultTaskType) throws UnsupportedEncodingException { @RequestParam(required = false) String defaultTaskType) throws UnsupportedEncodingException {
return runTaskService.checkNameAndCode(java.net.URLDecoder.decode(name, "UTF-8"), code, id, defaultTaskType); return runTaskService.checkNameAndCode(java.net.URLDecoder.decode(name, "UTF-8"), code, id, defaultTaskType);
} }
// public APPEWarningDetail ModelPreview(String id){
//
//
// return null;
// };
} }
\ No newline at end of file
...@@ -109,9 +109,8 @@ public class ModelMaintainController { ...@@ -109,9 +109,8 @@ public class ModelMaintainController {
if(!paramName.trim().equals("")){modelParameter.setParameterName(paramName);} if(!paramName.trim().equals("")){modelParameter.setParameterName(paramName);}
if(!paramValue.trim().equals("")){modelParameter.setParameterValue(paramValue);} if(!paramValue.trim().equals("")){modelParameter.setParameterValue(paramValue);}
if(!paramType.trim().equals("")){modelParameter.setParameterDataType(paramType);} if(!paramType.trim().equals("")){modelParameter.setParameterDataType(paramType);}
modelParameter.setIfSystemDefault(0L);
modelParameterDao.save(modelParameter); modelParameterDao.save(modelParameter);
Long dataModelId = modelParameter.getParameterId(); Long dataModelId = modelParameter.getParameterId();
dataModelIdList.add(dataModelId); dataModelIdList.add(dataModelId);
} }
......
...@@ -103,7 +103,7 @@ public class ModelParameterConfigurationController { ...@@ -103,7 +103,7 @@ public class ModelParameterConfigurationController {
if(!dataModelId.trim().equals("")){ if(!dataModelId.trim().equals("")){
dataModel = dataModelDao.findByDataModelId(Long.parseLong(dataModelId)); dataModel = dataModelDao.findByDataModelId(Long.parseLong(dataModelId));
modelParameterList = modelParameterDao.findByDataModelId(Long.parseLong(dataModelId)); modelParameterList = modelParameterDao.findByDataModelIdAndIfSystemDefault(Long.parseLong(dataModelId),0L);
} }
......
...@@ -428,6 +428,9 @@ public class RegularityAnalysisController { ...@@ -428,6 +428,9 @@ public class RegularityAnalysisController {
//Comment by Huach on 20140731 begin //Comment by Huach on 20140731 begin
String dbConXml =Constant.CONFIG_FILE;// "/home/pentaho/conf" + System.getProperty("file.separator") + "application.properties"; String dbConXml =Constant.CONFIG_FILE;// "/home/pentaho/conf" + System.getProperty("file.separator") + "application.properties";
//Comment by Huach on 20140731 end //Comment by Huach on 20140731 end
System.out.println("-=====");
System.out.println(PropertiesUtil.readValue(dbConXml, "jdbc.dbip"));
System.out.println("======");
s.set("dbHost", PropertiesUtil.readValue(dbConXml, "jdbc.dbip")); s.set("dbHost", PropertiesUtil.readValue(dbConXml, "jdbc.dbip"));
s.set("dbPort", Integer.valueOf(PropertiesUtil.readValue(dbConXml, "jdbc.dbport"))); s.set("dbPort", Integer.valueOf(PropertiesUtil.readValue(dbConXml, "jdbc.dbport")));
......
...@@ -12,7 +12,7 @@ local.ip.prefix=192.168 ...@@ -12,7 +12,7 @@ local.ip.prefix=192.168
#jdbc.driver=com.vertica.jdbc.Driver #jdbc.driver=com.vertica.jdbc.Driver
#vertica database ip address #vertica database ip address
jdbc.dbip=192.168.113.117 jdbc.dbip=hg-computer
jdbc.dbport=5433 jdbc.dbport=5433
......
...@@ -12,7 +12,7 @@ local.ip.prefix=192.168 ...@@ -12,7 +12,7 @@ local.ip.prefix=192.168
#jdbc.driver=com.vertica.jdbc.Driver #jdbc.driver=com.vertica.jdbc.Driver
#vertica database ip address #vertica database ip address
jdbc.dbip=192.168.113.117 jdbc.dbip=hg-computer
jdbc.dbport=5433 jdbc.dbport=5433
......
...@@ -22,13 +22,6 @@ ...@@ -22,13 +22,6 @@
.table-null tr td:last-child .form-control,.table-null tr td:last-child table{ .table-null tr td:last-child .form-control,.table-null tr td:last-child table{
width: 400px; width: 400px;
} }
.file-box{ position:relative;}
.file{ position:absolute; top:0; height:30px; filter:alpha(opacity:0);opacity:0;width:470px;cursor: pointer; }
/* .file-box{ position:relative;width:340px}
.txt{ height:22px; border:1px solid #cdcdcd; width:180px;}
.btn{ background-color:#FFF; border:1px solid #CDCDCD;height:24px; width:70px;}
.file{ position:absolute; top:0; right:80px; height:24px; filter:alpha(opacity:0);opacity: 0;width:260px } */
</style> </style>
</head> </head>
...@@ -53,60 +46,68 @@ ...@@ -53,60 +46,68 @@
<form action="#" class="form-horizontal" id="ruleMaintainForm" method="post" enctype="multipart/form-data"> <form action="#" class="form-horizontal" id="ruleMaintainForm" method="post" enctype="multipart/form-data">
<table id="ruleMaintainTable" class="table-null"> <table id="ruleMaintainTable" class="table-null">
<tr><td>省份(<font color="red">必填</font>):</td> <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}">
<option value="${dataSource.dataSourceId}">${dataSource.dataSourceName}</option>
</c:forEach>
</select></td>
</tr> </tr>
<tr><td>渠道(<font color="red">必填</font>):</td> <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}">
<option value="${channel.channelId}">${channel.channelName}</option>
</c:forEach>
</select></td>
</tr> </tr>
<tr><td>业务(<font color="red">必填</font>):</td> <tr><td>业务(<font color="red">必填</font>):</td>
<td><tags:BusinessTag /></td> <td >
<div id="businesstd"></div>
<input type="hidden" id="business" name="business" value='${businessList}' />
</td>
</tr> </tr>
<tr><td>数据来源(<font color="red">必填</font>):</td> <tr><td>指标(<font color="red">必填</font>):</td>
<td><tags:DataSourceTag /></td> <td>
<div id="kpitd"></div>
<input type="hidden" id="kpi" name="kpi" value='${kpiList}' />
</td>
</tr> </tr>
<tr><td>数据采集频率(<font color="red">必填</font>):</td> <tr><td>数据采集频率(<font color="red">必填</font>):</td>
<td><select class="form-control" name="" id="" style="display: inline;"> <td><select class="form-control" name="calCycle" id="calCycle" style="display: inline;">
<option value="0">30分钟</option> <option value="30MI">30分钟</option>
<option value="1">1小时</option> <option value="01HR">1小时</option>
<option value="2">1天</option> <option value="01DY">1天</option>
<option value="3">1月</option> <option value="01MO">1月</option>
</select></td></tr> </select></td></tr>
<tr><td>指标检测时间(<font color="red">必填</font>):</td> <tr><td>指标监控时间(<font color="red">必填</font>):</td>
<td> <td>
<div> <input type="text" style="width:200px" name="kpiMonitorTime" id="kpiMonitorTime" style="display: inline;" />
<input type="text" class="form-control" name="kpiMonitorTime" id="kpiMonitorTime" style="display: inline;" /> <select style="width:200px" name="kpiUnit" id="kpiUnit" style="display: inline;">
<select class="form-control" name="" id="" style="display: inline;">
<option value="0">分钟</option> <option value="0">分钟</option>
<option value="1">小时</option> <option value="1">小时</option>
<option value="2"></option> <option value="2"></option>
<option value="3"></option> <option value="3"></option>
</select> </select></td>
</div></td>
</tr> </tr>
<tr><td>指标检测范围<font color="red">必填</font>):</td> <tr><td>指标业务时间<font color="red">必填</font>):</td>
<td> <td>
<div> <input type="text" class="form-control" name="businessTime" id="businessTime" onFocus="WdatePicker({maxDate:'#F{$dp.$D(\'businessTime\')}'})" />
<input type="text" class="form-control" name="kpiMonitorRange" id="kpiMonitorRange" style="display: inline;" /> </td>
<select class="form-control" name="" id="" style="display: inline;">
<option value="0">分钟</option>
<option value="1">小时</option>
<option value="2"></option>
<option value="3"></option>
</select>
</div></td>
</tr> </tr>
<tr><td>完整性阈值(<font color="red">必填</font>):</td><td><input type='text' name='integrityThresholdValue' id='integrityThresholdValue' class="form-control" style="display: inline;"/></td></tr>
<tr><td>及时性阈值(<font color="red">必填</font>):</td><td><input type='text' name='timelinessThresholdValue' id='timelinessThresholdValue' class="form-control" style="display: inline;"/></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 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> <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>
<tr><td>准确性规则:</td> <tr><td>准确性规则:</td>
<td><select class="form-control" name="accuracyRule" id="accuracyRule" > <td><select class="form-control" name="ruleType" id="ruleType" >
<option value="0"></option> <option value=""></option>
<option value="1">范围类</option> <option value="1">范围类</option>
<option value="2">重复类</option> <option value="2">重复类</option>
</select></td></tr> </select></td></tr>
<tr class="range"><td>范围最大值:</td><td><input type="text" class="form-control" name="scopeMaxValue" id="scopeMaxValue" /></td></tr> <tr class="range"><td>范围最大值:</td><td><input type="text" class="form-control" name="scopeMaxValue" id="scopeMaxValue" /></td></tr>
<tr class="range"><td>范围最小值:</td><td><input type="text" class="form-control" name="scopeMinValue" id="scopeMinValue" /></td></tr> <tr class="range"><td>范围最小值:</td><td><input type="text" class="form-control" name="scopeMinValue" id="scopeMinValue" /></td></tr>
<tr class="repeate"><td>重复考核粒度:</td><td><input type='text' name='repeatedCheckGranularity' id='repeatedCheckGranularity' class="form-control" style="display: inline;"/></td></tr> <tr class="repeate"><td>重复考核粒度:</td><td><input type='text' name='repeatedCheckGranularity' id='repeatedCheckGranularity' class="form-control" style="display: inline;"/></td></tr>
...@@ -116,7 +117,6 @@ ...@@ -116,7 +117,6 @@
<tr class="repeate"><td>重复最大次数:</td><td><input type='text' name='repeatedCheckMaxTime' id='repeatedCheckMaxTime' class="form-control" style="display: inline;"/></td></tr> <tr class="repeate"><td>重复最大次数:</td><td><input type='text' name='repeatedCheckMaxTime' id='repeatedCheckMaxTime' class="form-control" style="display: inline;"/></td></tr>
<tr class="repeate"><td>数据是否累计:</td><td><input type='text' name='ifRepeatedCheckSummation' id='ifRepeatedCheckSummation' class="form-control" style="display: inline;"/></td></tr> <tr class="repeate"><td>数据是否累计:</td><td><input type='text' name='ifRepeatedCheckSummation' id='ifRepeatedCheckSummation' class="form-control" style="display: inline;"/></td></tr>
<tr><td></td><td><button type="button" id="ruleSubmit" class="btn btn-primary">确定</button> <tr><td></td><td><button type="button" id="ruleSubmit" class="btn btn-primary">确定</button>
<button type="reset" class="btn btn-warning" id="ruleBack">返回</button> <button type="reset" class="btn btn-warning" id="ruleBack">返回</button>
</td></tr> </td></tr>
</table> </table>
...@@ -132,10 +132,10 @@ ...@@ -132,10 +132,10 @@
<script type="text/javascript"> <script type="text/javascript">
$(".range").hide(); $(".range").hide();
$(".repeate").hide(); $(".repeate").hide();
$("#accuracyRule").change(function (){ $("#ruleType").change(function (){
var selectValue = $("#accuracyRule").val(); var selectValue = $("#ruleType").val();
console.log(selectValue); console.log(selectValue);
if (selectValue == 0){ if (selectValue == ""){
$(".range").hide(); $(".range").hide();
$(".repeate").hide(); $(".repeate").hide();
} }
...@@ -149,54 +149,54 @@ $("#accuracyRule").change(function (){ ...@@ -149,54 +149,54 @@ $("#accuracyRule").change(function (){
} }
}) })
//form表单重置
$("#modelReset").click(function(){
deleteAllTr();
});
//form表单提交 //form表单提交
$("#modelSubmit").click(function(){ $("#ruleSubmit").click(function(){
if($.trim($("#dataModelName").val())==""){ if($.trim($("kpiMonitorTime").val())==""){
$.alert("数据模型名称不能为空"); $.alert("指标监控时间不能为空");
}else if($("#modelExeScriptName").val()==""){ }else if($("#businessTime").val()==""){
$.alert("模型执行脚本不能为空"); $.alert("指标业务时间不能为空");
}else if($("#businessStartTime").val()==""){ }else if($("#ruleCrtTime").val()==""){
$.alert("业务开始时间不能为空"); $.alert("规则创建时间不能为空");
}else if($("#businessEndTime").val()==""){ }else if($("#ruleUpdateTime").val()==""){
$.alert("业务结束时间不能为空"); $.alert("规则更新时间不能为空");
}else{ }else{
if($.trim($("#paramName").val())!=""){ if($.trim($("#ruleType").val())!=""){
$.dialog({ $.dialog({
title: "提醒", title: "提醒",
content: "有参数尚未添加,确定提交", content: "有准确性规则参数尚未添加,确定提交",
ok: function(){ ok: function(){
$("#modelSubmit").attr("disabled",true); $("#ruleSubmit").attr("disabled",true);
var i = $("#addTr").find("tr").size(); var i = $("#addTr").find("tr").size();
if(i==0){ if(i==0){
var createForm=$("#modelMaintainForm"); var createForm=$("#ruleMaintainForm");
createForm.attr("action","${ctx}/ModelManage/ModelMaintain/saveModelDataForm"); createForm.attr("action","${ctx}/AnalysisSupport/QualityRuleMaintain/saveRuleDataForm");
createForm.submit(); createForm.submit();
createForm.attr("action","#"); createForm.attr("action","#");
}else{ }else{
$("#addTr").find("tr").each(function(){ $("#addTr").find("tr").each(function(){
//alert($(this).find("td").eq(0).html()); var ruleType = $(this).find("td").eq(0).html();
var paramName = $(this).find("td").eq(0).html(); var scopeMaxValue = $(this).find("td").eq(1).html();
var paramValue = $(this).find("td").eq(1).html(); var scopeMinValue = $(this).find("td").eq(2).html();
var paramType = $(this).find("td").eq(2).html(); var repeatedCheckGranularity = $(this).find("td").eq(3).html();
var repeatedCheckStartTime = $(this).find("td").eq(4).html();
var repeatedCheckEndTime = $(this).find("td").eq(5).html();
var ifRepeatedCheckSeries = $(this).find("td").eq(6).html();
var repeatedCheckMaxTime = $(this).find("td").eq(7).html();
var ifRepeatedCheckSummation = $(this).find("td").eq(8).html();
$.ajax({ $.ajax({
type : "GET", type : "GET",
contentType : "application/json", contentType : "application/json",
url: "${ctx}/ModelManage/ModelMaintain/createModelParam?paramName="+encodeURIComponent(paramName)+"&paramValue="+encodeURIComponent(paramValue)+"&paramType="+encodeURIComponent(paramType), url: "${ctx}/AnalysisSupport/QualityRuleMaintain/createAccuracyRule?ruleType="+ruleType+"&scopeMaxValue="+scopeMaxValue+"&scopeMinValue="+scopeMinValue+"&repeatedCheckGranularity="+repeatedCheckGranularity+"&repeatedCheckStartTime="+repeatedCheckStartTime+"&repeatedCheckEndTime="+repeatedCheckEndTime+"&scopeMinValue="+ifRepeatedCheckSeries+"&ifRepeatedCheckSeries="+repeatedCheckMaxTime+"&repeatedCheckMaxTime="+ifRepeatedCheckSummation+"&ifRepeatedCheckSummation=",
dataType : "text", dataType : "text",
async: false, async: false,
beforeSend: function(data) {}, beforeSend: function(data) {},
success: function(){ success: function(){
i--; i--;
if(i==0){ if(i==0){
var createForm=$("#modelMaintainForm"); var createForm=$("#ruleMaintainForm");
createForm.attr("action","${ctx}/ModelManage/ModelMaintain/saveModelDataForm"); createForm.attr("action","${ctx}/AnalysisSupport/QualityRuleMaintain/saveRuleDataForm");
createForm.submit(); createForm.submit();
createForm.attr("action","#"); createForm.attr("action","#");
} }
...@@ -210,32 +210,37 @@ $("#accuracyRule").change(function (){ ...@@ -210,32 +210,37 @@ $("#accuracyRule").change(function (){
cancelValue: "取消", cancelValue: "取消",
}); });
}else{ }else{
$("#modelSubmit").attr("disabled",true); $("#ruleSubmit").attr("disabled",true);
var i = $("#addTr").find("tr").size(); var i = $("#addTr").find("tr").size();
if(i==0){ if(i==0){
var createForm=$("#modelMaintainForm"); var createForm=$("#ruleMaintainForm");
createForm.attr("action","${ctx}/ModelManage/ModelMaintain/saveModelDataForm"); createForm.attr("action","${ctx}/AnalysisSupport/QualityRuleMaintain/saveRuleDataForm");
createForm.submit(); createForm.submit();
createForm.attr("action","#"); createForm.attr("action","#");
}else{ }else{
$("#addTr").find("tr").each(function(){ $("#addTr").find("tr").each(function(){
//alert($(this).find("td").eq(0).html()); var ruleType = $(this).find("td").eq(0).html();
var paramName = $(this).find("td").eq(0).html(); var scopeMaxValue = $(this).find("td").eq(1).html();
var paramValue = $(this).find("td").eq(1).html(); var scopeMinValue = $(this).find("td").eq(2).html();
var paramType = $(this).find("td").eq(2).html(); var repeatedCheckGranularity = $(this).find("td").eq(3).html();
var repeatedCheckStartTime = $(this).find("td").eq(4).html();
var repeatedCheckEndTime = $(this).find("td").eq(5).html();
var ifRepeatedCheckSeries = $(this).find("td").eq(6).html();
var repeatedCheckMaxTime = $(this).find("td").eq(7).html();
var ifRepeatedCheckSummation = $(this).find("td").eq(8).html();
$.ajax({ $.ajax({
type : "GET", type : "GET",
contentType : "application/json", contentType : "application/json",
url: "${ctx}/ModelManage/ModelMaintain/createModelParam?paramName="+encodeURIComponent(paramName)+"&paramValue="+encodeURIComponent(paramValue)+"&paramType="+encodeURIComponent(paramType), url: "${ctx}/AnalysisSupport/QualityRuleMaintain/createAccuracyRule?ruleType="+ruleType+"&scopeMaxValue="+scopeMaxValue+"&scopeMinValue="+scopeMinValue+"&repeatedCheckGranularity="+repeatedCheckGranularity+"&repeatedCheckStartTime="+repeatedCheckStartTime+"&repeatedCheckEndTime="+repeatedCheckEndTime+"&scopeMinValue="+ifRepeatedCheckSeries+"&ifRepeatedCheckSeries="+repeatedCheckMaxTime+"&repeatedCheckMaxTime="+ifRepeatedCheckSummation+"&ifRepeatedCheckSummation=",
dataType : "text", dataType : "text",
async: false, async: false,
beforeSend: function(data) {}, beforeSend: function(data) {},
success: function(){ success: function(){
i--; i--;
if(i==0){ if(i==0){
var createForm=$("#modelMaintainForm"); var createForm=$("#ruleMaintainForm");
createForm.attr("action","${ctx}/ModelManage/ModelMaintain/saveModelDataForm"); createForm.attr("action","${ctx}/AnalysisSupport/QualityRuleMaintain/saveRuleDataForm");
createForm.submit(); createForm.submit();
createForm.attr("action","#"); createForm.attr("action","#");
} }
...@@ -248,9 +253,114 @@ $("#accuracyRule").change(function (){ ...@@ -248,9 +253,114 @@ $("#accuracyRule").change(function (){
} }
}); });
$("#modelBack").click(function(){ $("#ruleBack").click(function(){
location.href="${ctx}/ModelManage/ModelResult"; location.href="${ctx}/AnalysisSupport/QualityRuleResult";
});
var dataSourceValue = $("#dataSource").val();
var channelValue = $("#channel").val();
$("#dataSource").change(function(){
dataSourceValue = $("#dataSource").val();
console.log(dataSourceValue);
updateBusiness(dataSourceValue,channelValue);
});
$("#channel").change(function(){
channelValue = $("#channel").val();
console.log(channelValue);
updateBusiness(dataSourceValue,channelValue);
});
function getBusinessCheckedValues(){
var businessArray = new Array();
var i=0;
$("#business: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;
}
var businessIds = getBusinessCheckedValuesString();
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();
console.log(data)
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){
console.log(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();
console.log(data)
data = JSON.parse(data)
console.log(data)
data.forEach(function(t){
td.append("<input type='checkbox' name='businessinput' class='businessItem' value='"+t[0]+"' checked >"+t[1]+"</input>")
businessIds+=t[0]+",";
console.log("ids:"+businessIds);
}); });
updateKpi(businessIds);
}
});
$("#business").click(function(){
var clickFlag=true;
$("#business").each(function(){
if($(this).attr("checked") == null||$(this).attr("checked") == false){ clickFlag=false;}
});
$("#business").attr("checked",clickFlag);
updateKpi(businessIds);
});
}
</script> </script>
</body> </body>
......
...@@ -40,12 +40,11 @@ ...@@ -40,12 +40,11 @@
<div class="slideMenu" id="cbp-spmenu-s2" style=""> <div class="slideMenu" id="cbp-spmenu-s2" style="">
<div class="form"> <div class="form">
<tags:ProvinceTag /> <tags:Public_ProvinceTag />
<tags:ChannelTag /> <tags:GJFX_datasource_channle_business/>
<tags:BusinessTag />
<button id="submit" class="btn btn-primary" onclick="modelResultSubmit()">提交</button> <button id="submit" class="btn btn-primary" onclick="ruleResultSubmit()">提交</button>
<button id="disable" class="btn btn-warning" onclick="modelResultReset()">重置</button> <button id="disable" class="btn btn-warning" onclick="ruleResultReset()">重置</button>
</div> </div>
</div> </div>
...@@ -92,8 +91,15 @@ ...@@ -92,8 +91,15 @@
</div> </div>
<script type="text/javascript" src="${ctx}/static/js/ruleResultDetailTable.js"></script> <script type="text/javascript" src="${ctx}/static/js/ruleResultDetailTable.js"></script>
<script type="text/javascript"> <script type="text/javascript">
var receiveRulePageNum = "${rulePageNum}";
ruleResultDetailTable(); ruleResultDetailTable();
if(receiveRulePageNum!=1){
$("#goPageNo").attr("value",receiveRulePageNum);
$("#jumpButton").click();
}
$("#createRule").click(function(){ $("#createRule").click(function(){
$.dialog({ $.dialog({
...@@ -136,6 +142,114 @@ $("#createRule").click(function(){ ...@@ -136,6 +142,114 @@ $("#createRule").click(function(){
}); });
}); });
function ruleResultSubmit(){
var dataSource=getStatsDataSourceCheckedValuesString();
var chnnal=getStatsChannelCheckedValuesString();
var bussines=getStatsBusinessCheckedValuesString();
var province=getProvinceCheckedValuesString();
if(dataSource==""){
$.alert("数据来源的选择不能为空");
}else if(chnnal===""){
$.alert("渠道的选择不能为空");
}else if(bussines===""){
$.alert("业务的选择不能为空");
}else if(province===""){
$.alert("省份的选择不能为空");
}else{
toggleMenu('slidePushMenus');//隐藏筛选项
//数据来源标签
$('#DataSourceTag').text("数据来源").append($("<span class='badge'></span>").text(getStatsDataSourceCheckedValues().length)).attr('data-original-title',getStatsDataSourceCheckedTitles()).tooltip();
//渠道标签
$('#ChannelTag').text("渠道").append($("<span class='badge'></span>").text(getStatsChannelCheckedValues().length)).attr('data-original-title',getStatsChannelCheckedTitles()).tooltip();
//业务标签
$('#BusinessTag').text("业务").append($("<span class='badge'></span>").text(getStatsBusinessCheckedValues().length)).attr('data-original-title',getStatsBusinessCheckedTitlesString()).tooltip();
//省份标签
$('#ProvinceTag').text("省份").append($("<span class='badge'></span>").text(getProvinceCheckedValues().length)).attr('data-original-title',getProvinceCheckedTitles()).tooltip();
$.ajax({
type : 'GET',
contentType : 'application/json',
url: "${ctx}/AnalysisSupport/QualityRuleResult/ruleTableChange?province="+province+"&dataSource="+dataSource+"&chnnal="+chnnal+"&bussines="+bussines,
dataType : 'text',
async: false,
beforeSend: function(data) {
},
success: function(data) {
$("#qualityRuleView").val(data);
ruleResultDetailTable();
ruleId="";
$("#updateRule").attr("disabled", true);
toggleMenu('slidePushMenus2');//隐藏筛选项
updateTag(true);
}
});
}
function ruleResultReset(){
ProvinceReset();
statsDataSourceReset();//三级联动重置
}
//更新按钮点击
$("#updateModel").click(function(){
var pageNum = $("#goPageNo").val();
$.dialog({
title: "提醒",
content:"确定修改模型?",
ok: function(){location.href="${ctx}/AnalysisSupport/RuleConfiguration?qualityRuleId="+ruleId+"&rulePageNum="+pageNum;},
okValue:"确定",
cancel: function(){},
cancelValue:"取消",
lock:true
});
//查看准确性规则
function lookParm(qualityRuleId){
$.dialog({
title:"准确性规则",
content:"<div id='paramList'>"+
"<div class='col-xs-12'><div class='panel panel-default'><div class='panel-heading'>参数列表</div><div class='panel-body'> <table class='table table-hover table-striped'> <thead> <tr> <th width='20%'>参数ID号</th> <th width='35%'>参数名</th> <th width='20%'>参数值</th> <th width='25%'>参数类型</th> </tr> </thead> <tbody> </tbody> </table> </div> </div> </div>"+
"</div>",
lock:true,
width:800,
initialize:function(){
$.ajax({
type : 'GET',
contentType : 'application/json',
url: "${ctx}/AnalysisSupport/QualityRuleResult/findAccuracy?qualityRuleId="+qualityRuleId,
dataType : 'text',
beforeSend: function(data) {
},
success: function(data){
for(var i=0;i<data.length;i++){
if(data[i]=='\"'){
data=data.replace('\"','\'');
}
}
data=eval("("+data+")");
if(data!=null && data!=""){
var paramTbody = $('#paramList tbody');
for(var i=0;i<data.length;i++){
if(data[i].parameterValue=="undefined" || data[i].parameterValue==null || data[i].parameterValue==""){
data[i].parameterValue="";
}
paramTbody.append($("<tr></tr>").append("<td>"+data[i].parameterId+"</td>")
.append("<td>"+data[i].parameterName+"</td>")
.append("<td>"+data[i].parameterValue+"</td>")
.append("<td>"+data[i].parameterDataType+"</td>"));
}
}
}
});
}
});
}
});
}
</script> </script>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -291,7 +291,8 @@ ...@@ -291,7 +291,8 @@
cancel: function(){}, cancel: function(){},
cancelValue: "取消", cancelValue: "取消",
}); });
}else{ }
else{
$("#modelSubmit").attr("disabled",true); $("#modelSubmit").attr("disabled",true);
var i = $("#addTr").find("tr").size(); var i = $("#addTr").find("tr").size();
......
...@@ -28,6 +28,10 @@ ...@@ -28,6 +28,10 @@
$("#taskLogFrame").attr('src', '${ctx}/BaseManage/TaskLogManage/taskLogListFrame'); $("#taskLogFrame").attr('src', '${ctx}/BaseManage/TaskLogManage/taskLogListFrame');
} }
}); });
}); });
</script> </script>
...@@ -60,7 +64,7 @@ ...@@ -60,7 +64,7 @@
<div class="row me-row" style="margin-top:0px"> <div class="row me-row" style="margin-top:0px">
<div class="content clearfix"> <div class="content clearfix">
<div class="row" style="margin-top:0px"> <div class="row" style="margin-top:0px">
<iframe id="taskManageFrame" style="height:680px" scrolling="no" src="${ctx}/BaseManage/TaskManage/taskListFrame?defaultTaskType=1"> </iframe> <iframe id="taskManageFrame" style="height:800px" src="${ctx}/BaseManage/TaskManage/taskListFrame?defaultTaskType=1"> </iframe>
</div> </div>
</div> </div>
</div> </div>
...@@ -69,5 +73,60 @@ ...@@ -69,5 +73,60 @@
</div> </div>
</div> </div>
</div> </div>
<script type="">
function OpenDialog(data) {
// var data = JSON.parse(data);
var content ="<div class='dialog-p' style='max-height: 560px; overflow-y: scroll; overflow-x: auto;'>" +
" <div class='col-xs-12'>" +
" <div class='panel panel-default'>" +
" <div class='panel-heading'>模型预览<input onclick='createWorkingDetail()' id='createWorkingDetail' style='float:right' type='button' class='btn btn-primary' value='参数修改'></div>" +
" <div class='panel-body'>"+
" <table class='table table-vertical'>"+
" <tr><td>"+
" <table class='table table-vertical'>" +
" <tr>" +
" <td width='10%'>省份</td>" +
" <td>自定义</td>" +
" <td width='10%'>数据来源</td>" +
" <td>自定义</td>" +
" <td width='10%'>业务</td>" +
" <td>自定义</td>" +
" <td width='10%'>渠道</td>" +
" <td>自定义</td>" +
" </tr>" +
" <tr>" +
" <td>指标编码</td>" +
" <td>自定义</td>" +
" <td>指标名称</td>" +
" <td>自定义</td>" +
" <td>预测开始时间</td>" +
" <td>自定义</td>" +
" <td>预测结束时间</td>" +
" <td>自定义</td>" +
" </tr>" +
" <tr>" +
" <td colspan='8' align='center'>图表展示</td>" +
" </tr>" +
" <tr>" +
" <td colspan='8'>" +
" <div class=''>" +
<%--" <iframe id='ewarningIf' style='height:560px;padding: 7px;' scrolling='no' src='${biserver_config}&path=MonitorOperation/WarnAnalysis&action=GJFX_DETAIL_RELATED_EWARN.xaction&wrapper=false&height=534&WarningID="+getCol(t1, 'warningId')+ "&WarningSourceTag="+getCol(t1, 'warningSourceId')+ "&ctx=${ctx}" +"'></iframe>" +--%>
" </div>" +
" </td>" +
" </tr>" +
"</table>";
$.dialog({
title:'模型预览结果',
content:content,
lock: true
});
}
function preview() {
OpenDialog();
}
</script>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
</style> </style>
<script type="text/javascript" src="${ctx}/static/js/validation.js"></script> <script type="text/javascript" src="${ctx}/static/js/validation.js"></script>
<script language="javascript"> <script language="javascript" type="text/javascript">
var sandboxOptions = new Array(); var sandboxOptions = new Array();
var recoverOptions = new Array(); var recoverOptions = new Array();
var dataModelOptions = new Array(); var dataModelOptions = new Array();
...@@ -34,6 +34,10 @@ var minuteOption = new Array(); ...@@ -34,6 +34,10 @@ var minuteOption = new Array();
var hourOption = new Array(); var hourOption = new Array();
var dayOption = new Array(); var dayOption = new Array();
var monthOption = new Array(); var monthOption = new Array();
var provinceOptions = new Array();
var datasourceOptions = new Array();
var channelOptions = new Array();
var businessOptions = new Array();
$(document).ready(function() { $(document).ready(function() {
changeInputStatus('parallelFlg', 'parallelNums'); changeInputStatus('parallelFlg', 'parallelNums');
...@@ -56,6 +60,60 @@ var monthOption = new Array(); ...@@ -56,6 +60,60 @@ var monthOption = new Array();
</c:forEach> </c:forEach>
$('#modelId').append(dataModelOptions); $('#modelId').append(dataModelOptions);
<c:forEach items="${provinceList}" var="province">
var option = new Option('${province.provinceName}','${province.provinceId}');
provinceOptions.push(option);
</c:forEach>
$('#provinceId').append(provinceOptions);
<c:forEach items="${datasourceList}" var="datasource" varStatus="status">
var option = new Option('${datasource.dataSourceName}','${datasource.dataSourceId}');
datasourceOptions.push(option);
<c:if test ="${status.first}">
<c:forEach items="${channelDataSourceMapList}" var="channelDataSourceMap" >
<c:if test ="${channelDataSourceMap.dataSourceId == datasource.dataSourceId}">
var channelName = "";
<c:forEach items="${channelList}" var="channel" varStatus="channelStatus">
<c:if test="${channel.channelId == channelDataSourceMap.channelId}" >
channelName='${channel.channelName}';
</c:if>
</c:forEach>
var channelOption = new Option(channelName,'${channelDataSourceMap.channelId}');
channelOptions.push(channelOption);
</c:if>
</c:forEach>
</c:if>
</c:forEach>
$('#datasourceViewId').append(datasourceOptions);
$('#channelId').append(channelOptions);
function changeBusinessData(){
$('#businessId').empty();
businessOptions=[];
<c:forEach items="${channelDataSourceMapList}" var="channelDataSourceMap">
if('${channelDataSourceMap.channelId}' == $("#channelId").val() && '${channelDataSourceMap.dataSourceId}' == $("#datasourceViewId").val()){
<c:forEach items="${businessList}" var="business">
<c:if test="${business.channelDataSourceMapId == channelDataSourceMap.channelDataSourceMapId}">
var option = new Option('${business.businessName}','${business.businessId}');
businessOptions.push(option);
</c:if>
</c:forEach>
}
</c:forEach>
$('#businessId').append(businessOptions);
}
changeBusinessData();
<c:forEach items="${dataModelParameterList}" var="dataModelParameter">
var tr = "<tr><td>${dataModelParameter.parameterName}</td><td><input type='text' class='parameterValue' name='parameterValue' value='${dataModelParameter.parameterValue}'/></td><td>${dataModelParameter.parameterDataType}</td></tr>";
$('#addTr').append(tr);
</c:forEach>
changeTaskType(); changeTaskType();
$('#modelId').val('${runTask.dataModelView.dataModelId}'); $('#modelId').val('${runTask.dataModelView.dataModelId}');
$('#detailSelect').val('${runTask.taskDetail.taskInfoId}'); $('#detailSelect').val('${runTask.taskDetail.taskInfoId}');
...@@ -83,12 +141,59 @@ var monthOption = new Array(); ...@@ -83,12 +141,59 @@ var monthOption = new Array();
if($('#frequencyValueHidden').val()) { if($('#frequencyValueHidden').val()) {
$('#frequencyValue').val($('#frequencyValueHidden').val()); $('#frequencyValue').val($('#frequencyValueHidden').val());
} }
$('#modelId').change(function(){
var modelId = $('#modelId').val();
$.ajax({
type : 'GET',
contentType : 'application/json',
url: "${ctx}/BaseManage/TaskManage/getModelParameterList?modelId="+modelId,
dataType : 'text',
beforeSend: function(data) {},
success: function(data) {
$('#addTr').empty();
data = JSON.parse(data)
data.forEach(function(t){
var tr = "<tr><td>"+t.parameterName+"</td><td><input type='text' id='parameterValue' value='"+t.parameterValue+"'/></td><td>"+t.parameterDataType+"</td></tr>";
$('#addTr').append(tr);
})
}
});
});
$('#datasourceViewId').change(function(){
$("#channelId").empty();
channelOptions =[];
<c:forEach items="${channelDataSourceMapList}" var="channelDataSourceMap" >
if('${channelDataSourceMap.dataSourceId}'==$("#datasourceViewId").val()){
var channelName = "";
<c:forEach items="${channelList}" var="channel" varStatus="channelStatus">
<c:if test="${channel.channelId == channelDataSourceMap.channelId}" >
channelName='${channel.channelName}';
</c:if>
</c:forEach>
var channelOption = new Option(channelName,'${channelDataSourceMap.channelId}');
channelOptions.push(channelOption);
}
</c:forEach>
$('#channelId').append(channelOptions);
changeBusinessData();
});
$('#channelId').change(function(){
changeBusinessData();
})
}); });
function changeInputStatus(eleId, objId) { function changeInputStatus(eleId, objId) {
$('#' + objId).attr('disabled', !$('#' + eleId).attr('checked')); $('#' + objId).attr('disabled', !$('#' + eleId).attr('checked'));
} }
function submitForm() { function submitForm() {
var url = '${ctx}/BaseManage/TaskManage/checkNameAndCode'; var url = '${ctx}/BaseManage/TaskManage/checkNameAndCode';
var data = 'name=' + $('#name').val() + "&code=" + $('#code').val() + "&id=" + $('#taskId').val() + "&defaultTaskType=" + $('#defaultTaskType').val() ; var data = 'name=' + $('#name').val() + "&code=" + $('#code').val() + "&id=" + $('#taskId').val() + "&defaultTaskType=" + $('#defaultTaskType').val() ;
...@@ -97,7 +202,37 @@ var monthOption = new Array(); ...@@ -97,7 +202,37 @@ var monthOption = new Array();
$('#frequency').focus(); $('#frequency').focus();
return; return;
} */ } */
if (validate()) {
var i = $("#addTr").find("tr").size();
if(i==0){
checkAndSubmit(url, encodeURI(encodeURI(data))); checkAndSubmit(url, encodeURI(encodeURI(data)));
}else {
$("#addTr").find("tr").each(function () {
//alert($(this).find("td").eq(0).html());
var modelId = $('#modelId').val();
var paramName = $(this).find("td").eq(0).html();
var paramValue = $(this).find("td").eq(1).find("input").val();
var paramType = $(this).find("td").eq(2).html();
var taskId = $('#taskId').val();
console.log(paramValue)
$.ajax({
type: "GET",
contentType: "application/json",
url: "${ctx}/BaseManage/TaskManage/createModelParam?modelId="+encodeURIComponent(modelId)+"&paramName=" + encodeURIComponent(paramName) + "&paramValue=" + encodeURIComponent(paramValue) + "&paramType=" + encodeURIComponent(paramType) + "&taskId=" + encodeURIComponent(taskId),
dataType: "text",
async: false,
beforeSend: function (data) {
},
success: function () {
i--;
if (i == 0) {
checkAndSubmit(url, encodeURI(encodeURI(data)));
}
}
});
});
}
}
} }
function checkFrequency() { function checkFrequency() {
...@@ -184,8 +319,8 @@ var monthOption = new Array(); ...@@ -184,8 +319,8 @@ var monthOption = new Array();
} }
function showDetail() { function showDetail() {
$('#detailLabel').removeClass("hidden");
$('#detailDiv').removeClass("hidden"); $('#detailDiv').removeClass("hidden");
$('#detailLabel').removeClass("hidden");
$('#modelLabel').addClass("hidden"); $('#modelLabel').addClass("hidden");
$('#modelDiv').addClass("hidden"); $('#modelDiv').addClass("hidden");
...@@ -233,6 +368,20 @@ var monthOption = new Array(); ...@@ -233,6 +368,20 @@ var monthOption = new Array();
$('#frequencyValue').append(monthOption); $('#frequencyValue').append(monthOption);
} }
} }
function abandonTask(){
$.ajax({
type: "GET",
contentType: "application/json",
url: "${ctx}/BaseManage/TaskManage/taskDeleteFrame?taskId="+$('#taskId').val(),
dataType: "text",
async: false,
beforeSend: function (data) {
},
success: function () {
window.location.href='${ctx}/BaseManage/TaskManage/taskListFrame?defaultTaskType=${runTask.defaultTaskType}'
}
});
}
</script> </script>
</head> </head>
<body> <body>
...@@ -271,6 +420,38 @@ var monthOption = new Array(); ...@@ -271,6 +420,38 @@ var monthOption = new Array();
</tr> </tr>
<tr> <tr>
<td id="provinceLabel">省份:</td>
<td id="provinceDiv">
<select class="form-control input-sm" id="provinceId" name="provinceView.provinceId">
</select>
</td>
</tr>
<tr>
<td id="dataSourceLabel">数据来源:</td>
<td id="dataSourceDiv">
<select class="form-control input-sm" id="datasourceViewId" name="dataSource.dataSourceId" >
</select>
</td>
</tr>
<tr>
<td id="channelLabel">渠道:</td>
<td id="channelDiv">
<select class="form-control input-sm" id="channelId" >
</select>
</td>
</tr>
<tr>
<td id="businessLabel">业务:</td>
<td id="businessDiv">
<select class="form-control input-sm" id="businessId" >
</select>
</td>
</tr>
<tr>
<td>任务组:</td> <td>任务组:</td>
<td> <td>
<select class="form-control input-sm" id="taskGroup" name="taskGroup.taskgroupId"> <select class="form-control input-sm" id="taskGroup" name="taskGroup.taskgroupId">
...@@ -345,7 +526,6 @@ var monthOption = new Array(); ...@@ -345,7 +526,6 @@ var monthOption = new Array();
</select> </select>
</td> </td>
</tr> </tr>
<tr id="detailRow"> <tr id="detailRow">
<td id="detailLabel">数据维护任务信息:</td> <td id="detailLabel">数据维护任务信息:</td>
<td id="detailDiv"> <td id="detailDiv">
...@@ -353,7 +533,6 @@ var monthOption = new Array(); ...@@ -353,7 +533,6 @@ var monthOption = new Array();
</select> </select>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>下次运行时间(<font color="red">必填</font>):</td> <td>下次运行时间(<font color="red">必填</font>):</td>
<td> <td>
...@@ -379,17 +558,18 @@ var monthOption = new Array(); ...@@ -379,17 +558,18 @@ var monthOption = new Array();
</tr> </tr>
</c:if> </c:if>
<tr> <tr>
<td>任务内容</td> <td>模型参数</td>
<td> <td>
<c:if test="${runTask.defaultTaskType == 1 }"> <div style="width:420px;height: 130px;overflow: auto">
<textarea class="form-control input-sm" rows="6" maxlength="666" disabled>r_model_task_agent.pl</textarea> <table class="table table-hover table-striped" id="displayParam" >
<input type="hidden" name="taskContext" value="r_model_task_agent.pl"> <thead>
</c:if> <tr><th>参数名</th><th>参数值</th><th>参数类型</th></tr>
</thead>
<c:if test="${runTask.defaultTaskType != 1 }"> <tbody id="addTr">
<textarea class="form-control input-sm" rows="6" id="taskContextArea" maxlength="666">${runTask.taskContext}</textarea>
<input type="hidden" name="taskContext" id="taskContext" value="{runTask.taskContext}"> </tbody>
</c:if> </table>
</div>
</td> </td>
</tr> </tr>
<c:if test="${runTask.defaultTaskType != 3 }"> <c:if test="${runTask.defaultTaskType != 3 }">
...@@ -405,7 +585,7 @@ var monthOption = new Array(); ...@@ -405,7 +585,7 @@ var monthOption = new Array();
<td> <td>
<button type="button" id="modelSubmit" class="btn btn-primary" onclick="saveForm('taskId');">确定</button> <button type="button" id="modelSubmit" class="btn btn-primary" onclick="saveForm('taskId');">确定</button>
<!-- <button type="reset" class="btn btn-default" id="modelReset">清空</button> --> <!-- <button type="reset" class="btn btn-default" id="modelReset">清空</button> -->
<button type="reset" class="btn btn-warning" id="modelBack" onclick="window.location.href='${ctx}/BaseManage/TaskManage/taskListFrame?defaultTaskType=${runTask.defaultTaskType}'">返回</button> <button type="reset" class="btn btn-warning" id="modelBack" onclick="abandonTask()">返回</button>
</td> </td>
</tr> </tr>
</table> </table>
......
...@@ -121,30 +121,7 @@ taskName = "自定义任务"; ...@@ -121,30 +121,7 @@ taskName = "自定义任务";
cancelValue:"取消", cancelValue:"取消",
lock:true lock:true
}); });
/* $('#newTaskStatus').val(status);
$('#targetTaskId').val(id);
$('#queryForm').submit();
$.ajax({
type : 'post',
'url' : '${ctx}/BaseManage/TaskManage/queryResultFrame',
data : $('#queryForm').serialize() + "&page=" + page,
success : function(data) {
alert("操作成功")
}
}); */
}
/* function updateStatus(status, id) {
$.ajax({
type : 'post',
'url' : '${ctx}/BaseManage/TaskManage/updateStatusFrame',
data : "newTaskStatus=" + status + "&taskId=" +id,
success : function(data) {
queryResult($('#currentPage').val);
} }
});
} */
function queryResult(page) { function queryResult(page) {
$.ajax({ $.ajax({
...@@ -157,6 +134,11 @@ taskName = "自定义任务"; ...@@ -157,6 +134,11 @@ taskName = "自定义任务";
} }
}); });
} }
function preview(){
var id = $('input[name="taskId"]:checked').val();
parent.preview();
}
$(document).ready(function(){ $(document).ready(function(){
queryResult(1); queryResult(1);
...@@ -267,5 +249,6 @@ taskName = "自定义任务"; ...@@ -267,5 +249,6 @@ taskName = "自定义任务";
</div> </div>
</div> </div>
</div> </div>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -12,9 +12,10 @@ ...@@ -12,9 +12,10 @@
<button class="btn-sm btn btn-warning btn-sm btn-group btn-group-cog" onclick="deleteTask();">删除</button> <button class="btn-sm btn btn-warning btn-sm btn-group btn-group-cog" onclick="deleteTask();">删除</button>
<button class="btn-sm btn btn-primary btn-sm btn-group btn-group-cog" onclick="addTask();">新建</button> <button class="btn-sm btn btn-primary btn-sm btn-group btn-group-cog" onclick="addTask();">新建</button>
<%--create by afe 2017-10-26--%> <%--create by afe 2017-10-26--%>
<button class="btn-sm btn btn-primary btn-sm btn-group btn-group-cog" onclick="">模型预览</button> <button class="btn-sm btn btn-primary btn-sm btn-group btn-group-cog" id="ModelPreview" onclick="preview()">模型预览</button>
</div> </div>
</div> </div>
<table class="table table-hover table-striped"> <table class="table table-hover table-striped">
<thead> <thead>
<tr> <tr>
...@@ -39,6 +40,7 @@ ...@@ -39,6 +40,7 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<c:forEach items="${taskList.content}" var="runTask"> <c:forEach items="${taskList.content}" var="runTask">
<tr> <tr>
<td><input type="radio" name="taskId" id="taskId" value="${runTask.taskId}" /></td> <td><input type="radio" name="taskId" id="taskId" value="${runTask.taskId}" /></td>
......
...@@ -30,6 +30,11 @@ ...@@ -30,6 +30,11 @@
}); });
$("#${selectTab}").click(); $("#${selectTab}").click();
}); });
</script> </script>
</head> </head>
......
...@@ -128,17 +128,16 @@ function ruleResultDetailTable(){ ...@@ -128,17 +128,16 @@ function ruleResultDetailTable(){
header[0] = ["","<input type='radio' name='update'id='update' onclick='javascript:radioChoose(this);'/>","1%",""]; header[0] = ["","<input type='radio' name='update'id='update' onclick='javascript:radioChoose(this);'/>","1%",""];
header[1] = ["质量规则ID","qualityRuleId","7%","15"]; header[1] = ["质量规则ID","qualityRuleId","7%","15"];
header[2] = ["省份","provinceName","7%","15"]; header[2] = ["数据来源","dataSourceName","7%","15"];
header[3] = ["渠道","qualityRuleId","7%","15"]; header[3] = ["渠道","channelName","7%","15"];
header[4] = ["业务","qualityRuleId","7%","15"]; header[4] = ["业务","businessName","7%","15"];
header[5] = ["数据来源","qualityRuleId","7%","15"]; header[5] = ["指标名称","qualityRuleId","7%","15"];
header[6] = ["数据采集频率","qualityRuleId","7%","15"]; header[6] = ["指标编码","qualityRuleId","7%","15"];
header[7] = ["指标监控时间","qualityRuleId","7%","15"]; header[7] = ["数据类型","qualityRuleId","7%","15"];
header[8] = ["指标监控时间范围","qualityRuleId","7%","15"]; header[8] = ["数据采集频率","qualityRuleId","7%","15"];
header[9] = ["完整性阈值","qualityRuleId","7%","15"]; header[9] = ["指标监控时间","qualityRuleId","7%","15"];
header[10] = ["及时性阈值","qualityRuleId","7%","15"]; header[10] = ["指标业务时间","qualityRuleId","7%","15"];
header[11] = ["数据类型","qualityRuleId","7%","15"]; header[11] = ["准确性规则","qualityRuleId","7%","15"];
header[12] = ["准确性规则","qualityRuleId","7%","15"];
window.pagging = new table_pagging({limit:12,tableId:'ruleResultTable',header:header}); window.pagging = new table_pagging({limit:12,tableId:'ruleResultTable',header:header});
//pagging.pagging(jsonData); //pagging.pagging(jsonData);
...@@ -299,17 +298,6 @@ table_pagging.prototype = { ...@@ -299,17 +298,6 @@ table_pagging.prototype = {
tdContext = "&nbsp;"; tdContext = "&nbsp;";
} }
/*if(K==3){
if(tdContext!="&nbsp;"){
var strLength = tdContext.lastIndexOf(".");
var strBody = tdContext.substring(0,strLen-14);
var strExt = tdContext.substring(strLen);
tdContext=strBody+strExt;
}
}*/
// if(k==12){ //显示协查单的详细列表
// tdContext= "<a target='_blank' href='/CmszMonitorAnalysis/MonitorOperation/WorkingOrderReasult?xcdId="+this.getData(this.objectlist[i],this.header[k][1])+"'>"+ tdContext+"</a>"
if(k==9){ if(k==9){
if(tdContext!="&nbsp;"){ if(tdContext!="&nbsp;"){
...@@ -323,8 +311,8 @@ table_pagging.prototype = { ...@@ -323,8 +311,8 @@ table_pagging.prototype = {
} }
} }
if(k==11){ if(k==11){
tdContext = "<a href='javascript:;' onclick='lookParm(\""+this.getData(this.objectlist[i],"dataModelId")+"\",\""+this.getData(this.objectlist[i],"dataModelName")+"\")'>查看参数</a>"; tdContext = "<a href='javascript:;' onclick='lookParm(\""+this.getData(this.objectlist[i],"qualityRuleId")+"\")'>查看参数</a>";
//tdContext = "<a href='javascript:;' onclick=\"openDialog('"+this.getData(this.objectlist[i],"dataModelId")+"','"+ this.getData(this.objectlist[i],"dataModelName")"')\">查看参数</a>";
} }
if(k==4){ if(k==4){
if (this.header[k][4] && !(tdContext == "&nbsp;")) { if (this.header[k][4] && !(tdContext == "&nbsp;")) {
...@@ -364,12 +352,6 @@ table_pagging.prototype = { ...@@ -364,12 +352,6 @@ table_pagging.prototype = {
} }
} }
console.log(tdContext); console.log(tdContext);
td.innerHTML = tdContext; td.innerHTML = tdContext;
...@@ -557,8 +539,8 @@ table_pagging.prototype = { ...@@ -557,8 +539,8 @@ table_pagging.prototype = {
if(clickObj.checked){ if(clickObj.checked){
//alert(clickObj); //alert(clickObj);
//alert(clickObj.nextSibling.innerHTML); //alert(clickObj.nextSibling.innerHTML);
$("#updateModel").attr("disabled", false); $("#updateRule").attr("disabled", false);
modelId=parseInt(obj[parseInt(clickObj.nextSibling.innerHTML)].dataModelId); ruleId=parseInt(obj[parseInt(clickObj.nextSibling.innerHTML)].qualityRuleId);
} }
} }
\ No newline at end of file
...@@ -88,7 +88,7 @@ function checkKpi() { ...@@ -88,7 +88,7 @@ function checkKpi() {
} }
function checkAndSubmit(url, data) { function checkAndSubmit(url, data) {
if (validate()) {
$.ajax({ $.ajax({
type : 'POST', type : 'POST',
url: url, url: url,
...@@ -105,7 +105,7 @@ function checkAndSubmit(url, data) { ...@@ -105,7 +105,7 @@ function checkAndSubmit(url, data) {
} }
} }
}); });
}
} }
function saveForm(id) { function saveForm(id) {
......
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