From 08a9a3d10cfc3bea4d81dccbc66293b0b8323a10 Mon Sep 17 00:00:00 2001 From: Comair <1464848666@qq.com> Date: Sat, 3 Aug 2024 09:29:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A3=80=E6=9F=A5=E5=8F=8C=E6=B7=B1=E4=BD=8D?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E6=9C=89=E8=B4=A7=EF=BC=8C=E5=85=88=E6=A3=80?= =?UTF-8?q?=E6=9F=A5=E5=8D=95=E6=B7=B1=E4=BD=8D=E6=98=AF=E5=90=A6=E6=9C=89?= =?UTF-8?q?=E8=B4=A7=EF=BC=8C=E6=9C=89=E8=B4=A7=E5=88=99=E9=87=8D=E6=96=B0?= =?UTF-8?q?=E5=88=86=E9=85=8D=E8=B4=A7=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/BaseLocationServiceImpl.java | 75 ++++++++++++++++--- 1 file changed, 63 insertions(+), 12 deletions(-) diff --git a/shkj-wms/src/main/java/com/shkj/wms/service/impl/BaseLocationServiceImpl.java b/shkj-wms/src/main/java/com/shkj/wms/service/impl/BaseLocationServiceImpl.java index 999410c..c42b430 100644 --- a/shkj-wms/src/main/java/com/shkj/wms/service/impl/BaseLocationServiceImpl.java +++ b/shkj-wms/src/main/java/com/shkj/wms/service/impl/BaseLocationServiceImpl.java @@ -178,7 +178,7 @@ public class BaseLocationServiceImpl extends ServiceImpl wrapper = new LambdaQueryWrapper().in(BaseLocation::getId, ids) .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 assignEmptyLocationAll(AssingEmptyLocBo assingEmptyLocBo,String lcoatinTunnel) { + public synchronized Result assignEmptyLocationAll(AssingEmptyLocBo assingEmptyLocBo, String lcoatinTunnel) { BaseLocationVo locationVo = null; //bo等于空时,是空治具分配货位,否则是保险杠分配货位 if (assingEmptyLocBo == null) { @@ -912,7 +912,7 @@ public class BaseLocationServiceImpl extends ServiceImpl baseLocationVos = this.baseMapper.queryBaseLocationListByGoods(bo); - if (StringUtils.isEmpty(assingEmptyLocBo.getTunnel())){ + if (StringUtils.isEmpty(assingEmptyLocBo.getTunnel())) { if (baseLocationVos.size() == 0) { //查看缓冲区是否还有货位 Long bufferArea = Long.valueOf(sysParameterService.selectConfigByKey(ParameterConstants.ParameterSystem.buffer_area)); @@ -1313,9 +1313,11 @@ public class BaseLocationServiceImpl extends ServiceImpl0) { + if (businDataTaskGoodsVos != null && businDataTaskGoodsVos.size() > 0) { //判断与双深位的保险杠是否一样 long count = sysStockDetailVoList.stream().filter(val -> businDataTaskGoodsVos.stream().anyMatch(o -> Objects.equals(val.getGoodsNo(), o.getGoodsNo()))).count(); if (count == 0) { @@ -1348,7 +1350,7 @@ public class BaseLocationServiceImpl extends ServiceImpl locationVoResult = this.assignEmptyLocationAll(assingEmptyLocBo,null); + Result locationVoResult = this.assignEmptyLocationAll(assingEmptyLocBo, null); if (Result.isOk(locationVoResult)) { BaseLocationVo baseLocationVo = locationVoResult.getData(); baseLocation = BeanUtil.toBean(baseLocationVo, BaseLocation.class); @@ -1359,7 +1361,7 @@ public class BaseLocationServiceImpl extends ServiceImpl locationVoResult = this.assignEmptyLocationAll(assingEmptyLocBo,businDataTask.getTunnel()); + Result locationVoResult = this.assignEmptyLocationAll(assingEmptyLocBo, businDataTask.getTunnel()); if (Result.isOk(locationVoResult)) { BaseLocationVo baseLocationVo = locationVoResult.getData(); baseLocation = BeanUtil.toBean(baseLocationVo, BaseLocation.class); @@ -1367,11 +1369,60 @@ public class BaseLocationServiceImpl extends ServiceImpl() + .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 locationVoResult = this.assignEmptyLocationAll(assingEmptyLocBo, null); + if (Result.isOk(locationVoResult)) { + BaseLocationVo baseLocationVo = locationVoResult.getData(); + baseLocation = BeanUtil.toBean(baseLocationVo, BaseLocation.class); + } + } else { + //无数据是空托,重新分配货位 + AssingEmptyLocBo assingEmptyLocBo = null; + Result 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")) { if ("1".equals(locationStatus) || "2".equals(locationStatus) || "5".equals(locationStatus)) { AssingEmptyLocBo assingEmptyLocBo = null; - if (businDataTaskGoodsVos != null && businDataTaskGoodsVos.size()>0) { + if (businDataTaskGoodsVos != null && businDataTaskGoodsVos.size() > 0) { String goodsNo = businDataTaskGoodsVos.get(0).getGoodsNo(); BaseGoodsData baseGoodsData = iBaseGoodsDataService.getBaseGoodsByBarcodes(goodsNo); assingEmptyLocBo = new AssingEmptyLocBo(); @@ -1381,7 +1432,7 @@ public class BaseLocationServiceImpl extends ServiceImpl locationVoResult = this.assignEmptyLocationAll(assingEmptyLocBo,businDataTask.getTunnel()); + Result locationVoResult = this.assignEmptyLocationAll(assingEmptyLocBo, businDataTask.getTunnel()); if (Result.isOk(locationVoResult)) { BaseLocationVo baseLocationVo = locationVoResult.getData(); baseLocation = BeanUtil.toBean(baseLocationVo, BaseLocation.class);