| | |
| | | import org.apache.commons.collections.CollectionUtils; |
| | | import org.apache.commons.lang3.time.DateFormatUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Profile; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private UserPaymentV3Service paymentV3Service; |
| | | |
| | | @Autowired |
| | | private UserPaymentSybService paymentSybService; |
| | | |
| | | @Autowired |
| | | private OrderService orderService; |
| | |
| | | |
| | | @Autowired |
| | | private FlowerCategoryPriceThread thread; |
| | | |
| | | @Autowired |
| | | private BaseService baseService; |
| | | |
| | | @Scheduled(cron = "1 1 0/2 * * ?") |
| | | public void calculateAvePrice() { |
| | |
| | | try { |
| | | LocalDateTime createdTime = o.getCreateTime().plusMinutes(5); |
| | | if (createdTime.isBefore(LocalDateTime.now())) { |
| | | /*boolean f = paymentV3Service.checkOrderStatus(o.getId()); |
| | | boolean f = paymentV3Service.checkOrderStatus(o.getId()); |
| | | if(!f){ |
| | | paymentV3Service.cancelOrder(o.getId()); |
| | | }*/ |
| | | paymentSybService.cancelOrder(o.getId()); |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | log.error(e.getMessage(), e); |
| | |
| | | } |
| | | |
| | | @Scheduled(cron = "0 15 17 * * ?") |
| | | @Profile("prod") |
| | | public void DealSendMessageInfoBySupplier() { |
| | | log.info("供应商下单供货提示开始:" + DateFormatUtils.format(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss")); |
| | | // 获取当前日期 |
| | |
| | | LocalDateTime endDateTime = LocalDateTime.of(currentDate, LocalTime.of(17, 0)); |
| | | System.out.println("开始时间: " + startDateTime); |
| | | System.out.println("结束时间: " + endDateTime); |
| | | List<String> sends = orderMapper.getWaitSendMessageInfoBySupplier("SEND", startDateTime, endDateTime); |
| | | List<String> sends = orderMapper.getWaitSendMessageInfoBySupplier("COLLECTION", startDateTime, endDateTime); |
| | | if(CollectionUtils.isNotEmpty(sends)) { |
| | | sends.forEach(s -> { |
| | | try { |
| | | SmsUtil.sendSms(s, "SMS_474500141", null); |
| | | SmsUtil.sendSms(s, "SMS_474905508", null); |
| | | } catch (ClientException e) { |
| | | log.error("发送短信失败,手机号:" + s, e); |
| | | } |