Package com.sogou.qadev.service.cynthia.bean

Examples of com.sogou.qadev.service.cynthia.bean.Template


      Data task = allDatas[i];
      if (task == null) {
        continue;
      }
      if (templateMap.get(task.getTemplateId()) == null) {
        Template template = das.queryTemplate(task.getTemplateId());
        if (template != null) {
          templateMap.put(task.getTemplateId(), template);
        }
      }
     
      Template template = templateMap.get(task.getTemplateId());
     
      if (flowMap.get(template.getFlowId()) == null) {
        Flow flow = das.queryFlow(template.getFlowId());
        if (flow != null) {
          flowMap.put(flow.getId(), flow);
        }
      }
     
      Flow flow = flowMap.get(template.getFlowId());
     
     
      Map<String, String> displayMap = FilterQueryManager.getShowFieldValueMap(displayNames , task , template ,flow ,das ,ExportType.excel , userAliasMap ,isSysFilter);
     
      HSSFRow dataRow = sheet.createRow((short)(i+1));
View Full Code Here


       Data task = allDatas[i];
      if (task == null) {
        continue;
      }
      if (templateMap.get(task.getTemplateId()) == null) {
        Template template = das.queryTemplate(task.getTemplateId());
        if (template != null) {
          templateMap.put(task.getTemplateId(), template);
        }
      }
     
      Template template = templateMap.get(task.getTemplateId());
     
      if (flowMap.get(template.getFlowId()) == null) {
        Flow flow = das.queryFlow(template.getFlowId());
        if (flow != null) {
          flowMap.put(flow.getId(), flow);
        }
      }
     
      Flow flow = flowMap.get(template.getFlowId());
     
      Map<String, String> displayMap = FilterQueryManager.getShowFieldValueMap(displayNames , task , template ,flow ,das ,ExportType.excel , userAliasMap ,isSysFilter);
     
      plainBuffer.append(task.getId().getValue());
     
View Full Code Here

   * @return
   */
  protected Map<String, String> createMapByTaskFieldValue(Data task,DataAccessSession das) {
    Map<String, String> dataMap = new HashMap<String, String>();

    Template template = das.queryTemplate(task.getTemplateId());
    if (template == null)
      return dataMap;

    for (Field field : template.getFields()) {
      if (field.getType().equals(Type.t_selection)) {
        if (field.getDataType().equals(DataType.dt_single)) {
          UUID optionId = task.getSingleSelection(field.getId());
          if (optionId != null) {
            Option option = field.getOption(optionId);
View Full Code Here

    Map<String, Map<String, Integer>> resultMap = new LinkedHashMap<String, Map<String, Integer>>();
    if (templateId == null || roleIdStr == null || roleActionIds.equals("")) {
      return resultMap;
    }
   
    Template template = das.queryTemplate(templateId);
    if (template == null) {
      return resultMap;
    }
   
    Flow flow = das.queryFlow(template.getFlowId());
    if (flow == null) {
      return resultMap;
    }
   
    Map<String, String> userMap = new LinkedHashMap<String, String>();
View Full Code Here

 
  public boolean checkUserPrivilege(Data data, DataAccessAction action){
    if (data == null) {
      return false;
    }
    Template template = queryTemplate(data.getTemplateId());
    if (template == null) {
      return false;
    }
    Flow flow = queryFlow(template.getFlowId());
    if (flow == null) {
      return false;
    }
    return checkUserPrivilege(data, action, template, flow);
  }
View Full Code Here

   
    String idSql = DataFilterMemory.getQuerySql(tablesList, queryFieldSet, whereStr, orderFieldMap, isCurrent,templateId, queryConList);
    List<Map<String , String>> allIdMap = DbPoolConnection.getInstance().getResultSetListBySql(idSql);
    StringBuffer idBuffer = new StringBuffer();
   
    Template bugTemplate = null//任务对应缺陷bugId,目前默认任务与bug一对一关系
    for (Map<String, String> map : allIdMap) {
      for (String value : map.values()) {
        if (value == null)
          continue;
        if (bugTemplate == null) {
          String[] valueArr = value.split(",");
          if (valueArr != null && valueArr.length > 0) {
            try {
              Data data  = das.queryData(DataAccessFactory.getInstance().createUUID(valueArr[0]));
              if (data != null) {
                bugTemplate = das.queryTemplate(data.getTemplateId());
              }
            } catch (Exception e) {
            }
          }
        }
        idBuffer.append( idBuffer.length() > 0 ? ",":"").append(value);
      }
    }
   
    if (bugTemplate == null || idBuffer.equals("")) {
      return resultMap;
    }
   
    //数据库名
    String dataLogTable = TableRuleManager.getInstance().getDataLogTableName(bugTemplate.getId());
       
    StringBuffer sqlBuffer = new StringBuffer();
    sqlBuffer.append("SELECT dataId, ").append(fieldStaticColName).append(", date_format(logcreateTime,'%Y-%m-%d') as logcreateTime from ")
    .append(dataLogTable).append(" where is_valid = 1 and templateId=").append(bugTemplate.getId().getValue()).append(" and dataId in (").append(idBuffer.toString()).append(")").append(" and logcreateTime >= '").append(startTimestamp.toString().split(" ")[0])
    .append("' and logcreateTime <= '").append(endTimestamp.toString().split(" ")[0]).append("' order by dataid,logActionIndex");
   
    resultMap = BugTrendManager.getStatStaticMap(sqlBuffer.toString(), statMap , resultMap);
   
    String whereString = " id in (" + idBuffer.toString() + ")" ;
View Full Code Here

    }
  }
 
  public Data addData(UUID templateId)
  {
    Template template = queryTemplate(templateId);
    if (template == null)
      return null;

    UUID dataId = DataAccessFactory.getInstance().newUUID("DATA");
    newUUIDTable.put(dataId, false);
View Full Code Here

  public Pair<ErrorCode, String> modifyData(Data data)
  {
    UUID id = data.getId();
    DataAccessAction action = null;
   
    Template template = queryTemplate(data.getTemplateId());
    if(template == null)
      return new Pair<ErrorCode, String>(ErrorCode.noSuchTemplateFail, null);
   
    Flow flow = queryFlow(template.getFlowId());
    if(flow == null)
      return new Pair<ErrorCode, String>(ErrorCode.noSuchTemplateFail, null);
   
    if ((newUUIDTable.containsKey(id) && !newUUIDTable.get(id))||(!this.isDataExist(id)))
      action = DataAccessAction.insert;
View Full Code Here

    return TemplateCache.getInstance().queryField(fieldId);
  }
 
  public Field queryField(UUID fieldId , UUID templateId)
  {
    Template template = TemplateCache.getInstance().get(templateId);
    if (template == null) {
      return null;
    }
    return template.getField(fieldId);
  }
View Full Code Here

    return template.getField(fieldId);
  }
 
  public Option queryOption(UUID optionId ,UUID templateId)
  {
    Template template = TemplateCache.getInstance().get(templateId);
    return queryOption(optionId, template);
  }
View Full Code Here

TOP

Related Classes of com.sogou.qadev.service.cynthia.bean.Template

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.