diff --git a/ant-design-vue-jeecg/src/views/system/task/ReceiptTaskHeaderList.vue b/ant-design-vue-jeecg/src/views/system/task/ReceiptTaskHeaderList.vue index 6a48770..280f5e4 100644 --- a/ant-design-vue-jeecg/src/views/system/task/ReceiptTaskHeaderList.vue +++ b/ant-design-vue-jeecg/src/views/system/task/ReceiptTaskHeaderList.vue @@ -261,7 +261,7 @@ export default { dataIndex: 'status_dictText', }, { - title: '是否重入', + title: '重入', align: "center", dataIndex: 'isDoubleIn_dictText', }, diff --git a/ant-design-vue-jeecg/src/views/system/task/ShipmentTaskHeaderList.vue b/ant-design-vue-jeecg/src/views/system/task/ShipmentTaskHeaderList.vue index fe6ef5c..ba9b916 100644 --- a/ant-design-vue-jeecg/src/views/system/task/ShipmentTaskHeaderList.vue +++ b/ant-design-vue-jeecg/src/views/system/task/ShipmentTaskHeaderList.vue @@ -261,11 +261,16 @@ export default { dataIndex: 'status_dictText', }, { - title: '是否空出', + title: '空出', align: "center", dataIndex: 'isEmptyOut_dictText', }, { + title: '取货错', + align: "center", + dataIndex: 'isPickupError_dictText', + }, + { title: '创建人', align: "center", dataIndex: 'createBy' diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsService.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsService.java index bcb41e4..88278da 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsService.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsService.java @@ -40,4 +40,5 @@ public interface WcsService { * 取货错处理 */ Result pickupErrorHandle(String taskNo); + } diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsServiceImpl.java index 2ee3bf5..1ece0dc 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsServiceImpl.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsServiceImpl.java @@ -460,6 +460,7 @@ public class WcsServiceImpl implements WcsService { return Result.error("任务已完成"); } + taskHeader.setStatus(QuantityConstant.TASK_STATUS_COMPLETED); taskHeader.setIsEmptyOut(QuantityConstant.EMPTY_OUT); taskHeader.setExceptionName("空出处理"); taskHeader.setExceptionState(QuantityConstant.EXCEPTION_TASK_ERROR); diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/controller/TaskHeaderController.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/controller/TaskHeaderController.java index 06bc42c..c23117e 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/controller/TaskHeaderController.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/controller/TaskHeaderController.java @@ -40,16 +40,7 @@ import org.jeecgframework.poi.excel.entity.ExportParams; import org.jeecgframework.poi.excel.entity.ImportParams; import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -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.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartHttpServletRequest; import org.springframework.web.servlet.ModelAndView; @@ -656,4 +647,5 @@ public class TaskHeaderController extends HuahengBaseController { } return Result.OK(portList); } + } diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/entity/TaskHeader.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/entity/TaskHeader.java index 249e8fb..031a0b9 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/entity/TaskHeader.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/entity/TaskHeader.java @@ -85,6 +85,11 @@ public class TaskHeader implements Serializable { @Dict(dicCode = "is_or_not") @ApiModelProperty(value = "是否重入") private Integer isDoubleIn; + /** 取货错 */ + @Excel(name = "取货错", width = 15, dicCode = "is_or_not") + @Dict(dicCode = "is_or_not") + @ApiModelProperty(value = "取货错") + private Integer isPickupError; /** 重入库位号 */ @Excel(name = "重入库位号", width = 15) @ApiModelProperty(value = "重入库位号") diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/ITaskHeaderService.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/ITaskHeaderService.java index 40305fc..0515966 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/ITaskHeaderService.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/ITaskHeaderService.java @@ -193,4 +193,24 @@ public interface ITaskHeaderService extends IService<TaskHeader> { */ Result addMesTryTimes(TaskHeader taskHeader); + /** + * 处理空出 + * @param taskNo + * @return + */ + Result handleEmptyOut(String taskNo); + + /** + * 处理重入 + * @param taskNo + * @return + */ + Result handleDoubleIn(String taskNo); + + /** + * 处理取货错 + * @param taskNo + * @return + */ + Result handlePickupError(String taskNo); } diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java index affa2c6..dd654e4 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java @@ -639,6 +639,146 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea } @Override + public Result handleEmptyOut(String taskNo) { + // 1、判断非空字段 + if (StringUtils.isEmpty(taskNo)) { + return Result.error("处理空出失败,任务号为空"); + } + // 2、根据任务号查找任务 + TaskHeader taskHeader = taskHeaderService.getById(taskNo); + if (taskHeader == null) { + return Result.error("处理空出失败,没有找到该任务"); + } + // 3、已经完成的任务,不需要在处理 + if (taskHeader.getStatus() != QuantityConstant.TASK_STATUS_COMPLETED) { + return Result.OK("处理空出失败, 任务没有完成"); + } + String containerCode = taskHeader.getContainerCode(); + String fromLocationCode = taskHeader.getFromLocationCode(); + String warehouseCode = taskHeader.getWarehouseCode(); + // 4、容器号、库位号、仓库编码 不能为空 + if (StringUtils.isEmpty(containerCode)) { + return Result.error("处理空出失败,容器号为空"); + } + if (StringUtils.isEmpty(fromLocationCode)) { + return Result.error("处理空出失败,起始库号位为空"); + } + if (StringUtils.isEmpty(warehouseCode)) { + return Result.error("处理空出失败,仓库编码为空"); + } + Container container = containerService.getContainerByCode(containerCode, warehouseCode); + if (container == null) { + return Result.error("处理空出失败,没有找到容器"); + } + Location fronLocation = locationService.getLocationByCode(fromLocationCode, warehouseCode); + if (fronLocation == null) { + return Result.error("处理空出失败,没有找到库位"); + } + // 5、删除容器上的库位号,并设置状态为空盘 + boolean success = + containerService.updateLocationCodeAndStatus(containerCode, QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_CONTAINER_EMPTY, warehouseCode); + if (!success) { + throw new ServiceException("处理空出失败, 更新容器状态失败"); + } + // 6、删除库位上的容器号,并设置状态为空闲 + success = + locationService.updateContainerCodeAndStatus(fromLocationCode, QuantityConstant.EMPTY_STRING, QuantityConstant.STATUS_LOCATION_EMPTY, warehouseCode); + if (!success) { + throw new ServiceException("处理空出失败, 更新库位状态失败"); + } + // 7、删除库存头失败 + InventoryHeader inventoryHeader = inventoryHeaderService.getInventoryHeaderByContainerCode(containerCode, warehouseCode); + if (inventoryHeader != null) { + success = inventoryHeaderService.removeById(inventoryHeader.getId()); + if (!success) { + throw new ServiceException("处理空出失败, 删除库存头失败"); + } + } + // 8、删除库存详情失败 + List<InventoryDetail> inventoryDetailList = inventoryDetailService.getInventoryDetailListByContainerCode(containerCode, warehouseCode); + if (inventoryDetailList.size() != 0) { + success = inventoryDetailService.removeByIds(inventoryDetailList); + if (!success) { + throw new ServiceException("处理空出失败, 删除库存详情失败"); + } + } + return Result.error("处理空出成功"); + } + + @Override + public Result handleDoubleIn(String taskNo) { + // 1、判断非空字段 + if (StringUtils.isEmpty(taskNo)) { + return Result.error("处理重入失败,任务号为空"); + } + // 2、根据任务号查找任务 + TaskHeader taskHeader = taskHeaderService.getById(taskNo); + if (taskHeader == null) { + return Result.error("处理重入失败,没有找到该任务"); + } + // 3、已经完成的任务,不需要在处理 + if (taskHeader.getStatus() != QuantityConstant.TASK_STATUS_COMPLETED) { + return Result.OK("处理重入失败, 任务没有完成"); + } + + String containerCode = taskHeader.getContainerCode(); + String originLocationCode = taskHeader.getOriginLocationCode(); + String warehouseCode = taskHeader.getWarehouseCode(); + // 4、容器号、库位号、仓库编码 不能为空 + if (StringUtils.isEmpty(containerCode)) { + return Result.error("处理重入失败,容器号为空"); + } + if (StringUtils.isEmpty(originLocationCode)) { + return Result.error("处理重入失败,终点库号位为空"); + } + if (StringUtils.isEmpty(warehouseCode)) { + return Result.error("处理重入失败,仓库编码为空"); + } + Container container = containerService.getContainerByCode(containerCode, warehouseCode); + if (container == null) { + return Result.error("处理重入失败,没有找到容器"); + } + String[] locationCodes = originLocationCode.split(","); + for (String locationCode : locationCodes) { + Location toLocation = locationService.getLocationByCode(locationCode, warehouseCode); + if (toLocation == null) { + return Result.error("处理重入失败,没有找到库位"); + } + toLocation.setStatus(QuantityConstant.STATUS_LOCATION_EMPTY); + boolean success = locationService.updateById(toLocation); + if (!success) { + throw new ServiceException("处理重入失败,更新库位失败"); + } + } + + return Result.ok("处理重入成功"); + } + + @Override + public Result handlePickupError(String taskNo) { + // 1、判断非空字段 + if (StringUtils.isEmpty(taskNo)) { + return Result.error("处理取货错失败,任务号为空"); + } + // 2、根据任务号查找任务 + TaskHeader taskHeader = taskHeaderService.getById(taskNo); + if (taskHeader == null) { + return Result.error("处理取货错失败,没有找到该任务"); + } + // 3、已经完成的任务,不需要在处理 + if (taskHeader.getStatus() != QuantityConstant.TASK_STATUS_COMPLETED) { + return Result.OK("处理取货错失败, 任务没有完成"); + } + + taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD); + boolean success = taskHeaderService.updateById(taskHeader); + if (!success) { + throw new ServiceException("处理取货错失败,更新任务失败"); + } + return Result.ok("处理取货错成功"); + } + + @Override public TaskHeader getUnCompleteTaskByFromLocationCode(String fromLocationCode, String warehouseCode) { LambdaQueryWrapper<TaskHeader> taskHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(); taskHeaderLambdaQueryWrapper.eq(TaskHeader::getFromLocationCode, fromLocationCode).eq(TaskHeader::getWarehouseCode, warehouseCode).lt(TaskHeader::getStatus,