【增加】试题推送试题库,学生登录返回i性别字段
This commit is contained in:
@@ -81,7 +81,6 @@ public class RabbitMQController {
|
|||||||
* @return 接收结果
|
* @return 接收结果
|
||||||
*/
|
*/
|
||||||
@GetMapping("/receiveAll")
|
@GetMapping("/receiveAll")
|
||||||
// public List<ExamQuestion> receiveMessage(@RequestParam String queueName) {
|
|
||||||
public CommonResult receiveMessage() {
|
public CommonResult receiveMessage() {
|
||||||
String queueName = SecurityFrameworkUtils.getLoginQueueName();
|
String queueName = SecurityFrameworkUtils.getLoginQueueName();
|
||||||
boolean examQuestionToRabbitMQ = examQuestionService.getExamQuestionToRabbitMQInsertData(queueName);
|
boolean examQuestionToRabbitMQ = examQuestionService.getExamQuestionToRabbitMQInsertData(queueName);
|
||||||
|
@@ -167,8 +167,10 @@ public class ExamSpecialtyController{
|
|||||||
@GetMapping(value = "/getRole/{id}")
|
@GetMapping(value = "/getRole/{id}")
|
||||||
public CommonResult getRole(@PathVariable("id") String id) {
|
public CommonResult getRole(@PathVariable("id") String id) {
|
||||||
String roles= examSpecialtyService.getRoleById(id);
|
String roles= examSpecialtyService.getRoleById(id);
|
||||||
|
if(roles!=null){
|
||||||
return success(Integer.parseInt(roles));
|
return success(Integer.parseInt(roles));
|
||||||
|
}
|
||||||
|
return success("");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -121,7 +121,7 @@ public interface ExamQuestionMapper extends BaseMapperX<ExamQuestion>
|
|||||||
|
|
||||||
void updateExamQuestionByIds(@Param("updater") String loginUserNickname, @Param("quIds") List<String> quIds);
|
void updateExamQuestionByIds(@Param("updater") String loginUserNickname, @Param("quIds") List<String> quIds);
|
||||||
|
|
||||||
int selectExamQuestionCountByQuId(String quId);
|
ExamQuestion selectExamQuestionCountByQuId(String quId);
|
||||||
|
|
||||||
List<TenantVo> getSchoolNameNaPage();
|
List<TenantVo> getSchoolNameNaPage();
|
||||||
|
|
||||||
@@ -134,4 +134,9 @@ public interface ExamQuestionMapper extends BaseMapperX<ExamQuestion>
|
|||||||
,@Param("content") String content);
|
,@Param("content") String content);
|
||||||
|
|
||||||
String selectSchoolnameBytId(Long loginTenantId);
|
String selectSchoolnameBytId(Long loginTenantId);
|
||||||
|
|
||||||
|
void insertOrUpdateList(List<ExamQuestion> examQuestions);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -124,6 +124,7 @@ public class ExamQuestionServiceImpl implements IExamQuestionService
|
|||||||
|
|
||||||
String uuid = IdUtils.simpleUUID();
|
String uuid = IdUtils.simpleUUID();
|
||||||
examQuestion.setQuId(uuid);
|
examQuestion.setQuId(uuid);
|
||||||
|
examQuestion.setQuBankId(uuid);
|
||||||
examQuestion.setCreateTime(DateUtils.getNowLocalDateTime());
|
examQuestion.setCreateTime(DateUtils.getNowLocalDateTime());
|
||||||
List<ExamQuestionAnswer> answerList = examQuestion.getAnswerList();
|
List<ExamQuestionAnswer> answerList = examQuestion.getAnswerList();
|
||||||
List<SysFileUpload> fileUploads = examQuestion.getFileUploads();
|
List<SysFileUpload> fileUploads = examQuestion.getFileUploads();
|
||||||
@@ -197,36 +198,6 @@ public class ExamQuestionServiceImpl implements IExamQuestionService
|
|||||||
@Override
|
@Override
|
||||||
public int updateExamQuestion(ExamQuestion examQuestion)
|
public int updateExamQuestion(ExamQuestion examQuestion)
|
||||||
{
|
{
|
||||||
//获取试题id
|
|
||||||
// String quId = examQuestion.getQuId();
|
|
||||||
// ExamQuestion examQuestion1 = examQuestionMapper.selectExamQuestionByQuId(quId);
|
|
||||||
// String quBankId = examQuestion1.getQuBankId();
|
|
||||||
// //现在题有题库归属
|
|
||||||
// if (examQuestion.getQuBankId() != null && !examQuestion.getQuBankId().equals("")) {
|
|
||||||
// //原来试题有题库归属
|
|
||||||
// if (quBankId!=null&& !quBankId.equals("")){
|
|
||||||
// //代表没改动题库
|
|
||||||
// if (quBankId.equals(examQuestion.getQuBankId())){
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
// //改动题库
|
|
||||||
// else {
|
|
||||||
// UpdateQuCount(quBankId);
|
|
||||||
// UpdateQuCountNow(examQuestion.getQuBankId());
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// //原来试题没题库归属
|
|
||||||
// else {
|
|
||||||
// UpdateQuCountNow(examQuestion.getQuBankId());
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// //现在题没题库归属
|
|
||||||
// else {
|
|
||||||
// //原来试题有题库归属
|
|
||||||
// if (quBankId!=null&& !quBankId.equals("")){
|
|
||||||
// UpdateQuCount(quBankId);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -504,12 +475,111 @@ public class ExamQuestionServiceImpl implements IExamQuestionService
|
|||||||
}
|
}
|
||||||
if(examQuestions!=null&&examQuestions.size()>0){
|
if(examQuestions!=null&&examQuestions.size()>0){
|
||||||
for (ExamQuestion examQuestion : examQuestions) {
|
for (ExamQuestion examQuestion : examQuestions) {
|
||||||
int count= examQuestionMapper.selectExamQuestionCountByQuId(examQuestion.getQuId());
|
|
||||||
if (count==0){
|
ExamQuestion question= examQuestionMapper.selectExamQuestionCountByQuId(examQuestion.getQuBankId());
|
||||||
examQuestion.setQuId(IdUtils.simpleUUID());
|
if (question==null){
|
||||||
|
//如果没有,就是新增
|
||||||
|
String quId = IdUtils.simpleUUID();
|
||||||
|
examQuestion.setQuId(quId);
|
||||||
|
|
||||||
|
//新增
|
||||||
|
List<ExamQuestionAnswer> answerList = examQuestion.getAnswerList();
|
||||||
|
List<SysFileUpload> fileUploads = examQuestion.getFileUploads();
|
||||||
|
ExamQuestionScore questionScores = examQuestion.getQuestionScores();
|
||||||
|
List<ExamQuestionKeyword> questionKeywords = examQuestion.getQuestionKeywords();
|
||||||
|
|
||||||
|
if (answerList!=null&&answerList.size()>0){
|
||||||
|
answerList.replaceAll(answer -> {
|
||||||
|
answer.setAnswerId(IdUtils.simpleUUID());
|
||||||
|
answer.setQuId(quId);
|
||||||
|
return answer;
|
||||||
|
});
|
||||||
|
//examQuestionAnswerMapper.insert(answerList);
|
||||||
|
examQuestionAnswerMapper.insertExamQuestionAnswerList(answerList);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fileUploads!=null&&fileUploads.size()>0){
|
||||||
|
fileUploads.replaceAll(fileUpload -> {
|
||||||
|
// 设置 fileId 和 quId
|
||||||
|
fileUpload.setFileId(IdUtils.simpleUUID());
|
||||||
|
fileUpload.setQuId(quId);
|
||||||
|
|
||||||
|
return fileUpload;
|
||||||
|
});
|
||||||
|
sysFileMapper.insertSysFileList(fileUploads);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (questionScores!=null){
|
||||||
|
questionScores.setScoreId(IdUtils.simpleUUID());
|
||||||
|
questionScores.setQuId(quId);
|
||||||
|
examQuestionScoreMapper.insertExamQuestionScore(questionScores);
|
||||||
|
}
|
||||||
|
if (questionKeywords!=null&&questionKeywords.size()>0){
|
||||||
|
questionKeywords.replaceAll(examQuestionKeyword -> {
|
||||||
|
examQuestionKeyword.setKeywordId(IdUtils.simpleUUID());
|
||||||
|
examQuestionKeyword.setQuId(quId);
|
||||||
|
return examQuestionKeyword;
|
||||||
|
});
|
||||||
|
examQuestionKeywordMapper.insertExamQuestionKeywordList(questionKeywords);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
//有就是覆盖
|
||||||
|
else{
|
||||||
|
examQuestion.setQuId(question.getQuId());
|
||||||
|
String quId = question.getQuId();
|
||||||
|
examQuestionAnswerMapper.deleteExamQuestionAnswerByQuesId(quId);
|
||||||
|
sysFileMapper.deleteSysFileByQuesId(quId);
|
||||||
|
examQuestionScoreMapper.deleteExamQuestionScoreByQuesId(quId);
|
||||||
|
examQuestionKeywordMapper.deleteExamQuestionScoreByQuesId(quId);
|
||||||
|
|
||||||
|
|
||||||
|
//新增
|
||||||
|
List<ExamQuestionAnswer> answerList = examQuestion.getAnswerList();
|
||||||
|
List<SysFileUpload> fileUploads = examQuestion.getFileUploads();
|
||||||
|
ExamQuestionScore questionScores = examQuestion.getQuestionScores();
|
||||||
|
List<ExamQuestionKeyword> questionKeywords = examQuestion.getQuestionKeywords();
|
||||||
|
|
||||||
|
if (answerList!=null&&answerList.size()>0){
|
||||||
|
answerList.replaceAll(answer -> {
|
||||||
|
answer.setAnswerId(IdUtils.simpleUUID());
|
||||||
|
answer.setQuId(quId);
|
||||||
|
return answer;
|
||||||
|
});
|
||||||
|
//examQuestionAnswerMapper.insert(answerList);
|
||||||
|
examQuestionAnswerMapper.insertExamQuestionAnswerList(answerList);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fileUploads!=null&&fileUploads.size()>0){
|
||||||
|
fileUploads.replaceAll(fileUpload -> {
|
||||||
|
// 设置 fileId 和 quId
|
||||||
|
fileUpload.setFileId(IdUtils.simpleUUID());
|
||||||
|
fileUpload.setQuId(quId);
|
||||||
|
|
||||||
|
return fileUpload;
|
||||||
|
});
|
||||||
|
sysFileMapper.insertSysFileList(fileUploads);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (questionScores!=null){
|
||||||
|
questionScores.setScoreId(IdUtils.simpleUUID());
|
||||||
|
questionScores.setQuId(quId);
|
||||||
|
examQuestionScoreMapper.insertExamQuestionScore(questionScores);
|
||||||
|
}
|
||||||
|
if (questionKeywords!=null&&questionKeywords.size()>0){
|
||||||
|
questionKeywords.replaceAll(examQuestionKeyword -> {
|
||||||
|
examQuestionKeyword.setKeywordId(IdUtils.simpleUUID());
|
||||||
|
examQuestionKeyword.setQuId(quId);
|
||||||
|
return examQuestionKeyword;
|
||||||
|
});
|
||||||
|
examQuestionKeywordMapper.insertExamQuestionKeywordList(questionKeywords);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
examQuestionMapper.insertOrUpdate(examQuestions);
|
|
||||||
|
}
|
||||||
|
examQuestionMapper.insertOrUpdateList(examQuestions);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -527,6 +597,32 @@ public class ExamQuestionServiceImpl implements IExamQuestionService
|
|||||||
|
|
||||||
// 2、根据试题ID和租户查找试题详情
|
// 2、根据试题ID和租户查找试题详情
|
||||||
ExamQuestion examQuestion_obj = examQuestionMapper.selectExamQuestionByQuId(quId);
|
ExamQuestion examQuestion_obj = examQuestionMapper.selectExamQuestionByQuId(quId);
|
||||||
|
|
||||||
|
//查找试题答案
|
||||||
|
List<ExamQuestionAnswer> examQuestionAnswers = examQuestionAnswerMapper.selectExamQuestionAnswerByQuId(quId);
|
||||||
|
//查找试题文件
|
||||||
|
List<SysFileUpload> sysFileUploads =sysFileMapper.selectSysFileByQuid(quId);
|
||||||
|
//查找试题判分
|
||||||
|
ExamQuestionScore examQuestionScore =examQuestionScoreMapper.selectExamQuestionScoreByQuId(quId);
|
||||||
|
//获取试题关键字
|
||||||
|
List<ExamQuestionKeyword> examQuestionKeywords = examQuestionKeywordMapper.selectExamQuestionKeywordByQuId(quId);
|
||||||
|
|
||||||
|
|
||||||
|
if (examQuestion_obj!=null){
|
||||||
|
if (examQuestionAnswers!=null&&examQuestionAnswers.size()>0){
|
||||||
|
examQuestion_obj.setAnswerList(examQuestionAnswers);
|
||||||
|
}
|
||||||
|
if (sysFileUploads!=null&&sysFileUploads.size()>0){
|
||||||
|
examQuestion_obj.setFileUploads(sysFileUploads);
|
||||||
|
}
|
||||||
|
if (examQuestionScore!=null){
|
||||||
|
examQuestion_obj.setQuestionScores(examQuestionScore);
|
||||||
|
}
|
||||||
|
if (examQuestionKeywords!=null&&examQuestionKeywords.size()>0){
|
||||||
|
examQuestion_obj.setQuestionKeywords(examQuestionKeywords);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// examQuestion_obj.setType(rabbitMQSendInfoVO.getType());
|
// examQuestion_obj.setType(rabbitMQSendInfoVO.getType());
|
||||||
// examQuestion_obj.setSource(SecurityFrameworkUtils.getLoginTenantId());
|
// examQuestion_obj.setSource(SecurityFrameworkUtils.getLoginTenantId());
|
||||||
// examQuestion_obj.setCreateTeacher(SecurityFrameworkUtils.getLoginUserNickname());
|
// examQuestion_obj.setCreateTeacher(SecurityFrameworkUtils.getLoginUserNickname());
|
||||||
@@ -582,6 +678,7 @@ public class ExamQuestionServiceImpl implements IExamQuestionService
|
|||||||
examQuestion.setKeywords(importUser.getKeywords());
|
examQuestion.setKeywords(importUser.getKeywords());
|
||||||
examQuestion.setCreator(SecurityFrameworkUtils.getLoginUserNickname());
|
examQuestion.setCreator(SecurityFrameworkUtils.getLoginUserNickname());
|
||||||
examQuestion.setQuId(quId);
|
examQuestion.setQuId(quId);
|
||||||
|
examQuestion.setQuBankId(quId);
|
||||||
examQuestion.setCreateTime(DateUtils.getNowLocalDateTime());
|
examQuestion.setCreateTime(DateUtils.getNowLocalDateTime());
|
||||||
examQuestionMapper.insertExamQuestion(examQuestion);
|
examQuestionMapper.insertExamQuestion(examQuestion);
|
||||||
System.out.println(examQuestion);
|
System.out.println(examQuestion);
|
||||||
|
@@ -107,8 +107,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
FROM system_tenant
|
FROM system_tenant
|
||||||
WHERE deleted = 0
|
WHERE deleted = 0
|
||||||
</select>
|
</select>
|
||||||
<select id="selectExamQuestionCountByQuId" resultType="java.lang.Integer">
|
<select id="selectExamQuestionCountByQuId" resultMap="ExamQuestionResult">
|
||||||
select count(*) from exam_question where qu_id=#{quId}
|
select * from exam_question where qu_bank_id=#{quId}
|
||||||
</select>
|
</select>
|
||||||
<select id="getSchoolNameNaPage" resultMap="TenantVoResult">
|
<select id="getSchoolNameNaPage" resultMap="TenantVoResult">
|
||||||
SELECT id, name, queue_name
|
SELECT id, name, queue_name
|
||||||
@@ -182,6 +182,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
|
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
<insert id="insertOrUpdateList">
|
||||||
|
|
||||||
|
INSERT INTO exam_question (qu_id, qu_bank_id, chapterId_dict_text, subject_name,specialty_name, course_name, qu_level, content, audit, status, content_text, analysis, point_names, keywords, manual)
|
||||||
|
VALUES
|
||||||
|
<foreach collection="collection" item="item" separator=",">
|
||||||
|
(#{item.quId}, #{item.quBankId}, #{item.chapteridDictText}, #{item.subjectName},
|
||||||
|
#{item.specialtyName}, #{item.courseName}, #{item.quLevel}, #{item.content}, #{item.audit}
|
||||||
|
, #{item.status}, #{item.contentText}, #{item.analysis}, #{item.pointNames}, #{item.keywords}, #{item.manual})
|
||||||
|
</foreach>
|
||||||
|
ON DUPLICATE KEY UPDATE
|
||||||
|
chapterId_dict_text = VALUES(chapterId_dict_text),
|
||||||
|
subject_name = VALUES(subject_name),
|
||||||
|
specialty_name = VALUES(specialty_name),
|
||||||
|
course_name = VALUES(course_name),
|
||||||
|
qu_level = VALUES(qu_level),
|
||||||
|
content = VALUES(content),
|
||||||
|
audit = VALUES(audit),
|
||||||
|
status = VALUES(status),
|
||||||
|
content_text = VALUES(content_text),
|
||||||
|
analysis = VALUES(analysis),
|
||||||
|
point_names = VALUES(point_names),
|
||||||
|
keywords = VALUES(keywords),
|
||||||
|
manual = VALUES(manual);
|
||||||
|
|
||||||
|
</insert>
|
||||||
|
|
||||||
<update id="updateExamQuestion" parameterType="ExamQuestion">
|
<update id="updateExamQuestion" parameterType="ExamQuestion">
|
||||||
update exam_question
|
update exam_question
|
||||||
|
@@ -69,7 +69,8 @@ public class MysqlServericeImpl implements IMysqlServerice {
|
|||||||
.map(ExamQuestionAnswer::getAnswerId) // 提取每个对象的 answerId
|
.map(ExamQuestionAnswer::getAnswerId) // 提取每个对象的 answerId
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
//得到总计得分点
|
//得到总计得分点
|
||||||
totalKeyScore=examMysqlKeywordMapper.selectByAnswerIds(answerIdList);
|
System.out.println(answerIdList);
|
||||||
|
totalKeyScore=examMysqlKeywordMapper.selectByAnswerIds(answerIdList);
|
||||||
|
|
||||||
}
|
}
|
||||||
answerLogPath = filepath.getParent() + File.separator + "log.txt";
|
answerLogPath = filepath.getParent() + File.separator + "log.txt";
|
||||||
|
@@ -42,6 +42,7 @@ import static pc.exam.pp.framework.common.pojo.CommonResult.error;
|
|||||||
import static pc.exam.pp.framework.common.pojo.CommonResult.success;
|
import static pc.exam.pp.framework.common.pojo.CommonResult.success;
|
||||||
import static pc.exam.pp.framework.common.util.collection.CollectionUtils.convertSet;
|
import static pc.exam.pp.framework.common.util.collection.CollectionUtils.convertSet;
|
||||||
import static pc.exam.pp.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
import static pc.exam.pp.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||||
|
import static pc.exam.pp.framework.security.core.util.SecurityFrameworkUtils.getLoginUserSEX;
|
||||||
import static pc.exam.pp.module.system.enums.ErrorCodeConstants.STUDENT_USERNAME_LOGIN;
|
import static pc.exam.pp.module.system.enums.ErrorCodeConstants.STUDENT_USERNAME_LOGIN;
|
||||||
import static pc.exam.pp.module.system.enums.ErrorCodeConstants.STUDENT_USERNAME_NOTLOGIN;
|
import static pc.exam.pp.module.system.enums.ErrorCodeConstants.STUDENT_USERNAME_NOTLOGIN;
|
||||||
|
|
||||||
@@ -148,6 +149,8 @@ public class AuthController {
|
|||||||
} else {
|
} else {
|
||||||
menuList = menuService.filterDisableMenus(menuList);
|
menuList = menuService.filterDisableMenus(menuList);
|
||||||
}
|
}
|
||||||
|
String loginUserSEX = getLoginUserSEX();
|
||||||
|
user.setSex(Integer.valueOf(loginUserSEX));
|
||||||
// 2. 拼接结果返回
|
// 2. 拼接结果返回
|
||||||
return success(AuthConvert.INSTANCE.convert(user, roles, menuList));
|
return success(AuthConvert.INSTANCE.convert(user, roles, menuList));
|
||||||
}
|
}
|
||||||
|
@@ -47,6 +47,8 @@ public class AuthPermissionInfoRespVO {
|
|||||||
@Schema(description = "部门编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2048")
|
@Schema(description = "部门编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2048")
|
||||||
private Long deptId;
|
private Long deptId;
|
||||||
|
|
||||||
|
private String sex;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Schema(description = "管理后台 - 登录用户的菜单信息 Response VO")
|
@Schema(description = "管理后台 - 登录用户的菜单信息 Response VO")
|
||||||
|
Reference in New Issue
Block a user