use of com.ngtesting.platform.entity.TestProject in project ngtesting-platform by aaronchen2k.
the class ProjectServiceImpl method genGroupVos.
@Override
public List<TestProjectVo> genGroupVos(List<TestProject> pos) {
List<TestProjectVo> voList = new LinkedList<TestProjectVo>();
for (TestProject po : pos) {
TestProjectVo vo = genVo(po);
voList.add(vo);
}
return voList;
}
use of com.ngtesting.platform.entity.TestProject in project ngtesting-platform by aaronchen2k.
the class ProjectServiceImpl method delete.
@Override
public Boolean delete(Long id) {
if (id == null) {
return null;
}
TestProject po = (TestProject) get(TestProject.class, id);
po.setDeleted(true);
saveOrUpdate(po);
// 项目组被删除,删除子项目
if (po.getType().equals(ProjectType.group)) {
for (TestProject child : po.getChildren()) {
child.setDeleted(true);
saveOrUpdate(child);
}
}
return true;
}
use of com.ngtesting.platform.entity.TestProject in project ngtesting-platform by aaronchen2k.
the class BaseDaoImpl method moveNode.
@Override
public Integer moveNode(String nodeTable, Long nodeId, Long newParentId) {
Query query = this.getSession().createSQLQuery("CALL move_node(:node_table, :project_id, :parent_id)").addEntity(TestProject.class).setParameter("node_table", nodeTable).setParameter("project_id", nodeId).setParameter("parent_id", newParentId);
TestProject projec = (TestProject) query.uniqueResult();
return 1;
}
use of com.ngtesting.platform.entity.TestProject in project ngtesting-platform by aaronchen2k.
the class BaseDaoImpl method updateNode.
@Override
public Integer updateNode(String nodeTable, Long nodeId, String statusName, String statusValue) {
Query query = this.getSession().createSQLQuery("CALL update_node(:node_table, :node_id, :status_name, :status_value)").addEntity(TestProject.class).setParameter("node_table", nodeTable).setParameter("node_id", nodeId).setParameter("status_name", statusName).setParameter("status_value", statusValue);
TestProject projec = (TestProject) query.uniqueResult();
return 1;
}
use of com.ngtesting.platform.entity.TestProject in project ngtesting-platform by aaronchen2k.
the class CustomFieldServiceImpl method saveRelationsProjects.
@Override
public boolean saveRelationsProjects(Long fieldId, List<TestProjectVo> projects) {
if (projects == null) {
return false;
}
TestCustomField field = (TestCustomField) get(TestCustomField.class, fieldId);
Set<TestProject> projectSet = field.getProjectSet();
for (Object obj : projects) {
TestProjectVo vo = JSON.parseObject(JSON.toJSONString(obj), TestProjectVo.class);
if (vo.getSelecting() != vo.getSelected()) {
// 变化了
TestProject project = (TestProject) get(TestProject.class, vo.getId());
if (vo.getSelecting() && !projectSet.contains(project)) {
// 勾选
projectSet.add(project);
} else if (project != null) {
// 取消
projectSet.remove(project);
}
}
}
saveOrUpdate(field);
return true;
}
Aggregations