From cb98548ecc0fa2d4388eb67528b98be39670bc0c Mon Sep 17 00:00:00 2001
From: zyx <zyx123456>
Date: 星期四, 20 七月 2023 10:05:02 +0800
Subject: [PATCH] agv 有单入库功能

---
 src/main/java/com/zy/asrs/service/impl/AgvLocDetlServiceImpl.java |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/zy/asrs/service/impl/AgvLocDetlServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/AgvLocDetlServiceImpl.java
index df4ecc5..61b924b 100644
--- a/src/main/java/com/zy/asrs/service/impl/AgvLocDetlServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/AgvLocDetlServiceImpl.java
@@ -1,12 +1,34 @@
 package com.zy.asrs.service.impl;
 
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
 import com.zy.asrs.entity.AgvLocDetl;
+import com.zy.asrs.entity.AgvWrkDetl;
 import com.zy.asrs.mapper.AgvLocDetlMapper;
 import com.zy.asrs.service.AgvLocDetlService;
+import com.zy.asrs.service.AgvWrkDetlService;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.stream.Collectors;
 
 @Service
 public class AgvLocDetlServiceImpl extends ServiceImpl<AgvLocDetlMapper, AgvLocDetl> implements AgvLocDetlService {
 
+    @Autowired
+    AgvWrkDetlService agvWrkDetlService;
+
+    public void addLocDetlInfo(String locNo, int taskCode) {
+        List<AgvWrkDetl> agvWrkDetls = agvWrkDetlService.selectList(new EntityWrapper<AgvWrkDetl>().eq("wrk_no", taskCode));
+        List<AgvLocDetl> agvLocDetlList = agvWrkDetls.stream().map(agvWrkDetl -> {
+            AgvLocDetl agvLocDetl = new AgvLocDetl();
+            BeanUtils.copyProperties(agvWrkDetl, agvLocDetl);
+            agvLocDetl.setLocNo(locNo);
+            this.insert(agvLocDetl);
+            return agvLocDetl;
+        }).collect(Collectors.toList());
+
+    }
 }

--
Gitblit v1.9.1