|
|
|
@ -1,18 +1,45 @@
|
|
|
|
|
package com.hnac.hzims.scheduled.service.inspect.impl; |
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
|
import com.baomidou.dynamic.datasource.annotation.DS; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
|
import com.google.common.collect.Lists; |
|
|
|
|
import com.hnac.hzims.operational.duty.vo.ImsDutyMainFeignVO; |
|
|
|
|
import com.hnac.hzims.scheduled.mapper.inspect.TaskMapper; |
|
|
|
|
import com.hnac.hzims.scheduled.service.inspect.TaskService; |
|
|
|
|
import com.hnac.hzinfo.inspect.task.entity.TaskEntity; |
|
|
|
|
import com.hnac.hzims.scheduled.service.inspect.*; |
|
|
|
|
import com.hnac.hzims.scheduled.service.operation.DutyMainService; |
|
|
|
|
import com.hnac.hzinfo.inspect.obj.entity.*; |
|
|
|
|
import com.hnac.hzinfo.inspect.plan.PlanContants; |
|
|
|
|
import com.hnac.hzinfo.inspect.plan.entity.*; |
|
|
|
|
import com.hnac.hzinfo.inspect.task.TaskContants; |
|
|
|
|
import com.hnac.hzinfo.inspect.task.entity.*; |
|
|
|
|
import com.hnac.hzinfo.inspect.task.vo.DutyInspectTaskVO; |
|
|
|
|
import com.xxl.job.core.log.XxlJobLogger; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
|
import org.springblade.core.log.exception.ServiceException; |
|
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl; |
|
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
|
import org.springblade.core.tool.utils.CollectionUtil; |
|
|
|
|
import org.springblade.core.tool.utils.DateUtil; |
|
|
|
|
import org.springblade.core.tool.utils.Func; |
|
|
|
|
import org.springblade.core.tool.utils.ObjectUtil; |
|
|
|
|
import org.springblade.system.user.entity.User; |
|
|
|
|
import org.springblade.system.user.feign.IUserClient; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
import java.time.DayOfWeek; |
|
|
|
|
import java.time.LocalDate; |
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
|
import java.time.format.DateTimeFormatter; |
|
|
|
|
import java.time.temporal.WeekFields; |
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.LinkedList; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
@ -25,6 +52,687 @@ import java.util.stream.Collectors;
|
|
|
|
|
@DS("inspect") |
|
|
|
|
public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, TaskEntity> implements TaskService { |
|
|
|
|
|
|
|
|
|
private final PlanService planService; |
|
|
|
|
|
|
|
|
|
private final ObjectService objectService; |
|
|
|
|
|
|
|
|
|
private final PlanOrgService planOrgService; |
|
|
|
|
|
|
|
|
|
private final ContentService contentService; |
|
|
|
|
|
|
|
|
|
private final ProjectService projectService; |
|
|
|
|
|
|
|
|
|
private final TemplateService templateService; |
|
|
|
|
|
|
|
|
|
private final DutyMainService dutyMainService; |
|
|
|
|
|
|
|
|
|
private final PlanUserService planUserService; |
|
|
|
|
|
|
|
|
|
private final TaskUserService taskUserService; |
|
|
|
|
|
|
|
|
|
private final ObjectUserService objectUserService; |
|
|
|
|
|
|
|
|
|
private final TaskResultService taskResultService; |
|
|
|
|
|
|
|
|
|
private final TaskObjectService taskObjectService; |
|
|
|
|
|
|
|
|
|
private final PlanPositionService planPostionService; |
|
|
|
|
|
|
|
|
|
private final ProjectContentService projectContentService; |
|
|
|
|
|
|
|
|
|
private final TemplateProjectService templateProjectService; |
|
|
|
|
|
|
|
|
|
private final TaskObjectProjectService taskObjectProjectService; |
|
|
|
|
|
|
|
|
|
private final PlanObjectTemplateService planObjectTemplateService; |
|
|
|
|
|
|
|
|
|
private final TaskObjectProjectContentService taskObjectProjectContentService; |
|
|
|
|
|
|
|
|
|
private final TaskVideoManager taskVideoManager; |
|
|
|
|
|
|
|
|
|
private final TaskRemindManager remindCacheManager; |
|
|
|
|
|
|
|
|
|
private final IUserClient userClient; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 巡检任务派发 |
|
|
|
|
* @param param |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public void inspectTaskDistribute(String param) { |
|
|
|
|
// 清理无效任务
|
|
|
|
|
this.close(); |
|
|
|
|
|
|
|
|
|
// 派发任务状态前置修改
|
|
|
|
|
this.status(); |
|
|
|
|
|
|
|
|
|
// 遍历派发任务
|
|
|
|
|
this.distribute(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 清理无效任务 |
|
|
|
|
*/ |
|
|
|
|
private void close() { |
|
|
|
|
// 关闭超过计划结束时间 、已审核 、派发中的巡检计划
|
|
|
|
|
UpdateWrapper<PlanEntity> plan = new UpdateWrapper<>(); |
|
|
|
|
plan.lambda().set(PlanEntity::getStatus, Integer.valueOf(PlanContants.PlanStatusEnum.FINISH_STATUS.getStatus())) |
|
|
|
|
.in(PlanEntity::getStatus, Integer.valueOf(PlanContants.PlanStatusEnum.PAUSE_STATUS.getStatus()), Integer.valueOf(PlanContants.PlanStatusEnum.CHECK_STATUS.getStatus()), Integer.valueOf(PlanContants.PlanStatusEnum.UNDERWAY_STATUS.getStatus())) |
|
|
|
|
.lt(PlanEntity::getEndTime, LocalDate.now()); |
|
|
|
|
this.planService.update(plan); |
|
|
|
|
//关闭超过计划结束时间的巡检任务
|
|
|
|
|
UpdateWrapper<TaskEntity> task = new UpdateWrapper<>(); |
|
|
|
|
task.lambda().set(TaskEntity::getStatus, Integer.valueOf(TaskContants.TaskStatusEnum.UNFINISH_STATUS.getStatus())) |
|
|
|
|
.ne(TaskEntity::getStatus, Integer.valueOf(TaskContants.TaskStatusEnum.FINISH_STATUS.getStatus())) |
|
|
|
|
.lt(TaskEntity::getPlanEndTime, LocalDate.now()); |
|
|
|
|
this.update(task); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 派发状态前置 : 已审核计划 且 已过计划开始时间 |
|
|
|
|
*/ |
|
|
|
|
private void status() { |
|
|
|
|
UpdateWrapper<PlanEntity> plan = new UpdateWrapper<>(); |
|
|
|
|
plan.lambda().set(PlanEntity::getStatus, Integer.valueOf(PlanContants.PlanStatusEnum.UNDERWAY_STATUS.getStatus())) |
|
|
|
|
.eq(PlanEntity::getStatus, Integer.valueOf(PlanContants.PlanStatusEnum.CHECK_STATUS.getStatus())) |
|
|
|
|
.le(PlanEntity::getStartTime, LocalDate.now()); |
|
|
|
|
this.planService.update(plan); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 派发任务 |
|
|
|
|
*/ |
|
|
|
|
private void distribute() { |
|
|
|
|
// 查询需要派发任务列表
|
|
|
|
|
List<PlanEntity> plans = planService.list(Wrappers.<PlanEntity>lambdaQuery() |
|
|
|
|
.eq(PlanEntity::getStatus,Integer.valueOf(PlanContants.PlanStatusEnum.UNDERWAY_STATUS.getStatus()))); |
|
|
|
|
if(CollectionUtil.isEmpty(plans)){ |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
plans.forEach(plan->{ |
|
|
|
|
if(PlanContants.PlanCycleEnum.NEVER_CYCLE.getCycle().equals(plan.getCycle())){//计划周期每次,只需要派发一次任务
|
|
|
|
|
plan.setStatus(Integer.valueOf(PlanContants.PlanStatusEnum.FINISH_STATUS.getStatus())); |
|
|
|
|
this.planService.updateById(plan); |
|
|
|
|
} |
|
|
|
|
if(PlanContants.PlanMethodEnum.SEIZE.getMethod().equals(plan.getMethod())){ |
|
|
|
|
// 抢占模式
|
|
|
|
|
this.seize(plan); |
|
|
|
|
}else if(PlanContants.PlanMethodEnum.CONCURRENT.getMethod().equals(plan.getMethod())){ |
|
|
|
|
// 并发模式
|
|
|
|
|
this.concurrent(plan); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 抢占模式 |
|
|
|
|
* @param plan |
|
|
|
|
*/ |
|
|
|
|
private void seize(PlanEntity plan) { |
|
|
|
|
// 计划班次模式
|
|
|
|
|
if("4".equals(plan.getType())){ |
|
|
|
|
this.seizeClass(plan); |
|
|
|
|
} |
|
|
|
|
// 其他模式
|
|
|
|
|
this.seizeOther(plan); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 并发模式 |
|
|
|
|
* @param plan |
|
|
|
|
*/ |
|
|
|
|
private void concurrent(PlanEntity plan) { |
|
|
|
|
// 计划班次模式
|
|
|
|
|
if("4".equals(plan.getType())){ |
|
|
|
|
this.concurrentClass(plan); |
|
|
|
|
} |
|
|
|
|
// 其他模式
|
|
|
|
|
this.concurrentOther(plan); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 抢占-班次模式 |
|
|
|
|
* @param plan |
|
|
|
|
*/ |
|
|
|
|
private void seizeClass(PlanEntity plan) { |
|
|
|
|
List<TaskUserEntity> taskUserList = Lists.newArrayList(); |
|
|
|
|
|
|
|
|
|
if(Func.isEmpty(plan.getExecTimeJson())){ |
|
|
|
|
XxlJobLogger.log("seizeClass_巡检计划未设置值班班次: plan = " + plan); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
JSONArray array = JSONArray.parseArray(plan.getExecTimeJson()); |
|
|
|
|
for (int index = 0; index < plan.getTaskTimesADay(); index++) { |
|
|
|
|
// 取巡检任务执行开始、结束时间、是否下一天
|
|
|
|
|
JSONObject time = array.getJSONObject(index); |
|
|
|
|
plan.setExecStartTime(time.get("execStartTime").toString()); |
|
|
|
|
plan.setExecEndTime(time.get("execEndTime").toString()); |
|
|
|
|
if(time.containsKey("isNextDay")){ |
|
|
|
|
plan.setIsNextDay(time.getBoolean("isNextDay")); |
|
|
|
|
} |
|
|
|
|
// 保存巡检任务
|
|
|
|
|
TaskEntity task = this.saveTask(plan,1); |
|
|
|
|
if(ObjectUtil.isEmpty(task) || !time.containsKey("classId")){ |
|
|
|
|
XxlJobLogger.log("seizeClass_任务执行时间json数据不包含classId"); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
// 查询值班数据
|
|
|
|
|
ImsDutyMainFeignVO main = dutyMainService.mainPerson(time.getLong("classId"), DateUtil.format(LocalDate.now(),DateUtil.PATTERN_DATE)); |
|
|
|
|
if(ObjectUtil.isNotEmpty(main) && CollectionUtil.isNotEmpty(main.getPersons())){ |
|
|
|
|
plan.setDutyId(main.getMainId()); |
|
|
|
|
main.getPersons().forEach(persons->{ |
|
|
|
|
// 任务用户关联记录
|
|
|
|
|
TaskUserEntity taskUser = TaskUserEntity.builder().taskId(task.getId()).userId(persons).claimStatus(TaskContants.ClaimStatusEnum.UN_COLLECT.getStatus()).build(); |
|
|
|
|
taskUser.setTenantId(plan.getTenantId()); |
|
|
|
|
taskUserList.add(taskUser); |
|
|
|
|
//添加到提醒cache
|
|
|
|
|
task.setUserId(persons); |
|
|
|
|
remindCacheManager.addTaskToCacheList(task); |
|
|
|
|
taskVideoManager.addTaskToVideoCacheList(task); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
String reason = this.saveTaskObject(plan,task); |
|
|
|
|
if(reason.equals(StringUtils.EMPTY)){ |
|
|
|
|
LocalDateTime now = LocalDateTime.now(); |
|
|
|
|
reason = plan.getName() + now.getYear() + "年" + now.getMonthValue() + "月" + now.getDayOfMonth() + "日的任务派发成功"; |
|
|
|
|
} |
|
|
|
|
XxlJobLogger.log(reason); |
|
|
|
|
TaskResultEntity taskResultEntity = TaskResultEntity.builder().planId(task.getPlanId()).batchNumber(task.getBatchNumber()).reason(reason).build(); |
|
|
|
|
taskResultEntity.setTenantId(plan.getTenantId()); |
|
|
|
|
taskResultService.save(taskResultEntity); |
|
|
|
|
} |
|
|
|
|
if(taskUserList.size()>0){ |
|
|
|
|
taskUserService.saveBatch(taskUserList); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 抢占-其他模式 |
|
|
|
|
* @param plan |
|
|
|
|
*/ |
|
|
|
|
private void seizeOther(PlanEntity plan) { |
|
|
|
|
List<PlanUserEntity> users = this.getUsersByPlan(plan); |
|
|
|
|
List<TaskUserEntity> taskUserList = Lists.newArrayList(); |
|
|
|
|
|
|
|
|
|
JSONArray timeJsonArray = null; |
|
|
|
|
if(Func.isNotEmpty(plan.getExecTimeJson())){ |
|
|
|
|
timeJsonArray = JSON.parseArray(plan.getExecTimeJson()); |
|
|
|
|
} |
|
|
|
|
for (int j = 0; j < plan.getTaskTimesADay(); j++) { |
|
|
|
|
if(Func.isNotEmpty(timeJsonArray)){ |
|
|
|
|
JSONObject time = timeJsonArray.getJSONObject(j); |
|
|
|
|
plan.setExecStartTime(time.get("execStartTime").toString()); |
|
|
|
|
plan.setExecEndTime(time.get("execEndTime").toString()); |
|
|
|
|
if(time.containsKey("isNextDay")){ |
|
|
|
|
plan.setIsNextDay(time.getBoolean("isNextDay")); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
plan.setExecStartTime("00:00:00"); |
|
|
|
|
plan.setExecEndTime("23:59:59"); |
|
|
|
|
} |
|
|
|
|
TaskEntity task = this.saveTask(plan,1); |
|
|
|
|
if(task==null){continue;} |
|
|
|
|
for(PlanUserEntity user:users){ |
|
|
|
|
TaskUserEntity taskUser = TaskUserEntity.builder().taskId(task.getId()).userId(user.getUserId()).claimStatus(TaskContants.ClaimStatusEnum.UN_COLLECT.getStatus()).build(); |
|
|
|
|
taskUser.setTenantId(plan.getTenantId()); |
|
|
|
|
taskUserList.add(taskUser); |
|
|
|
|
//添加到提醒cache
|
|
|
|
|
task.setUserId(user.getUserId()); |
|
|
|
|
remindCacheManager.addTaskToCacheList(task); |
|
|
|
|
taskVideoManager.addTaskToVideoCacheList(task); |
|
|
|
|
} |
|
|
|
|
String reason = this.saveTaskObject(plan,task); |
|
|
|
|
if(reason.equals(StringUtils.EMPTY)){ |
|
|
|
|
LocalDateTime now = LocalDateTime.now(); |
|
|
|
|
reason = plan.getName() + now.getYear() + "年" + now.getMonthValue() + "月" + now.getDayOfMonth() + "日的任务派发成功"; |
|
|
|
|
} |
|
|
|
|
XxlJobLogger.log(reason); |
|
|
|
|
TaskResultEntity taskResultEntity = TaskResultEntity.builder().planId(task.getPlanId()).batchNumber(task.getBatchNumber()).reason(reason).build(); |
|
|
|
|
taskResultEntity.setTenantId(plan.getTenantId()); |
|
|
|
|
taskResultService.save(taskResultEntity); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(taskUserList.size()>0){ |
|
|
|
|
taskUserService.saveBatch(taskUserList); |
|
|
|
|
} else { |
|
|
|
|
XxlJobLogger.log("没有用户: plan = " + plan); |
|
|
|
|
XxlJobLogger.log("SeizeTaskService...没有任务用户: plan = " + plan); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 并发-班次模式 |
|
|
|
|
* @param plan |
|
|
|
|
*/ |
|
|
|
|
private void concurrentClass(PlanEntity plan) { |
|
|
|
|
List<TaskUserEntity> taskUserList = Lists.newArrayList(); |
|
|
|
|
|
|
|
|
|
LocalDateTime now = LocalDateTime.now(); |
|
|
|
|
String defaultReason = plan.getName() + now.getYear() + "年" + now.getMonthValue() + "月" + now.getDayOfMonth() + "日的任务派发成功"; |
|
|
|
|
JSONArray timeJsonArray; |
|
|
|
|
if (Func.isNotEmpty(plan.getExecTimeJson())) { |
|
|
|
|
timeJsonArray = JSON.parseArray(plan.getExecTimeJson()); |
|
|
|
|
} else { |
|
|
|
|
XxlJobLogger.log("巡检计划未设置值班班次: plan = " + plan); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
for (int j = 0; j < plan.getTaskTimesADay(); j++) { |
|
|
|
|
JSONObject time = timeJsonArray.getJSONObject(j); |
|
|
|
|
plan.setExecStartTime(time.get("execStartTime").toString()); |
|
|
|
|
plan.setExecEndTime(time.get("execEndTime").toString()); |
|
|
|
|
if (time.containsKey("isNextDay")) { |
|
|
|
|
plan.setIsNextDay(time.getBoolean("isNextDay")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//获取值班用户
|
|
|
|
|
if (time.containsKey("classId")) { |
|
|
|
|
Long classId = time.getLong("classId"); |
|
|
|
|
DateTimeFormatter dfShort = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
|
|
|
|
ImsDutyMainFeignVO mainPerson = dutyMainService.mainPerson(classId, dfShort.format(LocalDate.now())); |
|
|
|
|
List<Long> ids = mainPerson.getPersons(); |
|
|
|
|
plan.setDutyId(mainPerson.getMainId()); |
|
|
|
|
if (Func.isNotEmpty(ids)) { |
|
|
|
|
for (Long id : ids) { |
|
|
|
|
TaskEntity task = saveTask(plan, ids.size()); |
|
|
|
|
if (task == null) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
TaskUserEntity taskUser = TaskUserEntity.builder().taskId(task.getId()).userId(id).claimStatus(TaskContants.ClaimStatusEnum.UN_COLLECT.getStatus()).build(); |
|
|
|
|
taskUser.setTenantId(plan.getTenantId()); |
|
|
|
|
taskUserList.add(taskUser); |
|
|
|
|
String reason = saveTaskObject(plan, task); |
|
|
|
|
if (reason.equals(StringUtils.EMPTY)) { |
|
|
|
|
reason = defaultReason; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
XxlJobLogger.log(reason); |
|
|
|
|
TaskResultEntity taskResultEntity = TaskResultEntity.builder().planId(task.getPlanId()).batchNumber(task.getBatchNumber()).reason(reason).build(); |
|
|
|
|
taskResultEntity.setTenantId(plan.getTenantId()); |
|
|
|
|
taskResultService.save(taskResultEntity); |
|
|
|
|
|
|
|
|
|
//添加到提醒cache
|
|
|
|
|
task.setUserId(id); |
|
|
|
|
remindCacheManager.addTaskToCacheList(task); |
|
|
|
|
taskVideoManager.addTaskToVideoCacheList(task); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
XxlJobLogger.log("获取该班次值班人员为空, plan = " + plan); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
XxlJobLogger.log("巡检计划未设置值班班次, plan = " + plan); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (taskUserList.size() > 0) { |
|
|
|
|
taskUserService.saveBatch(taskUserList); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 并发其他模式 |
|
|
|
|
* @param plan |
|
|
|
|
*/ |
|
|
|
|
private void concurrentOther(PlanEntity plan) { |
|
|
|
|
LocalDateTime now = LocalDateTime.now(); |
|
|
|
|
String defaultReason = plan.getName() + now.getYear() + "年" + now.getMonthValue() + "月" + now.getDayOfMonth() + "日的任务派发成功"; |
|
|
|
|
List<PlanUserEntity> users = this.getUsersByPlan(plan); |
|
|
|
|
List<TaskUserEntity> taskUserList = Lists.newArrayList(); |
|
|
|
|
|
|
|
|
|
JSONArray timeJsonArray = null; |
|
|
|
|
if (Func.isNotEmpty(plan.getExecTimeJson())) { |
|
|
|
|
timeJsonArray = JSON.parseArray(plan.getExecTimeJson()); |
|
|
|
|
} |
|
|
|
|
for (PlanUserEntity user : users) { |
|
|
|
|
for (int j = 0; j < plan.getTaskTimesADay(); j++) { |
|
|
|
|
if (Func.isNotEmpty(timeJsonArray)) { |
|
|
|
|
JSONObject time = timeJsonArray.getJSONObject(j); |
|
|
|
|
plan.setExecStartTime(time.get("execStartTime").toString()); |
|
|
|
|
plan.setExecEndTime(time.get("execEndTime").toString()); |
|
|
|
|
if (time.containsKey("isNextDay")) { |
|
|
|
|
plan.setIsNextDay(time.getBoolean("isNextDay")); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
plan.setExecStartTime("00:00:00"); |
|
|
|
|
plan.setExecEndTime("23:59:59"); |
|
|
|
|
} |
|
|
|
|
TaskEntity task = saveTask(plan, users.size()); |
|
|
|
|
if (task == null) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
TaskUserEntity taskUser = TaskUserEntity.builder().taskId(task.getId()).userId(user.getId()).claimStatus(TaskContants.ClaimStatusEnum.UN_COLLECT.getStatus()).build(); |
|
|
|
|
taskUser.setTenantId(plan.getTenantId()); |
|
|
|
|
taskUserList.add(taskUser); |
|
|
|
|
String reason = saveTaskObject(plan, task); |
|
|
|
|
if (reason.equals(StringUtils.EMPTY)) { |
|
|
|
|
reason = defaultReason; |
|
|
|
|
} |
|
|
|
|
XxlJobLogger.log(reason); |
|
|
|
|
|
|
|
|
|
TaskResultEntity taskResultEntity = TaskResultEntity.builder().planId(task.getPlanId()).batchNumber(task.getBatchNumber()).reason(reason).build(); |
|
|
|
|
taskResultEntity.setTenantId(plan.getTenantId()); |
|
|
|
|
taskResultService.save(taskResultEntity); |
|
|
|
|
|
|
|
|
|
//添加到提醒cache
|
|
|
|
|
task.setUserId(user.getUserId()); |
|
|
|
|
remindCacheManager.addTaskToCacheList(task); |
|
|
|
|
taskVideoManager.addTaskToVideoCacheList(task); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (taskUserList.size() > 0) { |
|
|
|
|
taskUserService.saveBatch(taskUserList); |
|
|
|
|
} else { |
|
|
|
|
log.error("ConcurrentTaskServcie...没有任务用户: plan = " + plan); |
|
|
|
|
XxlJobLogger.log("ConcurrentTaskServcie...没有任务用户: plan = " + plan); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 根据巡检计划返回与计划有关的所有用户 |
|
|
|
|
* @param plan 巡检计划实例 |
|
|
|
|
* @return 计划相关用户集合 |
|
|
|
|
*/ |
|
|
|
|
public List<PlanUserEntity> getUsersByPlan(PlanEntity plan) { |
|
|
|
|
List<PlanUserEntity> res = new LinkedList<>(); |
|
|
|
|
if(PlanContants.PlanTypeEnum.USER_TYPE.getType().equals(plan.getType()) || PlanContants.PlanTypeEnum.FREE_TYPE.getType().equals(plan.getType())){ |
|
|
|
|
QueryWrapper<PlanUserEntity> planUserQw = new QueryWrapper<>(); |
|
|
|
|
planUserQw.lambda().eq(PlanUserEntity::getPlanId, plan.getId()); |
|
|
|
|
res.addAll(planUserService.list(planUserQw)); |
|
|
|
|
}else if(PlanContants.PlanTypeEnum.POSITION_TYPE.getType().equals(plan.getType())){ |
|
|
|
|
QueryWrapper<PlanPositionEntity> planPositionEntityQueryWrapper = new QueryWrapper<>(); |
|
|
|
|
planPositionEntityQueryWrapper.lambda().eq(PlanPositionEntity::getPlanId, plan.getId()); |
|
|
|
|
planPostionService.list(planPositionEntityQueryWrapper).forEach(entity->{ |
|
|
|
|
//获取该机构下所有用户列表
|
|
|
|
|
List<User> users = new ArrayList<>(); |
|
|
|
|
List<User> positionUsers = userClient.userListByPosition(entity.getPositionId()).getData(); |
|
|
|
|
if(CollectionUtil.isNotEmpty(positionUsers)){ |
|
|
|
|
users = positionUsers.stream().filter(user->user.getCreateDept().toString().contains(entity.getCreateDept().toString())).collect(Collectors.toList()); |
|
|
|
|
} |
|
|
|
|
XxlJobLogger.log("岗位信息:" + entity + "; 获取到的user:{}",users.stream().map(User::getName).collect(Collectors.joining(","))); |
|
|
|
|
for(User u:users){ |
|
|
|
|
res.add(PlanUserEntity.builder().planId(plan.getId()).userId(u.getId()).build()); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}else if(PlanContants.PlanTypeEnum.ORG_TYPE.getType().equals(plan.getType())){ |
|
|
|
|
QueryWrapper<PlanOrgEntity> planOrgEntityQueryWrapper = new QueryWrapper<>(); |
|
|
|
|
planOrgEntityQueryWrapper.lambda().eq(PlanOrgEntity::getPlanId, plan.getId()); |
|
|
|
|
planOrgService.list(planOrgEntityQueryWrapper).forEach(entity->{ |
|
|
|
|
List<User> users = userClient.userListByDeptId(entity.getOrgId()).getData(); |
|
|
|
|
for(User u:users){ |
|
|
|
|
res.add(PlanUserEntity.builder().planId(plan.getId()).userId(u.getId()).build()); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}else if(PlanContants.PlanTypeEnum.CLASS_TYPE.getType().equals(plan.getType())){ |
|
|
|
|
XxlJobLogger.log("巡检计划为班次时,有单独的处理流程,不应该跑到该分支下面来, plan = " + plan); |
|
|
|
|
JSONArray timeJsonArray; |
|
|
|
|
if(Func.isNotEmpty(plan.getExecTimeJson())){ |
|
|
|
|
timeJsonArray = JSON.parseArray(plan.getExecTimeJson()); |
|
|
|
|
} |
|
|
|
|
else{ |
|
|
|
|
throw new ServiceException("巡检计划未设置值班班次: plan = " + plan); |
|
|
|
|
} |
|
|
|
|
for(int i=0;i<plan.getTaskTimesADay();i++){ |
|
|
|
|
JSONObject time = timeJsonArray.getJSONObject(i); |
|
|
|
|
plan.setExecStartTime(time.get("execStartTime").toString()); |
|
|
|
|
plan.setExecEndTime(time.get("execEndTime").toString()); |
|
|
|
|
if (time.containsKey("isNextDay")) { |
|
|
|
|
plan.setIsNextDay(time.getBoolean("isNextDay")); |
|
|
|
|
} |
|
|
|
|
//获取值班用户
|
|
|
|
|
if (time.containsKey("classId")) { |
|
|
|
|
DateTimeFormatter dfShort = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
|
|
|
|
ImsDutyMainFeignVO mainPerson = dutyMainService.mainPerson(time.getLong("classId"), dfShort.format(LocalDate.now())); |
|
|
|
|
List<Long> ids = mainPerson.getPersons(); |
|
|
|
|
log.info("--计划为:{};人员ID为:{}--",plan.getName(),ids.stream().map(String::valueOf).collect(Collectors.joining(","))); |
|
|
|
|
plan.setDutyId(mainPerson.getMainId()); |
|
|
|
|
if(Func.isNotEmpty(ids)){ |
|
|
|
|
for (Long id : ids) { |
|
|
|
|
res.add(PlanUserEntity.builder().planId(plan.getId()).userId(id).build()); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
XxlJobLogger.log("获取该班次值班人员为空, plan = " + plan); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//设置租户
|
|
|
|
|
return res.stream().distinct().peek(entity-> entity.setTenantId(plan.getTenantId())).collect(Collectors.toList()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 保存巡检任务 |
|
|
|
|
* @param plan 巡检计划 |
|
|
|
|
* @param totalTaskNum 任务数 : 抢占任务只生成一个 |
|
|
|
|
* @return 巡检任务实例 |
|
|
|
|
*/ |
|
|
|
|
public TaskEntity saveTask(PlanEntity plan,int totalTaskNum) { |
|
|
|
|
totalTaskNum = plan.getTaskTimesADay() * totalTaskNum; |
|
|
|
|
TaskEntity task = new TaskEntity(); |
|
|
|
|
LocalDate now = LocalDate.now(); |
|
|
|
|
DateTimeFormatter dfShort = DateTimeFormatter.ofPattern("yyyy-MM-dd "); |
|
|
|
|
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
|
|
|
|
|
|
|
|
|
if(PlanContants.PlanCycleEnum.NEVER_CYCLE.getCycle().equals(plan.getCycle())) { |
|
|
|
|
task.setBatchNumber(now.getYear()+ "_" +now.getMonthValue()+ "_" +now.getDayOfMonth() + "N"); |
|
|
|
|
task.setPlanEndTime(LocalDateTime.parse(dfShort.format(plan.getEndTime())+plan.getExecEndTime(), df)); |
|
|
|
|
}else if(PlanContants.PlanCycleEnum.EVERYDAY_CYCLE.getCycle().equals(plan.getCycle())) { |
|
|
|
|
task.setBatchNumber(now.getYear()+ "_" +now.getMonthValue()+ "_" +now.getDayOfMonth()); |
|
|
|
|
if(Func.isNotEmpty(plan.getIsNextDay()) && plan.getIsNextDay()){ |
|
|
|
|
task.setPlanEndTime(LocalDateTime.parse(dfShort.format(now.plusDays(1L)) + plan.getExecEndTime(), df)); |
|
|
|
|
} else { |
|
|
|
|
task.setPlanEndTime(LocalDateTime.parse(dfShort.format(now) + plan.getExecEndTime(), df)); |
|
|
|
|
} |
|
|
|
|
}else if(PlanContants.PlanCycleEnum.EVERYWEEK_CYCLE.getCycle().equals(plan.getCycle())) { |
|
|
|
|
WeekFields weekFields = WeekFields.of(DayOfWeek.MONDAY,1); |
|
|
|
|
int weeks = now.get(weekFields.weekOfYear()); |
|
|
|
|
task.setBatchNumber(now.getYear()+ "_" +now.getMonthValue() + "_" +weeks + "W"); |
|
|
|
|
task.setPlanEndTime(LocalDateTime.parse(dfShort.format(now.plusWeeks(1)) + plan.getExecEndTime(), df)); |
|
|
|
|
}else if(PlanContants.PlanCycleEnum.EVERYMONTH_CYCLE.getCycle().equals(plan.getCycle())) { |
|
|
|
|
task.setBatchNumber(now.getYear()+ "_" +now.getMonthValue()); |
|
|
|
|
task.setPlanEndTime(LocalDateTime.parse(dfShort.format(now.plusMonths(1))+plan.getExecEndTime(), df)); |
|
|
|
|
}else if(PlanContants.PlanCycleEnum.EVERYQUARTER_CYCLE.getCycle().equals(plan.getCycle())) { |
|
|
|
|
task.setBatchNumber(now.getYear()+ "_" +now.getMonthValue() + "Q"); |
|
|
|
|
task.setPlanEndTime(LocalDateTime.parse(dfShort.format(now.plusMonths(3)) + plan.getExecEndTime(), df)); |
|
|
|
|
}else if(PlanContants.PlanCycleEnum.EVERYYEAR_CYCLE.getCycle().equals(plan.getCycle())){ |
|
|
|
|
task.setBatchNumber(String.valueOf(now.getYear())); |
|
|
|
|
task.setPlanEndTime(LocalDateTime.parse(dfShort.format(now.plusYears(1))+plan.getExecEndTime(), df)); |
|
|
|
|
} |
|
|
|
|
if(PlanContants.PlanCycleEnum.NEVER_CYCLE.getCycle().equals(plan.getCycle())) { |
|
|
|
|
task.setPlanStartTime(LocalDateTime.parse(dfShort.format(plan.getStartTime()) + plan.getExecStartTime(), df)); |
|
|
|
|
} else { |
|
|
|
|
task.setPlanStartTime(LocalDateTime.parse(dfShort.format(now) + plan.getExecStartTime(), df)); |
|
|
|
|
} |
|
|
|
|
task.setDutyId(plan.getDutyId()); |
|
|
|
|
task.setPlanId(plan.getId()); |
|
|
|
|
task.setPlanName(plan.getName()); |
|
|
|
|
task.setType(plan.getType()); |
|
|
|
|
task.setCycle(plan.getCycle()); |
|
|
|
|
task.setStatus(Integer.valueOf(TaskContants.TaskStatusEnum.INIT_STATUS.getStatus())); |
|
|
|
|
task.setTenantId(plan.getTenantId()); |
|
|
|
|
task.setCreateUser(plan.getCreateUser()); |
|
|
|
|
task.setCreateDept(plan.getCreateDept()); |
|
|
|
|
task.setAutoVideo(plan.getAutoVideo()); |
|
|
|
|
task.setMessageTemplateId(plan.getMessageTemplateId()); |
|
|
|
|
task.setMethod(plan.getMethod()); |
|
|
|
|
task.setEndRemindFlag(true); |
|
|
|
|
task.setStartRemindFlag(true); |
|
|
|
|
task.setStartRemindTime(task.getPlanStartTime().minusMinutes(plan.getStartRemind())); |
|
|
|
|
task.setEndRemindTime(task.getPlanEndTime().minusMinutes(plan.getEndRemind())); |
|
|
|
|
int taskCount = this.count(Wrappers.<TaskEntity>query().lambda().eq(TaskEntity::getPlanId,task.getPlanId()).eq(TaskEntity::getBatchNumber, task.getBatchNumber())); |
|
|
|
|
XxlJobLogger.log("该计划已生成计划批次:{},数量:{}",task.getBatchNumber(),taskCount); |
|
|
|
|
if(taskCount >= totalTaskNum){ |
|
|
|
|
log.info("计划id={}本周期batchNumber={}的任务已生成",plan.getId(),task.getBatchNumber()); |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
this.save(task); |
|
|
|
|
return task; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 保存巡检对象数据 |
|
|
|
|
* @param plan 巡检计划实例 |
|
|
|
|
* @param task 巡检任务实例 |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
public String saveTaskObject(PlanEntity plan, TaskEntity task) { |
|
|
|
|
String result = StringUtils.EMPTY; |
|
|
|
|
List<TaskObjectEntity> taskObjectList = Lists.newArrayList(); |
|
|
|
|
// 自由模式
|
|
|
|
|
if(PlanContants.PlanTypeEnum.FREE_TYPE.getType().equals(plan.getType())){ |
|
|
|
|
// 查询计划用户
|
|
|
|
|
List<PlanUserEntity> planUsers = planUserService.list(Wrappers.<PlanUserEntity>query().lambda().eq(PlanUserEntity::getPlanId,plan.getId())); |
|
|
|
|
if(CollectionUtil.isEmpty(planUsers)){ |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
for(PlanUserEntity planUser : planUsers){ |
|
|
|
|
// 查询巡检对象用户
|
|
|
|
|
List<ObjectUserEntity> objectUsers= objectUserService.list(Wrappers.<ObjectUserEntity>query().lambda().eq(ObjectUserEntity::getUserId,planUser.getUserId())); |
|
|
|
|
if(CollectionUtil.isEmpty(objectUsers)){ |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
for (ObjectUserEntity objectUser : objectUsers){ |
|
|
|
|
List<TaskObjectEntity> existEntity = taskObjectList.stream().filter(taskObjectEntity -> objectUser.getObjectId().equals(taskObjectEntity.getObjectId())).collect(Collectors.toList()); |
|
|
|
|
if(ObjectUtil.isNotEmpty(existEntity)){ |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
// 保存巡检对象
|
|
|
|
|
result = saveTaskObject(taskObjectList,task,objectUser.getObjectId(),objectUser.getTemplateId()); |
|
|
|
|
if(!result.equals(StringUtils.EMPTY)){ |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
List<PlanObjectTemplateEntity> templates = planObjectTemplateService.list(Wrappers.<PlanObjectTemplateEntity>query().lambda().eq(PlanObjectTemplateEntity::getPlanId,plan.getId())); |
|
|
|
|
for (PlanObjectTemplateEntity template : templates) { |
|
|
|
|
result = saveTaskObject(taskObjectList,task,template.getObjectId(),template.getTemplateId()); |
|
|
|
|
if(!result.equals(StringUtils.EMPTY)){ |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if(taskObjectList.size()>0 && result.equals(StringUtils.EMPTY)){ |
|
|
|
|
taskObjectService.saveBatch(taskObjectList); |
|
|
|
|
} |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 保存巡检对象 |
|
|
|
|
* @param taskObjectList |
|
|
|
|
* @param task |
|
|
|
|
* @param objectId |
|
|
|
|
* @param templateId |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
private String saveTaskObject(List<TaskObjectEntity> taskObjectList,TaskEntity task,Long objectId,Long templateId){ |
|
|
|
|
String result = StringUtils.EMPTY; |
|
|
|
|
ObjectEntity io = objectService.getById(objectId); |
|
|
|
|
if(io == null) { |
|
|
|
|
return "巡检对象id="+objectId+"找不到记录"; |
|
|
|
|
} |
|
|
|
|
TemplateEntity templateInfo = templateService.getById(templateId); |
|
|
|
|
if(templateInfo == null) { |
|
|
|
|
return "巡检模板id="+templateId+"找不到记录"; |
|
|
|
|
} |
|
|
|
|
TaskObjectEntity ito = new TaskObjectEntity(); |
|
|
|
|
ito.setTaskId(task.getId()); |
|
|
|
|
ito.setObjectId(objectId); |
|
|
|
|
ito.setCode(io.getCode()); |
|
|
|
|
ito.setName(io.getName()); |
|
|
|
|
ito.setAddress(io.getAddress()); |
|
|
|
|
ito.setLttd(io.getLttd()); |
|
|
|
|
ito.setLgtd(io.getLgtd()); |
|
|
|
|
ito.setCreateUser(task.getCreateUser()); |
|
|
|
|
ito.setCreateDept(task.getCreateDept()); |
|
|
|
|
ito.setCreateTime(task.getCreateTime()); |
|
|
|
|
ito.setDuplicateRecord(templateInfo.getDuplicateRecord()); |
|
|
|
|
ito.setTenantId(task.getTenantId()); |
|
|
|
|
ito.setStatus(TaskContants.StatusEnum.INIT_STATUS.getStatus()); |
|
|
|
|
taskObjectList.add(ito); |
|
|
|
|
List<TemplateProjectEntity> projects = templateProjectService.list(Wrappers.<TemplateProjectEntity>query().lambda().eq(TemplateProjectEntity::getTemplateId,templateId)); |
|
|
|
|
for (TemplateProjectEntity project : projects) { |
|
|
|
|
result = saveTaskObjectProject(task, objectId, project); |
|
|
|
|
if(!result.equals(StringUtils.EMPTY)){ |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 从巡检任务、巡检计划对象模板、巡检模板项目获取信息插入巡检任务项目表以及对应的历史数据表 |
|
|
|
|
* @param objectId 巡检计划对象模板实例 |
|
|
|
|
* @param project 巡检模板项目实例 |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
private String saveTaskObjectProject(TaskEntity task, Long objectId, TemplateProjectEntity project) { |
|
|
|
|
String result = StringUtils.EMPTY; |
|
|
|
|
ProjectEntity ip = projectService.getById(project.getProjectId()); |
|
|
|
|
if(ip == null) { |
|
|
|
|
return "巡检项目id="+project.getProjectId()+"找不到记录"; |
|
|
|
|
} |
|
|
|
|
TaskObjectProjectEntity itop = new TaskObjectProjectEntity(); |
|
|
|
|
itop.setObjectId(objectId); |
|
|
|
|
itop.setProjectId(ip.getId()); |
|
|
|
|
itop.setTaskId(task.getId()); |
|
|
|
|
itop.setName(ip.getName()); |
|
|
|
|
itop.setCode(ip.getCode()); |
|
|
|
|
itop.setDescription(ip.getDescription()); |
|
|
|
|
itop.setCreateTime(project.getCreateTime()); |
|
|
|
|
itop.setTenantId(task.getTenantId()); |
|
|
|
|
itop.setCreateUser(task.getCreateUser()); |
|
|
|
|
itop.setCreateDept(task.getCreateDept()); |
|
|
|
|
itop.setStatus(TaskContants.StatusEnum.INIT_STATUS.getStatus()); |
|
|
|
|
taskObjectProjectService.save(itop); |
|
|
|
|
List<ProjectContentEntity> contents = projectContentService.list(Wrappers.<ProjectContentEntity>query().lambda().eq(ProjectContentEntity::getProjectId,project.getProjectId())); |
|
|
|
|
for (ProjectContentEntity content : contents) { |
|
|
|
|
result = saveTaskObjectProjectContent(task, objectId, content); |
|
|
|
|
if(!result.equals(StringUtils.EMPTY)){ |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 从巡检任务、巡检计划对象模板、巡检项目内容获取信息插入巡检任务内容表以及对应的历史数据表 |
|
|
|
|
* @param objectId 巡检计划对象模板实例 |
|
|
|
|
* @param content 巡检项目内容实例 |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
private String saveTaskObjectProjectContent(TaskEntity task, Long objectId, ProjectContentEntity content) { |
|
|
|
|
ContentEntity ioc = contentService.getById(content.getContentId()); |
|
|
|
|
if(ioc == null) {return "巡检内容id="+content.getContentId()+"找不到记录";} |
|
|
|
|
TaskObjectProjectContentEntity itopc = new TaskObjectProjectContentEntity(); |
|
|
|
|
itopc.setTaskId(task.getId()); |
|
|
|
|
itopc.setObjectId(objectId); |
|
|
|
|
itopc.setProjectId(content.getProjectId()); |
|
|
|
|
itopc.setContentId(content.getContentId()); |
|
|
|
|
itopc.setCode(ioc.getCode()); |
|
|
|
|
itopc.setName(ioc.getName()); |
|
|
|
|
itopc.setDescription(ioc.getDescription()); |
|
|
|
|
itopc.setCheckType(ioc.getCheckType()); |
|
|
|
|
itopc.setRecordType(ioc.getRecordType()); |
|
|
|
|
itopc.setCreateTime(content.getCreateTime()); |
|
|
|
|
itopc.setTenantId(task.getTenantId()); |
|
|
|
|
itopc.setCreateUser(task.getCreateUser()); |
|
|
|
|
itopc.setCreateDept(task.getCreateDept()); |
|
|
|
|
itopc.setCheckTypeSon(ioc.getCheckTypeSon()); |
|
|
|
|
itopc.setCameraAddr(ioc.getCameraAddr()); |
|
|
|
|
itopc.setCameraId(ioc.getCameraId()); |
|
|
|
|
itopc.setClockId(ioc.getClockId()); |
|
|
|
|
itopc.setOtherParam(ioc.getOtherParam()); |
|
|
|
|
itopc.setStatus(TaskContants.StatusEnum.INIT_STATUS.getStatus()); |
|
|
|
|
itopc.setDictType(ioc.getDictType()); |
|
|
|
|
taskObjectProjectContentService.save(itopc); |
|
|
|
|
return StringUtils.EMPTY; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 时间区间机构的巡检任务数据查询 |
|
|
|
|
* @param start |
|
|
|
|