|
|
@@ -754,34 +754,40 @@ public class LawyerUserViolationServiceImpl extends ServiceImpl<LawyerUserViolat
|
|
|
* 分页查询违规举报信息
|
|
|
* <p>
|
|
|
* 根据查询条件分页查询律师用户违规举报信息,支持按订单号、处理状态、
|
|
|
- * 被举报人名称、违规原因等条件进行筛选查询
|
|
|
+ * 被举报人名称、违规原因、手机号、时间范围等条件进行筛选查询
|
|
|
* </p>
|
|
|
*
|
|
|
- * @param page 当前页码,从1开始,必须大于0
|
|
|
- * @param size 每页大小,必须大于0且不超过最大值
|
|
|
- * @param orderId 订单号,支持模糊查询,可为空
|
|
|
+ * @param pageNum 当前页码,从1开始,必须大于0
|
|
|
+ * @param pageSize 每页大小,必须大于0且不超过最大值
|
|
|
+ * @param orderNumber 订单号,支持模糊查询,可为空
|
|
|
+ * @param phone 举报人手机号,精确匹配,可为空
|
|
|
* @param processingStatus 处理状态,精确匹配,可为空
|
|
|
* @param reportedUserName 被举报人名称,支持模糊查询,可为空
|
|
|
- * @param violationReason 违规原因,精确匹配,可为空
|
|
|
+ * @param reportedPhone 被举报人手机号,精确匹配,可为空
|
|
|
+ * @param violationReason 违规原因,精确匹配,可为空
|
|
|
+ * @param startTime 开始时间,格式:yyyy-MM-dd HH:mm:ss,可为空
|
|
|
+ * @param endTime 结束时间,格式:yyyy-MM-dd HH:mm:ss,可为空
|
|
|
* @return 分页查询结果,包含违规举报DTO列表
|
|
|
- * @throws RuntimeException 当分页参数无效时抛出
|
|
|
+ * @throws RuntimeException 当分页参数无效或查询异常时抛出
|
|
|
* @author system
|
|
|
* @since 2025-01-XX
|
|
|
*/
|
|
|
@Override
|
|
|
- public IPage<LawyerUserViolationDto> getViolationPage(int page, int size, String orderId,
|
|
|
- String processingStatus, String reportedUserName,
|
|
|
- String violationReason) {
|
|
|
+ public IPage<LawyerUserViolationDto> getViolationPage(int pageNum, int pageSize, String orderNumber,
|
|
|
+ String phone, String processingStatus,
|
|
|
+ String reportedUserName, String reportedPhone,
|
|
|
+ String violationReason, String startTime,
|
|
|
+ String endTime) {
|
|
|
// 参数校验
|
|
|
- validatePageParams(page, size);
|
|
|
+ validatePageParams(pageNum, pageSize);
|
|
|
|
|
|
try {
|
|
|
// 构建分页对象
|
|
|
- IPage<LawyerUserViolationVo> pageRequest = new Page<>(page, size);
|
|
|
+ IPage<LawyerUserViolationVo> pageRequest = new Page<>(pageNum, pageSize);
|
|
|
|
|
|
// 构建查询条件
|
|
|
- QueryWrapper<LawyerUserViolationVo> queryWrapper = buildQueryWrapper(orderId,
|
|
|
- processingStatus, reportedUserName, violationReason);
|
|
|
+ QueryWrapper<LawyerUserViolationVo> queryWrapper = buildQueryWrapper(orderNumber, phone,
|
|
|
+ processingStatus, reportedUserName, reportedPhone, violationReason, startTime, endTime);
|
|
|
|
|
|
// 执行分页查询
|
|
|
IPage<LawyerUserViolationVo> resultPage = lawyerUserViolationMapper.getViolationPage(pageRequest,
|
|
|
@@ -790,8 +796,13 @@ public class LawyerUserViolationServiceImpl extends ServiceImpl<LawyerUserViolat
|
|
|
// 转换为DTO并处理数据
|
|
|
return convertToDtoPage(resultPage);
|
|
|
|
|
|
+ } catch (RuntimeException e) {
|
|
|
+ log.error("分页查询违规举报信息业务异常,页码:{},每页大小:{},异常信息:{}",
|
|
|
+ pageNum, pageSize, e.getMessage());
|
|
|
+ throw e;
|
|
|
} catch (Exception e) {
|
|
|
- log.error("分页查询违规举报信息异常,页码:{},每页大小:{},异常信息:{}", page, size, e.getMessage(), e);
|
|
|
+ log.error("分页查询违规举报信息异常,页码:{},每页大小:{},异常信息:{}",
|
|
|
+ pageNum, pageSize, e.getMessage(), e);
|
|
|
throw new RuntimeException("分页查询违规举报信息失败:" + e.getMessage(), e);
|
|
|
}
|
|
|
}
|
|
|
@@ -820,15 +831,26 @@ public class LawyerUserViolationServiceImpl extends ServiceImpl<LawyerUserViolat
|
|
|
|
|
|
/**
|
|
|
* 构建查询条件
|
|
|
+ * <p>
|
|
|
+ * 根据传入的查询参数动态构建查询条件,支持多条件组合查询
|
|
|
+ * </p>
|
|
|
*
|
|
|
- * @param orderId 订单号
|
|
|
- * @param processingStatus 处理状态
|
|
|
- * @param reportedUserName 被举报人名称
|
|
|
- * @param violationReason 违规原因
|
|
|
+ * @param orderId 订单号,支持模糊查询
|
|
|
+ * @param phone 举报人手机号,精确匹配
|
|
|
+ * @param processingStatus 处理状态,精确匹配
|
|
|
+ * @param reportedUserName 被举报人名称,支持模糊查询
|
|
|
+ * @param reportedPhone 被举报人手机号,精确匹配
|
|
|
+ * @param violationReason 违规原因,精确匹配
|
|
|
+ * @param startTime 开始时间,大于等于查询
|
|
|
+ * @param endTime 结束时间,小于等于查询
|
|
|
* @return 查询条件包装器
|
|
|
*/
|
|
|
- private QueryWrapper<LawyerUserViolationVo> buildQueryWrapper(String orderId, String processingStatus,
|
|
|
- String reportedUserName, String violationReason) {
|
|
|
+ private QueryWrapper<LawyerUserViolationVo> buildQueryWrapper(String orderId, String phone,
|
|
|
+ String processingStatus,
|
|
|
+ String reportedUserName,
|
|
|
+ String reportedPhone,
|
|
|
+ String violationReason,
|
|
|
+ String startTime, String endTime) {
|
|
|
QueryWrapper<LawyerUserViolationVo> queryWrapper = new QueryWrapper<>();
|
|
|
|
|
|
// 基础查询条件:未删除且为订单举报
|
|
|
@@ -837,7 +859,12 @@ public class LawyerUserViolationServiceImpl extends ServiceImpl<LawyerUserViolat
|
|
|
|
|
|
// 动态查询条件:订单号模糊查询
|
|
|
if (StringUtils.isNotEmpty(orderId)) {
|
|
|
- queryWrapper.like("luv.order_id", orderId);
|
|
|
+ queryWrapper.like("luv.order_number", orderId);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 动态查询条件:举报人手机号精确匹配
|
|
|
+ if (StringUtils.isNotEmpty(phone)) {
|
|
|
+ queryWrapper.eq("ui.phone", phone);
|
|
|
}
|
|
|
|
|
|
// 动态查询条件:处理状态精确匹配
|
|
|
@@ -850,11 +877,26 @@ public class LawyerUserViolationServiceImpl extends ServiceImpl<LawyerUserViolat
|
|
|
queryWrapper.like("ui_reported.nick_name", reportedUserName);
|
|
|
}
|
|
|
|
|
|
+ // 动态查询条件:被举报人手机号精确匹配
|
|
|
+ if (StringUtils.isNotEmpty(reportedPhone)) {
|
|
|
+ queryWrapper.eq("ui_reported.phone", reportedPhone);
|
|
|
+ }
|
|
|
+
|
|
|
// 动态查询条件:违规原因精确匹配
|
|
|
if (StringUtils.isNotEmpty(violationReason)) {
|
|
|
queryWrapper.eq("luv.violation_reason", violationReason);
|
|
|
}
|
|
|
|
|
|
+ // 动态查询条件:开始时间范围查询(大于等于)
|
|
|
+ if (StringUtils.isNotEmpty(startTime)) {
|
|
|
+ queryWrapper.ge("luv.created_time", startTime);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 动态查询条件:结束时间范围查询(小于等于)
|
|
|
+ if (StringUtils.isNotEmpty(endTime)) {
|
|
|
+ queryWrapper.le("luv.created_time", endTime);
|
|
|
+ }
|
|
|
+
|
|
|
// 排序:按更新时间倒序
|
|
|
queryWrapper.orderByDesc("luv.updated_time");
|
|
|
|