Commit e7202c9c authored by afe's avatar afe

Merge branch 'liuna'

# Conflicts: # src/main/java/com/hp/cmsz/entity/GjfxRelatedInsideWorkingOrder.java # src/main/java/com/hp/cmsz/entity/InsideXcdWorkingOrderInfoView.java # src/main/java/com/hp/cmsz/repository/GjfxRelatedInsideWorkingOrderDao.java # src/main/java/com/hp/cmsz/repository/InsideXcdWorkingOrderInfoViewDao.java # src/main/java/com/hp/cmsz/service/monitoroperation/InsideXcdWorkingOrderInfoViewService.java # src/main/webapp/WEB-INF/classes/com/hp/cmsz/web/PageURLController.class
parents 1a4c46a4 90fe13b3
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;
/**
* accuracy_rule_info_t表对应的实体类
*
* @author Liu Na
*
*/
@Entity
@Table(name = "accuracy_rule_info_t")
public class AccuracyRule implements Serializable {
private Long accuracyRuleId;//准确性规则ID
private Long qualityRuleId;//质量规则ID
private String ruleType;//规则类型
private double scopeMaxValue;//范围最大值
private double scopeMinValue;//范围最小值
private String repeatedCheckGranularity;//重复考核粒度
private Date repeatedCheckStartTime;//重复考核开始时间
private Date repeatedCheckEndTime;//重复考核结束时间
private String ifRepeatedCheckSeries;//重复是否连续
private Long repeatedCheckMaxTime;//重复最大次数
private String ifRepeatedCheckSummation;//数据是否累计
private Date ruleCrtTime;//规则创建时间
private Date ruleUpdateTime;//规则更新时间
private String validFlag;//规则是否有效
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="AccuracyRuleSequence")
@SequenceGenerator(name = "AccuracyRuleSequence", sequenceName = "accuracy_rule_info_t_seq", allocationSize=1)
public Long getAccuracyRuleId() {
return accuracyRuleId;
}
public void setAccuracyRuleId(Long accuracyRuleId) {
this.accuracyRuleId = accuracyRuleId;
}
public Long getQualityRuleId() {
return qualityRuleId;
}
public void setQualityRuleId(Long qualityRuleId) {
this.qualityRuleId = qualityRuleId;
}
public String getRuleType() {
return ruleType;
}
public void setRuleType(String ruleType) {
this.ruleType = ruleType;
}
public double getScopeMaxValue() {
return scopeMaxValue;
}
public void setScopeMaxValue(double scopeMaxValue) {
this.scopeMaxValue = scopeMaxValue;
}
public double getScopeMinValue() {
return scopeMinValue;
}
public void setScopeMinValue(double scopeMinValue) {
this.scopeMinValue = scopeMinValue;
}
public String getRepeatedCheckGranularity() {
return repeatedCheckGranularity;
}
public void setRepeatedCheckGranularity(String repeatedCheckGranularity) {
this.repeatedCheckGranularity = repeatedCheckGranularity;
}
public Date getRepeatedCheckStartTime() {
return repeatedCheckStartTime;
}
public void setRepeatedCheckStartTime(Date repeatedCheckStartTime) {
this.repeatedCheckStartTime = repeatedCheckStartTime;
}
public Date getRepeatedCheckEndTime() {
return repeatedCheckEndTime;
}
public void setRepeatedCheckEndTime(Date repeatedCheckEndTime) {
this.repeatedCheckEndTime = repeatedCheckEndTime;
}
public String getIfRepeatedCheckSeries() {
return ifRepeatedCheckSeries;
}
public void setIfRepeatedCheckSeries(String ifRepeatedCheckSeries) {
this.ifRepeatedCheckSeries = ifRepeatedCheckSeries;
}
public Long getRepeatedCheckMaxTime() {
return repeatedCheckMaxTime;
}
public void setRepeatedCheckMaxTime(Long repeatedCheckMaxTime) {
this.repeatedCheckMaxTime = repeatedCheckMaxTime;
}
public String getIfRepeatedCheckSummation() {
return ifRepeatedCheckSummation;
}
public void setIfRepeatedCheckSummation(String ifRepeatedCheckSummation) {
this.ifRepeatedCheckSummation = ifRepeatedCheckSummation;
}
public Date getRuleCrtTime() {
return ruleCrtTime;
}
public void setRuleCrtTime(Date ruleCrtTime) {
this.ruleCrtTime = ruleCrtTime;
}
public Date getRuleUpdateTime() {
return ruleUpdateTime;
}
public void setRuleUpdateTime(Date ruleUpdateTime) {
this.ruleUpdateTime = ruleUpdateTime;
}
public String getValidFlag() {
return validFlag;
}
public void setValidFlag(String validFlag) {
this.validFlag = validFlag;
}
}
package com.hp.cmsz.entity;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
/**
* warning_filtering_rule_info_t表对应的实体类
*
* @author Liu Na
*
*/
public class FilterRule implements Serializable{
private Long warningFilteringRuleId;//过滤规则ID
private Long kpiId;//指标ID
private Long provinceId;//省份ID
private Long channelId;//渠道ID
private Long businessId;//业务ID
private Date filterStartTime;//过滤开始时间
private Date filterEndTime;//过滤结束时间
private String filterReason;//过滤原因
private String filterType;//过滤类型
private Date ruleCrtTime;//规则创建时间
private Date ruleUpdateTime;//规则更新时间
private String validFlag;//规则是否有效
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="FilterRuleSequence")
@SequenceGenerator(name = "FilterRuleSequence", sequenceName = "warning_filtering_rule_info_t_seq", allocationSize=1)
public Long getWarningFilteringRuleId() {
return warningFilteringRuleId;
}
public void setWarningFilteringRuleId(Long warningFilteringRuleId) {
this.warningFilteringRuleId = warningFilteringRuleId;
}
public Long getKpiId() {
return kpiId;
}
public void setKpiId(Long kpiId) {
this.kpiId = kpiId;
}
public Long getProvinceId() {
return provinceId;
}
public void setProvinceId(Long provinceId) {
this.provinceId = provinceId;
}
public Long getChannelId() {
return channelId;
}
public void setChannelId(Long channelId) {
this.channelId = channelId;
}
public Long getBusinessId() {
return businessId;
}
public void setBusinessId(Long businessId) {
this.businessId = businessId;
}
public Date getFilterStartTime() {
return filterStartTime;
}
public void setFilterStartTime(Date filterStartTime) {
this.filterStartTime = filterStartTime;
}
public Date getFilterEndTime() {
return filterEndTime;
}
public void setFilterEndTime(Date filterEndTime) {
this.filterEndTime = filterEndTime;
}
public String getFilterReason() {
return filterReason;
}
public void setFilterReason(String filterReason) {
this.filterReason = filterReason;
}
public String getFilterType() {
return filterType;
}
public void setFilterType(String filterType) {
this.filterType = filterType;
}
public Date getRuleCrtTime() {
return ruleCrtTime;
}
public void setRuleCrtTime(Date ruleCrtTime) {
this.ruleCrtTime = ruleCrtTime;
}
public Date getRuleUpdateTime() {
return ruleUpdateTime;
}
public void setRuleUpdateTime(Date ruleUpdateTime) {
this.ruleUpdateTime = ruleUpdateTime;
}
public String getValidFlag() {
return validFlag;
}
public void setValidFlag(String validFlag) {
this.validFlag = validFlag;
}
}
package com.hp.cmsz.entity;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
/**
* quality_rule_warehouse_info_t表对应的实体类
*
* @author Liu Na
*
*/
public class QualityRule implements Serializable {
private Long qualityRuleId;//质量规则ID
private Long businessId;//业务ID
private Long kpiId;//指标ID
private Long channelId;//渠道ID
private Long provinceId;//省份维表ID
private Long taskId;//任务ID
private Long dataSourceId;//数据来源ID
private String kpiMonitorTime;//指标检测时间
private String kpiMonitorRange;//指标检查范围
private double integrityThresholdValue;//完整性阈值
private Long timelinessThresholdValue;//及时性阈值
private Date ruleCrtTime;//规则创建时间
private Date ruleUpdateTime;//规则更新时间
private String rileValidFlag;//规则是否有效
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="QualityRuleSequence")
@SequenceGenerator(name = "QualityRuleSequence", sequenceName = "quality_rule_warehouse_info_t_seq", allocationSize=1)
public Long getQualityRuleId() {
return qualityRuleId;
}
public void setQualityRuleId(Long qualityRuleId) {
this.qualityRuleId = qualityRuleId;
}
public Long getBusinessId() {
return businessId;
}
public void setBusinessId(Long businessId) {
this.businessId = businessId;
}
public Long getKpiId() {
return kpiId;
}
public void setKpiId(Long kpiId) {
this.kpiId = kpiId;
}
public Long getChannelId() {
return channelId;
}
public void setChannelId(Long channelId) {
this.channelId = channelId;
}
public Long getProvinceId() {
return provinceId;
}
public void setProvinceId(Long provinceId) {
this.provinceId = provinceId;
}
public Long getTaskId() {
return taskId;
}
public void setTaskId(Long taskId) {
this.taskId = taskId;
}
public Long getDataSourceId() {
return dataSourceId;
}
public void setDataSourceId(Long dataSourceId) {
this.dataSourceId = dataSourceId;
}
public String getKpiMonitorTime() {
return kpiMonitorTime;
}
public void setKpiMonitorTime(String kpiMonitorTime) {
this.kpiMonitorTime = kpiMonitorTime;
}
public String getKpiMonitorRange() {
return kpiMonitorRange;
}
public void setKpiMonitorRange(String kpiMonitorRange) {
this.kpiMonitorRange = kpiMonitorRange;
}
public double getIntegrityThresholdValue() {
return integrityThresholdValue;
}
public void setIntegrityThresholdValue(double integrityThresholdValue) {
this.integrityThresholdValue = integrityThresholdValue;
}
public Long getTimelinessThresholdValue() {
return timelinessThresholdValue;
}
public void setTimelinessThresholdValue(Long timelinessThresholdValue) {
this.timelinessThresholdValue = timelinessThresholdValue;
}
public Date getRuleCrtTime() {
return ruleCrtTime;
}
public void setRuleCrtTime(Date ruleCrtTime) {
this.ruleCrtTime = ruleCrtTime;
}
public Date getRuleUpdateTime() {
return ruleUpdateTime;
}
public void setRuleUpdateTime(Date ruleUpdateTime) {
this.ruleUpdateTime = ruleUpdateTime;
}
public String getRileValidFlag() {
return rileValidFlag;
}
public void setRileValidFlag(String rileValidFlag) {
this.rileValidFlag = rileValidFlag;
}
}
package com.hp.cmsz.repository;
import java.util.Date;
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.AccuracyRule;
/**
*
* @author Liu Na
*
*/
public interface AccuracyRuleDao extends JpaSpecificationExecutor<AccuracyRule>,
PagingAndSortingRepository<AccuracyRule, Long>{
//根据准确性规则ID查找质量规则
List<AccuracyRule> findByQualityRuleId(Long qualityRuleId);
//根据准确性规则ID查找质量规则
List<AccuracyRule> findByQualityRuleIdIn(List<Long> qualityRuleId);
//根据准确性规则ID更新质量规则ID
@Modifying
@Query("update AccuracyRule ar set ar.qualityRuleId=:qualityRuleId where ar.accuracyRuleId in (:accuracyRuleIds)")
void updateQualityRuleIdByAccuracyRuleIds(@Param("qualityRuleId")Long qualityRuleId, @Param("accuracyRuleIds")List<Long> accuracyRuleIds);
//根据准确性规则ID更新准确性规则信息
@Modifying
@Query("update AccuracyRule ar set ar.ruleType=:ruleType, ar.scopeMaxValue=:scopeMaxValue, ar.scopeMinValue=:scopeMinValue, ar.repeatedCheckGranularity=:repeatedCheckGranularity, ar.repeatedCheckStartTime=:repeatedCheckStartTime, ar.repeatedCheckEndTime=:repeatedCheckEndTime, ar.ifRepeatedCheckSeries=:ifRepeatedCheckSeries, ar.repeatedCheckMaxTime=:repeatedCheckMaxTime, ar.ifRepeatedCheckSummation=:ifRepeatedCheckSummation where ar.accuracyRuleId =:accuracyRuleId")
void updateAccuracyRuleByAccuracyRuleId(@Param("ruleType")String ruleType,@Param("scopeMaxValue")double scopeMaxValue,@Param("scopeMinValue")double scopeMinValue,@Param("repeatedCheckGranularity")String repeatedCheckGranularity,@Param("repeatedCheckStartTime")Date repeatedCheckStartTime,@Param("repeatedCheckEndTime")Date repeatedCheckEndTime,@Param("ifRepeatedCheckSeries")String ifRepeatedCheckSeries,@Param("repeatedCheckMaxTime")Long repeatedCheckMaxTime,@Param("ifRepeatedCheckSummation")String ifRepeatedCheckSummation);
//根据准确性规则ID删除一条准确性规则信息
@Modifying
@Query("delete from AccuracyRule ar where ar.accuracyRuleId=:accuracyRuleId")
void deleteAccuracyRuleByAccuracyRuleId(@Param("accuracyRuleId")Long accuracyRuleId);
//根据质量规则ID删除准确性规则信息
@Modifying
@Query("delete from AccuracyRule ar where ar.qualityRuleId=:qualityRuleId")
void deleteAccuracyRuleByOneQualityRuleId(@Param("qualityRuleId")Long qualityRuleId);
//根据多个数据模型ID删除参数信息
@Modifying
@Query("delete from AccuracyRule ar where ar.qualityRuleId in (:qualityRuleId)")
void deleteAccuracyRuleByQualityRuleId(@Param("qualityRuleId")List<Long> qualityRuleId);
}
package com.hp.cmsz.repository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import com.hp.cmsz.entity.FilterRule;
/**
*
* @author Liu Na
*
*/
public interface FilterRuleDao extends JpaSpecificationExecutor<FilterRule>,
PagingAndSortingRepository<FilterRule, Long>{
}
package com.hp.cmsz.repository;
import java.util.Date;
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.QualityRule;
/**
*
* @author Liu Na
*
*/
public interface QualityRuleDao extends JpaSpecificationExecutor<QualityRule>,
PagingAndSortingRepository<QualityRule, Long>{
List<QualityRule> findAll();
//根据质量规则ID查找质量规则
QualityRule findByQualityRuleId(Long qualityRuleId);
//根据质量规则ID查找质量规则
List<QualityRule> findByQualityRuleIdIn(List<Long> qualityRuleId);
//根据质量规则ID删除质量规则
@Modifying
@Query("delete from QualityRule qr where qr.qualityRuleId in (:qualityRuleId)")
void deleteQualityRuleByQualityRuleId(@Param("qualityRuleId")List<Long> qualityRuleId);
//根据质量规则ID修改质量规则
@Modifying
@Query("update from QualityRule qr set qr.businessId=:businessId, qr.kpiId=:kpiId, qr.channelId=:channelId, qr.provinceId=:provinceId, qr.dataSourceId=:dataSourceId, qr.kpiMonitorTime=:kpiMonitorTime, qr.kpiMonitorRange=:kpiMonitorRange,dm.integrityThresholdValue=:integrityThresholdValue, qr.timelinessThresholdValue=:timelinessThresholdValue, 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);
//根据质量规则ID得到数据条数
@Query("select count(*) from QualityRule qualityRule where qualityRule.qualityRuleId=:qualityRuleId")
Long getNumOfQualityRuleByQualityRuleId(@Param("qualityRuleId")String qualityRuleId);
//根据省份、渠道、业务、指标查询质量规则
List<QualityRule> findByProvinceIdInAndBusinessIdInAndKpiIdInAndChannelIdInOrderByQualityRuleIdDesc(List<Long> provinceId, List<Long> businessId, List<Long> kpiId, List<Long> channelId);
}
package com.hp.cmsz.service.analysissupport;
import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.hp.cmsz.repository.AccuracyRuleDao;
/**
*
* @author Liu Na
*
*/
@Service
@Transactional
public class AccuracyRuleService {
@Autowired
private AccuracyRuleDao accuracyRuleDao;
//根据准确性规则ID更新质量规则ID
@Transactional(readOnly=false)
public void updateAccuracyRuleByAccuracyRuleIds(Long qualityRuleId,List<Long> accuracyRuleIds){
accuracyRuleDao.updateQualityRuleIdByAccuracyRuleIds(qualityRuleId, accuracyRuleIds);;
}
//根据准确性规则ID更新准确性规则
@Transactional(readOnly=false)
public void updateAccuracyRuleByAccuracyRuleId(String ruleType,double scopeMaxValue,double scopeMinValue,String repeatedCheckGranularity,Date repeatedCheckStartTime,Date repeatedCheckEndTime,String ifRepeatedCheckSeries,Long repeatedCheckMaxTime,String ifRepeatedCheckSummation){
accuracyRuleDao.updateAccuracyRuleByAccuracyRuleId(ruleType, scopeMaxValue, scopeMinValue, repeatedCheckGranularity, repeatedCheckStartTime, repeatedCheckEndTime, ifRepeatedCheckSeries, repeatedCheckMaxTime, ifRepeatedCheckSummation);;
}
//根据准确性规则ID删除一条准确性规则信息
@Transactional(readOnly=false)
public void deleteAccuracyRuleByAccuracyRuleId(Long accuracyRuleId){
accuracyRuleDao.deleteAccuracyRuleByAccuracyRuleId(accuracyRuleId);
}
//根据数据模型ID删除一条参数信息
@Transactional(readOnly=false)
public void deleteAccuracyRuleByOneQualityRuleId(Long qualityRuleId){
accuracyRuleDao.deleteAccuracyRuleByOneQualityRuleId(qualityRuleId);
}
//根据数据模型IDS删除多条参数信息
@Transactional(readOnly=false)
public void deleteAccuracyRuleByQualityRuleId(List<Long> qualityRuleId){
accuracyRuleDao.deleteAccuracyRuleByQualityRuleId(qualityRuleId);
}
}
package com.hp.cmsz.service.analysissupport;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
*
* @author Liu Na
*
*/
@Service
@Transactional
public class FilterRuleService {
}
package com.hp.cmsz.service.analysissupport;
import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.hp.cmsz.repository.QualityRuleDao;
/**
*
* @author Liu Na
*
*/
@Service
@Transactional
public class QualityRuleService {
@Autowired
private QualityRuleDao qualityRuleDao;
//根据质量规则ID删除质量规则
@Transactional(readOnly=false)
public void deleteByQualityRuleId(List<Long> qualityRuleId){
qualityRuleDao.deleteQualityRuleByQualityRuleId(qualityRuleId);
}
//根据质量规则ID修改质量规则
@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){
qualityRuleDao.updateQualityRuleByQualityRuleId(businessId, kpiId, channelId, provinceId, dataSourceId, kpiMonitorTime, kpiMonitorRange, integrityThresholdValue, timelinessThresholdValue, ruleCrtTime, ruleUpdateTime, qualityRuleId);
}
}
......@@ -174,6 +174,14 @@ public class PageURLController {
public static String ModelMonitor ="ModelManage/ModelMonitor";
//运营支撑下的数据质量核查
public static String RuleResult = "AnalysisSupport/QualityRuleResult";
public static String RuleMaintain = "AnalysisSupport/QualityRuleMaintain";
public static String RuleConfiguration = "AnalysisSupport/QualityRuleConfiguration";
public static String FilterResult = "AnalysisSupport/FilterRuleResult";
public static String FilterMaintain = "AnalysisSupport/FilterRuleMaintain";
public static String FilterConfiguration = "AnalysisSupport/FilterRuleConfiguration";
//基础管理
//AuthorityManage映射到WEB-INF/views下的AuthorityManage/AuthorityManage.jsp页面
public static String AuthorityManage="AuthorityManage/AuthorityManage";
......
package com.hp.cmsz.web.analysissupport;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import com.hp.cmsz.web.PageURLController;
/**
* 质量规则维护的修改过滤规则控制类
*
* @author Liu Na
*
*/
@Controller
@RequestMapping(value="AnalysisSupport/FilterRuleConfiguration")
public class FilterRuleConfigurationController {
@RequestMapping()
public String updateFilterRuleForm() {
return PageURLController.FilterConfiguration;
}
}
package com.hp.cmsz.web.analysissupport;
import java.util.Map;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import com.hp.cmsz.web.PageURLController;
/**
* 质量规则维护的新增过滤规则控制类
*
* @author Liu Na
*
*/
@Controller
@RequestMapping(value="AnalysisSupport/FilterRuleMaintain")
public class FilterRuleMaintainController {
@RequestMapping(value = "")
public String filterMaintainHome(Map model){
return PageURLController.FilterMaintain;
}
}
package com.hp.cmsz.web.analysissupport;
import java.util.Map;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import com.hp.cmsz.web.PageURLController;
/**
* 数据质量核查中的过滤规则查询结果控制类
*
* @author Liu Na
*
*/
@Controller
@RequestMapping(value="AnalysisSupport/FilterRuleResult")
public class FilterRuleResultController {
@RequestMapping(value = "")
public String ruleResultHome(
@RequestParam(value = "rulePageNum", defaultValue="1") String rulePageNum,
Map model){
return PageURLController.FilterResult;
}
}
package com.hp.cmsz.web.analysissupport;
import java.text.ParseException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import com.hp.cmsz.web.PageURLController;
/**
* 质量规则维护的修改规则控制类
*
* @author Liu Na
*
*/
@Controller
@RequestMapping(value="AnalysisSupport/QualityRuleConfiguration")
public class QualityRuleConfigurationController {
@RequestMapping()
public String updateQualityRuleForm() {
return PageURLController.RuleConfiguration;
}
}
package com.hp.cmsz.web.analysissupport;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
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 com.hp.cmsz.entity.Channel;
import com.hp.cmsz.entity.DataModel;
import com.hp.cmsz.entity.DataSource;
import com.hp.cmsz.entity.DataType;
import com.hp.cmsz.entity.Kpi;
import com.hp.cmsz.entity.ModelParameter;
import com.hp.cmsz.entity.Province;
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.BusinessService;
import com.hp.cmsz.service.CmszOperationLogService;
import com.hp.cmsz.service.analysissupport.QualityRuleService;
import com.hp.cmsz.web.PageURLController;
/**
* 质量规则维护的新增规则控制类
*
* @author Liu Na
*
*/
@Controller
@RequestMapping(value="AnalysisSupport/QualityRuleMaintain")
public class QualityRuleMaintainController {
@Autowired
private ProvinceDao provinceDao;
@Autowired
private ChannelDao channelDao;
@Autowired
private BusinessService businessService;
@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 CmszOperationLogService cmszOperationLogService;
@RequestMapping(value = "")
public String ruleMaintainHome(Map model){
//查询出所有的省份
List<Province> provinceList=(List<Province>)provinceDao.findProvince();
//查询出所有的渠道信息
List<Channel> channelList=(List<Channel>)channelDao.findChannel();
//查询出所有的指标
List<Kpi> kpiList=(List<Kpi>)kpiDao.findAll();
//查询出所有的业务
List<String> businessList=businessService.getAllBusinessIdAndBusinessName();
//查询出所有的数据类型
List<DataType> dataTypeList= (List<DataType>)dataTypeDao.findAll();
//查询出所有的数据来源
List<DataSource> dataSourceList=(List<DataSource>)dataSourceDao.findAll();
model.put("provinceList", provinceList);
model.put("channelList", channelList);
model.put("kpiList", kpiList);
model.put("businessList", businessList);
model.put("dataTypeList", dataTypeList);
model.put("dataSourceList", dataSourceList);
return PageURLController.RuleMaintain;
}
// private List<Long> qualityRuleIdList = new ArrayList<Long>();
// //新增准确性规则
// @RequestMapping(value = "/createAccuracyRule*", method = RequestMethod.GET)
// @ResponseBody
// public void createAccuracyRule(
// @RequestParam(value="paramName") String paramName,
// @RequestParam(value="paramValue") String paramValue,
// @RequestParam(value="paramType") String paramType,
// @RequestParam(value="paramName") String paramName,
// @RequestParam(value="paramValue") String paramValue,
// @RequestParam(value="paramType") String paramType,
// @RequestParam(value="paramName") String paramName,
// @RequestParam(value="paramValue") String paramValue,
// @RequestParam(value="paramType") String paramType,
// 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);}
//
// modelParameterDao.save(modelParameter);
//
// Long dataModelId = modelParameter.getParameterId();
// dataModelIdList.add(dataModelId);
// }
// //新增质量模型
// @RequestMapping(value = "/saveModelDataForm", method = RequestMethod.POST)
// public String saveModelDataForm(HttpServletResponse response,HttpServletRequest request) throws ParseException{
// String dataModelName = "";
// String modelDesc = "";
// String ruleDefinition = "";
// String evaluationMethod = "";
// String evaluationStandard = "";
// String modelType = "";
// String deployedServer = "";
// String modelStatus = "";
// //String cycleMinutes = "";
// String modelExeScriptName = "";
// String kpiTypeId = "";
// String businessEndTime = "";
// String businessStartTime = "";
// Date publishTime = new Date();
// Date updateTime = new Date();
// DataModel dataModel = new DataModel();
// SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// SimpleDateFormat batchFormat = new SimpleDateFormat("yyyyMMdd000001");
// dataModel.setBatchNo(Long.parseLong(batchFormat.format(sd.parse(businessStartTime))));
// dataModel.setDataModelName(dataModelName);
// if(!modelDesc.trim().equals("")){dataModel.setModelDesc(modelDesc);}
// if(!ruleDefinition.trim().equals("")){dataModel.setRuleDefinition(ruleDefinition);}
// if(!evaluationMethod.trim().equals("")){dataModel.setEvaluationMethod(evaluationMethod);}
// if(!evaluationStandard.trim().equals("")){dataModel.setEvaluationStandard(evaluationStandard);}
// if(!modelType.trim().equals("")){dataModel.setDataModelTypeId(Long.parseLong(modelType));}
// if(!deployedServer.trim().equals("")){dataModel.setServerId(Long.parseLong(deployedServer));}
// if(!modelStatus.trim().equals("")){dataModel.setModelStatus(Long.parseLong(modelStatus));}
// if(!kpiTypeId.trim().equals("")){dataModel.setKpiTypeId(Long.parseLong(kpiTypeId));}
// /*if(!cycleMinutes.trim().equals("")){dataModel.setCycleMinutes(Long.parseLong(cycleMinutes));}*/
// dataModel.setModelPublishTime(publishTime);
// dataModel.setModelUpdateTime(updateTime);
// dataModel.setBusinessStartTime(sd.parse(businessStartTime));
// dataModel.setBusinessEndTime(sd.parse(businessEndTime));
// qualityRuleDao.save(qualityRule);
// cmszOperationLogService.createLog("增加","新建质量模型","quality_rule_warehouse_info_t. QUALITY_RULE_ID="+ qualityRule.getQualityRuleId().toString());
// Long dataModelId = dataModel.getDataModelId();
// return "redirect:AnalysisSupport/QualityRuleResult";
// }
}
package com.hp.cmsz.web.analysissupport;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
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 com.google.gson.Gson;
import com.hp.cmsz.entity.AccuracyRule;
import com.hp.cmsz.entity.Channel;
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.ChannelDao;
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.CmszOperationLogService;
import com.hp.cmsz.service.analysissupport.AccuracyRuleService;
import com.hp.cmsz.service.analysissupport.QualityRuleService;
import com.hp.cmsz.web.PageURLController;
/**
* 数据质量核查中的质量规则查询结果控制类
*
* @author Liu Na
*
*/
@Controller
@RequestMapping(value="AnalysisSupport/QualityRuleResult")
public class QualityRuleResultController {
// @Autowired
// private ProvinceDao provinceDao;
//
// @Autowired
// private ChannelDao channelDao;
//
// @Autowired
// private BusinessService businessService;
//
// @Autowired
// private KpiDao kpiDao;
//
// @Autowired
// private QualityRuleDao qualityRuleDao;
//
// @Autowired
// private QualityRuleService qualityRuleService;
//
// @Autowired
// private AccuracyRuleService accuracyRuleService;
//
// @Autowired
// private AccuracyRuleDao accuracyRuleDao;
//
// @Autowired
// private CmszOperationLogService cmszOperationLogService;
//
// private String staticProvinceId = "";
// private String staticChannelId = "";
// private String staticKpiId = "";
// private String staticBusinessId = "";
// List<QualityRule> staticQualityRuleList = new ArrayList<QualityRule>();
@RequestMapping(value = "")
public String ruleResultHome(
@RequestParam(value = "rulePageNum", defaultValue="1") String rulePageNum,
Map model){
// //查询出所有的省份
// List<Province> provinceList=(List<Province>)provinceDao.findProvince();
// //查询出所有的渠道信息
// List<Channel> channelList=(List<Channel>)channelDao.findChannel();
// //查询出所有的指标
// List<Kpi> kpiList=(List<Kpi>)kpiDao.findAll();
// //查询出所有的业务
// List<String> businessList=businessService.getAllBusinessIdAndBusinessName();
// //查询出所有的质量规则
// List<QualityRule> qualityRuleList=(List<QualityRule>)qualityRuleDao.findAll();
//
// Gson gson = new Gson();
// model.put("provinceList", gson.toJson(provinceList));
// model.put("channelList", gson.toJson(channelList));
// model.put("kpiList", gson.toJson(kpiList));
// model.put("businessList", gson.toJson(businessList));
// model.put("qualityRuleList", gson.toJson(qualityRuleList));
// model.put("rulePageNum", rulePageNum);
// cmszOperationLogService.createLog("查询","质量规则","质量规则首页");
return PageURLController.RuleResult;
}
// //根据筛选项更新表格
// @RequestMapping(value = "/ruleTableChange*",method = RequestMethod.GET)
// @ResponseBody
// public void modelTableChange(
// @RequestParam(value = "provinceId", defaultValue="") String provinceId,
// @RequestParam(value = "channelId", defaultValue="") String channelId,
// @RequestParam(value = "kpiId", defaultValue="") String kpiId,
// @RequestParam(value = "businessId", defaultValue="") String businessId,
// HttpServletResponse response) throws UnsupportedEncodingException{
// staticProvinceId = provinceId;
// staticChannelId = channelId;
// staticKpiId = kpiId;
// staticBusinessId = businessId;
// List<QualityRule> qualityRuleList = new ArrayList<QualityRule>();
//
// List<Long> provinceIdList = new ArrayList<Long>();
// for(int i=0;i<provinceId.split(",").length;i++){
// provinceIdList.add(Long.parseLong(provinceId.split(",")[i]));
// }
// List<Long> channelIdList = new ArrayList<Long>();
// for(int i=0;i<channelId.split(",").length;i++){
// channelIdList.add(Long.parseLong(channelId.split(",")[i]));
// }
// List<Long> kpiIdList = new ArrayList<Long>();
// for(int i=0;i<kpiId.split(",").length;i++){
// kpiIdList.add(Long.parseLong(kpiId.split(",")[i]));
// }
// List<Long> businessIdList = new ArrayList<Long>();
// for(int i=0;i<businessId.split(",").length;i++){
// businessIdList.add(Long.parseLong(businessId.split(",")[i]));
// }
//
// if(provinceId.equals("") && channelId.equals("") && businessId.equals("") && kpiId.equals("")){
// qualityRuleList = qualityRuleDao.findAll();
// } else {
// qualityRuleList = qualityRuleDao.findByProvinceIdInAndBusinessIdInAndKpiIdInAndChannelIdInOrderByQualityRuleIdDesc(provinceIdList, businessIdList, kpiIdList, channelIdList);
// }
//
// cmszOperationLogService.createLog("查询","质量规则","由筛选项得到质量规则");
// staticQualityRuleList = qualityRuleList;
//
// Gson gson = new Gson();
// response.setContentType("text/Xml;charset=gbk");
// PrintWriter out = null;
// try {
// out = response.getWriter();
// out.println(gson.toJson(qualityRuleList));
// } catch (IOException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
//
// }
//
// //删掉质量规则
// @RequestMapping(value = "/deleteOneRule*",method = RequestMethod.GET)
// @ResponseBody
// public void deleteRule(
// @RequestParam(value = "qualityRuleId") String qualityRuleId,
// HttpServletResponse response){
// List<Long> qualityRuleIdList = new ArrayList<Long>();
// String[] qualityRuleIdStr = qualityRuleId.split(",");
// for(int i=0; i<qualityRuleIdStr.length; i++){
// qualityRuleIdList.add(Long.parseLong(qualityRuleIdStr[i]));
// }
//
// qualityRuleService.deleteByQualityRuleId(qualityRuleIdList);
// accuracyRuleService.deleteAccuracyRuleByQualityRuleId(qualityRuleIdList);
// cmszOperationLogService.createLog("删除","更新质量规则","quality_rule_warehouse_info_t. QUALITY_RULE_ID="+qualityRuleId);
// //刷新模型表格
// List<QualityRule> qualityRuleList = new ArrayList<QualityRule>();
// qualityRuleList = qualityRuleDao.findAll();
// staticQualityRuleList = qualityRuleList;
//
// Gson gson = new Gson();
// response.setContentType("text/Xml;charset=gbk");
// PrintWriter out = null;
//
// try {
// out = response.getWriter();
// out.println(gson.toJson(qualityRuleList));
// } catch (IOException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
// }
//
// //查看准确性规则内容
// @RequestMapping(value = "/findAccuracy*",method = RequestMethod.GET)
// @ResponseBody
// public void findAccuracy(
// @RequestParam(value = "qualityRuleId") String qualityRuleId,
// HttpServletResponse response){
// List<AccuracyRule> accuracyRuleList = accuracyRuleDao.findByQualityRuleId(Long.parseLong(qualityRuleId));
// cmszOperationLogService.createLog("查询","准确性规则","查询准确性规则");
// Gson gson = new Gson();
// response.setContentType("text/Xml;charset=gbk");
// PrintWriter out = null;
//
// try {
// out = response.getWriter();
// out.println(gson.toJson(accuracyRuleList));
// } catch (IOException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
// }
}
......@@ -169,7 +169,7 @@
</li>
</shiro:hasPermission>
<shiro:hasPermission name="运营支撑:配置项分析 or 运营支撑:集成商分析 or 运营支撑:竞品分析 or 运营支撑:业务热点分析 or 运营支撑:投诉文本分析 ">
<shiro:hasPermission name="运营支撑:配置项分析 or 运营支撑:集成商分析 or 运营支撑:竞品分析 or 运营支撑:业务热点分析 or 运营支撑:投诉文本分析 or 运营支撑:数据质量核查 ">
<li class="titleLine"></li>
<li class="dropdown">
<a class="dropdonw-toggle" data-toggle="dropdown" role="button" href="#"><span class="menu-icon"><img alt="" src="${ctx}/static/images/4.png" /></span>运营支撑</a>
......@@ -221,6 +221,16 @@
</ul>
</li>
</shiro:hasPermission>
<shiro:hasPermission name="运营支撑:数据质量核查">
<li class="dropdown-submenu">
<a href="#">数据质量核查</a>
<ul class="dropdown-menu">
<li><a href="${ctx}/AnalysisSupport/QualityRuleResult">质量规则维护</a></li>
<li><a href="${ctx}/AnalysisSupport/FilterRuleResult">过滤规则维护</a></li>
<li><a href="${ctx}/AnalysisSupport/">质量规则运营</a></li>
</ul>
</li>
</shiro:hasPermission>
</ul>
</li>
</shiro:hasPermission>
......@@ -246,7 +256,8 @@
</shiro:hasPermission>
</ul>
</li>
</shiro:hasPermission>
</shiro:hasPermission>
<shiro:hasPermission name="基础管理:配置管理 or 基础管理:系统自监控 or 基础管理:系统数据备份和恢复 or 基础管理:元数据管理 or 基础管理:告警规则管理 or 基础管理:任务管理 ">
<li class="titleLine"></li>
......
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
</body>
</html>
\ No newline at end of file
<%@ page language="java" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags"%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>质量规则维护</title>
<style>
.table-null .table{
margin-bottom: 0px;
}
.table-null .table > tbody > tr > td, .table-null .table > thead > tr > th{
text-align: center;
width: 25%;
}
.table-null td:first-child{
text-align: right;
width: 36%;
}
.table-null tr td:last-child .form-control,.table-null tr td:last-child table{
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>
</head>
<body>
<div class="container">
<ol class="breadcrumb">
<li><a href="${ctx}/index">首页</a></li>
<li>数据质量核查</li>
<li class="active">过滤规则维护</li>
</ol>
</div>
<div id="main-container main-tab-container">
<div id="content" class="container">
<div class="section">
<div class="tab-content">
<div class="tab-pane fade in active" id="home">
<div class="row">
<div class="col-xs-12">
<div class="table-header">过滤规则上传</div>
<form action="#" class="form-horizontal" id="filterMaintainForm" method="post" enctype="multipart/form-data">
<table id="filterMaintainTable" class="table-null">
<tr><td>省份(<font color="red">必填</font>):</td>
<td><tags:ProvinceTag /></td>
</tr>
<tr><td>渠道(<font color="red">必填</font>):</td>
<td><tags:ChannelTag /></td>
</tr>
<tr><td>业务(<font color="red">必填</font>):</td>
<td><tags:BusinessTag /></td>
</tr>
<tr><td>数据来源(<font color="red">必填</font>):</td>
<td><tags:DataSourceTag /></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 type="text" class="form-control" id="filterStartTime" name="filterStartTime" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'filterStartTime\')}'})" /></td></tr>
<tr><td>生效结束时间(<font color="red">必填</font>):</td><td><input id="filterEndTime" name="filterEndTime" class="form-control" type="text" onFocus="WdatePicker({maxDate:'#F{$dp.$D(\'filterEndTime\')}'})"> </td></tr>
<tr><td>是否重复(<font color="red">必填</font>):</td><td><input type="radio" class="ifRepeate" name="ifRepeate" value="1" />
<input type="radio" class="ifRepeate" name="ifRepeate" value="0" /></td></tr>
<tr class="period"><td>过滤周期(<font color="red">必填</font>):</td><td><input type="text" class="form-control" name="scopeMaxValue" id="scopeMaxValue" /></td></tr>
<tr><td>过滤原因(<font color="red">必填</font>):</td><td><input type='text' name='filterReason' id='filterReason' class="form-control" style="display: inline;"/></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>
</td></tr>
</table>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(".period").hide();
$(".ifRepeate").change(function (){
var selectValue = $("input:radio[name='ifRepeate']:checked").val();
console.log(selectValue);
if (selectValue == 0){
$(".period").hide();
}
if (selectValue == 1){
$(".period").show();
}
})
</script>
\ No newline at end of file
<%@ 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>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>过滤规则维护</title>
</head>
<body>
<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}/">质量规则运营</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:ProvinceTag />
<tags:ChannelTag />
<tags:BusinessTag />
<button id="submit" class="btn btn-primary" onclick="modelResultSubmit()">提交</button>
<button id="disable" class="btn btn-warning" onclick="modelResultReset()">重置</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">
</div>
</div>
<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;">
<button class="btn-sm btn btn-primary btn-sm btn-group btn-group-cog" id="deleteFilter" disabled>删除规则</button>
<button class="btn-sm btn btn-primary btn-sm btn-group btn-group-cog" id="updateFilter" disabled>修改规则</button>
<button class="btn-sm btn btn-primary btn-sm btn-group btn-group-cog" id="createFilter">新建规则</button>
</div>
</shiro:hasAnyRoles>
</div>
<table id="filterResultTable" class="table table-hover table-striped">
</table>
<input type="hidden" id="filterRuleView" name="filterRuleView" value='${filterRuleViewList}' />
</div>
</div>
</div>
</div>
</div>
<form action="#" method="get" id="listForm"></form>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="${ctx}/static/js/filterResultDetailTable.js"></script>
<script type="text/javascript">
filterResultDetailTable();
$("#createFilter").click(function(){
$.dialog({
title: "提醒",
content:"确定新建过滤规则?",
ok: function(){location.href="${ctx}/AnalysisSupport/FilterRuleMaintain";},
okValue:"确定",
cancel: function(){},
cancelValue:"取消",
lock:true
});
});
$("#updateFilter").click(function(){
var pageNum = $("#goPageNo").val();
$.dialog({
title: "提醒",
content:"确定修改过滤规则?",
ok: function(){location.href="${ctx}/AnalysisSupport/FilterConfiguration?qualityRuleId="+qualityRuleId;},
okValue:"确定",
cancel: function(){},
cancelValue:"取消",
lock:true
});
});
$("#deleteFilter").click(function(){
var pageNum = $("#goPageNo").val();
$.dialog({
title: "提醒",
content:"确定删除过滤规则?",
ok: function(){location.href="${ctx}/AnalysisSupport/FilterDelete?qualityRuleId="+qualityRuleId;},
okValue:"确定",
cancel: function(){},
cancelValue:"取消",
lock:true
});
});
</script>
</body>
</html>
\ No newline at end of file
<%@ page language="java" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags"%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>质量规则维护</title>
<style>
.table-null .table{
margin-bottom: 0px;
}
.table-null .table > tbody > tr > td, .table-null .table > thead > tr > th{
text-align: center;
width: 25%;
}
.table-null td:first-child{
text-align: right;
width: 36%;
}
.table-null tr td:last-child .form-control,.table-null tr td:last-child table{
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>
</head>
<body>
<div class="container">
<ol class="breadcrumb">
<li><a href="${ctx}/index">首页</a></li>
<li>数据质量核查</li>
<li class="active">质量规则维护</li>
</ol>
</div>
<div id="main-container main-tab-container">
<div id="content" class="container">
<div class="section">
<div class="tab-content">
<div class="tab-pane fade in active" id="home">
<div class="row">
<div class="col-xs-12">
<div class="table-header">质量规则更新</div>
<form action="#" class="form-horizontal" id="ruleMaintainForm" method="post" enctype="multipart/form-data">
<table id="ruleMaintainTable" class="table-null">
<tr><td>省份(<font color="red">必填</font>):</td>
<td><tags:ProvinceTag /></td>
</tr>
<tr><td>渠道(<font color="red">必填</font>):</td>
<td><tags:ChannelTag /></td>
</tr>
<tr><td>业务(<font color="red">必填</font>):</td>
<td><tags:BusinessTag /></td>
</tr>
<tr><td>数据来源(<font color="red">必填</font>):</td>
<td><tags:DataSourceTag /></td>
</tr>
<tr><td>数据采集频率(<font color="red">必填</font>):</td>
<td><select class="form-control" name="" id="" style="display: inline;">
<option value="0">30分钟</option>
<option value="1">1小时</option>
<option value="2">1天</option>
<option value="3">1月</option>
</select></td></tr>
<tr><td>指标检测时间(<font color="red">必填</font>):</td>
<td>
<div>
<input type="text" class="form-control" name="kpiMonitorTime" id="kpiMonitorTime" style="display: inline;" />
<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><td>指标检测范围(<font color="red">必填</font>):</td>
<td>
<div>
<input type="text" class="form-control" name="kpiMonitorRange" id="kpiMonitorRange" style="display: inline;" />
<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><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 id="ruleUpdateTime" name="ruleUpdateTime" class="form-control" type="text" onFocus="WdatePicker({maxDate:'#F{$dp.$D(\'ruleUpdateTime\')}'})"> </td></tr>
<tr><td>准确性规则:</td>
<td><select class="form-control" name="accuracyRule" id="accuracyRule" >
<option value="0"></option>
<option value="1">范围类</option>
<option value="2">重复类</option>
</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="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" class="form-control" id="repeatedCheckStartTime" name="repeatedCheckStartTime" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'repeatedCheckStartTime\')}'})" /></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='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><td></td><td><button type="button" id="ruleSubmit" class="btn btn-primary">确定</button>
<button type="reset" class="btn btn-default" id="ruleReset">清空</button>
<button type="reset" class="btn btn-warning" id="ruleBack">返回</button>
</td></tr>
</table>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(".range").hide();
$(".repeate").hide();
$("#accuracyRule").change(function (){
var selectValue = $("#accuracyRule").val();
console.log(selectValue);
if (selectValue == 0){
$(".range").hide();
$(".repeate").hide();
}
if (selectValue == 1){
$(".repeate").hide();
$(".range").show();
}
if (selectValue == 2){
$(".range").hide();
$(".repeate").show();
}
})
</script>
</body>
</html>
\ No newline at end of file
<%@ page language="java" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags"%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>质量规则维护</title>
<style>
.table-null .table{
margin-bottom: 0px;
}
.table-null .table > tbody > tr > td, .table-null .table > thead > tr > th{
text-align: center;
width: 25%;
}
.table-null td:first-child{
text-align: right;
width: 36%;
}
.table-null tr td:last-child .form-control,.table-null tr td:last-child table{
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>
</head>
<body>
<div class="container">
<ol class="breadcrumb">
<li><a href="${ctx}/index">首页</a></li>
<li>数据质量核查</li>
<li class="active">质量规则维护</li>
</ol>
</div>
<div id="main-container main-tab-container">
<div id="content" class="container">
<div class="section">
<div class="tab-content">
<div class="tab-pane fade in active" id="home">
<div class="row">
<div class="col-xs-12">
<div class="table-header">质量规则上传</div>
<form action="#" class="form-horizontal" id="ruleMaintainForm" method="post" enctype="multipart/form-data">
<table id="ruleMaintainTable" class="table-null">
<tr><td>省份(<font color="red">必填</font>):</td>
<td><tags:ProvinceTag /></td>
</tr>
<tr><td>渠道(<font color="red">必填</font>):</td>
<td><tags:ChannelTag /></td>
</tr>
<tr><td>业务(<font color="red">必填</font>):</td>
<td><tags:BusinessTag /></td>
</tr>
<tr><td>数据来源(<font color="red">必填</font>):</td>
<td><tags:DataSourceTag /></td>
</tr>
<tr><td>数据采集频率(<font color="red">必填</font>):</td>
<td><select class="form-control" name="" id="" style="display: inline;">
<option value="0">30分钟</option>
<option value="1">1小时</option>
<option value="2">1天</option>
<option value="3">1月</option>
</select></td></tr>
<tr><td>指标检测时间(<font color="red">必填</font>):</td>
<td>
<div>
<input type="text" class="form-control" name="kpiMonitorTime" id="kpiMonitorTime" style="display: inline;" />
<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><td>指标检测范围(<font color="red">必填</font>):</td>
<td>
<div>
<input type="text" class="form-control" name="kpiMonitorRange" id="kpiMonitorRange" style="display: inline;" />
<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><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 id="ruleUpdateTime" name="ruleUpdateTime" class="form-control" type="text" onFocus="WdatePicker({maxDate:'#F{$dp.$D(\'ruleUpdateTime\')}'})"> </td></tr>
<tr><td>准确性规则:</td>
<td><select class="form-control" name="accuracyRule" id="accuracyRule" >
<option value="0"></option>
<option value="1">范围类</option>
<option value="2">重复类</option>
</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="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" class="form-control" id="repeatedCheckStartTime" name="repeatedCheckStartTime" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'repeatedCheckStartTime\')}'})" /></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='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><td></td><td><button type="button" id="ruleSubmit" class="btn btn-primary">确定</button>
<button type="reset" class="btn btn-warning" id="ruleBack">返回</button>
</td></tr>
</table>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(".range").hide();
$(".repeate").hide();
$("#accuracyRule").change(function (){
var selectValue = $("#accuracyRule").val();
console.log(selectValue);
if (selectValue == 0){
$(".range").hide();
$(".repeate").hide();
}
if (selectValue == 1){
$(".repeate").hide();
$(".range").show();
}
if (selectValue == 2){
$(".range").hide();
$(".repeate").show();
}
})
//form表单重置
$("#modelReset").click(function(){
deleteAllTr();
});
//form表单提交
$("#modelSubmit").click(function(){
if($.trim($("#dataModelName").val())==""){
$.alert("数据模型名称不能为空");
}else if($("#modelExeScriptName").val()==""){
$.alert("模型执行脚本不能为空");
}else if($("#businessStartTime").val()==""){
$.alert("业务开始时间不能为空");
}else if($("#businessEndTime").val()==""){
$.alert("业务结束时间不能为空");
}else{
if($.trim($("#paramName").val())!=""){
$.dialog({
title: "提醒",
content: "有参数尚未添加,确定提交",
ok: function(){
$("#modelSubmit").attr("disabled",true);
var i = $("#addTr").find("tr").size();
if(i==0){
var createForm=$("#modelMaintainForm");
createForm.attr("action","${ctx}/ModelManage/ModelMaintain/saveModelDataForm");
createForm.submit();
createForm.attr("action","#");
}else{
$("#addTr").find("tr").each(function(){
//alert($(this).find("td").eq(0).html());
var paramName = $(this).find("td").eq(0).html();
var paramValue = $(this).find("td").eq(1).html();
var paramType = $(this).find("td").eq(2).html();
$.ajax({
type : "GET",
contentType : "application/json",
url: "${ctx}/ModelManage/ModelMaintain/createModelParam?paramName="+encodeURIComponent(paramName)+"&paramValue="+encodeURIComponent(paramValue)+"&paramType="+encodeURIComponent(paramType),
dataType : "text",
async: false,
beforeSend: function(data) {},
success: function(){
i--;
if(i==0){
var createForm=$("#modelMaintainForm");
createForm.attr("action","${ctx}/ModelManage/ModelMaintain/saveModelDataForm");
createForm.submit();
createForm.attr("action","#");
}
}
});
});
}
},
okValue: "确定",
cancel: function(){},
cancelValue: "取消",
});
}else{
$("#modelSubmit").attr("disabled",true);
var i = $("#addTr").find("tr").size();
if(i==0){
var createForm=$("#modelMaintainForm");
createForm.attr("action","${ctx}/ModelManage/ModelMaintain/saveModelDataForm");
createForm.submit();
createForm.attr("action","#");
}else{
$("#addTr").find("tr").each(function(){
//alert($(this).find("td").eq(0).html());
var paramName = $(this).find("td").eq(0).html();
var paramValue = $(this).find("td").eq(1).html();
var paramType = $(this).find("td").eq(2).html();
$.ajax({
type : "GET",
contentType : "application/json",
url: "${ctx}/ModelManage/ModelMaintain/createModelParam?paramName="+encodeURIComponent(paramName)+"&paramValue="+encodeURIComponent(paramValue)+"&paramType="+encodeURIComponent(paramType),
dataType : "text",
async: false,
beforeSend: function(data) {},
success: function(){
i--;
if(i==0){
var createForm=$("#modelMaintainForm");
createForm.attr("action","${ctx}/ModelManage/ModelMaintain/saveModelDataForm");
createForm.submit();
createForm.attr("action","#");
}
}
});
});
}
}
}
});
$("#modelBack").click(function(){
location.href="${ctx}/ModelManage/ModelResult";
});
</script>
</body>
</html>
\ No newline at end of file
<%@ 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>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>质量规则维护</title>
</head>
<body>
<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 class="active"><a href="#home" data-toggle="tab">质量规则维护</a></li>
<li><a href="${ctx}/AnalysisSupport/FilterRuleResult">过滤规则维护</a></li>
<li><a href="${ctx}/">质量规则运营</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:ProvinceTag />
<tags:ChannelTag />
<tags:BusinessTag />
<button id="submit" class="btn btn-primary" onclick="modelResultSubmit()">提交</button>
<button id="disable" class="btn btn-warning" onclick="modelResultReset()">重置</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">
</div>
</div>
<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;">
<button class="btn-sm btn btn-primary btn-sm btn-group btn-group-cog" id="deleteRule" disabled>删除规则</button>
<button class="btn-sm btn btn-primary btn-sm btn-group btn-group-cog" id="updateRule" disabled>修改规则</button>
<button class="btn-sm btn btn-primary btn-sm btn-group btn-group-cog" id="createRule">新建规则</button>
</div>
</shiro:hasAnyRoles>
</div>
<table id="ruleResultTable" class="table table-hover table-striped">
</table>
<input type="hidden" id="qualityRuleView" name="qualityRuleView" value='${qualityRuleViewList}' />
</div>
</div>
</div>
</div>
</div>
<form action="#" method="get" id="listForm"></form>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="${ctx}/static/js/ruleResultDetailTable.js"></script>
<script type="text/javascript">
ruleResultDetailTable();
$("#createRule").click(function(){
$.dialog({
title: "提醒",
content:"确定新建质量规则?",
ok: function(){location.href="${ctx}/AnalysisSupport/QualityRuleMaintain";},
okValue:"确定",
cancel: function(){},
cancelValue:"取消",
lock:true
});
});
$("#updateRule").click(function(){
var pageNum = $("#goPageNo").val();
$.dialog({
title: "提醒",
content:"确定修改质量规则?",
ok: function(){location.href="${ctx}/AnalysisSupport/RuleConfiguration?qualityRuleId="+qualityRuleId;},
okValue:"确定",
cancel: function(){},
cancelValue:"取消",
lock:true
});
});
$("#deleteRule").click(function(){
var pageNum = $("#goPageNo").val();
$.dialog({
title: "提醒",
content:"确定删除质量规则?",
ok: function(){location.href="${ctx}/AnalysisSupport/RuleDelete?qualityRuleId="+qualityRuleId;},
okValue:"确定",
cancel: function(){},
cancelValue:"取消",
lock:true
});
});
</script>
</body>
</html>
\ No newline at end of file
//格式化日期
function Format(){
this.jsjava_class="jsjava.text.Format";
}
function DateFormat(){
this.jsjava_class="jsjava.text.DateFormat";
}
DateFormat.prototype=new Format();
DateFormat.prototype.constructor=DateFormat;
DateFormat.zh_cn_month2=["01","02","03","04","05","06","07","08","09","10","11","12"];
DateFormat.zh_cn_month3=["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708",];
DateFormat.zh_cn_month4=["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708",];
DateFormat.en_us_month4=["Janu","Febr","Marc","Apri","May","Juhn","July","Augu","Sept","Octo","Nove","Dece"];
DateFormat.en_us_month3=["Jan","Feb","Mar","Apr","May","Juh","Jul","Aug","Sep","Oct","Nov","Dec"];
DateFormat.en_us_month2=["01","02","03","04","05","06","07","08","09","10","11","12"];
DateFormat.zh_cn_week=["\u661f\u671f\u65e5","\u661f\u671f\u4e00","\u661f\u671f\u4e8c","\u661f\u671f\u4e09","\u661f\u671f\u56db","\u661f\u671f\u4e94","\u661f\u671f\u516d"];
DateFormat.zh_cn_am="\u4e0b\u5348";
DateFormat.zh_cn_pm="\u4e0a\u5348";
DateFormat.language=(navigator.userLanguage==undefined?navigator.language:navigator.userLanguage).replace("-","_").toLowerCase();
DateFormat.prototype.format=function(date){
var year4=date.getFullYear();
var year2=year4.toString().substring(2);
var pattern=this.pattern;
pattern=pattern.replace(/yyyy/,year4);
pattern=pattern.replace(/yy/,year2);
var month=date.getMonth();
pattern=pattern.replace(/MMMM/,eval("DateFormat."+DateFormat.language+"_month4[month]"));
pattern=pattern.replace(/MMM/,eval("DateFormat."+DateFormat.language+"_month3[month]"));
pattern=pattern.replace(/MM/,eval("DateFormat."+DateFormat.language+"_month2[month]"));
var dayOfMonth=date.getDate();
var dayOfMonth2=dayOfMonth;
var dayOfMonthLength=dayOfMonth.toString().length;
if(dayOfMonthLength==1){
dayOfMonth2="0"+dayOfMonth;
}
pattern=pattern.replace(/dd/,dayOfMonth2);
pattern=pattern.replace(/d/,dayOfMonth);
var hours=date.getHours();
var hours2=hours;
var hoursLength=hours.toString().length;
if(hoursLength==1){
hours2="0"+hours;
}
pattern=pattern.replace(/HH/,hours2);
pattern=pattern.replace(/H/,hours);
var minutes=date.getMinutes();
var minutes2=minutes;
var minutesLength=minutes.toString().length;
if(minutesLength==1){
minutes2="0"+minutes;
}
pattern=pattern.replace(/mm/,minutes2);
pattern=pattern.replace(/m/,minutes);
var seconds=date.getSeconds();
var seconds2=seconds;
var secondsLength=seconds.toString().length;
if(secondsLength==1){
seconds2="0"+seconds;
}
pattern=pattern.replace(/ss/,seconds2);
pattern=pattern.replace(/s/,seconds);
var milliSeconds=date.getMilliseconds();
pattern=pattern.replace(/S+/,milliSeconds);
var day=date.getDay();
// pattern=pattern.replace(/E+/,eval("DateFormat."+DateFormat.language+"_week[day]"));
if(hours>12){
pattern=pattern.replace(/a+/,eval("DateFormat."+DateFormat.language+"_am"));
}else{
pattern=pattern.replace(/a+/,eval("DateFormat."+DateFormat.language+"_pm"));
}
var kHours=hours;
if(kHours==0){
kHours=24;
}
var kHours2=kHours;
var kHoursLength=kHours.toString().length;
if(kHoursLength==1){
kHours2="0"+kHours;
}
pattern=pattern.replace(/kk/,kHours2);
pattern=pattern.replace(/k/,kHours);
var KHours=hours;
if(hours>11){
KHours=hours-12;
}
var KHours2=KHours;
var KHoursLength=KHours.toString().length;
if(KHoursLength==1){
KHours2="0"+KHours;
}
pattern=pattern.replace(/KK/,KHours2);
pattern=pattern.replace(/K/,KHours);
var hHours=KHours;
if(hHours==0){
hHours=12;
}
var hHours2=hHours;
var hHoursLength=hHours.toString().length;
if(KHoursLength==1){
hHours2="0"+hHours;
}
pattern=pattern.replace(/hh/,hHours2);
pattern=pattern.replace(/h/,hHours);
return pattern;
};
function SimpleDateFormat(){
this.jsjava_class="jsjava.text.SimpleDateFormat";
}
SimpleDateFormat.prototype=new DateFormat();
SimpleDateFormat.prototype.constructor=SimpleDateFormat;
SimpleDateFormat.prototype.applyPattern=function(pattern){
this.pattern=pattern;
};
var df=new SimpleDateFormat();
df.applyPattern("yyyy-MM-dd HH:mm:ss");
//
var filterRuleId;
function filterResultDetailTable(){
jsonData=document.getElementById('filterRuleView').value;
var header = new Array();
header[0] = ["","<input type='radio' name='update'id='update' onclick='javascript:radioChoose(this);'/>","1%",""];
header[1] = ["过滤规则ID","filterRuleId","7%","15"];
header[2] = ["省份","provinceName","7%","15"];
header[3] = ["渠道","qualityRuleId","7%","15"];
header[4] = ["业务","qualityRuleId","7%","15"];
header[5] = ["数据来源","qualityRuleId","7%","15"];
header[6] = ["影响开始时间","qualityRuleId","7%","15"];
header[7] = ["影响结束时间","qualityRuleId","7%","15"];
header[8] = ["是否重复","qualityRuleId","7%","15"];
header[9] = ["过滤周期","qualityRuleId","7%","15"];
header[10] = ["过滤原因","qualityRuleId","7%","15"];
window.pagging = new table_pagging({limit:12,tableId:'filterResultTable',header:header});
//pagging.pagging(jsonData);
}
var table_pagging = function() {
this.init.apply(this, arguments);
}
table_pagging.prototype = {
init : function(s) {
// 从第几个数据开始获取,缺省状态下从0开始显示
if (s.start) {
this.start = parseInt(s.start);
} else {
this.start = 0;
}
// limit是指从start开始一共要用几条数据,缺省状态下显示10条
if (s.limit) {
this.limit = parseInt(s.limit);
} else {
this.limit = 10;
}
// cellStep表示每行要显示的行数.缺省状态下为1,一行一条记录.
if (s.cellStep) {
this.cellStep = parseInt(s.cellStep);
} else {
this.cellStep = 1;
}
// 要执行的表的名字
if (s.tableId) {
this.tableObj = document.getElementById(s.tableId);
} else {
alert("missing table id~");
}
// 头部的样式编码
if (s.headTrClassName) {
this.headTrClassName = s.headTrClassName;
} else {
this.headTrClassName = "";
}
if (s.trClassName) {
this.trClassName = s.trClassName;
} else {
this.trClassName = "";
}
// 定义头部信息
if (this.checkHeadersIsArray(s.header)) {
this.header = s.header;
} else {
alert("header is wrong~");
}
// 初始化头部
this.createTableHeader();
},
cloumnModel : function() {
},
pagging : function(objectJson) {
this.objectlist = eval('(' + objectJson + ')');
if (this.start + this.limit >= this.objectlist.length) {
this.end = this.objectlist.length;
} else {
this.end = this.start + this.limit;
}
this.clearSearchTable();
this.createTableBodyTd();
},
checkHeadersIsArray : function(header) {
if (!(header instanceof Array)) {
return false;
}
for ( var i = 0; i < header.length; i++) {
if (!(header[i] instanceof Array) || header[i].length < 4) {
return false;
}
}
return true;
},
// 清空表格数据
clearSearchTable : function() {
for ( var i = this.tableObj.rows.length; i > 1; i--) {
this.tableObj.deleteRow(i - 1);
}
},
// 创建头部
createTableHeader : function() {
var tr = this.tableObj.insertRow(this.tableObj.rows.length);
if (this.headTrClassName) {
tr.className = this.headTrClassName;
}
var rowLength = this.header.length;
for ( var i = 0; i < rowLength; i++) {
var td = tr.insertCell(i);
td.innerHTML = this.header[i][0];
if (this.header[i][2]) {
td.width = this.header[i][2];
}
}
},
// 创建table的数据区域
createTableBodyTd : function() {
this.clearSearchTable();
if (this.start > this.objectlist.length) {
return;
}
if (this.start > this.end) {
return;
}
if (this.end > this.objectlist.length) {
this.end = this.objectlist.length;
}
var rowLength = this.header.length;
// alert(rowLength);
for ( var i = this.start; i < this.end; i++) {
var tr = this.tableObj.insertRow(this.tableObj.rows.length);
if (this.trClassName) {
tr.className = this.trClassName;
}
for ( var j = 0; j < this.cellStep; j++) {
for ( var k = 0; k < rowLength; k++) {
var td = tr.insertCell(rowLength * j + k);
var tdContext = "&nbsp;";
var tdTitle = "";
if (this.header[k][1]) {
var reg = /\%\{([\d\w.]+)\}\%/g;
if (k != 0) {
if (result = reg.exec(this.header[k][1])) {
// var result = reg.exec(this.header[k][1]);
var context = this.header[k][1];
while (reg.lastIndex != 0) {
var value = this.getData(
this.objectlist[i], result[1]);
context = context.replace(
/\%\{[\d\w.]+\}\%/, value);
result = reg.exec(this.header[k][1]);
}
tdContext = context;
} else {
tdContext = this.getData(this.objectlist[i],
this.header[k][1]);
if(tdContext==null){
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(tdContext!="&nbsp;"){
tdContext = df.format(new Date(tdContext));
}
}
if(k==10){
if(tdContext!="&nbsp;"){
tdContext = df.format(new Date(tdContext));
}
}
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=\"openDialog('"+this.getData(this.objectlist[i],"dataModelId")+"','"+ this.getData(this.objectlist[i],"dataModelName")"')\">查看参数</a>";
}
if(k==4){
if (this.header[k][4] && !(tdContext == "&nbsp;")) {
td.title = tdTitle;
tdContext = tdContext + "";
if (tdContext.length > parseInt(this.header[k][4])) {
tdContext = tdContext.substring(0,
this.header[k][4])
+ "..";
}
}
}
}
} else {
tdContext=this.header[k][1]+"<span style='display:none'>"+i+"</span>";
// tdContext=this.header[k][1];
}
} else {
tdContext = "&nbsp;";
}
if (tdContext instanceof Object) {
tdContext = this.formateDate(tdContext);
}
if (!tdTitle) {
tdTitle = tdContext;
}
if (this.header[k][3] && !(tdContext == "&nbsp;")) {
td.title = tdTitle;
tdContext = tdContext + "";
if (tdContext.length > parseInt(this.header[k][3])) {
tdContext = tdContext.substring(0,
this.header[k][3])
+ "..";
}
}
console.log(tdContext);
td.innerHTML = tdContext;
// alert(tdContext+"----i:"+i+",j:"+j+",k:"+k);
}
i = i + j;
if (i >= this.start + this.limit) {
break;
}
}
if (i >= this.start + this.limit) {
break;
}
}
this.createPageTr();
},
// 从json获取数据,其中key如果带有.这个符号,说明需要获取的数据是多维数组(也可以看成对象)
getData : function(arrayObj, key) {
if (key.indexOf(".") > 0) {
var keys = key.split(".");
var obj;
for ( var c = 0; c < keys.length; c++) {
if (c == keys.length - 1) {
return obj[keys[c]];
}
if (!arrayObj[keys[c]]) {
return "&nbsp;"
} else {
obj = arrayObj[keys[c]]
}
}
} else {
return arrayObj[key];
}
},
// 格式化Date数据
formateDate : function(dateObj) {
if (dateObj.month) {
return parseInt(dateObj.month) + 1 + "-" + dateObj.date + " "
+ dateObj.hours + ":" + dateObj.minutes + ":"
+ dateObj.seconds;
} else {
return dateObj;
}
},
operator : function(_start, _end) {
this.start = _start;
this.end = _end;
this.createTableBodyTd();
},
// 获取当前对象名
getObjectName : function() {
for ( var a in window) {
if (window[a] == this) {
return a;
}
}
},
// 创建尾部,上一页,下一页,当前页之类信息
createPageTr : function() {
var objectName = this.getObjectName();
var tr = this.tableObj.insertRow(this.tableObj.rows.length);
td = tr.insertCell(0);
td.colSpan = this.header.length + '';
var totalPage = Math.ceil(this.objectlist.length / this.limit);
var currentPage = Math.ceil(this.start / this.limit);
var tableName = objectName + "assrotCurrentIndexTable";
td.innerHTML = "<table id='" + tableName + "' width='100%'></table>";
var tableObj = document.getElementById(tableName);
var tr = tableObj.insertRow(0);
var td1 = tr.insertCell(0);
td1.width = "15%";
td1.align = "center";
if (this.start >= this.limit) {
td1.innerHTML = "<a href='javascript:" + objectName
+ ".operator(0," + this.limit + ")'>首页</a>";
} else {
td1.innerHTML = "<a>首页</a>";
}
var td2 = tr.insertCell(1);
td2.width = "15%";
td2.align = "center";
if (this.start >= this.limit) {
td2.innerHTML = "<a href='javascript:" + objectName + ".operator("
+ (this.start - this.limit) + "," + this.start
+ ")'>上一页</a>";
} else {
td2.innerHTML = "<a>上一页</a>";
}
var td3 = tr.insertCell(2);
td3.width = "25%";
td3.align = "center";
// td3.innerHTML = "Page <input id='table_pagging_page_input_id'
// type='text' size='1' id='currentIndex' value='"+(currentPage+1)+"'
// >of&nbsp;"+totalPage;
td3.innerHTML = "<div class='col-sm-4'><input class=\"form-control\" type=\"text\" id=\"goPageNo\" value=\""
+ (currentPage + 1)
+ "\" size=\"3\" /></div><div class='col-sm-5'><input class=\"form-control\" type=\"button\" id=\"jumpButton\" value=\"跳转\" onclick=\"javascript:"
+ objectName + ".jump2PageNum()\" /></div>";
var td4 = tr.insertCell(3);
td4.width = "15%";
td4.align = "center";
if (this.end >= this.objectlist.length) {
td4.innerHTML = "<a>下一页<a>";
} else {
if ((this.end + this.limit) > this.objectlist.length) {
td4.innerHTML = "<a href='javascript:" + objectName
+ ".operator(" + this.end + ","
+ this.objectlist.length + ")'>下一页<a>";
} else {
td4.innerHTML = "<a href='javascript:" + objectName
+ ".operator(" + this.end + ","
+ (this.end + this.limit) + ")'>下一页<a>";
}
}
var td5 = tr.insertCell(4);
td5.width = "15%";
td5.align = "center";
if (this.end >= this.objectlist.length) {
td5.innerHTML = "<a>末页</a>";
} else {
td5.innerHTML = "<a href='javascript:" + objectName + ".operator("
+ this.limit * (totalPage - 1) + ","
+ this.objectlist.length + ")'>末页</a>";
}
var td6 = tr.insertCell(5);
td6.align = 'right';
td6.width = "25%";
// td6.innerHTML =
// "显示第"+this.start+"到第"+this.end+"记录,共"+this.objectlist.length+"条记录";
td6.innerHTML = "页数:<span style='color:blue'>" + (currentPage + 1)
+ "</span>/" + totalPage;
},
// 点击跳转,未开发
jump2PageNum : function() {
var re = /^[1-9]+[0-9]*]*$/;
if (!re.test(document.getElementById('goPageNo').value)) {
alert("请输入正整数");
} else {
if (parseInt(document.getElementById('goPageNo').value) > Math
.ceil(this.objectlist.length / this.limit)) {
alert("你输入的数值过大!");
} else {
this
.operator(
this.limit
* (parseInt(document
.getElementById('goPageNo').value) - 1),
(this.limit
* (parseInt(document
.getElementById('goPageNo').value) - 1) + this.limit));
}
}
},
test : function() {
alert(this.start);
alert(this.step);
alert(this.cellStep);
alert(this.tablename);
}
}
function radioChoose(clickObj){
var obj = eval("(" + jsonData + ")");
//alert(obj);
if(clickObj.checked){
//alert(clickObj);
//alert(clickObj.nextSibling.innerHTML);
$("#updateModel").attr("disabled", false);
modelId=parseInt(obj[parseInt(clickObj.nextSibling.innerHTML)].dataModelId);
}
}
\ No newline at end of file
//格式化日期
function Format(){
this.jsjava_class="jsjava.text.Format";
}
function DateFormat(){
this.jsjava_class="jsjava.text.DateFormat";
}
DateFormat.prototype=new Format();
DateFormat.prototype.constructor=DateFormat;
DateFormat.zh_cn_month2=["01","02","03","04","05","06","07","08","09","10","11","12"];
DateFormat.zh_cn_month3=["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708",];
DateFormat.zh_cn_month4=["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708",];
DateFormat.en_us_month4=["Janu","Febr","Marc","Apri","May","Juhn","July","Augu","Sept","Octo","Nove","Dece"];
DateFormat.en_us_month3=["Jan","Feb","Mar","Apr","May","Juh","Jul","Aug","Sep","Oct","Nov","Dec"];
DateFormat.en_us_month2=["01","02","03","04","05","06","07","08","09","10","11","12"];
DateFormat.zh_cn_week=["\u661f\u671f\u65e5","\u661f\u671f\u4e00","\u661f\u671f\u4e8c","\u661f\u671f\u4e09","\u661f\u671f\u56db","\u661f\u671f\u4e94","\u661f\u671f\u516d"];
DateFormat.zh_cn_am="\u4e0b\u5348";
DateFormat.zh_cn_pm="\u4e0a\u5348";
DateFormat.language=(navigator.userLanguage==undefined?navigator.language:navigator.userLanguage).replace("-","_").toLowerCase();
DateFormat.prototype.format=function(date){
var year4=date.getFullYear();
var year2=year4.toString().substring(2);
var pattern=this.pattern;
pattern=pattern.replace(/yyyy/,year4);
pattern=pattern.replace(/yy/,year2);
var month=date.getMonth();
pattern=pattern.replace(/MMMM/,eval("DateFormat."+DateFormat.language+"_month4[month]"));
pattern=pattern.replace(/MMM/,eval("DateFormat."+DateFormat.language+"_month3[month]"));
pattern=pattern.replace(/MM/,eval("DateFormat."+DateFormat.language+"_month2[month]"));
var dayOfMonth=date.getDate();
var dayOfMonth2=dayOfMonth;
var dayOfMonthLength=dayOfMonth.toString().length;
if(dayOfMonthLength==1){
dayOfMonth2="0"+dayOfMonth;
}
pattern=pattern.replace(/dd/,dayOfMonth2);
pattern=pattern.replace(/d/,dayOfMonth);
var hours=date.getHours();
var hours2=hours;
var hoursLength=hours.toString().length;
if(hoursLength==1){
hours2="0"+hours;
}
pattern=pattern.replace(/HH/,hours2);
pattern=pattern.replace(/H/,hours);
var minutes=date.getMinutes();
var minutes2=minutes;
var minutesLength=minutes.toString().length;
if(minutesLength==1){
minutes2="0"+minutes;
}
pattern=pattern.replace(/mm/,minutes2);
pattern=pattern.replace(/m/,minutes);
var seconds=date.getSeconds();
var seconds2=seconds;
var secondsLength=seconds.toString().length;
if(secondsLength==1){
seconds2="0"+seconds;
}
pattern=pattern.replace(/ss/,seconds2);
pattern=pattern.replace(/s/,seconds);
var milliSeconds=date.getMilliseconds();
pattern=pattern.replace(/S+/,milliSeconds);
var day=date.getDay();
// pattern=pattern.replace(/E+/,eval("DateFormat."+DateFormat.language+"_week[day]"));
if(hours>12){
pattern=pattern.replace(/a+/,eval("DateFormat."+DateFormat.language+"_am"));
}else{
pattern=pattern.replace(/a+/,eval("DateFormat."+DateFormat.language+"_pm"));
}
var kHours=hours;
if(kHours==0){
kHours=24;
}
var kHours2=kHours;
var kHoursLength=kHours.toString().length;
if(kHoursLength==1){
kHours2="0"+kHours;
}
pattern=pattern.replace(/kk/,kHours2);
pattern=pattern.replace(/k/,kHours);
var KHours=hours;
if(hours>11){
KHours=hours-12;
}
var KHours2=KHours;
var KHoursLength=KHours.toString().length;
if(KHoursLength==1){
KHours2="0"+KHours;
}
pattern=pattern.replace(/KK/,KHours2);
pattern=pattern.replace(/K/,KHours);
var hHours=KHours;
if(hHours==0){
hHours=12;
}
var hHours2=hHours;
var hHoursLength=hHours.toString().length;
if(KHoursLength==1){
hHours2="0"+hHours;
}
pattern=pattern.replace(/hh/,hHours2);
pattern=pattern.replace(/h/,hHours);
return pattern;
};
function SimpleDateFormat(){
this.jsjava_class="jsjava.text.SimpleDateFormat";
}
SimpleDateFormat.prototype=new DateFormat();
SimpleDateFormat.prototype.constructor=SimpleDateFormat;
SimpleDateFormat.prototype.applyPattern=function(pattern){
this.pattern=pattern;
};
var df=new SimpleDateFormat();
df.applyPattern("yyyy-MM-dd HH:mm:ss");
//
var qualityRuleId;
function ruleResultDetailTable(){
jsonData=document.getElementById('qualityRuleView').value;
var header = new Array();
header[0] = ["","<input type='radio' name='update'id='update' onclick='javascript:radioChoose(this);'/>","1%",""];
header[1] = ["质量规则ID","qualityRuleId","7%","15"];
header[2] = ["省份","provinceName","7%","15"];
header[3] = ["渠道","qualityRuleId","7%","15"];
header[4] = ["业务","qualityRuleId","7%","15"];
header[5] = ["数据来源","qualityRuleId","7%","15"];
header[6] = ["数据采集频率","qualityRuleId","7%","15"];
header[7] = ["指标监控时间","qualityRuleId","7%","15"];
header[8] = ["指标监控时间范围","qualityRuleId","7%","15"];
header[9] = ["完整性阈值","qualityRuleId","7%","15"];
header[10] = ["及时性阈值","qualityRuleId","7%","15"];
header[11] = ["数据类型","qualityRuleId","7%","15"];
header[12] = ["准确性规则","qualityRuleId","7%","15"];
window.pagging = new table_pagging({limit:12,tableId:'ruleResultTable',header:header});
//pagging.pagging(jsonData);
}
var table_pagging = function() {
this.init.apply(this, arguments);
}
table_pagging.prototype = {
init : function(s) {
// 从第几个数据开始获取,缺省状态下从0开始显示
if (s.start) {
this.start = parseInt(s.start);
} else {
this.start = 0;
}
// limit是指从start开始一共要用几条数据,缺省状态下显示10条
if (s.limit) {
this.limit = parseInt(s.limit);
} else {
this.limit = 10;
}
// cellStep表示每行要显示的行数.缺省状态下为1,一行一条记录.
if (s.cellStep) {
this.cellStep = parseInt(s.cellStep);
} else {
this.cellStep = 1;
}
// 要执行的表的名字
if (s.tableId) {
this.tableObj = document.getElementById(s.tableId);
} else {
alert("missing table id~");
}
// 头部的样式编码
if (s.headTrClassName) {
this.headTrClassName = s.headTrClassName;
} else {
this.headTrClassName = "";
}
if (s.trClassName) {
this.trClassName = s.trClassName;
} else {
this.trClassName = "";
}
// 定义头部信息
if (this.checkHeadersIsArray(s.header)) {
this.header = s.header;
} else {
alert("header is wrong~");
}
// 初始化头部
this.createTableHeader();
},
cloumnModel : function() {
},
pagging : function(objectJson) {
this.objectlist = eval('(' + objectJson + ')');
if (this.start + this.limit >= this.objectlist.length) {
this.end = this.objectlist.length;
} else {
this.end = this.start + this.limit;
}
this.clearSearchTable();
this.createTableBodyTd();
},
checkHeadersIsArray : function(header) {
if (!(header instanceof Array)) {
return false;
}
for ( var i = 0; i < header.length; i++) {
if (!(header[i] instanceof Array) || header[i].length < 4) {
return false;
}
}
return true;
},
// 清空表格数据
clearSearchTable : function() {
for ( var i = this.tableObj.rows.length; i > 1; i--) {
this.tableObj.deleteRow(i - 1);
}
},
// 创建头部
createTableHeader : function() {
var tr = this.tableObj.insertRow(this.tableObj.rows.length);
if (this.headTrClassName) {
tr.className = this.headTrClassName;
}
var rowLength = this.header.length;
for ( var i = 0; i < rowLength; i++) {
var td = tr.insertCell(i);
td.innerHTML = this.header[i][0];
if (this.header[i][2]) {
td.width = this.header[i][2];
}
}
},
// 创建table的数据区域
createTableBodyTd : function() {
this.clearSearchTable();
if (this.start > this.objectlist.length) {
return;
}
if (this.start > this.end) {
return;
}
if (this.end > this.objectlist.length) {
this.end = this.objectlist.length;
}
var rowLength = this.header.length;
// alert(rowLength);
for ( var i = this.start; i < this.end; i++) {
var tr = this.tableObj.insertRow(this.tableObj.rows.length);
if (this.trClassName) {
tr.className = this.trClassName;
}
for ( var j = 0; j < this.cellStep; j++) {
for ( var k = 0; k < rowLength; k++) {
var td = tr.insertCell(rowLength * j + k);
var tdContext = "&nbsp;";
var tdTitle = "";
if (this.header[k][1]) {
var reg = /\%\{([\d\w.]+)\}\%/g;
if (k != 0) {
if (result = reg.exec(this.header[k][1])) {
// var result = reg.exec(this.header[k][1]);
var context = this.header[k][1];
while (reg.lastIndex != 0) {
var value = this.getData(
this.objectlist[i], result[1]);
context = context.replace(
/\%\{[\d\w.]+\}\%/, value);
result = reg.exec(this.header[k][1]);
}
tdContext = context;
} else {
tdContext = this.getData(this.objectlist[i],
this.header[k][1]);
if(tdContext==null){
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(tdContext!="&nbsp;"){
tdContext = df.format(new Date(tdContext));
}
}
if(k==10){
if(tdContext!="&nbsp;"){
tdContext = df.format(new Date(tdContext));
}
}
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=\"openDialog('"+this.getData(this.objectlist[i],"dataModelId")+"','"+ this.getData(this.objectlist[i],"dataModelName")"')\">查看参数</a>";
}
if(k==4){
if (this.header[k][4] && !(tdContext == "&nbsp;")) {
td.title = tdTitle;
tdContext = tdContext + "";
if (tdContext.length > parseInt(this.header[k][4])) {
tdContext = tdContext.substring(0,
this.header[k][4])
+ "..";
}
}
}
}
} else {
tdContext=this.header[k][1]+"<span style='display:none'>"+i+"</span>";
// tdContext=this.header[k][1];
}
} else {
tdContext = "&nbsp;";
}
if (tdContext instanceof Object) {
tdContext = this.formateDate(tdContext);
}
if (!tdTitle) {
tdTitle = tdContext;
}
if (this.header[k][3] && !(tdContext == "&nbsp;")) {
td.title = tdTitle;
tdContext = tdContext + "";
if (tdContext.length > parseInt(this.header[k][3])) {
tdContext = tdContext.substring(0,
this.header[k][3])
+ "..";
}
}
console.log(tdContext);
td.innerHTML = tdContext;
// alert(tdContext+"----i:"+i+",j:"+j+",k:"+k);
}
i = i + j;
if (i >= this.start + this.limit) {
break;
}
}
if (i >= this.start + this.limit) {
break;
}
}
this.createPageTr();
},
// 从json获取数据,其中key如果带有.这个符号,说明需要获取的数据是多维数组(也可以看成对象)
getData : function(arrayObj, key) {
if (key.indexOf(".") > 0) {
var keys = key.split(".");
var obj;
for ( var c = 0; c < keys.length; c++) {
if (c == keys.length - 1) {
return obj[keys[c]];
}
if (!arrayObj[keys[c]]) {
return "&nbsp;"
} else {
obj = arrayObj[keys[c]]
}
}
} else {
return arrayObj[key];
}
},
// 格式化Date数据
formateDate : function(dateObj) {
if (dateObj.month) {
return parseInt(dateObj.month) + 1 + "-" + dateObj.date + " "
+ dateObj.hours + ":" + dateObj.minutes + ":"
+ dateObj.seconds;
} else {
return dateObj;
}
},
operator : function(_start, _end) {
this.start = _start;
this.end = _end;
this.createTableBodyTd();
},
// 获取当前对象名
getObjectName : function() {
for ( var a in window) {
if (window[a] == this) {
return a;
}
}
},
// 创建尾部,上一页,下一页,当前页之类信息
createPageTr : function() {
var objectName = this.getObjectName();
var tr = this.tableObj.insertRow(this.tableObj.rows.length);
td = tr.insertCell(0);
td.colSpan = this.header.length + '';
var totalPage = Math.ceil(this.objectlist.length / this.limit);
var currentPage = Math.ceil(this.start / this.limit);
var tableName = objectName + "assrotCurrentIndexTable";
td.innerHTML = "<table id='" + tableName + "' width='100%'></table>";
var tableObj = document.getElementById(tableName);
var tr = tableObj.insertRow(0);
var td1 = tr.insertCell(0);
td1.width = "15%";
td1.align = "center";
if (this.start >= this.limit) {
td1.innerHTML = "<a href='javascript:" + objectName
+ ".operator(0," + this.limit + ")'>首页</a>";
} else {
td1.innerHTML = "<a>首页</a>";
}
var td2 = tr.insertCell(1);
td2.width = "15%";
td2.align = "center";
if (this.start >= this.limit) {
td2.innerHTML = "<a href='javascript:" + objectName + ".operator("
+ (this.start - this.limit) + "," + this.start
+ ")'>上一页</a>";
} else {
td2.innerHTML = "<a>上一页</a>";
}
var td3 = tr.insertCell(2);
td3.width = "25%";
td3.align = "center";
// td3.innerHTML = "Page <input id='table_pagging_page_input_id'
// type='text' size='1' id='currentIndex' value='"+(currentPage+1)+"'
// >of&nbsp;"+totalPage;
td3.innerHTML = "<div class='col-sm-4'><input class=\"form-control\" type=\"text\" id=\"goPageNo\" value=\""
+ (currentPage + 1)
+ "\" size=\"3\" /></div><div class='col-sm-5'><input class=\"form-control\" type=\"button\" id=\"jumpButton\" value=\"跳转\" onclick=\"javascript:"
+ objectName + ".jump2PageNum()\" /></div>";
var td4 = tr.insertCell(3);
td4.width = "15%";
td4.align = "center";
if (this.end >= this.objectlist.length) {
td4.innerHTML = "<a>下一页<a>";
} else {
if ((this.end + this.limit) > this.objectlist.length) {
td4.innerHTML = "<a href='javascript:" + objectName
+ ".operator(" + this.end + ","
+ this.objectlist.length + ")'>下一页<a>";
} else {
td4.innerHTML = "<a href='javascript:" + objectName
+ ".operator(" + this.end + ","
+ (this.end + this.limit) + ")'>下一页<a>";
}
}
var td5 = tr.insertCell(4);
td5.width = "15%";
td5.align = "center";
if (this.end >= this.objectlist.length) {
td5.innerHTML = "<a>末页</a>";
} else {
td5.innerHTML = "<a href='javascript:" + objectName + ".operator("
+ this.limit * (totalPage - 1) + ","
+ this.objectlist.length + ")'>末页</a>";
}
var td6 = tr.insertCell(5);
td6.align = 'right';
td6.width = "25%";
// td6.innerHTML =
// "显示第"+this.start+"到第"+this.end+"记录,共"+this.objectlist.length+"条记录";
td6.innerHTML = "页数:<span style='color:blue'>" + (currentPage + 1)
+ "</span>/" + totalPage;
},
// 点击跳转,未开发
jump2PageNum : function() {
var re = /^[1-9]+[0-9]*]*$/;
if (!re.test(document.getElementById('goPageNo').value)) {
alert("请输入正整数");
} else {
if (parseInt(document.getElementById('goPageNo').value) > Math
.ceil(this.objectlist.length / this.limit)) {
alert("你输入的数值过大!");
} else {
this
.operator(
this.limit
* (parseInt(document
.getElementById('goPageNo').value) - 1),
(this.limit
* (parseInt(document
.getElementById('goPageNo').value) - 1) + this.limit));
}
}
},
test : function() {
alert(this.start);
alert(this.step);
alert(this.cellStep);
alert(this.tablename);
}
}
function radioChoose(clickObj){
var obj = eval("(" + jsonData + ")");
//alert(obj);
if(clickObj.checked){
//alert(clickObj);
//alert(clickObj.nextSibling.innerHTML);
$("#updateModel").attr("disabled", false);
modelId=parseInt(obj[parseInt(clickObj.nextSibling.innerHTML)].dataModelId);
}
}
\ No newline at end of file
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