|
|
@@ -1,40 +0,0 @@
|
|
|
-package cn.start.tz.module.system.job;
|
|
|
-
|
|
|
-import cn.hutool.core.date.DatePattern;
|
|
|
-import cn.hutool.core.util.StrUtil;
|
|
|
-import cn.start.tz.framework.job.core.JobHandler;
|
|
|
-import cn.start.tz.module.system.service.clientunit.ClientUnitDataMigrationProdService;
|
|
|
-import jakarta.annotation.Resource;
|
|
|
-import lombok.extern.slf4j.Slf4j;
|
|
|
-import org.springframework.stereotype.Component;
|
|
|
-
|
|
|
-import java.time.LocalDate;
|
|
|
-
|
|
|
-/**
|
|
|
- * 任务单
|
|
|
- */
|
|
|
-@Component("clientUnitJob")
|
|
|
-@Slf4j
|
|
|
-public class ClientUnitJob implements JobHandler {
|
|
|
-
|
|
|
- @Resource
|
|
|
- private ClientUnitDataMigrationProdService clientUnitDataMigrationProdService;
|
|
|
-
|
|
|
- @Override
|
|
|
- public void execute(String jobId, String handlerParam) throws Exception {
|
|
|
- log.info("========== 开始执行每日单位信息同步 ==========");
|
|
|
- log.info("任务ID: {}, 参数: {}", jobId, handlerParam);
|
|
|
- if (StrUtil.isEmpty(handlerParam)) {
|
|
|
- handlerParam = LocalDate.now().format(DatePattern.NORM_DATE_FORMATTER);
|
|
|
- }
|
|
|
- try {
|
|
|
- // 1. 执行你的业务逻辑
|
|
|
- clientUnitDataMigrationProdService.synchronizationUnitInfoByDate(handlerParam);
|
|
|
- log.info("========== 每日 ClientUnitJob 任务执行成功 ==========");
|
|
|
- } catch (Exception e) {
|
|
|
- log.error("每日 ClientUnitJob 任务执行失败", e);
|
|
|
- throw e; // 抛出异常让 Quartz 知道任务失败
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-}
|