Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
yang_shj 10 months ago
parent
commit
776eaa8ba5
  1. 4
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenanceTaskSchedule.java
  2. 55
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenancePlanServiceImpl.java
  3. 9
      hzims-service/operational/src/main/resources/db/1.0.1.sql
  4. 1
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java

4
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());
}
}
}

55
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<OperMaintena
private final IDangerSourceClient dangerSourceClient;
private final List<TemplateService> templateService;
@Override
@ -95,34 +95,33 @@ public class OperMaintenancePlanServiceImpl extends BaseServiceImpl<OperMaintena
//获取日常维护计划
List<OperMaintenancePlanEntity> planEntities = list(new LambdaQueryWrapper<OperMaintenancePlanEntity>(){{
in(OperMaintenancePlanEntity::getId,idList);
isNotNull(OperMaintenancePlanEntity::getCreateTaskTime);
}});
//筛选当月没生成任务的计划
List<OperMaintenancePlanEntity> 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<OperMaintenancePlanEntity>().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<OperMaintenancePlanEntity> 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<OperMaintenancePlanEntity>().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("操作成功");
}

9
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 '是否逾期';
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 '更新人姓名';

1
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java

@ -326,6 +326,7 @@ public class FirstWorkTicketServiceImpl extends BaseServiceImpl<WorkTicketInfoMa
private Map<String,Object> 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<WorkTicketSafetyMeasureEntity> measures = workTicketSafetyMeasureService.selectByTicketId(ticketId);
if(CollectionUtil.isNotEmpty(measures)) {

Loading…
Cancel
Save