Search in sources :

Example 1 with TopicDirectorVO

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

the class TopicServiceImpl method listTopicDirectorVOs.

public PageResult<TopicDirectorVO> listTopicDirectorVOs(String sessionId, PageParameter<TopicDirectorVO> pageParameter) throws CheckedServiceException {
    PmphUser pmphUser = SessionUtil.getPmphUserBySessionId(sessionId);
    if (ObjectUtil.isNull(pmphUser)) {
        throw new CheckedServiceException(CheckedExceptionBusiness.TOPIC, CheckedExceptionResult.NULL_PARAM, "用户为空");
    }
    PageResult<TopicDirectorVO> 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.totalDirectorView(pageParameter.getParameter().getBookname(), submitTime);
        if (total > 0) {
            List<TopicDirectorVO> list = topicDao.listDirectorView(pageParameter.getParameter().getBookname(), submitTime, pageParameter.getStart(), pageParameter.getPageSize());
            list = addTypeNameDirector(list);
            pageResult.setRows(list);
        }
    } else {
        total = topicDao.totalTopicDirectorVOs(pmphUser.getId(), pageParameter.getParameter().getBookname(), submitTime);
        if (total > 0) {
            List<TopicDirectorVO> list = topicDao.listTopicDirectorVOs(pmphUser.getId(), pageParameter.getParameter().getBookname(), submitTime, pageParameter.getStart(), pageParameter.getPageSize());
            list = addTypeNameDirector(list);
            pageResult.setRows(list);
        }
    }
    pageResult.setTotal(total);
    return pageResult;
}
Also used : PmphUser(com.bc.pmpheep.back.po.PmphUser) CheckedServiceException(com.bc.pmpheep.service.exception.CheckedServiceException) TopicDirectorVO(com.bc.pmpheep.back.vo.TopicDirectorVO) PageResult(com.bc.pmpheep.back.plugin.PageResult)

Example 2 with TopicDirectorVO

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

the class TopicController method listDirector.

/**
 * Description:后台部门主任查看可操作的选题
 *
 * @author:lyc
 * @date:2017年12月22日下午2:59:37
 * @param request
 * @param pageSize
 *            当前页条数
 * @param pageNumber
 *            当前页数
 * @param bookname
 *            选题名称
 * @param submitTime
 *            提交时间
 * @return ResponseBean
 */
@ResponseBody
@LogDetail(businessType = BUSSINESS_TYPE, logRemark = "部门主任查看可操作的选题")
@RequestMapping(value = "/listDirector", method = RequestMethod.GET)
public ResponseBean listDirector(HttpServletRequest request, Integer pageSize, Integer pageNumber, String bookname, String submitTime) {
    PageParameter<TopicDirectorVO> pageParameter = new PageParameter<>(pageNumber, pageSize);
    TopicDirectorVO topicDirectorVO = new TopicDirectorVO();
    topicDirectorVO.setBookname(bookname);
    if (StringUtil.isEmpty(submitTime)) {
        topicDirectorVO.setSubmitTime(null);
    } else {
        topicDirectorVO.setSubmitTime(DateUtil.str2Timestam(submitTime));
    }
    String sessionId = CookiesUtil.getSessionId(request);
    pageParameter.setParameter(topicDirectorVO);
    return new ResponseBean(topicService.listTopicDirectorVOs(sessionId, pageParameter));
}
Also used : PageParameter(com.bc.pmpheep.back.plugin.PageParameter) ResponseBean(com.bc.pmpheep.controller.bean.ResponseBean) TopicDirectorVO(com.bc.pmpheep.back.vo.TopicDirectorVO) LogDetail(com.bc.pmpheep.annotation.LogDetail) ResponseBody(org.springframework.web.bind.annotation.ResponseBody) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

TopicDirectorVO (com.bc.pmpheep.back.vo.TopicDirectorVO)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