| | |
| | | List<Integer> queryDistinctRow(@Param("crnNo")Integer crnNo); |
| | | |
| | | LocMast queryFreeLocMast(@Param("row") Integer row, @Param("locType1") Short locType1, @Param("locType2") Short locType2, @Param("locType3") Short locType3); |
| | | LocMast queryFreeLocMastIncludeFirst(@Param("row") Integer row, @Param("locType1") Short locType1, @Param("locType2") Short locType2, @Param("locType3") Short locType3); |
| | | LocMast queryFreeLocMastExceptFirst(@Param("row") Integer row, @Param("locType1") Short locType1, @Param("locType2") Short locType2, @Param("locType3") Short locType3); |
| | | |
| | | @Select("select loc_no from asr_loc_mast where 1=1 and loc_sts = 'O' and crn_no = #{crnNo}") |
| | | List<String> queryGroupEmptyStock(Integer crnNo); |
| | |
| | | * @return |
| | | */ |
| | | Boolean checkEmptyCount(LocMast locMast); |
| | | |
| | | /** |
| | | * 优先找第一列悬挑货架的空库位 |
| | | * @param row |
| | | * @param locType1 |
| | | * @param locType2 |
| | | * @param locType3 |
| | | * @return |
| | | */ |
| | | LocMast queryFreeLocMastIncludeFirst(Integer row, Short locType1, Short locType2, Short locType3); |
| | | |
| | | /** |
| | | * 实物入库,寻找空库位不能为悬挑的第1列货架 |
| | | * @param row |
| | | * @param locType1 |
| | | * @param locType2 |
| | | * @param locType3 |
| | | * @return |
| | | */ |
| | | LocMast queryFreeLocMastExceptFirst(Integer row, Short locType1, Short locType2, Short locType3); |
| | | } |
| | |
| | | return this.baseMapper.selectEmptyLocCount(locMast.getLocType1(), locMast.getLocType2(), locMast.getLocType3(), locMast.getCrnNo()) > 1; |
| | | } |
| | | |
| | | @Override |
| | | public LocMast queryFreeLocMastIncludeFirst(Integer row, Short locType1, Short locType2, Short locType3) { |
| | | |
| | | return this.baseMapper.queryFreeLocMastIncludeFirst(row, locType1, locType2, locType3); |
| | | } |
| | | |
| | | @Override |
| | | public LocMast queryFreeLocMastExceptFirst(Integer row, Short locType1, Short locType2, Short locType3) { |
| | | return this.baseMapper.queryFreeLocMastExceptFirst(row, locType1, locType2, locType3); |
| | | } |
| | | |
| | | } |
| | |
| | | } else { |
| | | deepRow = curRow; |
| | | } |
| | | locMast = locMastService.queryFreeLocMast(deepRow, locTypeDto.getLocType1(), locTypeDto.getLocType2(), locTypeDto.getLocType3()); |
| | | |
| | | if(emptyMk){ |
| | | locMast = locMastService.queryFreeLocMastIncludeFirst(deepRow, locTypeDto.getLocType1(), locTypeDto.getLocType2(), locTypeDto.getLocType3()); |
| | | if (Cools.isEmpty(locMast)){ |
| | | locMast = locMastService.queryFreeLocMast(deepRow, locTypeDto.getLocType1(), locTypeDto.getLocType2(), locTypeDto.getLocType3()); |
| | | } |
| | | } else { |
| | | locMast = locMastService.queryFreeLocMastExceptFirst(deepRow, locTypeDto.getLocType1(), locTypeDto.getLocType2(), locTypeDto.getLocType3()); |
| | | } |
| | | |
| | | // locMast = locMastService.queryFreeLocMast(deepRow, locTypeDto.getLocType1(), locTypeDto.getLocType2(), locTypeDto.getLocType3()); |
| | | // 因库位移转、需预留空库位 |
| | | if (!locMastService.checkEmptyCount(locMast)) { |
| | | locMast = null; |
| | | } |
| | | } |
| | | if (Cools.isEmpty(locMast)) { |
| | | locMast = locMastService.queryFreeLocMast(curRow, locTypeDto.getLocType1(), locTypeDto.getLocType2(), locTypeDto.getLocType3()); |
| | | if(emptyMk){ |
| | | locMast = locMastService.queryFreeLocMastIncludeFirst(curRow, locTypeDto.getLocType1(), locTypeDto.getLocType2(), locTypeDto.getLocType3()); |
| | | if (Cools.isEmpty(locMast)){ |
| | | locMast = locMastService.queryFreeLocMast(curRow, locTypeDto.getLocType1(), locTypeDto.getLocType2(), locTypeDto.getLocType3()); |
| | | } |
| | | } else { |
| | | locMast = locMastService.queryFreeLocMastExceptFirst(curRow, locTypeDto.getLocType1(), locTypeDto.getLocType2(), locTypeDto.getLocType3()); |
| | | } |
| | | // locMast = locMastService.queryFreeLocMast(curRow, locTypeDto.getLocType1(), locTypeDto.getLocType2(), locTypeDto.getLocType3()); |
| | | // 因库位移转、需预留空库位 |
| | | if (!locMastService.checkEmptyCount(locMast)) { |
| | | locMast = null; |
| | |
| | | <!-- </if>--> |
| | | order by loc_sts desc ,lev1 asc,bay1 asc |
| | | </select> |
| | | |
| | | <select id="queryFreeLocMastIncludeFirst" resultMap="BaseResultMap"> |
| | | select top 1 * |
| | | from asr_loc_mast |
| | | where row1=#{row} |
| | | and bay1 = 1 |
| | | and loc_sts='O' |
| | | <if test="locType1 != null"> |
| | | and loc_type1 = #{locType1} |
| | | </if> |
| | | <!-- <if test="locType2 != null">--> |
| | | <!-- and loc_type2 = #{locType2}--> |
| | | <!-- </if>--> |
| | | <!-- <if test="locType3 != null">--> |
| | | <!-- and loc_type3 = #{locType3}--> |
| | | <!-- </if>--> |
| | | order by loc_sts desc ,lev1 asc,bay1 asc |
| | | </select> |
| | | <select id="queryFreeLocMastExceptFirst" resultMap="BaseResultMap"> |
| | | select top 1 * |
| | | from asr_loc_mast |
| | | where row1=#{row} |
| | | and bay1 > 1 |
| | | and loc_sts='O' |
| | | <if test="locType1 != null"> |
| | | and loc_type1 = #{locType1} |
| | | </if> |
| | | <!-- <if test="locType2 != null">--> |
| | | <!-- and loc_type2 = #{locType2}--> |
| | | <!-- </if>--> |
| | | <!-- <if test="locType3 != null">--> |
| | | <!-- and loc_type3 = #{locType3}--> |
| | | <!-- </if>--> |
| | | order by loc_sts desc ,lev1 asc,bay1 asc |
| | | </select> |
| | | |
| | | </mapper> |