| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | |
| | | private WorkService workService; |
| | | |
| | | @Override |
| | | public List<LocMast> queryFreeLocMast(List<Integer> rows, Integer rowsLen, Short locType1) { |
| | | return this.baseMapper.queryFreeLocMast(rows, rowsLen, locType1); |
| | | } |
| | | |
| | | @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 LocMast queryFreeLocMast0(Integer row, Short locType1) { |
| | | return this.baseMapper.queryFreeLocMast0(row, locType1); |
| | | public List<LocMast> selectAreaEmpty(Short locType1, Integer locType3) { |
| | | return this.baseMapper.selectAreaEmpty(locType1, locType3); |
| | | } |
| | | |
| | | @Override |
| | |
| | | if (locMast == null) { |
| | | return false; |
| | | } |
| | | return this.baseMapper.selectEmptyLocCount(locMast.getCrnNo()) > quaOfBlank; |
| | | } |
| | | |
| | | @Override |
| | | public Boolean checkWhole(List<LocDetl> locDetls) { |
| | | return null; |
| | | return this.baseMapper.selectEmptyLocCount(locMast.getLocType3(), locMast.getLev1()) > quaOfBlank; |
| | | } |
| | | |
| | | @Override |
| | | public Boolean isOutMost(String locNo, Boolean pakin) { |
| | | return Integer.parseInt(locNo.substring(0, 2)) == Utils.getOutLayerRow(locNo, pakin); |
| | | int row = Utils.getRow(locNo); |
| | | int bay = Utils.getBay(locNo); |
| | | ArrayList<Integer> list = new ArrayList<Integer>(){{ |
| | | add(1);add(3);add(4);add(6); |
| | | add(8);add(10);add(11); |
| | | }}; |
| | | |
| | | if (list.contains(row)) { |
| | | return true;//最外侧库位 |
| | | } |
| | | |
| | | if (row == 13 && (bay >= 59 && bay <= 61)) { |
| | | return true;//最外侧库位 |
| | | } |
| | | |
| | | if (bay < 59) { |
| | | if (row == 13 || row == 14 || row == 16) { |
| | | return true;//最外侧库位 |
| | | } |
| | | } |
| | | |
| | | return false;//不是最外侧库位 |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | |
| | | public LocMast findNearloc(String locNo) { |
| | | int row = getRow(locNo); |
| | | LocMast locMast = null; |
| | | if (row>19) { |
| | | List<String> groupOuterLoc = Utils.getGroupOuterLoc(locNo); |
| | | if (!Cools.isEmpty(groupOuterLoc)) { |
| | | locMast = this.baseMapper.selectAvailableNearLocDesc(groupOuterLoc); |
| | | } |
| | | |
| | | }else { |
| | | List<String> groupOuterLoc = Utils.getGroupOuterLoc(locNo); |
| | | if (!Cools.isEmpty(groupOuterLoc)) { |
| | | locMast = this.baseMapper.selectAvailableNearLocAsc(groupOuterLoc); |
| | | } |
| | | List<String> groupOuterLoc = Utils.getGroupOuterLoc(locNo); |
| | | if (!Cools.isEmpty(groupOuterLoc)) { |
| | | locMast = this.baseMapper.selectAvailableNearLocAsc(groupOuterLoc); |
| | | } |
| | | return locMast; |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public LocMast selectByLoc(String locNo) { |
| | | return this.baseMapper.selectByLoc(locNo); |
| | | } |
| | | |
| | | @Override |
| | | public Integer updateLocType2ByRBL(Integer locType2, Integer startRow, Integer endRow, Integer startBay, Integer endBay, Integer startLev, Integer endLev) { |
| | | return this.baseMapper.updateLocType2ByRBL(locType2, startRow, endRow, startBay, endBay, startLev, endLev); |
| | | } |