|
@@ -9,6 +9,7 @@ import cn.cslg.pas.common.dto.PatentStarListDTO;
|
|
import cn.cslg.pas.common.dto.business.ContentDetailDTO;
|
|
import cn.cslg.pas.common.dto.business.ContentDetailDTO;
|
|
import cn.cslg.pas.common.dto.business.EsPatentFamilyDTO;
|
|
import cn.cslg.pas.common.dto.business.EsPatentFamilyDTO;
|
|
import cn.cslg.pas.common.dto.business.SelectClaimDTO;
|
|
import cn.cslg.pas.common.dto.business.SelectClaimDTO;
|
|
|
|
+import cn.cslg.pas.common.dto.es.DelPatentsDTO;
|
|
import cn.cslg.pas.common.dto.es.EsCustomFieldValueDTO;
|
|
import cn.cslg.pas.common.dto.es.EsCustomFieldValueDTO;
|
|
import cn.cslg.pas.common.model.request.MapRequest;
|
|
import cn.cslg.pas.common.model.request.MapRequest;
|
|
import cn.cslg.pas.common.model.request.OrderDTO;
|
|
import cn.cslg.pas.common.model.request.OrderDTO;
|
|
@@ -43,6 +44,8 @@ import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.context.annotation.Lazy;
|
|
import org.springframework.context.annotation.Lazy;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
+import org.springframework.transaction.annotation.Propagation;
|
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.util.CollectionUtils;
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
@@ -1338,6 +1341,21 @@ public class EsService {
|
|
return list;
|
|
return list;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
|
|
|
+ public Boolean deletePatents(DelPatentsDTO vo) throws IOException {
|
|
|
|
+ Integer projectId = vo.getProjectId();
|
|
|
|
+ List<String> list = vo.getPatentNos();
|
|
|
|
+ for (String patentNo : list) {
|
|
|
|
+ Integer number = this.getPatent(patentNo, projectId);
|
|
|
|
+ if (number < 1) {
|
|
|
|
+ throw new XiaoShiException("删除失败");
|
|
|
|
+ } else {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+
|
|
public Integer getPatent(String patentNo, Integer projectId) throws IOException {
|
|
public Integer getPatent(String patentNo, Integer projectId) throws IOException {
|
|
SearchRequest.Builder builder = new SearchRequest.Builder();
|
|
SearchRequest.Builder builder = new SearchRequest.Builder();
|
|
//设置查询索引
|
|
//设置查询索引
|