Search in sources :

Example 1 with PmphGroupMemberManagerVO

use of com.bc.pmpheep.back.vo.PmphGroupMemberManagerVO in project pmph by BCSquad.

the class GroupController method manager.

/**
 * 功能描述:分页查询小组成员管理界面小组成员信息
 *
 * @param pageSize
 *            当页条数
 * @param pageNumber
 *            当前页数
 * @param groupId
 *            小组id
 * @param name
 *            姓名/帐号
 * @return
 */
@ResponseBody
@LogDetail(businessType = BUSSINESS_TYPE, logRemark = "分页查询小组成员管理界面小组成员信息")
@RequestMapping(value = "/list/manager", method = RequestMethod.GET)
public ResponseBean manager(Integer pageSize, Integer pageNumber, Long groupId, String name) {
    PageParameter pageParameter = new PageParameter<>(pageNumber, pageSize);
    PmphGroupMemberManagerVO pmphGroupMemberManagerVO = new PmphGroupMemberManagerVO();
    pmphGroupMemberManagerVO.setName(name);
    pmphGroupMemberManagerVO.setGroupId(groupId);
    pageParameter.setParameter(pmphGroupMemberManagerVO);
    return new ResponseBean(pmphGroupMemberService.listGroupMemberManagerVOs(pageParameter));
}
Also used : PmphGroupMemberManagerVO(com.bc.pmpheep.back.vo.PmphGroupMemberManagerVO) PageParameter(com.bc.pmpheep.back.plugin.PageParameter) ResponseBean(com.bc.pmpheep.controller.bean.ResponseBean) LogDetail(com.bc.pmpheep.annotation.LogDetail) ResponseBody(org.springframework.web.bind.annotation.ResponseBody) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 2 with PmphGroupMemberManagerVO

use of com.bc.pmpheep.back.vo.PmphGroupMemberManagerVO in project pmph by BCSquad.

the class PmphGroupMemberServiceTest method testListGroupMemberManagerVOs.

@Test
public void testListGroupMemberManagerVOs() {
    pmphGroupMemberService.addPmphGroupMember(pmphGroupMember);
    PageParameter pageParameter = new PageParameter<>(1, 20);
    PmphGroupMemberManagerVO pmphGroupMemberManagerVO = new PmphGroupMemberManagerVO();
    pmphGroupMemberManagerVO.setName(null);
    pmphGroupMemberManagerVO.setGroupId(pmphGroupMember.getGroupId());
    pageParameter.setParameter(pmphGroupMemberManagerVO);
    Assert.assertNotNull("获取数据失败", pmphGroupMemberService.listGroupMemberManagerVOs(pageParameter));
}
Also used : PmphGroupMemberManagerVO(com.bc.pmpheep.back.vo.PmphGroupMemberManagerVO) PageParameter(com.bc.pmpheep.back.plugin.PageParameter) Test(org.junit.Test) BaseTest(com.bc.pmpheep.test.BaseTest)

Example 3 with PmphGroupMemberManagerVO

use of com.bc.pmpheep.back.vo.PmphGroupMemberManagerVO in project pmph by BCSquad.

the class PmphGroupMemberServiceImpl method listGroupMemberManagerVOs.

@Override
public PageResult<PmphGroupMemberManagerVO> listGroupMemberManagerVOs(PageParameter<PmphGroupMemberManagerVO> pageParameter) throws CheckedServiceException {
    if (null == pageParameter.getParameter().getGroupId()) {
        throw new CheckedServiceException(CheckedExceptionBusiness.GROUP, CheckedExceptionResult.NULL_PARAM, "小组id不能为空");
    }
    String name = pageParameter.getParameter().getName();
    if (StringUtil.notEmpty(name)) {
        pageParameter.getParameter().setName(name);
    }
    PageResult<PmphGroupMemberManagerVO> pageResult = new PageResult<>();
    PageParameterUitl.CopyPageParameter(pageParameter, pageResult);
    int total = pmphGroupMemberDao.groupMemberTotal(pageParameter);
    if (total > 0) {
        List<PmphGroupMemberManagerVO> list = pmphGroupMemberDao.listGroupMemberManagerVOs(pageParameter);
        for (PmphGroupMemberManagerVO pmphGroupMemberManagerVO : list) {
            pmphGroupMemberManagerVO.setAvatar(RouteUtil.userAvatar(pmphGroupMemberManagerVO.getAvatar()));
            if (pmphGroupMemberManagerVO.getIsWriter()) {
                pmphGroupMemberManagerVO.setUserType(Const.SENDER_TYPE_2);
            } else {
                pmphGroupMemberManagerVO.setUserType(Const.SENDER_TYPE_1);
            }
            // 处理position
            String position = pmphGroupMemberManagerVO.getPosition();
            if (null != position && position.contains(",")) {
                position = position.replace("无,", "").replace(",无", "");
                String[] positions = position.split(",");
                String tempPosition = positions[0];
                for (int i = 1; i < positions.length; i++) {
                    if (!("," + tempPosition + ",").contains("," + positions[i] + ",")) {
                        tempPosition += "," + positions[i];
                    }
                }
                pmphGroupMemberManagerVO.setPosition(tempPosition);
            }
        // 处理position end
        }
        pageResult.setRows(list);
    }
    pageResult.setTotal(total);
    return pageResult;
}
Also used : PmphGroupMemberManagerVO(com.bc.pmpheep.back.vo.PmphGroupMemberManagerVO) CheckedServiceException(com.bc.pmpheep.service.exception.CheckedServiceException) PageResult(com.bc.pmpheep.back.plugin.PageResult)

Aggregations

PmphGroupMemberManagerVO (com.bc.pmpheep.back.vo.PmphGroupMemberManagerVO)3 PageParameter (com.bc.pmpheep.back.plugin.PageParameter)2 LogDetail (com.bc.pmpheep.annotation.LogDetail)1 PageResult (com.bc.pmpheep.back.plugin.PageResult)1 ResponseBean (com.bc.pmpheep.controller.bean.ResponseBean)1 CheckedServiceException (com.bc.pmpheep.service.exception.CheckedServiceException)1 BaseTest (com.bc.pmpheep.test.BaseTest)1 Test (org.junit.Test)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)1