【修改】 pptx、word出题BUG修改
This commit is contained in:
@@ -5,12 +5,13 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
|||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
import pc.exam.pp.framework.mybatis.core.dataobject.BaseDO;
|
||||||
import pc.exam.pp.framework.tenant.core.db.TenantBaseDO;
|
import pc.exam.pp.framework.tenant.core.db.TenantBaseDO;
|
||||||
|
|
||||||
@TableName("exam_specialty")
|
@TableName("exam_specialty")
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
public class ExamSpecialty extends TenantBaseDO {
|
public class ExamSpecialty extends BaseDO {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/** id */
|
/** id */
|
||||||
|
@@ -20,12 +20,19 @@ import pc.exam.pp.module.judgement.utils.wps_pptx.vo.PptxInfoReqVo;
|
|||||||
import pc.exam.pp.module.judgement.utils.wps_pptx.vo.PptxVO;
|
import pc.exam.pp.module.judgement.utils.wps_pptx.vo.PptxVO;
|
||||||
import pc.exam.pp.module.judgement.utils.wps_word.WpsWordUtils;
|
import pc.exam.pp.module.judgement.utils.wps_word.WpsWordUtils;
|
||||||
import pc.exam.pp.module.judgement.utils.wps_word.vo.WordVO;
|
import pc.exam.pp.module.judgement.utils.wps_word.vo.WordVO;
|
||||||
|
import pc.exam.pp.module.system.dal.dataobject.user.AdminUserDO;
|
||||||
|
import pc.exam.pp.module.system.service.user.AdminUserService;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Path;
|
||||||
|
import java.nio.file.Paths;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import static pc.exam.pp.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author REN
|
* @author REN
|
||||||
*/
|
*/
|
||||||
@@ -41,6 +48,9 @@ public class JudgementWpsPptxServiceImpl implements JudgementWpsPptxService {
|
|||||||
@Resource
|
@Resource
|
||||||
WpsPptxLinkMapper wpsPptxLinkMapper;
|
WpsPptxLinkMapper wpsPptxLinkMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private AdminUserService userService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<WpsPptxJudgementDto> getWpsPptxInfo(List<PptxInfoPointsVo> pptxInfoPointsVos) throws IOException {
|
public List<WpsPptxJudgementDto> getWpsPptxInfo(List<PptxInfoPointsVo> pptxInfoPointsVos) throws IOException {
|
||||||
List<WpsPptxJudgementDto> judgementDtos = WpsPptxUtils.getWpsPptxInfos(pptxInfoPointsVos);
|
List<WpsPptxJudgementDto> judgementDtos = WpsPptxUtils.getWpsPptxInfos(pptxInfoPointsVos);
|
||||||
@@ -49,10 +59,18 @@ public class JudgementWpsPptxServiceImpl implements JudgementWpsPptxService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<PptxInfoReqVo> programmingWpsPptx(String path) throws Exception {
|
public List<PptxInfoReqVo> programmingWpsPptx(String path) throws Exception {
|
||||||
|
String pathName = "";
|
||||||
|
String[] strPaht = path.split("/");
|
||||||
// 1、获取文件临时下载路径
|
// 1、获取文件临时下载路径
|
||||||
ConfigDO config = configService.getConfigByKey("file_down_wps_pptx_path");
|
ConfigDO config = configService.getConfigByKey("file_down_wps_pptx_path");
|
||||||
|
AdminUserDO user = userService.getUser(getLoginUserId());
|
||||||
|
Path paths = Paths.get(config.getValue() + "\\" + user.getId());
|
||||||
|
if (Files.exists(paths)) {
|
||||||
|
pathName = config.getValue() + "\\" + user.getId() + "\\" + strPaht[strPaht.length - 1];
|
||||||
|
} else {
|
||||||
// 2、下载文件并返回文件完整路径
|
// 2、下载文件并返回文件完整路径
|
||||||
String pathName = autoToolsService.downloadStudentFile(path, config.getValue() + "\\" + WpsWordUtils.getStringRandom());
|
pathName = autoToolsService.downloadStudentFile(path, config.getValue() + "\\" + user.getId());
|
||||||
|
}
|
||||||
// 4、pptx文件读取并返回考点及说明信息
|
// 4、pptx文件读取并返回考点及说明信息
|
||||||
// List<PptxVO> margins = WpsPptxUtils.wpsPptx(pathName, paragraphList);
|
// List<PptxVO> margins = WpsPptxUtils.wpsPptx(pathName, paragraphList);
|
||||||
List<PptxInfoReqVo> pptxInfoList = WpsPptxUtils.wpsPptxInfo(pathName);
|
List<PptxInfoReqVo> pptxInfoList = WpsPptxUtils.wpsPptxInfo(pathName);
|
||||||
|
@@ -19,11 +19,18 @@ import pc.exam.pp.module.judgement.service.auto_tools.AutoToolsService;
|
|||||||
import pc.exam.pp.module.judgement.utils.wps_word.WpsWordUtils;
|
import pc.exam.pp.module.judgement.utils.wps_word.WpsWordUtils;
|
||||||
import pc.exam.pp.module.judgement.utils.wps_word.vo.WordInfoReqVo;
|
import pc.exam.pp.module.judgement.utils.wps_word.vo.WordInfoReqVo;
|
||||||
import pc.exam.pp.module.judgement.utils.wps_word.vo.WordVO;
|
import pc.exam.pp.module.judgement.utils.wps_word.vo.WordVO;
|
||||||
|
import pc.exam.pp.module.system.dal.dataobject.user.AdminUserDO;
|
||||||
|
import pc.exam.pp.module.system.service.user.AdminUserService;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Path;
|
||||||
|
import java.nio.file.Paths;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import static pc.exam.pp.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class JudgementWpsWordServiceImpl implements JudgementWpsWordService {
|
public class JudgementWpsWordServiceImpl implements JudgementWpsWordService {
|
||||||
|
|
||||||
@@ -35,22 +42,23 @@ public class JudgementWpsWordServiceImpl implements JudgementWpsWordService {
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
ConfigService configService;
|
ConfigService configService;
|
||||||
|
@Resource
|
||||||
|
private AdminUserService userService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<WordInfoReqVo> programmingWpsWord(String path) throws Exception {
|
public List<WordInfoReqVo> programmingWpsWord(String path) throws Exception {
|
||||||
|
String pathName = "";
|
||||||
|
String[] strPaht = path.split("/");
|
||||||
// 1、获取文件临时下载路径
|
// 1、获取文件临时下载路径
|
||||||
ConfigDO config = configService.getConfigByKey("file_down_wps_word_path");
|
ConfigDO config = configService.getConfigByKey("file_down_wps_word_path");
|
||||||
|
AdminUserDO user = userService.getUser(getLoginUserId());
|
||||||
|
Path paths = Paths.get(config.getValue() + "\\" + user.getId());
|
||||||
|
if (Files.exists(paths)) {
|
||||||
|
pathName = config.getValue() + "\\" + user.getId() + "\\" + strPaht[strPaht.length - 1];
|
||||||
|
} else {
|
||||||
// 2、下载文件并返回文件完整路径
|
// 2、下载文件并返回文件完整路径
|
||||||
String pathName = autoToolsService.downloadStudentFile(path, config.getValue() + "\\" + WpsWordUtils.getStringRandom());
|
pathName = autoToolsService.downloadStudentFile(path, config.getValue() + "\\" + user.getId());
|
||||||
// 3、创建word考点tree
|
}
|
||||||
// WordListReqVO wordListReqVO = new WordListReqVO();
|
|
||||||
// wordListReqVO.setBelongTo(0);
|
|
||||||
// // 3-1、查询段落的标签
|
|
||||||
// List<WpsWordLinkDO> paragraphList = wpsWordLinkMapper.selectList(wordListReqVO);
|
|
||||||
// // 3-2、查询锚点的标签
|
|
||||||
// wordListReqVO.setBelongTo(3);
|
|
||||||
// List<WpsWordLinkDO> anchorList = wpsWordLinkMapper.selectList(wordListReqVO);
|
|
||||||
// 4、docx文件读取并返回考点及说明信息
|
// 4、docx文件读取并返回考点及说明信息
|
||||||
List<WordInfoReqVo> margins = WpsWordUtils.wpWord(pathName);
|
List<WordInfoReqVo> margins = WpsWordUtils.wpWord(pathName);
|
||||||
// 5、已经读取完得考点删除源文件
|
// 5、已经读取完得考点删除源文件
|
||||||
|
Reference in New Issue
Block a user