Browse Source

# 消缺事务问题

zhongwei
haungxing 1 year ago
parent
commit
86f719cd66
  1. 20
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/DefectCheckServiceImpl.java

20
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/DefectCheckServiceImpl.java

@ -163,6 +163,16 @@ public class DefectCheckServiceImpl extends BaseServiceImpl<OperPhenomenonMapper
// if (CollectionUtil.isEmpty(list)) {
// throw new ServiceException("请先添加甄别缺陷角色用户,再发起现象!");
// }
//新增缺陷流程记录
OperDefectStatisticsEntity operDefectStatisticsEntity = new OperDefectStatisticsEntity();
BeanUtil.copy(entity, operDefectStatisticsEntity);
statisticsService.save(operDefectStatisticsEntity);
//新增现象记录
OperAppearanceEntity operAppearanceEntity = new OperAppearanceEntity();
BeanUtil.copy(entity, operAppearanceEntity);
operAppearanceService.save(operAppearanceEntity);
// 现象发起人名字
String userName = Optional.ofNullable(UserCache.getUser(entity.getFinder()).getName()).orElse("");
// 现象发起来源
@ -180,15 +190,9 @@ public class DefectCheckServiceImpl extends BaseServiceImpl<OperPhenomenonMapper
}
// 关联流程唯一键
entity.setCheckProcessInstanceId(result.getData().getProcessInstanceId());
operDefectStatisticsEntity.setCheckProcessInstanceId(result.getData().getProcessInstanceId());
this.baseMapper.updateById(entity);
//新增缺陷流程记录
OperDefectStatisticsEntity operDefectStatisticsEntity = new OperDefectStatisticsEntity();
BeanUtil.copy(entity, operDefectStatisticsEntity);
statisticsService.save(operDefectStatisticsEntity);
//新增现象记录
OperAppearanceEntity operAppearanceEntity = new OperAppearanceEntity();
BeanUtil.copy(entity, operAppearanceEntity);
operAppearanceService.save(operAppearanceEntity);
statisticsService.updateById(operDefectStatisticsEntity);
}
/**

Loading…
Cancel
Save