diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenanceTaskSchedule.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenanceTaskSchedule.java index cbe29fc..cf7d0b9 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenanceTaskSchedule.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenanceTaskSchedule.java @@ -76,7 +76,7 @@ public class MaintenanceTaskSchedule { * 根据日常维护计划生成日常维护任务 * @param plan 日常维护计划 */ - private void generateTaskByPlan(OperMaintenancePlanEntity plan) { + public void generateTaskByPlan(OperMaintenancePlanEntity plan) { try { OperMaintenanceTaskEntity taskEntity = BeanUtil.copy(plan,OperMaintenanceTaskEntity.class); taskEntity.setPlanId(plan.getId()); @@ -104,8 +104,8 @@ public class MaintenanceTaskSchedule { for (OperMaintenanceTaskEntity maintenanceTask : maintenanceTasks) { if(Func.isNotEmpty(maintenanceTask.getProcessInstanceId())) { flowClient.delProcessInstanceById(maintenanceTask.getProcessInstanceId(),"错误流程"); - taskService.removeById(maintenanceTask.getId()); } + taskService.removeById(maintenanceTask.getId()); } } } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenancePlanServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenancePlanServiceImpl.java index 2099a87..83e30e3 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenancePlanServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenancePlanServiceImpl.java @@ -14,6 +14,7 @@ import com.hnac.hzims.operational.maintenance.entity.OperMaintenanceTaskEntity; import com.hnac.hzims.operational.maintenance.mapper.OperMaintenancePlanMapper; import com.hnac.hzims.operational.maintenance.scheduled.MaintenancePlanCreateTask; import com.hnac.hzims.operational.maintenance.scheduled.MaintenanceTaskCreateTask; +import com.hnac.hzims.operational.maintenance.scheduled.MaintenanceTaskSchedule; import com.hnac.hzims.operational.maintenance.service.IOperMaintenancePlanService; import com.hnac.hzims.operational.maintenance.template.service.TemplateService; import com.hnac.hzims.operational.maintenance.vo.OperMaintenancePlanVO; @@ -54,7 +55,6 @@ public class OperMaintenancePlanServiceImpl extends BaseServiceImpl templateService; @Override @@ -95,34 +95,33 @@ public class OperMaintenancePlanServiceImpl extends BaseServiceImpl planEntities = list(new LambdaQueryWrapper(){{ in(OperMaintenancePlanEntity::getId,idList); + isNotNull(OperMaintenancePlanEntity::getCreateTaskTime); }}); - //筛选当月没生成任务的计划 - List finalPlanEntities = planEntities.stream().filter(planEntity -> { - Date createTaskTime = planEntity.getCreateTaskTime(); - return ObjectUtil.isEmpty(createTaskTime) - || !DateUtil.judgeSameDay(DateUtil.DateToLocalDateTime(createTaskTime), LocalDate.now()); - }).collect(Collectors.toList()); - if(CollectionUtil.isEmpty(finalPlanEntities)) { - return R.success("所选计划当天已生成任务"); - } - MaintenanceTaskCreateTask schedule = SpringUtil.getBean(MaintenanceTaskCreateTask.class); - finalPlanEntities.forEach(planEntity -> { - try{ - schedule.generateTaskByPlan(planEntity,false); - //更新任务派发时间 - this.update(new LambdaUpdateWrapper().set(OperMaintenancePlanEntity::getCreateTaskTime,new Date()) - .eq(OperMaintenancePlanEntity::getId,planEntity.getId())); - - } - catch(Exception e) { - BladeLogger logger = SpringUtil.getBean(BladeLogger.class); - logger.error("maintenance:generateTask",e.getMessage()); - } - }); - - - - + MaintenanceTaskSchedule maintenanceTaskSchedule = SpringUtil.getBean(MaintenanceTaskSchedule.class); + planEntities.forEach(plan -> maintenanceTaskSchedule.generateTaskByPlan(plan)); +// //筛选当月没生成任务的计划 +// List finalPlanEntities = planEntities.stream().filter(planEntity -> { +// Date createTaskTime = planEntity.getCreateTaskTime(); +// return ObjectUtil.isEmpty(createTaskTime) +// || !DateUtil.judgeSameDay(DateUtil.DateToLocalDateTime(createTaskTime), LocalDate.now()); +// }).collect(Collectors.toList()); +// if(CollectionUtil.isEmpty(finalPlanEntities)) { +// return R.success("所选计划当天已生成任务"); +// } +// MaintenanceTaskCreateTask schedule = SpringUtil.getBean(MaintenanceTaskCreateTask.class); +// finalPlanEntities.forEach(planEntity -> { +// try{ +// schedule.generateTaskByPlan(planEntity,false); +// //更新任务派发时间 +// this.update(new LambdaUpdateWrapper().set(OperMaintenancePlanEntity::getCreateTaskTime,new Date()) +// .eq(OperMaintenancePlanEntity::getId,planEntity.getId())); +// +// } +// catch(Exception e) { +// BladeLogger logger = SpringUtil.getBean(BladeLogger.class); +// logger.error("maintenance:generateTask",e.getMessage()); +// } +// }); return R.success("操作成功"); } diff --git a/hzims-service/operational/src/main/resources/db/1.0.1.sql b/hzims-service/operational/src/main/resources/db/1.0.1.sql index 3d5860e..962bc44 100644 --- a/hzims-service/operational/src/main/resources/db/1.0.1.sql +++ b/hzims-service/operational/src/main/resources/db/1.0.1.sql @@ -1,2 +1,9 @@ alter table hzims_oper_maintenance_plan add column station_code varchar(60) comment '站点编码'; -alter table `hzims_oper_maintenance_task` add column `is_delay` tinyint(2) DEFAULT 0 COMMENT '是否逾期'; \ No newline at end of file +alter table `hzims_oper_maintenance_task` add column `is_delay` tinyint(2) DEFAULT 0 COMMENT '是否逾期'; +-- 补充执行人、创建人、更新人名称 +alter table `hzims_oper_maintenance_task` add column `disposer_name` varchar(255) comment '执行人姓名'; +alter table `hzims_oper_maintenance_task` add column `create_user_name` varchar(255) comment '创建人姓名'; +alter table `hzims_oper_maintenance_task` add column `update_user_name` varchar(255) comment '更新人姓名'; +alter table `hzims_oper_maintenance_plan` add column `disposer_name` varchar(255) comment '执行人姓名'; +alter table `hzims_oper_maintenance_plan` add column `create_user_name` varchar(255) comment '创建人姓名'; +alter table `hzims_oper_maintenance_plan` add column `update_user_name` varchar(255) comment '更新人姓名'; diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java index a37d029..dff3284 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java @@ -326,6 +326,7 @@ public class FirstWorkTicketServiceImpl extends BaseServiceImpl getTicketParamById(Long ticketId,WorkTicketInfoEntity workTicketInfoEntity) { Map params = ObjectUtils.obj2Map(workTicketInfoEntity); params.put("signerName",Optional.ofNullable(workTicketInfoEntity.getSigner()).map(UserCache::getUser).map(User::getName).orElse(null)); + params.put("membersCount",workTicketInfoEntity.getTotalPerson()); // 获取两票安措 List measures = workTicketSafetyMeasureService.selectByTicketId(ticketId); if(CollectionUtil.isNotEmpty(measures)) {