From 95727f675f239e0b6e34c32d6ee773b66c9e3689 Mon Sep 17 00:00:00 2001 From: 无关风月 <443237572@qq.com> Date: 星期二, 30 七月 2024 17:04:30 +0800 Subject: [PATCH] Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/ForestFirePrevention --- ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/service/impl/SlGoodsMaterialsServiceImpl.java | 31 +++++++++++++++++++++++++++---- 1 files changed, 27 insertions(+), 4 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 32fd7ff..8777369 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 @@ -3,6 +3,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.common.core.utils.page.BeanUtils; import com.ruoyi.common.core.utils.page.PageDTO; import com.ruoyi.management.domain.ManagementGoodsMaterials; import com.ruoyi.management.domain.SlGoodsMaterials; @@ -21,6 +22,7 @@ import com.ruoyi.management.service.SlGoodsMaterialsService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.management.service.SlVolumeProductionRkService; +import io.micrometer.core.instrument.binder.BaseUnits; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -85,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()); @@ -123,10 +125,10 @@ Page<ManagementGoodsMaterials> page = new Page<>(storeManagementGoodSmaterialsQuery.getPageCurr(), storeManagementGoodSmaterialsQuery.getPageSize()); LambdaQueryWrapper< ManagementGoodsMaterials> wrapper= Wrappers.lambdaQuery(); - if (slVolumeProductionIdList.size()>0){ + if (!slVolumeProductionIdList.isEmpty()){ wrapper.in(ManagementGoodsMaterials::getManagementId,slVolumeProductionIdList); } - if (SlGoodsMaterialsList.size()>0){ + if (!SlGoodsMaterialsList.isEmpty()){ wrapper.in(ManagementGoodsMaterials::getGoodsMaterialsId,SlGoodsMaterialsList); } wrapper.eq( ManagementGoodsMaterials::getDelFlag,0); @@ -145,4 +147,25 @@ 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()); + storeManagementGoodSmaterialsVO.setGoodsMaterialsName(byId.getGoodsMaterialsName()); + storeManagementGoodSmaterialsVO.setIsConsume(byId.getIsConsume()); + storeManagementGoodSmaterialsVO.setAveragePrice(storeManagementGoodSmaterialsOne); + return storeManagementGoodSmaterialsVO; + } + + } -- Gitblit v1.7.1