Search in sources :

Example 1 with Topic

use of com.bc.pmpheep.back.po.Topic 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)

Example 2 with Topic

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

the class TopicServiceImpl method updateByErp.

@Override
public void updateByErp() {
    InfoWorking bookInfoWorking = new InfoWorking();
    JSONArray topicInfo = bookInfoWorking.listTopicInfo();
    Long[] recordIds = new Long[topicInfo.size()];
    Integer total = 0;
    for (int i = 0; i < topicInfo.size(); i++) {
        JSONObject job = topicInfo.getJSONObject(i);
        String auditstates = job.getString("auditstates");
        String topicnumber = job.getString("topicnumber");
        String topicname = job.getString("topicname");
        String vn = job.getString("editionnum");
        recordIds[i] = job.getLong("record_id");
        switch(auditstates) {
            case "11":
                auditstates = "选题通过";
                break;
            case "12":
                auditstates = "转稿";
                break;
            case "13":
                auditstates = "发稿";
                break;
            case "14":
                auditstates = "即将出书";
                break;
            default:
                auditstates = "状态出现错误";
                break;
        }
        Topic topic = new Topic();
        topic.setNote(auditstates);
        topic.setTn(topicnumber);
        topic.setBookname(topicname);
        topic.setVn(vn);
        total += topicDao.updateByVn(topic);
    }
    if (total == topicInfo.size()) {
        bookInfoWorking.updateTopic(recordIds);
    } else {
        throw new CheckedServiceException(CheckedExceptionBusiness.TOPIC, CheckedExceptionResult.NULL_PARAM, "从erp更新教材申报信息失败请查看原因");
    }
}
Also used : JSONObject(net.sf.json.JSONObject) JSONArray(net.sf.json.JSONArray) CheckedServiceException(com.bc.pmpheep.service.exception.CheckedServiceException) Topic(com.bc.pmpheep.back.po.Topic) InfoWorking(com.bc.pmpheep.erp.service.InfoWorking)

Example 3 with Topic

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

the class TopicController method directorHandling.

/**
 * 功能描述:主任操作选题流程
 *
 * @param id
 *            选题申报id
 * @param editorId
 *            部门编辑id
 * @param isRejectedByDirector
 *            主任是否退回
 * @param reasonDirector
 *            退回原因
 * @return
 */
@ResponseBody
@LogDetail(businessType = BUSSINESS_TYPE, logRemark = "主任分配选题给部门编辑")
@RequestMapping(value = "/put/directorHandling", method = RequestMethod.PUT)
public ResponseBean directorHandling(HttpServletRequest request, Long id, Long editorId, Boolean isRejectedByDirector, String reasonDirector) {
    String sessionId = CookiesUtil.getSessionId(request);
    TopicLog topicLog = new TopicLog();
    topicLog.setTopicId(id);
    Topic topic = new Topic();
    topic.setId(id);
    if (ObjectUtil.isNull(isRejectedByDirector)) {
        isRejectedByDirector = false;
    }
    topic.setIsRejectedByDirector(isRejectedByDirector);
    if (isRejectedByDirector) {
        topicLog.setTopicEvent("主任退回选题给运维人员");
        topic.setIsRejectedByEditor(false);
        topic.setReasonEditor("-");
        topic.setIsDirectorHandling(false);
        topic.setReasonDirector(reasonDirector);
    } else {
        topicLog.setTopicEvent("主任分配选题给部门编辑");
        topic.setEditorId(editorId);
        topic.setIsRejectedByEditor(false);
        topic.setIsEditorHandling(true);
    }
    return new ResponseBean(topicService.update(topicLog, sessionId, topic));
}
Also used : ResponseBean(com.bc.pmpheep.controller.bean.ResponseBean) Topic(com.bc.pmpheep.back.po.Topic) TopicLog(com.bc.pmpheep.back.po.TopicLog) LogDetail(com.bc.pmpheep.annotation.LogDetail) ResponseBody(org.springframework.web.bind.annotation.ResponseBody) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 4 with Topic

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

the class TopicController method optsHandling.

/**
 * 功能描述:运维人员分配选题申报给部门
 *
 * @param id
 *            选题id
 * @param departmentId
 *            部门id
 * @return
 */
@ResponseBody
@LogDetail(businessType = BUSSINESS_TYPE, logRemark = "运维人员分配选题给部门")
@RequestMapping(value = "/put/optsHandling", method = RequestMethod.PUT)
public ResponseBean optsHandling(HttpServletRequest request, Long id, Long departmentId) {
    String sessionId = CookiesUtil.getSessionId(request);
    TopicLog topicLog = new TopicLog();
    topicLog.setTopicId(id);
    topicLog.setTopicEvent("运维人员分配选题给部门");
    Topic topic = new Topic();
    topic.setId(id);
    topic.setDepartmentId(departmentId);
    topic.setIsDirectorHandling(true);
    return new ResponseBean(topicService.update(topicLog, sessionId, topic));
}
Also used : ResponseBean(com.bc.pmpheep.controller.bean.ResponseBean) Topic(com.bc.pmpheep.back.po.Topic) TopicLog(com.bc.pmpheep.back.po.TopicLog) LogDetail(com.bc.pmpheep.annotation.LogDetail) ResponseBody(org.springframework.web.bind.annotation.ResponseBody) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 5 with Topic

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

the class TopicController method editorHandling.

/**
 * 功能描述:编辑操作选题申报
 *
 * @param id
 *            选题申报id
 * @param authProgress
 *            审核进度
 * @param authFeedback
 *            审核意见
 * @param
 *
 * @param isAccepted
 *            编辑是否受理
 * @param isRejectedByEditor
 *            是否退回上级
 * @param reasonEditor
 *            退回原因
 * @return
 */
@ResponseBody
@LogDetail(businessType = BUSSINESS_TYPE, logRemark = "编辑对选题进行操作")
@RequestMapping(value = "/put/editorHandling", method = RequestMethod.PUT)
public ResponseBean editorHandling(HttpServletRequest request, Long id, Integer authProgress, String authFeedback, Boolean isRejectedByEditor, Boolean isAccepted, String reasonEditor) {
    String sessionId = CookiesUtil.getSessionId(request);
    TopicLog topicLog = new TopicLog();
    topicLog.setTopicId(id);
    topicLog.setTopicEvent("编辑受理选题");
    Topic topic = new Topic();
    topic.setId(id);
    topic.setIsAccepted(isAccepted);
    if (ObjectUtil.isNull(isAccepted)) {
        if (ObjectUtil.isNull(isRejectedByEditor)) {
            isRejectedByEditor = false;
        }
        topic.setIsRejectedByEditor(isRejectedByEditor);
        if (isRejectedByEditor) {
            topicLog.setTopicEvent("编辑退回选题给主任");
            topic.setEditorId(0L);
            topic.setIsEditorHandling(false);
            topic.setReasonEditor(reasonEditor);
        } else {
            topicLog.setTopicEvent("编辑审核选题申报");
            topic.setAuthDate(DateUtil.getCurrentTime());
            topic.setAuthFeedback(authFeedback);
            topic.setAuthProgress(authProgress);
        }
    }
    return new ResponseBean(topicService.update(topicLog, sessionId, topic));
}
Also used : ResponseBean(com.bc.pmpheep.controller.bean.ResponseBean) Topic(com.bc.pmpheep.back.po.Topic) TopicLog(com.bc.pmpheep.back.po.TopicLog) LogDetail(com.bc.pmpheep.annotation.LogDetail) ResponseBody(org.springframework.web.bind.annotation.ResponseBody) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

Topic (com.bc.pmpheep.back.po.Topic)6 LogDetail (com.bc.pmpheep.annotation.LogDetail)3 TopicLog (com.bc.pmpheep.back.po.TopicLog)3 ResponseBean (com.bc.pmpheep.controller.bean.ResponseBean)3 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)3 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)3 TopicExtra (com.bc.pmpheep.back.po.TopicExtra)1 TopicWriter (com.bc.pmpheep.back.po.TopicWriter)1 WriterUser (com.bc.pmpheep.back.po.WriterUser)1 InfoWorking (com.bc.pmpheep.erp.service.InfoWorking)1 CheckedServiceException (com.bc.pmpheep.service.exception.CheckedServiceException)1 BaseTest (com.bc.pmpheep.test.BaseTest)1 Timestamp (java.sql.Timestamp)1 JSONArray (net.sf.json.JSONArray)1 JSONObject (net.sf.json.JSONObject)1 Test (org.junit.Test)1