Search in sources :

Example 1 with DecTextbookPmph

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

the class WordHelper method fillDecTextbookPmphData.

private XWPFTable fillDecTextbookPmphData(XWPFTable table, List<DecTextbookPmph> decTextbookPmphs) {
    if (CollectionUtil.isEmpty(decTextbookPmphs)) {
        return table;
    }
    if (decTextbookPmphs.size() > 1) {
        int height = table.getRow(1).getHeight();
        for (int i = 1; i < decTextbookPmphs.size(); i++) {
            table.createRow().setHeight(height);
        }
    }
    List<XWPFTableRow> rows = table.getRows();
    List<XWPFTableCell> cells;
    int rowCount = 1;
    for (DecTextbookPmph decTextbookPmph : decTextbookPmphs) {
        cells = rows.get(rowCount).getTableCells();
        String value = decTextbookPmph.getMaterialName();
        if (StringUtil.notEmpty(value)) {
            cells.get(0).setText(value);
        }
        /* 0=无/1=国家/2=省部/3=协编/4=校本/5=其他教材 */
        Integer rank = decTextbookPmph.getRank();
        if (null != rank) {
            switch(rank) {
                case 0:
                    value = "无";
                case 1:
                    value = "国家";
                    break;
                case 2:
                    value = "省部";
                    break;
                case 3:
                    value = "协编";
                    break;
                case 4:
                    value = "校本";
                    break;
                case 5:
                    value = "其他教材";
                    break;
                default:
                    value = "其他";
                    break;
            }
            cells.get(1).setText(value);
        }
        // 0=无/1=主编/2=副主编/3=编委
        Integer position = decTextbookPmph.getPosition();
        if (null != position) {
            switch(position) {
                case 1:
                    value = "主编";
                    break;
                case 2:
                    value = "副主编";
                    break;
                case 3:
                    value = "编委";
                    break;
                case 4:
                    value = "数字编委";
                    break;
                default:
                    value = "无";
                    break;
            }
            cells.get(2).setText(value);
        }
        Date publishDate = decTextbookPmph.getPublishDate();
        if (null != publishDate) {
            value = sdf.format(publishDate);
            cells.get(3).setText(value);
        }
        value = decTextbookPmph.getIsbn();
        if (StringUtil.notEmpty(value)) {
            cells.get(4).setText(value);
        }
        value = decTextbookPmph.getNote();
        if (StringUtil.notEmpty(value)) {
            cells.get(5).setText(value);
        }
        for (XWPFTableCell cell : cells) {
            cell.setVerticalAlignment(XWPFVertAlign.CENTER);
        }
        rowCount++;
    }
    return table;
}
Also used : BigInteger(java.math.BigInteger) XWPFTableCell(org.apache.poi.xwpf.usermodel.XWPFTableCell) DecTextbookPmph(com.bc.pmpheep.back.po.DecTextbookPmph) Date(java.util.Date) XWPFTableRow(org.apache.poi.xwpf.usermodel.XWPFTableRow)

Example 2 with DecTextbookPmph

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

the class MigrationStageSix method decTextbook.

/**
 * 作家教材编写情况表
 */
protected void decTextbook() {
    // 要迁移的旧库表名
    String tableName = "writer_materwrite ";
    // 增加new_pk字段
    JdbcHelper.addColumn(tableName);
    String sql = "select wm.materwriteid,wm.writerid,wm.matername,wm.publishing," + "case when level like '%1%' then 1 when level like '%2%' then 2 " + "when level like '%3%,%4%' then 4 " + "when level like '%3%' then 5 when level like '%4%' then 4 " + "else 5 end rank," + "case when wm.duty like '%1%' then 1 when wm.duty like '%2%' then 2 " + "else 3 end position,wm.booknumber,wm.remark,wm.publisdate,wd.new_pk id " + "from writer_materwrite wm " + "left join writer_declaration wd on wd.writerid=wm.writerid ";
    List<Map<String, Object>> maps = JdbcHelper.getJdbcTemplate().queryForList(sql);
    // 迁移成功的条目数
    int count = 0;
    int declarationidCount = 0;
    List<Map<String, Object>> excel = new LinkedList<>();
    Map<String, Object> result = new LinkedHashMap<>();
    int correctCount = 0;
    int[] state = { 0 };
    StringBuilder reason = new StringBuilder();
    StringBuilder dealWith = new StringBuilder();
    /* 开始遍历查询结果 */
    for (Map<String, Object> map : maps) {
        StringBuilder sb = new StringBuilder();
        // 旧表主键值
        String id = (String) map.get("materwriteid");
        // 申报表id
        Long declarationid = (Long) map.get("id");
        // 教材名称
        String materialName = (String) map.get("matername");
        // 教材级别
        Long rankJudge = (Long) map.get("rank");
        // 编写职务
        Long positionJudge = (Long) map.get("position");
        // 出版社
        String publisher = (String) map.get("publishing");
        // 出版时间
        Date publishDate = (Date) map.get("publisdate");
        // 标准书号
        String isbn = (String) map.get("booknumber");
        DecTextbook decTextbook = new DecTextbook();
        DecTextbookPmph decTextbookPmph = new DecTextbookPmph();
        if (ObjectUtil.isNull(declarationid) || declarationid.intValue() == 0) {
            map.put(SQLParameters.EXCEL_EX_HEADER, sb.append("未找到申报表对应的关联结果。"));
            excel.add(map);
            logger.debug("未找到申报表对应的关联结果,此结果将被记录在Excel中");
            declarationidCount++;
            if (state[0] == 0) {
                reason.append("找不到对应的申报作家。");
                dealWith.append("放弃迁移。");
                state[0] = 1;
            }
            continue;
        }
        if (StringUtil.notEmpty(isbn)) {
            isbn = isbn.trim();
            isbn = isbn.replace("ISBN", "ISBN ").replace("isbn", "ISBN ").replace(":", "").replace(":", "").replace("、", "/").replace(".", "·").replace("*", "·").replace("•", "·");
        }
        Integer rank;
        if (ObjectUtil.isNull(rankJudge)) {
            rank = 0;
        } else {
            rank = rankJudge.intValue();
        }
        if (ObjectUtil.isNull(publisher)) {
            publisher = "未填写";
        }
        int position;
        if (ObjectUtil.isNull(positionJudge)) {
            position = 5;
        } else {
            position = positionJudge.intValue();
        }
        long pk;
        if (!"人民卫生出版社".equals(publisher.trim())) {
            decTextbook.setDeclarationId(declarationid);
            decTextbook.setMaterialName(materialName);
            decTextbook.setRank(rank);
            decTextbook.setPosition(position);
            decTextbook.setPublisher(publisher);
            decTextbook.setPublishDate(publishDate);
            decTextbook.setIsbn(isbn);
            // 备注
            decTextbook.setNote((String) map.get("remark"));
            // 显示顺序
            decTextbook.setSort(999);
            decTextbook = decTextbookService.addDecTextbook(decTextbook);
            pk = decTextbook.getId();
        } else {
            decTextbookPmph.setDeclarationId(declarationid);
            decTextbookPmph.setMaterialName(materialName);
            decTextbookPmph.setRank(rank);
            decTextbookPmph.setPosition(position);
            decTextbookPmph.setPublishDate(publishDate);
            decTextbookPmph.setIsbn(isbn);
            // 备注
            decTextbookPmph.setNote((String) map.get("remark"));
            // 显示顺序
            decTextbookPmph.setSort(999);
            decTextbookPmph = decTextbookPmphService.addDecTextbookPmph(decTextbookPmph);
            pk = decTextbookPmph.getId();
        }
        JdbcHelper.updateNewPrimaryKey(tableName, pk, "materwriteid", id);
        count++;
        if (null == map.get("exception")) {
            correctCount++;
        }
    }
    if (excel.size() > 0) {
        try {
            excelHelper.exportFromMaps(excel, "作家教材编写情况表", "dec_textbook");
        } catch (IOException ex) {
            logger.error("异常数据导出到Excel失败", ex);
        }
    }
    if (correctCount != maps.size()) {
        result.put(SQLParameters.EXCEL_HEADER_TABLENAME, "dec_textbook");
        result.put(SQLParameters.EXCEL_HEADER_DESCRIPTION, "作家教材编写情况表");
        result.put(SQLParameters.EXCEL_HEADER_SUM_DATA, maps.size());
        result.put(SQLParameters.EXCEL_HEADER_MIGRATED_DATA, count);
        result.put(SQLParameters.EXCEL_HEADER_CORECT_DATA, correctCount);
        result.put(SQLParameters.EXCEL_HEADER_TRANSFERED_DATA, count - correctCount);
        result.put(SQLParameters.EXCEL_HEADER_NO_MIGRATED_DATA, maps.size() - count);
        result.put(SQLParameters.EXCEL_HEADER_EXCEPTION_REASON, reason.toString());
        result.put(SQLParameters.EXCEL_HEADER_DEAL_WITH, dealWith.toString());
        SQLParameters.STATISTICS_RESULT.add(result);
    }
    logger.info("未找到申报表对应的关联结果数量:{}", declarationidCount);
    logger.info("writer_materwrite表迁移完成,异常条目数量:{}", excel.size());
    logger.info("原数据库中共有{}条数据,迁移了{}条数据", maps.size(), count);
    // 记录信息
    Map<String, Object> msg = new HashMap<String, Object>();
    msg.put("result", "" + tableName + "  表迁移完成" + count + "/" + maps.size());
    SQLParameters.STATISTICS.add(msg);
}
Also used : HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) DecTextbook(com.bc.pmpheep.back.po.DecTextbook) IOException(java.io.IOException) LinkedList(java.util.LinkedList) Date(java.util.Date) DecTextbookPmph(com.bc.pmpheep.back.po.DecTextbookPmph) LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap)

Example 3 with DecTextbookPmph

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

the class MigrationStageSix method decTextbookOther.

protected void decTextbookOther() {
    // 要迁移的旧库表名
    String tableName = "writer_othermaterwrite ";
    // 增加new_pk字段
    JdbcHelper.addColumn(tableName);
    String sql = "select wo.othermaterwriteid,wo.writerid,wo.matername," + "case when wo.duty like '%1%' then 1 when wo.duty like '%2%' then 2 " + "else 3 end position," + "wo.publishing," + "if(wo.publisdate='0000-00-00 00:00:00'," + "STR_TO_DATE('2017-01-01 14:17:17','%Y-%c-%d %H:%i:%s'),wo.publisdate)publisdates," + "wo.booknumber,wo.remark,wd.new_pk id " + "from writer_othermaterwrite wo " + "left join writer_declaration wd on wd.writerid=wo.writerid ";
    List<Map<String, Object>> maps = JdbcHelper.getJdbcTemplate().queryForList(sql);
    // 迁移成功的条目数
    int count = 0;
    int declarationidCount = 0;
    List<Map<String, Object>> excel = new LinkedList<>();
    Map<String, Object> result = new LinkedHashMap<>();
    int correctCount = 0;
    int[] state = { 0 };
    StringBuilder reason = new StringBuilder();
    StringBuilder dealWith = new StringBuilder();
    /* 开始遍历查询结果 */
    for (Map<String, Object> map : maps) {
        StringBuilder sb = new StringBuilder();
        // 旧表主键值
        String id = (String) map.get("othermaterwriteid");
        // 申报表id
        Long declarationid = (Long) map.get("id");
        // 教材名称
        String materialName = (String) map.get("matername");
        // 编写职务
        Long positionJudge = (Long) map.get("position");
        // 出版社
        String publisher = (String) map.get("publishing");
        // 出版时间
        Date publishDate = (Date) map.get("publisdates");
        // 标准书号
        String isbn = (String) map.get("booknumber");
        DecTextbook decTextbook = new DecTextbook();
        DecTextbookPmph decTextbookPmph = new DecTextbookPmph();
        if (ObjectUtil.isNull(declarationid) || declarationid.intValue() == 0) {
            map.put(SQLParameters.EXCEL_EX_HEADER, sb.append("未找到申报表对应的关联结果。"));
            excel.add(map);
            logger.debug("未找到申报表对应的关联结果,此结果将被记录在Excel中");
            declarationidCount++;
            if (state[0] == 0) {
                reason.append("找不到对应的申报作家。");
                dealWith.append("放弃迁移。");
                state[0] = 1;
            }
            continue;
        }
        if (StringUtil.notEmpty(isbn)) {
            isbn = isbn.trim();
            isbn = isbn.replace("ISBN", "ISBN ").replace("isbn", "ISBN ").replace(":", "").replace(":", "").replace("、", "/").replace(".", "·").replace("*", "·").replace("•", "·");
        }
        if (ObjectUtil.isNull(publisher)) {
            publisher = "未填写";
        }
        int position;
        if (ObjectUtil.isNull(positionJudge)) {
            position = 5;
        } else {
            position = positionJudge.intValue();
        }
        long pk;
        if (!"人民卫生出版社".equals(publisher.trim())) {
            decTextbook.setDeclarationId(declarationid);
            decTextbook.setMaterialName(materialName);
            // 教材级别(设置成无)
            decTextbook.setRank(0);
            decTextbook.setPosition(position);
            String publishers = publisher.trim();
            if (StringUtil.length(publishers) > 50 || "-1819".equals(id)) {
                publishers.substring(0, 7);
                decTextbook.setPublisher(publishers);
            } else {
                decTextbook.setPublisher(publishers);
            }
            decTextbook.setPublishDate(publishDate);
            decTextbook.setIsbn(isbn);
            // 备注
            decTextbook.setNote((String) map.get("remark"));
            // 显示顺序
            decTextbook.setSort(999);
            decTextbook = decTextbookService.addDecTextbook(decTextbook);
            pk = decTextbook.getId();
        } else {
            decTextbookPmph.setDeclarationId(declarationid);
            decTextbookPmph.setMaterialName(materialName);
            // 教材级别(设置成无)
            decTextbookPmph.setRank(0);
            decTextbookPmph.setPosition(position);
            decTextbookPmph.setPublishDate(publishDate);
            decTextbookPmph.setIsbn(isbn);
            // 备注
            decTextbookPmph.setNote((String) map.get("remark"));
            // 显示顺序
            decTextbookPmph.setSort(999);
            decTextbookPmph = decTextbookPmphService.addDecTextbookPmph(decTextbookPmph);
            pk = decTextbookPmph.getId();
        }
        JdbcHelper.updateNewPrimaryKey(tableName, pk, "othermaterwriteid", id);
        count++;
        if (null == map.get("exception")) {
            correctCount++;
        }
    }
    if (excel.size() > 0) {
        try {
            excelHelper.exportFromMaps(excel, "作家教材其它编写情况表", "dec_textbookOther");
        } catch (IOException ex) {
            logger.error("异常数据导出到Excel失败", ex);
        }
    }
    if (correctCount != maps.size()) {
        result.put(SQLParameters.EXCEL_HEADER_TABLENAME, "dec_textbookOther");
        result.put(SQLParameters.EXCEL_HEADER_DESCRIPTION, "作家其他教材编写情况表");
        result.put(SQLParameters.EXCEL_HEADER_SUM_DATA, maps.size());
        result.put(SQLParameters.EXCEL_HEADER_MIGRATED_DATA, count);
        result.put(SQLParameters.EXCEL_HEADER_CORECT_DATA, correctCount);
        result.put(SQLParameters.EXCEL_HEADER_TRANSFERED_DATA, count - correctCount);
        result.put(SQLParameters.EXCEL_HEADER_NO_MIGRATED_DATA, maps.size() - count);
        result.put(SQLParameters.EXCEL_HEADER_EXCEPTION_REASON, reason.toString());
        result.put(SQLParameters.EXCEL_HEADER_DEAL_WITH, dealWith.toString());
        SQLParameters.STATISTICS_RESULT.add(result);
    }
    logger.info("未找到申报表对应的关联结果数量:{}", declarationidCount);
    logger.info("writer_othermaterwrite表迁移完成,异常条目数量:{}", excel.size());
    logger.info("原数据库中共有{}条数据,迁移了{}条数据", maps.size(), count);
    // 记录信息
    Map<String, Object> msg = new HashMap<String, Object>();
    msg.put("result", "" + tableName + "  表迁移完成" + count + "/" + maps.size());
    SQLParameters.STATISTICS.add(msg);
}
Also used : HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) DecTextbook(com.bc.pmpheep.back.po.DecTextbook) IOException(java.io.IOException) LinkedList(java.util.LinkedList) Date(java.util.Date) DecTextbookPmph(com.bc.pmpheep.back.po.DecTextbookPmph) LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap)

Example 4 with DecTextbookPmph

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

the class ExcelHelper method fillDecTextbookPmphData.

private ColumnProperties fillDecTextbookPmphData(List<DecTextbookPmph> decTextbookPmphs, Row row, ColumnProperties properties) {
    int colCount = properties.getColCount();
    int[] maxLength = properties.getMaxLength();
    if (CollectionUtil.isEmpty(decTextbookPmphs)) {
        for (int i = 0; i < 6; i++) {
            row.createCell(colCount++);
        }
    } else {
        String value;
        List<StringBuilder> builders = new ArrayList<>(6);
        for (int i = 0; i < 6; i++) {
            builders.add(new StringBuilder());
        }
        boolean isFirst = true;
        for (DecTextbookPmph decTextbookPmph : decTextbookPmphs) {
            if (isFirst == false) {
                for (StringBuilder builder : builders) {
                    builder.append("\r\n");
                }
            } else {
                isFirst = false;
            }
            int index = 0;
            value = decTextbookPmph.getMaterialName();
            if (StringUtil.isEmpty(value)) {
                value = "";
            }
            builders.get(index++).append(value);
            if (value.length() > maxLength[colCount]) {
                maxLength[colCount] = value.length();
            }
            colCount++;
            value = "其他";
            switch(decTextbookPmph.getRank()) {
                case 0:
                    value = "无";
                    break;
                case 1:
                    value = "国家";
                    break;
                case 2:
                    value = "省部";
                    break;
                case 3:
                    value = "协编";
                    break;
                case 4:
                    value = "校本";
                    break;
                case 5:
                    value = "其他";
                    break;
                default:
                    break;
            }
            builders.get(index++).append(value);
            if (value.length() > maxLength[colCount]) {
                maxLength[colCount] = value.length();
            }
            colCount++;
            value = "无";
            switch(decTextbookPmph.getPosition()) {
                case 1:
                    value = "主编";
                    break;
                case 2:
                    value = "副主编";
                    break;
                case 3:
                    value = "编委";
                    break;
                default:
                    break;
            }
            builders.get(index++).append(value);
            if (value.length() > maxLength[colCount]) {
                maxLength[colCount] = value.length();
            }
            colCount++;
            value = decTextbookPmph.getIsDigitalEditor() ? "是" : "否";
            builders.get(index++).append(value);
            if (value.length() > maxLength[colCount]) {
                maxLength[colCount] = value.length();
            }
            colCount++;
            if (ObjectUtil.isNull(decTextbookPmph.getPublishDate())) {
                value = "";
            } else {
                value = sdf.format(decTextbookPmph.getPublishDate());
            }
            builders.get(index++).append(value);
            if (value.length() > maxLength[colCount]) {
                maxLength[colCount] = value.length();
            }
            colCount++;
            value = decTextbookPmph.getIsbn();
            if (StringUtil.isEmpty(value)) {
                value = "";
            }
            builders.get(index++).append(value);
            if (value.length() > maxLength[colCount]) {
                maxLength[colCount] = value.length();
            }
            // 列数复位
            colCount = properties.getColCount();
        }
        for (int i = 0; i < 6; i++) {
            Cell cell = row.createCell(colCount++);
            value = builders.get(i).toString();
            cell.setCellValue(value);
        }
    }
    properties.setColCount(colCount);
    properties.setMaxLength(maxLength);
    return properties;
}
Also used : ArrayList(java.util.ArrayList) Cell(org.apache.poi.ss.usermodel.Cell) DecTextbookPmph(com.bc.pmpheep.back.po.DecTextbookPmph)

Example 5 with DecTextbookPmph

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

Aggregations

DecTextbookPmph (com.bc.pmpheep.back.po.DecTextbookPmph)8 DecTextbook (com.bc.pmpheep.back.po.DecTextbook)6 DecAcade (com.bc.pmpheep.back.po.DecAcade)4 DecAcadeReward (com.bc.pmpheep.back.po.DecAcadeReward)4 DecAchievement (com.bc.pmpheep.back.po.DecAchievement)4 DecClinicalReward (com.bc.pmpheep.back.po.DecClinicalReward)4 DecCourseConstruction (com.bc.pmpheep.back.po.DecCourseConstruction)4 DecEduExp (com.bc.pmpheep.back.po.DecEduExp)4 DecIntention (com.bc.pmpheep.back.po.DecIntention)4 DecLastPosition (com.bc.pmpheep.back.po.DecLastPosition)4 DecMonograph (com.bc.pmpheep.back.po.DecMonograph)4 DecMoocDigital (com.bc.pmpheep.back.po.DecMoocDigital)4 DecNationalPlan (com.bc.pmpheep.back.po.DecNationalPlan)4 DecPublishReward (com.bc.pmpheep.back.po.DecPublishReward)4 DecResearch (com.bc.pmpheep.back.po.DecResearch)4 DecSci (com.bc.pmpheep.back.po.DecSci)4 DecTeachExp (com.bc.pmpheep.back.po.DecTeachExp)4 DecWorkExp (com.bc.pmpheep.back.po.DecWorkExp)4 DecExtensionVO (com.bc.pmpheep.back.vo.DecExtensionVO)4 ArrayList (java.util.ArrayList)4