PatentStarController.java 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. package cn.cslg.pas.controller.outApi;
  2. import cn.cslg.pas.common.core.base.Constants;
  3. import cn.cslg.pas.common.dto.*;
  4. import cn.cslg.pas.common.dto.business.SelectClaimDTO;
  5. import cn.cslg.pas.common.model.cronModel.Records;
  6. import cn.cslg.pas.common.model.pythonModel.GetPatentSimilarScoreDTO;
  7. import cn.cslg.pas.common.model.pythonModel.GetPatentSimilarScoreVO;
  8. import cn.cslg.pas.common.utils.Response;
  9. import cn.cslg.pas.common.vo.QueryExternalFamilyVO;
  10. import cn.cslg.pas.common.vo.business.PatentNoVO;
  11. import cn.cslg.pas.domain.es.Text;
  12. import cn.cslg.pas.service.common.PatentStarApiService;
  13. import cn.cslg.pas.service.common.PythonApiService;
  14. import io.swagger.v3.oas.annotations.Operation;
  15. import io.swagger.v3.oas.annotations.tags.Tag;
  16. import lombok.RequiredArgsConstructor;
  17. import org.springframework.context.annotation.Lazy;
  18. import org.springframework.web.bind.annotation.*;
  19. import java.io.IOException;
  20. import java.text.ParseException;
  21. import java.util.List;
  22. import java.util.Map;
  23. @Tag(name = "专利之星接口服务类")
  24. @RestController
  25. @RequestMapping(Constants.API_XiaoSHI + "/patentStar")
  26. @RequiredArgsConstructor(onConstructor_ = {@Lazy})
  27. public class PatentStarController {
  28. private final PatentStarApiService patentStarApiService;
  29. private final PythonApiService pythonApiService;
  30. @PostMapping("/select")
  31. @Operation(summary = "一般检索接口")
  32. public Response select(@RequestBody PatentStarListDTO patentStarListDto) throws IOException {
  33. Records records = null;
  34. try {
  35. records = patentStarApiService.patentStarSearchLocal(patentStarListDto);
  36. } catch (Exception e) {
  37. return Response.error(e.getMessage());
  38. }
  39. return Response.success(records);
  40. }
  41. @GetMapping("/getCnBib")
  42. @Operation(summary = "获得中国专利著录")
  43. public String getCnBib(String appNo) {
  44. return patentStarApiService.getCnBibApi(appNo);
  45. }
  46. @GetMapping("/getPicture")
  47. @Operation(summary = "获得中国专利摘要附图")
  48. public String getPicture(String appNo) {
  49. return patentStarApiService.getPictureApi(appNo);
  50. }
  51. @GetMapping("/getWGPicture")
  52. @Operation(summary = "获得中国专利外观图")
  53. public String getWGPicture(String appNo) throws IOException {
  54. return patentStarApiService.getWGPictureApi(appNo);
  55. }
  56. @GetMapping("/getCnLegal")
  57. @Operation(summary = "获得中国专利法律状态")
  58. public String getCnLegal(String appNo) {
  59. return patentStarApiService.getCnLegalApi(appNo);
  60. }
  61. @GetMapping("/getCnPdf")
  62. @Operation(summary = "获得中国专利pdf全文")
  63. public String getCnPdf(String appNo) throws IOException {
  64. String picUrl = patentStarApiService.getCnPdfApi(appNo);
  65. return picUrl;
  66. }
  67. @GetMapping("/getCnFullXml")
  68. @Operation(summary = "获得中国专利全文文本")
  69. public String getCnFullXml(String appNo) throws IOException {
  70. return patentStarApiService.getCnFullXmlApi(appNo);
  71. }
  72. @GetMapping("/getEnPdf")
  73. @Operation(summary = "获得世界专利pdf")
  74. public String getEnPdf(String patentNo) throws IOException {
  75. return patentStarApiService.getEnPdfApi(patentNo);
  76. }
  77. @GetMapping("/getENBib")
  78. @Operation(summary = "获得世界专利著录信息")
  79. public String getENBib(String patentNo) throws IOException {
  80. String result = patentStarApiService.getENBibApi(patentNo);
  81. return result;
  82. }
  83. @GetMapping("/getFamilyByPubNo")
  84. @Operation(summary = "获得同族专利")
  85. public String getFamilyByPubNo(String patentNo) {
  86. return patentStarApiService.getFamilyByPubNoApi(patentNo);
  87. }
  88. @GetMapping("/getCitedNumByPubNo")
  89. @Operation(summary = "获得被引用次数")
  90. public String getCitedNumByPubNo(String patentNo) throws IOException {
  91. return patentStarApiService.getCitedNumByPubNoApi(patentNo);
  92. }
  93. @Operation(summary = "根据原始申请号查询外部权利要求")
  94. @GetMapping("/queryExternalClaim")
  95. public Response queryExternalClaim(String appNo) throws Exception {
  96. SelectClaimDTO dto = patentStarApiService.queryExternalClaim(appNo);
  97. return Response.success(dto);
  98. }
  99. @Operation(summary = "查询外部专利详情")
  100. @PostMapping("/queryExternalDetail")
  101. public Response queryExternalDetail(@RequestBody QueryExternalFamilyVO vo) throws Exception {
  102. PatentColumnDTO dto = null;
  103. try {
  104. dto = patentStarApiService.queryExternalDetail(vo);
  105. } catch (IOException e) {
  106. return Response.error(e.getMessage());
  107. }
  108. return Response.success(dto);
  109. }
  110. @Operation(summary = "查询外部专利同族专利")
  111. @PostMapping("/queryExternalFamily")
  112. public Response queryExternalFamily(@RequestBody QueryExternalFamilyVO vo) throws IOException {
  113. Records records = patentStarApiService.queryExternalFamily(vo);
  114. return Response.success(records);
  115. }
  116. @GetMapping("/getCnFullText")
  117. @Operation(summary = "获得中国专利说明书全文文本")
  118. public Response getCnFullText(String appNo) throws IOException {
  119. List<Text> fullText = patentStarApiService.getCnFullText(appNo);
  120. return Response.success(fullText);
  121. }
  122. @GetMapping("/getExternalTextPdf")
  123. @Operation(summary = "获得中国专利pdf全文")
  124. public Response getExternalTextPdf(String appNo,String rowApplicationNo,String publicNo,String grantNo ) throws IOException {
  125. List<InnerPatentPdfDTO> pdfDTOS = patentStarApiService.getExternalTextPdf(appNo,rowApplicationNo,publicNo,grantNo);
  126. return Response.success(pdfDTOS);
  127. }
  128. @GetMapping("/getExternalFigure")
  129. @Operation(summary = "外部获得附图")
  130. public Response getExternalFigure(String appNo) throws IOException {
  131. List<String> figures = patentStarApiService.getExternalFigure(appNo);
  132. return Response.success(figures);
  133. }
  134. @GetMapping("/getPictureGuid")
  135. @Operation(summary = "外部获取摘要附图")
  136. public Response getPictureGuid(String appNo) throws IOException {
  137. String pictureGuid = patentStarApiService.getPictureGuid(appNo);
  138. return Response.success(pictureGuid);
  139. }
  140. @GetMapping("/getLegalStatus")
  141. @Operation(summary = "外部获取法律状态")
  142. public Response getLegalStatus(String appNo) throws ParseException {
  143. ExternalLegalInfoDTO infoDTO = patentStarApiService.getLegalStatus(appNo);
  144. return Response.success(infoDTO);
  145. }
  146. @PostMapping("/getPatentSimilarMess")
  147. @Operation(summary = "获取专利相似度信息")
  148. public Response getLegalStatus(@RequestBody GetPatentSimilarScoreDTO getPatentSimilarScoreDTO) throws ParseException {
  149. GetPatentSimilarScoreVO getPatentSimilarScoreVO= pythonApiService.getPatentSimilarMess(getPatentSimilarScoreDTO);
  150. return Response.success(getPatentSimilarScoreVO);
  151. }
  152. @GetMapping("/queryPatentDetailByPatentNo")
  153. @Operation(summary = "用于窍笔根据号码获取专利检索详情数据")
  154. public Response queryPatentDetailByPatentNo(String patentNo) throws IOException {
  155. PatentInfoDTO infoDTO = patentStarApiService.queryPatentDetailByPatentNo(patentNo);
  156. return Response.success(infoDTO);
  157. }
  158. }