From 71d838e032d13a46a07917f5606862496220ea74 Mon Sep 17 00:00:00 2001 From: zyx <zyx123456> Date: 星期一, 08 一月 2024 08:35:35 +0800 Subject: [PATCH] # 入库拣货功能添加 --- src/main/java/com/zy/asrs/service/impl/PlaServiceImpl.java | 30 ++++++++++++++++++++++++++++++ 1 files changed, 30 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/zy/asrs/service/impl/PlaServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/PlaServiceImpl.java index 81a1491..5843839 100644 --- a/src/main/java/com/zy/asrs/service/impl/PlaServiceImpl.java +++ b/src/main/java/com/zy/asrs/service/impl/PlaServiceImpl.java @@ -10,6 +10,8 @@ import com.zy.asrs.mapper.PlaMapper; import com.zy.asrs.service.PlaQtyService; import com.zy.asrs.service.PlaService; +import com.zy.asrs.utils.Utils; +import com.zy.system.entity.User; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -84,4 +86,32 @@ } } + + //閫�鍥� + public void returned(List<PlaQty> plaQties, User user) { + plaQties.forEach(plaQty -> { + PlaQty plaQtyOut = plaQtyService.selectById(plaQty.getId()); + plaQtyOut.setReturned(1); + plaQtyService.updateById(plaQtyOut); + + PlaQty plaQtyReturned = new PlaQty(); + plaQtyReturned.setBatch(plaQtyOut.getBatch()); + plaQtyReturned.setPackageNo(plaQtyOut.getPackageNo()); + plaQtyReturned.setCreateTime(new Date()); + plaQtyReturned.setLocNo(plaQtyOut.getLocNo()); + plaQtyReturned.setOrderNo(plaQtyOut.getOrderNo()); + plaQtyReturned.setPakoutTime(Utils.getDateStr(new Date())); + plaQtyReturned.setOrderWeight(0 - plaQtyOut.getOrderWeight()); + plaQtyReturned.setHandlerBy(user.getUsername()); + plaQtyReturned.setCustomer(plaQtyOut.getCustomer()); + plaQtyReturned.setMemo(plaQty.getMemo()); + plaQtyService.insert(plaQtyReturned); + + Pla pla = this.selectByBatchAndPackageNo(plaQty.getBatch(), plaQty.getPackageNo()); + pla.setStatus("寰呭叆搴�"); + + this.updateById(pla); + + }); + } } -- Gitblit v1.9.1