Search in sources :

Example 6 with DecNationalPlan

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

the class DeclarationServiceImpl method declarationEtcBO.

@Override
public List<DeclarationEtcBO> declarationEtcBO(Long materialId, String textBookids, String realname, String position, String title, String orgName, String unitName, Integer positionType, Integer onlineProgress, Integer offlineProgress) throws CheckedServiceException, IllegalArgumentException, IllegalAccessException {
    List<DeclarationEtcBO> declarationEtcBOs = new ArrayList<>();
    Gson gson = new Gson();
    List<Long> bookIds = gson.fromJson(textBookids, new TypeToken<ArrayList<Long>>() {
    }.getType());
    List<DeclarationOrDisplayVO> declarationOrDisplayVOs = declarationDao.getDeclarationOrDisplayVOByMaterialId(materialId, bookIds, realname, position, title, orgName, unitName, positionType, onlineProgress, offlineProgress);
    List<Long> decIds = new ArrayList<>();
    for (DeclarationOrDisplayVO declarationOrDisplayVO : declarationOrDisplayVOs) {
        decIds.add(declarationOrDisplayVO.getId());
    }
    // 学习经历
    ArrayList<DecEduExp> decEduExps = (ArrayList<DecEduExp>) decEduExpDao.getListDecEduExpByDeclarationIds(decIds);
    // 工作经历
    ArrayList<DecWorkExp> decWorkExps = (ArrayList<DecWorkExp>) decWorkExpDao.getListDecWorkExpByDeclarationIds(decIds);
    // 教学经历
    ArrayList<DecTeachExp> decTeachExps = (ArrayList<DecTeachExp>) decTeachExpDao.getListDecTeachExpByDeclarationIds(decIds);
    // 兼职学术
    ArrayList<DecAcade> decAcades = (ArrayList<DecAcade>) decAcadeDao.getListDecAcadeByDeclarationIds(decIds);
    // 个人成就
    ArrayList<DecAchievement> decAchievements = (ArrayList<DecAchievement>) decAchievementDao.getDecAchievementByDeclarationIds(decIds);
    // 本套上版教材参编情况
    ArrayList<DecLastPosition> decLastPositions = (ArrayList<DecLastPosition>) decLastPositionDao.getListDecLastPositionByDeclarationIds(decIds);
    // 精品课程建设情况
    ArrayList<DecCourseConstruction> decCourseConstructions = (ArrayList<DecCourseConstruction>) decCourseConstructionDao.getDecCourseConstructionByDeclarationIds(decIds);
    // 主编国家级规划
    ArrayList<DecNationalPlan> decNationalPlans = (ArrayList<DecNationalPlan>) decNationalPlanDao.getListDecNationalPlanByDeclarationIds(decIds);
    // 人卫社教材编写情况表
    ArrayList<DecTextbookPmph> decTextbookPmphs = (ArrayList<DecTextbookPmph>) decTextbookPmphDao.getListDecTextbookPmphByDeclarationIds(decIds);
    // 其他社教材编写情况
    ArrayList<DecTextbook> decTextbooks = (ArrayList<DecTextbook>) decTextbookDao.getListDecTextbookByDeclarationIds(decIds);
    // 参加人卫慕课、数字教材编写情况表
    ArrayList<DecMoocDigital> decMoocDigitals = (ArrayList<DecMoocDigital>) decMoocDigitalDao.getDecMoocDigitalByDeclarationIds(decIds);
    // 作家科研
    ArrayList<DecResearch> decResearchs = (ArrayList<DecResearch>) decResearchDao.getListDecResearchByDeclarationIds(decIds);
    // 主编学术专著情况
    ArrayList<DecMonograph> decMonographList = (ArrayList<DecMonograph>) decMonographDao.getListDecMonographByDeclarationIds(decIds);
    // 出版行业获奖情况
    ArrayList<DecPublishReward> decPublishRewardList = (ArrayList<DecPublishReward>) decPublishRewardDao.getListDecPublishRewardByDeclarationIds(decIds);
    // SCI论文投稿及影响因子情况
    ArrayList<DecSci> decSciList = (ArrayList<DecSci>) decSciDao.getListDecSciByDeclarationIds(decIds);
    // 临床医学获奖情况
    ArrayList<DecClinicalReward> decClinicalRewardList = (ArrayList<DecClinicalReward>) decClinicalRewardDao.getListDecClinicalRewardByDeclarationIds(decIds);
    // 学术荣誉授予情况
    ArrayList<DecAcadeReward> decAcadeRewardList = (ArrayList<DecAcadeReward>) decAcadeRewardDao.getListDecAcadeRewardByDeclarationIds(decIds);
    // 作家扩展项
    ArrayList<DecExtensionVO> decExtensionVOs = (ArrayList<DecExtensionVO>) decExtensionDao.getListDecExtensionVOByDeclarationIds(decIds);
    // 编写内容意向表
    ArrayList<DecIntention> decIntentions = (ArrayList<DecIntention>) decIntentionDao.getDecIntentionByDeclarationIds(decIds);
    for (DeclarationOrDisplayVO declarationOrDisplayVO : declarationOrDisplayVOs) {
        // 审核进度
        String strOnlineProgress = "";
        // 纸质表进度
        String strOfflineProgress = "";
        // 性别
        String sex = "";
        // 证件类别
        String idtype = "";
        // 学历
        String degree = "";
        switch(declarationOrDisplayVO.getIdtype()) {
            case 0:
                idtype = "身份证";
                break;
            case 1:
                idtype = "护照";
                break;
            case 2:
                idtype = "军官证";
                break;
            default:
                idtype = "出现错误";
                break;
        }
        switch(declarationOrDisplayVO.getDegree()) {
            case 0:
                degree = "无";
                break;
            case 1:
                degree = "专科";
                break;
            case 2:
                degree = "本科";
                break;
            case 3:
                degree = "硕士";
                break;
            case 4:
                degree = "博士";
                break;
            default:
                degree = "出现错误";
                break;
        }
        switch(declarationOrDisplayVO.getOnlineProgress()) {
            case 0:
                strOnlineProgress = "未提交";
                break;
            case 1:
                strOnlineProgress = "已提交";
                break;
            case 2:
                strOnlineProgress = "被退回";
                break;
            case 3:
                strOnlineProgress = "已通过";
                break;
            default:
                strOnlineProgress = "出现错误";
                break;
        }
        switch(declarationOrDisplayVO.getSex()) {
            case 0:
                sex = "保密";
                break;
            case 1:
                sex = "男";
                break;
            case 2:
                sex = "女";
                break;
            default:
                sex = "出现错误";
                break;
        }
        switch(declarationOrDisplayVO.getOfflineProgress()) {
            case 0:
                strOfflineProgress = "未收到";
                break;
            case 1:
                strOfflineProgress = "被退回";
                break;
            case 2:
                strOfflineProgress = "已收到";
                break;
            default:
                strOfflineProgress = "出现错误";
                break;
        }
        String birthday = "";
        if (null != declarationOrDisplayVO.getBirthday()) {
            birthday = DateUtil.date2Str(declarationOrDisplayVO.getBirthday(), "yyyy-MM-dd");
        }
        if (null == declarationOrDisplayVO.getPosition() || "".equals(declarationOrDisplayVO.getPosition())) {
            declarationOrDisplayVO.setPosition("无");
        }
        if (StringUtil.isEmpty(declarationOrDisplayVO.getTextbookName())) {
            declarationOrDisplayVO.setTextbookName("");
        }
        if (StringUtil.isEmpty(declarationOrDisplayVO.getPresetPosition())) {
            declarationOrDisplayVO.setPresetPosition("");
        }
        // 学习经历
        List<DecEduExp> decEduExp = new ArrayList<>();
        for (DecEduExp exp : decEduExps) {
            if (exp.getDeclarationId().equals(declarationOrDisplayVO.getId())) {
                decEduExp.add(exp);
            }
        }
        // 工作经历
        List<DecWorkExp> decWorkExp = new ArrayList<>();
        for (DecWorkExp workExp : decWorkExps) {
            if (workExp.getDeclarationId().equals(declarationOrDisplayVO.getId())) {
                decWorkExp.add(workExp);
            }
        }
        // 教学经历
        List<DecTeachExp> decTeachExp = new ArrayList<>();
        for (DecTeachExp teachExp : decTeachExps) {
            if (teachExp.getDeclarationId().equals(declarationOrDisplayVO.getId())) {
                decTeachExp.add(teachExp);
            }
        }
        // 兼职学术
        List<DecAcade> decAcade = new ArrayList<>();
        for (DecAcade acade : decAcades) {
            if (acade.getDeclarationId().equals(declarationOrDisplayVO.getId())) {
                decAcade.add(acade);
            }
        }
        // 个人成就
        DecAchievement decAchievement = new DecAchievement();
        for (DecAchievement achievement : decAchievements) {
            if (achievement.getDeclarationId().equals(declarationOrDisplayVO.getId())) {
                decAchievement = achievement;
                break;
            }
        }
        // 上套教材
        List<DecLastPosition> decLastPosition = new ArrayList<>();
        for (DecLastPosition lastPosition : decLastPositions) {
            if (lastPosition.getDeclarationId().equals(declarationOrDisplayVO.getId())) {
                decLastPosition.add(lastPosition);
            }
        }
        // 精品课程建设情况
        List<DecCourseConstruction> decCourseConstruction = new ArrayList<>();
        for (DecCourseConstruction construction : decCourseConstructions) {
            if (construction.getDeclarationId().equals(declarationOrDisplayVO.getId())) {
                decCourseConstruction.add(construction);
            }
        }
        // 主编国家级规划
        List<DecNationalPlan> decNationalPlan = new ArrayList<>();
        for (DecNationalPlan plan : decNationalPlans) {
            if (plan.getDeclarationId().equals(declarationOrDisplayVO.getId())) {
                decNationalPlan.add(plan);
            }
        }
        // 人卫社教材编写
        List<DecTextbookPmph> decTextbookPmph = new ArrayList<>();
        for (DecTextbookPmph textbookPmph : decTextbookPmphs) {
            if (textbookPmph.getDeclarationId().equals(declarationOrDisplayVO.getId())) {
                decTextbookPmph.add(textbookPmph);
            }
        }
        // 其他社教材编写
        List<DecTextbook> decTextbook = new ArrayList<>();
        for (DecTextbook textbook : decTextbooks) {
            if (textbook.getDeclarationId().equals(declarationOrDisplayVO.getId())) {
                decTextbook.add(textbook);
            }
        }
        // 参加人卫慕课、数字教材编写情况表
        DecMoocDigital decMoocDigital = new DecMoocDigital();
        for (DecMoocDigital moocDigital : decMoocDigitals) {
            if (moocDigital.getDeclarationId().equals(declarationOrDisplayVO.getId())) {
                decMoocDigital = moocDigital;
                break;
            }
        }
        // 作家科研
        List<DecResearch> decResearch = new ArrayList<>();
        for (DecResearch research : decResearchs) {
            if (research.getDeclarationId().equals(declarationOrDisplayVO.getId())) {
                decResearch.add(research);
            }
        }
        // 主编学术专著情况
        List<DecMonograph> monographs = new ArrayList<>();
        for (DecMonograph monograph : decMonographList) {
            if (monograph.getDeclarationId().equals(declarationOrDisplayVO.getId())) {
                monographs.add(monograph);
            }
        }
        // 出版行业获奖情况
        List<DecPublishReward> publishRewards = new ArrayList<>();
        for (DecPublishReward publishReward : decPublishRewardList) {
            if (publishReward.getDeclarationId().equals(declarationOrDisplayVO.getId())) {
                publishRewards.add(publishReward);
            }
        }
        // SCI论文投稿及影响因子情况
        List<DecSci> scis = new ArrayList<>();
        for (DecSci sci : decSciList) {
            if (sci.getDeclarationId().equals(declarationOrDisplayVO.getId())) {
                scis.add(sci);
            }
        }
        // 临床医学获奖情况
        List<DecClinicalReward> clinicalRewards = new ArrayList<>();
        for (DecClinicalReward clinicalReward : decClinicalRewardList) {
            if (clinicalReward.getDeclarationId().equals(declarationOrDisplayVO.getId())) {
                clinicalRewards.add(clinicalReward);
            }
        }
        // 学术荣誉授予情况
        List<DecAcadeReward> acadeRewards = new ArrayList<>();
        for (DecAcadeReward acadeReward : decAcadeRewardList) {
            if (acadeReward.getDeclarationId().equals(declarationOrDisplayVO.getId())) {
                acadeRewards.add(acadeReward);
            }
        }
        // 编写内容意向表
        DecIntention decIntention = new DecIntention();
        for (DecIntention intention : decIntentions) {
            if (intention.getDeclarationId().equals(declarationOrDisplayVO.getId())) {
                decIntention = intention;
                break;
            }
        }
        // 作家扩展项
        List<DecExtensionVO> extensionVOs = new ArrayList<>();
        for (DecExtensionVO extensionVO : decExtensionVOs) {
            if (extensionVO.getDeclarationId().equals(declarationOrDisplayVO.getId())) {
                extensionVOs.add(extensionVO);
            }
        }
        String isDispensed = declarationOrDisplayVO.getIsDispensed() ? "是" : "否";
        String isUtec = declarationOrDisplayVO.getIsUtec() ? "是" : "否";
        String textbookName = declarationOrDisplayVO.getTextbookName() + "第" + declarationOrDisplayVO.getTextbookRound() + "版";
        DeclarationEtcBO declarationEtcBO = new DeclarationEtcBO(declarationOrDisplayVO.getRealname(), declarationOrDisplayVO.getUsername(), sex, birthday, declarationOrDisplayVO.getExperience(), declarationOrDisplayVO.getOrgName(), declarationOrDisplayVO.getPosition(), declarationOrDisplayVO.getTitle(), declarationOrDisplayVO.getAddress(), declarationOrDisplayVO.getPostcode(), declarationOrDisplayVO.getTelephone(), declarationOrDisplayVO.getFax(), declarationOrDisplayVO.getHandphone(), degree, declarationOrDisplayVO.getEmail(), idtype, declarationOrDisplayVO.getIdcard(), declarationOrDisplayVO.getExpertise(), isDispensed, isUtec, strOnlineProgress, strOfflineProgress, declarationOrDisplayVO.getOrgNameOne(), (ArrayList<DecEduExp>) decEduExp, (ArrayList<DecWorkExp>) decWorkExp, (ArrayList<DecTeachExp>) decTeachExp, decAchievement, (ArrayList<DecAcade>) decAcade, (ArrayList<DecLastPosition>) decLastPosition, (ArrayList<DecCourseConstruction>) decCourseConstruction, (ArrayList<DecNationalPlan>) decNationalPlan, (ArrayList<DecTextbookPmph>) decTextbookPmph, decMoocDigital, (ArrayList<DecTextbook>) decTextbook, (ArrayList<DecResearch>) decResearch, (ArrayList<DecMonograph>) monographs, (ArrayList<DecPublishReward>) publishRewards, (ArrayList<DecSci>) scis, (ArrayList<DecClinicalReward>) clinicalRewards, (ArrayList<DecAcadeReward>) acadeRewards, (ArrayList<DecExtensionVO>) extensionVOs, decIntention);
        List<String> list = new ArrayList<>();
        list.add(textbookName);
        declarationEtcBO.setTextbookName(list);
        List<String> presetPosition = new ArrayList<>();
        presetPosition.add(declarationOrDisplayVO.getPresetPosition());
        declarationEtcBO.setPresetPosition(presetPosition);
        declarationEtcBOs.add(declarationEtcBO);
    }
    return declarationEtcBOs;
}
Also used : ArrayList(java.util.ArrayList) 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) DecClinicalReward(com.bc.pmpheep.back.po.DecClinicalReward) DeclarationOrDisplayVO(com.bc.pmpheep.back.vo.DeclarationOrDisplayVO) DeclarationEtcBO(com.bc.pmpheep.back.bo.DeclarationEtcBO) DecTextbook(com.bc.pmpheep.back.po.DecTextbook) DecLastPosition(com.bc.pmpheep.back.po.DecLastPosition) DecExtensionVO(com.bc.pmpheep.back.vo.DecExtensionVO) DecAcade(com.bc.pmpheep.back.po.DecAcade) DecIntention(com.bc.pmpheep.back.po.DecIntention) DecCourseConstruction(com.bc.pmpheep.back.po.DecCourseConstruction) DecWorkExp(com.bc.pmpheep.back.po.DecWorkExp) DecResearch(com.bc.pmpheep.back.po.DecResearch) DecNationalPlan(com.bc.pmpheep.back.po.DecNationalPlan) DecMonograph(com.bc.pmpheep.back.po.DecMonograph) Gson(com.google.gson.Gson) DecMoocDigital(com.bc.pmpheep.back.po.DecMoocDigital) DecPublishReward(com.bc.pmpheep.back.po.DecPublishReward) TypeToken(com.google.gson.reflect.TypeToken) DecTeachExp(com.bc.pmpheep.back.po.DecTeachExp) DecAcadeReward(com.bc.pmpheep.back.po.DecAcadeReward)

Example 7 with DecNationalPlan

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

the class DeclarationServiceImpl method getDeclarationOrDisplayVOByIdOrRealname.

@Override
public List<DeclarationEtcBO> getDeclarationOrDisplayVOByIdOrRealname(List<Long> decIds) throws CheckedServiceException, IllegalArgumentException, IllegalAccessException {
    List<DeclarationEtcBO> declarationEtcBOs = new ArrayList<>();
    List<DeclarationOrDisplayVO> declarationOrDisplayVOs = declarationDao.getDeclarationOrDisplayVOByIdOrRealname(decIds);
    // 学习经历
    ArrayList<DecEduExp> decEduExps = (ArrayList<DecEduExp>) decEduExpDao.getListDecEduExpByDeclarationIds(decIds);
    // 工作经历
    ArrayList<DecWorkExp> decWorkExps = (ArrayList<DecWorkExp>) decWorkExpDao.getListDecWorkExpByDeclarationIds(decIds);
    // 教学经历
    ArrayList<DecTeachExp> decTeachExps = (ArrayList<DecTeachExp>) decTeachExpDao.getListDecTeachExpByDeclarationIds(decIds);
    // 兼职学术
    ArrayList<DecAcade> decAcades = (ArrayList<DecAcade>) decAcadeDao.getListDecAcadeByDeclarationIds(decIds);
    // 个人成就
    ArrayList<DecAchievement> decAchievements = (ArrayList<DecAchievement>) decAchievementDao.getDecAchievementByDeclarationIds(decIds);
    // 本套上版教材参编情况
    ArrayList<DecLastPosition> decLastPositions = (ArrayList<DecLastPosition>) decLastPositionDao.getListDecLastPositionByDeclarationIds(decIds);
    // 精品课程建设情况
    ArrayList<DecCourseConstruction> decCourseConstructions = (ArrayList<DecCourseConstruction>) decCourseConstructionDao.getDecCourseConstructionByDeclarationIds(decIds);
    // 主编国家级规划
    ArrayList<DecNationalPlan> decNationalPlans = (ArrayList<DecNationalPlan>) decNationalPlanDao.getListDecNationalPlanByDeclarationIds(decIds);
    // 人卫社教材编写情况表
    ArrayList<DecTextbookPmph> decTextbookPmphs = (ArrayList<DecTextbookPmph>) decTextbookPmphDao.getListDecTextbookPmphByDeclarationIds(decIds);
    // 其他社教材编写情况
    ArrayList<DecTextbook> decTextbooks = (ArrayList<DecTextbook>) decTextbookDao.getListDecTextbookByDeclarationIds(decIds);
    // 参加人卫慕课、数字教材编写情况表
    ArrayList<DecMoocDigital> decMoocDigitals = (ArrayList<DecMoocDigital>) decMoocDigitalDao.getDecMoocDigitalByDeclarationIds(decIds);
    // 作家科研
    ArrayList<DecResearch> decResearchs = (ArrayList<DecResearch>) decResearchDao.getListDecResearchByDeclarationIds(decIds);
    // 主编学术专著情况
    ArrayList<DecMonograph> decMonographList = (ArrayList<DecMonograph>) decMonographDao.getListDecMonographByDeclarationIds(decIds);
    // 出版行业获奖情况
    ArrayList<DecPublishReward> decPublishRewardList = (ArrayList<DecPublishReward>) decPublishRewardDao.getListDecPublishRewardByDeclarationIds(decIds);
    // SCI论文投稿及影响因子情况
    ArrayList<DecSci> decSciList = (ArrayList<DecSci>) decSciDao.getListDecSciByDeclarationIds(decIds);
    // 临床医学获奖情况
    ArrayList<DecClinicalReward> decClinicalRewardList = (ArrayList<DecClinicalReward>) decClinicalRewardDao.getListDecClinicalRewardByDeclarationIds(decIds);
    // 学术荣誉授予情况
    ArrayList<DecAcadeReward> decAcadeRewardList = (ArrayList<DecAcadeReward>) decAcadeRewardDao.getListDecAcadeRewardByDeclarationIds(decIds);
    // 作家扩展项
    ArrayList<DecExtensionVO> decExtensionVOs = (ArrayList<DecExtensionVO>) decExtensionDao.getListDecExtensionVOByDeclarationIds(decIds);
    // 编写内容意向表
    ArrayList<DecIntention> decIntentions = (ArrayList<DecIntention>) decIntentionDao.getDecIntentionByDeclarationIds(decIds);
    // materialExtensionService.getMaterialExtensionByMaterialId(materialId);
    for (DeclarationOrDisplayVO declarationOrDisplayVO : declarationOrDisplayVOs) {
        // 审核进度
        String strOnlineProgress = "";
        // 纸质表进度
        String strOfflineProgress = "";
        // 性别
        String sex = "";
        // 证件类别
        String idtype = "";
        // 学历
        String degree = "";
        switch(declarationOrDisplayVO.getIdtype()) {
            case 0:
                idtype = "身份证";
                break;
            case 1:
                idtype = "护照";
                break;
            case 2:
                idtype = "军官证";
                break;
            default:
                idtype = "出现错误";
                break;
        }
        switch(declarationOrDisplayVO.getDegree()) {
            case 0:
                degree = "无";
                break;
            case 1:
                degree = "专科";
                break;
            case 2:
                degree = "本科";
                break;
            case 3:
                degree = "硕士";
                break;
            case 4:
                degree = "博士";
                break;
            default:
                degree = "出现错误";
                break;
        }
        switch(declarationOrDisplayVO.getOnlineProgress()) {
            case 0:
                strOnlineProgress = "未提交";
                break;
            case 1:
                strOnlineProgress = "已提交";
                break;
            case 2:
                strOnlineProgress = "被退回";
                break;
            case 3:
                strOnlineProgress = "已通过";
                break;
            default:
                strOnlineProgress = "出现错误";
                break;
        }
        switch(declarationOrDisplayVO.getSex()) {
            case 0:
                sex = "保密";
                break;
            case 1:
                sex = "男";
                break;
            case 2:
                sex = "女";
                break;
            default:
                sex = "出现错误";
                break;
        }
        switch(declarationOrDisplayVO.getOfflineProgress()) {
            case 0:
                strOfflineProgress = "未收到";
                break;
            case 1:
                strOfflineProgress = "被退回";
                break;
            case 2:
                strOfflineProgress = "已收到";
                break;
            default:
                strOfflineProgress = "出现错误";
                break;
        }
        String birthday = "";
        if (null != declarationOrDisplayVO.getBirthday()) {
            birthday = DateUtil.date2Str(declarationOrDisplayVO.getBirthday(), "yyyy-MM-dd");
        }
        if (null == declarationOrDisplayVO.getPosition() || "".equals(declarationOrDisplayVO.getPosition())) {
            declarationOrDisplayVO.setPosition("无");
        }
        if (StringUtil.isEmpty(declarationOrDisplayVO.getTextbookName())) {
            declarationOrDisplayVO.setTextbookName("");
        }
        if (StringUtil.isEmpty(declarationOrDisplayVO.getPresetPosition())) {
            declarationOrDisplayVO.setPresetPosition("");
        }
        // 学习经历
        List<DecEduExp> decEduExp = new ArrayList<>();
        for (DecEduExp exp : decEduExps) {
            if (exp.getDeclarationId().equals(declarationOrDisplayVO.getId())) {
                decEduExp.add(exp);
            }
        }
        // 工作经历
        List<DecWorkExp> decWorkExp = new ArrayList<>();
        for (DecWorkExp workExp : decWorkExps) {
            if (workExp.getDeclarationId().equals(declarationOrDisplayVO.getId())) {
                decWorkExp.add(workExp);
            }
        }
        // 教学经历
        List<DecTeachExp> decTeachExp = new ArrayList<>();
        for (DecTeachExp teachExp : decTeachExps) {
            if (teachExp.getDeclarationId().equals(declarationOrDisplayVO.getId())) {
                decTeachExp.add(teachExp);
            }
        }
        // 兼职学术
        List<DecAcade> decAcade = new ArrayList<>();
        for (DecAcade acade : decAcades) {
            if (acade.getDeclarationId().equals(declarationOrDisplayVO.getId())) {
                decAcade.add(acade);
            }
        }
        // 个人成就
        DecAchievement decAchievement = new DecAchievement();
        for (DecAchievement achievement : decAchievements) {
            if (achievement.getDeclarationId().equals(declarationOrDisplayVO.getId())) {
                decAchievement = achievement;
                break;
            }
        }
        // 上套教材
        List<DecLastPosition> decLastPosition = new ArrayList<>();
        for (DecLastPosition lastPosition : decLastPositions) {
            if (lastPosition.getDeclarationId().equals(declarationOrDisplayVO.getId())) {
                decLastPosition.add(lastPosition);
            }
        }
        // 精品课程建设情况
        List<DecCourseConstruction> decCourseConstruction = new ArrayList<>();
        for (DecCourseConstruction construction : decCourseConstructions) {
            if (construction.getDeclarationId().equals(declarationOrDisplayVO.getId())) {
                decCourseConstruction.add(construction);
            }
        }
        // 主编国家级规划
        List<DecNationalPlan> decNationalPlan = new ArrayList<>();
        for (DecNationalPlan plan : decNationalPlans) {
            if (plan.getDeclarationId().equals(declarationOrDisplayVO.getId())) {
                decNationalPlan.add(plan);
            }
        }
        // 人卫社教材编写
        List<DecTextbookPmph> decTextbookPmph = new ArrayList<>();
        for (DecTextbookPmph textbookPmph : decTextbookPmphs) {
            if (textbookPmph.getDeclarationId().equals(declarationOrDisplayVO.getId())) {
                decTextbookPmph.add(textbookPmph);
            }
        }
        // 其他社教材编写
        List<DecTextbook> decTextbook = new ArrayList<>();
        for (DecTextbook textbook : decTextbooks) {
            if (textbook.getDeclarationId().equals(declarationOrDisplayVO.getId())) {
                decTextbook.add(textbook);
            }
        }
        // 参加人卫慕课、数字教材编写情况表
        DecMoocDigital decMoocDigital = new DecMoocDigital();
        for (DecMoocDigital moocDigital : decMoocDigitals) {
            if (moocDigital.getDeclarationId().equals(declarationOrDisplayVO.getId())) {
                decMoocDigital = moocDigital;
                break;
            }
        }
        // 作家科研
        List<DecResearch> decResearch = new ArrayList<>();
        for (DecResearch research : decResearchs) {
            if (research.getDeclarationId().equals(declarationOrDisplayVO.getId())) {
                decResearch.add(research);
            }
        }
        // 主编学术专著情况
        List<DecMonograph> monographs = new ArrayList<>();
        for (DecMonograph monograph : decMonographList) {
            if (monograph.getDeclarationId().equals(declarationOrDisplayVO.getId())) {
                monographs.add(monograph);
            }
        }
        // 出版行业获奖情况
        List<DecPublishReward> publishRewards = new ArrayList<>();
        for (DecPublishReward publishReward : decPublishRewardList) {
            if (publishReward.getDeclarationId().equals(declarationOrDisplayVO.getId())) {
                publishRewards.add(publishReward);
            }
        }
        // SCI论文投稿及影响因子情况
        List<DecSci> scis = new ArrayList<>();
        for (DecSci sci : decSciList) {
            if (sci.getDeclarationId().equals(declarationOrDisplayVO.getId())) {
                scis.add(sci);
            }
        }
        // 临床医学获奖情况
        List<DecClinicalReward> clinicalRewards = new ArrayList<>();
        for (DecClinicalReward clinicalReward : decClinicalRewardList) {
            if (clinicalReward.getDeclarationId().equals(declarationOrDisplayVO.getId())) {
                clinicalRewards.add(clinicalReward);
            }
        }
        // 学术荣誉授予情况
        List<DecAcadeReward> acadeRewards = new ArrayList<>();
        for (DecAcadeReward acadeReward : decAcadeRewardList) {
            if (acadeReward.getDeclarationId().equals(declarationOrDisplayVO.getId())) {
                acadeRewards.add(acadeReward);
            }
        }
        // 编写内容意向表
        DecIntention decIntention = new DecIntention();
        for (DecIntention intention : decIntentions) {
            if (intention.getDeclarationId().equals(declarationOrDisplayVO.getId())) {
                decIntention = intention;
                break;
            }
        }
        // 作家扩展项
        List<DecExtensionVO> extensionVOs = new ArrayList<>();
        for (DecExtensionVO extensionVO : decExtensionVOs) {
            if (extensionVO.getDeclarationId().equals(declarationOrDisplayVO.getId())) {
                extensionVOs.add(extensionVO);
            }
        }
        String isDispensed = declarationOrDisplayVO.getIsDispensed() ? "是" : "否";
        String isUtec = declarationOrDisplayVO.getIsUtec() ? "是" : "否";
        String textbookName = declarationOrDisplayVO.getTextbookName() + "第" + declarationOrDisplayVO.getTextbookRound() + "版";
        DeclarationEtcBO declarationEtcBO = new DeclarationEtcBO(declarationOrDisplayVO.getRealname(), declarationOrDisplayVO.getUsername(), sex, birthday, declarationOrDisplayVO.getExperience(), declarationOrDisplayVO.getOrgName(), declarationOrDisplayVO.getPosition(), declarationOrDisplayVO.getTitle(), declarationOrDisplayVO.getAddress(), declarationOrDisplayVO.getPostcode(), declarationOrDisplayVO.getTelephone(), declarationOrDisplayVO.getFax(), declarationOrDisplayVO.getHandphone(), degree, declarationOrDisplayVO.getEmail(), idtype, declarationOrDisplayVO.getIdcard(), declarationOrDisplayVO.getExpertise(), isDispensed, isUtec, strOnlineProgress, strOfflineProgress, declarationOrDisplayVO.getOrgNameOne(), (ArrayList<DecEduExp>) decEduExp, (ArrayList<DecWorkExp>) decWorkExp, (ArrayList<DecTeachExp>) decTeachExp, decAchievement, (ArrayList<DecAcade>) decAcade, (ArrayList<DecLastPosition>) decLastPosition, (ArrayList<DecCourseConstruction>) decCourseConstruction, (ArrayList<DecNationalPlan>) decNationalPlan, (ArrayList<DecTextbookPmph>) decTextbookPmph, decMoocDigital, (ArrayList<DecTextbook>) decTextbook, (ArrayList<DecResearch>) decResearch, (ArrayList<DecMonograph>) monographs, (ArrayList<DecPublishReward>) publishRewards, (ArrayList<DecSci>) scis, (ArrayList<DecClinicalReward>) clinicalRewards, (ArrayList<DecAcadeReward>) acadeRewards, (ArrayList<DecExtensionVO>) extensionVOs, decIntention);
        List<String> list = new ArrayList<>();
        list.add(textbookName);
        declarationEtcBO.setTextbookName(list);
        List<String> presetPosition = new ArrayList<>();
        presetPosition.add(declarationOrDisplayVO.getPresetPosition());
        declarationEtcBO.setPresetPosition(presetPosition);
        declarationEtcBO.setMaterialId(declarationOrDisplayVO.getMaterialId());
        declarationEtcBOs.add(declarationEtcBO);
    }
    return declarationEtcBOs;
}
Also used : ArrayList(java.util.ArrayList) 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) DecClinicalReward(com.bc.pmpheep.back.po.DecClinicalReward) DeclarationOrDisplayVO(com.bc.pmpheep.back.vo.DeclarationOrDisplayVO) DeclarationEtcBO(com.bc.pmpheep.back.bo.DeclarationEtcBO) DecTextbook(com.bc.pmpheep.back.po.DecTextbook) DecLastPosition(com.bc.pmpheep.back.po.DecLastPosition) DecExtensionVO(com.bc.pmpheep.back.vo.DecExtensionVO) DecAcade(com.bc.pmpheep.back.po.DecAcade) DecIntention(com.bc.pmpheep.back.po.DecIntention) DecCourseConstruction(com.bc.pmpheep.back.po.DecCourseConstruction) DecWorkExp(com.bc.pmpheep.back.po.DecWorkExp) DecResearch(com.bc.pmpheep.back.po.DecResearch) DecNationalPlan(com.bc.pmpheep.back.po.DecNationalPlan) DecMonograph(com.bc.pmpheep.back.po.DecMonograph) DecMoocDigital(com.bc.pmpheep.back.po.DecMoocDigital) DecPublishReward(com.bc.pmpheep.back.po.DecPublishReward) DecTeachExp(com.bc.pmpheep.back.po.DecTeachExp) DecAcadeReward(com.bc.pmpheep.back.po.DecAcadeReward)

Example 8 with DecNationalPlan

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

the class ExcelHelper method fromDeclarationEtcBOList.

/**
 * 根据业务对象(包含子集合的BO)集合创建工作簿
 *
 * @param material
 *            申报表所属教材对象
 * @param extensions
 *            教材扩展项集合
 * @param dataSource
 *            业务对象(BO)集合
 * @param sheetName
 *            要生成的Excel表名(非文件名)
 * @return Excel工作簿
 */
public Workbook fromDeclarationEtcBOList(Material material, List<MaterialExtension> extensions, List<DeclarationEtcBO> dataSource, String sheetName) throws CheckedServiceException, IllegalArgumentException, IllegalAccessException {
    if (null == dataSource || dataSource.isEmpty()) {
        throw new CheckedServiceException(CheckedExceptionBusiness.MATERIAL, CheckedExceptionResult.NULL_PARAM, "用于导出Excel的数据源为空");
    }
    Workbook workbook = new HSSFWorkbook();
    Sheet sheet = workbook.createSheet(sheetName);
    // 生成表头
    sheet = generateDeclarationEtcBOHeader(extensions, sheet);
    // 设置表头样式
    headerStyleSetup(workbook, 2);
    Field[] fields = dataSource.get(0).getClass().getDeclaredFields();
    /* 设置行计数器 */
    int rowCount = 2;
    /* 记录列数和最大列宽 */
    ColumnProperties columnProperties = new ColumnProperties(1, new int[sheet.getRow(1).getLastCellNum()]);
    /* 遍历list中的对象 */
    Iterator iterator = dataSource.iterator();
    while (iterator.hasNext()) {
        Object object = iterator.next();
        Row row = sheet.createRow(rowCount);
        /* 设置序号及宽度 */
        row.createCell(0).setCellValue(String.valueOf(rowCount - 1));
        columnProperties.setMaxElement(0, 2);
        /* 设置列计数器 */
        columnProperties.setColCount(1);
        for (Field field : fields) {
            // 可访问性设置
            field.setAccessible(true);
            if (field.isAnnotationPresent(ExcelHeader.class)) {
                ExcelHeader excelHeader = (ExcelHeader) field.getAnnotation(ExcelHeader.class);
                String headerName = excelHeader.header();
                if (StringUtil.notEmpty(headerName)) {
                    switch(headerName) {
                        case "学习经历":
                            {
                                List<DecEduExp> list = (List<DecEduExp>) field.get(object);
                                columnProperties = fillDecEduExpData(list, row, columnProperties);
                                break;
                            }
                        case "工作经历":
                            {
                                List<DecWorkExp> list = (List<DecWorkExp>) field.get(object);
                                columnProperties = fillDecWorkExpData(list, row, columnProperties);
                                break;
                            }
                        case "教学经历":
                            {
                                List<DecTeachExp> list = (List<DecTeachExp>) field.get(object);
                                columnProperties = fillDecTeachExpData(list, row, columnProperties);
                                break;
                            }
                        case "个人成就":
                            {
                                DecAchievement decAchievement = (DecAchievement) field.get(object);
                                columnProperties = fillDecAchievementData(decAchievement, row, columnProperties);
                                break;
                            }
                        case "学术兼职":
                            {
                                List<DecAcade> list = (List<DecAcade>) field.get(object);
                                columnProperties = fillDecAcadeData(list, row, columnProperties);
                                break;
                            }
                        case "本套上版教材参编情况":
                            {
                                List<DecLastPosition> list = (List<DecLastPosition>) field.get(object);
                                columnProperties = fillDecLastPositionData(list, row, columnProperties);
                                break;
                            }
                        case "精品课程建设情况":
                            {
                                List<DecCourseConstruction> list = (List<DecCourseConstruction>) field.get(object);
                                columnProperties = fillDecCourseConstructionData(list, row, columnProperties);
                                break;
                            }
                        case "主编国家级规划教材情况":
                            {
                                List<DecNationalPlan> list = (List<DecNationalPlan>) field.get(object);
                                columnProperties = fillDecNationalPlanData(list, row, columnProperties);
                                break;
                            }
                        case "人卫社教材编写情况":
                            {
                                List<DecTextbookPmph> list = (List<DecTextbookPmph>) field.get(object);
                                columnProperties = fillDecTextbookPmphData(list, row, columnProperties);
                                break;
                            }
                        case "其他社教材编写情况":
                            {
                                List<DecTextbook> list = (List<DecTextbook>) field.get(object);
                                columnProperties = fillDecTextbookData(list, row, columnProperties);
                                break;
                            }
                        case "参加人卫慕课、数字教材编写情况":
                            {
                                DecMoocDigital decMoocDigital = (DecMoocDigital) field.get(object);
                                columnProperties = fillDecMoocDigitalData(decMoocDigital, row, columnProperties);
                                break;
                            }
                        case "科研情况":
                            {
                                List<DecResearch> list = (List<DecResearch>) field.get(object);
                                columnProperties = fillDecResearchData(list, row, columnProperties);
                                break;
                            }
                        case "学术专著":
                            {
                                List<DecMonograph> list = (List<DecMonograph>) field.get(object);
                                columnProperties = fillDecMonographData(list, row, columnProperties);
                                break;
                            }
                        case "出版行业获奖情况":
                            {
                                List<DecPublishReward> list = (List<DecPublishReward>) field.get(object);
                                columnProperties = fillDecPublishRewardData(list, row, columnProperties);
                                break;
                            }
                        case "SCI论文投稿及影响因子情况":
                            {
                                List<DecSci> list = (List<DecSci>) field.get(object);
                                columnProperties = fillDecSciData(list, row, columnProperties);
                                break;
                            }
                        case "临床医学获奖情况":
                            {
                                List<DecClinicalReward> list = (List<DecClinicalReward>) field.get(object);
                                columnProperties = fillDecClinicalRewardData(list, row, columnProperties);
                                break;
                            }
                        case "学术荣誉授予情况":
                            {
                                List<DecAcadeReward> list = (List<DecAcadeReward>) field.get(object);
                                columnProperties = fillDecAcadeRewardData(list, row, columnProperties);
                                break;
                            }
                        case "编写内容意向":
                            {
                                DecIntention decIntention = (DecIntention) field.get(object);
                                columnProperties = fillDecIntentionData(decIntention, row, columnProperties);
                                break;
                            }
                        case "作家扩展项":
                            {
                                if (extensions == null || extensions.isEmpty()) {
                                    break;
                                }
                                List<DecExtensionVO> list = (List<DecExtensionVO>) field.get(object);
                                columnProperties = fillDecExtensionVODataPlus(extensions, list, row, columnProperties);
                                break;
                            }
                        default:
                            Object o = field.get(object);
                            Cell cell = row.createCell(columnProperties.getColCount());
                            if (null != o) {
                                String value = o.toString();
                                cell.setCellValue(value);
                                if (value.length() > columnProperties.getCurrentMaxElement()) {
                                    columnProperties.setCurrentMaxElement(value.length());
                                }
                            }
                            columnProperties.setColCount(columnProperties.getColCount() + 1);
                            break;
                    }
                }
            }
        }
        rowCount++;
    }
    /* 样式调整 */
    workbook = dataStyleSetup(workbook, 2, rowCount, columnProperties);
    /* 以下隐藏多余的列 */
    return clearColumns(workbook, material);
}
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) Field(java.lang.reflect.Field) DecClinicalReward(com.bc.pmpheep.back.po.DecClinicalReward) Iterator(java.util.Iterator) List(java.util.List) ArrayList(java.util.ArrayList) ExcelHeader(com.bc.pmpheep.annotation.ExcelHeader) Cell(org.apache.poi.ss.usermodel.Cell) 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) CheckedServiceException(com.bc.pmpheep.service.exception.CheckedServiceException) DecIntention(com.bc.pmpheep.back.po.DecIntention) HSSFWorkbook(org.apache.poi.hssf.usermodel.HSSFWorkbook) Workbook(org.apache.poi.ss.usermodel.Workbook) HSSFWorkbook(org.apache.poi.hssf.usermodel.HSSFWorkbook) DecCourseConstruction(com.bc.pmpheep.back.po.DecCourseConstruction) Row(org.apache.poi.ss.usermodel.Row) DecTeachExp(com.bc.pmpheep.back.po.DecTeachExp) DecWorkExp(com.bc.pmpheep.back.po.DecWorkExp) Sheet(org.apache.poi.ss.usermodel.Sheet) DecResearch(com.bc.pmpheep.back.po.DecResearch) DecNationalPlan(com.bc.pmpheep.back.po.DecNationalPlan) DecAcadeReward(com.bc.pmpheep.back.po.DecAcadeReward)

Example 9 with DecNationalPlan

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

the class WordHelper method fillDecNationalPlanData.

private XWPFTable fillDecNationalPlanData(XWPFTable table, List<DecNationalPlan> decNationalPlans) {
    if (CollectionUtil.isEmpty(decNationalPlans)) {
        return table;
    }
    if (decNationalPlans.size() > 1) {
        int height = table.getRow(1).getHeight();
        for (int i = 1; i < decNationalPlans.size(); i++) {
            table.createRow().setHeight(height);
        }
    }
    List<XWPFTableRow> rows = table.getRows();
    List<XWPFTableCell> cells;
    int rowCount = 1;
    for (DecNationalPlan decNationalPlan : decNationalPlans) {
        cells = rows.get(rowCount).getTableCells();
        String value = decNationalPlan.getMaterialName();
        if (StringUtil.notEmpty(value)) {
            cells.get(0).setText(value);
        }
        value = decNationalPlan.getIsbn();
        if (StringUtil.notEmpty(value)) {
            cells.get(1).setText(value);
        }
        value = decNationalPlan.getRankText();
        if (StringUtil.notEmpty(value)) {
            cells.get(2).setText(value);
        }
        value = decNationalPlan.getNote();
        if (StringUtil.notEmpty(value)) {
            cells.get(3).setText(value);
        }
        for (XWPFTableCell cell : cells) {
            cell.setVerticalAlignment(XWPFVertAlign.CENTER);
        }
        rowCount++;
    }
    return table;
}
Also used : XWPFTableCell(org.apache.poi.xwpf.usermodel.XWPFTableCell) DecNationalPlan(com.bc.pmpheep.back.po.DecNationalPlan) XWPFTableRow(org.apache.poi.xwpf.usermodel.XWPFTableRow)

Example 10 with DecNationalPlan

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

the class DecNationalPlanServiceTest method testGetDecNationalPlan.

@Test
@Rollback(Const.ISROLLBACK)
public void testGetDecNationalPlan() {
    long id = add().getId();
    DecNationalPlan decNationalPlan = decNationalPlanService.getDecNationalPlanById(id);
    Assert.assertNotNull("获取主编国家级规划教材情况失败", decNationalPlan);
}
Also used : DecNationalPlan(com.bc.pmpheep.back.po.DecNationalPlan) Test(org.junit.Test) BaseTest(com.bc.pmpheep.test.BaseTest) Rollback(org.springframework.test.annotation.Rollback)

Aggregations

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