From 45dd167e12e11af8dc7929ff1475623c80fc3578 Mon Sep 17 00:00:00 2001 From: whycq <913841844@qq.com> Date: 星期三, 30 十月 2024 13:59:33 +0800 Subject: [PATCH] # --- src/main/java/com/zy/asrs/controller/AgvMobileController.java | 45 +++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 41 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/zy/asrs/controller/AgvMobileController.java b/src/main/java/com/zy/asrs/controller/AgvMobileController.java index 4fcccae..33a4f1e 100644 --- a/src/main/java/com/zy/asrs/controller/AgvMobileController.java +++ b/src/main/java/com/zy/asrs/controller/AgvMobileController.java @@ -5,6 +5,7 @@ import com.core.annotations.ManagerAuth; import com.core.common.Cools; import com.core.common.R; +import com.core.common.SnowflakeIdWorker; import com.core.exception.CoolException; import com.zy.asrs.entity.*; import com.zy.asrs.entity.param.*; @@ -47,6 +48,10 @@ private AgvWrkMastService agvWrkMastService; @Autowired private AgvWrkDetlService agvWrkDetlService; + @Autowired + private SnowflakeIdWorker snowflakeIdWorker; + @Autowired + private FlowLogService flowLogService; /* @@ -373,9 +378,7 @@ - if((!Cools.eq("F",agvLocMastByContainerCode.getLocSts()) - && !Cools.eq("D",agvLocMastByContainerCode.getLocSts())) - || (!Cools.eq("F",agvLocMastByLocNo.getLocSts()) + if((!Cools.eq("F",agvLocMastByLocNo.getLocSts()) && !Cools.eq("D",agvLocMastByLocNo.getLocSts()))){ return R.error("搴撲綅鐘舵�佷笉涓篎鎴栬�匘锛屾棤娉曠淮鎶�"); @@ -428,7 +431,13 @@ } if((listByLocNo == null && listByContainerCode == null) || listByLocNo.equals(listByContainerCode)){ - return R.ok("璇ュ簱浣嶄笌璐ф灦搴撳瓨涓�鑷达紝鏃犻渶缁存姢"); + //agvLocMastByContainerCode.setBarcode(agvLocMastByLocNo.getBarcode()); + //agvLocMastService.updateById(agvLocMastByContainerCode); + + agvLocMastByLocNo.setBarcode(containerCode); + agvLocMastService.updateById(agvLocMastByLocNo); + //return R.ok("璇ュ簱浣嶄笌璐ф灦搴撳瓨涓�鑷达紝鏃犻渶缁存姢"); + return R.ok("缁存姢鎴愬姛"); } @@ -541,6 +550,7 @@ } AgvWrkMast wrkMast = createWrkMast(ioType, 22L, locNo, "", barcode, now, getUserId(), 30,floor); // 鍚屾璋冩嫧鍗� + long flowId = snowflakeIdWorker.nextId(); List<AgvLocDetl> agvLocDetls = agvLocDetlService.selectList(new EntityWrapper<AgvLocDetl>().eq("loc_no", locNo)); for (AgvLocDetl agvLocDetl : agvLocDetls) { AgvWrkDetl wrkDetl = new AgvWrkDetl(); @@ -555,8 +565,35 @@ if (!agvWrkDetlService.insert(wrkDetl)) { throw new CoolException("淇濆瓨宸ヤ綔鏄庣粏澶辫触"); } + // 鏇存柊璁㈠崟 OrderDetl orderDetl = orderDetlService.selectOne(new EntityWrapper<OrderDetl>().eq("source",33).eq("matnr", agvLocDetl.getMatnr()).eq("three_code",agvLocDetl.getThreeCode())); +// FlowLog flowLog = new FlowLog(); +// flowLog.setFid(String.valueOf(flowId)); +// flowLog.setSpare2(wrkMast.getWrkNo().toString()); +// flowLog.setLocNo(wrkMast.getSourceLocNo()); +// flowLog.setSpare1(barcode); +// flowLog.setOpType(5L); +// flowLog.setOrderNo(orderDetl.getOrderNo()); +// flowLog.setThreeCode(orderDetl.getThreeCode()); +// flowLog.setMatnr(agvLocDetl.getMatnr()); +// flowLog.setMaktx(agvLocDetl.getMaktx()); +// flowLog.setOrderPrevious(orderDetl.getAnfme()); +// flowLog.setOrderCurrent(orderDetl.getAnfme()); +// flowLog.setOrderChanged(0.0); +// +// flowLog.setQtyPrevious(orderDetl.getQty()); +// flowLog.setQtyCurrent(orderDetl.getQty() + agvLocDetl.getAnfme()); +// flowLog.setQtyChanged(agvLocDetl.getAnfme()); +// +// flowLog.setLocPrevious(agvLocDetl.getAnfme()); +// flowLog.setLocCurrent(0.0d); +// flowLog.setLocChanged(agvLocDetl.getAnfme()); +// flowLog.setUserId(getUserId()); +// flowLog.setAppeTime(now); +// if (!flowLogService.insert(flowLog)) { +// throw new CoolException("鍚屾鍗婃垚鍝佽皟鎷ㄥ崟娴佹按璁板綍澶辫触"); +// } orderDetl.setQty(orderDetl.getQty() + agvLocDetl.getAnfme()); if (!orderDetlService.update(orderDetl,new EntityWrapper<OrderDetl>().eq("source",33).eq("matnr", agvLocDetl.getMatnr()).eq("three_code",agvLocDetl.getThreeCode()))){ throw new CoolException("淇敼璁㈠崟鏄庣粏澶辫触锛岃鑱旂郴绠$悊鍛�"+agvLocDetl.getOrderNo()+agvLocDetl.getMatnr()); -- Gitblit v1.9.1