diff --git a/shkj-wms/src/main/java/com/shkj/wms/controller/business/BaseBarcodesController.java b/shkj-wms/src/main/java/com/shkj/wms/controller/business/BaseBarcodesController.java index 9a43d7a..a64d687 100644 --- a/shkj-wms/src/main/java/com/shkj/wms/controller/business/BaseBarcodesController.java +++ b/shkj-wms/src/main/java/com/shkj/wms/controller/business/BaseBarcodesController.java @@ -150,7 +150,7 @@ public class BaseBarcodesController extends BaseController { } /** - * + * 手动下发出库任务 * @param vin * @param status * @return diff --git a/shkj-wms/src/main/java/com/shkj/wms/controller/business/BusinBillOutController.java b/shkj-wms/src/main/java/com/shkj/wms/controller/business/BusinBillOutController.java index ac0263c..392b673 100644 --- a/shkj-wms/src/main/java/com/shkj/wms/controller/business/BusinBillOutController.java +++ b/shkj-wms/src/main/java/com/shkj/wms/controller/business/BusinBillOutController.java @@ -17,10 +17,7 @@ import com.shkj.wms.third.ykl.ThirdYklResult; import com.shkj.wms.vo.BusinBillHeadPlanOutVo; import lombok.RequiredArgsConstructor; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import javax.validation.Valid; import java.util.ArrayList; @@ -58,6 +55,19 @@ public class BusinBillOutController extends BaseController { } + /** + * 指定货位出库 + * @param locationCode + * @return + */ + @Log(title = "指定货位出库",businessType = BusinessType.UPDATE) + @PostMapping("/namedLoctionOutput") + @RepeatSubmit + public Result namedLoctionOutput(@Valid @RequestParam String locationCode){ + return businDataTaskService.insertBusinTask(locationCode); + } + + @Log(title = "紧急出库确认出库-方式2",businessType = BusinessType.UPDATE) diff --git a/shkj-wms/src/main/java/com/shkj/wms/enums/TaskTypeEnum.java b/shkj-wms/src/main/java/com/shkj/wms/enums/TaskTypeEnum.java index a359097..2e21630 100644 --- a/shkj-wms/src/main/java/com/shkj/wms/enums/TaskTypeEnum.java +++ b/shkj-wms/src/main/java/com/shkj/wms/enums/TaskTypeEnum.java @@ -107,7 +107,17 @@ public enum TaskTypeEnum { /** * 20.下挂空治具入库 */ - empty_in("20","下挂空治具入库"); + empty_in("20","下挂空治具入库"), + + /** + * 21 待冲孔出立库 + */ + punching_out("21","待冲孔出立库冲孔去"), + + /** + * 指定货位出库 + */ + named_loc("22","指定货位出库"); private String value; diff --git a/shkj-wms/src/main/java/com/shkj/wms/scheduled/ScheduledTasks.java b/shkj-wms/src/main/java/com/shkj/wms/scheduled/ScheduledTasks.java index 5a0787c..c0121e4 100644 --- a/shkj-wms/src/main/java/com/shkj/wms/scheduled/ScheduledTasks.java +++ b/shkj-wms/src/main/java/com/shkj/wms/scheduled/ScheduledTasks.java @@ -229,6 +229,10 @@ public class ScheduledTasks { taskQueryBo.setTaskType("21"); List businDataTaskVo21 = iBusinDataTaskService.selectBusinDataTask1(taskQueryBo); businDataTaskVos.addAll(businDataTaskVo21); + taskQueryBo.setTaskType("22"); + List businDataTaskVo22 = iBusinDataTaskService.selectBusinDataTask1(taskQueryBo); + businDataTaskVos.addAll(businDataTaskVo22); + for (BusinDataTaskVo businDataTaskVo : businDataTaskVos) { doTask(businDataTaskVo); } @@ -536,7 +540,8 @@ public class ScheduledTasks { businDataTaskVo.setDpsNoTwo(stkPlcId); iBusinDataTaskService.updateById(BeanUtil.toBean(businDataTaskVo, BusinDataTask.class)); - } else if (taskType.equals("2")) { + } + else if (taskType.equals("2")) { Long plcId = 0L; Long stkPlcId = 0L; Boolean NUMBER = true; @@ -698,7 +703,8 @@ public class ScheduledTasks { businDataTaskVo.setDpsNoOne(plcId); businDataTaskVo.setDpsNoTwo(stkPlcId); - } else if (taskType.equals("1")) { + } + else if (taskType.equals("1")) { Long plcId = 0L; Long stkPlcId = 0L; Boolean NUMBER = true; @@ -881,7 +887,8 @@ public class ScheduledTasks { businDataTaskVo.setDpsNoOne(plcId); businDataTaskVo.setDpsNoTwo(stkPlcId); - } else if (taskType.equals("3")) { + } + else if (taskType.equals("3")) { Long plcId = 0L; Long stkPlcId = 0L; Boolean NUMBER = true; @@ -1033,14 +1040,15 @@ public class ScheduledTasks { // } businDataTaskVo.setDpsNoOne(plcId); businDataTaskVo.setDpsNoTwo(stkPlcId); - } else if (taskType.equals("4") || taskType.equals("5")) { + } + else if (taskType.equals("4") || taskType.equals("5")) { String randome = null; //出库任务(正常出库、紧急出库) //获取要出库的物料信息 List businDataTaskGoodsVos = iBusinDataTaskGoodsService.getTaskGoodsByTaskCodeForOut(businDataTaskVo.getId()); //拿到按比例分配的库区 -// randome = allocationTasksUtils.randomeout(); + // randome = allocationTasksUtils.randomeout(); //测试时使用 randome = "P01"; //TODO 测试注释 要到开 @@ -1176,7 +1184,8 @@ public class ScheduledTasks { // } } - } else if (taskType.equals("11") || taskType.equals("12")) { + } + else if (taskType.equals("11") || taskType.equals("12")) { String agvno = ""; int AgvType = 0; //空治具流向呼叫agv失败后再次呼叫agv @@ -1247,7 +1256,8 @@ public class ScheduledTasks { // } } } - } else if (taskType.equals("10")) { + } + else if (taskType.equals("10")) { //先判断补货入库是否是一套,如果是入存货区,否则入异常区 List businDataTaskGoodsVos = iBusinDataTaskGoodsService.getTaskGoodsByTaskCodeForOut(businDataTaskVo.getId()); Result baseLocationVoResult = iBaseLocationService.queryById(businDataTaskVo.getLocationId()); @@ -1268,7 +1278,8 @@ public class ScheduledTasks { businDataTaskVo.setExceptionMsg("下发堆垛机指令失败"); businDataTaskVo.setTaskStatus(TaskStatusEnum.err.getValue()); } - } else if (taskType.equals(TaskTypeEnum.abnormal_delivery.getValue())) { + } + else if (taskType.equals(TaskTypeEnum.abnormal_delivery.getValue())) { //异常出库 //异常区货位 Long abnormalArea = Long.valueOf(sysParameterService.selectConfigByKey(ParameterConstants.ParameterSystem.abnormal_area)); @@ -1390,9 +1401,9 @@ public class ScheduledTasks { boolean b = iBusinDataTaskGoodsService.saveOrUpdateBatch(goods); - } else if (taskType.equals(TaskTypeEnum.punching_delivery.getValue())) { - - } else if (taskType.equals(TaskTypeEnum.replenished_in.getValue())) { + } + else if (taskType.equals(TaskTypeEnum.punching_delivery.getValue())) {} + else if (taskType.equals(TaskTypeEnum.replenished_in.getValue())) { String agvno = null; if (businDataTaskVo.getTaskPath().contains("manMade")) { List agvtaskType = new ArrayList(); @@ -1418,7 +1429,8 @@ public class ScheduledTasks { iBusinDataTaskService.runReplenishIn(businDataTaskVo, agvno); Result booleanResult = iPutInOutStorageService.reduceInventory(taskId, goodsNoStr); - } else if (taskType.equals("21")) { + } + else if (taskType.equals("21")) { // 冲孔出库 //待冲孔区货位 Long abnormalArea = Long.valueOf(sysParameterService.selectConfigByKey(ParameterConstants.ParameterSystem.punching_area)); @@ -1542,6 +1554,25 @@ public class ScheduledTasks { businDataTaskVo.setTaskStatus("-3"); } } + else if (taskType.equals("22")){ + BusinDataTask businDataTask = iBusinDataTaskService.getById(businDataTaskVo.getId()); + Result taskResult = outTask(businDataTask); + if (Result.isOk(taskResult)) { + businDataTask.setTaskStatus(TaskStatusEnum.wait_callback.getValue()); + if (ObjectUtils.isEmpty(redisTemplate.opsForValue().get("outbound:" + businDataTask.getId()))) { + redisTemplate.opsForValue().set("outbound:" + businDataTask.getId(), businDataTask.toString()); + } + } else { + if (ObjectUtils.isEmpty(redisTemplate.opsForValue().get("outbound:" + businDataTask.getId()))) { + businDataTask.setExceptionMsg("下发堆垛机失败"); + businDataTask.setTaskStatus(TaskStatusEnum.err.getValue()); + } else { + businDataTask.setExceptionMsg("已经下发堆垛机"); + businDataTask.setTaskStatus("-3"); + } + } + + } log.info("任务号" + businDataTaskVo.getId() + "任务状态" + businDataTaskVo.getTaskStatus() + "点位信息" + businDataTaskVo.getPoints()); //统一提交任务数据 iBusinDataTaskService.saveOrUpdate(BeanUtil.toBean(businDataTaskVo, BusinDataTask.class)); diff --git a/shkj-wms/src/main/java/com/shkj/wms/service/IBaseBarcodesOutService.java b/shkj-wms/src/main/java/com/shkj/wms/service/IBaseBarcodesOutService.java index c8098c0..84ff4de 100644 --- a/shkj-wms/src/main/java/com/shkj/wms/service/IBaseBarcodesOutService.java +++ b/shkj-wms/src/main/java/com/shkj/wms/service/IBaseBarcodesOutService.java @@ -79,7 +79,7 @@ public interface IBaseBarcodesOutService extends IService { Result handMoveOutboundInfoTask(BaseBarcodesOutQueryBo bo); /** - * + * 手动下发出库任务 * @author Comair * @date 2023/7/27 11:14 * @param vin @@ -113,7 +113,7 @@ public interface IBaseBarcodesOutService extends IService { Result handMoveOutboundInfoTaskForCancel(BaseBarcodesOutQueryBo bo); /** - * + * * @author Comair * @date 2023/8/29 15:19 * @return java.util.List> diff --git a/shkj-wms/src/main/java/com/shkj/wms/service/IBusinDataTaskService.java b/shkj-wms/src/main/java/com/shkj/wms/service/IBusinDataTaskService.java index c262ad1..e2d9bb0 100644 --- a/shkj-wms/src/main/java/com/shkj/wms/service/IBusinDataTaskService.java +++ b/shkj-wms/src/main/java/com/shkj/wms/service/IBusinDataTaskService.java @@ -37,6 +37,13 @@ public interface IBusinDataTaskService extends IService { */ Result insertBusinTaskByDervie(List baseGoodsDervieBos); + /** + * 指定货位出库 + * @param locationCode + * @return + */ + Result insertBusinTask(String locationCode); + /** *人工入库点位 */ @@ -155,7 +162,7 @@ public interface IBusinDataTaskService extends IService { /** * 可视化大屏统计出入任务数量 - * @param bo + * @param * @return */ List getCurDateTaskQty(); diff --git a/shkj-wms/src/main/java/com/shkj/wms/service/ISysStockService.java b/shkj-wms/src/main/java/com/shkj/wms/service/ISysStockService.java index 13a95bc..185d841 100644 --- a/shkj-wms/src/main/java/com/shkj/wms/service/ISysStockService.java +++ b/shkj-wms/src/main/java/com/shkj/wms/service/ISysStockService.java @@ -106,4 +106,7 @@ public interface ISysStockService extends IService { Map> getVehicheStockList(); + List queryStockDetailList(SysStockNumQueryBo bo); + + } 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 d6beb4f..ac6c7c4 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 @@ -498,7 +498,114 @@ public class BusinDataTaskServiceImpl extends ServiceImpl insertBusinTask(String locationCode){ + /** + * 1.查询当前货位是不是有库存 + * 2、查询当前货位是不是双深位,如果是,则查询单深位是否有货,如果有货,则提示不可出库 + * 3.生成相关任务,预占出库库存 + * 4. + */ + + BaseLocationVo baseLocationVo = iBaseLocationService.queryLocationByCode(locationCode); + if (baseLocationVo == null){ + return Result.err().msg("未查询到货位信息,请确认!"+locationCode); + } + if (baseLocationVo.getLocationStatus().equals("4") || baseLocationVo.getLocationStatus().equals("0")){ + return Result.err().msg("此货位出库中或已出库,请确认!"+locationCode+" 库位状态:"+baseLocationVo.getLocationStatus()); + } + List sysStockDetailVoList =null; + //查询指定出库的货位是不是双深位,如果是,则查询但深位是否有库存 + if (baseLocationVo.getIsDeep().equals("2")){ + String locationRow = baseLocationVo.getLocationRow(); + String locationColumn = baseLocationVo.getLocationColumn(); + String layer = baseLocationVo.getLayer(); + if (locationRow.equals("1")){ + locationRow="2"; + }else if (locationRow.equals("4")){ + locationRow="3"; + }else if (locationRow.equals("16")){ + locationRow="15"; + } + BaseLocation one = iBaseLocationService.getOne(new LambdaQueryWrapper() + .eq(BaseLocation::getLocationRow, locationRow) + .eq(BaseLocation::getLocationColumn, locationColumn) + .eq(BaseLocation::getLayer, layer)); + Result> stockListResult = iSysStockDetailService.queryByLocation(one.getId()); + if (Result.isOk(stockListResult)){ + sysStockDetailVoList = stockListResult.getData(); + if (sysStockDetailVoList != null && sysStockDetailVoList.size() !=0 ){ + return Result.err().msg("指定出库货位是双深位,单深位有货,不可出库"+locationCode); + } + } + } + + //确认出库的货位是否有库存信息 + Result> stockListResult = iSysStockDetailService.queryByLocation(baseLocationVo.getId()); + if (Result.isOk(stockListResult)){ + sysStockDetailVoList = stockListResult.getData(); + if (sysStockDetailVoList == null && sysStockDetailVoList.size() ==0 ){ + return Result.err().msg("此货位未查询到保险杠信息,请确认!"+locationCode); + } + } + //预占库存 + baseLocationVo.setLocationStatus("4"); + BaseLocation baseLocation = BeanUtil.toBean(baseLocationVo, BaseLocation.class); + iBaseLocationService.updateById(baseLocation); + + //需要搬运到的码头信息 + String taskPath ="KW30"; + //生成作业任务 + int index=0; + List taskGoodsList = new ArrayList<>(); + List sysStockDetails = new ArrayList<>(); + for (SysStockDetailVo sysStockDetailVo : sysStockDetailVoList) { + Long taskId=0L; + if(index ==0) { + BusinDataTask task = new BusinDataTask(); + task.setTaskType(TaskTypeEnum.named_loc.getValue()); + task.setPriority("2"); + task.setIsTop("0"); + task.setBatch(sysStockDetailVo.getBatch()); + task.setTaskStatus(TaskStatusEnum.wait_put.getValue()); + task.setIsUrgent("0"); + task.setCreateTime(DateUtils.getNowDate()); + task.setTaskPath(taskPath); + task.setDistinction("1"); + task.setContainerId(sysStockDetailVo.getContainerCode()); + task.setFromRow(baseLocationVo.getLocationRow()); + task.setFromLayer(baseLocationVo.getLayer()); + task.setFromColumn(baseLocationVo.getLocationColumn()); + task.setTunnel(baseLocationVo.getTunnel()); + businDataTaskMapper.insertBusinDataTask(task); + taskId = task.getId(); + index++; + } + + //保险杠信息 + BusinDataTaskGoods taskGoods = new BusinDataTaskGoods(); + taskGoods.setGoodsNo(sysStockDetailVo.getGoodsNo()); + taskGoods.setTaskCode(taskId); + taskGoods.setIsPunching(sysStockDetailVo.getIsPuch()); + taskGoods.setBranchId(SecurityUtils.getCurrentBranchId()); + taskGoodsList.add(taskGoods); + + //出库预占 + sysStockDetailVo.setOutQty(sysStockDetailVo.getQty().intValue()); + SysStockDetail sysStockDetail = BeanUtil.toBean(sysStockDetailVo, SysStockDetail.class); + sysStockDetail.setOutTime(DateUtils.getNowDate()); + sysStockDetails.add(sysStockDetail); + } + iSysStockDetailService.updateBatchById(sysStockDetails); + return iBusinDataTaskGoodsService.saveBatch(taskGoodsList)?Result.ok():Result.err().msg("指定货位出库失败"); + } @Override public Result getManualWarehousingPoint() { diff --git a/shkj-wms/src/main/java/com/shkj/wms/service/impl/PutInOutStorageServiceImpl.java b/shkj-wms/src/main/java/com/shkj/wms/service/impl/PutInOutStorageServiceImpl.java index 268fb58..6e6066a 100644 --- a/shkj-wms/src/main/java/com/shkj/wms/service/impl/PutInOutStorageServiceImpl.java +++ b/shkj-wms/src/main/java/com/shkj/wms/service/impl/PutInOutStorageServiceImpl.java @@ -1053,6 +1053,8 @@ public class PutInOutStorageServiceImpl extends ServiceImpl0?Result.ok():Result.err();