From 439dd3583f2ea745aa5e70ce26f3489d75c90912 Mon Sep 17 00:00:00 2001
From: zyx <zyx123456>
Date: 星期四, 25 一月 2024 15:07:28 +0800
Subject: [PATCH] pla增加库位导入功能 货主档案增加导入导出功能 pla表头固定

---
 src/main/java/com/zy/asrs/utils/PlaExcelListener.java |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/zy/asrs/utils/PlaExcelListener.java b/src/main/java/com/zy/asrs/utils/PlaExcelListener.java
index 137d1a1..fae28c7 100644
--- a/src/main/java/com/zy/asrs/utils/PlaExcelListener.java
+++ b/src/main/java/com/zy/asrs/utils/PlaExcelListener.java
@@ -5,8 +5,10 @@
 import com.core.common.Cools;
 import com.core.common.SpringUtils;
 import com.core.exception.CoolException;
+import com.zy.asrs.entity.Node;
 import com.zy.asrs.entity.Pla;
 import com.zy.asrs.entity.param.GlobleParameter;
+import com.zy.asrs.service.NodeService;
 import com.zy.asrs.service.PlaService;
 import com.zy.common.entity.MatExcel;
 import com.zy.common.entity.PlaExcel;
@@ -54,6 +56,7 @@
     @Override
     public void invoke(PlaExcel excel, AnalysisContext ctx) {
         PlaService plaService = SpringUtils.getBean(PlaService.class);
+        NodeService nodeService = SpringUtils.getBean(NodeService.class);
         Date now = new Date();
 
         // 鍟嗗搧
@@ -68,6 +71,16 @@
             pla.setModifyTime(new Date());
             pla.setStatus(GlobleParameter.PLA_STATUS_00);
             pla.setStockFreeze(1);
+            if(!Cools.isEmpty(pla.getLocNo())){
+                Node node = nodeService.selectByUuid(pla.getLocNo());
+                if(Cools.isEmpty(node)){
+                    throw new CoolException("鏈兘鎵惧埌鐩稿簲鐨勫簱浣嶄俊鎭�");
+                }
+                pla.setStash(node.getParentName());
+                pla.setLocNo(node.getUuid());
+                pla.setStatus(GlobleParameter.PLA_STATUS_1);
+                pla.setPakinTime(new Date());
+            }
             if (!plaService.insert(pla)) {
                 throw new CoolException("淇濆瓨鍟嗗搧淇℃伅澶辫触锛屽晢鍝佺紪鐮侊細" + excel.getMatnr());
             }

--
Gitblit v1.9.1