Search in sources :

Example 1 with GroupMemberWriterUserVO

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

the class WriterUserServiceImpl method listGroupMemberWriterUsers.

@Override
public PageResult<GroupMemberWriterUserVO> listGroupMemberWriterUsers(PageParameter<GroupMemberWriterUserVO> pageParameter) throws CheckedServiceException {
    String bookName = pageParameter.getParameter().getBookname();
    if (StringUtil.notEmpty(bookName)) {
        pageParameter.getParameter().setBookname(bookName);
    }
    String name = pageParameter.getParameter().getName();
    if (StringUtil.notEmpty(name)) {
        pageParameter.getParameter().setRealname(name);
    }
    PageResult<GroupMemberWriterUserVO> pageResult = new PageResult<>();
    PageParameterUitl.CopyPageParameter(pageParameter, pageResult);
    int total = writerUserDao.getGroupMemberWriterUserTotal(pageParameter);
    if (total > 0) {
        List<GroupMemberWriterUserVO> list = writerUserDao.listGroupMemberWriterUserVOs(pageParameter);
        for (GroupMemberWriterUserVO vo : list) {
            switch(vo.getChosenPosition()) {
                case 0:
                    vo.setChosenPositionName("无职位");
                    break;
                case 1:
                    vo.setChosenPositionName("主编");
                    break;
                case 2:
                    vo.setChosenPositionName("副主编");
                    break;
                case 3:
                    vo.setChosenPositionName("编委");
                    break;
                default:
                    throw new CheckedServiceException(CheckedExceptionBusiness.MATERIAL, CheckedExceptionResult.ILLEGAL_PARAM, "该用户没有身份");
            }
        }
        pageResult.setRows(list);
    }
    pageResult.setTotal(total);
    return pageResult;
}
Also used : GroupMemberWriterUserVO(com.bc.pmpheep.back.vo.GroupMemberWriterUserVO) CheckedServiceException(com.bc.pmpheep.service.exception.CheckedServiceException) PageResult(com.bc.pmpheep.back.plugin.PageResult)

Example 2 with GroupMemberWriterUserVO

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

the class WriterUserController method groupMember.

/**
 * 功能描述: 分页查询小组成员添加界面作家用户信息
 *
 * @param bookname
 *            书籍名称
 * @param chosenPosition
 *            申报职位
 * @param name
 *            姓名/帐号
 * @return 分好页的数据集
 */
@ResponseBody
@LogDetail(businessType = BUSSINESS_TYPE, logRemark = " 分页查询小组成员添加界面作家用户信息")
@RequestMapping(value = "/list/groupMember", method = RequestMethod.GET)
public ResponseBean groupMember(Integer pageSize, Integer pageNumber, String bookname, Integer chosenPosition, String name) {
    PageParameter<GroupMemberWriterUserVO> pageParameter = new PageParameter<>(pageNumber, pageSize);
    GroupMemberWriterUserVO groupMemberWriterUserVO = new GroupMemberWriterUserVO();
    groupMemberWriterUserVO.setBookname(bookname);
    groupMemberWriterUserVO.setChosenPosition(chosenPosition);
    groupMemberWriterUserVO.setName(name);
    pageParameter.setParameter(groupMemberWriterUserVO);
    return new ResponseBean(writerUserService.listGroupMemberWriterUsers(pageParameter));
}
Also used : GroupMemberWriterUserVO(com.bc.pmpheep.back.vo.GroupMemberWriterUserVO) 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)

Aggregations

GroupMemberWriterUserVO (com.bc.pmpheep.back.vo.GroupMemberWriterUserVO)2 LogDetail (com.bc.pmpheep.annotation.LogDetail)1 PageParameter (com.bc.pmpheep.back.plugin.PageParameter)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 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)1