use of com.ngtesting.platform.entity.TestUser in project ngtesting-platform by aaronchen2k.
the class CaseCommentsServiceImpl method genVo.
@Override
public TestCaseCommentsVo genVo(TestCaseComments po) {
TestCaseCommentsVo vo = new TestCaseCommentsVo();
BeanUtilEx.copyProperties(vo, po);
if (vo.getUpdateTime() == null) {
vo.setUpdateTime(vo.getCreateTime());
}
TestUser user = (TestUser) get(TestUser.class, po.getUserId());
vo.setUserName(user.getName());
vo.setUserAvatar(user.getAvatar());
return vo;
}
use of com.ngtesting.platform.entity.TestUser in project ngtesting-platform by aaronchen2k.
the class RelationOrgGroupUserServiceImpl method genVo.
private RelationOrgGroupUserVo genVo(Long orgId, Long orgGroupId, Long userId) {
RelationOrgGroupUserVo vo = new RelationOrgGroupUserVo();
vo.setOrgId(orgId);
if (orgGroupId != null) {
TestOrgGroup orgGroup = (TestOrgGroup) get(TestOrgGroup.class, orgGroupId);
vo.setOrgGroupId(orgGroupId);
vo.setOrgGroupName(orgGroup.getName());
}
if (userId != null) {
TestUser user = (TestUser) get(TestUser.class, userId);
vo.setUserId(user.getId());
vo.setUserName(user.getName());
}
return vo;
}
use of com.ngtesting.platform.entity.TestUser in project ngtesting-platform by aaronchen2k.
the class RelationOrgGroupUserServiceImpl method listRelationsByGroup.
@Override
public List<RelationOrgGroupUserVo> listRelationsByGroup(Long orgId, Long orgGroupId) {
List<TestUser> allUsers = listAllOrgUsers(orgId);
List<TestRelationOrgGroupUser> relations;
if (orgGroupId == null) {
relations = new LinkedList<>();
} else {
relations = listRelations(orgId, orgGroupId, null);
}
List<RelationOrgGroupUserVo> vos = new LinkedList<>();
for (TestUser user : allUsers) {
RelationOrgGroupUserVo vo = genVo(orgId, orgGroupId, user.getId());
vo.setSelected(false);
vo.setSelecting(false);
for (TestRelationOrgGroupUser po : relations) {
if (po.getUserId().longValue() == user.getId().longValue() && po.getOrgGroupId().longValue() == orgGroupId.longValue()) {
vo.setSelected(true);
vo.setSelecting(true);
}
}
vos.add(vo);
}
return vos;
}
use of com.ngtesting.platform.entity.TestUser in project ngtesting-platform by aaronchen2k.
the class OrgRoleUserServiceImpl method listAllOrgUsers.
private List<TestUser> listAllOrgUsers() {
DetachedCriteria dc = DetachedCriteria.forClass(TestUser.class);
dc.add(Restrictions.eq("deleted", Boolean.FALSE));
dc.add(Restrictions.eq("disabled", Boolean.FALSE));
dc.addOrder(Order.asc("id"));
List<TestUser> ls = findAllByCriteria(dc);
return ls;
}
use of com.ngtesting.platform.entity.TestUser in project ngtesting-platform by aaronchen2k.
the class OrgServiceImpl method setDefaultPers.
@Override
public void setDefaultPers(Long orgId, UserVo userVo) {
TestUser user = (TestUser) get(TestUser.class, userVo.getId());
user.setDefaultOrgId(orgId);
List<TestProjectAccessHistoryVo> recentProjects = projectService.listRecentProjectVo(orgId, userVo.getId());
user.setDefaultPrjId(recentProjects.get(0).getProjectId());
saveOrUpdate(user);
userVo.setDefaultOrgId(user.getDefaultOrgId());
userVo.setDefaultPrjId(recentProjects.get(0).getProjectId());
}
Aggregations