|
@@ -0,0 +1,133 @@
|
|
|
+package cn.cslg.pas.controller;
|
|
|
+
|
|
|
+import cn.cslg.pas.common.core.base.Constants;
|
|
|
+import cn.cslg.pas.common.dto.business.GetFeatureSplitDTO;
|
|
|
+import cn.cslg.pas.common.dto.business.ProductMessageDTO;
|
|
|
+import cn.cslg.pas.common.dto.business.TortCompareRecordDTO;
|
|
|
+import cn.cslg.pas.common.dto.business.TortTaskDTO;
|
|
|
+import cn.cslg.pas.common.model.cronModel.Records;
|
|
|
+import cn.cslg.pas.common.utils.Response;
|
|
|
+import cn.cslg.pas.common.vo.business.ProductMessageVO;
|
|
|
+import cn.cslg.pas.common.vo.business.TortCompareRecordVO;
|
|
|
+import cn.cslg.pas.exception.ConditionException;
|
|
|
+import cn.cslg.pas.exception.UnLoginException;
|
|
|
+import cn.cslg.pas.exception.XiaoShiException;
|
|
|
+import cn.cslg.pas.service.business.ProductMessageService;
|
|
|
+import cn.cslg.pas.service.business.ProjectTaskService;
|
|
|
+import cn.cslg.pas.service.business.TortCompareRecordService;
|
|
|
+import io.swagger.v3.oas.annotations.Operation;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 权利要求管理
|
|
|
+ * @Author lrj
|
|
|
+ * @Date 2024/3/25
|
|
|
+ */
|
|
|
+@Slf4j
|
|
|
+@RequestMapping(Constants.API_XiaoSHI + "/claimManage")
|
|
|
+@RestController
|
|
|
+public class ClaimsManageController {
|
|
|
+ @Autowired
|
|
|
+ private ProductMessageService productMessageService;
|
|
|
+ @Autowired
|
|
|
+ private TortCompareRecordService tortCompareRecordService;
|
|
|
+ @Autowired
|
|
|
+ private ProjectTaskService projectTaskService;
|
|
|
+
|
|
|
+ @Operation(summary = "编辑/保存标的产品信息")
|
|
|
+ @PostMapping("/addProductMessage")
|
|
|
+ public Response addProductMessage(@RequestBody ProductMessageDTO productMessageDTO){
|
|
|
+ Integer id = productMessageService.addOrUpdateProductMessage(productMessageDTO);
|
|
|
+ Records records = new Records();
|
|
|
+ records.setData(id);
|
|
|
+ return Response.success(records);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Operation(summary = "查询标的产品信息")
|
|
|
+ @GetMapping("/getProductMessage")
|
|
|
+ public Response getProductMessage(Integer projectId){
|
|
|
+ Records records = new Records();
|
|
|
+ ProductMessageVO productMessageVO = productMessageService.getProductMessage(projectId);
|
|
|
+ records.setData(productMessageVO);
|
|
|
+ return Response.success(records);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Operation(summary = "保存侵权分析对比结果")
|
|
|
+ @PostMapping("/addTortCompareRecord")
|
|
|
+ public Response addTortCompareRecord(@RequestBody TortCompareRecordDTO tortCompareRecordDTO){
|
|
|
+ if (tortCompareRecordDTO != null) {
|
|
|
+ List<Integer> ids = new ArrayList<>();
|
|
|
+ try {
|
|
|
+ ids = tortCompareRecordService.addTortCompareRecord(tortCompareRecordDTO);
|
|
|
+ } catch (Exception e) {
|
|
|
+ if (e instanceof XiaoShiException) {
|
|
|
+ return Response.error(e.getMessage());
|
|
|
+ } else if (e instanceof UnLoginException) {
|
|
|
+ return Response.unLogin(e.getMessage());
|
|
|
+ } else if (e instanceof ConditionException) {
|
|
|
+ return Response.conditionError(e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Records records = new Records();
|
|
|
+ records.setData(ids);
|
|
|
+ return Response.success(records);
|
|
|
+ } else {
|
|
|
+ return Response.error("入参为null");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Operation(summary = "查询侵权分析对比结果(包含拆分特征)")
|
|
|
+ @PostMapping("/getTortCompareRecord")
|
|
|
+ public Response getTortCompareRecord(@RequestBody GetFeatureSplitDTO getFeatureSplitDTO) throws Exception {
|
|
|
+ TortCompareRecordVO tortCompareRecordVO = tortCompareRecordService.getTortCompareRecord(getFeatureSplitDTO);
|
|
|
+ return Response.success(tortCompareRecordVO);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Operation(summary = "添加侵权分析协同任务")
|
|
|
+ @PostMapping("/addTortTask")
|
|
|
+ public Response addTortTask(@RequestBody TortTaskDTO tortTaskDTO) throws Exception {
|
|
|
+ Integer id = projectTaskService.addTortTask(tortTaskDTO);
|
|
|
+ Records records = new Records();
|
|
|
+ records.setData(id);
|
|
|
+ return Response.success(records);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Operation(summary = "保存协同任务对比结果")
|
|
|
+ @PostMapping("/addTortTaskResult")
|
|
|
+ public Response addTortTaskResult(@RequestBody TortCompareRecordDTO tortCompareRecordDTO){
|
|
|
+ List<Integer> ids = tortCompareRecordService.addTortTaskResult(tortCompareRecordDTO);
|
|
|
+ Records records = new Records();
|
|
|
+ records.setData(ids);
|
|
|
+ return Response.success(records);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Operation(summary = "查询侵权分析协同前后对比结果")
|
|
|
+ @GetMapping("/getAllTortTaskResult")
|
|
|
+ public Response getAllTortTaskResult(Integer taskId){
|
|
|
+ Integer type = 1;
|
|
|
+ TortCompareRecordVO tortCompareRecordVO = tortCompareRecordService.getAllTortTaskResult(null, taskId, type);
|
|
|
+ return Response.success(tortCompareRecordVO);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Operation(summary = "保存最终对比结果")
|
|
|
+ @PostMapping("/addFinalTortResult")
|
|
|
+ public Response addFinalTortResult(@RequestBody TortCompareRecordDTO tortCompareRecordDTO){
|
|
|
+ List<Integer> ids = tortCompareRecordService.addFinalTortResult(tortCompareRecordDTO);
|
|
|
+ Records records = new Records();
|
|
|
+ records.setData(ids);
|
|
|
+ return Response.success(records);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Operation(summary = "查询最终结果")
|
|
|
+ @GetMapping("/getTortFinalResult")
|
|
|
+ public Response getTortFinalResult(Integer projectId, Integer taskId){
|
|
|
+ Integer type = 2;
|
|
|
+ TortCompareRecordVO tortCompareRecordVO = tortCompareRecordService.getAllTortTaskResult(projectId, taskId, type);
|
|
|
+ return Response.success(tortCompareRecordVO);
|
|
|
+ }
|
|
|
+}
|