|
@@ -31,6 +31,8 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
import java.io.File;
|
|
|
import java.io.FileOutputStream;
|
|
|
import java.util.*;
|
|
|
+import java.util.regex.Matcher;
|
|
|
+import java.util.regex.Pattern;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
@@ -65,9 +67,20 @@ public class PatentInstructionService extends ServiceImpl<PatentInstructionMappe
|
|
|
}
|
|
|
|
|
|
public List<PatentInstruction> getPatentInstructionByPatentNo(String patentNo) {
|
|
|
- LambdaQueryWrapper<PatentInstruction> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
- queryWrapper.eq(PatentInstruction::getPatentNo, patentNo);
|
|
|
- return this.list(queryWrapper);
|
|
|
+ StringBuilder str = new StringBuilder(patentNo);
|
|
|
+ Matcher matcher = Pattern.compile("[A-Za-z]").matcher(str.reverse());
|
|
|
+ String patentNoByProcess;
|
|
|
+ if (matcher.find()) {
|
|
|
+ StringBuilder reverse = new StringBuilder(str.substring(matcher.start() + 1, str.length())).reverse();
|
|
|
+ patentNoByProcess = reverse.toString();
|
|
|
+ LambdaQueryWrapper<PatentInstruction> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.like(PatentInstruction::getPatentNo, patentNoByProcess);
|
|
|
+ return this.list(queryWrapper);
|
|
|
+ } else {
|
|
|
+ LambdaQueryWrapper<PatentInstruction> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(PatentInstruction::getPatentNo, patentNo);
|
|
|
+ return this.list(queryWrapper);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public List<PatentInstruction> getPatentInstructionByPatentNo(List<String> patentNo) {
|
|
@@ -86,6 +99,26 @@ public class PatentInstructionService extends ServiceImpl<PatentInstructionMappe
|
|
|
return this.getOne(queryWrapper);
|
|
|
}
|
|
|
|
|
|
+ public List<PatentInstruction> getPatentInstructionByPatentNoAndType2(String patentNo, Integer type) {
|
|
|
+ StringBuilder str = new StringBuilder(patentNo);
|
|
|
+ Matcher matcher = Pattern.compile("[A-Za-z]").matcher(str.reverse());
|
|
|
+ String patentNoByProcess;
|
|
|
+ if (matcher.find()) {
|
|
|
+ StringBuilder reverse = new StringBuilder(str.substring(matcher.start() + 1, str.length())).reverse();
|
|
|
+ patentNoByProcess = reverse.toString();
|
|
|
+ LambdaQueryWrapper<PatentInstruction> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(PatentInstruction::getType, type);
|
|
|
+ queryWrapper.like(PatentInstruction::getPatentNo, patentNoByProcess);
|
|
|
+ return this.list(queryWrapper);
|
|
|
+ } else {
|
|
|
+ LambdaQueryWrapper<PatentInstruction> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(PatentInstruction::getType, type);
|
|
|
+ queryWrapper.eq(PatentInstruction::getPatentNo, patentNo);
|
|
|
+ return this.list(queryWrapper);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
@Async("singleThreadAsyncTaskExecutor")
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public void batchUpload(String url, Integer type, String remark, Integer userId) {
|