fix(inspection): 增加物料唯一编号校验及检验数量限制
- 校验物料唯一编号不为空,防止传入空值 - 检查任务中物料是否已被检验,避免重复检验 - 验证当前检验数量未超过任务总检验数量减已检数量 - 优化异常提示信息,提高用户操作反馈准确性
This commit is contained in:
parent
6362d6ed7e
commit
049ff61c24
|
|
@ -809,6 +809,15 @@ public class IncomingInspectionTaskControllerService {
|
||||||
QmsIncomingInspectionTask task = incomingInspectionTaskService.getById(request.getTaskId());
|
QmsIncomingInspectionTask task = incomingInspectionTaskService.getById(request.getTaskId());
|
||||||
VUtil.trueThrowBusinessError(Objects.isNull(task)).throwMessage("任务不存在");
|
VUtil.trueThrowBusinessError(Objects.isNull(task)).throwMessage("任务不存在");
|
||||||
VUtil.trueThrowBusinessError(task.getInspectionStatus() == 2).throwMessage("该任务已完成");
|
VUtil.trueThrowBusinessError(task.getInspectionStatus() == 2).throwMessage("该任务已完成");
|
||||||
|
VUtil.trueThrowBusinessError(incomingInspectionTaskRecordService.lambdaQuery()
|
||||||
|
.eq(QmsIncomingInspectionTaskRecord::getTaskId, request.getTaskId())
|
||||||
|
.eq(QmsIncomingInspectionTaskRecord::getMaterialUniqueNo, request.getMaterialUniqueNo())
|
||||||
|
.exists()
|
||||||
|
).throwMessage("该物料已检验过");
|
||||||
|
Integer inspectedQty = incomingInspectionTaskService.getInspectedQty(task.getId());
|
||||||
|
VUtil.trueThrowBusinessError(request.getInspectionQty() > (task.getDetectionQty() - inspectedQty))
|
||||||
|
.throwMessage("超出总检验数量");
|
||||||
|
|
||||||
LocalDateTime now = LocalDateTime.now();
|
LocalDateTime now = LocalDateTime.now();
|
||||||
Long userId = UserUtil.getUserId();
|
Long userId = UserUtil.getUserId();
|
||||||
String userName = UserUtil.getUserName();
|
String userName = UserUtil.getUserName();
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.nflg.wms.common.pojo.qo;
|
package com.nflg.wms.common.pojo.qo;
|
||||||
|
|
||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.NotEmpty;
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
@ -22,7 +23,7 @@ public class QmsIncomingInspectionTaskTodoCheckSubmitQO {
|
||||||
/**
|
/**
|
||||||
* 物料唯一编号
|
* 物料唯一编号
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "物料唯一编号不能为空")
|
@NotBlank(message = "物料唯一编号不能为空")
|
||||||
private String materialUniqueNo;
|
private String materialUniqueNo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue