Переглянути джерело

feat(user): 增加举报上下文类型筛选功能

- 在 LifeUserViolationService 接口新增 reportContextType 参数
- 实现类中增加对 reportContextType 的查询条件
- 控制器层支持接收并传递 reportContextType 参数
- 更新了方法签名以兼容新的筛选字段
- 日志记录中增加了 reportContextType 参数信息
zjy 2 днів тому
батько
коміт
ae946f2436

+ 2 - 1
alien-store/src/main/java/shop/alien/store/controller/UserViolationController.java

@@ -100,11 +100,12 @@ public class UserViolationController {
             @RequestParam(value = "nickname", required = false) String nickname,
             @RequestParam(value = "phone", required = false) String phone,
             @RequestParam(value = "processingStatus", required = false) String processingStatus,
+            @RequestParam(value = "reportContextType", required = false) String reportContextType,
             @RequestParam(value = "startTime", required = false) String startTime,
             @RequestParam(value = "endTime", required = false) String endTime ) {
         log.info("UserViolationController.getAllViolationPage?pageNum={},pageSize={},nickName={},phone={},processingStatus={},startTime={},endTime={}", 
                 pageNum, pageSize, nickname, phone, processingStatus, startTime, endTime);
-        return R.data(lifeUserViolationService.getAllViolationPage(pageNum, pageSize, nickname, phone, processingStatus, startTime, endTime));
+        return R.data(lifeUserViolationService.getAllViolationPage(pageNum, pageSize, nickname, phone, processingStatus, startTime, endTime, reportContextType));
     }
 
     @ApiOperation(value = "举报审核")

+ 1 - 1
alien-store/src/main/java/shop/alien/store/service/LifeUserViolationService.java

@@ -28,7 +28,7 @@ public interface LifeUserViolationService extends IService<LifeUserViolation> {
 
     IPage<LifeUserViolationDto> getViolationPage(int page, int size, String nickName, String phone, String processingStatus);
 
-    IPage<LifeUserViolationDto> getAllViolationPage(int page, int size, String nickName, String phone, String processingStatus, String startTime, String endTime);
+    IPage<LifeUserViolationDto> getAllViolationPage(int page, int size, String nickName, String phone, String processingStatus, String startTime, String endTime, String reportContextType);
 
     void approve(int id, String processingStatus, String reportResult);
 

+ 5 - 1
alien-store/src/main/java/shop/alien/store/service/impl/LifeUserViolationServiceImpl.java

@@ -730,7 +730,7 @@ public class LifeUserViolationServiceImpl extends ServiceImpl<LifeUserViolationM
     }
 
     @Override
-    public IPage<LifeUserViolationDto> getAllViolationPage(int page, int size, String nickName, String phone, String processingStatus, String startTime, String endTime) {
+    public IPage<LifeUserViolationDto> getAllViolationPage(int page, int size, String nickName, String phone, String processingStatus, String startTime, String endTime, String reportContextType) {
         IPage<LifeUserViolationVo> pageRequest = new Page<>(page, size);
         QueryWrapper<LifeUserViolationVo> queryWrapper = new QueryWrapper<>();
 
@@ -741,6 +741,10 @@ public class LifeUserViolationServiceImpl extends ServiceImpl<LifeUserViolationM
         if (StringUtils.isNotEmpty(processingStatus)) {
             queryWrapper.eq("processing_status", processingStatus);
         }
+
+        if (StringUtils.isNotEmpty(reportContextType)) {
+            queryWrapper.eq("report_context_type", reportContextType);
+        }
         // 根据开始时间和结束时间过滤
         if (StringUtils.isNotEmpty(startTime)) {
             queryWrapper.ge("created_time", startTime);