通过excel导入题目管理信息bug修复

This commit is contained in:
guoshengxiong 2024-08-10 15:39:15 +08:00
parent 723f3ffc0b
commit 6117a314d3

View File

@ -363,6 +363,7 @@ public class ExamQuestionBankController {
* @param response
* @return
*/
@OperLog(operModul = "题目管理", operType = "导入", operDesc = "通过excel导入题目管理信息")
@ApiOperation(value = "通过excel导入题目管理信息", notes = "通过excel导入题目管理信息", httpMethod = "POST")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
@ -371,6 +372,7 @@ public class ExamQuestionBankController {
List<ExamSubject> subList = examSubjectService.list();
UserInfo user = SecurityUtils.getUser();
SystemUser systemUser = systemUserService.getById(user.getUserId());
String projectSn = request.getParameter("projectSn");
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
MultipartFile file = entity.getValue();// 获取上传文件对象
try {
@ -408,7 +410,7 @@ public class ExamQuestionBankController {
} catch (Exception e) {
throw new CustomException("分数格式错误,请填写正确的分数", HttpStatus.INTERNAL_SERVER_ERROR);
}
examQuestionBank.setProjectSn(systemUser.getSn());
examQuestionBank.setProjectSn(projectSn);
examQuestionBank.setCreateBy(systemUser.getUserId().toString());
examQuestionBank.setCreateTime(new Date());
examQuestionBank.setUpdateBy(systemUser.getUserId().toString());