qiangxuan 4 meses atrás
pai
commit
0c7d890966

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

@@ -433,25 +433,39 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
                 result.put("fail", "钢坯装运单不存在,车位发车失败!");
                 return result;
             }
-            // 根据装运单ID查询钢坯临时表
-            List<BilletAutoTmp> billetAutoTmpList = billetAutoTmpService.list(new LambdaQueryWrapper<BilletAutoTmp>()
-                    .eq(BilletAutoTmp::getStorageBillId, storageBill.getId()));
-            if (oConvertUtils.listIsEmpty(billetAutoTmpList)){
-                result.put("fail", "钢坯装运明细不存在,车位发车失败!");
-                return result;
-            }
             List<RollClubCommon> rollClubCommonList = new ArrayList<>();
-            billetAutoTmpList.forEach(x ->{
-                RollClubCommon rollClubCommon = new RollClubCommon();
-                BeanUtils.copyProperties(x, rollClubCommon);
-                rollClubCommon.setGrade(x.getSteel());
-                rollClubCommon.setLength(Integer.valueOf(x.getSize()));
-                rollClubCommon.setBilletWeight(x.getBlankOutput());
-                rollClubCommonList.add(rollClubCommon);
-            });
-            if (oConvertUtils.isEmpty(storageBill.getTypeConfigId())){
-                result.put("fail", "钢坯装运单中目的地ID为空,车位发车失败!");
-                return result;
+            List<BilletAutoTmp> billetAutoTmpList = new ArrayList<>();
+            if ("上若".equals(storageBillInfo.getDestination()) && "16".equals(storageBillInfo.getTypeConfigId())){
+                List<RollOutShippDetails> rollOutShippDetailsList = rollOutShippDetailsService.list(new LambdaQueryWrapper<RollOutShippDetails>()
+                        .eq(RollOutShippDetails::getStorageBillId, storageBill.getId()));
+                if (oConvertUtils.listIsEmpty(billetAutoTmpList)){
+                    result.put("fail", "去上若钢坯装运明细不存在,车位发车失败!");
+                    return result;
+                }
+                rollOutShippDetailsList.forEach(x ->{
+                    RollClubCommon rollClubCommon = new RollClubCommon();
+                    BeanUtils.copyProperties(x, rollClubCommon);
+                    rollClubCommon.setGrade(x.getSteel());
+                    rollClubCommon.setLength(Integer.valueOf(x.getSize()));
+                    rollClubCommon.setBilletWeight(x.getBlankOutput());
+                    rollClubCommonList.add(rollClubCommon);
+                });
+            }else {
+                // 根据装运单ID查询钢坯临时表
+                billetAutoTmpList = billetAutoTmpService.list(new LambdaQueryWrapper<BilletAutoTmp>()
+                        .eq(BilletAutoTmp::getStorageBillId, storageBill.getId()));
+                if (oConvertUtils.listIsEmpty(billetAutoTmpList)){
+                    result.put("fail", "钢坯装运明细不存在,车位发车失败!");
+                    return result;
+                }
+                billetAutoTmpList.forEach(x ->{
+                    RollClubCommon rollClubCommon = new RollClubCommon();
+                    BeanUtils.copyProperties(x, rollClubCommon);
+                    rollClubCommon.setGrade(x.getSteel());
+                    rollClubCommon.setLength(Integer.valueOf(x.getSize()));
+                    rollClubCommon.setBilletWeight(x.getBlankOutput());
+                    rollClubCommonList.add(rollClubCommon);
+                });
             }
             // 根据ID获取钢坯配置信息
             BilletHotsend billetHotsend = new BilletHotsend();
@@ -529,8 +543,10 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
             storageCarLog.setCreateTime(new Date());
             storageCarLogService.save(storageCarLog);
             log.info("{}{}", "B端钢坯车位发车成功!", storageBill.getLicensePlate());
-            // 物理删除钢坯临时表记录
-            billetAutoTmpService.removeBatchByIds(billetAutoTmpList.stream().map(BilletAutoTmp::getId).collect(Collectors.toList()));
+            if (!"上若".equals(storageBillInfo.getDestination()) && !"16".equals(storageBillInfo.getTypeConfigId())){
+                // 物理删除钢坯临时表记录
+                billetAutoTmpService.removeBatchByIds(billetAutoTmpList.stream().map(BilletAutoTmp::getId).collect(Collectors.toList()));
+            }
             result.put("success", "B端钢坯车位发车成功!");
             return result;
         }catch (Exception e){