fix(inspection): 修复来料检验任务AQL类型查询逻辑
- 移除了硬编码的AQL类型判断逻辑 - 修改为直接使用字典项ID作为检验类型条件 - 解决了无法正确匹配AQL类型导致的数据查询问题 - 优化了代码可读性和维护性
This commit is contained in:
parent
27538c238e
commit
6b0cfa7183
|
|
@ -963,14 +963,13 @@ public class IncomingInspectionTaskControllerService {
|
|||
.one();
|
||||
VUtil.trueThrowBusinessError(Objects.isNull(incomingInspectionTaskAqlRule)).throwMessage("该任务未设置AQL类型");
|
||||
DictionaryItem dictionaryItem = dictionaryItemService.getById(incomingInspectionTaskAqlRule.getUsedAqlType());
|
||||
Integer aqltype = StrUtil.contains(dictionaryItem.getName(), "正常")
|
||||
? 0
|
||||
: (StrUtil.contains(dictionaryItem.getName(), "加严") ? 1 : 2);
|
||||
// Integer aqltype = StrUtil.contains(dictionaryItem.getName(), "正常")
|
||||
// ? 0
|
||||
// : (StrUtil.contains(dictionaryItem.getName(), "加严") ? 1 : 2);
|
||||
QmsCodeLetterMatrix codeLetterMatrix = codeLetterMatrixService.lambdaQuery()
|
||||
.eq(QmsCodeLetterMatrix::getSamplingPlanId, samplingPlan.getId())
|
||||
.eq(QmsCodeLetterMatrix::getCodeLetterId, codeLetterId)
|
||||
.eq(QmsCodeLetterMatrix::getInspectionType, aqltype)
|
||||
.last("LIMIT 1")
|
||||
.eq(QmsCodeLetterMatrix::getInspectionType, dictionaryItem.getId())
|
||||
.one();
|
||||
VUtil.trueThrowBusinessError(Objects.isNull(codeLetterMatrix)).throwMessage("未找到对应的字码矩阵");
|
||||
return codeLetterMatrix.getSampleSize();
|
||||
|
|
|
|||
Loading…
Reference in New Issue