Merge remote-tracking branch 'origin/driver' into driver
This commit is contained in:
commit
d099d47541
@ -79,6 +79,18 @@ public interface DlDriveSchoolStudentMapper extends BaseMapper<DlDriveSchoolStud
|
||||
**/
|
||||
List<DlDriveSchoolStudentVO> selectStudentList(@Param("coachId") Long coachId, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||
|
||||
/**
|
||||
* 查学生列表---驾校层面查询
|
||||
*
|
||||
* @param coachId 教练ID
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @return java.util.List<cn.iocoder.yudao.module.base.vo.DlDriveSchoolStudentVO>
|
||||
* @author vinjor-M
|
||||
* @date 15:13 2025/2/14
|
||||
**/
|
||||
List<DlDriveSchoolStudentVO> selectStudentListByOrder(@Param("coachId") Long coachId, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||
|
||||
/**
|
||||
* 教练层面查询自己的学生列表
|
||||
*
|
||||
|
@ -24,6 +24,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
@ -154,8 +156,8 @@ public class DataViewServiceImpl implements DataViewService {
|
||||
schoolRate = (double)schoolNum / allNum;
|
||||
}
|
||||
}
|
||||
studentInfoMap.put("coachNum",coachNum);
|
||||
studentInfoMap.put("coachAmount",coachAmount);
|
||||
studentInfoMap.put("coachNum", new BigDecimal(coachNum).setScale(2, RoundingMode.HALF_UP));
|
||||
studentInfoMap.put("coachAmount", new BigDecimal(coachAmount).setScale(2, RoundingMode.HALF_UP));
|
||||
studentInfoMap.put("coachRate",0!=coachRate?(Double.parseDouble(df.format(coachRate))*100):0);
|
||||
studentInfoMap.put("schoolNum",schoolNum);
|
||||
studentInfoMap.put("schoolAmount",schoolAmount);
|
||||
|
@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.base.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.common.SchoolRoleEnum;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
@ -287,11 +288,13 @@ public class DlDriveSchoolCoachServiceImpl extends ServiceImpl<DlDriveSchoolCoac
|
||||
result.setCoachInfo(coach);
|
||||
/*2.车辆信息*/
|
||||
DriveSchoolCar schoolCar = new DriveSchoolCar();
|
||||
if(null!=coach.getUserId()){
|
||||
schoolCar = schoolCarService.selectByCoachId(coach.getUserId());
|
||||
if(null!=schoolCar.getCarRegisterDate()){
|
||||
Long carOld = DateUtil.betweenYear(schoolCar.getCarRegisterDate(),new Date(),true);
|
||||
schoolCar.setCarOld(carOld);
|
||||
if (ObjectUtil.isNotEmpty(schoolCar)) {
|
||||
if (null != coach.getUserId()) {
|
||||
schoolCar = schoolCarService.selectByCoachId(coach.getUserId());
|
||||
if (null != schoolCar.getCarRegisterDate()) {
|
||||
Long carOld = DateUtil.betweenYear(schoolCar.getCarRegisterDate(), new Date(), true);
|
||||
schoolCar.setCarOld(carOld);
|
||||
}
|
||||
}
|
||||
}
|
||||
result.setCar(schoolCar);
|
||||
|
@ -41,7 +41,7 @@
|
||||
LEFT JOIN drive_school_coach_course dscc ON main.id = dscc.coach_id AND dscc.deleted = 0
|
||||
LEFT JOIN drive_school_car dsc ON main.user_id = dsc.user_id AND dsc.deleted = 0
|
||||
<where>
|
||||
main.deleted = 0
|
||||
main.deleted = 0 AND dscc.is_sign = 1 AND dscc.deleted = 0 AND dscc.if_end = 0
|
||||
<if test="entity.type != null and entity.type != ''">
|
||||
AND main.type = #{entity.type}
|
||||
</if>
|
||||
|
@ -138,7 +138,7 @@
|
||||
dss.* ,SUM(dsco.reserve_money+dsco.rest_money)AS priceAmount
|
||||
FROM
|
||||
drive_school_student dss
|
||||
LEFT JOIN drive_school_course_order dsco ON dss.user_id=dsco.user_id AND dsco.deleted=0
|
||||
LEFT JOIN drive_school_course_order dsco ON dss.user_id=dsco.user_id AND dsco.deleted=0 AND dsco.if_end=0 AND dsco.is_sign = 1
|
||||
WHERE
|
||||
dss.deleted=0
|
||||
AND dsco.id IS NOT NULL
|
||||
@ -153,6 +153,22 @@
|
||||
</if>
|
||||
GROUP BY dss.id
|
||||
</select>
|
||||
<select id="selectStudentListByOrder" resultType="cn.iocoder.yudao.module.base.vo.DlDriveSchoolStudentVO">
|
||||
SELECT dss.*,SUM(dsco.reserve_money+dsco.rest_money)AS priceAmount
|
||||
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="startTime!=null and startTime!=''">
|
||||
AND dsco.create_time >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime!=null and endTime!=''">
|
||||
AND dsco.create_time <= #{endTime}
|
||||
</if>
|
||||
<if test="coachId!=null and coachId!=''">
|
||||
AND dsco.coach_id=#{coachId}
|
||||
</if>
|
||||
GROUP BY dss.id
|
||||
</select>
|
||||
<select id="selectStudentListCoach" resultType="cn.iocoder.yudao.module.base.vo.DlDriveSchoolStudentVO">
|
||||
SELECT
|
||||
dss.*,dsco.grad_time AS orderGradTime,dsco.id AS orderId
|
||||
@ -240,21 +256,21 @@
|
||||
</select>
|
||||
<select id="indexGetTrainList" resultType="cn.iocoder.yudao.module.base.vo.StudentCountVO">
|
||||
SELECT
|
||||
c.id,
|
||||
c.image AS image,
|
||||
c.NAME AS coachName,
|
||||
c.car_id AS carId,
|
||||
c.user_id AS userId,
|
||||
COUNT(DISTINCT s.user_id) AS totalNum,
|
||||
COUNT(DISTINCT CASE WHEN o.course_type = 'C1' THEN o.user_id END) AS c1Num,
|
||||
COUNT(DISTINCT CASE WHEN o.course_type = 'C2' THEN o.user_id END) AS c2Num
|
||||
c.id,
|
||||
c.image AS image,
|
||||
c.NAME AS coachName,
|
||||
c.car_id AS carId,
|
||||
c.user_id AS userId,
|
||||
COUNT(DISTINCT s.user_id) AS totalNum,
|
||||
COUNT(DISTINCT CASE WHEN o.course_type = 'C1' THEN o.user_id END) AS c1Num,
|
||||
COUNT(DISTINCT CASE WHEN o.course_type = 'C2' THEN o.user_id END) AS c2Num
|
||||
FROM
|
||||
drive_school_coach c
|
||||
LEFT JOIN drive_school_student s ON c.user_id = s.source_user_id AND s.deleted=0
|
||||
drive_school_coach c
|
||||
LEFT JOIN drive_school_student s ON c.user_id = s.source_user_id AND s.deleted=0
|
||||
<if test="type != null and type != ''">
|
||||
AND s.source = #{type}
|
||||
</if>
|
||||
LEFT JOIN drive_school_course_order o ON s.user_id = o.user_id AND o.payment_status > 1 AND o.deleted=0
|
||||
LEFT JOIN drive_school_course_order o ON s.user_id = o.user_id AND o.payment_status > 1 AND o.deleted=0 AND o.is_sign = 1 AND o.if_end = 0
|
||||
<if test="startTime != null and startTime != ''">
|
||||
AND o.create_time >= #{startTime}
|
||||
</if>
|
||||
@ -262,25 +278,26 @@
|
||||
AND o.create_time <= #{endTime}
|
||||
</if>
|
||||
WHERE
|
||||
c.deleted = 0
|
||||
<if test="coachId != null and coachId != ''">
|
||||
AND c.user_id = #{coachId}
|
||||
</if>
|
||||
<if test="type != null and type != ''">
|
||||
<choose>
|
||||
<when test="type=='01'">
|
||||
AND c.type='yg'
|
||||
</when>
|
||||
<when test="type=='02'">
|
||||
AND c.type='jl'
|
||||
</when>
|
||||
</choose>
|
||||
</if>
|
||||
c.deleted = 0
|
||||
<if test="coachId != null and coachId != ''">
|
||||
AND c.user_id = #{coachId}
|
||||
</if>
|
||||
<if test="type != null and type != ''">
|
||||
<choose>
|
||||
<when test="type=='01'">
|
||||
AND c.type='yg'
|
||||
</when>
|
||||
<when test="type=='02'">
|
||||
AND c.type='jl'
|
||||
</when>
|
||||
</choose>
|
||||
</if>
|
||||
GROUP BY
|
||||
c.id
|
||||
c.id
|
||||
ORDER BY
|
||||
totalNum DESC
|
||||
totalNum DESC
|
||||
</select>
|
||||
|
||||
<select id="indexGetFormList" resultType="cn.iocoder.yudao.module.base.vo.DlDriveSchoolStaffVO">
|
||||
SELECT
|
||||
main.id AS id,
|
||||
|
@ -47,7 +47,7 @@ public interface AdminUserMapper extends BaseMapperX<AdminUserDO> {
|
||||
|
||||
default PageResult<AdminUserDO> selectPage(UserPageReqVO reqVO, Collection<Long> deptIds) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<AdminUserDO>()
|
||||
.likeIfPresent(AdminUserDO::getUsername, reqVO.getUsername())
|
||||
// .likeIfPresent(AdminUserDO::getUsername, reqVO.getUsername())
|
||||
.likeIfPresent(AdminUserDO::getMobile, reqVO.getMobile())
|
||||
// 这里加了个模糊查询,用户名称搜索时可以模糊查用户昵称
|
||||
.likeIfPresent(AdminUserDO::getNickname, reqVO.getUsername())
|
||||
|
Loading…
Reference in New Issue
Block a user