use of com.bc.pmpheep.back.vo.TopicDeclarationVO in project pmph by BCSquad.
the class TopicServiceImpl method addState.
/**
* 功能描述:向查看选题申报中插入状态详情
*
* @param list
* @return
*/
public List<TopicDeclarationVO> addState(List<TopicDeclarationVO> list) {
for (TopicDeclarationVO vo : list) {
if (1 == vo.getAuthProgress()) {
if (vo.getIsOptsHandling()) {
vo.setState("作者已提交");
vo.setStateDeail("待管理员分配");
if (vo.getIsDirectorHandling()) {
vo.setState("主任已受理");
vo.setStateDeail("待主任分配");
if (vo.getIsEditorHandling()) {
vo.setState("主任已分配");
vo.setStateDeail("待编辑受理");
if (vo.getIsAccepted()) {
vo.setState("编辑已受理");
vo.setStateDeail("待编辑处理");
}
}
}
}
} else {
if (2 == vo.getAuthProgress()) {
vo.setState("不通过");
}
if (3 == vo.getAuthProgress()) {
vo.setState("通过");
}
}
}
return list;
}
use of com.bc.pmpheep.back.vo.TopicDeclarationVO in project pmph by BCSquad.
the class PmphUserServiceImpl method getPersonalCenter.
@Override
public Map<String, Object> getPersonalCenter(HttpServletRequest request, String state, String materialName, String groupName, String title, String bookname, String name, String authProgress, String topicBookname) {
String sessionId = CookiesUtil.getSessionId(request);
PmphUser sessionPmphUser = SessionUtil.getPmphUserBySessionId(sessionId);
if (null == sessionPmphUser) {
throw new CheckedServiceException(CheckedExceptionBusiness.MATERIAL, CheckedExceptionResult.NULL_PARAM, "请求用户不存在");
}
// 获取用户角色
List<PmphRole> rolelist = roleService.getPmphRoleByUserId(sessionPmphUser.getId());
// 用于装所有的数据map
Map<String, Object> map = new HashMap<>();
// 教师认证总数量
Integer writerUserCount = writerUserService.getCount();
// 机构认证数量orgList
Integer orgerCount = orgUserService.getCount();
// 小组
PmphGroupListVO pmphGroup = new PmphGroupListVO();
PageParameter<PmphGroupListVO> pageParameterPmphGroup = new PageParameter<>();
pageParameterPmphGroup.setParameter(pmphGroup);
// 小组结果
PageResult<PmphGroupListVO> pageResultPmphGroup = pmphGroupService.getlistPmphGroup(pageParameterPmphGroup, sessionId);
// 教材申报
PageParameter<MaterialListVO> pageParameter2 = new PageParameter<>();
MaterialListVO materialListVO = new MaterialListVO();
materialListVO.setState(state);
materialListVO.setMaterialName(materialName);
pageParameter2.setParameter(materialListVO);
// 教材申报的结果
PageResult<MaterialListVO> pageResultMaterialListVO = materialService.listMaterials(pageParameter2, sessionId);
// 文章审核
PageParameter<CmsContentVO> pageParameter1 = new PageParameter<>();
CmsContentVO cmsContentVO = new CmsContentVO();
cmsContentVO.setTitle(title);
cmsContentVO.setCategoryId(Const.CMS_CATEGORY_ID_1);
pageParameter1.setParameter(cmsContentVO);
// 文章审核的结果
PageResult<CmsContentVO> pageResultCmsContentVO = cmsContentService.listCmsContent(pageParameter1, sessionId);
map.put("cmsContent", pageResultCmsContentVO);
// 图书纠错审核
PageResult<BookCorrectionAuditVO> pageResultBookCorrectionAuditVO = bookCorrectionService.listBookCorrectionAudit(request, Const.PAGE_NUMBER, Const.PAGE_SIZE, bookname, null, null);
map.put("bookCorrectionAudit", pageResultBookCorrectionAuditVO);
// 图书评论审核
PageParameter<BookUserCommentVO> pageParameter = new PageParameter<>();
BookUserCommentVO bookUserCommentVO = new BookUserCommentVO();
// 去除空格
bookUserCommentVO.setName(name.replaceAll(" ", ""));
pageParameter.setParameter(bookUserCommentVO);
PageResult<BookUserCommentVO> pageResultBookUserCommentVO = bookUserCommentService.listBookUserCommentAdmin(pageParameter);
map.put("bookUserComment", pageResultBookUserCommentVO);
// 选题申报
PageParameter<TopicDeclarationVO> pageParameter3 = new PageParameter<>();
// 选题申报当前用户角色
PmphIdentity pmphIdentity = pmphUserService.identity(sessionId);
TopicDeclarationVO topicDeclarationVO = new TopicDeclarationVO();
// 是否由主任受理
if (pmphIdentity.getIsDirector()) {
topicDeclarationVO.setIsDirectorHandling(true);
}
// 是否由运维人员受理
if (pmphIdentity.getIsOpts()) {
topicDeclarationVO.setIsOptsHandling(true);
}
// 是否由编辑受理
if (pmphIdentity.getIsEditor()) {
topicDeclarationVO.setIsEditorHandling(true);
}
for (PmphRole pmphRole : rolelist) {
// 编辑
if (2 == pmphRole.getId()) {
topicDeclarationVO.setIsEditorHandling(true);
}
// 主任
if (9 == pmphRole.getId()) {
topicDeclarationVO.setIsDirectorHandling(true);
}
}
String[] strs = authProgress.split(",");
List<Long> progress = new ArrayList<>();
for (String str : strs) {
progress.add(Long.valueOf(str));
}
topicDeclarationVO.setBookname(topicBookname);
pageParameter3.setParameter(topicDeclarationVO);
//
if (sessionPmphUser.getIsAdmin()) {
PageResult<TopicDeclarationVO> pageResultTopicDeclarationVO = topicService.listMyTopic(progress, pageParameter3, null);
// topicService.listCheckTopic(progress, pageParameter3);
map.put("topicList", pageResultTopicDeclarationVO);
} else {
if (2 == rolelist.get(0).getId() || 9 == rolelist.get(0).getId() || 1 == rolelist.get(0).getId()) {
PageResult<TopicDeclarationVO> pageResultTopicDeclarationVO = topicService.listMyTopic(progress, pageParameter3, sessionPmphUser.getId());
// topicService.listCheckTopic(progress, pageParameter3);
map.put("topicList", pageResultTopicDeclarationVO);
} else {
PageResult<TopicDeclarationVO> pageResultTopicDeclarationVO = new PageResult<>();
List<TopicDeclarationVO> list = new ArrayList<>();
pageResultTopicDeclarationVO.setPageNumber(0);
pageResultTopicDeclarationVO.setRows(list);
pageResultTopicDeclarationVO.setPageTotal(0);
pageResultTopicDeclarationVO.setStart(0);
pageResultTopicDeclarationVO.setTotal(0);
;
map.put("topicList", pageResultTopicDeclarationVO);
}
}
// 获取用户上次登录时间
List<SysOperation> listSysOperation = sysOperationService.getSysOperation(sessionPmphUser.getId());
Timestamp loginTime = DateUtil.getCurrentTime();
if (!listSysOperation.isEmpty()) {
loginTime = listSysOperation.get(0).getOperateDate();
}
// 把其他模块的数据都装入map中返回给前端
map.put("materialList", pageResultMaterialListVO);
map.put("pmphGroup", pageResultPmphGroup);
map.put("writerUserCount", writerUserCount);
map.put("orgUserCount", orgerCount);
// 把用户信息存入map
map.put("pmphUser", sessionPmphUser);
// 把用户角色存入map
map.put("pmphRole", rolelist);
// 把选题申报的当前身份存入map
map.put("pmphIdentity", pmphIdentity);
// 存入用户上次操作时间
map.put("loginTime", loginTime);
return map;
}
use of com.bc.pmpheep.back.vo.TopicDeclarationVO in project pmph by BCSquad.
the class TopicController method checkTopic.
/**
* 功能描述:查看选题申报
*
* @param authProgress
* 申报状态
* @param bookname
* 申报标题
* @param submitTime
* 提交日期
* @param pageSize
* @param pageNumber
* @return
*/
@ResponseBody
@LogDetail(businessType = BUSSINESS_TYPE, logRemark = "查看选题申报")
@RequestMapping(value = "/list/checkTopic", method = RequestMethod.GET)
public ResponseBean checkTopic(String authProgress, String bookname, String submitTime, Integer pageSize, Integer pageNumber) {
String[] strs = authProgress.split(",");
List<Long> progress = new ArrayList<>();
for (String str : strs) {
progress.add(Long.valueOf(str));
}
PageParameter<TopicDeclarationVO> pageParameter = new PageParameter<>(pageNumber, pageSize);
TopicDeclarationVO topicDeclarationVO = new TopicDeclarationVO();
topicDeclarationVO.setBookname(bookname);
if (StringUtil.isEmpty(submitTime)) {
topicDeclarationVO.setSubmitTime(null);
} else {
topicDeclarationVO.setSubmitTime(DateUtil.str2Timestam(submitTime));
}
pageParameter.setParameter(topicDeclarationVO);
return new ResponseBean(topicService.listCheckTopic(progress, pageParameter));
}
use of com.bc.pmpheep.back.vo.TopicDeclarationVO in project pmph by BCSquad.
the class TopicServiceTest method testListCheckTopic.
@Test
public void testListCheckTopic() {
topicService.add(topic);
PageParameter<TopicDeclarationVO> pageParameter = new PageParameter<>(1, 5);
TopicDeclarationVO topicDeclarationVO = new TopicDeclarationVO();
topicDeclarationVO.setBookname(null);
topicDeclarationVO.setSubmitTime(null);
pageParameter.setParameter(topicDeclarationVO);
List<Long> progress = new ArrayList<>();
progress.add(1L);
progress.add(0L);
progress.add(2L);
progress.add(3L);
PageResult<TopicDeclarationVO> declarationVOs = topicService.listCheckTopic(progress, pageParameter);
Assert.assertTrue("查询失败", declarationVOs.getTotal() > 0);
}
Aggregations