cloudroam
2024-11-04 7a5095c394467dacd285009ab88ccf46efcc4732
src/main/java/com/mzl/flower/schedule/ScheduleService.java
@@ -24,6 +24,7 @@
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;
@@ -48,9 +49,6 @@
    @Autowired
    private UserPaymentV3Service paymentV3Service;
    @Autowired
    private UserPaymentSybService paymentSybService;
    @Autowired
    private OrderService orderService;
@@ -81,9 +79,6 @@
    @Autowired
    private FlowerCategoryPriceThread thread;
    @Autowired
    private BaseService baseService;
    @Scheduled(cron = "1 1 0/2 * * ?")
    public void calculateAvePrice() {
@@ -124,11 +119,10 @@
                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);
@@ -263,6 +257,7 @@
    }
    @Scheduled(cron = "0 15 17 * * ?")
    @Profile("prod")
    public void DealSendMessageInfoBySupplier() {
        log.info("供应商下单供货提示开始:" + DateFormatUtils.format(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss"));
        // 获取当前日期
@@ -273,11 +268,11 @@
        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);
                }