mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-09 10:56:50 +08:00
Compare commits
6 Commits
zcwy0927-y
...
zcwy0912-l
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a8ce10c575 | ||
|
|
70a87ac812 | ||
|
|
5285506f0f | ||
|
|
33df8b0831 | ||
|
|
effb45c6d0 | ||
|
|
3af3c2eedf |
@@ -9,6 +9,7 @@ import javax.servlet.http.Cookie;
|
|||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
@@ -28,6 +29,7 @@ import com.xboe.module.course.service.ICourseFileService;
|
|||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping(value = "/xboe/m/course/cware")
|
@RequestMapping(value = "/xboe/m/course/cware")
|
||||||
|
@Slf4j
|
||||||
public class CourseWareApi extends ApiBaseController {
|
public class CourseWareApi extends ApiBaseController {
|
||||||
|
|
||||||
private String cookieName = "PLAYSIGN_TIME";
|
private String cookieName = "PLAYSIGN_TIME";
|
||||||
@@ -131,6 +133,8 @@ public class CourseWareApi extends ApiBaseController {
|
|||||||
// 第一个/前端是时间
|
// 第一个/前端是时间
|
||||||
int index = signStr.indexOf("/");
|
int index = signStr.indexOf("/");
|
||||||
if (index <= 0) {
|
if (index <= 0) {
|
||||||
|
log.info("解密后的字符串:"+signStr);
|
||||||
|
log.info("解密后的字符串的时间拼接:"+index);
|
||||||
return badRequest("验证错误");
|
return badRequest("验证错误");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,9 +142,13 @@ public class CourseWareApi extends ApiBaseController {
|
|||||||
String cfid = signStr.substring(index+1);// 文件路径
|
String cfid = signStr.substring(index+1);// 文件路径
|
||||||
|
|
||||||
if (!time.equals(cookieTime)) {
|
if (!time.equals(cookieTime)) {
|
||||||
|
log.info("请求头时间和解析后的时间对比:"+"解析时间:"+time+" 请求头时间:"+cookieTime);
|
||||||
|
log.info("解密后的字符串的时间拼接:"+signStr);
|
||||||
return badRequest("验证错误");
|
return badRequest("验证错误");
|
||||||
}
|
}
|
||||||
if(StringUtils.isBlank(cfid) || cfid.length()<10) {
|
if(StringUtils.isBlank(cfid) || cfid.length()<10) {
|
||||||
|
log.info("查看时间文件路径:"+cfid);
|
||||||
|
log.info("解密后的字符串的时间拼接:"+signStr);
|
||||||
return badRequest("验证错误");
|
return badRequest("验证错误");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -355,17 +355,17 @@ public class AloneExamApi extends ApiBaseController {
|
|||||||
return badRequest("此考试无试卷内容,考试已经过期或试卷已被删除");
|
return badRequest("此考试无试卷内容,考试已经过期或试卷已被删除");
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
List<TestQuestionVo> qlist=this.randomQuestion(examTest, paperJson);
|
List<TestQuestionVo> qlist=this.randomQuestion(examTest, paperJson);
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
ObjectMapper objectMapper = new ObjectMapper();
|
||||||
paperJson=objectMapper.writeValueAsString(qlist);
|
paperJson=objectMapper.writeValueAsString(qlist);
|
||||||
} catch (XaskException e) {
|
} catch (XaskException e) {
|
||||||
log.error("生成试卷错误",e);
|
log.error("生成试卷错误",e);
|
||||||
return error("生成考试试卷错误",e.getMessage(),map);
|
return error("生成考试试卷错误",e.getMessage(),map);
|
||||||
} catch (JsonProcessingException e) {
|
} catch (JsonProcessingException e) {
|
||||||
log.error("生成试卷,解析生成json错误",e);
|
log.error("生成试卷,解析生成json错误",e);
|
||||||
return error("生成考试试卷解析错误",e.getMessage(),map);
|
return error("生成考试试卷解析错误",e.getMessage(),map);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
map.put("paper", paperJson);
|
map.put("paper", paperJson);
|
||||||
long end=System.currentTimeMillis();
|
long end=System.currentTimeMillis();
|
||||||
log.info("开始考试用时="+(end-start)+" ms");
|
log.info("开始考试用时="+(end-start)+" ms");
|
||||||
|
|||||||
@@ -312,14 +312,19 @@ public class ExamQuestionApi extends ApiBaseController {
|
|||||||
if(row1.getCell(1).getStringCellValue().equals("多选题")){
|
if(row1.getCell(1).getStringCellValue().equals("多选题")){
|
||||||
examQuestion.setType(2);
|
examQuestion.setType(2);
|
||||||
}
|
}
|
||||||
if(row1.getCell(2).getStringCellValue().equals("中")){
|
log.debug("row1.getCell(2) = " + row1.getCell(2));
|
||||||
examQuestion.setDifficulty(2f);
|
if (row1.getCell(2)==null ||row1.getCell(2).getStringCellValue() == null || row1.getCell(2).getStringCellValue().equals("")){
|
||||||
}else if(row1.getCell(2).getStringCellValue().equals("难")){
|
|
||||||
examQuestion.setDifficulty(3f);
|
|
||||||
} else if(row1.getCell(2).getStringCellValue().equals("易")){
|
|
||||||
examQuestion.setDifficulty(1f);
|
|
||||||
}else if(row1.getCell(2).getStringCellValue().equals("")){
|
|
||||||
examQuestion.setDifficulty(null);
|
examQuestion.setDifficulty(null);
|
||||||
|
}else{
|
||||||
|
if( row1.getCell(2).getStringCellValue().equals("中")){
|
||||||
|
examQuestion.setDifficulty(2f);
|
||||||
|
}else if(row1.getCell(2).getStringCellValue().equals("难")){
|
||||||
|
examQuestion.setDifficulty(3f);
|
||||||
|
} else if(row1.getCell(2).getStringCellValue().equals("易")){
|
||||||
|
examQuestion.setDifficulty(1f);
|
||||||
|
}else if(row1.getCell(2).getStringCellValue().equals("")){
|
||||||
|
examQuestion.setDifficulty(null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Cell cell = row1.getCell(3);
|
Cell cell = row1.getCell(3);
|
||||||
cell.setCellType(CellType.STRING);
|
cell.setCellType(CellType.STRING);
|
||||||
|
|||||||
Reference in New Issue
Block a user