From 25f3092b658c7045501cf063efde989695e72be7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=90=8D=E5=96=9C?= Date: Wed, 18 Dec 2024 16:02:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=87=AA=E5=8A=A8=E5=88=86?= =?UTF-8?q?=E9=85=8D=E5=BA=93=E4=BD=8D=E6=9C=BA=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wm/controller/WmsInTaskController.java | 26 +++++++++++++++---- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmsInTaskController.java b/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmsInTaskController.java index 576a0c0..a19654c 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmsInTaskController.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmsInTaskController.java @@ -11,14 +11,12 @@ import com.ktg.mes.md.domain.BaseKnife; import com.ktg.mes.md.domain.MdItem; import com.ktg.mes.md.service.IBaseKnifeService; import com.ktg.mes.md.service.IMdItemService; +import com.ktg.mes.wm.domain.UcmCtBase; import com.ktg.mes.wm.domain.WmStorageArea; import com.ktg.mes.wm.domain.WmsInPlanDetailEntity; import com.ktg.mes.wm.domain.WmsInTask; -import com.ktg.mes.wm.service.IWmStorageAreaService; -import com.ktg.mes.wm.service.IWmsInPlanDetailEntityService; -import com.ktg.mes.wm.service.IWmsInTaskService; +import com.ktg.mes.wm.service.*; import lombok.RequiredArgsConstructor; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; @@ -26,7 +24,6 @@ import javax.servlet.http.HttpServletResponse; import java.util.List; import java.util.Objects; import java.util.Optional; -import java.util.stream.Stream; /** * 入库任务Controller @@ -43,6 +40,8 @@ public class WmsInTaskController extends BaseController { private final IBaseKnifeService baseKnifeService; private final IWmStorageAreaService wmStorageAreaService; private final IWmsInPlanDetailEntityService wmsInPlanDetailEntityService; + private final IUcmCtBaseService ucmCtBaseService; + private final IWmStorageLocationService wmStorageLocationService; /** * 查询入库任务列表 @@ -95,8 +94,25 @@ public class WmsInTaskController extends BaseController { if (wmsInTask == null) { return AjaxResult.error("未查询到相关任务"); } + + // 获得料箱 + UcmCtBase ucmCtBaseByCode = ucmCtBaseService.selectUcmCtBaseByCode(rfid); + if (ucmCtBaseByCode == null) { + return AjaxResult.error("未查询到相关料箱"); + } + + // 自动分配非临时库位 + WmStorageArea wmStorageArea = this.wmStorageLocationService.queryOneAreaByLocationCode("DDJ01", ucmCtBaseByCode.getAttr3() == 1); + wmsInTask.setCellTgt(wmStorageArea.getAreaId()); + wmsInTask.setCellName(wmStorageArea.getAreaName()); + wmsInTask.setCellCode(wmStorageArea.getAreaCode()); + wmsInTask.setCellX(wmStorageArea.getPositionX().toString()); + wmsInTask.setCellY(wmStorageArea.getPositionY().toString()); + wmsInTask.setCellZ(wmStorageArea.getPositionZ().toString()); + // 将料箱rfid绑定至任务 wmsInTask.setBoxRfid(rfid); + wmsInTaskService.updateWmsInTask(wmsInTask); return AjaxResult.success(wmsInTask); }