Compare commits
5 Commits
9abd3ae634
...
8743504224
| Author | SHA1 | Date | |
|---|---|---|---|
| 8743504224 | |||
|
|
dfbfada442 | ||
| 104eb28c18 | |||
| 3bfe5dbfb1 | |||
|
|
e995811e84 |
@ -83,8 +83,9 @@ public class ProcessServiceImpl extends ServiceImpl<ProcessMapper, Process> impl
|
|||||||
Long userId = SecurityFrameworkUtils.getLoginUserId();
|
Long userId = SecurityFrameworkUtils.getLoginUserId();
|
||||||
LambdaQueryWrapper<Process> queryWrapper = new LambdaQueryWrapper<Process>()
|
LambdaQueryWrapper<Process> queryWrapper = new LambdaQueryWrapper<Process>()
|
||||||
.eq(Process::getCoachId, userId)
|
.eq(Process::getCoachId, userId)
|
||||||
|
.notIn(Process::getSubject, Arrays.asList(1, 4))
|
||||||
//状态不等于2-已完成的科目
|
//状态不等于2-已完成的科目
|
||||||
.ne(Process::getStatus, "2")
|
// .ne(Process::getStatus, "2")
|
||||||
.groupBy(Process::getCourseId).groupBy(Process::getSubject);
|
.groupBy(Process::getCourseId).groupBy(Process::getSubject);
|
||||||
return this.list(queryWrapper);
|
return this.list(queryWrapper);
|
||||||
}
|
}
|
||||||
@ -110,7 +111,7 @@ public class ProcessServiceImpl extends ServiceImpl<ProcessMapper, Process> impl
|
|||||||
}
|
}
|
||||||
//状态等于1-训练中的
|
//状态等于1-训练中的
|
||||||
queryWrapper.eq(Process::getStatus, "1")
|
queryWrapper.eq(Process::getStatus, "1")
|
||||||
.isNull(Process::getExamStatus)
|
.and(wrapper -> wrapper.isNull(Process::getExamStatus).or().eq(Process::getExamStatus, "0"))
|
||||||
.groupBy(Process::getUserId)
|
.groupBy(Process::getUserId)
|
||||||
.orderByDesc(BaseDO::getCreateTime);
|
.orderByDesc(BaseDO::getCreateTime);
|
||||||
return this.page(page, queryWrapper);
|
return this.page(page, queryWrapper);
|
||||||
@ -367,12 +368,13 @@ public class ProcessServiceImpl extends ServiceImpl<ProcessMapper, Process> impl
|
|||||||
// 发送消息给教练
|
// 发送消息给教练
|
||||||
String message = String.format(SchoolBaseConstants.SCHOOL_NOTIFY_MESSAGE_TEMPLATE_MEMBER_EXAM_SCORE, process.getUserName(), "科目一", process.getExamScore(), "已通过");
|
String message = String.format(SchoolBaseConstants.SCHOOL_NOTIFY_MESSAGE_TEMPLATE_MEMBER_EXAM_SCORE, process.getUserName(), "科目一", process.getExamScore(), "已通过");
|
||||||
schoolNotifyMessageSendService.sendMessage(process.getCoachId(), message, SchoolBaseConstants.SCHOOL_NOTIFY_MESSAGE_TYPE_ADMIN, process.getTenantId());
|
schoolNotifyMessageSendService.sendMessage(process.getCoachId(), message, SchoolBaseConstants.SCHOOL_NOTIFY_MESSAGE_TYPE_ADMIN, process.getTenantId());
|
||||||
}else if(process.getExamStatus() != null && !process.getExamStatus().equals("0")){
|
} else if (process.getExamStatus() != null && !process.getExamStatus().equals("0")) {
|
||||||
String message = String.format(SchoolBaseConstants.SCHOOL_NOTIFY_MESSAGE_TEMPLATE_MEMBER_EXAM_SCORE, process.getUserName(), "科目一", process.getExamScore(), "未通过");
|
String message = String.format(SchoolBaseConstants.SCHOOL_NOTIFY_MESSAGE_TEMPLATE_MEMBER_EXAM_SCORE, process.getUserName(), "科目一", process.getExamScore(), "未通过");
|
||||||
schoolNotifyMessageSendService.sendMessage(process.getCoachId(), message, SchoolBaseConstants.SCHOOL_NOTIFY_MESSAGE_TYPE_ADMIN, process.getTenantId());
|
schoolNotifyMessageSendService.sendMessage(process.getCoachId(), message, SchoolBaseConstants.SCHOOL_NOTIFY_MESSAGE_TYPE_ADMIN, process.getTenantId());
|
||||||
}
|
}
|
||||||
// 如果是科目一且通过考试,修改科目二状态
|
// 如果是科目一且通过考试,修改科目二状态
|
||||||
if (process.getSubject() == 1 && process.getExamStatus().equals("1")) {
|
if (process.getSubject() == 1 && process.getExamStatus().equals("1")) {
|
||||||
|
|
||||||
update(Wrappers.lambdaUpdate(Process.class)
|
update(Wrappers.lambdaUpdate(Process.class)
|
||||||
.eq(Process::getUserId, process.getUserId())
|
.eq(Process::getUserId, process.getUserId())
|
||||||
.eq(Process::getSubject, 2)
|
.eq(Process::getSubject, 2)
|
||||||
@ -385,7 +387,7 @@ public class ProcessServiceImpl extends ServiceImpl<ProcessMapper, Process> impl
|
|||||||
dlDriveSchoolStudentService.updateStudentPassAndGradTime(process.getExamTime(), process.getUserId(), process.getCourseId(), process.getTenantId());
|
dlDriveSchoolStudentService.updateStudentPassAndGradTime(process.getExamTime(), process.getUserId(), process.getCourseId(), process.getTenantId());
|
||||||
String message = String.format(SchoolBaseConstants.SCHOOL_NOTIFY_MESSAGE_TEMPLATE_MEMBER_EXAM_SCORE, process.getUserName(), "科目四", process.getExamScore(), "已通过");
|
String message = String.format(SchoolBaseConstants.SCHOOL_NOTIFY_MESSAGE_TEMPLATE_MEMBER_EXAM_SCORE, process.getUserName(), "科目四", process.getExamScore(), "已通过");
|
||||||
schoolNotifyMessageSendService.sendMessage(process.getCoachId(), message, SchoolBaseConstants.SCHOOL_NOTIFY_MESSAGE_TYPE_ADMIN, process.getTenantId());
|
schoolNotifyMessageSendService.sendMessage(process.getCoachId(), message, SchoolBaseConstants.SCHOOL_NOTIFY_MESSAGE_TYPE_ADMIN, process.getTenantId());
|
||||||
}else if(process.getSubject() == 4 && process.getExamStatus().equals("0")){
|
} else if (process.getSubject() == 4 && process.getExamStatus().equals("0")) {
|
||||||
String message = String.format(SchoolBaseConstants.SCHOOL_NOTIFY_MESSAGE_TEMPLATE_MEMBER_EXAM_SCORE, process.getUserName(), "科目四", process.getExamScore(), "未通过");
|
String message = String.format(SchoolBaseConstants.SCHOOL_NOTIFY_MESSAGE_TEMPLATE_MEMBER_EXAM_SCORE, process.getUserName(), "科目四", process.getExamScore(), "未通过");
|
||||||
schoolNotifyMessageSendService.sendMessage(process.getCoachId(), message, SchoolBaseConstants.SCHOOL_NOTIFY_MESSAGE_TYPE_ADMIN, process.getTenantId());
|
schoolNotifyMessageSendService.sendMessage(process.getCoachId(), message, SchoolBaseConstants.SCHOOL_NOTIFY_MESSAGE_TYPE_ADMIN, process.getTenantId());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,6 +18,7 @@ import cn.iocoder.yudao.module.exam.vo.ExamBatchVO;
|
|||||||
import cn.iocoder.yudao.module.exam.vo.ExamVO;
|
import cn.iocoder.yudao.module.exam.vo.ExamVO;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
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 lombok.SneakyThrows;
|
import lombok.SneakyThrows;
|
||||||
@ -227,10 +228,10 @@ public class ExamBatchItemServiceImpl extends ServiceImpl<ExamBatchItemMapper, E
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void updateObjNew(ExamBatchItemNewVO examBatchVO) {
|
public void updateObjNew(ExamBatchItemNewVO examBatchVO) {
|
||||||
String subject = "";
|
String subject = "";
|
||||||
if(examBatchVO.getSubject() == 2){
|
if (examBatchVO.getSubject() == 2) {
|
||||||
subject = "科目二";
|
subject = "科目二";
|
||||||
}else if(examBatchVO.getSubject() == 4){
|
} else if (examBatchVO.getSubject() == 3) {
|
||||||
subject = "科目四";
|
subject = "科目三";
|
||||||
}
|
}
|
||||||
//教练ID
|
//教练ID
|
||||||
Long userId = SecurityFrameworkUtils.getLoginUserId();
|
Long userId = SecurityFrameworkUtils.getLoginUserId();
|
||||||
@ -252,8 +253,10 @@ public class ExamBatchItemServiceImpl extends ServiceImpl<ExamBatchItemMapper, E
|
|||||||
process.setRemark(examBatchVO.getRemark());
|
process.setRemark(examBatchVO.getRemark());
|
||||||
//已完成
|
//已完成
|
||||||
|
|
||||||
process.setExamStatus(examBatchVO.getIfPass() ? "1" : "null");
|
process.setExamStatus(examBatchVO.getIfPass() ? "1" : "0");
|
||||||
|
|
||||||
processService.updateById(process);
|
processService.updateById(process);
|
||||||
|
|
||||||
//更新考试批次的通过率
|
//更新考试批次的通过率
|
||||||
this.updateBatchPassRate(examBatch.getId());
|
this.updateBatchPassRate(examBatch.getId());
|
||||||
if (examBatchVO.getIfPass()) {
|
if (examBatchVO.getIfPass()) {
|
||||||
@ -269,11 +272,11 @@ public class ExamBatchItemServiceImpl extends ServiceImpl<ExamBatchItemMapper, E
|
|||||||
.eq(Process::getCourseId, process.getCourseId())
|
.eq(Process::getCourseId, process.getCourseId())
|
||||||
.eq(Process::getUserId, process.getUserId())
|
.eq(Process::getUserId, process.getUserId())
|
||||||
.eq(Process::getSubject, nextSubject)
|
.eq(Process::getSubject, nextSubject)
|
||||||
.eq(Process::getTenantId,process.getTenantId());
|
.eq(Process::getTenantId, process.getTenantId());
|
||||||
List<Process> list = processService.list(queryWrapper);
|
List<Process> list = processService.list(queryWrapper);
|
||||||
if (!list.isEmpty()) {
|
if (!list.isEmpty()) {
|
||||||
Process nextProcess = list.get(0);
|
Process nextProcess = list.get(0);
|
||||||
if(!"2".equals(nextProcess.getStatus())){
|
if (!"2".equals(nextProcess.getStatus())) {
|
||||||
nextProcess.setStatus("1");
|
nextProcess.setStatus("1");
|
||||||
processService.updateById(nextProcess);
|
processService.updateById(nextProcess);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -87,5 +87,7 @@ public class ExamVO extends ExamBatchItemNewVO {
|
|||||||
*/
|
*/
|
||||||
private String courseType;
|
private String courseType;
|
||||||
|
|
||||||
|
private String ifPassStatus;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
AND course_id = #{courseId}
|
AND course_id = #{courseId}
|
||||||
AND `subject` = #{subject}
|
AND `subject` = #{subject}
|
||||||
AND coach_id = #{coachId}
|
AND coach_id = #{coachId}
|
||||||
AND exam_status IS NULL
|
AND (exam_status IS NULL OR exam_status = '0')
|
||||||
AND deleted =0
|
AND deleted =0
|
||||||
</update>
|
</update>
|
||||||
<update id="updateProcessExamResult">
|
<update id="updateProcessExamResult">
|
||||||
|
|||||||
@ -77,14 +77,14 @@
|
|||||||
|
|
||||||
SELECT
|
SELECT
|
||||||
dseb.*,
|
dseb.*,
|
||||||
/*dseb.batch_name,
|
|
||||||
dseb.start_time,
|
|
||||||
dseb.end_time,
|
|
||||||
dseb.addr,
|
|
||||||
dseb.trans_way,*/
|
|
||||||
dseb.start_time AS examStartTime,
|
dseb.start_time AS examStartTime,
|
||||||
|
|
||||||
dsc.type AS courseType,
|
dsp.course_type AS courseType,
|
||||||
|
CASE
|
||||||
|
WHEN dsebi.fraction IS NULL AND dsebi.if_pass IS NULL
|
||||||
|
THEN dsp.exam_status
|
||||||
|
ELSE NULL
|
||||||
|
END AS ifPassStatus,
|
||||||
|
|
||||||
dsebi.batch_id,
|
dsebi.batch_id,
|
||||||
dsebi.user_name,
|
dsebi.user_name,
|
||||||
@ -97,7 +97,7 @@
|
|||||||
dsebi.id AS batchItemId
|
dsebi.id AS batchItemId
|
||||||
FROM drive_school_exam_batch dseb
|
FROM drive_school_exam_batch dseb
|
||||||
LEFT JOIN drive_school_exam_batch_item dsebi ON dseb.id = dsebi.batch_id
|
LEFT JOIN drive_school_exam_batch_item dsebi ON dseb.id = dsebi.batch_id
|
||||||
LEFT JOIN drive_school_course dsc ON dseb.course_id = dsc.id
|
LEFT JOIN drive_school_process dsp ON dseb.course_id = dsp.course_id AND dseb.subject = dsp.subject AND dsebi.user_id = dsp.user_id
|
||||||
WHERE
|
WHERE
|
||||||
dsebi.user_id = #{userId}
|
dsebi.user_id = #{userId}
|
||||||
AND (dseb.deleted = 0 OR dseb.deleted IS NULL)
|
AND (dseb.deleted = 0 OR dseb.deleted IS NULL)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user