qiangxuan 1 月之前
父節點
當前提交
29c9a23bea

+ 19 - 14
zgzt-sys-java/jeecg-module-conn/src/main/java/org/jeecg/modules/billetActual/service/impl/BilletHotsendBaseServiceImpl.java

@@ -269,7 +269,6 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 		log.info("{}{}", "C端自动化热装<保存>mqtt参数:", jsonObject);
 		log.info("{}{}", "C端自动化热装<保存>mqtt参数:", jsonObject);
 		BilletHotsendDetailsVo billetHotsendDetailsVo = new BilletHotsendDetailsVo();
 		BilletHotsendDetailsVo billetHotsendDetailsVo = new BilletHotsendDetailsVo();
 
 
-		String ccmNo = jsonObject.getString("ccmNo");
 		String billetNos = jsonObject.getString("billetNos");
 		String billetNos = jsonObject.getString("billetNos");
 		String licensePlate = jsonObject.getString("licensePlate");
 		String licensePlate = jsonObject.getString("licensePlate");
 		String destination = jsonObject.getString("destination");
 		String destination = jsonObject.getString("destination");
@@ -284,16 +283,20 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 			log.info("{}{}", "参数为空,C端自动化热装<保存>失败!", jsonObject);
 			log.info("{}{}", "参数为空,C端自动化热装<保存>失败!", jsonObject);
 			return;
 			return;
 		}
 		}
-		// 取钢坯号的第九位字符
-		ccmNo = Optional.ofNullable(billetNos)
-				.filter(s -> !s.isEmpty())
-				.map(s -> s.split(","))
-				.filter(arr -> arr.length > 0)
-				.map(arr -> arr[0])
-				.filter(num -> num.length() >= 9)
-				.map(num -> String.valueOf(num.charAt(8)))
-				.orElse("");
-		log.info("C端自动化热装,钢坯中截取的铸机号:{}", ccmNo);
+		String ccmNo = jsonObject.getString("ccmNo");
+		// 2号车位不验证铸机号
+		if (positionNum.equals("2")) {
+			// 取钢坯号的第九位字符
+			ccmNo = Optional.ofNullable(billetNos)
+					.filter(s -> !s.isEmpty())
+					.map(s -> s.split(","))
+					.filter(arr -> arr.length > 0)
+					.map(arr -> arr[0])
+					.filter(num -> num.length() >= 9)
+					.map(num -> String.valueOf(num.charAt(8)))
+					.orElse("");
+			log.info("C端自动化热装,钢坯中截取的铸机号:{}", ccmNo);
+		}
 		String shiftGroup = shiftGroupHandle(ccmNo);
 		String shiftGroup = shiftGroupHandle(ccmNo);
 		String shift = shiftHandle(ccmNo);
 		String shift = shiftHandle(ccmNo);
 		log.info("C端自动化热装缓存中的班组、班别:{}", shiftGroup + ":" + shift);
 		log.info("C端自动化热装缓存中的班组、班别:{}", shiftGroup + ":" + shift);
@@ -306,7 +309,6 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 		// 独立保存行车吊运单
 		// 独立保存行车吊运单
 		billetLiftingBill.setId(String.valueOf(IdWorker.getId()));
 		billetLiftingBill.setId(String.valueOf(IdWorker.getId()));
 		billetLiftingBill.setCcmNo(ccmNo);
 		billetLiftingBill.setCcmNo(ccmNo);
-		billetLiftingBill.setBilletsNo(billetNos);
 		billetLiftingBill.setShiftGroup(shiftGroup);
 		billetLiftingBill.setShiftGroup(shiftGroup);
 		billetLiftingBill.setShift(shift);
 		billetLiftingBill.setShift(shift);
 		billetLiftingBill.setVehicleNumber(jsonObject.getString("vehicleNumber"));
 		billetLiftingBill.setVehicleNumber(jsonObject.getString("vehicleNumber"));
@@ -329,7 +331,6 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 		billetLiftingBill.setBilletWeight(0.00);
 		billetLiftingBill.setBilletWeight(0.00);
 		saveBilletLiftingBillsHotCharge(billetLiftingBill);
 		saveBilletLiftingBillsHotCharge(billetLiftingBill);
 		log.info("C端自动化热装保存吊运单成功: {}", billetLiftingBill.getBilletsNo());
 		log.info("C端自动化热装保存吊运单成功: {}", billetLiftingBill.getBilletsNo());
-
 		// 首先查询钢坯装运单
 		// 首先查询钢坯装运单
 		LambdaQueryWrapper<StorageBill> queryWrapper2 = new LambdaQueryWrapper<>();
 		LambdaQueryWrapper<StorageBill> queryWrapper2 = new LambdaQueryWrapper<>();
 		queryWrapper2.eq(StorageBill::getPositionNum, Integer.valueOf(positionNum))
 		queryWrapper2.eq(StorageBill::getPositionNum, Integer.valueOf(positionNum))
@@ -340,7 +341,7 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 		}
 		}
 		StorageBill isStorageBill = storageBillService.getOne(queryWrapper2);
 		StorageBill isStorageBill = storageBillService.getOne(queryWrapper2);
 		if (oConvertUtils.isEmpty(isStorageBill)) {
 		if (oConvertUtils.isEmpty(isStorageBill)) {
-			log.info("未查询到钢坯装运单信息,车位号为:{},C端自动化装保存失败!", positionNum);
+			log.info("未查询到钢坯装运单信息,车位号为:{},C端自动化装保存失败!", positionNum);
 			return;
 			return;
 		}
 		}
 
 
@@ -373,6 +374,10 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 				.isNull(BilletBasicInfo::getBelongTable)
 				.isNull(BilletBasicInfo::getBelongTable)
 				.isNull(BilletBasicInfo::getBhtcId);
 				.isNull(BilletBasicInfo::getBhtcId);
 		List<BilletBasicInfo> billetBasicInfoLists = billetBasicInfoService.list(queryWrapper1);
 		List<BilletBasicInfo> billetBasicInfoLists = billetBasicInfoService.list(queryWrapper1);
+		if (oConvertUtils.listIsEmpty(billetBasicInfoLists)){
+			log.info("{}{}", "钢坯基础信息为空,C端自动化热装失败!", jsonObject);
+			return;
+		}
 		if (oConvertUtils.listIsEmpty(billetBasicInfoLists)){
 		if (oConvertUtils.listIsEmpty(billetBasicInfoLists)){
 			log.info("{}{}", "钢坯基础信息不存在,C端自动化热装<保存>失败!", jsonObject);
 			log.info("{}{}", "钢坯基础信息不存在,C端自动化热装<保存>失败!", jsonObject);
 			BilletAutoException billetAutoException = createBilletAutoException(ccmNo, billetNos, shiftGroupHandle(ccmNo), shiftHandle(ccmNo), null);
 			BilletAutoException billetAutoException = createBilletAutoException(ccmNo, billetNos, shiftGroupHandle(ccmNo), shiftHandle(ccmNo), null);

+ 34 - 44
zgzt-sys-java/jeecg-module-conn/src/main/java/org/jeecg/modules/stackingAndLoadingVehicles/service/impl/StackingAndLoadingVehiclesServiceImpl.java

@@ -29,7 +29,6 @@ import org.jeecg.modules.billetLiftingBill.service.IBilletLiftingBillService;
 import org.jeecg.modules.connConfig.configMqtt.mapper.ConfigMqttMapper;
 import org.jeecg.modules.connConfig.configMqtt.mapper.ConfigMqttMapper;
 import org.jeecg.modules.operateLog.entity.OperateLog;
 import org.jeecg.modules.operateLog.entity.OperateLog;
 import org.jeecg.modules.operateLog.service.IOperateLogService;
 import org.jeecg.modules.operateLog.service.IOperateLogService;
-import org.jeecg.modules.push.utils.MqttClientCallback;
 import org.jeecg.modules.push.utils.MqttClientUtil;
 import org.jeecg.modules.push.utils.MqttClientUtil;
 import org.jeecg.modules.push.utils.TopicType;
 import org.jeecg.modules.push.utils.TopicType;
 import org.jeecg.modules.rollClubThree.entity.RollClubThree;
 import org.jeecg.modules.rollClubThree.entity.RollClubThree;
@@ -44,8 +43,6 @@ import org.jeecg.modules.rollDeputyCross.entity.RollDeputyCross;
 import org.jeecg.modules.rollDeputyCross.entity.RollDeputyCrossDetails;
 import org.jeecg.modules.rollDeputyCross.entity.RollDeputyCrossDetails;
 import org.jeecg.modules.rollDeputyCross.service.IRollDeputyCrossDetailsService;
 import org.jeecg.modules.rollDeputyCross.service.IRollDeputyCrossDetailsService;
 import org.jeecg.modules.rollDeputyCross.service.IRollDeputyCrossService;
 import org.jeecg.modules.rollDeputyCross.service.IRollDeputyCrossService;
-import org.jeecg.modules.rollHeight.entity.RollHeight;
-import org.jeecg.modules.rollHeight.entity.RollHeightDetails;
 import org.jeecg.modules.rollHeight.service.IRollHeightDetailsService;
 import org.jeecg.modules.rollHeight.service.IRollHeightDetailsService;
 import org.jeecg.modules.rollHeight.service.IRollHeightService;
 import org.jeecg.modules.rollHeight.service.IRollHeightService;
 import org.jeecg.modules.rollOutShipp.entity.RollOutShipp;
 import org.jeecg.modules.rollOutShipp.entity.RollOutShipp;
@@ -60,11 +57,8 @@ import org.jeecg.modules.stackingAndLoadingVehicles.service.IStackingAndLoadingV
 import org.jeecg.modules.stackingAndLoadingVehicles.service.IStackingDownLogService;
 import org.jeecg.modules.stackingAndLoadingVehicles.service.IStackingDownLogService;
 import org.jeecg.modules.stackingAndLoadingVehicles.service.IStackingUpLogService;
 import org.jeecg.modules.stackingAndLoadingVehicles.service.IStackingUpLogService;
 import org.jeecg.modules.stackingAndLoadingVehicles.vo.LoadingParams;
 import org.jeecg.modules.stackingAndLoadingVehicles.vo.LoadingParams;
-import org.jeecg.modules.storageBill.entity.ShiftEnum;
-import org.jeecg.modules.storageBill.entity.ShiftGroupEnum;
 import org.jeecg.modules.storageBill.entity.StorageBill;
 import org.jeecg.modules.storageBill.entity.StorageBill;
 import org.jeecg.modules.storageBill.service.IStorageBillService;
 import org.jeecg.modules.storageBill.service.IStorageBillService;
-import org.jeecg.modules.storageCarLog.entity.StorageCarLog;
 import org.jeecg.modules.storageCarLog.service.IStorageCarLogService;
 import org.jeecg.modules.storageCarLog.service.IStorageCarLogService;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -73,11 +67,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.interceptor.TransactionAspectSupport;
 import org.springframework.transaction.interceptor.TransactionAspectSupport;
-
 import java.util.*;
 import java.util.*;
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.stream.Collectors;
 import java.util.stream.Collectors;
 
 
@@ -317,8 +307,6 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
         BilletLiftingBill billetLiftingBill = new BilletLiftingBill();
         BilletLiftingBill billetLiftingBill = new BilletLiftingBill();
         billetLiftingBill.setId(String.valueOf(IdWorker.getId()));
         billetLiftingBill.setId(String.valueOf(IdWorker.getId()));
         billetLiftingBill.setCcmNo(ccmNo);
         billetLiftingBill.setCcmNo(ccmNo);
-        billetLiftingBill.setShiftGroup(shiftGroupHandle(ccmNo));
-        billetLiftingBill.setShift(shiftHandle(ccmNo));
         billetLiftingBill.setAddress(address);
         billetLiftingBill.setAddress(address);
         billetLiftingBill.setLayer(layer);
         billetLiftingBill.setLayer(layer);
         billetLiftingBill.setVehicleNumber(jsonObject.getString("vehicleNumber"));
         billetLiftingBill.setVehicleNumber(jsonObject.getString("vehicleNumber"));
@@ -349,7 +337,6 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
         List<StackingAndLoadingVehicles> stackingAndLoadingVehiclesLists = new ArrayList<>();
         List<StackingAndLoadingVehicles> stackingAndLoadingVehiclesLists = new ArrayList<>();
 
 
         StackingAndLoadingVehicles stackingAndLoadingVehiclesInfo = baseMapper.selectOne(new LambdaQueryWrapper<StackingAndLoadingVehicles>()
         StackingAndLoadingVehicles stackingAndLoadingVehiclesInfo = baseMapper.selectOne(new LambdaQueryWrapper<StackingAndLoadingVehicles>()
-                .eq(StackingAndLoadingVehicles::getCcmNo, ccmNo)
                 .eq(StackingAndLoadingVehicles::getLayer, layer)
                 .eq(StackingAndLoadingVehicles::getLayer, layer)
                 .eq(StackingAndLoadingVehicles::getAddress, address)
                 .eq(StackingAndLoadingVehicles::getAddress, address)
                 .eq(StackingAndLoadingVehicles::getTypeConfigId, billetHotsendTypeConfig.getId())
                 .eq(StackingAndLoadingVehicles::getTypeConfigId, billetHotsendTypeConfig.getId())
@@ -361,31 +348,7 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
         stackingAndLoadingVehiclesLists.add(stackingAndLoadingVehiclesInfo);
         stackingAndLoadingVehiclesLists.add(stackingAndLoadingVehiclesInfo);
         loadingParams.setStackingAndLoadingVehiclesList(stackingAndLoadingVehiclesLists);
         loadingParams.setStackingAndLoadingVehiclesList(stackingAndLoadingVehiclesLists);
         String allBilletNos  = stackingAndLoadingVehiclesInfo.getBilletNos();
         String allBilletNos  = stackingAndLoadingVehiclesInfo.getBilletNos();
-        // 获取所有的坯号集合
-        List<String> allBilletNoList  = Arrays.asList(allBilletNos.split(","));
-
-        LambdaQueryWrapper<BilletBasicInfo> queryWrapperBB = new LambdaQueryWrapper<BilletBasicInfo>()
-                .eq(BilletBasicInfo::getCcmNo, Integer.valueOf(ccmNo))
-                .in(BilletBasicInfo::getBilletNo, allBilletNoList);
-        List<BilletBasicInfo> billetBasicInfoList = billetBasicInfoService.list(queryWrapperBB);
-        if (oConvertUtils.listIsEmpty(billetBasicInfoList)) {
-            log.info("{}{}", "钢坯基础信息为空,C端自动化垛位装车保存失败", stackingAndLoadingVehiclesInfo.getBilletNos());
-            return;
-        }
 
 
-        // 2025 3.3,C端自动化推送保存、B端手动发车临时方案,
-        LambdaQueryWrapper<StorageBill> queryWrapper2 = new LambdaQueryWrapper<>();
-        queryWrapper2.eq(StorageBill::getPositionNum, Integer.valueOf(positionNum))
-                .isNull(StorageBill::getOutTime);
-        // 2号车位不验证铸机号
-        if (!positionNum.equals("2")) {
-            queryWrapper2.eq(StorageBill::getCcmNo, ccmNo);
-        }
-        StorageBill isStorageBill = storageBillService.getOne(queryWrapper2);
-        if (oConvertUtils.isEmpty(isStorageBill)) {
-            log.info("钢坯装运单不存在,车位号为:{},C端自动化垛位装车保存失败!", positionNum);
-            return;
-        }
         // 截取钢坯的第九位字符,为最终铸机号
         // 截取钢坯的第九位字符,为最终铸机号
         ccmNo = Optional.ofNullable(allBilletNos)
         ccmNo = Optional.ofNullable(allBilletNos)
                 .filter(s -> !s.isEmpty())
                 .filter(s -> !s.isEmpty())
@@ -400,14 +363,22 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
         String shift = shiftHandle(ccmNo);
         String shift = shiftHandle(ccmNo);
         log.info("C端自动化垛位装车缓存中的班组、班别:{}", shiftGroup + ":" + shift);
         log.info("C端自动化垛位装车缓存中的班组、班别:{}", shiftGroup + ":" + shift);
         if (oConvertUtils.isEmpty(shiftGroup) || oConvertUtils.isEmpty(shift)){
         if (oConvertUtils.isEmpty(shiftGroup) || oConvertUtils.isEmpty(shift)){
-            log.info("{}{}", "班组班别获取为空,C端自动化垛位装车<保存>失败!", JSON.toJSON(isStorageBill));
+            log.info("{}{}", "班组班别获取为空,C端自动化垛位装车<保存>失败!", JSON.toJSON(jsonObject));
+            return;
+        }
+        // 2025 3.3,C端自动化推送保存、B端手动发车临时方案,
+        LambdaQueryWrapper<StorageBill> queryWrapper2 = new LambdaQueryWrapper<>();
+        queryWrapper2.eq(StorageBill::getPositionNum, Integer.valueOf(positionNum))
+                .isNull(StorageBill::getOutTime);
+        // 2号车位不验证铸机号
+        if (!positionNum.equals("2")) {
+            queryWrapper2.eq(StorageBill::getCcmNo, ccmNo);
+        }
+        StorageBill isStorageBill = storageBillService.getOne(queryWrapper2);
+        if (oConvertUtils.isEmpty(isStorageBill)) {
+            log.info("钢坯装运单不存在,车位号为:{},C端自动化垛位装车保存失败!", positionNum);
             return;
             return;
         }
         }
-        BilletHotsend billetHotsend = new BilletHotsend();
-        billetHotsend.setCcmNo(ccmNo);
-        billetHotsend.setShiftGroup(shiftGroup);
-        billetHotsend.setShift(shift);
-        loadingParams.setBilletHotsend(billetHotsend);
         // 更新装运单铸机号、班别、班组
         // 更新装运单铸机号、班别、班组
         if ("0".equals(isStorageBill.getCcmNo())) {
         if ("0".equals(isStorageBill.getCcmNo())) {
             // 更新铸机号,到装运单
             // 更新铸机号,到装运单
@@ -421,17 +392,36 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
                 return;
                 return;
             }
             }
         }
         }
+
+        BilletHotsend billetHotsend = new BilletHotsend();
+        billetHotsend.setCcmNo(ccmNo);
+        billetHotsend.setShiftGroup(shiftGroup);
+        billetHotsend.setShift(shift);
+        loadingParams.setBilletHotsend(billetHotsend);
+
         loadingParams.setStorageBill(isStorageBill);
         loadingParams.setStorageBill(isStorageBill);
 
 
         log.info("{}{}", "自动化堆垛装车,装运单信息:", JSON.toJSON(isStorageBill));
         log.info("{}{}", "自动化堆垛装车,装运单信息:", JSON.toJSON(isStorageBill));
 
 
         StorageBill storageBill = loadingParams.getStorageBill();
         StorageBill storageBill = loadingParams.getStorageBill();
 
 
-        final double billetWeightTotal = billetBasicInfoList.stream().mapToDouble(BilletBasicInfo::getBilletWeight).sum();
+        // 获取所有的坯号集合
+        List<String> allBilletNoList  = Arrays.asList(allBilletNos.split(","));
+
+        LambdaQueryWrapper<BilletBasicInfo> queryWrapperBB = new LambdaQueryWrapper<BilletBasicInfo>()
+                .eq(BilletBasicInfo::getCcmNo, Integer.valueOf(ccmNo))
+                .in(BilletBasicInfo::getBilletNo, allBilletNoList);
+        List<BilletBasicInfo> billetBasicInfoList = billetBasicInfoService.list(queryWrapperBB);
+        if (oConvertUtils.listIsEmpty(billetBasicInfoList)) {
+            log.info("{}{}", "钢坯基础信息为空,C端自动化垛位装车保存失败", stackingAndLoadingVehiclesInfo.getBilletNos());
+            return;
+        }
 
 
         // 根据坯号查询吊运单信息。更新billetWeightTotal
         // 根据坯号查询吊运单信息。更新billetWeightTotal
         BilletLiftingBill billetLiftingBillUpdate = billetLiftingBillService.getById(billetLiftingBill.getId());
         BilletLiftingBill billetLiftingBillUpdate = billetLiftingBillService.getById(billetLiftingBill.getId());
         if (oConvertUtils.isNotEmpty(billetLiftingBillUpdate)){
         if (oConvertUtils.isNotEmpty(billetLiftingBillUpdate)){
+            final double billetWeightTotal = billetBasicInfoList.stream().mapToDouble(BilletBasicInfo::getBilletWeight).sum();
+
             billetLiftingBillUpdate.setShiftGroup(shiftGroup);
             billetLiftingBillUpdate.setShiftGroup(shiftGroup);
             billetLiftingBillUpdate.setShift(shift);
             billetLiftingBillUpdate.setShift(shift);
             // 维护吊运单,坯重、组坯号、炉号
             // 维护吊运单,坯重、组坯号、炉号