xiexiang 1 yıl önce
ebeveyn
işleme
4021ad0228

+ 0 - 10
src/main/java/cn/cslg/pas/common/dto/business/ReferencesDTO.java

@@ -33,14 +33,4 @@ public class ReferencesDTO {
      * 参考资料名称
      */
     private String referencesName;
-
-    /**
-     * 创建人id
-     */
-    private String createId;
-
-    /**
-     * 创建时间
-     */
-    private Date createTime;
 }

+ 0 - 10
src/main/java/cn/cslg/pas/common/dto/business/ReferencesUpdateDTO.java

@@ -36,14 +36,4 @@ public class ReferencesUpdateDTO {
      * 参考资料名称
      */
     private String referencesName;
-
-    /**
-     * 创建人id
-     */
-    private String createId;
-
-    /**
-     * 创建时间
-     */
-    private Date createTime;
 }

+ 26 - 5
src/main/java/cn/cslg/pas/controller/ReferencesController.java

@@ -1,17 +1,17 @@
 package cn.cslg.pas.controller;
 
 import cn.cslg.pas.common.core.base.Constants;
-import cn.cslg.pas.common.dto.business.PatentDigProjectTaskDTO;
 import cn.cslg.pas.common.dto.business.ReferencesDTO;
+import cn.cslg.pas.common.dto.business.ReferencesUpdateDTO;
 import cn.cslg.pas.common.utils.Response;
+import cn.cslg.pas.common.vo.business.ReferencesVO;
 import cn.cslg.pas.service.business.ReferencesService;
 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.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
 
 /**
  * @Author xiexiang
@@ -30,4 +30,25 @@ public class ReferencesController {
         Integer id = referencesService.add(referencesDTO);
         return Response.success(id);
     }
+
+    @Operation(summary = "更新报告文档")
+    @PostMapping("/updateReferences")
+    public Response updateReferences(@RequestBody ReferencesUpdateDTO referencesUpdateDTO) {
+        Integer id = referencesService.update(referencesUpdateDTO);
+        return Response.success(id);
+    }
+
+    @Operation(summary = "查报告文档")
+    @GetMapping("/getReferences")
+    public Response getReferences(Integer projectId) {
+        List<ReferencesVO> referencesVOS = referencesService.query(projectId);
+        return Response.success(referencesVOS);
+    }
+
+    @Operation(summary = "删除报告文档")
+    @PostMapping("/deleteReferences")
+    public Response deleteReferences(@RequestBody List<Integer> ids) {
+        referencesService.delete(ids);
+        return Response.success("删除成功");
+    }
 }

+ 3 - 1
src/main/java/cn/cslg/pas/service/business/ReferencesService.java

@@ -77,7 +77,9 @@ public class ReferencesService extends ServiceImpl<ReferencesMapper, References>
     }
 
     public void delete(List<Integer> ids){
-        this.removeBatchByIds(ids);
+        if (!ids.isEmpty()) {
+            this.removeBatchByIds(ids);
+        }
     }
 
     public List<ReferencesVO> query(Integer projectId){