use of com.autentia.tnt.businessobject.Project in project TNTConcept by autentia.
the class ActivityBean method getOrganizations.
/**
* @return Organizaciones con proyectos abiertos que ademas tengan ROLES creados
*/
public List<SelectItem> getOrganizations() {
ArrayList<SelectItem> ret = new ArrayList<SelectItem>(32);
List<Project> projects = projectManager.getDefault().getOpenProjects(new SortCriteria("name"));
HashMap<Integer, Organization> companies = new HashMap<Integer, Organization>(32);
if (!CollectionUtils.isEmpty(projects)) {
for (Project project : projects) {
if ((!project.isFinished()) && (project.getOpen())) {
Set<ProjectRole> roles = project.getRoles();
if (!CollectionUtils.isEmpty(roles)) {
Organization company = project.getClient();
if (!companies.containsKey(company.getId())) {
companies.put(company.getId(), company);
ret.add(new SelectItem(company, company.getName()));
}
}
}
}
}
Collections.sort(ret, new OperacionesComparator());
if ((this.selectedOrganization == null) && (ret.size() > 0)) {
this.setSelectedOrganization((Organization) ret.get(0).getValue());
}
return ret;
}
use of com.autentia.tnt.businessobject.Project in project TNTConcept by autentia.
the class ActivityEvidenceNotificationBean method groupedActivitiesByProject.
private HashMap<Project, List<Activity>> groupedActivitiesByProject(List<Activity> activities) {
HashMap<Project, List<Activity>> map = new HashMap<>();
activities.forEach(activity -> {
Project project = activity.getRole().getProject();
List<Activity> prjActivities = map.getOrDefault(project, new ArrayList<>());
prjActivities.add(activity);
map.put(project, prjActivities);
});
return map;
}
use of com.autentia.tnt.businessobject.Project in project TNTConcept by autentia.
the class BillAndBillPaymentTest method insertInitialData.
/**
* Metodo encargado de insertar datos muy generales pero que son necesarios
* en la gestion de facturas
*/
private void insertInitialData() {
final BillDAO billDAO = (BillDAO) SpringUtilsForTesting.getSpringBean("daoBill");
final ProjectDAO projectDAO = (ProjectDAO) SpringUtilsForTesting.getSpringBean("daoProject");
final Project project = new Project();
projectDAO.insert(project);
bill = new Bill();
bill.setCreationDate(new Date());
bill.setState(BillState.EMITTED);
bill.setNumber("200901");
bill.setName("Factura por servicios");
bill.setProject(project);
bill.setStartBillDate(new Date());
bill.setEndBillDate(new Date());
bill.setState(BillState.EMITTED);
bill.setOrderNumber("12");
billDAO.insert(bill);
}
use of com.autentia.tnt.businessobject.Project in project TNTConcept by autentia.
the class BillManagerTest method insertProjectIntoContext.
private Project insertProjectIntoContext(Date date) {
final Project project = new Project();
project.setRoles(createRolesForContext(project, date));
project.setClient(createOrganizationInContext());
projectDAO.insert(project);
return project;
}
use of com.autentia.tnt.businessobject.Project in project TNTConcept by autentia.
the class BillBeanTest method prepareReturnOpenProjects.
private List<Project> prepareReturnOpenProjects() {
List<Project> list = new ArrayList<Project>();
Project p1 = new Project();
p1.setId(1);
p1.setOpen(true);
p1.setName("Proyecto Abierto");
list.add(p1);
Project p2 = new Project();
p2.setId(2);
p2.setOpen(false);
p2.setName("Proyecto Cerrado");
list.add(p2);
return list;
}
Aggregations