Răsfoiți Sursa

暂时取消发送邮件,配置企业微信邮箱信息

Huanyi 2 luni în urmă
părinte
comite
05868e862e

+ 1 - 1
pom.xml

@@ -13,7 +13,7 @@
         <spring-boot.version>3.5.7</spring-boot.version>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
-        <java.version>17</java.version>
+        <java.version>21</java.version>
         <mybatis.version>3.5.16</mybatis.version>
         <springdoc.version>2.8.13</springdoc.version>
         <therapi-javadoc.version>0.15.0</therapi-javadoc.version>

+ 6 - 6
ruoyi-admin/src/main/resources/application-prod.yml

@@ -52,7 +52,7 @@ spring:
                     # rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
                     url: jdbc:mysql://127.0.0.1:3306/intelligent_etmf_system?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
                     username: root
-                    password: IntelligentEtmfSystem
+                    password: 123456
             #        # 从库数据源
             #        slave:
             #          lazy: true
@@ -136,17 +136,17 @@ redisson:
 
 --- # mail 邮件发送
 mail:
-    enabled: false
-    host: smtp.163.com
+    enabled: true
+    host: smtp.exmail.qq.com
     port: 465
     # 是否需要用户名密码验证
     auth: true
     # 发送方,遵循RFC-822标准
-    from: xxx@163.com
+    from: 浙江道修远生物医药科技有限公司 <baopeng@daoxiuyuan.com>
     # 用户名(注意:如果使用foxmail邮箱,此处user为qq号)
-    user: xxx@163.com
+    user: baopeng@daoxiuyuan.com
     # 密码(注意,某些邮箱需要为SMTP服务单独设置密码,详情查看相关帮助)
-    pass: xxxxxxxxxx
+    pass:
     # 使用 STARTTLS安全连接,STARTTLS是对纯文本通信协议的扩展。
     starttlsEnable: true
     # 使用SSL安全连接

+ 1 - 1
ruoyi-admin/src/main/resources/application.yml

@@ -44,7 +44,7 @@ spring:
     threads:
         # 开启虚拟线程 仅jdk21可用
         virtual:
-            enabled: false
+            enabled: true
     task:
         execution:
             # 从 springboot 3.5 开始 spring自带线程池

+ 24 - 24
ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/service/impl/DocumentQcTaskDetailServiceImpl.java

@@ -150,30 +150,30 @@ public class DocumentQcTaskDetailServiceImpl implements IDocumentQcTaskDetailSer
         DocumentQcTask task = taskMapper.selectById(bo.getTaskId());
         Document document = documentService.selectById(detail.getDocumentId());
 
-        if (bo.getResult().equals(DocumentStatusEnum.QC_REJECT.getValue())) {
-            Map<String, String> questionTypeMap = new HashMap<>();
-            dictTypeService.selectDictDataByType(DictTypeConst.QC_QUESTION_TYPE)
-                .forEach(e -> questionTypeMap.put(e.getDictValue(), e.getDictLabel()));
-            MailTemplateEnum template = MailTemplateEnum.QC_REJECT;
-            SysUserVo designatedDealer = userService.getById(bo.getDesignatedDealer());
-            String typeContext = Optional.ofNullable(questionTypeMap.get(bo.getRejectionType()))
-                .orElse("{\"zh_CN\":\"未知问题\",\"en_US\":\"Unknown Question\"}");
-            Dict type = JsonUtils.parseMap(typeContext);
-            MailUtils.sendHtml(
-                designatedDealer.getEmail(),
-                template.getTitle(),
-                MessageFormat.format(
-                    template.getContent(),
-                    designatedDealer.getNickName(),
-                    task.getName(),
-                    projectService.queryById(detail.getProjectId()).getName(),
-                    document.getName(),
-                    LocaleContextHolder.getLocale().getLanguage().equals("zh") ? type.getStr("zh_CN") : type.getStr("en_US"),
-                    bo.getOpinion(),
-                    DateUtils.formatDate(bo.getDeadline())
-                )
-            );
-        }
+//        if (bo.getResult().equals(DocumentStatusEnum.QC_REJECT.getValue())) {
+//            Map<String, String> questionTypeMap = new HashMap<>();
+//            dictTypeService.selectDictDataByType(DictTypeConst.QC_QUESTION_TYPE)
+//                .forEach(e -> questionTypeMap.put(e.getDictValue(), e.getDictLabel()));
+//            MailTemplateEnum template = MailTemplateEnum.QC_REJECT;
+//            SysUserVo designatedDealer = userService.getById(bo.getDesignatedDealer());
+//            String typeContext = Optional.ofNullable(questionTypeMap.get(bo.getRejectionType()))
+//                .orElse("{\"zh_CN\":\"未知问题\",\"en_US\":\"Unknown Question\"}");
+//            Dict type = JsonUtils.parseMap(typeContext);
+//            MailUtils.sendHtml(
+//                designatedDealer.getEmail(),
+//                template.getTitle(),
+//                MessageFormat.format(
+//                    template.getContent(),
+//                    designatedDealer.getNickName(),
+//                    task.getName(),
+//                    projectService.queryById(detail.getProjectId()).getName(),
+//                    document.getName(),
+//                    LocaleContextHolder.getLocale().getLanguage().equals("zh") ? type.getStr("zh_CN") : type.getStr("en_US"),
+//                    bo.getOpinion(),
+//                    DateUtils.formatDate(bo.getDeadline())
+//                )
+//            );
+//        }
 
         DocumentQcTaskLog log = new DocumentQcTaskLog();
         log.setTaskId(detail.getTaskId());

+ 59 - 59
ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/service/impl/DocumentServiceImpl.java

@@ -222,23 +222,23 @@ public class DocumentServiceImpl implements IDocumentService {
     public Boolean insertByBo(DocumentBo bo) {
         Document add = MapstructUtils.convert(bo, Document.class);
 
-        if (bo.getType().equals(DocumentTypeConst.PLAN)) {
-
-            SysUserVo user = userService.getById(bo.getPlanSubmitter());
-            MailTemplateEnum template = MailTemplateEnum.TO_SUBMIT;
-            MailUtils.sendHtml(
-                user.getEmail(),
-                template.getTitle(),
-                MessageFormat.format(
-                    template.getContent(),
-                    user.getNickName(),
-                    Arrays.stream(bo.getName().split("-")).filter(e -> !e.equals("NA")).collect(Collectors.joining("-")),
-                    projectService.queryById(bo.getProjectId()).getName(),
-                    folderService.getPathById(bo.getFolderId(), bo.getProjectId()),
-                    DateUtils.formatDateTime(bo.getSubmitDeadline())
-                )
-            );
-        }
+//        if (bo.getType().equals(DocumentTypeConst.PLAN)) {
+//
+//            SysUserVo user = userService.getById(bo.getPlanSubmitter());
+//            MailTemplateEnum template = MailTemplateEnum.TO_SUBMIT;
+//            MailUtils.sendHtml(
+//                user.getEmail(),
+//                template.getTitle(),
+//                MessageFormat.format(
+//                    template.getContent(),
+//                    user.getNickName(),
+//                    Arrays.stream(bo.getName().split("-")).filter(e -> !e.equals("NA")).collect(Collectors.joining("-")),
+//                    projectService.queryById(bo.getProjectId()).getName(),
+//                    folderService.getPathById(bo.getFolderId(), bo.getProjectId()),
+//                    DateUtils.formatDateTime(bo.getSubmitDeadline())
+//                )
+//            );
+//        }
 
         add.setSpecificationType(folderService.getSpecificationType(bo.getFolderId(), bo.getProjectId()));
 
@@ -306,18 +306,18 @@ public class DocumentServiceImpl implements IDocumentService {
         MailTemplateEnum template = MailTemplateEnum.TO_AUDIT;
         Document document = baseMapper.selectById(bo.getDocumentId());
         SysUserVo auditor = userService.getById(document.getCreateBy());
-        MailUtils.sendHtml(
-            auditor.getEmail(),
-            template.getTitle(),
-            MessageFormat.format(
-                template.getContent(),
-                auditor.getNickName(),
-                Arrays.stream(document.getName().split("-")).filter(e -> !e.equals("NA")).collect(Collectors.joining("-")),
-                projectService.queryById(document.getProjectId()).getName(),
-                folderService.getPathById(document.getFolderId(), document.getProjectId()),
-                DateUtils.formatDateTime(new Date())
-                )
-        );
+//        MailUtils.sendHtml(
+//            auditor.getEmail(),
+//            template.getTitle(),
+//            MessageFormat.format(
+//                template.getContent(),
+//                auditor.getNickName(),
+//                Arrays.stream(document.getName().split("-")).filter(e -> !e.equals("NA")).collect(Collectors.joining("-")),
+//                projectService.queryById(document.getProjectId()).getName(),
+//                folderService.getPathById(document.getFolderId(), document.getProjectId()),
+//                DateUtils.formatDateTime(new Date())
+//                )
+//        );
 
         document.setSubmitter(LoginHelper.getUserId());
         document.setActualDocument(bo.getOssId());
@@ -346,36 +346,36 @@ public class DocumentServiceImpl implements IDocumentService {
 
         SysUserVo user = userService.getById(document.getPlanSubmitter() != null ? document.getPlanSubmitter() : document.getSubmitter());
 
-        if (bo.getResult().equals(DocumentStatusEnum.AUDIT_REJECT.getValue())) {
-            MailTemplateEnum template = MailTemplateEnum.AUDIT_REJECT;
-            MailUtils.sendHtml(
-                user.getEmail(),
-                template.getTitle(),
-                MessageFormat.format(
-                    template.getContent(),
-                    user.getNickName(),
-                    Arrays.stream(document.getName().split("-")).filter(e -> !e.equals("NA")).collect(Collectors.joining("-")),
-                    projectService.queryById(document.getProjectId()).getName(),
-                    folderService.getPathById(document.getFolderId(), document.getProjectId()),
-                    DateUtils.formatDateTime(new Date()),
-                    bo.getRejectReason()
-                )
-            );
-        } else {
-            MailTemplateEnum template = MailTemplateEnum.AUDIT_PASS;
-            MailUtils.sendHtml(
-                user.getEmail(),
-                template.getTitle(),
-                MessageFormat.format(
-                    template.getContent(),
-                    user.getNickName(),
-                    Arrays.stream(document.getName().split("-")).filter(e -> !e.equals("NA")).collect(Collectors.joining("-")),
-                    projectService.queryById(document.getProjectId()).getName(),
-                    folderService.getPathById(document.getFolderId(), document.getProjectId()),
-                    DateUtils.formatDateTime(new Date())
-                )
-            );
-        }
+//        if (bo.getResult().equals(DocumentStatusEnum.AUDIT_REJECT.getValue())) {
+//            MailTemplateEnum template = MailTemplateEnum.AUDIT_REJECT;
+//            MailUtils.sendHtml(
+//                user.getEmail(),
+//                template.getTitle(),
+//                MessageFormat.format(
+//                    template.getContent(),
+//                    user.getNickName(),
+//                    Arrays.stream(document.getName().split("-")).filter(e -> !e.equals("NA")).collect(Collectors.joining("-")),
+//                    projectService.queryById(document.getProjectId()).getName(),
+//                    folderService.getPathById(document.getFolderId(), document.getProjectId()),
+//                    DateUtils.formatDateTime(new Date()),
+//                    bo.getRejectReason()
+//                )
+//            );
+//        } else {
+//            MailTemplateEnum template = MailTemplateEnum.AUDIT_PASS;
+//            MailUtils.sendHtml(
+//                user.getEmail(),
+//                template.getTitle(),
+//                MessageFormat.format(
+//                    template.getContent(),
+//                    user.getNickName(),
+//                    Arrays.stream(document.getName().split("-")).filter(e -> !e.equals("NA")).collect(Collectors.joining("-")),
+//                    projectService.queryById(document.getProjectId()).getName(),
+//                    folderService.getPathById(document.getFolderId(), document.getProjectId()),
+//                    DateUtils.formatDateTime(new Date())
+//                )
+//            );
+//        }
 
         if (Objects.equals(bo.getResult(), DocumentStatusEnum.UN_ARCHIEVED.getValue())) {
             document.setPassTime(new Date());