|
@@ -1,5 +1,6 @@
|
|
|
package com.chelvc.cloud.vehicle.server.service.impl;
|
|
|
|
|
|
+import cn.hutool.extra.spring.SpringUtil;
|
|
|
import com.baomidou.lock.annotation.Lock4j;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
@@ -11,7 +12,9 @@ import com.chelvc.cloud.uc.api.dto.UserDTO;
|
|
|
import com.chelvc.cloud.uc.api.service.UserService;
|
|
|
import com.chelvc.cloud.vehicle.api.constant.DynamicStatusType;
|
|
|
import com.chelvc.cloud.vehicle.api.constant.ExamineType;
|
|
|
+import com.chelvc.cloud.vehicle.api.constant.RecordType;
|
|
|
import com.chelvc.cloud.vehicle.api.dto.DynamicCommentDTO;
|
|
|
+import com.chelvc.cloud.vehicle.api.dto.DynamicEvaluateRecordDTO;
|
|
|
import com.chelvc.cloud.vehicle.api.param.AddDynamicCommentParam;
|
|
|
import com.chelvc.cloud.vehicle.api.param.QueryAdminDynamicParam;
|
|
|
import com.chelvc.cloud.vehicle.api.param.QueryDynamicCommentParam;
|
|
@@ -19,6 +22,7 @@ import com.chelvc.cloud.vehicle.server.dao.DynamicCommentMapper;
|
|
|
import com.chelvc.cloud.vehicle.server.entity.DynamicComment;
|
|
|
import com.chelvc.cloud.vehicle.server.service.DynamicCommentService;
|
|
|
import com.chelvc.cloud.vehicle.server.service.DynamicContentService;
|
|
|
+import com.chelvc.cloud.vehicle.server.service.DynamicEvaluateRecordService;
|
|
|
import com.chelvc.framework.base.exception.ResourceUnavailableException;
|
|
|
import com.chelvc.framework.common.model.Pagination;
|
|
|
import com.chelvc.framework.common.util.BeanCopyUtil;
|
|
@@ -51,6 +55,7 @@ public class DynamicCommentServiceImpl implements DynamicCommentService, com.che
|
|
|
private final DynamicContentService dynamicContentService;
|
|
|
@DubboReference
|
|
|
private final UserService userService;
|
|
|
+ DynamicEvaluateRecordService dynamicEvaluateRecordService;
|
|
|
|
|
|
//private final ContentAuditHelper contentAuditHelper;
|
|
|
/**
|
|
@@ -73,6 +78,7 @@ public class DynamicCommentServiceImpl implements DynamicCommentService, com.che
|
|
|
Page<DynamicComment> page = baseMapper.selectPage(
|
|
|
new Page<>(pageNum, pageSize), lqw);
|
|
|
List<DynamicComment> result = page.getRecords();
|
|
|
+ DynamicEvaluateRecordService service = getContentEvaluateRecordService();
|
|
|
if (result != null && result.size() > 0) {
|
|
|
List<DynamicCommentDTO> records = BeanCopyUtil.copy(result,
|
|
|
DynamicCommentDTO.class);
|
|
@@ -81,6 +87,13 @@ public class DynamicCommentServiceImpl implements DynamicCommentService, com.che
|
|
|
Map<Long, UserDTO> map = userService.queryUserByIds(userIds);
|
|
|
records.forEach(e -> {
|
|
|
e.setUserDTO(map == null ? new UserDTO() : map.get(e.getUserId()));
|
|
|
+ DynamicEvaluateRecordDTO dto = service.queryOperaterType(e.getId(),
|
|
|
+ userId, RecordType.COMMENT.getValue());
|
|
|
+ if (dto == null) {
|
|
|
+ e.setClickStatus(0);
|
|
|
+ } else {
|
|
|
+ e.setClickStatus(dto.getOperaterType());
|
|
|
+ }
|
|
|
});
|
|
|
return Pagination.<DynamicCommentDTO>builder().total(page.getTotal()).pages(page.getPages())
|
|
|
.records(records).build();
|
|
@@ -88,6 +101,11 @@ public class DynamicCommentServiceImpl implements DynamicCommentService, com.che
|
|
|
return new Pagination<>();
|
|
|
}
|
|
|
|
|
|
+ public DynamicEvaluateRecordService getContentEvaluateRecordService() {
|
|
|
+ this.dynamicEvaluateRecordService = SpringUtil.getBean(DynamicEvaluateRecordService.class);
|
|
|
+ return dynamicEvaluateRecordService;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public Pagination<DynamicCommentDTO> queryAdminPageList(QueryAdminDynamicParam param, Long pageNum,
|
|
|
Long pageSize) {
|
|
@@ -149,6 +167,9 @@ public class DynamicCommentServiceImpl implements DynamicCommentService, com.che
|
|
|
}
|
|
|
//异步处理审核
|
|
|
//contentAuditHelper.asyncCommentHandle(add);
|
|
|
+ //暂时不审核
|
|
|
+ addParentComment(param.getParentId());
|
|
|
+ dynamicContentService.addComment(param.getDynamicId());
|
|
|
}
|
|
|
|
|
|
private void addParentComment(Long parentId) {
|