From d3e9ae0b5f000e52bd54962644be8e9feec0df4a Mon Sep 17 00:00:00 2001 From: zhaowenxuan <chacca165@163.com> Date: 星期四, 19 十二月 2024 18:04:42 +0800 Subject: [PATCH] 20241219 --- src/main/java/com/example/scheudleds/DictSync.java | 22 ++++++++++++++++------ 1 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/example/scheudleds/DictSync.java b/src/main/java/com/example/scheudleds/DictSync.java index 8666ce9..a66ba58 100644 --- a/src/main/java/com/example/scheudleds/DictSync.java +++ b/src/main/java/com/example/scheudleds/DictSync.java @@ -1,6 +1,9 @@ package com.example.scheudleds; +import cn.hutool.core.util.StrUtil; +import com.example.config.ConfigValue; import com.example.utils.DictionaryUtil; +import com.example.utils.DictionaryUtilNew; import lombok.extern.slf4j.Slf4j; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -18,23 +21,30 @@ public class DictSync { @Autowired private DictionaryUtil dictionaryUtil; + @Autowired + private DictionaryUtilNew dictionaryUtilNew; + @Autowired + private ConfigValue configValue; /** * 瀛楀吀鍚屾 */ @Scheduled(cron = "0 0 22 * * ? ") public void execDict(){ + String open = configValue.getConfigValue("sjpt_open"); + if (StrUtil.isNotBlank(open) && open.equals("false")) return; FileWriter fileWriter = null; try { fileWriter = new FileWriter("src/main/resources/log.log"); fileWriter.write(""); fileWriter.close(); } catch (IOException ignored) {} - try { - dictionaryUtil.exec1(); - } catch (IOException e) { - log.error("瀹氭椂浠诲姟寮傚父"); - e.printStackTrace(); - } +// try { +// dictionaryUtil.exec1(); +// } catch (IOException e) { +// log.error("瀹氭椂浠诲姟寮傚父"); +// e.printStackTrace(); +// } + dictionaryUtilNew.exec1(); } } -- Gitblit v1.8.0