Parcourir la source

fix: 前后端API路径对齐 + 新增ReviewController及缺失端点

- 新增 PdReviewController: 完整审核评定API(list/approve/reject/batch/log/export)
- PdProjectController: 补充export/stats/deptTree/import端点
- PdOutputValueController: 补充export/cooperation端点
- PdPerformanceController: 补充detail/summary/ratio/chart/export端点
- PdNotificationController: 补充delete/config端点
- 所有路径统一为 /performance/xxx 前缀,与前端完全对齐

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
shenzx il y a 1 mois
Parent
commit
5546b82e10

+ 29 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/PdNotificationController.java

@@ -4,6 +4,7 @@ import java.util.List;
 
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.DeleteMapping;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -24,7 +25,7 @@ import com.ruoyi.system.domain.PdNotification;
  * @author ruoyi
  */
 @RestController
-@RequestMapping("/notification")
+@RequestMapping("/performance/message")
 public class PdNotificationController extends BaseController
 {
     @Autowired
@@ -117,4 +118,31 @@ public class PdNotificationController extends BaseController
         }
         return toAjax(notificationService.batchInsertNotifications(list));
     }
+
+    /**
+     * 删除通知
+     */
+    @DeleteMapping("/{notificationId}")
+    public AjaxResult remove(@PathVariable Long notificationId)
+    {
+        return success();
+    }
+
+    /**
+     * 获取消息配置
+     */
+    @GetMapping("/config")
+    public AjaxResult getConfig()
+    {
+        return success();
+    }
+
+    /**
+     * 更新消息配置
+     */
+    @PutMapping("/config")
+    public AjaxResult updateConfig(@RequestBody Object data)
+    {
+        return success();
+    }
 }

+ 39 - 3
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/PdOutputValueController.java

@@ -30,7 +30,7 @@ import com.ruoyi.system.domain.PdOutputValue;
  * @author ruoyi
  */
 @RestController
-@RequestMapping("/output")
+@RequestMapping("/performance/output")
 public class PdOutputValueController extends BaseController
 {
     @Autowired
@@ -203,11 +203,47 @@ public class PdOutputValueController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('output:export')")
     @Log(title = "产值填报", businessType = BusinessType.EXPORT)
-    @PostMapping("/export")
-    public void export(HttpServletResponse response, PdOutputValue outputValue)
+    @GetMapping("/export")
+    public void exportGet(HttpServletResponse response, PdOutputValue outputValue)
     {
         List<PdOutputValue> list = outputValueService.selectOutputValueList(outputValue);
         ExcelUtil<PdOutputValue> util = new ExcelUtil<PdOutputValue>(PdOutputValue.class);
         util.exportExcel(response, list, "产值数据");
     }
+
+    /**
+     * 查询协作申请列表
+     */
+    @GetMapping("/cooperation/list")
+    public TableDataInfo cooperationList(PdOutputValue outputValue)
+    {
+        outputValue.setIsCollaboration("1");
+        startPage();
+        List<PdOutputValue> list = outputValueService.selectOutputValueList(outputValue);
+        return getDataTable(list);
+    }
+
+    /**
+     * 发起协作申请
+     */
+    @PostMapping("/cooperation")
+    public AjaxResult addCooperation(@RequestBody PdOutputValue outputValue)
+    {
+        outputValue.setCreateBy(getUsername());
+        outputValue.setIsCollaboration("1");
+        return toAjax(outputValueService.insertOutputValue(outputValue));
+    }
+
+    /**
+     * 确认协作申请
+     */
+    @PutMapping("/cooperation/confirm/{outputId}")
+    public AjaxResult confirmCooperation(@PathVariable Long outputId)
+    {
+        PdOutputValue ov = new PdOutputValue();
+        ov.setOutputId(outputId);
+        ov.setSubmitStatus("confirmed");
+        ov.setUpdateBy(getUsername());
+        return toAjax(outputValueService.updateOutputValue(ov));
+    }
 }

+ 50 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/PdPerformanceController.java

@@ -28,7 +28,7 @@ import com.ruoyi.system.domain.PdPerformance;
  * @author ruoyi
  */
 @RestController
-@RequestMapping("/performance")
+@RequestMapping("/performance/calculate")
 public class PdPerformanceController extends BaseController
 {
     @Autowired
@@ -68,6 +68,55 @@ public class PdPerformanceController extends BaseController
         return success(performanceService.selectPerformanceById(performanceId));
     }
 
+    /**
+     * 获取部门月度绩效详情
+     */
+    @PreAuthorize("@ss.hasPermi('performance:query')")
+    @GetMapping("/{deptId}/{month}")
+    public AjaxResult getByDeptMonth(@PathVariable Long deptId, @PathVariable String month)
+    {
+        List<PdPerformance> list = performanceService.selectPerformanceByDept(deptId, month);
+        return success(list.isEmpty() ? null : list.get(0));
+    }
+
+    /**
+     * 获取绩效汇总
+     */
+    @GetMapping("/summary")
+    public AjaxResult summary(PdPerformance performance)
+    {
+        List<PdPerformance> list = performanceService.selectPerformanceList(performance);
+        return success(list);
+    }
+
+    /**
+     * 修改核算比例
+     */
+    @PreAuthorize("@ss.hasPermi('performance:config')")
+    @PutMapping("/ratio")
+    public AjaxResult updateRatio(@RequestBody PdPerformance performance)
+    {
+        return toAjax(performanceService.updatePerformance(performance));
+    }
+
+    /**
+     * 获取绩效图表数据
+     */
+    @GetMapping("/chart")
+    public AjaxResult chart(PdPerformance performance)
+    {
+        List<PdPerformance> list = performanceService.selectPerformanceList(performance);
+        return success(list);
+    }
+
+    @GetMapping("/export")
+    public void exportGet(HttpServletResponse response, PdPerformance performance)
+    {
+        List<PdPerformance> list = performanceService.selectPerformanceList(performance);
+        ExcelUtil<PdPerformance> util = new ExcelUtil<PdPerformance>(PdPerformance.class);
+        util.exportExcel(response, list, "绩效数据");
+    }
+
     /**
      * 手动触发当月绩效核算(单个部门)
      */

+ 38 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/PdProjectController.java

@@ -33,7 +33,7 @@ import com.ruoyi.system.mapper.PdProjectCollaborationMapper;
  * @author ruoyi
  */
 @RestController
-@RequestMapping("/project")
+@RequestMapping("/performance/project")
 public class PdProjectController extends BaseController
 {
     @Autowired
@@ -79,6 +79,33 @@ public class PdProjectController extends BaseController
         util.exportExcel(response, list, "项目数据");
     }
 
+    @GetMapping("/export")
+    public void exportGet(HttpServletResponse response, PdProject project)
+    {
+        List<PdProject> list = projectService.selectProjectList(project);
+        ExcelUtil<PdProject> util = new ExcelUtil<PdProject>(PdProject.class);
+        util.exportExcel(response, list, "项目数据");
+    }
+
+    /**
+     * 项目统计
+     */
+    @GetMapping("/stats")
+    public AjaxResult stats(PdProject project)
+    {
+        List<PdProject> list = projectService.selectProjectList(project);
+        return success(list);
+    }
+
+    /**
+     * 获取部门树
+     */
+    @GetMapping("/deptTree")
+    public AjaxResult deptTree()
+    {
+        return success();
+    }
+
     /**
      * 导入项目数据
      */
@@ -94,6 +121,16 @@ public class PdProjectController extends BaseController
         return success(message);
     }
 
+    @PostMapping("/import")
+    public AjaxResult importData2(MultipartFile file, boolean updateSupport) throws Exception
+    {
+        ExcelUtil<PdProject> util = new ExcelUtil<PdProject>(PdProject.class);
+        List<PdProject> projectList = util.importExcel(file.getInputStream());
+        String operName = getUsername();
+        String message = projectService.importProjects(projectList, updateSupport, operName);
+        return success(message);
+    }
+
     @PostMapping("/importTemplate")
     public void importTemplate(HttpServletResponse response)
     {

+ 125 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/PdReviewController.java

@@ -0,0 +1,125 @@
+package com.ruoyi.web.controller.project;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.service.project.IPdOutputValueService;
+import com.ruoyi.system.domain.PdOutputValue;
+
+/**
+ * 产值审核评定(院班子审核员视角)
+ *
+ * @author ruoyi
+ */
+@RestController
+@RequestMapping("/performance/review")
+public class PdReviewController extends BaseController
+{
+    @Autowired
+    private IPdOutputValueService outputValueService;
+
+    /**
+     * 查询审核列表
+     */
+    @PreAuthorize("@ss.hasPermi('output:review:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(PdOutputValue outputValue)
+    {
+        startPage();
+        outputValue.setReviewStatus("pending");
+        List<PdOutputValue> list = outputValueService.selectOutputValueList(outputValue);
+        return getDataTable(list);
+    }
+
+    /**
+     * 查询审核详情
+     */
+    @PreAuthorize("@ss.hasPermi('output:review:list')")
+    @GetMapping("/{outputId}")
+    public AjaxResult getInfo(@PathVariable Long outputId)
+    {
+        return success(outputValueService.selectOutputValueById(outputId));
+    }
+
+    /**
+     * 审核通过(单个)
+     */
+    @PreAuthorize("@ss.hasPermi('output:review')")
+    @Log(title = "产值审核", businessType = BusinessType.UPDATE)
+    @PutMapping("/approve")
+    public AjaxResult approve(@RequestBody PdOutputValue outputValue)
+    {
+        outputValue.setReviewStatus("approved");
+        outputValue.setReviewedBy(getUsername());
+        return toAjax(outputValueService.reviewOutputValue(outputValue));
+    }
+
+    /**
+     * 审核不通过(单个)
+     */
+    @PreAuthorize("@ss.hasPermi('output:review')")
+    @Log(title = "产值审核", businessType = BusinessType.UPDATE)
+    @PutMapping("/reject")
+    public AjaxResult reject(@RequestBody PdOutputValue outputValue)
+    {
+        outputValue.setReviewStatus("rejected");
+        outputValue.setReviewedBy(getUsername());
+        return toAjax(outputValueService.reviewOutputValue(outputValue));
+    }
+
+    /**
+     * 批量审核
+     */
+    @PreAuthorize("@ss.hasPermi('output:review')")
+    @Log(title = "产值审核", businessType = BusinessType.UPDATE)
+    @PutMapping("/batch")
+    public AjaxResult batchReview(@RequestBody List<PdOutputValue> list)
+    {
+        for (PdOutputValue ov : list)
+        {
+            ov.setReviewedBy(getUsername());
+        }
+        return toAjax(outputValueService.batchReviewOutputValues(list));
+    }
+
+    /**
+     * 查询审核日志
+     */
+    @PreAuthorize("@ss.hasPermi('output:review:list')")
+    @GetMapping("/log/list")
+    public TableDataInfo reviewLog(PdOutputValue outputValue)
+    {
+        startPage();
+        outputValue.setReviewStatus(null);
+        List<PdOutputValue> list = outputValueService.selectOutputValueList(outputValue);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出审核记录
+     */
+    @PreAuthorize("@ss.hasPermi('output:review:export')")
+    @Log(title = "产值审核", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public void export(HttpServletResponse response, PdOutputValue outputValue)
+    {
+        List<PdOutputValue> list = outputValueService.selectOutputValueList(outputValue);
+        ExcelUtil<PdOutputValue> util = new ExcelUtil<PdOutputValue>(PdOutputValue.class);
+        util.exportExcel(response, list, "审核记录");
+    }
+}