|
@@ -248,13 +248,10 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = {Exception.class})
|
|
|
public void autoAddRodLine(JSONObject jsonObject) {
|
|
|
- log.info("{}{}", "C端自动化轧钢外运<保存>参数:", jsonObject);
|
|
|
-
|
|
|
-
|
|
|
+ log.info("{}{}", "C端自动化热装<保存>mqtt参数:", jsonObject);
|
|
|
BilletHotsendDetailsVo billetHotsendDetailsVo = new BilletHotsendDetailsVo();
|
|
|
|
|
|
String ccmNo = jsonObject.getString("ccmNo");
|
|
|
-
|
|
|
String billetNos = jsonObject.getString("billetNos");
|
|
|
// String billetHotsendTypeConfigId = jsonObject.getString("billetHotsendTypeConfigId");
|
|
|
String licensePlate = jsonObject.getString("licensePlate");
|
|
@@ -267,7 +264,7 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
|
|
|
String location = jsonObject.getString("location");
|
|
|
|
|
|
if (oConvertUtils.isEmpty(billetNos) || oConvertUtils.isEmpty(positionNum)){
|
|
|
- log.info("{}{}", "参数为空,自动化轧钢外运<保存>失败!", jsonObject);
|
|
|
+ log.info("{}{}", "参数为空,C端自动化热装<保存>失败!", jsonObject);
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -289,7 +286,7 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
|
|
|
String shift = shiftHandle(ccmNo);
|
|
|
|
|
|
if (oConvertUtils.isEmpty(shiftGroup) || oConvertUtils.isEmpty(shift)){
|
|
|
- log.info("{}{}", "班组班别获取为空,自动化轧钢外运<保存>失败!", jsonObject);
|
|
|
+ log.info("{}{}", "班组班别获取为空,C端自动化热装<保存>失败!", jsonObject);
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -319,9 +316,9 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
|
|
|
if (oConvertUtils.isNotEmpty(liftingTime)){
|
|
|
billetLiftingBill.setLiftingTime(DateUtils.str2Date(liftingTime, DateUtils.datetimeFormat.get()));
|
|
|
}
|
|
|
- billetLiftingBill.setRemark("轧钢外运吊运单");
|
|
|
+ billetLiftingBill.setRemark("热装吊运单");
|
|
|
billetLiftingBill.setBilletWeight(0.00);
|
|
|
- log.info("C端自动化轧钢外运热装吊运单,吊运单信息: {}", JSON.toJSON(billetLiftingBill));
|
|
|
+ log.info("C端自动化热装——吊运单信息: {}", JSON.toJSON(billetLiftingBill));
|
|
|
saveBilletLiftingBillsHotCharge(billetLiftingBill);
|
|
|
|
|
|
// 根据坯号查询 对应的钢坯基础信息
|
|
@@ -348,14 +345,14 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
|
|
|
}
|
|
|
}
|
|
|
if (oConvertUtils.listIsEmpty(billetBasicInfoLists)){
|
|
|
- log.info("{}{}", "钢坯基础信息不存在,C端自动化轧钢外运<保存>失败!", jsonObject);
|
|
|
+ log.info("{}{}", "钢坯基础信息不存在,C端自动化热装<保存>失败!", jsonObject);
|
|
|
//4 获取所有的坯号集合
|
|
|
LambdaQueryWrapper<BilletBasicInfo> queryWrapperTest = new LambdaQueryWrapper<>();
|
|
|
queryWrapper1.in(BilletBasicInfo::getBilletNo, Arrays.asList(billetNosparts));
|
|
|
List<BilletBasicInfo> billetBasicInfoListsTest = billetBasicInfoService.list(queryWrapper1);
|
|
|
- log.info("{}{}", "C端查询钢坯实绩对象信息:", JSON.toJSON(billetBasicInfoListsTest));
|
|
|
+ log.info("{}{}", ">>>>>>>C端自动化热装钢坯实绩信息:", JSON.toJSON(billetBasicInfoListsTest));
|
|
|
BilletAutoException billetAutoException = createBilletAutoException(ccmNo, billetNos, shiftGroupHandle(ccmNo), shiftHandle(ccmNo), null);
|
|
|
- billetAutoException.setMassage("钢坯基础信息不存在,自动化轧钢外运<保存>失败!");
|
|
|
+ billetAutoException.setMassage("钢坯基础信息不存在,自动化热装<保存>失败!");
|
|
|
billetAutoExceptionService.save(billetAutoException);
|
|
|
return;
|
|
|
}
|
|
@@ -388,7 +385,7 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
|
|
|
}
|
|
|
// 钢坯装运单
|
|
|
if (oConvertUtils.isEmpty(isStorageBill)) {
|
|
|
- log.info("未查询钢坯装运单信息,车位号为:{},C端自动化轧钢外运<保存>失败!", positionNum);
|
|
|
+ log.info("未查询钢坯装运单信息,车位号为:{},C端自动化热装<保存>失败!", positionNum);
|
|
|
BilletAutoException billetAutoException = new BilletAutoException();
|
|
|
billetAutoException.setId(String.valueOf(IdWorker.getId()));
|
|
|
billetAutoException.setCcmNo(ccmNo);
|
|
@@ -397,14 +394,14 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
|
|
|
billetAutoException.setShift(shift);
|
|
|
billetAutoException.setCreateTime(new Date());
|
|
|
billetAutoException.setRemark(licensePlate);
|
|
|
- billetAutoException.setMassage("未查询钢坯装运单信息,自动化轧钢外运<保存>失败!");
|
|
|
+ billetAutoException.setMassage("未查询钢坯装运单信息,C端自动化热装<保存>失败!");
|
|
|
billetAutoExceptionService.save(billetAutoException);
|
|
|
return;
|
|
|
}
|
|
|
billetHotsendDetailsVo.setStorageBill(isStorageBill);
|
|
|
// 轧钢外运保存时,先判断装运单中的目的地ID是否为1024,如果为1024、明细暂存临时表billet_auto_tmp
|
|
|
if ("1024".equals(isStorageBill.getTypeConfigId())){
|
|
|
- log.info("{}{}", "C端自动化轧钢外运未知目的地信息:", JSON.toJSON(billetNosparts));
|
|
|
+ log.info("{}{}", "C端自动化热装未知目的地,坯号集:", JSON.toJSON(billetNosparts));
|
|
|
billetHotsendDetailsVo.setBelongTable("billet_auto_tmp");
|
|
|
billetHotsendDetailsVo.setBilletHotsendTypeConfigId("1024");
|
|
|
}else {
|
|
@@ -413,7 +410,10 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
|
|
|
queryWrapper3.eq(BilletHotsendTypeConfig::getCastMachine, ccmNo)
|
|
|
.eq(BilletHotsendTypeConfig::getTypeName, isStorageBill.getDestination());
|
|
|
BilletHotsendTypeConfig billetHotsendTypeConfig = billetHotsendTypeConfigService.getOne(queryWrapper3);
|
|
|
- log.info("{}{}", "C端自动化轧钢外运查询到钢坯配置信息:", JSON.toJSON(billetHotsendTypeConfig));
|
|
|
+ if (oConvertUtils.isEmpty(billetHotsendTypeConfig)){
|
|
|
+ log.info("{}{}", "C端自动化热装钢坯配置信息查询为空:", JSON.toJSON(isStorageBill));
|
|
|
+ return;
|
|
|
+ }
|
|
|
billetHotsendDetailsVo.setBelongTable(billetHotsendTypeConfig.getBelongTable());
|
|
|
billetHotsendDetailsVo.setBelongTypeName(billetHotsendTypeConfig.getTypeName());
|
|
|
billetHotsendDetailsVo.setBilletHotsendTypeConfigId(billetHotsendTypeConfig.getId());
|
|
@@ -435,24 +435,24 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
|
|
|
});
|
|
|
billetHotsendDetailsVo.setRollClubCommonList(rollClubCommonLists);
|
|
|
|
|
|
- log.info("{}{}", "C端自动化轧钢外运数据转换<保存>参数:", JSON.toJSONString(billetHotsendDetailsVo));
|
|
|
+ log.info("{}{}", "C端自动化热装数据转换<保存>参数:", JSON.toJSONString(billetHotsendDetailsVo));
|
|
|
|
|
|
saveBilletCommomTrucking(billetHotsendDetailsVo);
|
|
|
|
|
|
- log.info("{}{}", "C端自动化轧钢外运<保存>操作成功:", jsonObject);
|
|
|
+ log.info("{}{}", "C端自动化热装<保存>操作成功:", jsonObject);
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void autoDepartTrucking(JSONObject jsonObject) {
|
|
|
|
|
|
- log.info("{}{}", "C端自动化轧钢外运<直接发车>参数:", jsonObject);
|
|
|
+ log.info("{}{}", "C端自动化离站发车接收mqtt参数:", jsonObject);
|
|
|
|
|
|
String ccmNo = jsonObject.getString("ccmNo");
|
|
|
String licensePlate = jsonObject.getString("licensePlate");
|
|
|
String positionNum = jsonObject.getString("positionNum");
|
|
|
if (oConvertUtils.isEmpty(ccmNo) || oConvertUtils.isEmpty(positionNum)){
|
|
|
- log.info("{}{}", "参数为空,C端自动化轧钢外运<直接发车>失败!", jsonObject);
|
|
|
+ log.info("{}{}", "参数为空,C端自动化离站发车失败!", jsonObject);
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -465,10 +465,10 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
|
|
|
.orderByDesc(StorageBill::getCreateTime).last("limit 1");
|
|
|
StorageBill storageBill = storageBillService.getOne(queryWrapper);
|
|
|
if (oConvertUtils.isEmpty(storageBill)){
|
|
|
- log.info("{}{}", "该车装运单信息不存在,自动化轧钢外运<直接发车>失败!", jsonObject);
|
|
|
+ log.info("{}{}", "装运单信息不存在,C端自动化离站发车失败!", jsonObject);
|
|
|
BilletAutoException billetAutoException = createBilletAutoException(ccmNo, null, shiftGroupHandle(ccmNo), shiftHandle(ccmNo), null);
|
|
|
billetAutoException.setRemark(licensePlate);
|
|
|
- billetAutoException.setMassage("C端该车装运单信息不存在,自动化轧钢外运<直接发车>失败!");
|
|
|
+ billetAutoException.setMassage("装运单信息不存在,C端自动化离站发车失败!");
|
|
|
billetAutoExceptionService.save(billetAutoException);
|
|
|
return;
|
|
|
}
|
|
@@ -479,7 +479,7 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
|
|
|
|
|
|
// 判断装运单,是否有装运信息,装运总支数为0时,手动发车失败
|
|
|
if (storageBill.getAmountTotal() == null || storageBill.getAmountTotal() == 0) {
|
|
|
- log.info("C端自动化离站发车,钢坯装运信息为空,发车成功!{}", JSON.toJSON(storageBill));
|
|
|
+ log.info("钢坯装运信息为空,C端自动化离站发车成功!{}", JSON.toJSON(storageBill));
|
|
|
storageBillService.updateById(storageBill);
|
|
|
return;
|
|
|
}
|
|
@@ -525,7 +525,7 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
|
|
|
storageCarLog.setDataTime(new Date());
|
|
|
storageCarLog.setAmount(storageBill.getAmountTotal());// 支数
|
|
|
storageCarLogService.save(storageCarLog);
|
|
|
- log.info("{}{}", "C端自动化轧钢外运直接发车操作成功!:", licensePlate);
|
|
|
+ log.info("{}{}", "C端自动化离站发车成功!:", licensePlate + "<——>" + storageBill.getId());
|
|
|
|
|
|
}
|
|
|
|
|
@@ -1087,65 +1087,55 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
|
|
|
result.put("fail", "钢坯装运单不存在,C端自动化轧钢外运保存操作失败!");
|
|
|
return result;
|
|
|
}
|
|
|
- storageBillInfo.setAmountTotal(storageBillInfo.getAmountTotal() + rollClubCommonList.size());
|
|
|
+
|
|
|
// 取最新的第一条钢坯信息
|
|
|
- RollClubCommon rollClubCommon = rollClubCommonList.stream().findFirst().orElse(null);
|
|
|
- if (rollClubCommon != null) {
|
|
|
- storageBillInfo.setSteel(rollClubCommon.getGrade());//钢种
|
|
|
- storageBillInfo.setSpec(rollClubCommon.getSpec());//规格
|
|
|
- storageBillInfo.setHeatNo(rollClubCommon.getHeatNo());// 炉号
|
|
|
+ BilletBasicInfo billetBasicInfo = billetBasicInfoList.stream().findFirst().orElse(null);
|
|
|
+ if (billetBasicInfo != null) {
|
|
|
+ storageBillInfo.setSteel(billetBasicInfo.getGrade());//钢种
|
|
|
+ storageBillInfo.setSpec(billetBasicInfo.getSpec());//规格
|
|
|
+ storageBillInfo.setHeatNo(billetBasicInfo.getHeatNo());// 炉号
|
|
|
}
|
|
|
- // 获取 rollClubCommonList 中的长度并转成字符串集合
|
|
|
- List<String> sizeFromList = rollClubCommonList.stream()
|
|
|
- .map(RollClubCommon::getLength)
|
|
|
- .distinct()
|
|
|
- .map(String::valueOf)
|
|
|
- .collect(Collectors.toList());
|
|
|
-
|
|
|
- // 使用 LinkedHashSet 保持顺序(已有的在前)
|
|
|
- Set<String> mergedSizeSet = new LinkedHashSet<>();
|
|
|
- if (StringUtils.isNotBlank(storageBillInfo.getSize())) {
|
|
|
- mergedSizeSet.addAll(Arrays.asList(storageBillInfo.getSize().split(",")));
|
|
|
- }
|
|
|
-
|
|
|
- // 添加新的长度(自动去重)
|
|
|
- mergedSizeSet.addAll(sizeFromList);
|
|
|
-
|
|
|
- // 设置回 storageBillInfo
|
|
|
- String finalSizeString = String.join(",", mergedSizeSet);
|
|
|
- if (StringUtils.isNotBlank(finalSizeString)) {
|
|
|
- storageBillInfo.setSize(finalSizeString);
|
|
|
+ // 装运单编辑确认目的地,同步时,维护定尺
|
|
|
+ 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)) {
|
|
|
+ String distinctSizeStr = sizeIntList.stream()
|
|
|
+ .distinct()
|
|
|
+ .map(String::valueOf)
|
|
|
+ .collect(Collectors.joining(","));
|
|
|
+ String finalSizeStr = Optional.ofNullable(storageBillInfo.getSize())
|
|
|
+ .filter(oConvertUtils::isNotEmpty)
|
|
|
+ .map(s -> s + "," + distinctSizeStr)
|
|
|
+ .orElse(distinctSizeStr);
|
|
|
+ // 对 finalSizeStr 再次去重
|
|
|
+ String[] sizeArray = finalSizeStr.split(",");
|
|
|
+ Set<String> uniqueSizes = Arrays.stream(sizeArray)
|
|
|
+ .filter(s -> s != null && !s.isEmpty())
|
|
|
+ .collect(Collectors.toCollection(HashSet::new));
|
|
|
+ finalSizeStr = String.join(",", uniqueSizes);
|
|
|
+ storageBillInfo.setSize(finalSizeStr);
|
|
|
}
|
|
|
|
|
|
- List<String> stringList = billetBasicInfoList.stream()
|
|
|
- .map(BilletBasicInfo::getAssemblyNumber)
|
|
|
- .filter(oConvertUtils::isNotEmpty)
|
|
|
- .collect(Collectors.toList());
|
|
|
-
|
|
|
- if (oConvertUtils.listIsNotEmpty(stringList)) {
|
|
|
- Set<String> assemblyNumberSet = new LinkedHashSet<>();
|
|
|
-
|
|
|
- // 处理旧的 assemblyNumber(直接按照英文逗号 , 拆分)
|
|
|
- String oldAssemblyNumber = storageBillInfo.getAssemblyNumber();
|
|
|
- if (oConvertUtils.isNotEmpty(oldAssemblyNumber)) {
|
|
|
- Arrays.stream(oldAssemblyNumber.split(","))
|
|
|
- .map(String::trim)
|
|
|
- .filter(oConvertUtils::isNotEmpty)
|
|
|
- .forEach(assemblyNumberSet::add);
|
|
|
- }
|
|
|
-
|
|
|
- // 处理新的 assemblyNumber(也是英文逗号)
|
|
|
- stringList.stream()
|
|
|
- .flatMap(s -> Arrays.stream(s.split(",")))
|
|
|
- .map(String::trim)
|
|
|
+ // 装运单编辑确认目的地,同步时,维护组批号
|
|
|
+ List<String> assemblyNumberList = billetBasicInfoList.stream().map(BilletBasicInfo::getAssemblyNumber)
|
|
|
+ .filter(assemblyNumber -> oConvertUtils.isNotEmpty(assemblyNumber)).collect(Collectors.toList());
|
|
|
+ if(oConvertUtils.listIsNotEmpty(assemblyNumberList)) {
|
|
|
+ String distinctAssemblyNumber = assemblyNumberList.stream().distinct().collect(Collectors.joining(","));
|
|
|
+ String finalAssemblyNumber = Optional.ofNullable(storageBillInfo.getAssemblyNumber())
|
|
|
.filter(oConvertUtils::isNotEmpty)
|
|
|
- .forEach(assemblyNumberSet::add);
|
|
|
-
|
|
|
- // 最后重新赋值
|
|
|
- storageBillInfo.setAssemblyNumber(String.join(",", assemblyNumberSet));
|
|
|
+ .map(s -> s + "," + distinctAssemblyNumber)
|
|
|
+ .orElse(distinctAssemblyNumber);
|
|
|
+
|
|
|
+ // 对 finalAssemblyNumber 再次去重
|
|
|
+ String[] assemblyNumberArray = finalAssemblyNumber.split(",");
|
|
|
+ Set<String> uniqueAssemblyNumbers = Arrays.stream(assemblyNumberArray)
|
|
|
+ .filter(s -> s != null && !s.isEmpty())
|
|
|
+ .collect(Collectors.toCollection(HashSet::new));
|
|
|
+ finalAssemblyNumber = String.join(",", uniqueAssemblyNumbers);
|
|
|
+ storageBillInfo.setAssemblyNumber(finalAssemblyNumber);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ storageBillInfo.setAmountTotal(storageBillInfo.getAmountTotal() + rollClubCommonList.size());
|
|
|
storageBillInfo.setBtype("0");
|
|
|
storageBillService.updateById(storageBillInfo);
|
|
|
|