|
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
|
+import com.google.common.collect.Lists;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -17,6 +18,7 @@ import org.springframework.util.CollectionUtils;
|
|
|
import shop.alien.entity.second.SecondGoodsRecord;
|
|
import shop.alien.entity.second.SecondGoodsRecord;
|
|
|
import shop.alien.entity.store.*;
|
|
import shop.alien.entity.store.*;
|
|
|
import shop.alien.entity.store.dto.LifeUserViolationDto;
|
|
import shop.alien.entity.store.dto.LifeUserViolationDto;
|
|
|
|
|
+import shop.alien.entity.store.excelVo.LifeUserOrderExcelVo;
|
|
|
import shop.alien.entity.store.excelVo.LifeUserViolationExcelVO;
|
|
import shop.alien.entity.store.excelVo.LifeUserViolationExcelVO;
|
|
|
import shop.alien.entity.store.excelVo.util.ExcelGenerator;
|
|
import shop.alien.entity.store.excelVo.util.ExcelGenerator;
|
|
|
import shop.alien.entity.store.vo.LifeUserViolationVo;
|
|
import shop.alien.entity.store.vo.LifeUserViolationVo;
|
|
@@ -25,19 +27,24 @@ import shop.alien.mapper.*;
|
|
|
import shop.alien.mapper.second.SecondGoodsRecordMapper;
|
|
import shop.alien.mapper.second.SecondGoodsRecordMapper;
|
|
|
import shop.alien.store.config.WebSocketProcess;
|
|
import shop.alien.store.config.WebSocketProcess;
|
|
|
import shop.alien.store.service.*;
|
|
import shop.alien.store.service.*;
|
|
|
|
|
+import shop.alien.store.util.AiUserViolationUtils;
|
|
|
import shop.alien.store.util.FunctionMagic;
|
|
import shop.alien.store.util.FunctionMagic;
|
|
|
import shop.alien.util.ali.AliOSSUtil;
|
|
import shop.alien.util.ali.AliOSSUtil;
|
|
|
import shop.alien.util.common.EnumUtil;
|
|
import shop.alien.util.common.EnumUtil;
|
|
|
|
|
+import shop.alien.util.common.JwtUtil;
|
|
|
|
|
|
|
|
import java.io.File;
|
|
import java.io.File;
|
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
+import java.time.Instant;
|
|
|
import java.time.ZoneId;
|
|
import java.time.ZoneId;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
import java.time.format.DateTimeFormatter;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
+import static shop.alien.util.common.constant.Constant.*;
|
|
|
|
|
+
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* <p>
|
|
* <p>
|
|
@@ -81,6 +88,8 @@ public class LifeUserViolationServiceImpl extends ServiceImpl<LifeUserViolationM
|
|
|
private final SecondGoodsRecordMapper secondGoodsRecordMapper;
|
|
private final SecondGoodsRecordMapper secondGoodsRecordMapper;
|
|
|
private final StoreImgService storeImgService;
|
|
private final StoreImgService storeImgService;
|
|
|
|
|
|
|
|
|
|
+ private final AiUserViolationUtils aiUserViolationUtils;
|
|
|
|
|
+
|
|
|
@Value("${spring.web.resources.excel-path}")
|
|
@Value("${spring.web.resources.excel-path}")
|
|
|
private String excelPath;
|
|
private String excelPath;
|
|
|
|
|
|
|
@@ -101,34 +110,47 @@ public class LifeUserViolationServiceImpl extends ServiceImpl<LifeUserViolationM
|
|
|
}
|
|
}
|
|
|
int result = lifeUserViolationMapper.insert(lifeuserViolation);
|
|
int result = lifeUserViolationMapper.insert(lifeuserViolation);
|
|
|
if (result > 0) {
|
|
if (result > 0) {
|
|
|
|
|
+ // AI审核
|
|
|
|
|
+ //登录获取token
|
|
|
|
|
+ String token = aiUserViolationUtils.getAccessToken();
|
|
|
|
|
+ //调用AI接口
|
|
|
|
|
+ String taskId = aiUserViolationUtils.createTask(token, lifeuserViolation);
|
|
|
|
|
+ if (org.springframework.util.StringUtils.isEmpty(taskId)) {
|
|
|
|
|
+ log.warn("Failed to create AI task for second round review, lifeuserViolation id={}", lifeuserViolation.getId());
|
|
|
|
|
+ return 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ lifeuserViolation.setAiTaskId(taskId);
|
|
|
|
|
+ lifeUserViolationMapper.updateById(lifeuserViolation);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
//String phoneId = Objects.requireNonNull(JwtUtil.getCurrentUserInfo()).getString("userType") + "_" + JwtUtil.getCurrentUserInfo().getString("phone");
|
|
//String phoneId = Objects.requireNonNull(JwtUtil.getCurrentUserInfo()).getString("userType") + "_" + JwtUtil.getCurrentUserInfo().getString("phone");
|
|
|
- // 举报人消息
|
|
|
|
|
- LifeNotice lifeNotice = getLifeNotice(lifeuserViolation);
|
|
|
|
|
- lifeNoticeMapper.insert(lifeNotice);
|
|
|
|
|
- WebSocketVo websocketVo = new WebSocketVo();
|
|
|
|
|
- websocketVo.setSenderId("system");
|
|
|
|
|
- websocketVo.setReceiverId(lifeNotice.getReceiverId());
|
|
|
|
|
- websocketVo.setCategory("notice");
|
|
|
|
|
- websocketVo.setNoticeType("1");
|
|
|
|
|
- websocketVo.setIsRead(0);
|
|
|
|
|
- websocketVo.setText(com.alibaba.fastjson2.JSONObject.from(lifeNotice).toJSONString());
|
|
|
|
|
- webSocketProcess.sendMessage(lifeNotice.getReceiverId(), com.alibaba.fastjson2.JSONObject.from(websocketVo).toJSONString());
|
|
|
|
|
-
|
|
|
|
|
- // 被举报人消息
|
|
|
|
|
- if (StringUtils.isNotEmpty(lifeuserViolation.getReportContextType()) && "1,2,3".contains(lifeuserViolation.getReportContextType())) {
|
|
|
|
|
- LifeNotice lifeNoticeReported = getLifeReportedNotice(lifeuserViolation);
|
|
|
|
|
- if (lifeNoticeReported != null) {
|
|
|
|
|
- lifeNoticeMapper.insert(lifeNoticeReported);
|
|
|
|
|
- WebSocketVo websocketVoReported = new WebSocketVo();
|
|
|
|
|
- websocketVoReported.setSenderId("system");
|
|
|
|
|
- websocketVoReported.setReceiverId(lifeNoticeReported.getReceiverId());
|
|
|
|
|
- websocketVoReported.setCategory("notice");
|
|
|
|
|
- websocketVoReported.setNoticeType("1");
|
|
|
|
|
- websocketVoReported.setIsRead(0);
|
|
|
|
|
- websocketVoReported.setText(com.alibaba.fastjson2.JSONObject.from(lifeNoticeReported).toJSONString());
|
|
|
|
|
- webSocketProcess.sendMessage(lifeNoticeReported.getReceiverId(), com.alibaba.fastjson2.JSONObject.from(websocketVoReported).toJSONString());
|
|
|
|
|
|
|
+ // 举报人消息
|
|
|
|
|
+ LifeNotice lifeNotice = getLifeNotice(lifeuserViolation);
|
|
|
|
|
+ lifeNoticeMapper.insert(lifeNotice);
|
|
|
|
|
+ WebSocketVo websocketVo = new WebSocketVo();
|
|
|
|
|
+ websocketVo.setSenderId("system");
|
|
|
|
|
+ websocketVo.setReceiverId(lifeNotice.getReceiverId());
|
|
|
|
|
+ websocketVo.setCategory("notice");
|
|
|
|
|
+ websocketVo.setNoticeType("1");
|
|
|
|
|
+ websocketVo.setIsRead(0);
|
|
|
|
|
+ websocketVo.setText(com.alibaba.fastjson2.JSONObject.from(lifeNotice).toJSONString());
|
|
|
|
|
+ webSocketProcess.sendMessage(lifeNotice.getReceiverId(), com.alibaba.fastjson2.JSONObject.from(websocketVo).toJSONString());
|
|
|
|
|
+
|
|
|
|
|
+ // 被举报人消息
|
|
|
|
|
+ if(StringUtils.isNotEmpty(lifeuserViolation.getReportContextType()) && "1,2,3".contains(lifeuserViolation.getReportContextType())){
|
|
|
|
|
+ LifeNotice lifeNoticeReported = getLifeReportedNotice(lifeuserViolation);
|
|
|
|
|
+ if (lifeNoticeReported != null) {
|
|
|
|
|
+ lifeNoticeMapper.insert(lifeNoticeReported);
|
|
|
|
|
+ WebSocketVo websocketVoReported = new WebSocketVo();
|
|
|
|
|
+ websocketVoReported.setSenderId("system");
|
|
|
|
|
+ websocketVoReported.setReceiverId(lifeNoticeReported.getReceiverId());
|
|
|
|
|
+ websocketVoReported.setCategory("notice");
|
|
|
|
|
+ websocketVoReported.setNoticeType("1");
|
|
|
|
|
+ websocketVoReported.setIsRead(0);
|
|
|
|
|
+ websocketVoReported.setText(com.alibaba.fastjson2.JSONObject.from(lifeNoticeReported).toJSONString());
|
|
|
|
|
+ webSocketProcess.sendMessage(lifeNoticeReported.getReceiverId(), com.alibaba.fastjson2.JSONObject.from(websocketVoReported).toJSONString());
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
@@ -153,16 +175,16 @@ public class LifeUserViolationServiceImpl extends ServiceImpl<LifeUserViolationM
|
|
|
|
|
|
|
|
if ("1".equals(lifeuserViolation.getReportingUserType())) {
|
|
if ("1".equals(lifeuserViolation.getReportingUserType())) {
|
|
|
StoreUser storeUsers = storeUserMapper.selectById(reportUserId);
|
|
StoreUser storeUsers = storeUserMapper.selectById(reportUserId);
|
|
|
- phoneId = "store_" + storeUsers.getPhone();
|
|
|
|
|
|
|
+ phoneId = "store_"+storeUsers.getPhone();
|
|
|
} else {
|
|
} else {
|
|
|
LifeUser lifeUsers = lifeUserMapper.selectById(reportUserId);
|
|
LifeUser lifeUsers = lifeUserMapper.selectById(reportUserId);
|
|
|
- phoneId = "user_" + lifeUsers.getUserPhone();
|
|
|
|
|
|
|
+ phoneId = "user_"+lifeUsers.getUserPhone();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
lifeNotice.setReceiverId(phoneId);
|
|
lifeNotice.setReceiverId(phoneId);
|
|
|
|
|
|
|
|
- if (StringUtils.isNotEmpty(reportContextType) && "1,2,3".contains(reportContextType)) {
|
|
|
|
|
- String violationType = StringUtils.isNotEmpty(lifeuserViolation.getViolationType()) ? lifeuserViolation.getViolationType() : "13";
|
|
|
|
|
|
|
+ if(StringUtils.isNotEmpty(reportContextType) && "1,2,3".contains(reportContextType)){
|
|
|
|
|
+ String violationType = StringUtils.isNotEmpty(lifeuserViolation.getViolationType())?lifeuserViolation.getViolationType():"13";
|
|
|
String violationText = EnumUtil.getStatusValue(Integer.parseInt(violationType));
|
|
String violationText = EnumUtil.getStatusValue(Integer.parseInt(violationType));
|
|
|
|
|
|
|
|
String storeOrUserName = "";
|
|
String storeOrUserName = "";
|
|
@@ -182,25 +204,25 @@ public class LifeUserViolationServiceImpl extends ServiceImpl<LifeUserViolationM
|
|
|
|
|
|
|
|
switch (reportContextType) {
|
|
switch (reportContextType) {
|
|
|
case "1":
|
|
case "1":
|
|
|
- message = "您在" + storeDate + "举报用户“" + storeOrUserName + "”,涉嫌" + violationText + ",已提交至平台审核,1-3个工作日会将审核结果发送到您应用内的消息-通知中,请注意查收。";
|
|
|
|
|
|
|
+ message = "您在" + storeDate + "举报用户“" + storeOrUserName + "”,涉嫌"+violationText+",已提交至平台审核,1-3个工作日会将审核结果发送到您应用内的消息-通知中,请注意查收。";
|
|
|
break;
|
|
break;
|
|
|
case "2":
|
|
case "2":
|
|
|
String dynamicsId = lifeuserViolation.getDynamicsId();
|
|
String dynamicsId = lifeuserViolation.getDynamicsId();
|
|
|
String dynamicsDate = simpleDateFormat.format(new Date());
|
|
String dynamicsDate = simpleDateFormat.format(new Date());
|
|
|
- if (StringUtils.isNotEmpty(dynamicsId)) {
|
|
|
|
|
|
|
+ if(StringUtils.isNotEmpty(dynamicsId)){
|
|
|
LifeUserDynamics lifeUserDynamics = lifeUserDynamicsMapper.selectById(dynamicsId);
|
|
LifeUserDynamics lifeUserDynamics = lifeUserDynamicsMapper.selectById(dynamicsId);
|
|
|
dynamicsDate = simpleDateFormats.format(lifeUserDynamics.getCreatedTime());
|
|
dynamicsDate = simpleDateFormats.format(lifeUserDynamics.getCreatedTime());
|
|
|
}
|
|
}
|
|
|
- message = "您在" + storeDate + "举报用户“" + storeOrUserName + "”在" + dynamicsDate + "发布的动态,涉嫌" + violationText + ",已提交至平台审核,1-3个工作日会将审核结果发送到您应用内的消息-通知中,请注意查收。";
|
|
|
|
|
|
|
+ message = "您在" + storeDate + "举报用户“" + storeOrUserName + "”在"+dynamicsDate+"发布的动态,涉嫌"+violationText+",已提交至平台审核,1-3个工作日会将审核结果发送到您应用内的消息-通知中,请注意查收。";
|
|
|
break;
|
|
break;
|
|
|
case "3":
|
|
case "3":
|
|
|
String commonId = lifeuserViolation.getCommentId();
|
|
String commonId = lifeuserViolation.getCommentId();
|
|
|
String commonDate = simpleDateFormat.format(new Date());
|
|
String commonDate = simpleDateFormat.format(new Date());
|
|
|
- if (StringUtils.isNotEmpty(commonId)) {
|
|
|
|
|
- StoreComment storeComment = storeCommentMapper.selectById(commonId);
|
|
|
|
|
|
|
+ if(StringUtils.isNotEmpty(commonId)){
|
|
|
|
|
+ StoreComment storeComment = storeCommentMapper.selectById(commonId);
|
|
|
commonDate = simpleDateFormats.format(storeComment.getCreatedTime());
|
|
commonDate = simpleDateFormats.format(storeComment.getCreatedTime());
|
|
|
}
|
|
}
|
|
|
- message = "您在" + storeDate + "举报用户“" + storeOrUserName + "”在" + commonDate + "发布的评论,涉嫌" + violationText + ",已提交至平台审核,1-3个工作日会将审核结果发送到您应用内的消息-通知中,请注意查收。";
|
|
|
|
|
|
|
+ message = "您在" + storeDate + "举报用户“" + storeOrUserName + "”在"+commonDate+"发布的评论,涉嫌"+violationText+",已提交至平台审核,1-3个工作日会将审核结果发送到您应用内的消息-通知中,请注意查收。";
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -229,7 +251,7 @@ public class LifeUserViolationServiceImpl extends ServiceImpl<LifeUserViolationM
|
|
|
lifeNotice.setReceiverId("user_" + phoneId);
|
|
lifeNotice.setReceiverId("user_" + phoneId);
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
- if (StringUtils.isEmpty(phoneId)) {
|
|
|
|
|
|
|
+ if (StringUtils.isEmpty(phoneId)){
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
String violationText = EnumUtil.getStatusValue(Integer.parseInt(lifeuserViolation.getViolationType()));
|
|
String violationText = EnumUtil.getStatusValue(Integer.parseInt(lifeuserViolation.getViolationType()));
|
|
@@ -243,8 +265,8 @@ public class LifeUserViolationServiceImpl extends ServiceImpl<LifeUserViolationM
|
|
|
String storeDate = simpleDateFormat.format(new Date());
|
|
String storeDate = simpleDateFormat.format(new Date());
|
|
|
String reportContextType = lifeuserViolation.getReportContextType();
|
|
String reportContextType = lifeuserViolation.getReportContextType();
|
|
|
|
|
|
|
|
- if (StringUtils.isNotEmpty(reportContextType) && reportContextType.equals("1")) {
|
|
|
|
|
- message = "您在" + storeDate + "被举报涉嫌" + violationText + ",平台将会进行核实。如确实存在违规行为,平台将禁用您的账号**天,到期后账号可恢复使用,应用内的环境需要我们共同维护。";
|
|
|
|
|
|
|
+ if(StringUtils.isNotEmpty(reportContextType) && reportContextType.equals("1")){
|
|
|
|
|
+ message = "您在" + storeDate + "被举报涉嫌"+violationText+",平台将会进行核实。如确实存在违规行为,平台将禁用您的账号**天,到期后账号可恢复使用,应用内的环境需要我们共同维护。";
|
|
|
} else {
|
|
} else {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
@@ -310,9 +332,8 @@ public class LifeUserViolationServiceImpl extends ServiceImpl<LifeUserViolationM
|
|
|
QueryWrapper<LifeUserViolationVo> queryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<LifeUserViolationVo> queryWrapper = new QueryWrapper<>();
|
|
|
|
|
|
|
|
// 基础查询条件
|
|
// 基础查询条件
|
|
|
- queryWrapper.eq("luv.delete_flag", 0);
|
|
|
|
|
-// //排除二手的举报
|
|
|
|
|
-// .notIn("luv.report_context_type", Arrays.asList("4", "5"));
|
|
|
|
|
|
|
+ queryWrapper.eq("luv.delete_flag", 0)
|
|
|
|
|
+ .in("luv.report_context_type", Arrays.asList("1", "2", "3"));
|
|
|
|
|
|
|
|
// 动态查询条件
|
|
// 动态查询条件
|
|
|
queryWrapper.like(StringUtils.isNotEmpty(nickName), "ui.nick_name", nickName)
|
|
queryWrapper.like(StringUtils.isNotEmpty(nickName), "ui.nick_name", nickName)
|
|
@@ -350,7 +371,7 @@ public class LifeUserViolationServiceImpl extends ServiceImpl<LifeUserViolationM
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void approve(int id, String processingStatus, String reportResult) {
|
|
public void approve(int id, String processingStatus, String reportResult) {
|
|
|
- if (id == 0 || StringUtils.isBlank(processingStatus)) {
|
|
|
|
|
|
|
+ if(id==0 || StringUtils.isBlank(processingStatus)){
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
LifeUserViolation v = lifeUserViolationMapper.selectById(id);
|
|
LifeUserViolation v = lifeUserViolationMapper.selectById(id);
|
|
@@ -364,15 +385,15 @@ public class LifeUserViolationServiceImpl extends ServiceImpl<LifeUserViolationM
|
|
|
String violationTime = simpleDateFormat.format(v.getCreatedTime());
|
|
String violationTime = simpleDateFormat.format(v.getCreatedTime());
|
|
|
// 被举报人信息
|
|
// 被举报人信息
|
|
|
String reportedUserName = "";
|
|
String reportedUserName = "";
|
|
|
- if (StringUtils.isNotEmpty(v.getReportedUserId())) {
|
|
|
|
|
|
|
+ if(StringUtils.isNotEmpty(v.getReportedUserId())){
|
|
|
if (v.getReportedUserType().equals("1")) {
|
|
if (v.getReportedUserType().equals("1")) {
|
|
|
StoreUser storeUser = storeUserMapper.selectById(v.getReportedUserId());
|
|
StoreUser storeUser = storeUserMapper.selectById(v.getReportedUserId());
|
|
|
- if (storeUser != null) {
|
|
|
|
|
|
|
+ if(storeUser != null){
|
|
|
reportedUserName = storeUser.getNickName();
|
|
reportedUserName = storeUser.getNickName();
|
|
|
}
|
|
}
|
|
|
- } else {
|
|
|
|
|
|
|
+ } else{
|
|
|
LifeUser lifeUser = lifeUserMapper.selectById(v.getReportedUserId());
|
|
LifeUser lifeUser = lifeUserMapper.selectById(v.getReportedUserId());
|
|
|
- if (lifeUser != null) {
|
|
|
|
|
|
|
+ if(lifeUser != null) {
|
|
|
reportedUserName = lifeUser.getUserName();
|
|
reportedUserName = lifeUser.getUserName();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -380,15 +401,15 @@ public class LifeUserViolationServiceImpl extends ServiceImpl<LifeUserViolationM
|
|
|
// 被举报动态信息
|
|
// 被举报动态信息
|
|
|
String dynamicsId = v.getDynamicsId();
|
|
String dynamicsId = v.getDynamicsId();
|
|
|
String dynamicsDate = simpleDateFormats.format(new Date());
|
|
String dynamicsDate = simpleDateFormats.format(new Date());
|
|
|
- if (StringUtils.isNotEmpty(dynamicsId)) {
|
|
|
|
|
|
|
+ if(StringUtils.isNotEmpty(dynamicsId)){
|
|
|
LifeUserDynamics lifeUserDynamics = lifeUserDynamicsMapper.selectById(dynamicsId);
|
|
LifeUserDynamics lifeUserDynamics = lifeUserDynamicsMapper.selectById(dynamicsId);
|
|
|
dynamicsDate = simpleDateFormats.format(lifeUserDynamics.getCreatedTime());
|
|
dynamicsDate = simpleDateFormats.format(lifeUserDynamics.getCreatedTime());
|
|
|
}
|
|
}
|
|
|
// 被举报评论信息
|
|
// 被举报评论信息
|
|
|
String commonId = v.getCommentId();
|
|
String commonId = v.getCommentId();
|
|
|
String commonDate = simpleDateFormats.format(new Date());
|
|
String commonDate = simpleDateFormats.format(new Date());
|
|
|
- if (StringUtils.isNotEmpty(commonId)) {
|
|
|
|
|
- StoreComment storeComment = storeCommentMapper.selectById(commonId);
|
|
|
|
|
|
|
+ if(StringUtils.isNotEmpty(commonId)){
|
|
|
|
|
+ StoreComment storeComment = storeCommentMapper.selectById(commonId);
|
|
|
commonDate = simpleDateFormats.format(storeComment.getCreatedTime());
|
|
commonDate = simpleDateFormats.format(storeComment.getCreatedTime());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -401,13 +422,13 @@ public class LifeUserViolationServiceImpl extends ServiceImpl<LifeUserViolationM
|
|
|
// 通过
|
|
// 通过
|
|
|
if (v.getReportContextType().equals("1")) {
|
|
if (v.getReportContextType().equals("1")) {
|
|
|
// 用户
|
|
// 用户
|
|
|
- message = "您在" + violationTime + "举报用户“" + reportedUserName + "”,涉嫌违法违规,经核实,确实存在违规行为,平台已将用户禁用,感谢您为此做出的贡献。";
|
|
|
|
|
|
|
+ message = "您在"+violationTime+"举报用户“"+reportedUserName+"”,涉嫌违法违规,经核实,确实存在违规行为,平台已将用户禁用,感谢您为此做出的贡献。";
|
|
|
title = "用户举报成功通知";
|
|
title = "用户举报成功通知";
|
|
|
}
|
|
}
|
|
|
if (v.getReportContextType().equals("2")) {
|
|
if (v.getReportContextType().equals("2")) {
|
|
|
// 动态
|
|
// 动态
|
|
|
- message = "您在" + violationTime + "举报用户“" + reportedUserName + "”在" + dynamicsDate + "发布的动态,涉嫌违法违规,经核实,确实存在违规行为,平台已将此动态下架,感谢您为此做出的贡献";
|
|
|
|
|
- reportedMessage = "您在" + dynamicsDate + "发布的动态,经核实,确实存在违规行为,平台已将此动态下架,应用内的环境需要我们共同维护";
|
|
|
|
|
|
|
+ message = "您在"+violationTime+"举报用户“"+reportedUserName+"”在"+dynamicsDate+"发布的动态,涉嫌违法违规,经核实,确实存在违规行为,平台已将此动态下架,感谢您为此做出的贡献";
|
|
|
|
|
+ reportedMessage = "您在"+dynamicsDate+"发布的动态,经核实,确实存在违规行为,平台已将此动态下架,应用内的环境需要我们共同维护";
|
|
|
lifeUserDynamicsService.removeById(v.getDynamicsId());
|
|
lifeUserDynamicsService.removeById(v.getDynamicsId());
|
|
|
title = "动态举报成功通知";
|
|
title = "动态举报成功通知";
|
|
|
}
|
|
}
|
|
@@ -415,29 +436,29 @@ public class LifeUserViolationServiceImpl extends ServiceImpl<LifeUserViolationM
|
|
|
// 评论
|
|
// 评论
|
|
|
if (v.getReportedUserType().equals("1")) {
|
|
if (v.getReportedUserType().equals("1")) {
|
|
|
// 商户
|
|
// 商户
|
|
|
- message = "您在" + violationTime + "举报用户“" + reportedUserName + "”在" + commonDate + "发布的评论,涉嫌违法违规,经核实,确实存在违规行为,平台已将此评论下架,感谢您为此做出的贡献。";
|
|
|
|
|
|
|
+ message = "您在"+violationTime+"举报用户“"+reportedUserName+"”在"+commonDate+"发布的评论,涉嫌违法违规,经核实,确实存在违规行为,平台已将此评论下架,感谢您为此做出的贡献。";
|
|
|
storeCommentService.removeById(v.getCommentId());
|
|
storeCommentService.removeById(v.getCommentId());
|
|
|
} else {
|
|
} else {
|
|
|
// 用户
|
|
// 用户
|
|
|
- message = "您在" + violationTime + "举报用户“" + reportedUserName + "”在" + commonDate + "发布的评论,涉嫌违法违规,经核实,确实存在违规行为,平台已将此评论下架,感谢您为此做出的贡献。";
|
|
|
|
|
|
|
+ message = "您在"+violationTime+"举报用户“"+reportedUserName+"”在"+commonDate+"发布的评论,涉嫌违法违规,经核实,确实存在违规行为,平台已将此评论下架,感谢您为此做出的贡献。";
|
|
|
lifeCommentMapper.deleteById(v.getCommentId());
|
|
lifeCommentMapper.deleteById(v.getCommentId());
|
|
|
}
|
|
}
|
|
|
- reportedMessage = "您在" + commonDate + "发布的评论,经核实,确实存在违规行为,平台已将此评论下架,应用内的环境需要我们共同维护。";
|
|
|
|
|
|
|
+ reportedMessage = "您在"+commonDate+"发布的评论,经核实,确实存在违规行为,平台已将此评论下架,应用内的环境需要我们共同维护。";
|
|
|
title = "评论举报成功通知";
|
|
title = "评论举报成功通知";
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
// 驳回
|
|
// 驳回
|
|
|
switch (v.getReportContextType()) {
|
|
switch (v.getReportContextType()) {
|
|
|
case "1":
|
|
case "1":
|
|
|
- message = "您在" + violationTime + "举报用户“" + reportedUserName + "”,涉嫌违法违规,经核实,不存在违规行为,感谢您为此做出的贡献。";
|
|
|
|
|
|
|
+ message = "您在"+violationTime+"举报用户“"+reportedUserName+"”,涉嫌违法违规,经核实,不存在违规行为,感谢您为此做出的贡献。";
|
|
|
title = "用户举报失败通知";
|
|
title = "用户举报失败通知";
|
|
|
break;
|
|
break;
|
|
|
case "2":
|
|
case "2":
|
|
|
- message = "您在" + violationTime + "举报用户“" + reportedUserName + "”在" + dynamicsDate + "发布的动态,涉嫌违法违规,经核实,不存在违规行为,感谢您为此做出的贡献。";
|
|
|
|
|
|
|
+ message = "您在"+violationTime+"举报用户“"+reportedUserName+"”在"+dynamicsDate+"发布的动态,涉嫌违法违规,经核实,不存在违规行为,感谢您为此做出的贡献。";
|
|
|
title = "动态举报失败通知";
|
|
title = "动态举报失败通知";
|
|
|
break;
|
|
break;
|
|
|
case "3":
|
|
case "3":
|
|
|
- message = "您在" + violationTime + "举报用户“" + reportedUserName + "”在" + commonDate + "发布的评论,涉嫌违法违规,经核实,不存在违规行为,感谢您为此做出的贡献。";
|
|
|
|
|
|
|
+ message = "您在"+violationTime+"举报用户“"+reportedUserName+"”在"+commonDate+"发布的评论,涉嫌违法违规,经核实,不存在违规行为,感谢您为此做出的贡献。";
|
|
|
title = "评论举报失败通知";
|
|
title = "评论举报失败通知";
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
@@ -479,7 +500,7 @@ public class LifeUserViolationServiceImpl extends ServiceImpl<LifeUserViolationM
|
|
|
|
|
|
|
|
|
|
|
|
|
// 被举报通知
|
|
// 被举报通知
|
|
|
- if (StringUtils.isNotEmpty(reportedMessage)) {
|
|
|
|
|
|
|
+ if(StringUtils.isNotEmpty(reportedMessage)) {
|
|
|
LifeNotice reportedLifeMessage = new LifeNotice();
|
|
LifeNotice reportedLifeMessage = new LifeNotice();
|
|
|
com.alibaba.fastjson2.JSONObject jsonObjectReported = new com.alibaba.fastjson2.JSONObject();
|
|
com.alibaba.fastjson2.JSONObject jsonObjectReported = new com.alibaba.fastjson2.JSONObject();
|
|
|
jsonObjectReported.put("message", reportedMessage);
|
|
jsonObjectReported.put("message", reportedMessage);
|
|
@@ -522,12 +543,10 @@ public class LifeUserViolationServiceImpl extends ServiceImpl<LifeUserViolationM
|
|
|
if (entity == null) return null;
|
|
if (entity == null) return null;
|
|
|
LifeUserViolationDto dto = new LifeUserViolationDto();
|
|
LifeUserViolationDto dto = new LifeUserViolationDto();
|
|
|
BeanUtils.copyProperties(entity, dto);
|
|
BeanUtils.copyProperties(entity, dto);
|
|
|
- LambdaQueryWrapper<StoreImg> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
- queryWrapper.eq(StoreImg::getStoreId, entity.getId());
|
|
|
|
|
- queryWrapper.in(StoreImg::getImgType, 19);
|
|
|
|
|
- List<StoreImg> storeImgList = storeImgService.list(queryWrapper);
|
|
|
|
|
- List<String> collect = storeImgList.stream().map(StoreImg::getImgUrl).collect(Collectors.toList());
|
|
|
|
|
- dto.setImageList(collect);
|
|
|
|
|
|
|
+ if (Objects.nonNull(entity.getReportEvidenceImg())) {
|
|
|
|
|
+ List<String> list = Arrays.stream(entity.getReportEvidenceImg().split(",")).map(String::trim).collect(Collectors.toList());
|
|
|
|
|
+ dto.setImageList(list);
|
|
|
|
|
+ }
|
|
|
// 处理举报人信息
|
|
// 处理举报人信息
|
|
|
FunctionMagic.handleUserInfo(dto.getReportingUserType(), dto.getReportingUserId(), storeId -> storeUserService.getOne(FunctionMagic.idQueryWrapper(storeId)), lifeId -> lifeUserService.getOne(FunctionMagic.idQueryWrapper(lifeId)), user -> {
|
|
FunctionMagic.handleUserInfo(dto.getReportingUserType(), dto.getReportingUserId(), storeId -> storeUserService.getOne(FunctionMagic.idQueryWrapper(storeId)), lifeId -> lifeUserService.getOne(FunctionMagic.idQueryWrapper(lifeId)), user -> {
|
|
|
if (user instanceof StoreUser) {
|
|
if (user instanceof StoreUser) {
|
|
@@ -576,7 +595,7 @@ public class LifeUserViolationServiceImpl extends ServiceImpl<LifeUserViolationM
|
|
|
queryWrapper.orderByDesc("luv.updated_time");
|
|
queryWrapper.orderByDesc("luv.updated_time");
|
|
|
|
|
|
|
|
List<LifeUserViolationVo> violationList = lifeUserViolationMapper.getViolationList(queryWrapper);
|
|
List<LifeUserViolationVo> violationList = lifeUserViolationMapper.getViolationList(queryWrapper);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 如果查询结果为空,返回空列表生成的Excel
|
|
// 如果查询结果为空,返回空列表生成的Excel
|
|
|
if (CollectionUtils.isEmpty(violationList)) {
|
|
if (CollectionUtils.isEmpty(violationList)) {
|
|
|
log.warn("导出Excel时查询结果为空,nickName={}, phone={}, processingStatus={}", nickName, phone, processingStatus);
|
|
log.warn("导出Excel时查询结果为空,nickName={}, phone={}, processingStatus={}", nickName, phone, processingStatus);
|
|
@@ -584,7 +603,7 @@ public class LifeUserViolationServiceImpl extends ServiceImpl<LifeUserViolationM
|
|
|
|
|
|
|
|
// 日期格式化器(复用)
|
|
// 日期格式化器(复用)
|
|
|
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 使用Stream API进行转换,提高性能和可读性
|
|
// 使用Stream API进行转换,提高性能和可读性
|
|
|
AtomicInteger serialNumber = new AtomicInteger(1);
|
|
AtomicInteger serialNumber = new AtomicInteger(1);
|
|
|
List<LifeUserViolationExcelVO> excelDataList = violationList.stream()
|
|
List<LifeUserViolationExcelVO> excelDataList = violationList.stream()
|
|
@@ -594,10 +613,10 @@ public class LifeUserViolationServiceImpl extends ServiceImpl<LifeUserViolationM
|
|
|
// 生成Excel文件
|
|
// 生成Excel文件
|
|
|
String fileName = UUID.randomUUID().toString().replace("-", "");
|
|
String fileName = UUID.randomUUID().toString().replace("-", "");
|
|
|
String filePath = ExcelGenerator.generateExcel(
|
|
String filePath = ExcelGenerator.generateExcel(
|
|
|
- excelPath + excelGeneratePath + fileName + ".xlsx",
|
|
|
|
|
- excelDataList,
|
|
|
|
|
|
|
+ excelPath + excelGeneratePath + fileName + ".xlsx",
|
|
|
|
|
+ excelDataList,
|
|
|
LifeUserViolationExcelVO.class);
|
|
LifeUserViolationExcelVO.class);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 上传到OSS并返回URL
|
|
// 上传到OSS并返回URL
|
|
|
return aliOSSUtil.uploadFile(new File(filePath), "excel/" + fileName + ".xlsx");
|
|
return aliOSSUtil.uploadFile(new File(filePath), "excel/" + fileName + ".xlsx");
|
|
|
}
|
|
}
|
|
@@ -605,18 +624,18 @@ public class LifeUserViolationServiceImpl extends ServiceImpl<LifeUserViolationM
|
|
|
/**
|
|
/**
|
|
|
* 将 LifeUserViolationVo 转换为 LifeUserViolationExcelVO
|
|
* 将 LifeUserViolationVo 转换为 LifeUserViolationExcelVO
|
|
|
*
|
|
*
|
|
|
- * @param vo 源对象
|
|
|
|
|
|
|
+ * @param vo 源对象
|
|
|
* @param serialNumber 序号
|
|
* @param serialNumber 序号
|
|
|
- * @param formatter 日期格式化器
|
|
|
|
|
|
|
+ * @param formatter 日期格式化器
|
|
|
* @return Excel VO对象
|
|
* @return Excel VO对象
|
|
|
*/
|
|
*/
|
|
|
private LifeUserViolationExcelVO convertToExcelVO(LifeUserViolationVo vo, int serialNumber, DateTimeFormatter formatter) {
|
|
private LifeUserViolationExcelVO convertToExcelVO(LifeUserViolationVo vo, int serialNumber, DateTimeFormatter formatter) {
|
|
|
LifeUserViolationExcelVO excelVO = new LifeUserViolationExcelVO();
|
|
LifeUserViolationExcelVO excelVO = new LifeUserViolationExcelVO();
|
|
|
BeanUtils.copyProperties(vo, excelVO);
|
|
BeanUtils.copyProperties(vo, excelVO);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
excelVO.setId(serialNumber);
|
|
excelVO.setId(serialNumber);
|
|
|
excelVO.setNickname(vo.getNickName());
|
|
excelVO.setNickname(vo.getNickName());
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 处理举报凭证图片(安全分割,避免数组越界)
|
|
// 处理举报凭证图片(安全分割,避免数组越界)
|
|
|
if (StringUtils.isNotEmpty(vo.getReportEvidenceImg())) {
|
|
if (StringUtils.isNotEmpty(vo.getReportEvidenceImg())) {
|
|
|
String[] imageParts = vo.getReportEvidenceImg().split(",");
|
|
String[] imageParts = vo.getReportEvidenceImg().split(",");
|
|
@@ -624,7 +643,7 @@ public class LifeUserViolationServiceImpl extends ServiceImpl<LifeUserViolationM
|
|
|
excelVO.setReportEvidenceImg(imageParts[0].trim());
|
|
excelVO.setReportEvidenceImg(imageParts[0].trim());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 处理举报内容类型
|
|
// 处理举报内容类型
|
|
|
if (StringUtils.isNotEmpty(vo.getReportContextType())) {
|
|
if (StringUtils.isNotEmpty(vo.getReportContextType())) {
|
|
|
try {
|
|
try {
|
|
@@ -634,7 +653,7 @@ public class LifeUserViolationServiceImpl extends ServiceImpl<LifeUserViolationM
|
|
|
excelVO.setReportContextType(vo.getReportContextType());
|
|
excelVO.setReportContextType(vo.getReportContextType());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 处理举报理由
|
|
// 处理举报理由
|
|
|
if (StringUtils.isNotEmpty(vo.getViolationType())) {
|
|
if (StringUtils.isNotEmpty(vo.getViolationType())) {
|
|
|
try {
|
|
try {
|
|
@@ -644,7 +663,7 @@ public class LifeUserViolationServiceImpl extends ServiceImpl<LifeUserViolationM
|
|
|
excelVO.setViolationType(vo.getViolationType());
|
|
excelVO.setViolationType(vo.getViolationType());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 处理处理状态
|
|
// 处理处理状态
|
|
|
if (StringUtils.isNotEmpty(vo.getProcessingStatus())) {
|
|
if (StringUtils.isNotEmpty(vo.getProcessingStatus())) {
|
|
|
try {
|
|
try {
|
|
@@ -654,7 +673,7 @@ public class LifeUserViolationServiceImpl extends ServiceImpl<LifeUserViolationM
|
|
|
excelVO.setProcessingStatus(vo.getProcessingStatus());
|
|
excelVO.setProcessingStatus(vo.getProcessingStatus());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 格式化创建时间
|
|
// 格式化创建时间
|
|
|
if (Objects.nonNull(vo.getCreatedTime())) {
|
|
if (Objects.nonNull(vo.getCreatedTime())) {
|
|
|
try {
|
|
try {
|
|
@@ -667,7 +686,7 @@ public class LifeUserViolationServiceImpl extends ServiceImpl<LifeUserViolationM
|
|
|
log.warn("格式化创建时间失败,createdTime={}, error={}", vo.getCreatedTime(), e.getMessage());
|
|
log.warn("格式化创建时间失败,createdTime={}, error={}", vo.getCreatedTime(), e.getMessage());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 格式化处理时间
|
|
// 格式化处理时间
|
|
|
if (Objects.nonNull(vo.getProcessingTime())) {
|
|
if (Objects.nonNull(vo.getProcessingTime())) {
|
|
|
try {
|
|
try {
|
|
@@ -680,7 +699,7 @@ public class LifeUserViolationServiceImpl extends ServiceImpl<LifeUserViolationM
|
|
|
log.warn("格式化处理时间失败,processingTime={}, error={}", vo.getProcessingTime(), e.getMessage());
|
|
log.warn("格式化处理时间失败,processingTime={}, error={}", vo.getProcessingTime(), e.getMessage());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
return excelVO;
|
|
return excelVO;
|
|
|
}
|
|
}
|
|
|
|
|
|