feat: 广州市一基础数据同步
parent
79ef689b6e
commit
42e89000b5
@ -0,0 +1,41 @@
|
|||||||
|
package com.docus.demo.job;
|
||||||
|
|
||||||
|
import com.docus.demo.dto.SyncBasicDataDto;
|
||||||
|
import com.docus.demo.facade.ISyncBasicDataService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.temporal.TemporalAdjusters;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author YongBin Wen
|
||||||
|
* @date 2025/4/23 0023 17:13
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@Slf4j
|
||||||
|
public class GzFirstHospBasicSyncJob {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISyncBasicDataService syncBasicDataService;
|
||||||
|
|
||||||
|
@Scheduled(cron = "0 0 0/12 * * ?")
|
||||||
|
public void syncOneMonthData() {
|
||||||
|
LocalDate today = LocalDate.now();
|
||||||
|
LocalDate firstDayOfLastMonth = today.minusMonths(1).with(TemporalAdjusters.firstDayOfMonth());
|
||||||
|
SyncBasicDataDto dto = new SyncBasicDataDto();
|
||||||
|
dto.setStartDate(firstDayOfLastMonth.toString());
|
||||||
|
dto.setEndDate(today.toString());
|
||||||
|
dto.setLimit(1000);
|
||||||
|
log.info("广州市第一人民医院,同步省厅基础数据,日期:{} —— {}", firstDayOfLastMonth, today);
|
||||||
|
try {
|
||||||
|
syncBasicDataService.syncBasicData(dto);
|
||||||
|
log.info("广州市第一人民医院,同步省厅基础数据,日期:" + firstDayOfLastMonth + "—— " + today + ",同步完成!");
|
||||||
|
} catch (Exception ex) {
|
||||||
|
log.info("广州市第一人民医院,同步省厅基础数据,日期:" + firstDayOfLastMonth + "—— " + today + ",出现异常:" + ex.getMessage(), ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue