From ec13813c6dff6a3c92f06014e56d1b68834bf0ff Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Mon, 15 Jul 2024 11:10:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/hfkj/schedule/GasSchedule.java | 27 +++++++++++++++++++ .../com/hfkj/dao/BsGasOilPriceMapperExt.java | 1 + 2 files changed, 28 insertions(+) create mode 100644 schedule/src/main/java/com/hfkj/schedule/GasSchedule.java diff --git a/schedule/src/main/java/com/hfkj/schedule/GasSchedule.java b/schedule/src/main/java/com/hfkj/schedule/GasSchedule.java new file mode 100644 index 0000000..1f032da --- /dev/null +++ b/schedule/src/main/java/com/hfkj/schedule/GasSchedule.java @@ -0,0 +1,27 @@ +package com.hfkj.schedule; + +import com.hfkj.channel.gas.newlink.NewLinkGasService; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; + + +/** + * @className: GasSchedule + * @author: HuRui + * @date: 2024/7/15 + **/ +@Component +public class GasSchedule { + @Resource + private NewLinkGasService newLinkGasService; + @Scheduled(cron = "5 0 0 * * ?") // 每日凌晨00:00:5执行一次 + public void GasSchedule() { + try { + newLinkGasService.refresh(); + } catch (Exception e) { + System.out.println("能链【团油】油站获取失败!!!"); + } + } +} diff --git a/service/src/main/java/com/hfkj/dao/BsGasOilPriceMapperExt.java b/service/src/main/java/com/hfkj/dao/BsGasOilPriceMapperExt.java index 9ef63e9..498574d 100644 --- a/service/src/main/java/com/hfkj/dao/BsGasOilPriceMapperExt.java +++ b/service/src/main/java/com/hfkj/dao/BsGasOilPriceMapperExt.java @@ -16,6 +16,7 @@ import java.util.Map; public interface BsGasOilPriceMapperExt { @Select({" select b.* from bs_merchant a, bs_gas_oil_price b " + " where a.id = b.mer_id " + + " and a.source_type = 1 " + " and a.`status` = 1 " + " and a.province_code = #{regionId} " + " and b.oil_no = #{oilNo} "})