ソースを参照

Merge branch 'dev0410' of https://git.oschina.net/songyue123456/comm-ques-bank into dev0410

weiwenhai 7 年 前
コミット
a86f152b82

+ 24 - 17
cqb-comm-utils/src/main/java/com/qmth/cqb/utils/FileDisposeUtil.java

@@ -39,12 +39,9 @@ public class FileDisposeUtil {
 	public static boolean saveUrlAs(String fileUrl, String fileName) {
 		try {
 			URL url = new URL(fileUrl);
-			HttpURLConnection connection = (HttpURLConnection) url
-					.openConnection();
-			DataInputStream in = new DataInputStream(
-					connection.getInputStream());
-			DataOutputStream out = new DataOutputStream(new FileOutputStream(
-					fileName));
+			HttpURLConnection connection = (HttpURLConnection) url.openConnection();
+			DataInputStream in = new DataInputStream(connection.getInputStream());
+			DataOutputStream out = new DataOutputStream(new FileOutputStream(fileName));
 			byte[] buffer = new byte[4096];
 			int count = 0;
 			while ((count = in.read(buffer)) > 0) {
@@ -64,15 +61,19 @@ public class FileDisposeUtil {
 	 * @param response
 	 */
 	public static void downloadFile(String filename,String fullFilePath,HttpServletResponse response){
-		//获得请求文件名  
-        //设置文件MIME类型  
-		response.setContentType(getContentType(filename));
-        //设置Content-Disposition  
-        response.setHeader("Content-Disposition", "attachment;filename="+filename);  
-        //读取目标文件,通过response将目标文件写到客户端  
-        //获取目标文件的绝对路径  
-        //读取文件  
 		try {
+			//设置编码
+			response.setCharacterEncoding("UTF-8");
+	        //设置文件MIME类型  
+			response.setContentType(getContentType(filename));
+	        //设置Content-Disposition,名称强制为UTF-8
+			String fileEncode = System.getProperty("file.encoding");
+	        response.setHeader("Content-Disposition", "attachment;filename="+new String(filename.getBytes(fileEncode),"UTF-8"));
+	         // 设置强制下载不打开
+	         response.setContentType("application/octet-stream;charset=utf-8");
+	        //读取目标文件,通过response将目标文件写到客户端  
+	        //获取目标文件的绝对路径  
+	        //读取文件  
 			InputStream in = new FileInputStream(fullFilePath);
 			OutputStream out = response.getOutputStream();  
 	        //写文件  
@@ -133,7 +134,7 @@ public class FileDisposeUtil {
 			try {
 				File zipFile = new File(zipFilePath+File.separator+fileName+".zip");
 				if (zipFile.exists()) {
-					logger.error(zipFilePath + "目录下存在名字为:" + fileName+ ".zip" + "打包文件.");
+					logger.error(zipFilePath + "目录下存在名字为:"+fileName+".zip"+"打包文件.");
 				} else {
 					File[] sourceFiles = sourceFile.listFiles();
 					if (null == sourceFiles || sourceFiles.length < 1) {
@@ -144,7 +145,9 @@ public class FileDisposeUtil {
 						byte[] bufs = new byte[1024 * 10];
 						for (int i = 0; i < sourceFiles.length; i++) {
 							// 创建ZIP实体,并添加进压缩包
-							ZipEntry zipEntry = new ZipEntry(sourceFiles[i].getName());
+							String fileEncode = System.getProperty("file.encoding");
+							String name = new String(sourceFiles[i].getName().getBytes(fileEncode),"UTF-8");
+							ZipEntry zipEntry = new ZipEntry(name);
 							zos.putNextEntry(zipEntry);
 							// 读取待压缩的文件并写进压缩包里
 							fis = new FileInputStream(sourceFiles[i]);
@@ -199,5 +202,9 @@ public class FileDisposeUtil {
 		}
 		directory.mkdir();
 	}
-
+	
+	public static void main(String[] args) {
+		System.out.println(System.getProperty("sun.jnu.encoding"));
+		System.out.println(System.getProperty("file.encoding"));
+	}
 }

+ 10 - 0
cqb-gen-paper/src/main/java/com/qmth/cqb/genpaper/model/GenPaperDto.java

@@ -4,6 +4,7 @@ import java.io.Serializable;
 import java.util.List;
 import java.util.Map;
 
+import com.qmth.cqb.base.model.Course;
 import com.qmth.cqb.genpaper.condition.Condition;
 import com.qmth.cqb.utils.enums.RandomGenPaperPolicy;
 
@@ -20,6 +21,8 @@ public class GenPaperDto implements Serializable {
 
     private String courseName;// 课程名称
     
+    private Course course;
+    
     private CourseLevel level;// 层次
 
     private String paperName;// 试卷名称
@@ -144,5 +147,12 @@ public class GenPaperDto implements Serializable {
 		this.level = level;
 	}
 
+	public Course getCourse() {
+		return course;
+	}
+
+	public void setCourse(Course course) {
+		this.course = course;
+	}
     
 }

+ 7 - 0
cqb-gen-paper/src/main/java/com/qmth/cqb/genpaper/service/GenPaperService.java

@@ -13,6 +13,8 @@ import java.util.UUID;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import com.qmth.cqb.base.dao.CourseRepo;
+import com.qmth.cqb.base.model.Course;
 import com.qmth.cqb.genpaper.context.DetailContext;
 import com.qmth.cqb.genpaper.context.PaperContext;
 import com.qmth.cqb.genpaper.context.UnitContext;
@@ -48,6 +50,9 @@ public class GenPaperService {
     @Autowired
     PaperStructRepo paperStructRepo;
 
+    @Autowired
+    CourseRepo courseRepo;
+    
     /**
      * 精确组卷,根据设定试卷结构组卷
      * 
@@ -272,6 +277,8 @@ public class GenPaperService {
             paper.setName(genPaperDto.getPaperName());
             paper.setCourseNo(genPaperDto.getCourseNo());
             paper.setCourseName(genPaperDto.getCourseName());
+            Course course = courseRepo.findFirstByCodeAndOrgId(genPaperDto.getCourseNo(),genPaperDto.getOrgId());
+            paper.setCourse(course);
             paper.setCreator(genPaperDto.getCreator());
             paper.setCreateTime(CommonUtils.getCurDateTime());
             paper.setPaperDetailCount(details.size());

+ 21 - 2
cqb-paper/src/main/java/com/qmth/cqb/paper/model/ExamFile.java

@@ -2,6 +2,10 @@ package com.qmth.cqb.paper.model;
 
 import java.io.Serializable;
 import java.util.Date;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+import java.util.Map.Entry;
 
 import org.springframework.data.annotation.Id;
 
@@ -82,7 +86,7 @@ public class ExamFile implements Serializable{
     	
     }
     
-    public ExamFile(ExtractConfig extractConfig,String filePath,ExamFileType examFileType,String fileSuffix){
+    public ExamFile(String paperId,ExtractConfig extractConfig,String filePath,ExamFileType examFileType,String fileSuffix){
     	this.orgId = extractConfig.getOrgId();
     	this.orgName = extractConfig.getOrgName();
     	this.examId = extractConfig.getExamId()+"";
@@ -90,7 +94,22 @@ public class ExamFile implements Serializable{
     	this.examType = ExamType.strToEnum(extractConfig.getExamType());
     	this.courseId = extractConfig.getCourseCode();
     	this.courseName = extractConfig.getCourseName();
-    	this.fileName = extractConfig.getCourseName()+"_"+extractConfig.getCourseCode()+"_"+examFileType.getName()+fileSuffix;
+    	
+    	Map<String,String> paperIdMap = extractConfig.getFinishedPaperIdMap();
+    	Set<Entry<String,String>> entry = paperIdMap.entrySet();
+		Iterator<Entry<String,String>> iterator = entry.iterator();
+		String groupCode = "";
+		while(iterator.hasNext()){
+			Entry<String,String> next = iterator.next();
+			if(paperId.equals(next.getValue())){
+				groupCode = next.getKey();
+				break;
+			}
+		}
+    	this.fileName = extractConfig.getCourseName()+"_"+
+    				    extractConfig.getCourseCode()+"_"+
+    				    examFileType.getName()+"_"+
+    				    groupCode+fileSuffix;
     	this.filePath = filePath;
     	this.examFileType = examFileType;
     }

+ 6 - 7
cqb-paper/src/main/java/com/qmth/cqb/paper/model/Paper.java

@@ -12,7 +12,6 @@ import com.qmth.cqb.utils.enums.PaperStatus;
 import com.qmth.cqb.utils.enums.PaperType;
 
 import cn.com.qmth.examcloud.common.dto.core.enums.CourseLevel;
-import org.springframework.data.mongodb.core.mapping.DBRef;
 
 /**
  * @author songyue
@@ -67,7 +66,7 @@ public class Paper implements Serializable {
     /**
      * 是否包含音频题
      */
-    private Boolean hasAudioQuestion;
+    private Boolean hasAudio;
 
     public static long getSerialVersionUID() {
         return serialVersionUID;
@@ -221,15 +220,15 @@ public class Paper implements Serializable {
 		this.level = level;
 	}
 
-	public Boolean getHasAudioQuestion() {
-		return hasAudioQuestion;
+    public Boolean getHasAudio() {
+		return hasAudio;
 	}
 
-	public void setHasAudioQuestion(Boolean hasAudioQuestion) {
-		this.hasAudioQuestion = hasAudioQuestion;
+	public void setHasAudio(Boolean hasAudio) {
+		this.hasAudio = hasAudio;
 	}
 
-    public Course getCourse() {
+	public Course getCourse() {
         return course;
     }
 

+ 27 - 1
cqb-paper/src/main/java/com/qmth/cqb/paper/model/computerTestModel/ComputerTestPaper.java

@@ -20,6 +20,14 @@ public class ComputerTestPaper {
 	 * 试卷名称
 	 */
 	private String name;
+	/**
+	 * 课程code
+	 */
+	private String courseCode;
+	/**
+	 * 课程名称
+	 */
+	private String courseName;
 	/**
 	 * 总分
 	 */
@@ -45,9 +53,11 @@ public class ComputerTestPaper {
 	public ComputerTestPaper(Paper paper){
 		this.id = paper.getId();
 		this.name = paper.getName();
+		this.courseCode = paper.getCourse().getCode();
+		this.courseName = paper.getCourse().getName();
 		this.totalScore = paper.getTotalScore();
 		this.detailCount = paper.getPaperDetailCount();
-		if(paper.getHasAudioQuestion()==null||!paper.getHasAudioQuestion()){
+		if(paper.getHasAudio()==null||!paper.getHasAudio()){
 			this.hasVideo = 0;
 		}else{
 			this.hasVideo = 1;
@@ -90,6 +100,22 @@ public class ComputerTestPaper {
 	public void setDetails(List<ComputerTestPaperDetail> details) {
 		this.details = details;
 	}
+
+	public String getCourseCode() {
+		return courseCode;
+	}
+
+	public void setCourseCode(String courseCode) {
+		this.courseCode = courseCode;
+	}
+
+	public String getCourseName() {
+		return courseName;
+	}
+
+	public void setCourseName(String courseName) {
+		this.courseName = courseName;
+	}
 	
 }
 

+ 6 - 1
cqb-paper/src/main/java/com/qmth/cqb/paper/service/ExtractConfigFileService.java

@@ -14,10 +14,15 @@ import com.qmth.cqb.paper.model.ExtractConfig;
  * @description 调卷规则--文件处理service
  */
 public interface ExtractConfigFileService {
+	
 	/**
 	 * 保存调卷规则,生成试卷文件
+	 * @param extractConfig
+	 * @param isbuildFile	1:生成试卷文件 0:不生成试卷文件
+	 * @param accessUser
+	 * @throws Exception
 	 */
-	public void saveExtractConfigAndBuildPaperFile(ExtractConfig extractConfig,String orgName,AccessUser accessUser)  throws Exception;
+	public void saveExtractConfigAndBuildPaperFile(ExtractConfig extractConfig,Integer isbuildFile,AccessUser accessUser)  throws Exception;
 	
 	/**
 	 * 导出考试下的试卷信息  校验

+ 1 - 1
cqb-paper/src/main/java/com/qmth/cqb/paper/service/ExtractConfigService.java

@@ -39,7 +39,7 @@ public interface ExtractConfigService {
 	 * @param orgName		机构名称
 	 * @throws Exception
 	 */
-	public Map<String, String> saveExtractConfig(ExtractConfig extractConfig,String orgName,AccessUser accessUser) throws Exception;
+	public Map<String, String> saveExtractConfig(ExtractConfig extractConfig,AccessUser accessUser) throws Exception;
 	/**
 	 * 按照设定调卷规则生成一套试卷
 	 * 1.根据ExamPaper集合得出每个类型下应该抽取的试卷,并返回 试卷类型--->试卷的map

+ 6 - 6
cqb-paper/src/main/java/com/qmth/cqb/paper/service/export/ExportPaperAbstractService.java

@@ -846,10 +846,10 @@ public abstract class ExportPaperAbstractService {
 			DocxProcessUtil.exportWord(paperExp,paperfileName,template);
 			DocxProcessUtil.processImage(paperfileName,getPkgList(paperExp.getId()));
 			File file  = new File(TEMP_FILE_EXP+paperfileName);
-			String paperFilePath = uploadUrl+extractConfig.getOrgId()+File.separator+paperfileName;
+			String paperFilePath = uploadUrl+extractConfig.getOrgId()+"/"+paperfileName;
             UpYun upyun = new UpYun(bucketName,userName,password);
 			upyun.writeFile(paperFilePath,file,true);
-			examFileService.saveExamFile(new ExamFile(extractConfig,paperFilePath,examFileType,DOCX_SUFFIX),accessUser);
+			examFileService.saveExamFile(new ExamFile(paperExp.getId(),extractConfig,paperFilePath,examFileType,DOCX_SUFFIX),accessUser);
 			file.delete();
 		} catch (Exception e) {
 			e.printStackTrace();
@@ -885,10 +885,10 @@ public abstract class ExportPaperAbstractService {
 			File file = new File(TEMP_FILE_EXP+objectiveFilename);
 			FileOutputStream out = new FileOutputStream(file);
 			objectiveExcelExporter.write(objectiveFilename,objectiveQuestionStructureList,out);
-			String objectiveFilePath = uploadUrl+extractConfig.getOrgId()+File.separator+objectiveFilename;
+			String objectiveFilePath = uploadUrl+extractConfig.getOrgId()+"/"+objectiveFilename;
             UpYun upyun = new UpYun(bucketName,userName,password);
 			upyun.writeFile(objectiveFilePath,file,true);
-			examFileService.saveExamFile(new ExamFile(extractConfig,objectiveFilePath,ExamFileType.PAPER_STRUCTURE_OBJECTIVE,EXCEL_SUFFIX),accessUser);
+			examFileService.saveExamFile(new ExamFile(paperExp.getId(),extractConfig,objectiveFilePath,ExamFileType.PAPER_STRUCTURE_OBJECTIVE,EXCEL_SUFFIX),accessUser);
 			file.delete();
 		} catch (FileNotFoundException e) {
 			e.printStackTrace();
@@ -972,10 +972,10 @@ public abstract class ExportPaperAbstractService {
 			File file = new File(TEMP_FILE_EXP+subjectiveFileName);
 			FileOutputStream out = new FileOutputStream(file);
 			subjectiveExcelExporter.write(subjectiveFileName,subjectiveQuestionStructureList,out);
-			String subjectiveFilePath = uploadUrl+extractConfig.getOrgId()+File.separator+subjectiveFileName;
+			String subjectiveFilePath = uploadUrl+extractConfig.getOrgId()+"/"+subjectiveFileName;
             UpYun upyun = new UpYun(bucketName,userName,password);
 			upyun.writeFile(subjectiveFilePath,file,true);
-			examFileService.saveExamFile(new ExamFile(extractConfig,subjectiveFilePath,ExamFileType.PAPER_STRUCTURE_SUBJECTIVE,EXCEL_SUFFIX),accessUser);
+			examFileService.saveExamFile(new ExamFile(paperExp.getId(),extractConfig,subjectiveFilePath,ExamFileType.PAPER_STRUCTURE_SUBJECTIVE,EXCEL_SUFFIX),accessUser);
 			file.delete();
 		} catch (FileNotFoundException e) {
 			e.printStackTrace();

+ 18 - 12
cqb-paper/src/main/java/com/qmth/cqb/paper/service/impl/ExtractConfigFileServiceImpl.java

@@ -86,20 +86,24 @@ public class ExtractConfigFileServiceImpl implements ExtractConfigFileService {
 	private String zipDirectory;
 	
 	@Override
-	public void saveExtractConfigAndBuildPaperFile(ExtractConfig extractConfig,String orgName,AccessUser accessUser) throws Exception {
+	public void saveExtractConfigAndBuildPaperFile(ExtractConfig extractConfig,Integer isbuildFile,AccessUser accessUser) throws Exception {
 		//查询试卷导出设置
-		ExportStructure exportStructure = exportStructureService.findStructureByExamId(extractConfig.getExamId()+"");
-		//生成试卷
-		Map<String, String> finishedPaperIdMap = extractConfigService.saveExtractConfig(extractConfig, orgName, accessUser);
-		Set<Entry<String,String>> entry = finishedPaperIdMap.entrySet();
-		Iterator<Entry<String,String>> iterator = entry.iterator();
-		while(iterator.hasNext()){
-			String paperId = iterator.next().getValue();
-			accessUser.setRootOrgName(orgName);
-			uploadPaperFile(extractConfig,paperId,exportStructure,accessUser);
+		ExportStructure exportStructure = null;
+		if(isbuildFile==1){
+			exportStructure = exportStructureService.findStructureByExamId(extractConfig.getExamId()+"");
 		}
+		//生成试卷
+		Map<String, String> finishedPaperIdMap = extractConfigService.saveExtractConfig(extractConfig,accessUser);
 		extractConfig.setFinishedPaperIdMap(finishedPaperIdMap);
     	extractConfig.setIfFinish((short)1);
+    	if(isbuildFile==1){
+    		Set<Entry<String,String>> entry = finishedPaperIdMap.entrySet();
+    		Iterator<Entry<String,String>> iterator = entry.iterator();
+    		while(iterator.hasNext()){
+    			String paperId = iterator.next().getValue();
+    			uploadPaperFile(extractConfig,paperId,exportStructure,accessUser);
+    		}
+    	}
     	extractConfigRepo.save(extractConfig);
 	}
 	
@@ -112,8 +116,10 @@ public class ExtractConfigFileServiceImpl implements ExtractConfigFileService {
 	 * @throws Exception
 	 */
 	private void uploadPaperFile(ExtractConfig extractConfig,String paperId,ExportStructure exportStructure,AccessUser accessUser) throws Exception {
-		//ExportServiceManage esm = exportServiceManageRepo.findByOrgName(accessUser.getRootOrgName());
-		ExportServiceManage esm = exportServiceManageRepo.findByOrgName("陕西师范大学");
+		ExportServiceManage esm = exportServiceManageRepo.findByOrgName(accessUser.getRootOrgName());
+		if(esm==null){
+			esm = exportServiceManageRepo.findByOrgName("陕西师范大学");
+		}
     	ExportPaperAbstractService exportPaperAbstractService = (ExportPaperAbstractService) SpringContextUtils.getBeanById(esm.getExportServiceName());
     	exportPaperAbstractService.uploadFile(extractConfig,paperId,exportStructure,accessUser);
 	}

+ 11 - 7
cqb-paper/src/main/java/com/qmth/cqb/paper/service/impl/ExtractConfigServiceImpl.java

@@ -10,6 +10,7 @@ import java.util.Random;
 import java.util.Set;
 
 
+import com.qmth.cqb.base.dao.CourseRepo;
 import com.qmth.cqb.base.model.Course;
 import org.apache.commons.lang3.StringUtils;
 import org.nlpcn.commons.lang.util.StringUtil;
@@ -104,6 +105,9 @@ public class ExtractConfigServiceImpl implements ExtractConfigService {
     
     @Autowired
     private ExamCourseClient examCourseClient;
+
+	@Autowired
+	private CourseRepo courseRepo;
     
 	@Override
 	public ExtractConfig findConfig(ExtractConfig condition) {
@@ -118,7 +122,7 @@ public class ExtractConfigServiceImpl implements ExtractConfigService {
 	}
 
 	@Override
-	public Map<String, String> saveExtractConfig(ExtractConfig extractConfig,String orgName,AccessUser accessUser) throws Exception {
+	public Map<String, String> saveExtractConfig(ExtractConfig extractConfig,AccessUser accessUser) throws Exception {
 		List<ExamPaper> examPapers = extractConfig.getExamPaperList();
 		for(int i=0;i<examPapers.size();i++){
 			ExamPaper examPaper = examPapers.get(i);
@@ -126,7 +130,8 @@ public class ExtractConfigServiceImpl implements ExtractConfigService {
 			paper = paperRepo.findOne(paper.getId());
 			examPaper.setPaper(paper);
 		}
-		extractConfig.setOrgName(orgName);
+		Course course = courseRepo.findFirstByCodeAndOrgId(extractConfig.getCourseCode(),extractConfig.getOrgId());
+		extractConfig.setCourse(course);
 		return makePaperByConfig(extractConfig);
 	}
 
@@ -613,13 +618,12 @@ public class ExtractConfigServiceImpl implements ExtractConfigService {
 			ExtractConfig extractConfig = this.findConfig(condition);
 			if(extractConfig==null){
 				extractConfig = new ExtractConfig(examCourseDto);
+				Course course = courseRepo.findFirstByCodeAndOrgId(examCourseDto.getCourseCode(),examCourseDto.getOrgId().toString());
+				extractConfig.setCourse(course);
 			}
-			Course course = extractConfig.getCourse();
-			if(course != null && course.getEnable().equals("true")){
-				extractConfigs.add(extractConfig);
-			}
+			extractConfigs.add(extractConfig);
 		}
-		return new PageImpl<ExtractConfig>(extractConfigs,new PageRequest(currentPage,pageSize),extractConfigs.size());
+		return new PageImpl<ExtractConfig>(extractConfigs,new PageRequest(currentPage,pageSize),pageExamCourse.getTotalElements());
 	}
 
 }

+ 0 - 2
cqb-paper/src/main/java/com/qmth/cqb/paper/web/AudioTimeConfigController.java

@@ -15,14 +15,12 @@ import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.ModelAttribute;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 
 import cn.com.qmth.examcloud.common.uac.entity.AccessUser;
 
 import com.qmth.cqb.paper.dao.AudioTimeConfigRepo;
 import com.qmth.cqb.paper.model.AudioTimeConfig;
-import com.qmth.cqb.paper.model.ExamFile;
 import com.qmth.cqb.paper.service.AudioTimeConfigService;
 
 /**

+ 4 - 5
cqb-paper/src/main/java/com/qmth/cqb/paper/web/ExtractConfigController.java

@@ -88,14 +88,13 @@ public class ExtractConfigController {
 	} 
 	
 	@ApiOperation(value = "保存调卷规则", notes = "保存调卷规则")
-    @PutMapping(value = "/extractConfig/{orgName}")
-	public ResponseEntity<Object> saveExtractConfig(HttpServletRequest request,
-											@PathVariable String orgName,
-											@RequestBody ExtractConfig extractConfig){
+    @PutMapping(value = "/extractConfig/{isbuildFile}")
+	public ResponseEntity<Object> saveExtractConfig(HttpServletRequest request,@PathVariable Integer isbuildFile,@RequestBody ExtractConfig extractConfig){
 		try{
 			AccessUser accessUser = (AccessUser) request.getAttribute("accessUser");
 			extractConfig.setOrgId(accessUser.getRootOrgId()+"");
-			extractConfigFileService.saveExtractConfigAndBuildPaperFile(extractConfig, orgName, accessUser);
+			extractConfig.setOrgName(accessUser.getRootOrgName());
+			extractConfigFileService.saveExtractConfigAndBuildPaperFile(extractConfig,isbuildFile,accessUser);
 			return new ResponseEntity<Object>(HttpStatus.OK);
 		}catch(Exception e){
 			e.printStackTrace();

+ 2 - 2
cqb-starter/src/main/resources/application-dev.properties

@@ -11,8 +11,8 @@ spring.redis.port=6379
 upyun.bucketName=exam-cloud-test
 upyun.userName=examcloud
 upyun.password=examcloud123456
-upyun.uploadUrl=/comm-ques-bank/exam-paper-file/
-upyun.audio.uploadUrl=/comm-ques-bank/audio/
+upyun.uploadUrl=/comm-ques-bank/dev/exam-paper-file/
+upyun.audio.uploadUrl=/comm-ques-bank/dev/audio/
 upyun.downloadUrl=http://exam-cloud-test.b0.upaiyun.com
 upyun.downloadDirectory=paperDirectory
 upyun.zipDirectory=paperZipDirectory

+ 7 - 7
cqb-starter/src/main/resources/application-prod.properties

@@ -11,17 +11,17 @@ spring.redis.port=6379
 upyun.bucketName=exam-cloud-test
 upyun.userName=examcloud
 upyun.password=examcloud123456
-upyun.uploadUrl=/comm-ques-bank/exam-paper-file/
-upyun.audio.uploadUrl=/comm-ques-bank/audio/
+upyun.uploadUrl=/comm-ques-bank/prod/exam-paper-file/
+upyun.audio.uploadUrl=/comm-ques-bank/prod/audio/
 upyun.downloadUrl=http://exam-cloud-test.b0.upaiyun.com
 upyun.downloadDirectory=paperDirectory
 upyun.zipDirectory=paperZipDirectory
 upyun.radioType=mp3,wma
 
 
-spring.datasource.url=jdbc:mysql://192.168.1.99:3306/exam_cloud_test?useUnicode=true&characterEncoding=UTF-8
-spring.datasource.username=root
-spring.datasource.password=root
+spring.datasource.url=jdbc:mysql://qmthmysql.mysql.rds.aliyuncs.com:3306/exam_cloud?useUnicode=true&characterEncoding=UTF-8
+spring.datasource.username=exam_cloud
+spring.datasource.password=examcloud123!@#
 spring.datasource.validation-query=SELECT 1 FROM DUAL
 spring.datasource.test-on-borrow=true
 spring.datasource.driver-class-name=com.mysql.jdbc.Driver
@@ -29,8 +29,8 @@ spring.jpa.show-sql=false
 spring.jpa.hibernate.ddl-auto=update
 
 
-spring.rabbitmq.host=192.168.1.99
+spring.rabbitmq.host=localhost
 spring.rabbitmq.port=5672
 spring.rabbitmq.username=examcloud
-spring.rabbitmq.password=examcloud
+spring.rabbitmq.password=examcloud123
 spring.rabbitmq.listener.acknowledgeMode=MANUAL

+ 2 - 2
cqb-starter/src/main/resources/application-test.properties

@@ -10,8 +10,8 @@ spring.redis.port=6379
 upyun.bucketName=exam-cloud-test
 upyun.userName=examcloud
 upyun.password=examcloud123456
-upyun.uploadUrl=/comm-ques-bank/exam-paper-file/
-upyun.audio.uploadUrl=/comm-ques-bank/audio/
+upyun.uploadUrl=/comm-ques-bank/test/exam-paper-file/
+upyun.audio.uploadUrl=/comm-ques-bank/test/audio/
 upyun.downloadUrl=http://exam-cloud-test.b0.upaiyun.com
 upyun.downloadDirectory=paperDirectory
 upyun.zipDirectory=paperZipDirectory

+ 6 - 1
cqb-starter/src/main/resources/application.properties

@@ -6,4 +6,9 @@ hystrix.command.default.execution.timeout.enabled=false
 api_cqb=/api/ecs_ques
 app.api.core=/api/ecs_core
 app.api.exam=/api/ecs_exam_work
-question.reduplicate.similarity=0.95
+question.reduplicate.similarity=0.95
+hystrix.command.default.execution.timeout.enabled=false
+# Increase the Hystrix timeout to 600s (globally)
+hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds: 600000
+ribbon.ReadTimeout=800000
+ribbon.ConnectTimeout=800000