|
|
@@ -367,6 +367,7 @@ public class SafetyCheckJobBusiness extends TaskCreatingServiceImplBase<CoreSafe
|
|
|
vo.setStartTime(plan.getStartDate());
|
|
|
vo.setCheckOrg(check);
|
|
|
vo.setExecOrg(org);
|
|
|
+ vo.setCount(i + 1);
|
|
|
vo.setPlanCycle(Math.toIntExact(plan.getPlanCycle()));
|
|
|
if (plan.getCount() == 1) {
|
|
|
vo.setPlanName(plan.getPlanName());
|
|
|
@@ -441,6 +442,7 @@ public class SafetyCheckJobBusiness extends TaskCreatingServiceImplBase<CoreSafe
|
|
|
checkTask.setCheckOrgId(taskPlan.getCheckOrg().getId());
|
|
|
checkTask.setCheckOrgName(taskPlan.getCheckOrg().getShortName());
|
|
|
checkTask.setStatus(1);
|
|
|
+ checkTask.setCount(taskPlan.getCount());
|
|
|
checkTask.setCheckType(0L);
|
|
|
checkTask.setCheckCycle(Long.valueOf(taskPlan.getPlanCycle()));
|
|
|
checkTask.setYmdDate(datetime);
|
|
|
@@ -643,9 +645,8 @@ public class SafetyCheckJobBusiness extends TaskCreatingServiceImplBase<CoreSafe
|
|
|
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public void rebuildWeeklyTask(List<Long> orgIds, Date startDate, Date endDate) {
|
|
|
- Map<Long, Boolean> workingMap = orgWorkTimeStatusMap(startDate, CycleCommonEnum.WEEKLY, orgIds);
|
|
|
+ public void rebuildTask(List<Long> orgIds, Date startDate, Date endDate, CycleCommonEnum cycle) {
|
|
|
+ Map<Long, Boolean> workingMap = orgWorkTimeStatusMap(startDate, cycle, orgIds);
|
|
|
// List<Long> deleteTaskIds = new ArrayList<>();
|
|
|
|
|
|
List<SysOrg> orgs = remoteOrgService.selectByOrgIdList(orgIds, SecurityConstants.INNER);
|
|
|
@@ -655,6 +656,7 @@ public class SafetyCheckJobBusiness extends TaskCreatingServiceImplBase<CoreSafe
|
|
|
}
|
|
|
|
|
|
Long orgId = worg.getId();
|
|
|
+ checkTaskService.deleteByOrgIdAndRange(orgId, startDate, endDate);
|
|
|
if (!workingMap.containsKey(orgId) || !workingMap.get(orgId)) {
|
|
|
//当前作息周期已经歇业,删除未进行的任务
|
|
|
checkTaskService.deleteByOrgIdAndRange(orgId, startDate, endDate);
|
|
|
@@ -745,23 +747,28 @@ public class SafetyCheckJobBusiness extends TaskCreatingServiceImplBase<CoreSafe
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void rebuildMonthTask(List<Long> orgIds, Date startDate, Date endDate) {
|
|
|
+ public void rebuildWeeklyTask(List<Long> orgIds, Date startDate, Date endDate) {
|
|
|
+ rebuildTask(orgIds, startDate, endDate, CycleCommonEnum.WEEKLY);
|
|
|
+ }
|
|
|
|
|
|
+ @Override
|
|
|
+ public void rebuildMonthTask(List<Long> orgIds, Date startDate, Date endDate) {
|
|
|
+ rebuildTask(orgIds, startDate, endDate, CycleCommonEnum.MONTHLY);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void rebuildQuarterTask(List<Long> orgIds, Date startDate, Date endDate) {
|
|
|
-
|
|
|
+ rebuildTask(orgIds, startDate, endDate, CycleCommonEnum.QUARTERLY);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void rebuildHalfYearTask(List<Long> orgIds, Date startDate, Date endDate) {
|
|
|
-
|
|
|
+ rebuildTask(orgIds, startDate, endDate, CycleCommonEnum.HALF_YEARLY);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void rebuildYearTask(List<Long> orgIds, Date startDate, Date endDate) {
|
|
|
-
|
|
|
+ rebuildTask(orgIds, startDate, endDate, CycleCommonEnum.YEARLY);
|
|
|
}
|
|
|
|
|
|
@Override
|