qiangxuan 6 сар өмнө
parent
commit
2ef8340623

+ 10 - 3
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetHotsend/service/impl/BilletHotsendBaseServiceImpl.java

@@ -631,10 +631,14 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 		LambdaQueryWrapper<StorageBill> queryWrapperSB = new LambdaQueryWrapper<>();
 		queryWrapperSB.eq(StorageBill::getId, billetHotsendDetailsVo.getStorageBill().getId());
 		StorageBill storageBillInfo = storageBillService.getOne(queryWrapperSB);
+		if (oConvertUtils.isEmpty(storageBillInfo)){
+			storageBill.setAmountTotal(rollClubCommonList.size());
+		}else {
+			storageBill.setAmountTotal(storageBillInfo.getAmountTotal() + rollClubCommonList.size());
+		}
 		// 更新装运单 车次总序号、本车车次
 		storageBill.setTypeConfigId(billetHotsendDetailsVo.getBilletHotsendTypeConfigId()); // 钢坯配置类型ID
 		storageBill.setDestination(billetHotsendDetailsVo.getBelongTypeName());// 目的地
-		storageBill.setAmountTotal(storageBillInfo.getAmountTotal() + rollClubCommonList.size());
 		storageBillService.updateById(storageBill);
 		result.put("success", "新增钢坯热送成功!");
 		return result;
@@ -998,10 +1002,13 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 		LambdaQueryWrapper<StorageBill> queryWrapperSB = new LambdaQueryWrapper<>();
 		queryWrapperSB.eq(StorageBill::getId, billetHotsendDetailsVo.getStorageBill().getId());
 		StorageBill storageBillInfo = storageBillService.getOne(queryWrapperSB);
-
+		if (oConvertUtils.isEmpty(storageBillInfo)){
+			storageBill.setAmountTotal(rollClubCommonList.size());
+		}else {
+			storageBill.setAmountTotal(storageBillInfo.getAmountTotal() + rollClubCommonList.size());
+		}
 		storageBill.setTypeConfigId(billetHotsendDetailsVo.getBilletHotsendTypeConfigId()); // 钢坯配置类型ID
 		storageBill.setDestination(billetHotsendDetailsVo.getBelongTypeName());// 目的地
-		storageBill.setAmountTotal(storageBillInfo.getAmountTotal() + rollClubCommonList.size());
 		storageBill.setOutTime(new Date());
 		storageBillService.updateById(storageBill);
 		// 生成储运单

+ 13 - 2
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/stackingAndLoadingVehicles/service/impl/StackingAndLoadingVehiclesServiceImpl.java

@@ -1,5 +1,6 @@
 package org.jeecg.modules.billet.stackingAndLoadingVehicles.service.impl;
 
+import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.IdWorker;
@@ -476,8 +477,13 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
                 .eq(BilletHotsend::getShiftGroup, cacheShintGroup);
         BilletHotsend idExistBh = billetHotsendBaseService.getOne(queryWrapper);
         if (oConvertUtils.isNotEmpty(idExistBh)){
+            if (idExistBh.getStackNum() < stackingAndLoadingVehiclesList.size() * 4){
+                billetHotsend.setStackNum(stackingAndLoadingVehiclesList.size() * 4); // 堆垛总支数
+                log.info("{}{}", ">>>>>>>>>堆垛总支数计算出现异常:", JSON.toJSON(loadingParams));
+            }else {
+                billetHotsend.setStackNum(idExistBh.getStackNum() - stackingAndLoadingVehiclesList.size() * 4); // 堆垛总支数
+            }
             // 钢坯热送基础信息存在,但是钢坯信息不存在 直接返回
-            billetHotsend.setStackNum(idExistBh.getStackNum() - stackingAndLoadingVehiclesList.size() * 4); // 堆垛总支数
             LambdaUpdateWrapper<BilletHotsend> updateWrapper = new LambdaUpdateWrapper<>();
             updateWrapper.eq(BilletHotsend::getCcmNo, billetHotsend.getCcmNo())
                     .eq(BilletHotsend::getHeatNo, billetHotsend.getHeatNo())
@@ -582,8 +588,13 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
                 .eq(BilletHotsend::getShiftGroup, cacheShintGroup);
         BilletHotsend idExistBh = billetHotsendBaseService.getOne(queryWrapper);
         if (oConvertUtils.isNotEmpty(idExistBh)){
+            if (idExistBh.getStackNum() < stackingAndLoadingVehiclesList.size() * 4){
+                billetHotsend.setStackNum(stackingAndLoadingVehiclesList.size() * 4); // 堆垛总支数
+                log.info("{}{}", ">>>>>>>>>堆垛总支数计算出现异常:", JSON.toJSON(loadingParams));
+            }else {
+                billetHotsend.setStackNum(idExistBh.getStackNum() - stackingAndLoadingVehiclesList.size() * 4); // 堆垛总支数
+            }
             // 钢坯热送基础信息存在,但是钢坯信息不存在 直接返回
-            billetHotsend.setStackNum(idExistBh.getStackNum() - stackingAndLoadingVehiclesList.size() * 4); // 堆垛总支数
             LambdaUpdateWrapper<BilletHotsend> updateWrapper = new LambdaUpdateWrapper<>();
             updateWrapper.eq(BilletHotsend::getCcmNo, billetHotsend.getCcmNo())
                     .eq(BilletHotsend::getHeatNo, billetHotsend.getHeatNo())