|
|
@@ -456,6 +456,32 @@ public class LawyerUserViolationServiceImpl extends ServiceImpl<LawyerUserViolat
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 获取举报用户名称
|
|
|
+ *
|
|
|
+ * @param lawyerUserViolation 举报信息对象
|
|
|
+ * @return 举报用户名称
|
|
|
+ */
|
|
|
+ private String getReportingUserName(LawyerUserViolation lawyerUserViolation) {
|
|
|
+ String reportingUserType = lawyerUserViolation.getReportingUserType();
|
|
|
+ String reportingUserId = lawyerUserViolation.getReportingUserId();
|
|
|
+
|
|
|
+ if (StringUtils.isEmpty(reportingUserId)) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (USER_TYPE_LAWYER.equals(reportingUserType)) {
|
|
|
+ LawyerUser lawyerUser = lawyerUserMapper.selectById(reportingUserId);
|
|
|
+ return lawyerUser != null ? lawyerUser.getName() : null;
|
|
|
+ } else if (USER_TYPE_STORE.equals(reportingUserType)) {
|
|
|
+ StoreUser storeUser = storeUserMapper.selectById(reportingUserId);
|
|
|
+ return storeUser != null ? storeUser.getNickName() : null;
|
|
|
+ } else {
|
|
|
+ LifeUser lifeUser = lifeUserMapper.selectById(reportingUserId);
|
|
|
+ return lifeUser != null ? lifeUser.getUserName() : null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 生成被举报人通知消息
|
|
|
*
|
|
|
* @param lawyerUserViolation 举报信息对象
|
|
|
@@ -601,34 +627,53 @@ public class LawyerUserViolationServiceImpl extends ServiceImpl<LawyerUserViolat
|
|
|
return resultMap;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 根据ID查询举报详情
|
|
|
+ * <p>
|
|
|
+ * 根据举报ID查询举报详细信息,包括被举报人信息、举报原因、举报凭证等
|
|
|
+ * </p>
|
|
|
+ *
|
|
|
+ * @param id 举报记录ID,不能为空
|
|
|
+ * @return 举报详情VO对象,如果记录不存在返回null
|
|
|
+ * @throws RuntimeException 当参数无效或查询异常时抛出
|
|
|
+ * @author system
|
|
|
+ * @since 2025-01-XX
|
|
|
+ */
|
|
|
@Override
|
|
|
- public Map<String, Object> reportListById(String id) {
|
|
|
- Map<String, Object> resultMap = new HashMap<String, Object>();
|
|
|
- LawyerUserViolationVo lawyerUserViolationVo = new LawyerUserViolationVo();
|
|
|
- LawyerUserViolation lawyerUserViolation = lawyerUserViolationMapper.selectById(id);
|
|
|
- //商户或者用户名称
|
|
|
- String reportedUserName;
|
|
|
- if ("3".equals(lawyerUserViolation.getReportedUserType())) {
|
|
|
- LawyerUser lawyerUser = lawyerUserMapper.selectById(lawyerUserViolation.getReportedUserId());
|
|
|
- reportedUserName = lawyerUser.getName();
|
|
|
- } else if ("1".equals(lawyerUserViolation.getReportedUserType())) {
|
|
|
- StoreUser storeUser = storeUserMapper.selectById(lawyerUserViolation.getReportedUserId());
|
|
|
- reportedUserName = storeUser.getName();
|
|
|
- } else {
|
|
|
- LifeUser lifeUser = lifeUserMapper.selectById(lawyerUserViolation.getReportedUserId());
|
|
|
- reportedUserName = lifeUser.getUserName();
|
|
|
+ public LawyerUserViolationVo reportListById(String id) {
|
|
|
+ // 参数校验
|
|
|
+ if (StringUtils.isEmpty(id)) {
|
|
|
+ log.warn("查询举报详情参数为空,ID:{}", id);
|
|
|
+ throw new RuntimeException("举报ID不能为空");
|
|
|
+ }
|
|
|
+
|
|
|
+ try {
|
|
|
+ // 查询举报记录
|
|
|
+ LawyerUserViolation lawyerUserViolation = lawyerUserViolationMapper.selectById(id);
|
|
|
+ if (lawyerUserViolation == null) {
|
|
|
+ log.warn("举报记录不存在,ID:{}", id);
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 构建VO对象
|
|
|
+ LawyerUserViolationVo violationVo = new LawyerUserViolationVo();
|
|
|
+ BeanUtils.copyProperties(lawyerUserViolation, violationVo);
|
|
|
+
|
|
|
+ // 获取被举报用户名称
|
|
|
+ String reportedUserName = getReportedUserName(lawyerUserViolation);
|
|
|
+ violationVo.setReportedUserName(reportedUserName);
|
|
|
+
|
|
|
+ // 获取举报用户名称
|
|
|
+ String reportingUserName = getReportingUserName(lawyerUserViolation);
|
|
|
+ violationVo.setReportUserName(reportingUserName);
|
|
|
+
|
|
|
+ log.info("查询举报详情成功,ID:{}", id);
|
|
|
+ return violationVo;
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("查询举报详情异常,ID:{},异常信息:{}", id, e.getMessage(), e);
|
|
|
+ throw new RuntimeException("查询举报详情失败:" + e.getMessage(), e);
|
|
|
}
|
|
|
- resultMap.put("message", lawyerUserViolation.getProcessingStatus() != null ? lawyerUserViolation.getProcessingStatus() : "");
|
|
|
- lawyerUserViolationVo.setReportObject(reportedUserName);
|
|
|
- lawyerUserViolationVo.setViolationReason(lawyerUserViolation.getViolationReason());
|
|
|
- lawyerUserViolationVo.setReportEvidenceImg(lawyerUserViolation.getReportEvidenceImg());
|
|
|
- lawyerUserViolationVo.setCreatedTime(lawyerUserViolation.getCreatedTime());
|
|
|
- resultMap.put("reportDetail", lawyerUserViolationVo);
|
|
|
- LawyerUserViolationVo lawyerUserViolationVo2 = new LawyerUserViolationVo();
|
|
|
- lawyerUserViolationVo2.setProcessingStatus(lawyerUserViolation.getProcessingStatus());
|
|
|
- lawyerUserViolationVo2.setProcessingTime(lawyerUserViolation.getProcessingTime());
|
|
|
- resultMap.put("processStatus", lawyerUserViolationVo);
|
|
|
- return resultMap;
|
|
|
}
|
|
|
|
|
|
@Override
|