From 2bf3546b11ba12cd371a4255dbc5a7705d18c75a Mon Sep 17 00:00:00 2001
From: rentaiming <806181062@qq.com>
Date: 星期五, 26 七月 2024 09:04:21 +0800
Subject: [PATCH] 森林防火 供应商管理

---
 ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/service/impl/SlVolumeProductionRkServiceImpl.java |   65 +++++++++++++++++++++-----------
 1 files changed, 42 insertions(+), 23 deletions(-)

diff --git a/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/service/impl/SlVolumeProductionRkServiceImpl.java b/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/service/impl/SlVolumeProductionRkServiceImpl.java
index be8a26d..3d6fc4f 100644
--- a/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/service/impl/SlVolumeProductionRkServiceImpl.java
+++ b/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/service/impl/SlVolumeProductionRkServiceImpl.java
@@ -104,38 +104,57 @@
     }
 
     @Override
-    public void addVolumeProductionRkgl(SlVolumeProductionRkListDTO slVolumeProductionRkListDTO) {
-        List<Long> materialsId = slVolumeProductionRkListDTO.getMaterialsId();
-        for (Long m:materialsId){
+    public void addVolumeProductionRkgl(List<SlVolumeProductionRkListDTO> slVolumeProductionRkListDTO) {
+
+        for (SlVolumeProductionRkListDTO m:slVolumeProductionRkListDTO){
             SlVolumeProductionRk slVolumeProductionRk=new SlVolumeProductionRk();
-            slVolumeProductionRk.setVolumeProductionRkglId(slVolumeProductionRkListDTO.getVolumeProductionRkglId());
-            slVolumeProductionRk.setMaterialsId(m);
-            slVolumeProductionRk.setManagementId(slVolumeProductionRkListDTO.getManagementId());
+            slVolumeProductionRk.setVolumeProductionRkglId(m.getVolumeProductionRkglId());
+            slVolumeProductionRk.setMaterialsId(m.getMaterialsId());
+            slVolumeProductionRk.setManagementId(m.getManagementId());
             slVolumeProductionRk.setRkNumber("CD-"+new Date().getTime());
+            if ( m.getErwmNum()!=null){
+                slVolumeProductionRk.setErwmNum( m.getErwmNum());
+            }if ( m.getRkPice()!=null){
+                slVolumeProductionRk.setRkPice( m.getRkPice());
+            }if ( m.getRkNum()!=null){
+                slVolumeProductionRk.setRkNum( m.getRkNum());
+            }if ( m.getShelfId()!=null){
+                slVolumeProductionRk.setShelfId( m.getShelfId());
+            }if ( m.getRkModel()!=null){
+                slVolumeProductionRk.setRkModel( m.getRkModel());
+            }if ( m.getStoreManagementNumber()!=null){
+                slVolumeProductionRk.setStoreManagementNumber( m.getStoreManagementNumber());
+            }if ( m.getRkNumber()!=null){
+                slVolumeProductionRk.setRkNumber( m.getRkNumber());
+            }
+
             this.save(slVolumeProductionRk);
         }
 
     }
 
     @Override
-    public void uplSlVolumeProductionRk(SlVolumeProductionRkDTO SlVolumeProductionRkDTO) {
-        SlVolumeProductionRk byId = this.getById(SlVolumeProductionRkDTO.getId());
-        if (SlVolumeProductionRkDTO.getErwmNum()!=null){
-            byId.setErwmNum(SlVolumeProductionRkDTO.getErwmNum());
-        }if (SlVolumeProductionRkDTO.getRkPice()!=null){
-            byId.setRkPice(SlVolumeProductionRkDTO.getRkPice());
-        }if (SlVolumeProductionRkDTO.getRkNum()!=null){
-            byId.setRkNum(SlVolumeProductionRkDTO.getRkNum());
-        }if (SlVolumeProductionRkDTO.getShelfId()!=null){
-            byId.setShelfId(SlVolumeProductionRkDTO.getShelfId());
-        }if (SlVolumeProductionRkDTO.getRkModel()!=null){
-            byId.setRkModel(SlVolumeProductionRkDTO.getRkModel());
-        }if (SlVolumeProductionRkDTO.getStoreManagementNumber()!=null){
-            byId.setStoreManagementNumber(SlVolumeProductionRkDTO.getStoreManagementNumber());
-        }if (SlVolumeProductionRkDTO.getRkNumber()!=null){
-            byId.setRkNumber(SlVolumeProductionRkDTO.getRkNumber());
+    public void uplSlVolumeProductionRk(List<SlVolumeProductionRkDTO> SlVolumeProductionRkDTO) {
+        for (SlVolumeProductionRkDTO a:SlVolumeProductionRkDTO){
+            SlVolumeProductionRk byId = this.getById(a.getId());
+            if (a.getErwmNum()!=null){
+                byId.setErwmNum(a.getErwmNum());
+            }if (a.getRkPice()!=null){
+                byId.setRkPice(a.getRkPice());
+            }if (a.getRkNum()!=null){
+                byId.setRkNum(a.getRkNum());
+            }if (a.getShelfId()!=null){
+                byId.setShelfId(a.getShelfId());
+            }if (a.getRkModel()!=null){
+                byId.setRkModel(a.getRkModel());
+            }if (a.getStoreManagementNumber()!=null){
+                byId.setStoreManagementNumber(a.getStoreManagementNumber());
+            }if (a.getRkNumber()!=null){
+                byId.setRkNumber(a.getRkNumber());
+            }
+            this.updateById(byId);
         }
-        this.updateById(byId);
+
     }
 
     @Override

--
Gitblit v1.7.1