Search in sources :

Example 26 with WriterUser

use of com.bc.pmpheep.back.po.WriterUser in project pmph by BCSquad.

the class DeclarationServiceImpl method exportExcel.

@Override
public ApplicationVO exportExcel(Long declarationId) {
    // 专家信息显示实体
    ApplicationVO applicationVO = new ApplicationVO();
    // 作家申报
    List<DecPositionDisplayVO> decPositionList = decPositionDao.listDecPositionsOrBook(declarationId);
    for (DecPositionDisplayVO decPositions : decPositionList) {
        String syllabusId = decPositions.getSyllabusId();
        if (StringUtil.notEmpty(syllabusId)) {
            // 下载路径
            String syllabusIds = RouteUtil.MONGODB_FILE + syllabusId;
            decPositions.setSyllabusId(syllabusIds);
        }
        switch(decPositions.getPresetPosition()) {
            case 1:
                decPositions.setShowPosition("编委");
                break;
            case 2:
                decPositions.setShowPosition("副主编");
                break;
            case 3:
                decPositions.setShowPosition("副主编,编委");
                break;
            case 4:
                decPositions.setShowPosition("主编");
                break;
            case 5:
                decPositions.setShowPosition("主编,编委");
                break;
            case 6:
                decPositions.setShowPosition("主编,副主编");
                break;
            case 7:
                decPositions.setShowPosition("主编,副主编,编委");
                break;
            case 8:
                decPositions.setShowPosition("数字编委");
                break;
            case 9:
                decPositions.setShowPosition("编委,数字编委");
                break;
            case 10:
                decPositions.setShowPosition("副主编,数字编委");
                break;
            case 11:
                decPositions.setShowPosition("副主编,编委,数字编委");
                break;
            case 12:
                decPositions.setShowPosition("主编,数字编委");
                break;
            case 13:
                decPositions.setShowPosition("主编,编委,数字编委");
                break;
            case 14:
                decPositions.setShowPosition("主编,副主编,数字编委");
                break;
            case 15:
                decPositions.setShowPosition("主编,副主编,编委,数字编委");
                break;
            default:
                break;
        }
        if (decPositions.getChosenPosition() != 0) {
            switch(decPositions.getChosenPosition()) {
                case 1:
                    decPositions.setShowChosenPosition("编委");
                    break;
                case 2:
                    decPositions.setShowChosenPosition("副主编");
                    break;
                case 3:
                    decPositions.setShowChosenPosition("副主编,编委");
                    break;
                case 4:
                    decPositions.setShowChosenPosition("主编");
                    break;
                case 5:
                    decPositions.setShowChosenPosition("主编,编委");
                    break;
                case 6:
                    decPositions.setShowChosenPosition("主编,副主编");
                    break;
                case 7:
                    decPositions.setShowChosenPosition("主编,副主编,编委");
                    break;
                case 8:
                    decPositions.setShowChosenPosition("数字编委");
                    break;
                case 9:
                    decPositions.setShowChosenPosition("编委,数字编委");
                    break;
                case 10:
                    decPositions.setShowChosenPosition("副主编,数字编委");
                    break;
                case 11:
                    decPositions.setShowChosenPosition("副主编,编委,数字编委");
                    break;
                case 12:
                    decPositions.setShowChosenPosition("主编,数字编委");
                    break;
                case 13:
                    decPositions.setShowChosenPosition("主编,编委,数字编委");
                    break;
                case 14:
                    decPositions.setShowChosenPosition("主编,副主编,数字编委");
                    break;
                case 15:
                    decPositions.setShowChosenPosition("主编,副主编,编委,数字编委");
                    break;
                default:
                    break;
            }
        }
    }
    // 作家遴选
    List<DecPositionPublishedVO> decPositionPublishedVOs = decPositionPublishedDao.listDecPositionDisplayOrPosition(declarationId);
    for (DecPositionPublishedVO decPositionPublished : decPositionPublishedVOs) {
        if (decPositionPublished.getChosenPosition() != 0) {
            switch(decPositionPublished.getChosenPosition()) {
                case 1:
                    decPositionPublished.setShowChosenPosition("编委");
                    break;
                case 2:
                    decPositionPublished.setShowChosenPosition("副主编");
                    break;
                case 3:
                    decPositionPublished.setShowChosenPosition("副主编,编委");
                    break;
                case 4:
                    decPositionPublished.setShowChosenPosition("主编");
                    break;
                case 5:
                    decPositionPublished.setShowChosenPosition("主编,编委");
                    break;
                case 6:
                    decPositionPublished.setShowChosenPosition("主编,副主编");
                    break;
                case 7:
                    decPositionPublished.setShowChosenPosition("主编,副主编,编委");
                    break;
                case 8:
                    decPositionPublished.setShowChosenPosition("数字编委");
                    break;
                case 9:
                    decPositionPublished.setShowChosenPosition("编委,数字编委");
                    break;
                case 10:
                    decPositionPublished.setShowChosenPosition("副主编,数字编委");
                    break;
                case 11:
                    decPositionPublished.setShowChosenPosition("副主编,编委,数字编委");
                    break;
                case 12:
                    decPositionPublished.setShowChosenPosition("主编,数字编委");
                    break;
                case 13:
                    decPositionPublished.setShowChosenPosition("主编,编委,数字编委");
                    break;
                case 14:
                    decPositionPublished.setShowChosenPosition("主编,副主编,数字编委");
                    break;
                case 15:
                    decPositionPublished.setShowChosenPosition("主编,副主编,编委,数字编委");
                    break;
                default:
                    break;
            }
        }
    }
    // 作家申报表
    DeclarationOrDisplayVO declaration = declarationDao.getDeclarationByIdOrOrgName(declarationId);
    WriterUser user = writerUserService.get(declaration.getUserId());
    if (user != null) {
        declaration.setUsername(user.getUsername());
    }
    // 作家学习经历
    List<DecEduExp> decEduExpList = decEduExpDao.getListDecEduExpByDeclarationId(declarationId);
    // 作家工作经历
    List<DecWorkExp> decWorkExpList = decWorkExpDao.getListDecWorkExpByDeclarationId(declarationId);
    // 作家教学经历
    List<DecTeachExp> decTeachExpList = decTeachExpDao.getListDecTeachExpByDeclarationId(declarationId);
    // 作家个人成就
    DecAchievement decAchievement = decAchievementDao.getDecAchievementByDeclarationId(declarationId);
    // 作家兼职学术
    List<DecAcade> decAcadeList = decAcadeDao.getListDecAcadeByDeclarationId(declarationId);
    // 作家本套上版教材参编情况
    List<DecLastPosition> decLastPositionList = decLastPositionDao.getListDecLastPositionByDeclarationId(declarationId);
    // 作家主编国家级规划教材情况
    List<DecNationalPlan> decNationalPlanList = decNationalPlanDao.getListDecNationalPlanByDeclarationId(declarationId);
    // 人卫社教材编写情况表
    List<DecTextbookPmph> decTextbookPmphList = decTextbookPmphDao.getListDecTextbookPmphByDeclarationId(declarationId);
    // 其他社教材编写情况
    List<DecTextbook> decTextbookList = decTextbookDao.getListDecTextbookByDeclarationId(declarationId);
    // 参加人卫慕课、数字教材编写情况表
    DecMoocDigital decMoocDigital = decMoocDigitalDao.getDecMoocDigitalByDeclarationId(declarationId);
    // 作家精品课程建设情况
    List<DecCourseConstruction> decCourseConstruction = decCourseConstructionDao.getDecCourseConstructionByDeclarationId(declarationId);
    // 作家科研情况
    List<DecResearch> decResearchList = decResearchDao.getListDecResearchByDeclarationId(declarationId);
    // 主编学术专著情况
    List<DecMonograph> decMonographList = decMonographDao.getListDecMonographByDeclarationId(declarationId);
    // 出版行业获奖情况
    List<DecPublishReward> decPublishRewardList = decPublishRewardDao.getListDecPublishRewardByDeclarationId(declarationId);
    // SCI论文投稿及影响因子情况
    List<DecSci> decSciList = decSciDao.getListDecSciByDeclarationId(declarationId);
    // 临床医学获奖情况
    List<DecClinicalReward> decClinicalRewardList = decClinicalRewardDao.getListDecClinicalRewardByDeclarationId(declarationId);
    // 学术荣誉授予情况
    List<DecAcadeReward> decAcadeRewardList = decAcadeRewardDao.getListDecAcadeRewardByDeclarationId(declarationId);
    // 作家扩展项
    List<DecExtensionVO> decExtensionList = decExtensionDao.getListDecExtensionByDeclarationId(declarationId);
    // 编写内容意向表
    DecIntention decIntention = decIntentionDao.getDecIntentionByDeclarationId(declarationId);
    // 是否选择必填
    Material material = materialService.getMaterialById(declaration.getMaterialId());
    // 把查询出来的信息添加进applicationVO
    applicationVO.setDecPositionList(decPositionList);
    applicationVO.setDecPositionPublishedVOs(decPositionPublishedVOs);
    applicationVO.setDeclaration(declaration);
    applicationVO.setDecEduExpList(decEduExpList);
    applicationVO.setDecWorkExpList(decWorkExpList);
    applicationVO.setDecTeachExpList(decTeachExpList);
    applicationVO.setDecAchievement(decAchievement);
    applicationVO.setDecAcadeList(decAcadeList);
    applicationVO.setDecLastPositionList(decLastPositionList);
    applicationVO.setDecNationalPlanList(decNationalPlanList);
    applicationVO.setDecTextbookPmphList(decTextbookPmphList);
    applicationVO.setDecTextbookList(decTextbookList);
    applicationVO.setDecMoocDigital(decMoocDigital);
    applicationVO.setDecCourseConstruction(decCourseConstruction);
    applicationVO.setDecResearchList(decResearchList);
    applicationVO.setDecMonographList(decMonographList);
    applicationVO.setDecPublishRewardList(decPublishRewardList);
    applicationVO.setDecSciList(decSciList);
    applicationVO.setDecClinicalRewardList(decClinicalRewardList);
    applicationVO.setDecAcadeRewardList(decAcadeRewardList);
    applicationVO.setDecExtensionList(decExtensionList);
    applicationVO.setDecIntention(decIntention);
    applicationVO.setMaterial(material);
    return applicationVO;
}
Also used : DecMonograph(com.bc.pmpheep.back.po.DecMonograph) DecEduExp(com.bc.pmpheep.back.po.DecEduExp) DecTextbookPmph(com.bc.pmpheep.back.po.DecTextbookPmph) DecAchievement(com.bc.pmpheep.back.po.DecAchievement) DecSci(com.bc.pmpheep.back.po.DecSci) DecPositionPublishedVO(com.bc.pmpheep.back.vo.DecPositionPublishedVO) DecClinicalReward(com.bc.pmpheep.back.po.DecClinicalReward) DeclarationOrDisplayVO(com.bc.pmpheep.back.vo.DeclarationOrDisplayVO) WriterUser(com.bc.pmpheep.back.po.WriterUser) DecMoocDigital(com.bc.pmpheep.back.po.DecMoocDigital) DecTextbook(com.bc.pmpheep.back.po.DecTextbook) DecLastPosition(com.bc.pmpheep.back.po.DecLastPosition) DecPublishReward(com.bc.pmpheep.back.po.DecPublishReward) DecExtensionVO(com.bc.pmpheep.back.vo.DecExtensionVO) DecAcade(com.bc.pmpheep.back.po.DecAcade) Material(com.bc.pmpheep.back.po.Material) DecIntention(com.bc.pmpheep.back.po.DecIntention) DecPositionDisplayVO(com.bc.pmpheep.back.vo.DecPositionDisplayVO) DecCourseConstruction(com.bc.pmpheep.back.po.DecCourseConstruction) DecTeachExp(com.bc.pmpheep.back.po.DecTeachExp) DecWorkExp(com.bc.pmpheep.back.po.DecWorkExp) DecResearch(com.bc.pmpheep.back.po.DecResearch) ApplicationVO(com.bc.pmpheep.back.vo.ApplicationVO) DecNationalPlan(com.bc.pmpheep.back.po.DecNationalPlan) DecAcadeReward(com.bc.pmpheep.back.po.DecAcadeReward)

Example 27 with WriterUser

use of com.bc.pmpheep.back.po.WriterUser in project pmph by BCSquad.

the class WriterUserServiceImpl method updateWriterUserOfBack.

@Override
public String updateWriterUserOfBack(WriterUser writerUser) throws CheckedServiceException {
    WriterUser username = writerUserDao.get(writerUser.getId());
    if (!writerUser.getUsername().equals(username.getUsername())) {
        throw new CheckedServiceException(CheckedExceptionBusiness.USER_MANAGEMENT, CheckedExceptionResult.ILLEGAL_PARAM, "用户代码不相同");
    }
    if (StringUtil.strLength(writerUser.getUsername()) > 20) {
        throw new CheckedServiceException(CheckedExceptionBusiness.USER_MANAGEMENT, CheckedExceptionResult.NULL_PARAM, "用户名需要小于20字符");
    }
    if (StringUtil.strLength(writerUser.getRealname()) > 20) {
        throw new CheckedServiceException(CheckedExceptionBusiness.USER_MANAGEMENT, CheckedExceptionResult.NULL_PARAM, "姓名需要小于20字符");
    }
    if (!StringUtil.isEmpty(writerUser.getHandphone())) {
        if (!ValidatUtil.checkMobileNumber(writerUser.getHandphone())) {
            throw new CheckedServiceException(CheckedExceptionBusiness.USER_MANAGEMENT, CheckedExceptionResult.NULL_PARAM, "电话格式不正确");
        }
    }
    if (!StringUtil.isEmpty(writerUser.getEmail())) {
        if (!ValidatUtil.checkEmail(writerUser.getEmail())) {
            throw new CheckedServiceException(CheckedExceptionBusiness.USER_MANAGEMENT, CheckedExceptionResult.NULL_PARAM, "邮箱格式不正确");
        }
    }
    if (!StringUtil.isEmpty(writerUser.getNote())) {
        if (StringUtil.strLength(writerUser.getNote()) > 100) {
            throw new CheckedServiceException(CheckedExceptionBusiness.USER_MANAGEMENT, CheckedExceptionResult.NULL_PARAM, "备注需要小于100字符");
        }
    }
    if (StringUtil.strLength(writerUser.getPosition()) > 36) {
        throw new CheckedServiceException(CheckedExceptionBusiness.USER_MANAGEMENT, CheckedExceptionResult.ILLEGAL_PARAM, "职务需要小于36字符");
    }
    if (StringUtil.strLength(writerUser.getTitle()) > 30) {
        throw new CheckedServiceException(CheckedExceptionBusiness.USER_MANAGEMENT, CheckedExceptionResult.ILLEGAL_PARAM, "职称需要小于30字符");
    }
    int num = writerUserDao.update(writerUser);
    String result = "FAIL";
    if (num > 0) {
        result = "SUCCESS";
    }
    return result;
}
Also used : CheckedServiceException(com.bc.pmpheep.service.exception.CheckedServiceException) WriterUser(com.bc.pmpheep.back.po.WriterUser)

Example 28 with WriterUser

use of com.bc.pmpheep.back.po.WriterUser in project pmph by BCSquad.

the class WriterUserServiceImpl method resetPassword.

@Override
public String resetPassword(Long id) throws CheckedServiceException {
    if (null == id) {
        throw new CheckedServiceException(CheckedExceptionBusiness.USER_MANAGEMENT, CheckedExceptionResult.NULL_PARAM, "参数为空");
    }
    String password = "888888";
    WriterUser user = writerUserDao.get(id);
    DesRun desRun = new DesRun(user.getUsername(), password);
    user.setPassword(desRun.enpsw);
    writerUserDao.update(user);
    return password;
}
Also used : DesRun(com.bc.pmpheep.back.util.DesRun) CheckedServiceException(com.bc.pmpheep.service.exception.CheckedServiceException) WriterUser(com.bc.pmpheep.back.po.WriterUser)

Example 29 with WriterUser

use of com.bc.pmpheep.back.po.WriterUser in project pmph by BCSquad.

the class SystemMessageService method materialSend.

/**
 * 遴选公告发布时,给学校管理员和学校教师发送消息,通知他们留意报名情况或者是参加报名
 *
 * @author Mryang
 * @createDate 2017年11月17日 上午9:28:13
 * @param materialName
 *            教材名称
 * @param ids
 *            发送的机构id集合(新增或者增加的机构)
 * @param msgId
 *            消息id,没有发布过 则为null
 * @param isOnlyManager
 *            是否只发给管理员
 * @throws CheckedServiceException
 * @throws IOException
 * @return
 */
public void materialSend(Long materialId, List<Long> ids, boolean isOnlyManager) throws CheckedServiceException, IOException {
    String materialName = materialService.getMaterialNameById(materialId);
    if (StringUtils.isEmpty(materialName)) {
        throw new CheckedServiceException(CheckedExceptionBusiness.MESSAGE, CheckedExceptionResult.NULL_PARAM, "消息体为空");
    }
    if (null == ids || ids.size() == 0) {
        throw new CheckedServiceException(CheckedExceptionBusiness.MESSAGE, CheckedExceptionResult.NULL_PARAM, "消息接收对象为空");
    }
    // 向教师发送消息
    if (!isOnlyManager) {
        String tercherMsg = "《<font color='red'>" + materialName + "</font>》已经开始申报,请您留意";
        String msg_id = null;
        // mogodb保存消息体
        Message message = new Message(tercherMsg);
        message = messageService.add(message);
        msg_id = message.getId();
        // 获取这些机构启用的作家用户
        List<WriterUser> writerUserList = writerUserService.getWriterUserListByOrgIds(ids);
        if (null != writerUserList && writerUserList.size() > 0) {
            List<UserMessage> userMessageList = new ArrayList<UserMessage>(writerUserList.size());
            List<String> userIds = new ArrayList<String>(writerUserList.size());
            for (WriterUser writerUser : writerUserList) {
                // 信息是由系统发出
                UserMessage userMessage = new UserMessage(msg_id, messageTitle, new Short("0"), 0L, new Short("0"), writerUser.getId(), new Short("2"), materialId);
                userMessageList.add(userMessage);
                userIds.add("2_" + writerUser.getId());
            }
            // 批量插入消息
            userMessageService.addUserMessageBatch(userMessageList);
            // websocket推送页面消息
            WebScocketMessage webScocketMessage = new WebScocketMessage(msg_id, Const.MSG_TYPE_0, 0L, "系统", Const.SENDER_TYPE_0, Const.SEND_MSG_TYPE_0, RouteUtil.DEFAULT_USER_AVATAR, messageTitle, tercherMsg, DateUtil.getCurrentTime());
            myWebSocketHandler.sendWebSocketMessageToUser(userIds, webScocketMessage);
        }
    }
    // 向管理员发送消息
    String managerMsg = "《<font color='red'>" + materialName + "</font>》已经开始申报,请您留意教职工的报名情况";
    Message message = new Message(managerMsg);
    message = messageService.add(message);
    String msg_id = message.getId();
    // 获取这些机构的管理员
    List<OrgUser> orgUserList = orgUserService.getOrgUserListByOrgIds(ids);
    if (null != orgUserList && orgUserList.size() > 0) {
        List<UserMessage> userMessageList = new ArrayList<UserMessage>(orgUserList.size());
        List<String> userIds = new ArrayList<String>(orgUserList.size());
        for (OrgUser orgUser : orgUserList) {
            UserMessage userMessage = new UserMessage(msg_id, messageTitle, new Short("0"), 0L, new Short("0"), orgUser.getId(), new Short("3"), materialId);
            userMessageList.add(userMessage);
            userIds.add("3_" + orgUser.getId());
        }
        // 批量插入消息
        userMessageService.addUserMessageBatch(userMessageList);
        // websocket推送页面消息
        WebScocketMessage webScocketMessage = new WebScocketMessage(msg_id, Const.MSG_TYPE_0, 0L, "系统", Const.SENDER_TYPE_0, Const.SEND_MSG_TYPE_0, RouteUtil.DEFAULT_USER_AVATAR, messageTitle, managerMsg, DateUtil.getCurrentTime());
        myWebSocketHandler.sendWebSocketMessageToUser(userIds, webScocketMessage);
    }
    return;
}
Also used : UserMessage(com.bc.pmpheep.back.po.UserMessage) WebScocketMessage(com.bc.pmpheep.websocket.WebScocketMessage) Message(com.bc.pmpheep.general.po.Message) OrgUser(com.bc.pmpheep.back.po.OrgUser) ArrayList(java.util.ArrayList) CheckedServiceException(com.bc.pmpheep.service.exception.CheckedServiceException) UserMessage(com.bc.pmpheep.back.po.UserMessage) WebScocketMessage(com.bc.pmpheep.websocket.WebScocketMessage) WriterUser(com.bc.pmpheep.back.po.WriterUser)

Example 30 with WriterUser

use of com.bc.pmpheep.back.po.WriterUser in project pmph by BCSquad.

the class MigrationPlus method topic.

protected void topic() {
    Topic topic = new Topic(4017L, "内科学", 1, new Timestamp(445555L), 2, 123, 210, "医学", 1, 1, 17L, 21, 2000, false, null, null, null, null, 3, "内容丰富", new Timestamp(755564L), true, 15L, false, null, true, 35L, false, null, true, 423L, true, false, false, "基础覆盖面广", null, null, null, null, new Timestamp(446666L));
    topic = topicService.add(topic);
    TopicExtra topicExtra = new TopicExtra(topic.getId(), "丰富学生基础理论的辅导教材", "出版价值高", "内科学的基础理论");
    topicExtraService.add(topicExtra);
    WriterUser writerUser = writerUserService.get(topic.getUserId());
    TopicWriter topicWriter = new TopicWriter(topic.getId(), writerUser.getRealname(), writerUser.getSex(), 47, writerUser.getPosition(), writerUser.getWorkPlace());
    topicWriertService.add(topicWriter);
    Topic topic1 = new Topic(4018L, "外科学", 1, new Timestamp(455985L), 2, 115, 200, "医学", 1, 1, 18L, 18, 1200, false, null, null, null, null, 2, "重复", new Timestamp(765464l), true, 15L, false, null, true, 35L, false, null, true, 546L, true, false, false, "退回", null, null, null, null, new Timestamp(456000L));
    topic1 = topicService.add(topic1);
    TopicExtra topicExtra1 = new TopicExtra(topic1.getId(), "注重临床经验", "实用,工具书", "临床技术");
    topicExtraService.add(topicExtra1);
    WriterUser writerUser1 = writerUserService.get(topic1.getUserId());
    TopicWriter topicWriter1 = new TopicWriter(topic1.getId(), writerUser1.getRealname(), writerUser1.getSex(), 45, writerUser1.getPosition(), writerUser1.getWorkPlace());
    topicWriertService.add(topicWriter1);
    Topic topic2 = new Topic(4020L, "脑科学", 1, new Timestamp(435648L), 2, 95, 175, "医学", 1, 4, 20L, 17, 2600, false, null, null, null, null, 1, null, null, true, 15L, false, null, null, 35L, false, null, false, null, false, false, false, null, null, null, null, null, new Timestamp(445648L));
    topic2 = topicService.add(topic2);
    TopicExtra topicExtra2 = new TopicExtra(topic2.getId(), "前沿技术", "科普读物", "介绍脑科学研究的发展");
    topicExtraService.add(topicExtra2);
    WriterUser writerUser2 = writerUserService.get(topic2.getUserId());
    TopicWriter topicWriter2 = new TopicWriter(topic2.getId(), writerUser2.getRealname(), writerUser2.getSex(), 51, writerUser2.getPosition(), writerUser2.getWorkPlace());
    topicWriertService.add(topicWriter2);
    Topic topic3 = new Topic(4025L, "医学遗传学", 2, new Timestamp(452135L), 4, 135, 785, "遗传学", 0, 3, 25L, 26, 2100, true, "Medical Genetics", "林恩·乔德", "美国", "1", 1, null, null, true, 15L, false, null, true, 35L, true, "其他受理选题", false, 419L, false, false, false, null, null, null, null, null, new Timestamp(453135L));
    topic3 = topicService.add(topic3);
    TopicExtra topicExtra3 = new TopicExtra(topic3.getId(), "国外经典教材", "工具书", "最新译本");
    topicExtraService.add(topicExtra3);
    WriterUser writerUser3 = writerUserService.get(topic3.getUserId());
    TopicWriter topicWriter3 = new TopicWriter(topic3.getId(), writerUser3.getRealname(), writerUser3.getSex(), 53, writerUser3.getPosition(), writerUser3.getWorkPlace());
    topicWriertService.add(topicWriter3);
    Topic topic4 = new Topic(4030L, "社会心理学", 1, new Timestamp(475625L), 2, 1210, 179, "心理学", 2, 5, 30L, 27, 3100, false, null, null, null, null, 1, null, null, true, 15L, true, "不属于本部门领域", false, 35L, false, null, false, null, false, false, false, null, null, null, null, null, new Timestamp(476522L));
    topic4 = topicService.add(topic4);
    TopicExtra topicExtra4 = new TopicExtra(topic4.getId(), "心理学必修教材", "重要,必修课程", "基础理论");
    topicExtraService.add(topicExtra4);
    WriterUser writerUser4 = writerUserService.get(topic4.getId());
    TopicWriter topicWriter4 = new TopicWriter(topic4.getId(), writerUser4.getRealname(), writerUser4.getSex(), 37, writerUser4.getPosition(), writerUser4.getWorkPlace());
    topicWriertService.add(topicWriter4);
    Topic topic5 = new Topic(4035L, "人体解剖学", 0, new Timestamp(423654L), 1, 97, 1098, "医学", 0, 3, 35L, 14, 3300, false, null, null, null, null, 1, null, null, true, 15L, false, null, false, null, false, null, false, null, false, false, false, null, null, null, null, null, new Timestamp(433654L));
    topic5 = topicService.add(topic5);
    TopicExtra topicExtra5 = new TopicExtra(topic5.getId(), "医学院学生必读辅导书", "重要", "人体图解");
    topicExtraService.add(topicExtra5);
    WriterUser writerUser5 = writerUserService.get(topic5.getUserId());
    TopicWriter topicWriter5 = new TopicWriter(topic5.getId(), writerUser5.getRealname(), writerUser5.getSex(), 46, writerUser5.getPosition(), writerUser5.getWorkPlace());
    topicWriertService.add(topicWriter5);
    Topic topic6 = new Topic(4050L, "医学统计学", 1, new Timestamp(413564L), 3, 1150, 108, "医学", 1, 1, 50L, 18, 1100, false, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, true, null, null, null, null, null, null, null);
    topic6 = topicService.add(topic6);
    TopicExtra topicExtra6 = new TopicExtra(topic6.getId(), "辅助教材", "基础教材", "统计学在医学上的应用");
    topicExtraService.add(topicExtra6);
    WriterUser writerUser6 = writerUserService.get(topic6.getUserId());
    TopicWriter topicWriter6 = new TopicWriter(topic6.getId(), writerUser6.getRealname(), writerUser6.getSex(), 52, writerUser6.getPosition(), writerUser6.getWorkPlace());
    topicWriertService.add(topicWriter6);
}
Also used : TopicWriter(com.bc.pmpheep.back.po.TopicWriter) TopicExtra(com.bc.pmpheep.back.po.TopicExtra) WriterUser(com.bc.pmpheep.back.po.WriterUser) Topic(com.bc.pmpheep.back.po.Topic) Timestamp(java.sql.Timestamp)

Aggregations

WriterUser (com.bc.pmpheep.back.po.WriterUser)49 BaseTest (com.bc.pmpheep.test.BaseTest)26 Test (org.junit.Test)26 Rollback (org.springframework.test.annotation.Rollback)24 CheckedServiceException (com.bc.pmpheep.service.exception.CheckedServiceException)17 ArrayList (java.util.ArrayList)14 PmphUser (com.bc.pmpheep.back.po.PmphUser)11 UserMessage (com.bc.pmpheep.back.po.UserMessage)7 OrgUser (com.bc.pmpheep.back.po.OrgUser)6 WebScocketMessage (com.bc.pmpheep.websocket.WebScocketMessage)6 DesRun (com.bc.pmpheep.back.util.DesRun)4 Message (com.bc.pmpheep.general.po.Message)4 HashMap (java.util.HashMap)4 PageResult (com.bc.pmpheep.back.plugin.PageResult)3 MyMessageVO (com.bc.pmpheep.back.vo.MyMessageVO)3 PageParameter (com.bc.pmpheep.back.plugin.PageParameter)2 Material (com.bc.pmpheep.back.po.Material)2 MessageAttachment (com.bc.pmpheep.back.po.MessageAttachment)2 Org (com.bc.pmpheep.back.po.Org)2 PmphRole (com.bc.pmpheep.back.po.PmphRole)2