use of com.bc.pmpheep.back.vo.TopicTextVO in project pmph by BCSquad.
the class TopicServiceImpl method topicTextVO.
@Override
public TopicTextVO topicTextVO(TopicLog topicLog, String sessionId, Long id) throws CheckedServiceException {
PmphUser pmphUser = SessionUtil.getPmphUserBySessionId(sessionId);
if (ObjectUtil.isNull(pmphUser)) {
throw new CheckedServiceException(CheckedExceptionBusiness.TOPIC, CheckedExceptionResult.NULL_PARAM, "用户为空!");
}
topicLog.setUserId(pmphUser.getId());
if (ObjectUtil.isNull(id)) {
throw new CheckedServiceException(CheckedExceptionBusiness.TOPIC, CheckedExceptionResult.NULL_PARAM, "选题申报的id为空!");
}
topicLogService.add(topicLog);
TopicTextVO topicTextVO = topicDao.getTopicTextVO(id);
topicTextVO.setTopicExtra(topicExtraService.getTopicExtraByTopicId(id));
topicTextVO.setTopicWriters(topicWriertService.listTopicWriterByTopicId(id));
switch(topicTextVO.getRank()) {
case 0:
topicTextVO.setRankType("低");
break;
case 1:
topicTextVO.setRankType("中");
break;
case 2:
topicTextVO.setRankType("高");
break;
default:
throw new CheckedServiceException(CheckedExceptionBusiness.TOPIC, CheckedExceptionResult.NULL_PARAM, "没有这个级别");
}
switch(topicTextVO.getSource()) {
case 0:
topicTextVO.setSourceType("社策划");
break;
case 1:
topicTextVO.setSourceType("编辑策划");
break;
case 2:
topicTextVO.setSourceType("专家策划");
break;
case 3:
topicTextVO.setSourceType("离退休编审策划");
break;
case 4:
topicTextVO.setSourceType("上级交办");
break;
case 5:
topicTextVO.setSourceType("作者投稿");
break;
default:
throw new CheckedServiceException(CheckedExceptionBusiness.TOPIC, CheckedExceptionResult.NULL_PARAM, "没有这个选题来源");
}
switch(topicTextVO.getReader()) {
case 0:
topicTextVO.setReadType("医务工作者");
break;
case 1:
topicTextVO.setReadType("医学院校师生");
break;
case 2:
topicTextVO.setReadType("大众");
break;
default:
throw new CheckedServiceException(CheckedExceptionBusiness.TOPIC, CheckedExceptionResult.NULL_PARAM, "没有这个阅读人群");
}
switch(topicTextVO.getType()) {
case 0:
topicTextVO.setTypeName("专著");
break;
case 1:
topicTextVO.setTypeName("基础理论");
break;
case 2:
topicTextVO.setTypeName("论文集");
break;
case 3:
topicTextVO.setTypeName("科普");
break;
case 4:
topicTextVO.setTypeName("应用技术");
break;
case 5:
topicTextVO.setTypeName("工具书");
break;
case 6:
topicTextVO.setTypeName("其他");
break;
default:
throw new CheckedServiceException(CheckedExceptionBusiness.TOPIC, CheckedExceptionResult.ILLEGAL_PARAM, "没有这个图书类别");
}
return topicTextVO;
}
use of com.bc.pmpheep.back.vo.TopicTextVO in project pmph by BCSquad.
the class TopicController method detail.
/**
* 功能描述:查看选题申报详情
*
* @param id
* @return
*/
@ResponseBody
@LogDetail(businessType = BUSSINESS_TYPE, logRemark = "查看选题申报详情")
@RequestMapping(value = "/get/detail", method = RequestMethod.GET)
public ResponseBean detail(HttpServletRequest request, Long id) {
String sessionId = CookiesUtil.getSessionId(request);
TopicLog topicLog = new TopicLog();
topicLog.setTopicId(id);
topicLog.setTopicEvent("查看选题申报详情");
TopicTextVO topicTextVO = topicService.topicTextVO(topicLog, sessionId, id);
topicTextVO.setIsAccepted(null);
topicTextVO.setIsDirectorHandling(null);
topicTextVO.setIsEditorHandling(null);
return new ResponseBean(topicTextVO);
}
Aggregations