|  |  |  | 
|---|
|  |  |  | import com.zy.asrs.common.utils.Utils; | 
|---|
|  |  |  | import com.zy.asrs.common.wms.mapper.LocMastMapper; | 
|---|
|  |  |  | import com.zy.asrs.common.wms.entity.LocMast; | 
|---|
|  |  |  | import com.zy.asrs.common.wms.service.LocDirectionService; | 
|---|
|  |  |  | import com.zy.asrs.common.wms.service.LocMastService; | 
|---|
|  |  |  | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 
|---|
|  |  |  | import com.zy.asrs.framework.common.Cools; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.stereotype.Service; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Service("locMastService") | 
|---|
|  |  |  | public class LocMastServiceImpl extends ServiceImpl<LocMastMapper, LocMast> implements LocMastService { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private LocDirectionService locDirectionService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public List<String> queryGroupEmptyStock(String sourceLocNo, Long hostId) { | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public List<LocMast> queryFreeLocMast2(Short locType1, Integer rowBeg, Integer rowEnd, Integer bayBeg, Integer bayEnd, Integer levBeg, Integer levEnd, Long hostId) { | 
|---|
|  |  |  | return this.baseMapper.queryFreeLocMast2(locType1, rowBeg, rowEnd, bayBeg, bayEnd, levBeg, levEnd, hostId); | 
|---|
|  |  |  | public List<LocMast> queryFreeLocMast2(Short locType1, Integer rowBeg, Integer rowEnd, Integer bayBeg, Integer bayEnd, Integer levBeg, Integer levEnd, Long hostId,Long whsType) { | 
|---|
|  |  |  | return this.baseMapper.queryFreeLocMast2(locType1, rowBeg, rowEnd, bayBeg, bayEnd, levBeg, levEnd, hostId, whsType); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public LocMast findNearloc(String locNo, Long hostId, LocRangeDto locRangeDto) { | 
|---|
|  |  |  | LocMast locMast = null; | 
|---|
|  |  |  | List<String> groupOuterLoc = Utils.getGroupOuterLoc(locNo, hostId); | 
|---|
|  |  |  | if (!Cools.isEmpty(groupOuterLoc)) { | 
|---|
|  |  |  | List<String> groupLoc = Utils.getGroupLoc(locNo, hostId); | 
|---|
|  |  |  | boolean asc = locDirectionService.isAsc(Utils.getRow(locNo), "inner", hostId); | 
|---|
|  |  |  | if (!Cools.isEmpty(groupLoc)) { | 
|---|
|  |  |  | LambdaQueryWrapper<LocMast> wrapper = new LambdaQueryWrapper<LocMast>() | 
|---|
|  |  |  | .eq(LocMast::getLocSts, 'O') | 
|---|
|  |  |  | .in(LocMast::getLocNo, groupOuterLoc) | 
|---|
|  |  |  | .eq(LocMast::getHostId, hostId) | 
|---|
|  |  |  | .orderByAsc(LocMast::getRow1); | 
|---|
|  |  |  | .in(LocMast::getLocNo, groupLoc) | 
|---|
|  |  |  | .eq(LocMast::getHostId, hostId); | 
|---|
|  |  |  | if (asc) { | 
|---|
|  |  |  | wrapper.orderByAsc(LocMast::getRow1); | 
|---|
|  |  |  | }else { | 
|---|
|  |  |  | wrapper.orderByDesc(LocMast::getRow1); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //库位搜索范围 | 
|---|
|  |  |  | if (locRangeDto != null) { | 
|---|
|  |  |  | wrapper.ge(LocMast::getRow1, locRangeDto.getStartRow()); | 
|---|