| | |
| | | List<LocMast> queryFreeLocMastEnd(@Param("row") Integer row, @Param("locType1") Short locType1); |
| | | List<LocMast> queryFreeLocMastEnd0(@Param("bay") Integer bay,@Param("lev") Integer lev,@Param("row1") Integer row, @Param("locType1") Short locType1); |
| | | |
| | | List<LocMast> queryFreeLocMastEnd1(@Param("row") Integer row, @Param("locType1") Short locType1, @Param("inoutEveryday") Boolean inoutEveryday); |
| | | |
| | | @Select("select loc_no from asr_loc_mast where 1=1 and loc_sts = 'O' and crn_no = #{crnNo}") |
| | | List<String> queryGroupEmptyStock(Integer crnNo); |
| | | |
| | |
| | | , Integer rowBeg, Integer rowEnd, Integer bayBeg, Integer bayEnd, Integer levBeg, Integer levEnd); |
| | | List<LocMast> queryFreeLocMastEnd(Integer row, Short locType1); |
| | | List<LocMast> queryFreeLocMastEnd0(Integer bay,Integer lev,Integer row, Short locType1); |
| | | List<LocMast> queryFreeLocMastEnd1(Integer row, Short locType1,Boolean inoutEveryday); |
| | | |
| | | List<LocMast> queryFreeLocMast2(Short locType1, Integer rowBeg, Integer rowEnd, Integer bayBeg, Integer bayEnd, Integer levBeg, Integer levEnd); |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<LocMast> queryFreeLocMastEnd1(Integer row, Short locType1,Boolean inoutEveryday){ |
| | | return this.baseMapper.queryFreeLocMastEnd1(row, locType1,inoutEveryday); |
| | | } |
| | | |
| | | @Override |
| | | public List<LocMast> queryFreeLocMast2(Short locType1, Integer rowBeg, Integer rowEnd, Integer bayBeg, Integer bayEnd, Integer levBeg, Integer levEnd) { |
| | | return this.baseMapper.queryFreeLocMast2(locType1, rowBeg, rowEnd, bayBeg, bayEnd, levBeg, levEnd); |
| | | } |
| | |
| | | // 开始查找库位 ==============================>> |
| | | |
| | | // 1.当检索库排为浅库位排时,优先寻找当前库排的深库位排 |
| | | // 高低频管控、库位组全部为O |
| | | if (locMast == null) { |
| | | List<Integer> rows = Utils.getGroupLoc(curRow); |
| | | List<LocMast> locMasts = locMastService.queryFreeLocMast0(rows, rows.size(), locTypeDto.getLocType1(), inoutEveryday); |
| | |
| | | if (!locMastService.checkEmptyCount(locMast, 10)) { locMast = null; } |
| | | } |
| | | |
| | | // 2.1 高低频管控、库位组无需全部为O,找到库位对应深库位不能为P R |
| | | if (Cools.isEmpty(locMast)) { |
| | | int sign = curRow; |
| | | while (sign != 0 && Cools.isEmpty(locMast)) { |
| | | List<LocMast> locMasts = locMastService.queryFreeLocMastEnd1(sign, locTypeDto.getLocType1(), inoutEveryday); |
| | | for (LocMast loc : locMasts) { |
| | | // 同库位组对应其钱库位是否为 O.空库位 |
| | | boolean success = true; |
| | | // 浅库位 |
| | | List<String> outerLocList = Utils.getGroupOuterLoc(loc.getLocNo()); |
| | | for (String outerLocNo : outerLocList) { |
| | | LocMast outerLoc = locMastService.selectById(outerLocNo); |
| | | if (Cools.isEmpty(outerLoc)) { |
| | | continue; |
| | | } |
| | | if (!outerLoc.getLocSts().equals("O")) { |
| | | success = false; break; |
| | | } |
| | | } |
| | | // 深库位 |
| | | List<String> insideLocList = Utils.getGroupInsideLoc(loc.getLocNo()); |
| | | for (String insideLocNo : insideLocList) { |
| | | LocMast insideLoc = locMastService.selectById(insideLocNo); |
| | | if (Cools.isEmpty(insideLoc)) { |
| | | continue; |
| | | } |
| | | if (insideLoc.getLocSts().equals("R") || insideLoc.getLocSts().equals("P")) { |
| | | success = false; break; |
| | | } |
| | | } |
| | | // 因库位移转、需预留空库位 |
| | | if (!locMastService.checkEmptyCount(loc, 10)) { |
| | | success = false; |
| | | } |
| | | if (success) { |
| | | locMast = loc; |
| | | break; |
| | | } |
| | | } |
| | | sign = getCurRow(sign); |
| | | } |
| | | } |
| | | |
| | | // 2.无库位时,无视区域锁定,重新查找库位 |
| | | if (Cools.isEmpty(locMast)) { |
| | | int sign = curRow; |
| | |
| | | order by loc_sts desc ,lev1 asc,bay1 asc |
| | | </select> |
| | | |
| | | <select id="queryFreeLocMastEnd1" resultMap="BaseResultMap"> |
| | | select * |
| | | from asr_loc_mast |
| | | where row1=#{row} |
| | | and loc_sts='O' |
| | | <if test="locType1 != null"> |
| | | and loc_type1 = #{locType1} |
| | | </if> |
| | | <choose> |
| | | <when test="inoutEveryday != null and inoutEveryday"> |
| | | AND bay1 < 11 </when> |
| | | <otherwise> |
| | | AND bay1 >= 11 |
| | | </otherwise> |
| | | </choose> |
| | | and loc_no not in ('0100101', '0200101', '0300101', '1200701', '1300701', '1400701', '1900401', '2000401', '2100401') |
| | | order by loc_sts desc ,lev1 asc,bay1 asc |
| | | </select> |
| | | |
| | | <select id="queryFreeLocMastEnd0" resultMap="BaseResultMap"> |
| | | select * |
| | | from asr_loc_mast |