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_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);
|
driveSchoolCourseDeductService.add(list);
|
||||||
return CommonResult.ok();
|
return CommonResult.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -255,17 +255,28 @@ public class DataViewServiceImpl implements DataViewService {
|
|||||||
/*4.财务情况--*/
|
/*4.财务情况--*/
|
||||||
//应收
|
//应收
|
||||||
Double showedReceive = courseOrderMapper.selectByCoachUserId(coachId, startTimeStr, endTimeStr);
|
Double showedReceive = courseOrderMapper.selectByCoachUserId(coachId, startTimeStr, endTimeStr);
|
||||||
|
// 已确认收款
|
||||||
|
Double showedIsConfirmedReceive = courseOrderMapper.selectByCoachUserIdIsConfirmed(coachId, startTimeStr, endTimeStr);
|
||||||
//应付
|
//应付
|
||||||
List<SchoolCommission> schoolCommissionList = commissionMapper.selectByCoachId(coachId, startTimeStr, endTimeStr);
|
List<SchoolCommission> schoolCommissionList = commissionMapper.selectByCoachId(coachId, startTimeStr, endTimeStr);
|
||||||
double showedPay = 0.0;
|
double showedPay = 0.0;
|
||||||
|
double showedPayIsPaid = 0.0;
|
||||||
for (SchoolCommission item : schoolCommissionList) {
|
for (SchoolCommission item : schoolCommissionList) {
|
||||||
if (null != item.getCommissionAmount()) {
|
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<>();
|
Map<String, Object> moneyInfoMap = new HashMap<>();
|
||||||
moneyInfoMap.put("inAmount", null == showedReceive ? 0 : showedReceive);
|
moneyInfoMap.put("inAmount", null == showedReceive ? 0 : showedReceive);
|
||||||
moneyInfoMap.put("outAmount", showedPay);
|
moneyInfoMap.put("outAmount", showedPay);
|
||||||
|
moneyInfoMap.put("confirmedReceive", null == showedIsConfirmedReceive ? 0 : showedIsConfirmedReceive);
|
||||||
|
moneyInfoMap.put("showedPayIsPaid", showedPayIsPaid);
|
||||||
rtnObj.setMoneyInfo(moneyInfoMap);
|
rtnObj.setMoneyInfo(moneyInfoMap);
|
||||||
} else if ("coach".equals(type)) {
|
} else if ("coach".equals(type)) {
|
||||||
//教练查询
|
//教练查询
|
||||||
@ -323,8 +334,11 @@ public class DataViewServiceImpl implements DataViewService {
|
|||||||
rtnObj.setMoneyInfo(moneyInfoMap);
|
rtnObj.setMoneyInfo(moneyInfoMap);
|
||||||
}
|
}
|
||||||
/*2.训练情况*/
|
/*2.训练情况*/
|
||||||
List<TrainVO> allTrainList = trainMapper.selectTrainByCondition(coachId, startTimeStr, endTimeStr);
|
// List<TrainVO> allTrainList = trainMapper.selectTrainByCondition(coachId, startTimeStr, endTimeStr);
|
||||||
//所有车辆set,目的是去重
|
//所有车辆set,目的是去重
|
||||||
|
List<TrainVO> allTrainList = Optional.ofNullable(
|
||||||
|
trainMapper.selectTrainByCondition(coachId, startTimeStr, endTimeStr)
|
||||||
|
).orElse(Collections.emptyList());
|
||||||
Set<String> allCarSet = new HashSet<>();
|
Set<String> allCarSet = new HashSet<>();
|
||||||
Set<String> subject2CarSet = new HashSet<>();
|
Set<String> subject2CarSet = new HashSet<>();
|
||||||
Set<String> subject3CarSet = new HashSet<>();
|
Set<String> subject3CarSet = new HashSet<>();
|
||||||
@ -332,6 +346,13 @@ public class DataViewServiceImpl implements DataViewService {
|
|||||||
Set<Long> subject2UserSet = new HashSet<>();
|
Set<Long> subject2UserSet = new HashSet<>();
|
||||||
Set<Long> subject3UserSet = new HashSet<>();
|
Set<Long> subject3UserSet = new HashSet<>();
|
||||||
for (TrainVO trainVO : allTrainList) {
|
for (TrainVO trainVO : allTrainList) {
|
||||||
|
if (trainVO == null
|
||||||
|
|| trainVO.getSubject() == null
|
||||||
|
|| trainVO.getCarNo() == null
|
||||||
|
|| trainVO.getUserId() == null
|
||||||
|
|| trainVO.getCourseId() == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (2 == trainVO.getSubject()) {
|
if (2 == trainVO.getSubject()) {
|
||||||
subject2CarSet.add(trainVO.getCarNo());
|
subject2CarSet.add(trainVO.getCarNo());
|
||||||
allCarSet.add(trainVO.getCarNo());
|
allCarSet.add(trainVO.getCarNo());
|
||||||
|
|||||||
@ -457,7 +457,6 @@ public class DlDriveSchoolStudentServiceImpl extends ServiceImpl<DlDriveSchoolSt
|
|||||||
//自来的学生
|
//自来的学生
|
||||||
return dlDriveSchoolStudentMapper.indexCusStudentList(startTime, endTime);
|
return dlDriveSchoolStudentMapper.indexCusStudentList(startTime, endTime);
|
||||||
} else if ("04".equals(type)) {
|
} else if ("04".equals(type)) {
|
||||||
//自来的学生
|
|
||||||
return dlDriveSchoolStudentMapper.indexGetTrainList(type, coachId, startTime, endTime);
|
return dlDriveSchoolStudentMapper.indexGetTrainList(type, coachId, startTime, endTime);
|
||||||
} else {
|
} else {
|
||||||
return dlDriveSchoolStudentMapper.indexGetTrainList(type, coachId, startTime, endTime);
|
return dlDriveSchoolStudentMapper.indexGetTrainList(type, coachId, startTime, endTime);
|
||||||
|
|||||||
@ -71,4 +71,27 @@ public class DlDriveSchoolStaffVO {
|
|||||||
|
|
||||||
/**总招生数*/
|
/**总招生数*/
|
||||||
private Integer studentTotalNum;
|
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
|
@Data
|
||||||
public class StudentCountVO {
|
public class StudentCountVO {
|
||||||
|
/**教练Id */
|
||||||
|
private Long coachId;
|
||||||
/**教练头像*/
|
/**教练头像*/
|
||||||
private String image;
|
private String image;
|
||||||
/**姓名*/
|
/**姓名*/
|
||||||
|
|||||||
@ -1,11 +1,15 @@
|
|||||||
package cn.iocoder.yudao.module.course.controller.admin;
|
package cn.iocoder.yudao.module.course.controller.admin;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
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.service.SchoolCommissionService;
|
||||||
import cn.iocoder.yudao.module.course.vo.SchoolCommissionVO;
|
import cn.iocoder.yudao.module.course.vo.SchoolCommissionVO;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@ -13,6 +17,8 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
@Tag(name = "管理后台 - 提成记录")
|
@Tag(name = "管理后台 - 提成记录")
|
||||||
@ -51,15 +57,41 @@ public class SchoolCommissionController {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// @GetMapping("/get")
|
@GetMapping("/get")
|
||||||
// @Operation(summary = "获得提成记录")
|
@Operation(summary = "获得提成记录")
|
||||||
// @Parameter(name = "id", description = "编号", required = true, example = "1024")
|
public CommonResult<SchoolCommissionVO> getSchoolCommission(@RequestParam("id") String id) {
|
||||||
// @PreAuthorize("@ss.hasPermission('drive:school-commission:query')")
|
return success(schoolCommissionService.getSchoolCommissionById(id));
|
||||||
// public CommonResult<SchoolCommissionVO> getSchoolCommission(@RequestParam("id") String id) {
|
}
|
||||||
//// SchoolCommissionDO schoolCommission = schoolCommissionService.getSchoolCommission(id);
|
|
||||||
// return success(BeanUtils.toBean(schoolCommission, SchoolCommissionRespVO.class));
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出纳审核提成记录
|
||||||
|
* @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));
|
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 courseType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 成绩录入人
|
||||||
|
*/
|
||||||
|
private String inputName;
|
||||||
|
/**
|
||||||
|
* 成绩录入人id
|
||||||
|
*/
|
||||||
|
private Long inputUserId;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
|||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -85,4 +86,29 @@ public class SchoolCommission extends TenantBaseDO {
|
|||||||
*/
|
*/
|
||||||
private String checkRemark;
|
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 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);
|
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.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 驾照报名订单 Mapper
|
* 驾照报名订单 Mapper
|
||||||
*
|
*
|
||||||
@ -41,6 +43,7 @@ public interface SchoolCourseOrderMapper extends BaseMapper<SchoolCourseOrder> {
|
|||||||
* @return java.util.List<cn.iocoder.yudao.module.course.vo.SchoolCourseOrderVO>
|
* @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 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);
|
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.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提成记录 Service 接口
|
* 提成记录 Service 接口
|
||||||
*
|
*
|
||||||
@ -35,4 +37,24 @@ public interface SchoolCommissionService extends IService<SchoolCommission> {
|
|||||||
*/
|
*/
|
||||||
boolean exists(SchoolCommission entity);
|
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);
|
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()
|
Wrappers.<DriveSchoolCourseDeduct>lambdaQuery()
|
||||||
.eq(DriveSchoolCourseDeduct::getCourseId, process.getCourseId())
|
.eq(DriveSchoolCourseDeduct::getCourseId, process.getCourseId())
|
||||||
.eq(DriveSchoolCourseDeduct::getCourseSubject, process.getSubject())
|
.eq(DriveSchoolCourseDeduct::getCourseSubject, process.getSubject())
|
||||||
);
|
);*/
|
||||||
|
|
||||||
// 如果存在提成规则
|
// 如果存在提成规则
|
||||||
if (deduct != null) {
|
if (process.getCoachCommission() != null) {
|
||||||
// 构建提成记录对象
|
// 构建提成记录对象
|
||||||
SchoolCommission schoolCommission = new SchoolCommission();
|
SchoolCommission schoolCommission = new SchoolCommission();
|
||||||
schoolCommission.setCoachUserId(oldProcess.getCoachId());
|
schoolCommission.setCoachUserId(oldProcess.getCoachId());
|
||||||
schoolCommission.setCoachName(oldProcess.getCoachName());
|
schoolCommission.setCoachName(oldProcess.getCoachName());
|
||||||
schoolCommission.setStudentId(oldProcess.getUserId());
|
schoolCommission.setStudentId(oldProcess.getUserId());
|
||||||
schoolCommission.setStudentName(oldProcess.getUserName());
|
schoolCommission.setStudentName(oldProcess.getUserName());
|
||||||
schoolCommission.setCommissionAmount(deduct.getDeduct());
|
schoolCommission.setCommissionAmount(process.getCoachCommission());
|
||||||
schoolCommission.setCourseId(oldProcess.getCourseId());
|
schoolCommission.setCourseId(oldProcess.getCourseId());
|
||||||
schoolCommission.setSubject(String.valueOf(oldProcess.getSubject()));
|
schoolCommission.setSubject(String.valueOf(oldProcess.getSubject()));
|
||||||
schoolCommission.setCheckId(sysUser.getId());
|
schoolCommission.setCheckId(sysUser.getId());
|
||||||
schoolCommission.setCheckName(sysUser.getNickname());
|
schoolCommission.setCheckName(sysUser.getNickname());
|
||||||
schoolCommission.setCheckRemark(process.getFinanceRemark());
|
schoolCommission.setCheckRemark(process.getFinanceRemark());
|
||||||
|
schoolCommission.setStudentIdCard(process.getStudentIdCard());
|
||||||
|
|
||||||
// 检查是否已存在记录
|
// 检查是否已存在记录
|
||||||
SchoolCommission existing = schoolCommissionService.getOne(
|
SchoolCommission existing = schoolCommissionService.getOne(
|
||||||
@ -422,6 +423,18 @@ public class ProcessServiceImpl extends ServiceImpl<ProcessMapper, Process> impl
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else if (process.getFinancePass()) {
|
} 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);
|
schoolCommission.setDeleted(false);
|
||||||
schoolCommissionService.save(schoolCommission);
|
schoolCommissionService.save(schoolCommission);
|
||||||
@ -811,6 +824,7 @@ public class ProcessServiceImpl extends ServiceImpl<ProcessMapper, Process> impl
|
|||||||
BigDecimal studentPay = BigDecimal.ZERO;
|
BigDecimal studentPay = BigDecimal.ZERO;
|
||||||
BigDecimal studentRemainingPay = BigDecimal.ZERO;
|
BigDecimal studentRemainingPay = BigDecimal.ZERO;
|
||||||
String studentIdCard = null;
|
String studentIdCard = null;
|
||||||
|
String cashierConfirm = null;
|
||||||
if (!courseByInfo.isEmpty()) {
|
if (!courseByInfo.isEmpty()) {
|
||||||
studentPay = courseByInfo.get(0).getReserveMoney() != null ?
|
studentPay = courseByInfo.get(0).getReserveMoney() != null ?
|
||||||
courseByInfo.get(0).getReserveMoney() : BigDecimal.ZERO;
|
courseByInfo.get(0).getReserveMoney() : BigDecimal.ZERO;
|
||||||
@ -818,11 +832,15 @@ public class ProcessServiceImpl extends ServiceImpl<ProcessMapper, Process> impl
|
|||||||
courseByInfo.get(0).getRestMoney() : BigDecimal.ZERO;
|
courseByInfo.get(0).getRestMoney() : BigDecimal.ZERO;
|
||||||
studentIdCard = courseByInfo.get(0).getUserNo() != null ?
|
studentIdCard = courseByInfo.get(0).getUserNo() != null ?
|
||||||
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.setCoachCommission(deduct);
|
||||||
processVO.setStudentPay(studentPay);
|
processVO.setStudentPay(studentPay);
|
||||||
processVO.setStudentRemainingPay(studentRemainingPay);
|
processVO.setStudentRemainingPay(studentRemainingPay);
|
||||||
processVO.setStudentIdCard(studentIdCard);
|
processVO.setStudentIdCard(studentIdCard);
|
||||||
|
processVO.setCashierConfirm(cashierConfirm);
|
||||||
List<Process> list = this.lambdaQuery()
|
List<Process> list = this.lambdaQuery()
|
||||||
.eq(Process::getCoachId, processVO.getCoachId())
|
.eq(Process::getCoachId, processVO.getCoachId())
|
||||||
.eq(Process::getCourseId, processVO.getCourseId())
|
.eq(Process::getCourseId, processVO.getCourseId())
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package cn.iocoder.yudao.module.course.service.impl;
|
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.framework.security.core.util.SecurityFrameworkUtils;
|
||||||
import cn.iocoder.yudao.module.course.entity.SchoolCommission;
|
import cn.iocoder.yudao.module.course.entity.SchoolCommission;
|
||||||
import cn.iocoder.yudao.module.course.mapper.SchoolCommissionMapper;
|
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.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.validation.annotation.Validated;
|
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 cn.iocoder.yudao.framework.common.exception.ServiceException;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提成记录 Service 实现类
|
* 提成记录 Service 实现类
|
||||||
@ -81,4 +85,80 @@ public class SchoolCommissionServiceImpl extends ServiceImpl<SchoolCommissionMap
|
|||||||
.eq(SchoolCommission::getSubject, entity.getSubject())
|
.eq(SchoolCommission::getSubject, entity.getSubject())
|
||||||
.exists();
|
.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;
|
package cn.iocoder.yudao.module.course.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
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.common.util.object.BeanUtils;
|
||||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||||
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
|
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
|
||||||
import cn.iocoder.yudao.module.base.constant.SchoolBaseConstants;
|
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.entity.DlDriveSchoolStudent;
|
||||||
import cn.iocoder.yudao.module.base.service.DlDriveSchoolCourseService;
|
import cn.iocoder.yudao.module.base.service.DlDriveSchoolCourseService;
|
||||||
import cn.iocoder.yudao.module.base.service.DlDriveSchoolStudentService;
|
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.base.vo.DlDriveSchoolStudentVO;
|
||||||
import cn.iocoder.yudao.module.course.entity.Process;
|
import cn.iocoder.yudao.module.course.entity.Process;
|
||||||
import cn.iocoder.yudao.module.course.entity.SchoolCourseOrder;
|
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.mapper.SchoolCourseOrderMapper;
|
||||||
import cn.iocoder.yudao.module.course.service.ProcessService;
|
import cn.iocoder.yudao.module.course.service.ProcessService;
|
||||||
import cn.iocoder.yudao.module.course.service.SchoolCourseOrderService;
|
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.SchoolCommissionVO;
|
||||||
import cn.iocoder.yudao.module.course.vo.SchoolCourseOrderBusinessVO;
|
import cn.iocoder.yudao.module.course.vo.SchoolCourseOrderBusinessVO;
|
||||||
import cn.iocoder.yudao.module.course.vo.SchoolCourseOrderVO;
|
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.core.toolkit.Wrappers;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.annotation.Lazy;
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -37,6 +42,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
@ -72,6 +78,9 @@ public class SchoolCourseOrderServiceImpl extends ServiceImpl<SchoolCourseOrderM
|
|||||||
@Resource
|
@Resource
|
||||||
private DlDriveSchoolStudentService schoolStudentService;
|
private DlDriveSchoolStudentService schoolStudentService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private SchoolCourseSchemeService schoolCourseSchemeService;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String createSchoolCourseOrder(SchoolCourseOrderVO createReqVO) {
|
public String createSchoolCourseOrder(SchoolCourseOrderVO createReqVO) {
|
||||||
@ -308,6 +317,9 @@ public class SchoolCourseOrderServiceImpl extends ServiceImpl<SchoolCourseOrderM
|
|||||||
// .eq(Process::getCourseId, oldOrder.getCourseId()));
|
// .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 schoolCourseOrder = BeanUtil.copyProperties(oldOrder, SchoolCourseOrder.class);
|
||||||
schoolCourseOrder.setOldOrderId(oldOrder.getId());
|
schoolCourseOrder.setOldOrderId(oldOrder.getId());
|
||||||
//生成订单号
|
//生成订单号
|
||||||
@ -317,6 +329,7 @@ public class SchoolCourseOrderServiceImpl extends ServiceImpl<SchoolCourseOrderM
|
|||||||
schoolCourseOrder.setCourseType(createReqVO.getCourseType());
|
schoolCourseOrder.setCourseType(createReqVO.getCourseType());
|
||||||
schoolCourseOrder.setCoachUserId(createReqVO.getCoachUserId());
|
schoolCourseOrder.setCoachUserId(createReqVO.getCoachUserId());
|
||||||
schoolCourseOrder.setCoachUserName(createReqVO.getCoachUserName());
|
schoolCourseOrder.setCoachUserName(createReqVO.getCoachUserName());
|
||||||
|
schoolCourseOrder.setSchemeId(schemeId);
|
||||||
|
|
||||||
schoolCourseOrder.setId(null);
|
schoolCourseOrder.setId(null);
|
||||||
schoolCourseOrder.setCreateTime(null);
|
schoolCourseOrder.setCreateTime(null);
|
||||||
@ -535,4 +548,93 @@ public class SchoolCourseOrderServiceImpl extends ServiceImpl<SchoolCourseOrderM
|
|||||||
return schoolCourseOrderMapper.getOrderCountBySchemeId(schemeId);
|
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 List<Process> processList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出纳确认情况
|
||||||
|
*/
|
||||||
|
private String cashierConfirm;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,4 +16,12 @@ public class SchoolCommissionVO extends SchoolCommission {
|
|||||||
/**课程类型*/
|
/**课程类型*/
|
||||||
private String courseType;
|
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 io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
@Schema(description = "管理后台 - 驾照报名订单 Response VO")
|
@Schema(description = "管理后台 - 驾照报名订单 Response VO")
|
||||||
@Data
|
@Data
|
||||||
@ExcelIgnoreUnannotated
|
@ExcelIgnoreUnannotated
|
||||||
@ -21,4 +23,22 @@ public class SchoolCourseOrderVO extends SchoolCourseOrder {
|
|||||||
* 课程类型
|
* 课程类型
|
||||||
*/
|
*/
|
||||||
private String type;
|
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.mapper.StudentScoreInputMapper;
|
||||||
import cn.iocoder.yudao.module.jx.service.StudentScoreInputService;
|
import cn.iocoder.yudao.module.jx.service.StudentScoreInputService;
|
||||||
import cn.iocoder.yudao.module.system.api.permission.RoleApi;
|
import cn.iocoder.yudao.module.system.api.permission.RoleApi;
|
||||||
|
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||||
|
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
||||||
import cn.iocoder.yudao.module.system.api.user.dto.UserDTO;
|
import cn.iocoder.yudao.module.system.api.user.dto.UserDTO;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -64,12 +66,17 @@ public class StudentScoreInputServiceImpl implements StudentScoreInputService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private SchoolNotifyMessageSendService schoolNotifyMessageSendService;
|
private SchoolNotifyMessageSendService schoolNotifyMessageSendService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private AdminUserApi userApi;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 录入学员成绩
|
* 录入学员成绩
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void scoreInput(StudentScoreInput studentScoreInput) {
|
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 processVO = BeanUtils.toBean(processService.getById(studentScoreInput.getProcessId()), ProcessVO.class);
|
||||||
processVO.setExamStatus(studentScoreInput.getExamStatus());
|
processVO.setExamStatus(studentScoreInput.getExamStatus());
|
||||||
@ -79,6 +86,8 @@ public class StudentScoreInputServiceImpl implements StudentScoreInputService {
|
|||||||
processVO.setStatus(studentScoreInput.getStatus());
|
processVO.setStatus(studentScoreInput.getStatus());
|
||||||
processVO.setImages(studentScoreInput.getImages());
|
processVO.setImages(studentScoreInput.getImages());
|
||||||
processVO.setRemark(studentScoreInput.getRemark());
|
processVO.setRemark(studentScoreInput.getRemark());
|
||||||
|
processVO.setInputName(sysUser.getNickname());
|
||||||
|
processVO.setInputUserId(sysUser.getId());
|
||||||
processService.updateById(processVO);
|
processService.updateById(processVO);
|
||||||
|
|
||||||
// 如果是科2和科3 需要创建批次信息
|
// 如果是科2和科3 需要创建批次信息
|
||||||
|
|||||||
@ -58,7 +58,18 @@
|
|||||||
main.phone AS phone,
|
main.phone AS phone,
|
||||||
main.user_id AS userId,
|
main.user_id AS userId,
|
||||||
dsco.course_type,
|
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
|
FROM
|
||||||
drive_school_student main
|
drive_school_student main
|
||||||
LEFT JOIN drive_school_course_order dsco ON main.user_id = dsco.user_id
|
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 id="indexGetTrainList" resultType="cn.iocoder.yudao.module.base.vo.StudentCountVO">
|
||||||
SELECT
|
SELECT
|
||||||
c.id,
|
c.id,
|
||||||
|
c.user_id AS coachId,
|
||||||
c.image AS image,
|
c.image AS image,
|
||||||
c.NAME AS coachName,
|
c.NAME AS coachName,
|
||||||
c.car_id AS carId,
|
c.car_id AS carId,
|
||||||
|
|||||||
@ -52,4 +52,53 @@
|
|||||||
</if>
|
</if>
|
||||||
ORDER BY dsc.create_time DESC
|
ORDER BY dsc.create_time DESC
|
||||||
</select>
|
</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>
|
</mapper>
|
||||||
|
|||||||
@ -58,6 +58,7 @@
|
|||||||
</where>
|
</where>
|
||||||
order by main.create_time desc
|
order by main.create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectByCoachUserId" resultType="java.lang.Double">
|
<select id="selectByCoachUserId" resultType="java.lang.Double">
|
||||||
SELECT
|
SELECT
|
||||||
SUM(dsco.reserve_money+dsco.rest_money )
|
SUM(dsco.reserve_money+dsco.rest_money )
|
||||||
@ -81,6 +82,30 @@
|
|||||||
</if>
|
</if>
|
||||||
</select>
|
</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 id="getOrderInfo" resultType="cn.iocoder.yudao.module.course.vo.SchoolCourseOrderVO">
|
||||||
SELECT *
|
SELECT *
|
||||||
@ -88,12 +113,12 @@
|
|||||||
WHERE user_id = #{userId}
|
WHERE user_id = #{userId}
|
||||||
AND payment_status IN (2, 3, 4, 5)
|
AND payment_status IN (2, 3, 4, 5)
|
||||||
AND if_end = 0
|
AND if_end = 0
|
||||||
AND if_assignment_coach = 1
|
|
||||||
AND deleted = 0
|
AND deleted = 0
|
||||||
ORDER BY create_time DESC
|
ORDER BY create_time DESC
|
||||||
LIMIT 1
|
LIMIT 1
|
||||||
</select>
|
</select>
|
||||||
|
<!-- AND if_assignment_coach = 1 -->
|
||||||
<insert id="createStudentUsers" parameterType="cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO" useGeneratedKeys="true" keyProperty="id">
|
<insert id="createStudentUsers" parameterType="cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO" useGeneratedKeys="true" keyProperty="id">
|
||||||
INSERT INTO system_users (username,
|
INSERT INTO system_users (username,
|
||||||
password,
|
password,
|
||||||
@ -139,4 +164,126 @@
|
|||||||
WHERE scheme_id=#{schemeId}
|
WHERE scheme_id=#{schemeId}
|
||||||
AND deleted = 0
|
AND deleted = 0
|
||||||
</select>
|
</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>
|
</mapper>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user