Commit 92210c7a authored by 胡斌's avatar 胡斌

Merge remote-tracking branch 'origin/liuna'

# Conflicts: # .idea/workspace.xml
parents eb6fc743 ea1d1e22
...@@ -28,10 +28,10 @@ public class QualityRule { ...@@ -28,10 +28,10 @@ public class QualityRule {
private Long provinceId;//省份维表ID private Long provinceId;//省份维表ID
private Long dataSourceId;//数据来源ID private Long dataSourceId;//数据来源ID
private String kpiMonitorTime;//指标检测时间 private String kpiMonitorTime;//指标检测时间
private String kpiMonitorRunTime; private Timestamp kpiMonitorRunTime;
private String businessTime;//指标业务时间 private Timestamp businessTime;//指标业务时间
private Date ruleCrtTime;//规则创建时间 private Timestamp ruleCrtTime;//规则创建时间
private Date ruleUpdateTime;//规则更新时间 private Timestamp ruleUpdateTime;//规则更新时间
private String ruleValidFlag;//规则是否有效 private String ruleValidFlag;//规则是否有效
private String ifSystemValue; private String ifSystemValue;
...@@ -80,28 +80,28 @@ public class QualityRule { ...@@ -80,28 +80,28 @@ public class QualityRule {
public void setKpiMonitorTime(String kpiMonitorTime) { public void setKpiMonitorTime(String kpiMonitorTime) {
this.kpiMonitorTime = kpiMonitorTime; this.kpiMonitorTime = kpiMonitorTime;
} }
public String getKpiMonitorRunTime() { public Timestamp getKpiMonitorRunTime() {
return kpiMonitorRunTime; return kpiMonitorRunTime;
} }
public void setKpiMonitorRunTime(String kpiMonitorRunTime) { public void setKpiMonitorRunTime(Timestamp kpiMonitorRunTime) {
this.kpiMonitorRunTime = kpiMonitorRunTime; this.kpiMonitorRunTime = kpiMonitorRunTime;
} }
public String getBusinessTime() { public Timestamp getBusinessTime() {
return businessTime; return businessTime;
} }
public void setBusinessTime(String businessTime) { public void setBusinessTime(Timestamp businessTime) {
this.businessTime = businessTime; this.businessTime = businessTime;
} }
public Date getRuleCrtTime() { public Timestamp getRuleCrtTime() {
return ruleCrtTime; return ruleCrtTime;
} }
public void setRuleCrtTime(Date ruleCrtTime) { public void setRuleCrtTime(Timestamp ruleCrtTime) {
this.ruleCrtTime = ruleCrtTime; this.ruleCrtTime = ruleCrtTime;
} }
public Date getRuleUpdateTime() { public Timestamp getRuleUpdateTime() {
return ruleUpdateTime; return ruleUpdateTime;
} }
public void setRuleUpdateTime(Date ruleUpdateTime) { public void setRuleUpdateTime(Timestamp ruleUpdateTime) {
this.ruleUpdateTime = ruleUpdateTime; this.ruleUpdateTime = ruleUpdateTime;
} }
public String getRuleValidFlag() { public String getRuleValidFlag() {
...@@ -117,4 +117,22 @@ public class QualityRule { ...@@ -117,4 +117,22 @@ public class QualityRule {
this.ifSystemValue = ifSystemValue; this.ifSystemValue = ifSystemValue;
} }
@Override
public String toString() {
return "QualityRule{" +
"qualityRuleId=" + qualityRuleId +
", businessId=" + businessId +
", kpiId=" + kpiId +
", channelId=" + channelId +
", provinceId=" + provinceId +
", dataSourceId=" + dataSourceId +
", kpiMonitorTime='" + kpiMonitorTime + '\'' +
", kpiMonitorRunTime='" + kpiMonitorRunTime + '\'' +
", businessTime=" + businessTime +
", ruleCrtTime=" + ruleCrtTime +
", ruleUpdateTime=" + ruleUpdateTime +
", ruleValidFlag='" + ruleValidFlag + '\'' +
", ifSystemValue='" + ifSystemValue + '\'' +
'}';
}
} }
package com.hp.cmsz.entity;
import org.elasticsearch.cluster.metadata.MappingMetaData;
import javax.persistence.*;
import java.sql.Timestamp;
/**
* ccolap.quality_operation_detail_v视图对应的实体类
*
* @author Liu Na
*
*/
@Entity
@Table(name = "quality_operation_detail_v")
public class QualityRuleInfo {
private Long qualityRuleId;
private Long kpiId;
private Long businessId;
private Long channelId;
private Long dataSourceId;
private Long provinceId;
private Long qualityVerificationResultId;
private Timestamp kpiMonitorRunTime;
private Timestamp businessTime;
private String kpiName;
private String kpiCode;
private String businessName;
private String channelName;
private String dataSourceName;
private String provinceName;
private String warningType;
private Long ifFilter;
public Long getQualityRuleId() {
return qualityRuleId;
}
public void setQualityRuleId(Long qualityRuleId) {
this.qualityRuleId = qualityRuleId;
}
public Long getKpiId() {
return kpiId;
}
public void setKpiId(Long kpiId) {
this.kpiId = kpiId;
}
public Long getBusinessId() {
return businessId;
}
public void setBusinessId(Long businessId) {
this.businessId = businessId;
}
public Long getChannelId() {
return channelId;
}
public void setChannelId(Long channelId) {
this.channelId = channelId;
}
public Long getDataSourceId() {
return dataSourceId;
}
public void setDataSourceId(Long dataSourceId) {
this.dataSourceId = dataSourceId;
}
public Long getProvinceId() {
return provinceId;
}
public void setProvinceId(Long provinceId) {
this.provinceId = provinceId;
}
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public Long getQualityVerificationResultId() {
return qualityVerificationResultId;
}
public void setQualityVerificationResultId(Long qualityVerificationResultId) {
this.qualityVerificationResultId = qualityVerificationResultId;
}
public Timestamp getKpiMonitorRunTime() {
return kpiMonitorRunTime;
}
public void setKpiMonitorRunTime(Timestamp kpiMonitorRunTime) {
this.kpiMonitorRunTime = kpiMonitorRunTime;
}
public Timestamp getBusinessTime() {
return businessTime;
}
public void setBusinessTime(Timestamp businessTime) {
this.businessTime = businessTime;
}
public String getKpiName() {
return kpiName;
}
public void setKpiName(String kpiName) {
this.kpiName = kpiName;
}
public String getKpiCode() {
return kpiCode;
}
public void setKpiCode(String kpiCode) {
this.kpiCode = kpiCode;
}
public String getBusinessName() {
return businessName;
}
public void setBusinessName(String businessName) {
this.businessName = businessName;
}
public String getChannelName() {
return channelName;
}
public void setChannelName(String channelName) {
this.channelName = channelName;
}
public String getDataSourceName() {
return dataSourceName;
}
public void setDataSourceName(String dataSourceName) {
this.dataSourceName = dataSourceName;
}
public String getProvinceName() {
return provinceName;
}
public void setProvinceName(String provinceName) {
this.provinceName = provinceName;
}
public String getWarningType() {
return warningType;
}
public void setWarningType(String warningType) {
this.warningType = warningType;
}
public Long getIfFilter() {
return ifFilter;
}
public void setIfFilter(Long ifFilter) {
this.ifFilter = ifFilter;
}
@Override
public String toString() {
return "QualityRuleInfo{" +
"kpiId=" + kpiId +
", businessId=" + businessId +
", channelId=" + channelId +
", dataSourceId=" + dataSourceId +
", provinceId=" + provinceId +
", qualityVerificationResultId=" + qualityVerificationResultId +
", qualityRuleId=" + qualityRuleId +
", kpiMonitorRunTime=" + kpiMonitorRunTime +
", businessTime=" + businessTime +
", kpiName='" + kpiName + '\'' +
", kpiCode='" + kpiCode + '\'' +
", businessName='" + businessName + '\'' +
", channelName='" + channelName + '\'' +
", dataSourceName='" + dataSourceName + '\'' +
", provinceName='" + provinceName + '\'' +
", warningType='" + warningType + '\'' +
", ifFilter='" + ifFilter + '\'' +
'}';
}
}
package com.hp.cmsz.entity;
import javax.persistence.*;
import java.sql.Timestamp;
/**
* ccolap.quality_rule_detail_v视图对应的实体类
*
* @author Liu Na
*
*/
@Entity
@Table(name = "quality_rule_detail_v")
public class QualityRuleView {
private Long qualityRuleId;
private Long kpiId;
private Long businessId;
private Long channelId;
private Long dataSourceId;
private Long provinceId;
private String kpiMonitorTime;
private Timestamp businessTime;
private String kpiName;
private String kpiCode;
private String businessName;
private String channelName;
private String dataSourceName;
private String provinceName;
private String calCycle;
private String kpiTypeName;
public Long getKpiId() {
return kpiId;
}
public void setKpiId(Long kpiId) {
this.kpiId = kpiId;
}
public Long getBusinessId() {
return businessId;
}
public void setBusinessId(Long businessId) {
this.businessId = businessId;
}
public Long getChannelId() {
return channelId;
}
public void setChannelId(Long channelId) {
this.channelId = channelId;
}
public Long getDataSourceId() {
return dataSourceId;
}
public void setDataSourceId(Long dataSourceId) {
this.dataSourceId = dataSourceId;
}
public Long getProvinceId() {
return provinceId;
}
public void setProvinceId(Long provinceId) {
this.provinceId = provinceId;
}
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public Long getQualityRuleId() {
return qualityRuleId;
}
public void setQualityRuleId(Long qualityRuleId) {
this.qualityRuleId = qualityRuleId;
}
public String getKpiMonitorTime() {
return kpiMonitorTime;
}
public void setKpiMonitorTime(String kpiMonitorTime) {
this.kpiMonitorTime = kpiMonitorTime;
}
public Timestamp getBusinessTime() {
return businessTime;
}
public void setBusinessTime(Timestamp businessTime) {
this.businessTime = businessTime;
}
public String getKpiName() {
return kpiName;
}
public void setKpiName(String kpiName) {
this.kpiName = kpiName;
}
public String getKpiCode() {
return kpiCode;
}
public void setKpiCode(String kpiCode) {
this.kpiCode = kpiCode;
}
public String getBusinessName() {
return businessName;
}
public void setBusinessName(String businessName) {
this.businessName = businessName;
}
public String getChannelName() {
return channelName;
}
public void setChannelName(String channelName) {
this.channelName = channelName;
}
public String getDataSourceName() {
return dataSourceName;
}
public void setDataSourceName(String dataSourceName) {
this.dataSourceName = dataSourceName;
}
public String getProvinceName() {
return provinceName;
}
public void setProvinceName(String provinceName) {
this.provinceName = provinceName;
}
public String getCalCycle() {
return calCycle;
}
public void setCalCycle(String calCycle) {
this.calCycle = calCycle;
}
public String getKpiTypeName() {
return kpiTypeName;
}
public void setKpiTypeName(String kpiTypeName) {
this.kpiTypeName = kpiTypeName;
}
@Override
public String toString() {
return "QualityRuleView{" +
"kpiId=" + kpiId +
", businessId=" + businessId +
", channelId=" + channelId +
", dataSourceId=" + dataSourceId +
", provinceId=" + provinceId +
", qualityRuleId=" + qualityRuleId +
", kpiMonitorTime='" + kpiMonitorTime + '\'' +
", businessTime=" + businessTime +
", kpiName='" + kpiName + '\'' +
", kpiCode='" + kpiCode + '\'' +
", businessName='" + businessName + '\'' +
", channelName='" + channelName + '\'' +
", dataSourceName='" + dataSourceName + '\'' +
", provinceName='" + provinceName + '\'' +
", calCycle='" + calCycle + '\'' +
", kpiTypeName='" + kpiTypeName + '\'' +
'}';
}
}
...@@ -21,8 +21,6 @@ import com.hp.cmsz.entity.QualityRule; ...@@ -21,8 +21,6 @@ import com.hp.cmsz.entity.QualityRule;
public interface QualityRuleDao extends JpaSpecificationExecutor<QualityRule>, public interface QualityRuleDao extends JpaSpecificationExecutor<QualityRule>,
PagingAndSortingRepository<QualityRule, Long>{ PagingAndSortingRepository<QualityRule, Long>{
//根据质量规则ID查找质量规则 //根据质量规则ID查找质量规则
QualityRule findByQualityRuleId(Long qualityRuleId); QualityRule findByQualityRuleId(Long qualityRuleId);
...@@ -37,13 +35,12 @@ public interface QualityRuleDao extends JpaSpecificationExecutor<QualityRule>, ...@@ -37,13 +35,12 @@ 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.kpiMonitorRunTime=:kpiMonitorRunTime, qr.businessTime=:businessTime, 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("kpiMonitorRunTime")String kpiMonitorRunTime,@Param("businessTime")String businessTime,@Param("ruleCrtTime")Date ruleCrtTime,@Param("ruleUpdateTime")Date ruleUpdateTime,@Param("qualityRuleId")Long qualityRuleId); void updateQualityRuleByQualityRuleId(@Param("businessId")Long businessId,@Param("kpiId")Long kpiId,@Param("channelId")Long channelId,@Param("provinceId")Long provinceId,@Param("dataSourceId")Long dataSourceId,@Param("kpiMonitorTime")String kpiMonitorTime,@Param("kpiMonitorRunTime")Timestamp kpiMonitorRunTime,@Param("businessTime")Timestamp businessTime,@Param("ruleCrtTime")Timestamp ruleCrtTime,@Param("ruleUpdateTime")Timestamp ruleUpdateTime,@Param("qualityRuleId")Long qualityRuleId);
//根据质量规则ID得到数据条数 //根据质量规则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> findByProvinceIdInAndBusinessIdInAndDataSourceIdInAndChannelIdInOrderByQualityRuleIdDesc(Long[] province, Long[] business, Long[] datasource, Long[] channel);
} }
package com.hp.cmsz.repository;
import com.hp.cmsz.entity.QualityRuleInfo;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.Date;
import java.util.List;
public interface QualityRuleInfoDao extends JpaSpecificationExecutor<QualityRuleInfo>,
PagingAndSortingRepository<QualityRuleInfo, Long> {
@Query("from QualityRuleInfo qualityRuleInfo where qualityRuleInfo.businessTime between timestampadd(M,-1,getdate()) and getdate() order by qualityRuleInfo.businessTime Desc")
List<QualityRuleInfo> findQualityRuleInfo();
//根据筛选项查找
List<QualityRuleInfo> findByBusinessTimeBetweenAndChannelIdInAndBusinessIdInAndProvinceIdInAndIfFilterInAndDataSourceIdInOrderByBusinessTimeDesc(Date time1, Date time2,List<Long> dataSource,List<Long> chnnal,List<Long> busines,List<Long> province,List<Long> ifFilter);
}
package com.hp.cmsz.repository;
import com.hp.cmsz.entity.QualityRuleView;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
public interface QualityRuleViewDao extends JpaSpecificationExecutor<QualityRuleView>,
PagingAndSortingRepository<QualityRuleView, Long> {
//根据筛选项得到质量规则
List<QualityRuleView> findByDataSourceIdInAndChannelIdInAndBusinessIdInAndProvinceIdInOrderByQualityRuleIdAscBusinessTimeDesc(List<Long> dataSource,List<Long> chnnal,List<Long> busines,List<Long>province);
}
package com.hp.cmsz.service.analysissupport;
import com.hp.cmsz.entity.QualityRuleInfo;
import com.hp.cmsz.repository.QualityRuleInfoDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
@Service
@Transactional
public class QualityRuleInfoService {
@Autowired
private QualityRuleInfoDao qualityRuleInfoDao;
public List<QualityRuleInfo> getQualityRuleInfoByLastMonth(){
return qualityRuleInfoDao.findQualityRuleInfo();
}
//根据筛选项获取质量规则
public List<QualityRuleInfo> getQualityRuleInfoBy(Date time1, Date time2,List<Long> dataSource,List<Long> chnnal,List<Long> busines,List<Long>province,List<Long> ifFilter){
return qualityRuleInfoDao.findByBusinessTimeBetweenAndChannelIdInAndBusinessIdInAndProvinceIdInAndIfFilterInAndDataSourceIdInOrderByBusinessTimeDesc(time1, time2,dataSource,chnnal,busines,province,ifFilter);
}
}
package com.hp.cmsz.service.analysissupport; package com.hp.cmsz.service.analysissupport;
import java.sql.Timestamp; import com.hp.cmsz.repository.QualityRuleDao;
import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired; 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 java.sql.Timestamp;
import com.hp.cmsz.repository.QualityRuleDao; import java.util.List;
/** /**
* *
* @author Liu Na * @author Liu Na
* *
*/ */
...@@ -20,24 +17,18 @@ import com.hp.cmsz.repository.QualityRuleDao; ...@@ -20,24 +17,18 @@ import com.hp.cmsz.repository.QualityRuleDao;
@Transactional @Transactional
public class QualityRuleService { public class QualityRuleService {
@Autowired @Autowired
private QualityRuleDao qualityRuleDao; private QualityRuleDao qualityRuleDao;
//根据筛选条件查询出质量规则 //根据质量规则ID删除质量规则
public List<QualityRule> getAllQualityRuleByOther(Long[] province,Long[] datasource,Long[] channel,Long[] business){ @Transactional(readOnly=false)
return qualityRuleDao.findByProvinceIdInAndBusinessIdInAndDataSourceIdInAndChannelIdInOrderByQualityRuleIdDesc(province, business, datasource, channel); public void deleteByQualityRuleId(List<Long> qualityRuleId){
} qualityRuleDao.deleteQualityRuleByQualityRuleId(qualityRuleId);
}
//根据质量规则ID删除质量规则
@Transactional(readOnly=false) //根据质量规则ID修改质量规则
public void deleteByQualityRuleId(List<Long> qualityRuleId){ @Transactional(readOnly=false)
qualityRuleDao.deleteQualityRuleByQualityRuleId(qualityRuleId); public void updateByQualityRuleId(Long businessId,Long kpiId,Long channelId,Long provinceId,Long dataSourceId,String kpiMonitorTime,Timestamp kpiMonitorRunTime,Timestamp businessTime,Timestamp ruleCrtTime,Timestamp ruleUpdateTime,Long qualityRuleId){
} qualityRuleDao.updateQualityRuleByQualityRuleId(businessId,kpiId,channelId,provinceId,dataSourceId,kpiMonitorTime,kpiMonitorRunTime,businessTime,ruleCrtTime,ruleUpdateTime,qualityRuleId);
}
//根据质量规则ID修改质量规则
@Transactional(readOnly=false)
public void updateByQualityRuleId(Long businessId, Long kpiId, Long channelId, Long provinceId, Long dataSourceId, String kpiMonitorTime,String kpiMonitorRunTime,String businessTime,Date ruleCrtTime,Date ruleUpdateTime,Long qualityRuleId){
qualityRuleDao.updateQualityRuleByQualityRuleId(businessId, kpiId, channelId, provinceId, dataSourceId, kpiMonitorTime, kpiMonitorRunTime, businessTime, ruleCrtTime, ruleUpdateTime, qualityRuleId);
}
} }
package com.hp.cmsz.service.analysissupport;
import com.hp.cmsz.entity.QualityRuleView;
import com.hp.cmsz.repository.QualityRuleViewDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@Service
@Transactional
public class QualityRuleViewService {
@Autowired
private QualityRuleViewDao qualityRuleViewDao;
//根据筛选项得到质量规则
public List<QualityRuleView> getQualityRuleViewBy(List<Long> dataSource, List<Long> chnnal, List<Long> busines, List<Long>province){
return qualityRuleViewDao.findByDataSourceIdInAndChannelIdInAndBusinessIdInAndProvinceIdInOrderByQualityRuleIdAscBusinessTimeDesc(dataSource,chnnal,busines,province);
}
}
...@@ -192,6 +192,7 @@ public class PageURLController { ...@@ -192,6 +192,7 @@ public class PageURLController {
public static String FilterResult = "AnalysisSupport/FilterRuleResult"; public static String FilterResult = "AnalysisSupport/FilterRuleResult";
public static String FilterMaintain = "AnalysisSupport/FilterRuleMaintain"; public static String FilterMaintain = "AnalysisSupport/FilterRuleMaintain";
public static String FilterConfiguration = "AnalysisSupport/FilterRuleConfiguration"; public static String FilterConfiguration = "AnalysisSupport/FilterRuleConfiguration";
public static String RuleOperation = "AnalysisSupport/QualityRuleOperation";
//基础管理 //基础管理
//AuthorityManage映射到WEB-INF/views下的AuthorityManage/AuthorityManage.jsp页面 //AuthorityManage映射到WEB-INF/views下的AuthorityManage/AuthorityManage.jsp页面
......
...@@ -13,17 +13,12 @@ import java.util.Map; ...@@ -13,17 +13,12 @@ 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 com.hp.cmsz.service.analysissupport.QualityRuleService;
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.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.google.gson.Gson; 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.DataSource; import com.hp.cmsz.entity.DataSource;
import com.hp.cmsz.entity.DataType; import com.hp.cmsz.entity.DataType;
...@@ -42,8 +37,6 @@ import com.hp.cmsz.repository.ProvinceDao; ...@@ -42,8 +37,6 @@ 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.web.PageURLController; import com.hp.cmsz.web.PageURLController;
/** /**
...@@ -239,27 +232,35 @@ public class QualityRuleMaintainController { ...@@ -239,27 +232,35 @@ public class QualityRuleMaintainController {
Long qualityRuleId = accuracyRule.getAccuracyRuleId(); Long qualityRuleId = accuracyRule.getAccuracyRuleId();
qualityRuleIdList.add(qualityRuleId); qualityRuleIdList.add(qualityRuleId);
} }
//新增质量模型 //新增质量模型
@RequestMapping(value = "/saveRuleDataForm", method = RequestMethod.POST) @RequestMapping(value = "/saveRuleDataForm", method = RequestMethod.POST)
public String saveRuleDataForm( public String saveRuleDataForm(
// @RequestParam(value="channel") String channel,
// @RequestParam(value="dataSource") String dataSourceId,
// @RequestParam(value="kpiMonitorTime") String kpiMonitorTime,
// @RequestParam(value="businessTime") String businessTime,
// @RequestParam(value="ruleCrtTime") String ruleCrtTime,
// @RequestParam(value="ruleUpdateTime") String ruleUpdateTime,
HttpServletResponse response,HttpServletRequest request) throws ParseException{ HttpServletResponse response,HttpServletRequest request) throws ParseException{
System.out.println("123456"); // String province = request.getParameter("province");
// String provinceId = request.getParameter("province"); // String businessValue = request.getParameter("businessinput");
// String businessId = request.getParameter("businessinput"); String channel =request.getParameter("channel");
// String channelId =request.getParameter("channel");
// String dataSourceId =request.getParameter("dataSource"); // String dataSourceId =request.getParameter("dataSource");
// String kpiId = request.getParameter("kpiinput"); // String kpiValue = request.getParameter("kpiinput");
// String kpiMonitorTime=""; // String kpiMonitorTime=request.getParameter("kpiMonitorTime");
// String businessTime=""; // String businessTime=request.getParameter("businessTime");
// String ruleCrtTime=""; // String ruleCrtTime=request.getParameter("ruleCrtTime");
// String ruleUpdateTime=""; // String ruleUpdateTime=request.getParameter("ruleUpdateTime");
// // String provinceId = "";
// SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // String businessId = "";
// QualityRule qualityRule = new QualityRule(); // String kpiId = "";
SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
QualityRule qualityRule = new QualityRule();
// List<Long> provinceIdList = new ArrayList<Long>(); // List<Long> provinceIdList = new ArrayList<Long>();
// for(int i=0;i<provinceValue.split(",").length;i++){ // for(int i=0;i<province.split(",").length;i++){
// provinceIdList.add(Long.parseLong(provinceValue.split(",")[i])); // provinceIdList.add(Long.parseLong(province.split(",")[i]));
// } // }
// List<Long> businessIdList = new ArrayList<Long>(); // List<Long> businessIdList = new ArrayList<Long>();
// for(int i=0;i<businessValue.split(",").length;i++){ // for(int i=0;i<businessValue.split(",").length;i++){
...@@ -273,28 +274,39 @@ public class QualityRuleMaintainController { ...@@ -273,28 +274,39 @@ public class QualityRuleMaintainController {
// for(int j=0; j<provinceIdList.size(); j++) { // for(int j=0; j<provinceIdList.size(); j++) {
// for(int k=0; k<businessIdList.size(); k++){ // for(int k=0; k<businessIdList.size(); k++){
// for(int l=0; l<kpiIdList.size(); l++){ // for(int l=0; l<kpiIdList.size(); l++){
// provinceId = provinceIdList.get(j); // provinceId = String.valueOf(provinceIdList.get(j));
// businessId = businessIdList.get(k); // businessId = String.valueOf(businessIdList.get(k));
// kpiId = kpiIdList.get(l); // kpiId = String.valueOf(kpiIdList.get(l));
// if(!provinceId.equals("")){qualityRule.setProvinceId(provinceId);} // if(!provinceId.trim().equals("")){qualityRule.setProvinceId(Long.parseLong(provinceId));}
// if(!businessId.equals("")){qualityRule.setBusinessId(businessId);} // if(!businessId.trim().equals("")){qualityRule.setBusinessId(Long.parseLong(businessId));}
// if(!kpiId.equals("")){qualityRule.setKpiId(kpiId);} // if(!kpiId.trim().equals("")){qualityRule.setKpiId(Long.parseLong(kpiId));}
// if(!channelId.trim().equals("")){qualityRule.setChannelId(Long.parseLong(channelId));} qualityRule.setProvinceId(Long.parseLong("1"));
// if(!dataSourceId.trim().equals("")){qualityRule.setDataSourceId(Long.parseLong(dataSourceId));} qualityRule.setBusinessId(Long.parseLong("1490"));
// if(!kpiMonitorTime.trim().equals("")){qualityRule.setKpiMonitorTime(kpiMonitorTime);} qualityRule.setKpiId(Long.parseLong("2411"));
// qualityRule.setKpiMonitorRunTime(kpiMonitorTime+businessTime); if(!channel.trim().equals("")){
// if(!businessTime.trim().equals("")){qualityRule.setBusinessTime(businessTime);} qualityRule.setChannelId(Long.parseLong(channel));
// qualityRule.setRuleCrtTime(sd.parse(ruleCrtTime)); }
// qualityRule.setRuleUpdateTime(sd.parse(ruleUpdateTime)); //if(!dataSourceId.trim().equals("")){
// qualityRule.setRuleValidFlag("0"); qualityRule.setDataSourceId(Long.parseLong("7"));
// qualityRule.setIfSystemValue("0"); //}
// qualityRuleDao.save(qualityRule); //if(!kpiMonitorTime.trim().equals("")){
qualityRule.setKpiMonitorTime("4");
//}
qualityRule.setKpiMonitorRunTime(Timestamp.valueOf(sd.format(new Date())));
//if(!businessTime.trim().equals("")){
qualityRule.setBusinessTime(Timestamp.valueOf(sd.format(new Date())));
//}
qualityRule.setRuleCrtTime(Timestamp.valueOf(sd.format(new Date())));
qualityRule.setRuleUpdateTime(Timestamp.valueOf(sd.format(new Date())));
qualityRule.setRuleValidFlag("0");
qualityRule.setIfSystemValue("0");
System.out.println("qualityRule"+qualityRule);
qualityRuleDao.save(qualityRule);
// } // }
// } // }
// } // }
// cmszOperationLogService.createLog("增加","新建质量模型","quality_rule_warehouse_info_t. QUALITY_RULE_ID="+ qualityRule.getQualityRuleId().toString());
// cmszOperationLogService.createLog("增加","新建质量模型","quality_rule_warehouse_info_t. QUALITY_RULE_ID="+ qualityRule.getQualityRuleId().toString()); Long qualityRuleId = qualityRule.getQualityRuleId();
// Long qualityRuleId = qualityRule.getQualityRuleId();
return "redirect:AnalysisSupport/QualityRuleResult"; return "redirect:AnalysisSupport/QualityRuleResult";
} }
......
package com.hp.cmsz.web.analysissupport;
import com.google.gson.Gson;
import com.hp.cmsz.entity.*;
import com.hp.cmsz.repository.DataSourceDao;
import com.hp.cmsz.repository.KpiDao;
import com.hp.cmsz.repository.ProvinceDao;
import com.hp.cmsz.service.BusinessService;
import com.hp.cmsz.service.ChannelService;
import com.hp.cmsz.service.CmszOperationLogService;
import com.hp.cmsz.service.analysissupport.QualityRuleInfoService;
import com.hp.cmsz.web.PageURLController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* 数据质量核查中的质量规则运营结果控制类
*
* @author Liu Na
*
*/
@Controller
@RequestMapping(value="AnalysisSupport/QualityRuleOperation")
public class QualityRuleOperationController {
@Autowired
private ProvinceDao provinceDao;
@Autowired
private ChannelService channelService;
@Autowired
private BusinessService businessService;
@Autowired
private KpiDao kpiDao;
@Autowired
private DataSourceDao dataSourceDao;
@Autowired
private QualityRuleInfoService qualityRuleInfoService;
@Autowired
private CmszOperationLogService cmszOperationLogService;
@RequestMapping(value = "")
public String ruleResultHome(
@RequestParam(value = "rulePageNum", defaultValue="1") String rulePageNum,
Map model){
List<QualityRuleInfo> qualityRuleInfoList = new ArrayList<QualityRuleInfo>();
//查询出所有省份的信息
List<Province> provinceList=(List<Province>)provinceDao.findAll();
//查询出所有的渠道信息
//List<Channel> channelList=(List<Channel>)channelDao.findChannel();
List<Channel> channelList = channelService.getAllChannels();
//查询出所有的指标
List<Kpi> kpiList=(List<Kpi>)kpiDao.findAll();
//查询出所有的业务
List<String> businessList=businessService.getAllBusinessIdAndBusinessName();
//查询出所有的数据来源信息
List<DataSource> datasourceList=dataSourceDao.findDataSource();
//查询出所有的运营质量规则
qualityRuleInfoList = qualityRuleInfoService.getQualityRuleInfoByLastMonth();
Gson gson = new Gson();
model.put("provinceList", provinceList);
model.put("channelList", channelList);
model.put("kpiList", kpiList);
model.put("businessList",businessList);
model.put("datasourceList", datasourceList);
model.put("qualityRuleInfoList", gson.toJson(qualityRuleInfoList));
model.put("rulePageNum", rulePageNum);
cmszOperationLogService.createLog("查询","质量规则运营","质量规则运营首页");
return PageURLController.RuleOperation;
}
//根据筛选项搜索
@RequestMapping(value = "/changeTable*", method = RequestMethod.POST)
@ResponseBody
public void changeTable(@RequestParam(value = "period") String period,// 时间
@RequestParam(value = "dataSource") String dataSource,// 数据来源
@RequestParam(value = "chnnal") String chnnal,//渠道
@RequestParam(value = "bussines") String bussines,//业务
@RequestParam(value = "province") String province,//省份
@RequestParam(value = "ifFilter") String ifFilter,//是否过滤
HttpServletResponse response) throws ParseException, UnsupportedEncodingException {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
cmszOperationLogService.createLog("查询","质量规则运营查询","质量规则运营页面查询");
List<QualityRuleInfo> qualityRuleInfoList;
String[] time=period.split("~");
String[] dataSourceS=dataSource.split(",");
String[] chnnalS=chnnal.split(",");
String[] bussinesS =bussines.split(",");
String[] provinceS=province.split(",");
String[] ifFilterS=province.split(",");
Date time1=sdf.parse(time[0]);
Date time2=sdf.parse(time[1]);
List<Long> dataSourceList=changeStrToList(dataSourceS);
List<Long> chnnalList=changeStrToList(chnnalS);
List<Long> bussinesList=changeStrToList(bussinesS);
List<Long> provinceList=changeStrToList(provinceS);
List<Long> ifFilterList=changeStrToList(ifFilterS);
qualityRuleInfoList = qualityRuleInfoService.getQualityRuleInfoBy(time1,time2,dataSourceList,chnnalList,bussinesList,provinceList,ifFilterList);
Gson gson = new Gson();
response.setContentType("text/Xml;charset=gbk");
PrintWriter out = null;
try {
out = response.getWriter();
out.println(gson.toJson(qualityRuleInfoList));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
//将string数据类型转换成List<Long>类型
public List<Long> changeStrToList(String[] str){
List<Long> list = new ArrayList<Long>();
for(int i=0;i<str.length;i++){
list.add(Long.parseLong(str[i]));
}
return list;
}
}
...@@ -9,6 +9,10 @@ import java.util.Map; ...@@ -9,6 +9,10 @@ import java.util.Map;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.hp.cmsz.entity.*;
import com.hp.cmsz.repository.*;
import com.hp.cmsz.service.analysissupport.QualityRuleService;
import com.hp.cmsz.service.analysissupport.QualityRuleViewService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.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;
...@@ -17,22 +21,10 @@ import org.springframework.web.bind.annotation.RequestParam; ...@@ -17,22 +21,10 @@ 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.google.gson.Gson;
import com.hp.cmsz.entity.AccuracyRule;
import com.hp.cmsz.entity.Channel;
import com.hp.cmsz.entity.DataSource;
import com.hp.cmsz.entity.Kpi;
import com.hp.cmsz.entity.Province;
import com.hp.cmsz.entity.QualityRule;
import com.hp.cmsz.repository.AccuracyRuleDao;
import com.hp.cmsz.repository.DataSourceDao;
import com.hp.cmsz.repository.KpiDao;
import com.hp.cmsz.repository.ProvinceDao;
import com.hp.cmsz.repository.QualityRuleDao;
import com.hp.cmsz.service.BusinessService; import com.hp.cmsz.service.BusinessService;
import com.hp.cmsz.service.ChannelService; 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.web.PageURLController; import com.hp.cmsz.web.PageURLController;
/** /**
...@@ -60,13 +52,19 @@ public class QualityRuleResultController { ...@@ -60,13 +52,19 @@ public class QualityRuleResultController {
@Autowired @Autowired
private DataSourceDao dataSourceDao; private DataSourceDao dataSourceDao;
@Autowired @Autowired
private QualityRuleDao qualityRuleDao; private QualityRuleDao qualityRuleDao;
@Autowired @Autowired
private QualityRuleService qualityRuleService; private QualityRuleService qualityRuleService;
@Autowired
private QualityRuleViewDao qualityRuleViewDao;
@Autowired
private QualityRuleViewService qualityRuleViewService;
@Autowired @Autowired
private AccuracyRuleService accuracyRuleService; private AccuracyRuleService accuracyRuleService;
...@@ -82,7 +80,7 @@ public class QualityRuleResultController { ...@@ -82,7 +80,7 @@ public class QualityRuleResultController {
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.findAll(); List<Province> provinceList=(List<Province>)provinceDao.findAll();
//查询出所有的渠道信息 //查询出所有的渠道信息
...@@ -93,10 +91,10 @@ public class QualityRuleResultController { ...@@ -93,10 +91,10 @@ public class QualityRuleResultController {
//查询出所有的业务 //查询出所有的业务
List<String> businessList=businessService.getAllBusinessIdAndBusinessName(); List<String> businessList=businessService.getAllBusinessIdAndBusinessName();
//查询出所有的数据来源信息 //查询出所有的数据来源信息
List<DataSource> datasourceList=(List<DataSource>)dataSourceDao.findDataSource(); List<DataSource> datasourceList=dataSourceDao.findDataSource();
//查询出所有质量规则 //查询出所有质量规则
List<QualityRule> qualityRuleViewList=(List<QualityRule>)qualityRuleDao.findAll(); List<QualityRuleView> qualityRuleViewList= (List<QualityRuleView>) qualityRuleViewDao.findAll();
Gson gson = new Gson(); Gson gson = new Gson();
model.put("provinceList", provinceList); model.put("provinceList", provinceList);
model.put("channelList", channelList); model.put("channelList", channelList);
...@@ -114,61 +112,46 @@ public class QualityRuleResultController { ...@@ -114,61 +112,46 @@ public class QualityRuleResultController {
@RequestMapping(value = "/ruleTableChange*",method = RequestMethod.GET) @RequestMapping(value = "/ruleTableChange*",method = RequestMethod.GET)
@ResponseBody @ResponseBody
public void modelTableChange( public void modelTableChange(
@RequestParam(value = "province", defaultValue="") String province, @RequestParam(value = "dataSource") String dataSource,// 数据来源
@RequestParam(value = "channel", defaultValue="") String channel, @RequestParam(value = "chnnal") String chnnal,//渠道
@RequestParam(value = "datasource", defaultValue="") String datasource, @RequestParam(value = "bussines") String bussines,//业务
@RequestParam(value = "business", defaultValue="") String business, @RequestParam(value = "province") String province,//省份
HttpServletResponse response) throws UnsupportedEncodingException{ HttpServletResponse response) throws UnsupportedEncodingException{
cmszOperationLogService.createLog("查询","质量规则","由筛选项得到质量规则"); cmszOperationLogService.createLog("查询","质量规则","由筛选项得到质量规则");
List<QualityRule> qualityRuleS; List<QualityRuleView> qualityRuleViewList;
//将String型转换成List String[] dataSourceS=dataSource.split(",");
String[] channels=channel.split(","); String[] chnnalS=chnnal.split(",");
int size1=channels.length; String[] bussinesS =bussines.split(",");
Long[] channelS=new Long[size1]; String[] provinceS=province.split(",");
for(int i=0;i<channels.length;i++) List<Long> dataSourceList=changeStrToList(dataSourceS);
{ List<Long> chnnalList=changeStrToList(chnnalS);
channelS[i]=Long.parseLong(channels[i]); List<Long> bussinesList=changeStrToList(bussinesS);
} List<Long> provinceList=changeStrToList(provinceS);
//将String型转换成List qualityRuleViewList = qualityRuleViewService.getQualityRuleViewBy(dataSourceList,chnnalList,bussinesList,provinceList);
String[] dataSources=datasource.split(",");
int size2=dataSources.length;
Long[] dataSourceS=new Long[size2];
for(int i=0;i<dataSources.length;i++)
{
dataSourceS[i]=Long.parseLong(dataSources[i]);
}
//将String型转换成List
String[] businesss=business.split(",");
int size3=dataSources.length;
Long[] businessS=new Long[size3];
for(int i=0;i<businesss.length;i++)
{
businessS[i]=Long.parseLong(businesss[i]);
}
//将String型转换成List
String[] provinces=province.split(",");
int size4=dataSources.length;
Long[] provinceS=new Long[size4];
for(int i=0;i<provinces.length;i++)
{
provinceS[i]=Long.parseLong(provinces[i]);
}
qualityRuleS=qualityRuleService.getAllQualityRuleByOther(provinceS, dataSourceS, channelS, businessS);
Gson gson = new Gson(); Gson gson = new Gson();
response.setContentType("text/Xml;charset=gbk"); response.setContentType("text/Xml;charset=gbk");
PrintWriter out = null; PrintWriter out = null;
try { try {
out = response.getWriter(); out = response.getWriter();
out.println(gson.toJson(qualityRuleS)); out.println(gson.toJson(qualityRuleViewList));
} catch (IOException e) { } catch (IOException e) {
// TODO Auto-generated catch block // TODO Auto-generated catch block
e.printStackTrace(); e.printStackTrace();
} }
} }
//将string数据类型转换成List<Long>类型
public List<Long> changeStrToList(String[] str){
List<Long> list = new ArrayList<Long>();
for(int i=0;i<str.length;i++){
list.add(Long.parseLong(str[i]));
}
return list;
}
//删掉质量规则 //删掉质量规则
@RequestMapping(value = "/deleteOneRule*",method = RequestMethod.GET) @RequestMapping(value = "/deleteOneRule*",method = RequestMethod.GET)
......
...@@ -272,9 +272,9 @@ ...@@ -272,9 +272,9 @@
<li class="dropdown-submenu"> <li class="dropdown-submenu">
<a href="#">数据质量核查</a> <a href="#">数据质量核查</a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li><a href="${ctx}/AnalysisSupport/QualityRuleResult">质量规则维护</a></li> <li><a href="${ctx}/AnalysisSupport/QualityRuleResult">数据质量规则维护</a></li>
<li><a href="${ctx}/AnalysisSupport/QualityRuleOperation">数据质量运营</a></li>
<li><a href="${ctx}/AnalysisSupport/FilterRuleResult">过滤规则维护</a></li> <li><a href="${ctx}/AnalysisSupport/FilterRuleResult">过滤规则维护</a></li>
<li><a href="${ctx}/AnalysisSupport/">质量规则运营</a></li>
</ul> </ul>
</li> </li>
</shiro:hasPermission> </shiro:hasPermission>
......
<%@tag pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<!-- 质量规则是否过滤 -->
<div id="ws" class="slide-menu-option">
<label>是否过滤</label>
<select class="slide-menu-select" id="ifFilter" name="ifFilter">
<option value="'1'" title="是"><a href="#">是</a></option>
<option value="'0'" title="否"><a href="#">否</a></option>
</select>
</div>
<script type="text/javascript">
//获取其被选中的value,若是0则代表不是关键配置,若是1则代表是关键配置
function getIfFilter(){
return $("#ifFilter").val();
}
function getIfFilterTitle(){
return $("#ifFilter").find("option:selected").attr("title");
}
function RelFilterRest() {
$("#ifFilter").val("1");
}
</script>
\ No newline at end of file
...@@ -25,9 +25,9 @@ ...@@ -25,9 +25,9 @@
<div id="content" class="container"> <div id="content" class="container">
<div class="tab-bar-bt"> <div class="tab-bar-bt">
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<li><a href="${ctx}/AnalysisSupport/QualityRuleResult">质量规则维护</a></li> <li><a href="${ctx}/AnalysisSupport/QualityRuleResult">数据质量规则维护</a></li>
<li><a href="${ctx}/AnalysisSupport/QualityRuleOperation">数据质量运营</a></li>
<li class="active"><a href="#home" data-toggle="tab">过滤规则维护</a></li> <li class="active"><a href="#home" data-toggle="tab">过滤规则维护</a></li>
<li><a href="${ctx}/">质量规则运营</a></li>
</ul> </ul>
</div> </div>
<div class="section"> <div class="section">
......
...@@ -112,10 +112,15 @@ ...@@ -112,10 +112,15 @@
<input type='text' class='form-control' id='businessTime' name='businessTime' onfocus='WdatePicker({dateFmt:"yyyy-MM-dd HH:mm:00",readOnly:false,hmsMenuCfg : {H : [ 1, 6 ], m : [ 30, 2 ], s : [ 60, 0 ]}})'/> <input type='text' class='form-control' id='businessTime' name='businessTime' onfocus='WdatePicker({dateFmt:"yyyy-MM-dd HH:mm:00",readOnly:false,hmsMenuCfg : {H : [ 1, 6 ], m : [ 30, 2 ], s : [ 60, 0 ]}})'/>
</td> </td>
</tr> </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>添加准确性规则:</td>
<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> <td><table class="table table-hover table-striped" id="displayParam">
<tr><td>准确性规则:</td> <thead>
<td><select class="form-control" name="ruleType" id="ruleType" > <tr><th>规则类型</th><th>范围最大值</th><th>范围最小值</th><th>重复考核粒度</th><th>重复考核开始时间</th><th>重复考核结束时间</th><th>重复是否连续</th><th>重复最大次数</th><th>数据是否累计</th><th><a href="javascript:deleteAllTr()">删除所有规则</a></th></tr>
</thead>
<tbody id="addTr"></tbody>
</table></td></tr>
<tr><td>准确性规则类型:</td>
<td><select class="form-control" name="ruleType" id="ruleType" >
<option value=""></option> <option value=""></option>
<option value="1">范围类</option> <option value="1">范围类</option>
<option value="2">重复类</option> <option value="2">重复类</option>
...@@ -127,8 +132,10 @@ ...@@ -127,8 +132,10 @@
<tr class="repeate"><td>重复考核结束时间:</td><td><input id="repeatedCheckEndTime" name="repeatedCheckEndTime" class="form-control" type="text" onFocus="WdatePicker({maxDate:'#F{$dp.$D(\'repeatedCheckEndTime\')}'})"></td></tr> <tr class="repeate"><td>重复考核结束时间:</td><td><input id="repeatedCheckEndTime" name="repeatedCheckEndTime" class="form-control" type="text" onFocus="WdatePicker({maxDate:'#F{$dp.$D(\'repeatedCheckEndTime\')}'})"></td></tr>
<tr class="repeate"><td>重复是否连续:</td><td><input type='text' name='ifRepeatedCheckSeries' id='ifRepeatedCheckSeries' class="form-control" style="display: inline;"/></td></tr> <tr class="repeate"><td>重复是否连续:</td><td><input type='text' name='ifRepeatedCheckSeries' id='ifRepeatedCheckSeries' 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='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="addParam" class="btn btn-primary">添加规则</button></td></tr>
<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>
...@@ -146,20 +153,23 @@ ...@@ -146,20 +153,23 @@
<script type="text/javascript"> <script type="text/javascript">
$(".range").hide(); $(".range").hide();
$(".repeate").hide(); $(".repeate").hide();
$("#addParam").hide();
$("#ruleType").change(function (){ $("#ruleType").change(function (){
var selectValue = $("#ruleType").val(); var selectValue = $("#ruleType").val();
console.log(selectValue);
if (selectValue == ""){ if (selectValue == ""){
$(".range").hide(); $(".range").hide();
$(".repeate").hide(); $(".repeate").hide();
$("#addParam").hide();
} }
if (selectValue == 1){ if (selectValue == 1){
$(".repeate").hide(); $(".repeate").hide();
$(".range").show(); $(".range").show();
$("#addParam").show();
} }
if (selectValue == 2){ if (selectValue == 2){
$(".range").hide(); $(".range").hide();
$(".repeate").show(); $(".repeate").show();
$("#addParam").show();
} }
}) })
......
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
<head>
<title>全网监控智能分析平台</title>
</head>
<body>
<div id="sticky-wrap"></div>
<div>
<div class="container">
<ol class="breadcrumb">
<li><a href="${ctx}/index">首页</a></li>
<li>数据质量核查</li>
<li class="active">质量规则运营</li>
</ol>
</div>
</div>
<div id="main-container main-tab-container">
<div id="content" class="container">
<div class="tab-bar-bt">
<ul class="nav nav-tabs">
<li><a href="${ctx}/AnalysisSupport/QualityRuleResult">数据质量规则维护</a></li>
<li class="active"><a href="#home" data-toggle="tab">数据质量运营</a></li>
<li><a href="${ctx}/AnalysisSupport/FilterRuleResult">过滤规则维护</a></li>
</ul>
</div>
<div class="section">
<div class="tab-content">
<div class="tab-pane fade in active" id="home">
<div class="row me-row">
<div id="slidePushMenus2" class="cbp-spmenu-push">
<div class="slideMenu" id="cbp-spmenu-s2" style="">
<div class="form">
<tags:PeriodTag />
<tags:Public_ProvinceTag />
<tags:GJFX_datasource_channle_business/>
<tags:QualityRule_IfFilter />
<button id="submit" class="btn btn-primary" onclick="operResultSubmit()">提交</button>
<button id="disable" class="btn btn-warning" onclick="operResultReset()">重置</button>
</div>
</div>
<div class="main col-xs-12">
<div id="mainm2" class="mainm" ></div>
<div class="content clearfix">
<div class="block clearfix">
<button id="showLeftPush2" class="menu-trigger btn btn-default" onclick="toggleMenu('slidePushMenus2')">
<span class="glyphicon glyphicon-list"></span>
</button>
<div class="slide-menu-tags">
<span id="PeriodTag" class="label label-info" data-placement="bottom" >最近一个月</span>
<span id="ProvinceTag" class="label label-info" data-placement="bottom"></span>
<span id="DataSourceTag" class="label label-info" data-placement="bottom" ></span>
<span id="ChannelTag3" class="label label-info" data-placement="bottom"></span>
<span id="BusinessTag" class="label label-info" data-placement="bottom" ></span>
<span id="ifFilterTag" class="label label-info" data-placement="bottom" ></span>
</div>
<div class="bt-list-import">
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="table-header">
质量规则运营结果
<shiro:hasAnyRoles name="admin,dataAnalysis,businessAnalysis">
<div id="time_div" style="top: -6px;float: right;height: 0px;position: relative;">
</div>
</shiro:hasAnyRoles>
</div>
<table id="ruleOperationTable" class="table table-hover table-striped">
</table>
<input type="hidden" id="qualityRuleInfo" name="qualityRuleInfo" value='${qualityRuleInfoList}' />
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<form action="#" method="get" id="listForm"></form>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="${ctx}/static/js/ruleOperationDetailTable.js"></script>
<script type="text/javascript">
initDate();
ruleOperationDetailTable();
function operResultSubmit(){
var period=getPeriodStr();
var dataSource=getStatsDataSourceCheckedValuesString();
var chnnal=getStatsChannelCheckedValuesString();
var bussines=getStatsBusinessCheckedValuesString();
var province=getProvinceCheckedValuesString();
var ifFilter=getIfFilter();
if(dataSource==""){
$.alert("数据来源的选择不能为空");
}else if(chnnal===""){
$.alert("渠道的选择不能为空");
}else if(bussines===""){
$.alert("业务的选择不能为空");
}else if(province===""){
$.alert("省份的选择不能为空");
}else if(ifFilter==="") {
$.alert("是否过滤的选择不能为空");
}else{
toggleMenu('slidePushMenus');//隐藏筛选项
//时间标签
$('#PeriodTag').text("时间范围").attr('data-original-title',getPeriodStr()).tooltip();
//数据来源标签
$('#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();
//是否过滤
$('#ifFilterTag').text("是否过滤").attr('data-original-title', getIfFilterTitle()).tooltip();
if(period==""){
$.alert("时间选择不能为空");
}
$.ajax({
type : 'GET',
contentType : 'application/json',
url: "${ctx}/AnalysisSupport/QualityRuleOperation/changeTable?period="+period+"&province="+province+"&dataSource="+dataSource+"&chnnal="+chnnal+"&bussines="+bussines+"&ifFilter="+ifFilter,
dataType : 'text',
async: false,
beforeSend: function(data) {
},
success: function(data) {
$("#qualityRuleInfo").val(data);
ruleOperationDetailTable();
ruleId="";
toggleMenu('slidePushMenus2');//隐藏筛选项
updateTag(true);
}
});
}
}
function operResultReset(){
initDate();
ProvinceReset();
statsDataSourceReset();//三级联动重置
RelFilterRest();
}
</script>
</body>
</html>
\ No newline at end of file
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<html> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>质量规则维护</title> <title>全网监控智能分析平台</title>
</head> </head>
<body> <body>
<div> <div>
...@@ -25,9 +25,9 @@ ...@@ -25,9 +25,9 @@
<div id="content" class="container"> <div id="content" class="container">
<div class="tab-bar-bt"> <div class="tab-bar-bt">
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<li class="active"><a href="#home" data-toggle="tab">质量规则维护</a></li> <li class="active"><a href="#home" data-toggle="tab">数据质量规则维护</a></li>
<li><a href="${ctx}/AnalysisSupport/QualityRuleOperation">数据质量运营</a></li>
<li><a href="${ctx}/AnalysisSupport/FilterRuleResult">过滤规则维护</a></li> <li><a href="${ctx}/AnalysisSupport/FilterRuleResult">过滤规则维护</a></li>
<li><a href="${ctx}/">质量规则运营</a></li>
</ul> </ul>
</div> </div>
<div class="section"> <div class="section">
...@@ -57,7 +57,10 @@ ...@@ -57,7 +57,10 @@
<span class="glyphicon glyphicon-list"></span> <span class="glyphicon glyphicon-list"></span>
</button> </button>
<div class="slide-menu-tags"> <div class="slide-menu-tags">
<span id="ChannelTag" class="label label-info" data-placement="bottom" ></span>
<span id="ProvinceTag" class="label label-info" data-placement="bottom" ></span>
<span id="DataSourceTag" class="label label-info" data-placement="bottom" ></span>
<span id="BusinessTag" class="label label-info" data-placement="bottom" ></span>
</div> </div>
</div> </div>
...@@ -187,7 +190,8 @@ $("#createRule").click(function(){ ...@@ -187,7 +190,8 @@ $("#createRule").click(function(){
} }
}); });
} }
}
function ruleResultReset(){ function ruleResultReset(){
ProvinceReset(); ProvinceReset();
statsDataSourceReset();//三级联动重置 statsDataSourceReset();//三级联动重置
...@@ -208,7 +212,6 @@ $("#createRule").click(function(){ ...@@ -208,7 +212,6 @@ $("#createRule").click(function(){
}); });
}
</script> </script>
</body> </body>
</html> </html>
\ No newline at end of file
This diff is collapsed.
...@@ -128,19 +128,21 @@ function ruleResultDetailTable(){ ...@@ -128,19 +128,21 @@ 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] = ["数据来源","dataSourceId","7%","15"]; header[2] = ["省份","provinceName","7%","15"];
header[3] = ["渠道","channelId","7%","15"]; header[3] = ["数据来源","dataSourceName","7%","15"];
header[4] = ["业务","businessId","7%","15"]; header[4] = ["渠道","channelName","7%","15"];
header[5] = ["指标名称","kpiId","7%","15"]; header[5] = ["业务","businessName","7%","15"];
header[6] = ["指标编码","kpiCode","7%","15"]; header[6] = ["指标名称","kpiName","7%","15"];
header[7] = ["数据类型","dataSourceId","7%","15"]; header[7] = ["指标编码","kpiCode","7%","15"];
header[8] = ["数据采集频率","calCycle","7%","15"]; header[8] = ["数据类型","kpiTypeName","7%","15"];
header[9] = ["指标监控时间","kpiMonitorTime","7%","15"]; header[9] = ["数据采集频率","calCycle","7%","15"];
header[10] = ["指标采集时间","businessTime","7%","15"]; header[10] = ["指标监控范围","kpiMonitorTime","7%","15"];
header[11] = ["准确性规则","accuracyRuleId","7%","15"]; header[11] = ["指标采集时间","businessTime","7%","15"];
header[12] = ["准确性规则","accuracyRuleId","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,19 +301,19 @@ table_pagging.prototype = { ...@@ -299,19 +301,19 @@ table_pagging.prototype = {
tdContext = "&nbsp;"; tdContext = "&nbsp;";
} }
if(k==9){ if(k==10){
if(tdContext!="&nbsp;"){ if(tdContext!="&nbsp;"){
tdContext = df.format(new Date(tdContext)); tdContext = df.format(new Date(tdContext));
} }
} }
if(k==10){ if(k==11){
if(tdContext!="&nbsp;"){ if(tdContext!="&nbsp;"){
tdContext = df.format(new Date(tdContext)); tdContext = df.format(new Date(tdContext));
} }
} }
if(k==11){ if(k==12){
tdContext = "<a href='javascript:;' onclick='selectRule(\""+this.getData(this.objectlist[i],"qualityRuleId")+"\")'>查看规则</a>"; tdContext = "<a href='javascript:;' onclick='selectRule(\""+this.getData(this.objectlist[i],"qualityRuleId")+"\")'>查看规则</a>";
} }
...@@ -333,7 +335,7 @@ table_pagging.prototype = { ...@@ -333,7 +335,7 @@ table_pagging.prototype = {
} }
console.log(tdContext);
td.innerHTML = tdContext; td.innerHTML = tdContext;
// alert(tdContext+"----i:"+i+",j:"+j+",k:"+k); // alert(tdContext+"----i:"+i+",j:"+j+",k:"+k);
...@@ -532,7 +534,7 @@ function selectRule(qualityRuleId){ ...@@ -532,7 +534,7 @@ function selectRule(qualityRuleId){
$.dialog({ $.dialog({
title:"准确性规则", title:"准确性规则",
content:"<div id='ruleList'>"+ content:"<div id='ruleList'>"+
"<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='10%'>规则类型</th> <th width='15%'>范围最大值</th> <th width='15%'>范围最小值</th> <th width='15%'>重复考核粒度</th> <th width='15%'>重复考核开始时间</th> <th width='15%'>重复考核结束时间</th> <th width='15%'>重复是否连续</th> <th width='15%'>重复最大次数</th> <th width='15%'>数据是否累计</th> </tr> </thead> <tbody> </tbody> </table> </div> </div> </div>"+ "<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=''>规则类型</th> <th width=''>范围最大值</th> <th width=''>范围最小值</th> <th width=''>重复考核粒度</th> <th width=''>重复考核开始时间</th> <th width=''>重复考核结束时间</th> <th width=''>重复是否连续</th> <th width=''>重复最大次数</th> <th width=''>数据是否累计</th> </tr> </thead> <tbody> </tbody> </table> </div> </div> </div>"+
"</div>", "</div>",
lock:true, lock:true,
width:800, width:800,
...@@ -554,16 +556,46 @@ function selectRule(qualityRuleId){ ...@@ -554,16 +556,46 @@ function selectRule(qualityRuleId){
if (data != null && data != "") { if (data != null && data != "") {
var ruleTbody = $('#ruleList tbody'); var ruleTbody = $('#ruleList tbody');
for (var i = 0; i < data.length; i++) { for (var i = 0; i < data.length; i++) {
if(data[i].ifRepeatedCheckSeries == "0"){
data[i].ifRepeatedCheckSeries = "否";
} else if(data[i].ifRepeatedCheckSeries =="1") {
data[i].ifRepeatedCheckSeries ="是";
}
if(data[i].ifRepeatedCheckSummation == "0"){
data[i].ifRepeatedCheckSummation = "否";
} else if(data[i].ifRepeatedCheckSummation =="1"){
data[i].ifRepeatedCheckSummation ="是";
}
if(data[i].repeatedCheckStartTime != null){
data[i].repeatedCheckStartTime = df.format(new Date(data[i].repeatedCheckStartTime));
}
if(data[i].repeatedCheckEndTime != null){
data[i].repeatedCheckEndTime = df.format(new Date(data[i].repeatedCheckEndTime));
}
if(data[i].scopeMaxValue != null){
data[i].scopeMaxValue =parseFloat(data[i].scopeMaxValue);
}
if(data[i].scopeMinValue != null){
data[i].scopeMinValue =parseFloat(data[i].scopeMinValue);
}
if(data[i].repeatedCheckGranularity =="day"){
data[i].repeatedCheckGranularity ="日";
}else if(data[i].repeatedCheckGranularity =="mon"){
data[i].repeatedCheckGranularity ="月";
}
ruleTbody.append($("<tr></tr>").append("<td>" + data[i].ruleType + "</td>") ruleTbody.append($("<tr></tr>").append("<td>" + data[i].ruleType + "</td>")
.append("<td>" + (data[i].scopeMaxValue == null ? "" : data[i].scopeMaxValue) + "</td>") .append("<td>" + (data[i].scopeMaxValue == null ? "" : data[i].scopeMaxValue) + "</td>")
.append("<td>" + (data[i].scopeMinValue == null ? "" : data[i].scopeMinValue) + "</td>") .append("<td>" + (data[i].scopeMinValue == null ? "" : data[i].scopeMinValue) + "</td>")
.append("<td>" + (data[i].repeatedCheckGranularity == null ? "" : data[i].repeatedCheckGranularity) + "</td>") .append("<td>" + (data[i].repeatedCheckGranularity == null ? "" : data[i].repeatedCheckGranularity) + "</td>")
.append("<td>" + (data[i].repeatedCheckStartTime == null ? "" : data[i].repeatedCheckStartTime) + "</td>") .append("<td>" + (data[i].repeatedCheckStartTime == null ? "" : data[i].repeatedCheckStartTime) + "</td>")
.append("<td>" + (data[i].repeatedCheckEndTime == null ? "" : data[i].repeatedCheckEndTime) + "</td>") .append("<td>" + (data[i].repeatedCheckEndTime == null ? "" : data[i].repeatedCheckEndTime) + "</td>")
.append("<td>" + (data[i].ifRepeatedCheckSeries == null ? "" : data[i].ifRepeatedCheckSeries) + "</td>") .append("<td>" + (data[i].ifRepeatedCheckSeries == null ? "" : data[i].ifRepeatedCheckSeries) + "</td>")
.append("<td>" + (data[i].repeatedCheckMaxTime == null ? "" : data[i].repeatedCheckMaxTime) + "</td>") .append("<td>" + (data[i].repeatedCheckMaxTime == null ? "" : data[i].repeatedCheckMaxTime) + "</td>")
.append("<td>" + (data[i].ifRepeatedCheckSummation == null ? "" : data[i].ifRepeatedCheckSummation) + "</td>")); .append("<td>" + (data[i].ifRepeatedCheckSummation == null ? "" : data[i].ifRepeatedCheckSummation) + "</td>"));
} }
} }
} }
}); });
......
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