From bcb19e8c93c3cabf0d8eb3ee34ed819b3c5a10ef Mon Sep 17 00:00:00 2001
From: whycq <913841844@qq.com>
Date: 星期一, 25 十一月 2024 13:14:11 +0800
Subject: [PATCH] #优化地图

---
 src/main/java/com/zy/asrs/task/handler/AgvWrkMastHandler.java |   38 +++++++++++++++++++++++++++++++++++++-
 1 files changed, 37 insertions(+), 1 deletions(-)

diff --git a/src/main/java/com/zy/asrs/task/handler/AgvWrkMastHandler.java b/src/main/java/com/zy/asrs/task/handler/AgvWrkMastHandler.java
index b895aad..9364b19 100644
--- a/src/main/java/com/zy/asrs/task/handler/AgvWrkMastHandler.java
+++ b/src/main/java/com/zy/asrs/task/handler/AgvWrkMastHandler.java
@@ -4,6 +4,7 @@
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
 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.service.*;
@@ -51,9 +52,17 @@
     private AgvBasDevpService agvBasDevpService;
     @Autowired
     private AgvWorkService agvWorkService;
+    @Autowired
+    private OrderDetlService orderDetlService;
+    @Autowired
+    private SnowflakeIdWorker snowflakeIdWorker;
+    @Autowired
+    private FlowLogService flowLogService;
 
     @Transactional
     public ReturnT<String> completedPutWayWrk(AgvWrkMast agvWrkMast) {
+        long flowId = snowflakeIdWorker.nextId();
+        Date now = new Date();
         try{
             int wrkNo = agvWrkMast.getWrkNo();
             String barcode = agvWrkMast.getBarcode();
@@ -112,6 +121,34 @@
                         AgvLocDetl agvLocDetl = agvLocDetlService.selectByMatnrAndBatchAndCsocodeAndisoCode(agvWrkMast.getLocNo(), agvWrkDetl.getMatnr(), agvWrkDetl.getBatch(), agvWrkDetl.getThreeCode(), agvWrkDetl.getDeadTime());
                         if (!Cools.isEmpty(agvLocDetl)) {
                             double updateAnfme = agvLocDetl.getAnfme() - agvWrkDetl.getAnfme();
+//                            OrderDetl orderDetl = orderDetlService.selectItem(agvWrkDetl.getOrderNo(), agvWrkDetl.getMatnr(), agvWrkDetl.getThreeCode());
+//                            FlowLog flowLog = new FlowLog();
+//                            flowLog.setFid(String.valueOf(flowId));
+//                            flowLog.setSpare2(String.valueOf(agvWrkMast.getWrkNo()));
+//                            flowLog.setLocNo(agvWrkMast.getLocNo());
+//                            flowLog.setSpare1(agvWrkDetl.getSuppCode());
+//                            flowLog.setOpType(53L);
+//                            flowLog.setOrderNo(agvWrkDetl.getOrderNo());
+//                            flowLog.setThreeCode(agvWrkDetl.getThreeCode());
+//                            flowLog.setMatnr(agvWrkDetl.getMatnr());
+//                            flowLog.setMaktx(agvWrkDetl.getMaktx());
+//
+//                            flowLog.setOrderPrevious(orderDetl.getAnfme());
+//                            flowLog.setOrderCurrent(orderDetl.getAnfme());
+//                            flowLog.setOrderChanged(0.0);
+//
+//                            flowLog.setQtyPrevious(orderDetl.getQty());
+//                            flowLog.setQtyCurrent(updateAnfme);
+//                            flowLog.setQtyChanged(agvWrkDetl.getAnfme());
+//
+//                            flowLog.setLocPrevious(agvLocDetl.getAnfme());
+//                            flowLog.setLocCurrent(updateAnfme);
+//                            flowLog.setLocChanged(agvWrkDetl.getAnfme());
+//
+//                            flowLog.setAppeTime(now);
+//                            if (!flowLogService.insert(flowLog)) {
+//                                throw new CoolException("鍚屾鍗婃垚鍝佽皟鎷ㄥ崟娴佹按璁板綍澶辫触");
+//                            }
                             agvLocDetlService.updateAnfme(updateAnfme,agvLocDetl.getLocNo(),agvLocDetl.getMatnr(),agvLocDetl.getBatch(),agvLocDetl.getThreeCode(),agvLocDetl.getDeadTime());
                         }
                         //AgvLocDetl agvLocDetl = agvLocDetlService.selectLocdetl(agvWrkMast.getLocNo(),agvWrkDetl.getMatnr(),agvWrkDetl.getBatch(),agvWrkDetl.getThreeCode(),agvWrkDetl.getDeadTime());
@@ -121,7 +158,6 @@
                     agvBasDevpService.updateLocStsAndBarcodeByDevNo(agvWrkMast.getSourceLocNo(),"O","",agvWrkMast.getWhsType().shortValue());
                     break;
                 case 57:
-                    Date now = new Date();
                     // 鏇存柊搴撳瓨鏄庣粏
                     List<AgvWrkDetl> wrkDetlList = agvWrkDetlService.selectList(new EntityWrapper<AgvWrkDetl>().eq("wrk_no", agvWrkMast.getWrkNo()));
                     wrkDetlList.forEach(agvWrkDetl -> {

--
Gitblit v1.9.1