|
|
@@ -46,6 +46,7 @@ public class CommentAppealServiceImpl extends ServiceImpl<CommentAppealMapper, C
|
|
|
private final OrderReviewMapper orderReviewMapper;
|
|
|
private final LifeUserMapper lifeUserMapper;
|
|
|
private final LawyerUserMapper lawyerUserMapper;
|
|
|
+ private final LawyerConsultationOrderMapper lawyerConsultationOrderMapper;
|
|
|
|
|
|
|
|
|
@Override
|
|
|
@@ -70,6 +71,14 @@ public class CommentAppealServiceImpl extends ServiceImpl<CommentAppealMapper, C
|
|
|
return R.fail("该评论已有申诉记录,无法重复申诉");
|
|
|
}
|
|
|
|
|
|
+ // 如果orderId为空,从OrderReview中获取
|
|
|
+ if (commentAppeal.getOrderId() == null) {
|
|
|
+ OrderReview orderReview = orderReviewMapper.selectById(commentAppeal.getCommentId());
|
|
|
+ if (orderReview != null && orderReview.getOrderId() != null) {
|
|
|
+ commentAppeal.setOrderId(orderReview.getOrderId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// 设置默认值
|
|
|
commentAppeal.setStatus(0); // 待处理
|
|
|
if (commentAppeal.getDeleteFlag() == null) {
|
|
|
@@ -81,9 +90,18 @@ public class CommentAppealServiceImpl extends ServiceImpl<CommentAppealMapper, C
|
|
|
if (result) {
|
|
|
log.info("提交申诉成功,id={}", commentAppeal.getId());
|
|
|
|
|
|
+ // 更新订单表的申诉状态为2(申诉中)
|
|
|
+ if (commentAppeal.getOrderId() != null) {
|
|
|
+ LambdaUpdateWrapper<LawyerConsultationOrder> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
|
|
+ lambdaUpdateWrapper.eq(LawyerConsultationOrder::getId, commentAppeal.getOrderId())
|
|
|
+ .set(LawyerConsultationOrder::getIsAppealed, 2);
|
|
|
+ lawyerConsultationOrderMapper.update(null, lambdaUpdateWrapper);
|
|
|
+ log.info("更新订单申诉状态成功,orderId={}, isAppealed=2", commentAppeal.getOrderId());
|
|
|
+ }
|
|
|
+
|
|
|
// 发送通知给评价用户,告知其评价被申诉了
|
|
|
sendSubmitAppealNotification(commentAppeal);
|
|
|
-
|
|
|
+
|
|
|
return R.data(commentAppeal, "申诉提交成功");
|
|
|
} else {
|
|
|
return R.fail("申诉提交失败");
|
|
|
@@ -173,21 +191,21 @@ public class CommentAppealServiceImpl extends ServiceImpl<CommentAppealMapper, C
|
|
|
try {
|
|
|
// 查询律师用户信息
|
|
|
LambdaQueryWrapper<LawyerUser> lawyerUser = new LambdaQueryWrapper<>();
|
|
|
- lawyerUser.eq(LawyerUser :: getId, appeal.getLawyerUserId());
|
|
|
+ lawyerUser.eq(LawyerUser::getId, appeal.getLawyerUserId());
|
|
|
LawyerUser lifeUser = lawyerUserMapper.selectOne(lawyerUser);
|
|
|
if (lifeUser == null) {
|
|
|
log.warn("评价用户不存在,userId={}", lifeUser.getId());
|
|
|
return;
|
|
|
}
|
|
|
LambdaQueryWrapper<OrderReview> orderReviewLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
- orderReviewLambdaQueryWrapper.eq(OrderReview :: getId, appeal.getCommentId());
|
|
|
+ orderReviewLambdaQueryWrapper.eq(OrderReview::getId, appeal.getCommentId());
|
|
|
OrderReview orderReview = orderReviewMapper.selectOne(orderReviewLambdaQueryWrapper);
|
|
|
String orderNumber = "";
|
|
|
- if(orderReview != null){
|
|
|
+ if (orderReview != null) {
|
|
|
orderNumber = orderReview.getOrderNumber();
|
|
|
}
|
|
|
String receiverId = "user_" + lifeUser.getPhone();
|
|
|
- String message = String.format("您提交的差评申诉信息,订单编号为"+ orderNumber +",已提交至平台审核,1-3个工作日会发送您审核结果,请注意查收。");
|
|
|
+ String message = String.format("您提交的差评申诉信息,订单编号为" + orderNumber + ",已提交至平台审核,1-3个工作日会发送您审核结果,请注意查收。");
|
|
|
|
|
|
LifeNotice lifeNotice = new LifeNotice();
|
|
|
lifeNotice.setReceiverId(receiverId);
|
|
|
@@ -253,7 +271,7 @@ public class CommentAppealServiceImpl extends ServiceImpl<CommentAppealMapper, C
|
|
|
}
|
|
|
|
|
|
String receiverId = "user_" + lifeUser.getUserPhone();
|
|
|
- String message = String.format("您对订单编号为"+ orderReview.getOrderNumber() +"的评价,律师已进行申诉,经核实,您的评价不实,平台已删除此条评价及回复。");
|
|
|
+ String message = String.format("您对订单编号为" + orderReview.getOrderNumber() + "的评价,律师已进行申诉,经核实,您的评价不实,平台已删除此条评价及回复。");
|
|
|
|
|
|
LifeNotice lifeNotice = new LifeNotice();
|
|
|
lifeNotice.setReceiverId(receiverId);
|
|
|
@@ -296,9 +314,9 @@ public class CommentAppealServiceImpl extends ServiceImpl<CommentAppealMapper, C
|
|
|
// 律师的接收ID格式可能是 "lawyer_" + phone 或其他格式,需要根据实际情况调整
|
|
|
String receiverId = "lawyer_" + lawyerUser.getPhone();
|
|
|
String title = isSuccess ? "申诉成功通知" : "申诉失败通知";
|
|
|
- String message = isSuccess
|
|
|
- ? String.format("您的编号"+ orderReview.getOrderNumber() +"的订单,提交的差评申诉信息,经核实,评价内容不实,平台已删除此条评价。")
|
|
|
- : String.format("您的编号"+ orderReview.getOrderNumber() +"的订单,提交的差评申诉信息,经核实,评价内容属实。失败原因:"+ reviewReasons +"。");
|
|
|
+ String message = isSuccess
|
|
|
+ ? String.format("您的编号" + orderReview.getOrderNumber() + "的订单,提交的差评申诉信息,经核实,评价内容不实,平台已删除此条评价。")
|
|
|
+ : String.format("您的编号" + orderReview.getOrderNumber() + "的订单,提交的差评申诉信息,经核实,评价内容属实。失败原因:" + reviewReasons + "。");
|
|
|
|
|
|
LifeNotice lifeNotice = new LifeNotice();
|
|
|
lifeNotice.setReceiverId(receiverId);
|
|
|
@@ -347,8 +365,8 @@ public class CommentAppealServiceImpl extends ServiceImpl<CommentAppealMapper, C
|
|
|
|
|
|
@Override
|
|
|
public R<IPage<CommentAppealVo>> getAppealPage(Integer pageNum, Integer pageSize, Integer status,
|
|
|
- String orderNumber, String userName, String userPhone, String lawyerName, String lawyerPhone,
|
|
|
- String startTime, String endTime) {
|
|
|
+ String orderNumber, String userName, String userPhone, String lawyerName, String lawyerPhone,
|
|
|
+ String startTime, String endTime) {
|
|
|
log.info("CommentAppealServiceImpl.getAppealPage?pageNum={}, pageSize={}, status={}, orderNumber={}, userName={}, userPhone={}, lawyerName={}, lawyerPhone={}, startTime={}, endTime={}",
|
|
|
pageNum, pageSize, status, orderNumber, userName, userPhone, lawyerName, lawyerPhone, startTime, endTime);
|
|
|
|
|
|
@@ -526,11 +544,11 @@ public class CommentAppealServiceImpl extends ServiceImpl<CommentAppealMapper, C
|
|
|
pageNum, pageSize, status, lawyerUserId);
|
|
|
List<CommentAppealVo> appealList = new ArrayList<>();
|
|
|
//status 3 查全部
|
|
|
- if(status ==3){
|
|
|
- appealList = baseMapper.getAppealHistoryList(null, lawyerUserId);
|
|
|
- }else{
|
|
|
+ if (status == 3) {
|
|
|
+ appealList = baseMapper.getAppealHistoryList(null, lawyerUserId);
|
|
|
+ } else {
|
|
|
// 查询申诉历史列表
|
|
|
- appealList = baseMapper.getAppealHistoryList(status, lawyerUserId);
|
|
|
+ appealList = baseMapper.getAppealHistoryList(status, lawyerUserId);
|
|
|
}
|
|
|
|
|
|
// 处理数据转换(图片列表等)
|
|
|
@@ -539,7 +557,7 @@ public class CommentAppealServiceImpl extends ServiceImpl<CommentAppealMapper, C
|
|
|
}
|
|
|
|
|
|
ListToPage.setPage(appealList, pageNum, pageSize);
|
|
|
-
|
|
|
+
|
|
|
return appealList;
|
|
|
}
|
|
|
}
|