From 521aadbbdde31da31a4dce9e35632af5048d67ba Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@63.com> Date: 星期五, 03 二月 2023 14:44:54 +0800 Subject: [PATCH] # --- src/main/java/com/zy/asrs/mapper/LocDetlMapper.java | 4 +- src/main/resources/mapper/LocDetlMapper.xml | 56 ++++++++++++++++++++++++++++ src/main/java/com/zy/asrs/service/impl/LocDetlServiceImpl.java | 4 +- 3 files changed, 60 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/zy/asrs/mapper/LocDetlMapper.java b/src/main/java/com/zy/asrs/mapper/LocDetlMapper.java index ab04539..8b0f93a 100644 --- a/src/main/java/com/zy/asrs/mapper/LocDetlMapper.java +++ b/src/main/java/com/zy/asrs/mapper/LocDetlMapper.java @@ -54,9 +54,9 @@ // ------------------------------------------------- - List<QueryStockPreDo> queryStockPre(@Param("matnr")String matnr); + List<QueryStockPreDo> queryStockPre(@Param("matnr")String matnr, @Param("batch")String batch); - List<LocDetl> queryStock(@Param("matnr")String matnr, @Param("no") Integer no, @Param("orderBy") String orderBy, @Param("bay") Integer bay); + List<LocDetl> queryStock(@Param("matnr")String matnr, @Param("batch")String batch, @Param("no") Integer no, @Param("orderBy") String orderBy, @Param("bay") Integer bay); Double queryStockAnfme(String matnr, String batch); diff --git a/src/main/java/com/zy/asrs/service/impl/LocDetlServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/LocDetlServiceImpl.java index 2488944..64b512f 100644 --- a/src/main/java/com/zy/asrs/service/impl/LocDetlServiceImpl.java +++ b/src/main/java/com/zy/asrs/service/impl/LocDetlServiceImpl.java @@ -85,9 +85,9 @@ @Override public List<LocDetl> queryStock(String matnr, String batch, String orderNo, Set<String> locNos) { List<LocDetl> result = new ArrayList<>(); - List<QueryStockPreDo> preDos = this.baseMapper.queryStockPre(matnr); + List<QueryStockPreDo> preDos = this.baseMapper.queryStockPre(matnr, batch); for (QueryStockPreDo preDo : preDos) { - List<LocDetl> locDetls = this.baseMapper.queryStock(matnr, preDo.getNo(), preDo.getOrderBy(), preDo.getBay()); + List<LocDetl> locDetls = this.baseMapper.queryStock(matnr, batch, preDo.getNo(), preDo.getOrderBy(), preDo.getBay()); result.addAll(locDetls); } return result; diff --git a/src/main/resources/mapper/LocDetlMapper.xml b/src/main/resources/mapper/LocDetlMapper.xml index 10b267a..02f6ef9 100644 --- a/src/main/resources/mapper/LocDetlMapper.xml +++ b/src/main/resources/mapper/LocDetlMapper.xml @@ -246,6 +246,14 @@ and b.loc_sts = 'F' and b.frozen != 1 and a.manu is null and a.matnr = #{matnr} + <choose> + <when test="batch != null and batch != ''"> + and a.batch = #{batch} + </when> + <otherwise> + and (a.batch IS NULL OR a.batch = '') + </otherwise> + </choose> and b.row1 >= 1 and b.row1 <= 3 group by b.bay1 @@ -261,6 +269,14 @@ and b.loc_sts = 'F' and b.frozen != 1 and a.manu is null and a.matnr = #{matnr} + <choose> + <when test="batch != null and batch != ''"> + and a.batch = #{batch} + </when> + <otherwise> + and (a.batch IS NULL OR a.batch = '') + </otherwise> + </choose> and b.row1 >= 4 and b.row1 <= 7 group by b.bay1 @@ -276,6 +292,14 @@ and b.loc_sts = 'F' and b.frozen != 1 and a.manu is null and a.matnr = #{matnr} + <choose> + <when test="batch != null and batch != ''"> + and a.batch = #{batch} + </when> + <otherwise> + and (a.batch IS NULL OR a.batch = '') + </otherwise> + </choose> and b.row1 >= 8 and b.row1 <= 11 group by b.bay1 @@ -291,6 +315,14 @@ and b.loc_sts = 'F' and b.frozen != 1 and a.manu is null and a.matnr = #{matnr} + <choose> + <when test="batch != null and batch != ''"> + and a.batch = #{batch} + </when> + <otherwise> + and (a.batch IS NULL OR a.batch = '') + </otherwise> + </choose> and b.row1 >= 12 and b.row1 <= 14 group by b.bay1 @@ -306,6 +338,14 @@ and b.loc_sts = 'F' and b.frozen != 1 and a.manu is null and a.matnr = #{matnr} + <choose> + <when test="batch != null and batch != ''"> + and a.batch = #{batch} + </when> + <otherwise> + and (a.batch IS NULL OR a.batch = '') + </otherwise> + </choose> and b.row1 >= 15 and b.row1 <= 18 group by b.bay1 @@ -321,6 +361,14 @@ and b.loc_sts = 'F' and b.frozen != 1 and a.manu is null and a.matnr = #{matnr} + <choose> + <when test="batch != null and batch != ''"> + and a.batch = #{batch} + </when> + <otherwise> + and (a.batch IS NULL OR a.batch = '') + </otherwise> + </choose> and b.row1 >= 19 and b.row1 <= 21 group by b.bay1 @@ -381,6 +429,14 @@ </if> ) and a.matnr = #{matnr} + <choose> + <when test="batch != null and batch != ''"> + and a.batch = #{batch} + </when> + <otherwise> + and (a.batch IS NULL OR a.batch = '') + </otherwise> + </choose> and b.bay1 = #{bay} and b.loc_sts = 'F' and b.frozen != 1 order by b.row1 -- Gitblit v1.9.1