TaskController细节优化
This commit is contained in:
parent
d3e77e1375
commit
c102f16720
|
|
@ -260,7 +260,7 @@ public class ConveyTaskServiceImpl implements IConveyTaskService {
|
||||||
.eq(TAppStock::getStockStatus, WmsStockStatusEnums.OUTING.getCode())
|
.eq(TAppStock::getStockStatus, WmsStockStatusEnums.OUTING.getCode())
|
||||||
);
|
);
|
||||||
// 更新当前载具到达当前点位的拣选任务为已到达
|
// 更新当前载具到达当前点位的拣选任务为已到达
|
||||||
//updateVehicleArriveStatus(targetPickTask);
|
updateVehicleArriveStatus(targetPickTask);
|
||||||
}
|
}
|
||||||
// 更新拣选任务信息,添加拣选任务记录信息
|
// 更新拣选任务信息,添加拣选任务记录信息
|
||||||
pickRecords.add(new TAppPickTaskBak(
|
pickRecords.add(new TAppPickTaskBak(
|
||||||
|
|
@ -304,38 +304,72 @@ public class ConveyTaskServiceImpl implements IConveyTaskService {
|
||||||
* 更新载具到达状态,防止死锁
|
* 更新载具到达状态,防止死锁
|
||||||
* @param targetPickTask 目标拣选任务
|
* @param targetPickTask 目标拣选任务
|
||||||
*/
|
*/
|
||||||
|
// private void updateVehicleArriveStatus(TAppPickTask targetPickTask) {
|
||||||
|
// synchronized (targetPickTask.getVehicleId().intern()) {
|
||||||
|
//
|
||||||
|
// // 使用 last() 的方式虽然有效,但推荐使用 MyBatis Plus 内置方法保证兼容性
|
||||||
|
// LambdaQueryWrapper<TAppPickTask> queryWrapper = new LambdaQueryWrapper<TAppPickTask>()
|
||||||
|
// .eq(TAppPickTask::getVehicleId, targetPickTask.getVehicleId())
|
||||||
|
// .eq(TAppPickTask::getPickStatus, WmsPickTaskStatusEnum.WAIT.getCode());
|
||||||
|
//
|
||||||
|
// // 设置最多查一条记录(替代 last("LIMIT 1"))
|
||||||
|
// queryWrapper.last("LIMIT 1");
|
||||||
|
//
|
||||||
|
// TAppPickTask waitPickTask = appPickTaskService.getOne(queryWrapper);
|
||||||
|
//
|
||||||
|
// if (waitPickTask == null) {
|
||||||
|
// log.error("没有找到符合条件的 WAIT 状态任务。载具号: {}", targetPickTask.getVehicleId());
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// // 更新当前载具到达当前点位的拣选任务为已到达
|
||||||
|
// appPickTaskService.update(new LambdaUpdateWrapper<TAppPickTask>()
|
||||||
|
// .set(TAppPickTask::getPickStatus, WmsPickTaskStatusEnum.ARRIVE.getCode())
|
||||||
|
// .set(TAppPickTask::getArriveTime, LocalDateTime.now())
|
||||||
|
// .set(TAppPickTask::getPickStand, targetPickTask.getPickStand())
|
||||||
|
// .eq(TAppPickTask::getPickId, waitPickTask.getPickId())
|
||||||
|
// );
|
||||||
|
// appPickPlanService.update(new LambdaUpdateWrapper<TAppPickPlan>()
|
||||||
|
// .set(TAppPickPlan::getStandId, targetPickTask.getPickStand())
|
||||||
|
// .eq(TAppPickPlan::getVehicleId, targetPickTask.getVehicleId())
|
||||||
|
// .last("LIMIT 1"));
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
private void updateVehicleArriveStatus(TAppPickTask targetPickTask) {
|
private void updateVehicleArriveStatus(TAppPickTask targetPickTask) {
|
||||||
synchronized (targetPickTask.getVehicleId().intern()) {
|
if (targetPickTask == null || StringUtils.isEmpty(targetPickTask.getVehicleId())) {
|
||||||
|
log.warn("目标拣选任务或载具号为空");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// 使用 last() 的方式虽然有效,但推荐使用 MyBatis Plus 内置方法保证兼容性
|
synchronized ((targetPickTask.getVehicleId() + "_arrive").intern()) {
|
||||||
LambdaQueryWrapper<TAppPickTask> queryWrapper = new LambdaQueryWrapper<TAppPickTask>()
|
// 使用链式更新,一次性完成多个更新操作
|
||||||
.eq(TAppPickTask::getVehicleId, targetPickTask.getVehicleId())
|
boolean updated = appPickTaskService.update(
|
||||||
.eq(TAppPickTask::getPickStatus, WmsPickTaskStatusEnum.WAIT.getCode());
|
new LambdaUpdateWrapper<TAppPickTask>()
|
||||||
|
.set(TAppPickTask::getPickStatus, WmsPickTaskStatusEnum.ARRIVE.getCode())
|
||||||
|
.set(TAppPickTask::getArriveTime, LocalDateTime.now())
|
||||||
|
.set(TAppPickTask::getPickStand, targetPickTask.getPickStand())
|
||||||
|
.eq(TAppPickTask::getVehicleId, targetPickTask.getVehicleId())
|
||||||
|
.eq(TAppPickTask::getPickStatus, WmsPickTaskStatusEnum.WAIT.getCode())
|
||||||
|
.last("LIMIT 1")
|
||||||
|
);
|
||||||
|
|
||||||
// 设置最多查一条记录(替代 last("LIMIT 1"))
|
if (!updated) {
|
||||||
queryWrapper.last("LIMIT 1");
|
log.warn("没有找到符合条件的 WAIT 状态任务。载具号: {}", targetPickTask.getVehicleId());
|
||||||
|
|
||||||
TAppPickTask waitPickTask = appPickTaskService.getOne(queryWrapper);
|
|
||||||
|
|
||||||
if (waitPickTask == null) {
|
|
||||||
log.error("没有找到符合条件的 WAIT 状态任务。载具号: {}", targetPickTask.getVehicleId());
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 更新当前载具到达当前点位的拣选任务为已到达
|
|
||||||
appPickTaskService.update(new LambdaUpdateWrapper<TAppPickTask>()
|
// 更新拣选计划
|
||||||
.set(TAppPickTask::getPickStatus, WmsPickTaskStatusEnum.ARRIVE.getCode())
|
appPickPlanService.update(
|
||||||
.set(TAppPickTask::getArriveTime, LocalDateTime.now())
|
new LambdaUpdateWrapper<TAppPickPlan>()
|
||||||
.set(TAppPickTask::getPickStand, targetPickTask.getPickStand())
|
.set(TAppPickPlan::getStandId, targetPickTask.getPickStand())
|
||||||
.eq(TAppPickTask::getPickId, waitPickTask.getPickId())
|
.eq(TAppPickPlan::getVehicleId, targetPickTask.getVehicleId())
|
||||||
|
.last("LIMIT 1")
|
||||||
);
|
);
|
||||||
appPickPlanService.update(new LambdaUpdateWrapper<TAppPickPlan>()
|
|
||||||
.set(TAppPickPlan::getStandId, targetPickTask.getPickStand())
|
|
||||||
.eq(TAppPickPlan::getVehicleId, targetPickTask.getVehicleId())
|
|
||||||
.last("LIMIT 1"));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得对应库存的第一条工作
|
* 获得对应库存的第一条工作
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 库存数据服务实现
|
* 库存数据服务实现
|
||||||
|
|
@ -98,16 +99,24 @@ public class StockDataServiceImpl implements IStockDataService {
|
||||||
.orderByDesc(TAppStock::getFirstInTime)
|
.orderByDesc(TAppStock::getFirstInTime)
|
||||||
);
|
);
|
||||||
|
|
||||||
// 添加查询相同载具号和料号但remainNum小于realNum的数据
|
// // 添加查询相同载具号和料号但remainNum小于realNum的数据
|
||||||
List<TAppStock> additionalStockList = appStockService.list(new LambdaQueryWrapper<TAppStock>()
|
// List<TAppStock> additionalStockList = appStockService.list(new LambdaQueryWrapper<TAppStock>()
|
||||||
.eq(TAppStock::getVehicleId, stockConfirm.getVehicleId())
|
// .eq(TAppStock::getVehicleId, stockConfirm.getVehicleId())
|
||||||
.eq(TAppStock::getGoodsId, stockConfirm.getGoodsId())
|
// .eq(TAppStock::getGoodsId, stockConfirm.getGoodsId())
|
||||||
.apply("remain_num < real_num")
|
// .apply("remain_num < real_num")
|
||||||
);
|
// );
|
||||||
// 合并两个列表
|
// // 合并两个列表,避免重复添加
|
||||||
if (additionalStockList != null && !additionalStockList.isEmpty()) {
|
// if (additionalStockList != null && !additionalStockList.isEmpty()) {
|
||||||
stockList.addAll(additionalStockList);
|
// // 获取stockList中已存在的stockId集合
|
||||||
}
|
// Set<String> existingStockIds = stockList.stream()
|
||||||
|
// .map(TAppStock::getStockId)
|
||||||
|
// .collect(Collectors.toSet());
|
||||||
|
//
|
||||||
|
// // 只添加不在existingStockIds中的记录
|
||||||
|
// additionalStockList.stream()
|
||||||
|
// .filter(stock -> !existingStockIds.contains(stock.getStockId()))
|
||||||
|
// .forEach(stockList::add);
|
||||||
|
// }
|
||||||
|
|
||||||
if (stockList == null || stockList.isEmpty()){
|
if (stockList == null || stockList.isEmpty()){
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -109,6 +109,14 @@ public interface ITaskControllerService {
|
||||||
*/
|
*/
|
||||||
BaseWmsApiResponse requestInventory(InventoryRequest inventoryRequest);
|
BaseWmsApiResponse requestInventory(InventoryRequest inventoryRequest);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量下发盘点请求
|
||||||
|
* @param batchInventoryRequest 批量盘点请求
|
||||||
|
* @return 请求结果
|
||||||
|
*/
|
||||||
|
BaseWmsApiResponse batchRequestInventory(BatchInventoryRequest batchInventoryRequest);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询盘点任务确认信息
|
* 查询盘点任务确认信息
|
||||||
* @param inventoryConfirmRequest 请求
|
* @param inventoryConfirmRequest 请求
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,13 @@ public class StockControllerServiceImpl implements IStockControllerService {
|
||||||
// toDate + 1天的凌晨。
|
// toDate + 1天的凌晨。
|
||||||
lambdaQueryWrapper.le(TAppStock::getFirstInTime, LocalDateTime.of(stockQuery.getToDate(), LocalDateTime.MAX.toLocalTime()));
|
lambdaQueryWrapper.le(TAppStock::getFirstInTime, LocalDateTime.of(stockQuery.getToDate(), LocalDateTime.MAX.toLocalTime()));
|
||||||
}
|
}
|
||||||
|
// 新增:处理无使用天数查询
|
||||||
|
if (stockQuery.getNoUseDays() != null && stockQuery.getNoUseDays() > 0) {
|
||||||
|
LocalDateTime thresholdDate = LocalDateTime.now().minusDays(stockQuery.getNoUseDays());
|
||||||
|
// 假设 TAppStock 中有 lastUpdateTime 字段记录最后更新时间
|
||||||
|
lambdaQueryWrapper.le(TAppStock::getLastUpdateTime, thresholdDate);
|
||||||
|
}
|
||||||
|
|
||||||
Page<TAppStock> stockPage = appStockService.page(page, lambdaQueryWrapper);
|
Page<TAppStock> stockPage = appStockService.page(page, lambdaQueryWrapper);
|
||||||
|
|
||||||
PageVo<StockVo> pageVo = PageVo.of(stockPage, StockVo::ofPo);
|
PageVo<StockVo> pageVo = PageVo.of(stockPage, StockVo::ofPo);
|
||||||
|
|
|
||||||
|
|
@ -2081,6 +2081,194 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
||||||
return BaseWmsApiResponse.success("创建盘点任务成功。");
|
return BaseWmsApiResponse.success("创建盘点任务成功。");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public BaseWmsApiResponse batchRequestInventory(BatchInventoryRequest batchInventoryRequest) {
|
||||||
|
try {
|
||||||
|
// 基本参数校验
|
||||||
|
if (batchInventoryRequest == null) {
|
||||||
|
return BaseWmsApiResponse.error("请求为NULL。");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (StringUtils.isEmpty(batchInventoryRequest.getInvStand())) {
|
||||||
|
return BaseWmsApiResponse.error("请求缺少信息,请输入站台号。");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!appStandService.exists(new LambdaQueryWrapper<TAppStand>()
|
||||||
|
.eq(TAppStand::getStandId, batchInventoryRequest.getInvStand())
|
||||||
|
.eq(TAppStand::getStandType, 1))) {
|
||||||
|
return BaseWmsApiResponse.error("非拣选站台不允许盘点。");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (batchInventoryRequest.getItems() == null || batchInventoryRequest.getItems().isEmpty()) {
|
||||||
|
return BaseWmsApiResponse.error("请求缺少盘点项信息。");
|
||||||
|
}
|
||||||
|
|
||||||
|
List<TAppInventory> inventoryList = new ArrayList<>();
|
||||||
|
|
||||||
|
// 处理每个盘点项
|
||||||
|
for (BatchInventoryRequest.InventoryItem item : batchInventoryRequest.getItems()) {
|
||||||
|
// 验证必填字段
|
||||||
|
if (StringUtils.isEmpty(item.getGoodsId())) {
|
||||||
|
return BaseWmsApiResponse.error("存在缺少料号的盘点项。");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (StringUtils.isEmpty(item.getVehicleId())) {
|
||||||
|
return BaseWmsApiResponse.error("存在缺少载具号的盘点项。");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 判断这个料和载具组合有没有还没盘点完的任务
|
||||||
|
List<TAppInventory> existingInventoryList = appInventoryService.list(new LambdaQueryWrapper<TAppInventory>()
|
||||||
|
.eq(TAppInventory::getGoodsId, item.getGoodsId())
|
||||||
|
.eq(TAppInventory::getVehicleId, item.getVehicleId())
|
||||||
|
.and(wrapper -> {
|
||||||
|
// specialStock匹配逻辑
|
||||||
|
if (StringUtils.isEmpty(item.getSpecialStock())) {
|
||||||
|
// 传入空值,匹配数据库中的NULL或空字符串
|
||||||
|
wrapper.isNull(TAppInventory::getSpecialStock)
|
||||||
|
.or()
|
||||||
|
.eq(TAppInventory::getSpecialStock, "");
|
||||||
|
} else {
|
||||||
|
// 传入具体值,精确匹配
|
||||||
|
wrapper.eq(TAppInventory::getSpecialStock, item.getSpecialStock());
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.and(wrapper -> {
|
||||||
|
// specialStockNo匹配逻辑
|
||||||
|
if (StringUtils.isEmpty(item.getSpecialStockNo())) {
|
||||||
|
// 传入空值,匹配数据库中的NULL或空字符串
|
||||||
|
wrapper.isNull(TAppInventory::getSpecialStockNo)
|
||||||
|
.or()
|
||||||
|
.eq(TAppInventory::getSpecialStockNo, "");
|
||||||
|
} else {
|
||||||
|
// 传入具体值,精确匹配
|
||||||
|
wrapper.eq(TAppInventory::getSpecialStockNo, item.getSpecialStockNo());
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.and(wrapper -> {
|
||||||
|
// specialStockItemNo匹配逻辑
|
||||||
|
if (StringUtils.isEmpty(item.getSpecialStockItemNo())) {
|
||||||
|
// 传入空值,匹配数据库中的NULL或空字符串
|
||||||
|
wrapper.isNull(TAppInventory::getSpecialStockItemNo)
|
||||||
|
.or()
|
||||||
|
.eq(TAppInventory::getSpecialStockItemNo, "");
|
||||||
|
} else {
|
||||||
|
// 传入具体值,精确匹配
|
||||||
|
wrapper.eq(TAppInventory::getSpecialStockItemNo, item.getSpecialStockItemNo());
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.and(wrapper -> {
|
||||||
|
// batchNo匹配逻辑
|
||||||
|
if (StringUtils.isEmpty(item.getBatchNo())) {
|
||||||
|
// 传入空值,匹配数据库中的NULL或空字符串
|
||||||
|
wrapper.isNull(TAppInventory::getBatchNo)
|
||||||
|
.or()
|
||||||
|
.eq(TAppInventory::getBatchNo, "");
|
||||||
|
} else {
|
||||||
|
// 传入具体值,精确匹配
|
||||||
|
wrapper.eq(TAppInventory::getBatchNo, item.getBatchNo());
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
|
||||||
|
if (existingInventoryList != null && !existingInventoryList.isEmpty()) {
|
||||||
|
return BaseWmsApiResponse.error("载具:" + item.getVehicleId() + " 料号:" + item.getGoodsId() + " 还有盘点任务未完成。");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询库存验证是否存在
|
||||||
|
List<TAppStock> stockList = appStockService.list(new LambdaQueryWrapper<TAppStock>()
|
||||||
|
.eq(TAppStock::getGoodsId, item.getGoodsId())
|
||||||
|
.eq(TAppStock::getVehicleId, item.getVehicleId())
|
||||||
|
.and(wrapper -> {
|
||||||
|
// specialStock匹配逻辑
|
||||||
|
if (StringUtils.isEmpty(item.getSpecialStock())) {
|
||||||
|
// 传入空值,匹配数据库中的NULL或空字符串
|
||||||
|
wrapper.isNull(TAppStock::getSpecialStock)
|
||||||
|
.or()
|
||||||
|
.eq(TAppStock::getSpecialStock, "");
|
||||||
|
} else {
|
||||||
|
// 传入具体值,精确匹配
|
||||||
|
wrapper.eq(TAppStock::getSpecialStock, item.getSpecialStock());
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.and(wrapper -> {
|
||||||
|
// specialStockNo匹配逻辑
|
||||||
|
if (StringUtils.isEmpty(item.getSpecialStockNo())) {
|
||||||
|
// 传入空值,匹配数据库中的NULL或空字符串
|
||||||
|
wrapper.isNull(TAppStock::getSpecialStockNo)
|
||||||
|
.or()
|
||||||
|
.eq(TAppStock::getSpecialStockNo, "");
|
||||||
|
} else {
|
||||||
|
// 传入具体值,精确匹配
|
||||||
|
wrapper.eq(TAppStock::getSpecialStockNo, item.getSpecialStockNo());
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.and(wrapper -> {
|
||||||
|
// specialStockItemNo匹配逻辑
|
||||||
|
if (StringUtils.isEmpty(item.getSpecialStockItemNo())) {
|
||||||
|
// 传入空值,匹配数据库中的NULL或空字符串
|
||||||
|
wrapper.isNull(TAppStock::getSpecialStockItemNo)
|
||||||
|
.or()
|
||||||
|
.eq(TAppStock::getSpecialStockItemNo, "");
|
||||||
|
} else {
|
||||||
|
// 传入具体值,精确匹配
|
||||||
|
wrapper.eq(TAppStock::getSpecialStockItemNo, item.getSpecialStockItemNo());
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.and(wrapper -> {
|
||||||
|
// batchNo匹配逻辑
|
||||||
|
if (StringUtils.isEmpty(item.getBatchNo())) {
|
||||||
|
// 传入空值,匹配数据库中的NULL或空字符串
|
||||||
|
wrapper.isNull(TAppStock::getBatchNo)
|
||||||
|
.or()
|
||||||
|
.eq(TAppStock::getBatchNo, "");
|
||||||
|
} else {
|
||||||
|
// 传入具体值,精确匹配
|
||||||
|
wrapper.eq(TAppStock::getBatchNo, item.getBatchNo());
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
|
||||||
|
if (stockList == null || stockList.isEmpty()) {
|
||||||
|
return BaseWmsApiResponse.error("载具:" + item.getVehicleId() + " 物料:" + item.getGoodsId() + " 没有库存。");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建盘点任务
|
||||||
|
TAppInventory inventory = new TAppInventory(
|
||||||
|
UUIDUtils.getNewUUID(),
|
||||||
|
item.getGoodsId(),
|
||||||
|
item.getVehicleId(),
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
batchInventoryRequest.getInvStand(),
|
||||||
|
batchInventoryRequest.getInvUser(),
|
||||||
|
WmsInvTypeEnums.INV_TYPE_1.getCode(),
|
||||||
|
WmsInvStatusEnums.INIT.getCode(),
|
||||||
|
WmsInvResultEnums.NONE.getCode(),
|
||||||
|
LocalDateTime.now(),
|
||||||
|
null,
|
||||||
|
UUIDUtils.getNewUUID(), // orderId
|
||||||
|
item.getSpecialStock(),
|
||||||
|
item.getSpecialStockNo(),
|
||||||
|
item.getSpecialStockItemNo(),
|
||||||
|
item.getBatchNo()
|
||||||
|
);
|
||||||
|
|
||||||
|
inventoryList.add(inventory);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 批量保存盘点任务
|
||||||
|
if (!inventoryList.isEmpty()) {
|
||||||
|
appInventoryService.saveBatch(inventoryList);
|
||||||
|
}
|
||||||
|
|
||||||
|
return BaseWmsApiResponse.success("批量盘点任务创建成功");
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("批量盘点任务创建失败: {}", e.getMessage(), e);
|
||||||
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||||
|
return BaseWmsApiResponse.error("批量盘点任务创建失败: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询盘点确认信息
|
* 查询盘点确认信息
|
||||||
|
|
@ -2144,8 +2332,14 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
||||||
if (inventoryConfirmVo != null) {
|
if (inventoryConfirmVo != null) {
|
||||||
// 返回结果
|
// 返回结果
|
||||||
return WmsApiResponse.success("查询盘点确认信息成功。", inventoryConfirmVo);
|
return WmsApiResponse.success("查询盘点确认信息成功。", inventoryConfirmVo);
|
||||||
|
}else {
|
||||||
|
if (thisPickTask.getPickType() == 1){
|
||||||
|
return WmsApiResponse.instanceOf(WmsApiResponseCodeEnums.WARNING.getCode(),
|
||||||
|
"当前箱子有拣选任务,请使用PDA拣选,箱号:" + thisPickTask.getVehicleId() + "。",
|
||||||
|
null);
|
||||||
|
}
|
||||||
|
return WmsApiResponse.instanceOf(WmsApiResponseCodeEnums.WARNING.getCode(), "当前箱子没有要盘点的任务,请检查。", null);
|
||||||
}
|
}
|
||||||
return WmsApiResponse.instanceOf(WmsApiResponseCodeEnums.WARNING.getCode(), "当前箱子没有要盘点的任务,请放行。", null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -2246,28 +2440,28 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
||||||
LambdaQueryWrapper<TAppStock> stockQueryWrapper = new LambdaQueryWrapper<TAppStock>()
|
LambdaQueryWrapper<TAppStock> stockQueryWrapper = new LambdaQueryWrapper<TAppStock>()
|
||||||
.eq(TAppStock::getVehicleId, thisPickTask.getVehicleId());
|
.eq(TAppStock::getVehicleId, thisPickTask.getVehicleId());
|
||||||
List<TAppStock> stockList = appStockService.list(stockQueryWrapper);
|
List<TAppStock> stockList = appStockService.list(stockQueryWrapper);
|
||||||
// 界面直接点击确认/放行
|
// // 界面直接点击确认/放行
|
||||||
if (!stockList.isEmpty()) {
|
// if (!stockList.isEmpty()) {
|
||||||
// 判断是否还有其他盘点任务
|
// // 判断是否还有其他盘点任务
|
||||||
List<TAppInventory> otherInventoryList = appInventoryService.list(new LambdaQueryWrapper<TAppInventory>()
|
//// List<TAppInventory> otherInventoryList = appInventoryService.list(new LambdaQueryWrapper<TAppInventory>()
|
||||||
.eq(TAppInventory::getVehicleId, thisPickTask.getVehicleId())
|
//// .eq(TAppInventory::getVehicleId, thisPickTask.getVehicleId())
|
||||||
.ne(TAppInventory::getInventoryId, inventoryConfirmRequest.getInventoryId()));
|
//// .ne(TAppInventory::getInventoryId, inventoryConfirmRequest.getInventoryId()));
|
||||||
if (otherInventoryList != null && !otherInventoryList.isEmpty()) {
|
//// if (otherInventoryList != null && !otherInventoryList.isEmpty()) {
|
||||||
return BaseWmsApiResponse.error("当前载具还有其他的盘点任务,请继续盘点。");
|
//// return BaseWmsApiResponse.error("当前载具还有其他的盘点任务,请继续盘点。");
|
||||||
}
|
//// }
|
||||||
// 判断还有没有当前站台的其他拣选任务
|
// // 判断还有没有当前站台的其他拣选任务
|
||||||
TaskConfirmVo taskConfirmVo = conveyTaskService.getCurrentStandTask(thisPickTask);
|
// TaskConfirmVo taskConfirmVo = conveyTaskService.getCurrentStandTask(thisPickTask);
|
||||||
if (taskConfirmVo != null) {
|
// if (taskConfirmVo != null) {
|
||||||
return BaseWmsApiResponse.warn("当前载具还有紧急出库任务,请切换到出库界面信息进行拣配。");
|
// return BaseWmsApiResponse.warn("当前载具还有拣选任务,请使用PDA进行拣配。");
|
||||||
}
|
// }
|
||||||
WorkConfirmVo resultVo = conveyTaskService.getCurrentStandWork(thisPickTask);
|
//// WorkConfirmVo resultVo = conveyTaskService.getCurrentStandWork(thisPickTask);
|
||||||
if (resultVo != null) {
|
//// if (resultVo != null) {
|
||||||
return BaseWmsApiResponse.warn("当前载具还有工作,请切换到拣配界面进行拣配。");
|
//// return BaseWmsApiResponse.warn("当前载具还有工作,请切换到拣配界面进行拣配。");
|
||||||
}
|
//// }
|
||||||
} else {
|
// } else {
|
||||||
// 取消后续拣选任务
|
// // 取消后续拣选任务
|
||||||
conveyTaskService.cancelOtherStandPickTasks(thisPickTask.getVehicleId(), thisPickTask.getPickStand());
|
// conveyTaskService.cancelOtherStandPickTasks(thisPickTask.getVehicleId(), thisPickTask.getPickStand());
|
||||||
}
|
// }
|
||||||
// 放行
|
// 放行
|
||||||
if (conveyTaskService.releaseStandVehicle(thisPickTask)) {
|
if (conveyTaskService.releaseStandVehicle(thisPickTask)) {
|
||||||
return BaseWmsApiResponse.success("确认成功。");
|
return BaseWmsApiResponse.success("确认成功。");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user