入库请求以及入库任务记录查询bug解消。

This commit is contained in:
梁州 2024-07-01 16:49:17 +08:00
parent 409df1ac81
commit 4e576a1225
2 changed files with 13 additions and 8 deletions

View File

@ -140,7 +140,7 @@ public class TaskController {
}
// 生成入库任务
String saveTaskResult;
if (taskInRequest.getGoodsList().isEmpty()) {// 空托入库
if (taskInRequest.getGoodsList() == null || taskInRequest.getGoodsList().isEmpty()) {// 空托入库
saveTaskResult = genEmptyInTask(taskInRequest, nextLocationMap.get("nextLocationId"), nextLocationMap.get("preTaskId"));
} else {// 带料入库
saveTaskResult = genGoodsInTask(taskInRequest, nextLocationMap.get("nextLocationId"), nextLocationMap.get("preTaskId"));
@ -261,7 +261,7 @@ public class TaskController {
* @return 验证结果---空为验证通过否则输出错误信息
*/
private String validateTaskInRequest(TaskInRequest taskInRequest) {
// 验证任务ID
// 验证任务请求
if (taskInRequest == null) {
return TaskInValidationEnum.NO_REQUEST_BODY.getErrorMessage();
}
@ -287,7 +287,7 @@ public class TaskController {
BigDecimal max_weight = BigDecimal.valueOf(10000000);
try {
max_weight = new BigDecimal(configMap.get(ConfigMapKeyEnum.MAX_WEIGHT.getConfigKey()));
} catch (NumberFormatException e) {
} catch (Exception e) {
logger.error("转换配置项---最大承重,发生错误");
}
if (taskInRequest.getTotalWeight().compareTo(max_weight) > 0) {
@ -298,12 +298,12 @@ public class TaskController {
if (StringUtils.isEmpty(taskInRequest.getOriginPoint())) {
return TaskInValidationEnum.NO_IN_POINT.getErrorMessage();
} else {
if (standService.validateStand(taskInRequest.getOriginPoint(), 1)) {
if (!standService.validateStand(taskInRequest.getOriginPoint(), TaskType.IN.getCode())) {
return TaskInValidationEnum.ERROR_IN_POINT.getErrorMessage();
}
}
// 验证物料信息
if (!taskInRequest.getGoodsList().isEmpty()) {
if (taskInRequest.getGoodsList() != null && !taskInRequest.getGoodsList().isEmpty()) {
for (GoodsInRequest goodsInRequest : taskInRequest.getGoodsList()) {
// 验证物料编号
if (StringUtils.isEmpty(goodsInRequest.getGoodsId())) {
@ -605,11 +605,11 @@ public class TaskController {
}
// 验证终点站台
if (taskOutRequest.getIsPicking() == 0) {// 出库
if (standService.validateStand(taskOutRequest.getDestinationPoint(), 2)) {
if (!standService.validateStand(taskOutRequest.getDestinationPoint(), 2)) {
return TaskOutValidationEnum.ERROR_DESTINATION_POINT.getErrorMessage();
}
} else {// 拣选出库
if (standService.validateStand(taskOutRequest.getDestinationPoint(), 3)) {
if (!standService.validateStand(taskOutRequest.getDestinationPoint(), 3)) {
return TaskOutValidationEnum.ERROR_PICK_STAND.getErrorMessage();
}
}
@ -879,7 +879,10 @@ public class TaskController {
taskService.updateBatchById(feedBackTasks);
}
// 返回成功
logger.info("处理任务反馈成功");
response.setCode(ResponseCode.OK.getCode());
response.setMessage("处理任务反馈成功");
return convertJsonString(response);
} catch (Exception e) {
// 回滚事务

View File

@ -1,6 +1,7 @@
package com.wms.entity.app.vo;
import com.wms.entity.app.dto.extend.TaskDetailInfo;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@ -8,6 +9,7 @@ import java.time.LocalDateTime;
/**
* 任务记录VO
*/
@Data
public class TaskRecordVO {
/**
* 任务号