diff --git a/shkj-wms/src/main/java/com/shkj/wms/service/impl/BaseBarcodesOutServiceImpl.java b/shkj-wms/src/main/java/com/shkj/wms/service/impl/BaseBarcodesOutServiceImpl.java index 830048b..8b9029f 100644 --- a/shkj-wms/src/main/java/com/shkj/wms/service/impl/BaseBarcodesOutServiceImpl.java +++ b/shkj-wms/src/main/java/com/shkj/wms/service/impl/BaseBarcodesOutServiceImpl.java @@ -173,7 +173,7 @@ public class BaseBarcodesOutServiceImpl extends ServiceImpl 0) { 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 c281d6d..8e6610a 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,8 +178,7 @@ public class BaseLocationServiceImpl extends ServiceImpl wrapper = new LambdaQueryWrapper().in(BaseLocation::getId, ids) .eq(BaseLocation::getBranchId, SecurityUtils.getCurrentBranchId()); - this.update(del, wrapper); - return Result.ok(); + return this.update(del, wrapper)==true ?Result.ok().msg("启用/禁用货位成功"):Result.err().msg("启用/禁用货位失败"); } diff --git a/shkj-wms/src/main/java/com/shkj/wms/service/impl/BusinDataTaskServiceImpl.java b/shkj-wms/src/main/java/com/shkj/wms/service/impl/BusinDataTaskServiceImpl.java index e8c7ff3..af0f979 100644 --- a/shkj-wms/src/main/java/com/shkj/wms/service/impl/BusinDataTaskServiceImpl.java +++ b/shkj-wms/src/main/java/com/shkj/wms/service/impl/BusinDataTaskServiceImpl.java @@ -1936,81 +1936,26 @@ public class BusinDataTaskServiceImpl extends ServiceImpl deepStockDetailVos = iSysStockDetailService.queryList(stockDetailQueryBo); - - /* if (deepStockDetailVos.size() ==1 && sysStockDetailVos.size()==0){ - SysStockDetailVo deepStockDetailVo = deepStockDetailVos.get(0); - SysStockDetailVo sysStockDetailVo = sysStockDetailVos.get(0); - String deepGoodsNo = deepStockDetailVo.getGoodsNo(); - String outGoodsNo = sysStockDetailVo.getGoodsNo(); - if (deepGoodsNo !=null && outGoodsNo !=null){ - if (deepGoodsNo!= sysStockDetailVo.getGoodsNo()){ - return Result.err().msg("移入的货位双深位货物不同,不可移入"); - } - }else if (deepGoodsNo == null && outGoodsNo !=null){ - return Result.err().msg("移入的货位双深位是空托,移入的是保险杠"); - }else if (deepGoodsNo != null && outGoodsNo ==null){ - return Result.err().msg("移入的货位双深位是保险杠,移入的是空托"); - } - }else { - long count = deepStockDetailVos.stream().filter(val -> sysStockDetailVos.stream().anyMatch(instock -> Objects.equals(val.getGoodsNo(), instock.getGoodsNo()))).count(); - if (count<1){ - return Result.err().msg("移入的货位双深位货物不同,不可移入"); - } - }*/ - } + return booleanResult; } - //获取出库堆垛机 - BasePointDeviceQueryBo pointDeviceQueryBo = new BasePointDeviceQueryBo(); - pointDeviceQueryBo.setDevType("1"); - pointDeviceQueryBo.setTunnel(outBaseLocation.getTunnel()); - BaseDevicePlcVo baseDevicePlcVo = baseLocationPlcMapper.selectBaseDevicePlc(pointDeviceQueryBo); - Long stkPlcId = baseDevicePlcVo.getPlcId(); - - - //记录货位调整前的货位状态 inBaseLocation.setExtend1(outBaseLocation.getLocationStatus()); @@ -2023,23 +1968,19 @@ public class BusinDataTaskServiceImpl extends ServiceImpl taskGoodsList = new ArrayList<>(); - List sysStockDetails = new ArrayList<>(); + String inTunnel = inBaseLocation.getTunnel(); + String locationColumn = inBaseLocation.getLocationColumn(); + String layer = inBaseLocation.getLayer(); + String locationRow = inBaseLocation.getLocationRow(); + String tunnel = inBaseLocation.getTunnel(); - String inTunnel = tunnel; String outTunnel = outBaseLocation.getTunnel(); BusinDataTask dataTaskAdd = new BusinDataTask(); BusinDataTask dataTaskOut = new BusinDataTask(); BusinDataTask dataTaskIn = new BusinDataTask(); if (!inTunnel.equals(outTunnel)) { - - //获取出库堆垛机 - pointDeviceQueryBo = new BasePointDeviceQueryBo(); - pointDeviceQueryBo.setDevType("1"); - pointDeviceQueryBo.setTunnel(inBaseLocation.getTunnel()); - baseDevicePlcVo = baseLocationPlcMapper.selectBaseDevicePlc(pointDeviceQueryBo); - Long inStkPlcId = baseDevicePlcVo.getPlcId(); //移出任务 dataTaskOut.setTaskStatus("0"); dataTaskOut.setBatch(DateUtils.getDate()); @@ -2051,7 +1992,6 @@ public class BusinDataTaskServiceImpl extends ServiceImpl sysStockDetailVoList = iSysStockDetailService.queryByLocation(one.getId()); if (sysStockDetailVoList != null && sysStockDetailVoList.size() != 0) { - return Result.err().msg("出入库货位是双深位,单深位有货,不可出入库" + baseLocationVo.getLocationCode()); + return Result.err().msg("出库货位是双深位,单深位有货,不可出库" + baseLocationVo.getLocationCode()); } - } return Result.ok().msg("单深位"); } + + + public Result checkDoubleLocation(BaseLocation outLocation ,BaseLocation inLocation){ + String tunnel = inLocation.getTunnel(); + if ("01".equals(tunnel) || "06".equals(tunnel)) { + //如果是单深位,验证下双深位的是否有库存,如果有在判断车型颜色是否一致 + String locationRow = inLocation.getLocationRow(); + if ("2".equals(locationRow) || "3".equals(locationRow) || "14".equals(locationRow)) { + String locationColumn = inLocation.getLocationColumn(); + String layer = inLocation.getLayer(); + if (locationRow.equals("2")) { + locationRow = "1"; + } else if (locationRow.equals("3")) { + locationRow = "4"; + } else if (locationRow.equals("14")) { + locationRow = "15"; + } + BaseLocation doubleLocation = iBaseLocationService.getOne(new LambdaQueryWrapper() + .eq(BaseLocation::getLocationRow, locationRow) + .eq(BaseLocation::getLocationColumn, locationColumn) + .eq(BaseLocation::getLayer, layer)); + //双深位库存 + List sysStockDetailVoList = iSysStockDetailService.queryByLocation(doubleLocation.getId()); + + //移入的库存 + List outSysStockDetailVoList = iSysStockDetailService.queryByLocation(outLocation.getId()); + + //双深位无库存 + if (sysStockDetailVoList != null && sysStockDetailVoList.size() == 0) { + //移入的货位双深位无库存,不可移入单深位 + return Result.err().msg("移入的货位双深位无库存,不可移入单深位:"+ inLocation.getLocationCode()); + } else { + //判断移入的货位是单深位时,判断双深位的库存品规是否一样 + if (outSysStockDetailVoList != null && outSysStockDetailVoList.size()>0) { + long count = sysStockDetailVoList.stream().filter(val -> outSysStockDetailVoList.stream().anyMatch(o -> Objects.equals(val.getGoodsNo(), o.getGoodsNo()))).count(); + if (count == 0) { + //品规不一样,不允许移入 + return Result.err().msg("移入的货位双深位有库存,品规不一样:"+ inLocation.getLocationCode()); + } + } + } + } + } + return Result.ok(); + } } diff --git a/shkj-wms/src/main/resources/mapper/wms/SysStockMapper.xml b/shkj-wms/src/main/resources/mapper/wms/SysStockMapper.xml index 38e46d5..0b6c0c6 100644 --- a/shkj-wms/src/main/resources/mapper/wms/SysStockMapper.xml +++ b/shkj-wms/src/main/resources/mapper/wms/SysStockMapper.xml @@ -201,11 +201,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" stock.batch, loc.is_del FROM - sys_stock_detail stock + base_location loc + LEFT JOIN sys_stock_detail stock ON loc.id = stock.location_id LEFT JOIN base_goods_data item ON stock.goods_no = item.goods_no - LEFT JOIN base_location loc ON loc.id = stock.location_id LEFT JOIN base_container con ON stock.container_code = con.id - LEFT JOIN base_branch branch ON branch.id = stock.branch_id and loc.layer= #{layer}