FeatureController.java 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. package cn.cslg.pas.controller;
  2. import cn.cslg.pas.common.core.base.Constants;
  3. import cn.cslg.pas.common.dto.QuerySplitDTO;
  4. import cn.cslg.pas.common.model.cronModel.Records;
  5. import cn.cslg.pas.common.utils.Response;
  6. import cn.cslg.pas.common.vo.business.SplitVO;
  7. import cn.cslg.pas.domain.business.ReportProject;
  8. import cn.cslg.pas.exception.XiaoShiException;
  9. import cn.cslg.pas.service.business.FeatureService;
  10. import cn.cslg.pas.service.business.ReportProjectService;
  11. import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  12. import io.swagger.v3.oas.annotations.Operation;
  13. import lombok.extern.slf4j.Slf4j;
  14. import org.springframework.beans.factory.annotation.Autowired;
  15. import org.springframework.web.bind.annotation.*;
  16. /**
  17. * 特征Controller层
  18. *
  19. * @Author lrj
  20. * @Date 2023/12/5
  21. */
  22. @Slf4j
  23. @RequestMapping(Constants.API_XiaoSHI + "/feature")
  24. @RestController
  25. public class FeatureController {
  26. @Autowired
  27. private FeatureService featureService;
  28. @Autowired
  29. private ReportProjectService reportProjectService;
  30. @Operation(summary = "拆分查询特征")
  31. @PostMapping("/spiltFeature")
  32. public Response spiltFeature(@RequestBody SplitVO splitVO) throws Exception {
  33. try {
  34. Records records = new Records();
  35. records.setData(featureService.splitPatentFeature(splitVO));
  36. return Response.success(records);
  37. } catch (Exception e) {
  38. return Response.error(e.getMessage());
  39. }
  40. }
  41. @Operation(summary = "查询拆分信息")
  42. @PostMapping("/getSplitMessage")
  43. public Response getSplitMessage(@RequestBody QuerySplitDTO splitDTO) throws Exception {
  44. try {
  45. Records records = new Records();
  46. records.setData(featureService.getSplitMessage(splitDTO));
  47. return Response.success(records);
  48. } catch (Exception e) {
  49. return Response.error(e.getMessage());
  50. }
  51. }
  52. @Operation(summary = "查询权要")
  53. @GetMapping("/getPatentRight")
  54. public Response queryCustomField(String patentNo) throws Exception {
  55. try {
  56. Records records = new Records();
  57. records.setData(featureService.getPatentRight(patentNo));
  58. return Response.success(records);
  59. } catch (Exception e) {
  60. return Response.error(e.getMessage());
  61. }
  62. }
  63. @Operation(summary = "查询权要树")
  64. @GetMapping("/getPatentRightTree")
  65. public Response getPatentRightTree(String patentNo) throws Exception {
  66. try {
  67. Records records = new Records();
  68. records.setData(featureService.getPatentRightTree(patentNo));
  69. return Response.success(records);
  70. } catch (Exception e) {
  71. return Response.error(e.getMessage());
  72. }
  73. }
  74. @Operation(summary = "查询特征")
  75. @PostMapping("/getFeatrues")
  76. public Response getFeatrues(@RequestBody SplitVO splitVO) throws Exception {
  77. try {
  78. Records records = new Records();
  79. splitVO.setIfReSplit(false);
  80. if (splitVO.getProjectId() != null) {
  81. LambdaQueryWrapper<ReportProject> queryWrapper = new LambdaQueryWrapper();
  82. queryWrapper.eq(ReportProject::getProjectId, splitVO.getProjectId());
  83. ReportProject reportProject = reportProjectService.getOne(queryWrapper, false);
  84. if (reportProject != null) {
  85. splitVO.setPatentNo(reportProject.getSignPatentNo());
  86. } else {
  87. throw new XiaoShiException("未查询到报告");
  88. }
  89. }
  90. records.setData(featureService.splitPatentFeature(splitVO));
  91. return Response.success(records);
  92. } catch (Exception e) {
  93. return Response.error(e.getMessage());
  94. }
  95. }
  96. }