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

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


        -- Map String 统计字段名
        -- Map Integer 统计数据
     */
    Map<String, Map<String, Integer>> resultMap = new LinkedHashMap<String, Map<String, Integer>>();
   
    Template template = das.queryTemplate(taskData.getTemplateId());
    if (template == null) {
      return resultMap;
    }
   
    Field multiReferField = findMultiReferField(template);
    if (multiReferField == null) {
      return resultMap;
    }
   
    Template bugTemplate = null;
   
    UUID[] taskReferUUIDArray = taskData.getMultiReference(multiReferField.getId());
    if(taskReferUUIDArray == null || taskReferUUIDArray.length == 0)
      return resultMap;
   
    for (UUID uuid : taskReferUUIDArray) {
      Data data = das.queryData(uuid);
      if (data!=null) {
        bugTemplate = das.queryTemplate(data.getTemplateId());
      }
      if (bugTemplate != null) {
        break;
      }
    }
   
    if (bugTemplate == null) {
      System.out.println("can not find bugTemplate in BugTrendManager ! dataId :" + taskData.getId().getValue() );
      return resultMap;
    }
   
    StringBuffer allIdBuffer = new StringBuffer();
    for (UUID uuid : taskReferUUIDArray) {
      allIdBuffer.append(uuid.getValue()).append(",");
    }
    if (allIdBuffer.length() > 1) {
      allIdBuffer = allIdBuffer.deleteCharAt(allIdBuffer.length() -1);
    }
    //数据库名
    String dataLogTable = TableRuleManager.getInstance().getDataLogTableName(bugTemplate.getId());
   
    for(long i = startTimestamp.getTime(); i <= endTimestamp.getTime(); i += 86400000l){
      String date = new Timestamp(i).toString().split(" ")[0];
      resultMap.put(date, new LinkedHashMap<String, Integer>());
    }
View Full Code Here


   * @return
   * @see com.sogou.qadev.service.cynthia.service.impl.AbstractScriptAccessSession#queryScriptsInternal(com.sogou.qadev.service.cynthia.bean.Data, com.sogou.qadev.service.cynthia.bean.ExecuteTime, com.sogou.qadev.service.cynthia.service.DataAccessSession)
   */
  protected Script[] queryScriptsInternal(Data data, ExecuteTime executeTime, DataAccessSession das)
  {
    Template template = das.queryTemplate(data.getTemplateId());
    if(template == null)
      return null;
   
    Flow flow = das.queryFlow(template.getFlowId());
    if(flow == null)
      return null;
   
    Action action = null;
    if(data.getObject("logActionId") != null)
    {
      action = flow.getAction((UUID)data.getObject("logActionId"));
      if(action == null)
        return null;
    }
   
    StringBuffer sqlStrb = new StringBuffer();
    sqlStrb.append("SELECT * FROM script_new WHERE 1=1");
   
    sqlStrb.append(" AND (template_type_ids IS NULL");
    sqlStrb.append(" OR template_type_ids LIKE '%").append(template.getTemplateTypeId()).append("%')");
   
    sqlStrb.append(" AND (template_ids IS NULL");
    sqlStrb.append(" OR template_ids LIKE '%").append(template.getId()).append("%')");
   
    sqlStrb.append(" AND (flow_ids IS NULL");
    sqlStrb.append(" OR flow_ids LIKE '%").append(flow.getId()).append("%')");
   
    sqlStrb.append(" AND (end_stat_ids IS NULL");
View Full Code Here

        for(Node templateNode : templateNodeList){
          String templateIdStr = XMLUtil.getAttribute(templateNode, "id");
          UUID templateId = DataAccessFactory.getInstance().createUUID(templateIdStr);

          if (allTemplateMap.get(templateId) == null) {
            Template tmp = das.queryTemplate(templateId);
            allTemplateMap.put(templateId, tmp);
          }
          Template template = allTemplateMap.get(templateId);
          if(template != null){
            templateList.add(template);
          }
        }
      }

      boolean filterAllow = false;

      for(Template template : templateList){
        if(templateAllowMap.containsKey(template.getId())){
          if(templateAllowMap.get(template.getId())){
            filterAllow = true;
            break;
          }

          continue;
        }

        if (allFlowMap.get(template.getFlowId()) == null) {
          Flow tmp = das.queryFlow(template.getFlowId());
          allFlowMap.put(template.getFlowId(), tmp);
        }
       
        Flow flow = allFlowMap.get(template.getFlowId());
       
        if(flow == null){
          templateAllowMap.put(template.getId(), false);
          continue;
        }

        Role[] roleArray = flow.queryUserNodeRoles(user, template.getId());
        if(roleArray != null && roleArray.length > 0){
          filterAllow = true;
          templateAllowMap.put(template.getId(), true);
          break;
        }

        if(flow.isActionEveryoneRole(Action.readUUID) || flow.isActionEveryoneRole(Action.editUUID)){
          filterAllow = true;
          templateAllowMap.put(template.getId(), true);
          break;
        }

        Action[] actionArray = flow.getActions();
        if(actionArray != null){
          for(Action action : actionArray){
            if(flow.isActionEveryoneRole(action.getId())){
              filterAllow = true;
              templateAllowMap.put(template.getId(), true);
              break;
            }
          }
        }

        if(filterAllow){
          break;
        }

        templateAllowMap.put(template.getId(), false);
      }

      if(!filterAllow)
        filterItr.remove();
    }
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.