sangwenwei vor 1 Jahr
Ursprung
Commit
22f03f281a
49 geänderte Dateien mit 2450 neuen und 37 gelöschten Zeilen
  1. 22 0
      jeeplus-common/jeeplus-common-core/src/main/java/com/jeeplus/common/utils/CommonUtils.java
  2. 39 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/editor/domain/EditorFiles.java
  3. 18 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/editor/mapper/EditorFilesMapper.java
  4. 32 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/editor/mapper/xml/EditorFilesMapper.xml
  5. 107 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/editor/service/EditorFilesService.java
  6. 35 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/editor/service/dto/EditorFilesDTO.java
  7. 16 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/editor/service/mapstruct/EditorFilesWrapper.java
  8. 221 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/controller/JyNotifyController.java
  9. 95 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/domain/JyNotify.java
  10. 29 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/domain/JyNotifyLog.java
  11. 46 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/domain/JyNotifyRecord.java
  12. 33 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/domain/PluginNotifyComments.java
  13. 32 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/domain/PluginNotifyOffices.java
  14. 31 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/domain/PluginNotifyUser.java
  15. 19 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/mapper/JyNotifyLogMapper.java
  16. 86 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/mapper/JyNotifyMapper.java
  17. 22 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/mapper/JyNotifyRecordMapper.java
  18. 26 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/mapper/PluginNotifyCommentsMapper.java
  19. 17 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/mapper/PluginNotifyOfficesMapper.java
  20. 18 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/mapper/PluginNotifyUserMapper.java
  21. 46 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/mapper/xml/JyNotifyLogMapper.xml
  22. 264 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/mapper/xml/NotifyMapper.xml
  23. 30 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/mapper/xml/NotifyRecordMapper.xml
  24. 50 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/mapper/xml/PluginNotifyCommentsMapper.xml
  25. 30 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/mapper/xml/PluginNotifyOfficesMapper.xml
  26. 30 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/mapper/xml/PluginNotifyUserMapper.xml
  27. 28 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/service/JyNotifyRecordService.java
  28. 406 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/service/JyNotifyService.java
  29. 205 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/service/dto/JyNotifyDTO.java
  30. 44 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/service/dto/JyNotifyRecordDTO.java
  31. 46 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/service/dto/PluginNotifyCommentsDTO.java
  32. 35 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/service/dto/PluginNotifyOfficesDTO.java
  33. 39 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/service/dto/PluginNotifyUserDTO.java
  34. 25 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/service/dto/WorkAttachmentDto.java
  35. 18 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/service/mapstruct/JyNotifyRecordWrapper.java
  36. 15 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/service/mapstruct/JyNotifyWrapper.java
  37. 7 9
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/controller/JyProjectController.java
  38. 0 1
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/mapper/JyProjectMapper.java
  39. 0 3
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/service/JyProjectMembersService.java
  40. 10 13
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/service/JyProjectService.java
  41. 1 2
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/service/mapstruct/JyProjectAuditWrapper.java
  42. 25 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/utils/FreemarkerUtil.java
  43. 61 0
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/utils/JyResponseUtil.java
  44. 3 8
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/useSeal/service/SignetService.java
  45. 0 1
      jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/useSeal/service/dto/SignetDTO.java
  46. 16 0
      jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/controller/OfficeController.java
  47. 4 0
      jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/mapper/OfficeMapper.java
  48. 9 0
      jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/mapper/xml/OfficeMapper.xml
  49. 59 0
      jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/service/OfficeService.java

+ 22 - 0
jeeplus-common/jeeplus-common-core/src/main/java/com/jeeplus/common/utils/CommonUtils.java

@@ -6,6 +6,7 @@ import org.springframework.web.context.request.ServletRequestAttributes;
 
 import javax.servlet.ServletContext;
 import javax.servlet.http.HttpServletRequest;
+import java.util.Date;
 
 public class CommonUtils {
 
@@ -44,4 +45,25 @@ public class CommonUtils {
         return context.getRealPath ( "/" );
     }
 
+    /**
+     * 计算时间差
+     * 注:参数小于或等于当前时间
+     */
+    public static String timeDef(Date time) {
+        Long def = new Date().getTime() - time.getTime();
+        // 计算天数
+        long day = def / (1000 * 60 * 60 * 24);
+        if (day != 0) {
+            return day + "天前";
+        }
+        // 计算小时
+        long house = def / (1000 * 60 * 60);
+        if (house != 0) {
+            return house + "小时前";
+        }
+        // 计算分钟
+        long min = def / (1000 * 60);
+        return min + "分钟前";
+    }
+
 }

+ 39 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/editor/domain/EditorFiles.java

@@ -0,0 +1,39 @@
+package com.jeeplus.business.editor.domain;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+
+/**
+ * 富文本图片表
+ * @TableName editor_files
+ */
+@Data
+@TableName("editor_files")
+public class EditorFiles extends BaseEntity {
+
+    /**
+     * 备注信息
+     */
+    private String remarks;
+
+    /**
+     * 来源id
+     */
+    private String sourceId;
+
+    /**
+     * 临时地址
+     */
+    private String temporaryUrl;
+
+    /**
+     * 图片路径
+     */
+    private String url;
+
+    private static final long serialVersionUID = 1L;
+}

+ 18 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/editor/mapper/EditorFilesMapper.java

@@ -0,0 +1,18 @@
+package com.jeeplus.business.editor.mapper;
+
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jeeplus.business.editor.domain.EditorFiles;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * @Entity com.jeeplus.test.editor.domain.EditorFiles
+ */
+@Mapper
+public interface EditorFilesMapper extends BaseMapper<EditorFiles> {
+
+}
+
+
+
+

+ 32 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/editor/mapper/xml/EditorFilesMapper.xml

@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jeeplus.business.editor.mapper.EditorFilesMapper">
+
+    <resultMap id="BaseResultMap" type="com.jeeplus.business.editor.service.dto.EditorFilesDTO">
+            <id property="id" column="id" jdbcType="VARCHAR"/>
+            <result property="createBy.id" column="create_by" jdbcType="VARCHAR"/>
+            <result property="createTime" column="create_date" jdbcType="TIMESTAMP"/>
+            <result property="updateBy.id" column="update_by" jdbcType="VARCHAR"/>
+            <result property="updateTime" column="update_date" jdbcType="TIMESTAMP"/>
+            <result property="delFlag" column="del_flag" jdbcType="INTEGER"/>
+            <result property="remarks" column="remarks" jdbcType="VARCHAR"/>
+            <result property="sourceId" column="source_id" jdbcType="VARCHAR"/>
+            <result property="temporaryUrl" column="temporary_url" jdbcType="VARCHAR"/>
+            <result property="url" column="url" jdbcType="VARCHAR"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        ef.id,
+        ef.create_by,
+        ef.create_time,
+        ef.update_by,
+        ef.update_time,
+        ef.del_flag,
+        ef.remarks,
+        ef.source_id,
+        ef.temporary_url,
+        ef.url
+    </sql>
+</mapper>

+ 107 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/editor/service/EditorFilesService.java

@@ -0,0 +1,107 @@
+package com.jeeplus.business.editor.service;
+
+
+import com.aliyun.oss.OSSClient;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.jeeplus.business.editor.domain.EditorFiles;
+import com.jeeplus.business.editor.mapper.EditorFilesMapper;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.util.Date;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicReference;
+
+@Service
+@Transactional
+public class EditorFilesService extends ServiceImpl<EditorFilesMapper,EditorFiles> {
+
+
+
+    @Resource
+    private EditorFilesMapper editorFilesMapper;
+
+    /**
+     * 将富文本内容中的临时图片地址替换为新的
+     * @param content 富文本内容
+     * @param sourceId 数据id
+     * @return
+     */
+    public String getNewContent(String content,String sourceId){
+        List<EditorFiles> list = this.list(new QueryWrapper<EditorFiles>().lambda().eq(EditorFiles::getSourceId, sourceId));
+        AtomicReference<String> replace = new AtomicReference<>(content.replace("amp;", ""));
+        list.stream().forEach(item->{
+            boolean contains = replace.get().contains(item.getTemporaryUrl());
+            if(contains){
+                String fileTemporaryLookUrl = this.getFileTemporaryLookUrl(item.getUrl());
+                String r = replace.get().replace(item.getTemporaryUrl(),fileTemporaryLookUrl);
+                replace.set(r);
+                EditorFiles editorFiles = new EditorFiles();
+                editorFiles.setTemporaryUrl(fileTemporaryLookUrl);
+                editorFiles.setSourceId(sourceId);
+                this.update(editorFiles,new QueryWrapper<EditorFiles>().lambda().eq(EditorFiles::getSourceId,sourceId).eq(EditorFiles::getTemporaryUrl,item.getTemporaryUrl()));
+            }
+        });
+        return replace.get();
+    }
+
+    /**
+     * 富文本图片新增
+     * @param temporaryUrl
+     * @param url
+     * @param sourceId
+     * @return
+     */
+    public void saveUrl(String temporaryUrl,String url,String sourceId){
+        EditorFiles editorFiles = new EditorFiles();
+        editorFiles.setSourceId(sourceId);
+        editorFiles.setTemporaryUrl(temporaryUrl);
+        editorFiles.setUrl(url);
+        this.save(editorFiles);
+    }
+
+
+    @Value("${config.accessory.aliyun.aliyunUrl}")
+    private String aliyunUrl;
+    @Value("${config.accessory.aliyun.aliyunDownloadUrl}")
+    private String aliyunDownloadUrl;
+    @Value("${config.accessory.aliyun.endpoint}")
+    private String endpoint;
+    @Value("${config.accessory.aliyun.accessKeyId}")
+    private String accessKeyId;
+    @Value("${config.accessory.aliyun.accessKeySecret}")
+    private String accessKeySecret;
+    @Value("${config.accessory.aliyun.bucketName}")
+    private String bucketName;
+    /**
+     * 阿里云获取临时文件查看url
+     * @param url
+     */
+    public String getFileTemporaryLookUrl(String url){
+        url = url.replace("amp;","");
+        String cons = "";
+        if (url.contains(aliyunUrl)){
+            cons = aliyunUrl;
+        }else if (url.contains("http://gangwan-app.oss-cn-hangzhou.aliyuncs.com")){
+            cons = "http://gangwan-app.oss-cn-hangzhou.aliyuncs.com";
+        }else {
+            cons = aliyunDownloadUrl;
+        }
+        String key = "";
+        String[] split = url.split(cons + "/");
+        if(split.length>1){
+            key = split[1];
+        }else{
+            key = url;
+        }
+        // 指定过期时间为24小时。
+        Date expiration = new Date(new Date().getTime() + 1000 * 60 * 60 * 24 );
+        //初始化OSSClient
+        OSSClient ossClient = new OSSClient(endpoint,accessKeyId,accessKeySecret);
+        return ossClient.generatePresignedUrl(bucketName, key, expiration).toString();
+    }
+}

+ 35 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/editor/service/dto/EditorFilesDTO.java

@@ -0,0 +1,35 @@
+package com.jeeplus.business.editor.service.dto;
+
+
+import com.jeeplus.core.service.dto.BaseDTO;
+import lombok.Data;
+
+/**
+ * 富文本图片表
+ * @TableName editor_files
+ */
+@Data
+public class EditorFilesDTO extends BaseDTO {
+
+    /**
+     * 备注信息
+     */
+    private String remarks;
+
+    /**
+     * 来源id
+     */
+    private String sourceId;
+
+    /**
+     * 临时地址
+     */
+    private String temporaryUrl;
+
+    /**
+     * 图片路径
+     */
+    private String url;
+
+    private static final long serialVersionUID = 1L;
+}

+ 16 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/editor/service/mapstruct/EditorFilesWrapper.java

@@ -0,0 +1,16 @@
+package com.jeeplus.business.editor.service.mapstruct;
+
+
+import com.jeeplus.business.editor.domain.EditorFiles;
+import com.jeeplus.business.editor.service.dto.EditorFilesDTO;
+import com.jeeplus.core.mapstruct.EntityWrapper;
+import org.mapstruct.Mapper;
+import org.mapstruct.ReportingPolicy;
+import org.mapstruct.factory.Mappers;
+
+@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE, uses = {})
+public interface EditorFilesWrapper extends EntityWrapper<EditorFilesDTO, EditorFiles> {
+
+    EditorFilesWrapper INSTANCE = Mappers.getMapper(EditorFilesWrapper.class);
+
+}

+ 221 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/controller/JyNotifyController.java

@@ -0,0 +1,221 @@
+/**
+ * Copyright &copy; 2021-2026 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.business.notify.controller;
+
+import cn.hutool.core.util.ArrayUtil;
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.extra.spring.SpringUtil;
+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.google.common.collect.Lists;
+import com.jeeplus.business.notify.domain.JyNotifyLog;
+import com.jeeplus.business.notify.domain.PluginNotifyComments;
+import com.jeeplus.business.notify.service.JyNotifyService;
+import com.jeeplus.business.notify.service.dto.JyNotifyDTO;
+import com.jeeplus.business.notify.service.dto.PluginNotifyCommentsDTO;
+import com.jeeplus.common.TokenProvider;
+import com.jeeplus.common.utils.ResponseUtil;
+import com.jeeplus.core.query.QueryWrapperGenerator;
+import com.jeeplus.sys.feign.IUserApi;
+import com.jeeplus.sys.service.dto.UserDTO;
+import com.jeeplus.utils.StringUtils;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+import java.util.List;
+
+/**
+ * 通知通告Controller
+ *
+ * @author jeeplus
+ * @version 2021-05-16
+ */
+@RestController
+@RequestMapping("/jy/notify")
+public class JyNotifyController {
+
+    @Autowired
+    private JyNotifyService notifyService;
+
+
+    /**
+     * 通告列表数据
+     * 若对该方法进行调整则需要同步调整下边的 myNotifyData 方法
+     */
+    @GetMapping("list")
+    public ResponseEntity data(JyNotifyDTO notifyDTO, boolean isSelf, Page <JyNotifyDTO> page) throws Exception {
+        QueryWrapper <JyNotifyDTO> queryWrapper = QueryWrapperGenerator.buildQueryCondition ( notifyDTO, JyNotifyDTO.class );
+        if (ObjectUtil.isNotEmpty(notifyDTO)) {
+            if (StringUtils.isNotBlank(notifyDTO.getCreateById())) {
+                queryWrapper.like("a.create_by_id",notifyDTO.getCreateById());
+            }
+            if (ArrayUtil.isNotEmpty(notifyDTO.getCreateDates())) {
+                queryWrapper.between("a.create_time", notifyDTO.getCreateDates()[0], notifyDTO.getCreateDates()[1]);
+            }
+        }
+        UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getByToken(TokenProvider.getCurrentToken());
+        IPage <JyNotifyDTO> result = notifyService.findPage ( page, userDTO.getId ( ), isSelf, null, queryWrapper );
+        return ResponseEntity.ok ( result );
+    }
+
+    /**
+     * 通告列表数据(通知栏)
+     */
+    @GetMapping("myNotifyList")
+    public ResponseEntity myNotifyData(JyNotifyDTO notifyDTO, boolean isSelf, Page <JyNotifyDTO> page) throws Exception {
+        QueryWrapper <JyNotifyDTO> queryWrapper = QueryWrapperGenerator.buildQueryCondition ( notifyDTO, JyNotifyDTO.class );
+        if (ObjectUtil.isNotEmpty(notifyDTO)) {
+            if (StringUtils.isNotBlank(notifyDTO.getCreateName())) {
+                queryWrapper.like("u.name",notifyDTO.getCreateName());
+            }
+            if (ArrayUtil.isNotEmpty(notifyDTO.getCreateDates())) {
+                queryWrapper.between("a.create_time", notifyDTO.getCreateDates()[0], notifyDTO.getCreateDates()[1]);
+            }
+        }
+        UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getByToken(TokenProvider.getCurrentToken());
+        IPage <JyNotifyDTO> result = notifyService.myNotifyDataFindPage ( page, userDTO.getId ( ), isSelf, null, queryWrapper );
+        return ResponseEntity.ok ( result );
+    }
+
+    /**
+     * 查询数据
+     */
+    @GetMapping("queryById")
+    public ResponseEntity queryById(String id, boolean isSelf,String size) {
+        if ( isSelf ) {
+            notifyService.updateReadFlag ( id );
+
+        }
+        JyNotifyDTO notifyDTO = notifyService.getDetail (id);
+        //获取日志信息
+        int pageSize = Integer.parseInt(size);
+        List<JyNotifyLog> byNotifyId = notifyService.findByNotifyId(pageSize, id);
+        Integer count=notifyService.findLogCount(id);
+        notifyDTO.setLogCount(count);
+        notifyDTO.setNotifyLogList(byNotifyId);
+        return ResponseEntity.ok ( notifyDTO);
+    }
+
+    @PostMapping("pushNotifyRecord")
+    public ResponseEntity pushNotifyRecord(String id) {
+        String s = notifyService.pushNotifyRecord(id);
+        return ResponseEntity.ok ( s );
+    }
+
+
+    @PostMapping("save")
+    public ResponseEntity save(@Valid @RequestBody JyNotifyDTO notifyDTO) {
+        notifyService.saveForm ( notifyDTO );
+        return ResponseEntity.ok ( "保存通知'" + notifyDTO.getTitle ( ) + "'成功" );
+    }
+
+
+    /**
+     * 公告通知保存
+     * @param notifyDTO
+     * @return
+     */
+    @ApiOperation("公告通知保存")
+    @PostMapping("saveForm")
+    public ResponseEntity saveForm(@Valid @RequestBody JyNotifyDTO notifyDTO) {
+        String id = notifyService.saveForm(notifyDTO);
+        return ResponseUtil.newInstance().add("businessTable", "jy_plugin_notify").add("businessId", id).ok ("操作成功");
+    }
+
+    /**
+     * 根据id修改状态值status
+     * @param dto
+     * @return
+     */
+    @ApiOperation(value = "根据id修改状态值status")
+    @PostMapping(value = "/updateStatusById")
+    public ResponseEntity<String> updateStatusById(@RequestBody JyNotifyDTO dto) {
+        String s = notifyService.updateStatusById(dto);
+        return ResponseEntity.ok(s);
+    }
+
+
+    /**
+     * 根据id删除
+     * @param ids
+     * @return
+     */
+    @DeleteMapping("delete")
+    @ApiOperation("根据id删除")
+    public ResponseEntity<String> delete(String ids) {
+        String idArray[] = ids.split ( "," );
+        notifyService.removeByIds ( Lists.newArrayList ( idArray ) );
+        return ResponseEntity.ok ( "删除通知成功" );
+    }
+
+    /**
+     * 根据id关闭通知
+     * @param id
+     * @return
+     */
+    @GetMapping("close")
+    @ApiOperation("根据id关闭通知")
+    public ResponseEntity<String> close(String id) {
+        notifyService.closeById (id);
+        return ResponseEntity.ok ( "关闭通知成功" );
+    }
+
+    /**
+     * 评论
+     */
+    @PostMapping("/addComment")
+    @ApiOperation(value = "添加评论")
+    public ResponseEntity<String> addComment(@RequestBody PluginNotifyComments comment) {
+        String s = notifyService.addComment(comment);
+        return ResponseEntity.ok(s);
+    }
+
+    /**
+     * 删除评论
+     */
+    @GetMapping("/delComment")
+    @ApiOperation(value = "删除评论")
+    public ResponseEntity<String> delComment(String id) {
+        String s = notifyService.delComment(id);
+        return ResponseEntity.ok(s);
+    }
+
+    /**
+     * 部分标记为已读
+     * @param ids
+     * @return
+     */
+    @ApiOperation("部分标记为已读")
+    @PostMapping("portionRead")
+    public ResponseEntity portionRead(String ids) {
+        String idArray[] =ids.split(",");
+        notifyService.portionRead (Lists.newArrayList (idArray));
+        return ResponseEntity.ok ("部分标记为已读成功");
+    }
+
+    @ApiOperation(value = "全部标记已读")
+    @PostMapping("/readAll")
+    public String readAll() {
+        return notifyService.readAll();
+    }
+
+
+    /**
+     * 添加或修改通知日志
+     */
+    @ApiOperation("添加或修改通知日志")
+    @PostMapping("saveLog")
+    public String saveLog(@Valid @RequestBody JyNotifyDTO notifyDTO){
+        return notifyService.saveLog(notifyDTO);
+    }
+
+
+
+
+}

+ 95 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/domain/JyNotify.java

@@ -0,0 +1,95 @@
+/**
+ * Copyright &copy; 2021-2026 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.business.notify.domain;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+/**
+ * 通知通告Entity
+ *
+ * @author jeeplus
+ * @version 2021-05-16
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@TableName("jy_plugin_notify")
+public class JyNotify extends BaseEntity {
+
+    private static final long serialVersionUID = 1L;
+    /**
+     * 类型
+     */
+    private String type;
+    /**
+     * 标题
+     */
+    private String title;
+    /**
+     * 内容
+     */
+    private String content;
+    /**
+     * 附件
+     */
+    private String files;
+    /**
+     * 状态
+     */
+    private String status;
+
+    /**
+     * 描述
+     */
+    private String remarks;
+
+    /**
+     * 通告状态
+     */
+    private String notifyType;
+
+    /**
+     * 文号
+     */
+    private String no;
+
+    /**
+     * 开始时间
+     */
+    @TableField(fill = FieldFill.UPDATE)
+    private Date beginDate;
+
+    /**
+     * 结束时间
+     */
+    @TableField(fill = FieldFill.UPDATE)
+    private Date endDate;
+
+    /**
+     * 所属部门id
+     */
+    private String officeId;
+
+    /**
+     * 流程id
+     */
+    protected String procInsId;
+
+    /**
+     * 流程信息
+     */
+    protected String processDefinitionId;
+
+    /**
+     * 关闭状态
+     */
+    private String isClose;
+
+}

+ 29 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/domain/JyNotifyLog.java

@@ -0,0 +1,29 @@
+package com.jeeplus.business.notify.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+
+@Data
+@TableName("jy_notify_log")
+public class JyNotifyLog extends BaseEntity {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 次数
+     */
+    private Integer count;
+
+    /**
+     * 通知id
+     */
+    private String notifyId;
+
+    /**
+     * 创建人
+     */
+    @TableField(exist = false)
+    private String createName;
+}

+ 46 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/domain/JyNotifyRecord.java

@@ -0,0 +1,46 @@
+/**
+ * Copyright &copy; 2021-2026 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.business.notify.domain;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+
+/**
+ * 通知通告记录Entity
+ *
+ * @author jeeplus
+ * @version 2021-05-16
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@TableName("jy_plugin_notify_record")
+public class JyNotifyRecord extends BaseEntity {
+
+    private static final long serialVersionUID = 1L;
+    /**
+     * 通知通告ID
+     */
+    private String notifyId;
+    /**
+     * 接受人
+     */
+    private String userId;
+    /**
+     *  阅读标记(0:未读;1:已读)
+     */
+    private String readFlag;
+    /**
+     * 阅读时间
+     */
+    private Date readDate;
+
+
+
+
+}

+ 33 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/domain/PluginNotifyComments.java

@@ -0,0 +1,33 @@
+package com.jeeplus.business.notify.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+
+/**
+ * 知识分享评论记录表
+ * @TableName plugin_notify_comments
+ */
+@TableName(value ="jy_plugin_notify_comments")
+@Data
+public class PluginNotifyComments extends BaseEntity {
+
+    /**
+     * 公告id
+     */
+    private String notifyId;
+
+    /**
+     * 评论人id
+     */
+    private String userId;
+
+    /**
+     * 评论
+     */
+    private String comments;
+
+    @TableField(exist = false)
+    private static final long serialVersionUID = 1L;
+}

+ 32 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/domain/PluginNotifyOffices.java

@@ -0,0 +1,32 @@
+package com.jeeplus.business.notify.domain;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+
+/**
+ * 通知通告-通告范围-部门
+ * @TableName plugin_notify_offices
+ */
+@TableName(value ="jy_plugin_notify_offices")
+@Data
+public class PluginNotifyOffices extends BaseEntity {
+
+    /**
+     * 备注信息
+     */
+    private String remarks;
+
+    /**
+     * 部门id
+     */
+    private String officeId;
+
+    /**
+     * 通知id
+     */
+    private String notifyId;
+
+    @TableField(exist = false)
+    private static final long serialVersionUID = 1L;
+}

+ 31 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/domain/PluginNotifyUser.java

@@ -0,0 +1,31 @@
+package com.jeeplus.business.notify.domain;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+
+/**
+ * 通知通告-通告范围-用户
+ * @TableName plugin_notify_user
+ */
+@TableName(value ="jy_plugin_notify_user")
+@Data
+public class PluginNotifyUser extends BaseEntity {
+    /**
+     * 备注信息
+     */
+    private String remarks;
+
+    /**
+     * 用户id
+     */
+    private String userId;
+
+    /**
+     * 通知id
+     */
+    private String notifyId;
+
+    @TableField(exist = false)
+    private static final long serialVersionUID = 1L;
+}

+ 19 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/mapper/JyNotifyLogMapper.java

@@ -0,0 +1,19 @@
+package com.jeeplus.business.notify.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.jeeplus.business.notify.domain.JyNotifyLog;
+import com.jeeplus.business.notify.service.dto.JyNotifyDTO;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+@Mapper
+public interface JyNotifyLogMapper extends BaseMapper<JyNotifyLog> {
+    List<JyNotifyLog> findByNotifyId(@Param("size") Integer size, @Param("id") String id);
+
+    JyNotifyLog getByNotifyId(@Param("id")String id, @Param("userId")String id1);
+
+    Integer findLogCount(@Param("id")String id);
+}

+ 86 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/mapper/JyNotifyMapper.java

@@ -0,0 +1,86 @@
+/**
+ * Copyright &copy; 2021-2026 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.business.notify.mapper;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Constants;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+
+import com.jeeplus.business.notify.domain.JyNotify;
+import com.jeeplus.business.notify.service.dto.JyNotifyDTO;
+import com.jeeplus.business.notify.service.dto.WorkAttachmentDto;
+import com.jeeplus.sys.domain.WorkAttachmentInfo;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 通知通告MAPPER接口
+ *
+ * @author jeeplus
+ * @version 2021-05-16
+ */
+@Mapper
+public interface JyNotifyMapper extends BaseMapper<JyNotify> {
+
+    /**
+     * 获取通知
+     */
+    JyNotifyDTO getById(String id);
+
+
+    /**
+     * 获取通知数目
+     *
+     * @return
+     */
+    Long findCount(@Param( "currentUserId" ) String currentUserId, @Param( "isSelf" ) boolean isSelf, @Param("readFlag") String readFlag);
+
+    /**
+     * 获取列表
+     *
+     * @param queryWrapper
+     * @return
+     */
+    IPage <JyNotifyDTO> findList(Page <JyNotifyDTO> page,
+                               @Param( "currentUserId" ) String currentUserId,
+                               @Param( "isSelf" ) boolean isSelf,
+                               @Param("readFlag") String readFlag,
+                               @Param(Constants.WRAPPER) QueryWrapper queryWrapper);
+
+    /**
+     * 获取列表
+     *
+     * @param queryWrapper
+     * @return
+     */
+    IPage <JyNotifyDTO> myNotifyDataFindList(Page <JyNotifyDTO> page,
+                                           @Param( "currentUserId" ) String currentUserId,
+                                           @Param( "isSelf" ) boolean isSelf,
+                                           @Param("readFlag") String readFlag,
+                                           @Param(Constants.WRAPPER) QueryWrapper queryWrapper);
+
+    void updateStatusById(@Param( "id" ) String id, @Param( "status" ) String status);
+
+    void updateContentById(@Param( "content" ) String content, @Param( "id" ) String id);
+
+    /**
+     * 关闭通知
+     * @param id
+     */
+    void closeById(String id);
+
+    /**
+     * 将时间结束的通知关闭
+     */
+    void updateNotifyClose();
+
+    void readAll(@Param("userId") String userId);
+
+    List<WorkAttachmentDto> getFileList(@Param("id") String id);
+}

+ 22 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/mapper/JyNotifyRecordMapper.java

@@ -0,0 +1,22 @@
+/**
+ * Copyright &copy; 2021-2026 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.business.notify.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jeeplus.business.notify.domain.JyNotifyRecord;
+import com.jeeplus.business.notify.service.dto.JyNotifyRecordDTO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 通知通告记录MAPPER接口
+ *
+ * @author jeeplus
+ * @version 2021-05-16
+ */
+public interface JyNotifyRecordMapper extends BaseMapper <JyNotifyRecord> {
+
+    List <JyNotifyRecordDTO> findListByNotifyId(@Param( "notifyId" ) String notifyId);
+}

+ 26 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/mapper/PluginNotifyCommentsMapper.java

@@ -0,0 +1,26 @@
+package com.jeeplus.business.notify.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+import com.jeeplus.business.notify.domain.PluginNotifyComments;
+import com.jeeplus.business.notify.service.dto.PluginNotifyCommentsDTO;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.http.ResponseEntity;
+
+import java.util.List;
+
+/**
+ * @Entity com.jeeplus.notify.domain.PluginNotifyComments
+ */
+@Mapper
+public interface PluginNotifyCommentsMapper extends BaseMapper<PluginNotifyComments> {
+
+
+
+    List<PluginNotifyCommentsDTO> findNotifyAll(@Param("id") String notifyId);
+}
+
+
+
+

+ 17 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/mapper/PluginNotifyOfficesMapper.java

@@ -0,0 +1,17 @@
+package com.jeeplus.business.notify.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jeeplus.business.notify.domain.PluginNotifyOffices;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * @Entity generator.domain.PluginNotifyOffices
+ */
+@Mapper
+public interface PluginNotifyOfficesMapper extends BaseMapper<PluginNotifyOffices> {
+
+}
+
+
+
+

+ 18 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/mapper/PluginNotifyUserMapper.java

@@ -0,0 +1,18 @@
+package com.jeeplus.business.notify.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+import com.jeeplus.business.notify.domain.PluginNotifyUser;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * @Entity generator.domain.PluginNotifyUser
+ */
+@Mapper
+public interface PluginNotifyUserMapper extends BaseMapper<PluginNotifyUser> {
+
+}
+
+
+
+

+ 46 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/mapper/xml/JyNotifyLogMapper.xml

@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jeeplus.business.notify.mapper.JyNotifyLogMapper">
+
+    <select id="findByNotifyId" resultType="com.jeeplus.business.notify.domain.JyNotifyLog">
+        select
+            nl.id,
+            nl.create_by_id,
+            nl.create_time,
+            nl.update_by_id,
+            nl.update_time,
+            nl.count,
+            nl.notify_id,
+            su.name as createName
+        from jy_notify_log nl
+        left join sys_user su on su.id = nl.create_by_id and su.del_flag = '0'
+        where nl.notify_id=#{id}
+        order by nl.update_time DESC limit #{size}
+    </select>
+
+    <select id="getByNotifyId" resultType="com.jeeplus.business.notify.domain.JyNotifyLog">
+        select
+            nl.id,
+            nl.create_by_id,
+            nl.create_time,
+            nl.update_by_id,
+            nl.update_time,
+            nl.count,
+            nl.notify_id,
+            su.name as createName
+        from jy_notify_log nl
+        left join sys_user su on su.id = nl.create_by_id and su.del_flag = '0'
+        where nl.notify_id=#{id} and nl.create_by_id=#{userId}
+    </select>
+
+
+    <select id="findLogCount" resultType="integer">
+        select
+           count(*)
+        from jy_notify_log nl
+        where nl.notify_id=#{id}
+    </select>
+
+
+
+</mapper>

+ 264 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/mapper/xml/NotifyMapper.xml

@@ -0,0 +1,264 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jeeplus.business.notify.mapper.JyNotifyMapper">
+    <resultMap id="BaseResultMap" type="com.jeeplus.business.notify.service.dto.JyNotifyDTO">
+        <id property="id" column="id" jdbcType="VARCHAR"/>
+        <result property="createBy.id" column="create_by" jdbcType="VARCHAR"/>
+        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+        <result property="updateBy.id" column="update_by" jdbcType="VARCHAR"/>
+        <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
+        <result property="delFlag" column="del_flag" jdbcType="INTEGER"/>
+        <result property="type" column="type" jdbcType="VARCHAR"/>
+        <result property="title" column="title" jdbcType="VARCHAR"/>
+        <result property="remarks" column="remarks" jdbcType="VARCHAR"/>
+        <result property="notifyType" column="notify_type" jdbcType="VARCHAR"/>
+        <result property="no" column="no" jdbcType="VARCHAR"/>
+        <result property="beginDate" column="begin_date" jdbcType="TIMESTAMP"/>
+        <result property="endDate" column="end_date" jdbcType="TIMESTAMP"/>
+        <result property="officeId" column="office_id" jdbcType="VARCHAR"/>
+        <result property="procInsId" column="proc_ins_id" jdbcType="VARCHAR"/>
+        <result property="processDefinitionId" column="process_definition_id" jdbcType="VARCHAR"/>
+        <result property="readNum" column="read_num" jdbcType="VARCHAR"/>
+        <result property="unReadNum" column="un_read_num" jdbcType="VARCHAR"/>
+        <result property="createBy.name" column="name" jdbcType="VARCHAR"/>
+        <result property="createBy.photo" column="photo" jdbcType="VARCHAR"/>
+        <result property="readFlag" column="read_flag" jdbcType="VARCHAR"/>
+        <result property="isClose" column="is_close" jdbcType="VARCHAR"/>
+        <collection property="workAttachmentDtoList" ofType="com.jeeplus.business.notify.service.dto.WorkAttachmentDto" column="id" select="getFileList"></collection>
+        <collection property="pluginNotifyOfficesDTOList" ofType="com.jeeplus.business.notify.service.dto.PluginNotifyOfficesDTO" column="id" select="getOfficeList"></collection>
+        <collection property="pluginNotifyUserDTOList" ofType="com.jeeplus.business.notify.service.dto.PluginNotifyUserDTO" column="id" select="getUserList"></collection>
+    <collection property="comments" ofType="com.jeeplus.business.notify.service.dto.PluginNotifyCommentsDTO" column="id" select="getComments"></collection>
+    </resultMap>
+    <resultMap id="AttachmentMap" type="com.jeeplus.business.notify.service.dto.WorkAttachmentDto">
+        <id property="id" column="id" jdbcType="VARCHAR"/>
+        <result property="createBy.id" column="create_by_id" jdbcType="VARCHAR"/>
+        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+        <result property="updateBy.id" column="update_by_id" jdbcType="VARCHAR"/>
+        <result property="createBy.name" column="create_name" jdbcType="VARCHAR"/>
+        <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
+        <result property="delFlag" column="del_flag" jdbcType="VARCHAR"/>
+        <result property="url" column="url" jdbcType="VARCHAR"/>
+        <result property="name" column="attachment_name" jdbcType="VARCHAR"/>
+        <result property="size" column="file_size" jdbcType="VARCHAR"/>
+    </resultMap>
+    <sql id="notifyColumns">
+        a.id,
+        a.type,
+        a.title,
+        a.content,
+        a.files,
+        a.status,
+        a.create_by_id as createById,
+        a.create_time,
+        a.update_by_id,
+        a.update_time,
+        a.remarks,
+        a.del_flag,
+        a.notify_type,
+        a.no,
+        a.begin_date,
+        a.end_date,
+        a.office_id,
+        a.proc_ins_id,
+        a.process_definition_id,
+        u.name,
+        u.photo,
+        b.read_num,
+        b.un_read_num,
+        a.is_close
+    </sql>
+    <sql id="File_Column_List">
+        wa.id,
+        wa.create_by_id,
+        wa.create_time,
+        wa.update_by_id,
+        wa.update_time,
+        wa.remarks,
+        wa.del_flag,
+        wa.url,
+        wa.type,
+        wa.attachment_id,
+        wa.attachment_name,
+        wa.attachment_flag,
+        wa.module_type,
+        wa.attachment_type,
+        wa.file_size,
+        wa.sort,
+        wa.description
+    </sql>
+    <sql id="Users_Column_List">
+        pnu.id,
+        pnu.create_by_id,
+        pnu.create_time,
+        pnu.update_by_id,
+        pnu.update_time,
+        pnu.del_flag,
+        pnu.remarks,
+        pnu.user_id,
+        pnu.notify_id
+    </sql>
+    <sql id="Offices_Column_List">
+        pno.id,
+        pno.create_by_id,
+        pno.create_time,
+        pno.update_by_id,
+        pno.update_time,
+        pno.del_flag,
+        pno.remarks,
+        pno.office_id,
+        pno.notify_id
+    </sql>
+    <sql id="Comments_Column_List">
+        pnc.id,
+        pnc.create_by_id as create_id,
+        pnc.create_time,
+        pnc.update_by_id,
+        pnc.update_time,
+        pnc.notify_id,
+        pnc.user_id,
+        pnc.comments,
+        pnc.del_flag
+    </sql>
+    <select id="getComments" resultType="com.jeeplus.business.notify.service.dto.PluginNotifyCommentsDTO">
+        select
+        <include refid="Comments_Column_List"></include>,
+        su.name as user_name
+        from jy_plugin_notify_comments pnc
+        left join sys_user su on su.id = pnc.user_id and su.del_flag = '0'
+        where pnc.del_flag = '0' and pnc.notify_id = #{id}
+        order by pnc.create_time desc
+    </select>
+    <select id="getOfficeList" resultType="com.jeeplus.business.notify.service.dto.PluginNotifyOfficesDTO">
+        select
+        <include refid="Offices_Column_List"></include>,
+        so.name as office_name
+        from jy_plugin_notify_offices pno
+        left join sys_office so on so.id = pno.office_id and so.del_flag = '0'
+        where pno.del_flag = '0' and pno.notify_id = #{id}
+    </select>
+    <select id="getUserList" resultType="com.jeeplus.business.notify.service.dto.PluginNotifyUserDTO">
+        select
+        <include refid="Users_Column_List"></include>,
+        su.name as user_name,
+        so.name as office_name
+        from jy_plugin_notify_user pnu
+        left join sys_user su on su.id = pnu.user_id and su.del_flag = '0'
+        left join sys_office so on so.id = su.office_id and so.del_flag = '0'
+        where pnu.del_flag = '0' and pnu.notify_id = #{id}
+    </select>
+    <select id="getFileList" resultMap="AttachmentMap">
+        select
+        <include refid="File_Column_List"></include>,
+        su.name as create_name
+        from work_attachment wa
+        left join sys_user su on su.id = wa.create_by_id and su.del_flag = '0'
+        where wa.del_flag = '0' and wa.attachment_id = #{id}
+    </select>
+
+    <sql id="notifyJoins">
+        <!-- 查询已读和未读条数 -->
+        LEFT JOIN (
+        SELECT r.notify_id,
+        sum(case when r.del_flag = 0 and r.read_flag = '1' then 1 else 0 end) read_num,
+        sum(case when r.del_flag = 0 and r.read_flag != '1' then 1 else 0 end) un_read_num
+        FROM jy_plugin_notify_record r GROUP BY r.notify_id
+        ) b ON b.notify_id = a.id
+    </sql>
+
+    <select id="getById" resultMap="BaseResultMap">
+        SELECT
+        <include refid="notifyColumns"/>,
+        art.ID_ as taskId
+        FROM jy_plugin_notify a
+        LEFT JOIN sys_user u ON u.id = a.create_by_id AND u.del_flag = '0'
+        LEFT JOIN act_ru_task art ON a.proc_ins_id = art.PROC_INST_ID_
+        <include refid="notifyJoins"/>
+        WHERE a.id = #{id} and a.del_flag = 0
+    </select>
+
+    <select id="findList" resultMap="BaseResultMap">
+        SELECT
+        <include refid="notifyColumns"/>,
+        <if test="isSelf">
+            r.read_flag,
+        </if>
+        art.ID_ as taskId
+        FROM jy_plugin_notify a
+        LEFT JOIN sys_user u ON u.id = a.create_by_id AND u.del_flag = '0'
+        LEFT JOIN act_ru_task art ON a.proc_ins_id = art.PROC_INST_ID_
+        <include refid="notifyJoins"/>
+        <!-- 我的通知 -->
+        <if test="isSelf">
+            JOIN jy_plugin_notify_record r ON r.notify_id = a.id AND r.user_id = #{currentUserId} AND r.del_flag = 0
+            <if test="readFlag != null and readFlag != ''">
+                AND r.read_flag = #{readFlag}
+            </if>
+        </if>
+        ${ew.customSqlSegment}
+        <if test="isSelf">
+            and ((a.notify_type = 0 and NOW() >= a.begin_date and NOW() &lt;= a.end_date) or a.notify_type = 1)
+        </if>
+        order by a.create_time desc
+    </select>
+
+    <select id="myNotifyDataFindList" resultMap="BaseResultMap">
+        SELECT
+        <include refid="notifyColumns"/>
+        <if test="isSelf">,
+            r.read_flag
+        </if>
+        FROM jy_plugin_notify a
+        LEFT JOIN sys_user u ON u.id = a.CREATE_BY_id AND u.del_flag = '0'
+        <include refid="notifyJoins"/>
+        <!-- 我的通知 -->
+        <if test="isSelf">
+            JOIN jy_plugin_notify_record r ON r.notify_id = a.id AND r.user_id = #{currentUserId} AND r.del_flag = 0
+            <if test="readFlag != null and readFlag != ''">
+                AND r.read_flag = #{readFlag}
+            </if>
+        </if>
+        ${ew.customSqlSegment}
+        <if test="isSelf">
+            and ((a.notify_type = 0 and NOW() >= a.begin_date and NOW() &lt;= a.end_date) or a.notify_type = 1)
+        </if>
+        order by a.create_time desc
+    </select>
+
+
+
+    <select id="findCount" resultType="Long">
+        SELECT
+        count(1)
+        FROM jy_plugin_notify a
+        <if test="isSelf">
+            JOIN jy_plugin_notify_record r ON r.notify_id = a.id AND r.user_id = #{currentUserId} AND r.del_flag = 0
+            <if test="readFlag != null and readFlag != ''">
+                AND r.read_flag = #{readFlag}
+            </if>
+        </if>
+        WHERE a.del_flag = 0
+    </select>
+
+    <update id="updateStatusById">
+        update jy_plugin_notify set status = #{status} where id = #{id}
+    </update>
+
+    <update id="updateContentById">
+        update jy_plugin_notify set content = #{content} where id = #{id}
+    </update>
+    <update id="closeById">
+        update jy_plugin_notify set is_close = "1" where id = #{id}
+    </update>
+
+    <update id="updateNotifyClose">
+        update jy_plugin_notify set is_close = "1"
+        where
+        notify_type = 0 and NOW() > end_date and del_flag = 0
+    </update>
+
+    <update id="readAll">
+        update jy_plugin_notify_record set read_flag = "1" where user_id = #{userId}
+        and notify_id in (select id from plugin_notify where is_close = "0")
+    </update>
+
+</mapper>

+ 30 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/mapper/xml/NotifyRecordMapper.xml

@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jeeplus.business.notify.mapper.JyNotifyRecordMapper">
+
+    <sql id="notifyRecordColumns">
+        a.ID AS "id",
+        a.notify_id AS "notifyDTO.id",
+        a.user_id AS "userDTO.id",
+        a.read_flag AS "readFlag",
+        a.read_date AS "readDate",
+        u.name AS "userDTO.name",
+        o.name AS "userDTO.officeDTO.name"
+    </sql>
+
+    <sql id="notifyRecordJoins">
+        LEFT JOIN sys_user u ON u.id = a.user_id
+        LEFT JOIN sys_office o ON o.id = u.office_id
+    </sql>
+
+
+    <select id="findListByNotifyId" resultType="com.jeeplus.business.notify.service.dto.JyNotifyRecordDTO">
+        SELECT
+        <include refid="notifyRecordColumns"/>
+        FROM jy_plugin_notify_record a
+        <include refid="notifyRecordJoins"/>
+        WHERE a.notify_id = #{notifyId} and a.del_flag = 0 ORDER BY a.read_flag ASC
+    </select>
+
+
+</mapper>

+ 50 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/mapper/xml/PluginNotifyCommentsMapper.xml

@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jeeplus.business.notify.mapper.PluginNotifyCommentsMapper">
+
+    <resultMap id="BaseResultMap" type="com.jeeplus.business.notify.service.dto.PluginNotifyCommentsDTO">
+            <id property="id" column="id" jdbcType="VARCHAR"/>
+            <result property="createBy.id" column="create_by" jdbcType="VARCHAR"/>
+            <result property="createTime" column="create_date" jdbcType="TIMESTAMP"/>
+            <result property="updateBy.id" column="update_by" jdbcType="VARCHAR"/>
+            <result property="updateTime" column="update_date" jdbcType="TIMESTAMP"/>
+            <result property="notifyId" column="notify_id" jdbcType="VARCHAR"/>
+            <result property="userId" column="user_id" jdbcType="VARCHAR"/>
+            <result property="comments" column="comments" jdbcType="VARCHAR"/>
+            <result property="delFlag" column="del_flag" jdbcType="INTEGER"/>
+    </resultMap>
+
+    <sql id="Comments_Column_List">
+        pnc.id,
+        pnc.create_by_id,
+        pnc.create_time,
+        pnc.update_by_id,
+        pnc.update_time,
+        pnc.notify_id,
+        pnc.user_id,
+        pnc.comments,
+        pnc.del_flag
+    </sql>
+
+
+    <select id="findNotifyAll" resultType="com.jeeplus.business.notify.service.dto.PluginNotifyCommentsDTO">
+        select
+        pnc.id,
+        pnc.create_by_id as create_id,
+        pnc.create_time,
+        pnc.update_by_id,
+        pnc.update_time,
+        pnc.notify_id,
+        pnc.user_id,
+        pnc.comments,
+        pnc.del_flag ,
+        su.name as user_name
+        from jy_plugin_notify_comments pnc
+        left join sys_user su on su.id = pnc.user_id and su.del_flag = '0'
+        where pnc.del_flag = '0' and pnc.notify_id = #{id}
+        order by pnc.create_time desc
+    </select>
+
+</mapper>

+ 30 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/mapper/xml/PluginNotifyOfficesMapper.xml

@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jeeplus.business.notify.mapper.PluginNotifyOfficesMapper">
+
+    <resultMap id="BaseResultMap" type="com.jeeplus.business.notify.service.dto.PluginNotifyOfficesDTO">
+            <id property="id" column="id" jdbcType="VARCHAR"/>
+            <result property="createBy.id" column="create_by" jdbcType="VARCHAR"/>
+            <result property="createTime" column="create_date" jdbcType="TIMESTAMP"/>
+            <result property="updateBy.id" column="update_by" jdbcType="VARCHAR"/>
+            <result property="updateTime" column="update_date" jdbcType="TIMESTAMP"/>
+            <result property="delFlag" column="del_flag" jdbcType="INTEGER"/>
+            <result property="remarks" column="remarks" jdbcType="VARCHAR"/>
+            <result property="officeId" column="office_id" jdbcType="VARCHAR"/>
+            <result property="notifyId" column="notify_id" jdbcType="VARCHAR"/>
+    </resultMap>
+
+    <sql id="Offices_Column_List">
+        pno.id,
+        pno.create_by_id,
+        pno.create_time,
+        pno.update_by_id,
+        pno.update_time,
+        pno.del_flag,
+        pno.remarks,
+        pno.office_id,
+        pno.notify_id
+    </sql>
+</mapper>

+ 30 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/mapper/xml/PluginNotifyUserMapper.xml

@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jeeplus.business.notify.mapper.PluginNotifyUserMapper">
+
+    <resultMap id="BaseResultMap" type="com.jeeplus.business.notify.service.dto.PluginNotifyUserDTO">
+            <id property="id" column="id" jdbcType="VARCHAR"/>
+            <result property="createBy.id" column="create_by" jdbcType="VARCHAR"/>
+            <result property="createTime" column="create_date" jdbcType="TIMESTAMP"/>
+            <result property="updateBy.id" column="update_by" jdbcType="VARCHAR"/>
+            <result property="updateTime" column="update_date" jdbcType="TIMESTAMP"/>
+            <result property="delFlag" column="del_flag" jdbcType="INTEGER"/>
+            <result property="remarks" column="remarks" jdbcType="VARCHAR"/>
+            <result property="userId" column="user_id" jdbcType="VARCHAR"/>
+            <result property="notifyId" column="notify_id" jdbcType="VARCHAR"/>
+    </resultMap>
+
+    <sql id="Users_Column_List">
+        pnu.id,
+        pnu.create_by_id,
+        pnu.create_time,
+        pnu.update_by_id,
+        pnu.update_time,
+        pnu.del_flag,
+        pnu.remarks,
+        pnu.user_id,
+        pnu.notify_id
+    </sql>
+</mapper>

+ 28 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/service/JyNotifyRecordService.java

@@ -0,0 +1,28 @@
+/**
+ * Copyright &copy; 2021-2026 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.business.notify.service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.jeeplus.business.notify.domain.JyNotifyRecord;
+import com.jeeplus.business.notify.mapper.JyNotifyRecordMapper;
+import com.jeeplus.business.notify.service.dto.JyNotifyRecordDTO;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+/**
+ * 通知通告Service
+ *
+ * @author jeeplus
+ * @version 2021-05-16
+ */
+@Service
+@Transactional
+public class JyNotifyRecordService extends ServiceImpl<JyNotifyRecordMapper, JyNotifyRecord> {
+
+    public List<JyNotifyRecordDTO> findListByNotifyId (String notifyId) {
+        return baseMapper.findListByNotifyId ( notifyId );
+    }
+}

+ 406 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/service/JyNotifyService.java

@@ -0,0 +1,406 @@
+/**
+ * Copyright &copy; 2021-2026 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.business.notify.service;
+
+import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.extra.spring.SpringUtil;
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+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.jeeplus.business.editor.domain.EditorFiles;
+import com.jeeplus.business.editor.service.EditorFilesService;
+import com.jeeplus.business.editor.service.dto.EditorFilesDTO;
+import com.jeeplus.business.notify.domain.*;
+import com.jeeplus.business.notify.mapper.*;
+import com.jeeplus.business.notify.service.dto.JyNotifyDTO;
+import com.jeeplus.business.notify.service.dto.PluginNotifyCommentsDTO;
+import com.jeeplus.business.notify.service.dto.PluginNotifyOfficesDTO;
+import com.jeeplus.business.notify.service.dto.WorkAttachmentDto;
+import com.jeeplus.business.notify.service.mapstruct.JyNotifyWrapper;
+import com.jeeplus.business.project.domain.JyProjectEiaQualificationFile;
+import com.jeeplus.common.TokenProvider;
+import com.jeeplus.common.constant.CommonConstants;
+import com.jeeplus.common.utils.CommonUtils;
+import com.jeeplus.sys.domain.WorkAttachmentInfo;
+import com.jeeplus.sys.feign.IUserApi;
+import com.jeeplus.sys.feign.IWorkAttachmentApi;
+import com.jeeplus.sys.service.dto.UserDTO;
+import com.jeeplus.utils.StringUtils;
+import org.apache.poi.ss.formula.functions.T;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.util.*;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.stream.Collectors;
+
+/**
+ * 通知通告Service
+ *
+ * @author jeeplus
+ * @version 2021-05-16
+ */
+@Service
+@Transactional
+public class JyNotifyService extends ServiceImpl <JyNotifyMapper, JyNotify> {
+
+    @Autowired
+    private JyNotifyRecordService notifyRecordService;
+
+
+    @Resource
+    private PluginNotifyOfficesMapper pluginNotifyOfficesMapper;
+
+    @Resource
+    private PluginNotifyUserMapper pluginNotifyUserMapper;
+
+    @Resource
+    private EditorFilesService editorFilesService;
+
+
+
+    @Resource
+    private PluginNotifyCommentsMapper commentsMapper;
+
+    @Autowired
+    private JyNotifyMapper notifyMapper;
+
+    @Autowired
+    private JyNotifyLogMapper jyNotifyLogMapper;
+    /**
+     * 根据id获取通知
+     */
+    public JyNotifyDTO getById(String id) {
+        return baseMapper.getById ( id );
+    }
+
+    /**
+     * 自定义分页检索
+     *
+     * @param page
+     * @param queryWrapper
+     * @return
+     */
+    public IPage <JyNotifyDTO> findPage(Page <JyNotifyDTO> page, String currentUserId, boolean isSelf, String readFlag, QueryWrapper queryWrapper) {
+        queryWrapper.eq ( "a.del_flag", 0 ); // 排除已经删除
+        return baseMapper.findList ( page, currentUserId, isSelf, readFlag, queryWrapper );
+    }
+
+    /**
+     * 自定义分页检索
+     *
+     * @param page
+     * @param queryWrapper
+     * @return
+     */
+    public IPage <JyNotifyDTO> myNotifyDataFindPage(Page <JyNotifyDTO> page, String currentUserId, boolean isSelf, String readFlag, QueryWrapper queryWrapper) {
+        queryWrapper.eq ( "a.del_flag", 0 ); // 排除已经删除
+        return baseMapper.myNotifyDataFindList ( page, currentUserId, isSelf, readFlag, queryWrapper );
+    }
+
+    /**
+     * 获取通知发送记录
+     *
+     * @param id
+     * @return
+     */
+    public JyNotifyDTO getDetail(String id) {
+        JyNotifyDTO notifyDTO = notifyMapper.getById ( id );
+        if (ObjectUtil.isNotEmpty(notifyDTO)) {
+            this.saveLog(notifyDTO);
+            List notifyRecordList = notifyRecordService.findListByNotifyId ( id );
+            if (CollectionUtil.isNotEmpty(notifyRecordList)) {
+                notifyDTO.setNotifyRecordDTOList ( notifyRecordList );
+            }
+            // 1. 将富文本中的临时图片地址更换为新的
+            // 2. 获取富文本中的图片信息
+            if(StringUtils.isNotBlank(notifyDTO.getContent())){
+                String newContent = editorFilesService.getNewContent(notifyDTO.getContent(), id);
+                notifyMapper.updateContentById(newContent,id);
+                notifyDTO.setContent(newContent);
+                List<EditorFiles> list = editorFilesService.list(new QueryWrapper<EditorFiles>().lambda().eq(EditorFiles::getSourceId, id));
+                List<EditorFilesDTO> editorFilesDTOList = new ArrayList<>();
+                list.stream().forEach(item->{
+                    EditorFilesDTO editorFilesDTO = new EditorFilesDTO();
+                    editorFilesDTO.setSourceId(item.getSourceId());
+                    editorFilesDTO.setTemporaryUrl(item.getTemporaryUrl());
+                    editorFilesDTO.setUrl(item.getUrl());
+                    editorFilesDTOList.add(editorFilesDTO);
+                });
+                notifyDTO.setEditorFilesDTOList(editorFilesDTOList);
+            }
+            //获取评论信息
+            List<PluginNotifyCommentsDTO> commentsDTOList=commentsMapper.findNotifyAll(id);
+            if (CollectionUtil.isNotEmpty(commentsDTOList)){
+                commentsDTOList.stream().forEach(item -> {
+                    item.setDeff(CommonUtils.timeDef(item.getCreateTime()));
+                });
+            }
+            notifyDTO.setComments(commentsDTOList);
+            return notifyDTO;
+        } else {
+            return new JyNotifyDTO();
+        }
+    }
+
+    // 通知审核通过时,向通知接收人发送通知
+    // 根据所选接收部门以及所选接收用户,获取通知的接收人
+    public String pushNotifyRecord(String id) {
+        JyNotifyDTO detail = this.getDetail(id);
+        List<String> uIds = new ArrayList<>();
+        List<JyNotifyRecord> notifyRecordList = new ArrayList<>();
+        if (ObjectUtil.isNotEmpty(detail)) {
+            if (CollectionUtil.isNotEmpty(detail.getPluginNotifyOfficesDTOList())){
+                List<String> officeIds = detail.getPluginNotifyOfficesDTOList().stream().filter(item -> {
+                    if (StringUtils.isNotBlank(item.getOfficeId())) {
+                        return true;
+                    }
+                    return false;
+                }).map(PluginNotifyOfficesDTO::getOfficeId).collect(Collectors.toList());
+
+                if (CollectionUtil.isNotEmpty(officeIds)) {
+                    officeIds.stream().forEach(office->{
+                        List<UserDTO> listByOfficeId = SpringUtil.getBean(IUserApi.class).findListByOfficeId(office);
+                        if (CollectionUtil.isNotEmpty(listByOfficeId)) {
+                            listByOfficeId.stream().forEach(user -> {
+                                if(StringUtils.isNotBlank(user.getId())){
+                                    uIds.add(user.getId());
+                                }
+                            });
+                        }
+                    });
+
+                }
+            }
+            if (CollectionUtil.isNotEmpty(detail.getPluginNotifyUserDTOList())){
+                detail.getPluginNotifyUserDTOList().stream().forEach(userDTO -> {
+                    if (StringUtils.isNotBlank(userDTO.getUserId())) {
+                        uIds.add(userDTO.getUserId());
+                    }
+                });
+            }
+        }
+        if (CollectionUtil.isNotEmpty(uIds)) {
+            List<String> userIds = uIds.stream().distinct().collect(Collectors.toList());
+            userIds.stream().forEach(userId -> {
+                JyNotifyRecord notifyRecord = new JyNotifyRecord();
+                notifyRecord.setUserId(userId);
+                notifyRecord.setNotifyId(id);
+                notifyRecord.setReadFlag("0");
+                notifyRecordList.add(notifyRecord);
+            });
+        }
+        notifyRecordService.remove(new LambdaQueryWrapper<JyNotifyRecord>().eq(JyNotifyRecord::getNotifyId,id));
+        if (CollectionUtil.isNotEmpty(notifyRecordList)) {
+            notifyRecordService.saveBatch(notifyRecordList);
+        }
+        return "通知发送完成";
+    }
+
+
+    /**
+     * 获取通知数目
+     *
+     * @return
+     */
+    public Long findCount(String currentUserId, boolean isSelf, String readFlag) {
+        return baseMapper.findCount ( currentUserId, isSelf, readFlag );
+    }
+
+    /**
+     * 保存通知
+     *
+     * @param notifyDTO
+     * @return
+     */
+    public String saveForm(JyNotifyDTO notifyDTO) {
+        UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken());
+        JyNotify notify = JyNotifyWrapper.INSTANCE.toEntity ( notifyDTO );
+        super.saveOrUpdate ( notify );
+        notifyDTO.setId ( notify.getId () );
+        if (ObjectUtil.isNotEmpty(notifyDTO)) {
+            //富文本内容
+            editorFilesService.remove(new QueryWrapper<EditorFiles>().lambda().eq(EditorFiles::getSourceId,notify.getId ()));
+            if (CollectionUtil.isNotEmpty(notifyDTO.getEditorFilesDTOList())) {
+                notifyDTO.getEditorFilesDTOList().stream().forEach(item->{
+                    editorFilesService.saveUrl(item.getTemporaryUrl(),item.getUrl(),notify.getId());
+                });
+            }
+            // 附件
+            if (ObjectUtil.isNotEmpty(notifyDTO.getWorkAttachmentDtoList())) {
+                SpringUtil.getBean ( IWorkAttachmentApi.class ).deleteByAttachmentId(notifyDTO.getId());
+                AtomicInteger sort = new AtomicInteger(1);
+                notifyDTO.getWorkAttachmentDtoList().stream().forEach(item->{
+                    //保存附件信息
+                    WorkAttachmentInfo workAttachmentDto = new WorkAttachmentInfo();
+                    workAttachmentDto.setName(item.getName());
+                    workAttachmentDto.setSize(item.getSize());
+                    workAttachmentDto.setUrl(item.getUrl());
+                    Map<String,String> map = new HashMap<>();
+                    String workAttachmentDtoInfo = JSON.toJSONString(workAttachmentDto);
+                    String userDTOInfo = JSON.toJSONString(userDTO);
+                    String attachmentId = notifyDTO.getId();
+                    String attachmentFlag = "jyNotify";
+                    String sortInfo = Integer.toString(sort.get());
+                    map.put("workAttachmentDtoInfo",workAttachmentDtoInfo);
+                    map.put("userDTOInfo",userDTOInfo);
+                    map.put("attachmentId",attachmentId);
+                    map.put("attachmentFlag",attachmentFlag);
+                    map.put("sortInfo",sortInfo);
+                    String fileId = SpringUtil.getBean ( IWorkAttachmentApi.class ).saveFile(map);
+                    sort.getAndIncrement();
+                });
+            }
+            // 部门信息
+            pluginNotifyOfficesMapper.delete(new QueryWrapper<PluginNotifyOffices>().lambda().eq(PluginNotifyOffices::getNotifyId,notify.getId()));
+            if (ObjectUtil.isNotEmpty(notifyDTO.getPluginNotifyOfficesDTOList())){
+                notifyDTO.getPluginNotifyOfficesDTOList().stream().forEach(item->{
+                    PluginNotifyOffices pluginNotifyOffices = new PluginNotifyOffices();
+                    pluginNotifyOffices.setOfficeId(item.getOfficeId());
+                    pluginNotifyOffices.setNotifyId(notify.getId());
+                    pluginNotifyOfficesMapper.insert(pluginNotifyOffices);
+                });
+            }
+            // 用户信息
+            pluginNotifyUserMapper.delete(new QueryWrapper<PluginNotifyUser>().lambda().eq(PluginNotifyUser::getNotifyId,notify.getId()));
+            if (ObjectUtil.isNotEmpty(notifyDTO.getPluginNotifyUserDTOList())){
+                notifyDTO.getPluginNotifyUserDTOList().stream().forEach(item->{
+                    PluginNotifyUser pluginNotifyUser = new PluginNotifyUser();
+                    pluginNotifyUser.setUserId(item.getUserId());
+                    pluginNotifyUser.setNotifyId(notify.getId());
+                    pluginNotifyUserMapper.insert(pluginNotifyUser);
+                });
+            }
+            // 审核通过的时候,向用户发送通知
+            if (StringUtils.isNotBlank(notifyDTO.getStatus())) {
+                if ("5".equals(notifyDTO.getStatus())) {
+                    this.pushNotifyRecord(notify.getId());
+                }
+            }
+        }
+        return notify.getId ();
+    }
+
+    public ResponseEntity saveNotify(JyNotifyDTO notifyDTO){
+        this.saveForm(notifyDTO);
+        return ResponseEntity.ok("保存成功");
+    }
+
+    public String updateStatusById(JyNotifyDTO notifyDTO) {
+        baseMapper.updateStatusById(notifyDTO.getId(),notifyDTO.getStatus());
+        return "操作成功";
+    }
+
+    /**
+     * 更新阅读状态
+     */
+    public void updateReadFlag(String id) {
+        notifyRecordService.lambdaUpdate ( ).eq ( JyNotifyRecord::getNotifyId, id )
+                .eq ( JyNotifyRecord::getUserId, SpringUtil.getBean(IUserApi.class).getByToken(TokenProvider.getCurrentToken())).ne ( JyNotifyRecord::getReadFlag, CommonConstants.YES )
+                .set ( JyNotifyRecord::getReadDate, new Date ( ) ).set ( JyNotifyRecord::getReadFlag, CommonConstants.YES ).update ( );
+    }
+
+    public String addComment(PluginNotifyComments comment) {
+        commentsMapper.insert(comment);
+        return "操作完成";
+    }
+
+    public String delComment(String id) {
+        commentsMapper.deleteById(id);
+        return "操作完成";
+    }
+
+    /**
+     * 关闭通知
+     * @param id
+     */
+    public void closeById(String id) {
+        notifyMapper.closeById(id);
+    }
+
+    /**
+     * 将选定的通告信息改为已读
+     * @param idList
+     * @return
+     */
+    public void portionRead(List<String> idList){
+        if(null != idList && idList.size()>0){
+            for (String id: idList) {
+                notifyRecordService.lambdaUpdate ( ).eq ( JyNotifyRecord::getNotifyId, id )
+                        .eq ( JyNotifyRecord::getUserId, SpringUtil.getBean(IUserApi.class).getByToken(TokenProvider.getCurrentToken())).ne ( JyNotifyRecord::getReadFlag, CommonConstants.YES )
+                        .set ( JyNotifyRecord::getReadDate, new Date ( ) ).set ( JyNotifyRecord::getReadFlag, CommonConstants.YES ).update ( );
+            }
+        }
+    }
+
+    /**
+     * 当前登录人的所有有效通告均改为已读
+     * @return
+     */
+    public String readAll() {
+        // 获取当前登录人信息
+        UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getByToken(TokenProvider.getCurrentToken());
+        notifyMapper.readAll(userDTO.getId());
+        return "操作成功";
+    }
+
+    /**
+     * 添加或修改通知日志
+     * @param notifyDTO
+     * @return
+     */
+    public String saveLog(JyNotifyDTO notifyDTO) {
+        //获取当前登陆人信息
+        UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getByToken(TokenProvider.getCurrentToken());
+        //通过通知id查询日志中的数据
+        JyNotifyLog jyNotifyLogList=jyNotifyLogMapper.getByNotifyId(notifyDTO.getId(),userDTO.getId());
+        if (ObjectUtil.isNotEmpty(jyNotifyLogList)){
+            //修改
+            JyNotifyLog jyNotifyLog = new JyNotifyLog();
+            jyNotifyLog.setId(jyNotifyLogList.getId());
+            jyNotifyLog.setCount(jyNotifyLogList.getCount()+1);
+            jyNotifyLog.setNotifyId(notifyDTO.getId());
+            jyNotifyLog.setUpdateById(userDTO.getId());
+            jyNotifyLog.setUpdateTime(new Date());
+            jyNotifyLogMapper.updateById(jyNotifyLog);
+        }else {
+            //不存在则进行添加
+            JyNotifyLog jyNotifyLog = new JyNotifyLog();
+            jyNotifyLog.setCount(1);
+            jyNotifyLog.setNotifyId(notifyDTO.getId());
+            jyNotifyLog.setCreateById(userDTO.getId());
+            jyNotifyLog.setCreateTime(new Date());
+            jyNotifyLog.setUpdateById(userDTO.getId());
+            jyNotifyLog.setUpdateTime(new Date());
+            jyNotifyLogMapper.insert(jyNotifyLog);
+        }
+        return "操作成功";
+    }
+
+
+    //获取日志信息
+    public List<JyNotifyLog> findByNotifyId(Integer size,String id){
+        List<JyNotifyLog> notifyLogList=jyNotifyLogMapper.findByNotifyId(size,id);
+        return notifyLogList;
+    }
+
+    /**
+     * 获取日志数量
+     * @param id
+     * @return
+     */
+    public Integer findLogCount(String id) {
+        Integer count=jyNotifyLogMapper.findLogCount(id);
+        return count;
+    }
+}

+ 205 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/service/dto/JyNotifyDTO.java

@@ -0,0 +1,205 @@
+/**
+ * Copyright &copy; 2021-2026 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.business.notify.service.dto;
+
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.google.common.collect.Lists;
+import com.jeeplus.business.editor.service.dto.EditorFilesDTO;
+import com.jeeplus.business.notify.domain.JyNotifyLog;
+import com.jeeplus.common.constant.CommonConstants;
+import com.jeeplus.core.query.Query;
+import com.jeeplus.core.query.QueryType;
+import com.jeeplus.core.service.dto.BaseDTO;
+
+
+import com.jeeplus.sys.service.dto.UserDTO;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import javax.validation.constraints.Size;
+import java.util.Date;
+import java.util.List;
+import java.util.PriorityQueue;
+import java.util.stream.Collectors;
+
+/**
+ * 通知通告Entity
+ *
+ * @author jeeplus
+ * @version 2021-05-16
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class JyNotifyDTO extends BaseDTO {
+
+    private static final long serialVersionUID = 1L;
+    /**
+     * 类型
+     */
+    @Query(type = QueryType.EQ)
+    @Size(min = 0, max = 1, message = "类型长度必须介于 0 和 1 之间")
+    private String type;
+    /**
+     * 标题
+     */
+    @Query
+    @Size(min = 0, max = 200, message ="标题长度必须介于 0 和 200 之间")
+    private String title;
+    /**
+     * 内容
+     */
+    private String content;
+    /**
+     * 附件
+     */
+    @Size(min = 0, max = 2000, message = "附件长度必须介于 0 和 2000 之间")
+    private String files;
+    /**
+     * 状态
+     */
+    @Query(type = QueryType.EQ)
+    @Size(min = 0, max = 1, message = "状态长度必须介于 0 和 1 之间")
+    private String status;
+    /**
+     * 已读
+     */
+    private String readNum;
+    /**
+     * 未读
+     */
+    private String unReadNum;
+    /**
+     * 是否只查询自己的通知
+     */
+    private boolean isSelf;
+    /**
+     * 备注
+     */
+    private String remarks;
+    /**
+     * 通告状态
+     */
+    private String notifyType;
+    /**
+     * 文号
+     */
+    private String no;
+    /**
+     * 开始时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date beginDate;
+    /**
+     * 结束时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date endDate;
+    /**
+     * 所属部门id
+     */
+    private String officeId;
+
+    /**
+     * 本人阅读状态
+     */
+    @Query(type = QueryType.EQ)
+    private String readFlag;
+
+    /**
+     * 关闭状态
+     */
+    @Query(type = QueryType.EQ)
+    private String isClose;
+
+    /**
+     * 筛选条件:发布者
+     */
+    private String createName;
+    private String createById;
+
+    /**
+     * 筛选条件:创建时间
+     */
+    private String[] createDates;
+
+    /**
+     * 流程信息
+     */
+    private String taskId;
+
+    /**
+     * 附件
+     */
+    private List<WorkAttachmentDto> workAttachmentDtoList;
+    /**
+     * 接收部门集合
+     */
+    private List<PluginNotifyOfficesDTO> pluginNotifyOfficesDTOList;
+    /**
+     * 接收用户集合
+     */
+    private List<PluginNotifyUserDTO> pluginNotifyUserDTOList;
+    /**
+     * 富文本图片集合
+     */
+    private List<EditorFilesDTO> editorFilesDTOList;
+
+    private List<JyNotifyRecordDTO> notifyRecordDTOList = Lists.newArrayList();
+
+    /**
+     * 访问日志
+     */
+    private List<JyNotifyLog> notifyLogList;
+    //日志访问总数
+    private Integer logCount;
+
+    /**
+     * 评论
+     */
+    private List<PluginNotifyCommentsDTO> comments;
+
+    /**
+     * 获取通知发送记录用户ID
+     *
+     * @return
+     */
+    public String getNotifyRecordIds() {
+        return notifyRecordDTOList.stream ().map ( notifyRecordDTO -> {
+            return notifyRecordDTO.getUserDTO ().getId ();
+        } ).collect( Collectors.joining(","));
+    }
+
+    /**
+     * 设置通知发送记录用户ID
+     *
+     * @return
+     */
+    public void setNotifyRecordIds(String notifyRecordIds) {
+        this.notifyRecordDTOList = Lists.newArrayList();
+        for (String id : StrUtil.split(notifyRecordIds, ",")) {
+            JyNotifyRecordDTO dto = new JyNotifyRecordDTO();
+            dto.setNotifyDTO ( this );
+            dto.setUserDTO ( new UserDTO( id ) );
+            dto.setReadFlag ( CommonConstants.NO );
+            this.notifyRecordDTOList.add(dto);
+        }
+    }
+
+    /**
+     * 获取通知发送记录用户Name
+     *
+     * @return
+     */
+    public String getNotifyRecordNames() {
+        return notifyRecordDTOList.stream ().map ( notifyRecordDTO -> {
+            return notifyRecordDTO.getUserDTO ().getName ();
+        } ).collect( Collectors.joining(","));
+    }
+}

+ 44 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/service/dto/JyNotifyRecordDTO.java

@@ -0,0 +1,44 @@
+/**
+ * Copyright &copy; 2021-2026 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.business.notify.service.dto;
+
+import com.jeeplus.core.service.dto.BaseDTO;
+import com.jeeplus.sys.service.dto.UserDTO;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+
+/**
+ * 通知通告记录Entity
+ *
+ * @author jeeplus
+ * @version 2021-05-16
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class JyNotifyRecordDTO extends BaseDTO {
+
+    private static final long serialVersionUID = 1L;
+    /**
+     * 通知通告ID
+     */
+    private JyNotifyDTO notifyDTO;
+    /**
+     * 接受人
+     */
+    private UserDTO userDTO;
+    /**
+     *  阅读标记(0:未读;1:已读)
+     */
+    private String readFlag;
+    /**
+     * 阅读时间
+     */
+    private Date readDate;
+
+
+
+}

+ 46 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/service/dto/PluginNotifyCommentsDTO.java

@@ -0,0 +1,46 @@
+package com.jeeplus.business.notify.service.dto;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.jeeplus.core.service.dto.BaseDTO;
+import lombok.Data;
+
+/**
+ * 知识分享评论记录表
+ * @TableName plugin_notify_comments
+ */
+@Data
+public class PluginNotifyCommentsDTO extends BaseDTO {
+
+    /**
+     * 公告id
+     */
+    private String notifyId;
+
+    /**
+     * 评论人id
+     */
+    private String userId;
+
+    /**
+     * 评论人
+     */
+    private String userName;
+
+    /**
+     * 评论
+     */
+    private String comments;
+
+    /**
+     * 评论距离当前时间
+     */
+    private String Deff;
+
+    /**
+     * 创建人id
+     */
+    private String createId;
+
+    @TableField(exist = false)
+    private static final long serialVersionUID = 1L;
+}

+ 35 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/service/dto/PluginNotifyOfficesDTO.java

@@ -0,0 +1,35 @@
+package com.jeeplus.business.notify.service.dto;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.jeeplus.core.service.dto.BaseDTO;
+import lombok.Data;
+
+/**
+ * 通知通告-通告范围-部门
+ * @TableName plugin_notify_offices
+ */
+@Data
+public class PluginNotifyOfficesDTO extends BaseDTO {
+
+    /**
+     * 备注信息
+     */
+    private String remarks;
+
+    /**
+     * 部门id
+     */
+    private String officeId;
+
+    /**
+     * 通知id
+     */
+    private String notifyId;
+
+    /**
+     * 部门名称
+     */
+    private String officeName;
+
+    @TableField(exist = false)
+    private static final long serialVersionUID = 1L;
+}

+ 39 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/service/dto/PluginNotifyUserDTO.java

@@ -0,0 +1,39 @@
+package com.jeeplus.business.notify.service.dto;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.jeeplus.core.service.dto.BaseDTO;
+import lombok.Data;
+
+/**
+ * 通知通告-通告范围-用户
+ * @TableName plugin_notify_user
+ */
+@Data
+public class PluginNotifyUserDTO extends BaseDTO {
+    /**
+     * 备注信息
+     */
+    private String remarks;
+
+    /**
+     * 用户id
+     */
+    private String userId;
+
+    /**
+     * 通知id
+     */
+    private String notifyId;
+
+    /**
+     * 用户名称
+     */
+    private String userName;
+
+    /**
+     * 所属部门
+     */
+    private String officeName;
+
+    @TableField(exist = false)
+    private static final long serialVersionUID = 1L;
+}

+ 25 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/service/dto/WorkAttachmentDto.java

@@ -0,0 +1,25 @@
+package com.jeeplus.business.notify.service.dto;
+
+import com.jeeplus.core.service.dto.BaseDTO;
+import com.jeeplus.sys.service.dto.UserDTO;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class WorkAttachmentDto extends BaseDTO {
+
+    private String name;
+
+    private String size;
+
+    private String url;
+
+    private UserDTO createBy;
+
+    private String by;
+
+    private String createByName;
+
+
+}

+ 18 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/service/mapstruct/JyNotifyRecordWrapper.java

@@ -0,0 +1,18 @@
+package com.jeeplus.business.notify.service.mapstruct;
+
+import com.jeeplus.business.notify.domain.JyNotifyRecord;
+import com.jeeplus.business.notify.service.dto.JyNotifyRecordDTO;
+import com.jeeplus.core.mapstruct.EntityWrapper;
+import org.mapstruct.Mapper;
+import org.mapstruct.Mapping;
+import org.mapstruct.Mappings;
+import org.mapstruct.ReportingPolicy;
+import org.mapstruct.factory.Mappers;
+
+@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE, uses = {} )
+public interface JyNotifyRecordWrapper extends EntityWrapper<JyNotifyRecordDTO, JyNotifyRecord> {
+
+    JyNotifyRecordWrapper INSTANCE = Mappers.getMapper( JyNotifyRecordWrapper.class);
+
+
+}

+ 15 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/notify/service/mapstruct/JyNotifyWrapper.java

@@ -0,0 +1,15 @@
+package com.jeeplus.business.notify.service.mapstruct;
+
+import com.jeeplus.business.notify.domain.JyNotify;
+import com.jeeplus.business.notify.service.dto.JyNotifyDTO;
+import com.jeeplus.core.mapstruct.EntityWrapper;
+import org.mapstruct.Mapper;
+import org.mapstruct.ReportingPolicy;
+import org.mapstruct.factory.Mappers;
+
+@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE, uses = {} )
+public interface JyNotifyWrapper extends EntityWrapper<JyNotifyDTO, JyNotify> {
+
+    JyNotifyWrapper INSTANCE = Mappers.getMapper( JyNotifyWrapper.class);
+
+}

+ 7 - 9
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/controller/JyProjectController.java

@@ -4,21 +4,19 @@ import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jeeplus.aop.demo.annotation.DemoMode;
-import com.jeeplus.assess.program.configuration.projectList.domain.ProgramProjectListInfo;
-import com.jeeplus.assess.program.configuration.projectList.service.dto.ContractDto;
-import com.jeeplus.assess.program.configuration.projectList.service.dto.ProgramAuditDto;
-import com.jeeplus.assess.program.configuration.projectList.service.dto.ProjectListDto;
-import com.jeeplus.assess.utils.FreemarkerUtil;
-import com.jeeplus.assess.workContract.domain.WorkContractInfo;
+//import com.jeeplus.assess.utils.FreemarkerUtil;
 import com.jeeplus.business.project.domain.JyProject;
 import com.jeeplus.business.project.domain.JyProjectAudit;
 import com.jeeplus.business.project.domain.JyProjectReportsSubmit;
 import com.jeeplus.business.project.service.JyProjectAuditService;
 import com.jeeplus.business.project.service.JyProjectService;
 import com.jeeplus.business.project.service.dto.*;
+import com.jeeplus.business.project.utils.FreemarkerUtil;
+import com.jeeplus.business.project.utils.JyResponseUtil;
 import com.jeeplus.business.useSeal.service.dto.SignetDTO;
 import com.jeeplus.business.workContractInfo.domain.JyWorkContractInfo;
 import com.jeeplus.business.workContractInfo.service.dto.JyWorkContractInfoDto;
+
 import com.jeeplus.common.utils.ResponseUtil;
 import com.jeeplus.logging.annotation.ApiLog;
 import freemarker.template.Configuration;
@@ -257,7 +255,7 @@ public class JyProjectController {
 
             File docFile = new File("嘉溢一级校审.doc");
             FreemarkerUtil.generateFile(data,template,docFile);
-            com.jeeplus.assess.utils.ResponseUtil.docResponse("嘉溢一级校审.doc",docFile,response);
+            JyResponseUtil.docResponse("嘉溢一级校审.doc",docFile,response);
         } catch (IOException e) {
             e.printStackTrace();
         }finally {
@@ -311,7 +309,7 @@ public class JyProjectController {
 
             File docFile = new File("嘉溢二级校审.doc");
             FreemarkerUtil.generateFile(data,template,docFile);
-            com.jeeplus.assess.utils.ResponseUtil.docResponse("嘉溢二级校审.doc",docFile,response);
+            JyResponseUtil.docResponse("嘉溢二级校审.doc",docFile,response);
         } catch (IOException e) {
             e.printStackTrace();
         }finally {
@@ -364,7 +362,7 @@ public class JyProjectController {
 
             File docFile = new File("嘉溢三级校审.doc");
             FreemarkerUtil.generateFile(data,template,docFile);
-            com.jeeplus.assess.utils.ResponseUtil.docResponse("嘉溢三级校审.doc",docFile,response);
+            JyResponseUtil.docResponse("嘉溢三级校审.doc",docFile,response);
         } catch (IOException e) {
             e.printStackTrace();
         }finally {

+ 0 - 1
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/mapper/JyProjectMapper.java

@@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Constants;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.jeeplus.assess.program.configuration.projectList.domain.ProgramProjectListInfo;
 import com.jeeplus.business.project.domain.JyProject;
 import com.jeeplus.business.workContractInfo.domain.JyWorkContractInfo;
 import com.jeeplus.business.workContractInfo.service.dto.JyWorkContractInfoDto;

+ 0 - 3
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/service/JyProjectMembersService.java

@@ -1,7 +1,6 @@
 package com.jeeplus.business.project.service;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.jeeplus.assess.program.configuration.projectList.mapper.ProgramMembersMapper;
 import com.jeeplus.business.project.domain.JyProjectMembers;
 import com.jeeplus.business.project.mapper.JyProjectMemberMapper;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -10,6 +9,4 @@ import org.springframework.stereotype.Service;
 @Service
 public class JyProjectMembersService extends ServiceImpl<JyProjectMemberMapper, JyProjectMembers> {
 
-    @Autowired
-    private ProgramMembersMapper programMembersMapper;
 }

+ 10 - 13
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/service/JyProjectService.java

@@ -9,7 +9,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.jeeplus.assess.workContract.mapper.WorkContractInfoMapper;
 import com.jeeplus.business.project.domain.*;
 import com.jeeplus.business.project.mapper.*;
 import com.jeeplus.business.project.service.dto.*;
@@ -30,12 +29,12 @@ import com.jeeplus.business.workContractInfo.service.dto.JyWorkContractInfoDto;
 import com.jeeplus.common.TokenProvider;
 import com.jeeplus.core.query.QueryWrapperGenerator;
 import com.jeeplus.flowable.feign.IFlowableApi;
-import com.jeeplus.pubmodules.oss.domain.WorkAttachment;
-import com.jeeplus.sys.domain.DictValue;
 import com.jeeplus.sys.domain.WorkAttachmentInfo;
+import com.jeeplus.sys.feign.IDictApi;
 import com.jeeplus.sys.feign.IUserApi;
 import com.jeeplus.sys.feign.IWorkAttachmentApi;
-import com.jeeplus.sys.mapper.DictValueMapper;
+
+//import com.jeeplus.sys.mapper.DictValueMapper;
 import com.jeeplus.sys.service.dto.UserDTO;
 import com.jeeplus.sys.service.dto.WorkAttachmentInfoDTO;
 import org.apache.commons.compress.utils.Lists;
@@ -78,14 +77,12 @@ public class JyProjectService {
 //    @Autowired
 //    private JyWorkContractService jyWorkContractService;
 
-    @Resource
-    private DictValueMapper dictValueMapper;
+//    @Resource
+//    private DictValueMapper dictValueMapper;
 
     @Resource
     private JyProjectAuditMapper jyProjectAuditMapper;
 
-    @Resource
-    private WorkContractInfoMapper workContractInfoMapper;
 
     @Autowired
     private SignetMapper signetMapper;
@@ -575,8 +572,8 @@ public class JyProjectService {
             }else {
                 String[] split = info.getContractType().split(",");
                 for (String s : split) {
-                    DictValue dictValue = dictValueMapper.selectById(s);
-                    type=dictValue.getLabel()+",";
+                    String contractType = SpringUtil.getBean(IDictApi.class).getDictLabel(s, "jy_contract_type", "");
+                    type=contractType+",";
                     String newType=type.substring(0,type.lastIndexOf(","));
                     jyProjectDTO.setContractType(newType);
                 }
@@ -690,7 +687,7 @@ public class JyProjectService {
         //根据id获取校审信息
         JyProjectAuditDTO jyProjectAuditDTO=jyProjectAuditMapper.findByIdAudit(id);
         // 查询附件信息
-        List<WorkAttachmentInfo> files = workContractInfoMapper.findDtos(id);
+        List<WorkAttachmentInfo> files = jyWorkContractInfoMapper.findDtos(id);
         if (CollectionUtils.isNotEmpty(files)) {
             for (WorkAttachmentInfo i : files) {
                 i.setCreateBy(SpringUtil.getBean ( IUserApi.class ).getById(i.getBy()));
@@ -1419,7 +1416,7 @@ public class JyProjectService {
     public void saveReportsFiles(List<WorkAttachmentInfo> list, UserDTO userDTO, String id) {
         int j = 1;
         for (WorkAttachmentInfo dto : list) {
-            WorkAttachment i = new WorkAttachment();
+            WorkAttachmentInfo i = new WorkAttachmentInfo();
             //包含了url、size、name
             i.setId(UUID.randomUUID().toString().replace("-", ""));
 //            i.getCreateBy().setId(userDTO.getId());
@@ -1478,7 +1475,7 @@ public class JyProjectService {
             //判断是否存在
             Integer isExit = signetMapper.findIsExit(id, dto.getName());
             if (isExit == 0) {
-                WorkAttachment i = new WorkAttachment();
+                WorkAttachmentInfo i = new WorkAttachmentInfo();
                 //包含了url、size、name
                 i.setId(UUID.randomUUID().toString().replace("-", ""));
 //                i.getCreateBy().setId(userDTO.getId());

+ 1 - 2
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/service/mapstruct/JyProjectAuditWrapper.java

@@ -1,7 +1,6 @@
 package com.jeeplus.business.project.service.mapstruct;
 
-import com.jeeplus.assess.program.configuration.projectList.domain.ProgramAudit;
-import com.jeeplus.assess.program.configuration.projectList.service.dto.ProgramAuditDto;
+
 import com.jeeplus.business.project.domain.JyProjectAudit;
 import com.jeeplus.business.project.service.dto.JyProjectAuditDTO;
 import com.jeeplus.core.mapstruct.EntityWrapper;

+ 25 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/utils/FreemarkerUtil.java

@@ -0,0 +1,25 @@
+package com.jeeplus.business.project.utils;
+
+import freemarker.template.Template;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
+import java.util.Map;
+
+public class FreemarkerUtil {
+    public static void generateFile(Map<?, ?> dataMap, Template template, File file){
+
+        Template t = template;
+        try {
+            // 这个地方不能使用FileWriter因为需要指定编码类型否则生成的Word文档会因为有无法识别的编码而无法打开
+            Writer w = new OutputStreamWriter(new FileOutputStream(file), "UTF-8");
+            t.process(dataMap, w);
+            w.close();
+        } catch (Exception ex) {
+            ex.printStackTrace();
+            throw new RuntimeException(ex);
+        }
+    }
+}

+ 61 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/utils/JyResponseUtil.java

@@ -0,0 +1,61 @@
+package com.jeeplus.business.project.utils;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServletResponse;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.net.URLEncoder;
+import java.util.Calendar;
+
+public class JyResponseUtil {
+    private static Logger logger = LoggerFactory.getLogger(JyResponseUtil.class);
+
+    public static void docResponse(String fileName, File file, HttpServletResponse response) {
+        ServletOutputStream out = null;
+        FileInputStream fin = null;
+        try {
+            fin = new FileInputStream(file);
+            response.setCharacterEncoding("utf-8");
+            response.setContentType("application/octet-stream; charset=UTF-8");
+            // 设置浏览器以下载的方式处理该文件名
+            response.setHeader("Content-Disposition", "attachment;filename="
+                    .concat(String.valueOf(URLEncoder.encode(fileName, "UTF-8"))));
+            out = response.getOutputStream();
+            byte[] buffer = new byte[1024];  // 缓冲区
+            int bytesToRead = -1;
+            // 通过循环将读入的Word文件的内容输出到浏览器中
+            while ((bytesToRead = fin.read(buffer)) != -1) {
+                out.write(buffer, 0, bytesToRead);
+            }
+        } catch (Exception e) {
+            logger.error("导出模板文件发生错误!",e);
+        } finally {
+            try {
+                out.flush();
+                if (fin != null) fin.close();
+                if (out != null) out.close();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+
+        }
+    }
+
+
+    /**
+     * 获取当前时间年月日
+     * @return
+     */
+    public static String datePath(){
+        Calendar date = Calendar.getInstance();
+        String year = String.valueOf(date.get(Calendar.YEAR));
+        String month = String.valueOf(date.get(Calendar.MONTH)+1);
+        String day = String.valueOf(date.get(Calendar.DAY_OF_MONTH));
+        String path = "/"+year+"/"+month+"/"+day;
+        return path;
+    }
+}

+ 3 - 8
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/useSeal/service/SignetService.java

@@ -18,9 +18,6 @@ import com.jeeplus.business.project.service.dto.JyProjectDTO;
 import com.jeeplus.business.workContractInfo.mapper.JyWorkContractInfoMapper;
 import com.jeeplus.common.TokenProvider;
 import com.jeeplus.core.query.QueryWrapperGenerator;
-import com.jeeplus.pubmodules.oss.domain.WorkAttachment;
-import com.jeeplus.pubmodules.oss.service.dto.WorkAttachmentDto;
-import com.jeeplus.pubmodules.serialNumTpl.service.SerialnumTplService;
 import com.jeeplus.business.useSeal.domain.Signet;
 import com.jeeplus.business.useSeal.mapper.SignetMapper;
 import com.jeeplus.business.useSeal.service.dto.SignetDTO;
@@ -45,8 +42,6 @@ public class SignetService {
     @Autowired
     private SignetMapper signetMapper;
 
-    @Autowired
-    private SerialnumTplService serialnumTplService;
 
     @Autowired
     private JyProjectMapper jyProjectMapper;
@@ -154,7 +149,7 @@ public class SignetService {
         // 生成id
         String id = UUID.randomUUID().toString().replace("-", "");
         // 生成编号
-        String no = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), dto.BIZ_CODE,TokenProvider.getCurrentToken());
+        String no = SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), dto.BIZ_CODE,TokenProvider.getCurrentToken());
         // 保存基础信息表信息
         Signet signet = new Signet();
         BeanUtils.copyProperties(dto, signet);
@@ -275,7 +270,7 @@ public class SignetService {
     public void saveFiles(List<WorkAttachmentInfo> list, UserDTO userDTO, String id) {
         int j = 1;
         for (WorkAttachmentInfo dto : list) {
-            WorkAttachment i = new WorkAttachment();
+            WorkAttachmentInfo i = new WorkAttachmentInfo();
             //包含了url、size、name
             i.setId(UUID.randomUUID().toString().replace("-", ""));
 //            i.getCreateBy().setId(userDTO.getId());
@@ -334,7 +329,7 @@ public class SignetService {
             //判断是否存在
             Integer isExit = signetMapper.findIsExit(id, dto.getName());
             if (isExit == 0) {
-                WorkAttachment i = new WorkAttachment();
+                WorkAttachmentInfo i = new WorkAttachmentInfo();
                 //包含了url、size、name
                 i.setId(UUID.randomUUID().toString().replace("-", ""));
 //                i.getCreateBy().setId(userDTO.getId());

+ 0 - 1
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/useSeal/service/dto/SignetDTO.java

@@ -3,7 +3,6 @@ package com.jeeplus.business.useSeal.service.dto;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.jeeplus.business.project.domain.JyProject;
-import com.jeeplus.pubmodules.oss.service.dto.WorkAttachmentDto;
 import com.jeeplus.sys.domain.WorkAttachmentInfo;
 import lombok.Data;
 

+ 16 - 0
jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/controller/OfficeController.java

@@ -4,6 +4,8 @@
 package com.jeeplus.sys.controller;
 
 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.google.common.collect.Lists;
 import com.jeeplus.aop.demo.annotation.DemoMode;
 import com.jeeplus.common.constant.CommonConstants;
@@ -223,4 +225,18 @@ public class OfficeController {
         return ResponseEntity.ok (rootTree);
     }
 
+    /**
+     * 查询部门信息列表tree
+     * @param officeDTO
+     * @param page
+     * @return
+     * @throws Exception
+     */
+    @ApiLog("查询部门信息列表tree")
+    @GetMapping("list_tree")
+    public ResponseEntity<IPage<OfficeDTO>> dataTree(OfficeDTO officeDTO, Page<OfficeDTO> page) throws Exception {
+        IPage<OfficeDTO> result = new Page<OfficeDTO>();
+        result = officeService.findListTree (page,officeDTO);
+        return ResponseEntity.ok (result);
+    }
 }

+ 4 - 0
jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/mapper/OfficeMapper.java

@@ -5,7 +5,9 @@ package com.jeeplus.sys.mapper;
 
 import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Constants;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jeeplus.core.domain.TreeMapper;
 import com.jeeplus.sys.domain.Office;
 import com.jeeplus.sys.domain.SysParameterValue;
@@ -130,4 +132,6 @@ public interface OfficeMapper extends TreeMapper <Office> {
 
     @InterceptorIgnore(tenantLine = "true")
     List<Office> getJyChildren(String rootId);
+
+    IPage<OfficeDTO> findListTree(Page<OfficeDTO> page,@Param(Constants.WRAPPER)  QueryWrapper<OfficeDTO> queryWrapper);
 }

+ 9 - 0
jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/mapper/xml/OfficeMapper.xml

@@ -409,4 +409,13 @@
             and parent_id = #{rootId}
             and NAME LIKE concat('%','嘉溢','%')
     </select>
+
+    <select id="findListTree" resultType="com.jeeplus.sys.service.dto.OfficeDTO">
+        select
+            so.parent_id,
+            so.name,
+            so.id
+        from sys_office so
+        ${ew.customSqlSegment}
+    </select>
 </mapper>

+ 59 - 0
jeeplus-modules/jeeplus-system/src/main/java/com/jeeplus/sys/service/OfficeService.java

@@ -4,9 +4,11 @@
 package com.jeeplus.sys.service;
 
 import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.extra.spring.SpringUtil;
 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.google.common.collect.Lists;
 import com.google.common.collect.Maps;
@@ -31,6 +33,7 @@ import org.springframework.transaction.annotation.Transactional;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * 机构Service
@@ -651,4 +654,60 @@ public class OfficeService extends TreeService <OfficeMapper, Office> {
         }
         return offices;
     }
+
+    public IPage<OfficeDTO> findListTree(Page<OfficeDTO> page, OfficeDTO officeDTO) throws Exception{
+        QueryWrapper<OfficeDTO> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("so.del_flag","0");
+        queryWrapper.orderByAsc("so.create_time");
+        if (ObjectUtil.isNotEmpty(officeDTO)) {
+            if (org.apache.commons.lang.StringUtils.isNotBlank(officeDTO.getName())) {
+                List<String> ids = new ArrayList<>();
+                List<Office> list = this.list(new QueryWrapper<Office>().lambda()
+                        .like(org.apache.commons.lang.StringUtils.isNotBlank(officeDTO.getName()),Office::getName, officeDTO.getName())
+                );
+                list.stream().forEach(item->{
+                    ids.add(item.getId());
+                    if (org.apache.commons.lang.StringUtils.isNotBlank(item.getParentId())) {
+                        String parentId = item.getParentId();
+                        while (true) {
+                            Office byId = this.getOne(new QueryWrapper<Office>().lambda().eq(Office::getId, parentId));
+                            if (ObjectUtil.isNotEmpty(byId)) {
+                                ids.add(byId.getId());
+                                if (org.apache.commons.lang.StringUtils.isBlank(byId.getParentId())) {
+                                    break;
+                                } else {
+                                    parentId = byId.getParentId();
+                                }
+                            } else {
+                                break;
+                            }
+                        }
+                    }
+                    List<String> childIdList = this.list(new QueryWrapper<Office>().lambda().eq(Office::getParentId, item.getId())).stream().map(Office::getId).collect(Collectors.toList());
+                    while (true) {
+                        if (CollectionUtil.isNotEmpty(childIdList)) {
+                            childIdList.stream().forEach(childId->{
+                                ids.add(childId);
+                            });
+                            List<String> childIdS = this.list(new QueryWrapper<Office>().lambda().in(Office::getParentId, childIdList)).stream().map(Office::getId).collect(Collectors.toList());
+                            if (CollectionUtil.isNotEmpty(childIdS)) {
+                                childIdList = childIdS;
+                            } else {
+                                break;
+                            }
+                        } else {
+                            break;
+                        }
+                    }
+                });
+                List<String> lastIdList = ids.stream().distinct().collect(Collectors.toList());
+                if (CollectionUtil.isNotEmpty(lastIdList)){
+                    queryWrapper.in("so.id",lastIdList);
+                } else {
+                    return new Page<>();
+                }
+            }
+        }
+        return officeMapper.findListTree(page, queryWrapper);
+    }
 }