|
@@ -22,6 +22,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.Objects;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -203,30 +204,13 @@ public class PatentInventorService extends ServiceImpl<PatentInventorMapper, Pat
|
|
patentInventor.setCountry(params.getAddressList().get(i).substring(params.getAddressList().get(i).lastIndexOf(",") + 1).replaceAll(" ", ""));
|
|
patentInventor.setCountry(params.getAddressList().get(i).substring(params.getAddressList().get(i).lastIndexOf(",") + 1).replaceAll(" ", ""));
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- patentInventor.setAddress("");
|
|
|
|
|
|
+ if (patentInventor.getAddress() == null || patentInventor.getAddress().equals("")) {
|
|
|
|
+ patentInventor.setAddress("");
|
|
|
|
+ patentInventor.setCountry("");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
-
|
|
|
|
- //patentInventor.setType(PatentUtils.getIntKeyByOrganType(name));
|
|
|
|
dataList.add(patentInventor);
|
|
dataList.add(patentInventor);
|
|
}
|
|
}
|
|
-// if (StringUtils.isNotEmpty(params.getFirstAddress())) {
|
|
|
|
-// PatentInventor patentInventor = patentInventorList.stream().filter(PatentInventor::getFirst).findFirst().orElse(null);
|
|
|
|
-// if (patentInventor != null) {
|
|
|
|
-// patentInventor.setAddress(params.getFirstAddress().replaceAll(" ", ""));
|
|
|
|
-// patentInventor.setCountry(params.getFirstAddress().substring(params.getFirstAddress().lastIndexOf(",") + 1).replaceAll(" ", ""));
|
|
|
|
-// patentInventor.updateById();
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// List<PatentInventor> dataList = params.getNameList().stream().map(name -> {
|
|
|
|
-// PatentInventor patentInventor = this.getPatentInventorByName(name);
|
|
|
|
-// if (patentInventor == null) {
|
|
|
|
-// patentInventor = new PatentInventor();
|
|
|
|
-// }
|
|
|
|
-// patentInventor.setName(name);
|
|
|
|
-// patentInventor.setMerge(false);
|
|
|
|
-// patentInventor.setType(PatentUtils.getIntKeyByOrganType(name));
|
|
|
|
-// return patentInventor;
|
|
|
|
-// }).collect(Collectors.toList());
|
|
|
|
this.saveOrUpdateBatch(dataList);
|
|
this.saveOrUpdateBatch(dataList);
|
|
PatentInventor first = dataList.stream().filter(item -> item.getName().equals(params.getFirstName())).findFirst().orElse(null);
|
|
PatentInventor first = dataList.stream().filter(item -> item.getName().equals(params.getFirstName())).findFirst().orElse(null);
|
|
patentInventorLinkService.updatePatentInventLink(dataList.stream().map(PatentInventor::getId).collect(Collectors.toList()), params.getPatentId(), first == null ? 0 : first.getId());
|
|
patentInventorLinkService.updatePatentInventLink(dataList.stream().map(PatentInventor::getId).collect(Collectors.toList()), params.getPatentId(), first == null ? 0 : first.getId());
|