|
@@ -7,7 +7,7 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
@Service
|
|
|
public class CheckTaskService {
|
|
|
-
|
|
|
+
|
|
|
@Autowired
|
|
|
private WxUserService wxUserService;
|
|
|
@Autowired
|
|
@@ -23,26 +23,30 @@ public class CheckTaskService {
|
|
|
@Autowired
|
|
|
private SapApprovalInfoService sapApprovalInfoService;
|
|
|
|
|
|
+ public void taskBiz() {
|
|
|
+ if (DateUtil.getHour().equals("10") || DateUtil.getHour().equals("20")) {
|
|
|
+ executeBiz(DateUtil.getDate());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public void executeBiz(String checkinDay) {
|
|
|
- if(DateUtil.getHour().equals("10") || DateUtil.getHour().equals("20")) {
|
|
|
- String startDay = checkinDay;
|
|
|
- String endDay = checkinDay;
|
|
|
- try {
|
|
|
- wxDepartService.saveDeparts();
|
|
|
- wxUserService.saveUsers();
|
|
|
- sapCheckService.saveCheckInOffOuts(startDay, endDay);
|
|
|
- // 判断打卡记录小于10条记录认为是假期
|
|
|
- if(sapCheckService.queryCheckInTotal() < 10) {
|
|
|
- return;
|
|
|
- }
|
|
|
- sapCheckdateService.saveCheckout(startDay);
|
|
|
- employeeTimeService.saveEmployeeTimes();
|
|
|
- sapCheckOptionService.saveOptions(endDay);
|
|
|
- sapApprovalInfoService.saveApprovalInfos(endDay.substring(0, 7));
|
|
|
- sapCheckService.saveReportResultData(startDay, endDay);
|
|
|
- } catch (Exception e) {
|
|
|
- LoggerUtil.error(e);
|
|
|
+ String startDay = checkinDay;
|
|
|
+ String endDay = checkinDay;
|
|
|
+ try {
|
|
|
+ wxDepartService.saveDeparts();
|
|
|
+ wxUserService.saveUsers();
|
|
|
+ sapCheckService.saveCheckInOffOuts(startDay, endDay);
|
|
|
+ // 判断打卡记录小于10条记录认为是假期
|
|
|
+ if (sapCheckService.queryCheckInTotal() < 10) {
|
|
|
+ return;
|
|
|
}
|
|
|
+ sapCheckdateService.saveCheckout(startDay);
|
|
|
+ employeeTimeService.saveEmployeeTimes();
|
|
|
+ sapCheckOptionService.saveOptions(endDay);
|
|
|
+ sapApprovalInfoService.saveApprovalInfos(endDay.substring(0, 7));
|
|
|
+ sapCheckService.saveReportResultData(startDay, endDay);
|
|
|
+ } catch (Exception e) {
|
|
|
+ LoggerUtil.error(e);
|
|
|
}
|
|
|
}
|
|
|
}
|