From 7bbce72b03664f56400fe7e70e8dcd4ea737a8da Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期五, 02 八月 2024 14:19:30 +0800
Subject: [PATCH] 代码提交 bug解决

---
 ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/service/impl/SlGoodsMaterialsServiceImpl.java |   24 ++++++++++--------------
 1 files changed, 10 insertions(+), 14 deletions(-)

diff --git a/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/service/impl/SlGoodsMaterialsServiceImpl.java b/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/service/impl/SlGoodsMaterialsServiceImpl.java
index dd657cc..acce94f 100644
--- a/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/service/impl/SlGoodsMaterialsServiceImpl.java
+++ b/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/service/impl/SlGoodsMaterialsServiceImpl.java
@@ -87,8 +87,8 @@
     public PageDTO<SlGoodsMaterialsVO> getGoodSmaterialsList(SlGoodsMaterialsQuery slGoodsMaterialsQuery) {
         Page<SlGoodsMaterials> page = new Page<>(slGoodsMaterialsQuery.getPageCurr(), slGoodsMaterialsQuery.getPageSize());
         LambdaQueryWrapper< SlGoodsMaterials> wrapper= Wrappers.lambdaQuery();
-        if (slGoodsMaterialsQuery.getGoodsMaterialsName()!=null&&slGoodsMaterialsQuery.getGoodsMaterialsName()!=""){
-            wrapper.eq(SlGoodsMaterials::getGoodsMaterialsName,slGoodsMaterialsQuery.getGoodsMaterialsName());
+        if (slGoodsMaterialsQuery.getGoodsMaterialsName()!=null&& !slGoodsMaterialsQuery.getGoodsMaterialsName().isEmpty()){
+            wrapper.like(SlGoodsMaterials::getGoodsMaterialsName,slGoodsMaterialsQuery.getGoodsMaterialsName());
         }
         if (slGoodsMaterialsQuery.getIsConsume()!=0){
             wrapper.eq(SlGoodsMaterials::getIsConsume,slGoodsMaterialsQuery.getIsConsume());
@@ -121,17 +121,18 @@
         SlGoodsMaterialsList = list1.stream().map(SlGoodsMaterials::getId)
                 .collect(Collectors.toSet());
 
-
         Page<ManagementGoodsMaterials> page = new Page<>(storeManagementGoodSmaterialsQuery.getPageCurr(), storeManagementGoodSmaterialsQuery.getPageSize());
         LambdaQueryWrapper< ManagementGoodsMaterials> wrapper= Wrappers.lambdaQuery();
 
-        if (slVolumeProductionIdList.size()>0){
-            wrapper.in(ManagementGoodsMaterials::getManagementId,slVolumeProductionIdList);
-        }
-        if (SlGoodsMaterialsList.size()>0){
+//        if (!slVolumeProductionIdList.isEmpty()){
+//            wrapper.in(ManagementGoodsMaterials::getId,slVolumeProductionIdList);
+//        }
+
+        if (!SlGoodsMaterialsList.isEmpty()){
             wrapper.in(ManagementGoodsMaterials::getGoodsMaterialsId,SlGoodsMaterialsList);
         }
         wrapper.eq( ManagementGoodsMaterials::getDelFlag,0);
+        wrapper.eq(ManagementGoodsMaterials::getManagementId,storeManagementGoodSmaterialsQuery.getStoreManagementId());
         wrapper.orderByDesc(ManagementGoodsMaterials::getCreateTime);
         Page<ManagementGoodsMaterials> page1 = managementGoodsMaterialsService.page(page, wrapper);
         PageDTO<StoreManagementGoodSmaterialsVO> storeManagementGoodSmaterialsVOPageDTO = PageDTO.of(page1, StoreManagementGoodSmaterialsVO.class);
@@ -143,24 +144,19 @@
             li.setIsConsume(byId.getIsConsume());
             li.setAveragePrice(storeManagementGoodSmaterialsOne);
         }
-
-
         return storeManagementGoodSmaterialsVOPageDTO;
     }
 
     @Override
     public StoreManagementGoodSmaterialsVO getSmaterialsOne(StoreManagementGoodSmaterialsQuery storeManagementGoodSmaterialsQuery) {
         LambdaQueryWrapper< ManagementGoodsMaterials> wrapper= Wrappers.lambdaQuery();
-
-
         wrapper.eq(ManagementGoodsMaterials::getGoodsMaterialsId,storeManagementGoodSmaterialsQuery.getGoodsMaterialsId());
-
         wrapper.eq( ManagementGoodsMaterials::getDelFlag,0);
         wrapper.orderByDesc(ManagementGoodsMaterials::getCreateTime);
         ManagementGoodsMaterials page1 = managementGoodsMaterialsService.getOne(wrapper);
         StoreManagementGoodSmaterialsVO storeManagementGoodSmaterialsVO = BeanUtils.copyBean(page1, StoreManagementGoodSmaterialsVO.class);
-            Double storeManagementGoodSmaterialsOne = slVolumeProductionRkMapper.getStoreManagementGoodSmaterialsOne(storeManagementGoodSmaterialsVO.getGoodsMaterialsId());
-            SlGoodsMaterials byId = this.getById(storeManagementGoodSmaterialsVO.getGoodsMaterialsId());
+        Double storeManagementGoodSmaterialsOne = slVolumeProductionRkMapper.getStoreManagementGoodSmaterialsOne(storeManagementGoodSmaterialsVO.getGoodsMaterialsId());
+        SlGoodsMaterials byId = this.getById(storeManagementGoodSmaterialsVO.getGoodsMaterialsId());
         storeManagementGoodSmaterialsVO.setGoodsMaterialsName(byId.getGoodsMaterialsName());
         storeManagementGoodSmaterialsVO.setIsConsume(byId.getIsConsume());
         storeManagementGoodSmaterialsVO.setAveragePrice(storeManagementGoodSmaterialsOne);

--
Gitblit v1.7.1