Commit cfd18236557c4218113c12ce1706e130764f008c
1 parent
e1a480e6
更新下发任务代码
Showing
2 changed files
with
6 additions
and
12 deletions
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsServiceImpl.java
... | ... | @@ -289,7 +289,7 @@ public class WcsServiceImpl implements WcsService { |
289 | 289 | String toLocationCode = taskHeader.getToLocationCode(); |
290 | 290 | Location fromLocation = locationService.getLocationByCode(fromLocationCode, warehouseCode); |
291 | 291 | // Location toLocation = locationService.getLocationByCode(toLocationCode, warehouseCode); |
292 | - boolean direction = true; // true 执行时是入库动作, false 执行时是出库动作 | |
292 | + boolean direction = false; // true 执行时是入库动作, false 执行时是出库动作 | |
293 | 293 | switch (taskType) { |
294 | 294 | case QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT: |
295 | 295 | case QuantityConstant.TASK_TYPE_WHOLESHIPMENT: |
... | ... | @@ -299,9 +299,6 @@ public class WcsServiceImpl implements WcsService { |
299 | 299 | case QuantityConstant.TASK_TYPE_TRANSFER: |
300 | 300 | case QuantityConstant.TASK_TYPE_CHECK_OUT: |
301 | 301 | case QuantityConstant.TASK_TYPE_MANY_EMPTYSHIPMENT: |
302 | - if (fromLocation == null) { | |
303 | - return Result.error("起始库位为空"); | |
304 | - } | |
305 | 302 | direction = false; |
306 | 303 | break; |
307 | 304 | case QuantityConstant.TASK_TYPE_WHOLERECEIPT: |
... | ... | @@ -368,7 +365,7 @@ public class WcsServiceImpl implements WcsService { |
368 | 365 | } |
369 | 366 | } |
370 | 367 | |
371 | - // 下发移库任务 | |
368 | + // 下发任务 | |
372 | 369 | WcsTask wcsTask = new WcsTask(); |
373 | 370 | wcsTask.setTaskNo(taskHeader.getId().toString()); |
374 | 371 | wcsTask.setWarehouseCode(warehouseCode); |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java
... | ... | @@ -948,22 +948,19 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
948 | 948 | return Result.error("下发wcs任务时,没有找到任务, 任务号" + taskId); |
949 | 949 | } |
950 | 950 | if (taskHeader.getStatus() >= QuantityConstant.TASK_STATUS_RELEASE) { |
951 | - return Result.error("任务" + taskId + "已经下发,请不要重复下发,操作中止"); | |
951 | + return Result.error("下发wcs任务时, 任务" + taskId + "已经下发,请不要重复下发,操作中止"); | |
952 | 952 | } |
953 | 953 | Result result = wcsService.wcsTaskAssign(taskHeader); |
954 | 954 | if (!result.isSuccess()) { |
955 | - if (result.getMessage().equals("先执行移库任务")) { | |
956 | - return result; | |
957 | - } | |
958 | - throw new JeecgBootException(result.getMessage()); | |
955 | + return Result.error(result.getMessage()); | |
959 | 956 | } |
960 | 957 | taskHeader.setStatus(QuantityConstant.TASK_STATUS_RELEASE); |
961 | - boolean success = taskHeaderService.updateById(taskHeader); | |
958 | + boolean success = taskHeaderService.updateStatusById(QuantityConstant.TASK_STATUS_RELEASE, taskHeader.getId()); | |
962 | 959 | if (!success) { |
963 | 960 | throw new JeecgBootException("下发wcs任务时, 更新任务状态失败"); |
964 | 961 | } |
965 | 962 | |
966 | - return Result.ok("执行下发任务成功"); | |
963 | + return Result.ok("下发wcs任务成功"); | |
967 | 964 | } |
968 | 965 | |
969 | 966 | /** |
... | ... |