Browse Source

处理话题的群状态

hotfix/yujt_opt
zhangyuan 6 years ago
parent
commit
04e7457764
  1. 8
      epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/topic/service/impl/TopicServiceImpl.java

8
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<TopicDao, TopicEntity> 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);

Loading…
Cancel
Save