检查双深位是否有货,先检查单深位是否有货,有货则重新分配货位

main
Comair 1 year ago
parent 44f7a0abb9
commit 08a9a3d10c
  1. 71
      shkj-wms/src/main/java/com/shkj/wms/service/impl/BaseLocationServiceImpl.java

@ -178,7 +178,7 @@ public class BaseLocationServiceImpl extends ServiceImpl<BaseLocationMapper, Bas
} }
LambdaQueryWrapper<BaseLocation> wrapper = new LambdaQueryWrapper<BaseLocation>().in(BaseLocation::getId, ids) LambdaQueryWrapper<BaseLocation> wrapper = new LambdaQueryWrapper<BaseLocation>().in(BaseLocation::getId, ids)
.eq(BaseLocation::getBranchId, SecurityUtils.getCurrentBranchId()); .eq(BaseLocation::getBranchId, SecurityUtils.getCurrentBranchId());
return this.update(del, wrapper)==true ?Result.ok().msg("启用/禁用货位成功"):Result.err().msg("启用/禁用货位失败"); return this.update(del, wrapper) == true ? Result.ok().msg("启用/禁用货位成功") : Result.err().msg("启用/禁用货位失败");
} }
@ -815,7 +815,7 @@ public class BaseLocationServiceImpl extends ServiceImpl<BaseLocationMapper, Bas
@Override @Override
public synchronized Result<BaseLocationVo> assignEmptyLocationAll(AssingEmptyLocBo assingEmptyLocBo,String lcoatinTunnel) { public synchronized Result<BaseLocationVo> assignEmptyLocationAll(AssingEmptyLocBo assingEmptyLocBo, String lcoatinTunnel) {
BaseLocationVo locationVo = null; BaseLocationVo locationVo = null;
//bo等于空时,是空治具分配货位,否则是保险杠分配货位 //bo等于空时,是空治具分配货位,否则是保险杠分配货位
if (assingEmptyLocBo == null) { if (assingEmptyLocBo == null) {
@ -912,7 +912,7 @@ public class BaseLocationServiceImpl extends ServiceImpl<BaseLocationMapper, Bas
bo.setTunnel(assingEmptyLocBo.getTunnel()); bo.setTunnel(assingEmptyLocBo.getTunnel());
log.info("保险杠分配货位查询条件:" + JsonUtil.toJSONString(bo)); log.info("保险杠分配货位查询条件:" + JsonUtil.toJSONString(bo));
List<BaseLocationVo> baseLocationVos = this.baseMapper.queryBaseLocationListByGoods(bo); List<BaseLocationVo> baseLocationVos = this.baseMapper.queryBaseLocationListByGoods(bo);
if (StringUtils.isEmpty(assingEmptyLocBo.getTunnel())){ if (StringUtils.isEmpty(assingEmptyLocBo.getTunnel())) {
if (baseLocationVos.size() == 0) { if (baseLocationVos.size() == 0) {
//查看缓冲区是否还有货位 //查看缓冲区是否还有货位
Long bufferArea = Long.valueOf(sysParameterService.selectConfigByKey(ParameterConstants.ParameterSystem.buffer_area)); Long bufferArea = Long.valueOf(sysParameterService.selectConfigByKey(ParameterConstants.ParameterSystem.buffer_area));
@ -1313,9 +1313,11 @@ public class BaseLocationServiceImpl extends ServiceImpl<BaseLocationMapper, Bas
if ("01".equals(tunnel) || "06".equals(tunnel)) { if ("01".equals(tunnel) || "06".equals(tunnel)) {
//如果是单深位,验证下双深位的是否有库存,如果有在判断车型颜色是否一致 //如果是单深位,验证下双深位的是否有库存,如果有在判断车型颜色是否一致
String locationRow = baseLocation.getLocationRow(); String locationRow = baseLocation.getLocationRow();
if ("2".equals(locationRow) || "3".equals(locationRow) || "14".equals(locationRow)) {
String locationColumn = baseLocation.getLocationColumn(); String locationColumn = baseLocation.getLocationColumn();
String layer = baseLocation.getLayer(); String layer = baseLocation.getLayer();
if ("2".equals(locationRow) || "3".equals(locationRow) || "14".equals(locationRow)) {
if (locationRow.equals("2")) { if (locationRow.equals("2")) {
locationRow = "1"; locationRow = "1";
} else if (locationRow.equals("3")) { } else if (locationRow.equals("3")) {
@ -1335,7 +1337,7 @@ public class BaseLocationServiceImpl extends ServiceImpl<BaseLocationMapper, Bas
baseLocation = doubleLocation; baseLocation = doubleLocation;
} else { } else {
//双深位有库存,当前任务是保险杠时,判断保险杠是否一样 //双深位有库存,当前任务是保险杠时,判断保险杠是否一样
if (businDataTaskGoodsVos != null && businDataTaskGoodsVos.size()>0) { if (businDataTaskGoodsVos != null && businDataTaskGoodsVos.size() > 0) {
//判断与双深位的保险杠是否一样 //判断与双深位的保险杠是否一样
long count = sysStockDetailVoList.stream().filter(val -> businDataTaskGoodsVos.stream().anyMatch(o -> Objects.equals(val.getGoodsNo(), o.getGoodsNo()))).count(); long count = sysStockDetailVoList.stream().filter(val -> businDataTaskGoodsVos.stream().anyMatch(o -> Objects.equals(val.getGoodsNo(), o.getGoodsNo()))).count();
if (count == 0) { if (count == 0) {
@ -1348,7 +1350,7 @@ public class BaseLocationServiceImpl extends ServiceImpl<BaseLocationMapper, Bas
assingEmptyLocBo.setGoodsNo(goodsNo); assingEmptyLocBo.setGoodsNo(goodsNo);
assingEmptyLocBo.setVehicheModel(baseGoodsData.getVehicheModel()); assingEmptyLocBo.setVehicheModel(baseGoodsData.getVehicheModel());
assingEmptyLocBo.setTunnel(baseLocation.getTunnel()); assingEmptyLocBo.setTunnel(baseLocation.getTunnel());
Result<BaseLocationVo> locationVoResult = this.assignEmptyLocationAll(assingEmptyLocBo,null); Result<BaseLocationVo> locationVoResult = this.assignEmptyLocationAll(assingEmptyLocBo, null);
if (Result.isOk(locationVoResult)) { if (Result.isOk(locationVoResult)) {
BaseLocationVo baseLocationVo = locationVoResult.getData(); BaseLocationVo baseLocationVo = locationVoResult.getData();
baseLocation = BeanUtil.toBean(baseLocationVo, BaseLocation.class); baseLocation = BeanUtil.toBean(baseLocationVo, BaseLocation.class);
@ -1359,7 +1361,7 @@ public class BaseLocationServiceImpl extends ServiceImpl<BaseLocationMapper, Bas
String goodsNo = sysStockDetailVoList.get(0).getGoodsNo(); String goodsNo = sysStockDetailVoList.get(0).getGoodsNo();
if (goodsNo != null) { if (goodsNo != null) {
AssingEmptyLocBo assingEmptyLocBo = null; AssingEmptyLocBo assingEmptyLocBo = null;
Result<BaseLocationVo> locationVoResult = this.assignEmptyLocationAll(assingEmptyLocBo,businDataTask.getTunnel()); Result<BaseLocationVo> locationVoResult = this.assignEmptyLocationAll(assingEmptyLocBo, businDataTask.getTunnel());
if (Result.isOk(locationVoResult)) { if (Result.isOk(locationVoResult)) {
BaseLocationVo baseLocationVo = locationVoResult.getData(); BaseLocationVo baseLocationVo = locationVoResult.getData();
baseLocation = BeanUtil.toBean(baseLocationVo, BaseLocation.class); baseLocation = BeanUtil.toBean(baseLocationVo, BaseLocation.class);
@ -1367,11 +1369,60 @@ public class BaseLocationServiceImpl extends ServiceImpl<BaseLocationMapper, Bas
} }
} }
} }
} else if ("1".equals(locationRow) || "4".equals(locationRow) || "15".equals(locationRow)) {
//检查单深位是否有货
if (locationRow.equals("1")) {
locationRow = "2";
} else if (locationRow.equals("4")) {
locationRow = "3";
} else if (locationRow.equals("15")) {
locationRow = "14";
}
BaseLocation oneLocation = this.getOne(new LambdaQueryWrapper<BaseLocation>()
.eq(BaseLocation::getLocationRow, locationRow)
.eq(BaseLocation::getLocationColumn, locationColumn)
.eq(BaseLocation::getLayer, layer));
String oneLocationStatus = oneLocation.getLocationStatus();
Boolean checkLoc = false;
if (oneLocationStatus.equals("1") || oneLocationStatus.equals("2") || oneLocationStatus.equals("5")) {
//入库货位是双深位,单深位有货,重新分配货位
checkLoc = true;
}
if (locationStatus.equals("1") || locationStatus.equals("2") || locationStatus.equals("5")) {
//入库是双深位时,此货位有货,重新分配货位
checkLoc = true;
}
if (checkLoc) {
if (businDataTaskGoodsVos != null && businDataTaskGoodsVos.size() > 0) {
String goodsNo = businDataTaskGoodsVos.get(0).getGoodsNo();
BaseGoodsData baseGoodsData = iBaseGoodsDataService.getBaseGoodsByBarcodes(goodsNo);
AssingEmptyLocBo 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, null);
if (Result.isOk(locationVoResult)) {
BaseLocationVo baseLocationVo = locationVoResult.getData();
baseLocation = BeanUtil.toBean(baseLocationVo, BaseLocation.class);
}
} else {
//无数据是空托,重新分配货位
AssingEmptyLocBo assingEmptyLocBo = null;
Result<BaseLocationVo> locationVoResult = this.assignEmptyLocationAll(assingEmptyLocBo, businDataTask.getTunnel());
if (Result.isOk(locationVoResult)) {
BaseLocationVo baseLocationVo = locationVoResult.getData();
baseLocation = BeanUtil.toBean(baseLocationVo, BaseLocation.class);
}
}
} }
else if (tunnel.equals("06") && locationRow.equals("13")){ } else if (tunnel.equals("06") && locationRow.equals("13")) {
if ("1".equals(locationStatus) || "2".equals(locationStatus) || "5".equals(locationStatus)) { if ("1".equals(locationStatus) || "2".equals(locationStatus) || "5".equals(locationStatus)) {
AssingEmptyLocBo assingEmptyLocBo = null; AssingEmptyLocBo assingEmptyLocBo = null;
if (businDataTaskGoodsVos != null && businDataTaskGoodsVos.size()>0) { if (businDataTaskGoodsVos != null && businDataTaskGoodsVos.size() > 0) {
String goodsNo = businDataTaskGoodsVos.get(0).getGoodsNo(); String goodsNo = businDataTaskGoodsVos.get(0).getGoodsNo();
BaseGoodsData baseGoodsData = iBaseGoodsDataService.getBaseGoodsByBarcodes(goodsNo); BaseGoodsData baseGoodsData = iBaseGoodsDataService.getBaseGoodsByBarcodes(goodsNo);
assingEmptyLocBo = new AssingEmptyLocBo(); assingEmptyLocBo = new AssingEmptyLocBo();
@ -1381,7 +1432,7 @@ public class BaseLocationServiceImpl extends ServiceImpl<BaseLocationMapper, Bas
assingEmptyLocBo.setVehicheModel(baseGoodsData.getVehicheModel()); assingEmptyLocBo.setVehicheModel(baseGoodsData.getVehicheModel());
assingEmptyLocBo.setTunnel(baseLocation.getTunnel()); assingEmptyLocBo.setTunnel(baseLocation.getTunnel());
} }
Result<BaseLocationVo> locationVoResult = this.assignEmptyLocationAll(assingEmptyLocBo,businDataTask.getTunnel()); Result<BaseLocationVo> locationVoResult = this.assignEmptyLocationAll(assingEmptyLocBo, businDataTask.getTunnel());
if (Result.isOk(locationVoResult)) { if (Result.isOk(locationVoResult)) {
BaseLocationVo baseLocationVo = locationVoResult.getData(); BaseLocationVo baseLocationVo = locationVoResult.getData();
baseLocation = BeanUtil.toBean(baseLocationVo, BaseLocation.class); baseLocation = BeanUtil.toBean(baseLocationVo, BaseLocation.class);

Loading…
Cancel
Save