weaver-hrm-salary/src/com/engine/salary/timer/SyncTaxAgentEmpJob.java

46 lines
1.1 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.engine.salary.timer;
import com.engine.common.util.ServiceUtil;
import com.engine.salary.wrapper.TaxAgentWrapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.StopWatch;
import weaver.hrm.User;
import weaver.interfaces.schedule.BaseCronJob;
/**
* 自动同步人员
* <p>Copyright: Copyright (c) 2022</p>
* <p>Company: 泛微软件</p>
*
* @author qiantao
* @version 1.0
**/
@Slf4j
public class SyncTaxAgentEmpJob extends BaseCronJob {
private TaxAgentWrapper getTaxAgentWrapper(User user) {
return ServiceUtil.getService(TaxAgentWrapper.class, user);
}
@Override
public void execute() {
StopWatch stopWatch = new StopWatch();
stopWatch.start("计划任务【SyncTaxAgentEmpJob】");
start();
stopWatch.stop();
log.info(stopWatch.prettyPrint());
}
/**
* 代码执行逻辑方法
*/
private void start() {
try {
getTaxAgentWrapper(null).syncAllRange();
} catch (Exception e) {
log.error("计划任务【SyncTaxAgentEmpJob】执行异常" + e);
}
}
}