|
@@ -2828,7 +2828,9 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
|
|
|
if (jsonObject.containsKey("fail")) {
|
|
|
log.info("{}{}", "编辑装运单,未知目的地数据同步操作失败,事务回滚!", jsonObject);
|
|
|
result.put("fail", "编辑装运单,未知目的地数据同步操作失败!");
|
|
|
- throw new RuntimeException("编辑装运单,未知目的地数据同步操作失败!");
|
|
|
+ // 手动回滚事务
|
|
|
+ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
+ return result;
|
|
|
}
|
|
|
}
|
|
|
List<String> billetNos = rollClubCommonHotChargeList.stream().map(RollClubCommon::getBilletNo).collect(Collectors.toList());
|
|
@@ -2900,7 +2902,9 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
|
|
|
if (oConvertUtils.isEmpty(idExistBh)){
|
|
|
log.info("{}{}", "编辑装运单,钢坯热送单为空,堆垛数据同步失败:", JSON.toJSON(billetHotsend));
|
|
|
result.put("fail", "编辑装运单,钢坯热送单为空,堆垛数据同步操作失败!");
|
|
|
- throw new RuntimeException("编辑装运单,钢坯热送单为空,堆垛数据同步操作失败!");
|
|
|
+ // 手动回滚事务
|
|
|
+ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
+ return result;
|
|
|
}
|
|
|
billetHotsend.setId(idExistBh.getId());
|
|
|
// 钢坯热送基础信息存在,但是钢坯信息不存在 直接返回
|
|
@@ -2932,7 +2936,9 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
|
|
|
if (oConvertUtils.listIsEmpty(billetBasicInfoStackList)) {
|
|
|
log.info("编辑装运单,钢坯基础信息为空,堆垛数据同步失败!");
|
|
|
result.put("fail", "编辑装运单,钢坯基础信息为空,堆垛数据同步失败!");
|
|
|
- throw new RuntimeException("编辑装运单,钢坯基础信息为空,堆垛数据同步失败!");
|
|
|
+ // 手动回滚事务
|
|
|
+ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
+ return result;
|
|
|
}
|
|
|
//5 查询并批量更新钢坯基础信息 belongTable
|
|
|
billetBasicInfoStackList.forEach(x ->{
|
|
@@ -3017,9 +3023,11 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
|
|
|
return result;
|
|
|
} catch (Exception e) {
|
|
|
// 记录异常日志
|
|
|
- log.error("B端编辑装运单未知目的地明细同步发生异常", e);
|
|
|
- // 抛出异常触发事务回滚
|
|
|
- throw new RuntimeException(e);
|
|
|
+ log.error("编辑装运单未知目的地明细同步发生异常", e);
|
|
|
+ result.put("fail", "编辑装运单明细同步异常!");
|
|
|
+ // 手动回滚事务
|
|
|
+ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
+ return result;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -3031,13 +3039,12 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
|
|
|
JSONObject result = new JSONObject();
|
|
|
try {
|
|
|
log.info("{}{}", "监控看板确认目的地,数据同步装运单信息:", JSON.toJSON(storageBill));
|
|
|
-
|
|
|
// 根据装运单ID查询钢坯临时表 棒线数据同步、堆垛数据同步
|
|
|
List<BilletAutoTmp> billetAutoTmpList = billetAutoTmpService.list(new LambdaQueryWrapper<BilletAutoTmp>()
|
|
|
.eq(BilletAutoTmp::getStorageBillId, storageBill.getId()));
|
|
|
if (oConvertUtils.listIsEmpty(billetAutoTmpList)){
|
|
|
baseMapper.updateById(storageBill);
|
|
|
- result.put("success", "更新目的地成功!");
|
|
|
+ result.put("success", "看板确认目的地成功!");
|
|
|
return result;
|
|
|
}
|
|
|
|
|
@@ -3107,7 +3114,8 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
|
|
|
if (jsonObject.containsKey("fail")) {
|
|
|
log.info("{}{}", "监控看板确认目的地,未知目的地数据同步操作失败,事务回滚!", jsonObject);
|
|
|
result.put("fail", "监控看板确认目的地,未知目的地数据同步操作失败!");
|
|
|
- throw new RuntimeException("监控看板确认目的地,未知目的地数据同步操作失败!");
|
|
|
+ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
+ return result;
|
|
|
}
|
|
|
}
|
|
|
List<String> billetNos = rollClubCommonHotChargeList.stream().map(RollClubCommon::getBilletNo).collect(Collectors.toList());
|
|
@@ -3180,7 +3188,8 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
|
|
|
if (oConvertUtils.isEmpty(idExistBh)){
|
|
|
log.info("{}{}", "监控看板确认目的地,钢坯热送单为空,堆垛数据同步失败:", JSON.toJSON(billetHotsend));
|
|
|
result.put("fail", "监控看板确认目的地,钢坯热送单为空,堆垛数据同步操作失败!");
|
|
|
- throw new RuntimeException("监控看板确认目的地,钢坯热送单为空,堆垛数据同步操作失败!");
|
|
|
+ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
+ return result;
|
|
|
}
|
|
|
billetHotsend.setId(idExistBh.getId());
|
|
|
// 钢坯热送基础信息存在,但是钢坯信息不存在 直接返回
|
|
@@ -3210,7 +3219,9 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
|
|
|
.in(BilletBasicInfo::getBilletNo, billetNosList);
|
|
|
billetBasicInfoStackList = billetBasicInfoService.list(queryWrapperls);
|
|
|
if (oConvertUtils.listIsEmpty(billetBasicInfoStackList)) {
|
|
|
+ log.info("{}{}", "监控看板确认目的地,钢坯基础信息为空,堆垛数据同步失败:", billetNosList);
|
|
|
result.put("fail", "监控看板确认目的地,钢坯基础信息为空,堆垛数据同步失败!");
|
|
|
+ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
return result;
|
|
|
}
|
|
|
//5 查询并批量更新钢坯基础信息 belongTable
|
|
@@ -3297,8 +3308,11 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
|
|
|
return result;
|
|
|
}catch (Exception e){
|
|
|
// 记录异常日志
|
|
|
- log.error("B端监控看板确认目的地,同步发生异常", e.getMessage());
|
|
|
- throw new RuntimeException(e);
|
|
|
+ log.error("监控看板确认目的地,同步发生异常", e.getMessage());
|
|
|
+ result.put("fail", "编辑装运单明细同步异常!");
|
|
|
+ // 手动回滚事务
|
|
|
+ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
+ return result;
|
|
|
}
|
|
|
}
|
|
|
|