Commit c8358d99 authored by 胡斌's avatar 胡斌

Merge remote-tracking branch 'origin/liuna'

# Conflicts: # .idea/workspace.xml # src/main/java/com/hp/cmsz/web/analysissupport/FilterRuleMaintainController.java
parents 08503c0e 29444a6f
......@@ -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")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);
void updateAccuracyRuleByAccuracyRuleId(@Param("ruleType")String ruleType,@Param("scopeMaxValue")Double scopeMaxValue,@Param("scopeMinValue")Double scopeMinValue,@Param("repeatedCheckGranularity")String repeatedCheckGranularity,@Param("repeatedCheckStartTime")Date repeatedCheckStartTime,@Param("repeatedCheckEndTime")Date repeatedCheckEndTime,@Param("ifRepeatedCheckSeries")String ifRepeatedCheckSeries,@Param("repeatedCheckMaxTime")Long repeatedCheckMaxTime,@Param("ifRepeatedCheckSummation")String ifRepeatedCheckSummation,@Param("accuracyRuleId")Long accuracyRuleId);
//根据准确性规则ID删除一条准确性规则信息
@Modifying
......
......@@ -5,7 +5,9 @@ import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import sun.security.krb5.internal.Ticket;
import java.sql.Timestamp;
import java.util.Date;
import java.util.List;
......@@ -16,5 +18,5 @@ public interface QualityRuleInfoDao extends JpaSpecificationExecutor<QualityRule
List<QualityRuleInfo> findQualityRuleInfo();
//根据筛选项查找
List<QualityRuleInfo> findByBusinessTimeBetweenAndChannelIdInAndBusinessIdInAndProvinceIdInAndIfFilterInAndDataSourceIdInOrderByBusinessTimeDesc(Date time1, Date time2,List<Long> dataSource,List<Long> chnnal,List<Long> busines,List<Long> province,List<Long> ifFilter);
List<QualityRuleInfo> findByBusinessTimeBetweenAndDataSourceIdInAndChannelIdInAndBusinessIdInAndProvinceIdInAndIfFilterInOrderByBusinessTimeDesc(Timestamp time1, Timestamp time2, List<Long> dataSource, List<Long> chnnal, List<Long> busines, List<Long> province, List<Long> ifFilter);
}
......@@ -29,7 +29,7 @@ public class AccuracyRuleService {
//根据准确性规则ID更新准确性规则
@Transactional(readOnly=false)
public void updateAccuracyRuleByAccuracyRuleId(String ruleType,String scopeMaxValue,String scopeMinValue,String repeatedCheckGranularity,Date repeatedCheckStartTime,Date repeatedCheckEndTime,String ifRepeatedCheckSeries,Long repeatedCheckMaxTime,String ifRepeatedCheckSummation,Long accuracyRuleId){
public void updateAccuracyRuleByAccuracyRuleId(String ruleType,Double scopeMaxValue,Double scopeMinValue,String repeatedCheckGranularity,Date repeatedCheckStartTime,Date repeatedCheckEndTime,String ifRepeatedCheckSeries,Long repeatedCheckMaxTime,String ifRepeatedCheckSummation,Long accuracyRuleId){
accuracyRuleDao.updateAccuracyRuleByAccuracyRuleId(ruleType, scopeMaxValue, scopeMinValue, repeatedCheckGranularity, repeatedCheckStartTime, repeatedCheckEndTime, ifRepeatedCheckSeries, repeatedCheckMaxTime, ifRepeatedCheckSummation,accuracyRuleId);
}
......
package com.hp.cmsz.service.analysissupport;
import com.hp.cmsz.entity.QualityRuleInfo;
import com.hp.cmsz.entity.Time;
import com.hp.cmsz.repository.QualityRuleInfoDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.sql.Timestamp;
import java.util.Date;
import java.util.List;
......@@ -21,7 +23,7 @@ public class QualityRuleInfoService {
}
//根据筛选项获取质量规则
public List<QualityRuleInfo> getQualityRuleInfoBy(Date time1, Date time2,List<Long> dataSource,List<Long> chnnal,List<Long> busines,List<Long>province,List<Long> ifFilter){
return qualityRuleInfoDao.findByBusinessTimeBetweenAndChannelIdInAndBusinessIdInAndProvinceIdInAndIfFilterInAndDataSourceIdInOrderByBusinessTimeDesc(time1, time2,dataSource,chnnal,busines,province,ifFilter);
public List<QualityRuleInfo> getQualityRuleInfoBy(Timestamp time1 , Timestamp time2, List<Long> dataSource, List<Long> chnnal, List<Long> busines, List<Long>province, List<Long> ifFilter){
return qualityRuleInfoDao.findByBusinessTimeBetweenAndDataSourceIdInAndChannelIdInAndBusinessIdInAndProvinceIdInAndIfFilterInOrderByBusinessTimeDesc(time1, time2,dataSource,chnnal,busines,province,ifFilter);
}
}
......@@ -3,18 +3,16 @@ package com.hp.cmsz.web.analysissupport;
import java.util.List;
import java.util.Map;
import com.hp.cmsz.entity.Province;
import com.hp.cmsz.repository.ChannelDao;
import com.hp.cmsz.repository.DataSourceDao;
import com.hp.cmsz.repository.ProvinceDao;
import com.google.gson.Gson;
import com.hp.cmsz.entity.*;
import com.hp.cmsz.repository.*;
import com.hp.cmsz.service.BusinessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import com.hp.cmsz.web.PageURLController;
import javax.annotation.Resource;
/**
* 质量规则维护的新增过滤规则控制类
*
......@@ -26,23 +24,51 @@ import javax.annotation.Resource;
@RequestMapping(value="AnalysisSupport/FilterRuleMaintain")
public class FilterRuleMaintainController {
@Resource
@Autowired
private ProvinceDao provinceDao;
@Autowired
private ChannelDao channelDao;
@Autowired
private DataSourceDao dataSourceDao;
@Autowired
private ChannelDataSourceMapDao channelDataSourceMapDao;
@Autowired
private BusinessService businessService;
@RequestMapping(value = "")
public String filterMaintainHome(Map model){
@Autowired
private BusinessDao businessDao;
@Autowired
private KpiDao kpiDao;
List<Province> provinceList=(List<Province>)provinceDao.findProvince();
@Autowired
private DataTypeDao dataTypeDao;
@Autowired
private DataSourceDao dataSourceDao;
model.put("providerList", provinceList);
@RequestMapping(value = "")
public String filterMaintainHome(Map model){
//查询出所有的省份
List<Province> provinceList=(List<Province>)provinceDao.findProvince();
//查询出所有的渠道信息
List<Channel> channelList=(List<Channel>)channelDao.findChannel();
//查询出所有的指标
List<Kpi> kpiList=(List<Kpi>)kpiDao.findAll();
//查询出所有的业务
List<Object[]> businessList=(List<Object[]>)businessDao.findAllBusinessIdAndBusinessName();
//查询出所有的数据类型
List<DataType> dataTypeList= (List<DataType>)dataTypeDao.findAll();
//查询出所有的数据来源
List<DataSource> dataSourceList=(List<DataSource>)dataSourceDao.findAll();
Gson gson = new Gson();
model.put("provinceList", provinceList);
model.put("channelList", channelList);
model.put("kpiList", kpiList);
model.put("businessList", gson.toJson(businessList));
model.put("dataTypeList", dataTypeList);
model.put("dataSourceList", dataSourceList);
return PageURLController.FilterMaintain;
}
}
package com.hp.cmsz.web.analysissupport;
import java.io.IOException;
import java.io.PrintWriter;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
......@@ -8,6 +12,10 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.hp.cmsz.repository.*;
import com.hp.cmsz.service.BusinessService;
import com.hp.cmsz.service.CmszOperationLogService;
import com.hp.cmsz.service.analysissupport.QualityRuleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -24,14 +32,6 @@ import com.hp.cmsz.entity.DataType;
import com.hp.cmsz.entity.Kpi;
import com.hp.cmsz.entity.Province;
import com.hp.cmsz.entity.QualityRule;
import com.hp.cmsz.repository.AccuracyRuleDao;
import com.hp.cmsz.repository.BusinessDao;
import com.hp.cmsz.repository.ChannelDao;
import com.hp.cmsz.repository.DataSourceDao;
import com.hp.cmsz.repository.DataTypeDao;
import com.hp.cmsz.repository.KpiDao;
import com.hp.cmsz.repository.ProvinceDao;
import com.hp.cmsz.repository.QualityRuleDao;
import com.hp.cmsz.service.analysissupport.AccuracyRuleService;
import com.hp.cmsz.web.PageURLController;
......@@ -46,112 +46,220 @@ import com.hp.cmsz.web.PageURLController;
@RequestMapping(value="AnalysisSupport/QualityRuleConfiguration")
public class QualityRuleConfigurationController {
// @Autowired
// private ProvinceDao provinceDao;
//
// @Autowired
// private ChannelDao channelDao;
//
// @Autowired
// private BusinessDao businessDao;
//
// @Autowired
// private KpiDao kpiDao;
//
// @Autowired
// private DataTypeDao dataTypeDao;
//
// @Autowired
// private DataSourceDao dataSourceDao;
//
// @Autowired
// private QualityRuleDao qualityRuleDao;
//
//// @Autowired
//// private QualityRuleService qualityRuleService;
//
// @Autowired
// private AccuracyRuleDao accuracyRuleDao;
//
// @Autowired
// private AccuracyRuleService accuracyRuleService;
////
//// @Autowired
//// private CmszOperationLogService cmszOperationLogService;
//
// @RequestMapping(value = "")
// public String ruleMaintainHome(@RequestParam(value = "qualityRuleId", defaultValue ="") String qualityRuleId,
// Map model){
//
// QualityRule qualityRule = null;
// List<AccuracyRule> accuracyRuleList = null;
// if(!qualityRuleId.trim().equals("")){
// qualityRule = qualityRuleDao.findByQualityRuleId(Long.parseLong(qualityRuleId));
// accuracyRuleList = accuracyRuleDao.findByQualityRuleId(Long.parseLong(qualityRuleId));
// }
//
// //查询出所有的省份
// List<Province> provinceList=(List<Province>)provinceDao.findProvince();
// //查询出所有的渠道信息
// List<Channel> channelList=(List<Channel>)channelDao.findChannelWithoutAll();
// //查询出所有的指标
// List<Kpi> kpiList=(List<Kpi>)kpiDao.findAll();
// //查询出所有的业务
// List<Business> businessList=(List<Business>)businessDao.findAll();
// //查询出所有的数据类型
// List<DataType> dataTypeList= (List<DataType>)dataTypeDao.findAll();
// //查询出所有的数据来源
// List<DataSource> dataSourceList=(List<DataSource>)dataSourceDao.findAll();
// Gson gson = new Gson();
// model.put("provinceList", provinceList);
// model.put("channelList", channelList);
// model.put("kpiList", kpiList);
// model.put("businessList", gson.toJson(businessList));
// model.put("dataTypeList", dataTypeList);
// model.put("dataSourceList", dataSourceList);
//
// return PageURLController.RuleConfiguration;
// }
//
// //修改准确性规则信息
// @RequestMapping(value = "/updateAccuracyRule*",method=RequestMethod.GET)
// @ResponseBody
// public void updateParameter(
// @RequestParam(value="ruleType") String ruleType,
// @RequestParam(value="scopeMaxValue") double scopeMaxValue,
// @RequestParam(value="scopeMinValue") double scopeMinValue,
// @RequestParam(value="repeatedCheckGranularity") String repeatedCheckGranularity,
// @RequestParam(value="repeatedCheckStartTime") Date repeatedCheckStartTime,
// @RequestParam(value="repeatedCheckEndTime") Date repeatedCheckEndTime,
// @RequestParam(value="ifRepeatedCheckSeries") String ifRepeatedCheckSeries,
// @RequestParam(value="repeatedCheckMaxTime") Long repeatedCheckMaxTime,
// @RequestParam(value="ifRepeatedCheckSummation") String ifRepeatedCheckSummation,
// @RequestParam(value="qualityRuleId")String qualityRuleId,
// @RequestParam(value="accuracyRuleId")String accuracyRuleId){
//
// if(qualityRuleId.trim().equals("")){
// AccuracyRule accuracyRule = new AccuracyRule();
// accuracyRule.setAccuracyRuleId(Long.parseLong(qualityRuleId));
// accuracyRule.setRuleType(ruleType);
// accuracyRule.setScopeMinValue(scopeMaxValue);
// accuracyRule.setScopeMinValue(scopeMinValue);
// accuracyRule.setRepeatedCheckGranularity(repeatedCheckGranularity);
// accuracyRule.setRepeatedCheckStartTime(repeatedCheckStartTime);
// accuracyRule.setRepeatedCheckEndTime(repeatedCheckEndTime);
// accuracyRule.setIfRepeatedCheckSeries(ifRepeatedCheckSeries);
// accuracyRule.setRepeatedCheckMaxTime(repeatedCheckMaxTime);
// accuracyRule.setIfRepeatedCheckSummation(ifRepeatedCheckSummation);
//
// accuracyRuleDao.save(accuracyRule);
// }else{
// accuracyRuleService.updateAccuracyRuleByAccuracyRuleId(ruleType, scopeMaxValue, scopeMinValue, repeatedCheckGranularity, repeatedCheckStartTime, repeatedCheckEndTime, ifRepeatedCheckSeries, repeatedCheckMaxTime, ifRepeatedCheckSummation, Long.parseLong(accuracyRuleId));;
// }
//
// }
@Autowired
private ProvinceDao provinceDao;
@Autowired
private ChannelDao channelDao;
@Autowired
private ChannelDataSourceMapDao channelDataSourceMapDao;
@Autowired
private BusinessService businessService;
@Autowired
private BusinessDao businessDao;
@Autowired
private KpiDao kpiDao;
@Autowired
private DataTypeDao dataTypeDao;
@Autowired
private DataSourceDao dataSourceDao;
@Autowired
private QualityRuleDao qualityRuleDao;
@Autowired
private QualityRuleService qualityRuleService;
@Autowired
private AccuracyRuleDao accuracyRuleDao;
@Autowired
private AccuracyRuleService accuracyRuleService;
@Autowired
private CmszOperationLogService cmszOperationLogService;
private String staticQualityRuleId = "";
private Double staticScopeMaxValue = 0.00;
private Double staticScopeMinValue = 0.00;
@RequestMapping(value = "")
public String ruleMaintainHome(@RequestParam(value = "qualityRuleId", defaultValue ="") String qualityRuleId,
Map model){
staticQualityRuleId = qualityRuleId;
QualityRule qualityRule = null;
List<AccuracyRule> accuracyRuleList = null;
if(!qualityRuleId.trim().equals("")){
qualityRule = qualityRuleDao.findByQualityRuleId(Long.parseLong(qualityRuleId));
accuracyRuleList = accuracyRuleDao.findByQualityRuleId(Long.parseLong(qualityRuleId));
}
//查询出所有的省份
List<Province> provinceList=provinceDao.findProvince();
//查询出所有的渠道信息
List<Channel> channelList=channelDao.findChannel();
//查询出所有的指标
List<Kpi> kpiList=(List<Kpi>)kpiDao.findAll();
//查询出所有的业务
List<Object[]> businessList=businessDao.findAllBusinessIdAndBusinessName();
//查询出所有的数据类型
List<DataType> dataTypeList= (List<DataType>)dataTypeDao.findAll();
//查询出所有的数据来源
List<DataSource> dataSourceList=(List<DataSource>)dataSourceDao.findAll();
Gson gson = new Gson();
model.put("provinceList", provinceList);
model.put("channelList", channelList);
model.put("kpiList", kpiList);
model.put("businessList", gson.toJson(businessList));
model.put("dataTypeList", dataTypeList);
model.put("dataSourceList", dataSourceList);
return PageURLController.RuleConfiguration;
}
@RequestMapping(value = "/findBusinessId*")
@ResponseBody
public void datasource_select(@RequestParam(value = "dataSource", defaultValue ="" ) String dataSource,
@RequestParam(value = "channel", defaultValue ="" ) String channel,
HttpServletResponse response) {
System.out.println(dataSource);
List<Object []> resultList = new ArrayList<Object []>();
List<Object[]> list = (List<Object[]>)businessDao.findBusinessIdAndBusinessNameByDataSourceIdAndChannelIdWithIsActive(Long.parseLong(channel),Long.parseLong(dataSource));
for(int i=0;i<list.size();i++){
Object[] objs = list.get(i);
//将重复的业务名的Id写在同一个对象中
for(int j=0;j<list.size();j++){
if(i == j){}else{
Object[] objs1 = list.get(j);
if(objs[1].equals(objs1[1])){
objs[0] = objs[0] +","+ objs1[0];
list.remove(j);
j--;
}
}
}
resultList.add(objs);
}
Gson gson = new Gson();
response.setContentType("text/Xml;chartset=gbk");
PrintWriter out = null;
try{
out = response.getWriter();
out.println(gson.toJson(resultList));
}
catch(IOException ex){
ex.printStackTrace();
}
finally{
out.close();
}
}
@RequestMapping(value="/findKpiId*")
@ResponseBody
public void findKpiId(@RequestParam(value = "businessIds", defaultValue ="" ) String businessIds,
@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++) {
businessIdlist.add(Long.valueOf(strs[i]));
}
List<Object[]> businessKpiList = (List<Object[]>)kpiDao.findKpiIdAndKpiNameByBusinessIds(businessIdlist,calCycleValue);
Gson gson = new Gson();
response.setContentType("text/Xml;charset=gbk");
PrintWriter out = null;
try {
out = response.getWriter();
out.println(gson.toJson(businessKpiList));
}
catch (IOException ex1) {
ex1.printStackTrace();
}finally{ out.close(); }
}
//删除准确性规则信息
@RequestMapping(value = "/deleteAccuracyRule*",method=RequestMethod.GET)
@ResponseBody
public void deleteParameter(@RequestParam(value = "accuracyRuleId", defaultValue ="") String accuracyRuleId,
@RequestParam(value = "qualityRuleId", defaultValue ="") String qualityRuleId){
if(!accuracyRuleId.trim().equals("")){
accuracyRuleService.deleteAccuracyRuleByAccuracyRuleId(Long.parseLong(accuracyRuleId));
}
if(!qualityRuleId.trim().equals("")){
accuracyRuleService.deleteAccuracyRuleByOneQualityRuleId(Long.parseLong(qualityRuleId));
}
}
//修改准确性规则信息
@RequestMapping(value = "/updateAccuracyRule*",method=RequestMethod.GET)
@ResponseBody
public void updateParameter(
@RequestParam(value="ruleType") String ruleType,
@RequestParam(value="scopeMaxValue") double scopeMaxValue,
@RequestParam(value="scopeMinValue") double scopeMinValue,
@RequestParam(value="repeatedCheckGranularity") String repeatedCheckGranularity,
@RequestParam(value="repeatedCheckStartTime") Date repeatedCheckStartTime,
@RequestParam(value="repeatedCheckEndTime") Date repeatedCheckEndTime,
@RequestParam(value="ifRepeatedCheckSeries") String ifRepeatedCheckSeries,
@RequestParam(value="repeatedCheckMaxTime") Long repeatedCheckMaxTime,
@RequestParam(value="ifRepeatedCheckSummation") String ifRepeatedCheckSummation,
@RequestParam(value="qualityRuleId")String qualityRuleId,
@RequestParam(value="accuracyRuleId")String accuracyRuleId){
if(qualityRuleId.trim().equals("")){
AccuracyRule accuracyRule = new AccuracyRule();
accuracyRule.setAccuracyRuleId(Long.parseLong(qualityRuleId));
if (ruleType == "1") {
accuracyRule.setRuleType("范围");
} else if (ruleType == "2") {
accuracyRule.setRuleType("重复");
}
accuracyRule.setScopeMinValue(String.valueOf(scopeMaxValue));
accuracyRule.setScopeMinValue(String.valueOf(scopeMinValue));
accuracyRule.setRepeatedCheckGranularity(repeatedCheckGranularity);
accuracyRule.setRepeatedCheckStartTime(repeatedCheckStartTime);
accuracyRule.setRepeatedCheckEndTime(repeatedCheckEndTime);
accuracyRule.setIfRepeatedCheckSeries(ifRepeatedCheckSeries);
accuracyRule.setRepeatedCheckMaxTime(repeatedCheckMaxTime);
accuracyRule.setIfRepeatedCheckSummation(ifRepeatedCheckSummation);
accuracyRuleDao.save(accuracyRule);
}else{
staticScopeMaxValue= Double.parseDouble(String.valueOf(scopeMaxValue));
staticScopeMinValue= Double.parseDouble(String.valueOf(scopeMinValue));
accuracyRuleService.updateAccuracyRuleByAccuracyRuleId(ruleType, staticScopeMaxValue, staticScopeMinValue, repeatedCheckGranularity, repeatedCheckStartTime, repeatedCheckEndTime, ifRepeatedCheckSeries, repeatedCheckMaxTime, ifRepeatedCheckSummation, Long.parseLong(accuracyRuleId));;
}
}
@RequestMapping()
public String updateQualityRuleForm() {
@RequestMapping(value = "/updateQualityRuleForm",method=RequestMethod.POST)
public String updateQualityRuleForm(@RequestParam(value="businessid") String businessId,
@RequestParam(value="provinceid") String provinceId,
@RequestParam(value="channelid") String channelId,
@RequestParam(value="dataSourceid") String dataSourceId,
@RequestParam(value="kpiid") String kpiId,
@RequestParam(value="kpiMonitorTime") String kpiMonitorTime,
@RequestParam(value="businessTime") String businessTime,
HttpServletResponse response, HttpServletRequest request) throws ParseException {
System.out.println("businessId"+businessId+"provinceid"+provinceId+"channelId"+channelId+"dataSourceId"+dataSourceId+"kpi"+kpiId+"kpiMonitorTime"+kpiMonitorTime+"businessTime"+businessTime);
SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return PageURLController.RuleConfiguration;
}
}
......@@ -193,121 +193,105 @@ public class QualityRuleMaintainController {
@RequestParam(value="ifRepeatedCheckSeries") String ifRepeatedCheckSeries,
@RequestParam(value="repeatedCheckMaxTime") String repeatedCheckMaxTime,
@RequestParam(value="ifRepeatedCheckSummation") String ifRepeatedCheckSummation,
HttpServletResponse response,HttpServletRequest request) {
HttpServletResponse response,HttpServletRequest request) {
System.out.println("ruleType"+ruleType);
SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
AccuracyRule accuracyRule = new AccuracyRule();
if(!ruleType.trim().equals("")) {
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 (!scopeMaxValue.trim().equals("")) {
accuracyRule.setScopeMaxValue(scopeMaxValue);
}
}
if(!repeatedCheckEndTime.trim().equals("")){
try {
accuracyRule.setRepeatedCheckEndTime(sd.parse(repeatedCheckEndTime));
} catch (ParseException e) {
e.printStackTrace();
if (!scopeMinValue.trim().equals("")) {
accuracyRule.setScopeMinValue(scopeMinValue);
}
}
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());
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);
accuracyRuleDao.save(accuracyRule);
Long qualityRuleId = accuracyRule.getAccuracyRuleId();
qualityRuleIdList.add(qualityRuleId);
Long qualityRuleId = accuracyRule.getAccuracyRuleId();
qualityRuleIdList.add(qualityRuleId);
}
}
//新增质量模型
@RequestMapping(value = "/saveRuleDataForm", method = RequestMethod.POST)
public String saveRuleDataForm(
// @RequestParam(value="channel") String channel,
// @RequestParam(value="dataSource") String dataSourceId,
// @RequestParam(value="kpiMonitorTime") String kpiMonitorTime,
// @RequestParam(value="businessTime") String businessTime,
// @RequestParam(value="ruleCrtTime") String ruleCrtTime,
// @RequestParam(value="ruleUpdateTime") String ruleUpdateTime,
HttpServletResponse response,HttpServletRequest request) throws ParseException{
// String province = request.getParameter("province");
// String businessValue = request.getParameter("businessinput");
String channel =request.getParameter("channel");
// String dataSourceId =request.getParameter("dataSource");
// String kpiValue = request.getParameter("kpiinput");
// String kpiMonitorTime=request.getParameter("kpiMonitorTime");
// String businessTime=request.getParameter("businessTime");
// String ruleCrtTime=request.getParameter("ruleCrtTime");
// String ruleUpdateTime=request.getParameter("ruleUpdateTime");
// String provinceId = "";
// String businessId = "";
// String kpiId = "";
//新增质量模型
@RequestMapping(value = "/saveRuleDataForm", method = RequestMethod.POST)
public String saveRuleDataForm (@RequestParam(value="businessinput") String business,
@RequestParam(value="province") String province,
@RequestParam(value="channel") String channel,
@RequestParam(value="dataSource") String dataSourceId,
@RequestParam(value="kpiinput") String kpi,
@RequestParam(value="kpiUnit") String kpiUnit,
@RequestParam(value="kpiMonitorTime") String kpiMonitorTime,
@RequestParam(value="businessTime") String businessTime,
HttpServletResponse response, HttpServletRequest request) throws ParseException {
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<province.split(",").length;i++){
// provinceIdList.add(Long.parseLong(province.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 = String.valueOf(provinceIdList.get(j));
// businessId = String.valueOf(businessIdList.get(k));
// kpiId = String.valueOf(kpiIdList.get(l));
// if(!provinceId.trim().equals("")){qualityRule.setProvinceId(Long.parseLong(provinceId));}
// if(!businessId.trim().equals("")){qualityRule.setBusinessId(Long.parseLong(businessId));}
// if(!kpiId.trim().equals("")){qualityRule.setKpiId(Long.parseLong(kpiId));}
qualityRule.setProvinceId(Long.parseLong("1"));
qualityRule.setBusinessId(Long.parseLong("1490"));
qualityRule.setKpiId(Long.parseLong("2411"));
if(!channel.trim().equals("")){
qualityRule.setChannelId(Long.parseLong(channel));
}
//if(!dataSourceId.trim().equals("")){
qualityRule.setDataSourceId(Long.parseLong("7"));
//}
//if(!kpiMonitorTime.trim().equals("")){
qualityRule.setKpiMonitorTime("4");
//}
qualityRule.setKpiMonitorRunTime(Timestamp.valueOf(sd.format(new Date())));
//if(!businessTime.trim().equals("")){
qualityRule.setBusinessTime(Timestamp.valueOf(sd.format(new Date())));
//}
qualityRule.setRuleCrtTime(Timestamp.valueOf(sd.format(new Date())));
qualityRule.setRuleUpdateTime(Timestamp.valueOf(sd.format(new Date())));
qualityRule.setRuleValidFlag("0");
qualityRule.setIfSystemValue("0");
System.out.println("qualityRule"+qualityRule);
qualityRuleDao.save(qualityRule);
// }
// }
// }
cmszOperationLogService.createLog("增加","新建质量模型","quality_rule_warehouse_info_t. QUALITY_RULE_ID="+ qualityRule.getQualityRuleId().toString());
Long qualityRuleId = qualityRule.getQualityRuleId();
return "redirect:AnalysisSupport/QualityRuleResult";
}
System.out.println("0000"+kpiUnit);
SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
List<Long> provinceIdList = new ArrayList<Long>();
for(int i=0;i<province.split(",").length;i++){
provinceIdList.add(Long.parseLong(province.split(",")[i]));
}
List<Long> businessIdList = new ArrayList<Long>();
for(int i=0;i<business.split(",").length;i++){
businessIdList.add(Long.parseLong(business.split(",")[i]));
}
List<Long> kpiIdList = new ArrayList<Long>();
for(int i=0;i<kpi.split(",").length;i++){
kpiIdList.add(Long.parseLong(kpi.split(",")[i]));
}
for(int j=0; j<provinceIdList.size(); j++) {
for(int l=0; l<kpiIdList.size(); l++){
QualityRule qualityRule = new QualityRule();
qualityRule.setProvinceId(provinceIdList.get(j));
qualityRule.setKpiId(kpiIdList.get(l));
if(!channel.trim().equals("")){ qualityRule.setChannelId(Long.parseLong(channel)); }
if(!dataSourceId.trim().equals("")){ qualityRule.setDataSourceId(Long.parseLong(dataSourceId)); }
if(!kpiMonitorTime.trim().equals("")){ qualityRule.setKpiMonitorTime(kpiMonitorTime); }
qualityRule.setKpiMonitorRunTime(Timestamp.valueOf(sd.format(new Date())));
if(!businessTime.trim().equals("")){ qualityRule.setBusinessTime(Timestamp.valueOf(businessTime)); }
qualityRule.setRuleCrtTime(Timestamp.valueOf(sd.format(new Date())));
qualityRule.setRuleUpdateTime(Timestamp.valueOf(sd.format(new Date())));
qualityRule.setRuleValidFlag("0");
qualityRule.setIfSystemValue("0");
qualityRuleDao.save(qualityRule);
cmszOperationLogService.createLog("增加", "新建质量模型", "quality_rule_warehouse_info_t. QUALITY_RULE_ID=" + qualityRule.getQualityRuleId().toString());
Long qualityRuleId = qualityRule.getQualityRuleId();
}
}
return "redirect:/AnalysisSupport/QualityRuleResult";
}
}
......@@ -18,10 +18,12 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.sql.Timestamp;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
......@@ -97,7 +99,7 @@ public class QualityRuleOperationController {
}
//根据筛选项搜索
@RequestMapping(value = "/changeTable*", method = RequestMethod.POST)
@RequestMapping(value = "/operationChangeTable*", method = RequestMethod.GET)
@ResponseBody
public void changeTable(@RequestParam(value = "period") String period,// 时间
@RequestParam(value = "dataSource") String dataSource,// 数据来源
......@@ -106,23 +108,24 @@ public class QualityRuleOperationController {
@RequestParam(value = "province") String province,//省份
@RequestParam(value = "ifFilter") String ifFilter,//是否过滤
HttpServletResponse response) throws ParseException, UnsupportedEncodingException {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
cmszOperationLogService.createLog("查询","质量规则运营查询","质量规则运营页面查询");
List<QualityRuleInfo> qualityRuleInfoList;
String[] time=period.split("~");
String[] dates=period.split("~");
String[] dataSourceS=dataSource.split(",");
String[] chnnalS=chnnal.split(",");
String[] bussinesS =bussines.split(",");
String[] provinceS=province.split(",");
String[] ifFilterS=province.split(",");
Date time1=sdf.parse(time[0]);
Date time2=sdf.parse(time[1]);
String[] ifFilterS=ifFilter.split(",");
Timestamp time1=new Timestamp(format.parse(dates[0]).getTime());
Timestamp time2=new Timestamp(format.parse(dates[1]).getTime());
List<Long> dataSourceList=changeStrToList(dataSourceS);
List<Long> chnnalList=changeStrToList(chnnalS);
List<Long> bussinesList=changeStrToList(bussinesS);
List<Long> provinceList=changeStrToList(provinceS);
List<Long> ifFilterList=changeStrToList(ifFilterS);
System.out.println("qualityRule:"+time1+time2+"data"+dataSourceList+"busin"+bussinesList+"procin"+provinceList+"if"+ifFilterList);
qualityRuleInfoList = qualityRuleInfoService.getQualityRuleInfoBy(time1,time2,dataSourceList,chnnalList,bussinesList,provinceList,ifFilterList);
Gson gson = new Gson();
response.setContentType("text/Xml;charset=gbk");
......
......@@ -7,14 +7,14 @@
<div id="ws" class="slide-menu-option">
<label>是否过滤</label>
<select class="slide-menu-select" id="ifFilter" name="ifFilter">
<option value="'1'" title="是"><a href="#">是</a></option>
<option value="'0'" title="否"><a href="#">否</a></option>
<option value="0,1" title="全部"selected><a href="#">全部</a></option>
<option value="1" title="是"><a href="#">是</a></option>
<option value="0" title="否"><a href="#">否</a></option>
</select>
</div>
<script type="text/javascript">
//获取其被选中的value,若是0则代表不是关键配置,若是1则代表是关键配置
function getIfFilter(){
return $("#ifFilter").val();
}
......@@ -25,6 +25,6 @@
}
function RelFilterRest() {
$("#ifFilter").val("1");
$("#ifFilter").val("0,1");
}
</script>
\ No newline at end of file
......@@ -53,16 +53,48 @@
<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>
<td>
<c:forEach var="province" items="${provinceList}">
<input type="checkbox" name="province" id="province" value="${province.provinceId}" checked>${province.provinceName}
</c:forEach>
</td>
</tr>
<tr><td>数据来源(<font color="red">必填</font>):</td>
<td>
<select class="form-control" name="dataSource" id="dataSource" >
<c:forEach var="dataSource" items="${dataSourceList}">
<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><tags:ChannelTag /></td>
<td><select class="form-control" name="channel" id="channel" >
<c:forEach var="channel" items="${channelList}">
<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><tags:BusinessTag /></td>
<td >
<div id="businesstd"></div>
</td>
</tr>
<tr><td>数据来源(<font color="red">必填</font>):</td>
<td><tags:DataSourceTag /></td>
<tr><td>指标(<font color="red">必填</font>):</td>
<td>
<div id="kpitd"></div>
</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> -->
......@@ -96,5 +128,139 @@ $(".ifRepeate").change(function (){
$(".period").show();
}
})
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();
updateBusiness(dataSourceValue,channelValue);
});
$("#channel").change(function(){
channelValue = $("#channel").val();
updateBusiness(dataSourceValue,channelValue);
});
function updateKpi(businessIds){
$.ajax({
type : "GET",
contentType : "application/json",
url: "${ctx}/AnalysisSupport/QualityRuleMaintain/findKpiId?businessIds="+businessIds,
async: false,
beforeSend: function(data) {},
success: function(data){
var td = $("#kpitd");
td.empty();
data = JSON.parse(data)
data.forEach(function(t){
td.append("<input type='checkbox' name='kpiinput' class='kpiItem' value='"+t[0]+"' checked >"+t[1]+"</input>")
});
}
});
}
function updateBusiness(dataSource,channel){
$.ajax({
type : "GET",
contentType : "application/json",
url: "${ctx}/AnalysisSupport/QualityRuleMaintain/findBusinessId?dataSource="+dataSource+"&channel="+channel,
async: false,
beforeSend: function(data) {},
success: function(data){
var td = $("#businesstd");
var businessIds = new Array();
td.empty();
data = JSON.parse(data)
data.forEach(function(t){
td.append("<input type='checkbox' name='businessinput' class='businessItem' value='"+t[0]+"' checked >"+t[1]+"</input>")
businessIds+=t[0]+",";
});
updateKpi(businessIds);
}
});
$(".businessItem").click(function(){
businessIds="";
$("[name='businessinput']:checked").each(function (){
businessIds += $(this).val()+",";
});
updateKpi(businessIds);
});
}
updateBusiness($("#dataSource").val(),$("#channel").val());
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;
}
</script>
\ No newline at end of file
......@@ -6,7 +6,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>质量规则维护</title>
<title>数据质量规则维护</title>
<style>
.table-null .table{
margin-bottom: 0px;
......@@ -38,7 +38,7 @@
<ol class="breadcrumb">
<li><a href="${ctx}/index">首页</a></li>
<li>数据质量核查</li>
<li class="active">质量规则维护</li>
<li class="active">数据质量规则维护</li>
</ol>
</div>
<div id="main-container main-tab-container">
......@@ -49,78 +49,121 @@
<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>
<div class="table-header">数据质量规则更新</div>
<form action="#" class="form-horizontal" id="ruleUpdateForm" method="post">
<table id="ruleMaintainTable" class="table-null">
<tr><td>省份(<font color="red">必填</font>):</td>
<td>
<c:forEach var="province" items="${provinceList}">
<input type="checkbox" name="province" id="province" value="${province.provinceId}" checked>${province.provinceName}
</c:forEach>
</td>
</tr>
<tr><td>数据来源(<font color="red">必填</font>):</td>
<td>
<select class="form-control" name="dataSource" id="dataSource" >
<c:forEach var="dataSource" items="${dataSourceList}">
<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}">
<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>
</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>
</td>
</tr>
<tr><td>指标监控时间(<font color="red">必填</font>):</td>
<td>
<input type="text" style="width:200px" name="kpiMonitorTime" id="kpiMonitorTime" style="display: inline;" />
<select style="width:200px" name="kpiUnit" id="kpiUnit" style="display: inline;">
<option value="0">分钟</option>
<option value="1">小时</option>
<option value="2"></option>
<option value="3"></option>
</select></td>
</tr>
<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>添加准确性规则:</td>
<td><table class="table table-hover table-striped" id="displayParam">
<thead>
<tr><th>规则类型</th><th>范围最大值</th><th>范围最小值</th><th>重复考核粒度</th><th>重复考核开始时间</th><th>重复考核结束时间</th><th>重复是否连续</th><th>重复最大次数</th><th>数据是否累计</th><th><a href="javascript:deleteAllTr()">删除所有规则</a></th></tr>
</thead>
<tbody id="addTr"></tbody>
</table></td></tr>
<tr><td>准确性规则类型:</td>
<td><select class="form-control" name="ruleType" id="ruleType" >
<option value=""></option>
<option value="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><select class="form-control" name='repeatedCheckGranularity' id='repeatedCheckGranularity'>
<option value="day" selected></option>
<option value="mon"></option>
</select>
</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><select name='ifRepeatedCheckSeries' id='ifRepeatedCheckSeries' class="form-control">
<option value="1" selected></option>
<option value="0"></option>
</select>
</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><select name='ifRepeatedCheckSummation' id='ifRepeatedCheckSummation' class="form-control">
<option value="1" selected></option>
<option value="0"></option>
</select>
</td></tr>
<tr><td></td>
<td><button type="button" id="addParam" class="btn btn-primary">添加规则</button></td></tr>
<tr><td></td><td><button type="button" id="ruleSubmit" class="btn btn-primary">确定</button>
<button type="reset" class="btn btn-warning" id="ruleBack">返回</button>
</td></tr>
</table>
</table>
</form>
<input type="hidden" id="kpi" name="kpi" value='${kpiList}' />
<input type="hidden" id="business" name="business" value='${businessList}' />
</div>
</div>
</div>
......@@ -128,28 +171,388 @@
</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>
<script type="text/javascript">
$(".range").hide();
$(".repeate").hide();
$("#addParam").hide();
$("#ruleType").change(function (){
var selectValue = $("#ruleType").val();
if (selectValue == ""){
$(".range").hide();
$(".repeate").hide();
$("#addParam").hide();
}
if (selectValue == 1){
$(".repeate").hide();
$(".range").show();
$("#addParam").show();
}
if (selectValue == 2){
$(".range").hide();
$(".repeate").show();
$("#addParam").show();
}
});
//删除所有准确性规则
function deleteAllTr(){
$("#addTr").empty();
}
//删除一条准确性规则
function deleteRow(elementTag){
$(elementTag).parent().parent().remove();
}
//添加/修改准确性规则
$("#addParam").click(function(){
var ruleType= $("#ruleType").val();
var scopeMaxValue = $.trim($("#scopeMaxValue").val());
var scopeMinValue = $.trim($("#scopeMinValue").val());
var repeatedCheckGranularity = $.trim($("#repeatedCheckGranularity").val());
var repeatedCheckStartTime = $.trim($("#repeatedCheckStartTime").val());
var repeatedCheckEndTime = $.trim($("#repeatedCheckEndTime").val());
var ifRepeatedCheckSeries = $.trim($("#ifRepeatedCheckSeries").val());
var repeatedCheckMaxTime = $.trim($("#repeatedCheckMaxTime").val());
var ifRepeatedCheckSummation = $.trim($("#ifRepeatedCheckSummation").val());
if(ruleType == "1" || ruleType == "2"){
if(ruleType == "1"){
if(scopeMaxValue==""){$.alert("范围最大值不能为空");}
if(scopeMinValue==""){$.alert("范围最小值不能为空");}
repeatedCheckGranularity ="无";
repeatedCheckStartTime ="无";
repeatedCheckEndTime ="无";
ifRepeatedCheckSeries ="无";
repeatedCheckMaxTime ="无";
ifRepeatedCheckSummation ="无";
} else if(ruleType == "2"){
if(repeatedCheckGranularity==""){$.alert("重复考核粒度不能为空");}
if(repeatedCheckStartTime==""){$.alert("重复考核开始时间不能为空");}
if(repeatedCheckEndTime==""){$.alert("重复考核结束时间不能为空");}
if(ifRepeatedCheckSeries==""){$.alert("重复是否连续不能为空");}
if(repeatedCheckMaxTime==""){$.alert("重复最大次数不能为空");}
if(ifRepeatedCheckSummation==""){$.alert("数据是否累计不能为空");}
scopeMaxValue ="无";
scopeMinValue ="无";
}
if($("#addTr").find("tr.orange-tr").html()==null){
var addRow = $("<tr><td>"+ruleType+"</td><td>"+scopeMaxValue+"</td><td>"+scopeMinValue+"</td><td>"+repeatedCheckGranularity+"</td><td>"+repeatedCheckStartTime+"</td><td>"+repeatedCheckEndTime+"</td><td>"+ifRepeatedCheckSeries+"</td><td>"+repeatedCheckMaxTime+"</td><td>"+ifRepeatedCheckSummation+"</td><td><a href='javascript:;' title='' onclick='deleteRow(this)'>删除</a></td></tr>");
$("#addTr").append(addRow);
$("#ruleType").attr("value","");
$("#scopeMaxValue").attr("value","");
$("#scopeMinValue").attr("value","");
$("#repeatedCheckGranularity").attr("value","");
$("#repeatedCheckStartTime").attr("value","");
$("#repeatedCheckEndTime").attr("value","");
$("#ifRepeatedCheckSeries").attr("value","");
$("#repeatedCheckMaxTime").attr("value","");
$("#ifRepeatedCheckSummation").attr("value","");
}else{
var findTr = $("#addTr").find("tr.orange-tr");
$(findTr).find("td").eq(0).html(ruleType);
$(findTr).find("td").eq(1).html(scopeMaxValue);
$(findTr).find("td").eq(2).html(scopeMinValue);
$(findTr).find("td").eq(3).html(repeatedCheckGranularity);
$(findTr).find("td").eq(4).html(repeatedCheckStartTime);
$(findTr).find("td").eq(5).html(repeatedCheckEndTime);
$(findTr).find("td").eq(6).html(ifRepeatedCheckSeries);
$(findTr).find("td").eq(7).html(repeatedCheckMaxTime);
$(findTr).find("td").eq(8).html(ifRepeatedCheckSummation);
$("#addTr").find("tr").removeClass();
$("#addParam").text("添加规则");
}
}
});
//form表单提交
$("#ruleSubmit").click(function(){
if($.trim($("#kpiMonitorTime").val())==""){
$.alert("指标监控时间不能为空");
}else if($("#businessTime").val()==""){
$.alert("指标业务时间不能为空");
}else if($("#ruleCrtTime").val()==""){
$.alert("规则创建时间不能为空");
}else if($("#ruleUpdateTime").val()==""){
$.alert("规则更新时间不能为空");
}else{
if($.trim($("#ruleType").val())=="1" || $.trim($("#ruleType").val())=="2"){
$.dialog({
title: "提醒",
content: "有准确性规则参数尚未添加,确定提交",
ok: function(){
$("#ruleSubmit").attr("disabled",true);
var i = $("#addTr").find("tr").size();
if(i==0){
var createForm=$("#ruleMaintainForm");
createForm.attr("action","${ctx}/AnalysisSupport/QualityRuleMaintain/saveRuleDataForm");
createForm.submit();
createForm.attr("action","#");
}else{
$("#addTr").find("tr").each(function(){
var ruleType = $(this).find("td").eq(0).html();
var scopeMaxValue = $(this).find("td").eq(1).html();
var scopeMinValue = $(this).find("td").eq(2).html();
var repeatedCheckGranularity = $(this).find("td").eq(3).html();
var repeatedCheckStartTime = $(this).find("td").eq(4).html();
var repeatedCheckEndTime = $(this).find("td").eq(5).html();
var ifRepeatedCheckSeries = $(this).find("td").eq(6).html();
var repeatedCheckMaxTime = $(this).find("td").eq(7).html();
var ifRepeatedCheckSummation = $(this).find("td").eq(8).html();
if(scopeMaxValue =="无"){scopeMaxValue ="";}
if(scopeMinValue =="无"){scopeMinValue ="";}
if(repeatedCheckGranularity =="无"){repeatedCheckGranularity ="";}
if(repeatedCheckStartTime =="无"){repeatedCheckStartTime ="";}
if(repeatedCheckEndTime ="无"){repeatedCheckEndTime ="";}
if(ifRepeatedCheckSeries =="无"){ifRepeatedCheckSeries ="";}
if(repeatedCheckMaxTime =="无"){repeatedCheckMaxTime ="";}
if(ifRepeatedCheckSummation =="无"){ifRepeatedCheckSummation ="";}
$.ajax({
type : "GET",
contentType : "application/json",
url: "${ctx}/AnalysisSupport/QualityRuleMaintain/createAccuracyRule?ruleType="+ruleType+"&scopeMaxValue="+scopeMaxValue+"&scopeMinValue="+scopeMinValue+"&repeatedCheckGranularity="+repeatedCheckGranularity+"&repeatedCheckStartTime="+repeatedCheckStartTime+"&repeatedCheckEndTime="+repeatedCheckEndTime+"&scopeMinValue="+ifRepeatedCheckSeries+"&ifRepeatedCheckSeries="+repeatedCheckMaxTime+"&repeatedCheckMaxTime="+ifRepeatedCheckSummation+"&ifRepeatedCheckSummation=",
dataType : "text",
async: false,
beforeSend: function(data) {},
success: function(){
i--;
if(i==0){
var createForm=$("#ruleMaintainForm");
createForm.attr("action","${ctx}/AnalysisSupport/QualityRuleMaintain/saveRuleDataForm");
createForm.submit();
createForm.attr("action","#");
}
}
});
});
}
},
okValue: "确定",
cancel: function(){},
cancelValue: "取消",
});
}else{
$("#ruleSubmit").attr("disabled",true);
var i = $("#addTr").find("tr").size();
if(i==0){
var createForm=$("#ruleMaintainForm");
createForm.attr("action","${ctx}/AnalysisSupport/QualityRuleMaintain/saveRuleDataForm");
createForm.submit();
createForm.attr("action","#");
}else{
$("#addTr").find("tr").each(function(){
var ruleType = $(this).find("td").eq(0).html();
var scopeMaxValue = $(this).find("td").eq(1).html();
var scopeMinValue = $(this).find("td").eq(2).html();
var repeatedCheckGranularity = $(this).find("td").eq(3).html();
var repeatedCheckStartTime = $(this).find("td").eq(4).html();
var repeatedCheckEndTime = $(this).find("td").eq(5).html();
var ifRepeatedCheckSeries = $(this).find("td").eq(6).html();
var repeatedCheckMaxTime = $(this).find("td").eq(7).html();
var ifRepeatedCheckSummation = $(this).find("td").eq(8).html();
if(scopeMaxValue =="无"){scopeMaxValue ="";}
if(scopeMinValue =="无"){scopeMinValue ="";}
if(repeatedCheckGranularity =="无"){repeatedCheckGranularity ="";}
if(repeatedCheckStartTime =="无"){repeatedCheckStartTime ="";}
if(repeatedCheckEndTime ="无"){repeatedCheckEndTime ="";}
if(ifRepeatedCheckSeries =="无"){ifRepeatedCheckSeries ="";}
if(repeatedCheckMaxTime =="无"){repeatedCheckMaxTime ="";}
if(ifRepeatedCheckSummation =="无"){ifRepeatedCheckSummation ="";}
$.ajax({
type : "GET",
contentType : "application/json",
url: "${ctx}/AnalysisSupport/QualityRuleMaintain/createAccuracyRule?ruleType="+ruleType+"&scopeMaxValue="+scopeMaxValue+"&scopeMinValue="+scopeMinValue+"&repeatedCheckGranularity="+encodeURIComponent(repeatedCheckGranularity)+"&repeatedCheckStartTime="+encodeURIComponent(repeatedCheckStartTime)+"&repeatedCheckEndTime="+encodeURIComponent(repeatedCheckEndTime)+"&ifRepeatedCheckSeries="+ifRepeatedCheckSeries+"&repeatedCheckMaxTime="+repeatedCheckMaxTime+"&ifRepeatedCheckSummation="+ifRepeatedCheckSummation,
dataType : "text",
async: false,
beforeSend: function(data) {},
success: function(){
i--;
if(i==0){
var createForm=$("#ruleMaintainForm");
createForm.attr("action","${ctx}/AnalysisSupport/QualityRuleMaintain/saveRuleDataForm");
createForm.submit();
createForm.attr("action","#");
}
}
});
});
}
}
}
});
$("#ruleBack").click(function(){
location.href="${ctx}/AnalysisSupport/QualityRuleResult";
});
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();
updateBusiness(dataSourceValue,channelValue);
});
$("#channel").change(function(){
channelValue = $("#channel").val();
updateBusiness(dataSourceValue,channelValue);
});
function updateKpi(businessIds,calCycleValue){
$.ajax({
type : "GET",
contentType : "application/json",
url: "${ctx}/AnalysisSupport/QualityRuleMaintain/findKpiId?businessIds="+businessIds+"&calCycleValue="+calCycleValue,
async: false,
beforeSend: function(data) {},
success: function(data){
var td = $("#kpitd");
td.empty();
data = JSON.parse(data)
data.forEach(function(t){
td.append("<input type='checkbox' name='kpiinput' class='kpiItem' value='"+t[0]+"' checked >"+t[1]+"</input>")
});
}
});
}
function updateBusiness(dataSource,channel){
$.ajax({
type : "GET",
contentType : "application/json",
url: "${ctx}/AnalysisSupport/QualityRuleMaintain/findBusinessId?dataSource="+dataSource+"&channel="+channel,
async: false,
beforeSend: function(data) {},
success: function(data){
var td = $("#businesstd");
var businessIds = new Array();
td.empty();
data = JSON.parse(data)
data.forEach(function(t){
td.append("<input type='checkbox' name='businessinput' class='businessItem' value='"+t[0]+"' checked >"+t[1]+"</input>")
businessIds+=t[0]+",";
});
updateKpi(businessIds,calCycleValue);
}
});
$(".businessItem").click(function(){
businessIds="";
$("[name='businessinput']:checked").each(function (){
businessIds += $(this).val()+",";
});
updateKpi(businessIds,calCycleValue);
});
}
$("#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>
</html>
\ No newline at end of file
......@@ -6,7 +6,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>质量规则维护</title>
<title>数据质量规则维护</title>
<style>
.table-null .table{
margin-bottom: 0px;
......@@ -31,7 +31,7 @@
<ol class="breadcrumb">
<li><a href="${ctx}/index">首页</a></li>
<li>数据质量核查</li>
<li class="active">质量规则维护</li>
<li class="active">数据质量规则维护</li>
</ol>
</div>
<div id="main-container main-tab-container">
......@@ -42,8 +42,8 @@
<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">
<div class="table-header">数据质量规则上传</div>
<form action="#" class="form-horizontal" id="ruleMaintainForm" method="post">
<table id="ruleMaintainTable" class="table-null">
<tr><td>省份(<font color="red">必填</font>):</td>
<td>
......@@ -100,7 +100,7 @@
<tr><td>指标监控时间(<font color="red">必填</font>):</td>
<td>
<input type="text" style="width:200px" name="kpiMonitorTime" id="kpiMonitorTime" style="display: inline;" />
<select style="width:200px" name="kpiUnit" id="kpiUnit" style="display: inline;">
<select name="kpiUnit" id="kpiUnit">
<option value="0">分钟</option>
<option value="1">小时</option>
<option value="2"></option>
......@@ -127,12 +127,27 @@
</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><select class="form-control" name='repeatedCheckGranularity' id='repeatedCheckGranularity'>
<option value="day" selected></option>
<option value="mon"></option>
</select>
</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><select name='ifRepeatedCheckSeries' id='ifRepeatedCheckSeries' class="form-control">
<option value="1" selected></option>
<option value="0"></option>
</select>
</td></tr>
<tr class="repeate"><td>重复最大次数:</td><td><input type='text' name='repeatedCheckMaxTime' id='repeatedCheckMaxTime' class="form-control" style="display: inline;"/></td></tr>
<tr class="repeate"><td>数据是否累计:</td><td><input type='text' name='ifRepeatedCheckSummation' id='ifRepeatedCheckSummation' class="form-control" style="display: inline;"/></td></tr>
<tr class="repeate"><td>数据是否累计:</td>
<td><select name='ifRepeatedCheckSummation' id='ifRepeatedCheckSummation' class="form-control">
<option value="1" selected></option>
<option value="0"></option>
</select>
</td></tr>
<tr><td></td>
<td><button type="button" id="addParam" class="btn btn-primary">添加规则</button></td></tr>
<tr><td></td><td><button type="button" id="ruleSubmit" class="btn btn-primary">确定</button>
......@@ -171,8 +186,79 @@ $("#ruleType").change(function (){
$(".repeate").show();
$("#addParam").show();
}
})
});
//删除所有准确性规则
function deleteAllTr(){
$("#addTr").empty();
}
//删除一条准确性规则
function deleteRow(elementTag){
$(elementTag).parent().parent().remove();
}
//添加/修改准确性规则
$("#addParam").click(function(){
var ruleType= $("#ruleType").val();
var scopeMaxValue = $.trim($("#scopeMaxValue").val());
var scopeMinValue = $.trim($("#scopeMinValue").val());
var repeatedCheckGranularity = $.trim($("#repeatedCheckGranularity").val());
var repeatedCheckStartTime = $.trim($("#repeatedCheckStartTime").val());
var repeatedCheckEndTime = $.trim($("#repeatedCheckEndTime").val());
var ifRepeatedCheckSeries = $.trim($("#ifRepeatedCheckSeries").val());
var repeatedCheckMaxTime = $.trim($("#repeatedCheckMaxTime").val());
var ifRepeatedCheckSummation = $.trim($("#ifRepeatedCheckSummation").val());
if(ruleType == "1" || ruleType == "2"){
if(ruleType == "1"){
if(scopeMaxValue==""){$.alert("范围最大值不能为空");}
if(scopeMinValue==""){$.alert("范围最小值不能为空");}
repeatedCheckGranularity ="无";
repeatedCheckStartTime ="无";
repeatedCheckEndTime ="无";
ifRepeatedCheckSeries ="无";
repeatedCheckMaxTime ="无";
ifRepeatedCheckSummation ="无";
} else if(ruleType == "2"){
if(repeatedCheckGranularity==""){$.alert("重复考核粒度不能为空");}
if(repeatedCheckStartTime==""){$.alert("重复考核开始时间不能为空");}
if(repeatedCheckEndTime==""){$.alert("重复考核结束时间不能为空");}
if(ifRepeatedCheckSeries==""){$.alert("重复是否连续不能为空");}
if(repeatedCheckMaxTime==""){$.alert("重复最大次数不能为空");}
if(ifRepeatedCheckSummation==""){$.alert("数据是否累计不能为空");}
scopeMaxValue ="无";
scopeMinValue ="无";
}
if($("#addTr").find("tr.orange-tr").html()==null){
var addRow = $("<tr><td>"+ruleType+"</td><td>"+scopeMaxValue+"</td><td>"+scopeMinValue+"</td><td>"+repeatedCheckGranularity+"</td><td>"+repeatedCheckStartTime+"</td><td>"+repeatedCheckEndTime+"</td><td>"+ifRepeatedCheckSeries+"</td><td>"+repeatedCheckMaxTime+"</td><td>"+ifRepeatedCheckSummation+"</td><td><a href='javascript:;' title='' onclick='deleteRow(this)'>删除</a></td></tr>");
$("#addTr").append(addRow);
$("#ruleType").attr("value","");
$("#scopeMaxValue").attr("value","");
$("#scopeMinValue").attr("value","");
$("#repeatedCheckGranularity").attr("value","");
$("#repeatedCheckStartTime").attr("value","");
$("#repeatedCheckEndTime").attr("value","");
$("#ifRepeatedCheckSeries").attr("value","");
$("#repeatedCheckMaxTime").attr("value","");
$("#ifRepeatedCheckSummation").attr("value","");
}else{
var findTr = $("#addTr").find("tr.orange-tr");
$(findTr).find("td").eq(0).html(ruleType);
$(findTr).find("td").eq(1).html(scopeMaxValue);
$(findTr).find("td").eq(2).html(scopeMinValue);
$(findTr).find("td").eq(3).html(repeatedCheckGranularity);
$(findTr).find("td").eq(4).html(repeatedCheckStartTime);
$(findTr).find("td").eq(5).html(repeatedCheckEndTime);
$(findTr).find("td").eq(6).html(ifRepeatedCheckSeries);
$(findTr).find("td").eq(7).html(repeatedCheckMaxTime);
$(findTr).find("td").eq(8).html(ifRepeatedCheckSummation);
$("#addTr").find("tr").removeClass();
$("#addParam").text("添加规则");
}
}
});
//form表单提交
$("#ruleSubmit").click(function(){
if($.trim($("#kpiMonitorTime").val())==""){
......@@ -184,7 +270,7 @@ $("#ruleType").change(function (){
}else if($("#ruleUpdateTime").val()==""){
$.alert("规则更新时间不能为空");
}else{
if($.trim($("#ruleType").val())!=""){
if($.trim($("#ruleType").val())=="1" || $.trim($("#ruleType").val())=="2"){
$.dialog({
title: "提醒",
content: "有准确性规则参数尚未添加,确定提交",
......@@ -209,6 +295,14 @@ $("#ruleType").change(function (){
var ifRepeatedCheckSeries = $(this).find("td").eq(6).html();
var repeatedCheckMaxTime = $(this).find("td").eq(7).html();
var ifRepeatedCheckSummation = $(this).find("td").eq(8).html();
if(scopeMaxValue =="无"){scopeMaxValue ="";}
if(scopeMinValue =="无"){scopeMinValue ="";}
if(repeatedCheckGranularity =="无"){repeatedCheckGranularity ="";}
if(repeatedCheckStartTime =="无"){repeatedCheckStartTime ="";}
if(repeatedCheckEndTime ="无"){repeatedCheckEndTime ="";}
if(ifRepeatedCheckSeries =="无"){ifRepeatedCheckSeries ="";}
if(repeatedCheckMaxTime =="无"){repeatedCheckMaxTime ="";}
if(ifRepeatedCheckSummation =="无"){ifRepeatedCheckSummation ="";}
$.ajax({
type : "GET",
contentType : "application/json",
......@@ -253,10 +347,18 @@ $("#ruleType").change(function (){
var ifRepeatedCheckSeries = $(this).find("td").eq(6).html();
var repeatedCheckMaxTime = $(this).find("td").eq(7).html();
var ifRepeatedCheckSummation = $(this).find("td").eq(8).html();
if(scopeMaxValue =="无"){scopeMaxValue ="";}
if(scopeMinValue =="无"){scopeMinValue ="";}
if(repeatedCheckGranularity =="无"){repeatedCheckGranularity ="";}
if(repeatedCheckStartTime =="无"){repeatedCheckStartTime ="";}
if(repeatedCheckEndTime ="无"){repeatedCheckEndTime ="";}
if(ifRepeatedCheckSeries =="无"){ifRepeatedCheckSeries ="";}
if(repeatedCheckMaxTime =="无"){repeatedCheckMaxTime ="";}
if(ifRepeatedCheckSummation =="无"){ifRepeatedCheckSummation ="";}
$.ajax({
type : "GET",
contentType : "application/json",
url: "${ctx}/AnalysisSupport/QualityRuleMaintain/createAccuracyRule?ruleType="+ruleType+"&scopeMaxValue="+scopeMaxValue+"&scopeMinValue="+scopeMinValue+"&repeatedCheckGranularity="+repeatedCheckGranularity+"&repeatedCheckStartTime="+repeatedCheckStartTime+"&repeatedCheckEndTime="+repeatedCheckEndTime+"&scopeMinValue="+ifRepeatedCheckSeries+"&ifRepeatedCheckSeries="+repeatedCheckMaxTime+"&repeatedCheckMaxTime="+ifRepeatedCheckSummation+"&ifRepeatedCheckSummation=",
url: "${ctx}/AnalysisSupport/QualityRuleMaintain/createAccuracyRule?ruleType="+ruleType+"&scopeMaxValue="+scopeMaxValue+"&scopeMinValue="+scopeMinValue+"&repeatedCheckGranularity="+encodeURIComponent(repeatedCheckGranularity)+"&repeatedCheckStartTime="+encodeURIComponent(repeatedCheckStartTime)+"&repeatedCheckEndTime="+encodeURIComponent(repeatedCheckEndTime)+"&ifRepeatedCheckSeries="+ifRepeatedCheckSeries+"&repeatedCheckMaxTime="+repeatedCheckMaxTime+"&ifRepeatedCheckSummation="+ifRepeatedCheckSummation,
dataType : "text",
async: false,
beforeSend: function(data) {},
......@@ -382,7 +484,7 @@ 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 ]}})'/>");
$("#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 ]},'minDate:HH:00:00','maxDate:HH:30:00'})'/>");
}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"){
......@@ -441,7 +543,6 @@ function getKpiCheckedValuesString(){
var provinceValue = getProvinceCheckedValuesString();
var businessValue = getBusinessCheckedValuesString();
var kpiValue = getKpiCheckedValuesString();
console.log("provinceValue:"+provinceValue+"businessValue:"+businessValue+"kpiValue:"+kpiValue)
</script>
......
......@@ -102,7 +102,7 @@
ruleOperationDetailTable();
function operResultSubmit(){
var period=getPeriodStr();
var period=getPeriodStr()
var dataSource=getStatsDataSourceCheckedValuesString();
var chnnal=getStatsChannelCheckedValuesString();
var bussines=getStatsBusinessCheckedValuesString();
......@@ -142,7 +142,7 @@
$.ajax({
type : 'GET',
contentType : 'application/json',
url: "${ctx}/AnalysisSupport/QualityRuleOperation/changeTable?period="+period+"&province="+province+"&dataSource="+dataSource+"&chnnal="+chnnal+"&bussines="+bussines+"&ifFilter="+ifFilter,
url: "${ctx}/AnalysisSupport/QualityRuleOperation/operationChangeTable?period="+period+"&province="+province+"&dataSource="+dataSource+"&chnnal="+chnnal+"&bussines="+bussines+"&ifFilter="+ifFilter,
dataType : 'text',
async: false,
beforeSend: function(data) {
......
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