| | |
| | | @Select("select count(*) as count from asr_loc_mast where 1=1 and loc_sts = 'O' and loc_type1 = #{locType1} and loc_type2 = #{locType2} and crn_no = #{crnNo}") |
| | | Integer selectEmptyLocCount(@Param("locType1") Short locType1, @Param("locType2") Short locType2, @Param("crnNo") Integer crnNo); |
| | | |
| | | Integer selectEmptyLocCount0(@Param("locType1") Short locType1, @Param("locType2") Short locType2, @Param("crnNo") Integer crnNo); |
| | | |
| | | void updateLocSts(@Param("locNo") String locNo,@Param("locSts") String locSts); |
| | | |
| | | //找外侧空库位 |
| | |
| | | Boolean checkEmptyCount(LocMast locMast, int quaOfBlank); |
| | | |
| | | /** |
| | | * 检查当前库位所属巷道的空库位数量 |
| | | * @param locMast |
| | | * @return |
| | | */ |
| | | Boolean checkEmptyCount0(LocMast locMast, int quaOfBlank); |
| | | |
| | | /** |
| | | * 当前库存明细是否为整托 |
| | | */ |
| | | Boolean checkWhole(List<LocDetl> locDetls); |
| | |
| | | } |
| | | return res; |
| | | } |
| | | @Override |
| | | public Boolean checkEmptyCount0(LocMast locMast, int quaOfBlank) { |
| | | if (locMast == null) { |
| | | return false; |
| | | } |
| | | Integer nowQua = this.baseMapper.selectEmptyLocCount0(locMast.getLocType1(), locMast.getLocType2(), locMast.getCrnNo()); |
| | | boolean res = nowQua > quaOfBlank; |
| | | if (!res) { |
| | | log.warn("{}号堆垛机库位不足,因滞留空库位{}个,目前空库位{}个", locMast.getCrnNo(), quaOfBlank, nowQua); |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | @Override |
| | | public Boolean checkWhole(List<LocDetl> locDetls) { |
| | |
| | | // 浅库位对应堆垛机必须可用且无异常 |
| | | if (basCrnpService.checkSiteError(locMast0.getCrnNo(), true)) { |
| | | // 因库位移转、需预留空库位 |
| | | if (locMastService.checkEmptyCount(locMast0, 10)) { |
| | | if (locMastService.checkEmptyCount0(locMast0, 6)) { |
| | | locMast = locMast0; |
| | | } |
| | | } |
| | |
| | | #{item} |
| | | </foreach> |
| | | </select> |
| | | |
| | | <select id="selectEmptyLocCount0" resultMap="BaseResultMap"> |
| | | select count(*) as count from asr_loc_mast |
| | | where 1=1 |
| | | and loc_sts = 'O' |
| | | and loc_type1 = #{locType1} |
| | | and loc_type2 = #{locType2} |
| | | and crn_no = #{crnNo} |
| | | <if test="crnNo == 1"> |
| | | and row1 in (3,4) |
| | | </if> |
| | | <if test="crnNo == 2"> |
| | | and row1 in (11,12) |
| | | </if> |
| | | <if test="crnNo == 3"> |
| | | and row1 in (18,19) |
| | | </if> |
| | | </select> |
| | | </mapper> |