Compare commits

...

5 Commits

Author SHA1 Message Date
Lx
8743504224 Merge remote-tracking branch 'origin/driver' into driver 2025-04-17 18:45:49 +08:00
xyc
dfbfada442 更改 2025-04-17 18:38:34 +08:00
Lx
104eb28c18 Merge remote-tracking branch 'origin/driver' into driver 2025-04-17 18:30:19 +08:00
Lx
3bfe5dbfb1 0417-3 2025-04-17 18:30:11 +08:00
xyc
e995811e84 更改 2025-04-17 18:29:55 +08:00
5 changed files with 25 additions and 18 deletions

View File

@ -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);
@ -373,6 +374,7 @@ public class ProcessServiceImpl extends ServiceImpl<ProcessMapper, Process> impl
}
// 如果是科目一且通过考试修改科目二状态
if (process.getSubject() == 1 && process.getExamStatus().equals("1")) {
update(Wrappers.lambdaUpdate(Process.class)
.eq(Process::getUserId, process.getUserId())
.eq(Process::getSubject, 2)

View File

@ -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;
@ -229,8 +230,8 @@ public class ExamBatchItemServiceImpl extends ServiceImpl<ExamBatchItemMapper, E
String subject = "";
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()) {

View File

@ -87,5 +87,7 @@ public class ExamVO extends ExamBatchItemNewVO {
*/
private String courseType;
private String ifPassStatus;
}

View File

@ -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">

View File

@ -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)