|
@@ -1,6 +1,8 @@
|
|
|
package com.ims.eval.controller;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.ims.common.utils.StringUtils;
|
|
|
import com.ims.eval.config.CustomException;
|
|
|
import com.ims.eval.entity.DataDictionary;
|
|
|
import com.ims.eval.entity.EvaluationNotice;
|
|
@@ -16,6 +18,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import java.io.File;
|
|
|
import java.io.IOException;
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
|
|
@@ -212,14 +215,31 @@ public class NoticeManagementController {
|
|
|
*
|
|
|
* @return 结果
|
|
|
*/
|
|
|
- @GetMapping(value = "/deptId")
|
|
|
- public R circularDisplay(@RequestParam(value = "id") String deptId) {
|
|
|
- List<EvaluationNotice> evaluationNoticeList = evaluationNoticeService.list();
|
|
|
+ @GetMapping(value = "/circularDisplay/{deptId}")
|
|
|
+ public R circularDisplay(@PathVariable String deptId) {
|
|
|
+ QueryWrapper<EvaluationNotice> qw = new QueryWrapper<>();
|
|
|
+ if (StringUtils.isNotEmpty("已发布")) {
|
|
|
+ qw.lambda().eq(EvaluationNotice::getReleaseState, "已发布");
|
|
|
+ }
|
|
|
+ List<EvaluationNotice> evaluationNoticeList = evaluationNoticeService.list(qw);
|
|
|
+ List<EvaluationNotice> list = new ArrayList<>();
|
|
|
for (EvaluationNotice evaluationNotice : evaluationNoticeList) {
|
|
|
- if ("All".equals(evaluationNotice.getSendTo())){
|
|
|
-
|
|
|
+ if ("所有单位".equals(evaluationNotice.getSendTo())) {
|
|
|
+ list.add(evaluationNotice);
|
|
|
+ } else if ("个别部门".equals(evaluationNotice.getSendTo())) {
|
|
|
+ String[] strings = evaluationNotice.getSendToContent().split(",");
|
|
|
+ for (String str : strings) {
|
|
|
+ if (str.equals(deptId)) {
|
|
|
+ list.add(evaluationNotice);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if ("本部部门".equals(evaluationNotice.getSendTo())) {
|
|
|
+ if (deptId.equals(evaluationNotice.getReleaseDept())) {
|
|
|
+ list.add(evaluationNotice);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- return R.ok().data(evaluationNoticeList);
|
|
|
+ return R.ok().data(list);
|
|
|
}
|
|
|
}
|