|
|
|
|
@ -815,13 +815,16 @@ public class BaseLocationServiceImpl extends ServiceImpl<BaseLocationMapper, Bas |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public synchronized Result<BaseLocationVo> assignEmptyLocationAll(AssingEmptyLocBo assingEmptyLocBo) { |
|
|
|
|
public synchronized Result<BaseLocationVo> assignEmptyLocationAll(AssingEmptyLocBo assingEmptyLocBo,String lcoatinTunnel) { |
|
|
|
|
BaseLocationVo locationVo = null; |
|
|
|
|
//bo等于空时,是空治具分配货位,否则是保险杠分配货位
|
|
|
|
|
if (assingEmptyLocBo == null) { |
|
|
|
|
//获取立库区的空治具存放区域编号
|
|
|
|
|
Long emptyconArea = Long.valueOf(sysParameterService.selectConfigByKey(SecurityUtils.getCurrentBranchId(), ParameterConstants.ParameterSystem.emptycon_area)); |
|
|
|
|
List<BaseLocationVo> baseLocationVos = baseLocationMapper.getLocationByAreaId(emptyconArea); |
|
|
|
|
BaseLocationQueryBo locationQueryBo = new BaseLocationQueryBo(); |
|
|
|
|
locationQueryBo.setAreaId(emptyconArea); |
|
|
|
|
locationQueryBo.setTunnel(lcoatinTunnel); |
|
|
|
|
List<BaseLocationVo> baseLocationVos = baseLocationMapper.getLocationByAreaIdTunel(locationQueryBo); |
|
|
|
|
if (baseLocationVos.size() > 0) { |
|
|
|
|
locationVo = baseLocationVos.get(0); |
|
|
|
|
} else { |
|
|
|
|
@ -909,19 +912,21 @@ public class BaseLocationServiceImpl extends ServiceImpl<BaseLocationMapper, Bas |
|
|
|
|
bo.setTunnel(assingEmptyLocBo.getTunnel()); |
|
|
|
|
log.info("保险杠分配货位查询条件:" + JsonUtil.toJSONString(bo)); |
|
|
|
|
List<BaseLocationVo> baseLocationVos = this.baseMapper.queryBaseLocationListByGoods(bo); |
|
|
|
|
if (baseLocationVos.size() == 0) { |
|
|
|
|
//查看缓冲区是否还有货位
|
|
|
|
|
Long bufferArea = Long.valueOf(sysParameterService.selectConfigByKey(ParameterConstants.ParameterSystem.buffer_area)); |
|
|
|
|
List<BaseLocationVo> baseLocationVoList = baseLocationMapper.getLocationByAreaId(bufferArea); |
|
|
|
|
log.info("保险杠缓冲区分配到的货位信息:" + baseLocationVoList.size()); |
|
|
|
|
if (baseLocationVoList.size() < 0) { |
|
|
|
|
log.info("车型及缓冲区都未查询到空货位"); |
|
|
|
|
return Result.err().msg("保险杠分配货位暂无空货位可用"); |
|
|
|
|
if (StringUtils.isEmpty(assingEmptyLocBo.getTunnel())){ |
|
|
|
|
if (baseLocationVos.size() == 0) { |
|
|
|
|
//查看缓冲区是否还有货位
|
|
|
|
|
Long bufferArea = Long.valueOf(sysParameterService.selectConfigByKey(ParameterConstants.ParameterSystem.buffer_area)); |
|
|
|
|
List<BaseLocationVo> baseLocationVoList = baseLocationMapper.getLocationByAreaId(bufferArea); |
|
|
|
|
log.info("保险杠缓冲区分配到的货位信息:" + baseLocationVoList.size()); |
|
|
|
|
if (baseLocationVoList.size() < 0) { |
|
|
|
|
log.info("车型及缓冲区都未查询到空货位"); |
|
|
|
|
return Result.err().msg("保险杠分配货位暂无空货位可用"); |
|
|
|
|
} |
|
|
|
|
baseLocationVos = baseLocationVoList; |
|
|
|
|
} |
|
|
|
|
//baseLocationVos.addAll(baseLocationVoList);
|
|
|
|
|
baseLocationVos = baseLocationVoList; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//拿到所有可用货位,根据巷道号对双深位的巷道进行处理
|
|
|
|
|
//空货位所在巷道列表,同时过滤掉已有入库任务的巷道
|
|
|
|
|
List<String> tunnelList = baseLocationVos.stream().map(e -> e.getTunnel()).distinct().collect(Collectors.toList()); |
|
|
|
|
@ -1300,7 +1305,11 @@ public class BaseLocationServiceImpl extends ServiceImpl<BaseLocationMapper, Bas |
|
|
|
|
if (baseLocation == null) { |
|
|
|
|
baseLocation = this.queryBaseLocationByrcl(businDataTask.getToRow(), businDataTask.getToColumn(), businDataTask.getToLayer(), businDataTask.getTunnel()); |
|
|
|
|
} |
|
|
|
|
//查询目前任务的信息的保险杠信息:
|
|
|
|
|
List<BusinDataTaskGoodsVo> businDataTaskGoodsVos = businDataTaskGoodsService.selectBusinTaskGoodsByTaskCode(businDataTask.getId()); |
|
|
|
|
|
|
|
|
|
String tunnel = baseLocation.getTunnel(); |
|
|
|
|
String locationStatus = baseLocation.getLocationStatus(); |
|
|
|
|
if ("01".equals(tunnel) || "06".equals(tunnel)) { |
|
|
|
|
//如果是单深位,验证下双深位的是否有库存,如果有在判断车型颜色是否一致
|
|
|
|
|
String locationRow = baseLocation.getLocationRow(); |
|
|
|
|
@ -1320,10 +1329,7 @@ public class BaseLocationServiceImpl extends ServiceImpl<BaseLocationMapper, Bas |
|
|
|
|
.eq(BaseLocation::getLayer, layer)); |
|
|
|
|
List<SysStockDetailVo> sysStockDetailVoList = iSysStockDetailService.queryByLocation(doubleLocation.getId()); |
|
|
|
|
|
|
|
|
|
//查询目前任务的信息的保险杠信息:
|
|
|
|
|
List<BusinDataTaskGoodsVo> businDataTaskGoodsVos = businDataTaskGoodsService.selectBusinTaskGoodsByTaskCode(businDataTask.getId()); |
|
|
|
|
//空托盘入库时,此对象无数据
|
|
|
|
|
|
|
|
|
|
//双深位无库存
|
|
|
|
|
if (sysStockDetailVoList != null && sysStockDetailVoList.size() == 0) { |
|
|
|
|
baseLocation = doubleLocation; |
|
|
|
|
@ -1342,7 +1348,7 @@ public class BaseLocationServiceImpl extends ServiceImpl<BaseLocationMapper, Bas |
|
|
|
|
assingEmptyLocBo.setGoodsNo(goodsNo); |
|
|
|
|
assingEmptyLocBo.setVehicheModel(baseGoodsData.getVehicheModel()); |
|
|
|
|
assingEmptyLocBo.setTunnel(baseLocation.getTunnel()); |
|
|
|
|
Result<BaseLocationVo> locationVoResult = this.assignEmptyLocationAll(assingEmptyLocBo); |
|
|
|
|
Result<BaseLocationVo> locationVoResult = this.assignEmptyLocationAll(assingEmptyLocBo,null); |
|
|
|
|
if (Result.isOk(locationVoResult)) { |
|
|
|
|
BaseLocationVo baseLocationVo = locationVoResult.getData(); |
|
|
|
|
baseLocation = BeanUtil.toBean(baseLocationVo, BaseLocation.class); |
|
|
|
|
@ -1353,7 +1359,7 @@ public class BaseLocationServiceImpl extends ServiceImpl<BaseLocationMapper, Bas |
|
|
|
|
String goodsNo = sysStockDetailVoList.get(0).getGoodsNo(); |
|
|
|
|
if (goodsNo != null) { |
|
|
|
|
AssingEmptyLocBo assingEmptyLocBo = null; |
|
|
|
|
Result<BaseLocationVo> locationVoResult = this.assignEmptyLocationAll(assingEmptyLocBo); |
|
|
|
|
Result<BaseLocationVo> locationVoResult = this.assignEmptyLocationAll(assingEmptyLocBo,businDataTask.getTunnel()); |
|
|
|
|
if (Result.isOk(locationVoResult)) { |
|
|
|
|
BaseLocationVo baseLocationVo = locationVoResult.getData(); |
|
|
|
|
baseLocation = BeanUtil.toBean(baseLocationVo, BaseLocation.class); |
|
|
|
|
@ -1361,19 +1367,39 @@ public class BaseLocationServiceImpl extends ServiceImpl<BaseLocationMapper, Bas |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (!businDataTask.getLocationId().equals(baseLocation.getId())) { |
|
|
|
|
baseLocation.setLocationStatus("4"); |
|
|
|
|
this.updateById(baseLocation); |
|
|
|
|
businDataTask.setToLayer(baseLocation.getLayer()); |
|
|
|
|
businDataTask.setToColumn(baseLocation.getLocationColumn()); |
|
|
|
|
businDataTask.setToRow(baseLocation.getLocationRow()); |
|
|
|
|
businDataTask.setLocationId(baseLocation.getId()); |
|
|
|
|
log.info("双深位重新分配货位:" + JsonUtil.toJSONString(baseLocation)); |
|
|
|
|
iBusinDataTaskService.updateById(businDataTask); |
|
|
|
|
} |
|
|
|
|
else if (tunnel.equals("06") && locationRow.equals("13")){ |
|
|
|
|
if ("1".equals(locationStatus) || "2".equals(locationStatus) || "5".equals(locationStatus)) { |
|
|
|
|
AssingEmptyLocBo assingEmptyLocBo = null; |
|
|
|
|
if (businDataTaskGoodsVos != null && businDataTaskGoodsVos.size()>0) { |
|
|
|
|
String goodsNo = businDataTaskGoodsVos.get(0).getGoodsNo(); |
|
|
|
|
BaseGoodsData baseGoodsData = iBaseGoodsDataService.getBaseGoodsByBarcodes(goodsNo); |
|
|
|
|
assingEmptyLocBo = new AssingEmptyLocBo(); |
|
|
|
|
assingEmptyLocBo.setBusinDataTaskGoodsVos(businDataTaskGoodsVos); |
|
|
|
|
assingEmptyLocBo.setBatch(DateUtils.getDate()); |
|
|
|
|
assingEmptyLocBo.setGoodsNo(goodsNo); |
|
|
|
|
assingEmptyLocBo.setVehicheModel(baseGoodsData.getVehicheModel()); |
|
|
|
|
assingEmptyLocBo.setTunnel(baseLocation.getTunnel()); |
|
|
|
|
} |
|
|
|
|
Result<BaseLocationVo> locationVoResult = this.assignEmptyLocationAll(assingEmptyLocBo,businDataTask.getTunnel()); |
|
|
|
|
if (Result.isOk(locationVoResult)) { |
|
|
|
|
BaseLocationVo baseLocationVo = locationVoResult.getData(); |
|
|
|
|
baseLocation = BeanUtil.toBean(baseLocationVo, BaseLocation.class); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!businDataTask.getLocationId().equals(baseLocation.getId())) { |
|
|
|
|
baseLocation.setLocationStatus("4"); |
|
|
|
|
this.updateById(baseLocation); |
|
|
|
|
businDataTask.setToLayer(baseLocation.getLayer()); |
|
|
|
|
businDataTask.setToColumn(baseLocation.getLocationColumn()); |
|
|
|
|
businDataTask.setToRow(baseLocation.getLocationRow()); |
|
|
|
|
businDataTask.setLocationId(baseLocation.getId()); |
|
|
|
|
log.info("双深位重新分配货位:" + JsonUtil.toJSONString(baseLocation)); |
|
|
|
|
iBusinDataTaskService.updateById(businDataTask); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
String locationStatus = baseLocation.getLocationStatus(); |
|
|
|
|
if ("1".equals(locationStatus) || "2".equals(locationStatus) || "5".equals(locationStatus)) { |
|
|
|
|
log.info("给堆垛机下发任务:" + businDataTask.getId() + " 原货位:" + JsonUtil.toJSONString(baseLocation)); |
|
|
|
|
BaseLocationVo baseLocationVo = this.queryLocationByTunnel(tunnel); |
|
|
|
|
|