Commit cfd18236557c4218113c12ce1706e130764f008c

Authored by 肖超群
1 parent e1a480e6

更新下发任务代码

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