|
@@ -233,31 +233,36 @@ public class PatentApplicantService extends ServiceImpl<PatentApplicantMapper, P
|
|
* @param name 权利人 通过分割符 | 分割后的List
|
|
* @param name 权利人 通过分割符 | 分割后的List
|
|
* @param shortName 【标】权利人 通过分割符 | 分割后的List
|
|
* @param shortName 【标】权利人 通过分割符 | 分割后的List
|
|
*/
|
|
*/
|
|
- public List<Integer> updatePatentApplicant(List<String> name, List<String> shortName) {
|
|
|
|
|
|
+ public List<Integer> updatePatentApplicant(List<String> name, List<String> shortName,List<PatentApplicant> patentApplicantList) {
|
|
//生成一个存放ID的List
|
|
//生成一个存放ID的List
|
|
List<Integer> ids = new ArrayList<>();
|
|
List<Integer> ids = new ArrayList<>();
|
|
//判断当前名称是否为空
|
|
//判断当前名称是否为空
|
|
if (name != null) {
|
|
if (name != null) {
|
|
for (int i = 0; i < name.size(); i++) {
|
|
for (int i = 0; i < name.size(); i++) {
|
|
String s = i < shortName.size() ? shortName.get(i) : null;
|
|
String s = i < shortName.size() ? shortName.get(i) : null;
|
|
- LambdaQueryWrapper<PatentApplicant> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
- queryWrapper.eq(PatentApplicant::getName, name.get(i));
|
|
|
|
- queryWrapper.eq(PatentApplicant::getMerge, 0);
|
|
|
|
- PatentApplicant temp = this.getOne(queryWrapper);
|
|
|
|
|
|
+ String nam = name.get(i);
|
|
|
|
+ PatentApplicant temp = patentApplicantList.stream().filter(item->item.getMerge().equals(false)&&item.getName().equals(nam)).findFirst().orElse(null);
|
|
|
|
+// LambdaQueryWrapper<PatentApplicant> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
+// queryWrapper.eq(PatentApplicant::getName, name.get(i));
|
|
|
|
+// queryWrapper.eq(PatentApplicant::getMerge, 0);
|
|
|
|
+// PatentApplicant temp = this.getOne(queryWrapper);
|
|
if (temp == null) {
|
|
if (temp == null) {
|
|
temp = this.add(name.get(i), s);
|
|
temp = this.add(name.get(i), s);
|
|
} else if (s != null && !s.equals(temp.getShortName())) {
|
|
} else if (s != null && !s.equals(temp.getShortName())) {
|
|
temp.setShortName(s);
|
|
temp.setShortName(s);
|
|
temp.updateById();
|
|
temp.updateById();
|
|
}
|
|
}
|
|
- ids.add(temp.getId());
|
|
|
|
|
|
+ if(!ids.contains(temp.getId()))
|
|
|
|
+ { ids.add(temp.getId());}
|
|
|
|
+
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
for (String s : shortName) {
|
|
for (String s : shortName) {
|
|
- LambdaQueryWrapper<PatentApplicant> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
- queryWrapper.eq(PatentApplicant::getShortName, s);
|
|
|
|
- queryWrapper.eq(PatentApplicant::getMerge, 0);
|
|
|
|
- List<PatentApplicant> temp = this.list(queryWrapper);
|
|
|
|
|
|
+ List<PatentApplicant> temp = patentApplicantList.stream().filter(item->item.getMerge().equals(0)&&item.getName().equals(s)).collect(Collectors.toList());
|
|
|
|
+// LambdaQueryWrapper<PatentApplicant> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
+// queryWrapper.eq(PatentApplicant::getShortName, s);
|
|
|
|
+// queryWrapper.eq(PatentApplicant::getMerge, 0);
|
|
|
|
+// List<PatentApplicant> temp = this.list(queryWrapper);
|
|
|
|
|
|
PatentApplicant patentApplicant = new PatentApplicant();
|
|
PatentApplicant patentApplicant = new PatentApplicant();
|
|
if (temp.size() == 0) {
|
|
if (temp.size() == 0) {
|
|
@@ -275,7 +280,8 @@ public class PatentApplicantService extends ServiceImpl<PatentApplicantMapper, P
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- ids.add(patentApplicant.getId());
|
|
|
|
|
|
+ if(!ids.contains(patentApplicant.getId())){ids.add(patentApplicant.getId());}
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|