|
|
@ -81,6 +81,7 @@ public class SampleProofTrackingServiceImpl implements SampleProofTrackingServic |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public PageUtils searchProofTracking(ProofTrackingData data) { |
|
|
public PageUtils searchProofTracking(ProofTrackingData data) { |
|
|
|
|
|
normalizeSearchProofingStatusFilters(data); |
|
|
long page = data.getPage() <= 0 ? 1 : data.getPage(); |
|
|
long page = data.getPage() <= 0 ? 1 : data.getPage(); |
|
|
long limit = data.getLimit() <= 0 ? 20 : data.getLimit(); |
|
|
long limit = data.getLimit() <= 0 ? 20 : data.getLimit(); |
|
|
IPage<ProofTrackingData> result = |
|
|
IPage<ProofTrackingData> result = |
|
|
@ -107,6 +108,7 @@ public class SampleProofTrackingServiceImpl implements SampleProofTrackingServic |
|
|
if (data == null) { |
|
|
if (data == null) { |
|
|
throw new RuntimeException("导出参数不能为空"); |
|
|
throw new RuntimeException("导出参数不能为空"); |
|
|
} |
|
|
} |
|
|
|
|
|
normalizeSearchProofingStatusFilters(data); |
|
|
if (isBlank(data.getSite())) { |
|
|
if (isBlank(data.getSite())) { |
|
|
throw new RuntimeException("工厂不能为空"); |
|
|
throw new RuntimeException("工厂不能为空"); |
|
|
} |
|
|
} |
|
|
@ -2759,6 +2761,37 @@ public class SampleProofTrackingServiceImpl implements SampleProofTrackingServic |
|
|
return "system"; |
|
|
return "system"; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void normalizeSearchProofingStatusFilters(ProofTrackingData data) { |
|
|
|
|
|
if (data == null) { |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
if (!isBlank(data.getProofingStatus())) { |
|
|
|
|
|
data.setProofingStatus(data.getProofingStatus().trim()); |
|
|
|
|
|
} else { |
|
|
|
|
|
data.setProofingStatus(null); |
|
|
|
|
|
} |
|
|
|
|
|
List<String> sourceStatusList = data.getProofingStatusList(); |
|
|
|
|
|
if (sourceStatusList == null || sourceStatusList.isEmpty()) { |
|
|
|
|
|
data.setProofingStatusList(null); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
List<String> normalizedStatusList = new ArrayList<>(); |
|
|
|
|
|
Set<String> usedStatusSet = new LinkedHashSet<>(); |
|
|
|
|
|
for (String oneStatus : sourceStatusList) { |
|
|
|
|
|
if (isBlank(oneStatus)) { |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
String normalizedStatus = oneStatus.trim(); |
|
|
|
|
|
String statusKey = normalizedStatus.toLowerCase(); |
|
|
|
|
|
if (usedStatusSet.contains(statusKey)) { |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
usedStatusSet.add(statusKey); |
|
|
|
|
|
normalizedStatusList.add(normalizedStatus); |
|
|
|
|
|
} |
|
|
|
|
|
data.setProofingStatusList(normalizedStatusList.isEmpty() ? null : normalizedStatusList); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
private boolean isBlank(String value) { |
|
|
private boolean isBlank(String value) { |
|
|
return value == null || value.trim().isEmpty(); |
|
|
return value == null || value.trim().isEmpty(); |
|
|
} |
|
|
} |
|
|
|