|
@@ -77,6 +77,7 @@ import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
import java.util.concurrent.CompletableFuture;
|
|
import java.util.concurrent.CompletableFuture;
|
|
import java.util.concurrent.TimeUnit;
|
|
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;
|
|
|
|
|
|
@@ -304,7 +305,7 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
String positionNum = jsonObject.getString("positionNum");// 车位号
|
|
String positionNum = jsonObject.getString("positionNum");// 车位号
|
|
String layer = jsonObject.getString("layer");
|
|
String layer = jsonObject.getString("layer");
|
|
String address = jsonObject.getString("address");
|
|
String address = jsonObject.getString("address");
|
|
- if (oConvertUtils.isEmpty(ccmNo) || oConvertUtils.isEmpty(positionNum) || oConvertUtils.isEmpty(layer) || oConvertUtils.isEmpty(address) ){
|
|
|
|
|
|
+ if (oConvertUtils.isEmpty(ccmNo) || oConvertUtils.isEmpty(positionNum) || oConvertUtils.isEmpty(layer) || oConvertUtils.isEmpty(address) || oConvertUtils.isEmpty(billetHotsendTypeConfigId)){
|
|
log.info("{}{}", "参数为空,C端自动化新增堆垛失败!", jsonObject.toJSONString());
|
|
log.info("{}{}", "参数为空,C端自动化新增堆垛失败!", jsonObject.toJSONString());
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -380,14 +381,47 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
|
|
|
// 2025 3.3,C端自动化推送保存、B端手动发车临时方案,
|
|
// 2025 3.3,C端自动化推送保存、B端手动发车临时方案,
|
|
LambdaQueryWrapper<StorageBill> queryWrapper2 = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<StorageBill> queryWrapper2 = new LambdaQueryWrapper<>();
|
|
- queryWrapper2.eq(StorageBill::getCcmNo, ccmNo)
|
|
|
|
- .eq(StorageBill::getPositionNum, Integer.valueOf(positionNum))
|
|
|
|
|
|
+ queryWrapper2.eq(StorageBill::getPositionNum, Integer.valueOf(positionNum))
|
|
.isNull(StorageBill::getOutTime);
|
|
.isNull(StorageBill::getOutTime);
|
|
|
|
+ // 2号车位不验证铸机号
|
|
|
|
+ if (!positionNum.equals("2")) {
|
|
|
|
+ queryWrapper2.eq(StorageBill::getCcmNo, ccmNo);
|
|
|
|
+ }
|
|
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;
|
|
|
|
+ }
|
|
|
|
+ // 截取钢坯的第九位字符,为最终铸机号
|
|
|
|
+ ccmNo = Optional.ofNullable(allBilletNos)
|
|
|
|
+ .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 shift = shiftHandle(ccmNo);
|
|
|
|
+ log.info("C端自动化垛位装车缓存中的班组、班别:{}", shiftGroup + ":" + shift);
|
|
|
|
+ if (oConvertUtils.isEmpty(shiftGroup) || oConvertUtils.isEmpty(shift)){
|
|
|
|
+ log.info("{}{}", "班组班别获取为空,C端自动化垛位装车<保存>失败!", JSON.toJSON(isStorageBill));
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+ // 更新装运单铸机号、班别、班组
|
|
|
|
+ if ("0".equals(isStorageBill.getCcmNo())) {
|
|
|
|
+ // 更新铸机号,到装运单
|
|
|
|
+ isStorageBill.setCcmNo(ccmNo);
|
|
|
|
+ isStorageBill.setShiftGroup(shiftGroup);
|
|
|
|
+ isStorageBill.setShift(shift);
|
|
|
|
+ storageBillService.updateById(isStorageBill);
|
|
|
|
+ }else {
|
|
|
|
+ if (!isStorageBill.getCcmNo().equals(ccmNo)){
|
|
|
|
+ log.info("{}{}", ",铸机号与钢坯不一致,C端自动化垛位装车<保存>失败!", JSON.toJSON(isStorageBill));
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
loadingParams.setStorageBill(isStorageBill);
|
|
loadingParams.setStorageBill(isStorageBill);
|
|
|
|
|
|
log.info("{}{}", "自动化堆垛装车,装运单信息:", JSON.toJSON(isStorageBill));
|
|
log.info("{}{}", "自动化堆垛装车,装运单信息:", JSON.toJSON(isStorageBill));
|
|
@@ -409,13 +443,14 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
}
|
|
}
|
|
|
|
|
|
// 棒线公共属性信息
|
|
// 棒线公共属性信息
|
|
- List<RollClubCommon> rollClubCommonList= new ArrayList<>();
|
|
|
|
- billetBasicInfoList.forEach(x ->{
|
|
|
|
- RollClubCommon rollClubCommon = new RollClubCommon();
|
|
|
|
- BeanUtils.copyProperties(x, rollClubCommon);
|
|
|
|
- rollClubCommon.setCcmNo(x.getCcmNo().toString());
|
|
|
|
- rollClubCommonList.add(rollClubCommon);
|
|
|
|
- });
|
|
|
|
|
|
+ String finalCcmNo = ccmNo;
|
|
|
|
+ List<RollClubCommon> rollClubCommonList = billetBasicInfoList.stream()
|
|
|
|
+ .map(info -> {
|
|
|
|
+ RollClubCommon rollClubCommon = new RollClubCommon();
|
|
|
|
+ BeanUtils.copyProperties(info, rollClubCommon);
|
|
|
|
+ rollClubCommon.setCcmNo(finalCcmNo);
|
|
|
|
+ return rollClubCommon;
|
|
|
|
+ }).collect(Collectors.toList());
|
|
|
|
|
|
// 轧钢外运保存时,先判断装运单中的目的地ID是否为1024,如果为1024、明细暂存临时表billet_auto_tmp
|
|
// 轧钢外运保存时,先判断装运单中的目的地ID是否为1024,如果为1024、明细暂存临时表billet_auto_tmp
|
|
if ("1024".equals(isStorageBill.getTypeConfigId())){
|
|
if ("1024".equals(isStorageBill.getTypeConfigId())){
|
|
@@ -428,7 +463,7 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
queryWrapper3.eq(BilletHotsendTypeConfig::getCastMachine, ccmNo)
|
|
queryWrapper3.eq(BilletHotsendTypeConfig::getCastMachine, ccmNo)
|
|
.eq(BilletHotsendTypeConfig::getTypeName, isStorageBill.getDestination());
|
|
.eq(BilletHotsendTypeConfig::getTypeName, isStorageBill.getDestination());
|
|
BilletHotsendTypeConfig billetHotsendTypeConfigInfo = billetHotsendTypeConfigService.getOne(queryWrapper3);
|
|
BilletHotsendTypeConfig billetHotsendTypeConfigInfo = billetHotsendTypeConfigService.getOne(queryWrapper3);
|
|
- log.info("{}{}", "C端自动化堆垛外运查询到钢坯配置目的地信息:", JSON.toJSON(billetHotsendTypeConfigInfo));
|
|
|
|
|
|
+ log.info("{}{}", "C端自动化堆垛装车查询到钢坯配置目的地信息:", JSON.toJSON(billetHotsendTypeConfigInfo));
|
|
|
|
|
|
loadingParams.setDestination(billetHotsendTypeConfigInfo.getTypeName());
|
|
loadingParams.setDestination(billetHotsendTypeConfigInfo.getTypeName());
|
|
loadingParams.setDestinationId(billetHotsendTypeConfigInfo.getId());
|
|
loadingParams.setDestinationId(billetHotsendTypeConfigInfo.getId());
|