0710
This commit is contained in:
parent
32ab7f6652
commit
a56b551975
@ -323,6 +323,11 @@ public class DlDriveSchoolCoachController {
|
|||||||
return success(dlDriveSchoolCoachService.getBusinessRecordExportData(exportVO, page));
|
return success(dlDriveSchoolCoachService.getBusinessRecordExportData(exportVO, page));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getBusinessRecordExportCount")
|
||||||
|
public CommonResult<BusinessRecordExportCountVO> getBusinessRecordExportCount(BusinessRecordExportVO exportVO) {
|
||||||
|
return success(dlDriveSchoolCoachService.getBusinessRecordExportCount(exportVO));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出
|
* 导出
|
||||||
* @param exportVO
|
* @param exportVO
|
||||||
|
|||||||
@ -162,6 +162,7 @@ public interface DlDriveSchoolCoachService extends IService<DlDriveSchoolCoach>
|
|||||||
* 获取导出数据列表
|
* 获取导出数据列表
|
||||||
*/
|
*/
|
||||||
IPage<BusinessRecordExportVO> getBusinessRecordExportData(BusinessRecordExportVO reqVO, Page<BusinessRecordExportVO> page);
|
IPage<BusinessRecordExportVO> getBusinessRecordExportData(BusinessRecordExportVO reqVO, Page<BusinessRecordExportVO> page);
|
||||||
|
BusinessRecordExportCountVO getBusinessRecordExportCount(BusinessRecordExportVO reqVO);
|
||||||
/**
|
/**
|
||||||
* 导出的三种形式
|
* 导出的三种形式
|
||||||
* @param exportVO
|
* @param exportVO
|
||||||
|
|||||||
@ -1226,6 +1226,32 @@ public class DlDriveSchoolCoachServiceImpl extends ServiceImpl<DlDriveSchoolCoac
|
|||||||
return businessManager;
|
return businessManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BusinessRecordExportCountVO getBusinessRecordExportCount(BusinessRecordExportVO reqVO) {
|
||||||
|
Page<BusinessRecordExportVO> page = new Page<>(1, Integer.MAX_VALUE);
|
||||||
|
// reqVO.setIsSign(1);
|
||||||
|
reqVO.setIfEnd("0");
|
||||||
|
|
||||||
|
IPage<BusinessRecordExportVO> allData = this.getBusinessRecordExportData(reqVO, page);
|
||||||
|
List<BusinessRecordExportVO> records = allData.getRecords();
|
||||||
|
|
||||||
|
BusinessRecordExportCountVO result = new BusinessRecordExportCountVO();
|
||||||
|
|
||||||
|
result.setTotalPeople(records.size());
|
||||||
|
|
||||||
|
BigDecimal totalAmount = records.stream()
|
||||||
|
.map(record -> record.getReserveMoney() != null ? record.getReserveMoney() : BigDecimal.ZERO)
|
||||||
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
|
||||||
|
BigDecimal totalSubsidy = records.stream()
|
||||||
|
.map(record -> record.getSubsidy() != null ? record.getSubsidy() : BigDecimal.ZERO)
|
||||||
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
result.setTotalAmount(totalAmount);
|
||||||
|
result.setTotalSubsidy(totalSubsidy);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出的三种形式
|
* 导出的三种形式
|
||||||
*/
|
*/
|
||||||
@ -1234,7 +1260,20 @@ public class DlDriveSchoolCoachServiceImpl extends ServiceImpl<DlDriveSchoolCoac
|
|||||||
// 分页查询当前页
|
// 分页查询当前页
|
||||||
Page<BusinessRecordExportVO> page = new Page<>(exportVO.getPageNo(), exportVO.getPageSize());
|
Page<BusinessRecordExportVO> page = new Page<>(exportVO.getPageNo(), exportVO.getPageSize());
|
||||||
IPage<BusinessRecordExportVO> result = dlDriveSchoolCoachMapper.getBusinessRecordExportData(exportVO, page);
|
IPage<BusinessRecordExportVO> result = dlDriveSchoolCoachMapper.getBusinessRecordExportData(exportVO, page);
|
||||||
return result.getRecords();
|
List<BusinessRecordExportVO> records = result.getRecords();
|
||||||
|
|
||||||
|
// 计算提成
|
||||||
|
for (BusinessRecordExportVO record : records) {
|
||||||
|
BigDecimal deduct = BigDecimal.ZERO;
|
||||||
|
if(record.getScheme() != null){
|
||||||
|
deduct = schemeService.getSchemeById(record.getScheme(), 0);
|
||||||
|
}else{
|
||||||
|
deduct = schemeService.getCourseDeduct(record.getCourseId(), 0);
|
||||||
|
}
|
||||||
|
record.setSubsidy(deduct);
|
||||||
|
}
|
||||||
|
|
||||||
|
return records;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -1242,7 +1281,20 @@ public class DlDriveSchoolCoachServiceImpl extends ServiceImpl<DlDriveSchoolCoac
|
|||||||
// 不分页查询全部数据
|
// 不分页查询全部数据
|
||||||
Page<BusinessRecordExportVO> page = new Page<>(1, Integer.MAX_VALUE);
|
Page<BusinessRecordExportVO> page = new Page<>(1, Integer.MAX_VALUE);
|
||||||
IPage<BusinessRecordExportVO> result = dlDriveSchoolCoachMapper.getBusinessRecordExportData(exportVO, page);
|
IPage<BusinessRecordExportVO> result = dlDriveSchoolCoachMapper.getBusinessRecordExportData(exportVO, page);
|
||||||
return result.getRecords();
|
List<BusinessRecordExportVO> records = result.getRecords();
|
||||||
|
|
||||||
|
// 计算提成
|
||||||
|
for (BusinessRecordExportVO record : records) {
|
||||||
|
BigDecimal deduct = BigDecimal.ZERO;
|
||||||
|
if(record.getScheme() != null){
|
||||||
|
deduct = schemeService.getSchemeById(record.getScheme(), 0);
|
||||||
|
}else{
|
||||||
|
deduct = schemeService.getCourseDeduct(record.getCourseId(), 0);
|
||||||
|
}
|
||||||
|
record.setSubsidy(deduct);
|
||||||
|
}
|
||||||
|
|
||||||
|
return records;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -1253,7 +1305,20 @@ public class DlDriveSchoolCoachServiceImpl extends ServiceImpl<DlDriveSchoolCoac
|
|||||||
for (int i = exportVO.getStartPage(); i <= exportVO.getEndPage(); i++) {
|
for (int i = exportVO.getStartPage(); i <= exportVO.getEndPage(); i++) {
|
||||||
Page<BusinessRecordExportVO> page = new Page<>(i, exportVO.getPageSize());
|
Page<BusinessRecordExportVO> page = new Page<>(i, exportVO.getPageSize());
|
||||||
IPage<BusinessRecordExportVO> result = dlDriveSchoolCoachMapper.getBusinessRecordExportData(exportVO, page);
|
IPage<BusinessRecordExportVO> result = dlDriveSchoolCoachMapper.getBusinessRecordExportData(exportVO, page);
|
||||||
allData.addAll(result.getRecords());
|
List<BusinessRecordExportVO> records = result.getRecords();
|
||||||
|
|
||||||
|
// 计算提成
|
||||||
|
for (BusinessRecordExportVO record : records) {
|
||||||
|
BigDecimal deduct = BigDecimal.ZERO;
|
||||||
|
if(record.getScheme() != null){
|
||||||
|
deduct = schemeService.getSchemeById(record.getScheme(), 0);
|
||||||
|
}else{
|
||||||
|
deduct = schemeService.getCourseDeduct(record.getCourseId(), 0);
|
||||||
|
}
|
||||||
|
record.setSubsidy(deduct);
|
||||||
|
}
|
||||||
|
|
||||||
|
allData.addAll(records);
|
||||||
|
|
||||||
if (i >= result.getPages()) {
|
if (i >= result.getPages()) {
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -0,0 +1,15 @@
|
|||||||
|
package cn.iocoder.yudao.module.base.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class BusinessRecordExportCountVO {
|
||||||
|
|
||||||
|
private BigDecimal totalAmount;
|
||||||
|
|
||||||
|
private BigDecimal totalSubsidy;
|
||||||
|
|
||||||
|
private Integer totalPeople;
|
||||||
|
}
|
||||||
@ -46,6 +46,8 @@ public class BusinessRecordExportVO {
|
|||||||
|
|
||||||
@ExcelIgnore
|
@ExcelIgnore
|
||||||
private Integer isSign;
|
private Integer isSign;
|
||||||
|
@ExcelIgnore
|
||||||
|
private String ifEnd;
|
||||||
|
|
||||||
@ExcelProperty(value = "面签时间", index = 9)
|
@ExcelProperty(value = "面签时间", index = 9)
|
||||||
private String signTimeStr;
|
private String signTimeStr;
|
||||||
|
|||||||
@ -328,8 +328,8 @@ public class SchoolCourseOrderServiceImpl extends ServiceImpl<SchoolCourseOrderM
|
|||||||
schoolCourseOrder.setSchemeId(schemeId);
|
schoolCourseOrder.setSchemeId(schemeId);
|
||||||
|
|
||||||
schoolCourseOrder.setId(null);
|
schoolCourseOrder.setId(null);
|
||||||
schoolCourseOrder.setCreateTime(null);
|
schoolCourseOrder.setCreateTime(createReqVO.getCreateTime());
|
||||||
schoolCourseOrder.setUpdateTime(null);
|
schoolCourseOrder.setUpdateTime(LocalDateTime.now());
|
||||||
schoolCourseOrder.setDeleted(SchoolBaseConstants.COMMON_NO);
|
schoolCourseOrder.setDeleted(SchoolBaseConstants.COMMON_NO);
|
||||||
schoolCourseOrder.setIfAssignmentCoach(SchoolBaseConstants.SCHOOL_COURSE_ORDER_IS_ASSIGN_COACH);
|
schoolCourseOrder.setIfAssignmentCoach(SchoolBaseConstants.SCHOOL_COURSE_ORDER_IS_ASSIGN_COACH);
|
||||||
schoolCourseOrder.setIfEnd(SchoolBaseConstants.COMMON_NO);
|
schoolCourseOrder.setIfEnd(SchoolBaseConstants.COMMON_NO);
|
||||||
|
|||||||
@ -106,6 +106,7 @@ public class CommissionExportVO {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void setExamTime(Date examTime) {
|
public void setExamTime(Date examTime) {
|
||||||
|
this.examTime = examTime;
|
||||||
if (examTime != null) {
|
if (examTime != null) {
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
this.examTimeStr = sdf.format(examTime);
|
this.examTimeStr = sdf.format(examTime);
|
||||||
|
|||||||
@ -9,6 +9,7 @@ import lombok.Data;
|
|||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@ -39,6 +40,7 @@ public class CourseOrderExportVO {
|
|||||||
private String signUpTimeStr;
|
private String signUpTimeStr;
|
||||||
|
|
||||||
public void setSignUpTime(Date signUpTime) {
|
public void setSignUpTime(Date signUpTime) {
|
||||||
|
this.signUpTime = signUpTime;
|
||||||
if (signUpTime != null) {
|
if (signUpTime != null) {
|
||||||
this.signUpTimeStr = new SimpleDateFormat("yyyy-MM-dd").format(signUpTime);
|
this.signUpTimeStr = new SimpleDateFormat("yyyy-MM-dd").format(signUpTime);
|
||||||
}
|
}
|
||||||
@ -63,7 +65,8 @@ public class CourseOrderExportVO {
|
|||||||
@ExcelProperty(value = "缴费时间", index = 7)
|
@ExcelProperty(value = "缴费时间", index = 7)
|
||||||
private String payFeesTimeStr;
|
private String payFeesTimeStr;
|
||||||
|
|
||||||
public void setPayFeesTimeStr(Date payFeesTime) {
|
public void setPayFeesTime(Date payFeesTime) {
|
||||||
|
this.payFeesTime = payFeesTime;
|
||||||
if (payFeesTime != null) {
|
if (payFeesTime != null) {
|
||||||
this.payFeesTimeStr = new SimpleDateFormat("yyyy-MM-dd").format(payFeesTime);
|
this.payFeesTimeStr = new SimpleDateFormat("yyyy-MM-dd").format(payFeesTime);
|
||||||
}
|
}
|
||||||
@ -85,9 +88,18 @@ public class CourseOrderExportVO {
|
|||||||
@ExcelProperty(value = "是否已面签", index = 10)
|
@ExcelProperty(value = "是否已面签", index = 10)
|
||||||
private String isSignDisplay;
|
private String isSignDisplay;
|
||||||
|
|
||||||
@ExcelProperty(value = "面签时间", index = 11)
|
@ExcelIgnore
|
||||||
private LocalDateTime signTime;
|
private LocalDateTime signTime;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "面签时间", index = 11)
|
||||||
|
private String signTimeStr;
|
||||||
|
|
||||||
|
public void setSignTime(LocalDateTime signTime) {
|
||||||
|
this.signTime = signTime;
|
||||||
|
if (signTime != null) {
|
||||||
|
this.signTimeStr = signTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ExcelIgnore
|
@ExcelIgnore
|
||||||
private Long coachId;
|
private Long coachId;
|
||||||
|
|
||||||
@ -119,6 +131,7 @@ public class CourseOrderExportVO {
|
|||||||
private String cashierConfirmTimeStr;
|
private String cashierConfirmTimeStr;
|
||||||
|
|
||||||
public void setCashierConfirmTime(Date cashierConfirmTime) {
|
public void setCashierConfirmTime(Date cashierConfirmTime) {
|
||||||
|
this.cashierConfirmTime = cashierConfirmTime;
|
||||||
if (cashierConfirmTime != null) {
|
if (cashierConfirmTime != null) {
|
||||||
this.cashierConfirmTimeStr = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(cashierConfirmTime);
|
this.cashierConfirmTimeStr = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(cashierConfirmTime);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -222,7 +222,8 @@
|
|||||||
dsc.name AS businessName,
|
dsc.name AS businessName,
|
||||||
dsc.phone AS businessPhone,
|
dsc.phone AS businessPhone,
|
||||||
dsco.create_time,
|
dsco.create_time,
|
||||||
dsc.image
|
dsc.image,
|
||||||
|
dsco.scheme_id AS scheme
|
||||||
from drive_school_student dss
|
from drive_school_student dss
|
||||||
LEFT JOIN drive_school_course_order dsco ON dss.user_id = dsco.user_id
|
LEFT JOIN drive_school_course_order dsco ON dss.user_id = dsco.user_id
|
||||||
<if test="entity.startTimeStr != null and entity.startTimeStr != ''">
|
<if test="entity.startTimeStr != null and entity.startTimeStr != ''">
|
||||||
|
|||||||
@ -166,7 +166,7 @@
|
|||||||
</otherwise>
|
</otherwise>
|
||||||
</choose>
|
</choose>
|
||||||
</if>
|
</if>
|
||||||
order BY dsc.create_time DESC
|
ORDER BY dsc.create_time DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getCommissionStatistics" resultType="cn.iocoder.yudao.module.course.vo.CommissionStatisticsVO">
|
<select id="getCommissionStatistics" resultType="cn.iocoder.yudao.module.course.vo.CommissionStatisticsVO">
|
||||||
|
|||||||
@ -36,6 +36,20 @@
|
|||||||
<if test="entity.endTimeStr!=null and entity.endTimeStr!=''">
|
<if test="entity.endTimeStr!=null and entity.endTimeStr!=''">
|
||||||
AND main.create_time <= #{entity.endTimeStr}
|
AND main.create_time <= #{entity.endTimeStr}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="entity.cashierConfirm != ''">
|
||||||
|
<choose>
|
||||||
|
<when test="entity.cashierConfirm == 1">
|
||||||
|
AND main.cashier_confirm = 1
|
||||||
|
</when>
|
||||||
|
<when test="entity.cashierConfirm == 0">
|
||||||
|
AND main.cashier_confirm = 0
|
||||||
|
</when>
|
||||||
|
<when test="entity.cashierConfirm == null">
|
||||||
|
AND main.cashier_confirm IS NULL
|
||||||
|
</when>
|
||||||
|
</choose>
|
||||||
|
</if>
|
||||||
|
|
||||||
</where>
|
</where>
|
||||||
order by main.create_time desc
|
order by main.create_time desc
|
||||||
</select>
|
</select>
|
||||||
@ -312,6 +326,7 @@
|
|||||||
dsco.cashier_confirm_time,
|
dsco.cashier_confirm_time,
|
||||||
dss.source,
|
dss.source,
|
||||||
dsco.payment_account,
|
dsco.payment_account,
|
||||||
|
dsco.sign_time,
|
||||||
MAX(CASE WHEN dsp.subject = 2 THEN COALESCE(dsp.coach_name, '') END) AS subject2CoachName,
|
MAX(CASE WHEN dsp.subject = 2 THEN COALESCE(dsp.coach_name, '') END) AS subject2CoachName,
|
||||||
MAX(CASE WHEN dscd.course_subject = 2 THEN COALESCE(dscd.deduct, 0) END) AS subject2Deduct,
|
MAX(CASE WHEN dscd.course_subject = 2 THEN COALESCE(dscd.deduct, 0) END) AS subject2Deduct,
|
||||||
MAX(CASE WHEN dsp.subject = 3 THEN COALESCE(dsp.coach_name, '') END) AS subject3CoachName,
|
MAX(CASE WHEN dsp.subject = 3 THEN COALESCE(dsp.coach_name, '') END) AS subject3CoachName,
|
||||||
@ -406,13 +421,19 @@
|
|||||||
dsco.user_no,
|
dsco.user_no,
|
||||||
dsco.user_phone,
|
dsco.user_phone,
|
||||||
dsco.create_time,
|
dsco.create_time,
|
||||||
|
dsco.is_sign,
|
||||||
dsco.pay_fees_time,
|
dsco.pay_fees_time,
|
||||||
dsco.reserve_money,
|
dsco.reserve_money,
|
||||||
dsco.course_name,
|
dsco.course_name,
|
||||||
dsco.course_type,
|
dsco.course_type,
|
||||||
dsco.order_remark,
|
dsco.order_remark,
|
||||||
dsco.cashier_confirm,
|
dsco.cashier_confirm,
|
||||||
dsco.cashier_confirm_remark
|
dsco.cashier_confirm_remark,
|
||||||
|
dsco.cashier_confirm_time,
|
||||||
|
dss.source,
|
||||||
|
dsco.payment_account,
|
||||||
|
dsco.sign_time
|
||||||
|
ORDER BY dsco.create_time DESC, dsco.user_id
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user