diff --git a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/DealDutyRecFlowServiceImpl.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/DealDutyRecFlowServiceImpl.java index 92abff0..03e4ec7 100644 --- a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/DealDutyRecFlowServiceImpl.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/DealDutyRecFlowServiceImpl.java @@ -57,9 +57,12 @@ public class DealDutyRecFlowServiceImpl extends ProcessAbstractService { */ @Override public void calculate(ProcessWorkFlowResponse response) { + log.info("交接班v4消费流程执行中,param"+response); R dealtDutyRecFlow = iDutyRecClient.dealDutyRecFlow(response); if (!dealtDutyRecFlow.isSuccess()){ + log.error("消费交接班失败"+response); throw new ServiceException("执行交接班v4失败"); } + log.info("交接班v4消费流程结束,param"+response); } } diff --git a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/DefectProcessServiceImpl.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/DefectProcessServiceImpl.java index 97a1266..23e2349 100644 --- a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/DefectProcessServiceImpl.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/DefectProcessServiceImpl.java @@ -58,10 +58,12 @@ public class DefectProcessServiceImpl extends ProcessAbstractService { */ @Override public void calculate(ProcessWorkFlowResponse response) { + log.info("消缺工作流程消费开始---param",response); R defect = defectClient.saveDefect(response); if (!defect.isSuccess()) { + log.error("消缺工作流程消费调取对应业务报错---param",response); throw new ServiceException("消缺工作流程出现异常呢"); - } + log.info("消缺工作消费流程结束---param",response); } } diff --git a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/MachineryTicketProcessServiceImpl.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/MachineryTicketProcessServiceImpl.java index 48d0154..6e28602 100644 --- a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/MachineryTicketProcessServiceImpl.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/MachineryTicketProcessServiceImpl.java @@ -61,10 +61,12 @@ public class MachineryTicketProcessServiceImpl extends ProcessAbstractService { */ @Override public void calculate(ProcessWorkFlowResponse response) { + log.info("水力机械工作票消费流程开始---param",response); Boolean pending = ticketProcessService.findPending(response); if (!pending) { + log.error("水力机械工作票消费调用报错---param",response); throw new ServiceException("水力机械工作票流程出现异常呢"); - } + log.info("水力机械工作票消费流程结束---param",response); } } diff --git a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/MaintenanceProcessServiceImpl.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/MaintenanceProcessServiceImpl.java index 972e37b..d9fd8ff 100644 --- a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/MaintenanceProcessServiceImpl.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/MaintenanceProcessServiceImpl.java @@ -58,9 +58,12 @@ public class MaintenanceProcessServiceImpl extends ProcessAbstractService { */ @Override public void calculate(ProcessWorkFlowResponse response) { + log.info("日常维护消费开始---param",response); Boolean pending = maintenanceFeignClient.findPending(response); if (!pending) { + log.error("日常维护消费报错---param",response); throw new ServiceException("日常维护业务流程出错呢"); } + log.info("日常维护消费结束---param",response); } } diff --git a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/OneTicketProcessServiceImpl.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/OneTicketProcessServiceImpl.java index 600e82d..170d403 100644 --- a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/OneTicketProcessServiceImpl.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/OneTicketProcessServiceImpl.java @@ -66,10 +66,12 @@ public class OneTicketProcessServiceImpl extends ProcessAbstractService { */ @Override public void calculate(ProcessWorkFlowResponse response) { + log.info("工作票消费调用开始---param",response); Boolean pending = ticketProcessService.findPending(response); if (!pending) { + log.error("工作票消费调用异常---param",response); throw new ServiceException("工作票流程出现异常呢"); - } + log.info("工作票消费调用结束---param",response); } } diff --git a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/OperationTicketProcessServiceImpl.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/OperationTicketProcessServiceImpl.java index 608f866..f7cd785 100644 --- a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/OperationTicketProcessServiceImpl.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/OperationTicketProcessServiceImpl.java @@ -62,9 +62,12 @@ public class OperationTicketProcessServiceImpl extends ProcessAbstractService { */ @Override public void calculate(ProcessWorkFlowResponse response) { + log.info("操作票流程消费调用fein接口开始---param",response); Boolean pending = operationTicketFeignClient.findPending(response); if (!pending) { + log.info("操作票流程调用fein接口异常---param",response); throw new ServiceException("操作票流程出现异常呢"); } + log.info("操作票流程消费调用fein接口结束---param",response); } } diff --git a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/OverhaulPlanServiceImpl.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/OverhaulPlanServiceImpl.java index 57bc9e2..89ed0c4 100644 --- a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/OverhaulPlanServiceImpl.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/OverhaulPlanServiceImpl.java @@ -46,9 +46,12 @@ public class OverhaulPlanServiceImpl extends ProcessAbstractService { */ @Override public void calculate(ProcessWorkFlowResponse response) { + log.info("检修计划调用fein消费开始---param",response); R defect = accessPlanV4Client.listener(response); if (!defect.isSuccess()) { + log.error("检修计划调用fein异常---param",response); throw new ServiceException("检修计划业务执行异常!"); } + log.info("检修计划调用fein结束---param",response); } } diff --git a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/OverhaulTaskServiceImpl.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/OverhaulTaskServiceImpl.java index 3283052..bdfd199 100644 --- a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/OverhaulTaskServiceImpl.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/OverhaulTaskServiceImpl.java @@ -47,10 +47,12 @@ public class OverhaulTaskServiceImpl extends ProcessAbstractService { */ @Override public void calculate(ProcessWorkFlowResponse response) { + log.info("检修计划调用fein接口消费开始---param",response); R defect = accessTaskV4Client.listener(response); if (!defect.isSuccess()) { + log.error("检修计划调用fein接口消费异常---param",response); throw new ServiceException("检修任务业务执行异常!"); - } + log.info("检修计划调用fein接口消费结束---param",response); } } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/MaintenanceController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/MaintenanceController.java index 1def60a..d504a91 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/MaintenanceController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/MaintenanceController.java @@ -55,11 +55,13 @@ public class MaintenanceController { @PostMapping("/findPending") @ApiOperation(value = "日常维护待处理") public Boolean findPending(@RequestBody ProcessWorkFlowResponse response){ + log.info("日常维护消费处理开始:findPending"); try { maintenanceService.findPending(response); return true; } catch (Exception e) { e.printStackTrace(); + log.error("param"+response+"报错信息"+e.toString()); throw new ServiceException("日常维护待处理:" + e.getMessage()); } } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenanceTaskCreateTask.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenanceTaskCreateTask.java index a87d789..e10a281 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenanceTaskCreateTask.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenanceTaskCreateTask.java @@ -30,6 +30,7 @@ import org.springblade.flow.core.feign.IFlowClient; import org.springframework.beans.factory.annotation.Value; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.jdbc.datasource.DataSourceTransactionManager; +import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import org.springframework.transaction.TransactionDefinition; 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"; @XxlJob(TASK_VALUE_MAINTENANCE_TASK_CREATE) - @Transactional +// @Transactional public ReturnT execute(String param) throws Exception { 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); @@ -107,6 +108,9 @@ public class MaintenanceTaskCreateTask { planEntityLambdaUpdateWrapper.set(OperMaintenancePlanEntity::getCreateTaskTime, new Date()); planEntityLambdaUpdateWrapper.eq(OperMaintenancePlanEntity::getId, planEntities.get(i).getId()); maintenancePlanService.update(planEntityLambdaUpdateWrapper); + log.info("更新任务派发"+planEntities.get(i)); + }else { + log.error("更新任务派发失败"+planEntities.get(i)); } } Thread.sleep(1000); @@ -123,6 +127,7 @@ public class MaintenanceTaskCreateTask { * @return */ public Boolean generateTaskByPlan(OperMaintenancePlanEntity planEntity,Boolean flag) { + log.info("日常维护计划生成任务开始:param"+planEntity); OperMaintenanceTaskEntity taskEntity = BeanUtil.copy(planEntity,OperMaintenanceTaskEntity.class); //拆分设备 每个设备生成一条任务 List taskIds=new ArrayList<>(); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/MaintenanceServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/MaintenanceServiceImpl.java index b9c9785..d8de898 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/MaintenanceServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/MaintenanceServiceImpl.java @@ -143,24 +143,26 @@ public class MaintenanceServiceImpl implements MaintenanceService { // standardTicketInfoVo = (OperMaintenanceTaskEntityVo) jsonObject.get("operMaintenanceTaskEntityVo"); // standardTicketInfoVo = JSONObject.toJavaObject(jsonObject, OperMaintenanceTaskEntityVo.class); } catch (Exception e) { - log.error("获取表单出现异常了~~~~"); + log.error("获取表单出现异常了~~~~"+response); throw new IllegalArgumentException(e.getMessage()); } - //1.查询日常维护信息 - Long id = NumberUtils.toLong(response.getBusinessKey()); - OperMaintenanceTaskEntity dbOperMaintenanceTaskEntity = taskService.getById(id); - if (ObjectUtils.isEmpty(dbOperMaintenanceTaskEntity)) { - log.error("获取日常维护数据不存在"); - return; - } OperMaintenanceTaskEntity entity = new OperMaintenanceTaskEntity(); BeanUtils.copyProperties(standardTicketInfoVo, entity); - entity.setId(id); + //1.查询日常维护信息 + //有Id才进行生成操作 + if (StringUtils.isNotBlank(response.getBusinessKey())) { + Long id = NumberUtils.toLong(response.getBusinessKey()); + OperMaintenanceTaskEntity dbOperMaintenanceTaskEntity = taskService.getById(id); + if (ObjectUtils.isEmpty(dbOperMaintenanceTaskEntity)) { + log.error("获取日常维护数据不存在" + response); + return; + } + entity.setId(id); + //填充日常维护信息 saveOperMaintenanceTaskEntity(entity, response); entity.setProcessInstanceId(response.getProcessInstanceId()); taskService.updateById(entity); - //推送消息 if (response.getTaskId() != null) { // MessagePushRecordDto message = new MessagePushRecordDto(); @@ -225,8 +227,10 @@ public class MaintenanceServiceImpl implements MaintenanceService { } log.info("推送成功~"); } + } } catch (Exception e) { e.printStackTrace(); + log.error("日常维护消费异常:param"+response+"报错信息"+e); } } @@ -310,7 +314,7 @@ public class MaintenanceServiceImpl implements MaintenanceService { * @param finalPlanEntity */ @Override - @Transactional(rollbackFor = Exception.class) +// @Transactional(rollbackFor = Exception.class) public Long fillTask(OperMaintenanceTaskEntity taskEntity, OperMaintenancePlanEntity finalPlanEntity, Boolean flag) { // DefaultTransactionDefinition = new DefaultTransactionDefinition(); // defaultTransactionDefinition.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW);