提交代码

master
胡锐 4 months ago
parent fbd4fa3931
commit ec13813c6d
  1. 27
      schedule/src/main/java/com/hfkj/schedule/GasSchedule.java
  2. 1
      service/src/main/java/com/hfkj/dao/BsGasOilPriceMapperExt.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("能链【团油】油站获取失败!!!");
}
}
}

@ -16,6 +16,7 @@ import java.util.Map;
public interface BsGasOilPriceMapperExt { public interface BsGasOilPriceMapperExt {
@Select({" select b.* from bs_merchant a, bs_gas_oil_price b " + @Select({" select b.* from bs_merchant a, bs_gas_oil_price b " +
" where a.id = b.mer_id " + " where a.id = b.mer_id " +
" and a.source_type = 1 " +
" and a.`status` = 1 " + " and a.`status` = 1 " +
" and a.province_code = #{regionId} " + " and a.province_code = #{regionId} " +
" and b.oil_no = #{oilNo} "}) " and b.oil_no = #{oilNo} "})

Loading…
Cancel
Save