|
@@ -1,5 +1,7 @@
|
|
|
package com.jpsoft.shinestar.scheduled;
|
|
|
|
|
|
+import com.jpsoft.shinestar.modules.base.entity.CompanyInfo;
|
|
|
+import com.jpsoft.shinestar.modules.base.service.CompanyInfoService;
|
|
|
import com.jpsoft.shinestar.modules.base.service.WorkOverPersonService;
|
|
|
import com.jpsoft.shinestar.modules.base.service.WorkShiftCompanyService;
|
|
|
import com.jpsoft.shinestar.modules.business.service.WorkScheduleAttendanceService;
|
|
@@ -24,13 +26,18 @@ public class WorkScheduleTask {
|
|
|
@Autowired
|
|
|
private WorkOverPersonService workOverPersonService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private CompanyInfoService companyInfoService;
|
|
|
+
|
|
|
/**
|
|
|
* 每天5,18点统计昨天的考勤情况
|
|
|
*/
|
|
|
@Scheduled(cron = "0 0 5,18 * * ?")
|
|
|
public void run() {
|
|
|
//查询出关联了班次考勤的单位
|
|
|
- List<String> companyList = workShiftCompanyService.findDistinctCompanyId();
|
|
|
+
|
|
|
+ //List<String> companyList = workShiftCompanyService.findDistinctCompanyId();
|
|
|
+ List<CompanyInfo> companyList = companyInfoService.list();
|
|
|
|
|
|
DateTime prevTime = DateTime.now().minusDays(1).withTimeAtStartOfDay();
|
|
|
String prevDay = prevTime.toString("yyyy-MM-dd");
|
|
@@ -39,9 +46,9 @@ public class WorkScheduleTask {
|
|
|
int affectCount = workOverPersonService.updateFinishTime(prevDay);
|
|
|
log.warn("更新{}加班结束时间共{}条", prevDay, affectCount);
|
|
|
|
|
|
- for (String companyId : companyList) {
|
|
|
+ for (CompanyInfo companyInfo : companyList) {
|
|
|
//查询前天考勤情况
|
|
|
- workScheduleAttendanceService.batchUpdate(companyId,null,null,null,
|
|
|
+ workScheduleAttendanceService.batchUpdate(companyInfo.getId(),null,null,null,
|
|
|
prevTime.toDate(),prevTime.plusDays(1).toDate(),false);
|
|
|
}
|
|
|
}
|