Explorar o código

在redis中存储流号定尺信息

lingpeng.li hai 3 semanas
pai
achega
d0b31fd5ef

+ 4 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetHotsend/dto/StrandNoSizeDTO.java

@@ -7,11 +7,15 @@ import java.util.List;
 @Data
 public class StrandNoSizeDTO {
 
+    private String ccmNo;
+
+
     private List<StrandNoSize> strandNoSizeList;
 
     @Data
     public static class StrandNoSize {
 
+
         private Integer strandNo;
 
         private Integer length;

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

@@ -1,5 +1,6 @@
 package org.jeecg.modules.billet.billetHotsend.service.impl;
 
+import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -137,7 +138,7 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 		JSONObject result = new JSONObject();
 		// 根据billetHotsendTypeConfigId 查询基础垛位信息
 		List<RollClubCommon> rollClubCommonList = billetHotsendDetailsVo.getRollClubCommonList();
-		if (oConvertUtils.listIsEmpty(rollClubCommonList)){
+		if (oConvertUtils.listIsEmpty(rollClubCommonList)) {
 			result.put("fail", "棒线钢坯信息不存在,保存失败!");
 			return result;
 		}
@@ -153,7 +154,7 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 			billetHotsend.setShift(parts[2]);// 班别
 			List<RollClubCommon> groupRollClubCommonList = entry.getValue();
 			JSONObject jsonObject = handleBilletHotsenAndDetails(billetHotsend, billetHotsendDetailsVo, billetHotsendTypeConfig, storageBill, groupRollClubCommonList);
-			if (jsonObject.containsKey("fail")){
+			if (jsonObject.containsKey("fail")) {
 				TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
 				return jsonObject;
 			}
@@ -164,20 +165,20 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 				.eq(BilletBasicInfo::getCcmNo, Integer.valueOf(billetHotsend.getCcmNo()))
 				.in(BilletBasicInfo::getBilletNo, billetNos);
 		List<BilletBasicInfo> billetBasicInfoList = billetBasicInfoService.list(queryWrapperls);
-		if (oConvertUtils.listIsEmpty(billetBasicInfoList)){
+		if (oConvertUtils.listIsEmpty(billetBasicInfoList)) {
 			result.put("fail", "钢坯基础信息不存在,棒线保存失败!");
 			return result;
 		}
-		billetBasicInfoList.forEach(x ->{
-			if ("roll_club_one".equals(billetHotsendDetailsVo.getBelongTable())){
+		billetBasicInfoList.forEach(x -> {
+			if ("roll_club_one".equals(billetHotsendDetailsVo.getBelongTable())) {
 				x.setBelongTable("roll_club_one");
-			}else if ("roll_club_two".equals(billetHotsendDetailsVo.getBelongTable())){
+			} else if ("roll_club_two".equals(billetHotsendDetailsVo.getBelongTable())) {
 				x.setBelongTable("roll_club_two");
-			}else if ("roll_club_three".equals(billetHotsendDetailsVo.getBelongTable())){
+			} else if ("roll_club_three".equals(billetHotsendDetailsVo.getBelongTable())) {
 				x.setBelongTable("roll_club_three");
-			}else if ("roll_height".equals(billetHotsendDetailsVo.getBelongTable())){
+			} else if ("roll_height".equals(billetHotsendDetailsVo.getBelongTable())) {
 				x.setBelongTable("roll_height");
-			}else if ("roll_out_shipp".equals(billetHotsendDetailsVo.getBelongTable())){
+			} else if ("roll_out_shipp".equals(billetHotsendDetailsVo.getBelongTable())) {
 				x.setBelongTable("roll_out_shipp");
 			}
 			x.setBhtcId(billetHotsendDetailsVo.getBilletHotsendTypeConfigId());
@@ -185,10 +186,10 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 		});
 		billetBasicInfoService.saveOrUpdateBatch(billetBasicInfoList);
 
-		if ("roll_club_one".equals(billetHotsendDetailsVo.getBelongTable())){
+		if ("roll_club_one".equals(billetHotsendDetailsVo.getBelongTable())) {
 			result.put("success", "直轧棒一保存成功!");
 			return result;
-		}else if ("roll_height".equals(billetHotsendDetailsVo.getBelongTable())){
+		} else if ("roll_height".equals(billetHotsendDetailsVo.getBelongTable())) {
 			result.put("success", "热送高线保存成功!");
 			return result;
 		}
@@ -196,7 +197,7 @@ 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)){
+		if (oConvertUtils.isEmpty(storageBillInfo)) {
 			result.put("fail", "钢坯装运单不存在,棒线保存操作失败!");
 			return result;
 		}
@@ -211,7 +212,7 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 		// 装运单编辑确认目的地,同步时,维护定尺
 		List<Integer> sizeIntList = billetBasicInfoList.stream().map(BilletBasicInfo::getLength).distinct().collect(Collectors.toList());
 		List<String> sizeStrList = sizeIntList.stream().map(String::valueOf).collect(Collectors.toList());
-		if(oConvertUtils.listIsNotEmpty(sizeStrList)) {
+		if (oConvertUtils.listIsNotEmpty(sizeStrList)) {
 			String distinctSizeStr = sizeIntList.stream()
 					.distinct()
 					.map(String::valueOf)
@@ -232,7 +233,7 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 		// 装运单编辑确认目的地,同步时,维护组批号
 		List<String> assemblyNumberList = billetBasicInfoList.stream().map(BilletBasicInfo::getAssemblyNumber)
 				.filter(assemblyNumber -> oConvertUtils.isNotEmpty(assemblyNumber)).collect(Collectors.toList());
-		if(oConvertUtils.listIsNotEmpty(assemblyNumberList)) {
+		if (oConvertUtils.listIsNotEmpty(assemblyNumberList)) {
 			String distinctAssemblyNumber = assemblyNumberList.stream().distinct().collect(Collectors.joining(","));
 			String finalAssemblyNumber = Optional.ofNullable(storageBillInfo.getAssemblyNumber())
 					.filter(oConvertUtils::isNotEmpty)
@@ -260,7 +261,7 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 	public JSONObject saveBilletHotsendDetailsCar(BilletHotsendDetailsVo billetHotsendDetailsVo) {
 		JSONObject result = new JSONObject();
 		List<RollClubCommon> rollClubCommonList = billetHotsendDetailsVo.getRollClubCommonList();
-		if (oConvertUtils.listIsEmpty(rollClubCommonList)){
+		if (oConvertUtils.listIsEmpty(rollClubCommonList)) {
 			result.put("fail", "棒线钢坯信息不存在,发车失败!");
 			return result;
 		}
@@ -279,7 +280,7 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 			billetHotsend.setShift(parts[2]);// 班别
 			List<RollClubCommon> groupRollClubCommonList = entry.getValue();
 			JSONObject jsonObject = handleBilletHotsenAndDetails(billetHotsend, billetHotsendDetailsVo, billetHotsendTypeConfig, storageBill, groupRollClubCommonList);
-			if (jsonObject.containsKey("fail")){
+			if (jsonObject.containsKey("fail")) {
 				TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
 				return jsonObject;
 			}
@@ -290,16 +291,16 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 				.eq(BilletBasicInfo::getCcmNo, Integer.valueOf(billetHotsend.getCcmNo()))
 				.in(BilletBasicInfo::getBilletNo, billetNos);
 		List<BilletBasicInfo> billetBasicInfoList = billetBasicInfoService.list(queryWrapperls);
-		billetBasicInfoList.forEach(x ->{
-			if ("roll_club_one".equals(billetHotsendDetailsVo.getBelongTable())){
+		billetBasicInfoList.forEach(x -> {
+			if ("roll_club_one".equals(billetHotsendDetailsVo.getBelongTable())) {
 				x.setBelongTable("roll_club_one");
-			}else if ("roll_club_two".equals(billetHotsendDetailsVo.getBelongTable())){
+			} else if ("roll_club_two".equals(billetHotsendDetailsVo.getBelongTable())) {
 				x.setBelongTable("roll_club_two");
-			}else if ("roll_club_three".equals(billetHotsendDetailsVo.getBelongTable())){
+			} else if ("roll_club_three".equals(billetHotsendDetailsVo.getBelongTable())) {
 				x.setBelongTable("roll_club_three");
-			}else if ("roll_height".equals(billetHotsendDetailsVo.getBelongTable())){
+			} else if ("roll_height".equals(billetHotsendDetailsVo.getBelongTable())) {
 				x.setBelongTable("roll_height");
-			}else if ("roll_out_shipp".equals(billetHotsendDetailsVo.getBelongTable())){
+			} else if ("roll_out_shipp".equals(billetHotsendDetailsVo.getBelongTable())) {
 				x.setBelongTable("roll_out_shipp");
 			}
 			x.setBhtcId(billetHotsendDetailsVo.getBilletHotsendTypeConfigId());
@@ -310,7 +311,7 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 		List<String> sizeList = new ArrayList<>();
 		List<String> heatNoList = new ArrayList<>();
 		//根据铸机号、钢坯转运单ID查询定尺信息
-		if ("roll_club_two".equals(billetHotsendDetailsVo.getBelongTable())){
+		if ("roll_club_two".equals(billetHotsendDetailsVo.getBelongTable())) {
 			LambdaQueryWrapper<RollClubTwoDetails> queryWrapperRC = new LambdaQueryWrapper();
 			queryWrapperRC.eq(RollClubTwoDetails::getCcmNo, storageBill.getCcmNo()).eq(RollClubTwoDetails::getStorageBillId, storageBill.getId());
 			List<RollClubTwoDetails> rollClubTwoDetailsList = rollClubTwoDetailsService.list(queryWrapperRC);
@@ -319,7 +320,7 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 			heatNoList = rollClubTwoDetailsList.stream().map(RollClubTwoDetails::getHeatNo).distinct()
 					.collect(Collectors.toList());
 		}
-		if ("roll_club_three".equals(billetHotsendDetailsVo.getBelongTable())){
+		if ("roll_club_three".equals(billetHotsendDetailsVo.getBelongTable())) {
 			LambdaQueryWrapper<RollClubThreeDetails> queryWrapperCT = new LambdaQueryWrapper();
 			queryWrapperCT.eq(RollClubThreeDetails::getCcmNo, storageBill.getCcmNo()).eq(RollClubThreeDetails::getStorageBillId, storageBill.getId());
 			List<RollClubThreeDetails> rollClubThreeDetailsList = rollClubThreeDetailsService.list(queryWrapperCT);
@@ -328,7 +329,7 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 			heatNoList = rollClubThreeDetailsList.stream().map(RollClubThreeDetails::getHeatNo).distinct()
 					.collect(Collectors.toList());
 		}
-		if ("roll_out_shipp".equals(billetHotsendDetailsVo.getBelongTable())){
+		if ("roll_out_shipp".equals(billetHotsendDetailsVo.getBelongTable())) {
 			LambdaQueryWrapper<RollOutShippDetails> queryWrapperROS = new LambdaQueryWrapper();
 			queryWrapperROS.eq(RollOutShippDetails::getCcmNo, storageBill.getCcmNo()).eq(RollOutShippDetails::getStorageBillId, storageBill.getId());
 			List<RollOutShippDetails> rollOutShippDetailsList = rollOutShippDetailsService.list(queryWrapperROS);
@@ -338,7 +339,7 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 					.collect(Collectors.toList());
 		}
 		// 更新装运单 车次总序号、本车车次
-		if (oConvertUtils.isEmpty(billetHotsendDetailsVo.getStorageBill()) || billetHotsendDetailsVo.getStorageBill() == null){
+		if (oConvertUtils.isEmpty(billetHotsendDetailsVo.getStorageBill()) || billetHotsendDetailsVo.getStorageBill() == null) {
 			TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
 			result.put("fail", "钢坯装运单不存在,棒线发车失败!");
 			return result;
@@ -346,7 +347,7 @@ 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)){
+		if (oConvertUtils.isEmpty(storageBillInfo)) {
 			TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
 			result.put("fail", "钢坯装运单不存在,棒线发车操作失败!");
 			return result;
@@ -362,7 +363,7 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 		// 装运单编辑确认目的地,同步时,维护定尺
 		List<Integer> sizeIntList = billetBasicInfoList.stream().map(BilletBasicInfo::getLength).distinct().collect(Collectors.toList());
 		List<String> sizeStrList = sizeIntList.stream().map(String::valueOf).collect(Collectors.toList());
-		if(oConvertUtils.listIsNotEmpty(sizeStrList)) {
+		if (oConvertUtils.listIsNotEmpty(sizeStrList)) {
 			String distinctSizeStr = sizeIntList.stream()
 					.distinct()
 					.map(String::valueOf)
@@ -383,7 +384,7 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 		// 装运单编辑确认目的地,同步时,维护组批号
 		List<String> assemblyNumberList = billetBasicInfoList.stream().map(BilletBasicInfo::getAssemblyNumber)
 				.filter(assemblyNumber -> oConvertUtils.isNotEmpty(assemblyNumber)).collect(Collectors.toList());
-		if(oConvertUtils.listIsNotEmpty(assemblyNumberList)) {
+		if (oConvertUtils.listIsNotEmpty(assemblyNumberList)) {
 			String distinctAssemblyNumber = assemblyNumberList.stream().distinct().collect(Collectors.joining(","));
 			String finalAssemblyNumber = Optional.ofNullable(storageBillInfo.getAssemblyNumber())
 					.filter(oConvertUtils::isNotEmpty)
@@ -409,31 +410,31 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 		BeanUtils.copyProperties(storageBillInfo, storageCarLog);
 		storageCarLog.setDestination(storageBillInfo.getDestination());// 目的地
 		storageCarLog.setCarNm(storageBillInfo.getLicensePlate());// 车牌号
-		if("棒二".equals(storageBillInfo.getDestination())){
+		if ("棒二".equals(storageBillInfo.getDestination())) {
 			// 根据装运单ID,查询棒二明细表
 			LambdaQueryWrapper<RollClubTwoDetails> queryWrapperRC = new LambdaQueryWrapper();
 			queryWrapperRC.eq(RollClubTwoDetails::getStorageBillId, storageBillInfo.getId());
 			List<RollClubTwoDetails> rollClubTwoDetailsList = rollClubTwoDetailsService.list(queryWrapperRC);
-			if (oConvertUtils.listIsNotEmpty(rollClubTwoDetailsList)){
+			if (oConvertUtils.listIsNotEmpty(rollClubTwoDetailsList)) {
 				double totalBlankOutputs = rollClubTwoDetailsList.stream().mapToDouble(RollClubTwoDetails::getBlankOutput).sum();
 				BigDecimal bd = BigDecimal.valueOf(totalBlankOutputs).setScale(4, BigDecimal.ROUND_HALF_UP);
 				storageCarLog.setFixedWeight(bd.doubleValue());
 			}
-		}else if ("棒三".equals(storageBillInfo.getDestination())) {
+		} else if ("棒三".equals(storageBillInfo.getDestination())) {
 			// 根据装运单ID,查询棒二明细表
 			LambdaQueryWrapper<RollClubThreeDetails> queryWrapperRT = new LambdaQueryWrapper();
 			queryWrapperRT.eq(RollClubThreeDetails::getStorageBillId, storageBillInfo.getId());
 			List<RollClubThreeDetails> rollClubThreeDetailsList = rollClubThreeDetailsService.list(queryWrapperRT);
-			if (oConvertUtils.listIsNotEmpty(rollClubThreeDetailsList)){
+			if (oConvertUtils.listIsNotEmpty(rollClubThreeDetailsList)) {
 				double totalBlankOutputs = rollClubThreeDetailsList.stream().mapToDouble(RollClubThreeDetails::getBlankOutput).sum();
 				BigDecimal bd = BigDecimal.valueOf(totalBlankOutputs).setScale(4, BigDecimal.ROUND_HALF_UP);
 				storageCarLog.setFixedWeight(bd.doubleValue());
 			}
-		}else if ("上若".equals(storageBillInfo.getDestination())) {
+		} else if ("上若".equals(storageBillInfo.getDestination())) {
 			LambdaQueryWrapper<RollOutShippDetails> queryWrapperROS = new LambdaQueryWrapper();
 			queryWrapperROS.eq(RollOutShippDetails::getStorageBillId, storageBillInfo.getId());
 			List<RollOutShippDetails> rollOutShippDetailsList = rollOutShippDetailsService.list(queryWrapperROS);
-			if (oConvertUtils.listIsNotEmpty(rollOutShippDetailsList)){
+			if (oConvertUtils.listIsNotEmpty(rollOutShippDetailsList)) {
 				double totalBlankOutputs = rollOutShippDetailsList.stream().mapToDouble(RollOutShippDetails::getBlankOutput).sum();
 				BigDecimal bd = BigDecimal.valueOf(totalBlankOutputs).setScale(4, BigDecimal.ROUND_HALF_UP);
 				storageCarLog.setFixedWeight(bd.doubleValue());// 定重
@@ -462,7 +463,7 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 				.eq(BilletHotsend::getShift, cacheShint)
 				.eq(BilletHotsend::getShiftGroup, cacheShintGroup);
 		BilletHotsend check = baseMapper.selectOne(queryWrapper);
-		if (oConvertUtils.isNotEmpty(check)){
+		if (oConvertUtils.isNotEmpty(check)) {
 			result.put("fail", "该班次钢坯热送单已存在,新增失败!");
 			return result;
 		}
@@ -478,7 +479,7 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 		billetHotsend.setStackNum(0);
 		baseMapper.insert(billetHotsend);
 		billetHotsend.setId(billetHotsend.getId());
-		operateLogService.add(billetHotsend,null,BilletHotsend.class);
+		operateLogService.add(billetHotsend, null, BilletHotsend.class);
 		result.put("success", "钢坯热送单新增成功!");
 		return result;
 	}
@@ -490,7 +491,7 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 		LambdaQueryWrapper<BilletBasicInfo> queryWrapper = new LambdaQueryWrapper<>();
 		queryWrapper.eq(BilletBasicInfo::getBilletNo, billetNo);
 		BilletBasicInfo billetBasicInfo = billetBasicInfoService.getOne(queryWrapper);
-		if (oConvertUtils.isEmpty(billetBasicInfo) || oConvertUtils.isEmpty(billetBasicInfo.getBhtcId())){
+		if (oConvertUtils.isEmpty(billetBasicInfo) || oConvertUtils.isEmpty(billetBasicInfo.getBhtcId())) {
 			return billetBasicInfoDetailsList;
 		}
 		BilletBasicInfoDetails billetBasicInfoDetails = new BilletBasicInfoDetails();
@@ -499,12 +500,12 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 		billetBasicInfoDetails.setHeatNo(billetBasicInfo.getHeatNo());
 		billetBasicInfoDetails.setShift(ShiftEnum.fromCode(billetBasicInfo.getShift()).name());
 		billetBasicInfoDetails.setShiftGroup(ShiftGroupEnum.fromCode(billetBasicInfo.getShiftGroup()).name());
-		if ("roll_club_one".equals(billetBasicInfo.getBelongTable())){
+		if ("roll_club_one".equals(billetBasicInfo.getBelongTable())) {
 			billetBasicInfoDetails.setBelongType("直轧");
 			billetBasicInfoDetails.setLicensePlate("辊道");
 			billetBasicInfoDetails.setDestination("5号机棒一");
 			billetBasicInfoDetailsList.add(billetBasicInfoDetails);
-		}else if ("roll_club_two".equals(billetBasicInfo.getBelongTable())){
+		} else if ("roll_club_two".equals(billetBasicInfo.getBelongTable())) {
 			QueryWrapper<RollClubTwoDetails> queryWrapper1 = new QueryWrapper<>();
 			queryWrapper1.eq("billet_no", billetNo)
 					.or()
@@ -513,19 +514,19 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 			if (rollClubTwoDetails != null) {
 				StorageBill storageBill = storageBillService.getOne(new LambdaQueryWrapper<StorageBill>()
 						.eq(StorageBill::getId, rollClubTwoDetails.getStorageBillId()));
-				if (storageBill != null && oConvertUtils.isNotEmpty(rollClubTwoDetails.getStartNum())){
+				if (storageBill != null && oConvertUtils.isNotEmpty(rollClubTwoDetails.getStartNum())) {
 					// 棒线、通过装运单ID查询装运信息
 					billetBasicInfoDetails.setBelongType("车运");
 					billetBasicInfoDetails.setLicensePlate(storageBill.getLicensePlate());
 					billetBasicInfoDetails.setDestination(storageBill.getDestination());
-					if (oConvertUtils.isNotEmpty(storageBill.getUpdateTime())){
+					if (oConvertUtils.isNotEmpty(storageBill.getUpdateTime())) {
 						billetBasicInfoDetails.setLoadCarTime(storageBill.getUpdateTime());
 					}
-					if (oConvertUtils.isNotEmpty(storageBill.getOutTime())){
+					if (oConvertUtils.isNotEmpty(storageBill.getOutTime())) {
 						billetBasicInfoDetails.setOutCarTime(storageBill.getOutTime());
 					}
 					billetBasicInfoDetailsList.add(billetBasicInfoDetails);
-				}else {
+				} else {
 					// 堆垛、通过装运单ID查询装运信息
 					billetBasicInfoDetails.setBelongType("堆垛");
 					billetBasicInfoDetails.setLicensePlate(storageBill.getLicensePlate());
@@ -536,13 +537,13 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 							.or()
 							.apply("CONCAT(',', billet_no, ',') LIKE CONCAT('%,', {0}, ',%')", billetNo);
 					StackingUpLog stackingUpLog = stackingUpLogService.getOne(queryWrapper2, false);
-					if (stackingUpLog != null){
+					if (stackingUpLog != null) {
 						billetBasicInfoDetails.setStackingUpTime(stackingUpLog.getCreateTime());
 					}
-					if (oConvertUtils.isNotEmpty(storageBill.getUpdateTime())){
+					if (oConvertUtils.isNotEmpty(storageBill.getUpdateTime())) {
 						billetBasicInfoDetails.setLoadCarTime(rollClubTwoDetails.getCreateTime());
 					}
-					if (oConvertUtils.isNotEmpty(storageBill.getOutTime())){
+					if (oConvertUtils.isNotEmpty(storageBill.getOutTime())) {
 						billetBasicInfoDetails.setOutCarTime(storageBill.getOutTime());
 					}
 					billetBasicInfoDetails.setStackingDownTime(null);
@@ -554,7 +555,7 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 							.or()
 							.apply("CONCAT(',', billet_no, ',') LIKE CONCAT('%,', {0}, ',%')", billetNo);
 					StackingDownLog stackingDownLog = stackingDownLogService.getOne(queryWrapper3, false);
-					if (stackingDownLog != null){
+					if (stackingDownLog != null) {
 						BilletBasicInfoDetails billetBasicInfoDetails1 = new BilletBasicInfoDetails();
 						BeanUtils.copyProperties(billetBasicInfoDetails, billetBasicInfoDetails1);
 						billetBasicInfoDetails1.setStackingDownTime(stackingDownLog.getCreateTime());
@@ -563,7 +564,7 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 					}
 				}
 			}
-		}else if ("roll_club_three".equals(billetBasicInfo.getBelongTable())){
+		} else if ("roll_club_three".equals(billetBasicInfo.getBelongTable())) {
 			QueryWrapper<RollClubThreeDetails> queryWrapper1 = new QueryWrapper<>();
 			queryWrapper1.eq("billet_no", billetNo)
 					.or()
@@ -572,19 +573,19 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 			if (rollClubThreeDetails != null) {
 				StorageBill storageBill = storageBillService.getOne(new LambdaQueryWrapper<StorageBill>()
 						.eq(StorageBill::getId, rollClubThreeDetails.getStorageBillId()));
-				if (storageBill != null && oConvertUtils.isNotEmpty(rollClubThreeDetails.getStartNum())){
+				if (storageBill != null && oConvertUtils.isNotEmpty(rollClubThreeDetails.getStartNum())) {
 					// 棒线、通过装运单ID查询装运信息
 					billetBasicInfoDetails.setBelongType("车运");
 					billetBasicInfoDetails.setLicensePlate(storageBill.getLicensePlate());
 					billetBasicInfoDetails.setDestination(storageBill.getDestination());
-					if (oConvertUtils.isNotEmpty(storageBill.getUpdateTime())){
+					if (oConvertUtils.isNotEmpty(storageBill.getUpdateTime())) {
 						billetBasicInfoDetails.setLoadCarTime(storageBill.getUpdateTime());
 					}
-					if (oConvertUtils.isNotEmpty(storageBill.getOutTime())){
+					if (oConvertUtils.isNotEmpty(storageBill.getOutTime())) {
 						billetBasicInfoDetails.setOutCarTime(storageBill.getOutTime());
 					}
 					billetBasicInfoDetailsList.add(billetBasicInfoDetails);
-				}else {
+				} else {
 					// 堆垛、通过装运单ID查询装运信息
 					billetBasicInfoDetails.setBelongType("堆垛");
 					billetBasicInfoDetails.setLicensePlate(storageBill.getLicensePlate());
@@ -595,13 +596,13 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 							.or()
 							.apply("CONCAT(',', billet_no, ',') LIKE CONCAT('%,', {0}, ',%')", billetNo);
 					StackingUpLog stackingUpLog = stackingUpLogService.getOne(queryWrapper2, false);
-					if (stackingUpLog != null){
+					if (stackingUpLog != null) {
 						billetBasicInfoDetails.setStackingUpTime(stackingUpLog.getCreateTime());
 					}
-					if (oConvertUtils.isNotEmpty(storageBill.getUpdateTime())){
+					if (oConvertUtils.isNotEmpty(storageBill.getUpdateTime())) {
 						billetBasicInfoDetails.setLoadCarTime(rollClubThreeDetails.getCreateTime());
 					}
-					if (oConvertUtils.isNotEmpty(storageBill.getOutTime())){
+					if (oConvertUtils.isNotEmpty(storageBill.getOutTime())) {
 						billetBasicInfoDetails.setOutCarTime(storageBill.getOutTime());
 					}
 					billetBasicInfoDetails.setStackingDownTime(null);
@@ -613,7 +614,7 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 							.or()
 							.apply("CONCAT(',', billet_no, ',') LIKE CONCAT('%,', {0}, ',%')", billetNo);
 					StackingDownLog stackingDownLog = stackingDownLogService.getOne(queryWrapper3, false);
-					if (stackingDownLog != null){
+					if (stackingDownLog != null) {
 						BilletBasicInfoDetails billetBasicInfoDetails1 = new BilletBasicInfoDetails();
 						BeanUtils.copyProperties(billetBasicInfoDetails, billetBasicInfoDetails1);
 						billetBasicInfoDetails1.setStackingDownTime(stackingDownLog.getCreateTime());
@@ -622,7 +623,7 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 					}
 				}
 			}
-		}else if ("roll_out_shipp".equals(billetBasicInfo.getBelongTable())){
+		} else if ("roll_out_shipp".equals(billetBasicInfo.getBelongTable())) {
 			QueryWrapper<RollOutShippDetails> queryWrapper1 = new QueryWrapper<>();
 			queryWrapper1.eq("billet_no", billetNo)
 					.or()
@@ -631,19 +632,19 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 			if (rollOutShippDetails != null) {
 				StorageBill storageBill = storageBillService.getOne(new LambdaQueryWrapper<StorageBill>()
 						.eq(StorageBill::getId, rollOutShippDetails.getStorageBillId()));
-				if (storageBill != null && oConvertUtils.isNotEmpty(rollOutShippDetails.getStartNum())){
+				if (storageBill != null && oConvertUtils.isNotEmpty(rollOutShippDetails.getStartNum())) {
 					// 棒线、通过装运单ID查询装运信息
 					billetBasicInfoDetails.setBelongType("车运");
 					billetBasicInfoDetails.setLicensePlate(storageBill.getLicensePlate());
 					billetBasicInfoDetails.setDestination(storageBill.getDestination());
-					if (oConvertUtils.isNotEmpty(storageBill.getUpdateTime())){
+					if (oConvertUtils.isNotEmpty(storageBill.getUpdateTime())) {
 						billetBasicInfoDetails.setLoadCarTime(storageBill.getUpdateTime());
 					}
-					if (oConvertUtils.isNotEmpty(storageBill.getOutTime())){
+					if (oConvertUtils.isNotEmpty(storageBill.getOutTime())) {
 						billetBasicInfoDetails.setOutCarTime(storageBill.getOutTime());
 					}
 					billetBasicInfoDetailsList.add(billetBasicInfoDetails);
-				}else {
+				} else {
 					// 堆垛、通过装运单ID查询装运信息
 					billetBasicInfoDetails.setBelongType("堆垛");
 					billetBasicInfoDetails.setLicensePlate(storageBill.getLicensePlate());
@@ -654,13 +655,13 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 							.or()
 							.apply("CONCAT(',', billet_no, ',') LIKE CONCAT('%,', {0}, ',%')", billetNo);
 					StackingUpLog stackingUpLog = stackingUpLogService.getOne(queryWrapper2, false);
-					if (stackingUpLog != null){
+					if (stackingUpLog != null) {
 						billetBasicInfoDetails.setStackingUpTime(stackingUpLog.getCreateTime());
 					}
-					if (oConvertUtils.isNotEmpty(storageBill.getUpdateTime())){
+					if (oConvertUtils.isNotEmpty(storageBill.getUpdateTime())) {
 						billetBasicInfoDetails.setLoadCarTime(rollOutShippDetails.getCreateTime());
 					}
-					if (oConvertUtils.isNotEmpty(storageBill.getOutTime())){
+					if (oConvertUtils.isNotEmpty(storageBill.getOutTime())) {
 						billetBasicInfoDetails.setOutCarTime(storageBill.getOutTime());
 					}
 					billetBasicInfoDetails.setStackingDownTime(null);
@@ -672,7 +673,7 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 							.or()
 							.apply("CONCAT(',', billet_no, ',') LIKE CONCAT('%,', {0}, ',%')", billetNo);
 					StackingDownLog stackingDownLog = stackingDownLogService.getOne(queryWrapper3, false);
-					if (stackingDownLog != null){
+					if (stackingDownLog != null) {
 						BilletBasicInfoDetails billetBasicInfoDetails1 = new BilletBasicInfoDetails();
 						BeanUtils.copyProperties(billetBasicInfoDetails, billetBasicInfoDetails1);
 						billetBasicInfoDetails1.setStackingDownTime(stackingDownLog.getCreateTime());
@@ -681,7 +682,7 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 					}
 				}
 			}
-		}else if ("roll_height".equals(billetBasicInfo.getBelongTable())){
+		} else if ("roll_height".equals(billetBasicInfo.getBelongTable())) {
 			billetBasicInfoDetails.setBelongType("高线");
 			billetBasicInfoDetails.setLicensePlate("辊道");
 			billetBasicInfoDetails.setDestination("6号机高线");
@@ -693,7 +694,7 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 				.or()
 				.apply("CONCAT(',', billets_no, ',') LIKE CONCAT('%,', {0}, ',%')", billetNo);
 		BilletLiftingBill billetLiftingBill = billetLiftingBillService.getOne(queryWrapper5, false);
-		if (billetLiftingBill != null){
+		if (billetLiftingBill != null) {
 			BilletBasicInfoDetails billetBasicInfoDetails2 = new BilletBasicInfoDetails();
 			BeanUtils.copyProperties(billetBasicInfoDetails, billetBasicInfoDetails2);
 			billetBasicInfoDetails2.setLiftingTime(billetLiftingBill.getLiftingTime());
@@ -779,32 +780,43 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 	@Override
 	public void pushStrandNoSize(StrandNoSizeDTO dto) {
 
-		if (oConvertUtils.listIsEmpty(dto.getStrandNoSizeList())) {
+		if (dto == null || oConvertUtils.listIsEmpty(dto.getStrandNoSizeList())) {
 			throw new JeecgBootException("流号以及定尺集合不能为空!");
 		}
 
-		for (StrandNoSizeDTO.StrandNoSize strandNoSize : dto.getStrandNoSizeList()) {
-			sendStrandNoSizeToMqtt(strandNoSize);
-		}
+		String ccmNo = dto.getCcmNo();
+		// 构造 Redis key
+		String redisKey = String.format("ccmno:length:stream:%s", ccmNo);
 
-	}
+		// 序列化成 JSON 字符串
+		String jsonValue = JSON.toJSONString(dto.getStrandNoSizeList());
 
-	public void sendStrandNoSizeToMqtt(StrandNoSizeDTO.StrandNoSize strandNoSize) {
+		// 存入 Redis
+		redisTemplate.opsForValue().set(redisKey, jsonValue);
 
-		try {
-			Map<String, Object> mapSendInfo = new HashMap<>();
-			mapSendInfo.put("strandNo", strandNoSize.getStrandNo());
-			mapSendInfo.put("length", strandNoSize.getLength());
 
-			// 执行MQTT推送,设置合理的超时时间
-			MqttClientUtil mqttClientUtilBe = new MqttClientUtil();
-			mqttClientUtilBe.pushCData(configMqttMapper, mapSendInfo, TopicType.SYN_BILLET_PUSHSTRANDNOLENGTH.getTopicValue());
-			log.info("B端传递流号定尺参数,发送MQTT成功: {}", mapSendInfo);
-		} catch (Exception e) {
-			log.error("B端传递流号定尺参数,发送MQTT异常!", e);
-		}
+			// 变更的定尺集合
+//			for (StrandNoSizeDTO.StrandNoSize strandNoSize : dto.getStrandNoSizeList()) {
+//				sendStrandNoSizeToMqtt(strandNoSize);
+//			}
 	}
 
+//	public void sendStrandNoSizeToMqtt(StrandNoSizeDTO.StrandNoSize strandNoSize) {
+//
+//		try {
+//			Map<String, Object> mapSendInfo = new HashMap<>();
+//			mapSendInfo.put("strandNo", strandNoSize.getStrandNo());
+//			mapSendInfo.put("length", strandNoSize.getLength());
+//
+//			// 执行MQTT推送,设置合理的超时时间
+//			MqttClientUtil mqttClientUtilBe = new MqttClientUtil();
+//			mqttClientUtilBe.pushCData(configMqttMapper, mapSendInfo, TopicType.SYN_BILLET_PUSHSTRANDNOLENGTH.getTopicValue());
+//			log.info("B端传递流号定尺参数,发送MQTT成功: {}", mapSendInfo);
+//		} catch (Exception e) {
+//			log.error("B端传递流号定尺参数,发送MQTT异常!", e);
+//		}
+//	}
+
 	public void sendFurnaceChangeToMqtt(FurnaceChangeData data) {
 		try {
 			Map<String, Object> mapSendInfo = new HashMap<>();

+ 2 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/storageBill/entity/OnDutyInfo.java

@@ -15,4 +15,6 @@ public class OnDutyInfo {
     private BigDecimal currentCastingFurnace;
     //牌号
     private String brandNum;
+    //流号定尺
+    private String standNoSize;
 }

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

@@ -1388,6 +1388,18 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
 
         OnDutyInfo onDutyInfo = new OnDutyInfo();
 
+        String redisKey = String.format("ccmno:length:stream:%s", ccmNo);
+
+        // 获取 Redis 中的值
+        String value = (String) redisTemplate.opsForValue().get(redisKey);
+
+        // 判空处理
+        if (value != null && !value.isEmpty()) {
+            onDutyInfo.setStandNoSize(String.valueOf(JSON.parseArray(value)));
+        } else {
+            log.info("Redis中未找到对应的值或值为空");
+        }
+
         String brandNum = String.format("billet:basic:info:brand:num:%s", ccmNo);
         String brandNumStr = !oConvertUtils.getString(redisTemplate.opsForValue().get(brandNum)).isEmpty() ? oConvertUtils.getString(redisTemplate.opsForValue().get(brandNum)) : "";