2024-08-28 17:42:16 +08:00
|
|
|
package com.engine.salary.timer;
|
|
|
|
|
|
|
|
|
|
import com.engine.common.util.ServiceUtil;
|
|
|
|
|
import com.engine.salary.entity.ly.param.LySalaryReportQueryParam;
|
2024-10-21 18:02:04 +08:00
|
|
|
import com.engine.salary.service.LyFundReportService;
|
2024-08-28 17:42:16 +08:00
|
|
|
import com.engine.salary.service.LySalaryReportService;
|
|
|
|
|
import com.engine.salary.service.LySocialReportService;
|
2024-10-21 18:02:04 +08:00
|
|
|
import com.engine.salary.service.impl.LyFundReportServiceImpl;
|
2024-08-28 17:42:16 +08:00
|
|
|
import com.engine.salary.service.impl.LySalaryReportServiceImpl;
|
|
|
|
|
import com.engine.salary.service.impl.LySocialReportServiceImpl;
|
|
|
|
|
import com.engine.salary.util.SalaryDateUtil;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import weaver.hrm.User;
|
|
|
|
|
import weaver.interfaces.schedule.BaseCronJob;
|
|
|
|
|
|
|
|
|
|
import java.time.LocalDate;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 领悦 生成报表数据定时任务
|
|
|
|
|
*/
|
|
|
|
|
@Slf4j
|
|
|
|
|
public class LySalaryVoucherReportJob extends BaseCronJob {
|
|
|
|
|
|
|
|
|
|
private LySalaryReportService getlLySalaryReportService(User user) {
|
|
|
|
|
return ServiceUtil.getService(LySalaryReportServiceImpl.class, user);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private LySocialReportService getlLySocialReportService(User user) {
|
|
|
|
|
return ServiceUtil.getService(LySocialReportServiceImpl.class, user);
|
|
|
|
|
}
|
|
|
|
|
|
2024-10-21 18:02:04 +08:00
|
|
|
private LyFundReportService getLyFundReportService(User user) {
|
|
|
|
|
return ServiceUtil.getService(LyFundReportServiceImpl.class, user);
|
|
|
|
|
}
|
|
|
|
|
|
2024-08-28 17:42:16 +08:00
|
|
|
private String salaryAddMonth;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void execute() {
|
|
|
|
|
User user = new User();
|
|
|
|
|
user.setUid(1);
|
|
|
|
|
LocalDate localDate = SalaryDateUtil.dateToLocalDate(new Date());
|
|
|
|
|
if(StringUtils.isNotBlank(salaryAddMonth)){
|
|
|
|
|
localDate = localDate.plusMonths(Integer.valueOf(salaryAddMonth.trim()));
|
|
|
|
|
}
|
|
|
|
|
String formatYearMonth = SalaryDateUtil.getFormatYearMonth(localDate);
|
|
|
|
|
LySalaryReportQueryParam param = LySalaryReportQueryParam.builder().salaryMonth(formatYearMonth).build();
|
|
|
|
|
getlLySalaryReportService(user).generateSalaryReport(param);
|
|
|
|
|
getlLySocialReportService(user).generateSocialReport(param);
|
2024-10-21 18:02:04 +08:00
|
|
|
getLyFundReportService(user).generateFundReport(param);
|
2024-08-28 17:42:16 +08:00
|
|
|
}
|
|
|
|
|
}
|