use of com.bc.pmpheep.back.vo.PmphUserManagerVO in project pmph by BCSquad.
the class PmphUserServiceTest method testTetListPmphUserVO.
@Test
public void testTetListPmphUserVO() {
PageResult pageResult = new PageResult<>();
PageParameter pageParameter = new PageParameter<>();
PmphUserManagerVO managerVO = new PmphUserManagerVO();
managerVO.setUsername(null);
managerVO.setRealname(null);
managerVO.setPath("0-92-174");
managerVO.setDepartmentId(176L);
pageParameter.setParameter(managerVO);
pageParameter.setPageNumber(1);
pageParameter.setPageSize(30);
pageResult = userService.getListPmphUser(pageParameter, null);
Assert.assertNotNull("查找失败", pageResult);
}
use of com.bc.pmpheep.back.vo.PmphUserManagerVO in project pmph by BCSquad.
the class PmphUserController method pmphUser.
/**
* 功能描述:分页查询社内用户
*
* @param page
* 分页条件
* @param pmphUserManagerVO
* 查询条件
* @return 分好页的结果集
*/
@ResponseBody
@LogDetail(businessType = BUSSINESS_TYPE, logRemark = "分页查询社内用户")
@RequestMapping(value = "/list/pmphUser", method = RequestMethod.GET)
public ResponseBean pmphUser(Integer pageSize, Integer pageNumber, String name, @RequestParam("path") String path, Long departmentId, Long groupId, Long roleId) {
PageParameter pageParameter = new PageParameter<>();
PmphUserManagerVO pmphUserManagerVO = new PmphUserManagerVO();
if (StringUtil.notEmpty(name)) {
// 去除空格
pmphUserManagerVO.setName(name.replaceAll(" ", ""));
}
pmphUserManagerVO.setPath(path);
pmphUserManagerVO.setDepartmentId(departmentId);
pmphUserManagerVO.setRoleIds(roleId != null ? roleId.toString() : "");
pageParameter.setPageNumber(pageNumber);
pageParameter.setPageSize(pageSize);
pageParameter.setParameter(pmphUserManagerVO);
return new ResponseBean(userService.getListPmphUser(pageParameter, groupId));
}
use of com.bc.pmpheep.back.vo.PmphUserManagerVO in project pmph by BCSquad.
the class UserMessageServiceImpl method listMessage.
@Override
public PageResult<UserMessageVO> listMessage(PageParameter<UserMessageVO> pageParameter, String sessionId) throws CheckedServiceException {
PmphUser pmphUser = SessionUtil.getPmphUserBySessionId(sessionId);
if (ObjectUtil.isNull(pmphUser)) {
throw new CheckedServiceException(CheckedExceptionBusiness.MESSAGE, CheckedExceptionResult.NULL_PARAM, "用户为空");
}
if (ObjectUtil.isNull(pmphUser.getId())) {
throw new CheckedServiceException(CheckedExceptionBusiness.MESSAGE, CheckedExceptionResult.NULL_PARAM, "用户为空");
}
// 如果是系统管理员,则查询所有,否则查询对应的消息
if (Const.FALSE == pmphUser.getIsAdmin()) {
List<Long> ids = new ArrayList<Long>();
// 如果是主任,获取主任所在部门下的所有用户
if (Const.TRUE == pmphUser.getIsDirector()) {
// 社内部门父级节点ID
Long parentId = 1L;
PmphDepartment pmphDepartment = pmphDepartmentService.getPmphDepartmentById(pmphUser.getDepartmentId());
// 如果是人卫社主任,则可以查看所有用户发送的消息
if (parentId.longValue() == pmphDepartment.getId().longValue()) {
ids = null;
} else {
// 如果是子级部门主任,则只可以查看子级部门下的用户发送的消息
PageParameter<PmphUserManagerVO> parameter = new PageParameter<>(1, 2000);
PmphUserManagerVO pmphUserManagerVO = new PmphUserManagerVO();
pmphUserManagerVO.setPath(pmphDepartment.getPath());
pmphUserManagerVO.setDepartmentId(pmphDepartment.getId());
parameter.setParameter(pmphUserManagerVO);
PageResult<PmphUserManagerVO> listPageResult = pmphUserService.getListPmphUser(parameter, null);
List<PmphUserManagerVO> listPmphUserManagerVOs = listPageResult.getRows();
for (PmphUserManagerVO pmManagerVO : listPmphUserManagerVOs) {
ids.add(pmManagerVO.getId());
}
}
} else {
ids.add(pmphUser.getId());
}
pageParameter.getParameter().setSenderIds(ids);
}
PageResult<UserMessageVO> pageResult = new PageResult<>();
PageParameterUitl.CopyPageParameter(pageParameter, pageResult);
Integer total = userMessageDao.getMessageTotal(pageParameter);
if (total > 0) {
List<UserMessageVO> list = userMessageDao.listMessage(pageParameter);
Message message;
for (UserMessageVO userMessageVO : list) {
message = messageService.get(userMessageVO.getMsgId());
if (ObjectUtil.notNull(message)) {
userMessageVO.setContent(message.getContent());
}
}
pageResult.setRows(list);
pageResult.setTotal(total);
}
return pageResult;
}
use of com.bc.pmpheep.back.vo.PmphUserManagerVO in project pmph by BCSquad.
the class PmphUserServiceTest method testUpdatePmphUserOfBack.
@Test
public void testUpdatePmphUserOfBack() {
PmphUser pmphUser = new PmphUser();
pmphUser.setUsername("BBB");
pmphUser.setPassword("666");
pmphUser.setAvatar("110");
pmphUser.setRealname("CCC");
PmphUser pmphUser2 = new PmphUser();
pmphUser2 = userService.add(pmphUser);
pmphUser2.setPassword("777");
PmphUserManagerVO managerVO = new PmphUserManagerVO();
managerVO.setId(pmphUser2.getId());
managerVO.setUsername(pmphUser2.getUsername());
managerVO.setRealname(pmphUser2.getRealname());
managerVO.setRealname("角色");
managerVO.setHandphone("18728090611");
managerVO.setEmail("1249115@qq.com");
String result = userService.updatePmphUserOfBack(managerVO);
Assert.assertTrue("更新失败", result.equals("SUCCESS"));
}
Aggregations