第一轮测试bug修复

master
whb 7 months ago
parent f6daa0720e
commit 15de247588

@ -1,25 +1,34 @@
package com.sztzjy.marketing.controller.stu;
import com.sztzjy.marketing.annotation.AnonymousAccess;
import com.sztzjy.marketing.entity.StuUploadImgAi;
import com.sztzjy.marketing.entity.dto.StuCreateArticleDTO;
import com.sztzjy.marketing.entity.dto.StuCreateImgDTO;
import com.sztzjy.marketing.mapper.StuUploadImgAiMapper;
import com.sztzjy.marketing.qianfan.Qianfan;
import com.sztzjy.marketing.qianfan.model.chat.Message;
import com.sztzjy.marketing.service.QianFanBigModuleService;
import com.sztzjy.marketing.util.ResultDataEntity;
import com.sztzjy.marketing.util.ResultEntity;
import com.sztzjy.marketing.util.RsaUtil;
import com.sztzjy.marketing.util.file.IFileUtil;
import com.sztzjy.marketing.util.file.LocalFileUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
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.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.yaml.snakeyaml.reader.StreamReader;
import reactor.core.publisher.Flux;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
/**
@ -32,7 +41,11 @@ import java.util.List;
@RestController
public class QianFanBigModuleController {
@Autowired
private IFileUtil iFileUtil;
@Autowired
private StuUploadImgAiMapper stuUploadImgAiMapper;
@Autowired
@ -63,7 +76,7 @@ public class QianFanBigModuleController {
@ApiOperation("AI文章")
//@AnonymousAccess
@PostMapping("/createArticleByAi")
public Flux<String> createArticleByAi(@RequestBody List<Message> messageList) {
public Flux<String> createArticleByAi(@RequestBody @Valid List<Message> messageList) {
@ -72,5 +85,34 @@ public class QianFanBigModuleController {
}
@ApiOperation("上传图片")
@PostMapping("/uploadFile")
@AnonymousAccess
@Transactional(rollbackFor = Exception.class)
public ResultEntity uploadFile(@ApiParam("dataFile") List<MultipartFile> dataFile, @ApiParam("用户ID") String userId) {
for (MultipartFile multipartFile : dataFile) {
String originalFilename = multipartFile.getOriginalFilename();
String substring = originalFilename.substring(originalFilename.lastIndexOf(".") + 1);
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);
}
return new ResultEntity<>(HttpStatus.OK,"图片上传成功");
}
}

@ -67,6 +67,15 @@ public class StuUserProfileDatabaseController {
}
@GetMapping("/selfExcelBaseInfo")
//@AnonymousAccess
@ApiOperation("自荐表数据下拉框")
public ResultEntity selfExcelBaseInfo( @ApiParam("用户ID")String userId){
return userProfileDatabaseService.selfExcelBaseInfo(userId);
}
//导入外部Excel格式的数据

@ -1,22 +1,37 @@
package com.sztzjy.marketing.entity;
import io.swagger.annotations.ApiModelProperty;
/**
*
* @author whb
* admin_excel_error_message
*/
public class AdminExcelErrorMessage {
@ApiModelProperty("id")
private Integer id;
@ApiModelProperty("题目")
private String topicName;
@ApiModelProperty("题目类型")
private String topicType;
@ApiModelProperty("题目ID")
private String topicId;
@ApiModelProperty("状态")
private String state;
@ApiModelProperty("错误信息")
private String resultMsg;
@ApiModelProperty("归属模块")
private String module;
@ApiModelProperty("用户ID")
private String userid;
@ApiModelProperty("提交状态")
private Integer submissionState;
public Integer getId() {

@ -0,0 +1,65 @@
package com.sztzjy.marketing.entity;
import java.util.Date;
import io.swagger.annotations.ApiModelProperty;
/**
* AI
*
* @author whb
* stu_upload_img_ai
*/
public class StuUploadImgAi {
private Integer id;
@ApiModelProperty("用户id")
private String userId;
@ApiModelProperty("图片路径")
private String imgPath;
@ApiModelProperty("创建时间")
private Date createTime;
private String append;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId == null ? null : userId.trim();
}
public String getImgPath() {
return imgPath;
}
public void setImgPath(String imgPath) {
this.imgPath = imgPath == null ? null : imgPath.trim();
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getAppend() {
return append;
}
public void setAppend(String append) {
this.append = append == null ? null : append.trim();
}
}

@ -0,0 +1,530 @@
package com.sztzjy.marketing.entity;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class StuUploadImgAiExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public StuUploadImgAiExample() {
oredCriteria = new ArrayList<>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Integer value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Integer value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Integer value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Integer value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Integer value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Integer> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Integer> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Integer value1, Integer value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Integer value1, Integer value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andUserIdIsNull() {
addCriterion("user_id is null");
return (Criteria) this;
}
public Criteria andUserIdIsNotNull() {
addCriterion("user_id is not null");
return (Criteria) this;
}
public Criteria andUserIdEqualTo(String value) {
addCriterion("user_id =", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotEqualTo(String value) {
addCriterion("user_id <>", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThan(String value) {
addCriterion("user_id >", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThanOrEqualTo(String value) {
addCriterion("user_id >=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThan(String value) {
addCriterion("user_id <", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThanOrEqualTo(String value) {
addCriterion("user_id <=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLike(String value) {
addCriterion("user_id like", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotLike(String value) {
addCriterion("user_id not like", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdIn(List<String> values) {
addCriterion("user_id in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotIn(List<String> values) {
addCriterion("user_id not in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdBetween(String value1, String value2) {
addCriterion("user_id between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotBetween(String value1, String value2) {
addCriterion("user_id not between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andImgPathIsNull() {
addCriterion("img_path is null");
return (Criteria) this;
}
public Criteria andImgPathIsNotNull() {
addCriterion("img_path is not null");
return (Criteria) this;
}
public Criteria andImgPathEqualTo(String value) {
addCriterion("img_path =", value, "imgPath");
return (Criteria) this;
}
public Criteria andImgPathNotEqualTo(String value) {
addCriterion("img_path <>", value, "imgPath");
return (Criteria) this;
}
public Criteria andImgPathGreaterThan(String value) {
addCriterion("img_path >", value, "imgPath");
return (Criteria) this;
}
public Criteria andImgPathGreaterThanOrEqualTo(String value) {
addCriterion("img_path >=", value, "imgPath");
return (Criteria) this;
}
public Criteria andImgPathLessThan(String value) {
addCriterion("img_path <", value, "imgPath");
return (Criteria) this;
}
public Criteria andImgPathLessThanOrEqualTo(String value) {
addCriterion("img_path <=", value, "imgPath");
return (Criteria) this;
}
public Criteria andImgPathLike(String value) {
addCriterion("img_path like", value, "imgPath");
return (Criteria) this;
}
public Criteria andImgPathNotLike(String value) {
addCriterion("img_path not like", value, "imgPath");
return (Criteria) this;
}
public Criteria andImgPathIn(List<String> values) {
addCriterion("img_path in", values, "imgPath");
return (Criteria) this;
}
public Criteria andImgPathNotIn(List<String> values) {
addCriterion("img_path not in", values, "imgPath");
return (Criteria) this;
}
public Criteria andImgPathBetween(String value1, String value2) {
addCriterion("img_path between", value1, value2, "imgPath");
return (Criteria) this;
}
public Criteria andImgPathNotBetween(String value1, String value2) {
addCriterion("img_path not between", value1, value2, "imgPath");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null");
return (Criteria) this;
}
public Criteria andCreateTimeIsNotNull() {
addCriterion("create_time is not null");
return (Criteria) this;
}
public Criteria andCreateTimeEqualTo(Date value) {
addCriterion("create_time =", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotEqualTo(Date value) {
addCriterion("create_time <>", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThan(Date value) {
addCriterion("create_time >", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("create_time >=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThan(Date value) {
addCriterion("create_time <", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
addCriterion("create_time <=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeIn(List<Date> values) {
addCriterion("create_time in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotIn(List<Date> values) {
addCriterion("create_time not in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeBetween(Date value1, Date value2) {
addCriterion("create_time between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
addCriterion("create_time not between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andAppendIsNull() {
addCriterion("append is null");
return (Criteria) this;
}
public Criteria andAppendIsNotNull() {
addCriterion("append is not null");
return (Criteria) this;
}
public Criteria andAppendEqualTo(String value) {
addCriterion("append =", value, "append");
return (Criteria) this;
}
public Criteria andAppendNotEqualTo(String value) {
addCriterion("append <>", value, "append");
return (Criteria) this;
}
public Criteria andAppendGreaterThan(String value) {
addCriterion("append >", value, "append");
return (Criteria) this;
}
public Criteria andAppendGreaterThanOrEqualTo(String value) {
addCriterion("append >=", value, "append");
return (Criteria) this;
}
public Criteria andAppendLessThan(String value) {
addCriterion("append <", value, "append");
return (Criteria) this;
}
public Criteria andAppendLessThanOrEqualTo(String value) {
addCriterion("append <=", value, "append");
return (Criteria) this;
}
public Criteria andAppendLike(String value) {
addCriterion("append like", value, "append");
return (Criteria) this;
}
public Criteria andAppendNotLike(String value) {
addCriterion("append not like", value, "append");
return (Criteria) this;
}
public Criteria andAppendIn(List<String> values) {
addCriterion("append in", values, "append");
return (Criteria) this;
}
public Criteria andAppendNotIn(List<String> values) {
addCriterion("append not in", values, "append");
return (Criteria) this;
}
public Criteria andAppendBetween(String value1, String value2) {
addCriterion("append between", value1, value2, "append");
return (Criteria) this;
}
public Criteria andAppendNotBetween(String value1, String value2) {
addCriterion("append not between", value1, value2, "append");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

@ -9,11 +9,11 @@ import lombok.Data;
@Data
public class StuBlockProductWithDTO {
private String module;
private String schoolId;
private String userId;
private String ascription;
}

@ -2,11 +2,9 @@ package com.sztzjy.marketing.mapper;
import com.sztzjy.marketing.entity.AdminExcelErrorMessage;
import com.sztzjy.marketing.entity.AdminExcelErrorMessageExample;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface AdminExcelErrorMessageMapper {
long countByExample(AdminExcelErrorMessageExample example);

@ -32,4 +32,6 @@ public interface StuUploadExcelUserMapper {
//根据用userId查询用户导入数据去重后的module
List<String> selectDistModuleName(String userId);
}

@ -0,0 +1,32 @@
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);
int deleteByExample(StuUploadImgAiExample example);
int deleteByPrimaryKey(Integer id);
int insert(StuUploadImgAi record);
int insertSelective(StuUploadImgAi record);
List<StuUploadImgAi> selectByExample(StuUploadImgAiExample example);
StuUploadImgAi selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") StuUploadImgAi record, @Param("example") StuUploadImgAiExample example);
int updateByExample(@Param("record") StuUploadImgAi record, @Param("example") StuUploadImgAiExample example);
int updateByPrimaryKeySelective(StuUploadImgAi record);
int updateByPrimaryKey(StuUploadImgAi record);
}

@ -20,6 +20,8 @@ import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotNull;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ -39,6 +41,7 @@ public class Message {
*/
private String name;
@NotNull
private String userId;
/**

@ -26,4 +26,12 @@ public interface StuUserProfileDatabaseService {
*/
ResultEntity getBaseInfoBySelect(String userId, String tableName, String selfTableName,Integer index,Integer size);
/*
*
* *
* @return
*/
ResultEntity selfExcelBaseInfo(String userId);
}

@ -23,12 +23,13 @@ import lombok.extern.slf4j.Slf4j;
import okhttp3.*;
import okio.BufferedSource;
import okio.Okio;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.client.methods.HttpPost;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.task.AsyncTaskExecutor;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import reactor.core.publisher.Flux;
@ -37,6 +38,7 @@ import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@Service
@ -114,6 +116,10 @@ public class QianFanBigModuleServiceImpl implements QianFanBigModuleService {
@Override
public Flux<String> createArticleByMessage(List<Message> messageList) {
if (!StringUtils.hasText(messageList.get(0).getUserId())){
throw new RuntimeException("userId不能为空");
}
int count = 0;
for (Message message : messageList) {
int length = message.getContent().length();
@ -124,7 +130,16 @@ public class QianFanBigModuleServiceImpl implements QianFanBigModuleService {
StuAiLimitExample limitExample = new StuAiLimitExample();
limitExample.createCriteria().andUserIdEqualTo(messageList.get(0).getUserId());
List<StuAiLimit> stuAiLimits = stuAiLimitMapper.selectByExample(limitExample);
if (stuAiLimits.isEmpty())
{
StuAiLimit stuAiLimit = new StuAiLimit();
stuAiLimit.setUserId(messageList.get(0).getUserId());
stuAiLimit.setLimitState((byte)0);
stuAiLimit.setCreateTime(new Date());
stuAiLimit.setNumberOfTimes(1);
stuAiLimit.setWordNumber(0);
stuAiLimitMapper.insertSelective(stuAiLimit);
}
if (stuAiLimits.get(0).getLimitState()== (byte) 1 || 30 < stuAiLimits.get(0).getWordNumber()) {
@ -134,6 +149,38 @@ public class QianFanBigModuleServiceImpl implements QianFanBigModuleService {
stuAiLimitMapper.updateByPrimaryKeySelective(stuAiLimits.get(0));
// StuAiLimitExample limitExample = new StuAiLimitExample();
// limitExample.createCriteria().andUserIdEqualTo(messageList.get(0).getUserId());
// List<StuAiLimit> stuAiLimits = stuAiLimitMapper.selectByExample(limitExample);
// if (!stuAiLimits.isEmpty())
// {
// if (stuAiLimits.get(0).getLimitState()== (byte) 1 || 30 < stuAiLimits.get(0).getWordNumber()){
// throw new RuntimeException("您的使用已达到今日限额,请明日再试。");
// }
//
// StuAiLimit stuAiLimit = stuAiLimits.get(0);
//
//
// if (30 <= stuAiLimit.getWordNumber())
// {
// stuAiLimit.setLimitState((byte)1);
// }
//
// stuAiLimitMapper.updateByPrimaryKeySelective(stuAiLimit);
//
//
// }else {
//
// StuAiLimit stuAiLimit = new StuAiLimit();
// stuAiLimit.setUserId(messageList.get(0).getUserId());
// stuAiLimit.setLimitState((byte)0);
// stuAiLimit.setCreateTime(new Date());
// stuAiLimit.setNumberOfTimes(1);
// stuAiLimit.setWordNumber(0);
// stuAiLimitMapper.insertSelective(stuAiLimit);
//
// }
String accesstoken = null;
try {
accesstoken = getAccesstoken();
@ -234,7 +281,7 @@ public class QianFanBigModuleServiceImpl implements QianFanBigModuleService {
while ((line = reader.readUtf8Line()) != null) {
line = line.replace("data: ", "");
JSONObject json = JSON.parseObject(line);
if (json != null && StringUtils.isNotBlank((String) json.get("result"))) {
if (json != null && StringUtils.hasText((String) json.get("result"))) {
sink.next((String) json.get("result")); // 返回答案
System.out.println("Received data: " + json.get("result")); // 打印接收到的数据
if (Boolean.TRUE.equals(json.get("is_end"))) {

@ -279,7 +279,7 @@ public class StuConceptBlockServiceImpl implements StuConceptBlockService {
}
StuPracticalTrainingReportExample stuPracticalTrainingReportExample = new StuPracticalTrainingReportExample();
stuPracticalTrainingReportExample.createCriteria().andUseridEqualTo(stuBlockProductWithBLOBs.getUserId()).andModuleEqualTo(stuBlockProductWithBLOBs.getModule()).andAscriptionEqualTo(stuBlockProductWithBLOBs.getAscription());
stuPracticalTrainingReportExample.createCriteria().andUseridEqualTo(stuBlockProductWithBLOBs.getUserId());
List<StuPracticalTrainingReport> stuPracticalTrainingReports = stuPracticalTrainingReportMapper.selectByExample(stuPracticalTrainingReportExample);
String originalFilename = file.getOriginalFilename();
@ -315,8 +315,6 @@ public class StuConceptBlockServiceImpl implements StuConceptBlockService {
int info = i > 0 ? i : -i;
stuPracticalTrainingReport.setId(info);
stuPracticalTrainingReport.setReportName(name + ".pdf");
stuPracticalTrainingReport.setModule(stuBlockProductWithBLOBs.getModule());
stuPracticalTrainingReport.setAscription(stuBlockProductWithBLOBs.getAscription());
stuPracticalTrainingReport.setSize((int) fileSize);
stuPracticalTrainingReport.setUploadTime(new Date());
stuPracticalTrainingReport.setUrl(url);
@ -337,8 +335,7 @@ public class StuConceptBlockServiceImpl implements StuConceptBlockService {
if (reportWeight != null) {
StuScoreDetails scoreDetails = new StuScoreDetails();
scoreDetails.setUserId(stuBlockProductWithBLOBs.getUserId());
// scoreDetails.setModule(stuBlockProductWithBLOBs.getModule());
// scoreDetails.setAscription(stuBlockProductWithBLOBs.getAscription());
//
scoreDetails.setScoreWeight(reportWeight.doubleValue());
scoreDetails.setId(id);
scoreDetails.setLearningProjects("实训报告");
@ -411,8 +408,6 @@ public class StuConceptBlockServiceImpl implements StuConceptBlockService {
int info = i > 0 ? i : -i;
stuPracticalTrainingReport.setId(info);
stuPracticalTrainingReport.setReportName(name + ".pdf");
stuPracticalTrainingReport.setModule(stuBlockProductWithBLOBs.getModule());
stuPracticalTrainingReport.setAscription(stuBlockProductWithBLOBs.getAscription());
stuPracticalTrainingReport.setSize((int) fileSize);
stuPracticalTrainingReport.setUploadTime(new Date());
stuPracticalTrainingReport.setUrl(upload);
@ -433,8 +428,6 @@ public class StuConceptBlockServiceImpl implements StuConceptBlockService {
if (reportWeight != null) {
StuScoreDetails scoreDetails = new StuScoreDetails();
scoreDetails.setUserId(stuBlockProductWithBLOBs.getUserId());
// scoreDetails.setModule(stuBlockProductWithBLOBs.getModule());
// scoreDetails.setAscription(stuBlockProductWithBLOBs.getAscription());
scoreDetails.setScoreWeight(reportWeight.doubleValue());
scoreDetails.setId(id);
scoreDetails.setLearningProjects("实训报告");

@ -24,6 +24,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.function.Predicate;
import java.util.stream.Collectors;
@Service
public class StuUserProfileDatabaseServiceImpl implements StuUserProfileDatabaseService {
@ -196,5 +197,15 @@ public class StuUserProfileDatabaseServiceImpl implements StuUserProfileDatabase
}
@Override
public ResultEntity selfExcelBaseInfo(String userId) {
List<String> nameList = uploadExcelUserMapper.selectDistModuleName(userId);
return new ResultEntity<>(HttpStatus.OK,nameList);
}
}

@ -0,0 +1,275 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.sztzjy.marketing.mapper.AdminExcelErrorMessageMapper">
<resultMap id="BaseResultMap" type="com.sztzjy.marketing.entity.AdminExcelErrorMessage">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="topic_name" jdbcType="VARCHAR" property="topicName" />
<result column="topic_type" jdbcType="VARCHAR" property="topicType" />
<result column="topic_id" jdbcType="VARCHAR" property="topicId" />
<result column="state" jdbcType="VARCHAR" property="state" />
<result column="result_msg" jdbcType="VARCHAR" property="resultMsg" />
<result column="module" jdbcType="VARCHAR" property="module" />
<result column="userId" jdbcType="VARCHAR" property="userid" />
<result column="submission_state" jdbcType="INTEGER" property="submissionState" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, topic_name, topic_type, topic_id, state, result_msg, module, userId, submission_state
</sql>
<select id="selectByExample" parameterType="com.sztzjy.marketing.entity.AdminExcelErrorMessageExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from admin_excel_error_message
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from admin_excel_error_message
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from admin_excel_error_message
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.sztzjy.marketing.entity.AdminExcelErrorMessageExample">
delete from admin_excel_error_message
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.sztzjy.marketing.entity.AdminExcelErrorMessage">
insert into admin_excel_error_message (id, topic_name, topic_type,
topic_id, state, result_msg,
module, userId, submission_state
)
values (#{id,jdbcType=INTEGER}, #{topicName,jdbcType=VARCHAR}, #{topicType,jdbcType=VARCHAR},
#{topicId,jdbcType=VARCHAR}, #{state,jdbcType=VARCHAR}, #{resultMsg,jdbcType=VARCHAR},
#{module,jdbcType=VARCHAR}, #{userid,jdbcType=VARCHAR}, #{submissionState,jdbcType=INTEGER}
)
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.marketing.entity.AdminExcelErrorMessage">
insert into admin_excel_error_message
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="topicName != null">
topic_name,
</if>
<if test="topicType != null">
topic_type,
</if>
<if test="topicId != null">
topic_id,
</if>
<if test="state != null">
state,
</if>
<if test="resultMsg != null">
result_msg,
</if>
<if test="module != null">
module,
</if>
<if test="userid != null">
userId,
</if>
<if test="submissionState != null">
submission_state,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="topicName != null">
#{topicName,jdbcType=VARCHAR},
</if>
<if test="topicType != null">
#{topicType,jdbcType=VARCHAR},
</if>
<if test="topicId != null">
#{topicId,jdbcType=VARCHAR},
</if>
<if test="state != null">
#{state,jdbcType=VARCHAR},
</if>
<if test="resultMsg != null">
#{resultMsg,jdbcType=VARCHAR},
</if>
<if test="module != null">
#{module,jdbcType=VARCHAR},
</if>
<if test="userid != null">
#{userid,jdbcType=VARCHAR},
</if>
<if test="submissionState != null">
#{submissionState,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.marketing.entity.AdminExcelErrorMessageExample" resultType="java.lang.Long">
select count(*) from admin_excel_error_message
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update admin_excel_error_message
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.topicName != null">
topic_name = #{record.topicName,jdbcType=VARCHAR},
</if>
<if test="record.topicType != null">
topic_type = #{record.topicType,jdbcType=VARCHAR},
</if>
<if test="record.topicId != null">
topic_id = #{record.topicId,jdbcType=VARCHAR},
</if>
<if test="record.state != null">
state = #{record.state,jdbcType=VARCHAR},
</if>
<if test="record.resultMsg != null">
result_msg = #{record.resultMsg,jdbcType=VARCHAR},
</if>
<if test="record.module != null">
module = #{record.module,jdbcType=VARCHAR},
</if>
<if test="record.userid != null">
userId = #{record.userid,jdbcType=VARCHAR},
</if>
<if test="record.submissionState != null">
submission_state = #{record.submissionState,jdbcType=INTEGER},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update admin_excel_error_message
set id = #{record.id,jdbcType=INTEGER},
topic_name = #{record.topicName,jdbcType=VARCHAR},
topic_type = #{record.topicType,jdbcType=VARCHAR},
topic_id = #{record.topicId,jdbcType=VARCHAR},
state = #{record.state,jdbcType=VARCHAR},
result_msg = #{record.resultMsg,jdbcType=VARCHAR},
module = #{record.module,jdbcType=VARCHAR},
userId = #{record.userid,jdbcType=VARCHAR},
submission_state = #{record.submissionState,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.marketing.entity.AdminExcelErrorMessage">
update admin_excel_error_message
<set>
<if test="topicName != null">
topic_name = #{topicName,jdbcType=VARCHAR},
</if>
<if test="topicType != null">
topic_type = #{topicType,jdbcType=VARCHAR},
</if>
<if test="topicId != null">
topic_id = #{topicId,jdbcType=VARCHAR},
</if>
<if test="state != null">
state = #{state,jdbcType=VARCHAR},
</if>
<if test="resultMsg != null">
result_msg = #{resultMsg,jdbcType=VARCHAR},
</if>
<if test="module != null">
module = #{module,jdbcType=VARCHAR},
</if>
<if test="userid != null">
userId = #{userid,jdbcType=VARCHAR},
</if>
<if test="submissionState != null">
submission_state = #{submissionState,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.marketing.entity.AdminExcelErrorMessage">
update admin_excel_error_message
set topic_name = #{topicName,jdbcType=VARCHAR},
topic_type = #{topicType,jdbcType=VARCHAR},
topic_id = #{topicId,jdbcType=VARCHAR},
state = #{state,jdbcType=VARCHAR},
result_msg = #{resultMsg,jdbcType=VARCHAR},
module = #{module,jdbcType=VARCHAR},
userId = #{userid,jdbcType=VARCHAR},
submission_state = #{submissionState,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>

@ -962,4 +962,5 @@
FROM stu_upload_excel_user
WHERE user_id = #{userId}
</select>
</mapper>

@ -0,0 +1,211 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.sztzjy.marketing.mapper.StuUploadImgAiMapper">
<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="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="append" jdbcType="VARCHAR" property="append" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, user_id, img_path, create_time, append
</sql>
<select id="selectByExample" parameterType="com.sztzjy.marketing.entity.StuUploadImgAiExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_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="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from stu_upload_img_ai
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from stu_upload_img_ai
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.sztzjy.marketing.entity.StuUploadImgAiExample">
delete from stu_upload_img_ai
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</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>
<insert id="insertSelective" parameterType="com.sztzjy.marketing.entity.StuUploadImgAi">
insert into stu_upload_img_ai
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="userId != null">
user_id,
</if>
<if test="imgPath != null">
img_path,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="append != null">
append,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="userId != null">
#{userId,jdbcType=VARCHAR},
</if>
<if test="imgPath != null">
#{imgPath,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="append != null">
#{append,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.marketing.entity.StuUploadImgAiExample" resultType="java.lang.Long">
select count(*) from stu_upload_img_ai
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update stu_upload_img_ai
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=VARCHAR},
</if>
<if test="record.imgPath != null">
img_path = #{record.imgPath,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.append != null">
append = #{record.append,jdbcType=VARCHAR},
</if>
</set>
<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},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
append = #{record.append,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.marketing.entity.StuUploadImgAi">
update stu_upload_img_ai
<set>
<if test="userId != null">
user_id = #{userId,jdbcType=VARCHAR},
</if>
<if test="imgPath != null">
img_path = #{imgPath,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="append != null">
append = #{append,jdbcType=VARCHAR},
</if>
</set>
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},
create_time = #{createTime,jdbcType=TIMESTAMP},
append = #{append,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>
Loading…
Cancel
Save