This commit is contained in:
Lx 2025-08-12 16:55:00 +08:00
parent 821e8e6f56
commit 02acf9f290
14 changed files with 132 additions and 22 deletions

View File

@ -423,7 +423,13 @@ public class ProcessServiceImpl extends ServiceImpl<ProcessMapper, Process> impl
List<UserDTO> officeStaffList = roleApi.selectUserListByRoleCode(tenantId, "school_staff");
if (officeStaffList != null && !officeStaffList.isEmpty()) {
String officeMessage = String.format(SchoolBaseConstants.SCHOOL_NOTIFY_MESSAGE_TEMPLATE_MEMBER_AUDIT_NOT_PASS, process.getUserName(), process.getStudentIdCard(), process.getCourseName(), process.getSubject(), process.getFinanceRemark());
String studentIdCard = "";
if(process.getStudentIdCard() != null){
studentIdCard = process.getStudentIdCard();
}else {
studentIdCard = "——";
}
String officeMessage = String.format(SchoolBaseConstants.SCHOOL_NOTIFY_MESSAGE_TEMPLATE_MEMBER_AUDIT_NOT_PASS, process.getUserName(), studentIdCard, process.getCourseName(), process.getSubject(), process.getFinanceRemark());
for (UserDTO staff : officeStaffList) {
schoolNotifyMessageSendService.sendMessage(staff.getId(), officeMessage, SchoolBaseConstants.SCHOOL_NOTIFY_MESSAGE_TYPE_ADMIN, process.getTenantId());

View File

@ -401,6 +401,8 @@ public class SchoolCourseOrderServiceImpl extends ServiceImpl<SchoolCourseOrderM
if(dlDriveSchoolCoachByUserId != null){
tenantId = dlDriveSchoolCoachByUserId.getTenantId();
}
studentName = (studentName == null) ? "——" : studentName;
courseName = (courseName == null) ? "——" : courseName;
if (coachId != null) {
// 准备消息内容

View File

@ -200,6 +200,12 @@ public class DriveSchoolCoachClockController {
return success(coachClockService.getClockCarNoByUserId(userId));
}
@GetMapping("/getClockCarNoAndSubjectByUserId")
public CommonResult<List<DriveSchoolCoachClock>> getClockCarNoAndSubjectByUserId() {
Long userId = SecurityFrameworkUtils.getLoginUserId();
return success(coachClockService.getClockCarNoAndSubjectByUserId(userId));
}
/**
* 根据教练id查询当日打卡记录的车牌号列表
*/

View File

@ -61,6 +61,12 @@ public interface DriveSchoolCoachClockMapper extends BaseMapper<DriveSchoolCoach
* 根据教练id查询当日打卡记录的车牌号列表
*/
List<String> getClockCarNoByUserId(@Param("userId") Long userId);
/**
* 根据教练id查询当日打卡记录的车牌号和科目列表
*/
List<DriveSchoolCoachClock> getClockCarNoAndSubjectByUserId(@Param("userId") Long userId);
DriveSchoolCoachClock getClockCarInfoByUserId(@Param("userId") Long userId, @Param("carNo") String carNo);
IPage<DriveSchoolCoachClockVO> queryErrorClockListPage(@Param("entity") DriveSchoolCoachClockVO pageReqVO, Page<DriveSchoolCoachClockVO> page);

View File

@ -97,6 +97,9 @@ public interface IDriveSchoolCoachClockService extends IService<DriveSchoolCoach
* 根据教练id查询当日打卡记录的车牌号列表
*/
List<String> getClockCarNoByUserId(Long userId);
List<DriveSchoolCoachClock> getClockCarNoAndSubjectByUserId(Long userId);
DriveSchoolCoachClock getClockCarInfoByUserId(Long userId, String carNo);
/**

View File

@ -96,7 +96,7 @@ public class DriveSchoolCoachClockServiceImpl extends ServiceImpl<DriveSchoolCoa
new LambdaQueryWrapper<DriveSchoolCoachClock>()
.eq(DriveSchoolCoachClock::getUserId, userId)
.eq(DriveSchoolCoachClock::getCarNo,carNo)
.eq(DriveSchoolCoachClock::getTrainDay, DateUtil.format(new Date(), "yyyy-MM-dd"))
// .eq(DriveSchoolCoachClock::getTrainDay, DateUtil.format(new Date(), "yyyy-MM-dd"))
.isNull(DriveSchoolCoachClock::getEndTime)
.eq(DriveSchoolCoachClock::getDeleted, 0)
.orderByDesc(DriveSchoolCoachClock::getCreateTime)
@ -106,7 +106,6 @@ public class DriveSchoolCoachClockServiceImpl extends ServiceImpl<DriveSchoolCoa
}else{
return null;
}
}
/**
@ -461,6 +460,11 @@ public class DriveSchoolCoachClockServiceImpl extends ServiceImpl<DriveSchoolCoa
return driveSchoolCoachClockMapper.getClockCarNoByUserId(userId);
}
@Override
public List<DriveSchoolCoachClock> getClockCarNoAndSubjectByUserId(Long userId) {
return driveSchoolCoachClockMapper.getClockCarNoAndSubjectByUserId(userId);
}
@Override
public DriveSchoolCoachClock getClockCarInfoByUserId(Long userId, String carNo) {
return driveSchoolCoachClockMapper.getClockCarInfoByUserId(userId, carNo);
@ -492,6 +496,10 @@ public class DriveSchoolCoachClockServiceImpl extends ServiceImpl<DriveSchoolCoa
//当天
startTime = DateUtil.formatDate(DateUtil.date());
endTime = DateUtil.formatDate(DateUtil.date());
} else if ("yesterday".equals(pageReqVO.getTimeType())) {
//昨天
startTime = DateUtil.formatDate(DateUtil.yesterday());
endTime = DateUtil.formatDate(DateUtil.yesterday());
}
pageReqVO.setStartTimeStr(startTime);
pageReqVO.setEndTimeStr(endTime);

View File

@ -131,7 +131,7 @@ public class TrainServiceImpl extends ServiceImpl<TrainMapper, Train> implements
.eq(Train::getUserId,userId)
.eq(Train::getCourseId,courseId)
.eq(Train::getSubject,subject)
.eq(Train::getTrainDay,dayStr)
// .eq(Train::getTrainDay,dayStr)
.isNull(Train::getEndTime);
List<Train> list = this.list(queryWrapper);
return list.isEmpty()?null:list.get(0);

View File

@ -341,17 +341,26 @@
SELECT car_No
FROM drive_school_coach_clock
WHERE user_id = #{userId}
AND train_day = CURDATE()
-- AND train_day = CURDATE()
AND end_time IS NULL
AND deleted = 0
</select>
<select id="getClockCarNoAndSubjectByUserId" resultType="cn.iocoder.yudao.module.train.entity.DriveSchoolCoachClock">
SELECT car_No, subject,train_day
FROM drive_school_coach_clock
WHERE user_id = #{userId}
-- AND train_day = CURDATE()
AND end_time IS NULL
AND deleted = 0
</select>
<select id="getClockCarInfoByUserId" resultType="cn.iocoder.yudao.module.train.entity.DriveSchoolCoachClock">
SELECT *
FROM drive_school_coach_clock
WHERE user_id = #{userId}
AND car_no = #{carNo}
AND train_day = CURDATE()
-- AND train_day = CURDATE()
AND end_time IS NULL
AND deleted = 0
</select>

View File

@ -129,21 +129,19 @@
</select>
<select id="noClockInRemindByUserId" resultType="cn.iocoder.yudao.module.train.vo.NoClockInRemindVO">
SELECT
coach_id,
coach_name,
COUNT(DISTINCT user_id) AS student_count,
GROUP_CONCAT(DISTINCT user_name SEPARATOR '') AS student_names,
tenant_id
SELECT coach_id,
coach_name,
COUNT(user_id) AS student_count,
GROUP_CONCAT(DISTINCT CONCAT(user_name, '(', '科目', subject, ')') SEPARATOR '' ) AS student_names,
tenant_id
FROM drive_school_train
WHERE
coach_id = #{userId}
WHERE coach_id = #{userId}
AND car_no = #{carNo}
AND DATE(create_time) = CURDATE()
AND DATE(start_time) = CURDATE()
AND end_time IS NULL
AND deleted = 0
GROUP BY coach_id, coach_name
AND tenant_id = 180
GROUP BY coach_id,
coach_name
</select>
<select id="selectStudentByCoachClockId" resultType="cn.iocoder.yudao.module.train.entity.Train">

View File

@ -0,0 +1,68 @@
package cn.iocoder.yudao.module.system.api.user.dto;
import lombok.Data;
@Data
public class DriverUserDTO {
/**
* 用户id
*/
private Long id;
/**
* 用户账号
*/
private String username;
/**
* 用户昵称
*/
private String nickname;
/**
* 用户类型
*/
private String userType;
/**
* 备注
*/
private String remark;
/**
* 部门编号
*/
private Long deptId;
/**
* 用户手机号码
*/
private String mobile;
/**
* 用户密码
*/
private String password;
/**
* 用户头像
*/
private String avatar;
/**
* 用户性别
**/
private String sex;
/**
* 用户openId
**/
private String openId;
/**
* 用户openId
**/
private Long tenantId;
/**
* 用户状态
*/
private Integer status;
/**
* 司机id
*/
private Long driverId;
/**
* 角色名称 多个角色以逗号隔开
*/
private String roleNames;
}

View File

@ -1,6 +1,7 @@
package cn.iocoder.yudao.module.system.dal.mysql.permission;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.system.api.user.dto.DriverUserDTO;
import cn.iocoder.yudao.module.system.api.user.dto.UserDTO;
import cn.iocoder.yudao.module.system.api.user.dto.UserRoleDTO;
import cn.iocoder.yudao.module.system.controller.admin.permission.vo.role.RolePageReqVO;
@ -45,7 +46,7 @@ public interface UserRoleMapper extends BaseMapperX<UserRoleDO> {
IPage<UserDTO> selectListByRoleId(@Param("page") Page<UserDTO> page,@Param("role") RolePageReqVO role);
IPage<UserDTO> selectListByRoleIdJX(@Param("page") Page<UserDTO> page,@Param("role") RolePageReqVO role);
IPage<UserDTO> selectListByRoleIdJY(@Param("page") Page<UserDTO> page,@Param("role") RolePageReqVO role);
IPage<DriverUserDTO> selectListByRoleIdJY(@Param("page") Page<DriverUserDTO> page, @Param("role") RolePageReqVO role);
IPage<UserDTO> selectListByRoleIdRepair(@Param("page") Page<UserDTO> page,@Param("role") RolePageReqVO role);
List<UserDTO> selectByRoleId(Integer roleId);

View File

@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.system.service.permission;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
import cn.iocoder.yudao.module.system.api.user.dto.DriverUserDTO;
import cn.iocoder.yudao.module.system.api.user.dto.UserDTO;
import cn.iocoder.yudao.module.system.controller.admin.permission.vo.role.RolePageReqVO;
import cn.iocoder.yudao.module.system.controller.admin.permission.vo.role.RoleSaveReqVO;
@ -174,7 +175,7 @@ public interface RoleService {
IPage<UserDTO> selectListByRoleId(RolePageReqVO role);
IPage<UserDTO> selectListByRoleIdJX(RolePageReqVO role);
IPage<UserDTO> selectListByRoleIdJY(RolePageReqVO role);
IPage<DriverUserDTO> selectListByRoleIdJY(RolePageReqVO role);
IPage<UserDTO> selectListByRoleIdRepair(RolePageReqVO role);

View File

@ -12,6 +12,7 @@ import cn.iocoder.yudao.framework.security.core.LoginUser;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
import cn.iocoder.yudao.module.system.api.user.dto.DriverUserDTO;
import cn.iocoder.yudao.module.system.api.user.dto.UserDTO;
import cn.iocoder.yudao.module.system.controller.admin.permission.vo.role.RolePageReqVO;
import cn.iocoder.yudao.module.system.controller.admin.permission.vo.role.RoleSaveReqVO;
@ -370,8 +371,8 @@ public class RoleServiceImpl implements RoleService {
}
@Override
public IPage<UserDTO> selectListByRoleIdJY(RolePageReqVO role) {
Page<UserDTO> page = new Page<>(role.getPageNo(), role.getPageSize());
public IPage<DriverUserDTO> selectListByRoleIdJY(RolePageReqVO role) {
Page<DriverUserDTO> page = new Page<>(role.getPageNo(), role.getPageSize());
return userRoleMapper.selectListByRoleIdJY(page,role);
}

View File

@ -78,10 +78,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectListByRoleIdJY" resultType="cn.iocoder.yudao.module.system.api.user.dto.UserDTO"
<select id="selectListByRoleIdJY" resultType="cn.iocoder.yudao.module.system.api.user.dto.DriverUserDTO"
parameterType="cn.iocoder.yudao.module.system.controller.admin.permission.vo.role.RolePageReqVO">
SELECT
su.id,
di.id AS driverId,
su.username,
su.nickname,
su.user_type,