|
@@ -7,63 +7,44 @@
|
|
|
|
|
|
package cn.com.qmth.examcloud.core.examwork.api.controller;
|
|
|
|
|
|
-import java.math.RoundingMode;
|
|
|
-import java.text.DecimalFormat;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Arrays;
|
|
|
-import java.util.List;
|
|
|
-import java.util.regex.Matcher;
|
|
|
-import java.util.regex.Pattern;
|
|
|
-import java.util.stream.Collectors;
|
|
|
-
|
|
|
-import org.jsoup.Jsoup;
|
|
|
-import org.jsoup.nodes.Document;
|
|
|
-import org.jsoup.nodes.Element;
|
|
|
-import org.jsoup.select.Elements;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.validation.annotation.Validated;
|
|
|
-import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.PathVariable;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestParam;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
-
|
|
|
-import com.mysql.cj.util.StringUtils;
|
|
|
-
|
|
|
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.exchange.PageInfo;
|
|
|
import cn.com.qmth.examcloud.api.commons.security.bean.User;
|
|
|
import cn.com.qmth.examcloud.api.commons.security.bean.UserType;
|
|
|
import cn.com.qmth.examcloud.commons.exception.StatusException;
|
|
|
-import cn.com.qmth.examcloud.core.examwork.api.controller.bean.AddNoticeDomain;
|
|
|
-import cn.com.qmth.examcloud.core.examwork.api.controller.bean.NoticeDomain;
|
|
|
-import cn.com.qmth.examcloud.core.examwork.api.controller.bean.NoticeDomainQuery;
|
|
|
-import cn.com.qmth.examcloud.core.examwork.api.controller.bean.UpdateNoticeDomain;
|
|
|
-import cn.com.qmth.examcloud.core.examwork.api.controller.bean.UserNoticeDomain;
|
|
|
-import cn.com.qmth.examcloud.core.examwork.api.controller.bean.UserNoticeDomainQuery;
|
|
|
+import cn.com.qmth.examcloud.core.examwork.api.controller.bean.*;
|
|
|
import cn.com.qmth.examcloud.core.examwork.dao.NoticeRepo;
|
|
|
import cn.com.qmth.examcloud.core.examwork.dao.entity.NoticeEntity;
|
|
|
import cn.com.qmth.examcloud.core.examwork.dao.entity.NoticeRulePublishProgressEntity;
|
|
|
import cn.com.qmth.examcloud.core.examwork.service.NoticeService;
|
|
|
-import cn.com.qmth.examcloud.core.examwork.service.bean.AddNoticeInfo;
|
|
|
-import cn.com.qmth.examcloud.core.examwork.service.bean.NoticeInfo;
|
|
|
-import cn.com.qmth.examcloud.core.examwork.service.bean.NoticeInfoQuery;
|
|
|
-import cn.com.qmth.examcloud.core.examwork.service.bean.UpdateNoticeInfo;
|
|
|
-import cn.com.qmth.examcloud.core.examwork.service.bean.UserNoticeInfo;
|
|
|
-import cn.com.qmth.examcloud.core.examwork.service.bean.UserNoticeInfoQuery;
|
|
|
+import cn.com.qmth.examcloud.core.examwork.service.bean.*;
|
|
|
import cn.com.qmth.examcloud.reports.commons.bean.OnlineStudentReport;
|
|
|
import cn.com.qmth.examcloud.reports.commons.bean.OnlineUserReport;
|
|
|
import cn.com.qmth.examcloud.reports.commons.util.ReportsUtil;
|
|
|
import cn.com.qmth.examcloud.web.helpers.GlobalHelper;
|
|
|
import cn.com.qmth.examcloud.web.support.ControllerSupport;
|
|
|
import cn.com.qmth.examcloud.web.support.Naked;
|
|
|
+import com.mysql.cj.util.StringUtils;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
+import org.jsoup.Jsoup;
|
|
|
+import org.jsoup.nodes.Document;
|
|
|
+import org.jsoup.nodes.Element;
|
|
|
+import org.jsoup.select.Elements;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.math.RoundingMode;
|
|
|
+import java.text.DecimalFormat;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.List;
|
|
|
+import java.util.regex.Matcher;
|
|
|
+import java.util.regex.Pattern;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* 公告类
|
|
@@ -133,16 +114,16 @@ public class NoticeController extends ControllerSupport {
|
|
|
if (null != noticeInfoList && !noticeInfoList.isEmpty()) {
|
|
|
resultList = getNoticeDomainListFrom(noticeInfoList);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
User user = this.getAccessUser();
|
|
|
- //在线数据打点 start
|
|
|
- if(UserType.STUDENT.equals(user.getUserType())) {
|
|
|
- //在线学生登录打点
|
|
|
- ReportsUtil.report(new OnlineStudentReport(user.getRootOrgId(),user.getUserId()));
|
|
|
- }else if(UserType.COMMON.equals(user.getUserType())) {
|
|
|
- //在线用户登录打点
|
|
|
- ReportsUtil.report(new OnlineUserReport(user.getRootOrgId(),user.getUserId()));
|
|
|
- }
|
|
|
+ //在线数据打点 start
|
|
|
+ if (UserType.STUDENT.equals(user.getUserType())) {
|
|
|
+ //在线学生登录打点
|
|
|
+ ReportsUtil.report(new OnlineStudentReport(user.getRootOrgId(), user.getUserId()));
|
|
|
+ } else if (UserType.COMMON.equals(user.getUserType())) {
|
|
|
+ //在线用户登录打点
|
|
|
+ ReportsUtil.report(new OnlineUserReport(user.getRootOrgId(), user.getUserId()));
|
|
|
+ }
|
|
|
return resultList;
|
|
|
}
|
|
|
|
|
@@ -264,9 +245,9 @@ public class NoticeController extends ControllerSupport {
|
|
|
}
|
|
|
String content = addNoticeDomain.getContent();
|
|
|
// 普通文本内容不允许超过500个字
|
|
|
- int simpleTextLength=getSimpleTextLength(content);
|
|
|
+ int simpleTextLength = getSimpleTextLength(content);
|
|
|
if (simpleTextLength > 500) {
|
|
|
- throw new StatusException("500010", "通知内容不得超过500个字符,当前字数为:"+simpleTextLength);
|
|
|
+ throw new StatusException("500010", "通知内容不得超过500个字符,当前字数为:" + simpleTextLength);
|
|
|
}
|
|
|
// 图片总大小不得超过2M
|
|
|
int imgSize = getImageSize(content);
|
|
@@ -331,9 +312,9 @@ public class NoticeController extends ControllerSupport {
|
|
|
}
|
|
|
String content = updateNoticeDomain.getContent();
|
|
|
// 普通文本内容不允许超过500个字
|
|
|
- int simpleTextLength=getSimpleTextLength(content);
|
|
|
+ int simpleTextLength = getSimpleTextLength(content);
|
|
|
if (simpleTextLength > 500) {
|
|
|
- throw new StatusException("500010", "通知内容不得超过500个字符,当前字数为:"+simpleTextLength);
|
|
|
+ throw new StatusException("500010", "通知内容不得超过500个字符,当前字数为:" + simpleTextLength);
|
|
|
}
|
|
|
// 图片总大小不得超过2M
|
|
|
int imgSize = getImageSize(content);
|