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

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


   * @param createUser
   * @return
   */
  public Timer createTimer(String createUser)
  {
    UUID id = DataAccessFactory.getInstance().newUUID("TIME");
    Timestamp createTime = new Timestamp(System.currentTimeMillis());
    return new TimerImpl(id, createUser, createTime);
  }
View Full Code Here


      pstm.setString(1, createUser);

      rst = pstm.executeQuery();
      while(rst.next())
      {
        UUID id = DataAccessFactory.getInstance().createUUID(rst.getObject("id").toString());
        Timestamp createTime = rst.getTimestamp("create_time");

        Timer timer = new TimerImpl(id, createUser, createTime);

        timer.setName(rst.getString("name"));
View Full Code Here

      pstm = conn.prepareStatement("SELECT * FROM timer");

      rst = pstm.executeQuery();
      while(rst.next())
      {
        UUID id = DataAccessFactory.getInstance().createUUID(rst.getObject("id").toString());
        String createUser = rst.getString("create_user");
        Timestamp createTime = rst.getTimestamp("create_time");

        Timer timer = new TimerImpl(id, createUser, createTime);

View Full Code Here

      pstm.setLong(1, Long.parseLong(filterId.getValue()));

      rst = pstm.executeQuery();
      while(rst.next())
      {
        UUID id = DataAccessFactory.getInstance().createUUID(rst.getObject("id").toString());
        Timestamp createTime = rst.getTimestamp("create_time");
        String createUser = rst.getString("create_user");

        Timer timer = new TimerImpl(id, createUser, createTime);
View Full Code Here

      pstm.setLong(1, Long.parseLong(timerActionId.getValue()));

      rst = pstm.executeQuery();
      while(rst.next())
      {
        UUID id = DataAccessFactory.getInstance().createUUID(rst.getObject("id").toString());
        String createUser = rst.getString("create_user");
        Timestamp createTime = rst.getTimestamp("create_time");

        Timer timer = new TimerImpl(id, createUser, createTime);
View Full Code Here

   */
  public static void adjustWhereNode(Document doc , Node node){
   
    Node envNode = XMLUtil.getSingleNode(doc, "query/env");
    String idStr = XMLUtil.getAttribute(node, "id");
    UUID id = DataAccessFactory.getInstance().createUUID(idStr);
    String type = XMLUtil.getAttribute(node, "type");
    List<Flow> allFlows = null;
    //where fields
    Node whereNode = XMLUtil.getSingleNode(node, "where");
   
    if(whereNode != null){
   
      List<Node> whereFieldNodeList = XMLUtil.getNodes(whereNode, "field");
      for(Node whereFieldNode : whereFieldNodeList){
        String fieldId = XMLUtil.getAttribute(whereFieldNode, "id");
        String fieldMethod = XMLUtil.getAttribute(whereFieldNode, "method");
        String fieldType = XMLUtil.getAttribute(whereFieldNode, "type");
        String fieldDataType = XMLUtil.getAttribute(whereFieldNode, "dataType");
        String fieldValue = whereFieldNode.getTextContent();
       
        if(fieldValue.startsWith("$") && fieldValue.endsWith("$")){
          List<Node> defineNodeList = XMLUtil.getNodes(envNode, fieldValue.substring(1, fieldValue.length() - 1));
          if(defineNodeList.size() == 0){
            continue;
          }
         
          if(defineNodeList.size() == 1){
            whereFieldNode.setTextContent(defineNodeList.get(0).getTextContent());
          }
          else{
            Node leftNode = doc.createElement("condition");
            leftNode.setTextContent("(");
            whereNode.insertBefore(leftNode, whereFieldNode);
           
            if(fieldMethod.equals("!=")){
              Node newFieldNode = whereFieldNode.cloneNode(true);
              XMLUtil.setAttribute(newFieldNode, "method", "is null");
              whereNode.insertBefore(newFieldNode, whereFieldNode);
             
              Node orNode = doc.createElement("condition");
              orNode.setTextContent("or");
              whereNode.insertBefore(orNode, whereFieldNode);
            }
           
            for(int i = 0; i < defineNodeList.size(); i++){
              if(i > 0){
                Node relationNode = doc.createElement("condition");
                if(fieldMethod.equals("=")){
                  relationNode.setTextContent("or");
                }
                else if(fieldMethod.equals("!=")){
                  relationNode.setTextContent("and");
                }
               
                whereNode.insertBefore(relationNode, whereFieldNode);
              }
             
              Node newFieldNode = whereFieldNode.cloneNode(true);
              newFieldNode.setTextContent(defineNodeList.get(i).getTextContent());
              whereNode.insertBefore(newFieldNode, whereFieldNode);
            }
           
            //(
            Node rightNode = doc.createElement("condition");
            rightNode.setTextContent(")");
            whereNode.insertBefore(rightNode, whereFieldNode);
           
            whereNode.removeChild(whereFieldNode);
          }
        }
       
        if(fieldId.equals("status_id") && (fieldValue.equals("[逻辑开始]") || fieldValue.equals("[逻辑关闭]"))){
          StringBuffer statusIdStrb = new StringBuffer();
          List<Flow> flowList = new ArrayList<Flow>();
         
          if(type.equals("tt")){
            if (allFlows == null) {
              allFlows = FlowCache.getInstance().getAll();
            }
            if (allFlows == null) {
              continue;
            }
           
            flowList.addAll(allFlows);
           
          }else if(type.equals("t")){
            Template template = TemplateCache.getInstance().get(id);
            if(template == null){
              continue;
            }
            Flow flow = FlowCache.getInstance().get(template.getFlowId());
            if (flow == null) {
              continue;
            }
            flowList.add(flow);
          }
         
          for(Flow flow : flowList){
            if(flow == null){
              continue;
            }
           
            if(fieldValue.equals("[逻辑开始]") && flow.getBeginStats() != null){
              for(Stat stat : flow.getBeginStats()){
                if(statusIdStrb.length() > 0){
                  statusIdStrb.append(",");
                }
               
                statusIdStrb.append(stat.getId());
              }
            }
            else if(fieldValue.equals("[逻辑关闭]") && flow.getEndStats() != null){
              for(Stat stat : flow.getEndStats()){
                if(statusIdStrb.length() > 0){
                  statusIdStrb.append(",");
                }
               
                statusIdStrb.append(stat.getId());
              }
            }
          }
         
          if(statusIdStrb.length() == 0){
            continue;
          }
         
          if(fieldMethod.equals("=")){
            XMLUtil.setAttribute(whereFieldNode, "method", "in");
          }
          else if(fieldMethod.equals("!=")){
            XMLUtil.setAttribute(whereFieldNode, "method", "not in");
          }
         
          whereFieldNode.setTextContent(statusIdStrb.toString());
        }
       
       
        //创建人 指派人可以指派给角色
        if((fieldId.equals("create_user") || fieldId.equals("assign_user") || fieldId.equals("log_create_user")) && (fieldValue.startsWith("role_"))){
         
          String roleIdStr = fieldValue.substring(5);
         
          if (!CommonUtil.isPosNum(roleIdStr))
            continue;
         
          StringBuffer roleUsers = new StringBuffer();
          if (type.equals("t")) {
            Template template = TemplateCache.getInstance().get(id);
            if(template == null){
              continue;
            }
            Flow flow = FlowCache.getInstance().get(template.getFlowId());
            if (flow == null) {
              continue;
            }
            UUID roleId = DataAccessFactory.getInstance().createUUID(roleIdStr);
            Set<Right> allRoleRight = flow.queryRightsByRole(roleId);
           
            for (Right right : allRoleRight) {
              roleUsers.append(roleUsers.length() > 0 ? "," : "").append(right.getUsername());
            }
View Full Code Here

    boolean isCurrent = FilterUtil.getIsQueryLog(XMLUtil.getSingleNode(node, "where"));
   
    adjustWhereNode(doc,node );
   
    String idStr = XMLUtil.getAttribute(node, "id");
    UUID id = DataAccessFactory.getInstance().createUUID(idStr);
    String type = XMLUtil.getAttribute(node, "type");
    String templateId = null;
    if (type.equals("t")) {
      templateId = idStr;
    }
View Full Code Here

    for (Node fieldNode : fieldList)
    {
      String fieldIdStr = XMLUtil.getAttribute(fieldNode, "id");
      if(CommonUtil.isPosNum(fieldIdStr))
      {
        UUID fieldId = DataAccessFactory.getInstance().createUUID(fieldIdStr);
        Field field = null;
        if (template == null) {
          field = TemplateCache.getInstance().queryField(fieldId);
        }else {
          field = template.getField(fieldId);
View Full Code Here

      for (Node fieldNode : allShowFieldList)
      {
        String fieldIdStr = XMLUtil.getAttribute(fieldNode, "id");
        if(CommonUtil.isPosNum(fieldIdStr))
        {
          UUID fieldId = DataAccessFactory.getInstance().createUUID(fieldIdStr);
          Field field = null;
          if (template == null) {
            field = TemplateCache.getInstance().queryField(fieldId);
          }else {
            field = template.getField(fieldId);
View Full Code Here

        TemplateTypeSegmentTag segmentTag = createTemplateTypeSegmentTag(templateTypeNode, das);
        if (segmentTag.indentFieldsName != null && segmentTag.indentFieldsName.length > 0) {
          return segmentTag.indentFieldsName[0];
        }
      }else{
        UUID templateId = DataAccessFactory.getInstance().createUUID(XMLUtil.getAttribute(templateNode, "id").toString());
        Template template = TemplateCache.getInstance().get(templateId);
       
        Element templateElement = (Element)filterDoc.getElementsByTagName("template").item(0);
        SegmentTagBase templateSegment = createSegmentTagBase(templateElement,das ,template);
        if (templateSegment.indentFieldsName != null && templateSegment.indentFieldsName.length > 0) {
View Full Code Here

TOP

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

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.