首页 > 其他分享 >山东大学软件学院2024年项目实训-11

山东大学软件学院2024年项目实训-11

时间:2024-06-16 14:30:05浏览次数:10  
标签:11 project 00 06 08 2024 实训 PPT

队友合代码的时候用她的电脑生成PPT功能会报500错误,说layout为空,加入判断是否为空的逻辑后导致结尾页识别不了了,参看日志发现可能是直接按照内容页判断的,判断不出就自行创建了一页幻灯片,这样显然是不对的。

2024-06-16T13:06:42.528+08:00 DEBUG 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Checking text in slide: 标题
2024-06-16T13:06:42.528+08:00 DEBUG 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Replaced '标题' with '探索粉色花朵的美丽'
2024-06-16T13:06:42.529+08:00 DEBUG 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Checking text in slide: 副标题
2024-06-16T13:06:42.529+08:00 DEBUG 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Checking text in slide: 探索粉色花朵的美丽
2024-06-16T13:06:42.529+08:00 DEBUG 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Checking text in slide: 副标题
2024-06-16T13:06:42.529+08:00 DEBUG 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Replaced '副标题' with '从自然到艺术的粉色花卉之旅'
2024-06-16T13:06:42.529+08:00  INFO 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Inserting cover picture from generated image
2024-06-16T13:06:42.659+08:00 DEBUG 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Checking text in slide: 目录
2024-06-16T13:06:42.660+08:00 DEBUG 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Replaced '目录' with '目录'
2024-06-16T13:06:42.660+08:00 DEBUG 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Checking text in slide: 目录内容
2024-06-16T13:06:42.660+08:00 DEBUG 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Checking text in slide: 目录
2024-06-16T13:06:42.660+08:00 DEBUG 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Checking text in slide: 目录内容
2024-06-16T13:06:42.660+08:00 DEBUG 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Replaced '目录内容' with '简介:粉色花朵的魅力
粉色花朵的种类:不同品种的介绍
粉色花朵在艺术中的运用
如何种植和护理粉色花朵'
2024-06-16T13:06:42.661+08:00 DEBUG 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Checking text in slide: 主题
2024-06-16T13:06:42.662+08:00 DEBUG 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Replaced '主题' with '简介'
2024-06-16T13:06:42.662+08:00 DEBUG 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Checking text in slide: 内容
2024-06-16T13:06:42.662+08:00 DEBUG 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Checking text in slide: 简介
2024-06-16T13:06:42.662+08:00 DEBUG 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Checking text in slide: 内容
2024-06-16T13:06:42.662+08:00 DEBUG 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Replaced '内容' with '粉色花朵象征着温柔、爱和美丽,在自然界和艺术中都占有重要的地位。'
2024-06-16T13:06:42.663+08:00 DEBUG 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Checking text in slide: 主题
2024-06-16T13:06:42.663+08:00 DEBUG 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Replaced '主题' with '粉色花朵的种类'
2024-06-16T13:06:42.663+08:00 DEBUG 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Checking text in slide: 内容
2024-06-16T13:06:42.663+08:00 DEBUG 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Checking text in slide: 粉色花朵的种类
2024-06-16T13:06:42.663+08:00 DEBUG 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Checking text in slide: 内容
2024-06-16T13:06:42.663+08:00 DEBUG 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Replaced '内容' with '介绍不同品种的粉色花朵,例如玫瑰、樱花、牡丹等。'
2024-06-16T13:06:42.664+08:00 DEBUG 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Checking text in slide: 主题
2024-06-16T13:06:42.664+08:00 DEBUG 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Replaced '主题' with '粉色花朵在艺术中的运用'
2024-06-16T13:06:42.664+08:00 DEBUG 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Checking text in slide: 内容
2024-06-16T13:06:42.665+08:00 DEBUG 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Checking text in slide: 粉色花朵在艺术中的运用
2024-06-16T13:06:42.665+08:00 DEBUG 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Checking text in slide: 内容
2024-06-16T13:06:42.665+08:00 DEBUG 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Replaced '内容' with '探讨粉色花朵在绘画、摄影、园艺设计中的运用。'
2024-06-16T13:06:42.665+08:00 DEBUG 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Checking text in slide: 结尾内容
2024-06-16T13:06:42.665+08:00  WARN 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Placeholder '主题' not found in the slide.
2024-06-16T13:06:42.665+08:00 DEBUG 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Checking text in slide: 结尾内容
2024-06-16T13:06:42.665+08:00  WARN 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Placeholder '内容' not found in the slide.
2024-06-16T13:06:42.666+08:00  WARN 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Layout 'title_and_content' not found. Using default layout.
2024-06-16T13:06:42.666+08:00 DEBUG 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptTemplateService         : Default layout found: 比较
2024-06-16T13:06:42.682+08:00 DEBUG 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Handling ending slide with content: 感谢各位的参与和关注。
2024-06-16T13:06:42.683+08:00 DEBUG 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Checking text in slide: 单击此处编辑母版标题样式
2024-06-16T13:06:42.683+08:00 DEBUG 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Checking text in slide: 单击此处编辑母版文本样式
2024-06-16T13:06:42.683+08:00 DEBUG 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Checking text in slide: 单击此处编辑母版文本样式
2024-06-16T13:06:42.683+08:00 DEBUG 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Checking text in slide: 二级
2024-06-16T13:06:42.683+08:00 DEBUG 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Checking text in slide: 三级
2024-06-16T13:06:42.683+08:00 DEBUG 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Checking text in slide: 四级
2024-06-16T13:06:42.683+08:00 DEBUG 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Checking text in slide: 五级
2024-06-16T13:06:42.684+08:00 DEBUG 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Checking text in slide: 单击此处编辑母版文本样式
2024-06-16T13:06:42.684+08:00 DEBUG 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Checking text in slide: 单击此处编辑母版文本样式
2024-06-16T13:06:42.684+08:00 DEBUG 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Checking text in slide: 二级
2024-06-16T13:06:42.684+08:00 DEBUG 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Checking text in slide: 三级
2024-06-16T13:06:42.684+08:00 DEBUG 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Checking text in slide: 四级
2024-06-16T13:06:42.684+08:00 DEBUG 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Checking text in slide: 五级
2024-06-16T13:06:42.684+08:00  WARN 6172 --- [PPT_project_backend] [nio-8080-exec-2] c.e.p.service.PptOperationService        : Placeholder '结尾内容' not found in the slide.
2024-06-16T13:06:42.725+08:00 DEBUG 6172 --- [PPT_project_backend] [nio-8080-exec-2] o.apache.poi.openxml4j.opc.ZipPackage    : Save content types part

很奇怪,之前没加判断逻辑的时候是能正常识别结尾页并加入内容的。

找到原因,是因为模板PPT中“内容页”数量少于传入参数中的内容页数量,加入逻辑,判断应该复制的幻灯片和幻灯片页数。

// 获取模板中的内容页
        Optional<XSLFSlide> optionalContentSlide = ppt.getSlides().stream()
                .filter(this::isContentSlide)
                .findFirst();

        if (!optionalContentSlide.isPresent()) {
            throw new IllegalArgumentException("Template does not contain a content slide with text '主题'");
        }

        XSLFSlide contentSlideTemplate = optionalContentSlide.get();
        XSLFSlideLayout contentLayout = contentSlideTemplate.getSlideLayout();

        // 计算模板中已有的内容页数量
        int templateContentSlideCount = (int) ppt.getSlides().stream()
                .filter(this::isContentSlide)
                .count();

        // 计算所需的内容页数量
        long requiredContentSlides = slides.stream().filter(s -> s.getTitle().equals("内容页")).count();

        // 如果所需内容页数量大于模板中的内容页数量,复制内容页
        if (requiredContentSlides > templateContentSlideCount) {
            int slidesToAdd = (int) requiredContentSlides - templateContentSlideCount;
            for (int i = 0; i < slidesToAdd; i++) {
                ppt.createSlide(contentLayout);
            }
        }

标签:11,project,00,06,08,2024,实训,PPT
From: https://blog.csdn.net/m0_64226812/article/details/139719246

相关文章

  • coreldraw2024注册机破解KeyGen包含注册码序列号永久有效
    【CorelDRAWGraphicsSuite2024】是一款集图形设计、照片编辑和矢量动画于一体的全面图形套件。这款软件因其用户友好的界面、强大的功能集以及支持多种文件格式而广受专业人士和业余爱好者的欢迎。它提供了创新的设计工具,如高级向量插图、页面布局、照片编辑等,旨在提升设计效......
  • 代码随想录算法训练营第五十九天 | 115.不同的子序列、583. 两个字符串的删除操作、72
    115.不同的子序列题目链接:代码随想录视频讲解:动态规划之子序列,为了编辑距离做铺垫|LeetCode:115.不同的子序列_哔哩哔哩_bilibili解题思路1.dp[i][j]  为在s的前i个元素(即s[0,i-1])(以i-1结尾)中,有多少个t[0,j-1]匹配(以t[j -1]为结尾)2.递推公式//如果......
  • 洛谷 P1162 填涂颜色
    题目链接:填涂颜色思路代码#include<bits/stdc++.h>usingnamespacestd;constintN=30+10;#definelllonglongintmp[N][N],dir[5][2]={{1,0},{0,1},{-1,0},{0,-1}},n;boolvis[N][N];boolcheck(intx,inty){returnx>=......
  • FL Studio21.2.2破解版注册机包含破解2024许可证
    FLStudio,即FruityLoopsStudio,自推出以来,在音乐制作领域已赢得了广泛的声誉。这款软件不仅为专业音乐制作人提供了强大的工具集,也为初学者提供了一个直观、易上手的学习平台。它集成了音频录制、编辑、混音、编曲、虚拟乐器演奏和效果处理等多种功能,几乎涵盖了音乐制作的所有......
  • CorelDRAW2024最新官方永久破解版下载地址链接
    CorelDRAWGraphicsSuite的订阅版是一种按周期付费的软件使用模式,允许用户以一定的费用在一段时间内访问和使用CorelDRAWGraphicsSuite的全部或部分功能。这种模式通常不涉及软件的所有权转让,而是提供使用权。「CorelDRAW全系列汉化版下载」,来自夸克网盘分享链接:抓紧保存......
  • 最新2024FL Studio21中文激活注册码获取方法步骤教程!
    在音乐创作领域,FLStudio21无疑是一款强大的工具。然而,对于许多初学者来说,如何正确注册和激活FLStudio21成了一个难题。今天,我们就来为大家详细解答这个问题。我们需要在FLStudio21的官方网站上购买正版软件。在购买过程中,请确保选择与您操作系统相匹配的版本。购买完成后,......
  • 2024hw蓝队面试题-3
    Linux有哪些提权思路常用的有以下几种:1.SUID提权:在Linux中,如果一个可执行文件的SUID被设置,那么该文件将以拥有者的权限运行,而不是以执行者的权限运行。因此,如果用户找到了一个SUID为root的文件并成功地使其执行了恶意代码,那么该用户将会获得root权限。2.利用系统漏洞:这是最......
  • 2024年6月杂题乱写
    6.5P3214[HNOI2011]卡农设\(f_i\)表示选了\(m\)个集合的答案,简单观察发现,只要确定了\(m-1\)个集合,最后一个集合就是确定的,不是偶数次数的出现,偶数次数的不出现,选\(m\)个集合有\(C_{2^n-1}^{m-1}\)种方案,考虑下面两种不合法的情况。这\(m-1\)个集合已经合法,最后......
  • 【LeetCode最详尽解答】11-盛最多水的容器 Container-With-Most-Water
    欢迎收藏Star我的MachineLearningBlog:https://github.com/purepisces/Wenqing-Machine_Learning_Blog。如果收藏star,有问题可以随时与我交流,谢谢大家!链接:11-盛最多水的容器直觉这个问题可以通过可视化图表来理解和解决。通过图形化这个问题,可以简化解决过程。......
  • 徐辰武2024综述:作物全基因组选择育种技术研究进展
    近日,《生物技术通报》特邀扬州大学农学院徐辰武教授团队发表综述《作物全基因组选择育种技术研究进展》。本文首先分析了影响作物GS功效的主要因素,继而从非加性效应模型、群体构建方案、多性状与多环境预测、多组学预测和育种芯片技术现状等方面阐述了GS技术在作物育种中的研究进......