|
@@ -280,6 +280,16 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
|
|
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 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);
|
|
@@ -287,13 +297,14 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
|
|
log.info("{}{}", "班组班别获取为空,C端自动化热装<保存>失败!", JSON.toJSON(jsonObject));
|
|
log.info("{}{}", "班组班别获取为空,C端自动化热装<保存>失败!", JSON.toJSON(jsonObject));
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+
|
|
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.setBilletsNo(billetNos);
|
|
|
|
billetLiftingBill.setShiftGroup(shiftGroup);
|
|
billetLiftingBill.setShiftGroup(shiftGroup);
|
|
billetLiftingBill.setShift(shift);
|
|
billetLiftingBill.setShift(shift);
|
|
|
|
+ billetLiftingBill.setBilletsNo(billetNos);
|
|
billetLiftingBill.setVehicleNumber(jsonObject.getString("vehicleNumber"));
|
|
billetLiftingBill.setVehicleNumber(jsonObject.getString("vehicleNumber"));
|
|
billetLiftingBill.setLocation(location);
|
|
billetLiftingBill.setLocation(location);
|
|
billetLiftingBill.setAddress(address);
|
|
billetLiftingBill.setAddress(address);
|
|
@@ -335,17 +346,7 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- // 取钢坯号的第九位字符
|
|
|
|
- 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);
|
|
|
|
// 更新装运单铸机号、班别、班组
|
|
// 更新装运单铸机号、班别、班组
|
|
if ("0".equals(isStorageBill.getCcmNo())) {
|
|
if ("0".equals(isStorageBill.getCcmNo())) {
|
|
// 更新铸机号,到装运单
|
|
// 更新铸机号,到装运单
|
|
@@ -406,6 +407,8 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
|
|
try {
|
|
try {
|
|
billetLiftingBillUpdate.setHeatNo(getHeatNo(billetBasicInfoLists));
|
|
billetLiftingBillUpdate.setHeatNo(getHeatNo(billetBasicInfoLists));
|
|
double totalWeight = billetBasicInfoLists.stream().mapToDouble(BilletBasicInfo::getBilletWeight).sum();
|
|
double totalWeight = billetBasicInfoLists.stream().mapToDouble(BilletBasicInfo::getBilletWeight).sum();
|
|
|
|
+ billetLiftingBillUpdate.setShiftGroup(shiftGroup);
|
|
|
|
+ billetLiftingBillUpdate.setShift(shift);
|
|
billetLiftingBillUpdate.setBilletWeight(totalWeight);
|
|
billetLiftingBillUpdate.setBilletWeight(totalWeight);
|
|
billetLiftingBillUpdate.setAssemblyNumber(getAssemblyNumber(billetBasicInfoLists));
|
|
billetLiftingBillUpdate.setAssemblyNumber(getAssemblyNumber(billetBasicInfoLists));
|
|
billetLiftingBillService.updateById(billetLiftingBillUpdate);
|
|
billetLiftingBillService.updateById(billetLiftingBillUpdate);
|
|
@@ -600,6 +603,45 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
|
|
throw new JeecgBootException("流号定尺集合不能为空!");
|
|
throw new JeecgBootException("流号定尺集合不能为空!");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ Map<Integer, String> strandNoMap = new HashMap<>();
|
|
|
|
+ strandNoMap.put(1, "one");
|
|
|
|
+ strandNoMap.put(2, "two");
|
|
|
|
+ strandNoMap.put(3, "three");
|
|
|
|
+ strandNoMap.put(4, "four");
|
|
|
|
+ strandNoMap.put(5, "five");
|
|
|
|
+ strandNoMap.put(6, "six");
|
|
|
|
+ strandNoMap.put(7, "seven");
|
|
|
|
+ strandNoMap.put(8, "eight");
|
|
|
|
+
|
|
|
|
+ // 遍历JSONArray并更新Redis缓存
|
|
|
|
+ for (Object obj : strandNoSizeArray) {
|
|
|
|
+ JSONObject item = (JSONObject) obj;
|
|
|
|
+ Integer strandNo = item.getInteger("strandNo");
|
|
|
|
+ Integer length = item.getInteger("length");
|
|
|
|
+ // 生成Redis键
|
|
|
|
+ String strandText = strandNoMap.getOrDefault(strandNo, String.valueOf(strandNo));
|
|
|
|
+ String redisKey = String.format("strandNo:%s:length:%s", strandText, ccmNo);
|
|
|
|
+ // 判断缓存是否存在
|
|
|
|
+ boolean keyExists = redisTemplate.hasKey(redisKey);
|
|
|
|
+ String newValue = length.toString();
|
|
|
|
+ if (!keyExists) {
|
|
|
|
+ // 缓存不存在,直接写入
|
|
|
|
+ redisTemplate.opsForValue().set(redisKey, newValue);
|
|
|
|
+ log.info("初始化缓存 - 键: {}, 值: {}", redisKey, newValue);
|
|
|
|
+ } else {
|
|
|
|
+ // 缓存已存在,获取旧值并比较
|
|
|
|
+ String oldValue = oConvertUtils.getString(redisTemplate.opsForValue().get(redisKey));
|
|
|
|
+ if (!oldValue.equals(newValue)) {
|
|
|
|
+ // 新旧值不同,更新缓存并标记切割类型
|
|
|
|
+ String redisCuttoLengthKey = String.format("cut:to:length:%s", ccmNo);
|
|
|
|
+ redisTemplate.opsForValue().set(redisCuttoLengthKey, "2");
|
|
|
|
+ }
|
|
|
|
+ // 无论是否变更,都更新缓存(确保一致性)
|
|
|
|
+ redisTemplate.opsForValue().set(redisKey, newValue);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
String redisCuttoLengthKey = String.format("cut:to:length:%s", ccmNo);
|
|
String redisCuttoLengthKey = String.format("cut:to:length:%s", ccmNo);
|
|
String cuttolengthType = !oConvertUtils.getString(redisTemplate.opsForValue().get(redisCuttoLengthKey))
|
|
String cuttolengthType = !oConvertUtils.getString(redisTemplate.opsForValue().get(redisCuttoLengthKey))
|
|
.isEmpty() ? oConvertUtils.getString(redisTemplate.opsForValue().get(redisCuttoLengthKey)) : "";
|
|
.isEmpty() ? oConvertUtils.getString(redisTemplate.opsForValue().get(redisCuttoLengthKey)) : "";
|
|
@@ -616,6 +658,8 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
|
|
// 存入 Redis
|
|
// 存入 Redis
|
|
redisTemplate.opsForValue().set(redisKey, jsonValue);
|
|
redisTemplate.opsForValue().set(redisKey, jsonValue);
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
public void sendFurnaceChangeToMqtt(FurnaceChangeData data) {
|
|
public void sendFurnaceChangeToMqtt(FurnaceChangeData data) {
|