org.opensingular.flow.persistence.entity.Actor类的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(8.9k)|赞(0)|评价(0)|浏览(169)

本文整理了Java中org.opensingular.flow.persistence.entity.Actor类的一些代码示例,展示了Actor类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Actor类的具体详情如下:
包路径:org.opensingular.flow.persistence.entity.Actor
类名称:Actor

Actor介绍

[英]The persistent class for the TB_ATOR database table.
[中]TB_ATOR数据库表的持久类。

代码示例

代码示例来源:origin: org.opensingular/singular-flow-persistence

@Override
  public String getCodUsuario() {
    return actor.getCodUsuario();
  }
};

代码示例来源:origin: org.opensingular/singular-server-commons

@Override
public Object transformTuple(Object[] objects, String[] strings) {
  if (objects == null || objects.length == 0) {
    return null;
  }
  Actor actor = new Actor();
  for (int i = 0; i < strings.length; i += 1) {
    Object rawObject = objects[i];
    switch (strings[i]) {
      case COD:
        actor.setCod(castToInteger(rawObject));
        break;
      case COD_USUARIO:
        actor.setCodUsuario(String.valueOf(rawObject));
        break;
      case NOME:
        actor.setNome((String) rawObject);
        break;
      case EMAIL:
        actor.setEmail((String) rawObject);
        break;
      default:
    }
  }
  return actor;
}

代码示例来源:origin: org.opensingular/singular-flow-core

@Override
public Integer getCod() {
  return actor.getCod();
}

代码示例来源:origin: org.opensingular/flow-persistence

@Override
  public String getCodUsuario() {
    return actor.getCodUsuario();
  }
};

代码示例来源:origin: org.opensingular/singular-requirement-module

@Override
public Object transformTuple(Object[] objects, String[] strings) {
  if (objects == null || objects.length == 0) {
    return null;
  }
  Actor actor = new Actor();
  for (int i = 0; i < strings.length; i += 1) {
    Object rawObject = objects[i];
    switch (strings[i]) {
      case COD:
        actor.setCod(castToInteger(rawObject));
        break;
      case COD_USUARIO:
        actor.setCodUsuario(String.valueOf(rawObject));
        break;
      case NOME:
        actor.setNome((String) rawObject);
        break;
      case EMAIL:
        actor.setEmail((String) rawObject);
        break;
      default:
    }
  }
  return actor;
}

代码示例来源:origin: org.opensingular/singular-flow-persistence

@Override
public Integer getCod() {
  return actor.getCod();
}

代码示例来源:origin: org.opensingular/singular-flow-core

public String getCodUsuario() {
    return actor.getCodUsuario();
  }
};

代码示例来源:origin: org.opensingular/singular-requirement-commons

@Override
public Object transformTuple(Object[] objects, String[] strings) {
  if (objects == null || objects.length == 0) {
    return null;
  }
  Actor actor = new Actor();
  for (int i = 0; i < strings.length; i += 1) {
    Object rawObject = objects[i];
    switch (strings[i]) {
      case COD:
        actor.setCod(castToInteger(rawObject));
        break;
      case COD_USUARIO:
        actor.setCodUsuario(String.valueOf(rawObject));
        break;
      case NOME:
        actor.setNome((String) rawObject);
        break;
      case EMAIL:
        actor.setEmail((String) rawObject);
        break;
      default:
    }
  }
  return actor;
}

代码示例来源:origin: org.opensingular/flow-persistence

@Override
public Integer getCod() {
  return actor.getCod();
}

代码示例来源:origin: org.opensingular/server-commons

public void filterActors(List<Actor> actors, Long petitionId, String actionName) {
  PetitionAuthMetadataDTO petitionAuthMetadataDTO = petitionService.findPetitionAuthMetadata(petitionId);
  if (actors != null && !actors.isEmpty()) {
    Iterator<Actor> it = actors.iterator();
    while (it.hasNext()) {
      Actor a = it.next();
      if (!hasPermission(petitionAuthMetadataDTO, null, a.getCodUsuario(), actionName)) {
        it.remove();
      }
    }
  }
}

代码示例来源:origin: org.opensingular/server-commons

public Actor buscarPorCodUsuario(String username) {
  if (username == null) {
    return null;
  }
  Query query = getSession().createSQLQuery(
      "select a.CO_ATOR as \"cod\", a.CO_USUARIO as \"codUsuario\", a.NO_ATOR as \"nome\", a.DS_EMAIL as \"email\" " +
          " FROM " + Constants.SCHEMA + ".VW_ATOR a " +
          " WHERE UPPER(trim(a.CO_USUARIO)) = :codUsuario");
  query.setParameter("codUsuario", username.toUpperCase());
  Object[] dados = (Object[]) query.uniqueResult();
  Actor    actor = null;
  if (dados != null) {
    actor = new Actor();
    if (dados[0] != null) {
      actor.setCod(((Number) dados[0]).intValue());
    }
    actor.setCodUsuario(dados[1].toString());
    actor.setNome((String) dados[2]);
    actor.setEmail((String) dados[3]);
  }
  return actor;
}

代码示例来源:origin: org.opensingular/singular-server-commons

public void filterActors(List<Actor> actors, Long requirementId, String actionName) {
  RequirementAuthMetadataDTO requirementAuthMetadataDTO = requirementService.findRequirementAuthMetadata(requirementId);
  if (actors != null && !actors.isEmpty()) {
    actors.removeIf(a -> !hasPermission(requirementAuthMetadataDTO, null, a.getCodUsuario(), actionName));
  }
}

代码示例来源:origin: org.opensingular/singular-requirement-commons

public void filterActors(List<Actor> actors, Long requirementId, String actionName) {
  RequirementAuthMetadataDTO requirementAuthMetadataDTO = requirementService.findRequirementAuthMetadata(requirementId);
  if (actors != null && !actors.isEmpty()) {
    actors.removeIf(a -> !hasPermission(requirementAuthMetadataDTO, null, a.getCodUsuario(), actionName));
  }
}

代码示例来源:origin: org.opensingular/singular-requirement-module

/**
 * Utility method used by {@link #hasPermission(Long, String, String, String, String, IServerContext, boolean)}
 *
 * @param requirementId
 * @param idUsuario
 * @return
 */
@SuppressWarnings("OptionalIsPresent")
protected boolean isTaskAssignedToAnotherUser(Long requirementId, String idUsuario) {
  if (requirementId != null && idUsuario != null) {
    return requirementService.findCurrentTaskEntityByRequirementId(requirementId)
        .map(AbstractTaskInstanceEntity::getTaskHistory)
        .filter(histories -> !histories.isEmpty())
        .map(histories -> histories.get(histories.size() - 1))
        .map(history -> history.getAllocatedUser() != null
            && history.getAllocationEndDate() == null
            && !idUsuario.equalsIgnoreCase(history.getAllocatedUser().getCodUsuario()))
        .orElse(Boolean.FALSE);
  }
  return false;
}

代码示例来源:origin: org.opensingular/singular-server-module

private boolean isTaskAssignedToAnotherUser(ActionContext config) {
  String username = SingularSession.get().getUsername();
  Optional<Long> requirementIdOpt =  config.getRequirementId();
  if (requirementIdOpt.isPresent()) {
    return requirementService.findCurrentTaskEntityByRequirementId(requirementIdOpt.get())
        .map(AbstractTaskInstanceEntity::getTaskHistory)
        .filter(histories -> !histories.isEmpty())
        .map(histories -> histories.get(histories.size() - 1))
        .map(history -> history.getAllocatedUser() != null
            && history.getAllocationEndDate() == null
            && !username.equalsIgnoreCase(history.getAllocatedUser().getCodUsuario()))
        .orElse(Boolean.FALSE);
  }
  return false;
}

代码示例来源:origin: org.opensingular/server-module

private boolean isTaskAssignedToAnotherUser(FormPageConfig config) {
  String username   = SingularSession.get().getUsername();
  Long   petitionId = NumberUtils.toLong(config.getPetitionId(), -1);
  if (petitionId < 0) {
    petitionId = null;
  }
  TaskInstanceEntity currentTask = petitionService.findCurrentTaskByPetitionId(petitionId);
  if (currentTask != null
      && !currentTask.getTaskHistory().isEmpty()) {
    TaskInstanceHistoryEntity taskInstanceHistory = currentTask.getTaskHistory().get(currentTask.getTaskHistory().size() - 1);
    return taskInstanceHistory.getEndDateAllocation() == null
        && !username.equalsIgnoreCase(taskInstanceHistory.getAllocatedUser().getCodUsuario());
  }
  return false;
}

代码示例来源:origin: org.opensingular/singular-requirement-module

protected ActionRequest buildCallAtribuirObject(BoxItemAction boxAction, BoxItemDataMap boxItem, Actor actor) {
  ActionAtribuirRequest actionRequest = new ActionAtribuirRequest();
  actionRequest.setIdUsuario(getBoxPage().getIdUsuario());
  if (actor == null) {
    actionRequest.setEndLastAllocation(true);
  } else {
    actionRequest.setIdUsuarioDestino(actor.getCodUsuario());
  }
  if (boxAction.isUseExecute()) {
    actionRequest.setAction(boxAction);
    actionRequest.setLastVersion(boxItem.getVersionStamp());
  }
  return actionRequest;
}

代码示例来源:origin: org.opensingular/singular-requirement-core

protected ActionRequest buildCallAtribuirObject(BoxItemAction boxAction, BoxItemDataMap boxItem, Actor actor) {
  ActionAtribuirRequest actionRequest = new ActionAtribuirRequest();
  actionRequest.setIdUsuario(getBoxPage().getIdUsuario());
  if (actor == null) {
    actionRequest.setEndLastAllocation(true);
  } else {
    actionRequest.setIdUsuarioDestino(actor.getCodUsuario());
  }
  if (boxAction.isUseExecute()) {
    actionRequest.setAction(boxAction);
    actionRequest.setLastVersion(boxItem.getVersionStamp());
  }
  return actionRequest;
}

代码示例来源:origin: org.opensingular/singular-server-core

protected ActionRequest buildCallAtribuirObject(BoxItemAction boxAction, BoxItemDataMap boxItem, Actor actor) {
  ActionAtribuirRequest actionRequest = new ActionAtribuirRequest();
  actionRequest.setIdUsuario(getBoxPage().getIdUsuario());
  if (actor == null) {
    actionRequest.setEndLastAllocation(true);
  } else {
    actionRequest.setIdUsuarioDestino(actor.getCodUsuario());
  }
  if (boxAction.isUseExecute()) {
    actionRequest.setAction(boxAction);
    actionRequest.setLastVersion(boxItem.getVersionStamp());
  }
  return actionRequest;
}

代码示例来源:origin: org.opensingular/server-core

protected Object buildCallAtribuirObject(BoxItemAction boxAction, BoxItemModel boxItem, Actor actor) {
  ActionAtribuirRequest actionRequest = new ActionAtribuirRequest();
  actionRequest.setIdUsuario(getBoxPage().getIdUsuario());
  if (actor == null) {
    actionRequest.setEndLastAllocation(true);
  } else {
    actionRequest.setIdUsuarioDestino(actor.getCodUsuario());
  }
  if (boxAction.isUseExecute()) {
    actionRequest.setName(boxAction.getName());
    actionRequest.setLastVersion(boxItem.getVersionStamp());
  }
  return actionRequest;
}

相关文章