This commit is contained in:
Lx 2025-07-11 16:44:25 +08:00
parent a56b551975
commit 2dd26ebb38
15 changed files with 221 additions and 17 deletions

View File

@ -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 ,不要忘记离场打卡哟!";
}

View File

@ -174,5 +174,16 @@ public class SchoolCourseOrder extends TenantBaseDO {
*/
private String paymentAccount;
/**
* 优惠金额
*/
private BigDecimal discount;
/**
* 实付金额
*/
private BigDecimal actualPayment;
}

View File

@ -836,8 +836,12 @@ public class ProcessServiceImpl extends ServiceImpl<ProcessMapper, Process> impl
List<SchoolCourseOrderVO> 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<ProcessMapper, Process> 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<Process> list = this.lambdaQuery()
.eq(Process::getCoachId, processVO.getCoachId())
.eq(Process::getCourseId, processVO.getCourseId())

View File

@ -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;
/**

View File

@ -12,6 +12,12 @@ public class CourseOrderStatisticsVO {
/** 招生金额总和 */
private BigDecimal totalAmount;
/** 优惠总金额 */
private BigDecimal totalDiscount;
/** 实付总金额 */
private BigDecimal totalActualPayment;
/** 科目二提成金额总和 */
private BigDecimal subject2DeductTotal;

View File

@ -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;
}

View File

@ -41,4 +41,7 @@ public class SchoolCourseOrderVO extends SchoolCourseOrder {
/** 总金额 */
private Double totalPrice;
/** 优惠筛选 */
private String discountIndex;
}

View File

@ -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();
}
}

View File

@ -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<Train> {
IPage<TrainVO> queryTrainListPage(@Param("entity") TrainVO pageReqVO, @Param("page") Page<TrainVO> page);
List<TrainVO> listJoinBatchByIds(@Param("trainIds") List<String> trainIds);
List<NoClockInRemindVO> noClockInRemind();
}

View File

@ -84,4 +84,9 @@ public interface TrainService extends IService<Train> {
* @return
*/
List<TrainVO> listJoinBatchByIds(List<String> trainIds);
/**
* 提醒教练未打卡学员信息
*/
void noClockInRemind();
}

View File

@ -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<TrainMapper, Train> implements
if (CollUtil.isEmpty(trainIds)) return null;
return trainMapper.listJoinBatchByIds(trainIds);
}
/**
* 提醒教练未打卡学员信息
*/
@Override
public void noClockInRemind() {
List<NoClockInRemindVO> 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);
}
}
}

View File

@ -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;
}

View File

@ -50,6 +50,17 @@
</choose>
</if>
<if test="entity.discountIndex != null and entity.discountIndex != ''">
<choose>
<when test="entity.discountIndex == 1">
AND main.discount &gt; 0
</when>
<when test="entity.discountIndex == 0">
AND main.discount = 0 or main.discount is null
</when>
</choose>
</if>
</where>
order by main.create_time desc
</select>
@ -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 @@
</when>
</choose>
</if>
<if test="entity.discountIndex != null and entity.discountIndex != ''">
<choose>
<when test="entity.discountIndex == 1">
AND dsco.discount &gt; 0
</when>
<when test="entity.discountIndex == 0">
AND (dsco.discount = 0 or dsco.discount IS NULL)
</when>
</choose>
</if>
<if test="entity.source != null and entity.source != '' ">
AND dss.source = #{entity.source}
</if>
@ -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 @@
</when>
</choose>
</if>
<if test="entity.discountIndex != null and entity.discountIndex != ''">
<choose>
<when test="entity.discountIndex == 1">
AND dsco.discount &gt; 0
</when>
<when test="entity.discountIndex == 0">
AND (dsco.discount = 0 or dsco.discount IS NULL)
</when>
</choose>
</if>
</select>

View File

@ -85,4 +85,20 @@
#{trainId}
</foreach>
</select>
<select id="noClockInRemind" resultType="cn.iocoder.yudao.module.train.vo.NoClockInRemindVO">
SELECT
coach_id,
coach_name,
COUNT(DISTINCT user_id) AS student_count,
GROUP_CONCAT(DISTINCT user_name SEPARATOR '') AS student_names,
tenant_id
FROM drive_school_train
WHERE
DATE(create_time) = CURDATE()
AND DATE(start_time) = CURDATE()
AND end_time IS NULL
GROUP BY coach_id, coach_name
</select>
</mapper>

View File

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