|
@@ -91,14 +91,22 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
|
|
|
/**
|
|
|
* 判断该车位上是否有未发出的车辆
|
|
|
* 车位1: 五号机501堆垛旁的车位
|
|
|
- * 车位2: 六号机冷床和高线辊道中间的车位
|
|
|
+ * 车位2: 六号机冷床和高线辊道中间的车位 (变更逻辑 2号车位创建不固定 5or6铸机号)
|
|
|
* 车位3: 六号机601堆垛旁的车位
|
|
|
* 车位4: 六号机步进冷床和602堆垛中间的车位
|
|
|
*/
|
|
|
+ // 车位等于 2铸机号先归为0 变更日期 2025-4-24 默认取6
|
|
|
+ if (positionNum.equals("2")) {
|
|
|
+ shiftGroup = getShiftInfo("6", "class:shift:group:%s");
|
|
|
+ shift = getShiftInfo("6", "class:shift:%s");
|
|
|
+ }
|
|
|
LambdaQueryWrapper<StorageBill> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
- queryWrapper.eq(StorageBill::getCcmNo, ccmNo)
|
|
|
- .eq(StorageBill::getPositionNum, Integer.valueOf(positionNum))
|
|
|
+ queryWrapper.eq(StorageBill::getPositionNum, Integer.valueOf(positionNum))
|
|
|
.isNull(StorageBill::getOutTime);
|
|
|
+ // 2号车位不验证铸机号
|
|
|
+ if (!positionNum.equals("2")) {
|
|
|
+ queryWrapper.eq(StorageBill::getCcmNo, ccmNo);
|
|
|
+ }
|
|
|
StorageBill isStorageBill = baseMapper.selectOne(queryWrapper);
|
|
|
if (oConvertUtils.isNotEmpty(isStorageBill)) {
|
|
|
log.info("C端自动化查询到该车位存在未发车车辆,需对此车辆进行发车,车牌号为:{}", jsonObject);
|
|
@@ -106,8 +114,8 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
|
|
|
}
|
|
|
|
|
|
// 更新交班记录 通过铸机号、班组、班别去查询交班记录并初始化 出车号
|
|
|
- updateBilletHotsendChangeShift(ccmNo, shiftGroup, shift);
|
|
|
- // 钢坯信息
|
|
|
+// updateBilletHotsendChangeShift(ccmNo, shiftGroup, shift);
|
|
|
+ // 装运单信息
|
|
|
StorageBill storageBill = new StorageBill();
|
|
|
storageBill.setId(String.valueOf(IdWorker.getId()));
|
|
|
log.info("{}{}", "C端自动化创建装运单主键ID", storageBill.getId());
|
|
@@ -120,26 +128,26 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
|
|
|
log.info("{}{}", "C端自动化新增装运单,车牌字典中是否存在:", exists);
|
|
|
if (exists){
|
|
|
storageBill.setLicensePlateStatus(0);
|
|
|
- int carNum = calculateCarNum(ccmNo, licensePlate, shiftGroup, shift);
|
|
|
- storageBill.setCarNum(carNum + 1);
|
|
|
+// int carNum = calculateCarNum(ccmNo, licensePlate, shiftGroup, shift);
|
|
|
+// storageBill.setCarNum(carNum + 1);
|
|
|
storageBill.setLicensePlate(licensePlate);
|
|
|
}else {
|
|
|
storageBill.setLicensePlateStatus(1);
|
|
|
- storageBill.setCarNum(0);
|
|
|
storageBill.setLicensePlate("");
|
|
|
}
|
|
|
log.info("{}{}", "C端自动化新增装运单对象信息:", JSON.toJSON(storageBill));
|
|
|
}
|
|
|
}else {
|
|
|
storageBill.setLicensePlate("");
|
|
|
- storageBill.setCarNum(0);
|
|
|
storageBill.setLicensePlateStatus(1);
|
|
|
log.info("{}{}", "C端自动化新增钢坯装运单,未传车牌号:", JSON.toJSON(storageBill));
|
|
|
}
|
|
|
+ storageBill.setCarNum(0); // 本车车次
|
|
|
+ storageBill.setCarAllNum(0); // 总车车次
|
|
|
// 车次总序号
|
|
|
- int carAllNum = calculateCarAllNum(ccmNo, shiftGroup, shift);
|
|
|
- storageBill.setCarAllNum(carAllNum + 1);
|
|
|
- // 保存钢坯基础信息
|
|
|
+// int carAllNum = calculateCarAllNum(ccmNo, shiftGroup, shift);
|
|
|
+// storageBill.setCarAllNum(carAllNum + 1);
|
|
|
+ // 保存储运单信息
|
|
|
storageBill.setCcmNo(ccmNo);
|
|
|
// 根据铸机号、班组、班别,创建时间倒序 只返回一条,查询储运配置信息
|
|
|
LambdaQueryWrapper<ShiftConfiguration> queryWrapper1 = new LambdaQueryWrapper<ShiftConfiguration>();
|
|
@@ -206,9 +214,12 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
|
|
|
return;
|
|
|
}
|
|
|
LambdaQueryWrapper<StorageBill> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
- queryWrapper.eq(StorageBill::getCcmNo, ccmNo)
|
|
|
- .eq(StorageBill::getPositionNum, Integer.valueOf(positionNum))
|
|
|
+ queryWrapper.eq(StorageBill::getPositionNum, Integer.valueOf(positionNum))
|
|
|
.isNull(StorageBill::getOutTime);
|
|
|
+ // 2号车位不验证铸机号 变更日期 2025-4-24
|
|
|
+ if (!positionNum.equals("2")) {
|
|
|
+ queryWrapper.eq(StorageBill::getCcmNo, ccmNo);
|
|
|
+ }
|
|
|
StorageBill isStorageBill = baseMapper.selectOne(queryWrapper);
|
|
|
if (oConvertUtils.isEmpty(isStorageBill)) {
|
|
|
log.info("C端自动化钢坯装运单信息为空,更新车牌号失败:{}", jsonObject);
|
|
@@ -231,8 +242,8 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
|
|
|
log.info("{}{}", "C端自动化更新车牌字典中是否存在:", exists);
|
|
|
if (exists){
|
|
|
isStorageBill.setLicensePlateStatus(0);
|
|
|
- int carNum = calculateCarNum(ccmNo, licensePlate, isStorageBill.getShiftGroup(), isStorageBill.getShift());
|
|
|
- isStorageBill.setCarNum(carNum + 1);
|
|
|
+// int carNum = calculateCarNum(ccmNo, licensePlate, isStorageBill.getShiftGroup(), isStorageBill.getShift());
|
|
|
+// isStorageBill.setCarNum(carNum + 1);
|
|
|
log.info("{}{}", "C端自动化更新车牌,本车车次序号:", isStorageBill.getCarNum());
|
|
|
isStorageBill.setLicensePlate(licensePlate);
|
|
|
}else {
|