Commit 20ee8f77 authored by afe's avatar afe

Merge remote-tracking branch 'monitorAnalysis/liuna'

# Conflicts: # .idea/workspace.xml
parents 25f2cdf0 c86ed933
......@@ -1470,7 +1470,14 @@
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" name="lib" level="project" />
<orderEntry type="library" name="servlet-api" level="application" />
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://D:/CMSZMonitorAnalysis/apache-tomcat-7.0.47/lib/servlet-api.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
</component>
</module>
\ No newline at end of file
......@@ -24,8 +24,8 @@ public class AccuracyRule implements Serializable {
private Long accuracyRuleId;//准确性规则ID
private Long qualityRuleId;//质量规则ID
private String ruleType;//规则类型
private double scopeMaxValue;//范围最大值
private double scopeMinValue;//范围最小值
private String scopeMaxValue;//范围最大值
private String scopeMinValue;//范围最小值
private String repeatedCheckGranularity;//重复考核粒度
private Date repeatedCheckStartTime;//重复考核开始时间
private Date repeatedCheckEndTime;//重复考核结束时间
......@@ -58,16 +58,16 @@ public class AccuracyRule implements Serializable {
public void setRuleType(String ruleType) {
this.ruleType = ruleType;
}
public double getScopeMaxValue() {
public String getScopeMaxValue() {
return scopeMaxValue;
}
public void setScopeMaxValue(double scopeMaxValue) {
public void setScopeMaxValue(String scopeMaxValue) {
this.scopeMaxValue = scopeMaxValue;
}
public double getScopeMinValue() {
public String getScopeMinValue() {
return scopeMinValue;
}
public void setScopeMinValue(double scopeMinValue) {
public void setScopeMinValue(String scopeMinValue) {
this.scopeMinValue = scopeMinValue;
}
public String getRepeatedCheckGranularity() {
......
......@@ -41,7 +41,8 @@ public class Kpi implements Serializable{
private Long kpiTypeId;
private Long kpiCycleTypeId;
private String isActive ; //是否有效,为Y时,才需要在筛选项中显示
private String calCycle;
public Long getKpiId() {
return kpiId;
}
......@@ -111,4 +112,7 @@ public class Kpi implements Serializable{
public void setIsActive(String isActive) {
this.isActive = isActive;
}
public String getCalCycle(){ return calCycle;}
public void setCalCycle(String calCycle) { this.calCycle = calCycle;}
}
......@@ -34,10 +34,10 @@ public class QualityRule {
private Date ruleUpdateTime;//规则更新时间
private String ruleValidFlag;//规则是否有效
private String ifSystemValue;
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="QualityRuleSequence")
@SequenceGenerator(name = "QualityRuleSequence", sequenceName = "ccolap.quality_rule_deq", allocationSize=1)
@SequenceGenerator(name = "QualityRuleSequence", sequenceName = "ccolap.quality_rule_seq", allocationSize=1)
public Long getQualityRuleId() {
return qualityRuleId;
}
......@@ -116,5 +116,5 @@ public class QualityRule {
public void setIfSystemValue(String ifSystemValue) {
this.ifSystemValue = ifSystemValue;
}
}
......@@ -34,7 +34,7 @@ public interface AccuracyRuleDao extends JpaSpecificationExecutor<AccuracyRule>,
//根据准确性规则ID更新准确性规则信息
@Modifying
@Query("update AccuracyRule ar set ar.ruleType=:ruleType, ar.scopeMaxValue=:scopeMaxValue, ar.scopeMinValue=:scopeMinValue, ar.repeatedCheckGranularity=:repeatedCheckGranularity, ar.repeatedCheckStartTime=:repeatedCheckStartTime, ar.repeatedCheckEndTime=:repeatedCheckEndTime, ar.ifRepeatedCheckSeries=:ifRepeatedCheckSeries, ar.repeatedCheckMaxTime=:repeatedCheckMaxTime, ar.ifRepeatedCheckSummation=:ifRepeatedCheckSummation where ar.accuracyRuleId =:accuracyRuleId")
void updateAccuracyRuleByAccuracyRuleId(@Param("ruleType")String ruleType,@Param("scopeMaxValue")double scopeMaxValue,@Param("scopeMinValue")double scopeMinValue,@Param("repeatedCheckGranularity")String repeatedCheckGranularity,@Param("repeatedCheckStartTime")Date repeatedCheckStartTime,@Param("repeatedCheckEndTime")Date repeatedCheckEndTime,@Param("ifRepeatedCheckSeries")String ifRepeatedCheckSeries,@Param("repeatedCheckMaxTime")Long repeatedCheckMaxTime,@Param("ifRepeatedCheckSummation")String ifRepeatedCheckSummation,@Param("accuracyRuleId")Long accuracyRuleId);
void updateAccuracyRuleByAccuracyRuleId(@Param("ruleType")String ruleType,@Param("scopeMaxValue")String scopeMaxValue,@Param("scopeMinValue")String scopeMinValue,@Param("repeatedCheckGranularity")String repeatedCheckGranularity,@Param("repeatedCheckStartTime")Date repeatedCheckStartTime,@Param("repeatedCheckEndTime")Date repeatedCheckEndTime,@Param("ifRepeatedCheckSeries")String ifRepeatedCheckSeries,@Param("repeatedCheckMaxTime")Long repeatedCheckMaxTime,@Param("ifRepeatedCheckSummation")String ifRepeatedCheckSummation,@Param("accuracyRuleId")Long accuracyRuleId);
//根据准确性规则ID删除一条准确性规则信息
@Modifying
......
......@@ -25,10 +25,15 @@ public interface KpiDao extends JpaSpecificationExecutor<Kpi>,PagingAndSortingRe
List<Kpi> findByKpiName(String kpiName);
List<Kpi> findByBusinessIdIn(List<Long> businessIdList);
List<Kpi> findByBusinessIdIn(Collection<Long> businessIdList);
@Query("select kpi.kpiName, kpi.kpiCode from Kpi kpi where kpi.kpiId = :kpiId")
List<Kpi> findKpiCodeAndKpiNameByKpiId(@Param("kpiId") Long kpiId);
@Query("select kpi.kpiId, kpi.kpiName from Kpi kpi where kpi.kpiId >=0")
List<Object[]> findAllKpiIdAndKpiName();
//由指标名得到指标周期类型
@Query("select kpiCycleType.isHourKpi from Kpi kpi,KpiCycleType kpiCycleType where kpi.kpiCycleTypeId=kpiCycleType.kpiCycleTypeId and kpi.kpiName IN (:kpiName) and kpi.kpiId >=0")
List<Object[]> findKpiCycleTypeByKpiName(@Param("kpiName") String kpiName);
......@@ -38,9 +43,9 @@ public interface KpiDao extends JpaSpecificationExecutor<Kpi>,PagingAndSortingRe
@Query("select kpi.kpiId, kpi.kpiName from Kpi kpi,Business business where kpi.businessId=business.businessId and business.businessId IN (:businessIdList) and kpi.kpiId >=0")
List<Object[]> findAllKpiIdAndKpiNameByBusinessId(@Param("businessIdList") List<Long> businessIdList);
//由业务联动得到指标
@Query("select kpi.kpiId, kpi.kpiName from Kpi kpi,Business business where business.businessId = kpi.businessId and kpi.isActive = 'Y' and business.businessId in (:businessIds) and kpi.kpiId>=0 order by kpi.kpiId ")
List<Object[]> findKpiIdAndKpiNameByBusinessIds(@Param("businessIds")List<Long> businessIdList);
//由业务,采集频率联动得到指标
@Query("select kpi.kpiId, kpi.kpiName from Kpi kpi,Business business where business.businessId = kpi.businessId and kpi.isActive = 'Y' and kpi.calCycle=:calCycleValue and business.businessId in (:businessIds) and kpi.kpiId>=0 order by kpi.kpiId ")
List<Object[]> findKpiIdAndKpiNameByBusinessIds(@Param("businessIds")List<Long> businessIdList, @Param("calCycleValue") String calCycleValue);
//由单个业务ID得到指标
@Query("select kpi.kpiId, kpi.kpiName from Kpi kpi,Business business where kpi.businessId=business.businessId and business.businessId = :businessIdList and kpi.kpiId >=0")
......
......@@ -4,6 +4,7 @@ package com.hp.cmsz.repository;
import java.util.Date;
import java.util.List;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
......@@ -22,7 +23,8 @@ public interface ProvinceDao extends JpaSpecificationExecutor<Province>,
List<Province> findByProvinceIdIn(List<Long> provinceIds);
List<Province> findByProvinceId(Long provinceId);
@Query("from Province p where p.provinceId>=0 order by p.provinceId")
List<Province> findProvince();
......
......@@ -29,7 +29,7 @@ public class AccuracyRuleService {
//根据准确性规则ID更新准确性规则
@Transactional(readOnly=false)
public void updateAccuracyRuleByAccuracyRuleId(String ruleType,double scopeMaxValue,double scopeMinValue,String repeatedCheckGranularity,Date repeatedCheckStartTime,Date repeatedCheckEndTime,String ifRepeatedCheckSeries,Long repeatedCheckMaxTime,String ifRepeatedCheckSummation,Long accuracyRuleId){
public void updateAccuracyRuleByAccuracyRuleId(String ruleType,String scopeMaxValue,String scopeMinValue,String repeatedCheckGranularity,Date repeatedCheckStartTime,Date repeatedCheckEndTime,String ifRepeatedCheckSeries,Long repeatedCheckMaxTime,String ifRepeatedCheckSummation,Long accuracyRuleId){
accuracyRuleDao.updateAccuracyRuleByAccuracyRuleId(ruleType, scopeMaxValue, scopeMinValue, repeatedCheckGranularity, repeatedCheckStartTime, repeatedCheckEndTime, ifRepeatedCheckSeries, repeatedCheckMaxTime, ifRepeatedCheckSummation,accuracyRuleId);
}
......
......@@ -2,6 +2,7 @@ package com.hp.cmsz.web.analysissupport;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Timestamp;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
......@@ -24,13 +25,12 @@ import org.springframework.web.bind.annotation.ResponseBody;
import com.google.gson.Gson;
import com.hp.cmsz.entity.Business;
import com.hp.cmsz.entity.Channel;
import com.hp.cmsz.entity.ChannelDataSourceMap;
import com.hp.cmsz.entity.DataModel;
import com.hp.cmsz.entity.DataSource;
import com.hp.cmsz.entity.DataType;
import com.hp.cmsz.entity.QualityRule;
import com.hp.cmsz.entity.Kpi;
import com.hp.cmsz.entity.ModelParameter;
import com.hp.cmsz.entity.Province;
import com.hp.cmsz.entity.AccuracyRule;
import com.hp.cmsz.repository.AccuracyRuleDao;
import com.hp.cmsz.repository.BusinessDao;
import com.hp.cmsz.repository.ChannelDao;
......@@ -81,17 +81,17 @@ public class QualityRuleMaintainController {
@Autowired
private DataSourceDao dataSourceDao;
// @Autowired
// private QualityRuleDao qualityRuleDao;
//
// @Autowired
// private QualityRuleService qualityRuleService;
//
// @Autowired
// private AccuracyRuleDao accuracyRuleDao;
//
// @Autowired
// private CmszOperationLogService cmszOperationLogService;
@Autowired
private QualityRuleDao qualityRuleDao;
@Autowired
private QualityRuleService qualityRuleService;
@Autowired
private AccuracyRuleDao accuracyRuleDao;
@Autowired
private CmszOperationLogService cmszOperationLogService;
@RequestMapping(value = "")
public String ruleMaintainHome(Map model){
......@@ -142,7 +142,6 @@ public class QualityRuleMaintainController {
}
}
}
resultList.add(objs);
}
......@@ -162,34 +161,17 @@ public class QualityRuleMaintainController {
}
// @RequestMapping(value="/findBusinessId*")
// @ResponseBody
// public void findBusinessId(@RequestParam(value = "dataSource", defaultValue ="" ) String dataSource,
// @RequestParam(value = "channelId", defaultValue ="" ) String channelId,
// HttpServletResponse response){
// List<Object[]> channelDataSourceMapIdList = (List<Object[]>)businessDao.findBusinessIdAndBusinessNameByDataSourceIdAndChannelIdWithIsActive(Long.parseLong(dataSource),Long.parseLong(channel));
// Gson gson = new Gson();
// response.setContentType("text/Xml;charset=gbk");
// PrintWriter out = null;
// try {
// out = response.getWriter();
// out.println(gson.toJson(dataSceAndBus));
// }
// catch (IOException ex1) {
// ex1.printStackTrace();
// }finally{ out.close(); }
// }
@RequestMapping(value="/findKpiId*")
@ResponseBody
public void findKpiId(@RequestParam(value = "businessIds", defaultValue ="" ) String businessIds,
HttpServletResponse response){
@RequestParam(value = "calCycleValue", defaultValue = "30MI") String calCycleValue,
HttpServletResponse response){
String[] strs = businessIds.split(",");
List<Long> businessIdlist = new ArrayList<Long>();
for(int i=0;i<strs.length;i++){
for(int i=0;i<strs.length;i++) {
businessIdlist.add(Long.valueOf(strs[i]));
List<Object[]> businessKpiList = (List<Object[]>)kpiDao.findKpiIdAndKpiNameByBusinessIds(businessIdlist);
}
List<Object[]> businessKpiList = (List<Object[]>)kpiDao.findKpiIdAndKpiNameByBusinessIds(businessIdlist,calCycleValue);
Gson gson = new Gson();
response.setContentType("text/Xml;charset=gbk");
......@@ -204,81 +186,116 @@ public class QualityRuleMaintainController {
}
// private List<Long> qualityRuleIdList = new ArrayList<Long>();
// //新增准确性规则
// @RequestMapping(value = "/createAccuracyRule*", method = RequestMethod.GET)
// @ResponseBody
// public void createAccuracyRule(
// @RequestParam(value="ruleType") String ruleType,
// @RequestParam(value="scopeMaxValue") String scopeMaxValue,
// @RequestParam(value="scopeMinValue") String scopeMinValue,
// @RequestParam(value="repeatedCheckGranularity") String repeatedCheckGranularity,
// @RequestParam(value="repeatedCheckStartTime") String repeatedCheckStartTime,
// @RequestParam(value="repeatedCheckEndTime") String repeatedCheckEndTime,
// @RequestParam(value="ifRepeatedCheckSeries") String ifRepeatedCheckSeries,
// @RequestParam(value="repeatedCheckMaxTime") String repeatedCheckMaxTime,
// @RequestParam(value="ifRepeatedCheckSummation") String ifRepeatedCheckSummation,
// HttpServletResponse response,HttpServletRequest request) {
//
// AccuracyRule accuracyRule = new accuracyRule();
// if(!ruleType.trim().equals("")){
// if(ruleType == 1){
// accuracyRule.setruleType("范围");
// }else if(ruleType == 2){
// accuracyRule.setruleType("重复");
private List<Long> qualityRuleIdList = new ArrayList<Long>();
//新增准确性规则
@RequestMapping(value = "/createAccuracyRule*", method = RequestMethod.GET)
@ResponseBody
public void createAccuracyRule(
@RequestParam(value="ruleType") String ruleType,
@RequestParam(value="scopeMaxValue") String scopeMaxValue,
@RequestParam(value="scopeMinValue") String scopeMinValue,
@RequestParam(value="repeatedCheckGranularity") String repeatedCheckGranularity,
@RequestParam(value="repeatedCheckStartTime") String repeatedCheckStartTime,
@RequestParam(value="repeatedCheckEndTime") String repeatedCheckEndTime,
@RequestParam(value="ifRepeatedCheckSeries") String ifRepeatedCheckSeries,
@RequestParam(value="repeatedCheckMaxTime") String repeatedCheckMaxTime,
@RequestParam(value="ifRepeatedCheckSummation") String ifRepeatedCheckSummation,
HttpServletResponse response,HttpServletRequest request) {
AccuracyRule accuracyRule = new AccuracyRule();
if(!ruleType.trim().equals("")) {
if (ruleType == "1") {
accuracyRule.setRuleType("范围");
} else if (ruleType == "2") {
accuracyRule.setRuleType("重复");
}
}
SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
if(!scopeMaxValue.trim().equals("")){accuracyRule.setScopeMaxValue(scopeMaxValue);}
if(!scopeMinValue.trim().equals("")){accuracyRule.setScopeMinValue(scopeMinValue);}
if(!repeatedCheckGranularity.trim().equals("")){accuracyRule.setRepeatedCheckGranularity(repeatedCheckGranularity);}
if(!repeatedCheckStartTime.trim().equals("")){
try {
accuracyRule.setRepeatedCheckStartTime(sd.parse(repeatedCheckStartTime));
} catch (ParseException e) {
e.printStackTrace();
}
}
if(!repeatedCheckEndTime.trim().equals("")){
try {
accuracyRule.setRepeatedCheckEndTime(sd.parse(repeatedCheckEndTime));
} catch (ParseException e) {
e.printStackTrace();
}
}
if(!ifRepeatedCheckSeries.trim().equals("")){accuracyRule.setIfRepeatedCheckSeries(ifRepeatedCheckSeries);}
if(!repeatedCheckMaxTime.trim().equals("")){accuracyRule.setRepeatedCheckMaxTime(Long.parseLong(repeatedCheckMaxTime));}
if(!ifRepeatedCheckSummation.trim().equals("")){accuracyRule.setIfRepeatedCheckSummation(ifRepeatedCheckSummation);}
accuracyRule.setRuleCrtTime(new Date());
accuracyRule.setRuleUpdateTime(new Date());
accuracyRuleDao.save(accuracyRule);
Long qualityRuleId = accuracyRule.getAccuracyRuleId();
qualityRuleIdList.add(qualityRuleId);
}
//新增质量模型
@RequestMapping(value = "/saveRuleDataForm", method = RequestMethod.POST)
public String saveRuleDataForm(
HttpServletResponse response,HttpServletRequest request) throws ParseException{
System.out.println("123456");
// String provinceId = request.getParameter("province");
// String businessId = request.getParameter("businessinput");
// String channelId =request.getParameter("channel");
// String dataSourceId =request.getParameter("dataSource");
// String kpiId = request.getParameter("kpiinput");
// String kpiMonitorTime="";
// String businessTime="";
// String ruleCrtTime="";
// String ruleUpdateTime="";
//
// SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// QualityRule qualityRule = new QualityRule();
// List<Long> provinceIdList = new ArrayList<Long>();
// for(int i=0;i<provinceValue.split(",").length;i++){
// provinceIdList.add(Long.parseLong(provinceValue.split(",")[i]));
// }
// List<Long> businessIdList = new ArrayList<Long>();
// for(int i=0;i<businessValue.split(",").length;i++){
// businessIdList.add(Long.parseLong(businessValue.split(",")[i]));
// }
// List<Long> kpiIdList = new ArrayList<Long>();
// for(int i=0;i<kpiValue.split(",").length;i++){
// kpiIdList.add(Long.parseLong(kpiValue.split(",")[i]));
// }
// System.out.println("provinceIdList:"+provinceIdList+"businessIdList:"+businessIdList+"kpiIdList:"+kpiIdList);
// for(int j=0; j<provinceIdList.size(); j++) {
// for(int k=0; k<businessIdList.size(); k++){
// for(int l=0; l<kpiIdList.size(); l++){
// provinceId = provinceIdList.get(j);
// businessId = businessIdList.get(k);
// kpiId = kpiIdList.get(l);
// if(!provinceId.equals("")){qualityRule.setProvinceId(provinceId);}
// if(!businessId.equals("")){qualityRule.setBusinessId(businessId);}
// if(!kpiId.equals("")){qualityRule.setKpiId(kpiId);}
// if(!channelId.trim().equals("")){qualityRule.setChannelId(Long.parseLong(channelId));}
// if(!dataSourceId.trim().equals("")){qualityRule.setDataSourceId(Long.parseLong(dataSourceId));}
// if(!kpiMonitorTime.trim().equals("")){qualityRule.setKpiMonitorTime(kpiMonitorTime);}
// qualityRule.setKpiMonitorRunTime(kpiMonitorTime+businessTime);
// if(!businessTime.trim().equals("")){qualityRule.setBusinessTime(businessTime);}
// qualityRule.setRuleCrtTime(sd.parse(ruleCrtTime));
// qualityRule.setRuleUpdateTime(sd.parse(ruleUpdateTime));
// qualityRule.setRuleValidFlag("0");
// qualityRule.setIfSystemValue("0");
// qualityRuleDao.save(qualityRule);
// }
// }
// }
// if(!scopeMaxValue.trim().equals("")){accuracyRule.setscopeMaxValue(scopeMaxValue);}
// if(!scopeMinValue.trim().equals("")){accuracyRule.setscopeMinValue(scopeMinValue);}
// if(!repeatedCheckGranularity.trim().equals("")){accuracyRule.setrepeatedCheckGranularity(repeatedCheckGranularity);}
// if(!repeatedCheckStartTime.trim().equals("")){accuracyRule.setrepeatedCheckStartTime(repeatedCheckStartTime);}
// if(!repeatedCheckEndTime.trim().equals("")){accuracyRule.setrepeatedCheckEndTime(repeatedCheckEndTime);}
// if(!ifRepeatedCheckSeries.trim().equals("")){accuracyRule.setifRepeatedCheckSeries(ifRepeatedCheckSeries);}
// if(!repeatedCheckMaxTime.trim().equals("")){accuracyRule.setrepeatedCheckMaxTime(repeatedCheckMaxTime);}
// if(!ifRepeatedCheckSummation.trim().equals("")){accuracyRule.setifRepeatedCheckSummation(ifRepeatedCheckSummation);}
//
// accuracyRuleDao.save(accuracyRule);
//
// Long accuracyRuleId = accuracyRule.getaccuracyRuleId();
// qualityRuleIdList.add(qualityRuleId);
// }
// //新增质量模型
// @RequestMapping(value = "/saveRuleDataForm", method = RequestMethod.POST)
// public String saveRuleDataForm(HttpServletResponse response,HttpServletRequest request) throws ParseException{
// Long qualityRuleId = "";
// Long businessId = "";
// Long kpiId = "";
// Long channelId = "";
// Long provinceId = "";
// Long dataSourceId = "";
// String kpiMonitorTime = "";
// String kpiMonitorRunTime = "";
// String businessTime = "";
// Date ruleCrtTime = "";
// Date ruleUpdateTime = "";
// String ruleValidFlag = "";
// String ifSystemValue = "";
// QualityRule qualityRule = new qualityRule();
// SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// if(!qualityRuleId.trim().equals("")){qualityRule.setqualityRuleId(Long.parseLong(qualityRuleId));}
// if(!businessId.trim().equals("")){qualityRule.setbusinessId(Long.parseLong(businessId));}
// if(!kpiId.trim().equals("")){qualityRule.setkpiId(Long.parseLong(kpiId));}
// if(!channelId.trim().equals("")){qualityRule.setchannelId(Long.parseLong(channelId));}
// if(!provinceId.trim().equals("")){qualityRule.setprovinceId(Long.parseLong(provinceId));}
// if(!dataSourceId.trim().equals("")){qualityRule.setdataSourceId(Long.parseLong(dataSourceId));}
// if(!kpiMonitorTime.trim().equals("")){qualityRule.setkpiMonitorTime(kpiMonitorTime);}
// qualityRule.setkpiMonitorRunTime(kpiMonitorTime);
// if(!businessTime.trim().equals("")){qualityRule.setbusinessTime(businessTime);}
// qualityRule.setruleCrtTime(sd.parse(ruleCrtTime));
// qualityRule.setruleUpdateTime(sd.parse(ruleUpdateTime));
// qualityRule.setruleValidFlag(1);
// qualityRule.setifSystemValue(1);
// qualityRuleDao.save(qualityRule);
// cmszOperationLogService.createLog("增加","新建质量模型","quality_rule_warehouse_info_t. QUALITY_RULE_ID="+ qualityRule.getQualityRuleId().toString());
// Long qualityRuleId = qualityRule.getqualityRuleId();
// return "redirect:AnalysisSupport/QualityRuleResult";
// }
// Long qualityRuleId = qualityRule.getQualityRuleId();
return "redirect:AnalysisSupport/QualityRuleResult";
}
}
......@@ -95,15 +95,15 @@ public class QualityRuleResultController {
//查询出所有的数据来源信息
List<DataSource> datasourceList=(List<DataSource>)dataSourceDao.findDataSource();
//查询出所有的质量规则
List<QualityRule> qualityRuleList=(List<QualityRule>)qualityRuleDao.findAll();
List<QualityRule> qualityRuleViewList=(List<QualityRule>)qualityRuleDao.findAll();
Gson gson = new Gson();
model.put("provinceList", gson.toJson(provinceList));
model.put("provinceList", provinceList);
model.put("channelList", channelList);
model.put("kpiList", kpiList);
model.put("businessList",businessList);
model.put("datasourceList", datasourceList);
model.put("qualityRuleList", qualityRuleList);
model.put("qualityRuleViewList", gson.toJson(qualityRuleViewList));
model.put("rulePageNum", rulePageNum);
cmszOperationLogService.createLog("查询","质量规则","质量规则首页");
......
......@@ -53,38 +53,50 @@
</td>
</tr>
<tr><td>数据来源(<font color="red">必填</font>):</td>
<td><select class="form-control" name="dataSource" id="dataSource" >
<c:forEach var="dataSource" items="${dataSourceList}">
<option value="${dataSource.dataSourceId}">${dataSource.dataSourceName}</option>
</c:forEach>
<td>
<select class="form-control" name="dataSource" id="dataSource" >
<c:forEach var="dataSource" items="${dataSourceList}">
<c:if test="${dataSource.dataSourceId == '5'}">
<option value="${dataSource.dataSourceId}" selected>${dataSource.dataSourceName}</option>
</c:if >
<c:if test="${dataSource.dataSourceId != '5'}">
<option value="${dataSource.dataSourceId}" >${dataSource.dataSourceName}</option>
</c:if >
</c:forEach>
</select></td>
</tr>
<tr><td>渠道(<font color="red">必填</font>):</td>
<td><select class="form-control" name="channel" id="channel" >
<c:forEach var="channel" items="${channelList}">
<option value="${channel.channelId}">${channel.channelName}</option>
<c:if test="${channel.channelId == '7'}">
<option value="${channel.channelId}" selected>${channel.channelName}</option>
</c:if>
<c:if test="${channel.channelId != '7'}">
<option value="${channel.channelId}">${channel.channelName}</option>
</c:if>
</c:forEach>
</select></td>
</tr>
<tr><td>业务(<font color="red">必填</font>):</td>
<td >
<div id="businesstd"></div>
<input type="hidden" id="business" name="business" value='${businessList}' />
</td>
</tr>
<tr><td>数据采集频率(<font color="red">必填</font>):</td>
<td><select class="form-control" name="calCycle" id="calCycle" style="display: inline;">
<option value="30MI">30分钟</option>
<option value="01HR">1小时</option>
<option value="01DY">1天</option>
<option value="01MO">1月</option>
</select>
</td></tr>
<tr><td>指标(<font color="red">必填</font>):</td>
<td>
<div id="kpitd"></div>
<input type="hidden" id="kpi" name="kpi" value='${kpiList}' />
</td>
</tr>
<tr><td>数据采集频率(<font color="red">必填</font>):</td>
<td><select class="form-control" name="calCycle" id="calCycle" style="display: inline;">
<option value="30MI">30分钟</option>
<option value="01HR">1小时</option>
<option value="01DY">1天</option>
<option value="01MO">1月</option>
</select></td></tr>
<tr><td>指标监控时间(<font color="red">必填</font>):</td>
<td>
<input type="text" style="width:200px" name="kpiMonitorTime" id="kpiMonitorTime" style="display: inline;" />
......@@ -95,9 +107,9 @@
<option value="3"></option>
</select></td>
</tr>
<tr><td>指标业务时间(<font color="red">必填</font>):</td>
<td>
<input type="text" class="form-control" name="businessTime" id="businessTime" onFocus="WdatePicker({maxDate:'#F{$dp.$D(\'businessTime\')}'})" />
<tr><td>指标采集时间(<font color="red">必填</font>):</td>
<td id="businessTimetd">
<input type='text' class='form-control' id='businessTime' name='businessTime' onfocus='WdatePicker({dateFmt:"yyyy-MM-dd HH:mm:00",readOnly:false,hmsMenuCfg : {H : [ 1, 6 ], m : [ 30, 2 ], s : [ 60, 0 ]}})'/>
</td>
</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>
......@@ -121,6 +133,8 @@
</td></tr>
</table>
</form>
<input type="hidden" id="kpi" name="kpi" value='${kpiList}' />
<input type="hidden" id="business" name="business" value='${businessList}' />
</div>
</div>
</div>
......@@ -151,7 +165,7 @@ $("#ruleType").change(function (){
//form表单提交
$("#ruleSubmit").click(function(){
if($.trim($("kpiMonitorTime").val())==""){
if($.trim($("#kpiMonitorTime").val())==""){
$.alert("指标监控时间不能为空");
}else if($("#businessTime").val()==""){
$.alert("指标业务时间不能为空");
......@@ -256,59 +270,55 @@ $("#ruleType").change(function (){
$("#ruleBack").click(function(){
location.href="${ctx}/AnalysisSupport/QualityRuleResult";
});
var dataSourceValue = $("#dataSource").val();
function getProvinceCheckedValues() {
var provinceArray = new Array();
var i=0;
$("#province:checked").each(function(){
provinceArray[i]=$(this).val();
i++;
});
return provinceArray;
}
function getProvinceCheckedValuesString(){
var provinceStr="";
var provinceArray=getProvinceCheckedValues();
for(var i=0;i<provinceArray.length;i++){
if(i==provinceArray.length-1){
provinceStr+=provinceArray[i];
}else{
provinceStr+=provinceArray[i]+",";
}
}
return provinceStr;
}
var dataSourceValue =$("#dataSource").val();
var channelValue = $("#channel").val();
var businessIds = getBusinessCheckedValues();
var calCycleValue =$("#calCycle").val();
$("#dataSource").change(function(){
dataSourceValue = $("#dataSource").val();
console.log(dataSourceValue);
updateBusiness(dataSourceValue,channelValue);
});
$("#channel").change(function(){
channelValue = $("#channel").val();
console.log(channelValue);
updateBusiness(dataSourceValue,channelValue);
});
function getBusinessCheckedValues(){
var businessArray = new Array();
var i=0;
$("#business:checked").each(function(){
businessArray[i]=$(this).val();
i++;
});
return businessArray;
}
function getBusinessCheckedValuesString(){
var businessStr="";
var businessArray=getBusinessCheckedValues();
for(var i=0;i<businessArray.length;i++){
if(i==businessArray.length-1){
businessStr+=businessArray[i];
}else{
businessStr+=businessArray[i]+",";
}
}
return businessStr;
}
var businessIds = getBusinessCheckedValuesString();
function updateKpi(businessIds){
function updateKpi(businessIds,calCycleValue){
$.ajax({
type : "GET",
contentType : "application/json",
url: "${ctx}/AnalysisSupport/QualityRuleMaintain/findKpiId?businessIds="+businessIds,
url: "${ctx}/AnalysisSupport/QualityRuleMaintain/findKpiId?businessIds="+businessIds+"&calCycleValue="+calCycleValue,
async: false,
beforeSend: function(data) {},
success: function(data){
var td = $("#kpitd");
td.empty();
console.log(data)
data = JSON.parse(data)
data.forEach(function(t){
td.append("<input type='checkbox' name='kpiinput' class='kpiItem' value='"+t[0]+"' checked >"+t[1]+"</input>")
......@@ -318,7 +328,6 @@ function updateKpi(businessIds){
}
function updateBusiness(dataSource,channel){
console.log(dataSource,channel)
$.ajax({
type : "GET",
contentType : "application/json",
......@@ -329,38 +338,101 @@ function updateBusiness(dataSource,channel){
var td = $("#businesstd");
var businessIds = new Array();
td.empty();
console.log(data)
data = JSON.parse(data)
console.log(data)
data.forEach(function(t){
td.append("<input type='checkbox' name='businessinput' class='businessItem' value='"+t[0]+"' checked >"+t[1]+"</input>")
businessIds+=t[0]+",";
console.log("ids:"+businessIds);
});
updateKpi(businessIds);
updateKpi(businessIds,calCycleValue);
}
});
$(".businessItem").click(function(){
businessIds="";
$("[name='businessinput']:checked").each(function (){
businessIds += $(this).val()+",";
});
updateKpi(businessIds,calCycleValue);
});
$("#business").click(function(){
var clickFlag=true;
$("#business").each(function(){
if($(this).attr("checked") == null||$(this).attr("checked") == false){ clickFlag=false;}
});
$("#business").attr("checked",clickFlag);
updateKpi(businessIds);
}
$("#calCycle").change(function () {
calCycleValue=$("#calCycle").val();
$("[name='businessinput']:checked").each(function (){
businessIds += $(this).val()+",";
});
updateKpi(businessIds,calCycleValue)
updateBusinessTime(calCycleValue)
});
updateBusiness($("#dataSource").val(),$("#channel").val());
function updateBusinessTime(calCycleValue) {
$("#businessTimetd").empty()
if(calCycleValue == "30MI"){
$("#businessTimetd").append("<input type='text' class='form-control' id='businessTime' name='businessTime' onfocus='WdatePicker({dateFmt:\"yyyy-MM-dd HH:mm:00\",readOnly:false,hmsMenuCfg : {H : [ 1, 6 ], m : [ 30, 2 ], s : [ 60, 0 ]}})'/>");
}else if(calCycleValue == "01HR"){
$("#businessTimetd").append("<input type='text' class='form-control' id='businessTime' name='businessTime' onfocus='WdatePicker({dateFmt:\"yyyy-MM-dd HH:00:00\",readOnly:false,hmsMenuCfg : {H : [ 1, 6 ], m : [ 30, 2 ], s : [ 60, 0 ]}})'/>");
}else if(calCycleValue == "01DY"){
$("#businessTimetd").append("<input type='text' class='form-control' id='businessTime' name='businessTime' onfocus='WdatePicker({dateFmt:\"yyyy-MM-dd 00:00:00\",readOnly:false,hmsMenuCfg : {H : [ 24, 0 ], m : [ 60, 0 ], s : [ 60, 0 ]}})'/>");
}else if(calCycleValue == "01MO"){
$("#businessTimetd").append("<input type='text' class='form-control' id='businessTime' name='businessTime' onfocus='WdatePicker({dateFmt:\"yyyy-MM-01 00:00:00\",readOnly:false,hmsMenuCfg : {H : [ 24, 0 ], m : [ 60, 0 ], s : [ 60, 0 ]}})' />");
}
}
function getBusinessCheckedValues(){
var businessArray = new Array();
var i=0;
$("[name='businessinput']:checked").each(function(){
businessArray[i]=$(this).val();
i++;
});
return businessArray;
}
function getBusinessCheckedValuesString(){
var businessStr="";
var businessArray=getBusinessCheckedValues();
for(var i=0;i<businessArray.length;i++){
if(i==businessArray.length-1){
businessStr+=businessArray[i];
}else{
businessStr+=businessArray[i]+",";
}
}
return businessStr;
}
function getKpiCheckedValues(){
var kpiArray = new Array();
var i=0;
$("[name='kpiinput']:checked").each(function(){
kpiArray[i]=$(this).val();
i++;
});
return kpiArray;
}
function getKpiCheckedValuesString(){
var kpiStr="";
var kpiArray=getKpiCheckedValues();
for(var i=0;i<kpiArray.length;i++){
if(i==kpiArray.length-1){
kpiStr+=kpiArray[i];
}else{
kpiStr+=kpiArray[i]+",";
}
}
return kpiStr;
}
var provinceValue = getProvinceCheckedValuesString();
var businessValue = getBusinessCheckedValuesString();
var kpiValue = getKpiCheckedValuesString();
console.log("provinceValue:"+provinceValue+"businessValue:"+businessValue+"kpiValue:"+kpiValue)
</script>
</body>
......
......@@ -75,7 +75,7 @@
</div>
<table id="ruleResultTable" class="table table-hover table-striped">
</table>
<input type="hidden" id="qualityRuleView" name="qualityRuleView" value='${qualityRuleViewList}' />
<input type="hidden" id="qualityRuleView" name="qualityRuleView" value='${qualityRuleViewList}' />
</div>
</div>
......@@ -205,49 +205,8 @@ $("#createRule").click(function(){
cancelValue:"取消",
lock:true
});
//查看准确性规则
function lookParm(qualityRuleId){
$.dialog({
title:"准确性规则",
content:"<div id='paramList'>"+
"<div class='col-xs-12'><div class='panel panel-default'><div class='panel-heading'>参数列表</div><div class='panel-body'> <table class='table table-hover table-striped'> <thead> <tr> <th width='20%'>参数ID号</th> <th width='35%'>参数名</th> <th width='20%'>参数值</th> <th width='25%'>参数类型</th> </tr> </thead> <tbody> </tbody> </table> </div> </div> </div>"+
"</div>",
lock:true,
width:800,
initialize:function(){
$.ajax({
type : 'GET',
contentType : 'application/json',
url: "${ctx}/AnalysisSupport/QualityRuleResult/findAccuracy?qualityRuleId="+qualityRuleId,
dataType : 'text',
beforeSend: function(data) {
},
success: function(data){
for(var i=0;i<data.length;i++){
if(data[i]=='\"'){
data=data.replace('\"','\'');
}
}
data=eval("("+data+")");
if(data!=null && data!=""){
var paramTbody = $('#paramList tbody');
for(var i=0;i<data.length;i++){
if(data[i].parameterValue=="undefined" || data[i].parameterValue==null || data[i].parameterValue==""){
data[i].parameterValue="";
}
paramTbody.append($("<tr></tr>").append("<td>"+data[i].parameterId+"</td>")
.append("<td>"+data[i].parameterName+"</td>")
.append("<td>"+data[i].parameterValue+"</td>")
.append("<td>"+data[i].parameterDataType+"</td>"));
}
}
}
});
}
});
}
});
}
</script>
......
......@@ -87,7 +87,7 @@
</div>
<table id="modelResultTable" class="table table-hover table-striped">
</table>
<input type="hidden" id="dataModelView" name="dataModelView" value='${dataModelViewList}' />
<input type="hidden" id="dataModelView" name="dataModelView" value='${dataModelViewList}' />
</div>
</div>
</div>
......
......@@ -417,6 +417,7 @@ printStackTrace.implementation.prototype = {
a = a || this.createException();
b = b || this.mode(a);
if (b === "other") {
// noinspection JSAnnotator
return this.other(arguments.callee)
} else {
return this[b](a)
......
//格式化日期
function Format(){
this.jsjava_class="jsjava.text.Format";
this.jsjava_class="jsjava.text.Format";
}
function DateFormat(){
this.jsjava_class="jsjava.text.DateFormat";
this.jsjava_class="jsjava.text.DateFormat";
}
DateFormat.prototype=new Format();
DateFormat.prototype.constructor=DateFormat;
......@@ -15,105 +15,105 @@ DateFormat.en_us_month3=["Jan","Feb","Mar","Apr","May","Juh","Jul","Aug","Sep","
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.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();
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;
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";
this.jsjava_class="jsjava.text.SimpleDateFormat";
}
SimpleDateFormat.prototype=new DateFormat();
SimpleDateFormat.prototype.constructor=SimpleDateFormat;
SimpleDateFormat.prototype.applyPattern=function(pattern){
this.pattern=pattern;
this.pattern=pattern;
};
var df=new SimpleDateFormat();
......@@ -128,24 +128,25 @@ function ruleResultDetailTable(){
header[0] = ["","<input type='radio' name='update'id='update' onclick='javascript:radioChoose(this);'/>","1%",""];
header[1] = ["质量规则ID","qualityRuleId","7%","15"];
header[2] = ["数据来源","dataSourceName","7%","15"];
header[3] = ["渠道","channelName","7%","15"];
header[4] = ["业务","businessName","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[2] = ["数据来源","dataSourceId","7%","15"];
header[3] = ["渠道","channelId","7%","15"];
header[4] = ["业务","businessId","7%","15"];
header[5] = ["指标名称","kpiId","7%","15"];
header[6] = ["指标编码","kpiCode","7%","15"];
header[7] = ["数据类型","dataSourceId","7%","15"];
header[8] = ["数据采集频率","calCycle","7%","15"];
header[9] = ["指标监控时间","kpiMonitorTime","7%","15"];
header[10] = ["指标采集时间","businessTime","7%","15"];
header[11] = ["准确性规则","accuracyRuleId","7%","15"];
window.pagging = new table_pagging({limit:12,tableId:'ruleResultTable',header:header});
//pagging.pagging(jsonData);
pagging.pagging(jsonData);
}
var table_pagging = function() {
this.init.apply(this, arguments);
}
table_pagging.prototype = {
init : function(s) {
// 从第几个数据开始获取,缺省状态下从0开始显示
......@@ -311,20 +312,9 @@ table_pagging.prototype = {
}
}
if(k==11){
tdContext = "<a href='javascript:;' onclick='lookParm(\""+this.getData(this.objectlist[i],"qualityRuleId")+"\")'>查看参数</a>";
tdContext = "<a href='javascript:;' onclick='selectRule(\""+this.getData(this.objectlist[i],"qualityRuleId")+"\")'>查看规则</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>";
......@@ -342,15 +332,6 @@ table_pagging.prototype = {
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);
......@@ -543,4 +524,50 @@ table_pagging.prototype = {
ruleId=parseInt(obj[parseInt(clickObj.nextSibling.innerHTML)].qualityRuleId);
}
}
\ No newline at end of file
}
//查看准确性规则
function selectRule(qualityRuleId){
$.dialog({
title:"准确性规则",
content:"<div id='ruleList'>"+
"<div class='col-xs-12'><div class='panel panel-default'><div class='panel-heading'>规则参数列表</div><div class='panel-body'> <table class='table table-hover table-striped'> <thead> <tr> <th width='10%'>规则类型</th> <th width='15%'>范围最大值</th> <th width='15%'>范围最小值</th> <th width='15%'>重复考核粒度</th> <th width='15%'>重复考核开始时间</th> <th width='15%'>重复考核结束时间</th> <th width='15%'>重复是否连续</th> <th width='15%'>重复最大次数</th> <th width='15%'>数据是否累计</th> </tr> </thead> <tbody> </tbody> </table> </div> </div> </div>"+
"</div>",
lock:true,
width:800,
initialize:function(){
$.ajax({
type : 'GET',
contentType : 'application/json',
url: "/AnalysisSupport/QualityRuleResult/findAccuracy?qualityRuleId="+qualityRuleId,
dataType : 'text',
beforeSend: function(data) {
},
success: function(data) {
for (var i = 0; i < data.length; i++) {
if (data[i] == '\"') {
data = data.replace('\"', '\'');
}
}
data = eval("(" + data + ")");
if (data != null && data != "") {
var ruleTbody = $('#ruleList tbody');
for (var i = 0; i < data.length; i++) {
ruleTbody.append($("<tr></tr>").append("<td>" + data[i].ruleType + "</td>")
.append("<td>" + (data[i].scopeMaxValue == null ? "" : data[i].scopeMaxValue) + "</td>")
.append("<td>" + (data[i].scopeMinValue == null ? "" : data[i].scopeMinValue) + "</td>")
.append("<td>" + (data[i].repeatedCheckGranularity == null ? "" : data[i].repeatedCheckGranularity) + "</td>")
.append("<td>" + (data[i].repeatedCheckStartTime == null ? "" : data[i].repeatedCheckStartTime) + "</td>")
.append("<td>" + (data[i].repeatedCheckEndTime == null ? "" : data[i].repeatedCheckEndTime) + "</td>")
.append("<td>" + (data[i].ifRepeatedCheckSeries == null ? "" : data[i].ifRepeatedCheckSeries) + "</td>")
.append("<td>" + (data[i].repeatedCheckMaxTime == null ? "" : data[i].repeatedCheckMaxTime) + "</td>")
.append("<td>" + (data[i].ifRepeatedCheckSummation == null ? "" : data[i].ifRepeatedCheckSummation) + "</td>"));
}
}
}
});
}
});
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment