From 6c696606a420be0b99f820807045b2f21b05266e Mon Sep 17 00:00:00 2001
From: rentaiming <806181062@qq.com>
Date: 星期日, 21 七月 2024 15:38:36 +0800
Subject: [PATCH] 森林防火 供应商管理

---
 ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/service/impl/SlVolumeProductionRkglServiceImpl.java |   27 +++++++++++++++++++--------
 1 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/service/impl/SlVolumeProductionRkglServiceImpl.java b/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/service/impl/SlVolumeProductionRkglServiceImpl.java
index a1f01f0..0c20646 100644
--- a/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/service/impl/SlVolumeProductionRkglServiceImpl.java
+++ b/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/service/impl/SlVolumeProductionRkglServiceImpl.java
@@ -79,7 +79,7 @@
     }
 
     @Override
-    public VolumeProductionRkgInfoVO getVolumeProductionRkgInfo(Integer id) {
+    public VolumeProductionRkgInfoVO getVolumeProductionRkgInfo(Long id) {
         SlVolumeProductionRkgl byId = this.getById(id);
         VolumeProductionRkgInfoVO v=BeanUtils.copyBean(byId, VolumeProductionRkgInfoVO.class);
         SlStoreManagement slStoreManagement = slStoreManagementMapper.selectById(byId.getManagementId());
@@ -103,10 +103,16 @@
                 .collect(Collectors.toSet());
 
         LambdaQueryWrapper< SlVolumeProductionRkgl> wrapper1= Wrappers.lambdaQuery();
-        wrapper1.eq(SlVolumeProductionRkgl::getPresentState,getVolumeProductionRkQuery.getPresentState());
-        wrapper1.eq(SlVolumeProductionRkgl::getAuditStatus,getVolumeProductionRkQuery.getAuditStatus());
+        if (getVolumeProductionRkQuery.getPresentState()!=0&&getVolumeProductionRkQuery.getPresentState()!=null){
+            wrapper1.eq(SlVolumeProductionRkgl::getPresentState,getVolumeProductionRkQuery.getPresentState());
+        }
+        if (getVolumeProductionRkQuery.getAuditStatus()!=0&&getVolumeProductionRkQuery.getAuditStatus()!=null) {
+            wrapper1.eq(SlVolumeProductionRkgl::getAuditStatus, getVolumeProductionRkQuery.getAuditStatus());
+        }
         if (goodsSkuIdList.size()>0){
             wrapper1.in(SlVolumeProductionRkgl::getSysId,goodsSkuIdList);
+        }else{
+
         }
         wrapper1.eq( SlVolumeProductionRkgl::getDelFlag,0);
         wrapper1.orderByDesc(SlVolumeProductionRkgl::getCreateTime);
@@ -127,10 +133,10 @@
     @Override
     public void addVolumeProductionRkgl(VolumeProductionRkglDTO volumeProductionRkglDTO) {
         Long userid = SecurityUtils.getUserId();
-        if (volumeProductionRkglDTO.getId()!=null){
+        if (volumeProductionRkglDTO.getId()==null){
             SlVolumeProductionRkgl slVolumeProductionRkgl=new  SlVolumeProductionRkgl();
             slVolumeProductionRkgl.setAttachmentUrl(volumeProductionRkglDTO.getAttachmentUrl());
-            slVolumeProductionRkgl.setAuthorization(volumeProductionRkglDTO.getAuthorization());
+            slVolumeProductionRkgl.setAuthorizationUrl(volumeProductionRkglDTO.getAuthorization());
             slVolumeProductionRkgl.setAuditStatus(1);
             slVolumeProductionRkgl.setManagementId(volumeProductionRkglDTO.getManagementId());
             slVolumeProductionRkgl.setPresentState(1);
@@ -155,14 +161,14 @@
                 byId.setAttachmentUrl(volumeProductionRkglDTO.getAttachmentUrl());
             }
             if (volumeProductionRkglDTO.getAuthorization()!=null){
-                byId.setAuthorization(volumeProductionRkglDTO.getAuthorization());
+                byId.setAuthorizationUrl(volumeProductionRkglDTO.getAuthorization());
             }
             this.updateById(byId);
         }
     }
 
     @Override
-    public VolumeProductionRkgInventoryVO getVolumeProductionRkgInventory(Integer id) {
+    public VolumeProductionRkgInventoryVO getVolumeProductionRkgInventory(Long id) {
         SlVolumeProductionRkgl byId = this.getById(id);
         VolumeProductionRkgInventoryVO vo = new VolumeProductionRkgInventoryVO();
         SysUser data = sysUserClient.getSysUser(byId.getId()).getData();
@@ -229,7 +235,7 @@
     }
 
     @Override
-    public void rk(Integer id) {
+    public void rk(Long id) {
         LambdaQueryWrapper<SlVolumeProductionRk> wrapper1 = Wrappers.lambdaQuery();
         wrapper1.eq(SlVolumeProductionRk::getVolumeProductionRkglId, id);
         wrapper1.eq(SlVolumeProductionRk::getDelFlag, 0);
@@ -241,6 +247,9 @@
             wrapper2.eq(ManagementGoodsMaterials::getManagementId,list.getManagementId());
             wrapper2.eq(ManagementGoodsMaterials::getDelFlag, 0);
             ManagementGoodsMaterials managementGoodsMaterials = managementGoodsMaterialsMapper.selectOne(wrapper2);
+
+            SlGoodsMaterials slGoodsMaterials = slGoodsMaterialsMapper.selectById(list.getMaterialsId());
+
             if (managementGoodsMaterials!=null){
                 Long repertorySum = managementGoodsMaterials.getRepertorySum();
                 Long repertoryZhai = managementGoodsMaterials.getRepertoryZhai();
@@ -248,6 +257,7 @@
                 Long re1=repertoryZhai+list.getRkNum();
                 managementGoodsMaterials.setRepertorySum(re);
                 managementGoodsMaterials.setRepertoryZhai(re1);
+                managementGoodsMaterials.setRepertory(slGoodsMaterials.getRepertory());
                 managementGoodsMaterialsMapper.updateById(managementGoodsMaterials);
             }else{
                 ManagementGoodsMaterials managementGoodsMaterials1=new ManagementGoodsMaterials();
@@ -255,6 +265,7 @@
                 managementGoodsMaterials1.setGoodsMaterialsId(list.getMaterialsId());
                 managementGoodsMaterials1.setRepertoryZhai(list.getRkNum());
                 managementGoodsMaterials1.setRepertorySum(list.getRkNum());
+                managementGoodsMaterials.setRepertory(slGoodsMaterials.getRepertory());
                 managementGoodsMaterialsMapper.insert(managementGoodsMaterials1);
             }
         }

--
Gitblit v1.7.1