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();
|
||||
LambdaQueryWrapper<Process> queryWrapper = new LambdaQueryWrapper<Process>()
|
||||
.eq(Process::getCoachId, userId)
|
||||
.notIn(Process::getSubject, Arrays.asList(1, 4))
|
||||
//状态不等于2-已完成的科目
|
||||
.ne(Process::getStatus, "2")
|
||||
// .ne(Process::getStatus, "2")
|
||||
.groupBy(Process::getCourseId).groupBy(Process::getSubject);
|
||||
return this.list(queryWrapper);
|
||||
}
|
||||
@ -110,7 +111,7 @@ public class ProcessServiceImpl extends ServiceImpl<ProcessMapper, Process> impl
|
||||
}
|
||||
//状态等于1-训练中的
|
||||
queryWrapper.eq(Process::getStatus, "1")
|
||||
.isNull(Process::getExamStatus)
|
||||
.and(wrapper -> wrapper.isNull(Process::getExamStatus).or().eq(Process::getExamStatus, "0"))
|
||||
.groupBy(Process::getUserId)
|
||||
.orderByDesc(BaseDO::getCreateTime);
|
||||
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(), "已通过");
|
||||
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(), "未通过");
|
||||
schoolNotifyMessageSendService.sendMessage(process.getCoachId(), message, SchoolBaseConstants.SCHOOL_NOTIFY_MESSAGE_TYPE_ADMIN, process.getTenantId());
|
||||
}
|
||||
// 如果是科目一且通过考试,修改科目二状态
|
||||
if (process.getSubject() == 1 && process.getExamStatus().equals("1")) {
|
||||
|
||||
update(Wrappers.lambdaUpdate(Process.class)
|
||||
.eq(Process::getUserId, process.getUserId())
|
||||
.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());
|
||||
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());
|
||||
}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(), "未通过");
|
||||
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 com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
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.service.impl.ServiceImpl;
|
||||
import lombok.SneakyThrows;
|
||||
@ -227,10 +228,10 @@ public class ExamBatchItemServiceImpl extends ServiceImpl<ExamBatchItemMapper, E
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateObjNew(ExamBatchItemNewVO examBatchVO) {
|
||||
String subject = "";
|
||||
if(examBatchVO.getSubject() == 2){
|
||||
if (examBatchVO.getSubject() == 2) {
|
||||
subject = "科目二";
|
||||
}else if(examBatchVO.getSubject() == 4){
|
||||
subject = "科目四";
|
||||
} else if (examBatchVO.getSubject() == 3) {
|
||||
subject = "科目三";
|
||||
}
|
||||
//教练ID
|
||||
Long userId = SecurityFrameworkUtils.getLoginUserId();
|
||||
@ -252,8 +253,10 @@ public class ExamBatchItemServiceImpl extends ServiceImpl<ExamBatchItemMapper, E
|
||||
process.setRemark(examBatchVO.getRemark());
|
||||
//已完成
|
||||
|
||||
process.setExamStatus(examBatchVO.getIfPass() ? "1" : "null");
|
||||
process.setExamStatus(examBatchVO.getIfPass() ? "1" : "0");
|
||||
|
||||
processService.updateById(process);
|
||||
|
||||
//更新考试批次的通过率
|
||||
this.updateBatchPassRate(examBatch.getId());
|
||||
if (examBatchVO.getIfPass()) {
|
||||
@ -269,11 +272,11 @@ public class ExamBatchItemServiceImpl extends ServiceImpl<ExamBatchItemMapper, E
|
||||
.eq(Process::getCourseId, process.getCourseId())
|
||||
.eq(Process::getUserId, process.getUserId())
|
||||
.eq(Process::getSubject, nextSubject)
|
||||
.eq(Process::getTenantId,process.getTenantId());
|
||||
.eq(Process::getTenantId, process.getTenantId());
|
||||
List<Process> list = processService.list(queryWrapper);
|
||||
if (!list.isEmpty()) {
|
||||
Process nextProcess = list.get(0);
|
||||
if(!"2".equals(nextProcess.getStatus())){
|
||||
if (!"2".equals(nextProcess.getStatus())) {
|
||||
nextProcess.setStatus("1");
|
||||
processService.updateById(nextProcess);
|
||||
}
|
||||
|
||||
@ -87,5 +87,7 @@ public class ExamVO extends ExamBatchItemNewVO {
|
||||
*/
|
||||
private String courseType;
|
||||
|
||||
private String ifPassStatus;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
AND course_id = #{courseId}
|
||||
AND `subject` = #{subject}
|
||||
AND coach_id = #{coachId}
|
||||
AND exam_status IS NULL
|
||||
AND (exam_status IS NULL OR exam_status = '0')
|
||||
AND deleted =0
|
||||
</update>
|
||||
<update id="updateProcessExamResult">
|
||||
|
||||
@ -77,14 +77,14 @@
|
||||
|
||||
SELECT
|
||||
dseb.*,
|
||||
/*dseb.batch_name,
|
||||
dseb.start_time,
|
||||
dseb.end_time,
|
||||
dseb.addr,
|
||||
dseb.trans_way,*/
|
||||
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.user_name,
|
||||
@ -97,7 +97,7 @@
|
||||
dsebi.id AS batchItemId
|
||||
FROM drive_school_exam_batch dseb
|
||||
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
|
||||
dsebi.user_id = #{userId}
|
||||
AND (dseb.deleted = 0 OR dseb.deleted IS NULL)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user