use of com.ngtesting.platform.entity.TestProject in project ngtesting-platform by aaronchen2k.
the class ProjectServiceImpl method updateNameInHisotyPers.
@Override
public void updateNameInHisotyPers(Long projectId, Long userId) {
TestProject project = getDetail(projectId);
getHistoryPers(project.getOrgId(), userId, projectId, project.getName());
}
use of com.ngtesting.platform.entity.TestProject in project ngtesting-platform by aaronchen2k.
the class CustomFieldServiceImpl method listProjectsForField.
@Override
public List<TestProjectVo> listProjectsForField(Long orgId, Long fieldId) {
List<TestProject> allProjects = projectService.list(orgId, null, null);
Set<TestProject> projectsForField;
if (fieldId == null) {
projectsForField = new HashSet<TestProject>();
} else {
TestCustomField field = (TestCustomField) get(TestCustomField.class, fieldId);
projectsForField = field.getProjectSet();
}
List<TestProjectVo> vos = new LinkedList<TestProjectVo>();
for (TestProject po1 : allProjects) {
TestProjectVo vo = projectService.genVo(po1);
vo.setSelected(false);
vo.setSelecting(false);
for (TestProject item : projectsForField) {
if (po1.getId().longValue() == item.getId().longValue()) {
vo.setSelected(true);
vo.setSelecting(true);
}
}
vos.add(vo);
for (TestProject child : po1.getChildren()) {
TestProjectVo childVo = projectService.genVo(child);
for (TestProject item : projectsForField) {
if (child.getId().longValue() == item.getId().longValue()) {
childVo.setSelected(true);
childVo.setSelecting(true);
}
}
vos.add(childVo);
}
}
return vos;
}
Aggregations