|
@@ -242,11 +242,10 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
|
|
|
public JSONObject storageBillSave(StorageBill storageBill) {
|
|
|
JSONObject result = new JSONObject();
|
|
|
try {
|
|
|
-
|
|
|
// 从 Redis 获取班次信息
|
|
|
String shiftGroup = getShiftInfo(storageBill.getCcmNo(), "class:shift:group:%s");
|
|
|
String shift = getShiftInfo(storageBill.getCcmNo(), "class:shift:%s");
|
|
|
-
|
|
|
+ // 判断车牌号是否存在未发车的装运单信息
|
|
|
LambdaQueryWrapper<StorageBill> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
queryWrapper.eq(StorageBill::getCcmNo, storageBill.getCcmNo())
|
|
|
.eq(StorageBill::getLicensePlate, storageBill.getLicensePlate())
|
|
@@ -256,18 +255,22 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
|
|
|
StorageBill isStorageBill = baseMapper.selectOne(queryWrapper);
|
|
|
if (oConvertUtils.isNotEmpty(isStorageBill)) {
|
|
|
log.info("查询到存在未发车车辆,车牌号为:{},新增钢坯装运单失败!", storageBill.getLicensePlate());
|
|
|
- result.put("fail", "存在未发车车辆,新增钢坯装运单失败!");
|
|
|
+ result.put("fail", "该车存在未发车信息,新增钢坯装运单失败!");
|
|
|
return result;
|
|
|
}
|
|
|
- // 判断车位是否存在未发车车辆(2025/3.3,暂时注释,等自动化发车车位发车完善后,在添加此段逻辑)
|
|
|
-// List<StorageBill> storageBillList = baseMapper.selectList(new LambdaQueryWrapper<StorageBill>()
|
|
|
-// .eq(StorageBill::getPositionNum, storageBill.getPositionNum())
|
|
|
-// .isNull(StorageBill::getOutTime));
|
|
|
-// if (oConvertUtils.listIsNotEmpty(storageBillList)){
|
|
|
-// log.info("该车位存在未发车车辆,车牌号为:{},新增钢坯装运单失败!", storageBill.getLicensePlate());
|
|
|
-// result.put("fail", "该车位存在未发车车辆,新增钢坯装运单失败!");
|
|
|
-// return result;
|
|
|
-// }
|
|
|
+ // 判断车位是否存在未发车车辆(2025/3.3,半自动化逻辑,等自动化发车车位发车完善后,在添加此段逻辑)
|
|
|
+ List<StorageBill> storageBillList = baseMapper.selectList(new LambdaQueryWrapper<StorageBill>()
|
|
|
+ .eq(StorageBill::getPositionNum, storageBill.getPositionNum())
|
|
|
+ .isNull(StorageBill::getOutTime));
|
|
|
+ if (oConvertUtils.listIsNotEmpty(storageBillList)){
|
|
|
+ log.info("{}{}", "该车位存在未发车信息,新增钢坯装运单失败!", JSON.toJSON(storageBillList));
|
|
|
+ result.put("fail", "该车位存在未发车信息,新增钢坯装运单失败!");
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ // 五号机默认为1号车位
|
|
|
+ if ("5".equals(storageBill.getCcmNo())){
|
|
|
+ storageBill.setPositionNum(1);
|
|
|
+ }
|
|
|
storageBill.setArrivalTime(new Date());// 到达时间
|
|
|
LambdaQueryWrapper<StorageBill> queryWrapper1 = new LambdaQueryWrapper<>();
|
|
|
queryWrapper1.eq(StorageBill::getCcmNo, storageBill.getCcmNo())
|