use of com.ngtesting.platform.vo.OrgGroupVo in project ngtesting-platform by aaronchen2k.
the class OrgGroupServiceImpl method genVos.
@Override
public List<OrgGroupVo> genVos(List<TestOrgGroup> pos) {
List<OrgGroupVo> vos = new LinkedList<OrgGroupVo>();
for (TestOrgGroup po : pos) {
OrgGroupVo vo = genVo(po);
vos.add(vo);
}
return vos;
}
use of com.ngtesting.platform.vo.OrgGroupVo in project ngtesting-platform by aaronchen2k.
the class OrgGroupServiceImpl method genVo.
// @Override
// public void initDefaultBasicDataPers(TestOrg org) {
// String [] groups = new String[]{"测试主管","测试设计","测试执行"};
// for(String name : groups) {
// TestOrgGroup po = new TestOrgGroup();
// po.setName(name);
// po.setOrgId(org.getId());
// saveOrUpdate(po);
// }
// }
@Override
public OrgGroupVo genVo(TestOrgGroup group) {
OrgGroupVo vo = new OrgGroupVo();
BeanUtilEx.copyProperties(vo, group);
return vo;
}
use of com.ngtesting.platform.vo.OrgGroupVo in project ngtesting-platform by aaronchen2k.
the class OrgGroupAction method list.
@AuthPassport(validate = true)
@RequestMapping(value = "list", method = RequestMethod.POST)
@ResponseBody
public Map<String, Object> list(HttpServletRequest request, @RequestBody JSONObject json) {
Map<String, Object> ret = new HashMap<String, Object>();
UserVo userVo = (UserVo) request.getSession().getAttribute(Constant.HTTP_SESSION_USER_KEY);
Long orgId = userVo.getDefaultOrgId();
String keywords = json.getString("keywords");
String disabled = json.getString("disabled");
int page = json.getInteger("page") == null ? 0 : json.getInteger("page") - 1;
int pageSize = json.getInteger("pageSize") == null ? Constant.PAGE_SIZE : json.getInteger("pageSize");
Page pageData = orgGroupService.listByPage(orgId, keywords, disabled, page, pageSize);
List<OrgGroupVo> vos = orgGroupService.genVos(pageData.getItems());
ret.put("collectionSize", pageData.getTotal());
ret.put("data", vos);
ret.put("code", Constant.RespCode.SUCCESS.getCode());
return ret;
}
use of com.ngtesting.platform.vo.OrgGroupVo in project ngtesting-platform by aaronchen2k.
the class UserAndGroupAction method search.
@AuthPassport(validate = true)
@RequestMapping(value = "search", method = RequestMethod.POST)
@ResponseBody
public Map<String, Object> search(HttpServletRequest request, @RequestBody JSONObject json) {
Map<String, Object> ret = new HashMap<String, Object>();
UserVo userVo = (UserVo) request.getSession().getAttribute(Constant.HTTP_SESSION_USER_KEY);
Long orgId = json.getLong("orgId");
String keywords = json.getString("keywords");
JSONArray exceptIds = json.getJSONArray("exceptIds");
List userPos = userService.search(orgId, keywords, exceptIds);
List<UserVo> userVos = userService.genVos(userPos);
List groupPos = orgGroupService.search(orgId, keywords, exceptIds);
List<OrgGroupVo> groupVos = orgGroupService.genVos(groupPos);
List<Object> vos = new ArrayList<>();
vos.addAll(groupVos);
vos.addAll(userVos);
ret.put("data", vos);
ret.put("code", RespCode.SUCCESS.getCode());
return ret;
}
use of com.ngtesting.platform.vo.OrgGroupVo in project ngtesting-platform by aaronchen2k.
the class OrgGroupAction method get.
@AuthPassport(validate = true)
@RequestMapping(value = "get", method = RequestMethod.POST)
@ResponseBody
public Map<String, Object> get(HttpServletRequest request, @RequestBody JSONObject json) {
Map<String, Object> ret = new HashMap<String, Object>();
UserVo userVo = (UserVo) request.getSession().getAttribute(Constant.HTTP_SESSION_USER_KEY);
Long orgId = userVo.getDefaultOrgId();
Long orgGroupId = json.getLong("id");
List<RelationOrgGroupUserVo> relations = orgGroupUserService.listRelationsByGroup(orgId, orgGroupId);
if (orgGroupId == null) {
ret.put("group", new OrgGroupVo());
ret.put("relations", relations);
ret.put("code", Constant.RespCode.SUCCESS.getCode());
return ret;
}
TestOrgGroup po = (TestOrgGroup) orgGroupService.get(TestOrgGroup.class, Long.valueOf(orgGroupId));
OrgGroupVo group = orgGroupService.genVo(po);
ret.put("group", group);
ret.put("relations", relations);
ret.put("code", Constant.RespCode.SUCCESS.getCode());
return ret;
}
Aggregations