|
@@ -13,7 +13,6 @@ import cn.cslg.pas.domain.PatentApplicantLink;
|
|
|
import cn.cslg.pas.domain.PatentApplicantMergeLink;
|
|
|
import cn.cslg.pas.domain.SystemDict;
|
|
|
import cn.cslg.pas.mapper.PatentApplicantMapper;
|
|
|
-import cn.dev33.satoken.stp.StpUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
@@ -40,7 +39,6 @@ import java.util.stream.Collectors;
|
|
|
public class PatentApplicantService extends ServiceImpl<PatentApplicantMapper, PatentApplicant> {
|
|
|
|
|
|
private final PatentApplicantLinkService patentApplicantLinkService;
|
|
|
- private final ProjectPatentLinkService projectPatentLinkService;
|
|
|
private final PatentApplicantMergeLinkService patentApplicantMergeLinkService;
|
|
|
private final AreaService areaService;
|
|
|
private final SystemDictService systemDictService;
|
|
@@ -96,9 +94,7 @@ public class PatentApplicantService extends ServiceImpl<PatentApplicantMapper, P
|
|
|
public IPage<PatentApplicant> getPageList(PatentApplicantVO params) {
|
|
|
IPage<PatentApplicant> pageList = baseMapper.getPageList(new Page<>(params.getCurrent(), params.getSize()), params);
|
|
|
List<SystemDict> systemDictList = systemDictService.getSystemDictListByType(Collections.singletonList("COUNTRIES"));
|
|
|
- pageList.getRecords().forEach(item -> {
|
|
|
- item.setCountryName(systemDictList.stream().filter(systemDict -> systemDict.getValue().equals(item.getCountry())).findFirst().orElse(new SystemDict()).getLabel());
|
|
|
- });
|
|
|
+ pageList.getRecords().forEach(item -> item.setCountryName(systemDictList.stream().filter(systemDict -> systemDict.getValue().equals(item.getCountry())).findFirst().orElse(new SystemDict()).getLabel()));
|
|
|
return pageList;
|
|
|
}
|
|
|
|
|
@@ -238,8 +234,9 @@ public class PatentApplicantService extends ServiceImpl<PatentApplicantMapper, P
|
|
|
* @param shortName 【标】权利人 通过分割符 | 分割后的List
|
|
|
*/
|
|
|
public List<Integer> updatePatentApplicant(List<String> name, List<String> shortName) {
|
|
|
- //生成 一个存放ID的List
|
|
|
+ //生成一个存放ID的List
|
|
|
List<Integer> ids = new ArrayList<>();
|
|
|
+ //判断当前名称是否为空
|
|
|
if (name != null) {
|
|
|
for (int i = 0; i < name.size(); i++) {
|
|
|
String s = i < shortName.size() ? shortName.get(i) : null;
|
|
@@ -258,17 +255,27 @@ public class PatentApplicantService extends ServiceImpl<PatentApplicantMapper, P
|
|
|
} else {
|
|
|
for (String s : shortName) {
|
|
|
LambdaQueryWrapper<PatentApplicant> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
- queryWrapper.eq(PatentApplicant::getName, "");
|
|
|
queryWrapper.eq(PatentApplicant::getShortName, s);
|
|
|
queryWrapper.eq(PatentApplicant::getMerge, 0);
|
|
|
- PatentApplicant temp = this.getOne(queryWrapper);
|
|
|
- if (temp == null) {
|
|
|
- temp = this.add("", s);
|
|
|
- } else if (s != null && !s.equals(temp.getShortName())) {
|
|
|
- temp.setShortName(s);
|
|
|
- temp.updateById();
|
|
|
+ List<PatentApplicant> temp = this.list(queryWrapper);
|
|
|
+
|
|
|
+ PatentApplicant patentApplicant = new PatentApplicant();
|
|
|
+ if (temp.size() == 0) {
|
|
|
+ patentApplicant = this.add(s, s);
|
|
|
+ } else {
|
|
|
+ if (temp.size() == 1) {
|
|
|
+ patentApplicant = temp.get(0);
|
|
|
+ } else {
|
|
|
+ for (PatentApplicant pa : temp) {
|
|
|
+ if (pa.getShortName().equals(pa.getName())) {
|
|
|
+ patentApplicant = pa;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- ids.add(temp.getId());
|
|
|
+
|
|
|
+ ids.add(patentApplicant.getId());
|
|
|
}
|
|
|
}
|
|
|
|