qiangxuan преди 2 месеца
родител
ревизия
51f3f4a7df

+ 8 - 13
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/storageBill/service/impl/StorageBillServiceImpl.java

@@ -2833,10 +2833,9 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
                     List<RollClubCommon> groupRollClubCommonList = entry.getValue();
                     JSONObject jsonObject = commonBilletHotsenAndDetailsHandle(billetHotsend, billetHotsendDetailsVo, billetHotsendTypeConfig, storageBill, groupRollClubCommonList, null);
                     if (jsonObject.containsKey("fail")) {
-                        TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                         log.info("{}{}", "编辑装运单,未知目的地数据同步操作失败,事务回滚!", jsonObject);
                         result.put("fail", "编辑装运单,未知目的地数据同步操作失败!");
-                        return result;
+                        throw new RuntimeException("编辑装运单,未知目的地数据同步操作失败!");
                     }
                 }
                 List<String> billetNos = rollClubCommonHotChargeList.stream().map(RollClubCommon::getBilletNo).collect(Collectors.toList());
@@ -2906,10 +2905,9 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
                             .eq(BilletHotsend::getShiftGroup, billetHotsend.getShiftGroup());
                     BilletHotsend idExistBh = billetHotsendBaseMapper.selectOne(queryWrapper);
                     if (oConvertUtils.isEmpty(idExistBh)){
-                        TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                         log.info("{}{}", "编辑装运单,钢坯热送单为空,堆垛数据同步失败:", JSON.toJSON(billetHotsend));
                         result.put("fail", "编辑装运单,钢坯热送单为空,堆垛数据同步操作失败!");
-                        return result;
+                        throw new RuntimeException("编辑装运单,钢坯热送单为空,堆垛数据同步操作失败!");
                     }
                     billetHotsend.setId(idExistBh.getId());
                     // 钢坯热送基础信息存在,但是钢坯信息不存在 直接返回
@@ -2939,8 +2937,9 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
                         .in(BilletBasicInfo::getBilletNo, billetNosList);
                 billetBasicInfoStackList = billetBasicInfoService.list(queryWrapperls);
                 if (oConvertUtils.listIsEmpty(billetBasicInfoStackList)) {
+                    log.info("编辑装运单,钢坯基础信息为空,堆垛数据同步失败!");
                     result.put("fail", "编辑装运单,钢坯基础信息为空,堆垛数据同步失败!");
-                    return result;
+                    throw new RuntimeException("编辑装运单,钢坯基础信息为空,堆垛数据同步失败!");
                 }
                 //5 查询并批量更新钢坯基础信息 belongTable
                 billetBasicInfoStackList.forEach(x ->{
@@ -2998,10 +2997,9 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
             billetAutoTmpService.removeBatchByIds(billetAutoTmpList.stream().map(BilletAutoTmp::getId).collect(Collectors.toList()));
             result.put("success", "B端编辑装运单未知目的地明细同步成功!");
             return result;
-        }catch (Exception e){
-            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+        } catch (Exception e) {
             // 记录异常日志
-            log.error("B端编辑装运单未知目的地明细同步发生异常", e.getMessage());
+            log.error("B端编辑装运单未知目的地明细同步发生异常", e);
             result.put("fail", "系统错误,请稍后再试!");
             return result;
         }
@@ -3090,10 +3088,9 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
                     List<RollClubCommon> groupRollClubCommonList = entry.getValue();
                     JSONObject jsonObject = commonBilletHotsenAndDetailsHandle(billetHotsend, billetHotsendDetailsVo, billetHotsendTypeConfig, storageBill, groupRollClubCommonList, null);
                     if (jsonObject.containsKey("fail")) {
-                        TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                         log.info("{}{}", "监控看板确认目的地,未知目的地数据同步操作失败,事务回滚!", jsonObject);
                         result.put("fail", "监控看板确认目的地,未知目的地数据同步操作失败!");
-                        return result;
+                        throw new RuntimeException("监控看板确认目的地,未知目的地数据同步操作失败!");
                     }
                 }
                 List<String> billetNos = rollClubCommonHotChargeList.stream().map(RollClubCommon::getBilletNo).collect(Collectors.toList());
@@ -3164,10 +3161,9 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
                             .eq(BilletHotsend::getShiftGroup, billetHotsend.getShiftGroup());
                     BilletHotsend idExistBh = billetHotsendBaseMapper.selectOne(queryWrapper);
                     if (oConvertUtils.isEmpty(idExistBh)){
-                        TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                         log.info("{}{}", "监控看板确认目的地,钢坯热送单为空,堆垛数据同步失败:", JSON.toJSON(billetHotsend));
                         result.put("fail", "监控看板确认目的地,钢坯热送单为空,堆垛数据同步操作失败!");
-                        return result;
+                        throw new RuntimeException("监控看板确认目的地,钢坯热送单为空,堆垛数据同步操作失败!");
                     }
                     billetHotsend.setId(idExistBh.getId());
                     // 钢坯热送基础信息存在,但是钢坯信息不存在 直接返回
@@ -3258,7 +3254,6 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
             result.put("success", "B端监控看板确认目的地同步成功!");
             return result;
         }catch (Exception e){
-            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
             // 记录异常日志
             log.error("B端监控看板确认目的地,同步发生异常", e.getMessage());
             result.put("fail", "系统错误,请稍后再试!");