|
|
@ -30,6 +30,7 @@ import org.springblade.flow.core.feign.IFlowClient; |
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
import org.springframework.data.redis.core.RedisTemplate; |
|
|
|
import org.springframework.data.redis.core.RedisTemplate; |
|
|
|
import org.springframework.jdbc.datasource.DataSourceTransactionManager; |
|
|
|
import org.springframework.jdbc.datasource.DataSourceTransactionManager; |
|
|
|
|
|
|
|
import org.springframework.scheduling.annotation.Scheduled; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
import org.springframework.transaction.TransactionDefinition; |
|
|
|
import org.springframework.transaction.TransactionDefinition; |
|
|
|
import org.springframework.transaction.TransactionStatus; |
|
|
|
import org.springframework.transaction.TransactionStatus; |
|
|
@ -81,7 +82,7 @@ public class MaintenanceTaskCreateTask { |
|
|
|
final static String REMIND_TASK_END_LIST = "hzims:operation:maintenance:remind:end:tasks"; |
|
|
|
final static String REMIND_TASK_END_LIST = "hzims:operation:maintenance:remind:end:tasks"; |
|
|
|
|
|
|
|
|
|
|
|
@XxlJob(TASK_VALUE_MAINTENANCE_TASK_CREATE) |
|
|
|
@XxlJob(TASK_VALUE_MAINTENANCE_TASK_CREATE) |
|
|
|
@Transactional |
|
|
|
// @Transactional
|
|
|
|
public ReturnT<String> execute(String param) throws Exception { |
|
|
|
public ReturnT<String> execute(String param) throws Exception { |
|
|
|
log.info(TASK_VALUE_MAINTENANCE_TASK_CREATE + " start...................................................................................."); |
|
|
|
log.info(TASK_VALUE_MAINTENANCE_TASK_CREATE + " start...................................................................................."); |
|
|
|
Date startDate = StringUtil.isNotBlank(param) ? DateUtil.parse(param, DateUtil.PATTERN_DATE) : DateUtil.parse(DateUtil.formatDate(DateUtil.now()), DateUtil.PATTERN_DATE); |
|
|
|
Date startDate = StringUtil.isNotBlank(param) ? DateUtil.parse(param, DateUtil.PATTERN_DATE) : DateUtil.parse(DateUtil.formatDate(DateUtil.now()), DateUtil.PATTERN_DATE); |
|
|
@ -107,6 +108,9 @@ public class MaintenanceTaskCreateTask { |
|
|
|
planEntityLambdaUpdateWrapper.set(OperMaintenancePlanEntity::getCreateTaskTime, new Date()); |
|
|
|
planEntityLambdaUpdateWrapper.set(OperMaintenancePlanEntity::getCreateTaskTime, new Date()); |
|
|
|
planEntityLambdaUpdateWrapper.eq(OperMaintenancePlanEntity::getId, planEntities.get(i).getId()); |
|
|
|
planEntityLambdaUpdateWrapper.eq(OperMaintenancePlanEntity::getId, planEntities.get(i).getId()); |
|
|
|
maintenancePlanService.update(planEntityLambdaUpdateWrapper); |
|
|
|
maintenancePlanService.update(planEntityLambdaUpdateWrapper); |
|
|
|
|
|
|
|
log.info("更新任务派发"+planEntities.get(i)); |
|
|
|
|
|
|
|
}else { |
|
|
|
|
|
|
|
log.error("更新任务派发失败"+planEntities.get(i)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
Thread.sleep(1000); |
|
|
|
Thread.sleep(1000); |
|
|
@ -123,6 +127,7 @@ public class MaintenanceTaskCreateTask { |
|
|
|
* @return |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public Boolean generateTaskByPlan(OperMaintenancePlanEntity planEntity,Boolean flag) { |
|
|
|
public Boolean generateTaskByPlan(OperMaintenancePlanEntity planEntity,Boolean flag) { |
|
|
|
|
|
|
|
log.info("日常维护计划生成任务开始:param"+planEntity); |
|
|
|
OperMaintenanceTaskEntity taskEntity = BeanUtil.copy(planEntity,OperMaintenanceTaskEntity.class); |
|
|
|
OperMaintenanceTaskEntity taskEntity = BeanUtil.copy(planEntity,OperMaintenanceTaskEntity.class); |
|
|
|
//拆分设备 每个设备生成一条任务
|
|
|
|
//拆分设备 每个设备生成一条任务
|
|
|
|
List<Long> taskIds=new ArrayList<>(); |
|
|
|
List<Long> taskIds=new ArrayList<>(); |
|
|
|