From 04e7457764d64125de939d4f65ed818dab084b6b Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Thu, 28 May 2020 15:40:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E8=AF=9D=E9=A2=98=E7=9A=84?= =?UTF-8?q?=E7=BE=A4=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epdc/modules/topic/service/impl/TopicServiceImpl.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/topic/service/impl/TopicServiceImpl.java b/epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/topic/service/impl/TopicServiceImpl.java index c056751..68fd3f2 100644 --- a/epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/topic/service/impl/TopicServiceImpl.java +++ b/epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/topic/service/impl/TopicServiceImpl.java @@ -68,6 +68,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.security.acl.Group; import java.util.*; /** @@ -179,8 +180,13 @@ public class TopicServiceImpl extends BaseServiceImpl imp @Override @Transactional(rollbackFor = Exception.class) public Result saveTopic(TopicSubmitFormDTO formDto) { + GroupDTO groupDTO = groupService.get(formDto.getGroupId()); + + if (!GroupStateEnum.GROUP_STATE_EXAMINATION_PASSED.getValue().equals(groupDTO.getState())) { + return new Result().error("社群状态异常,无法发布话题"); + } TopicEntity entity = ConvertUtils.sourceToTarget(formDto, TopicEntity.class); - entity.setGroupCategory(GroupConstant.PROPERTY_GROUP_CATEGORY); + entity.setGroupCategory(groupDTO.getGroupCategory()); if (insert(entity)) { // 保存图片 topicImgService.saveImages(formDto.getImages(), entity.getId(), TopicImageConstant.TYPE_IMAGE_BIZ_TOPIC);