Commit 3efd19bae6b1dc46649afedcb9eea97c1d777005
1 parent
78eb9f1d
feat:防止没有给生产科配置邮箱产生空指针异常
Showing
8 changed files
with
106 additions
and
46 deletions
pom.xml
@@ -55,6 +55,12 @@ | @@ -55,6 +55,12 @@ | ||
55 | <groupId>com.alibaba</groupId> | 55 | <groupId>com.alibaba</groupId> |
56 | <artifactId>easyexcel</artifactId> | 56 | <artifactId>easyexcel</artifactId> |
57 | <version>${easyexcel.version}</version> | 57 | <version>${easyexcel.version}</version> |
58 | + <exclusions> | ||
59 | + <exclusion> | ||
60 | + <artifactId>asm</artifactId> | ||
61 | + <groupId>org.ow2.asm</groupId> | ||
62 | + </exclusion> | ||
63 | + </exclusions> | ||
58 | </dependency> | 64 | </dependency> |
59 | 65 | ||
60 | <dependency> | 66 | <dependency> |
@@ -86,6 +92,12 @@ | @@ -86,6 +92,12 @@ | ||
86 | <artifactId>spring-boot-starter-test</artifactId> | 92 | <artifactId>spring-boot-starter-test</artifactId> |
87 | <version>${springboot.version}</version> | 93 | <version>${springboot.version}</version> |
88 | <scope>test</scope> | 94 | <scope>test</scope> |
95 | + <exclusions> | ||
96 | + <exclusion> | ||
97 | + <artifactId>asm</artifactId> | ||
98 | + <groupId>org.ow2.asm</groupId> | ||
99 | + </exclusion> | ||
100 | + </exclusions> | ||
89 | </dependency> | 101 | </dependency> |
90 | 102 | ||
91 | <dependency> | 103 | <dependency> |
@@ -265,6 +277,12 @@ | @@ -265,6 +277,12 @@ | ||
265 | <groupId>com.aliyun.oss</groupId> | 277 | <groupId>com.aliyun.oss</groupId> |
266 | <artifactId>aliyun-sdk-oss</artifactId> | 278 | <artifactId>aliyun-sdk-oss</artifactId> |
267 | <version>${aliyun-sdk-oss.version}</version> | 279 | <version>${aliyun-sdk-oss.version}</version> |
280 | + <exclusions> | ||
281 | + <exclusion> | ||
282 | + <artifactId>aliyun-java-sdk-core</artifactId> | ||
283 | + <groupId>com.aliyun</groupId> | ||
284 | + </exclusion> | ||
285 | + </exclusions> | ||
268 | </dependency> | 286 | </dependency> |
269 | 287 | ||
270 | <!--thumbnailator 图片压缩工具--> | 288 | <!--thumbnailator 图片压缩工具--> |
@@ -280,6 +298,12 @@ | @@ -280,6 +298,12 @@ | ||
280 | <groupId>wiki.xsx</groupId> | 298 | <groupId>wiki.xsx</groupId> |
281 | <artifactId>x-easypdf-pdfbox</artifactId> | 299 | <artifactId>x-easypdf-pdfbox</artifactId> |
282 | <version>${x-easypdf-pdfbox.version}</version> | 300 | <version>${x-easypdf-pdfbox.version}</version> |
301 | + <exclusions> | ||
302 | + <exclusion> | ||
303 | + <artifactId>commons-logging</artifactId> | ||
304 | + <groupId>commons-logging</groupId> | ||
305 | + </exclusion> | ||
306 | + </exclusions> | ||
283 | </dependency> | 307 | </dependency> |
284 | 308 | ||
285 | <!--email邮件配置--> | 309 | <!--email邮件配置--> |
src/main/java/com/order/erp/job/OrderOverTimeEventJob.java
@@ -301,7 +301,7 @@ public class OrderOverTimeEventJob { | @@ -301,7 +301,7 @@ public class OrderOverTimeEventJob { | ||
301 | private Boolean filterBigSampleEvent(OrderEventJobVO eventJobVO) { | 301 | private Boolean filterBigSampleEvent(OrderEventJobVO eventJobVO) { |
302 | String orderHodTime = eventJobVO.getBaseInfo().getOrderHodTime(); | 302 | String orderHodTime = eventJobVO.getBaseInfo().getOrderHodTime(); |
303 | String shippmentSampleConfirmResult = eventJobVO.getTrackStageInfo().getShippmentSampleConfirmResult(); | 303 | String shippmentSampleConfirmResult = eventJobVO.getTrackStageInfo().getShippmentSampleConfirmResult(); |
304 | - String shippmentSampleConfirmTime = eventJobVO.getTrackStageInfo().getShippmentSampleSendTime(); | 304 | + String shippmentSampleConfirmTime = eventJobVO.getTrackStageInfo().getShippmentSampleConfirmTime(); |
305 | if (StringUtils.isNotBlank(orderHodTime) && StringUtils.isNotBlank(shippmentSampleConfirmResult) && StringUtils.isNotBlank(shippmentSampleConfirmTime)) { | 305 | if (StringUtils.isNotBlank(orderHodTime) && StringUtils.isNotBlank(shippmentSampleConfirmResult) && StringUtils.isNotBlank(shippmentSampleConfirmTime)) { |
306 | int daysBetween = getDaysBetween(shippmentSampleConfirmResult, shippmentSampleConfirmTime, orderHodTime); | 306 | int daysBetween = getDaysBetween(shippmentSampleConfirmResult, shippmentSampleConfirmTime, orderHodTime); |
307 | if (daysBetween == Constant.SEVEN || daysBetween == Constant.NEGATIVE_ONE) { | 307 | if (daysBetween == Constant.SEVEN || daysBetween == Constant.NEGATIVE_ONE) { |
src/main/java/com/order/erp/mapper/order/OrderBaseInfoMapper.java
@@ -31,7 +31,8 @@ public interface OrderBaseInfoMapper extends BaseMapper<OrderBaseInfoDO> { | @@ -31,7 +31,8 @@ public interface OrderBaseInfoMapper extends BaseMapper<OrderBaseInfoDO> { | ||
31 | 31 | ||
32 | List<QueryProjectNoAndInnerNoDto> queryProjectNoAndInnerNoDto(@Param("flag") Boolean flag, | 32 | List<QueryProjectNoAndInnerNoDto> queryProjectNoAndInnerNoDto(@Param("flag") Boolean flag, |
33 | @Param("dto") QueryProjectNoAndInnerNoDto dto); | 33 | @Param("dto") QueryProjectNoAndInnerNoDto dto); |
34 | - @Select("SELECT * FROM order_base_info WHERE order_status!=50 and enable_flag=10 and DATE_SUB(CURDATE(), INTERVAL 3 MONTH) <= date(create_time);") | 34 | +// @Select("SELECT * FROM order_base_info WHERE order_status!=50 and enable_flag=10 and DATE_SUB(CURDATE(), INTERVAL 3 MONTH) <= date(create_time);") |
35 | +@Select("SELECT * FROM order_base_info WHERE enable_flag=10 and DATE_SUB(CURDATE(), INTERVAL 3 MONTH) <= date(create_time);") | ||
35 | List<OrderBaseInfoDO> getEventList(); | 36 | List<OrderBaseInfoDO> getEventList(); |
36 | } | 37 | } |
37 | 38 |
src/main/java/com/order/erp/service/order/impl/OrderBaseInfoServiceImpl.java
@@ -1801,40 +1801,23 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O | @@ -1801,40 +1801,23 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O | ||
1801 | AdminUserDO ProductionDepartmentUserDO = userService.getOne(new LambdaQueryWrapper<AdminUserDO>() | 1801 | AdminUserDO ProductionDepartmentUserDO = userService.getOne(new LambdaQueryWrapper<AdminUserDO>() |
1802 | .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | 1802 | .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) |
1803 | .eq(AdminUserDO::getUserName, orderBaseInfoDO.getProductionDepartment())); | 1803 | .eq(AdminUserDO::getUserName, orderBaseInfoDO.getProductionDepartment())); |
1804 | - OrderEventJobVO orderEventJobVO = new OrderEventJobVO(); | ||
1805 | - orderEventJobVO.setInspectionStageInfo(inspectionStageInfo); | ||
1806 | - OrderBaseInfoVO orderBaseInfoVo = BeanUtil.copyProperties(orderBaseInfoDo, OrderBaseInfoVO.class); | ||
1807 | - orderEventJobVO.setBaseInfo(orderBaseInfoVo); | ||
1808 | - List<String> emails = Arrays.asList(ProductionDepartmentUserDO.getEmail().split( "[,,]+")) | ||
1809 | - .stream().map(String::trim) | ||
1810 | - .collect(Collectors.toList()); | ||
1811 | - //一旦修改完质检信息就自动发送邮件对应的生产科。多次编辑保存多次发送。 | ||
1812 | - if (StringUtils.isNotBlank(inspectionStageInfo.getEndCheckApplyTime())) { | ||
1813 | - String EndCheckApplyTime= inspectionStageInfo.getEndCheckApplyTime().substring(0, 10); | ||
1814 | - String ProductionDepartmentConsignTime =orderBaseInfoDo.getProductionDepartmentConsignTime().substring(0, 10); | ||
1815 | - String EndCheckApply = DateUtils.format(DateUtils.parseDate(EndCheckApplyTime, DATE), DATE); | ||
1816 | - String ProductionDepartmentConsign = DateUtils.format(DateUtils.parseDate(ProductionDepartmentConsignTime,DATE), DATE); | ||
1817 | - orderEventJobVO.getInspectionStageInfo().setEndCheckApplyTime(EndCheckApply); | ||
1818 | - orderEventJobVO.getBaseInfo().setProductionDepartmentConsignTime(ProductionDepartmentConsign); | ||
1819 | - //尾期验货报告。 | ||
1820 | - emailSendUtils.sendEmail(EmailTemplateEnum.END_CHECK_REPORT_TEMPLATE, emails, orderEventJobVO); | ||
1821 | - }else if(StringUtils.isNotBlank(inspectionStageInfo.getMidCheckApplyTime())){ | ||
1822 | - String MidCheckApplyTime= inspectionStageInfo.getMidCheckApplyTime().substring(0, 10); | ||
1823 | - String ProductionDepartmentConsignTime =orderBaseInfoDo.getProductionDepartmentConsignTime().substring(0, 10); | ||
1824 | - String MidCheckApply = DateUtils.format(DateUtils.parseDate(MidCheckApplyTime, DATE), DATE); | ||
1825 | - String ProductionDepartmentConsign = DateUtils.format(DateUtils.parseDate(ProductionDepartmentConsignTime,DATE), DATE); | ||
1826 | - orderEventJobVO.getInspectionStageInfo().setMidCheckApplyTime(MidCheckApply); | ||
1827 | - orderEventJobVO.getBaseInfo().setProductionDepartmentConsignTime(ProductionDepartmentConsign); | ||
1828 | - //中期验货报告。 | ||
1829 | - emailSendUtils.sendEmail(EmailTemplateEnum.MID_CHECK_REPORT_TEMPLATE, emails, orderEventJobVO); | 1804 | + if( Objects.nonNull(ProductionDepartmentUserDO) && StringUtils.isNotBlank(ProductionDepartmentUserDO.getEmail())){ |
1805 | + sendOrderInspectionStage(updateVO,inspectionStageInfo); | ||
1830 | } | 1806 | } |
1831 | - | ||
1832 | } else { | 1807 | } else { |
1833 | inspectionStageDO = new OrderInspectionStageDO(); | 1808 | inspectionStageDO = new OrderInspectionStageDO(); |
1834 | BeanUtils.copyProperties(updateVO.getInspectionStageInfo(), inspectionStageDO); | 1809 | BeanUtils.copyProperties(updateVO.getInspectionStageInfo(), inspectionStageDO); |
1835 | inspectionStageDO.setOrderId(updateVO.getOrderId()); | 1810 | inspectionStageDO.setOrderId(updateVO.getOrderId()); |
1836 | inspectionStageDO.setOrderStatus(OrderStatusEnum.INSPECT_ING.getStatus()); | 1811 | inspectionStageDO.setOrderStatus(OrderStatusEnum.INSPECT_ING.getStatus()); |
1837 | inspectionStageService.save(inspectionStageDO); | 1812 | inspectionStageService.save(inspectionStageDO); |
1813 | + OrderBaseInfoDO orderBaseInfoDO = baseInfoService.getById(updateVO.getOrderId()); | ||
1814 | + AdminUserDO ProductionDepartmentUserDO = userService.getOne(new LambdaQueryWrapper<AdminUserDO>() | ||
1815 | + .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | ||
1816 | + .eq(AdminUserDO::getUserName, orderBaseInfoDO.getProductionDepartment())); | ||
1817 | + if( Objects.nonNull(ProductionDepartmentUserDO) && StringUtils.isNotBlank(ProductionDepartmentUserDO.getEmail())){ | ||
1818 | + sendOrderInspectionStage(updateVO,inspectionStageInfo); | ||
1819 | + } | ||
1820 | + | ||
1838 | } | 1821 | } |
1839 | orderBaseInfoDo.setOrderStatus(OrderStatusEnum.INSPECT_ING.getStatus()); | 1822 | orderBaseInfoDo.setOrderStatus(OrderStatusEnum.INSPECT_ING.getStatus()); |
1840 | optLogDO = buildOrderOptLogDo(updateVO.getOrderId(), userId, OrderOptTypeEnum.ORDER_INSPECT_EDIT_APPLY.getDesc(), JSONObject.toJSONString(updateVO)); | 1823 | optLogDO = buildOrderOptLogDo(updateVO.getOrderId(), userId, OrderOptTypeEnum.ORDER_INSPECT_EDIT_APPLY.getDesc(), JSONObject.toJSONString(updateVO)); |
@@ -2155,4 +2138,36 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O | @@ -2155,4 +2138,36 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O | ||
2155 | List<OrderBaseInfoDO> orderBaseInfoDOList = baseMapper.getEventList(); | 2138 | List<OrderBaseInfoDO> orderBaseInfoDOList = baseMapper.getEventList(); |
2156 | return orderBaseInfoDOList; | 2139 | return orderBaseInfoDOList; |
2157 | } | 2140 | } |
2141 | + | ||
2142 | + private void sendOrderInspectionStage(OrderUpdateVO updateVO, OrderInspectionStageVO inspectionStageInfo){ | ||
2143 | + OrderBaseInfoDO orderBaseInfoDO = baseInfoService.getById(updateVO.getOrderId()); | ||
2144 | + AdminUserDO ProductionDepartmentUserDO = userService.getOne(new LambdaQueryWrapper<AdminUserDO>() | ||
2145 | + .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | ||
2146 | + .eq(AdminUserDO::getUserName, orderBaseInfoDO.getProductionDepartment())); | ||
2147 | + OrderEventJobVO orderEventJobVO = new OrderEventJobVO(); | ||
2148 | + orderEventJobVO.setInspectionStageInfo(inspectionStageInfo); | ||
2149 | + OrderBaseInfoVO orderBaseInfoVo = BeanUtil.copyProperties(orderBaseInfoDO, OrderBaseInfoVO.class); | ||
2150 | + orderEventJobVO.setBaseInfo(orderBaseInfoVo); | ||
2151 | + List<String> emails = Arrays.asList(ProductionDepartmentUserDO.getEmail().split( "[,,]+")) | ||
2152 | + .stream().map(String::trim) | ||
2153 | + .collect(Collectors.toList()); | ||
2154 | + //一旦修改完质检信息就自动发送邮件对应的生产科。多次编辑保存多次发送。 | ||
2155 | + if (StringUtils.isNotBlank(inspectionStageInfo.getEndCheckApplyTime())) { | ||
2156 | + String EndCheckApplyTime= inspectionStageInfo.getEndCheckApplyTime().substring(0, 10); | ||
2157 | + String ProductionDepartmentConsignTime =orderBaseInfoDO.getProductionDepartmentConsignTime().substring(0, 10); | ||
2158 | + orderEventJobVO.getInspectionStageInfo().setEndCheckApplyTime(EndCheckApplyTime); | ||
2159 | + orderEventJobVO.getBaseInfo().setProductionDepartmentConsignTime(ProductionDepartmentConsignTime); | ||
2160 | + //尾期验货报告。 | ||
2161 | + emailSendUtils.sendEmail(EmailTemplateEnum.END_CHECK_REPORT_TEMPLATE, emails, orderEventJobVO); | ||
2162 | + }else if(StringUtils.isNotBlank(inspectionStageInfo.getMidCheckApplyTime())){ | ||
2163 | + String MidCheckApplyTime= inspectionStageInfo.getMidCheckApplyTime().substring(0, 10); | ||
2164 | + String ProductionDepartmentConsignTime =orderBaseInfoDO.getProductionDepartmentConsignTime().substring(0, 10); | ||
2165 | + String MidCheckApply = DateUtils.format(DateUtils.parseDate(MidCheckApplyTime, DATE), DATE); | ||
2166 | + String ProductionDepartmentConsign = DateUtils.format(DateUtils.parseDate(ProductionDepartmentConsignTime,DATE), DATE); | ||
2167 | + orderEventJobVO.getInspectionStageInfo().setMidCheckApplyTime(MidCheckApply); | ||
2168 | + orderEventJobVO.getBaseInfo().setProductionDepartmentConsignTime(ProductionDepartmentConsign); | ||
2169 | + //中期验货报告。 | ||
2170 | + emailSendUtils.sendEmail(EmailTemplateEnum.MID_CHECK_REPORT_TEMPLATE, emails, orderEventJobVO); | ||
2171 | + } | ||
2172 | + } | ||
2158 | } | 2173 | } |
src/main/resources/application-local.yml
@@ -57,13 +57,13 @@ spring: | @@ -57,13 +57,13 @@ spring: | ||
57 | testWhileIdle: true | 57 | testWhileIdle: true |
58 | testOnBorrow: true | 58 | testOnBorrow: true |
59 | testOnReturn: true | 59 | testOnReturn: true |
60 | - password: canrd@2024 | 60 | + password: root |
61 | time-between-eviction-runs-millis: 1000 | 61 | time-between-eviction-runs-millis: 1000 |
62 | - url: jdbc:mysql://39.108.227.113:3307/order-erp1?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&useSSL=false&autoReconnect=true&failOverReadOnly=false&maxReconnects=10&allowMultiQueries=true&useAffectedRows=true&autoReconnectForPools=true | 62 | + url: jdbc:mysql://localhost:3306/order-erp1?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&useSSL=false&autoReconnect=true&failOverReadOnly=false&maxReconnects=10&allowMultiQueries=true&useAffectedRows=true&autoReconnectForPools=true |
63 | username: root | 63 | username: root |
64 | redis: | 64 | redis: |
65 | database: 0 | 65 | database: 0 |
66 | - host: 39.108.227.113 | 66 | + host: localhost |
67 | lettuce: | 67 | lettuce: |
68 | pool: | 68 | pool: |
69 | max-active: 2000 | 69 | max-active: 2000 |
@@ -76,21 +76,33 @@ spring: | @@ -76,21 +76,33 @@ spring: | ||
76 | timeout: 2000 | 76 | timeout: 2000 |
77 | mail: | 77 | mail: |
78 | # 配置 SMTP 服务器地址 | 78 | # 配置 SMTP 服务器地址 |
79 | +# host: smtp.163.com | ||
79 | host: smtp.mxhichina.com | 80 | host: smtp.mxhichina.com |
80 | - # 发送者邮箱,已开通POP3/SMTP服务的邮箱,也就是你自己的 | 81 | + # 发送者邮箱,已开通POP3/SMTP服务的邮箱,也就是你自己的 |
81 | username: system@canrd.com | 82 | username: system@canrd.com |
82 | - # 配置密码,注意不是真正的密码,而是刚刚申请到的授权码 | 83 | + # 配置密码,注意不是真正的密码,而是刚刚申请到的授权码 |
83 | password: Kelude2015 | 84 | password: Kelude2015 |
84 | - # 邮件接收者 | 85 | + # 邮件接收者 |
85 | mailRecipient: #邮件接收者邮箱 | 86 | mailRecipient: #邮件接收者邮箱 |
87 | + # 端口号465或587(QQ邮箱发送邮件仅支持587端口协议) | ||
88 | + port: 465 | ||
89 | + | ||
90 | + # 发送者邮箱,已开通POP3/SMTP服务的邮箱,也就是你自己的 | ||
91 | +# username: chenhang4442024@163.com | ||
92 | + # 配置密码,注意不是真正的密码,而是刚刚申请到的授权码 | ||
93 | +# password: ACHWYJSXRITHTMGA | ||
94 | + # 邮件接收者 | ||
95 | +# mailRecipient: #邮件接收者邮箱 | ||
86 | # 端口号465或587(QQ邮箱发送邮件仅支持587端口协议) | 96 | # 端口号465或587(QQ邮箱发送邮件仅支持587端口协议) |
87 | - port: 587 | 97 | +# port: 25 |
88 | # 默认的邮件编码为UTF-8 | 98 | # 默认的邮件编码为UTF-8 |
89 | default-encoding: UTF-8 | 99 | default-encoding: UTF-8 |
90 | # 配置SSL 加密工厂 | 100 | # 配置SSL 加密工厂 |
91 | properties: | 101 | properties: |
92 | mail: | 102 | mail: |
93 | smtp: | 103 | smtp: |
104 | + ssl: | ||
105 | + enabled: true | ||
94 | socketFactoryClass: javax.net.ssl.SSLSocketFactory | 106 | socketFactoryClass: javax.net.ssl.SSLSocketFactory |
95 | #表示开启 DEBUG 模式,这样,邮件发送过程的日志会在控制台打印出来,方便排查错误 | 107 | #表示开启 DEBUG 模式,这样,邮件发送过程的日志会在控制台打印出来,方便排查错误 |
96 | debug: true | 108 | debug: true |
src/main/resources/application-pre-prod.yml
@@ -76,15 +76,19 @@ spring: | @@ -76,15 +76,19 @@ spring: | ||
76 | timeout: 2000 | 76 | timeout: 2000 |
77 | mail: | 77 | mail: |
78 | # 配置 SMTP 服务器地址 | 78 | # 配置 SMTP 服务器地址 |
79 | - host: xxx | 79 | +# host: xxx |
80 | + host: smtp.163.com | ||
80 | # 发送者邮箱,已开通POP3/SMTP服务的邮箱,也就是你自己的 | 81 | # 发送者邮箱,已开通POP3/SMTP服务的邮箱,也就是你自己的 |
81 | - username: xxxx | 82 | +# username: xxxx |
83 | + username: chenhang4442024@163.com | ||
82 | # 配置密码,注意不是真正的密码,而是刚刚申请到的授权码 | 84 | # 配置密码,注意不是真正的密码,而是刚刚申请到的授权码 |
83 | - password: xxx | 85 | +# password: xxx |
86 | + password: ACHWYJSXRITHTMGA | ||
84 | # 邮件接收者 | 87 | # 邮件接收者 |
85 | mailRecipient: #邮件接收者邮箱 | 88 | mailRecipient: #邮件接收者邮箱 |
86 | # 端口号465或587(QQ邮箱发送邮件仅支持587端口协议) | 89 | # 端口号465或587(QQ邮箱发送邮件仅支持587端口协议) |
87 | - port: 587 | 90 | +# port: 587 |
91 | + port: 25 | ||
88 | # 默认的邮件编码为UTF-8 | 92 | # 默认的邮件编码为UTF-8 |
89 | default-encoding: UTF-8 | 93 | default-encoding: UTF-8 |
90 | # 配置SSL 加密工厂 | 94 | # 配置SSL 加密工厂 |
src/main/resources/application-test.yml
@@ -76,25 +76,29 @@ spring: | @@ -76,25 +76,29 @@ spring: | ||
76 | timeout: 2000 | 76 | timeout: 2000 |
77 | mail: | 77 | mail: |
78 | # 配置 SMTP 服务器地址 | 78 | # 配置 SMTP 服务器地址 |
79 | - host: smtp.mxhichina.com | 79 | +# host: smtp.mxhichina.com |
80 | + host: smtp.163.com | ||
80 | # 发送者邮箱,已开通POP3/SMTP服务的邮箱,也就是你自己的 | 81 | # 发送者邮箱,已开通POP3/SMTP服务的邮箱,也就是你自己的 |
81 | - username: system@canrd.com | 82 | + username: chenhang4442024@163.com |
82 | # 配置密码,注意不是真正的密码,而是刚刚申请到的授权码 | 83 | # 配置密码,注意不是真正的密码,而是刚刚申请到的授权码 |
83 | - password: Kelude2015 | 84 | + password: ACHWYJSXRITHTMGA |
84 | # 邮件接收者 | 85 | # 邮件接收者 |
85 | mailRecipient: #邮件接收者邮箱 | 86 | mailRecipient: #邮件接收者邮箱 |
86 | # 端口号465或587(QQ邮箱发送邮件仅支持587端口协议) | 87 | # 端口号465或587(QQ邮箱发送邮件仅支持587端口协议) |
87 | - port: 587 | 88 | + port: 465 |
88 | # 默认的邮件编码为UTF-8 | 89 | # 默认的邮件编码为UTF-8 |
89 | default-encoding: UTF-8 | 90 | default-encoding: UTF-8 |
90 | # 配置SSL 加密工厂 | 91 | # 配置SSL 加密工厂 |
91 | properties: | 92 | properties: |
92 | mail: | 93 | mail: |
93 | smtp: | 94 | smtp: |
95 | + ssl: | ||
96 | + enable: true | ||
94 | socketFactoryClass: javax.net.ssl.SSLSocketFactory | 97 | socketFactoryClass: javax.net.ssl.SSLSocketFactory |
95 | #表示开启 DEBUG 模式,这样,邮件发送过程的日志会在控制台打印出来,方便排查错误 | 98 | #表示开启 DEBUG 模式,这样,邮件发送过程的日志会在控制台打印出来,方便排查错误 |
96 | debug: true | 99 | debug: true |
97 | 100 | ||
101 | + | ||
98 | freemarker: | 102 | freemarker: |
99 | template-loader-path: classpath:/template/ | 103 | template-loader-path: classpath:/template/ |
100 | suffix: .flt | 104 | suffix: .flt |
src/main/resources/application.yml
-
mentioned in commit bdf35574