|
|
@@ -19,6 +19,7 @@ import shop.alien.entity.store.StoreStaffReview;
|
|
|
import shop.alien.entity.store.dto.StoreStaffReviewDto;
|
|
|
import shop.alien.entity.store.vo.StoreStaffCommentVo;
|
|
|
import shop.alien.entity.store.vo.StoreStaffReviewDetailVo;
|
|
|
+import shop.alien.entity.store.vo.StoreStaffReviewListWithStaffVo;
|
|
|
import shop.alien.entity.store.vo.StoreStaffReviewVo;
|
|
|
import shop.alien.entity.store.StoreStaffConfig;
|
|
|
import shop.alien.mapper.LifeLikeRecordMapper;
|
|
|
@@ -122,10 +123,21 @@ public class StoreStaffReviewServiceImpl extends ServiceImpl<StoreStaffReviewMap
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ // 查询人员信息
|
|
|
+ StoreStaffConfig staffInfo = null;
|
|
|
+ if (reviewVo.getStaffUserId() != null) {
|
|
|
+ try {
|
|
|
+ staffInfo = storeStaffConfigMapper.selectById(reviewVo.getStaffUserId());
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.warn("查询人员信息失败, staffUserId={}, error={}", reviewVo.getStaffUserId(), e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// 构建返回结果
|
|
|
StoreStaffReviewDetailVo detailVo = new StoreStaffReviewDetailVo();
|
|
|
detailVo.setReview(reviewVo);
|
|
|
detailVo.setCommentList(comments != null ? comments : new ArrayList<>());
|
|
|
+ detailVo.setStaffInfo(staffInfo);
|
|
|
|
|
|
return R.data(detailVo);
|
|
|
}
|
|
|
@@ -473,4 +485,39 @@ public class StoreStaffReviewServiceImpl extends ServiceImpl<StoreStaffReviewMap
|
|
|
comment.setUpdatedTime(new Date());
|
|
|
storeStaffCommentService.updateById(comment);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public R<StoreStaffReviewListWithStaffVo> getReviewListByStaffId(int pageNum, int pageSize, Integer staffUserId, Integer currentUserId) {
|
|
|
+ log.info("根据人员ID查询评价列表, pageNum={}, pageSize={}, staffUserId={}, currentUserId={}",
|
|
|
+ pageNum, pageSize, staffUserId, currentUserId);
|
|
|
+
|
|
|
+ if (staffUserId == null) {
|
|
|
+ return R.fail("人员ID不能为空");
|
|
|
+ }
|
|
|
+
|
|
|
+ // 查询人员信息
|
|
|
+ StoreStaffConfig staffInfo = null;
|
|
|
+ try {
|
|
|
+ staffInfo = storeStaffConfigMapper.selectById(staffUserId);
|
|
|
+ if (staffInfo == null) {
|
|
|
+ log.warn("人员信息不存在, staffUserId={}", staffUserId);
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.warn("查询人员信息失败, staffUserId={}, error={}", staffUserId, e.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ // 查询评价列表
|
|
|
+ Page<StoreStaffReviewVo> page = new Page<>(pageNum, pageSize);
|
|
|
+ IPage<StoreStaffReviewVo> reviewList = storeStaffReviewMapper.getReviewListWithUser(page, staffUserId, null, currentUserId);
|
|
|
+
|
|
|
+ // 处理评价图片JSON字符串转换为列表
|
|
|
+ reviewList.getRecords().forEach(this::parseReviewImages);
|
|
|
+
|
|
|
+ // 构建返回结果
|
|
|
+ StoreStaffReviewListWithStaffVo result = new StoreStaffReviewListWithStaffVo();
|
|
|
+ result.setStaffInfo(staffInfo);
|
|
|
+ result.setReviewList(reviewList);
|
|
|
+
|
|
|
+ return R.data(result);
|
|
|
+ }
|
|
|
}
|