|
@@ -1,47 +1,8 @@
|
|
|
package cn.com.qmth.examcloud.core.questions.api.controller;
|
|
|
|
|
|
-import java.io.File;
|
|
|
-import java.io.IOException;
|
|
|
-import java.io.StringWriter;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Arrays;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.HashSet;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-import java.util.Set;
|
|
|
-import java.util.stream.Collectors;
|
|
|
-import java.util.stream.Stream;
|
|
|
-
|
|
|
-import javax.servlet.http.HttpServletResponse;
|
|
|
-import javax.validation.constraints.NotNull;
|
|
|
-
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.data.domain.Example;
|
|
|
-import org.springframework.data.domain.Page;
|
|
|
-import org.springframework.data.domain.PageImpl;
|
|
|
-import org.springframework.http.HttpStatus;
|
|
|
-import org.springframework.http.ResponseEntity;
|
|
|
-import org.springframework.stereotype.Controller;
|
|
|
-import org.springframework.ui.Model;
|
|
|
-import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
-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.PutMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
-import org.springframework.web.bind.annotation.RequestParam;
|
|
|
-import org.springframework.web.bind.annotation.RequestPart;
|
|
|
-import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
-import org.springframework.web.multipart.MultipartFile;
|
|
|
-
|
|
|
-import com.google.gson.Gson;
|
|
|
-
|
|
|
+import cn.com.qmth.examcloud.api.commons.enums.DataRuleType;
|
|
|
import cn.com.qmth.examcloud.api.commons.security.bean.User;
|
|
|
+import cn.com.qmth.examcloud.api.commons.security.bean.UserDataRule;
|
|
|
import cn.com.qmth.examcloud.commons.exception.StatusException;
|
|
|
import cn.com.qmth.examcloud.commons.util.PathUtil;
|
|
|
import cn.com.qmth.examcloud.core.basic.api.OrgCloudService;
|
|
@@ -70,10 +31,32 @@ import cn.com.qmth.examcloud.core.questions.service.util.PaperUtil;
|
|
|
import cn.com.qmth.examcloud.reports.commons.bean.AdminOperateReport;
|
|
|
import cn.com.qmth.examcloud.reports.commons.util.ReportsUtil;
|
|
|
import cn.com.qmth.examcloud.support.cache.CacheHelper;
|
|
|
+import cn.com.qmth.examcloud.web.security.DataRule;
|
|
|
import cn.com.qmth.examcloud.web.support.ControllerSupport;
|
|
|
import cn.com.qmth.examcloud.web.support.Naked;
|
|
|
+import com.google.gson.Gson;
|
|
|
import freemarker.template.TemplateException;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.data.domain.Example;
|
|
|
+import org.springframework.data.domain.Page;
|
|
|
+import org.springframework.data.domain.PageImpl;
|
|
|
+import org.springframework.http.HttpStatus;
|
|
|
+import org.springframework.http.ResponseEntity;
|
|
|
+import org.springframework.stereotype.Controller;
|
|
|
+import org.springframework.ui.Model;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+import org.springframework.web.multipart.MultipartFile;
|
|
|
+
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+import javax.validation.constraints.NotNull;
|
|
|
+import java.io.File;
|
|
|
+import java.io.IOException;
|
|
|
+import java.io.StringWriter;
|
|
|
+import java.util.*;
|
|
|
+import java.util.stream.Collectors;
|
|
|
+import java.util.stream.Stream;
|
|
|
|
|
|
/**
|
|
|
* Created by songyue on 16/12/28.
|
|
@@ -84,7 +67,9 @@ import io.swagger.annotations.ApiOperation;
|
|
|
@Controller
|
|
|
@RequestMapping("${api_cqb}/")
|
|
|
public class PaperController extends ControllerSupport {
|
|
|
- private final static String BASE_PAGE="base_page";
|
|
|
+
|
|
|
+ private final static String BASE_PAGE = "base_page";
|
|
|
+
|
|
|
@Autowired
|
|
|
PaperService paperService;
|
|
|
|
|
@@ -102,7 +87,7 @@ public class PaperController extends ControllerSupport {
|
|
|
|
|
|
@Autowired
|
|
|
ExportServiceManageRepo exportServiceManageRepo;
|
|
|
-
|
|
|
+
|
|
|
@Autowired
|
|
|
OrgCloudService orgCloudService;
|
|
|
|
|
@@ -131,37 +116,37 @@ public class PaperController extends ControllerSupport {
|
|
|
@PutMapping(value = "/paper")
|
|
|
public ResponseEntity<Object> savePaperById(@RequestBody PaperExp paper) {
|
|
|
User user = getAccessUser();
|
|
|
- String changeInfo=getChangeInfo(paper);
|
|
|
+ String changeInfo = getChangeInfo(paper);
|
|
|
Map<String, Object> msgMap = paperService.savePaper(paper, user);
|
|
|
if ("success".equals(msgMap.get("msg"))) {
|
|
|
- if(changeInfo!=null) {
|
|
|
- if(PaperType.IMPORT.equals(paper.getPaperType())) {
|
|
|
- ReportsUtil.report(new AdminOperateReport(user.getRootOrgId(), user.getUserId(), "导入试卷管理-编辑试卷",changeInfo));
|
|
|
- }else {
|
|
|
- ReportsUtil.report(new AdminOperateReport(user.getRootOrgId(), user.getUserId(), "考试试卷管理-编辑试卷",changeInfo));
|
|
|
- }
|
|
|
- }
|
|
|
+ if (changeInfo != null) {
|
|
|
+ if (PaperType.IMPORT.equals(paper.getPaperType())) {
|
|
|
+ ReportsUtil.report(new AdminOperateReport(user.getRootOrgId(), user.getUserId(), "导入试卷管理-编辑试卷", changeInfo));
|
|
|
+ } else {
|
|
|
+ ReportsUtil.report(new AdminOperateReport(user.getRootOrgId(), user.getUserId(), "考试试卷管理-编辑试卷", changeInfo));
|
|
|
+ }
|
|
|
+ }
|
|
|
return new ResponseEntity<>(msgMap, HttpStatus.OK);
|
|
|
} else {
|
|
|
- throw new StatusException("1000",msgMap.get("msg").toString());
|
|
|
+ throw new StatusException("1000", msgMap.get("msg").toString());
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
private String getChangeInfo(PaperExp paper) {
|
|
|
- Paper old = cn.com.qmth.examcloud.core.questions.base.Model.of(paperRepo.findById(paper.getId()));
|
|
|
+ Paper old = cn.com.qmth.examcloud.core.questions.base.Model.of(paperRepo.findById(paper.getId()));
|
|
|
if (old == null) {
|
|
|
- return null;
|
|
|
+ return null;
|
|
|
}
|
|
|
- StringBuilder sb=new StringBuilder();
|
|
|
- if(!old.getName().equals(paper.getName())) {
|
|
|
- sb.append("试卷名称变动("+old.getName()+"改为"+paper.getName()+")");
|
|
|
+ StringBuilder sb = new StringBuilder();
|
|
|
+ if (!old.getName().equals(paper.getName())) {
|
|
|
+ sb.append("试卷名称变动(" + old.getName() + "改为" + paper.getName() + ")");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (sb.length() != 0) {
|
|
|
+ return sb.toString();
|
|
|
}
|
|
|
-
|
|
|
- if(sb.length()!=0) {
|
|
|
- return sb.toString();
|
|
|
- }
|
|
|
- return null;
|
|
|
-
|
|
|
+ return null;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -172,6 +157,7 @@ public class PaperController extends ControllerSupport {
|
|
|
* @param pageSize
|
|
|
* @return
|
|
|
*/
|
|
|
+ @DataRule(type = DataRuleType.COURSE)
|
|
|
@ResponseBody
|
|
|
@ApiOperation(value = "查询所有导入试卷", notes = "查询所有导入试卷")
|
|
|
@GetMapping(value = "/importPaper/{curPage}/{pageSize}")
|
|
@@ -179,8 +165,11 @@ public class PaperController extends ControllerSupport {
|
|
|
@PathVariable int curPage,
|
|
|
@PathVariable int pageSize) {
|
|
|
User user = getAccessUser();
|
|
|
+ UserDataRule userDataRule = super.getUserDataRule(DataRuleType.COURSE);
|
|
|
+
|
|
|
paperSearchInfo.setOrgId(user.getRootOrgId().toString());
|
|
|
- return new ResponseEntity<>(paperService.getImportPapers(paperSearchInfo, curPage, pageSize), HttpStatus.OK);
|
|
|
+
|
|
|
+ return new ResponseEntity<>(paperService.getImportPapers(paperSearchInfo, curPage, pageSize, userDataRule, false), HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
@ResponseBody
|
|
@@ -245,15 +234,15 @@ public class PaperController extends ControllerSupport {
|
|
|
paperSearchInfo.setOrgId(user.getRootOrgId().toString());
|
|
|
Page<Paper> ret;
|
|
|
if (ids != null && ids.length > 0) {
|
|
|
- ret=paperService.getPapersNotInIds(paperSearchInfo, ids, curPage, pageSize, PaperType.GENERATE);
|
|
|
- if(ret.getContent().size()==0&&ret.getTotalElements()>0&&curPage>1) {
|
|
|
- ret=paperService.getPapersNotInIds(paperSearchInfo, ids, curPage-1, pageSize, PaperType.GENERATE);
|
|
|
- }
|
|
|
+ ret = paperService.getPapersNotInIds(paperSearchInfo, ids, curPage, pageSize, PaperType.GENERATE);
|
|
|
+ if (ret.getContent().size() == 0 && ret.getTotalElements() > 0 && curPage > 1) {
|
|
|
+ ret = paperService.getPapersNotInIds(paperSearchInfo, ids, curPage - 1, pageSize, PaperType.GENERATE);
|
|
|
+ }
|
|
|
} else {
|
|
|
- ret=paperService.getGenPapers(paperSearchInfo, curPage, pageSize);
|
|
|
- if(ret.getContent().size()==0&&ret.getTotalElements()>0&&curPage>1) {
|
|
|
- ret=paperService.getGenPapers(paperSearchInfo, curPage-1, pageSize);
|
|
|
- }
|
|
|
+ ret = paperService.getGenPapers(paperSearchInfo, curPage, pageSize);
|
|
|
+ if (ret.getContent().size() == 0 && ret.getTotalElements() > 0 && curPage > 1) {
|
|
|
+ ret = paperService.getGenPapers(paperSearchInfo, curPage - 1, pageSize);
|
|
|
+ }
|
|
|
}
|
|
|
return new ResponseEntity<>(ret, HttpStatus.OK);
|
|
|
}
|
|
@@ -268,13 +257,13 @@ public class PaperController extends ControllerSupport {
|
|
|
@ApiOperation(value = "删除试卷", notes = "删除试卷")
|
|
|
@DeleteMapping(value = "/paper/{paperIds}")
|
|
|
public ResponseEntity<Object> delPaper(@PathVariable String paperIds) {
|
|
|
- User user = getAccessUser();
|
|
|
+ User user = getAccessUser();
|
|
|
List<String> paperList = Stream.of(paperIds.split(",")).collect(Collectors.toList());
|
|
|
- Map<String, Object> msgMap = paperService.deletePapers(paperList,user);
|
|
|
+ Map<String, Object> msgMap = paperService.deletePapers(paperList, user);
|
|
|
if (msgMap.get("msg").equals("success")) {
|
|
|
return new ResponseEntity<>(msgMap, HttpStatus.OK);
|
|
|
} else {
|
|
|
- throw new StatusException("1001","试卷["+msgMap.get("paperName")+"]中有试题被组卷使用,不能删除!");
|
|
|
+ throw new StatusException("1001", "试卷[" + msgMap.get("paperName") + "]中有试题被组卷使用,不能删除!");
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -416,10 +405,10 @@ public class PaperController extends ControllerSupport {
|
|
|
@DeleteMapping(value = "/paper/deleteQuestion/{questionId}")
|
|
|
public ResponseEntity<Object> deletePaperQuestion(@PathVariable String questionId) {
|
|
|
User user = getAccessUser();
|
|
|
- List<String> paperNames = paperService.deleteImportQuestionById(null,questionId, user);
|
|
|
+ List<String> paperNames = paperService.deleteImportQuestionById(null, questionId, user);
|
|
|
return new ResponseEntity<>(paperNames, HttpStatus.OK);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 删除导入试卷中的试题
|
|
|
*
|
|
@@ -429,9 +418,9 @@ public class PaperController extends ControllerSupport {
|
|
|
@ResponseBody
|
|
|
@ApiOperation(value = "删除导入试卷中的试题", notes = "删除导入试卷中的试题")
|
|
|
@DeleteMapping(value = "/paper/deleteQuestion/{detailUnitId}/{questionId}")
|
|
|
- public ResponseEntity<Object> deleteImportPaperQuestion(@PathVariable String detailUnitId,@PathVariable String questionId) {
|
|
|
+ public ResponseEntity<Object> deleteImportPaperQuestion(@PathVariable String detailUnitId, @PathVariable String questionId) {
|
|
|
User user = getAccessUser();
|
|
|
- List<String> paperNames = paperService.deleteImportQuestionById(detailUnitId,questionId, user);
|
|
|
+ List<String> paperNames = paperService.deleteImportQuestionById(detailUnitId, questionId, user);
|
|
|
return new ResponseEntity<>(paperNames, HttpStatus.OK);
|
|
|
}
|
|
|
|
|
@@ -592,14 +581,14 @@ public class PaperController extends ControllerSupport {
|
|
|
paperSearchInfo.setOrgId(user.getRootOrgId().toString());
|
|
|
Page<Paper> ret;
|
|
|
if (ids != null && ids.length > 0) {
|
|
|
- ret= paperService.getPapersNotInIds(paperSearchInfo, ids, curPage, pageSize, PaperType.IMPORT);
|
|
|
- if(ret.getContent().size()==0&&ret.getTotalElements()>0&&curPage>1) {
|
|
|
- ret= paperService.getPapersNotInIds(paperSearchInfo, ids, curPage-1, pageSize, PaperType.IMPORT);
|
|
|
- }
|
|
|
+ ret = paperService.getPapersNotInIds(paperSearchInfo, ids, curPage, pageSize, PaperType.IMPORT);
|
|
|
+ if (ret.getContent().size() == 0 && ret.getTotalElements() > 0 && curPage > 1) {
|
|
|
+ ret = paperService.getPapersNotInIds(paperSearchInfo, ids, curPage - 1, pageSize, PaperType.IMPORT);
|
|
|
+ }
|
|
|
} else {
|
|
|
- ret= paperService.getImportPapers(paperSearchInfo, curPage, pageSize);
|
|
|
- if(ret.getContent().size()==0&&ret.getTotalElements()>0&&curPage>1) {
|
|
|
- ret= paperService.getImportPapers(paperSearchInfo, curPage-1, pageSize);
|
|
|
+ ret = paperService.getImportPapers(paperSearchInfo, curPage, pageSize);
|
|
|
+ if (ret.getContent().size() == 0 && ret.getTotalElements() > 0 && curPage > 1) {
|
|
|
+ ret = paperService.getImportPapers(paperSearchInfo, curPage - 1, pageSize);
|
|
|
}
|
|
|
}
|
|
|
return new ResponseEntity<>(ret, HttpStatus.OK);
|
|
@@ -635,18 +624,18 @@ public class PaperController extends ControllerSupport {
|
|
|
User user = getAccessUser();
|
|
|
try {
|
|
|
String[] paperIdArray = paperIds.split(",");
|
|
|
- StringBuilder paperInfo=new StringBuilder();
|
|
|
+ StringBuilder paperInfo = new StringBuilder();
|
|
|
for (int i = 0; i < paperIdArray.length; i++) {
|
|
|
Paper oldpaper = cn.com.qmth.examcloud.core.questions.base.Model.of(paperRepo.findById(paperIdArray[i]));
|
|
|
boolean result = paperService.checkPaperName(oldpaper.getName(), PaperType.GENERATE, user.getRootOrgId() + "");
|
|
|
if (!result) {
|
|
|
throw new StatusException("160565", "考试试卷:" + oldpaper.getName() + "已经存在");
|
|
|
}
|
|
|
- paperInfo.append(" 课程:"+oldpaper.getCourse().getName()+"("+oldpaper.getCourse().getCode()+") 试卷名称:"+oldpaper.getName());
|
|
|
+ paperInfo.append(" 课程:" + oldpaper.getCourse().getName() + "(" + oldpaper.getCourse().getCode() + ") 试卷名称:" + oldpaper.getName());
|
|
|
}
|
|
|
paperService.useBasePaper(paperIds, user.getDisplayName());
|
|
|
-
|
|
|
- ReportsUtil.report(new AdminOperateReport(user.getRootOrgId(), user.getUserId(), "导入试卷管理-使用原卷",paperInfo.toString()));
|
|
|
+
|
|
|
+ ReportsUtil.report(new AdminOperateReport(user.getRootOrgId(), user.getUserId(), "导入试卷管理-使用原卷", paperInfo.toString()));
|
|
|
return new ResponseEntity<>(HttpStatus.OK);
|
|
|
} catch (Exception e) {
|
|
|
throw new StatusException("160537", e.getMessage());
|
|
@@ -698,12 +687,12 @@ public class PaperController extends ControllerSupport {
|
|
|
map.put("courseName", previewPaper.getCourseName());
|
|
|
map.put("courseLevel", previewPaper.getCourseLevel());
|
|
|
ExportTemplateUtil.getTemplate(Long.valueOf(paper.getOrgId()), ExportTemplateType.PAPER_VIEW).process(map, result);
|
|
|
- String content=result.toString();
|
|
|
+ String content = result.toString();
|
|
|
model.addAttribute("pageContent", content);
|
|
|
return BASE_PAGE;
|
|
|
} catch (NumberFormatException | TemplateException | IOException e) {
|
|
|
throw new StatusException("500", "解析模板出错!");
|
|
|
- }finally {
|
|
|
+ } finally {
|
|
|
try {
|
|
|
result.close();
|
|
|
} catch (IOException e) {
|
|
@@ -723,7 +712,7 @@ public class PaperController extends ControllerSupport {
|
|
|
ExportPaperAbstractService exportPaperService = PaperUtil.getByRootOrgId(paper.getOrgId());
|
|
|
PaperExp previewPaper = exportPaperService.previewPaperForPDF(paper);
|
|
|
|
|
|
-
|
|
|
+
|
|
|
StringWriter result = new StringWriter();
|
|
|
try {
|
|
|
Map<String, Object> map = new HashMap<String, Object>();
|
|
@@ -734,12 +723,12 @@ public class PaperController extends ControllerSupport {
|
|
|
map.put("courseName", previewPaper.getCourseName());
|
|
|
map.put("courseLevel", previewPaper.getCourseLevel());
|
|
|
ExportTemplateUtil.getTemplate(Long.valueOf(paper.getOrgId()), ExportTemplateType.ANWSER_VIEW).process(map, result);
|
|
|
- String content=result.toString();
|
|
|
+ String content = result.toString();
|
|
|
model.addAttribute("pageContent", content);
|
|
|
return BASE_PAGE;
|
|
|
} catch (NumberFormatException | TemplateException | IOException e) {
|
|
|
throw new StatusException("500", "解析模板出错!");
|
|
|
- }finally {
|
|
|
+ } finally {
|
|
|
try {
|
|
|
result.close();
|
|
|
} catch (IOException e) {
|
|
@@ -775,43 +764,46 @@ public class PaperController extends ControllerSupport {
|
|
|
double total = paperService.getQuestionTypeScore(paperId, publicityType, difficultyType);
|
|
|
return new ResponseEntity<>(total, HttpStatus.OK);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
@ApiOperation(value = "试卷答案导出")
|
|
|
@RequestMapping(value = "/paper/answer/export/{paperId}", method = RequestMethod.GET)
|
|
|
- public void answerExport(@PathVariable String paperId,HttpServletResponse response){
|
|
|
+ public void answerExport(@PathVariable String paperId, HttpServletResponse response) {
|
|
|
User user = getAccessUser();
|
|
|
Paper paper = cn.com.qmth.examcloud.core.questions.base.Model.of(paperRepo.findById(paperId));
|
|
|
- if(paper==null) {
|
|
|
- throw new StatusException("500", "未找到试卷");
|
|
|
+ if (paper == null) {
|
|
|
+ throw new StatusException("500", "未找到试卷");
|
|
|
}
|
|
|
- if(!isSuperAdmin()&&!paper.getOrgId().equals(String.valueOf(user.getRootOrgId()))) {
|
|
|
- throw new StatusException("500", "非法请求");
|
|
|
+ if (!isSuperAdmin() && !paper.getOrgId().equals(String.valueOf(user.getRootOrgId()))) {
|
|
|
+ throw new StatusException("500", "非法请求");
|
|
|
}
|
|
|
List<PaperAnswerDomain> dtos = paperService.answerExport(paper);
|
|
|
ExportUtils.exportEXCEL("试卷答案", PaperAnswerDomain.class, dtos, response);
|
|
|
}
|
|
|
+
|
|
|
@ApiOperation(value = "试卷答案导入")
|
|
|
@RequestMapping(value = "/paper/answer/import/{paperId}", method = RequestMethod.POST)
|
|
|
@ResponseBody
|
|
|
- public void answerImport(@PathVariable String paperId,@RequestPart @NotNull(message = "上传文件不能为空!") MultipartFile dataFile){
|
|
|
+ public void answerImport(@PathVariable String paperId, @RequestPart @NotNull(message = "上传文件不能为空!") MultipartFile dataFile) {
|
|
|
User user = getAccessUser();
|
|
|
Paper paper = cn.com.qmth.examcloud.core.questions.base.Model.of(paperRepo.findById(paperId));
|
|
|
- if(paper==null) {
|
|
|
- throw new StatusException("500", "未找到试卷");
|
|
|
+ if (paper == null) {
|
|
|
+ throw new StatusException("500", "未找到试卷");
|
|
|
}
|
|
|
- if(!isSuperAdmin()&&!paper.getOrgId().equals(String.valueOf(user.getRootOrgId()))) {
|
|
|
- throw new StatusException("500", "非法请求");
|
|
|
+ if (!isSuperAdmin() && !paper.getOrgId().equals(String.valueOf(user.getRootOrgId()))) {
|
|
|
+ throw new StatusException("500", "非法请求");
|
|
|
}
|
|
|
- paperService.answerImport(paper,dataFile);
|
|
|
- StringBuilder paperInfo=new StringBuilder();
|
|
|
- paperInfo.append("课程:"+paper.getCourse().getName()+"("+paper.getCourse().getCode()+")");
|
|
|
- paperInfo.append(" 试卷名称:"+paper.getName());
|
|
|
- ReportsUtil.report(new AdminOperateReport(user.getRootOrgId(), user.getUserId(), "导入试卷管理-试卷答案导入",paperInfo.toString()));
|
|
|
+ paperService.answerImport(paper, dataFile);
|
|
|
+ StringBuilder paperInfo = new StringBuilder();
|
|
|
+ paperInfo.append("课程:" + paper.getCourse().getName() + "(" + paper.getCourse().getCode() + ")");
|
|
|
+ paperInfo.append(" 试卷名称:" + paper.getName());
|
|
|
+ ReportsUtil.report(new AdminOperateReport(user.getRootOrgId(), user.getUserId(), "导入试卷管理-试卷答案导入", paperInfo.toString()));
|
|
|
}
|
|
|
+
|
|
|
@ApiOperation(value = "下载答案模板", notes = "下载答案模板")
|
|
|
@GetMapping("/paper/answer/template")
|
|
|
public void getImportTemplate(HttpServletResponse response) {
|
|
|
String resoucePath = PathUtil.getResoucePath("templates/answerImportTemplate.xlsx");
|
|
|
exportFile("答案导入模板.xlsx", new File(resoucePath));
|
|
|
}
|
|
|
+
|
|
|
}
|