From a56b5519758d01c9fc16b9380ac479a2e79c65f0 Mon Sep 17 00:00:00 2001 From: Lx <935448346@qq.com> Date: Thu, 10 Jul 2025 17:39:11 +0800 Subject: [PATCH 1/4] 0710 --- .../admin/DlDriveSchoolCoachController.java | 5 ++ .../service/DlDriveSchoolCoachService.java | 1 + .../impl/DlDriveSchoolCoachServiceImpl.java | 71 ++++++++++++++++++- .../base/vo/BusinessRecordExportCountVO.java | 15 ++++ .../base/vo/BusinessRecordExportVO.java | 2 + .../impl/SchoolCourseOrderServiceImpl.java | 4 +- .../module/course/vo/CommissionExportVO.java | 1 + .../module/course/vo/CourseOrderExportVO.java | 17 ++++- .../mapper/base/DlDriveSchoolCoachMapper.xml | 3 +- .../mapper/course/SchoolCommissionMapper.xml | 2 +- .../mapper/course/SchoolCourseOrderMapper.xml | 23 +++++- 11 files changed, 134 insertions(+), 10 deletions(-) create mode 100644 dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/vo/BusinessRecordExportCountVO.java diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/controller/admin/DlDriveSchoolCoachController.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/controller/admin/DlDriveSchoolCoachController.java index 496c8271..bdfd0471 100644 --- a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/controller/admin/DlDriveSchoolCoachController.java +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/controller/admin/DlDriveSchoolCoachController.java @@ -323,6 +323,11 @@ public class DlDriveSchoolCoachController { return success(dlDriveSchoolCoachService.getBusinessRecordExportData(exportVO, page)); } + @GetMapping("/getBusinessRecordExportCount") + public CommonResult getBusinessRecordExportCount(BusinessRecordExportVO exportVO) { + return success(dlDriveSchoolCoachService.getBusinessRecordExportCount(exportVO)); + } + /** * 导出 * @param exportVO diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/service/DlDriveSchoolCoachService.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/service/DlDriveSchoolCoachService.java index 7d660879..bec10b9d 100644 --- a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/service/DlDriveSchoolCoachService.java +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/service/DlDriveSchoolCoachService.java @@ -162,6 +162,7 @@ public interface DlDriveSchoolCoachService extends IService * 获取导出数据列表 */ IPage getBusinessRecordExportData(BusinessRecordExportVO reqVO, Page page); + BusinessRecordExportCountVO getBusinessRecordExportCount(BusinessRecordExportVO reqVO); /** * 导出的三种形式 * @param exportVO diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/service/impl/DlDriveSchoolCoachServiceImpl.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/service/impl/DlDriveSchoolCoachServiceImpl.java index eba4455d..03e36120 100644 --- a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/service/impl/DlDriveSchoolCoachServiceImpl.java +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/service/impl/DlDriveSchoolCoachServiceImpl.java @@ -1226,6 +1226,32 @@ public class DlDriveSchoolCoachServiceImpl extends ServiceImpl page = new Page<>(1, Integer.MAX_VALUE); +// reqVO.setIsSign(1); + reqVO.setIfEnd("0"); + + IPage allData = this.getBusinessRecordExportData(reqVO, page); + List records = allData.getRecords(); + + BusinessRecordExportCountVO result = new BusinessRecordExportCountVO(); + + result.setTotalPeople(records.size()); + + BigDecimal totalAmount = records.stream() + .map(record -> record.getReserveMoney() != null ? record.getReserveMoney() : BigDecimal.ZERO) + .reduce(BigDecimal.ZERO, BigDecimal::add); + + BigDecimal totalSubsidy = records.stream() + .map(record -> record.getSubsidy() != null ? record.getSubsidy() : BigDecimal.ZERO) + .reduce(BigDecimal.ZERO, BigDecimal::add); + result.setTotalAmount(totalAmount); + result.setTotalSubsidy(totalSubsidy); + + return result; + } + /** * 导出的三种形式 */ @@ -1234,7 +1260,20 @@ public class DlDriveSchoolCoachServiceImpl extends ServiceImpl page = new Page<>(exportVO.getPageNo(), exportVO.getPageSize()); IPage result = dlDriveSchoolCoachMapper.getBusinessRecordExportData(exportVO, page); - return result.getRecords(); + List records = result.getRecords(); + + // 计算提成 + for (BusinessRecordExportVO record : records) { + BigDecimal deduct = BigDecimal.ZERO; + if(record.getScheme() != null){ + deduct = schemeService.getSchemeById(record.getScheme(), 0); + }else{ + deduct = schemeService.getCourseDeduct(record.getCourseId(), 0); + } + record.setSubsidy(deduct); + } + + return records; } @Override @@ -1242,7 +1281,20 @@ public class DlDriveSchoolCoachServiceImpl extends ServiceImpl page = new Page<>(1, Integer.MAX_VALUE); IPage result = dlDriveSchoolCoachMapper.getBusinessRecordExportData(exportVO, page); - return result.getRecords(); + List records = result.getRecords(); + + // 计算提成 + for (BusinessRecordExportVO record : records) { + BigDecimal deduct = BigDecimal.ZERO; + if(record.getScheme() != null){ + deduct = schemeService.getSchemeById(record.getScheme(), 0); + }else{ + deduct = schemeService.getCourseDeduct(record.getCourseId(), 0); + } + record.setSubsidy(deduct); + } + + return records; } @Override @@ -1253,7 +1305,20 @@ public class DlDriveSchoolCoachServiceImpl extends ServiceImpl page = new Page<>(i, exportVO.getPageSize()); IPage result = dlDriveSchoolCoachMapper.getBusinessRecordExportData(exportVO, page); - allData.addAll(result.getRecords()); + List records = result.getRecords(); + + // 计算提成 + for (BusinessRecordExportVO record : records) { + BigDecimal deduct = BigDecimal.ZERO; + if(record.getScheme() != null){ + deduct = schemeService.getSchemeById(record.getScheme(), 0); + }else{ + deduct = schemeService.getCourseDeduct(record.getCourseId(), 0); + } + record.setSubsidy(deduct); + } + + allData.addAll(records); if (i >= result.getPages()) { break; diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/vo/BusinessRecordExportCountVO.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/vo/BusinessRecordExportCountVO.java new file mode 100644 index 00000000..3438cf7a --- /dev/null +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/vo/BusinessRecordExportCountVO.java @@ -0,0 +1,15 @@ +package cn.iocoder.yudao.module.base.vo; + +import lombok.Data; + +import java.math.BigDecimal; + +@Data +public class BusinessRecordExportCountVO { + + private BigDecimal totalAmount; + + private BigDecimal totalSubsidy; + + private Integer totalPeople; +} diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/vo/BusinessRecordExportVO.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/vo/BusinessRecordExportVO.java index 95ac24c6..869e3f25 100644 --- a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/vo/BusinessRecordExportVO.java +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/vo/BusinessRecordExportVO.java @@ -46,6 +46,8 @@ public class BusinessRecordExportVO { @ExcelIgnore private Integer isSign; + @ExcelIgnore + private String ifEnd; @ExcelProperty(value = "面签时间", index = 9) private String signTimeStr; diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/course/service/impl/SchoolCourseOrderServiceImpl.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/course/service/impl/SchoolCourseOrderServiceImpl.java index 9e5c138b..68132c97 100644 --- a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/course/service/impl/SchoolCourseOrderServiceImpl.java +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/course/service/impl/SchoolCourseOrderServiceImpl.java @@ -328,8 +328,8 @@ public class SchoolCourseOrderServiceImpl extends ServiceImpl diff --git a/dl-module-jx/src/main/resources/mapper/course/SchoolCommissionMapper.xml b/dl-module-jx/src/main/resources/mapper/course/SchoolCommissionMapper.xml index 447195b2..02d816c0 100644 --- a/dl-module-jx/src/main/resources/mapper/course/SchoolCommissionMapper.xml +++ b/dl-module-jx/src/main/resources/mapper/course/SchoolCommissionMapper.xml @@ -166,7 +166,7 @@ - order BY dsc.create_time DESC + ORDER BY dsc.create_time DESC @@ -312,6 +326,7 @@ dsco.cashier_confirm_time, dss.source, dsco.payment_account, + dsco.sign_time, MAX(CASE WHEN dsp.subject = 2 THEN COALESCE(dsp.coach_name, '') END) AS subject2CoachName, MAX(CASE WHEN dscd.course_subject = 2 THEN COALESCE(dscd.deduct, 0) END) AS subject2Deduct, MAX(CASE WHEN dsp.subject = 3 THEN COALESCE(dsp.coach_name, '') END) AS subject3CoachName, @@ -406,13 +421,19 @@ dsco.user_no, dsco.user_phone, dsco.create_time, + dsco.is_sign, dsco.pay_fees_time, dsco.reserve_money, dsco.course_name, dsco.course_type, dsco.order_remark, dsco.cashier_confirm, - dsco.cashier_confirm_remark + dsco.cashier_confirm_remark, + dsco.cashier_confirm_time, + dss.source, + dsco.payment_account, + dsco.sign_time + ORDER BY dsco.create_time DESC, dsco.user_id From 2dd26ebb38ec8a2496ab548319a59f3bbe6e0025 Mon Sep 17 00:00:00 2001 From: Lx <935448346@qq.com> Date: Fri, 11 Jul 2025 16:44:25 +0800 Subject: [PATCH 2/4] 0711 --- .../base/constant/SchoolBaseConstants.java | 5 +++ .../course/entity/SchoolCourseOrder.java | 11 ++++++ .../service/impl/ProcessServiceImpl.java | 27 +++++++++++++- .../module/course/vo/CourseOrderExportVO.java | 37 ++++++++++++------- .../course/vo/CourseOrderStatisticsVO.java | 6 +++ .../yudao/module/course/vo/ProcessVO.java | 25 +++++++++++++ .../module/course/vo/SchoolCourseOrderVO.java | 3 ++ .../controller/admin/TrainController.java | 11 ++++++ .../module/train/mapper/TrainMapper.java | 5 ++- .../module/train/service/TrainService.java | 5 +++ .../train/service/impl/TrainServiceImpl.java | 21 ++++++++++- .../module/train/vo/NoClockInRemindVO.java | 29 +++++++++++++++ .../mapper/course/SchoolCourseOrderMapper.xml | 35 ++++++++++++++++++ .../resources/mapper/train/TrainMapper.xml | 16 ++++++++ .../yudao/server/YudaoServerApplication.java | 2 + 15 files changed, 221 insertions(+), 17 deletions(-) create mode 100644 dl-module-jx/src/main/java/cn/iocoder/yudao/module/train/vo/NoClockInRemindVO.java diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/constant/SchoolBaseConstants.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/constant/SchoolBaseConstants.java index b09a2a04..4f94d5fd 100644 --- a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/constant/SchoolBaseConstants.java +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/base/constant/SchoolBaseConstants.java @@ -165,4 +165,9 @@ public interface SchoolBaseConstants { */ public static final String SCHOOL_NOTIFY_MESSAGE_TEMPLATE_MEMBER_AUDIT_PASS = "驾校教练 %s 的学员 %s ,身份证号:%s,课程:%s,科目 %s 的提成审核已通过,请查看!"; + /** + * 提醒教练未打卡学员信息 + */ + public static final String SCHOOL_NOTIFY_MESSAGE_TEMPLATE_MEMBER_NOT_ATTENDANCE = "您有 %s 位学员未进行离场打卡 ,学员为: %s ,不要忘记离场打卡哟!"; + } diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/course/entity/SchoolCourseOrder.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/course/entity/SchoolCourseOrder.java index 18ee94fb..4cb0037f 100644 --- a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/course/entity/SchoolCourseOrder.java +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/course/entity/SchoolCourseOrder.java @@ -174,5 +174,16 @@ public class SchoolCourseOrder extends TenantBaseDO { */ private String paymentAccount; + /** + * 优惠金额 + */ + private BigDecimal discount; + + + /** + * 实付金额 + */ + private BigDecimal actualPayment; + } diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/course/service/impl/ProcessServiceImpl.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/course/service/impl/ProcessServiceImpl.java index c91de88c..6ec6cd86 100644 --- a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/course/service/impl/ProcessServiceImpl.java +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/course/service/impl/ProcessServiceImpl.java @@ -836,8 +836,12 @@ public class ProcessServiceImpl extends ServiceImpl impl List courseByInfo = schoolCourseOrderService.getCourseByInfo(userId, courseId); BigDecimal studentPay = BigDecimal.ZERO; BigDecimal studentRemainingPay = BigDecimal.ZERO; + BigDecimal discount = BigDecimal.ZERO; + BigDecimal actualPayment = BigDecimal.ZERO; String studentIdCard = null; String cashierConfirm = null; + String orderRemark = null; + String cashierConfirmRemark = null; if (!courseByInfo.isEmpty()) { studentPay = courseByInfo.get(0).getReserveMoney() != null ? courseByInfo.get(0).getReserveMoney() : BigDecimal.ZERO; @@ -847,13 +851,34 @@ public class ProcessServiceImpl extends ServiceImpl impl courseByInfo.get(0).getUserNo() : null; cashierConfirm = courseByInfo.get(0).getCashierConfirm()!= null? courseByInfo.get(0).getCashierConfirm() : null; - + orderRemark = courseByInfo.get(0).getOrderRemark()!= null? + courseByInfo.get(0).getOrderRemark() : null; + discount = courseByInfo.get(0).getDiscount() != null ? + courseByInfo.get(0).getDiscount() : BigDecimal.ZERO; + actualPayment = courseByInfo.get(0).getActualPayment() != null ? + courseByInfo.get(0).getActualPayment() : BigDecimal.ZERO; + cashierConfirmRemark = courseByInfo.get(0).getCashierConfirmRemark()!= null? + courseByInfo.get(0).getCashierConfirmRemark() : null; } processVO.setCoachCommission(deduct); processVO.setStudentPay(studentPay); + processVO.setDiscount(discount); + processVO.setActualPayment(actualPayment); processVO.setStudentRemainingPay(studentRemainingPay); processVO.setStudentIdCard(studentIdCard); processVO.setCashierConfirm(cashierConfirm); + processVO.setOrderRemark(orderRemark); + processVO.setCashierConfirmRemark(cashierConfirmRemark); + + DlDriveSchoolStudent studentByUserId = dlDriveSchoolStudentService.getStudentByUserId(userId); + if(studentByUserId != null){ + if(studentByUserId.getChannel() != null){ + processVO.setChannel(studentByUserId.getChannel()); + } + if(studentByUserId.getSource() != null){ + processVO.setSource(studentByUserId.getSource()); + } + } List list = this.lambdaQuery() .eq(Process::getCoachId, processVO.getCoachId()) .eq(Process::getCourseId, processVO.getCourseId()) diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/course/vo/CourseOrderExportVO.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/course/vo/CourseOrderExportVO.java index 155e0500..077f2e9a 100644 --- a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/course/vo/CourseOrderExportVO.java +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/course/vo/CourseOrderExportVO.java @@ -55,14 +55,23 @@ public class CourseOrderExportVO { @ExcelProperty(value = "课程类型", index = 5) private String courseType; - @ExcelProperty(value = "缴费金额", index = 6) + @ExcelProperty(value = "课程金额", index = 6) private BigDecimal reserveMoney; + @ExcelProperty(value = "优惠金额", index = 7) + private BigDecimal discount; + + @ExcelIgnore + private String discountIndex; + + @ExcelProperty(value = "实付金额", index = 8) + private BigDecimal actualPayment; + /*@ExcelProperty(value = "缴费时间", index = 8) @DateTimeFormat("yyyy-MM-dd")*/ @ExcelIgnore private Date payFeesTime; - @ExcelProperty(value = "缴费时间", index = 7) + @ExcelProperty(value = "缴费时间", index = 9) private String payFeesTimeStr; public void setPayFeesTime(Date payFeesTime) { @@ -75,23 +84,23 @@ public class CourseOrderExportVO { @ExcelIgnore private String source; - @ExcelProperty(value = "渠道", index = 8) + @ExcelProperty(value = "渠道", index = 10) private String sourceStr; - @ExcelProperty(value = "订单备注", index = 9) + @ExcelProperty(value = "订单备注", index = 11) private String orderRemark; // @ExcelProperty(value = "是否已面签", index = 13) @ExcelIgnore private Integer isSign; - @ExcelProperty(value = "是否已面签", index = 10) + @ExcelProperty(value = "是否已面签", index = 12) private String isSignDisplay; @ExcelIgnore private LocalDateTime signTime; - @ExcelProperty(value = "面签时间", index = 11) + @ExcelProperty(value = "面签时间", index = 13) private String signTimeStr; public void setSignTime(LocalDateTime signTime) { @@ -103,22 +112,22 @@ public class CourseOrderExportVO { @ExcelIgnore private Long coachId; - @ExcelProperty(value = "科目二教练", index = 12) + @ExcelProperty(value = "科目二教练", index = 14) private String subject2CoachName; - @ExcelProperty(value = "科目二提成(预提)", index = 13) + @ExcelProperty(value = "科目二提成(预提)", index = 15) private String subject2Deduct; - @ExcelProperty(value = "科目三教练", index = 14) + @ExcelProperty(value = "科目三教练", index = 16) private String subject3CoachName; - @ExcelProperty(value = "科目三提成(预提)", index = 15) + @ExcelProperty(value = "科目三提成(预提)", index = 17) private String subject3Deduct; - @ExcelProperty(value = "出纳是否确认收款", index = 16) + @ExcelProperty(value = "出纳是否确认收款", index = 18) private String cashierConfirmDisplay; - @ExcelProperty(value = "收款账号", index = 17) + @ExcelProperty(value = "收款账号", index = 19) private String paymentAccount; @ExcelIgnore private String cashierConfirm; @@ -127,7 +136,7 @@ public class CourseOrderExportVO { @ExcelIgnore private Date cashierConfirmTime; - @ExcelProperty(value = "出纳确认时间", index = 18) + @ExcelProperty(value = "出纳确认时间", index = 20) private String cashierConfirmTimeStr; public void setCashierConfirmTime(Date cashierConfirmTime) { @@ -137,7 +146,7 @@ public class CourseOrderExportVO { } } - @ExcelProperty(value = "出纳备注", index = 19) + @ExcelProperty(value = "出纳备注", index = 21) private String cashierConfirmRemark; /** diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/course/vo/CourseOrderStatisticsVO.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/course/vo/CourseOrderStatisticsVO.java index 77d8d8b1..3cbaba54 100644 --- a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/course/vo/CourseOrderStatisticsVO.java +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/course/vo/CourseOrderStatisticsVO.java @@ -12,6 +12,12 @@ public class CourseOrderStatisticsVO { /** 招生金额总和 */ private BigDecimal totalAmount; + /** 优惠总金额 */ + private BigDecimal totalDiscount; + + /** 实付总金额 */ + private BigDecimal totalActualPayment; + /** 科目二提成金额总和 */ private BigDecimal subject2DeductTotal; diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/course/vo/ProcessVO.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/course/vo/ProcessVO.java index 15687a4a..25103945 100644 --- a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/course/vo/ProcessVO.java +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/course/vo/ProcessVO.java @@ -59,4 +59,29 @@ public class ProcessVO extends Process { * 考试结束时间 */ private String examEndTime; + + /** + * 订单备注 + */ + private String orderRemark; + + /** + * 来源 + */ + private String channel; + + /** + * 优惠金额 + */ + private BigDecimal discount; + + /** + * 实付金额 + */ + private BigDecimal actualPayment; + + /** + * 出纳备注 + */ + private String cashierConfirmRemark; } diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/course/vo/SchoolCourseOrderVO.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/course/vo/SchoolCourseOrderVO.java index 3c8c9f6c..8c68f2b8 100644 --- a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/course/vo/SchoolCourseOrderVO.java +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/course/vo/SchoolCourseOrderVO.java @@ -41,4 +41,7 @@ public class SchoolCourseOrderVO extends SchoolCourseOrder { /** 总金额 */ private Double totalPrice; + + /** 优惠筛选 */ + private String discountIndex; } diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/train/controller/admin/TrainController.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/train/controller/admin/TrainController.java index 83dd2bd5..c81a4ba3 100644 --- a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/train/controller/admin/TrainController.java +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/train/controller/admin/TrainController.java @@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.train.controller.admin; import cn.hutool.core.date.DateUtil; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; +import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore; import cn.iocoder.yudao.module.base.entity.DlDriveSchoolStudent; import cn.iocoder.yudao.module.base.mapper.DlDriveSchoolStudentMapper; import cn.iocoder.yudao.module.base.vo.DlDriveSchoolStudentVO; @@ -18,6 +19,7 @@ import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; import org.apache.commons.lang3.StringUtils; +import org.springframework.scheduling.annotation.Scheduled; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -180,4 +182,13 @@ public class TrainController { return success(carMapper.selectTrainStudent(coachId,subject, startTimeStr,endTimeStr,searchValue,courseType)); } + + /** + * 定时任务提醒教练未进行离场打卡学员信息 + */ + @TenantIgnore + @Scheduled(cron = "0 0 18 * * ?") + public void noClockInRemind() { + trainService.noClockInRemind(); + } } diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/train/mapper/TrainMapper.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/train/mapper/TrainMapper.java index 5bbc46d5..8b4e1287 100644 --- a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/train/mapper/TrainMapper.java +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/train/mapper/TrainMapper.java @@ -1,6 +1,7 @@ package cn.iocoder.yudao.module.train.mapper; import cn.iocoder.yudao.module.train.entity.Train; +import cn.iocoder.yudao.module.train.vo.NoClockInRemindVO; import cn.iocoder.yudao.module.train.vo.TrainVO; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -25,4 +26,6 @@ public interface TrainMapper extends BaseMapper { IPage queryTrainListPage(@Param("entity") TrainVO pageReqVO, @Param("page") Page page); List listJoinBatchByIds(@Param("trainIds") List trainIds); -} \ No newline at end of file + + List noClockInRemind(); +} diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/train/service/TrainService.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/train/service/TrainService.java index 3865afce..0bb91444 100644 --- a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/train/service/TrainService.java +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/train/service/TrainService.java @@ -84,4 +84,9 @@ public interface TrainService extends IService { * @return */ List listJoinBatchByIds(List trainIds); + + /** + * 提醒教练未打卡学员信息 + */ + void noClockInRemind(); } diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/train/service/impl/TrainServiceImpl.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/train/service/impl/TrainServiceImpl.java index b5bb0273..c6b95749 100644 --- a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/train/service/impl/TrainServiceImpl.java +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/train/service/impl/TrainServiceImpl.java @@ -10,6 +10,7 @@ import cn.iocoder.yudao.module.course.service.ProcessService; import cn.iocoder.yudao.module.train.entity.Train; import cn.iocoder.yudao.module.train.mapper.TrainMapper; import cn.iocoder.yudao.module.train.service.TrainService; +import cn.iocoder.yudao.module.train.vo.NoClockInRemindVO; import cn.iocoder.yudao.module.train.vo.TrainVO; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -165,4 +166,22 @@ public class TrainServiceImpl extends ServiceImpl implements if (CollUtil.isEmpty(trainIds)) return null; return trainMapper.listJoinBatchByIds(trainIds); } -} \ No newline at end of file + + /** + * 提醒教练未打卡学员信息 + */ + @Override + public void noClockInRemind() { + List noClockInRemindVOList = trainMapper.noClockInRemind(); + for (NoClockInRemindVO noClockInRemindVO : noClockInRemindVOList) { + Long coachId = noClockInRemindVO.getCoachId(); + String studentCount = noClockInRemindVO.getStudentCount(); + String studentNames = noClockInRemindVO.getStudentNames(); + Long tenantId = noClockInRemindVO.getTenantId(); + String message = String.format(SchoolBaseConstants.SCHOOL_NOTIFY_MESSAGE_TEMPLATE_MEMBER_NOT_ATTENDANCE, studentCount, studentNames); + schoolNotifyMessageSendService.sendMessage(coachId, message, SchoolBaseConstants.SCHOOL_NOTIFY_MESSAGE_TYPE_ADMIN, tenantId); + } + } + + +} diff --git a/dl-module-jx/src/main/java/cn/iocoder/yudao/module/train/vo/NoClockInRemindVO.java b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/train/vo/NoClockInRemindVO.java new file mode 100644 index 00000000..85319595 --- /dev/null +++ b/dl-module-jx/src/main/java/cn/iocoder/yudao/module/train/vo/NoClockInRemindVO.java @@ -0,0 +1,29 @@ +package cn.iocoder.yudao.module.train.vo; + +import lombok.Data; + +@Data +public class NoClockInRemindVO { + + /** + * 教练id + */ + private Long coachId; + + /** + * 教练姓名 + */ + private String coachName; + + /** + * 学员数量 + */ + private String studentCount; + + /** + * 全部学员名称 + */ + private String studentNames; + + private Long tenantId; +} diff --git a/dl-module-jx/src/main/resources/mapper/course/SchoolCourseOrderMapper.xml b/dl-module-jx/src/main/resources/mapper/course/SchoolCourseOrderMapper.xml index f5cec7ad..3fd4db68 100644 --- a/dl-module-jx/src/main/resources/mapper/course/SchoolCourseOrderMapper.xml +++ b/dl-module-jx/src/main/resources/mapper/course/SchoolCourseOrderMapper.xml @@ -50,6 +50,17 @@ + + + + AND main.discount > 0 + + + AND main.discount = 0 or main.discount is null + + + + order by main.create_time desc @@ -327,6 +338,8 @@ dss.source, dsco.payment_account, dsco.sign_time, + dsco.discount, + dsco.actual_payment, MAX(CASE WHEN dsp.subject = 2 THEN COALESCE(dsp.coach_name, '') END) AS subject2CoachName, MAX(CASE WHEN dscd.course_subject = 2 THEN COALESCE(dscd.deduct, 0) END) AS subject2Deduct, MAX(CASE WHEN dsp.subject = 3 THEN COALESCE(dsp.coach_name, '') END) AS subject3CoachName, @@ -396,6 +409,16 @@ + + + + AND dsco.discount > 0 + + + AND (dsco.discount = 0 or dsco.discount IS NULL) + + + AND dss.source = #{entity.source} @@ -443,6 +466,8 @@ SELECT COUNT(DISTINCT dss.user_id) AS studentCount, SUM(dsco.reserve_money) AS totalAmount, + SUM(dsco.discount) AS totalDiscount, + SUM(dsco.actual_payment) AS totalActualPayment, SUM(IFNULL(sub.subject2Deduct, 0)) AS subject2DeductTotal, SUM(IFNULL(sub.subject3Deduct, 0)) AS subject3DeductTotal FROM drive_school_student dss @@ -542,6 +567,16 @@ + + + + AND dsco.discount > 0 + + + AND (dsco.discount = 0 or dsco.discount IS NULL) + + + diff --git a/dl-module-jx/src/main/resources/mapper/train/TrainMapper.xml b/dl-module-jx/src/main/resources/mapper/train/TrainMapper.xml index 39a141e3..a045c5c8 100644 --- a/dl-module-jx/src/main/resources/mapper/train/TrainMapper.xml +++ b/dl-module-jx/src/main/resources/mapper/train/TrainMapper.xml @@ -85,4 +85,20 @@ #{trainId} + + + diff --git a/yudao-server/src/main/java/cn/iocoder/yudao/server/YudaoServerApplication.java b/yudao-server/src/main/java/cn/iocoder/yudao/server/YudaoServerApplication.java index 75124921..2215bcc1 100644 --- a/yudao-server/src/main/java/cn/iocoder/yudao/server/YudaoServerApplication.java +++ b/yudao-server/src/main/java/cn/iocoder/yudao/server/YudaoServerApplication.java @@ -2,6 +2,7 @@ package cn.iocoder.yudao.server; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.scheduling.annotation.EnableScheduling; /** * 项目的启动类 @@ -13,6 +14,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; * @author 芋道源码 */ @SuppressWarnings("SpringComponentScan") // 忽略 IDEA 无法识别 ${yudao.info.base-package} +@EnableScheduling @SpringBootApplication(scanBasePackages = {"${yudao.info.base-package}.server", "${yudao.info.base-package}.module", "${yudao.info.base-package}"}) public class YudaoServerApplication { From 2d9e5a541d38b47ffb48b50daf078dc01cc845c5 Mon Sep 17 00:00:00 2001 From: Lx <935448346@qq.com> Date: Fri, 11 Jul 2025 16:59:30 +0800 Subject: [PATCH 3/4] 0711 --- dl-module-jx/src/main/resources/mapper/train/TrainMapper.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dl-module-jx/src/main/resources/mapper/train/TrainMapper.xml b/dl-module-jx/src/main/resources/mapper/train/TrainMapper.xml index a045c5c8..3110824d 100644 --- a/dl-module-jx/src/main/resources/mapper/train/TrainMapper.xml +++ b/dl-module-jx/src/main/resources/mapper/train/TrainMapper.xml @@ -95,9 +95,10 @@ tenant_id FROM drive_school_train WHERE - DATE(create_time) = CURDATE() + DATE(create_time) = CURDATE() AND DATE(start_time) = CURDATE() AND end_time IS NULL + AND deleted = 0 GROUP BY coach_id, coach_name From 8f02904dacedfa2e7336c1afbbbe1a61da113947 Mon Sep 17 00:00:00 2001 From: Lx <935448346@qq.com> Date: Fri, 11 Jul 2025 17:05:48 +0800 Subject: [PATCH 4/4] 0711 --- .../java/cn/iocoder/yudao/server/YudaoServerApplication.java | 1 - 1 file changed, 1 deletion(-) diff --git a/yudao-server/src/main/java/cn/iocoder/yudao/server/YudaoServerApplication.java b/yudao-server/src/main/java/cn/iocoder/yudao/server/YudaoServerApplication.java index 2215bcc1..091f290b 100644 --- a/yudao-server/src/main/java/cn/iocoder/yudao/server/YudaoServerApplication.java +++ b/yudao-server/src/main/java/cn/iocoder/yudao/server/YudaoServerApplication.java @@ -14,7 +14,6 @@ import org.springframework.scheduling.annotation.EnableScheduling; * @author 芋道源码 */ @SuppressWarnings("SpringComponentScan") // 忽略 IDEA 无法识别 ${yudao.info.base-package} -@EnableScheduling @SpringBootApplication(scanBasePackages = {"${yudao.info.base-package}.server", "${yudao.info.base-package}.module", "${yudao.info.base-package}"}) public class YudaoServerApplication {