private ChooseOrganizationResponse queryDept(ChooseOrganizationRequest request) {
   List<Department> result =
       departmentService.getDepartmentsOfCorporationAndKey(
           request.getSession().getCorporationId(), request.getCriteria().getKey());
   List<OrganicationClient> lt = new ArrayList<OrganicationClient>();
   for (Department dept : result) {
     OrganicationClient client = new OrganicationClient();
     client.setId(dept.getId());
     client.setName(dept.getName());
     client.setType(OrganType.DEPT);
     lt.add(client);
   }
   OrganSearchResult rs = new OrganSearchResult();
   rs.setResult(lt);
   rs.setTotal(result.size());
   return new ChooseOrganizationResponse(rs);
 }
Exemplo n.º 2
0
  @Override
  public DepartmentLeaderResponse execute(DepartmentLeaderRequest action, ExecutionContext context)
      throws DispatchException {
    List<DepartmentNode> nodeList = new ArrayList<DepartmentNode>();

    List<DepartmentManageVo> departmentManageVoList =
        departmentService.getDepartmentLeaderList(action.getLeaderId(), action.getCorporcationId());

    for (DepartmentManageVo vo : departmentManageVoList) {
      if (vo != null) {
        DepartmentNode c =
            new DepartmentNode(
                vo.getDepartmentName(),
                (int) vo.getBudgetIntegral() + "",
                (int) vo.getBudgetIntegral() + "",
                vo.getDepartmentId(),
                vo.isLeaf(),
                vo.getParentId());
        nodeList.add(c);
      }
    }
    return new DepartmentLeaderResponse(nodeList);
  }