0623
This commit is contained in:
parent
e8b40a68f2
commit
2016d8db9c
@ -160,4 +160,9 @@ public interface SchoolBaseConstants {
|
||||
*/
|
||||
public static final String SCHOOL_NOTIFY_MESSAGE_TEMPLATE_MEMBER_AUDIT_WAIT = "驾校学员 %s ,身份证号:%s,科目 %s 的考试已通过,提成待审核,请查看!";
|
||||
|
||||
/**
|
||||
* 审核通过
|
||||
*/
|
||||
public static final String SCHOOL_NOTIFY_MESSAGE_TEMPLATE_MEMBER_AUDIT_PASS = "驾校教练 %s 的学员 %s ,身份证号:%s,科目 %s 的提成审核已通过,请查看!";
|
||||
|
||||
}
|
||||
|
@ -44,4 +44,5 @@ public class DlDriveSchoolCourseDeductController {
|
||||
driveSchoolCourseDeductService.add(list);
|
||||
return CommonResult.ok();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -255,17 +255,28 @@ public class DataViewServiceImpl implements DataViewService {
|
||||
/*4.财务情况--*/
|
||||
//应收
|
||||
Double showedReceive = courseOrderMapper.selectByCoachUserId(coachId, startTimeStr, endTimeStr);
|
||||
// 已确认收款
|
||||
Double showedIsConfirmedReceive = courseOrderMapper.selectByCoachUserIdIsConfirmed(coachId, startTimeStr, endTimeStr);
|
||||
//应付
|
||||
List<SchoolCommission> schoolCommissionList = commissionMapper.selectByCoachId(coachId, startTimeStr, endTimeStr);
|
||||
double showedPay = 0.0;
|
||||
double showedPayIsPaid = 0.0;
|
||||
for (SchoolCommission item : schoolCommissionList) {
|
||||
if (null != item.getCommissionAmount()) {
|
||||
showedPay = showedPay + item.getCommissionAmount().doubleValue();
|
||||
// showedPay = showedPay + item.getCommissionAmount().doubleValue();
|
||||
double amount = item.getCommissionAmount().doubleValue();
|
||||
showedPay += amount;
|
||||
|
||||
if (Boolean.TRUE.equals(item.getIfPay())) {
|
||||
showedPayIsPaid += amount;
|
||||
}
|
||||
}
|
||||
}
|
||||
Map<String, Object> moneyInfoMap = new HashMap<>();
|
||||
moneyInfoMap.put("inAmount", null == showedReceive ? 0 : showedReceive);
|
||||
moneyInfoMap.put("outAmount", showedPay);
|
||||
moneyInfoMap.put("confirmedReceive", null == showedIsConfirmedReceive ? 0 : showedIsConfirmedReceive);
|
||||
moneyInfoMap.put("showedPayIsPaid", showedPayIsPaid);
|
||||
rtnObj.setMoneyInfo(moneyInfoMap);
|
||||
} else if ("coach".equals(type)) {
|
||||
//教练查询
|
||||
@ -323,8 +334,11 @@ public class DataViewServiceImpl implements DataViewService {
|
||||
rtnObj.setMoneyInfo(moneyInfoMap);
|
||||
}
|
||||
/*2.训练情况*/
|
||||
List<TrainVO> allTrainList = trainMapper.selectTrainByCondition(coachId, startTimeStr, endTimeStr);
|
||||
// List<TrainVO> allTrainList = trainMapper.selectTrainByCondition(coachId, startTimeStr, endTimeStr);
|
||||
//所有车辆set,目的是去重
|
||||
List<TrainVO> allTrainList = Optional.ofNullable(
|
||||
trainMapper.selectTrainByCondition(coachId, startTimeStr, endTimeStr)
|
||||
).orElse(Collections.emptyList());
|
||||
Set<String> allCarSet = new HashSet<>();
|
||||
Set<String> subject2CarSet = new HashSet<>();
|
||||
Set<String> subject3CarSet = new HashSet<>();
|
||||
@ -332,6 +346,13 @@ public class DataViewServiceImpl implements DataViewService {
|
||||
Set<Long> subject2UserSet = new HashSet<>();
|
||||
Set<Long> subject3UserSet = new HashSet<>();
|
||||
for (TrainVO trainVO : allTrainList) {
|
||||
if (trainVO == null
|
||||
|| trainVO.getSubject() == null
|
||||
|| trainVO.getCarNo() == null
|
||||
|| trainVO.getUserId() == null
|
||||
|| trainVO.getCourseId() == null) {
|
||||
continue;
|
||||
}
|
||||
if (2 == trainVO.getSubject()) {
|
||||
subject2CarSet.add(trainVO.getCarNo());
|
||||
allCarSet.add(trainVO.getCarNo());
|
||||
|
@ -457,7 +457,6 @@ public class DlDriveSchoolStudentServiceImpl extends ServiceImpl<DlDriveSchoolSt
|
||||
//自来的学生
|
||||
return dlDriveSchoolStudentMapper.indexCusStudentList(startTime, endTime);
|
||||
} else if ("04".equals(type)) {
|
||||
//自来的学生
|
||||
return dlDriveSchoolStudentMapper.indexGetTrainList(type, coachId, startTime, endTime);
|
||||
} else {
|
||||
return dlDriveSchoolStudentMapper.indexGetTrainList(type, coachId, startTime, endTime);
|
||||
|
@ -71,4 +71,27 @@ public class DlDriveSchoolStaffVO {
|
||||
|
||||
/**总招生数*/
|
||||
private Integer studentTotalNum;
|
||||
|
||||
/**学员身份证*/
|
||||
private String studentIdCard;
|
||||
/**课程名称*/
|
||||
private String courseName;
|
||||
/**支付状态*/
|
||||
private String paymentStatus;
|
||||
/**支付类型*/
|
||||
private String payType;
|
||||
/**支付渠道*/
|
||||
private String payChannel;
|
||||
/**支付金额*/
|
||||
private String reserveMoney;
|
||||
/**尾款*/
|
||||
private String restMoney;
|
||||
/**是否终止*/
|
||||
private Boolean ifEnd;
|
||||
/**出纳是否审核*/
|
||||
private String cashierConfirm;
|
||||
/**出纳审核备注*/
|
||||
private String cashierConfirmRemark;
|
||||
/**报名时间*/
|
||||
private Date enrollTime;
|
||||
}
|
||||
|
@ -4,6 +4,8 @@ import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class StudentCountVO {
|
||||
/**教练Id */
|
||||
private Long coachId;
|
||||
/**教练头像*/
|
||||
private String image;
|
||||
/**姓名*/
|
||||
|
@ -1,11 +1,15 @@
|
||||
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.module.base.vo.DriveSchoolCourseDeductVO;
|
||||
import cn.iocoder.yudao.module.course.entity.SchoolCommission;
|
||||
import cn.iocoder.yudao.module.course.service.SchoolCommissionService;
|
||||
import cn.iocoder.yudao.module.course.vo.SchoolCommissionVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -13,6 +17,8 @@ import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - 提成记录")
|
||||
@ -51,15 +57,41 @@ public class SchoolCommissionController {
|
||||
|
||||
|
||||
|
||||
// @GetMapping("/get")
|
||||
// @Operation(summary = "获得提成记录")
|
||||
// @Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
// @PreAuthorize("@ss.hasPermission('drive:school-commission:query')")
|
||||
// public CommonResult<SchoolCommissionVO> getSchoolCommission(@RequestParam("id") String id) {
|
||||
//// SchoolCommissionDO schoolCommission = schoolCommissionService.getSchoolCommission(id);
|
||||
// return success(BeanUtils.toBean(schoolCommission, SchoolCommissionRespVO.class));
|
||||
// }
|
||||
//
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得提成记录")
|
||||
public CommonResult<SchoolCommissionVO> getSchoolCommission(@RequestParam("id") String id) {
|
||||
return success(schoolCommissionService.getSchoolCommissionById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 出纳审核提成记录
|
||||
* @param schoolCommissionVO
|
||||
* @return
|
||||
*/
|
||||
@PutMapping("/cashierConfirm")
|
||||
public CommonResult<?> cashierConfirm(@RequestBody SchoolCommissionVO schoolCommissionVO) {
|
||||
boolean b = schoolCommissionService.cashierConfirm(schoolCommissionVO);
|
||||
return success(b);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 教练提成合计列表
|
||||
*/
|
||||
@GetMapping("/getCoachTotalCommission")
|
||||
public CommonResult<List<SchoolCommissionVO>> getCoachTotalCommission(SchoolCommissionVO schoolCommissionVO){
|
||||
return success(schoolCommissionService.getCoachTotalCommission(schoolCommissionVO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 教练提成信息列表
|
||||
*/
|
||||
@GetMapping("/getCommissionListByCoachId")
|
||||
public CommonResult<IPage<SchoolCommissionVO>> getCommissionListByCoachId(SchoolCommissionVO schoolCommissionVO,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize){
|
||||
Page<SchoolCommissionVO> page = new Page<>(pageNo, pageSize);
|
||||
return success(schoolCommissionService.getCommissionListByCoachId(schoolCommissionVO, page));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -159,6 +159,39 @@ public class SchoolCourseOrderController {
|
||||
return success(schoolCourseOrderService.getOrderCountBySchemeId(schemeId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据教练id获取对应招生
|
||||
*/
|
||||
@GetMapping("getOrderByCoachId")
|
||||
public CommonResult<IPage<SchoolCourseOrderVO>> getOrderByCoachId(SchoolCourseOrderVO pageReqVO,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize){
|
||||
Page<SchoolCourseOrderVO> page = new Page<>(pageNo, pageSize);
|
||||
return success(schoolCourseOrderService.getOrderByCoachId(pageReqVO, page));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取教练的订单总金额
|
||||
* @param pageReqVO
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("getCoachMoney")
|
||||
public CommonResult<List<SchoolCourseOrderVO>> getCoachMoney(SchoolCourseOrderVO pageReqVO){
|
||||
return success(schoolCourseOrderService.getCoachMoney(pageReqVO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取教练的订单明细
|
||||
* @param pageReqVO
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("getOrderMoneyByCoachId")
|
||||
public CommonResult<IPage<SchoolCourseOrderVO>> getOrderMoneyByCoachId(SchoolCourseOrderVO pageReqVO,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize){
|
||||
Page<SchoolCourseOrderVO> page = new Page<>(pageNo, pageSize);
|
||||
return success(schoolCourseOrderService.getOrderMoneyByCoachId(pageReqVO, page));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -104,4 +104,13 @@ public class Process extends TenantBaseDO {
|
||||
*/
|
||||
private String courseType;
|
||||
|
||||
/**
|
||||
* 成绩录入人
|
||||
*/
|
||||
private String inputName;
|
||||
/**
|
||||
* 成绩录入人id
|
||||
*/
|
||||
private Long inputUserId;
|
||||
|
||||
}
|
@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
@ -85,4 +86,29 @@ public class SchoolCommission extends TenantBaseDO {
|
||||
*/
|
||||
private String checkRemark;
|
||||
|
||||
/**
|
||||
* 出纳确认日期
|
||||
*/
|
||||
private LocalDateTime cashierConfirmTime;
|
||||
|
||||
/**
|
||||
* 出纳确认备注
|
||||
*/
|
||||
private String cashierConfirmRemark;
|
||||
|
||||
/**
|
||||
* 证明材料
|
||||
*/
|
||||
private String images;
|
||||
|
||||
/**
|
||||
* 确认人姓名
|
||||
*/
|
||||
private String cashierName;
|
||||
|
||||
/**
|
||||
* 确认人id
|
||||
*/
|
||||
private Long cashierUserId;
|
||||
|
||||
}
|
||||
|
@ -146,5 +146,18 @@ public class SchoolCourseOrder extends TenantBaseDO {
|
||||
*/
|
||||
private String schemeId;
|
||||
|
||||
/**
|
||||
* 出纳确认是否到账
|
||||
*/
|
||||
private String cashierConfirm;
|
||||
|
||||
/**
|
||||
* 出纳确认备注
|
||||
*/
|
||||
private String cashierConfirmRemark;
|
||||
|
||||
/** 订单备注 */
|
||||
private String orderRemark;
|
||||
|
||||
|
||||
}
|
||||
|
@ -31,5 +31,14 @@ public interface SchoolCommissionMapper extends BaseMapper<SchoolCommission> {
|
||||
|
||||
List<SchoolCommission> selectByCoachId(@Param("coachId")Long coachId,@Param("startTime")String startTime,@Param("endTime")String endTime);
|
||||
|
||||
SchoolCommissionVO getSchoolCommissionById(@Param("id") String id);
|
||||
|
||||
/**
|
||||
* 教练提成合计列表
|
||||
*/
|
||||
List<SchoolCommissionVO> getCoachTotalCommission(@Param("entity") SchoolCommissionVO entity);
|
||||
|
||||
IPage<SchoolCommissionVO> getCommissionListByCoachId(@Param("entity") SchoolCommissionVO entity, Page<SchoolCommissionVO> page);
|
||||
|
||||
|
||||
}
|
@ -11,6 +11,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 驾照报名订单 Mapper
|
||||
*
|
||||
@ -41,6 +43,7 @@ public interface SchoolCourseOrderMapper extends BaseMapper<SchoolCourseOrder> {
|
||||
* @return java.util.List<cn.iocoder.yudao.module.course.vo.SchoolCourseOrderVO>
|
||||
**/
|
||||
Double selectByCoachUserId(@Param("coachId")Long coachId,@Param("startTime")String startTime,@Param("endTime")String endTime);
|
||||
Double selectByCoachUserIdIsConfirmed(@Param("coachId")Long coachId,@Param("startTime")String startTime,@Param("endTime")String endTime);
|
||||
|
||||
|
||||
/** 学员订单信息 */
|
||||
@ -59,4 +62,12 @@ public interface SchoolCourseOrderMapper extends BaseMapper<SchoolCourseOrder> {
|
||||
* 查询是否有订单使用该提成方案
|
||||
*/
|
||||
Integer getOrderCountBySchemeId(@Param("schemeId") String schemeId);
|
||||
|
||||
/**
|
||||
* 根据教练id获取对应招生
|
||||
*/
|
||||
IPage<SchoolCourseOrderVO> getOrderByCoachId(@Param("entity")SchoolCourseOrderVO entity, Page<SchoolCourseOrderVO> page);
|
||||
|
||||
List<SchoolCourseOrderVO> getCoachMoney(@Param("entity")SchoolCourseOrderVO entity);
|
||||
IPage<SchoolCourseOrderVO> getOrderMoneyByCoachId(@Param("entity")SchoolCourseOrderVO entity, Page<SchoolCourseOrderVO> page);
|
||||
}
|
||||
|
@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 提成记录 Service 接口
|
||||
*
|
||||
@ -35,4 +37,24 @@ public interface SchoolCommissionService extends IService<SchoolCommission> {
|
||||
*/
|
||||
boolean exists(SchoolCommission entity);
|
||||
|
||||
/**
|
||||
* 根据id获取提成记录详细信息
|
||||
*/
|
||||
SchoolCommissionVO getSchoolCommissionById(String id);
|
||||
|
||||
/**
|
||||
* 出纳审核提成记录
|
||||
*/
|
||||
boolean cashierConfirm(SchoolCommissionVO schoolCommissionVO);
|
||||
|
||||
/**
|
||||
* 教练提成合计列表
|
||||
*/
|
||||
List<SchoolCommissionVO> getCoachTotalCommission(SchoolCommissionVO schoolCommissionVO);
|
||||
|
||||
/**
|
||||
* 教练提成列表
|
||||
*/
|
||||
IPage<SchoolCommissionVO> getCommissionListByCoachId(SchoolCommissionVO schoolCommissionVO, Page<SchoolCommissionVO> page);
|
||||
|
||||
}
|
||||
|
@ -125,4 +125,22 @@ public interface SchoolCourseOrderService extends IService<SchoolCourseOrder> {
|
||||
*/
|
||||
Integer getOrderCountBySchemeId(String schemeId);
|
||||
|
||||
/**
|
||||
* 根据教练id获取对应招生
|
||||
*/
|
||||
IPage<SchoolCourseOrderVO> getOrderByCoachId(SchoolCourseOrderVO pageReqVO, Page<SchoolCourseOrderVO> page);
|
||||
|
||||
/**
|
||||
* 获取教练的订单总金额
|
||||
* @param pageReqVO
|
||||
* @return
|
||||
*/
|
||||
List<SchoolCourseOrderVO> getCoachMoney(SchoolCourseOrderVO pageReqVO);
|
||||
/**
|
||||
* 获取教练的订单明细
|
||||
* @param pageReqVO
|
||||
* @return
|
||||
*/
|
||||
IPage<SchoolCourseOrderVO> getOrderMoneyByCoachId(SchoolCourseOrderVO pageReqVO, Page<SchoolCourseOrderVO> page);
|
||||
|
||||
}
|
||||
|
@ -376,26 +376,27 @@ public class ProcessServiceImpl extends ServiceImpl<ProcessMapper, Process> impl
|
||||
}
|
||||
|
||||
// 查询提成规则
|
||||
DriveSchoolCourseDeduct deduct = deductService.getOne(
|
||||
/*DriveSchoolCourseDeduct deduct = deductService.getOne(
|
||||
Wrappers.<DriveSchoolCourseDeduct>lambdaQuery()
|
||||
.eq(DriveSchoolCourseDeduct::getCourseId, process.getCourseId())
|
||||
.eq(DriveSchoolCourseDeduct::getCourseSubject, process.getSubject())
|
||||
);
|
||||
);*/
|
||||
|
||||
// 如果存在提成规则
|
||||
if (deduct != null) {
|
||||
if (process.getCoachCommission() != null) {
|
||||
// 构建提成记录对象
|
||||
SchoolCommission schoolCommission = new SchoolCommission();
|
||||
schoolCommission.setCoachUserId(oldProcess.getCoachId());
|
||||
schoolCommission.setCoachName(oldProcess.getCoachName());
|
||||
schoolCommission.setStudentId(oldProcess.getUserId());
|
||||
schoolCommission.setStudentName(oldProcess.getUserName());
|
||||
schoolCommission.setCommissionAmount(deduct.getDeduct());
|
||||
schoolCommission.setCommissionAmount(process.getCoachCommission());
|
||||
schoolCommission.setCourseId(oldProcess.getCourseId());
|
||||
schoolCommission.setSubject(String.valueOf(oldProcess.getSubject()));
|
||||
schoolCommission.setCheckId(sysUser.getId());
|
||||
schoolCommission.setCheckName(sysUser.getNickname());
|
||||
schoolCommission.setCheckRemark(process.getFinanceRemark());
|
||||
schoolCommission.setStudentIdCard(process.getStudentIdCard());
|
||||
|
||||
// 检查是否已存在记录
|
||||
SchoolCommission existing = schoolCommissionService.getOne(
|
||||
@ -422,6 +423,18 @@ public class ProcessServiceImpl extends ServiceImpl<ProcessMapper, Process> impl
|
||||
}
|
||||
|
||||
} else if (process.getFinancePass()) {
|
||||
|
||||
Long tenantId = TenantContextHolder.getTenantId();
|
||||
List<UserDTO> officeStaffList = roleApi.selectUserListByRoleCode(tenantId, "cn");
|
||||
|
||||
if (officeStaffList != null && !officeStaffList.isEmpty()) {
|
||||
String officeMessage = String.format(SchoolBaseConstants.SCHOOL_NOTIFY_MESSAGE_TEMPLATE_MEMBER_AUDIT_PASS, process.getCoachName(), process.getUserName(), process.getStudentIdCard(), process.getSubject());
|
||||
|
||||
for (UserDTO staff : officeStaffList) {
|
||||
schoolNotifyMessageSendService.sendMessage(staff.getId(), officeMessage, SchoolBaseConstants.SCHOOL_NOTIFY_MESSAGE_TYPE_ADMIN, null);
|
||||
}
|
||||
}
|
||||
|
||||
// 仅审核通过时新增记录
|
||||
schoolCommission.setDeleted(false);
|
||||
schoolCommissionService.save(schoolCommission);
|
||||
@ -811,6 +824,7 @@ public class ProcessServiceImpl extends ServiceImpl<ProcessMapper, Process> impl
|
||||
BigDecimal studentPay = BigDecimal.ZERO;
|
||||
BigDecimal studentRemainingPay = BigDecimal.ZERO;
|
||||
String studentIdCard = null;
|
||||
String cashierConfirm = null;
|
||||
if (!courseByInfo.isEmpty()) {
|
||||
studentPay = courseByInfo.get(0).getReserveMoney() != null ?
|
||||
courseByInfo.get(0).getReserveMoney() : BigDecimal.ZERO;
|
||||
@ -818,11 +832,15 @@ public class ProcessServiceImpl extends ServiceImpl<ProcessMapper, Process> impl
|
||||
courseByInfo.get(0).getRestMoney() : BigDecimal.ZERO;
|
||||
studentIdCard = courseByInfo.get(0).getUserNo() != null ?
|
||||
courseByInfo.get(0).getUserNo() : null;
|
||||
cashierConfirm = courseByInfo.get(0).getCashierConfirm()!= null?
|
||||
courseByInfo.get(0).getCashierConfirm() : null;
|
||||
|
||||
}
|
||||
processVO.setCoachCommission(deduct);
|
||||
processVO.setStudentPay(studentPay);
|
||||
processVO.setStudentRemainingPay(studentRemainingPay);
|
||||
processVO.setStudentIdCard(studentIdCard);
|
||||
processVO.setCashierConfirm(cashierConfirm);
|
||||
List<Process> list = this.lambdaQuery()
|
||||
.eq(Process::getCoachId, processVO.getCoachId())
|
||||
.eq(Process::getCourseId, processVO.getCourseId())
|
||||
|
@ -1,5 +1,6 @@
|
||||
package cn.iocoder.yudao.module.course.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
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;
|
||||
@ -10,6 +11,7 @@ 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.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@ -17,6 +19,8 @@ import org.springframework.validation.annotation.Validated;
|
||||
import cn.iocoder.yudao.framework.common.exception.ServiceException;
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 提成记录 Service 实现类
|
||||
@ -81,4 +85,80 @@ public class SchoolCommissionServiceImpl extends ServiceImpl<SchoolCommissionMap
|
||||
.eq(SchoolCommission::getSubject, entity.getSubject())
|
||||
.exists();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id获取提成记录详细信息
|
||||
*/
|
||||
@Override
|
||||
public SchoolCommissionVO getSchoolCommissionById(String id) {
|
||||
return schoolCommissionMapper.getSchoolCommissionById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 出纳审核提成记录
|
||||
*/
|
||||
@Override
|
||||
public boolean cashierConfirm(SchoolCommissionVO schoolCommissionVO) {
|
||||
Long userId = SecurityFrameworkUtils.getLoginUserId();
|
||||
AdminUserRespDTO sysUser = userApi.getUser(userId);
|
||||
schoolCommissionVO.setCashierName(sysUser.getNickname());
|
||||
schoolCommissionVO.setCashierUserId(userId);
|
||||
return this.updateById(schoolCommissionVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 教练提成合计列表
|
||||
*/
|
||||
@Override
|
||||
public List<SchoolCommissionVO> getCoachTotalCommission(SchoolCommissionVO schoolCommissionVO) {
|
||||
String startTime = "";
|
||||
String endTime = "";
|
||||
if ("more".equals(schoolCommissionVO.getTimeType())) {
|
||||
if (StringUtils.isNotEmpty(schoolCommissionVO.getStartTimeStr())) {
|
||||
startTime = schoolCommissionVO.getStartTimeStr() + " 00:00:01";
|
||||
}
|
||||
if (StringUtils.isNotEmpty(schoolCommissionVO.getEndTimeStr())) {
|
||||
endTime = schoolCommissionVO.getEndTimeStr() + " 23:59:59";
|
||||
}
|
||||
} else if ("month".equals(schoolCommissionVO.getTimeType())) {
|
||||
//当月
|
||||
startTime = DateUtil.format(DateUtil.beginOfMonth(DateUtil.date()), "yyyy-MM-dd") + " 00:00:01";
|
||||
endTime = DateUtil.format(DateUtil.endOfMonth(DateUtil.date()), "yyyy-MM-dd") + " 23:59:59";
|
||||
} else if ("day".equals(schoolCommissionVO.getTimeType())) {
|
||||
//当天
|
||||
startTime = DateUtil.formatDate(DateUtil.date()) + " 00:00:01";
|
||||
endTime = DateUtil.formatDate(DateUtil.date()) + " 23:59:59";
|
||||
}
|
||||
schoolCommissionVO.setStartTimeStr(startTime);
|
||||
schoolCommissionVO.setEndTimeStr(endTime);
|
||||
return schoolCommissionMapper.getCoachTotalCommission(schoolCommissionVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 教练提成列表
|
||||
*/
|
||||
@Override
|
||||
public IPage<SchoolCommissionVO> getCommissionListByCoachId(SchoolCommissionVO schoolCommissionVO, Page<SchoolCommissionVO> page) {
|
||||
String startTime = "";
|
||||
String endTime = "";
|
||||
if ("more".equals(schoolCommissionVO.getTimeType())) {
|
||||
if (StringUtils.isNotEmpty(schoolCommissionVO.getStartTimeStr())) {
|
||||
startTime = schoolCommissionVO.getStartTimeStr() + " 00:00:01";
|
||||
}
|
||||
if (StringUtils.isNotEmpty(schoolCommissionVO.getEndTimeStr())) {
|
||||
endTime = schoolCommissionVO.getEndTimeStr() + " 23:59:59";
|
||||
}
|
||||
} else if ("month".equals(schoolCommissionVO.getTimeType())) {
|
||||
//当月
|
||||
startTime = DateUtil.format(DateUtil.beginOfMonth(DateUtil.date()), "yyyy-MM-dd") + " 00:00:01";
|
||||
endTime = DateUtil.format(DateUtil.endOfMonth(DateUtil.date()), "yyyy-MM-dd") + " 23:59:59";
|
||||
} else if ("day".equals(schoolCommissionVO.getTimeType())) {
|
||||
//当天
|
||||
startTime = DateUtil.formatDate(DateUtil.date()) + " 00:00:01";
|
||||
endTime = DateUtil.formatDate(DateUtil.date()) + " 23:59:59";
|
||||
}
|
||||
schoolCommissionVO.setStartTimeStr(startTime);
|
||||
schoolCommissionVO.setEndTimeStr(endTime);
|
||||
return schoolCommissionMapper.getCommissionListByCoachId(schoolCommissionVO, page);
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,12 @@
|
||||
package cn.iocoder.yudao.module.course.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
|
||||
import cn.iocoder.yudao.module.base.constant.SchoolBaseConstants;
|
||||
import cn.iocoder.yudao.module.base.entity.DlDriveSchoolCourse;
|
||||
import cn.iocoder.yudao.module.base.entity.DlDriveSchoolStudent;
|
||||
import cn.iocoder.yudao.module.base.service.DlDriveSchoolCourseService;
|
||||
import cn.iocoder.yudao.module.base.service.DlDriveSchoolStudentService;
|
||||
@ -12,9 +14,11 @@ import cn.iocoder.yudao.module.base.service.SchoolNotifyMessageSendService;
|
||||
import cn.iocoder.yudao.module.base.vo.DlDriveSchoolStudentVO;
|
||||
import cn.iocoder.yudao.module.course.entity.Process;
|
||||
import cn.iocoder.yudao.module.course.entity.SchoolCourseOrder;
|
||||
import cn.iocoder.yudao.module.course.entity.SchoolCourseScheme;
|
||||
import cn.iocoder.yudao.module.course.mapper.SchoolCourseOrderMapper;
|
||||
import cn.iocoder.yudao.module.course.service.ProcessService;
|
||||
import cn.iocoder.yudao.module.course.service.SchoolCourseOrderService;
|
||||
import cn.iocoder.yudao.module.course.service.SchoolCourseSchemeService;
|
||||
import cn.iocoder.yudao.module.course.vo.SchoolCommissionVO;
|
||||
import cn.iocoder.yudao.module.course.vo.SchoolCourseOrderBusinessVO;
|
||||
import cn.iocoder.yudao.module.course.vo.SchoolCourseOrderVO;
|
||||
@ -30,6 +34,7 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
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.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -37,6 +42,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDateTime;
|
||||
@ -72,6 +78,9 @@ public class SchoolCourseOrderServiceImpl extends ServiceImpl<SchoolCourseOrderM
|
||||
@Resource
|
||||
private DlDriveSchoolStudentService schoolStudentService;
|
||||
|
||||
@Resource
|
||||
private SchoolCourseSchemeService schoolCourseSchemeService;
|
||||
|
||||
|
||||
@Override
|
||||
public String createSchoolCourseOrder(SchoolCourseOrderVO createReqVO) {
|
||||
@ -308,6 +317,9 @@ public class SchoolCourseOrderServiceImpl extends ServiceImpl<SchoolCourseOrderM
|
||||
// .eq(Process::getCourseId, oldOrder.getCourseId()));
|
||||
// }
|
||||
|
||||
// 查询新课程默认方案
|
||||
SchoolCourseScheme courseScheme = schoolCourseSchemeService.lambdaQuery().eq(SchoolCourseScheme::getCourseId, createReqVO.getCourseId()).eq(SchoolCourseScheme::getIsDefault, true).eq(SchoolCourseScheme::getDeleted, false).one();
|
||||
String schemeId = courseScheme != null ? courseScheme.getId() : null;
|
||||
SchoolCourseOrder schoolCourseOrder = BeanUtil.copyProperties(oldOrder, SchoolCourseOrder.class);
|
||||
schoolCourseOrder.setOldOrderId(oldOrder.getId());
|
||||
//生成订单号
|
||||
@ -317,6 +329,7 @@ public class SchoolCourseOrderServiceImpl extends ServiceImpl<SchoolCourseOrderM
|
||||
schoolCourseOrder.setCourseType(createReqVO.getCourseType());
|
||||
schoolCourseOrder.setCoachUserId(createReqVO.getCoachUserId());
|
||||
schoolCourseOrder.setCoachUserName(createReqVO.getCoachUserName());
|
||||
schoolCourseOrder.setSchemeId(schemeId);
|
||||
|
||||
schoolCourseOrder.setId(null);
|
||||
schoolCourseOrder.setCreateTime(null);
|
||||
@ -535,4 +548,93 @@ public class SchoolCourseOrderServiceImpl extends ServiceImpl<SchoolCourseOrderM
|
||||
return schoolCourseOrderMapper.getOrderCountBySchemeId(schemeId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据教练id获取对应招生
|
||||
*/
|
||||
@Override
|
||||
public IPage<SchoolCourseOrderVO> getOrderByCoachId(SchoolCourseOrderVO pageReqVO, Page<SchoolCourseOrderVO> page) {
|
||||
String startTime = "";
|
||||
String endTime = "";
|
||||
if ("more".equals(pageReqVO.getTimeType())) {
|
||||
if (StringUtils.isNotEmpty(pageReqVO.getStartTimeStr())) {
|
||||
startTime = pageReqVO.getStartTimeStr() + " 00:00:01";
|
||||
}
|
||||
if (StringUtils.isNotEmpty(pageReqVO.getEndTimeStr())) {
|
||||
endTime = pageReqVO.getEndTimeStr() + " 23:59:59";
|
||||
}
|
||||
} else if ("month".equals(pageReqVO.getTimeType())) {
|
||||
//当月
|
||||
startTime = DateUtil.format(DateUtil.beginOfMonth(DateUtil.date()), "yyyy-MM-dd") + " 00:00:01";
|
||||
endTime = DateUtil.format(DateUtil.endOfMonth(DateUtil.date()), "yyyy-MM-dd") + " 23:59:59";
|
||||
} else if ("day".equals(pageReqVO.getTimeType())) {
|
||||
//当天
|
||||
startTime = DateUtil.formatDate(DateUtil.date()) + " 00:00:01";
|
||||
endTime = DateUtil.formatDate(DateUtil.date()) + " 23:59:59";
|
||||
}
|
||||
pageReqVO.setStartTimeStr(startTime);
|
||||
pageReqVO.setEndTimeStr(endTime);
|
||||
return schoolCourseOrderMapper.getOrderByCoachId(pageReqVO, page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取教练的订单总金额
|
||||
* @param pageReqVO
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<SchoolCourseOrderVO> getCoachMoney(SchoolCourseOrderVO pageReqVO) {
|
||||
String startTime = "";
|
||||
String endTime = "";
|
||||
if ("more".equals(pageReqVO.getTimeType())) {
|
||||
if (StringUtils.isNotEmpty(pageReqVO.getStartTimeStr())) {
|
||||
startTime = pageReqVO.getStartTimeStr() + " 00:00:01";
|
||||
}
|
||||
if (StringUtils.isNotEmpty(pageReqVO.getEndTimeStr())) {
|
||||
endTime = pageReqVO.getEndTimeStr() + " 23:59:59";
|
||||
}
|
||||
} else if ("month".equals(pageReqVO.getTimeType())) {
|
||||
//当月
|
||||
startTime = DateUtil.format(DateUtil.beginOfMonth(DateUtil.date()), "yyyy-MM-dd") + " 00:00:01";
|
||||
endTime = DateUtil.format(DateUtil.endOfMonth(DateUtil.date()), "yyyy-MM-dd") + " 23:59:59";
|
||||
} else if ("day".equals(pageReqVO.getTimeType())) {
|
||||
//当天
|
||||
startTime = DateUtil.formatDate(DateUtil.date()) + " 00:00:01";
|
||||
endTime = DateUtil.formatDate(DateUtil.date()) + " 23:59:59";
|
||||
}
|
||||
pageReqVO.setStartTimeStr(startTime);
|
||||
pageReqVO.setEndTimeStr(endTime);
|
||||
return schoolCourseOrderMapper.getCoachMoney(pageReqVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取教练的订单明细
|
||||
* @param pageReqVO
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public IPage<SchoolCourseOrderVO> getOrderMoneyByCoachId(SchoolCourseOrderVO pageReqVO, Page<SchoolCourseOrderVO> page) {
|
||||
String startTime = "";
|
||||
String endTime = "";
|
||||
if ("more".equals(pageReqVO.getTimeType())) {
|
||||
if (StringUtils.isNotEmpty(pageReqVO.getStartTimeStr())) {
|
||||
startTime = pageReqVO.getStartTimeStr() + " 00:00:01";
|
||||
}
|
||||
if (StringUtils.isNotEmpty(pageReqVO.getEndTimeStr())) {
|
||||
endTime = pageReqVO.getEndTimeStr() + " 23:59:59";
|
||||
}
|
||||
} else if ("month".equals(pageReqVO.getTimeType())) {
|
||||
//当月
|
||||
startTime = DateUtil.format(DateUtil.beginOfMonth(DateUtil.date()), "yyyy-MM-dd") + " 00:00:01";
|
||||
endTime = DateUtil.format(DateUtil.endOfMonth(DateUtil.date()), "yyyy-MM-dd") + " 23:59:59";
|
||||
} else if ("day".equals(pageReqVO.getTimeType())) {
|
||||
//当天
|
||||
startTime = DateUtil.formatDate(DateUtil.date()) + " 00:00:01";
|
||||
endTime = DateUtil.formatDate(DateUtil.date()) + " 23:59:59";
|
||||
}
|
||||
pageReqVO.setStartTimeStr(startTime);
|
||||
pageReqVO.setEndTimeStr(endTime);
|
||||
return schoolCourseOrderMapper.getOrderMoneyByCoachId(pageReqVO, page);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -39,4 +39,9 @@ public class ProcessVO extends Process {
|
||||
* 学习进度
|
||||
*/
|
||||
private List<Process> processList;
|
||||
|
||||
/**
|
||||
* 出纳确认情况
|
||||
*/
|
||||
private String cashierConfirm;
|
||||
}
|
||||
|
@ -16,4 +16,12 @@ public class SchoolCommissionVO extends SchoolCommission {
|
||||
/**课程类型*/
|
||||
private String courseType;
|
||||
|
||||
/**开始时间 */
|
||||
private String startTimeStr;
|
||||
/**结束时间 */
|
||||
private String endTimeStr;
|
||||
|
||||
/**时间类型 */
|
||||
private String timeType;
|
||||
|
||||
}
|
@ -5,6 +5,8 @@ import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Schema(description = "管理后台 - 驾照报名订单 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@ -21,4 +23,22 @@ public class SchoolCourseOrderVO extends SchoolCourseOrder {
|
||||
* 课程类型
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/** 渠道 */
|
||||
private String source;
|
||||
|
||||
/** 开始时间*/
|
||||
private String startTimeStr;
|
||||
|
||||
/** 结束时间*/
|
||||
private String endTimeStr;
|
||||
|
||||
/**时间类型*/
|
||||
private String timeType;
|
||||
|
||||
/**排序方式*/
|
||||
private String sort;
|
||||
|
||||
/** 总金额 */
|
||||
private Double totalPrice;
|
||||
}
|
||||
|
@ -23,6 +23,8 @@ import cn.iocoder.yudao.module.jx.domain.StudentScoreInput;
|
||||
import cn.iocoder.yudao.module.jx.mapper.StudentScoreInputMapper;
|
||||
import cn.iocoder.yudao.module.jx.service.StudentScoreInputService;
|
||||
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 com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -64,12 +66,17 @@ public class StudentScoreInputServiceImpl implements StudentScoreInputService {
|
||||
@Autowired
|
||||
private SchoolNotifyMessageSendService schoolNotifyMessageSendService;
|
||||
|
||||
@Resource
|
||||
private AdminUserApi userApi;
|
||||
|
||||
/**
|
||||
* 录入学员成绩
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void scoreInput(StudentScoreInput studentScoreInput) {
|
||||
Long userId = SecurityFrameworkUtils.getLoginUserId();
|
||||
AdminUserRespDTO sysUser = userApi.getUser(userId);
|
||||
// 获取当前进度信息,设置考试成绩等信息
|
||||
ProcessVO processVO = BeanUtils.toBean(processService.getById(studentScoreInput.getProcessId()), ProcessVO.class);
|
||||
processVO.setExamStatus(studentScoreInput.getExamStatus());
|
||||
@ -79,6 +86,8 @@ public class StudentScoreInputServiceImpl implements StudentScoreInputService {
|
||||
processVO.setStatus(studentScoreInput.getStatus());
|
||||
processVO.setImages(studentScoreInput.getImages());
|
||||
processVO.setRemark(studentScoreInput.getRemark());
|
||||
processVO.setInputName(sysUser.getNickname());
|
||||
processVO.setInputUserId(sysUser.getId());
|
||||
processService.updateById(processVO);
|
||||
|
||||
// 如果是科2和科3 需要创建批次信息
|
||||
|
@ -58,7 +58,18 @@
|
||||
main.phone AS phone,
|
||||
main.user_id AS userId,
|
||||
dsco.course_type,
|
||||
dsp.`subject`
|
||||
dsp.`subject`,
|
||||
dsco.course_name,
|
||||
dsco.payment_status,
|
||||
dsco.cashier_confirm,
|
||||
dsco.pay_type,
|
||||
dsco.pay_channel,
|
||||
dsco.cashier_confirm_remark,
|
||||
dsco.reserve_money,
|
||||
dsco.rest_money,
|
||||
dsco.if_end,
|
||||
dsco.create_time AS enrollTime,
|
||||
dsco.user_no AS studentIdCard
|
||||
FROM
|
||||
drive_school_student main
|
||||
LEFT JOIN drive_school_course_order dsco ON main.user_id = dsco.user_id
|
||||
@ -463,6 +474,7 @@
|
||||
<select id="indexGetTrainList" resultType="cn.iocoder.yudao.module.base.vo.StudentCountVO">
|
||||
SELECT
|
||||
c.id,
|
||||
c.user_id AS coachId,
|
||||
c.image AS image,
|
||||
c.NAME AS coachName,
|
||||
c.car_id AS carId,
|
||||
|
@ -52,4 +52,53 @@
|
||||
</if>
|
||||
ORDER BY dsc.create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="getSchoolCommissionById" resultType="cn.iocoder.yudao.module.course.vo.SchoolCommissionVO">
|
||||
SELECT
|
||||
main.*,
|
||||
dsc.name AS courseName,
|
||||
dsc.type AS courseType
|
||||
FROM
|
||||
drive_school_commission main
|
||||
LEFT JOIN drive_school_course dsc ON main.course_id = dsc.id AND dsc.deleted = 0
|
||||
WHERE main.deleted = 0 AND main.id = #{id}
|
||||
order by main.create_time desc
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getCoachTotalCommission" resultType="cn.iocoder.yudao.module.course.vo.SchoolCommissionVO">
|
||||
SELECT coach_user_id,coach_name, SUM(commission_amount) AS commissionAmount FROM drive_school_commission
|
||||
WHERE deleted = 0
|
||||
<if test="entity.coachUserId!=null and entity.coachUserId!=''">
|
||||
AND coach_user_id = #{entity.coachUserId}
|
||||
</if>
|
||||
<if test="entity.ifPay!=null and entity.ifPay!=''">
|
||||
AND if_pay = #{entity.ifPay}
|
||||
</if>
|
||||
<if test="entity.startTimeStr!=null and entity.startTimeStr!='' ">
|
||||
AND create_time >= #{entity.startTimeStr}
|
||||
</if>
|
||||
<if test="entity.endTimeStr!=null and entity.endTimeStr!='' ">
|
||||
AND create_time <= #{entity.endTimeStr}
|
||||
</if>
|
||||
GROUP BY coach_user_id
|
||||
</select>
|
||||
|
||||
<select id="getCommissionListByCoachId" resultType="cn.iocoder.yudao.module.course.vo.SchoolCommissionVO">
|
||||
SELECT course.name AS courseName, course.type AS courseType, dsc.* FROM drive_school_commission dsc
|
||||
LEFT JOIN drive_school_course course ON dsc.course_id = course.id AND course.deleted = 0
|
||||
WHERE dsc.deleted = 0
|
||||
<if test="entity.coachUserId!=null and entity.coachUserId!=''">
|
||||
AND dsc.coach_user_id = #{entity.coachUserId}
|
||||
</if>
|
||||
<if test="entity.ifPay!=null and entity.ifPay!=''">
|
||||
AND dsc.if_pay = #{entity.ifPay}
|
||||
</if>
|
||||
<if test="entity.startTimeStr!=null and entity.startTimeStr!='' ">
|
||||
AND dsc.create_time >= #{entity.startTimeStr}
|
||||
</if>
|
||||
<if test="entity.endTimeStr!=null and entity.endTimeStr!='' ">
|
||||
AND dsc.create_time <= #{entity.endTimeStr}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -58,6 +58,7 @@
|
||||
</where>
|
||||
order by main.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectByCoachUserId" resultType="java.lang.Double">
|
||||
SELECT
|
||||
SUM(dsco.reserve_money+dsco.rest_money )
|
||||
@ -81,6 +82,30 @@
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectByCoachUserIdIsConfirmed" resultType="java.lang.Double">
|
||||
SELECT
|
||||
SUM(dsco.reserve_money+dsco.rest_money )
|
||||
FROM
|
||||
drive_school_course_order dsco
|
||||
<if test="coachId != null and coachId != ''">
|
||||
LEFT JOIN drive_school_student dss ON dsco.user_id = dss.user_id
|
||||
AND dss.deleted = 0
|
||||
</if>
|
||||
WHERE
|
||||
dsco.deleted = 0
|
||||
AND dsco.payment_status IN ( '2', '3', '4', '5' )
|
||||
AND dsco.cashier_confirm = 1
|
||||
<if test="coachId != null and coachId != ''">
|
||||
AND dss.source_user_id = #{coachId}
|
||||
</if>
|
||||
<if test="startTime!=null and startTime!=''">
|
||||
AND dsco.create_time >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime!=null and endTime!=''">
|
||||
AND dsco.create_time <= #{endTime}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getOrderInfo" resultType="cn.iocoder.yudao.module.course.vo.SchoolCourseOrderVO">
|
||||
SELECT *
|
||||
@ -88,12 +113,12 @@
|
||||
WHERE user_id = #{userId}
|
||||
AND payment_status IN (2, 3, 4, 5)
|
||||
AND if_end = 0
|
||||
AND if_assignment_coach = 1
|
||||
|
||||
AND deleted = 0
|
||||
ORDER BY create_time DESC
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
<!-- AND if_assignment_coach = 1 -->
|
||||
<insert id="createStudentUsers" parameterType="cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO system_users (username,
|
||||
password,
|
||||
@ -139,4 +164,126 @@
|
||||
WHERE scheme_id=#{schemeId}
|
||||
AND deleted = 0
|
||||
</select>
|
||||
|
||||
<!--<select id="getOrderByCoachId" resultType="cn.iocoder.yudao.module.course.vo.SchoolCourseOrderVO">
|
||||
SELECT dsco.* FROM drive_school_student dss
|
||||
LEFT JOIN drive_school_course_order dsco ON dsco.user_id = dss.user_id AND dsco.deleted = 0
|
||||
WHERE dss.deleted = 0
|
||||
<if test="entity.coachUserId!= null and entity.coachUserId!= ''">
|
||||
AND dss.source_user_id = #{entity.coachUserId}
|
||||
</if>
|
||||
<if test="entity.source!= null and entity.source!= ''">
|
||||
AND dss.source = #{entity.source}
|
||||
</if>
|
||||
<if test="entity.userName != null and entity.userName != '' ">
|
||||
AND dsco.user_name like concat('%', #{entity.userName}, '%')
|
||||
</if>
|
||||
<if test="entity.startTimeStr!=null and entity.startTimeStr!='' ">
|
||||
AND dsco.create_time >= #{entity.startTimeStr}
|
||||
</if>
|
||||
<if test="entity.endTimeStr!=null and entity.endTimeStr!='' ">
|
||||
AND dsco.create_time <= #{entity.endTimeStr}
|
||||
</if>
|
||||
<choose>
|
||||
<when test="sort=='asc'">
|
||||
ORDER BY
|
||||
dsco.create_time ASC
|
||||
</when>
|
||||
<otherwise>
|
||||
ORDER BY
|
||||
dsco.create_time DESC
|
||||
</otherwise>
|
||||
</choose>
|
||||
</select>-->
|
||||
|
||||
<select id="getOrderByCoachId" resultType="cn.iocoder.yudao.module.course.vo.SchoolCourseOrderVO">
|
||||
SELECT dsco.* FROM drive_school_course_order dsco
|
||||
LEFT JOIN drive_school_student dss ON dsco.user_id = dss.user_id AND dss.deleted = 0
|
||||
WHERE dsco.deleted = 0
|
||||
<if test="entity.coachUserId!= null and entity.coachUserId!= ''">
|
||||
AND dss.source_user_id = #{entity.coachUserId}
|
||||
</if>
|
||||
<if test="entity.source!= null and entity.source!= ''">
|
||||
AND dss.source = #{entity.source}
|
||||
</if>
|
||||
<if test="entity.userName != null and entity.userName != '' ">
|
||||
AND dsco.user_name like concat('%', #{entity.userName}, '%')
|
||||
</if>
|
||||
<if test="entity.startTimeStr!=null and entity.startTimeStr!='' ">
|
||||
AND dsco.create_time >= #{entity.startTimeStr}
|
||||
</if>
|
||||
<if test="entity.endTimeStr!=null and entity.endTimeStr!='' ">
|
||||
AND dsco.create_time <= #{entity.endTimeStr}
|
||||
</if>
|
||||
<choose>
|
||||
<when test="entity.sort=='asc'">
|
||||
ORDER BY
|
||||
dsco.create_time ASC
|
||||
</when>
|
||||
<otherwise>
|
||||
ORDER BY
|
||||
dsco.create_time DESC
|
||||
</otherwise>
|
||||
</choose>
|
||||
</select>
|
||||
|
||||
<select id="getCoachMoney" resultType="cn.iocoder.yudao.module.course.vo.SchoolCourseOrderVO">
|
||||
SELECT dsc.user_id AS coachUserId,dsc.name AS coachUserName,
|
||||
SUM(COALESCE(dsco.reserve_money, 0) + COALESCE(dsco.rest_money, 0)) AS totalPrice
|
||||
FROM drive_school_course_order dsco
|
||||
LEFT JOIN drive_school_student dss ON dss.user_id = dsco.user_id AND dss.deleted = 0
|
||||
LEFT JOIN drive_school_coach dsc ON dsc.user_id = dss.source_user_id AND dsc.deleted = 0
|
||||
WHERE dsco.deleted = 0
|
||||
<if test="entity.cashierConfirm != null and entity.cashierConfirm != '' ">
|
||||
<choose>
|
||||
<when test="entity.cashierConfirm == 0">
|
||||
AND (dsco.cashier_confirm IS NULL OR dsco.cashier_confirm = #{entity.cashierConfirm})
|
||||
</when>
|
||||
<otherwise>
|
||||
AND dsco.cashier_confirm = #{entity.cashierConfirm}
|
||||
</otherwise>
|
||||
</choose>
|
||||
</if>
|
||||
<if test="entity.coachUserId!= null and entity.coachUserId!= ''">
|
||||
AND dss.source_user_id = #{entity.coachUserId}
|
||||
</if>
|
||||
<if test="entity.source!= null and entity.source!= ''">
|
||||
AND dss.source = #{entity.source}
|
||||
</if>
|
||||
<if test="entity.startTimeStr!=null and entity.startTimeStr!='' ">
|
||||
AND dsco.create_time >= #{entity.startTimeStr}
|
||||
</if>
|
||||
<if test="entity.endTimeStr!=null and entity.endTimeStr!='' ">
|
||||
AND dsco.create_time <= #{entity.endTimeStr}
|
||||
</if>
|
||||
GROUP BY dsc.user_id
|
||||
ORDER BY totalPrice DESC
|
||||
</select>
|
||||
|
||||
<select id="getOrderMoneyByCoachId" resultType="cn.iocoder.yudao.module.course.vo.SchoolCourseOrderVO">
|
||||
SELECT dsco.* FROM drive_school_course_order dsco
|
||||
LEFT JOIN drive_school_student dss ON dsco.user_id = dss.user_id AND dss.deleted = 0
|
||||
where dsco.deleted = 0 AND dsco.payment_status IN ( '2', '3', '4', '5' ) AND dsco.is_sign = 1
|
||||
<if test="entity.coachUserId!=null and entity.coachUserId!='' ">
|
||||
AND dss.source_user_id = #{entity.coachUserId}
|
||||
</if>
|
||||
<if test="entity.cashierConfirm != null and entity.cashierConfirm != '' ">
|
||||
<choose>
|
||||
<when test="entity.cashierConfirm == 0">
|
||||
AND (dsco.cashier_confirm IS NULL OR dsco.cashier_confirm = #{entity.cashierConfirm})
|
||||
</when>
|
||||
<otherwise>
|
||||
AND dsco.cashier_confirm = #{entity.cashierConfirm}
|
||||
</otherwise>
|
||||
</choose>
|
||||
</if>
|
||||
<if test="entity.startTimeStr!=null and entity.startTimeStr!='' ">
|
||||
AND dsco.create_time >= #{entity.startTimeStr}
|
||||
</if>
|
||||
<if test="entity.endTimeStr!=null and entity.endTimeStr!='' ">
|
||||
AND dsco.create_time <= #{entity.endTimeStr}
|
||||
</if>
|
||||
GROUP BY dss.user_id
|
||||
ORDER BY dss.create_time DESC
|
||||
</select>
|
||||
</mapper>
|
||||
|
Loading…
Reference in New Issue
Block a user