|
@@ -17,6 +17,7 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
@@ -72,6 +73,7 @@ public class ImGroupNoticeServiceImpl extends ServiceImpl<ImGroupNoticeDao, ImGr
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
public void modify(ImGroupNotice imGroupNotice) {
|
|
public void modify(ImGroupNotice imGroupNotice) {
|
|
if(Objects.isNull(baseMapper.selectById(imGroupNotice.getId()))){
|
|
if(Objects.isNull(baseMapper.selectById(imGroupNotice.getId()))){
|
|
throw new BizException("群公告不存在");
|
|
throw new BizException("群公告不存在");
|
|
@@ -81,6 +83,12 @@ public class ImGroupNoticeServiceImpl extends ServiceImpl<ImGroupNoticeDao, ImGr
|
|
imGroupNotice.setOperatorId(userId);
|
|
imGroupNotice.setOperatorId(userId);
|
|
imGroupNotice.setCreateTime(date);
|
|
imGroupNotice.setCreateTime(date);
|
|
imGroupNotice.setUpdateTime(date);
|
|
imGroupNotice.setUpdateTime(date);
|
|
|
|
+
|
|
|
|
+ // 群公告置顶 只能有一个
|
|
|
|
+ if(imGroupNotice.getTopFlag() != null && Boolean.TRUE.equals(imGroupNotice.getTopFlag())){
|
|
|
|
+ baseMapper.updateTopFlag(imGroupNotice.getGroupId());
|
|
|
|
+ }
|
|
|
|
+
|
|
baseMapper.updateById(imGroupNotice);
|
|
baseMapper.updateById(imGroupNotice);
|
|
}
|
|
}
|
|
|
|
|