|
@@ -1,8 +1,8 @@
|
|
|
package cn.com.qmth.examcloud.core.examwork.service.impl;
|
|
|
|
|
|
+import cn.com.qmth.examcloud.api.commons.enums.NoticePublishStatus;
|
|
|
import cn.com.qmth.examcloud.api.commons.enums.NoticeReceiverRuleType;
|
|
|
import cn.com.qmth.examcloud.api.commons.enums.NoticeStatus;
|
|
|
-import cn.com.qmth.examcloud.api.commons.enums.PublishStatus;
|
|
|
import cn.com.qmth.examcloud.api.commons.exchange.PageInfo;
|
|
|
import cn.com.qmth.examcloud.api.commons.security.bean.UserType;
|
|
|
import cn.com.qmth.examcloud.api.commons.security.enums.RoleMeta;
|
|
@@ -27,7 +27,6 @@ import com.mysql.cj.util.StringUtils;
|
|
|
import org.apache.commons.lang.time.DateUtils;
|
|
|
import org.apache.commons.logging.Log;
|
|
|
import org.apache.commons.logging.LogFactory;
|
|
|
-import org.assertj.core.util.DateUtil;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
import org.springframework.data.domain.PageRequest;
|
|
@@ -189,7 +188,7 @@ public class NoticeServiceImpl implements NoticeService {
|
|
|
if (publishSchedule == null) {
|
|
|
throw new StatusException("501007", "找不到通知id为:" + info.getId() + "的通知进度数据");
|
|
|
}
|
|
|
- if (publishSchedule.getPublishStatus() != PublishStatus.UNPUBLISHED) {
|
|
|
+ if (publishSchedule.getPublishStatus() != NoticePublishStatus.UNPUBLISHED) {
|
|
|
throw new StatusException("501008", "发布中或已发布的通知不允许修改");
|
|
|
}
|
|
|
|
|
@@ -224,7 +223,7 @@ public class NoticeServiceImpl implements NoticeService {
|
|
|
|
|
|
@Override
|
|
|
public void disposePublishingUserNotice() {
|
|
|
- List<NoticePublishScheduleEntity> publishingScheduleList = noticePublishScheduleRepo.findByPublishStatus(PublishStatus.PUBLISHING);
|
|
|
+ List<NoticePublishScheduleEntity> publishingScheduleList = noticePublishScheduleRepo.findByPublishStatus(NoticePublishStatus.PUBLISHING);
|
|
|
//如果没有状态为发布中的数据,则直接返回
|
|
|
if (publishingScheduleList == null || publishingScheduleList.isEmpty()) {
|
|
|
return;
|
|
@@ -350,7 +349,7 @@ public class NoticeServiceImpl implements NoticeService {
|
|
|
userNoticeList.add(userNotice);
|
|
|
}
|
|
|
userNoticeRepo.saveAll(userNoticeList);
|
|
|
- publishSchedule.setPublishStatus(PublishStatus.PUBLISHED);
|
|
|
+ publishSchedule.setPublishStatus(NoticePublishStatus.PUBLISHED);
|
|
|
noticePublishScheduleRepo.save(publishSchedule);
|
|
|
}
|
|
|
|
|
@@ -495,7 +494,7 @@ public class NoticeServiceImpl implements NoticeService {
|
|
|
* @param ne
|
|
|
* @return 发布状态枚举
|
|
|
*/
|
|
|
- private PublishStatus getNoticePublishStatus(Long rootOrgId, NoticeEntity ne) {
|
|
|
+ private NoticePublishStatus getNoticePublishStatus(Long rootOrgId, NoticeEntity ne) {
|
|
|
NoticePublishScheduleEntity publishSchedule =
|
|
|
noticePublishScheduleRepo.findByRootOrgIdAndNoticeId(rootOrgId, ne.getId());
|
|
|
|
|
@@ -602,9 +601,9 @@ public class NoticeServiceImpl implements NoticeService {
|
|
|
publishScheduleEntity.setRootOrgId(addNoticeInfo.getRootOrgId());
|
|
|
publishScheduleEntity.setNoticeId(noticeId);
|
|
|
if (addNoticeInfo.getNoticeStatus() == NoticeStatus.PUBLISH) {
|
|
|
- publishScheduleEntity.setPublishStatus(PublishStatus.PUBLISHING);
|
|
|
+ publishScheduleEntity.setPublishStatus(NoticePublishStatus.PUBLISHING);
|
|
|
} else {
|
|
|
- publishScheduleEntity.setPublishStatus(PublishStatus.UNPUBLISHED);
|
|
|
+ publishScheduleEntity.setPublishStatus(NoticePublishStatus.UNPUBLISHED);
|
|
|
}
|
|
|
return publishScheduleEntity;
|
|
|
}
|
|
@@ -671,9 +670,9 @@ public class NoticeServiceImpl implements NoticeService {
|
|
|
publishScheduleEntity.setRootOrgId(info.getRootOrgId());
|
|
|
publishScheduleEntity.setNoticeId(info.getId());
|
|
|
if (info.getNoticeStatus() == NoticeStatus.PUBLISH) {
|
|
|
- publishScheduleEntity.setPublishStatus(PublishStatus.PUBLISHING);
|
|
|
+ publishScheduleEntity.setPublishStatus(NoticePublishStatus.PUBLISHING);
|
|
|
} else {
|
|
|
- publishScheduleEntity.setPublishStatus(PublishStatus.UNPUBLISHED);
|
|
|
+ publishScheduleEntity.setPublishStatus(NoticePublishStatus.UNPUBLISHED);
|
|
|
}
|
|
|
return publishScheduleEntity;
|
|
|
}
|