This commit is contained in:
Lx 2025-04-02 15:31:03 +08:00
parent f00389d7d9
commit 23566a8a5b
6 changed files with 91 additions and 1 deletions

View File

@ -34,6 +34,7 @@ public class ObtainDriveContractController {
* 新增驾校合同
*/
@PostMapping
@TenantIgnore
public CommonResult add(@RequestBody DriveSchoolContract driveSchoolContract)
{
return CommonResult.success(driveSchoolContractService.insertDriveSchoolContractNew(driveSchoolContract));

View File

@ -0,0 +1,62 @@
package cn.iocoder.yudao.module.course.controller.app;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
import cn.iocoder.yudao.module.course.entity.Process;
import cn.iocoder.yudao.module.course.service.ProcessService;
import cn.iocoder.yudao.module.course.vo.ProcessVO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Tag(name = "学员课程进度")
@RestController
@RequestMapping("/process")
@Validated
public class ProcessSmallProgramController {
@Resource
private ProcessService processService;
/**
* 学员课程进度分页查询
*
* @param pageReqVO {@link ProcessVO}
* @param pageNo 分页参数
* @param pageSize 分页参数
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<com.baomidou.mybatisplus.core.metadata.IPage < ?>>
* @author PQZ
* @date 15:33 2025/2/17
**/
@GetMapping("/page")
@Operation(summary = "学员课程进度分页")
@TenantIgnore
public CommonResult<IPage<?>> getDlDriveSchoolCoachPage(ProcessVO pageReqVO,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
Page<ProcessVO> page = new Page<>(pageNo, pageSize);
return success(processService.pageProcess(page, pageReqVO));
}
/**
* 修改学员课程进度
*
* @param process {@link Process}
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<java.lang.Boolean>
*/
@PutMapping("/updateProcess")
@Operation(summary = "修改学员课程进度")
@TenantIgnore
public CommonResult updateProcess(@RequestBody Process process) {
processService.updateProcess(process);
return CommonResult.ok();
}
}

View File

@ -106,4 +106,9 @@ public interface ProcessService extends IService<Process> {
* @param processes {@link Process}
*/
void saveProcess(ProcessAddVO request);
/**
* 修改学院课程进度
*/
void updateProcess(Process process);
}

View File

@ -21,6 +21,8 @@ import cn.iocoder.yudao.module.payment.service.IFzRecordService;
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -294,6 +296,24 @@ public class ProcessServiceImpl extends ServiceImpl<ProcessMapper, Process> impl
}
@Override
public void updateProcess(Process process) {
update(Wrappers.lambdaUpdate(Process.class)
.eq(Process::getUserId, process.getUserId())
.eq(Process::getSubject, process.getSubject())
.eq(Process::getCourseId, process.getCourseId())
.eq(Process::getDeleted, false)
.set(process.getUserName() != null, Process::getUserName, process.getUserName())
.set(process.getExamStatus() != null, Process::getExamStatus, process.getExamStatus())
.set(process.getExamScore() != null, Process::getExamScore, process.getExamScore())
.set(process.getRemark() != null, Process::getRemark, process.getRemark())
.set(process.getExamTime() != null, Process::getExamTime, process.getExamTime())
.set(process.getImages() != null, Process::getImages, process.getImages()));
}
private static void verify(List<Process> processes) {
for (Process process : processes) {
// 校验状态
@ -328,4 +348,4 @@ public class ProcessServiceImpl extends ServiceImpl<ProcessMapper, Process> impl
}
}
}
}

View File

@ -51,6 +51,7 @@
<if test="entity.userName != null and entity.userName != '' "> and dsp.user_name like concat('%', #{entity.userName}, '%')</if>
<if test="entity.courseName != null and entity.courseName != '' "> and dsp.name like concat('%', #{entity.courseName}, '%')</if>
<if test="entity.userId != null "> and dsp.user_id = #{entity.userId}</if>
<if test="entity.courseId != null and entity.courseId != '' "> and dsp.course_id = #{entity.courseId}</if>
</where>
order by dsp.create_time desc
</select>

View File

@ -20,6 +20,7 @@
<if test="entity.userName != null and entity.userName != ''"> and main.user_name like concat('%', #{entity.userName}, '%')</if>
<if test="entity.userId != null and entity.userId != ''"> and main.user_id = #{entity.userId}</if>
<if test="entity.paymentStatus != null and entity.paymentStatus != ''"> and main.payment_status = #{entity.paymentStatus}</if>
<if test="entity.ifEnd != null and entity.ifEnd != ''"> and main.if_end = #{entity.ifEnd}</if>
</where>
</select>
<select id="selectByCoachUserId" resultType="java.lang.Double">