Commit 03807d19 by 涂亚平

旧版本推数据备份-1106

1 parent a079f1ef
...@@ -16,10 +16,8 @@ import io.swagger.annotations.Api; ...@@ -16,10 +16,8 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CachePut; import org.springframework.cache.annotation.CachePut;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/** /**
* <p> * <p>
...@@ -74,4 +72,17 @@ public class ExerciseDictController { ...@@ -74,4 +72,17 @@ public class ExerciseDictController {
return ResponseData.generateCreatedResponse(0,exerciseDictService.getPaperExercise(getPaperExerciseDTO)); return ResponseData.generateCreatedResponse(0,exerciseDictService.getPaperExercise(getPaperExerciseDTO));
} }
@PostMapping("judge")
@ApiOperation("判断题 file ")
public ResponseVO judge(@RequestParam("file") MultipartFile file,Long paperId,Long courseId){
return ResponseData.generateCreatedResponse(0,exerciseDictService.judge(file,paperId,courseId));
}
@PostMapping("select")
@ApiOperation("选择题 file")
public ResponseVO select(@RequestParam("file") MultipartFile file,Long paperId,Long courseId){
return ResponseData.generateCreatedResponse(0,exerciseDictService.select(file,paperId,courseId));
}
} }
package com.subsidy.dto.exercise;
import com.subsidy.util.excel.ExcelColumnUtil;
import lombok.Data;
@Data
public class JudgeDTO {
@ExcelColumnUtil(value = "序号", col = 1)
private Integer id;
@ExcelColumnUtil(value = "题目", col = 2)
private String title;
@ExcelColumnUtil(value = "题目类型", col = 3)
private String exerciseType;
@ExcelColumnUtil(value = "答案(填“是”或者“否”)", col = 4)
private String answer;
}
package com.subsidy.dto.exercise;
import com.subsidy.util.excel.ExcelColumnUtil;
import lombok.Data;
@Data
public class SelectDTO {
@ExcelColumnUtil(value = "序号", col = 1)
private Integer id;
@ExcelColumnUtil(value = "题目", col = 2)
private String title;
@ExcelColumnUtil(value = "题目类型", col = 3)
private String exerciseType;
@ExcelColumnUtil(value = "选项A", col = 4)
private String answerA;
@ExcelColumnUtil(value = "选项B", col = 5)
private String answerB;
@ExcelColumnUtil(value = "选项C", col = 6)
private String answerC;
@ExcelColumnUtil(value = "选项D", col = 7)
private String answerD;
@ExcelColumnUtil(value = "正确答案(多选的答案用英文逗号隔开)", col = 8)
private String rightAnswer;
}
...@@ -40,5 +40,9 @@ public class RenshejuHistoryDO extends BaseModel { ...@@ -40,5 +40,9 @@ public class RenshejuHistoryDO extends BaseModel {
*/ */
private Object outputParam; private Object outputParam;
/**
* 备注
*/
private String remarkNote;
} }
...@@ -8,6 +8,7 @@ import com.subsidy.model.CourseDictDO; ...@@ -8,6 +8,7 @@ import com.subsidy.model.CourseDictDO;
import com.subsidy.model.ExerciseDictDO; import com.subsidy.model.ExerciseDictDO;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.subsidy.vo.course.ExerciseVO; import com.subsidy.vo.course.ExerciseVO;
import org.springframework.web.multipart.MultipartFile;
import java.util.List; import java.util.List;
...@@ -30,4 +31,8 @@ public interface ExerciseDictService extends IService<ExerciseDictDO> { ...@@ -30,4 +31,8 @@ public interface ExerciseDictService extends IService<ExerciseDictDO> {
Long submit(SubmitDTO submitDTO); Long submit(SubmitDTO submitDTO);
IPage getPaperExercise(GetPaperExerciseDTO getPaperExerciseDTO); IPage getPaperExercise(GetPaperExerciseDTO getPaperExerciseDTO);
String judge(MultipartFile multipartFile,Long paperId,Long courseId);
String select(MultipartFile multipartFile,Long paperId,Long courseId);
} }
...@@ -1396,7 +1396,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis ...@@ -1396,7 +1396,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
memberDO1.setCompanyId(companyId); memberDO1.setCompanyId(companyId);
memberDO1.setFirstLogin(0); memberDO1.setFirstLogin(0);
memberDO1.setTelephone(s.getTelephone()); memberDO1.setTelephone(s.getTelephone());
memberDO1.setIdCard(s.getIdCard()); memberDO1.setIdCard(s.getIdCard().toUpperCase());
memberDO1.setStatus("启用"); memberDO1.setStatus("启用");
memberDO1.setPassword("Ykhl123456"); memberDO1.setPassword("Ykhl123456");
memberDO1.setAccountNameEn(s.getAccountNameEn()); memberDO1.setAccountNameEn(s.getAccountNameEn());
......
package com.subsidy.service.impl; package com.subsidy.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.subsidy.common.exception.HttpException; import com.subsidy.common.exception.HttpException;
import com.subsidy.dto.exercise.GetPaperExerciseDTO; import com.subsidy.dto.exercise.GetPaperExerciseDTO;
import com.subsidy.dto.exercise.JudgeDTO;
import com.subsidy.dto.exercise.SelectDTO;
import com.subsidy.dto.exercise.SubmitDTO; import com.subsidy.dto.exercise.SubmitDTO;
import com.subsidy.dto.member.ImportMemberDTO;
import com.subsidy.mapper.ExerciseDictMapper; import com.subsidy.mapper.ExerciseDictMapper;
import com.subsidy.mapper.ExerciseDoneHistoryMapper; import com.subsidy.mapper.ExerciseDoneHistoryMapper;
import com.subsidy.mapper.ExerciseDoneResultMapper; import com.subsidy.mapper.ExerciseDoneResultMapper;
import com.subsidy.model.ExerciseDictDO; import com.subsidy.model.*;
import com.subsidy.model.ExerciseDoneHistoryDO;
import com.subsidy.model.ExerciseDoneResultDO;
import com.subsidy.service.ExerciseDictService; import com.subsidy.service.ExerciseDictService;
import com.subsidy.util.ConstantUtils; import com.subsidy.util.ConstantUtils;
import com.subsidy.util.MathUtil; import com.subsidy.util.MathUtil;
import com.subsidy.util.excel.ExcelUtil;
import com.subsidy.vo.exercise.GetPaperExerciseVO; import com.subsidy.vo.exercise.GetPaperExerciseVO;
import com.subsidy.vo.exercise.MemberExerciseVO; import com.subsidy.vo.exercise.MemberExerciseVO;
import net.sourceforge.pinyin4j.PinyinHelper;
import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType;
import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat;
import net.sourceforge.pinyin4j.format.HanyuPinyinToneType;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Locale;
/** /**
* <p> * <p>
...@@ -133,4 +145,68 @@ public class ExerciseDictServiceImpl extends ServiceImpl<ExerciseDictMapper, Exe ...@@ -133,4 +145,68 @@ public class ExerciseDictServiceImpl extends ServiceImpl<ExerciseDictMapper, Exe
return this.baseMapper.getPaperExercise(pager, getPaperExerciseDTO.getPaperId(), getPaperExerciseDTO.getDifficulty(), getPaperExerciseDTO.getExerciseType(), getPaperExerciseDTO.getTitle()); return this.baseMapper.getPaperExercise(pager, getPaperExerciseDTO.getPaperId(), getPaperExerciseDTO.getDifficulty(), getPaperExerciseDTO.getExerciseType(), getPaperExerciseDTO.getTitle());
} }
public String judge(MultipartFile multipartFile,Long paperId,Long courseId){
try {
ExcelUtil.readExcel(null, JudgeDTO.class, multipartFile).forEach(s -> {
ExerciseDictDO exerciseDictDO = new ExerciseDictDO();
exerciseDictDO.setTitle("<p>"+s.getTitle()+"</p>");
exerciseDictDO.setRightAnswer(s.getAnswer());
exerciseDictDO.setExerciseType(s.getExerciseType());
exerciseDictDO.setDifficulty("适中");
exerciseDictDO.setPaperId(paperId);
exerciseDictDO.setCourseId(courseId);
exerciseDictDO.setOrderNo(s.getId());
this.baseMapper.insert(exerciseDictDO);
});
} catch (Exception e) {
e.printStackTrace();
throw new HttpException(10001);
}
return ConstantUtils.ADD_SUCCESS;
}
public String select(MultipartFile multipartFile,Long paperId,Long courseId){
try {
ExcelUtil.readExcel(null, SelectDTO.class, multipartFile).forEach(s -> {
ExerciseDictDO exerciseDictDO = new ExerciseDictDO();
exerciseDictDO.setTitle("<p>"+s.getTitle()+"<p>");
exerciseDictDO.setOrderNo(s.getId());
exerciseDictDO.setExerciseType(s.getExerciseType());
//选项
StringBuffer items = new StringBuffer();
items.append("[");
items.append("{\"label\":\"<p>").append(s.getAnswerA()).append("</p>\",\"value\":\"A\"},");
items.append("{\"label\":\"<p>").append(s.getAnswerB()).append("</p>\",\"value\":\"B\"},");
items.append("{\"label\":\"<p>").append(s.getAnswerC()).append("</p>\",\"value\":\"C\"},");
items.append("{\"label\":\"<p>").append(s.getAnswerD()).append("</p>\",\"value\":\"D\"}]");
exerciseDictDO.setItems(items.toString());
if ("单选题".equals(s.getExerciseType())){
exerciseDictDO.setRightAnswer(s.getRightAnswer());
}else {
String[] answers = s.getRightAnswer().split(",");
StringBuffer answer = new StringBuffer();
answer.append("[");
int i = 0;
for (String split : answers){
answer.append("\"").append(split).append("\"");
if(i!=answers.length-1){
answer.append(",");
}
i++;
}
answer.append("]");
exerciseDictDO.setRightAnswer(answer.toString());
}
this.baseMapper.insert(exerciseDictDO);
});
} catch (Exception e) {
e.printStackTrace();
throw new HttpException(10001);
}
return ConstantUtils.ADD_SUCCESS;
}
} }
...@@ -79,6 +79,7 @@ public class RenSheJuServiceImpl implements RenSheJuService { ...@@ -79,6 +79,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
answerClassIds.stream().forEach(x -> classIds.add(x)); answerClassIds.stream().forEach(x -> classIds.add(x));
imageClassIds.stream().forEach(x -> classIds.add(x)); imageClassIds.stream().forEach(x -> classIds.add(x));
try { try {
if (classIds.size() > 0) { if (classIds.size() > 0) {
for (Long classId : classIds) { for (Long classId : classIds) {
...@@ -166,6 +167,7 @@ public class RenSheJuServiceImpl implements RenSheJuService { ...@@ -166,6 +167,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
List<DailyStudyInfoVO> result = new ArrayList<>(); List<DailyStudyInfoVO> result = new ArrayList<>();
// List<Long> vodClassIds = new ArrayList<>();
try { try {
for (Long classId : vodClassIds) { for (Long classId : vodClassIds) {
......
...@@ -11,7 +11,7 @@ spring.server.port=23457 ...@@ -11,7 +11,7 @@ spring.server.port=23457
#spring.datasource.username=devloper #spring.datasource.username=devloper
#spring.datasource.password=dev@1553$ #spring.datasource.password=dev@1553$
# 数据源配置 8.0数据库 # 数据源配置
spring.datasource.url=jdbc:mysql://139.224.253.21:3306/subsidy?autoReconnect=true&useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8 spring.datasource.url=jdbc:mysql://139.224.253.21:3306/subsidy?autoReconnect=true&useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
......
# 环境配置 # 环境配置
spring.profiles.active=prod spring.profiles.active=dev
#和CPU数 #和CPU数
spring.server.acceptorThreadCount=600 spring.server.acceptorThreadCount=600
spring.server.minSpareThreads=100 spring.server.minSpareThreads=100
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<select id="getMemberCheckDetail" resultType="com.subsidy.vo.image.GetMemberCheckDetailVO"> <select id="getMemberCheckDetail" resultType="com.subsidy.vo.image.GetMemberCheckDetailVO">
SELECT SELECT
t.id, t.id,
t.occurred_time, t.create_date occurred_time,
t.photo, t.photo,
t.similarity t.similarity
FROM FROM
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!