| | |
| | | |
| | | List<LocMast> queryFreeLocMast(@Param("rows") List<Integer> rows, @Param("rowsLen") Integer rowsLen, @Param("locType1") Short locType1); |
| | | List<LocMast> queryFreeLocMast0(@Param("rows") List<Integer> rows, @Param("rowsLen") Integer rowsLen, @Param("locType1") Short locType1, @Param("inoutEveryday") Boolean inoutEveryday); |
| | | List<LocMast> queryFreeLocMast1(@Param("rows") List<Integer> rows |
| | | , @Param("rowsLen") Integer rowsLen, @Param("locType1") Short locType1, @Param("inoutEveryday") Boolean inoutEveryday |
| | | , @Param("rowBeg") Integer rowBeg, @Param("rowEnd") Integer rowEnd, @Param("bayBeg") Integer bayBeg |
| | | , @Param("bayEnd") Integer bayEnd, @Param("levBeg") Integer levBeg, @Param("levEnd") Integer levEnd); |
| | | |
| | | @Select("select loc_no from asr_loc_mast where 1=1 and loc_sts = 'O' and crn_no = #{crnNo}") |
| | | List<String> queryGroupEmptyStock(Integer crnNo); |
| | |
| | | */ |
| | | List<LocMast> queryFreeLocMast(List<Integer> rows, Integer rowsLen, Short locType1); |
| | | List<LocMast> queryFreeLocMast0(List<Integer> rows, Integer rowsLen, Short locType1,Boolean inoutEveryday); |
| | | List<LocMast> queryFreeLocMast1(List<Integer> rows, Integer rowsLen, Short locType1,Boolean inoutEveryday |
| | | , Integer rowBeg, Integer rowEnd, Integer bayBeg, Integer bayEnd, Integer levBeg, Integer levEnd); |
| | | |
| | | /** |
| | | * 获取同组货架的空库位 |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<LocMast> queryFreeLocMast1(List<Integer> rows, Integer rowsLen, Short locType1, Boolean inoutEveryday, Integer rowBeg, Integer rowEnd, Integer bayBeg, Integer bayEnd, Integer levBeg, Integer levEnd) { |
| | | return this.baseMapper.queryFreeLocMast1(rows, rowsLen, locType1,inoutEveryday, rowBeg, rowEnd, bayBeg, bayEnd, levBeg, levEnd); |
| | | } |
| | | |
| | | @Override |
| | | public List<String> queryGroupEmptyStock(String sourceLocNo) { |
| | | if (Cools.isEmpty(sourceLocNo)) { |
| | | return null; |
| | |
| | | |
| | | // 1.当检索库排为浅库位排时,优先寻找当前库排的深库位排 |
| | | if (locMast == null) { |
| | | List<Integer> rows = Utils.getGroupLoc(curRow); |
| | | List<LocMast> locMasts = locMastService.queryFreeLocMast0(rows, rows.size(), locTypeDto.getLocType1(), inoutEveryday); |
| | | if (!Cools.isEmpty(locMasts)) { |
| | | Integer innermostRow = Utils.getInnermostRow(locMasts.get(0).getLocNo()); |
| | | for (LocMast one : locMasts) { |
| | | if (one.getRow1().equals(innermostRow)) { |
| | | locMast = one; |
| | | break; |
| | | |
| | | // 库区锁定 |
| | | LocRule locRule = locRuleService.find(Cools.isEmpty(matNos) ? null : matNos.get(0), null); |
| | | if (!Cools.isEmpty(locRule)) { |
| | | List<Integer> rows = Utils.getGroupLoc(locRule.getRowBeg()); |
| | | List<LocMast> locMasts = locMastService.queryFreeLocMast1(rows, rows.size(), locTypeDto.getLocType1(), inoutEveryday |
| | | , locRule.getRowBeg(), locRule.getRowEnd(), locRule.getBayBeg(), locRule.getBayEnd(), locRule.getLevBeg(), locRule.getLevEnd()); |
| | | if (!Cools.isEmpty(locMasts)) { |
| | | Integer innermostRow = Utils.getInnermostRow(locMasts.get(0).getLocNo()); |
| | | for (LocMast one : locMasts) { |
| | | if (one.getRow1().equals(innermostRow)) { |
| | | locMast = one; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (locMast == null) { |
| | | List<Integer> rows = Utils.getGroupLoc(curRow); |
| | | List<LocMast> locMasts = locMastService.queryFreeLocMast0(rows, rows.size(), locTypeDto.getLocType1(), inoutEveryday); |
| | | if (!Cools.isEmpty(locMasts)) { |
| | | Integer innermostRow = Utils.getInnermostRow(locMasts.get(0).getLocNo()); |
| | | for (LocMast one : locMasts) { |
| | | if (one.getRow1().equals(innermostRow)) { |
| | | locMast = one; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | ) |
| | | </select> |
| | | |
| | | <select id="queryFreeLocMast1" resultMap="BaseResultMap"> |
| | | select |
| | | * |
| | | from asr_loc_mast |
| | | where 1=1 |
| | | and row1 in |
| | | <foreach item="item" collection="rows" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | and ctn_no = |
| | | ( |
| | | select |
| | | top 1 |
| | | ctn_no |
| | | from ( |
| | | select |
| | | ctn_no, |
| | | count(1) as count |
| | | from asr_loc_mast |
| | | where 1=1 |
| | | and row1 in |
| | | <foreach item="item" collection="rows" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | and loc_sts = 'O' |
| | | <if test="locType1 != null"> |
| | | and loc_type1 = #{locType1} |
| | | </if> |
| | | <choose> |
| | | <when test="inoutEveryday != null and inoutEveryday"> |
| | | AND bay1 < 11 and lev1 in (3,4) |
| | | </when> |
| | | <otherwise> |
| | | AND (bay1 >= 11 or (bay1 < 11 and lev1 in (1,2))) |
| | | </otherwise> |
| | | </choose> |
| | | and loc_no not in ('0100101', '0200101', '0300101', '1200701', '1300701', '1400701', '1900401', '2000401', '2100401') |
| | | group by ctn_no |
| | | ) a |
| | | where count = #{rowsLen} |
| | | order by right(ctn_no, 2) + 0 asc, left(ctn_no, 3) + 0 asc |
| | | ) |
| | | </select> |
| | | |
| | | </mapper> |