diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/dynamic/DynamicCommentCmdExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/dynamic/DynamicCommentCmdExe.java index 63def7f0..bf84b235 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/dynamic/DynamicCommentCmdExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/dynamic/DynamicCommentCmdExe.java @@ -102,6 +102,7 @@ public class DynamicCommentCmdExe { commentListCO.setContent(dynamicComment.getContent()); commentListCO.setCreateTime(dynamicComment.getCreateTime()); commentListCO.setRootCommentId(Objects.isNull(dynamicComment.getRootCommentId()) ? dynamicComment.getId() : dynamicComment.getRootCommentId()); + commentListCO.setReplyCommentId(dynamicComment.getReplyCommentId()); UserProfile userProfile = userProfileMap.get(dynamicComment.getCreateUser()); if (userProfile != null) { diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/dynamic/query/DynamicDetailsQryExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/dynamic/query/DynamicDetailsQryExe.java index cce56de5..4c1aaa7e 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/dynamic/query/DynamicDetailsQryExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/dynamic/query/DynamicDetailsQryExe.java @@ -1,6 +1,7 @@ package com.red.circle.other.app.command.dynamic.query; import com.google.common.collect.Sets; +import com.red.circle.common.business.core.enums.ApprovalStatusEnum; import com.red.circle.common.business.dto.cmd.IdLongCmd; import com.red.circle.framework.core.asserts.ResponseAssert; import com.red.circle.framework.core.response.CommonErrorCode; @@ -8,9 +9,11 @@ import com.red.circle.other.app.convertor.user.UserProfileAppConvertor; import com.red.circle.other.app.dto.clientobject.dynamic.DynamicListCO; import com.red.circle.other.app.dto.clientobject.dynamic.DynamicPictureCO; import com.red.circle.other.domain.gateway.user.UserProfileGateway; +import com.red.circle.other.infra.database.rds.entity.approval.ApprovalDynamicContent; import com.red.circle.other.infra.database.rds.entity.dynamic.DynamicContent; import com.red.circle.other.infra.database.rds.entity.dynamic.DynamicPicture; import com.red.circle.other.infra.database.rds.entity.dynamic.DynamicTag; +import com.red.circle.other.infra.database.rds.service.approval.ApprovalDynamicContentService; import com.red.circle.other.infra.database.rds.service.dynamic.DynamicCommentService; import com.red.circle.other.infra.database.rds.service.dynamic.DynamicContentService; import com.red.circle.other.infra.database.rds.service.dynamic.DynamicGiftService; @@ -52,6 +55,7 @@ public class DynamicDetailsQryExe { private final DynamicGiftService dynamicGiftService; private final UserSubscriptionService userSubscriptionService; private final UserProfileAppConvertor userProfileAppConvertor; + private final ApprovalDynamicContentService approvalDynamicContentService; public DynamicListCO execute(IdLongCmd cmd) { @@ -59,6 +63,10 @@ public class DynamicDetailsQryExe { ResponseAssert.notNull(DynamicErrorCode.CONTENT_IS_NULL, dynamic); ResponseAssert.isFalse(DynamicErrorCode.CONTENT_DELETE, dynamic.getDel()); + ApprovalDynamicContent approvalDynamicContent = approvalDynamicContentService.getByDynamicId(dynamic.getId()); + ResponseAssert.isFalse(DynamicErrorCode.CONTENT_DELETE, approvalDynamicContent != null && + ApprovalStatusEnum.NOT_PASS.name().equals(approvalDynamicContent.getApproveStatus())); + UserProfileDTO baseInfo = userProfileAppConvertor.toUserProfileDTO( userProfileGateway.getByUserId(dynamic.getCreateUser())); ResponseAssert.notNull(CommonErrorCode.NO_SUITABLE_CONTENT, dynamic); diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/approval/ApprovalDynamicContentService.java b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/approval/ApprovalDynamicContentService.java index 1468a4fc..fbca2ede 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/approval/ApprovalDynamicContentService.java +++ b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/approval/ApprovalDynamicContentService.java @@ -32,4 +32,9 @@ public interface ApprovalDynamicContentService extends BaseService listPendingDynamicIds(); + + /** + * 根据动态id获取审核数据 + */ + ApprovalDynamicContent getByDynamicId(Long dynamicId); } diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/approval/impl/ApprovalDynamicContentServiceImpl.java b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/approval/impl/ApprovalDynamicContentServiceImpl.java index db5bd7ac..ff19bce4 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/approval/impl/ApprovalDynamicContentServiceImpl.java +++ b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/approval/impl/ApprovalDynamicContentServiceImpl.java @@ -90,4 +90,18 @@ public class ApprovalDynamicContentServiceImpl extends .filter(Objects::nonNull) .toList(); } + + @Override + public ApprovalDynamicContent getByDynamicId(Long dynamicId) { + if (Objects.isNull(dynamicId)) { + return null; + } + return query() + .eq(ApprovalDynamicContent::getDynamicId, dynamicId) + .orderByDesc(ApprovalDynamicContent::getCreateTime) + .last(PageConstant.LIMIT_ONE) + .getOne(); + + } + }