diff --git a/ant-design-vue-jeecg/src/api/api.js b/ant-design-vue-jeecg/src/api/api.js index f8f2536..1c62504 100644 --- a/ant-design-vue-jeecg/src/api/api.js +++ b/ant-design-vue-jeecg/src/api/api.js @@ -198,7 +198,11 @@ export const completeAgv = (params) => postAction('/task/agvTask/complete?ids=' //取消AGV任务 export const cancelAgv = (params) => postAction('/task/agvTask/cancel?ids=' + params, params); //修复空出数据 -export const handleEmptyOut = (params) => postAction('/task/taskHeader/handleEmptyOut?ids=' + params, params); +export const handleEmptyOut = (params) => postAction('/task/taskHeader/handleEmptyOut?id=' + params, params); +//修复取货错数据 +export const handlePickupError = (params) => postAction('/task/taskHeader/handlePickupError?id=' + params, params); +//修复重入数据 +export const handleDoubleIn = (params) => postAction('/task/taskHeader/handleDoubleIn?id=' + params, params); // 中转HTTP请求 export const transitRESTful = { get: (url, parameter) => getAction(getTransitURL(url), parameter), 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 0100016..9ff1d59 100644 --- a/ant-design-vue-jeecg/src/views/system/task/ReceiptTaskHeaderList.vue +++ b/ant-design-vue-jeecg/src/views/system/task/ReceiptTaskHeaderList.vue @@ -153,6 +153,12 @@ <span slot="action" slot-scope="text, record"> <a v-if="record.status == 1" v-has="'taskHeader:executeTask'" @click="executeTask(record)">执行<a-divider type="vertical"/></a> + <a v-if="record.isEmptyOut == 1 && record.exceptionState == 1" v-has="'taskHeader:executeTask'" @click="handleEmptyOutTask(record)">修复空出数据 + <a-divider type="vertical"/></a> + <a v-if="record.isPickupError == 1 && record.exceptionState == 1" v-has="'taskHeader:executeTask'" @click="handlePickupErrorTask(record)">修复取货错数据 + <a-divider type="vertical"/></a> + <a v-if="record.isDoubleIn == 1 && record.exceptionState == 1" v-has="'taskHeader:executeTask'" @click="handleDoubleInTask(record)">修复重入数据 + <a-divider type="vertical"/></a> <a v-if="record.status < 100" v-has="'taskHeader:cancelTask'" @click="cancelTask(record)">取消<a-divider type="vertical"/></a> <a v-if="record.status < 100" v-has="'taskHeader:completeTask'" @click="completeTask(record)">完成<a-divider type="vertical"/></a> <a-dropdown> @@ -195,7 +201,7 @@ import {initDictOptions, filterMultiDictText} from '@/components/dict/JDictSelec import '@/assets/less/TableExpand.less' import {completeTaskByWMS, cancelTask} from '@/api/api' import {execute} from '@/api/api' -import {getZoneList} from '@/api/api' +import {getZoneList, handleEmptyOut, handlePickupError, handleDoubleIn} from '@/api/api' import EmptyInTaskModal from './modules/EmptyInTaskModal' import ManyEmptyInTaskModal from "./modules/ManyEmptyInTaskModal"; @@ -444,6 +450,45 @@ export default { this.searchQuery(); }); }, + handleEmptyOutTask(record) { + this.loading = true; + this.model = Object.assign({}, record); + handleEmptyOut(this.model.id).then((res) => { + this.loading = false; + if (res.success) { + this.$message.success(res.message); + } else { + this.$message.error(res.message); + } + this.searchQuery(); + }); + }, + handlePickupErrorTask(record) { + this.loading = true; + this.model = Object.assign({}, record); + handlePickupError(this.model.id).then((res) => { + this.loading = false; + if (res.success) { + this.$message.success(res.message); + } else { + this.$message.error(res.message); + } + this.searchQuery(); + }); + }, + handleDoubleInTask(record) { + this.loading = true; + this.model = Object.assign({}, record); + handleDoubleIn(this.model.id).then((res) => { + this.loading = false; + if (res.success) { + this.$message.success(res.message); + } else { + this.$message.error(res.message); + } + this.searchQuery(); + }); + }, getSuperFieldList() { let fieldList = []; fieldList.push({type: 'int', value: 'taskType', text: '任务类型', dictCode: 'task_type'}) 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 695e0c7..19bafc5 100644 --- a/ant-design-vue-jeecg/src/views/system/task/ShipmentTaskHeaderList.vue +++ b/ant-design-vue-jeecg/src/views/system/task/ShipmentTaskHeaderList.vue @@ -155,7 +155,11 @@ <span slot="action" slot-scope="text, record"> <a v-if="record.status == 1" v-has="'taskHeader:executeTask'" @click="executeTask(record)">执行 <a-divider type="vertical"/></a> - <a v-if="record.isEmptyOut == 1 && record.exceptionState == 0" v-has="'taskHeader:executeTask'" @click="handleEmptyOutTask(record)">修复空出数据 + <a v-if="record.isEmptyOut == 1 && record.exceptionState == 1" v-has="'taskHeader:executeTask'" @click="handleEmptyOutTask(record)">修复空出数据 + <a-divider type="vertical"/></a> + <a v-if="record.isPickupError == 1 && record.exceptionState == 1" v-has="'taskHeader:executeTask'" @click="handlePickupErrorTask(record)">修复取货错数据 + <a-divider type="vertical"/></a> + <a v-if="record.isDoubleIn == 1 && record.exceptionState == 1" v-has="'taskHeader:executeTask'" @click="handleDoubleInTask(record)">修复重入数据 <a-divider type="vertical"/></a> <a v-if="record.status < 100" v-has="'taskHeader:cancelTask'" @click="cancelTask(record)">取消 <a-divider type="vertical"/></a> @@ -202,7 +206,7 @@ import {initDictOptions, filterMultiDictText} from '@/components/dict/JDictSelec import '@/assets/less/TableExpand.less' import {completeTaskByWMS, cancelTask} from '@/api/api' import {execute} from '@/api/api' -import {getZoneList, handleEmptyOut} from '@/api/api' +import {getZoneList, handleEmptyOut, handlePickupError, handleDoubleIn} from '@/api/api' import EmptyOutTaskModal from './modules/EmptyOutTaskModal' import ManyEmptyOutTaskModal from "./modules/ManyEmptyOutTaskModal"; @@ -462,6 +466,32 @@ export default { this.searchQuery(); }); }, + handlePickupErrorTask(record) { + this.loading = true; + this.model = Object.assign({}, record); + handlePickupError(this.model.id).then((res) => { + this.loading = false; + if (res.success) { + this.$message.success(res.message); + } else { + this.$message.error(res.message); + } + this.searchQuery(); + }); + }, + handleDoubleInTask(record) { + this.loading = true; + this.model = Object.assign({}, record); + handleDoubleIn(this.model.id).then((res) => { + this.loading = false; + if (res.success) { + this.$message.success(res.message); + } else { + this.$message.error(res.message); + } + this.searchQuery(); + }); + }, getSuperFieldList() { let fieldList = []; fieldList.push({type: 'int', value: 'taskType', text: '任务类型', dictCode: 'task_type'}) diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/controller/WcsController.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/controller/WcsController.java index 5d84325..8499b85 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/controller/WcsController.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/controller/WcsController.java @@ -108,24 +108,24 @@ public class WcsController extends HuahengBaseController { @ResponseBody @ApiOperation("申请空托盘组出库") @ApiLogger(apiName = "申请空托盘组出库", from = "WCS") - public Result manyEmptyOut(@RequestBody ManyEmptyDomain manyEmptyDomain) { - String containerCode = manyEmptyDomain.getContainerCode(); - String toPortCode = manyEmptyDomain.getPort(); - String warehouseCode = manyEmptyDomain.getWarehouseCode(); + public Result manyEmptyOut(@RequestBody ManyEmptyOutDomain manyEmptyOutDomain) { + String toPortCode = manyEmptyOutDomain.getPort(); + String warehouseCode = manyEmptyOutDomain.getWarehouseCode(); + String zoneCode = manyEmptyOutDomain.getZoneCode(); if (StringUtils.isEmpty(warehouseCode)) { return Result.error("申请空托盘组出库, 仓库号为空"); } if (StringUtils.isEmpty(toPortCode)) { return Result.error("申请空托盘组出库, 出库口为空"); } - if (StringUtils.isEmpty(containerCode)) { - return Result.error("申请空托盘组出库, 托盘号为空"); + if (StringUtils.isEmpty(zoneCode)) { + return Result.error("申请空托盘组出库, 库区为空"); } - String lockKey = warehouseCode + containerCode; + String lockKey = warehouseCode + zoneCode; Result result = handleMultiProcess("manyEmptyOut", lockKey, new MultiProcessListener() { @Override public Result<?> doProcess() { - Result result = taskHeaderService.createManyEmptyOutTask(containerCode, toPortCode, warehouseCode); + Result result = wcsService.manyEmptyOut(zoneCode, toPortCode, warehouseCode); return result; } }); @@ -230,7 +230,7 @@ public class WcsController extends HuahengBaseController { String taskNo = taskEntity.getTaskNo(); String warehouseCode = taskEntity.getWarehouseCode(); String lockKey = warehouseCode; - Result result = handleMultiProcess("pickupErrorHandle", warehouseCode, new MultiProcessListener() { + Result result = handleMultiProcess("pickupErrorHandle", lockKey, new MultiProcessListener() { @Override public Result<?> doProcess() { Result result = wcsService.pickupErrorHandle(taskNo); diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/entity/ManyEmptyDomain.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/entity/ManyEmptyDomain.java index 014bec9..36ebf92 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/entity/ManyEmptyDomain.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/entity/ManyEmptyDomain.java @@ -21,8 +21,8 @@ public class ManyEmptyDomain { /** 重量 */ @ApiModelProperty(value = "重量") private String weight; - /** 重量 */ - @ApiModelProperty(value = "重量") + /** 仓库编码 */ + @ApiModelProperty(value = "仓库编码") private String warehouseCode; /** 巷道 */ @ApiModelProperty(value = "巷道") diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/entity/ManyEmptyOutDomain.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/entity/ManyEmptyOutDomain.java new file mode 100644 index 0000000..c68df66 --- /dev/null +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/entity/ManyEmptyOutDomain.java @@ -0,0 +1,22 @@ +package org.jeecg.modules.wms.api.wcs.entity; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author 游杰 + */ +@Data +public class ManyEmptyOutDomain { + + /** 仓库编码 */ + @ApiModelProperty(value = "仓库编码", required = true) + private String warehouseCode; + /** 库区 */ + @ApiModelProperty(value = "库区", required = true) + private String zoneCode; + /** 分拣口 */ + @ApiModelProperty(value = "分拣口", required = true) + private String port; + +} 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 14996eb..eb5e25c 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 @@ -45,4 +45,9 @@ public interface WcsService { * 到达拣选台 */ Result arrivedNotice(String taskNo, String port); + + /** + * 选取空托盘组出库 + */ + Result manyEmptyOut(String zoneCode, String port, String warehouseCode); } 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 6da01f0..10410d9 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 @@ -485,6 +485,7 @@ public class WcsServiceImpl implements WcsService { } @Override + @Transactional(rollbackFor = Exception.class) public Result reentryHandle(String taskNo) { // 1、判断非空字段 if (StringUtils.isEmpty(taskNo)) { @@ -585,6 +586,7 @@ public class WcsServiceImpl implements WcsService { } @Override + @Transactional(rollbackFor = Exception.class) public Result pickupErrorHandle(String taskNo) { // 1、判断非空字段 if (StringUtils.isEmpty(taskNo)) { @@ -599,7 +601,8 @@ public class WcsServiceImpl implements WcsService { if (taskHeader.getStatus() == QuantityConstant.TASK_STATUS_COMPLETED) { return Result.OK("取货错处理失败, 任务已完成"); } - // 3、修改该任务为取货错,过后处理 + // 4、修改该任务为取货错,过后处理 + taskHeader.setIsPickupError(QuantityConstant.PICK_UP_ERROR); taskHeader.setExceptionName("取货错误"); taskHeader.setExceptionState(QuantityConstant.EXCEPTION_TASK_ERROR); boolean success = taskHeaderService.updateById(taskHeader); @@ -610,6 +613,7 @@ public class WcsServiceImpl implements WcsService { } @Override + @Transactional(rollbackFor = Exception.class) public Result arrivedNotice(String taskNo, String port) { TaskHeader taskHeader = taskHeaderService.getById(taskNo); if (taskHeader == null) { @@ -628,4 +632,33 @@ public class WcsServiceImpl implements WcsService { return Result.ok("更新到达站台成功"); } + @Override + @Transactional(rollbackFor = Exception.class) + public Result manyEmptyOut(String zoneCode, String port, String warehouseCode) { + LambdaQueryWrapper<Container> containerLambdaQueryWrapper = Wrappers.lambdaQuery(); + containerLambdaQueryWrapper.eq(Container::getStatus, QuantityConstant.STATUS_CONTAINER_MANY).eq(Container::getWarehouseCode, warehouseCode); + List<Container> containerList = containerService.list(containerLambdaQueryWrapper); + List<Container> removeContainerList = new ArrayList<>(); + if (containerList != null && containerList.size() > 0) { + for (Container container : containerList) { + String locationCode = container.getLocationCode(); + Location location = locationService.getLocationByCode(locationCode, warehouseCode); + if (!location.getZoneCode().equals(zoneCode)) { + removeContainerList.add(container); + } + } + } + containerList.removeAll(removeContainerList); + if (!(containerList != null && containerList.size() > 0)) { + return Result.error("没有找到合适的空托盘组!"); + } + String containerCode = containerList.get(0).getCode(); + Container container = containerService.getContainerByCode(containerCode, warehouseCode); + if (container == null) { + return Result.error("没有找到托盘, 托盘号:" + containerCode); + } + Result result = taskHeaderService.createManyEmptyOut(containerCode, port, warehouseCode); + return result; + } + } 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 453b83b..ab1b3c4 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 @@ -658,8 +658,8 @@ public class TaskHeaderController extends HuahengBaseController { @ApiOperation("修复空出的数据") @ResponseBody @ApiLogger(apiName = "修复空出的数据", from = "WMS") - public Result handleEmptyOut(@RequestParam(name = "ids", required = true) String ids) { - Result result = taskHeaderService.handleEmptyOut(ids); + public Result handleEmptyOut(@RequestParam(name = "id", required = true) String id) { + Result result = taskHeaderService.handleEmptyOut(id); return result; } @@ -672,8 +672,8 @@ public class TaskHeaderController extends HuahengBaseController { @ApiOperation("修复重入的数据") @ResponseBody @ApiLogger(apiName = "修复重入的数据", from = "WMS") - public Result handleDoubleIn(@RequestBody String taskNo) { - Result result = taskHeaderService.handleDoubleIn(taskNo); + public Result handleDoubleIn(@RequestParam(name = "id", required = true) String id) { + Result result = taskHeaderService.handleDoubleIn(id); return result; } @@ -686,8 +686,8 @@ public class TaskHeaderController extends HuahengBaseController { @ApiOperation("修复取货错的数据") @ResponseBody @ApiLogger(apiName = "修复取货错的数据", from = "WMS") - public Result handlePickupError(@RequestBody String taskNo) { - Result result = taskHeaderService.handlePickupError(taskNo); + public Result handlePickupError(@RequestParam(name = "id", required = true) String id) { + Result result = taskHeaderService.handlePickupError(id); return result; } 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 2be8def..c48d8ce 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 @@ -169,15 +169,6 @@ public interface ITaskHeaderService extends IService<TaskHeader> { Result createManyEmptyIn(String containerCode, String toLocationCode, String warehouseCode); /** - * WCS申请空托盘组出库 - * @param zoneCode - * @param toPortCode - * @param warehouseCode - * @return - */ - Result createManyEmptyOutTask(String zoneCode, String toPortCode, String warehouseCode); - - /** * 创建空托盘组出库 * @param containerCode * @param toPortCode @@ -214,8 +205,18 @@ public interface ITaskHeaderService extends IService<TaskHeader> { */ Result handlePickupError(String taskNo); + /** + * 完成入库 + * @param taskHeader + * @return + */ Result completeReceiptTask(TaskHeader taskHeader); + /** + * 完成出库 + * @param taskHeader + * @return + */ Result completeShipmentTask(TaskHeader taskHeader); Result completeCycleCountTask(TaskHeader taskHeader); 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 79291ef..9e777ff 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 @@ -485,7 +485,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea if (StringUtils.isEmpty(toLocationCode)) { throw new ServiceException("创建空托盘组入库任务时,目标库位为空"); } - Result result = createManyEmptyIn(containerCode, toLocationCode, warehouseCode); + Result result = taskHeaderService.createManyEmptyIn(containerCode, toLocationCode, warehouseCode); if (!result.isSuccess()) { throw new ServiceException(result.getMessage()); } @@ -501,6 +501,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea if (StringUtils.isEmpty(warehouseCode)) { return Result.error("创建空托盘组入库任务时,仓库编码为空"); } + String zoneCode = null; Container container = containerService.getContainerByCode(containerCode, warehouseCode); if (container == null) { return Result.error("创建空托盘组入库任务时,没有找到容器"); @@ -520,13 +521,14 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea if (toLocation == null) { return Result.error("创建空托盘组入库任务时,没有找到目标库位"); } - if (toLocation.getStatus() != QuantityConstant.STATUS_LOCATION_EMPTY) { + if (!toLocation.getStatus().equals(QuantityConstant.STATUS_LOCATION_EMPTY)) { return Result.error("创建空托盘组入库任务时,目标库位状态不是空闲"); } success = locationService.updateStatus(toLocationCode, QuantityConstant.STATUS_LOCATION_LOCK, warehouseCode); if (!success) { throw new ServiceException("创建空托盘组入库任务时, 更新库位状态失败"); } + zoneCode = toLocation.getZoneCode(); } TaskHeader taskHeader = new TaskHeader(); taskHeader.setWarehouseCode(warehouseCode); @@ -534,6 +536,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea taskHeader.setTaskType(QuantityConstant.TASK_TYPE_MANY_EMPTYRECEIPT); taskHeader.setInnernalTaskType(QuantityConstant.TASK_INTENERTYPE_RECEIPT); taskHeader.setToLocationCode(toLocationCode); + taskHeader.setZoneCode(zoneCode); taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD); success = taskHeaderService.save(taskHeader); if (!success) { @@ -544,51 +547,6 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea @Override @Transactional(rollbackFor = Exception.class) - public Result createManyEmptyOutTask(String zoneCode, String toPortCode, String warehouseCode) { - if (StringUtils.isEmpty(toPortCode)) { - return Result.error("创建空托盘组出库任务时,目标出入口为空"); - } - if (StringUtils.isEmpty(zoneCode)) { - return Result.error("创建空托盘组出库任务时,库区编码为空"); - } - if (StringUtils.isEmpty(warehouseCode)) { - return Result.error("创建空托盘组出库任务时,仓库编码为空"); - } - List<Container> containerList = containerService.getContainerListByStatus(QuantityConstant.STATUS_CONTAINER_MANY, warehouseCode); - if (containerList.size() == 0) { - return Result.error("创建空托盘组出库任务时,没有找到空托盘组"); - } - List<Container> removeContainerList = new ArrayList<>(); - if (containerList.size() > 0) { - for (Container container : containerList) { - String locationCode = container.getLocationCode(); - Location location = locationService.getLocationByCode(locationCode, warehouseCode); - if (!location.getZoneCode().equals(zoneCode)) { - removeContainerList.add(container); - } - } - } - boolean success = containerList.removeAll(removeContainerList); - if (!success) { - throw new ServiceException("创建空托盘组出库任务时,删除不符合的空托盘组失败"); - } - if (containerList.size() <= 0) { - throw new ServiceException("没有找到合适的空托盘组!"); - } - String containerCode = containerList.get(0).getCode(); - TaskHeader taskHeader = taskHeaderService.getUnCompleteTaskByContainerCode(containerCode, warehouseCode); - if (taskHeader != null) { - return Result.ok("创建空托盘组出库任务时, 已经生成空托盘组出库任务"); - } - Result result = createManyEmptyOut(containerCode, toPortCode, warehouseCode); - if (!result.isSuccess()) { - throw new ServiceException(result.getMessage()); - } - return Result.ok("创建空托盘组出库任务成功"); - } - - @Override - @Transactional(rollbackFor = Exception.class) public Result createManyEmptyOut(String containerCode, String toPortCode, String warehouseCode) { if (StringUtils.isEmpty(containerCode)) { return Result.error("创建空托盘组出库任务时,托盘号为空"); @@ -720,6 +678,12 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea throw new ServiceException("处理空出失败, 删除库存详情失败"); } } + // 9 更新单据 + taskHeader.setExceptionState(QuantityConstant.EXCEPTION_TASK_HANDLE); + success = taskHeaderService.updateById(taskHeader); + if (!success) { + throw new ServiceException("处理空出失败,更新任务失败"); + } return Result.ok("处理空出成功"); } @@ -768,7 +732,11 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea throw new ServiceException("处理重入失败,更新库位失败"); } } - + taskHeader.setExceptionState(QuantityConstant.EXCEPTION_TASK_HANDLE); + boolean success = taskHeaderService.updateById(taskHeader); + if (!success) { + throw new ServiceException("处理重入失败,更新任务失败"); + } return Result.ok("处理重入成功"); } @@ -784,11 +752,12 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea return Result.error("处理取货错失败,没有找到该任务"); } // 3、已经完成的任务,不需要在处理 - if (taskHeader.getStatus() != QuantityConstant.TASK_STATUS_COMPLETED) { - return Result.OK("处理取货错失败, 任务没有完成"); + if (taskHeader.getStatus() == QuantityConstant.TASK_STATUS_COMPLETED) { + return Result.OK("处理取货错失败, 任务已经完成"); } taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD); + taskHeader.setExceptionState(QuantityConstant.EXCEPTION_TASK_HANDLE); boolean success = taskHeaderService.updateById(taskHeader); if (!success) { throw new ServiceException("处理取货错失败,更新任务失败"); diff --git a/huaheng-wms-core/src/main/java/org/jeecg/utils/constant/QuantityConstant.java b/huaheng-wms-core/src/main/java/org/jeecg/utils/constant/QuantityConstant.java index 7146578..34885bd 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/utils/constant/QuantityConstant.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/utils/constant/QuantityConstant.java @@ -492,6 +492,9 @@ public class QuantityConstant { public static final int EMPTY_OUT_PROSESS = 2; public static final int NORMAL_OUT = 0; + // 取货错 + public static final int PICK_UP_ERROR = 1; + public static final int PORT_TYPE_IN = 1; public static final int PORT_TYPE_OUT = 2; public static final int PORT_TYPE_PICK = 3;