Explorar o código

举报代码修改

zhangchen hai 3 semanas
pai
achega
a27d335fc5

+ 12 - 0
alien-entity/src/main/java/shop/alien/entity/store/dto/LawyerUserViolationDto.java

@@ -46,6 +46,9 @@ public class LawyerUserViolationDto {
     @ApiModelProperty(value = "1:用户违规,2:色情低俗,3:违法违规,4:谩骂嘲讽、煽动对立,5:涉嫌诈骗,6:人身攻击,7:种族歧视,8:政治敏感,9:虚假、不实内容,违反公德秩序,10:危害人身安全,11:网络暴力,12:其他原因")
     private String violationType;
 
+    @ApiModelProperty(value = "举报原因")
+    private String violationReason;
+
     @ApiModelProperty(value = "其他原因具体内容")
     private String otherReasonContent;
 
@@ -76,12 +79,21 @@ public class LawyerUserViolationDto {
     @ApiModelProperty(value = "订单ID")
     private String orderId;
 
+    @ApiModelProperty(value = "订单编号")
+    private String orderNumber;
+
     @ApiModelProperty(value = "昵称")
     private String nickname;
 
     @ApiModelProperty(value = "联系方式")
     private String phone;
 
+    @ApiModelProperty(value = "举报人名称")
+    private String reportUserName;
+
+    @ApiModelProperty(value = "被举报人名称")
+    private String reportedUserName;
+
     @ApiModelProperty(value = "被举报人账号")
     private String account;
 

+ 8 - 1
alien-entity/src/main/java/shop/alien/mapper/LawyerUserViolationMapper.java

@@ -63,13 +63,20 @@ public interface LawyerUserViolationMapper extends BaseMapper<LawyerUserViolatio
             "SELECT " +
             "    luv.*, " +
             "    ui.nick_name AS nickname, " +
-            "    ui.phone " +
+            "    ui.phone, " +
+            "    ui.nick_name AS reportUserName, " +
+            "    ui_reported.nick_name AS reportedUserName " +
             "FROM lawyer_user_violation luv " +
             "LEFT JOIN userInfo ui ON (" +
             "    (ui.type = 'lawyer' AND luv.reporting_user_type = 'lawyer' AND ui.id = luv.reporting_user_id) OR " +
             "    (ui.type = 'store' AND luv.reporting_user_type = '1' AND ui.id = luv.reporting_user_id) OR " +
             "    (ui.type = 'user' AND luv.reporting_user_type = '2' AND ui.id = luv.reporting_user_id)" +
             ") " +
+            "LEFT JOIN userInfo ui_reported ON (" +
+            "    (ui_reported.type = 'lawyer' AND (luv.reported_user_type = 'lawyer' OR luv.reported_user_type = '3') AND ui_reported.id = luv.reported_user_id) OR " +
+            "    (ui_reported.type = 'store' AND luv.reported_user_type = '1' AND ui_reported.id = luv.reported_user_id) OR " +
+            "    (ui_reported.type = 'user' AND luv.reported_user_type = '2' AND ui_reported.id = luv.reported_user_id)" +
+            ") " +
             "    ${ew.customSqlSegment}" +
             "</script>")
     IPage<LawyerUserViolationVo> getViolationPage(

+ 4 - 3
alien-lawyer/src/main/java/shop/alien/lawyer/controller/LawyerUserViolationController.java

@@ -144,9 +144,10 @@ public class LawyerUserViolationController {
             @RequestParam(defaultValue = "1") int pageNum,
             @RequestParam(defaultValue = "10") int pageSize,
             @RequestParam(required = false) String orderId,
-            @RequestParam(required = false) String processingStatus) {
-        log.info("LawyerUserViolationController.getViolationPage?pageNum={},pageSize={},orderId={},processingStatus={}", pageNum, pageSize, orderId, processingStatus);
-        return R.data(lawyerUserViolationService.getViolationPage(pageNum, pageSize, orderId, processingStatus));
+            @RequestParam(required = false) String processingStatus,
+            @RequestParam(required = false) String reportingUserName) {
+        log.info("LawyerUserViolationController.getViolationPage?pageNum={},pageSize={},orderId={},processingStatus={},reportingUserName={}", pageNum, pageSize, orderId, processingStatus, reportingUserName);
+        return R.data(lawyerUserViolationService.getViolationPage(pageNum, pageSize, orderId, processingStatus, reportingUserName));
     }
 
     @ApiOperation(value = "举报审核")

+ 1 - 1
alien-lawyer/src/main/java/shop/alien/lawyer/service/LawyerUserViolationService.java

@@ -46,7 +46,7 @@ public interface LawyerUserViolationService extends IService<LawyerUserViolation
      */
     LawyerUserViolationVo reportListById(String id);
 
-    IPage<LawyerUserViolationDto> getViolationPage(int page, int size, String orderId, String processingStatus);
+    IPage<LawyerUserViolationDto> getViolationPage(int page, int size, String orderId, String processingStatus, String reportingUserName);
 
     void approve(int id, String processingStatus, String reportResult);
 

+ 8 - 1
alien-lawyer/src/main/java/shop/alien/lawyer/service/impl/LawyerUserViolationServiceImpl.java

@@ -736,7 +736,7 @@ public class LawyerUserViolationServiceImpl extends ServiceImpl<LawyerUserViolat
     }
 
     @Override
-    public IPage<LawyerUserViolationDto> getViolationPage(int page, int size, String orderId, String processingStatus) {
+    public IPage<LawyerUserViolationDto> getViolationPage(int page, int size, String orderId, String processingStatus, String reportingUserName) {
         IPage<LawyerUserViolationVo> pageRequest = new Page<>(page, size);
         QueryWrapper<LawyerUserViolationVo> queryWrapper = new QueryWrapper<>();
 
@@ -749,6 +749,10 @@ public class LawyerUserViolationServiceImpl extends ServiceImpl<LawyerUserViolat
         if (StringUtils.isNotEmpty(processingStatus)) {
             queryWrapper.eq("luv.processing_status", processingStatus);
         }
+        // 举报人名称模糊查询
+        if (StringUtils.isNotEmpty(reportingUserName)) {
+            queryWrapper.like("ui.nick_name", reportingUserName);
+        }
 
         queryWrapper.orderByDesc("luv.updated_time");
 
@@ -771,7 +775,10 @@ public class LawyerUserViolationServiceImpl extends ServiceImpl<LawyerUserViolat
                 }
             }
 
+            // 设置举报人和被举报人名称
             dto.setNickname(e.getNickName());
+            dto.setReportUserName(e.getReportUserName());
+            dto.setReportedUserName(e.getReportedUserName());
             return dto;
         });
     }