Search in sources :

Example 1 with TopicOPtsManagerVO

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

the class TopicServiceImpl method listOpts.

@Override
public PageResult<TopicOPtsManagerVO> listOpts(String sessionId, PageParameter<TopicOPtsManagerVO> pageParameter) throws CheckedServiceException {
    PmphUser pmphUser = SessionUtil.getPmphUserBySessionId(sessionId);
    if (ObjectUtil.isNull(pmphUser)) {
        throw new CheckedServiceException(CheckedExceptionBusiness.TOPIC, CheckedExceptionResult.NULL_PARAM, "用户为空!");
    }
    PageResult<TopicOPtsManagerVO> pageResult = new PageResult<>();
    PageParameterUitl.CopyPageParameter(pageParameter, pageResult);
    Integer total = 0;
    String submitTime = DateUtil.date2Str(pageParameter.getParameter().getSubmitTime(), "yyyy-MM-dd");
    if (pmphUser.getIsAdmin()) {
        total = topicDao.listTotal(pageParameter.getParameter().getBookname(), submitTime);
        if (total > 0) {
            List<TopicOPtsManagerVO> list = topicDao.list(pageParameter.getParameter().getBookname(), submitTime, pageParameter.getStart(), pageParameter.getPageSize());
            list = addTypeName(list);
            pageResult.setRows(list);
        }
    } else {
        total = topicDao.listOptsTotal(pmphUser.getId(), pageParameter.getParameter().getBookname(), submitTime);
        if (total > 0) {
            List<TopicOPtsManagerVO> list = topicDao.listOpts(pmphUser.getId(), pageParameter.getParameter().getBookname(), submitTime, pageParameter.getStart(), pageParameter.getPageSize());
            list = addTypeName(list);
            pageResult.setRows(list);
        }
    }
    pageResult.setTotal(total);
    return pageResult;
}
Also used : PmphUser(com.bc.pmpheep.back.po.PmphUser) TopicOPtsManagerVO(com.bc.pmpheep.back.vo.TopicOPtsManagerVO) CheckedServiceException(com.bc.pmpheep.service.exception.CheckedServiceException) PageResult(com.bc.pmpheep.back.plugin.PageResult)

Example 2 with TopicOPtsManagerVO

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

the class TopicController method listOpts.

/**
 * 功能描述:维护人员选题申报审核页面
 *
 * @param request
 * @param pageSize
 *            当前页条数
 * @param pageNumber
 *            当前页数
 * @param bookname
 *            选题名称
 * @param submitTime
 *            提交时间
 * @return
 */
@ResponseBody
@LogDetail(businessType = BUSSINESS_TYPE, logRemark = "维护人员查询可操作的选题")
@RequestMapping(value = "/listOpts", method = RequestMethod.GET)
public ResponseBean listOpts(HttpServletRequest request, Integer pageSize, Integer pageNumber, String bookname, String submitTime) {
    PageParameter<TopicOPtsManagerVO> pageParameter = new PageParameter(pageNumber, pageSize);
    TopicOPtsManagerVO topicOPtsManagerVO = new TopicOPtsManagerVO();
    topicOPtsManagerVO.setBookname(bookname);
    if (StringUtil.isEmpty(submitTime)) {
        topicOPtsManagerVO.setSubmitTime(null);
    } else {
        topicOPtsManagerVO.setSubmitTime(DateUtil.str2Timestam(submitTime));
    }
    String sessionId = CookiesUtil.getSessionId(request);
    pageParameter.setParameter(topicOPtsManagerVO);
    return new ResponseBean(topicService.listOpts(sessionId, pageParameter));
}
Also used : TopicOPtsManagerVO(com.bc.pmpheep.back.vo.TopicOPtsManagerVO) 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

TopicOPtsManagerVO (com.bc.pmpheep.back.vo.TopicOPtsManagerVO)2 LogDetail (com.bc.pmpheep.annotation.LogDetail)1 PageParameter (com.bc.pmpheep.back.plugin.PageParameter)1 PageResult (com.bc.pmpheep.back.plugin.PageResult)1 PmphUser (com.bc.pmpheep.back.po.PmphUser)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