Commit bdf35574b869309fac8c4b9d4ab3dbd7cc57db76

Authored by chenhang4442024
1 parent 3efd19ba

Revert "feat:防止没有给生产科配置邮箱产生空指针异常"

This reverts commit 3efd19ba.
... ... @@ -55,12 +55,6 @@
55 55 <groupId>com.alibaba</groupId>
56 56 <artifactId>easyexcel</artifactId>
57 57 <version>${easyexcel.version}</version>
58   - <exclusions>
59   - <exclusion>
60   - <artifactId>asm</artifactId>
61   - <groupId>org.ow2.asm</groupId>
62   - </exclusion>
63   - </exclusions>
64 58 </dependency>
65 59  
66 60 <dependency>
... ... @@ -92,12 +86,6 @@
92 86 <artifactId>spring-boot-starter-test</artifactId>
93 87 <version>${springboot.version}</version>
94 88 <scope>test</scope>
95   - <exclusions>
96   - <exclusion>
97   - <artifactId>asm</artifactId>
98   - <groupId>org.ow2.asm</groupId>
99   - </exclusion>
100   - </exclusions>
101 89 </dependency>
102 90  
103 91 <dependency>
... ... @@ -277,12 +265,6 @@
277 265 <groupId>com.aliyun.oss</groupId>
278 266 <artifactId>aliyun-sdk-oss</artifactId>
279 267 <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>
286 268 </dependency>
287 269  
288 270 <!--thumbnailator 图片压缩工具-->
... ... @@ -298,12 +280,6 @@
298 280 <groupId>wiki.xsx</groupId>
299 281 <artifactId>x-easypdf-pdfbox</artifactId>
300 282 <version>${x-easypdf-pdfbox.version}</version>
301   - <exclusions>
302   - <exclusion>
303   - <artifactId>commons-logging</artifactId>
304   - <groupId>commons-logging</groupId>
305   - </exclusion>
306   - </exclusions>
307 283 </dependency>
308 284  
309 285 <!--email邮件配置-->
... ...
src/main/java/com/order/erp/job/OrderOverTimeEventJob.java
... ... @@ -301,7 +301,7 @@ public class OrderOverTimeEventJob {
301 301 private Boolean filterBigSampleEvent(OrderEventJobVO eventJobVO) {
302 302 String orderHodTime = eventJobVO.getBaseInfo().getOrderHodTime();
303 303 String shippmentSampleConfirmResult = eventJobVO.getTrackStageInfo().getShippmentSampleConfirmResult();
304   - String shippmentSampleConfirmTime = eventJobVO.getTrackStageInfo().getShippmentSampleConfirmTime();
  304 + String shippmentSampleConfirmTime = eventJobVO.getTrackStageInfo().getShippmentSampleSendTime();
305 305 if (StringUtils.isNotBlank(orderHodTime) && StringUtils.isNotBlank(shippmentSampleConfirmResult) && StringUtils.isNotBlank(shippmentSampleConfirmTime)) {
306 306 int daysBetween = getDaysBetween(shippmentSampleConfirmResult, shippmentSampleConfirmTime, orderHodTime);
307 307 if (daysBetween == Constant.SEVEN || daysBetween == Constant.NEGATIVE_ONE) {
... ...
src/main/java/com/order/erp/mapper/order/OrderBaseInfoMapper.java
... ... @@ -31,8 +31,7 @@ public interface OrderBaseInfoMapper extends BaseMapper&lt;OrderBaseInfoDO&gt; {
31 31  
32 32 List<QueryProjectNoAndInnerNoDto> queryProjectNoAndInnerNoDto(@Param("flag") Boolean flag,
33 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);")
35   -@Select("SELECT * FROM order_base_info WHERE 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);")
36 35 List<OrderBaseInfoDO> getEventList();
37 36 }
38 37  
... ...
src/main/java/com/order/erp/service/order/impl/OrderBaseInfoServiceImpl.java
... ... @@ -1801,23 +1801,40 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl&lt;OrderBaseInfoMapper, O
1801 1801 AdminUserDO ProductionDepartmentUserDO = userService.getOne(new LambdaQueryWrapper<AdminUserDO>()
1802 1802 .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN)
1803 1803 .eq(AdminUserDO::getUserName, orderBaseInfoDO.getProductionDepartment()));
1804   - if( Objects.nonNull(ProductionDepartmentUserDO) && StringUtils.isNotBlank(ProductionDepartmentUserDO.getEmail())){
1805   - sendOrderInspectionStage(updateVO,inspectionStageInfo);
  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);
1806 1830 }
  1831 +
1807 1832 } else {
1808 1833 inspectionStageDO = new OrderInspectionStageDO();
1809 1834 BeanUtils.copyProperties(updateVO.getInspectionStageInfo(), inspectionStageDO);
1810 1835 inspectionStageDO.setOrderId(updateVO.getOrderId());
1811 1836 inspectionStageDO.setOrderStatus(OrderStatusEnum.INSPECT_ING.getStatus());
1812 1837 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   -
1821 1838 }
1822 1839 orderBaseInfoDo.setOrderStatus(OrderStatusEnum.INSPECT_ING.getStatus());
1823 1840 optLogDO = buildOrderOptLogDo(updateVO.getOrderId(), userId, OrderOptTypeEnum.ORDER_INSPECT_EDIT_APPLY.getDesc(), JSONObject.toJSONString(updateVO));
... ... @@ -2138,36 +2155,4 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl&lt;OrderBaseInfoMapper, O
2138 2155 List<OrderBaseInfoDO> orderBaseInfoDOList = baseMapper.getEventList();
2139 2156 return orderBaseInfoDOList;
2140 2157 }
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   - }
2173 2158 }
... ...
src/main/resources/application-local.yml
... ... @@ -57,13 +57,13 @@ spring:
57 57 testWhileIdle: true
58 58 testOnBorrow: true
59 59 testOnReturn: true
60   - password: root
  60 + password: canrd@2024
61 61 time-between-eviction-runs-millis: 1000
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
  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
63 63 username: root
64 64 redis:
65 65 database: 0
66   - host: localhost
  66 + host: 39.108.227.113
67 67 lettuce:
68 68 pool:
69 69 max-active: 2000
... ... @@ -76,33 +76,21 @@ spring:
76 76 timeout: 2000
77 77 mail:
78 78 # 配置 SMTP 服务器地址
79   -# host: smtp.163.com
80 79 host: smtp.mxhichina.com
81   - # 发送者邮箱,已开通POP3/SMTP服务的邮箱,也就是你自己的
82   - username: system@canrd.com
83   - # 配置密码,注意不是真正的密码,而是刚刚申请到的授权码
84   - password: Kelude2015
85   - # 邮件接收者
86   - mailRecipient: #邮件接收者邮箱
87   - # 端口号465或587(QQ邮箱发送邮件仅支持587端口协议)
88   - port: 465
89   -
90 80 # 发送者邮箱,已开通POP3/SMTP服务的邮箱,也就是你自己的
91   -# username: chenhang4442024@163.com
  81 + username: system@canrd.com
92 82 # 配置密码,注意不是真正的密码,而是刚刚申请到的授权码
93   -# password: ACHWYJSXRITHTMGA
  83 + password: Kelude2015
94 84 # 邮件接收者
95   -# mailRecipient: #邮件接收者邮箱
  85 + mailRecipient: #邮件接收者邮箱
96 86 # 端口号465或587(QQ邮箱发送邮件仅支持587端口协议)
97   -# port: 25
  87 + port: 587
98 88 # 默认的邮件编码为UTF-8
99 89 default-encoding: UTF-8
100 90 # 配置SSL 加密工厂
101 91 properties:
102 92 mail:
103 93 smtp:
104   - ssl:
105   - enabled: true
106 94 socketFactoryClass: javax.net.ssl.SSLSocketFactory
107 95 #表示开启 DEBUG 模式,这样,邮件发送过程的日志会在控制台打印出来,方便排查错误
108 96 debug: true
... ...
src/main/resources/application-pre-prod.yml
... ... @@ -76,19 +76,15 @@ spring:
76 76 timeout: 2000
77 77 mail:
78 78 # 配置 SMTP 服务器地址
79   -# host: xxx
80   - host: smtp.163.com
  79 + host: xxx
81 80 # 发送者邮箱,已开通POP3/SMTP服务的邮箱,也就是你自己的
82   -# username: xxxx
83   - username: chenhang4442024@163.com
  81 + username: xxxx
84 82 # 配置密码,注意不是真正的密码,而是刚刚申请到的授权码
85   -# password: xxx
86   - password: ACHWYJSXRITHTMGA
  83 + password: xxx
87 84 # 邮件接收者
88 85 mailRecipient: #邮件接收者邮箱
89 86 # 端口号465或587(QQ邮箱发送邮件仅支持587端口协议)
90   -# port: 587
91   - port: 25
  87 + port: 587
92 88 # 默认的邮件编码为UTF-8
93 89 default-encoding: UTF-8
94 90 # 配置SSL 加密工厂
... ...
src/main/resources/application-test.yml
... ... @@ -76,29 +76,25 @@ spring:
76 76 timeout: 2000
77 77 mail:
78 78 # 配置 SMTP 服务器地址
79   -# host: smtp.mxhichina.com
80   - host: smtp.163.com
  79 + host: smtp.mxhichina.com
81 80 # 发送者邮箱,已开通POP3/SMTP服务的邮箱,也就是你自己的
82   - username: chenhang4442024@163.com
  81 + username: system@canrd.com
83 82 # 配置密码,注意不是真正的密码,而是刚刚申请到的授权码
84   - password: ACHWYJSXRITHTMGA
  83 + password: Kelude2015
85 84 # 邮件接收者
86 85 mailRecipient: #邮件接收者邮箱
87 86 # 端口号465或587(QQ邮箱发送邮件仅支持587端口协议)
88   - port: 465
  87 + port: 587
89 88 # 默认的邮件编码为UTF-8
90 89 default-encoding: UTF-8
91 90 # 配置SSL 加密工厂
92 91 properties:
93 92 mail:
94 93 smtp:
95   - ssl:
96   - enable: true
97 94 socketFactoryClass: javax.net.ssl.SSLSocketFactory
98 95 #表示开启 DEBUG 模式,这样,邮件发送过程的日志会在控制台打印出来,方便排查错误
99 96 debug: true
100 97  
101   -
102 98 freemarker:
103 99 template-loader-path: classpath:/template/
104 100 suffix: .flt
... ...
src/main/resources/application.yml
1 1 server:
2   - port: 18000
  2 + port: 8000
3 3  
4 4 spring:
5 5 profiles:
6   - active: test
7 6 \ No newline at end of file
  7 + active: pre-prod
8 8 \ No newline at end of file
... ...