Prechádzať zdrojové kódy

试验管理-试验检测-列表名称查询根据记录编号、报告编号、委托单编号、样品编号、试验项目名称查询

LHB 1 mesiac pred
rodič
commit
1e05bd0e86

+ 18 - 1
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialSelfInspectionRecordServiceImpl.java

@@ -107,7 +107,24 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
                 queryWrapper.lambda().in(TrialSelfInspectionRecord::getNodeId, pIds);
             }
             if (StringUtils.isNotEmpty(dto.getQueryValue())) {
-                queryWrapper.lambda().like(TrialSelfInspectionRecord::getTrialProjectName, dto.getQueryValue());
+                //查询委托单编码
+                List<EntrustInfo> entrustInfos = entrustInfoMapper.selectList(Wrappers.<EntrustInfo>lambdaQuery()
+                        .like(EntrustInfo::getEntrustNo, dto.getQueryValue()));
+                List<Long> entrustIds;
+                if(CollectionUtil.isNotEmpty(entrustInfos)){
+                    entrustIds = entrustInfos.stream().map(EntrustInfo::getId).collect(Collectors.toList());
+                } else {
+                    entrustIds = null;
+                }
+
+                queryWrapper.lambda().and(
+                        wq ->
+                            wq.like(TrialSelfInspectionRecord::getTrialProjectName, dto.getQueryValue()).or()
+                                    .like(TrialSelfInspectionRecord::getRecordNo, dto.getQueryValue()).or()
+                                    .like(TrialSelfInspectionRecord::getReportNo, dto.getQueryValue()).or()
+                                    .like(TrialSelfInspectionRecord::getSpecificationNumber, dto.getQueryValue()).or()
+                                    .in(CollectionUtil.isNotEmpty(entrustIds),TrialSelfInspectionRecord::getEntrustId, entrustIds)
+                );
             }
             if (org.apache.commons.lang.StringUtils.isNotEmpty(dto.getStartTime()) && org.apache.commons.lang.StringUtils.isNotEmpty(dto.getEndTime())) {
                 String endTime = dto.getEndTime();