Commit 650e5163ae9eb1adadac0b345b346eb9be0ca81b
1 parent
ca292506
优化定时任务超时时间
Showing
1 changed file
with
3 additions
and
21 deletions
src/main/java/com/order/erp/job/OrderOverTimeEventJob.java
... | ... | @@ -17,23 +17,15 @@ import com.order.erp.domain.dto.order.ReceiveEmailMappingDO; |
17 | 17 | import com.order.erp.domain.vo.order.*; |
18 | 18 | import com.order.erp.service.admin.AdminUserService; |
19 | 19 | import com.order.erp.service.order.*; |
20 | -import freemarker.template.TemplateException; | |
21 | 20 | import lombok.extern.slf4j.Slf4j; |
22 | 21 | import org.springframework.scheduling.annotation.Scheduled; |
23 | 22 | import org.springframework.stereotype.Component; |
24 | - | |
25 | 23 | import javax.annotation.Resource; |
26 | -import javax.mail.MessagingException; | |
27 | -import java.io.IOException; | |
28 | 24 | import java.time.LocalDate; |
29 | -import java.time.LocalDateTime; | |
30 | -import java.time.format.DateTimeFormatter; | |
31 | 25 | import java.time.temporal.ChronoUnit; |
32 | 26 | import java.util.*; |
33 | 27 | import java.util.concurrent.TimeUnit; |
34 | 28 | import java.util.function.Function; |
35 | -import java.util.regex.Matcher; | |
36 | -import java.util.regex.Pattern; | |
37 | 29 | import java.util.stream.Collectors; |
38 | 30 | |
39 | 31 | |
... | ... | @@ -49,13 +41,6 @@ public class OrderOverTimeEventJob { |
49 | 41 | |
50 | 42 | @Resource |
51 | 43 | private OrderBaseInfoService orderBaseInfoService; |
52 | - | |
53 | - @Resource | |
54 | - private OrderProfitAnalysisService profitAnalysisService; | |
55 | - | |
56 | - @Resource | |
57 | - private OrderCompletionReportService reportService; | |
58 | - | |
59 | 44 | @Resource |
60 | 45 | private OrderTrackStageService trackStageService; |
61 | 46 | |
... | ... | @@ -63,9 +48,6 @@ public class OrderOverTimeEventJob { |
63 | 48 | private OrderInspectionStageService inspectionStageService; |
64 | 49 | |
65 | 50 | @Resource |
66 | - private TransactionHelper transactionHelper; | |
67 | - | |
68 | - @Resource | |
69 | 51 | private EmailSendUtils emailSendUtils; |
70 | 52 | |
71 | 53 | @Resource |
... | ... | @@ -82,7 +64,7 @@ public class OrderOverTimeEventJob { |
82 | 64 | */ |
83 | 65 | @Scheduled(cron = "0 0 1 * * ?") |
84 | 66 | //存储的日期都必须为yyyy-MM-dd HH:mm:ss。 |
85 | - public void checkOverTimeExecuteV2() throws MessagingException, TemplateException, IOException { | |
67 | + public void checkOverTimeExecuteV2() { | |
86 | 68 | List<OrderBaseInfoDO> orderBaseInfoDOList = orderBaseInfoService.getEventList(); |
87 | 69 | if (CollectionUtils.isNotEmpty(orderBaseInfoDOList)) { |
88 | 70 | Set<Long> orderIds = orderBaseInfoDOList.stream().map(OrderBaseInfoDO::getId).collect(Collectors.toSet()); |
... | ... | @@ -143,8 +125,8 @@ public class OrderOverTimeEventJob { |
143 | 125 | .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) |
144 | 126 | .eq(AdminUserDO::getUserName, productionDepartment)); |
145 | 127 | List<String> productionEmail = Arrays.asList(productionDepartmentUser.getEmail().split("[,,]+")) |
146 | - .stream().map(String::trim) | |
147 | - .collect(Collectors.toList()); | |
128 | + .stream().map(String::trim) | |
129 | + .collect(Collectors.toList()); | |
148 | 130 | emailSendUtils.sendEmail(EmailTemplateEnum.byTemplate(eventEnum.getTemplateId()), |
149 | 131 | productionEmail, orderEventJob); |
150 | 132 | redisUtils.set(EmailTemplateEnum.byTemplate( | ... | ... |