use of com.bc.pmpheep.back.vo.TopicEditorVO in project pmph by BCSquad.
the class TopicServiceImpl method listTopicEditorVOs.
@Override
public PageResult<TopicEditorVO> listTopicEditorVOs(String sessionId, PageParameter<TopicEditorVO> pageParameter) throws CheckedServiceException {
PmphUser pmphUser = SessionUtil.getPmphUserBySessionId(sessionId);
if (ObjectUtil.isNull(pmphUser)) {
throw new CheckedServiceException(CheckedExceptionBusiness.TOPIC, CheckedExceptionResult.NULL_PARAM, "用户为空");
}
PageResult<TopicEditorVO> 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.totalEditorView(pageParameter.getParameter().getBookname(), submitTime);
if (total > 0) {
List<TopicEditorVO> list = topicDao.listEditorView(pageParameter.getParameter().getBookname(), submitTime, pageParameter.getStart(), pageParameter.getPageSize());
list = addTypeNameEditor(list);
pageResult.setRows(list);
}
} else {
total = topicDao.totalTopicEditorVOs(pmphUser.getId(), pageParameter.getParameter().getBookname(), submitTime);
if (total > 0) {
List<TopicEditorVO> list = topicDao.listTopicEditorVOs(pmphUser.getId(), pageParameter.getParameter().getBookname(), submitTime, pageParameter.getStart(), pageParameter.getPageSize());
list = addTypeNameEditor(list);
pageResult.setRows(list);
}
}
pageResult.setTotal(total);
return pageResult;
}
use of com.bc.pmpheep.back.vo.TopicEditorVO in project pmph by BCSquad.
the class TopicController method listEditor.
/**
* Description:后台部门编辑查看可操作的申报选题
*
* @author:lyc
* @date:2017年12月22日下午3:10:12
* @param request
* @param pageSize
* 当前页条数
* @param pageNumber
* 当前页数
* @param bookname
* 选题名称
* @param submitTime
* 提交时间
* @return ResponseBean
*/
@ResponseBody
@LogDetail(businessType = BUSSINESS_TYPE, logRemark = "部门编辑查看可操作的申报选题")
@RequestMapping(value = "/listEditor", method = RequestMethod.GET)
public ResponseBean listEditor(HttpServletRequest request, Integer pageSize, Integer pageNumber, String bookname, String submitTime) {
PageParameter<TopicEditorVO> pageParameter = new PageParameter<>(pageNumber, pageSize);
TopicEditorVO topicEditorVO = new TopicEditorVO();
topicEditorVO.setBookname(bookname);
if (StringUtil.isEmpty(submitTime)) {
topicEditorVO.setSubmitTime(null);
} else {
topicEditorVO.setSubmitTime(DateUtil.str2Timestam(submitTime));
}
String sessionId = CookiesUtil.getSessionId(request);
pageParameter.setParameter(topicEditorVO);
return new ResponseBean(topicService.listTopicEditorVOs(sessionId, pageParameter));
}
Aggregations