no message

main
HUOJIN\92525 2024-08-03 18:42:05 +08:00
parent e82b9bc435
commit 6f60f94779
5 changed files with 39 additions and 10 deletions

View File

@ -173,7 +173,7 @@ public class StockController {
@PreAuthorize("@el.check('stock:edit')") @PreAuthorize("@el.check('stock:edit')")
public ResponseEntity<Object> updateStock(@Validated @RequestBody Stock resources) { public ResponseEntity<Object> updateStock(@Validated @RequestBody Stock resources) {
stockService.update(resources); stockService.update(resources);
return new ResponseEntity<>(HttpStatus.NO_CONTENT); return new ResponseEntity<>(HttpStatus.OK);
} }
@PutMapping("/updateStockOK") @PutMapping("/updateStockOK")

View File

@ -129,6 +129,9 @@ public class StockServiceImpl implements StockService {
Point point = resources.getPoint(); Point point = resources.getPoint();
point.setStatus(BaseStatus.USED); point.setStatus(BaseStatus.USED);
pointRepository.save(point); pointRepository.save(point);
} else {
resources.setPoint(null);
stockRepository.save(resources);
} }
ValidationUtil.isNull(stock.getId(), "Stock", "id", resources.getId()); ValidationUtil.isNull(stock.getId(), "Stock", "id", resources.getId());
stock.copy(resources); stock.copy(resources);
@ -498,13 +501,13 @@ public class StockServiceImpl implements StockService {
/**验证目标容器*/ /**验证目标容器*/
Stock dstStock = validatedstStock(dstStockCode); Stock dstStock = validatedstStock(dstStockCode);
if(dstStock.getStatus().equals(BaseStatus.USED)){
throw new RuntimeException(dstStock.getCode()+"目标托盘已使用,请绑定新的托盘!");
}
/**待拣货数量*/ /**待拣货数量*/
double moveQty = task.getPlanQty(); double moveQty = task.getPlanQty();
/**库存移位*/
moveInventory(task, dstStock, moveQty);
if (pick.getStock() == null) { if (pick.getStock() == null) {
pick.setStock(dstStock); pick.setStock(dstStock);
pickRepository.save(pick); pickRepository.save(pick);
@ -515,6 +518,11 @@ public class StockServiceImpl implements StockService {
} }
} }
/**库存移位*/
moveInventory(task, dstStock, moveQty);
/**刷新拣货状态*/ /**刷新拣货状态*/
refreshPickStatus(task, moveQty); refreshPickStatus(task, moveQty);

View File

@ -431,6 +431,9 @@ public class AgvTaskServiceImpl implements AgvTaskService {
case "FORK_UP": case "FORK_UP":
handleUpContainer(agvTask, containerCode);//容器顶升 handleUpContainer(agvTask, containerCode);//容器顶升
break; break;
case "FORK_DOWN":
handleForkDownContainer(agvTask, containerCode);//容器放下
break;
case "COMPLETED": case "COMPLETED":
handleComContainer(agvTask, containerCode);//搬运任务完成 handleComContainer(agvTask, containerCode);//搬运任务完成
break; break;
@ -466,10 +469,6 @@ public class AgvTaskServiceImpl implements AgvTaskService {
} }
List<Task> taskList = taskService.getAgvTaskList(agvTask.getId()); List<Task> taskList = taskService.getAgvTaskList(agvTask.getId());
switch (endAreaName) { switch (endAreaName) {
case AreaNameDic.XJQ:
case AreaNameDic.DJQ:
handleXJDJ(agvTask, taskList, stock);//入库完成
break;
case AreaNameDic.XJFBQ: case AreaNameDic.XJFBQ:
handleFBQ(taskList, stock, endPoint);//备料完成 handleFBQ(taskList, stock, endPoint);//备料完成
break; break;
@ -488,6 +487,28 @@ public class AgvTaskServiceImpl implements AgvTaskService {
update(agvTask); update(agvTask);
} }
private void handleForkDownContainer(AgvTask agvTask, String containerCode) {
//任务完成根据AGV任务的目标点位走对应流程
Point endPoint = pointService.findByCode(agvTask.getEndSlotCode(), null, null, null, null, null);
String endAreaName = endPoint.getArea().getCode();
Stock stock = stockRepository.findByCode(containerCode, null);
if (stock == null) {
throw new RuntimeException(containerCode + "容器不存在! 请维护");
}
List<Task> taskList = taskService.getAgvTaskList(agvTask.getId());
switch (endAreaName) {
case AreaNameDic.XJQ:
case AreaNameDic.DJQ:
handleXJDJ(agvTask, taskList, stock);//入库完成
break;
}
agvTask.setStatus(BizStatus.FINISH);
agvTask.setStockCode(containerCode);
agvTask.setEndTime(new Timestamp(new Date().getTime()));
update(agvTask);
}
/** /**
* *

View File

@ -155,7 +155,7 @@ public class PickDetailServiceImpl implements PickDetailService {
for (Inventory inv : inventoryList) { for (Inventory inv : inventoryList) {
//判断托盘是否有任务 //判断托盘是否有任务
if (taskRepository.existsByStock(inv.getStockCode()) >= 1) { if (taskRepository.existsByStock(inv.getStockCode()) >= 1) {
return pick.getCode() + "出库单;" + item.getCode() + "的" + inv.getStockCode() + "托盘有任务,请先完成任务!"; continue;
} }
Point startPoint = inv.getPoint();//起始点位 Point startPoint = inv.getPoint();//起始点位
if (unQty == 0) { if (unQty == 0) {

View File

@ -75,7 +75,7 @@ public class pickTask {
List<String> statuses = Arrays.asList(BizStatus.PICK_ALL); List<String> statuses = Arrays.asList(BizStatus.PICK_ALL);
List<Pick> pickList = pickRepository.findByPickStatus(statuses,true); List<Pick> pickList = pickRepository.findByPickStatus(statuses,true);
if (pickList.isEmpty()) { if (pickList.isEmpty()) {
throw new RuntimeException("无拣货完成的出库单,呼叫货架失败!"); throw new RuntimeException("无拣货完成的出库单或出库单为未叫料,呼叫货架失败!");
} else { } else {
for (Pick pick : pickList) { for (Pick pick : pickList) {
stockService.callJlTask(pick); stockService.callJlTask(pick);