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;
}
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));
}
Aggregations