| | |
| | | , @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); |
| | | List<LocMast> queryFreeLocMast2(@Param("locType1") Short locType1 |
| | | , @Param("rowBeg") Integer rowBeg, @Param("rowEnd") Integer rowEnd, @Param("bayBeg") Integer bayBeg |
| | | , @Param("bayEnd") Integer bayEnd, @Param("levBeg") Integer levBeg, @Param("levEnd") Integer levEnd); |
| | | |
| | | 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> queryFreeLocMastEnd(Integer row, Short locType1); |
| | | List<LocMast> queryFreeLocMastEnd0(Integer bay,Integer lev,Integer row, Short locType1); |
| | | |
| | | List<LocMast> queryFreeLocMast2(Short locType1, Integer rowBeg, Integer rowEnd, Integer bayBeg, Integer bayEnd, Integer levBeg, Integer levEnd); |
| | | |
| | | /** |
| | | * 获取同组货架的空库位 |
| | | * @param sourceLocNo 源库位 |
| | |
| | | } |
| | | |
| | | @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); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<String> queryGroupEmptyStock(String sourceLocNo) { |
| | | if (Cools.isEmpty(sourceLocNo)) { |
| | | return null; |
| | |
| | | // 库区锁定 |
| | | LocRule locRule = locRuleService.find(Cools.isEmpty(matNos) ? null : matNos.get(0), null, start, end); |
| | | if (!Cools.isEmpty(locRule)) { |
| | | List<Integer> rows = Utils.getGroupLoc(locRule.getRowBeg()); |
| | | List<LocMast> locMasts = locMastService.queryFreeLocMast1(rows, rows.size(), locTypeDto.getLocType1(), inoutEveryday |
| | | // plan first |
| | | // 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; |
| | | // crnNo = locMast.getCrnNo(); |
| | | // wrapper = new EntityWrapper<StaDesc>() |
| | | // .eq("type_no", staDescId) |
| | | // .eq("stn_no", sourceStaNo) |
| | | // .eq("crn_no", crnNo); |
| | | // staDesc = staDescService.selectOne(wrapper); |
| | | // if (Cools.isEmpty(staDesc)) { |
| | | // log.error("入库路径不存在, staDescId={}, sourceStaNo={}, crnNo={}", staDescId, sourceStaNo, crnNo); |
| | | // throw new CoolException("入库路径不存在"); |
| | | // } |
| | | // // 检测目标站 |
| | | // staNo = basDevpService.selectById(staDesc.getCrnStn()); |
| | | // if (!staNo.getAutoing().equals("Y")) { |
| | | // throw new CoolException("目标站"+staDesc.getCrnStn()+"不可用"); |
| | | // } |
| | | // break; |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | // plan second |
| | | List<LocMast> locMasts = locMastService.queryFreeLocMast2(locTypeDto.getLocType1() |
| | | , 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; |
| | | crnNo = locMast.getCrnNo(); |
| | | wrapper = new EntityWrapper<StaDesc>() |
| | | .eq("type_no", staDescId) |
| | | .eq("stn_no", sourceStaNo) |
| | | .eq("crn_no", crnNo); |
| | | staDesc = staDescService.selectOne(wrapper); |
| | | if (Cools.isEmpty(staDesc)) { |
| | | log.error("入库路径不存在, staDescId={}, sourceStaNo={}, crnNo={}", staDescId, sourceStaNo, crnNo); |
| | | throw new CoolException("入库路径不存在"); |
| | | } |
| | | // 检测目标站 |
| | | staNo = basDevpService.selectById(staDesc.getCrnStn()); |
| | | if (!staNo.getAutoing().equals("Y")) { |
| | | throw new CoolException("目标站"+staDesc.getCrnStn()+"不可用"); |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | for (LocMast one : locMasts) { |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="queryFreeLocMast2" resultMap="BaseResultMap"> |
| | | select * |
| | | from asr_loc_mast |
| | | where row1=#{row} |
| | | and loc_sts='O' |
| | | <if test="locType1 != null"> |
| | | and loc_type1 = #{locType1} |
| | | </if> |
| | | |
| | | <if test="rowBeg != null"> |
| | | and row1 >= #{rowBeg} |
| | | </if> |
| | | <if test="rowEnd != null"> |
| | | and row1 <= #{rowEnd} |
| | | </if> |
| | | <if test="bayBeg != null"> |
| | | and bay1 >= #{bayBeg} |
| | | </if> |
| | | <if test="bayEnd != null"> |
| | | and bay1 <= #{bayEnd} |
| | | </if> |
| | | <if test="levBeg != null"> |
| | | and lev1 >= #{levBeg} |
| | | </if> |
| | | <if test="levEnd != null"> |
| | | and lev1 <= #{levEnd} |
| | | </if> |
| | | and loc_no not in ('0100101', '0200101', '0300101', '1200701', '1300701', '1400701', '1900401', '2000401', '2100401') |
| | | order by loc_sts desc ,lev1 asc,bay1 asc |
| | | </select> |
| | | |
| | | </mapper> |