|
@@ -95,7 +95,23 @@ public class SortDayworkController extends BaseController {
|
|
|
bizDayworkItem.setTechnologicalProcessId(bizTechnologicalProcess.getId());
|
|
|
}
|
|
|
// 查找所有该工序和产品对应的分选标准和检查指导书
|
|
|
- List<BizProductInspectionInstruction> list = bizProductInspectionInstructionService.query().eq("technological_process_id", bizDayworkItem.getTechnologicalProcessId()).eq("process_id", bizDayworkItem.getProcessId()).list();
|
|
|
+ List<BizProductInspectionInstruction> list;
|
|
|
+
|
|
|
+ if (bizDayworkItem.getKeywords() != null ) {
|
|
|
+ // 如果 keywords 不为空或空字符串,则添加 LIKE 条件
|
|
|
+ list = bizProductInspectionInstructionService.query()
|
|
|
+ .eq("technological_process_id", bizDayworkItem.getTechnologicalProcessId())
|
|
|
+ .eq("process_id", bizDayworkItem.getProcessId())
|
|
|
+ .like("standard", bizDayworkItem.getKeywords()) // 添加 LIKE 条件
|
|
|
+ .list();
|
|
|
+ } else {
|
|
|
+ // 如果 keywords 为空,则不添加 LIKE 条件
|
|
|
+ list = bizProductInspectionInstructionService.query()
|
|
|
+ .eq("technological_process_id", bizDayworkItem.getTechnologicalProcessId())
|
|
|
+ .eq("process_id", bizDayworkItem.getProcessId())
|
|
|
+ .list();
|
|
|
+ }
|
|
|
+ // List<BizProductInspectionInstruction> list = bizProductInspectionInstructionService.query().eq("technological_process_id", bizDayworkItem.getTechnologicalProcessId()).eq("process_id", bizDayworkItem.getProcessId()).list();
|
|
|
|
|
|
// 查询所有的分选标准
|
|
|
List<BizInspectionInstruction> inspectionStandard = bizInspectionInstructionService.query().in("id", list.isEmpty() ? Collections.singletonList("0"): list.stream().map(BizProductInspectionInstruction::getInspectionInstructionId).collect(Collectors.toList())).eq("type", 1).list();
|