Browse Source

代码优化

wangcahngsheng 1 year ago
parent
commit
ec4f55fdbc

+ 18 - 169
ims-service/ims-eval/src/main/java/com/ims/eval/controller/NoticeManagementController.java

@@ -4,6 +4,10 @@ import cn.hutool.core.convert.Convert;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.IdUtil;
 import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.json.JSONArray;
+import cn.hutool.json.JSONUtil;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.ims.common.utils.StringUtils;
@@ -13,18 +17,25 @@ import com.ims.eval.entity.EvaluationNotice;
 import com.ims.eval.entity.OrganizationStructure;
 import com.ims.eval.entity.custom.Path;
 import com.ims.eval.entity.dto.result.R;
+import com.ims.eval.entity.dto.result.ResultInfo;
 import com.ims.eval.service.IEvaluationNoticeService;
 import com.ims.eval.service.IOrganizationStructureService;
+import com.ims.eval.util.FileUploadUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.io.FileSystemResource;
 import org.springframework.core.io.InputStreamResource;
 import org.springframework.http.*;
+import org.springframework.util.FileCopyUtils;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.client.RestTemplate;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletRequest;
 import java.io.File;
+import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.InetAddress;
@@ -38,7 +49,6 @@ import java.util.*;
  * @date 2023/5/17 14:48
  * 文件说明:
  */
-@Slf4j
 @RestController
 @RequestMapping("//evaluation-dept-notice")
 public class NoticeManagementController {
@@ -52,12 +62,6 @@ public class NoticeManagementController {
 	@Autowired
 	HttpServletRequest request;
 
-	@Autowired
-	private RestTemplate restTemplate;
-
-	@Autowired
-	private ImaConfig imaConfig;
-
 	/**
 	 * 通告管理列表信息(分页)
 	 *
@@ -198,48 +202,9 @@ public class NoticeManagementController {
 	 * @throws IOException 异常
 	 */
 	@PostMapping(value = "/uploadAttachment")
-	public R uploadAttachment(@RequestParam(value = "id") String id, @RequestParam(value = "files", required = false) MultipartFile[] files) throws IOException {
+	public R uploadAttachment(@RequestParam(value = "id") String id, @RequestParam(value = "files", required = false) MultipartFile[] files) {
 		try {
-			boolean b = false;
-			EvaluationNotice evaluationNotice = evaluationNoticeService.getById(id);
-			if (null != evaluationNotice) {
-				for (MultipartFile file : files) {
-					HttpHeaders headers = new HttpHeaders();
-					headers.setContentType(MediaType.MULTIPART_FORM_DATA);
-					headers.add("Blade-Auth", "bearer " + request.getHeader("Blade-Auth"));
-					headers.add("code", request.getHeader("code"));
-					Map<String, Object> map = new LinkedHashMap<>();
-					map.put("folder", "AsApplication");
-					map.put("objType", "xxxt/image");
-					map.put("objKey", "");
-					map.put("file", file);
-					map.put("docPath", "dbkp");
-					HttpEntity<Map> param = new HttpEntity<>(map, headers);
-					ResponseEntity<String> responseEntity2 = restTemplate.exchange(imaConfig.getGatewayUrl() +"f-center/dm/dmDoc/saveA", HttpMethod.POST, param, String.class);
-					log.info("\n code:{}\n header:{}\n body:{}\n", responseEntity2.getStatusCodeValue(), responseEntity2.getHeaders(), responseEntity2.getBody());
-					if (200 == responseEntity2.getStatusCodeValue()) {
-
-					}
-				}
-				/*StringBuilder fileNames = new StringBuilder();
-				if (files.length > 0) {
-					for (MultipartFile file : files) {
-						// 上传文件路径
-						String filePath = Path.getNoticePath();
-						// 上传并返回新文件名称
-						String fileName = FileUploadUtil.upload(filePath, file);
-						fileNames.append(fileName).append(",");
-					}
-					String newNoticeAnnex = fileNames.toString().substring(0, fileNames.toString().length() - 1);
-					if (StringUtils.isNotEmpty(evaluationNotice.getNoticeAnnex())) {//true:非空串
-						String noticeAnnex = evaluationNotice.getNoticeAnnex() + "," + newNoticeAnnex;
-						evaluationNotice.setNoticeAnnex(noticeAnnex);
-					} else {
-						evaluationNotice.setNoticeAnnex(newNoticeAnnex);
-					}
-					b = evaluationNoticeService.updateById(evaluationNotice);
-				}*/
-			}
+			boolean b = evaluationNoticeService.uploadAttachment(id, files, request);
 			if (b) {
 				return R.ok().data(b);
 			} else {
@@ -253,30 +218,14 @@ public class NoticeManagementController {
 	/**
 	 * 删除附件
 	 *
-	 * @param id          主键
-	 * @param noticeAnnex 附件名称
+	 * @param id      主键
+	 * @param docPath 附件路径
 	 * @return 结果
 	 */
 	@PostMapping(value = "/deleteAttachment")
-	public R deleteAttachment(@RequestParam(value = "id") String id, @RequestParam(value = "noticeAnnex") String noticeAnnex) {
+	public R deleteAttachment(@RequestParam(value = "id") String id, @RequestParam(value = "docPath") String docPath) {
 		try {
-			boolean b;
-			EvaluationNotice evaluationNotice = evaluationNoticeService.getById(id);
-			if (null != evaluationNotice) {
-				String[] strings = evaluationNotice.getNoticeAnnex().split(",");
-				StringBuilder fileNames = new StringBuilder();
-				for (String str : strings) {
-					if (str.substring(str.lastIndexOf("/") + 1, str.length()).equals(noticeAnnex)) {
-						String filePath = Path.getStatementPath() + str;
-						File file = new File(filePath);
-						b = file.delete();
-					} else {
-						fileNames.append(str).append(",");
-					}
-				}
-				evaluationNotice.setNoticeAnnex(fileNames.toString().substring(0, fileNames.toString().length() - 1));
-			}
-			b = evaluationNoticeService.updateById(evaluationNotice);
+			boolean b = evaluationNoticeService.deleteAttachment(id, docPath, request);
 			if (b) {
 				return R.ok().data(b);
 			} else {
@@ -299,67 +248,7 @@ public class NoticeManagementController {
 							 @RequestParam(value = "noticeTitle") String noticeTitle,
 							 @RequestParam(value = "beginDataTime", required = false) String beginDataTime,
 							 @RequestParam(value = "endDataTime", required = false) String endDataTime) {
-		QueryWrapper<EvaluationNotice> qw = new QueryWrapper<>();
-		qw.lambda().eq(EvaluationNotice::getReleaseState, "已发布");
-		if (StringUtils.isNotEmpty(noticeTitle)) {
-			qw.lambda().eq(EvaluationNotice::getNoticeTitle, noticeTitle);
-		}
-		if (StringUtils.isNotEmpty(beginDataTime) && StringUtils.isNotEmpty(endDataTime)) {
-			qw.lambda().between(EvaluationNotice::getReleaseDate, DateUtil.parse(beginDataTime), DateUtil.parse(endDataTime));
-		}
-		List<EvaluationNotice> evaluationNoticeList = evaluationNoticeService.list(qw);
-		List<EvaluationNotice> list = new ArrayList<>();
-		for (EvaluationNotice evaluationNotice : evaluationNoticeList) {
-			if ("所有单位".equals(evaluationNotice.getSendTo())) {
-				if (null != evaluationNotice.getNoticeAnnex()) {
-					if (evaluationNotice.getNoticeAnnex().length() > 0) {
-						String[] noticeAnnexList = evaluationNotice.getNoticeAnnex().split(",");
-						StringBuilder noticeAnnex = new StringBuilder();
-						for (String str : noticeAnnexList) {
-							if (str.contains("All")) {
-								noticeAnnex.append(str).append(",");
-							} else if (str.contains(deptId)) {
-								noticeAnnex.append(str).append(",");
-							}
-						}
-						if (noticeAnnex.toString().length() > 0) {
-							evaluationNotice.setNoticeAnnex(noticeAnnex.toString().substring(0, noticeAnnex.toString().length() - 1));
-						}
-					}
-				}
-				list.add(evaluationNotice);
-			} else if ("个别部门".equals(evaluationNotice.getSendTo())) {
-				String[] sendToContentList = evaluationNotice.getSendToContent().split(",");
-				for (String str : sendToContentList) {
-					if (str.equals(deptId)) {
-						if (evaluationNotice.getNoticeAnnex().length() > 0) {
-							String[] noticeAnnexList = evaluationNotice.getNoticeAnnex().split(",");
-							StringBuilder noticeAnnex = new StringBuilder();
-							for (String str1 : noticeAnnexList) {
-								if (str1.contains("All")) {
-									noticeAnnex.append(str1).append(",");
-								} else if (str1.contains(deptId)) {
-									noticeAnnex.append(str1).append(",");
-								}
-							}
-							if (noticeAnnex.toString().length() > 0) {
-								evaluationNotice.setNoticeAnnex(noticeAnnex.toString().substring(0, noticeAnnex.toString().length() - 1));
-							}
-						}
-						list.add(evaluationNotice);
-						break;
-					}
-				}
-			} else if ("本部部门".equals(evaluationNotice.getSendTo())) {
-				List<OrganizationStructure> deptList = organizationStructureService.getTree("23031001", 1, "140");
-				if (deptList.size() > 0) {
-					OrganizationStructure organizationStructure = deptList.stream().filter(item -> item.getId().equals(deptId)).findFirst().orElse(null);
-					if (ObjectUtil.isNotNull(organizationStructure)) {
-						list.add(evaluationNotice);
-					}
-				}
-			}
-		}
+		List<EvaluationNotice> list = evaluationNoticeService.circularDisplay(deptId, noticeTitle, beginDataTime, endDataTime);
 		return R.ok().data(list);
 	}
 
@@ -376,44 +265,4 @@ public class NoticeManagementController {
 		String httpUrl = "http://" + ip + ":28900/file/" + url;
 		return R.ok().data(httpUrl);
 	}
-
-	static class CommonInputStreamResource extends InputStreamResource {
-		private long length;
-		private String fileName;
-
-		public CommonInputStreamResource(InputStream inputStream, long length, String fileName) {
-			super(inputStream);
-			this.length = length;
-			this.fileName = fileName;
-		}
-
-		/**
-		 * 覆写父类方法
-		 * 如果不重写这个方法,并且文件有一定大小,那么服务端会出现异常
-		 * {@code The multi-part request contained parameter data (excluding uploaded files) that exceeded}
-		 */
-		@Override
-		public String getFilename() {
-			return fileName;
-		}
-
-		/**
-		 * 覆写父类 contentLength 方法
-		 * 因为 {@link org.springframework.core.io.AbstractResource#contentLength()}方法会重新读取一遍文件,
-		 * 而上传文件时,restTemplate 会通过这个方法获取大小。然后当真正需要读取内容的时候,发现已经读完,会报如下错误。
-		 */
-		@Override
-		public long contentLength() {
-			long estimate = length;
-			return estimate == 0 ? 1 : estimate;
-		}
-
-		public void setLength(long length) {
-			this.length = length;
-		}
-
-		public void setFileName(String fileName) {
-			this.fileName = fileName;
-		}
-	}
 }

+ 8 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/entity/EvaluationNotice.java

@@ -54,6 +54,14 @@ public class EvaluationNotice extends Model {
 	private Date updateTime;
 	//更新者
 	private String updateBy;
+	//预留字段
+	private String memo1;
+	//预留字段
+	private String memo2;
+	//预留字段
+	private String memo3;
+	//预留字段
+	private String memo4;
 	//列表回显部门名称
 	@TableField(exist = false)
 	private String deptNames;

+ 10 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/service/IEvaluationNoticeService.java

@@ -3,6 +3,10 @@ package com.ims.eval.service;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.ims.eval.entity.EvaluationNotice;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.List;
 
 /**
  * @author hlf
@@ -12,4 +16,10 @@ import com.ims.eval.entity.EvaluationNotice;
 public interface IEvaluationNoticeService extends IService<EvaluationNotice> {
 
 	IPage<EvaluationNotice> listPage(Integer pageNum, Integer pageSize, String noticeTitle);
+
+    boolean uploadAttachment(String id, MultipartFile[] files, HttpServletRequest request);
+
+	boolean deleteAttachment(String id, String docPath, HttpServletRequest request);
+
+	List<EvaluationNotice> circularDisplay(String deptId, String noticeTitle, String beginDataTime, String endDataTime);
 }

+ 207 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/EvaluationNoticeServiceImpl.java

@@ -1,12 +1,43 @@
 package com.ims.eval.service.impl;
 
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.util.ObjectUtil;
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ims.common.utils.StringUtils;
+import com.ims.eval.config.ImaConfig;
 import com.ims.eval.dao.EvaluationNoticeMapper;
 import com.ims.eval.entity.EvaluationNotice;
+import com.ims.eval.entity.OrganizationStructure;
+import com.ims.eval.entity.custom.Path;
+import com.ims.eval.entity.dto.result.ResultInfo;
 import com.ims.eval.service.IEvaluationNoticeService;
+import com.ims.eval.service.IOrganizationStructureService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.io.FileSystemResource;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Service;
+import org.springframework.util.FileCopyUtils;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+import org.springframework.web.client.RestTemplate;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletRequest;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
 
 /**
  * @author hlf
@@ -14,8 +45,18 @@ import org.springframework.stereotype.Service;
  * 文件说明:
  */
 @Service
+@Slf4j
 public class EvaluationNoticeServiceImpl extends ServiceImpl<EvaluationNoticeMapper, EvaluationNotice> implements IEvaluationNoticeService {
 
+	@Autowired
+	private IOrganizationStructureService organizationStructureService;
+
+	@Autowired
+	private RestTemplate restTemplate;
+
+	@Autowired
+	private ImaConfig imaConfig;
+
 	@Override
 	public IPage<EvaluationNotice> listPage(Integer pageNum, Integer pageSize, String noticeTitle) {
 		if (null == pageNum || null == pageSize) {
@@ -25,4 +66,170 @@ public class EvaluationNoticeServiceImpl extends ServiceImpl<EvaluationNoticeMap
 		Page<EvaluationNotice> page = new Page<>(pageNum, pageSize);
 		return baseMapper.selectListPage(page, noticeTitle);
 	}
+
+	@Override
+	public boolean uploadAttachment(String id, MultipartFile[] files, HttpServletRequest request) {
+		EvaluationNotice evaluationNotice = baseMapper.selectById(id);
+		if (null != evaluationNotice) {
+			StringBuilder docPaths = new StringBuilder();
+			StringBuilder docFileNames = new StringBuilder();
+			if (files.length > 0) {
+				for (MultipartFile multipartFile : files) {
+					File file = null;
+					try {
+						file = new File(multipartFile.getOriginalFilename());
+						FileOutputStream fileOutputStream = new FileOutputStream(file);
+						FileCopyUtils.copy(multipartFile.getInputStream(), fileOutputStream);
+						fileOutputStream.close();
+					} catch (IOException e) {
+						e.printStackTrace();
+					} catch (Exception e) {
+						e.printStackTrace();
+					}
+					FileSystemResource fileStream = new FileSystemResource(file);
+					HttpHeaders headers = new HttpHeaders();
+					headers.add("Blade-Auth", "bearer " + request.getHeader("Blade-Auth"));
+					headers.add("Content-Type", "multipart/form-data");
+					MultiValueMap<String, Object> map = new LinkedMultiValueMap<>();
+					map.add("folder", "AsApplication");
+					map.add("objType", "xxxt/image");
+					map.add("objKey", "");
+					map.add("file", fileStream);
+					map.add("bucketName", "dbkp");
+					HttpEntity<Map> param = new HttpEntity<>(map, headers);
+					ResponseEntity<String> responseEntity2 = restTemplate.exchange(imaConfig.getGatewayUrl() + "f-center/dm/dmDoc/save", HttpMethod.POST, param, String.class);
+					log.info("\n code:{}\n header:{}\n body:{}\n", responseEntity2.getStatusCodeValue(), responseEntity2.getHeaders(), responseEntity2.getBody());
+					//删除临时文件
+					if (file.exists()) {
+						file.delete();
+					}
+					if (200 == responseEntity2.getStatusCodeValue()) {
+						ResultInfo resultInfo = JSON.parseObject(responseEntity2.getBody(), ResultInfo.class);
+						if ("保存成功!".equals(resultInfo.getMessage())) {
+							Map<String, Object> fileInfo = (Map<String, Object>) resultInfo.getData();
+							if (fileInfo.size() > 0) {
+								String docPath = (String) fileInfo.get("docPath");
+								docPaths.append(docPath).append(",");
+								String docFileName = (String) fileInfo.get("docFileName");
+								docFileNames.append(docFileName).append(",");
+							}
+						}
+					}
+				}
+				String docPathStr = docPaths.toString().substring(0, docPaths.toString().length() - 1);
+				String docFileNameStr = docFileNames.toString().substring(0, docFileNames.toString().length() - 1);
+				if (StringUtils.isNotEmpty(evaluationNotice.getNoticeAnnex())) {//true:非空串
+					String noticeAnnex = evaluationNotice.getNoticeAnnex() + "," + docPathStr;
+					evaluationNotice.setNoticeAnnex(noticeAnnex);
+					String memo4 = evaluationNotice.getMemo4() + "," + docFileNameStr;
+					evaluationNotice.setMemo4(memo4);
+				} else {
+					evaluationNotice.setNoticeAnnex(docPathStr);
+					evaluationNotice.setMemo4(docFileNameStr);
+				}
+				baseMapper.updateById(evaluationNotice);
+			}
+		}
+		return true;
+	}
+
+	@Override
+	public boolean deleteAttachment(String id, String docPath, HttpServletRequest request) {
+		EvaluationNotice evaluationNotice = baseMapper.selectById(id);
+		if (null != evaluationNotice) {
+			HttpHeaders headers = new HttpHeaders();
+			headers.add("iamAccessToken", request.getHeader("Blade-Auth"));
+			headers.add("iamCode", request.getHeader("code"));
+			HttpEntity<Map> param = new HttpEntity<>(null, headers);
+			ResponseEntity<String> responseEntity2 = restTemplate.exchange(imaConfig.getGatewayUrl() + "f-center/dm/dmDoc/remove?docPath={1}", HttpMethod.GET, param, String.class, docPath);
+			log.info("\n code:{}\n header:{}\n body:{}\n", responseEntity2.getStatusCodeValue(), responseEntity2.getHeaders(), responseEntity2.getBody());
+			if (200 == responseEntity2.getStatusCodeValue()) {
+				ResultInfo resultInfo = JSON.parseObject(responseEntity2.getBody(), ResultInfo.class);
+				if ("删除成功".equals(resultInfo.getMessage())) {
+					String[] noticeAnnexStr = evaluationNotice.getNoticeAnnex().split(",");
+					String[] memo4Str = evaluationNotice.getMemo4().split(",");
+					StringBuilder docPaths = new StringBuilder();
+					StringBuilder docFileNames = new StringBuilder();
+					for (int i = 0; i < noticeAnnexStr.length; i++) {
+						if (!noticeAnnexStr[i].equals(docPath)) {
+							docPaths.append(noticeAnnexStr[i]).append(",");
+							docFileNames.append(memo4Str[i]).append(",");
+						}
+					}
+					String docPathStr = docPaths.toString().substring(0, docPaths.toString().length() - 1);
+					evaluationNotice.setNoticeAnnex(docPathStr);
+					String docFileNameStr = docFileNames.toString().substring(0, docFileNames.toString().length() - 1);
+					evaluationNotice.setMemo4(docFileNameStr);
+					baseMapper.updateById(evaluationNotice);
+				}
+			}
+		}
+		return true;
+	}
+
+	@Override
+	public List<EvaluationNotice> circularDisplay(String deptId, String noticeTitle, String beginDataTime, String endDataTime) {
+		QueryWrapper<EvaluationNotice> qw = new QueryWrapper<>();
+		qw.lambda().eq(EvaluationNotice::getReleaseState, "已发布");
+		if (StringUtils.isNotEmpty(noticeTitle)) {
+			qw.lambda().eq(EvaluationNotice::getNoticeTitle, noticeTitle);
+		}
+		if (StringUtils.isNotEmpty(beginDataTime) && StringUtils.isNotEmpty(endDataTime)) {
+			qw.lambda().between(EvaluationNotice::getReleaseDate, DateUtil.parse(beginDataTime), DateUtil.parse(endDataTime));
+		}
+		List<EvaluationNotice> evaluationNoticeList = baseMapper.selectList(qw);
+		List<EvaluationNotice> list = new ArrayList<>();
+		for (EvaluationNotice evaluationNotice : evaluationNoticeList) {
+			if ("所有单位".equals(evaluationNotice.getSendTo())) {
+				if (null != evaluationNotice.getNoticeAnnex()) {
+					if (evaluationNotice.getNoticeAnnex().length() > 0) {
+						String[] noticeAnnexList = evaluationNotice.getNoticeAnnex().split(",");
+						StringBuilder noticeAnnex = new StringBuilder();
+						for (String str : noticeAnnexList) {
+							if (str.contains("All")) {
+								noticeAnnex.append(str).append(",");
+							} else if (str.contains(deptId)) {
+								noticeAnnex.append(str).append(",");
+							}
+						}
+						if (noticeAnnex.toString().length() > 0) {
+							evaluationNotice.setNoticeAnnex(noticeAnnex.toString().substring(0, noticeAnnex.toString().length() - 1));
+						}
+					}
+				}
+				list.add(evaluationNotice);
+			} else if ("个别部门".equals(evaluationNotice.getSendTo())) {
+				String[] sendToContentList = evaluationNotice.getSendToContent().split(",");
+				for (String str : sendToContentList) {
+					if (str.equals(deptId)) {
+						if (evaluationNotice.getNoticeAnnex().length() > 0) {
+							String[] noticeAnnexList = evaluationNotice.getNoticeAnnex().split(",");
+							StringBuilder noticeAnnex = new StringBuilder();
+							for (String str1 : noticeAnnexList) {
+								if (str1.contains("All")) {
+									noticeAnnex.append(str1).append(",");
+								} else if (str1.contains(deptId)) {
+									noticeAnnex.append(str1).append(",");
+								}
+							}
+							if (noticeAnnex.toString().length() > 0) {
+								evaluationNotice.setNoticeAnnex(noticeAnnex.toString().substring(0, noticeAnnex.toString().length() - 1));
+							}
+						}
+						list.add(evaluationNotice);
+						break;
+					}
+				}
+			} else if ("本部部门".equals(evaluationNotice.getSendTo())) {
+				List<OrganizationStructure> deptList = organizationStructureService.getTree("23031001", 1, "140");
+				if (deptList.size() > 0) {
+					OrganizationStructure organizationStructure = deptList.stream().filter(item -> item.getId().equals(deptId)).findFirst().orElse(null);
+					if (ObjectUtil.isNotNull(organizationStructure)) {
+						list.add(evaluationNotice);
+					}
+				}
+			}
+		}
+		return list;
+	}
 }

+ 9 - 1
ims-service/ims-eval/src/main/resources/mappers/EvaluationNoticeMapper.xml

@@ -22,6 +22,10 @@
         <result column="create_name" property="createName"/>
         <result column="update_time" property="updateTime"/>
         <result column="update_by" property="updateBy"/>
+        <result column="memo1" property="memo1"/>
+        <result column="memo2" property="memo2"/>
+        <result column="memo3" property="memo3"/>
+        <result column="memo4" property="memo4"/>
     </resultMap>
 
     <!-- 通用查询结果列 -->
@@ -43,7 +47,11 @@
                create_by,
                create_name,
                update_time,
-               update_by
+               update_by,
+               memo1,
+               memo2,
+               memo3,
+               memo4
         from evaluation_notice
     </sql>