From be843c763437870285cfc79f0b511e592b30f0b8 Mon Sep 17 00:00:00 2001 From: songguoqiang <765017469@qq.com> Date: Tue, 14 May 2024 09:53:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=A9=E5=90=88=E9=9C=80=E6=B1=82=E6=96=B0?= =?UTF-8?q?=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../itemaccounts/vo/ItemAccountsPageReqVO.java | 3 +++ .../dal/mysql/itemaccounts/ItemAccountsMapper.java | 13 +++++++++++-- .../mysql/iteminlocation/ItemInLocationMapper.java | 4 ++-- .../itemoutlocation/ItemOutLocationMapper.java | 4 ++-- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/itemaccounts/vo/ItemAccountsPageReqVO.java b/win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/itemaccounts/vo/ItemAccountsPageReqVO.java index f6599fb..6da2028 100644 --- a/win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/itemaccounts/vo/ItemAccountsPageReqVO.java +++ b/win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/itemaccounts/vo/ItemAccountsPageReqVO.java @@ -30,4 +30,7 @@ public class ItemAccountsPageReqVO extends PageParam { @Schema(description = "库区编号") private String areaNumber; + @Schema(description = "项目号") + private String project; + } diff --git a/win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/dal/mysql/itemaccounts/ItemAccountsMapper.java b/win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/dal/mysql/itemaccounts/ItemAccountsMapper.java index daf7bcb..91aa7e0 100644 --- a/win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/dal/mysql/itemaccounts/ItemAccountsMapper.java +++ b/win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/dal/mysql/itemaccounts/ItemAccountsMapper.java @@ -1,5 +1,6 @@ package com.win.module.eam.dal.mysql.itemaccounts; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -14,6 +15,7 @@ import com.win.module.eam.controller.itemaccounts.vo.ItemAccountsPageReqVO; import com.win.module.eam.convert.itemaccounts.ItemAccountsConvert; import com.win.module.eam.dal.dataobject.itemaccounts.ItemAccountsDO; import com.win.module.eam.dal.dataobject.transaction.TransactionDO; +import com.win.module.eam.dal.mysql.item.ItemMapper; import com.win.module.eam.enums.itemAccount.ItemAccountStatusEnum; import com.win.module.eam.enums.transaction.TransactionEnum; import com.win.module.eam.enums.transactionType.TransactionTypeEnum; @@ -37,6 +39,8 @@ import static com.win.module.eam.enums.ErrorCodeConstants.COUNT_IS_HAVA; @Mapper public interface ItemAccountsMapper extends BaseMapperX { + + /** * 更新库存余额数量,出库qty是负数 */ @@ -231,13 +235,18 @@ public interface ItemAccountsMapper extends BaseMapperX { } default PageResult selectPage(ItemAccountsPageReqVO reqVO) { - return selectPage(reqVO, new LambdaQueryWrapperX() + LambdaQueryWrapper itemAccountsDOLambdaQueryWrapper = new LambdaQueryWrapperX() .likeIfPresent(ItemAccountsDO::getItemNumber, reqVO.getItemNumber()) .likeIfPresent(ItemAccountsDO::getLocationNumber, reqVO.getLocationNumber()) .likeIfPresent(ItemAccountsDO::getAreaNumber, reqVO.getAreaNumber()) .eqIfPresent(ItemAccountsDO::getType, reqVO.getType()) .eqIfPresent(ItemAccountsDO::getAvailable, reqVO.getAvailable()) - .orderByDesc(ItemAccountsDO::getId)); + .orderByDesc(ItemAccountsDO::getId); + if(reqVO.getProject()!=null&& !reqVO.getProject().isEmpty()){ + itemAccountsDOLambdaQueryWrapper.inSql(ItemAccountsDO::getItemNumber, "select number from basic_item where available = 'TRUE' and deleted = 0 and project like CONCAT('%','" + reqVO.getProject() + "','%') "); + } + return selectPage(reqVO, itemAccountsDOLambdaQueryWrapper); + } default List selectList(ItemAccountsExportReqVO reqVO) { diff --git a/win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/dal/mysql/iteminlocation/ItemInLocationMapper.java b/win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/dal/mysql/iteminlocation/ItemInLocationMapper.java index b9561d3..f7e25cb 100644 --- a/win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/dal/mysql/iteminlocation/ItemInLocationMapper.java +++ b/win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/dal/mysql/iteminlocation/ItemInLocationMapper.java @@ -24,8 +24,8 @@ public interface ItemInLocationMapper extends BaseMapperX { return selectPage(reqVO, new LambdaQueryWrapperX() .eqIfPresent(ItemInLocationDO::getId, reqVO.getId()) .eqIfPresent(ItemInLocationDO::getNumber, reqVO.getNumber()) - .eqIfPresent(ItemInLocationDO::getItemNumber, reqVO.getItemNumber()) - .eqIfPresent(ItemInLocationDO::getLocationNumber, reqVO.getLocationNumber()) + .likeIfPresent(ItemInLocationDO::getItemNumber, reqVO.getItemNumber()) + .likeIfPresent(ItemInLocationDO::getLocationNumber, reqVO.getLocationNumber()) .eqIfPresent(ItemInLocationDO::getType, reqVO.getType()) .eqIfPresent(ItemInLocationDO::getQty, reqVO.getQty()) .orderByDesc(ItemInLocationDO::getId)); diff --git a/win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/dal/mysql/itemoutlocation/ItemOutLocationMapper.java b/win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/dal/mysql/itemoutlocation/ItemOutLocationMapper.java index 3f2870c..90250c8 100644 --- a/win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/dal/mysql/itemoutlocation/ItemOutLocationMapper.java +++ b/win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/dal/mysql/itemoutlocation/ItemOutLocationMapper.java @@ -24,8 +24,8 @@ public interface ItemOutLocationMapper extends BaseMapperX { return selectPage(reqVO, new LambdaQueryWrapperX() .eqIfPresent(ItemOutLocationDO::getId, reqVO.getId()) .eqIfPresent(ItemOutLocationDO::getNumber, reqVO.getNumber()) - .eqIfPresent(ItemOutLocationDO::getItemNumber, reqVO.getItemNumber()) - .eqIfPresent(ItemOutLocationDO::getLocationNumber, reqVO.getLocationNumber()) + .likeIfPresent(ItemOutLocationDO::getItemNumber, reqVO.getItemNumber()) + .likeIfPresent(ItemOutLocationDO::getLocationNumber, reqVO.getLocationNumber()) .eqIfPresent(ItemOutLocationDO::getType, reqVO.getType()) .eqIfPresent(ItemOutLocationDO::getQty, reqVO.getQty()) .orderByDesc(ItemOutLocationDO::getId));