| | |
| | | package com.ruoyi.integration.util; |
| | | |
| | | import com.ruoyi.integration.rocket.produce.ChargingMessageListener; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @date 2023/7/11 8:39 |
| | | */ |
| | | @Component |
| | | public class TaskUtil { |
| | | |
| | | @Resource |
| | | private ChargingMessageListener chargingMessageListener; |
| | | |
| | | |
| | | /** |
| | | * 5分钟执行的定时任务 |
| | | */ |
| | | @Scheduled(fixedRate = 300000) |
| | | public void taskMonth() { |
| | | chargingMessageListener.transactionRecord(); |
| | | } |
| | | |
| | | |
| | | } |
| | | //package com.ruoyi.integration.util; |
| | | // |
| | | //import com.ruoyi.integration.mongodb.service.*; |
| | | //import org.springframework.scheduling.annotation.Scheduled; |
| | | //import org.springframework.stereotype.Component; |
| | | // |
| | | //import javax.annotation.Resource; |
| | | // |
| | | ///** |
| | | // * 定时任务工具类 |
| | | // * @author zhibing.pu |
| | | // * @Date 2025/5/21 11:43 |
| | | // */ |
| | | //@Component |
| | | //public class TaskUtil { |
| | | // |
| | | // @Resource |
| | | // private AcquisitionBillingModeReplyService acquisitionBillingModeReplyService; |
| | | // |
| | | // @Resource |
| | | // private AcquisitionBillingModeService acquisitionBillingModeService; |
| | | // |
| | | // @Resource |
| | | // private BillingModeVerifyReplyService billingModeVerifyReplyService; |
| | | // |
| | | // @Resource |
| | | // private BillingModeVerifyService billingModeVerifyService; |
| | | // |
| | | // @Resource |
| | | // private BmsAbortService bmsAbortService; |
| | | // |
| | | // @Resource |
| | | // private BmsDemandAndChargerExportationService bmsDemandAndChargerExportationService; |
| | | // |
| | | // @Resource |
| | | // private BmsInformationService bmsInformationService; |
| | | // |
| | | // @Resource |
| | | // private ChargingHandshakeService chargingHandshakeService; |
| | | // |
| | | // |
| | | // /** |
| | | // * 定时任务 |
| | | // */ |
| | | // @Scheduled(cron = "0 0 9 * * ?") |
| | | // public void run(){ |
| | | // //获取当前运行的端口号 |
| | | // String port = System.getProperty("server.port"); |
| | | // if("5701".equals(port)){ |
| | | // acquisitionBillingModeReplyService.taskDelete(); |
| | | // acquisitionBillingModeService.taskDelete(); |
| | | // billingModeVerifyReplyService.taskDelete(); |
| | | // billingModeVerifyService.taskDelete(); |
| | | // bmsAbortService.taskDelete(); |
| | | // bmsDemandAndChargerExportationService.taskDelete(); |
| | | // bmsInformationService.taskDelete(); |
| | | // chargingHandshakeService.taskDelete(); |
| | | // } |
| | | // } |
| | | //} |