Merge remote-tracking branch 'origin/driver' into driver
This commit is contained in:
commit
7dc2610f56
@ -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 ,不要忘记离场打卡哟!";
|
||||
|
||||
}
|
||||
|
@ -323,6 +323,11 @@ public class DlDriveSchoolCoachController {
|
||||
return success(dlDriveSchoolCoachService.getBusinessRecordExportData(exportVO, page));
|
||||
}
|
||||
|
||||
@GetMapping("/getBusinessRecordExportCount")
|
||||
public CommonResult<BusinessRecordExportCountVO> getBusinessRecordExportCount(BusinessRecordExportVO exportVO) {
|
||||
return success(dlDriveSchoolCoachService.getBusinessRecordExportCount(exportVO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出
|
||||
* @param exportVO
|
||||
|
@ -162,6 +162,7 @@ public interface DlDriveSchoolCoachService extends IService<DlDriveSchoolCoach>
|
||||
* 获取导出数据列表
|
||||
*/
|
||||
IPage<BusinessRecordExportVO> getBusinessRecordExportData(BusinessRecordExportVO reqVO, Page<BusinessRecordExportVO> page);
|
||||
BusinessRecordExportCountVO getBusinessRecordExportCount(BusinessRecordExportVO reqVO);
|
||||
/**
|
||||
* 导出的三种形式
|
||||
* @param exportVO
|
||||
|
@ -1226,6 +1226,32 @@ public class DlDriveSchoolCoachServiceImpl extends ServiceImpl<DlDriveSchoolCoac
|
||||
return businessManager;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BusinessRecordExportCountVO getBusinessRecordExportCount(BusinessRecordExportVO reqVO) {
|
||||
Page<BusinessRecordExportVO> page = new Page<>(1, Integer.MAX_VALUE);
|
||||
// reqVO.setIsSign(1);
|
||||
reqVO.setIfEnd("0");
|
||||
|
||||
IPage<BusinessRecordExportVO> allData = this.getBusinessRecordExportData(reqVO, page);
|
||||
List<BusinessRecordExportVO> 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<DlDriveSchoolCoac
|
||||
// 分页查询当前页
|
||||
Page<BusinessRecordExportVO> page = new Page<>(exportVO.getPageNo(), exportVO.getPageSize());
|
||||
IPage<BusinessRecordExportVO> result = dlDriveSchoolCoachMapper.getBusinessRecordExportData(exportVO, page);
|
||||
return result.getRecords();
|
||||
List<BusinessRecordExportVO> 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<DlDriveSchoolCoac
|
||||
// 不分页查询全部数据
|
||||
Page<BusinessRecordExportVO> page = new Page<>(1, Integer.MAX_VALUE);
|
||||
IPage<BusinessRecordExportVO> result = dlDriveSchoolCoachMapper.getBusinessRecordExportData(exportVO, page);
|
||||
return result.getRecords();
|
||||
List<BusinessRecordExportVO> 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<DlDriveSchoolCoac
|
||||
for (int i = exportVO.getStartPage(); i <= exportVO.getEndPage(); i++) {
|
||||
Page<BusinessRecordExportVO> page = new Page<>(i, exportVO.getPageSize());
|
||||
IPage<BusinessRecordExportVO> result = dlDriveSchoolCoachMapper.getBusinessRecordExportData(exportVO, page);
|
||||
allData.addAll(result.getRecords());
|
||||
List<BusinessRecordExportVO> 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;
|
||||
|
@ -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;
|
||||
}
|
@ -46,6 +46,8 @@ public class BusinessRecordExportVO {
|
||||
|
||||
@ExcelIgnore
|
||||
private Integer isSign;
|
||||
@ExcelIgnore
|
||||
private String ifEnd;
|
||||
|
||||
@ExcelProperty(value = "面签时间", index = 9)
|
||||
private String signTimeStr;
|
||||
|
@ -174,5 +174,16 @@ public class SchoolCourseOrder extends TenantBaseDO {
|
||||
*/
|
||||
private String paymentAccount;
|
||||
|
||||
/**
|
||||
* 优惠金额
|
||||
*/
|
||||
private BigDecimal discount;
|
||||
|
||||
|
||||
/**
|
||||
* 实付金额
|
||||
*/
|
||||
private BigDecimal actualPayment;
|
||||
|
||||
|
||||
}
|
||||
|
@ -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())
|
||||
|
@ -328,8 +328,8 @@ public class SchoolCourseOrderServiceImpl extends ServiceImpl<SchoolCourseOrderM
|
||||
schoolCourseOrder.setSchemeId(schemeId);
|
||||
|
||||
schoolCourseOrder.setId(null);
|
||||
schoolCourseOrder.setCreateTime(null);
|
||||
schoolCourseOrder.setUpdateTime(null);
|
||||
schoolCourseOrder.setCreateTime(createReqVO.getCreateTime());
|
||||
schoolCourseOrder.setUpdateTime(LocalDateTime.now());
|
||||
schoolCourseOrder.setDeleted(SchoolBaseConstants.COMMON_NO);
|
||||
schoolCourseOrder.setIfAssignmentCoach(SchoolBaseConstants.SCHOOL_COURSE_ORDER_IS_ASSIGN_COACH);
|
||||
schoolCourseOrder.setIfEnd(SchoolBaseConstants.COMMON_NO);
|
||||
|
@ -106,6 +106,7 @@ public class CommissionExportVO {
|
||||
}
|
||||
}
|
||||
public void setExamTime(Date examTime) {
|
||||
this.examTime = examTime;
|
||||
if (examTime != null) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
this.examTimeStr = sdf.format(examTime);
|
||||
|
@ -9,6 +9,7 @@ import lombok.Data;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@ -39,6 +40,7 @@ public class CourseOrderExportVO {
|
||||
private String signUpTimeStr;
|
||||
|
||||
public void setSignUpTime(Date signUpTime) {
|
||||
this.signUpTime = signUpTime;
|
||||
if (signUpTime != null) {
|
||||
this.signUpTimeStr = new SimpleDateFormat("yyyy-MM-dd").format(signUpTime);
|
||||
}
|
||||
@ -53,17 +55,27 @@ 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 setPayFeesTimeStr(Date payFeesTime) {
|
||||
public void setPayFeesTime(Date payFeesTime) {
|
||||
this.payFeesTime = payFeesTime;
|
||||
if (payFeesTime != null) {
|
||||
this.payFeesTimeStr = new SimpleDateFormat("yyyy-MM-dd").format(payFeesTime);
|
||||
}
|
||||
@ -72,41 +84,50 @@ 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;
|
||||
|
||||
@ExcelProperty(value = "面签时间", index = 11)
|
||||
@ExcelIgnore
|
||||
private LocalDateTime signTime;
|
||||
|
||||
@ExcelProperty(value = "面签时间", index = 13)
|
||||
private String signTimeStr;
|
||||
|
||||
public void setSignTime(LocalDateTime signTime) {
|
||||
this.signTime = signTime;
|
||||
if (signTime != null) {
|
||||
this.signTimeStr = signTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
||||
}
|
||||
}
|
||||
@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;
|
||||
@ -115,16 +136,17 @@ public class CourseOrderExportVO {
|
||||
@ExcelIgnore
|
||||
private Date cashierConfirmTime;
|
||||
|
||||
@ExcelProperty(value = "出纳确认时间", index = 18)
|
||||
@ExcelProperty(value = "出纳确认时间", index = 20)
|
||||
private String cashierConfirmTimeStr;
|
||||
|
||||
public void setCashierConfirmTime(Date cashierConfirmTime) {
|
||||
this.cashierConfirmTime = cashierConfirmTime;
|
||||
if (cashierConfirmTime != null) {
|
||||
this.cashierConfirmTimeStr = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(cashierConfirmTime);
|
||||
}
|
||||
}
|
||||
|
||||
@ExcelProperty(value = "出纳备注", index = 19)
|
||||
@ExcelProperty(value = "出纳备注", index = 21)
|
||||
private String cashierConfirmRemark;
|
||||
|
||||
/**
|
||||
|
@ -12,6 +12,12 @@ public class CourseOrderStatisticsVO {
|
||||
/** 招生金额总和 */
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
/** 优惠总金额 */
|
||||
private BigDecimal totalDiscount;
|
||||
|
||||
/** 实付总金额 */
|
||||
private BigDecimal totalActualPayment;
|
||||
|
||||
/** 科目二提成金额总和 */
|
||||
private BigDecimal subject2DeductTotal;
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -41,4 +41,7 @@ public class SchoolCourseOrderVO extends SchoolCourseOrder {
|
||||
|
||||
/** 总金额 */
|
||||
private Double totalPrice;
|
||||
|
||||
/** 优惠筛选 */
|
||||
private String discountIndex;
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -84,4 +84,9 @@ public interface TrainService extends IService<Train> {
|
||||
* @return
|
||||
*/
|
||||
List<TrainVO> listJoinBatchByIds(List<String> trainIds);
|
||||
|
||||
/**
|
||||
* 提醒教练未打卡学员信息
|
||||
*/
|
||||
void noClockInRemind();
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
@ -222,7 +222,8 @@
|
||||
dsc.name AS businessName,
|
||||
dsc.phone AS businessPhone,
|
||||
dsco.create_time,
|
||||
dsc.image
|
||||
dsc.image,
|
||||
dsco.scheme_id AS scheme
|
||||
from drive_school_student dss
|
||||
LEFT JOIN drive_school_course_order dsco ON dss.user_id = dsco.user_id
|
||||
<if test="entity.startTimeStr != null and entity.startTimeStr != ''">
|
||||
|
@ -166,7 +166,7 @@
|
||||
</otherwise>
|
||||
</choose>
|
||||
</if>
|
||||
order BY dsc.create_time DESC
|
||||
ORDER BY dsc.create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="getCommissionStatistics" resultType="cn.iocoder.yudao.module.course.vo.CommissionStatisticsVO">
|
||||
|
@ -36,6 +36,31 @@
|
||||
<if test="entity.endTimeStr!=null and entity.endTimeStr!=''">
|
||||
AND main.create_time <= #{entity.endTimeStr}
|
||||
</if>
|
||||
<if test="entity.cashierConfirm != ''">
|
||||
<choose>
|
||||
<when test="entity.cashierConfirm == 1">
|
||||
AND main.cashier_confirm = 1
|
||||
</when>
|
||||
<when test="entity.cashierConfirm == 0">
|
||||
AND main.cashier_confirm = 0
|
||||
</when>
|
||||
<when test="entity.cashierConfirm == null">
|
||||
AND main.cashier_confirm IS NULL
|
||||
</when>
|
||||
</choose>
|
||||
</if>
|
||||
|
||||
<if test="entity.discountIndex != null and entity.discountIndex != ''">
|
||||
<choose>
|
||||
<when test="entity.discountIndex == 1">
|
||||
AND main.discount > 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>
|
||||
@ -312,6 +337,9 @@
|
||||
dsco.cashier_confirm_time,
|
||||
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,
|
||||
@ -381,6 +409,16 @@
|
||||
</when>
|
||||
</choose>
|
||||
</if>
|
||||
<if test="entity.discountIndex != null and entity.discountIndex != ''">
|
||||
<choose>
|
||||
<when test="entity.discountIndex == 1">
|
||||
AND dsco.discount > 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>
|
||||
@ -406,13 +444,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
|
||||
</select>
|
||||
|
||||
|
||||
@ -422,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
|
||||
@ -521,6 +567,16 @@
|
||||
</when>
|
||||
</choose>
|
||||
</if>
|
||||
<if test="entity.discountIndex != null and entity.discountIndex != ''">
|
||||
<choose>
|
||||
<when test="entity.discountIndex == 1">
|
||||
AND dsco.discount > 0
|
||||
</when>
|
||||
<when test="entity.discountIndex == 0">
|
||||
AND (dsco.discount = 0 or dsco.discount IS NULL)
|
||||
</when>
|
||||
</choose>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
|
@ -85,4 +85,21 @@
|
||||
#{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
|
||||
AND deleted = 0
|
||||
GROUP BY coach_id, coach_name
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
@ -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;
|
||||
|
||||
/**
|
||||
* 项目的启动类
|
||||
|
Loading…
Reference in New Issue
Block a user