Compare commits
9 Commits
fd4d5efa8f
...
80766669e0
| Author | SHA1 | Date | |
|---|---|---|---|
| 80766669e0 | |||
| 381913137a | |||
|
|
86e7f06405 | ||
|
|
d4eefc8da9 | ||
| 71ea01aded | |||
| 678b3eb207 | |||
| 552437b4fc | |||
| 78a7a65bba | |||
| 01cc2c0323 |
@ -18,7 +18,7 @@ public enum SchoolRoleEnum {
|
||||
/**
|
||||
* 驾校工作人员
|
||||
*/
|
||||
STAFF("school_staff","驾校工作人员"),
|
||||
STAFF("school_staff","驾校安全员"),
|
||||
/**
|
||||
* 驾校教练
|
||||
*/
|
||||
|
||||
@ -13,6 +13,7 @@ import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
@ -123,4 +124,14 @@ public class Company extends TenantBaseDO {
|
||||
* 营业结束时间
|
||||
*/
|
||||
private String businessEndTime;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
private BigDecimal lgt;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
private BigDecimal lat;
|
||||
}
|
||||
|
||||
@ -116,9 +116,18 @@ public interface SchoolBaseConstants {
|
||||
public static final String SCHOOL_NOTIFY_MESSAGE_TEMPLATE_MEMBER_EXAM_SCORE= "学员 %s 在 %s 的考试成绩为:%s,%s考试";
|
||||
|
||||
/**
|
||||
* 驾校消息模版: 学员报名
|
||||
* 驾校消息模版: 学员报名之后发送消息给教练(在选择了教练的情况下)
|
||||
*/
|
||||
public static final String SCHOOL_NOTIFY_MESSAGE_TEMPLATE_MEMBER_ENROLL= "学员 %s 报名 %s 课程,报名方式:%s";
|
||||
public static final String SCHOOL_NOTIFY_MESSAGE_TEMPLATE_MEMBER_ENROLL= "学员 %s 报名了 %s 课程";
|
||||
|
||||
/**
|
||||
* 学员分配教练之后通知对应教练
|
||||
*/
|
||||
public static final String SCHOOL_NOTIFY_MESSAGE_TEMPLATE_ASSIGN_COACH_TO_COACH= "您有新学员,请留意。学员姓名:%s,学员手机号:%s";
|
||||
|
||||
/**
|
||||
* 学员报名之后发送消息到办公室
|
||||
*/
|
||||
public static final String SCHOOL_NOTIFY_MESSAGE_TEMPLATE_MEMBER_ENROLL_TO_OFFICE= "学员 %s 报名了 %s 课程,请留意!";
|
||||
|
||||
}
|
||||
|
||||
@ -8,6 +8,7 @@ import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
||||
import cn.iocoder.yudao.module.base.entity.DlDriveSchoolStudent;
|
||||
import cn.iocoder.yudao.module.base.service.DlDriveSchoolStudentService;
|
||||
import cn.iocoder.yudao.module.base.vo.DlDriveSchoolStudentVO;
|
||||
import cn.iocoder.yudao.module.jx.core.controller.BaseController;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
||||
import cn.iocoder.yudao.module.system.service.user.AdminUserService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
@ -31,7 +32,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
@RestController
|
||||
@RequestMapping("/small/dl-drive-school-student")
|
||||
@Validated
|
||||
public class DlDriveSchoolStudentSmallProgramController {
|
||||
public class DlDriveSchoolStudentSmallProgramController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private DlDriveSchoolStudentService schoolStudentService;
|
||||
@ -89,6 +90,9 @@ public class DlDriveSchoolStudentSmallProgramController {
|
||||
@TenantIgnore
|
||||
public CommonResult<AdminUserDO> getUsersInfo(){
|
||||
LoginUser user = SecurityFrameworkUtils.getLoginUser();
|
||||
if (user == null) {
|
||||
return success("未登录");
|
||||
}
|
||||
Long userId = user.getId();
|
||||
AdminUserDO sysUser = userService.getUser(userId);
|
||||
return success(sysUser);
|
||||
|
||||
@ -0,0 +1,40 @@
|
||||
package cn.iocoder.yudao.module.base.controller.app;
|
||||
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
||||
import cn.iocoder.yudao.module.jx.domain.DriveSchoolSwiper;
|
||||
import cn.iocoder.yudao.module.jx.service.IDriveSchoolSwiperService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.security.PermitAll;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 驾校-轮播图Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-03-19
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/drivingSchool/small/swiper")
|
||||
public class DriveSchoolSwiperSmallProgramController {
|
||||
|
||||
@Autowired
|
||||
private IDriveSchoolSwiperService driveSchoolSwiperService;
|
||||
|
||||
/**
|
||||
* 查询驾校-轮播图列表
|
||||
*/
|
||||
@TenantIgnore
|
||||
@PermitAll
|
||||
@GetMapping("/list")
|
||||
public CommonResult list(DriveSchoolSwiper driveSchoolSwiper)
|
||||
{
|
||||
List<DriveSchoolSwiper> list = driveSchoolSwiperService.selectDriveSchoolSwiperList(driveSchoolSwiper);
|
||||
return CommonResult.success(list);
|
||||
}
|
||||
}
|
||||
@ -86,4 +86,13 @@ public class SchoolCourseOrderSmallProgramController {
|
||||
//获取当前登陆人
|
||||
return success(schoolCourseOrderService.getCourseByLoginUser(SecurityFrameworkUtils.getLoginUserId()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 报名之后发送对应消息
|
||||
*/
|
||||
@GetMapping("/sendMessage")
|
||||
@TenantIgnore
|
||||
public CommonResult<?> sendMessage(String studentName, String courseName,Long coachId) {
|
||||
return success(schoolCourseOrderService.sendOrderMessage(studentName, courseName, coachId));
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,8 +4,11 @@ import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.*;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 驾校学员 DO
|
||||
*
|
||||
@ -106,4 +109,14 @@ public class DlDriveSchoolStudent extends TenantBaseDO {
|
||||
*/
|
||||
private String uniqueCode;
|
||||
|
||||
}
|
||||
/**
|
||||
* 体检报告
|
||||
*/
|
||||
private String examinationReport;
|
||||
|
||||
/**
|
||||
* 学员编码
|
||||
*/
|
||||
private String drivingStudentCode;
|
||||
|
||||
}
|
||||
|
||||
@ -148,10 +148,10 @@ public class DataViewServiceImpl implements DataViewService {
|
||||
double schoolRate=0;
|
||||
if(allNum>0){
|
||||
if(coachNum>0){
|
||||
coachRate = coachNum / allNum;
|
||||
coachRate = (double)coachNum / allNum;
|
||||
}
|
||||
if(schoolNum>0){
|
||||
schoolRate = schoolNum / allNum;
|
||||
schoolRate = (double)schoolNum / allNum;
|
||||
}
|
||||
}
|
||||
studentInfoMap.put("coachNum",coachNum);
|
||||
|
||||
@ -1,9 +1,11 @@
|
||||
package cn.iocoder.yudao.module.base.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import cn.iocoder.yudao.module.base.entity.DlDriveSchoolCoachCourse;
|
||||
import cn.iocoder.yudao.module.base.entity.DlDriveSchoolCourse;
|
||||
import cn.iocoder.yudao.module.base.entity.DriveSchoolCourseDeduct;
|
||||
import cn.iocoder.yudao.module.base.mapper.DlDriveSchoolCourseMapper;
|
||||
import cn.iocoder.yudao.module.base.service.DlDriveSchoolCoachCourseService;
|
||||
import cn.iocoder.yudao.module.base.service.DlDriveSchoolCourseDeductService;
|
||||
@ -11,8 +13,10 @@ import cn.iocoder.yudao.module.base.service.DlDriveSchoolCourseService;
|
||||
import cn.iocoder.yudao.module.base.vo.DlDriveSchoolCoachVO;
|
||||
import cn.iocoder.yudao.module.base.vo.DlDriveSchoolCourseVO;
|
||||
import cn.iocoder.yudao.module.jx.utils.StringUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
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 org.springframework.stereotype.Service;
|
||||
@ -20,6 +24,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -90,8 +95,17 @@ public class DlDriveSchoolCourseServiceImpl extends ServiceImpl<DlDriveSchoolCou
|
||||
DlDriveSchoolCourse course = BeanUtils.toBean(courseVO, DlDriveSchoolCourse.class);
|
||||
saveOrUpdate(course);
|
||||
coachCourseService.saveCoachCourse(course.getId(), courseVO.getName(), courseVO.getType(), courseVO.getCoachList());
|
||||
// 删除提成配置
|
||||
driveSchoolCourseDeductService.remove(Wrappers.<DriveSchoolCourseDeduct>lambdaQuery()
|
||||
.eq(DriveSchoolCourseDeduct::getCourseId, course.getId()));
|
||||
//设置提成信息课程id
|
||||
courseVO.getDeductList().forEach(deduct -> {
|
||||
deduct.setCourseId(course.getId());
|
||||
deduct.setId(null);
|
||||
});
|
||||
|
||||
// 保存提成信息
|
||||
driveSchoolCourseDeductService.defaultAdd(course.getId());
|
||||
driveSchoolCourseDeductService.saveBatch(courseVO.getDeductList());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -126,24 +140,39 @@ public class DlDriveSchoolCourseServiceImpl extends ServiceImpl<DlDriveSchoolCou
|
||||
Map<String, List<String>> groupedCoachMap = coachList.stream()
|
||||
.collect(Collectors.groupingBy(
|
||||
DlDriveSchoolCoachVO::getCoachName,
|
||||
Collectors.mapping(coach -> "科目" + coach.getSubject() , Collectors.toList())
|
||||
Collectors.mapping(coach -> "科目" + coach.getSubject(), Collectors.toList())
|
||||
));
|
||||
// 将 groupedCoachMap 转换为字符串格式
|
||||
String resultString = groupedCoachMap.entrySet().stream()
|
||||
.map(entry -> entry.getKey() + "[" + String.join(" ", entry.getValue()) + "]")
|
||||
.collect(Collectors.joining(", "));
|
||||
result.setCoachListText(resultString);
|
||||
// 查询提成配置
|
||||
List<DriveSchoolCourseDeduct> deducts = driveSchoolCourseDeductService.list(Wrappers.<DriveSchoolCourseDeduct>lambdaQuery()
|
||||
.eq(DriveSchoolCourseDeduct::getCourseId, id));
|
||||
if (CollUtil.isEmpty(deducts)) {
|
||||
// 科目一到科目四都为0
|
||||
for (int i = 1; i <= 4; i++) {
|
||||
DriveSchoolCourseDeduct deduct = new DriveSchoolCourseDeduct();
|
||||
deduct.setCourseId(id);
|
||||
deduct.setCourseSubject(i + "");
|
||||
deduct.setDeduct(new BigDecimal("0"));
|
||||
deducts.add(deduct);
|
||||
}
|
||||
}
|
||||
result.setDeductList(deducts);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 数据类型转换
|
||||
* @author PQZ
|
||||
* @date 14:25 2025/2/8
|
||||
*
|
||||
* @param coachList TODO
|
||||
* @return java.util.List<cn.iocoder.yudao.module.base.vo.DlDriveSchoolCoachVO>
|
||||
**/
|
||||
* @author PQZ
|
||||
* @date 14:25 2025/2/8
|
||||
**/
|
||||
private List<DlDriveSchoolCoachVO> transCoachList(List<DlDriveSchoolCoachCourse> coachList) {
|
||||
List<DlDriveSchoolCoachVO> transList = new ArrayList<>();
|
||||
if (!coachList.isEmpty()) {
|
||||
|
||||
@ -39,6 +39,7 @@ import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Comparator;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@ -98,6 +99,8 @@ public class DlDriveSchoolStudentServiceImpl extends ServiceImpl<DlDriveSchoolSt
|
||||
// 生成唯一推广码
|
||||
String uniqueCode = uniqueCodeService.createUniqueCode();
|
||||
dlDriveSchoolStudent.setUniqueCode(uniqueCode);
|
||||
// 生成学员编码
|
||||
dlDriveSchoolStudent.setDrivingStudentCode(generateDrivingStudentCode());
|
||||
dlDriveSchoolStudentMapper.insert(dlDriveSchoolStudent);
|
||||
return dlDriveSchoolStudent.getId();
|
||||
} else {
|
||||
@ -117,6 +120,31 @@ public class DlDriveSchoolStudentServiceImpl extends ServiceImpl<DlDriveSchoolSt
|
||||
.one();
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成学员编码 年份 + 五位递增数字
|
||||
* @return
|
||||
*/
|
||||
private String generateDrivingStudentCode() {
|
||||
String year = String.valueOf(LocalDate.now().getYear());
|
||||
|
||||
QueryWrapper<DlDriveSchoolStudent> wrapper = new QueryWrapper<>();
|
||||
wrapper.select("driving_student_code")
|
||||
.likeRight("driving_student_code", year)
|
||||
.orderByDesc("driving_student_code")
|
||||
.last("LIMIT 1");
|
||||
|
||||
DlDriveSchoolStudent maxStudent = dlDriveSchoolStudentMapper.selectOne(wrapper);
|
||||
|
||||
int next = 1;
|
||||
if (maxStudent != null && StringUtils.isNotBlank(maxStudent.getDrivingStudentCode())) {
|
||||
String code = maxStudent.getDrivingStudentCode();
|
||||
String suffix = code.substring(4);
|
||||
next = Integer.parseInt(suffix) + 1;
|
||||
}
|
||||
|
||||
return year + String.format("%05d", next);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取学员详细信息
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package cn.iocoder.yudao.module.base.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.base.entity.DlDriveSchoolCourse;
|
||||
import cn.iocoder.yudao.module.base.entity.DriveSchoolCourseDeduct;
|
||||
import cn.iocoder.yudao.module.jx.core.page.TenantBaDO;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
@ -16,4 +17,5 @@ import java.util.List;
|
||||
public class DlDriveSchoolCourseVO extends DlDriveSchoolCourse {
|
||||
private List<DlDriveSchoolCoachVO> coachList;
|
||||
private String coachListText;
|
||||
private List<DriveSchoolCourseDeduct> deductList;
|
||||
}
|
||||
|
||||
@ -12,6 +12,8 @@ import lombok.Data;
|
||||
public class DlDriveSchoolStudentVO extends DlDriveSchoolStudent {
|
||||
/**教练ID*/
|
||||
private Long coachId;
|
||||
/**教练姓名*/
|
||||
private String coachName;
|
||||
/**教练ID*/
|
||||
private String courseId;
|
||||
/**学习进度*/
|
||||
@ -35,4 +37,4 @@ public class DlDriveSchoolStudentVO extends DlDriveSchoolStudent {
|
||||
private String courseName;
|
||||
/**订单ID*/
|
||||
private String orderId;
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,9 +3,12 @@ package cn.iocoder.yudao.module.course.controller.admin;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
||||
import cn.iocoder.yudao.module.base.service.DlDriveSchoolCourseService;
|
||||
import cn.iocoder.yudao.module.base.vo.DlDriveSchoolCourseVO;
|
||||
import cn.iocoder.yudao.module.course.entity.Process;
|
||||
import cn.iocoder.yudao.module.course.service.ProcessService;
|
||||
import cn.iocoder.yudao.module.course.vo.ProcessAddVO;
|
||||
import cn.iocoder.yudao.module.course.vo.ProcessNewVO;
|
||||
import cn.iocoder.yudao.module.course.vo.ProcessVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@ -19,6 +22,7 @@ import javax.annotation.Resource;
|
||||
import javax.annotation.security.PermitAll;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
@ -33,6 +37,8 @@ public class ProcessController {
|
||||
private ProcessService processService;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 学员课程进度分页查询
|
||||
*
|
||||
@ -140,4 +146,13 @@ public class ProcessController {
|
||||
return success(processService.getAllByUserIdAndCourseId(userId, courseId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 教练自招学员,自动分配教练
|
||||
*/
|
||||
@PostMapping("/autoAssignCoach")
|
||||
public CommonResult<Boolean> autoAssignCoach(@RequestBody ProcessNewVO requset) {
|
||||
processService.autoAssignCoach(requset);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -8,12 +8,10 @@ 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.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@ -45,6 +43,13 @@ public class SchoolCommissionController {
|
||||
return success(schoolCommissionService.queryPage(page, pageReqVO));
|
||||
}
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建提成记录")
|
||||
public CommonResult<Boolean> createSchoolCommission(@Valid @RequestBody SchoolCommissionVO createReqVO) {
|
||||
return success(schoolCommissionService.createSchoolCommission(createReqVO));
|
||||
}
|
||||
|
||||
|
||||
|
||||
// @GetMapping("/get")
|
||||
// @Operation(summary = "获得提成记录")
|
||||
@ -57,4 +62,4 @@ public class SchoolCommissionController {
|
||||
//
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@ import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
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.ProcessNewVO;
|
||||
import cn.iocoder.yudao.module.course.vo.ProcessVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
@ -99,4 +100,13 @@ public class ProcessSmallProgramController {
|
||||
.eq(Process::getUserId, loginUserId)
|
||||
.eq(Process::getCourseId, courseId)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 教练自招学员,自动分配教练
|
||||
*/
|
||||
@PostMapping("/autoAssignCoach")
|
||||
public CommonResult<Boolean> autoAssignCoach(@RequestBody ProcessNewVO requset) {
|
||||
processService.autoAssignCoach(requset);
|
||||
return success(true);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package cn.iocoder.yudao.module.course.service;
|
||||
|
||||
import cn.iocoder.yudao.module.course.entity.Process;
|
||||
import cn.iocoder.yudao.module.course.vo.ProcessNewVO;
|
||||
import cn.iocoder.yudao.module.exam.vo.ExamVO;
|
||||
import cn.iocoder.yudao.module.course.vo.ProcessAddVO;
|
||||
import cn.iocoder.yudao.module.course.vo.ProcessVO;
|
||||
@ -127,4 +128,9 @@ public interface ProcessService extends IService<Process> {
|
||||
*/
|
||||
List<ProcessVO> getExamListByUserId(Long userId);
|
||||
List<ExamVO> getExamListByUserIdTest(Long userId);
|
||||
|
||||
/**
|
||||
* 教练自招自动分配教练
|
||||
*/
|
||||
void autoAssignCoach(ProcessNewVO request);
|
||||
}
|
||||
|
||||
@ -25,4 +25,9 @@ public interface SchoolCommissionService extends IService<SchoolCommission> {
|
||||
**/
|
||||
IPage<SchoolCommissionVO> queryPage(Page<SchoolCommissionVO> page, SchoolCommissionVO pageReqVO);
|
||||
|
||||
}
|
||||
/**
|
||||
* 创建提成记录
|
||||
*/
|
||||
boolean createSchoolCommission(SchoolCommissionVO entity);
|
||||
|
||||
}
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
package cn.iocoder.yudao.module.course.service;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
||||
import cn.iocoder.yudao.module.course.entity.SchoolCommission;
|
||||
import cn.iocoder.yudao.module.course.entity.SchoolCourseOrder;
|
||||
import cn.iocoder.yudao.module.course.vo.SchoolCommissionVO;
|
||||
@ -8,11 +10,14 @@ import cn.iocoder.yudao.module.course.vo.SchoolCourseOrderVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* 驾照报名订单 Service 接口
|
||||
*
|
||||
@ -87,4 +92,11 @@ public interface SchoolCourseOrderService extends IService<SchoolCourseOrder> {
|
||||
* @return List<SchoolCourseOrderVO>
|
||||
*/
|
||||
List<SchoolCourseOrderVO> getCourseByLoginUser(Long loginUserId);
|
||||
|
||||
/**
|
||||
* 报名之后发送对应消息
|
||||
*/
|
||||
Boolean sendOrderMessage(String studentName, String courseName, Long coachId);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -7,8 +7,13 @@ import cn.hutool.core.util.StrUtil;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import cn.iocoder.yudao.module.base.constant.SchoolBaseConstants;
|
||||
import cn.iocoder.yudao.module.base.mapper.DlDriveSchoolCourseMapper;
|
||||
import cn.iocoder.yudao.module.base.service.DlDriveSchoolCourseService;
|
||||
import cn.iocoder.yudao.module.base.entity.DriveSchoolCourseDeduct;
|
||||
import cn.iocoder.yudao.module.base.service.DlDriveSchoolCourseDeductService;
|
||||
import cn.iocoder.yudao.module.base.service.DlDriveSchoolStudentService;
|
||||
import cn.iocoder.yudao.module.base.service.SchoolNotifyMessageSendService;
|
||||
import cn.iocoder.yudao.module.base.vo.DlDriveSchoolCourseVO;
|
||||
import cn.iocoder.yudao.module.course.entity.Process;
|
||||
import cn.iocoder.yudao.module.course.entity.SchoolCommission;
|
||||
import cn.iocoder.yudao.module.course.entity.SchoolCourseOrder;
|
||||
@ -16,6 +21,8 @@ import cn.iocoder.yudao.module.course.mapper.ProcessMapper;
|
||||
import cn.iocoder.yudao.module.course.service.ProcessService;
|
||||
import cn.iocoder.yudao.module.course.service.SchoolCommissionService;
|
||||
import cn.iocoder.yudao.module.course.service.SchoolCourseOrderService;
|
||||
import cn.iocoder.yudao.module.course.vo.ProcessNewVO;
|
||||
import cn.iocoder.yudao.module.course.vo.SchoolCourseOrderVO;
|
||||
import cn.iocoder.yudao.module.exam.vo.ExamVO;
|
||||
import cn.iocoder.yudao.module.course.vo.ProcessAddVO;
|
||||
import cn.iocoder.yudao.module.course.vo.ProcessVO;
|
||||
@ -52,8 +59,8 @@ import static cn.iocoder.yudao.module.base.utils.DriveSchoolBaseUtil.getSubjectS
|
||||
public class ProcessServiceImpl extends ServiceImpl<ProcessMapper, Process> implements ProcessService {
|
||||
@Autowired
|
||||
private ProcessMapper processMapper;
|
||||
@Resource
|
||||
private IDriveSchoolDeductService deductService;
|
||||
// @Resource
|
||||
// private IDriveSchoolDeductService deductService;
|
||||
@Resource
|
||||
private AdminUserApi userApi;
|
||||
@Resource
|
||||
@ -70,6 +77,12 @@ public class ProcessServiceImpl extends ServiceImpl<ProcessMapper, Process> impl
|
||||
@Autowired
|
||||
private SchoolNotifyMessageSendService schoolNotifyMessageSendService;
|
||||
|
||||
@Resource
|
||||
private DlDriveSchoolCourseService courseService;
|
||||
|
||||
@Autowired
|
||||
private DlDriveSchoolCourseDeductService deductService;
|
||||
|
||||
|
||||
/**
|
||||
* 教练查自己带教的课程和科目
|
||||
@ -262,7 +275,10 @@ public class ProcessServiceImpl extends ServiceImpl<ProcessMapper, Process> impl
|
||||
if (process.getFinancePass()) {
|
||||
//根据科目查询规则
|
||||
if (null != process.getSubject()) {
|
||||
DriveSchoolDeduct deduct = deductService.queryBySubject(process.getSubject().toString());
|
||||
// 根据课程id查询配置
|
||||
DriveSchoolCourseDeduct deduct = deductService.getOne(Wrappers.<DriveSchoolCourseDeduct>lambdaQuery()
|
||||
.eq(DriveSchoolCourseDeduct::getCourseId, process.getCourseId())
|
||||
.eq(DriveSchoolCourseDeduct::getCourseSubject, process.getSubject()));
|
||||
//如果存在提成规则则生成提成记录
|
||||
if (null != deduct) {
|
||||
SchoolCommission schoolCommission = new SchoolCommission();
|
||||
@ -375,18 +391,27 @@ public class ProcessServiceImpl extends ServiceImpl<ProcessMapper, Process> impl
|
||||
// 发送消息给学员
|
||||
schoolNotifyMessageSendService.sendMessage(userId, message, SchoolBaseConstants.SCHOOL_NOTIFY_MESSAGE_TYPE_MEMBER, null);
|
||||
|
||||
// 发送消息给对应教练
|
||||
AdminUserRespDTO user = userApi.getUser(userId);
|
||||
String userName = user.getNickname();
|
||||
String userPhone = user.getMobile();
|
||||
String messageToCoach = String.format(SchoolBaseConstants.SCHOOL_NOTIFY_MESSAGE_TEMPLATE_ASSIGN_COACH_TO_COACH, userName, userPhone);
|
||||
schoolNotifyMessageSendService.sendMessage(request.getProcessList().get(0).getCoachId(), messageToCoach, SchoolBaseConstants.SCHOOL_NOTIFY_MESSAGE_TYPE_ADMIN, null);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateProcess(Process process) {
|
||||
|
||||
Long userId = SecurityFrameworkUtils.getLoginUserId();
|
||||
AdminUserRespDTO user = userApi.getUser(userId);
|
||||
String userName = user.getNickname();
|
||||
update(Wrappers.lambdaUpdate(Process.class)
|
||||
.eq(Process::getUserId, process.getUserId())
|
||||
.eq(Process::getSubject, process.getSubject())
|
||||
.eq(Process::getCourseId, process.getCourseId())
|
||||
.eq(Process::getTenantId, process.getTenantId())
|
||||
.eq(Process::getDeleted, SchoolBaseConstants.COMMON_NO)
|
||||
.set(process.getUserName() != null, Process::getUserName, process.getUserName())
|
||||
// .set(process.getUserName() != null, Process::getUserName, process.getUserName())
|
||||
.set(process.getExamStatus() != null, Process::getExamStatus, process.getExamStatus())
|
||||
.set(process.getExamScore() != null, Process::getExamScore, process.getExamScore())
|
||||
|
||||
@ -404,15 +429,15 @@ public class ProcessServiceImpl extends ServiceImpl<ProcessMapper, Process> impl
|
||||
.eq(Process::getDeleted, SchoolBaseConstants.COMMON_NO)
|
||||
.set(Process::getStatus, 2));
|
||||
// 发送消息给教练
|
||||
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, userName, "科目一", process.getExamScore(), "已通过");
|
||||
schoolNotifyMessageSendService.sendMessage(process.getCoachId(), message, SchoolBaseConstants.SCHOOL_NOTIFY_MESSAGE_TYPE_ADMIN, process.getTenantId());
|
||||
} 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, userName, "科目一", 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)
|
||||
@ -423,10 +448,10 @@ public class ProcessServiceImpl extends ServiceImpl<ProcessMapper, Process> impl
|
||||
// 如果是科目四且通过考试,修改学员考试通过状态
|
||||
if (process.getSubject() == 4 && process.getExamStatus().equals("1")) {
|
||||
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, userName, "科目四", process.getExamScore(), "已通过");
|
||||
schoolNotifyMessageSendService.sendMessage(process.getCoachId(), message, SchoolBaseConstants.SCHOOL_NOTIFY_MESSAGE_TYPE_ADMIN, process.getTenantId());
|
||||
} 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, userName, "科目四", process.getExamScore(), "未通过");
|
||||
schoolNotifyMessageSendService.sendMessage(process.getCoachId(), message, SchoolBaseConstants.SCHOOL_NOTIFY_MESSAGE_TYPE_ADMIN, process.getTenantId());
|
||||
}
|
||||
|
||||
@ -530,4 +555,54 @@ public class ProcessServiceImpl extends ServiceImpl<ProcessMapper, Process> impl
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 教练自招自动分配教练
|
||||
*/
|
||||
@Override
|
||||
public void autoAssignCoach(ProcessNewVO request){
|
||||
Long userId = SecurityFrameworkUtils.getLoginUserId();
|
||||
AdminUserRespDTO user = userApi.getUser(userId);
|
||||
String userName = user.getNickname();
|
||||
String mobile = user.getMobile();
|
||||
|
||||
DlDriveSchoolCourseVO dlDriveSchoolCourseVO = courseService.queryDetailById(request.getCourseId());
|
||||
ProcessAddVO processVo = new ProcessAddVO();
|
||||
List<ProcessVO> processList = new ArrayList<>();
|
||||
|
||||
for (int subject = 1; subject <= 4; subject++) {
|
||||
ProcessVO processVO = new ProcessVO();
|
||||
processVO.setSubject(subject);
|
||||
if(subject == 1){
|
||||
processVO.setStatus("1");
|
||||
}else{
|
||||
processVO.setStatus("0");
|
||||
}
|
||||
processVO.setUserId(userId);
|
||||
processVO.setCourseId(dlDriveSchoolCourseVO.getId());
|
||||
processVO.setCourseName(dlDriveSchoolCourseVO.getName());
|
||||
processVO.setCourseType(dlDriveSchoolCourseVO.getType());
|
||||
processVO.setUserName(userName);
|
||||
processVO.setUserMobile(mobile);
|
||||
processVO.setCoachId(request.getCoachId());
|
||||
processVO.setCoachName(request.getCoachName());
|
||||
processVO.setExamStatus(null);
|
||||
|
||||
processList.add(processVO);
|
||||
}
|
||||
|
||||
// 组装ProcessAddVO
|
||||
|
||||
processVo.setProcessList(processList);
|
||||
ProcessAddVO processAddVO = new ProcessAddVO();
|
||||
processAddVO.setProcessList(processList);
|
||||
processAddVO.setOrderId(request.getOrderId());
|
||||
|
||||
// 修改订单状态为已支付
|
||||
schoolCourseOrderService.update(Wrappers.lambdaUpdate(SchoolCourseOrder.class)
|
||||
.eq(SchoolCourseOrder::getId, request.getOrderId())
|
||||
.set(SchoolCourseOrder::getIfAssignmentCoach, SchoolBaseConstants.SCHOOL_COURSE_ORDER_IS_ASSIGN_COACH)
|
||||
.set(SchoolCourseOrder::getPaymentStatus, "2"));
|
||||
this.saveProcess(processAddVO);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,16 +1,22 @@
|
||||
package cn.iocoder.yudao.module.course.service.impl;
|
||||
|
||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import cn.iocoder.yudao.module.course.entity.SchoolCommission;
|
||||
import cn.iocoder.yudao.module.course.mapper.SchoolCommissionMapper;
|
||||
import cn.iocoder.yudao.module.course.service.SchoolCommissionService;
|
||||
import cn.iocoder.yudao.module.course.vo.SchoolCommissionVO;
|
||||
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.exception.ServiceException;
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 提成记录 Service 实现类
|
||||
@ -24,6 +30,9 @@ public class SchoolCommissionServiceImpl extends ServiceImpl<SchoolCommissionMap
|
||||
@Resource
|
||||
private SchoolCommissionMapper schoolCommissionMapper;
|
||||
|
||||
@Resource
|
||||
private AdminUserApi userApi;
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询提成记录
|
||||
@ -38,4 +47,28 @@ public class SchoolCommissionServiceImpl extends ServiceImpl<SchoolCommissionMap
|
||||
public IPage<SchoolCommissionVO> queryPage(Page<SchoolCommissionVO> page, SchoolCommissionVO pageReqVO) {
|
||||
return schoolCommissionMapper.queryPage(pageReqVO,page);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建提成记录
|
||||
*/
|
||||
@Override
|
||||
public boolean createSchoolCommission(SchoolCommissionVO entity) {
|
||||
Long userId = SecurityFrameworkUtils.getLoginUserId();
|
||||
AdminUserRespDTO user = userApi.getUser(userId);
|
||||
String userName = user.getNickname();
|
||||
|
||||
SchoolCommission commission = new SchoolCommission();
|
||||
BeanUtils.copyProperties(entity, commission);
|
||||
|
||||
commission.setCheckId(userId);
|
||||
commission.setCheckName(userName);
|
||||
commission.setCreateTime(LocalDateTime.now());
|
||||
commission.setUpdateTime(LocalDateTime.now());
|
||||
|
||||
if (!this.save(commission)) {
|
||||
throw new RuntimeException("创建提成记录失败");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.course.service.impl;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
|
||||
import cn.iocoder.yudao.module.base.constant.SchoolBaseConstants;
|
||||
import cn.iocoder.yudao.module.base.service.SchoolNotifyMessageSendService;
|
||||
import cn.iocoder.yudao.module.course.entity.Process;
|
||||
@ -12,11 +13,17 @@ import cn.iocoder.yudao.module.course.service.ProcessService;
|
||||
import cn.iocoder.yudao.module.course.service.SchoolCourseOrderService;
|
||||
import cn.iocoder.yudao.module.course.vo.SchoolCommissionVO;
|
||||
import cn.iocoder.yudao.module.course.vo.SchoolCourseOrderVO;
|
||||
import cn.iocoder.yudao.module.system.api.permission.RoleApi;
|
||||
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
||||
import cn.iocoder.yudao.module.system.api.user.dto.UserDTO;
|
||||
import cn.iocoder.yudao.module.system.service.permission.RoleService;
|
||||
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 org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@ -44,6 +51,12 @@ public class SchoolCourseOrderServiceImpl extends ServiceImpl<SchoolCourseOrderM
|
||||
@Autowired
|
||||
private SchoolNotifyMessageSendService schoolNotifyMessageSendService;
|
||||
|
||||
@Resource
|
||||
private AdminUserApi userApi;
|
||||
@Resource
|
||||
@Lazy
|
||||
private RoleApi roleApi;
|
||||
|
||||
@Override
|
||||
public String createSchoolCourseOrder(SchoolCourseOrderVO createReqVO) {
|
||||
// 插入
|
||||
@ -189,6 +202,36 @@ public class SchoolCourseOrderServiceImpl extends ServiceImpl<SchoolCourseOrderM
|
||||
return BeanUtil.copyToList(list, SchoolCourseOrderVO.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 报名之后发送对应消息
|
||||
*/
|
||||
@Override
|
||||
public Boolean sendOrderMessage(String studentName, String courseName, Long coachId) {
|
||||
|
||||
if(coachId != null){
|
||||
// 准备消息内容
|
||||
String message = String.format(SchoolBaseConstants.SCHOOL_NOTIFY_MESSAGE_TEMPLATE_MEMBER_ENROLL, studentName, courseName);
|
||||
|
||||
// 发送消息给教练
|
||||
schoolNotifyMessageSendService.sendMessage(coachId, message, SchoolBaseConstants.SCHOOL_NOTIFY_MESSAGE_TYPE_ADMIN, null);
|
||||
}
|
||||
|
||||
|
||||
// 发送消息给所有办公室人员
|
||||
Long tenantId = TenantContextHolder.getTenantId();
|
||||
List<UserDTO> officeStaffList = roleApi.selectUserListByRoleCode(tenantId, "bgs");
|
||||
|
||||
if (officeStaffList != null && !officeStaffList.isEmpty()) {
|
||||
String officeMessage = String.format(SchoolBaseConstants.SCHOOL_NOTIFY_MESSAGE_TEMPLATE_MEMBER_ENROLL_TO_OFFICE, studentName, courseName);
|
||||
|
||||
for (UserDTO staff : officeStaffList) {
|
||||
schoolNotifyMessageSendService.sendMessage(staff.getId(), officeMessage, SchoolBaseConstants.SCHOOL_NOTIFY_MESSAGE_TYPE_ADMIN, null);
|
||||
}
|
||||
}
|
||||
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
public String generateOrderNumber() {
|
||||
return "ORDER" + UUID.randomUUID().toString().replace("-", "").substring(0, 10);
|
||||
}
|
||||
|
||||
@ -0,0 +1,39 @@
|
||||
package cn.iocoder.yudao.module.course.vo;
|
||||
|
||||
|
||||
import lombok.*;
|
||||
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ProcessNewVO {
|
||||
|
||||
/**
|
||||
* 订单ID
|
||||
*/
|
||||
private String orderId;
|
||||
|
||||
/**
|
||||
* 课程ID
|
||||
*/
|
||||
private String courseId;
|
||||
/**
|
||||
* 课程名称
|
||||
*/
|
||||
private String courseName;
|
||||
/**
|
||||
* 用户(学员)ID
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 教练ID
|
||||
*/
|
||||
private Long coachId;
|
||||
/**
|
||||
* 教练姓名
|
||||
*/
|
||||
private String coachName;
|
||||
}
|
||||
@ -16,6 +16,8 @@ import cn.iocoder.yudao.module.exam.vo.ExamBatchItemNewVO;
|
||||
import cn.iocoder.yudao.module.exam.vo.ExamBatchItemVO;
|
||||
import cn.iocoder.yudao.module.exam.vo.ExamBatchVO;
|
||||
import cn.iocoder.yudao.module.exam.vo.ExamVO;
|
||||
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.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
@ -27,6 +29,7 @@ import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.List;
|
||||
@ -50,6 +53,8 @@ public class ExamBatchItemServiceImpl extends ServiceImpl<ExamBatchItemMapper, E
|
||||
private ExamBatchService examBatchService;
|
||||
@Autowired
|
||||
private SchoolNotifyMessageSendService schoolNotifyMessageSendService;
|
||||
@Resource
|
||||
private AdminUserApi userApi;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
@ -235,6 +240,8 @@ public class ExamBatchItemServiceImpl extends ServiceImpl<ExamBatchItemMapper, E
|
||||
}
|
||||
//教练ID
|
||||
Long userId = SecurityFrameworkUtils.getLoginUserId();
|
||||
AdminUserRespDTO user = userApi.getUser(userId);
|
||||
String userName = user.getNickname();
|
||||
ExamBatchItem updateItem = this.getById(examBatchVO.getId());
|
||||
updateItem.setFraction(examBatchVO.getFraction());
|
||||
updateItem.setImages(examBatchVO.getImages());
|
||||
@ -262,7 +269,7 @@ public class ExamBatchItemServiceImpl extends ServiceImpl<ExamBatchItemMapper, E
|
||||
if (examBatchVO.getIfPass()) {
|
||||
process.setStatus("2");
|
||||
processService.updateById(process);
|
||||
String message = String.format(SchoolBaseConstants.SCHOOL_NOTIFY_MESSAGE_TEMPLATE_MEMBER_EXAM_SCORE, examBatchVO.getUserName(), subject, examBatchVO.getFraction(), "已通过");
|
||||
String message = String.format(SchoolBaseConstants.SCHOOL_NOTIFY_MESSAGE_TEMPLATE_MEMBER_EXAM_SCORE, userName, subject, examBatchVO.getFraction(), "已通过");
|
||||
schoolNotifyMessageSendService.sendMessage(examBatchVO.getCoachId(), message, SchoolBaseConstants.SCHOOL_NOTIFY_MESSAGE_TYPE_ADMIN, examBatchVO.getTenantId());
|
||||
|
||||
//考试通过
|
||||
@ -289,7 +296,7 @@ public class ExamBatchItemServiceImpl extends ServiceImpl<ExamBatchItemMapper, E
|
||||
process.setExamNum(process.getExamNum() + 1);
|
||||
processService.updateById(process);
|
||||
// 发送消息给教练
|
||||
String message = String.format(SchoolBaseConstants.SCHOOL_NOTIFY_MESSAGE_TEMPLATE_MEMBER_EXAM_SCORE, examBatchVO.getUserName(), subject, examBatchVO.getFraction(), "未通过");
|
||||
String message = String.format(SchoolBaseConstants.SCHOOL_NOTIFY_MESSAGE_TEMPLATE_MEMBER_EXAM_SCORE, userName, subject, examBatchVO.getFraction(), "未通过");
|
||||
schoolNotifyMessageSendService.sendMessage(examBatchVO.getCoachId(), message, SchoolBaseConstants.SCHOOL_NOTIFY_MESSAGE_TYPE_ADMIN, examBatchVO.getTenantId());
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,80 @@
|
||||
package cn.iocoder.yudao.module.jx.controller.admin;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.base.entity.DriveSchoolAddress;
|
||||
import cn.iocoder.yudao.module.base.vo.DlDriveSchoolStudentVO;
|
||||
import cn.iocoder.yudao.module.jx.core.controller.BaseController;
|
||||
import cn.iocoder.yudao.module.jx.domain.DriveSchoolGuide;
|
||||
import cn.iocoder.yudao.module.jx.service.DriveSchoolGuideService;
|
||||
import cn.iocoder.yudao.module.jx.vo.DlDriveSchoolGuidePageReqVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
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 javax.annotation.security.PermitAll;
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - 业务办理指南")
|
||||
@RestController
|
||||
@RequestMapping("/jx/driveSchool/guide")
|
||||
@Validated
|
||||
public class DriveSchoolGuideController extends BaseController{
|
||||
|
||||
@Resource
|
||||
private DriveSchoolGuideService driveSchoolGuideService;
|
||||
|
||||
@PostMapping
|
||||
@Operation(summary = "新增业务办理指南")
|
||||
@PermitAll
|
||||
public CommonResult<String> create(@Valid @RequestBody DriveSchoolGuide driveSchoolGuide) {
|
||||
return success(driveSchoolGuideService.save(driveSchoolGuide));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Operation(summary = "更新业务办理指南")
|
||||
@PermitAll
|
||||
public CommonResult<Boolean> update(@Valid @RequestBody DriveSchoolGuide driveSchoolGuide) {
|
||||
return success(driveSchoolGuideService.updateById(driveSchoolGuide));
|
||||
}
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
@Operation(summary = "删除业务办理指南")
|
||||
@PermitAll
|
||||
public CommonResult<?> delete(@PathVariable("id") String id) {
|
||||
return success(driveSchoolGuideService.removeById(id));
|
||||
}
|
||||
|
||||
@GetMapping("/{id}")
|
||||
@Operation(summary = "获取业务办理指南详情")
|
||||
@PermitAll
|
||||
public CommonResult<DriveSchoolGuide> getById(@PathVariable("id") String id) {
|
||||
return success(driveSchoolGuideService.getById(id));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "分页查询业务办理指南")
|
||||
@PermitAll
|
||||
public CommonResult<?> page(
|
||||
@Valid DriveSchoolGuide pageReqVO,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
Page<DriveSchoolGuide> page = new Page<>(pageNo, pageSize);
|
||||
return success(driveSchoolGuideService.page(page, Wrappers.<DriveSchoolGuide>lambdaQuery()));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获取所有业务办理指南")
|
||||
@PermitAll
|
||||
public CommonResult<List<DriveSchoolGuide>> list() {
|
||||
return success(driveSchoolGuideService.list());
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
package cn.iocoder.yudao.module.jx.controller.app;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
||||
import cn.iocoder.yudao.module.jx.core.controller.BaseController;
|
||||
import cn.iocoder.yudao.module.jx.domain.DriveSchoolGuide;
|
||||
import cn.iocoder.yudao.module.jx.service.DriveSchoolGuideService;
|
||||
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.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.annotation.security.PermitAll;
|
||||
import java.util.List;
|
||||
|
||||
@Tag(name = "小程序 - 业务办理指南")
|
||||
@RestController
|
||||
@RequestMapping("/jx/driveSchool/smallProgram/guide")
|
||||
@Validated
|
||||
public class AppDriveSchoolGuideController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private DriveSchoolGuideService driveSchoolGuideService;
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "根据字段值查询业务办理指南")
|
||||
@PermitAll
|
||||
@TenantIgnore
|
||||
public CommonResult<List<DriveSchoolGuide>> listByField(
|
||||
@RequestParam(required = false) String tenantId
|
||||
) {
|
||||
return success(driveSchoolGuideService.listByTenantId(tenantId));
|
||||
}
|
||||
}
|
||||
@ -55,7 +55,7 @@ public class NewSmallProgramJxOrderController {
|
||||
|
||||
@PostMapping("/offLinePay")
|
||||
@TenantIgnore
|
||||
public CommonResult offLinePay(@RequestBody SchoolCourseOrder schoolCourseOrder) {
|
||||
public CommonResult<String> offLinePay(@RequestBody SchoolCourseOrder schoolCourseOrder) {
|
||||
SchoolCourseOrderVO schoolCourseOrderVO = BeanUtils.toBean(schoolCourseOrder, SchoolCourseOrderVO.class);
|
||||
schoolCourseOrderVO.setPaymentStatus("0");
|
||||
boolean exists = false;
|
||||
@ -82,8 +82,8 @@ public class NewSmallProgramJxOrderController {
|
||||
retryCount++;
|
||||
} while (exists);
|
||||
schoolCourseOrderVO.setOrderNo(orderNo);
|
||||
schoolCourseOrderService.createSchoolCourseOrder(schoolCourseOrderVO);
|
||||
return CommonResult.success("ok");
|
||||
String orderId = schoolCourseOrderService.createSchoolCourseOrder(schoolCourseOrderVO);
|
||||
return CommonResult.success(orderId);
|
||||
}
|
||||
|
||||
@PostMapping("/onLinePay")
|
||||
|
||||
@ -0,0 +1,34 @@
|
||||
package cn.iocoder.yudao.module.jx.domain;
|
||||
|
||||
import cn.iocoder.yudao.annotation.Excel;
|
||||
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
|
||||
import cn.iocoder.yudao.module.jx.core.page.TenantBaDO;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@TableName("drive_school_guide")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DriveSchoolGuide extends TenantBaseDO {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键id */
|
||||
private Long id;
|
||||
|
||||
/** 标题 */
|
||||
private String title;
|
||||
|
||||
/** 业务办理指南 */
|
||||
private String guide;
|
||||
|
||||
/** 短信提醒内容 */
|
||||
private String msgText;
|
||||
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package cn.iocoder.yudao.module.jx.mapper;
|
||||
|
||||
import cn.iocoder.yudao.module.jx.domain.DriveSchoolDeduct;
|
||||
import cn.iocoder.yudao.module.jx.domain.DriveSchoolGuide;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 业务办理指南
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-04-01
|
||||
*/
|
||||
@Mapper
|
||||
public interface DriveSchoolGuideMapper extends BaseMapper<DriveSchoolGuide> {
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
package cn.iocoder.yudao.module.jx.service;
|
||||
|
||||
import cn.iocoder.yudao.module.base.entity.DlDriveSchoolStudent;
|
||||
import cn.iocoder.yudao.module.base.vo.DlDriveSchoolStaffVO;
|
||||
import cn.iocoder.yudao.module.base.vo.DlDriveSchoolStudentVO;
|
||||
import cn.iocoder.yudao.module.base.vo.StudentCountVO;
|
||||
import cn.iocoder.yudao.module.jx.domain.DriveSchoolGuide;
|
||||
import cn.iocoder.yudao.module.jx.vo.DlDriveSchoolGuidePageReqVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 业务办理指南
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-04-01
|
||||
*/
|
||||
public interface DriveSchoolGuideService extends IService<DriveSchoolGuide> {
|
||||
|
||||
/**
|
||||
* 根据租户id查询业务办理指南
|
||||
*/
|
||||
List<DriveSchoolGuide> listByTenantId(String tenantId);
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
package cn.iocoder.yudao.module.jx.service.impl;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.exception.ServiceException;
|
||||
import cn.iocoder.yudao.module.jx.domain.DriveSchoolGuide;
|
||||
import cn.iocoder.yudao.module.jx.mapper.DriveSchoolGuideMapper;
|
||||
import cn.iocoder.yudao.module.jx.service.DriveSchoolGuideService;
|
||||
import cn.iocoder.yudao.module.jx.vo.DlDriveSchoolGuidePageReqVO;
|
||||
import cn.iocoder.yudao.util.StringUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 业务办理指南
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-04-01
|
||||
*/
|
||||
@Service
|
||||
public class DriveSchoolGuideServiceImpl extends ServiceImpl<DriveSchoolGuideMapper, DriveSchoolGuide> implements DriveSchoolGuideService {
|
||||
|
||||
|
||||
@Override
|
||||
public List<DriveSchoolGuide> listByTenantId(String tenantId) {
|
||||
LambdaQueryWrapper<DriveSchoolGuide> queryWrapper = new LambdaQueryWrapper<>();
|
||||
if (StringUtils.isNotBlank(tenantId)) {
|
||||
queryWrapper.eq(DriveSchoolGuide::getTenantId, tenantId);
|
||||
}
|
||||
return this.list(queryWrapper);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package cn.iocoder.yudao.module.jx.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.jx.domain.DriveSchoolGuide;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
@Schema(description = "管理后台 - 驾校业务办理指南分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class DlDriveSchoolGuidePageReqVO extends DriveSchoolGuide {
|
||||
}
|
||||
@ -11,9 +11,11 @@
|
||||
|
||||
<select id="queryListPage" resultType="cn.iocoder.yudao.module.base.vo.DlDriveSchoolStudentVO">
|
||||
SELECT
|
||||
main.*
|
||||
main.*,
|
||||
dsco.coach_user_name AS coachName
|
||||
FROM
|
||||
drive_school_student main
|
||||
LEFT JOIN drive_school_course_order dsco ON main.user_id = dsco.user_id
|
||||
<where>
|
||||
main.deleted = 0
|
||||
<if test="entity.name != null and entity.name != ''">and main.name like concat('%', #{entity.name}, '%')</if>
|
||||
@ -321,4 +323,4 @@
|
||||
<select id="indexCusStudentList" resultType="cn.iocoder.yudao.module.base.vo.StudentCountVO">
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user