0807
This commit is contained in:
parent
f0a5d5ad47
commit
a88b06107a
@ -68,7 +68,6 @@ public interface IInspectionFileService extends IService<InspectionFile> {
|
||||
/**
|
||||
* 分页查询 InspectionFile 列表
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param inspectionFile 查询条件
|
||||
* @return 分页结果
|
||||
*/
|
||||
|
@ -209,4 +209,13 @@ public class DriveSchoolCoachClockController {
|
||||
return success(coachClockService.getClockCarInfoByUserId(userId, carNo));
|
||||
}
|
||||
|
||||
@GetMapping("/errorPage")
|
||||
@Operation(summary = "获得教练异常打卡记录分页")
|
||||
public CommonResult<IPage<?>> queryErrorClockListPage(DriveSchoolCoachClockVO pageReqVO,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
Page<DriveSchoolCoachClockVO> page = new Page<>(pageNo, pageSize);
|
||||
return success(coachClockService.queryErrorClockListPage(pageReqVO, page));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -253,6 +253,14 @@ public class TrainController {
|
||||
return success(trainService.getTrainStudentList(coachClockId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据教练打卡id,获取对应异常学员列表信息
|
||||
*/
|
||||
@GetMapping("getTrainErrorStudentList")
|
||||
public CommonResult<List<Train>> getTrainErrorStudentList(@RequestParam(value = "coachClockId") String coachClockId){
|
||||
return success(trainService.getTrainErrorStudentList(coachClockId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取学员导出数据列表
|
||||
*/
|
||||
|
@ -63,5 +63,8 @@ public interface DriveSchoolCoachClockMapper extends BaseMapper<DriveSchoolCoach
|
||||
List<String> getClockCarNoByUserId(@Param("userId") Long userId);
|
||||
DriveSchoolCoachClock getClockCarInfoByUserId(@Param("userId") Long userId, @Param("carNo") String carNo);
|
||||
|
||||
IPage<DriveSchoolCoachClockVO> queryErrorClockListPage(@Param("entity") DriveSchoolCoachClockVO pageReqVO, Page<DriveSchoolCoachClockVO> page);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -99,4 +99,12 @@ public interface IDriveSchoolCoachClockService extends IService<DriveSchoolCoach
|
||||
List<String> getClockCarNoByUserId(Long userId);
|
||||
DriveSchoolCoachClock getClockCarInfoByUserId(Long userId, String carNo);
|
||||
|
||||
/**
|
||||
* 获得教练异常打卡记录分页
|
||||
* @param pageReqVO
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
IPage<DriveSchoolCoachClockVO> queryErrorClockListPage(DriveSchoolCoachClockVO pageReqVO, Page<DriveSchoolCoachClockVO> page);
|
||||
|
||||
}
|
||||
|
@ -98,6 +98,7 @@ public interface TrainService extends IService<Train> {
|
||||
* 根据教练打卡id,获取对应学员列表信息
|
||||
*/
|
||||
List<Train> getTrainStudentList(String coachClockId);
|
||||
List<Train> getTrainErrorStudentList(String coachClockId);
|
||||
|
||||
/**
|
||||
* 获取学员导出数据列表
|
||||
|
@ -466,5 +466,36 @@ public class DriveSchoolCoachClockServiceImpl extends ServiceImpl<DriveSchoolCoa
|
||||
return driveSchoolCoachClockMapper.getClockCarInfoByUserId(userId, carNo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得教练异常打卡记录分页
|
||||
*
|
||||
* @param pageReqVO
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public IPage<DriveSchoolCoachClockVO> queryErrorClockListPage(DriveSchoolCoachClockVO pageReqVO, Page<DriveSchoolCoachClockVO> page) {
|
||||
String startTime = "";
|
||||
String endTime = "";
|
||||
if ("more".equals(pageReqVO.getTimeType())) {
|
||||
if (org.apache.commons.lang3.StringUtils.isNotEmpty(pageReqVO.getStartTimeStr())) {
|
||||
startTime = pageReqVO.getStartTimeStr();
|
||||
}
|
||||
if (org.apache.commons.lang3.StringUtils.isNotEmpty(pageReqVO.getEndTimeStr())) {
|
||||
endTime = pageReqVO.getEndTimeStr();
|
||||
}
|
||||
} else if ("month".equals(pageReqVO.getTimeType())) {
|
||||
//当月
|
||||
startTime = DateUtil.format(DateUtil.beginOfMonth(DateUtil.date()), "yyyy-MM-dd");
|
||||
endTime = DateUtil.format(DateUtil.endOfMonth(DateUtil.date()), "yyyy-MM-dd");
|
||||
} else if ("day".equals(pageReqVO.getTimeType())) {
|
||||
//当天
|
||||
startTime = DateUtil.formatDate(DateUtil.date());
|
||||
endTime = DateUtil.formatDate(DateUtil.date());
|
||||
}
|
||||
pageReqVO.setStartTimeStr(startTime);
|
||||
pageReqVO.setEndTimeStr(endTime);
|
||||
return driveSchoolCoachClockMapper.queryErrorClockListPage(pageReqVO, page);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -205,6 +205,22 @@ public class TrainServiceImpl extends ServiceImpl<TrainMapper, Train> implements
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据教练打卡id,获取对应学员列表信息
|
||||
*/
|
||||
@Override
|
||||
public List<Train> getTrainErrorStudentList(String coachClockId) {
|
||||
return lambdaQuery().eq(Train::getCoachClockId,coachClockId)
|
||||
.eq(Train::getDeleted,0)
|
||||
.isNull(Train::getEndTime)
|
||||
.isNotNull(Train::getUserId)
|
||||
.isNotNull(Train::getCoachId)
|
||||
.isNotNull(Train::getSubject)
|
||||
.orderByDesc(Train::getCreateTime)
|
||||
.list();
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取学员导出数据列表
|
||||
|
@ -367,4 +367,35 @@
|
||||
AND subject = #{entity.subject}
|
||||
</if>
|
||||
</select>-->
|
||||
|
||||
|
||||
<select id="queryErrorClockListPage" resultType="cn.iocoder.yudao.module.train.vo.DriveSchoolCoachClockVO">
|
||||
SELECT
|
||||
dscc.*
|
||||
FROM
|
||||
drive_school_coach_clock dscc
|
||||
WHERE
|
||||
dscc.end_time IS NULL
|
||||
AND dscc.train_day < CURDATE()
|
||||
AND dscc.deleted = 0
|
||||
<if test="entity.userId!= null and entity.userId!= ''">
|
||||
and dscc.user_id = #{entity.userId}
|
||||
</if>
|
||||
<if test="entity.carNo!= null and entity.carNo!= ''">
|
||||
and dscc.car_no like concat('%', #{entity.carNo},'%')
|
||||
</if>
|
||||
<if test="entity.subject!= null and entity.subject!= ''">
|
||||
and dscc.subject = #{entity.subject}
|
||||
</if>
|
||||
<if test="entity.id!= null and entity.id!= ''">
|
||||
and dscc.id = #{entity.id}
|
||||
</if>
|
||||
<if test="entity.startTimeStr != null and entity.startTimeStr != ''">
|
||||
AND dscc.train_day >= #{entity.startTimeStr}
|
||||
</if>
|
||||
<if test="entity.endTimeStr != null and entity.endTimeStr != ''">
|
||||
AND dscc.train_day <= #{entity.endTimeStr}
|
||||
</if>
|
||||
ORDER BY dscc.train_day DESC
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -151,7 +151,7 @@ public class SysLoginController {
|
||||
@TenantIgnore
|
||||
public CommonResult loginApp(@RequestBody LoginBody loginBody) throws Exception {
|
||||
String userName = loginBody.getUsername();
|
||||
AdminUserDO user = userService.getUserByUsername(userName);
|
||||
AdminUserDO user = userService.getUserByUsernameRescue(userName);
|
||||
if (ObjectUtil.isEmpty(user)) {
|
||||
return error(CommonErrorCodeConstants.LOGIN_ACCOUNT_NOT_EXIST);
|
||||
}
|
||||
|
@ -2,6 +2,8 @@ package cn.iocoder.yudao.module.bpm.framework.web.core;
|
||||
|
||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import cn.iocoder.yudao.module.bpm.framework.flowable.core.util.FlowableUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.filter.OncePerRequestFilter;
|
||||
|
||||
import javax.servlet.FilterChain;
|
||||
@ -17,6 +19,8 @@ import java.io.IOException;
|
||||
*/
|
||||
public class FlowableWebFilter extends OncePerRequestFilter {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(FlowableWebFilter.class);
|
||||
|
||||
@Override
|
||||
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain)
|
||||
throws ServletException, IOException {
|
||||
@ -24,14 +28,24 @@ public class FlowableWebFilter extends OncePerRequestFilter {
|
||||
// 设置工作流的用户
|
||||
Long userId = SecurityFrameworkUtils.getLoginUserId();
|
||||
if (userId != null) {
|
||||
FlowableUtils.setAuthenticatedUserId(userId);
|
||||
try {
|
||||
FlowableUtils.setAuthenticatedUserId(userId);
|
||||
} catch (Exception e) {
|
||||
// 忽略设置用户 ID 时的异常,避免影响主流程
|
||||
log.warn("设置 Flowable 认证用户 ID 失败", e);
|
||||
}
|
||||
}
|
||||
// 过滤
|
||||
chain.doFilter(request, response);
|
||||
} finally {
|
||||
// 清理
|
||||
FlowableUtils.clearAuthenticatedUserId();
|
||||
try {
|
||||
FlowableUtils.clearAuthenticatedUserId();
|
||||
} catch (Exception e) {
|
||||
// 忽略清理时的异常
|
||||
log.warn("清理 Flowable 认证用户 ID 失败", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -12,6 +12,7 @@ import cn.iocoder.yudao.module.system.controller.admin.auth.vo.AuthLoginReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.app.user.UserInfoVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@ -29,6 +30,13 @@ public interface AdminUserMapper extends BaseMapperX<AdminUserDO> {
|
||||
return selectOne(AdminUserDO::getUsername, username);
|
||||
}
|
||||
|
||||
default AdminUserDO selectByUsernameRescue(String username) {
|
||||
QueryWrapper<AdminUserDO> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("username", username)
|
||||
.ne("user_type", "02");
|
||||
return selectOne(wrapper);
|
||||
}
|
||||
|
||||
default AdminUserDO selectByUsername(String username, Long tenantId,String userType) {
|
||||
return selectOne(new LambdaQueryWrapperX<AdminUserDO>().eq(AdminUserDO::getUsername, username).eq(ObjectUtil.isNotEmpty(tenantId),TenantBaseDO::getTenantId, tenantId)
|
||||
.eq(ObjectUtil.isNotEmpty(userType), AdminUserDO::getUserType, userType).last("limit 1"));
|
||||
|
@ -145,6 +145,7 @@ public class AdminAuthServiceImpl implements AdminAuthService {
|
||||
// 创建 Token 令牌,记录登录日志
|
||||
return createTokenAfterLoginSuccess(user.getId(), reqVO.getUsername(), LoginLogTypeEnum.LOGIN_USERNAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AuthLoginRespVO loginApp(AuthLoginReqVO reqVO,Long tenantId) {
|
||||
// 校验验证码
|
||||
|
@ -128,6 +128,7 @@ public interface AdminUserService extends IService<AdminUserDO> {
|
||||
* @return 用户对象信息
|
||||
*/
|
||||
AdminUserDO getUserByUsername(String username);
|
||||
AdminUserDO getUserByUsernameRescue(String username);
|
||||
|
||||
/**
|
||||
* 通过用户名查询用户
|
||||
|
@ -293,6 +293,11 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
|
||||
public AdminUserDO getUserByUsername(String username) {
|
||||
return userMapper.selectByUsername(username);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AdminUserDO getUserByUsernameRescue(String username) {
|
||||
return userMapper.selectByUsernameRescue(username);
|
||||
}
|
||||
@Override
|
||||
public AdminUserDO getUserByUsername(String username,Long tenantId) {
|
||||
return userMapper.selectByUsername(username,tenantId,null);
|
||||
|
Loading…
Reference in New Issue
Block a user