no message

main
HUOJIN\92525 2025-03-21 17:58:23 +08:00
parent e413a5f1d9
commit 415009920b
4 changed files with 42 additions and 16 deletions

View File

@ -185,18 +185,18 @@ public class BydAppServiceImpl implements BydAppService {
@Override
public ReturnTaskVo scanStock(String stockCode) {
List<Task> taskList = taskService.findTaskByContains(BizStatus.PICK, BizStatus.ARRIVED, stockCode);
if (taskList.isEmpty()) {
throw new BadRequestException("未找到" + stockCode + "托盘的翻包拣货任务!");
}
//推荐目标托盘
Stock stock;
stock = stockService.findByPointCode(stockCode);
if (stock == null) {
stock = stockService.findByCode(stockCode);
}
String pickCode = taskService.findByStockCodeToPick(stock.getCode());
List<Task> taskList = taskService.findTaskByContains(BizStatus.PICK, BizStatus.ARRIVED, stockCode);
if (taskList.isEmpty()) {
throw new BadRequestException( stock.getCode() + "托盘任务已翻包完成!");
}
//推荐目标托盘
String pickCode = taskService.findBySrcStockToPick(stock.getCode());
String dstStockCode = taskService.findByPickToStockCode(pickCode);
if (StringUtils.isEmpty(dstStockCode)) {
dstStockCode = "";
@ -488,6 +488,11 @@ public class BydAppServiceImpl implements BydAppService {
if (StringUtils.isNotBlank(stockCode) && !dstStockCode.equals(stockCode)) {
throw new BadRequestException("一个工单的物料只能放入同一个货架! 请放入" + stockCode + "货架!");
}
String pickCode = taskService.findByDstStockToPick(dstStockCode);
if (StringUtils.isNotBlank(pickCode) && !pick.getCode().equals(pickCode)) {
throw new BadRequestException(dstStockCode+"货架已绑定其他工单,请更换容器");
}
}
return dstStock;
}

View File

@ -106,12 +106,20 @@ public interface TaskRepository extends JpaRepository<Task, Long>, JpaSpecificat
/**
*
* @param stockCode
*
* @param srcStockCode
* @return
*/
@Query(value = "select max(t.pickDetail.pick.code) from Task t where t.srcStock.code=:stockCode and t.taskType='PICK' and t.planQty-t.moveQty>0 and t.callAgvTaskId is null")
String findByStockCodeToPick(String stockCode);
@Query(value = "select max(t.pickDetail.pick.code) from Task t where t.srcStock.code=:srcStockCode and t.taskType='PICK' and t.planQty-t.moveQty>0 and t.callAgvTaskId is null")
String findBySrcStockToPick(String srcStockCode);
/**
*
* @param dstStockCode
* @return
*/
@Query(value = "select max(t.pickDetail.pick.code) from Task t where t.dstStock.code=:dstStockCode and t.taskType='PICK' and t.planQty-t.moveQty=0 and t.callAgvTaskId is null")
String findByDstStockToPick(String dstStockCode);
/**
*

View File

@ -163,11 +163,19 @@ public interface TaskService {
List<Task> findTaskByContains(String taskType, String taskStatus, String srcStockCode);
/**
*
*
*
* @param stockCode
* @param srcStockCode
*/
String findByStockCodeToPick(String stockCode);
String findBySrcStockToPick(String srcStockCode);
/**
*
*
* @param dstStockCode
*/
String findByDstStockToPick(String dstStockCode);
/**

View File

@ -171,8 +171,13 @@ public class TaskServiceImpl implements TaskService {
}
@Override
public String findByStockCodeToPick(String stockCode) {
return taskRepository.findByStockCodeToPick(stockCode);
public String findBySrcStockToPick(String srcStockCode) {
return taskRepository.findBySrcStockToPick(srcStockCode);
}
@Override
public String findByDstStockToPick(String dstStockCode) {
return taskRepository.findByDstStockToPick(dstStockCode);
}
@Override