修改实验报告查询上传,下载等接口

限制文件上传上线为300m
master
whb 7 months ago
parent 3784b2134e
commit 11c7ff675e

@ -2,8 +2,10 @@ package com.sztzjy.marketing.controller.stu;
import com.sztzjy.marketing.annotation.AnonymousAccess;
import com.sztzjy.marketing.entity.StuUploadImgAi;
import com.sztzjy.marketing.entity.StuUploadImgAiExample;
import com.sztzjy.marketing.entity.dto.StuCreateArticleDTO;
import com.sztzjy.marketing.entity.dto.StuCreateImgDTO;
import com.sztzjy.marketing.entity.dto.StuUploadAiDTO;
import com.sztzjy.marketing.mapper.StuUploadImgAiMapper;
import com.sztzjy.marketing.qianfan.Qianfan;
import com.sztzjy.marketing.qianfan.model.chat.Message;
@ -20,6 +22,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.yaml.snakeyaml.reader.StreamReader;
@ -42,7 +46,7 @@ import java.util.List;
public class QianFanBigModuleController {
@Autowired
private IFileUtil iFileUtil;
private IFileUtil iFileUtil;
@Autowired
private StuUploadImgAiMapper stuUploadImgAiMapper;
@ -55,10 +59,10 @@ public class QianFanBigModuleController {
@ApiOperation("AI文生图")
//@AnonymousAccess
@PostMapping("/createImgByAi")
public ResultEntity createImgByAi(@RequestBody StuCreateImgDTO stuCreateImgDTO) {
public ResultEntity createImgByAi(@RequestBody StuCreateImgDTO stuCreateImgDTO) {
return qianFanBigModuleService.createImgByAi(stuCreateImgDTO);
return qianFanBigModuleService.createImgByAi(stuCreateImgDTO);
}
@ -76,41 +80,95 @@ public class QianFanBigModuleController {
@ApiOperation("AI文章")
//@AnonymousAccess
@PostMapping("/createArticleByAi")
public Flux<String> createArticleByAi(@RequestBody @Valid List<Message> messageList) {
public Flux<String> createArticleByAi(@RequestBody @Valid List<Message> messageList) {
return qianFanBigModuleService.createArticleByMessage(messageList);
return qianFanBigModuleService.createArticleByMessage(messageList);
}
@ApiOperation("上传图片")
@ApiOperation("文件上传")
@PostMapping("/uploadFile")
@AnonymousAccess
@Transactional(rollbackFor = Exception.class)
public ResultEntity uploadFile(@ApiParam("dataFile") List<MultipartFile> dataFile, @ApiParam("用户ID") String userId) {
public ResultEntity uploadFile(@RequestBody StuUploadAiDTO stuUploadAiDTO) {
//获取后缀
String originalFilename = stuUploadAiDTO.getFile().getOriginalFilename();
String substring = originalFilename.substring(originalFilename.lastIndexOf(".") + 1);
List<String> list = Arrays.asList(
"jpg",
"jpeg",
"png",
"gif",
"bmp",
"tiff",
"webp",
"mp4",
"avi",
"mkv",
"mov",
"wmv",
"flv",
"webm",
"3gp",
"mpeg",
"doc",
"docx",
"pdf", // 添加pdf后缀
"xls", // 添加xls后缀
"xlsx" // 添加xlsx后缀
);
if (!list.contains(substring)) {
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "请上传格式的文件");
}
String upload = iFileUtil.upload(stuUploadAiDTO.getFile());
//判断是第几次上传是哪个模块的,老师是否评分
StuUploadImgAiExample example = new StuUploadImgAiExample();
example.createCriteria().
andUserIdEqualTo(stuUploadAiDTO.getUserId()).
andModuleEqualTo(stuUploadAiDTO.getModule())
.andUploadNumberEqualTo(stuUploadAiDTO.getCount());
List<StuUploadImgAi> stuUploadImgAiList = stuUploadImgAiMapper.selectByExampleWithBLOBs(example);
if (CollectionUtils.isEmpty(stuUploadImgAiList)){
for (MultipartFile multipartFile : dataFile) {
String originalFilename = multipartFile.getOriginalFilename();
String substring = originalFilename.substring(originalFilename.lastIndexOf(".") + 1);
StuUploadImgAi stuUploadImgAi = new StuUploadImgAi();
stuUploadImgAi.setFilePath(upload);
stuUploadImgAi.setCreateTime(new Date());
stuUploadImgAi.setUserId(stuUploadAiDTO.getUserId());
stuUploadImgAi.setModule(stuUploadAiDTO.getModule());
stuUploadImgAi.setUploadNumber(stuUploadAiDTO.getCount());
stuUploadImgAi.setFileSize((double) stuUploadAiDTO.getFile().getSize());
stuUploadImgAi.setFileName(stuUploadAiDTO.getFile().getOriginalFilename());
stuUploadImgAi.setSufxx(substring);
List<String> list = Arrays.asList("jpg", "jpeg", "png", "gif", "bmp", "tiff", "webp");
if (!list.contains(substring)){
return new ResultEntity<>(HttpStatus.BAD_REQUEST,"请上传正确的图片");
}
String upload = iFileUtil.upload(multipartFile);
StuUploadImgAi stuUploadImgAi = new StuUploadImgAi();
stuUploadImgAi.setImgPath(upload);
stuUploadImgAi.setCreateTime(new Date());
stuUploadImgAi.setUserId(userId);
stuUploadImgAiMapper.insertSelective(stuUploadImgAi);
}else {
//更新操作之前判断老师是否已经评阅
StuUploadImgAi stuUploadImgAi = stuUploadImgAiList.get(0);
if (stuUploadImgAi.getTchScore()!=null)
{
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "老师已评分,无法进行修改!");
}
stuUploadImgAi.setFilePath(upload);
stuUploadImgAi.setUpdateTime(new Date());
stuUploadImgAi.setFileSize((double) stuUploadAiDTO.getFile().getSize());
stuUploadImgAi.setFileName(stuUploadAiDTO.getFile().getOriginalFilename());
stuUploadImgAi.setSufxx(substring);
stuUploadImgAiMapper.updateByPrimaryKeyWithBLOBs(stuUploadImgAi);
}
return new ResultEntity<>(HttpStatus.OK,"图片上传成功");
return new ResultEntity<>(HttpStatus.OK, "文件上传成功");
}

@ -30,6 +30,7 @@ import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotNull;
import java.io.*;
import java.nio.file.Path;
import java.nio.file.Paths;
@ -108,10 +109,10 @@ public class StuConceptBlockController {
@GetMapping("/getReport")
@ApiOperation("获取实训报告详情")
//@AnonymousAccess
public ResultDataEntity<StuPracticalTrainingReport> getReport(String userId) {
public ResultEntity getReport(String userId) {
StuPracticalTrainingReport report = stuConceptBlockService.getReport(userId);
return new ResultDataEntity<>(HttpStatus.OK, report);
List<StuUploadImgAi> report = stuConceptBlockService.getReport(userId);
return new ResultEntity<>(HttpStatus.OK, report);
}
@ -174,9 +175,9 @@ public class StuConceptBlockController {
@GetMapping("/download")
@ApiOperation("下载实训报告")
//@AnonymousAccess
public void download(@RequestParam String userId, String TOKEN, HttpServletResponse response) {
public void download(@ApiParam("id不是userId")@NotNull Integer id, @NotNull String TOKEN, HttpServletResponse response) {
TokenProvider.getJWTUser(TOKEN);
stuConceptBlockService.download(userId, response);
stuConceptBlockService.download(id, response);
}
@GetMapping("/getResourceUrl")

@ -4,7 +4,7 @@ import java.util.Date;
import io.swagger.annotations.ApiModelProperty;
/**
* AI
* AI
*
* @author whb
* stu_upload_img_ai
@ -16,13 +16,38 @@ public class StuUploadImgAi {
private String userId;
@ApiModelProperty("图片路径")
private String imgPath;
private String filePath;
@ApiModelProperty("创建时间")
private Date createTime;
@ApiModelProperty("上传序号")
private Integer uploadNumber;
@ApiModelProperty("文件大小")
private Double fileSize;
@ApiModelProperty("文件名")
private String fileName;
@ApiModelProperty("模块名")
private String module;
@ApiModelProperty("老师评分")
private Double tchScore;
@ApiModelProperty("更新时间")
private Date updateTime;
@ApiModelProperty("文件后缀")
private String sufxx;
@ApiModelProperty("暂时不用")
private String append;
@ApiModelProperty("老师评语")
private String tchComment;
public Integer getId() {
return id;
}
@ -39,12 +64,12 @@ public class StuUploadImgAi {
this.userId = userId == null ? null : userId.trim();
}
public String getImgPath() {
return imgPath;
public String getFilePath() {
return filePath;
}
public void setImgPath(String imgPath) {
this.imgPath = imgPath == null ? null : imgPath.trim();
public void setFilePath(String filePath) {
this.filePath = filePath == null ? null : filePath.trim();
}
public Date getCreateTime() {
@ -55,6 +80,62 @@ public class StuUploadImgAi {
this.createTime = createTime;
}
public Integer getUploadNumber() {
return uploadNumber;
}
public void setUploadNumber(Integer uploadNumber) {
this.uploadNumber = uploadNumber;
}
public Double getFileSize() {
return fileSize;
}
public void setFileSize(Double fileSize) {
this.fileSize = fileSize;
}
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName == null ? null : fileName.trim();
}
public String getModule() {
return module;
}
public void setModule(String module) {
this.module = module == null ? null : module.trim();
}
public Double getTchScore() {
return tchScore;
}
public void setTchScore(Double tchScore) {
this.tchScore = tchScore;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public String getSufxx() {
return sufxx;
}
public void setSufxx(String sufxx) {
this.sufxx = sufxx == null ? null : sufxx.trim();
}
public String getAppend() {
return append;
}
@ -62,4 +143,12 @@ public class StuUploadImgAi {
public void setAppend(String append) {
this.append = append == null ? null : append.trim();
}
public String getTchComment() {
return tchComment;
}
public void setTchComment(String tchComment) {
this.tchComment = tchComment == null ? null : tchComment.trim();
}
}

@ -235,73 +235,73 @@ public class StuUploadImgAiExample {
return (Criteria) this;
}
public Criteria andImgPathIsNull() {
addCriterion("img_path is null");
public Criteria andFilePathIsNull() {
addCriterion("file_path is null");
return (Criteria) this;
}
public Criteria andImgPathIsNotNull() {
addCriterion("img_path is not null");
public Criteria andFilePathIsNotNull() {
addCriterion("file_path is not null");
return (Criteria) this;
}
public Criteria andImgPathEqualTo(String value) {
addCriterion("img_path =", value, "imgPath");
public Criteria andFilePathEqualTo(String value) {
addCriterion("file_path =", value, "filePath");
return (Criteria) this;
}
public Criteria andImgPathNotEqualTo(String value) {
addCriterion("img_path <>", value, "imgPath");
public Criteria andFilePathNotEqualTo(String value) {
addCriterion("file_path <>", value, "filePath");
return (Criteria) this;
}
public Criteria andImgPathGreaterThan(String value) {
addCriterion("img_path >", value, "imgPath");
public Criteria andFilePathGreaterThan(String value) {
addCriterion("file_path >", value, "filePath");
return (Criteria) this;
}
public Criteria andImgPathGreaterThanOrEqualTo(String value) {
addCriterion("img_path >=", value, "imgPath");
public Criteria andFilePathGreaterThanOrEqualTo(String value) {
addCriterion("file_path >=", value, "filePath");
return (Criteria) this;
}
public Criteria andImgPathLessThan(String value) {
addCriterion("img_path <", value, "imgPath");
public Criteria andFilePathLessThan(String value) {
addCriterion("file_path <", value, "filePath");
return (Criteria) this;
}
public Criteria andImgPathLessThanOrEqualTo(String value) {
addCriterion("img_path <=", value, "imgPath");
public Criteria andFilePathLessThanOrEqualTo(String value) {
addCriterion("file_path <=", value, "filePath");
return (Criteria) this;
}
public Criteria andImgPathLike(String value) {
addCriterion("img_path like", value, "imgPath");
public Criteria andFilePathLike(String value) {
addCriterion("file_path like", value, "filePath");
return (Criteria) this;
}
public Criteria andImgPathNotLike(String value) {
addCriterion("img_path not like", value, "imgPath");
public Criteria andFilePathNotLike(String value) {
addCriterion("file_path not like", value, "filePath");
return (Criteria) this;
}
public Criteria andImgPathIn(List<String> values) {
addCriterion("img_path in", values, "imgPath");
public Criteria andFilePathIn(List<String> values) {
addCriterion("file_path in", values, "filePath");
return (Criteria) this;
}
public Criteria andImgPathNotIn(List<String> values) {
addCriterion("img_path not in", values, "imgPath");
public Criteria andFilePathNotIn(List<String> values) {
addCriterion("file_path not in", values, "filePath");
return (Criteria) this;
}
public Criteria andImgPathBetween(String value1, String value2) {
addCriterion("img_path between", value1, value2, "imgPath");
public Criteria andFilePathBetween(String value1, String value2) {
addCriterion("file_path between", value1, value2, "filePath");
return (Criteria) this;
}
public Criteria andImgPathNotBetween(String value1, String value2) {
addCriterion("img_path not between", value1, value2, "imgPath");
public Criteria andFilePathNotBetween(String value1, String value2) {
addCriterion("file_path not between", value1, value2, "filePath");
return (Criteria) this;
}
@ -365,6 +365,456 @@ public class StuUploadImgAiExample {
return (Criteria) this;
}
public Criteria andUploadNumberIsNull() {
addCriterion("upload_number is null");
return (Criteria) this;
}
public Criteria andUploadNumberIsNotNull() {
addCriterion("upload_number is not null");
return (Criteria) this;
}
public Criteria andUploadNumberEqualTo(Integer value) {
addCriterion("upload_number =", value, "uploadNumber");
return (Criteria) this;
}
public Criteria andUploadNumberNotEqualTo(Integer value) {
addCriterion("upload_number <>", value, "uploadNumber");
return (Criteria) this;
}
public Criteria andUploadNumberGreaterThan(Integer value) {
addCriterion("upload_number >", value, "uploadNumber");
return (Criteria) this;
}
public Criteria andUploadNumberGreaterThanOrEqualTo(Integer value) {
addCriterion("upload_number >=", value, "uploadNumber");
return (Criteria) this;
}
public Criteria andUploadNumberLessThan(Integer value) {
addCriterion("upload_number <", value, "uploadNumber");
return (Criteria) this;
}
public Criteria andUploadNumberLessThanOrEqualTo(Integer value) {
addCriterion("upload_number <=", value, "uploadNumber");
return (Criteria) this;
}
public Criteria andUploadNumberIn(List<Integer> values) {
addCriterion("upload_number in", values, "uploadNumber");
return (Criteria) this;
}
public Criteria andUploadNumberNotIn(List<Integer> values) {
addCriterion("upload_number not in", values, "uploadNumber");
return (Criteria) this;
}
public Criteria andUploadNumberBetween(Integer value1, Integer value2) {
addCriterion("upload_number between", value1, value2, "uploadNumber");
return (Criteria) this;
}
public Criteria andUploadNumberNotBetween(Integer value1, Integer value2) {
addCriterion("upload_number not between", value1, value2, "uploadNumber");
return (Criteria) this;
}
public Criteria andFileSizeIsNull() {
addCriterion("file_size is null");
return (Criteria) this;
}
public Criteria andFileSizeIsNotNull() {
addCriterion("file_size is not null");
return (Criteria) this;
}
public Criteria andFileSizeEqualTo(Double value) {
addCriterion("file_size =", value, "fileSize");
return (Criteria) this;
}
public Criteria andFileSizeNotEqualTo(Double value) {
addCriterion("file_size <>", value, "fileSize");
return (Criteria) this;
}
public Criteria andFileSizeGreaterThan(Double value) {
addCriterion("file_size >", value, "fileSize");
return (Criteria) this;
}
public Criteria andFileSizeGreaterThanOrEqualTo(Double value) {
addCriterion("file_size >=", value, "fileSize");
return (Criteria) this;
}
public Criteria andFileSizeLessThan(Double value) {
addCriterion("file_size <", value, "fileSize");
return (Criteria) this;
}
public Criteria andFileSizeLessThanOrEqualTo(Double value) {
addCriterion("file_size <=", value, "fileSize");
return (Criteria) this;
}
public Criteria andFileSizeIn(List<Double> values) {
addCriterion("file_size in", values, "fileSize");
return (Criteria) this;
}
public Criteria andFileSizeNotIn(List<Double> values) {
addCriterion("file_size not in", values, "fileSize");
return (Criteria) this;
}
public Criteria andFileSizeBetween(Double value1, Double value2) {
addCriterion("file_size between", value1, value2, "fileSize");
return (Criteria) this;
}
public Criteria andFileSizeNotBetween(Double value1, Double value2) {
addCriterion("file_size not between", value1, value2, "fileSize");
return (Criteria) this;
}
public Criteria andFileNameIsNull() {
addCriterion("file_name is null");
return (Criteria) this;
}
public Criteria andFileNameIsNotNull() {
addCriterion("file_name is not null");
return (Criteria) this;
}
public Criteria andFileNameEqualTo(String value) {
addCriterion("file_name =", value, "fileName");
return (Criteria) this;
}
public Criteria andFileNameNotEqualTo(String value) {
addCriterion("file_name <>", value, "fileName");
return (Criteria) this;
}
public Criteria andFileNameGreaterThan(String value) {
addCriterion("file_name >", value, "fileName");
return (Criteria) this;
}
public Criteria andFileNameGreaterThanOrEqualTo(String value) {
addCriterion("file_name >=", value, "fileName");
return (Criteria) this;
}
public Criteria andFileNameLessThan(String value) {
addCriterion("file_name <", value, "fileName");
return (Criteria) this;
}
public Criteria andFileNameLessThanOrEqualTo(String value) {
addCriterion("file_name <=", value, "fileName");
return (Criteria) this;
}
public Criteria andFileNameLike(String value) {
addCriterion("file_name like", value, "fileName");
return (Criteria) this;
}
public Criteria andFileNameNotLike(String value) {
addCriterion("file_name not like", value, "fileName");
return (Criteria) this;
}
public Criteria andFileNameIn(List<String> values) {
addCriterion("file_name in", values, "fileName");
return (Criteria) this;
}
public Criteria andFileNameNotIn(List<String> values) {
addCriterion("file_name not in", values, "fileName");
return (Criteria) this;
}
public Criteria andFileNameBetween(String value1, String value2) {
addCriterion("file_name between", value1, value2, "fileName");
return (Criteria) this;
}
public Criteria andFileNameNotBetween(String value1, String value2) {
addCriterion("file_name not between", value1, value2, "fileName");
return (Criteria) this;
}
public Criteria andModuleIsNull() {
addCriterion("module is null");
return (Criteria) this;
}
public Criteria andModuleIsNotNull() {
addCriterion("module is not null");
return (Criteria) this;
}
public Criteria andModuleEqualTo(String value) {
addCriterion("module =", value, "module");
return (Criteria) this;
}
public Criteria andModuleNotEqualTo(String value) {
addCriterion("module <>", value, "module");
return (Criteria) this;
}
public Criteria andModuleGreaterThan(String value) {
addCriterion("module >", value, "module");
return (Criteria) this;
}
public Criteria andModuleGreaterThanOrEqualTo(String value) {
addCriterion("module >=", value, "module");
return (Criteria) this;
}
public Criteria andModuleLessThan(String value) {
addCriterion("module <", value, "module");
return (Criteria) this;
}
public Criteria andModuleLessThanOrEqualTo(String value) {
addCriterion("module <=", value, "module");
return (Criteria) this;
}
public Criteria andModuleLike(String value) {
addCriterion("module like", value, "module");
return (Criteria) this;
}
public Criteria andModuleNotLike(String value) {
addCriterion("module not like", value, "module");
return (Criteria) this;
}
public Criteria andModuleIn(List<String> values) {
addCriterion("module in", values, "module");
return (Criteria) this;
}
public Criteria andModuleNotIn(List<String> values) {
addCriterion("module not in", values, "module");
return (Criteria) this;
}
public Criteria andModuleBetween(String value1, String value2) {
addCriterion("module between", value1, value2, "module");
return (Criteria) this;
}
public Criteria andModuleNotBetween(String value1, String value2) {
addCriterion("module not between", value1, value2, "module");
return (Criteria) this;
}
public Criteria andTchScoreIsNull() {
addCriterion("tch_score is null");
return (Criteria) this;
}
public Criteria andTchScoreIsNotNull() {
addCriterion("tch_score is not null");
return (Criteria) this;
}
public Criteria andTchScoreEqualTo(Double value) {
addCriterion("tch_score =", value, "tchScore");
return (Criteria) this;
}
public Criteria andTchScoreNotEqualTo(Double value) {
addCriterion("tch_score <>", value, "tchScore");
return (Criteria) this;
}
public Criteria andTchScoreGreaterThan(Double value) {
addCriterion("tch_score >", value, "tchScore");
return (Criteria) this;
}
public Criteria andTchScoreGreaterThanOrEqualTo(Double value) {
addCriterion("tch_score >=", value, "tchScore");
return (Criteria) this;
}
public Criteria andTchScoreLessThan(Double value) {
addCriterion("tch_score <", value, "tchScore");
return (Criteria) this;
}
public Criteria andTchScoreLessThanOrEqualTo(Double value) {
addCriterion("tch_score <=", value, "tchScore");
return (Criteria) this;
}
public Criteria andTchScoreIn(List<Double> values) {
addCriterion("tch_score in", values, "tchScore");
return (Criteria) this;
}
public Criteria andTchScoreNotIn(List<Double> values) {
addCriterion("tch_score not in", values, "tchScore");
return (Criteria) this;
}
public Criteria andTchScoreBetween(Double value1, Double value2) {
addCriterion("tch_score between", value1, value2, "tchScore");
return (Criteria) this;
}
public Criteria andTchScoreNotBetween(Double value1, Double value2) {
addCriterion("tch_score not between", value1, value2, "tchScore");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNull() {
addCriterion("update_time is null");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNotNull() {
addCriterion("update_time is not null");
return (Criteria) this;
}
public Criteria andUpdateTimeEqualTo(Date value) {
addCriterion("update_time =", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotEqualTo(Date value) {
addCriterion("update_time <>", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThan(Date value) {
addCriterion("update_time >", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("update_time >=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThan(Date value) {
addCriterion("update_time <", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThanOrEqualTo(Date value) {
addCriterion("update_time <=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIn(List<Date> values) {
addCriterion("update_time in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotIn(List<Date> values) {
addCriterion("update_time not in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeBetween(Date value1, Date value2) {
addCriterion("update_time between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotBetween(Date value1, Date value2) {
addCriterion("update_time not between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andSufxxIsNull() {
addCriterion("sufxx is null");
return (Criteria) this;
}
public Criteria andSufxxIsNotNull() {
addCriterion("sufxx is not null");
return (Criteria) this;
}
public Criteria andSufxxEqualTo(String value) {
addCriterion("sufxx =", value, "sufxx");
return (Criteria) this;
}
public Criteria andSufxxNotEqualTo(String value) {
addCriterion("sufxx <>", value, "sufxx");
return (Criteria) this;
}
public Criteria andSufxxGreaterThan(String value) {
addCriterion("sufxx >", value, "sufxx");
return (Criteria) this;
}
public Criteria andSufxxGreaterThanOrEqualTo(String value) {
addCriterion("sufxx >=", value, "sufxx");
return (Criteria) this;
}
public Criteria andSufxxLessThan(String value) {
addCriterion("sufxx <", value, "sufxx");
return (Criteria) this;
}
public Criteria andSufxxLessThanOrEqualTo(String value) {
addCriterion("sufxx <=", value, "sufxx");
return (Criteria) this;
}
public Criteria andSufxxLike(String value) {
addCriterion("sufxx like", value, "sufxx");
return (Criteria) this;
}
public Criteria andSufxxNotLike(String value) {
addCriterion("sufxx not like", value, "sufxx");
return (Criteria) this;
}
public Criteria andSufxxIn(List<String> values) {
addCriterion("sufxx in", values, "sufxx");
return (Criteria) this;
}
public Criteria andSufxxNotIn(List<String> values) {
addCriterion("sufxx not in", values, "sufxx");
return (Criteria) this;
}
public Criteria andSufxxBetween(String value1, String value2) {
addCriterion("sufxx between", value1, value2, "sufxx");
return (Criteria) this;
}
public Criteria andSufxxNotBetween(String value1, String value2) {
addCriterion("sufxx not between", value1, value2, "sufxx");
return (Criteria) this;
}
public Criteria andAppendIsNull() {
addCriterion("append is null");
return (Criteria) this;

@ -0,0 +1,25 @@
package com.sztzjy.marketing.entity.dto;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
/**
* @author 17803
* @date 2024-08-20 10:06
*/
@Data
public class StuUploadAiDTO {
private MultipartFile file;
private String userId;
private String module;
@ApiModelProperty("上传模块的第几个文件1,2,3")
private Integer count;
}

@ -3,10 +3,8 @@ package com.sztzjy.marketing.mapper;
import com.sztzjy.marketing.entity.StuUploadImgAi;
import com.sztzjy.marketing.entity.StuUploadImgAiExample;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface StuUploadImgAiMapper {
long countByExample(StuUploadImgAiExample example);
@ -18,15 +16,21 @@ public interface StuUploadImgAiMapper {
int insertSelective(StuUploadImgAi record);
List<StuUploadImgAi> selectByExampleWithBLOBs(StuUploadImgAiExample example);
List<StuUploadImgAi> selectByExample(StuUploadImgAiExample example);
StuUploadImgAi selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") StuUploadImgAi record, @Param("example") StuUploadImgAiExample example);
int updateByExampleWithBLOBs(@Param("record") StuUploadImgAi record, @Param("example") StuUploadImgAiExample example);
int updateByExample(@Param("record") StuUploadImgAi record, @Param("example") StuUploadImgAiExample example);
int updateByPrimaryKeySelective(StuUploadImgAi record);
int updateByPrimaryKeyWithBLOBs(StuUploadImgAi record);
int updateByPrimaryKey(StuUploadImgAi record);
}

@ -4,6 +4,7 @@ package com.sztzjy.marketing.service;
import com.sztzjy.marketing.entity.StuPracticalTrainingReport;
import com.sztzjy.marketing.entity.StuResources;
import com.sztzjy.marketing.entity.StuUploadImgAi;
import com.sztzjy.marketing.entity.dto.StuAssessmentQuestionDetailsDTO;
import com.sztzjy.marketing.entity.dto.StuBlockProductWithDTO;
import com.sztzjy.marketing.entity.dto.StuLearningAssessmentScoreDTO;
@ -28,9 +29,9 @@ public interface StuConceptBlockService {
StuPracticalTrainingReport upload(MultipartFile file, StuBlockProductWithDTO stuBlockProductWithBLOBs);
void download(String id, HttpServletResponse response);
void download(Integer id, HttpServletResponse response);
StuPracticalTrainingReport getReport(String userId);
List<StuUploadImgAi> getReport(String userId);
/**
* pdf

@ -487,27 +487,20 @@ public class StuConceptBlockServiceImpl implements StuConceptBlockService {
*
*/
@Override
public void download(String id, HttpServletResponse response) {
StuPracticalTrainingReportExample reportExample = new StuPracticalTrainingReportExample();
reportExample.createCriteria().andUseridEqualTo(id);
public void download(Integer id, HttpServletResponse response) {
StuUploadImgAi stuUploadImgAi = stuUploadImgAiMapper.selectByPrimaryKey(id);
Assert.isTrue(stuUploadImgAi != null && stuUploadImgAi.getFilePath() != null, "文件不存在");
List<StuPracticalTrainingReport> stuPracticalTrainingReport = stuPracticalTrainingReportMapper.selectByExample(reportExample);
if (stuPracticalTrainingReport.size()>0)
{
Assert.isTrue(stuPracticalTrainingReport != null && stuPracticalTrainingReport.get(0).getUrl() != null, "报告不存在");
fileUtil.download(response, stuPracticalTrainingReport.get(0).getReportName(), stuPracticalTrainingReport.get(0).getUrl());
}else {
throw new RuntimeException("报告不存在");
}
fileUtil.download(response, stuUploadImgAi.getFileName(), stuUploadImgAi.getFilePath());
}
@Autowired
private StuUploadImgAiMapper stuUploadImgAiMapper;
/**
*
*
@ -515,19 +508,19 @@ public class StuConceptBlockServiceImpl implements StuConceptBlockService {
* @return
*/
@Override
public StuPracticalTrainingReport getReport(String userId) {
public List<StuUploadImgAi> getReport(String userId) {
//获取实验报告
StuPracticalTrainingReportExample export = new StuPracticalTrainingReportExample();
export.createCriteria().andUseridEqualTo(userId);
if (stuPracticalTrainingReportMapper.selectByExample(export).size() != 0) {
StuPracticalTrainingReport report = stuPracticalTrainingReportMapper.selectByExample(export).get(0);
StuUploadImgAiExample export = new StuUploadImgAiExample();
export.createCriteria().andUserIdEqualTo(userId);
return report;
List<StuUploadImgAi> stuUploadImgAiList = stuUploadImgAiMapper.selectByExampleWithBLOBs(export);
if (CollectionUtils.isEmpty(stuUploadImgAiList)){
return null;
}else {
return stuUploadImgAiList;
}
return null;
}

@ -12,8 +12,8 @@ spring:
active: dev
servlet:
multipart:
max-file-size: 500MB
max-request-size: 500MB
max-file-size: 300MB
max-request-size: 300MB
jackson:
time-zol ne: GMT+8
mvc:

@ -4,10 +4,20 @@
<resultMap id="BaseResultMap" type="com.sztzjy.marketing.entity.StuUploadImgAi">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="user_id" jdbcType="VARCHAR" property="userId" />
<result column="img_path" jdbcType="VARCHAR" property="imgPath" />
<result column="file_path" jdbcType="VARCHAR" property="filePath" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="upload_number" jdbcType="INTEGER" property="uploadNumber" />
<result column="file_size" jdbcType="DOUBLE" property="fileSize" />
<result column="file_name" jdbcType="VARCHAR" property="fileName" />
<result column="module" jdbcType="VARCHAR" property="module" />
<result column="tch_score" jdbcType="DOUBLE" property="tchScore" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="sufxx" jdbcType="VARCHAR" property="sufxx" />
<result column="append" jdbcType="VARCHAR" property="append" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.sztzjy.marketing.entity.StuUploadImgAi">
<result column="tch_comment" jdbcType="LONGVARCHAR" property="tchComment" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
@ -67,8 +77,28 @@
</where>
</sql>
<sql id="Base_Column_List">
id, user_id, img_path, create_time, append
id, user_id, file_path, create_time, upload_number, file_size, file_name, module,
tch_score, update_time, sufxx, append
</sql>
<sql id="Blob_Column_List">
tch_comment
</sql>
<select id="selectByExampleWithBLOBs" parameterType="com.sztzjy.marketing.entity.StuUploadImgAiExample" resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from stu_upload_img_ai
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExample" parameterType="com.sztzjy.marketing.entity.StuUploadImgAiExample" resultMap="BaseResultMap">
select
<if test="distinct">
@ -83,9 +113,11 @@
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from stu_upload_img_ai
where id = #{id,jdbcType=INTEGER}
</select>
@ -100,10 +132,16 @@
</if>
</delete>
<insert id="insert" parameterType="com.sztzjy.marketing.entity.StuUploadImgAi">
insert into stu_upload_img_ai (id, user_id, img_path,
create_time, append)
values (#{id,jdbcType=INTEGER}, #{userId,jdbcType=VARCHAR}, #{imgPath,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{append,jdbcType=VARCHAR})
insert into stu_upload_img_ai (id, user_id, file_path,
create_time, upload_number, file_size,
file_name, module, tch_score,
update_time, sufxx, append,
tch_comment)
values (#{id,jdbcType=INTEGER}, #{userId,jdbcType=VARCHAR}, #{filePath,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{uploadNumber,jdbcType=INTEGER}, #{fileSize,jdbcType=DOUBLE},
#{fileName,jdbcType=VARCHAR}, #{module,jdbcType=VARCHAR}, #{tchScore,jdbcType=DOUBLE},
#{updateTime,jdbcType=TIMESTAMP}, #{sufxx,jdbcType=VARCHAR}, #{append,jdbcType=VARCHAR},
#{tchComment,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.marketing.entity.StuUploadImgAi">
insert into stu_upload_img_ai
@ -114,15 +152,39 @@
<if test="userId != null">
user_id,
</if>
<if test="imgPath != null">
img_path,
<if test="filePath != null">
file_path,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="uploadNumber != null">
upload_number,
</if>
<if test="fileSize != null">
file_size,
</if>
<if test="fileName != null">
file_name,
</if>
<if test="module != null">
module,
</if>
<if test="tchScore != null">
tch_score,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="sufxx != null">
sufxx,
</if>
<if test="append != null">
append,
</if>
<if test="tchComment != null">
tch_comment,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@ -131,15 +193,39 @@
<if test="userId != null">
#{userId,jdbcType=VARCHAR},
</if>
<if test="imgPath != null">
#{imgPath,jdbcType=VARCHAR},
<if test="filePath != null">
#{filePath,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="uploadNumber != null">
#{uploadNumber,jdbcType=INTEGER},
</if>
<if test="fileSize != null">
#{fileSize,jdbcType=DOUBLE},
</if>
<if test="fileName != null">
#{fileName,jdbcType=VARCHAR},
</if>
<if test="module != null">
#{module,jdbcType=VARCHAR},
</if>
<if test="tchScore != null">
#{tchScore,jdbcType=DOUBLE},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="sufxx != null">
#{sufxx,jdbcType=VARCHAR},
</if>
<if test="append != null">
#{append,jdbcType=VARCHAR},
</if>
<if test="tchComment != null">
#{tchComment,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.marketing.entity.StuUploadImgAiExample" resultType="java.lang.Long">
@ -157,26 +243,76 @@
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=VARCHAR},
</if>
<if test="record.imgPath != null">
img_path = #{record.imgPath,jdbcType=VARCHAR},
<if test="record.filePath != null">
file_path = #{record.filePath,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.uploadNumber != null">
upload_number = #{record.uploadNumber,jdbcType=INTEGER},
</if>
<if test="record.fileSize != null">
file_size = #{record.fileSize,jdbcType=DOUBLE},
</if>
<if test="record.fileName != null">
file_name = #{record.fileName,jdbcType=VARCHAR},
</if>
<if test="record.module != null">
module = #{record.module,jdbcType=VARCHAR},
</if>
<if test="record.tchScore != null">
tch_score = #{record.tchScore,jdbcType=DOUBLE},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
<if test="record.sufxx != null">
sufxx = #{record.sufxx,jdbcType=VARCHAR},
</if>
<if test="record.append != null">
append = #{record.append,jdbcType=VARCHAR},
</if>
<if test="record.tchComment != null">
tch_comment = #{record.tchComment,jdbcType=LONGVARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
update stu_upload_img_ai
set id = #{record.id,jdbcType=INTEGER},
user_id = #{record.userId,jdbcType=VARCHAR},
file_path = #{record.filePath,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
upload_number = #{record.uploadNumber,jdbcType=INTEGER},
file_size = #{record.fileSize,jdbcType=DOUBLE},
file_name = #{record.fileName,jdbcType=VARCHAR},
module = #{record.module,jdbcType=VARCHAR},
tch_score = #{record.tchScore,jdbcType=DOUBLE},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
sufxx = #{record.sufxx,jdbcType=VARCHAR},
append = #{record.append,jdbcType=VARCHAR},
tch_comment = #{record.tchComment,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update stu_upload_img_ai
set id = #{record.id,jdbcType=INTEGER},
user_id = #{record.userId,jdbcType=VARCHAR},
img_path = #{record.imgPath,jdbcType=VARCHAR},
file_path = #{record.filePath,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
upload_number = #{record.uploadNumber,jdbcType=INTEGER},
file_size = #{record.fileSize,jdbcType=DOUBLE},
file_name = #{record.fileName,jdbcType=VARCHAR},
module = #{record.module,jdbcType=VARCHAR},
tch_score = #{record.tchScore,jdbcType=DOUBLE},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
sufxx = #{record.sufxx,jdbcType=VARCHAR},
append = #{record.append,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -188,23 +324,70 @@
<if test="userId != null">
user_id = #{userId,jdbcType=VARCHAR},
</if>
<if test="imgPath != null">
img_path = #{imgPath,jdbcType=VARCHAR},
<if test="filePath != null">
file_path = #{filePath,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="uploadNumber != null">
upload_number = #{uploadNumber,jdbcType=INTEGER},
</if>
<if test="fileSize != null">
file_size = #{fileSize,jdbcType=DOUBLE},
</if>
<if test="fileName != null">
file_name = #{fileName,jdbcType=VARCHAR},
</if>
<if test="module != null">
module = #{module,jdbcType=VARCHAR},
</if>
<if test="tchScore != null">
tch_score = #{tchScore,jdbcType=DOUBLE},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="sufxx != null">
sufxx = #{sufxx,jdbcType=VARCHAR},
</if>
<if test="append != null">
append = #{append,jdbcType=VARCHAR},
</if>
<if test="tchComment != null">
tch_comment = #{tchComment,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.sztzjy.marketing.entity.StuUploadImgAi">
update stu_upload_img_ai
set user_id = #{userId,jdbcType=VARCHAR},
file_path = #{filePath,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
upload_number = #{uploadNumber,jdbcType=INTEGER},
file_size = #{fileSize,jdbcType=DOUBLE},
file_name = #{fileName,jdbcType=VARCHAR},
module = #{module,jdbcType=VARCHAR},
tch_score = #{tchScore,jdbcType=DOUBLE},
update_time = #{updateTime,jdbcType=TIMESTAMP},
sufxx = #{sufxx,jdbcType=VARCHAR},
append = #{append,jdbcType=VARCHAR},
tch_comment = #{tchComment,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.marketing.entity.StuUploadImgAi">
update stu_upload_img_ai
set user_id = #{userId,jdbcType=VARCHAR},
img_path = #{imgPath,jdbcType=VARCHAR},
file_path = #{filePath,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
upload_number = #{uploadNumber,jdbcType=INTEGER},
file_size = #{fileSize,jdbcType=DOUBLE},
file_name = #{fileName,jdbcType=VARCHAR},
module = #{module,jdbcType=VARCHAR},
tch_score = #{tchScore,jdbcType=DOUBLE},
update_time = #{updateTime,jdbcType=TIMESTAMP},
sufxx = #{sufxx,jdbcType=VARCHAR},
append = #{append,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>

Loading…
Cancel
Save