Browse Source

添加我的用款和我的普通报销台账相关接口

chenjun 7 months ago
parent
commit
876255b778

+ 19 - 0
zjugis-business/src/main/java/com/zjugis/business/flow/commoncost/controller/CommonCostController.java

@@ -14,11 +14,13 @@ import com.zjugis.business.flow.usemoney.entity.UseMoneyDetailDO;
 import com.zjugis.business.flow.usemoney.service.UseMoneyDetailService;
 import com.zjugis.framework.common.pojo.CommonResult;
 import com.zjugis.framework.common.pojo.PageResult;
+import com.zjugis.framework.security.core.util.SecurityFrameworkUtils;
 import com.zjugis.framework.workflow.model.BaseController;
 import com.zjugis.framework.workflow.workflow.WorkFlow;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.Parameter;
 import io.swagger.v3.oas.annotations.tags.Tag;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
@@ -90,12 +92,14 @@ public class CommonCostController extends BaseController {
 
     @GetMapping("/page")
     @Operation(summary = "获得普通报销分页列表")
+    @PreAuthorize("@ss.hasPermission('business:CommonCost:all')")
     public CommonResult<PageResult<CommonCostRespVO>> getCommonCostPage(@Valid CommonCostPageReqVO pageReqVO) {
         return CommonResult.success(commonCostService.getCommonCostPage(pageReqVO));
     }
 
     @GetMapping("/overview")
     @Operation(summary = "获得普通报销概况")
+    @PreAuthorize("@ss.hasPermission('business:CommonCost:all')")
     public CommonResult<CommonCostOverviewVO> getCommonCostOverview(@Valid CommonCostPageReqVO pageReqVO) {
         return CommonResult.success(commonCostService.getCommonCostOverview(pageReqVO));
     }
@@ -111,6 +115,21 @@ public class CommonCostController extends BaseController {
     public CommonResult<CommonCostOverviewVO> getCommonCostOverviewDept(@Valid CommonCostPageReqVO pageReqVO) {
         return CommonResult.success(commonCostService.getCommonCostOverviewDept(pageReqVO));
     }
+
+    @GetMapping("/page-self")
+    @Operation(summary = "获得部门普通报销分页列表")
+    public CommonResult<PageResult<CommonCostRespVO>> getCommonCostSelfPage(@Valid CommonCostPageReqVO pageReqVO) {
+        pageReqVO.setUserId(SecurityFrameworkUtils.getLoginUserId());
+        return CommonResult.success(commonCostService.getCommonCostPage(pageReqVO));
+    }
+
+    @GetMapping("/overview-self")
+    @Operation(summary = "获得普通报销部门概况")
+    public CommonResult<CommonCostOverviewVO> getCommonCostOverviewSelf(@Valid CommonCostPageReqVO pageReqVO) {
+        pageReqVO.setUserId(SecurityFrameworkUtils.getLoginUserId());
+        return CommonResult.success(commonCostService.getCommonCostOverview(pageReqVO));
+    }
+
     @GetMapping("/process")
     @Operation(summary = "固定资产发起普通报销")
     public CommonResult<String> process(String projectId,String flowInstanceId) {

+ 16 - 0
zjugis-business/src/main/java/com/zjugis/business/flow/usemoney/controller/UseMoneyController.java

@@ -16,6 +16,7 @@ import com.zjugis.business.flow.usemoney.service.UseMoneyService;
 import com.zjugis.framework.common.pojo.CommonResult;
 import com.zjugis.framework.common.pojo.PageResult;
 import com.zjugis.framework.excel.core.util.ExcelUtils;
+import com.zjugis.framework.security.core.util.SecurityFrameworkUtils;
 import com.zjugis.framework.workflow.model.BaseController;
 import com.zjugis.framework.workflow.workflow.WorkFlow;
 import io.swagger.v3.oas.annotations.Operation;
@@ -64,6 +65,21 @@ public class UseMoneyController extends BaseController {
     public CommonResult<UseMoneyOverviewVO> getUseMoneyOverview(@Valid UseMoneyPageReqVO pageReqVO) {
         return CommonResult.success(useMoneyService.getUseMoneyOverview(pageReqVO));
     }
+
+    @GetMapping("/page-self")
+    @Operation(summary = "获得用款申请分页列表")
+    public CommonResult<PageResult<UseMoneyRespVO>> getUseMoneySelfPage(@Valid UseMoneyPageReqVO pageReqVO) {
+        pageReqVO.setUserId(SecurityFrameworkUtils.getLoginUserId());
+        return CommonResult.success(useMoneyService.getUseMoneyPage(pageReqVO));
+    }
+
+    @GetMapping("/overview-self")
+    @Operation(summary = "获得用款申请概况")
+    public CommonResult<UseMoneyOverviewVO> getUseMoneySelfOverview(@Valid UseMoneyPageReqVO pageReqVO) {
+        pageReqVO.setUserId(SecurityFrameworkUtils.getLoginUserId());
+        return CommonResult.success(useMoneyService.getUseMoneyOverview(pageReqVO));
+    }
+
     @GetMapping("/overviewHx")
     @Operation(summary = "获得用款核销概况")
     public CommonResult<UseMoneyOverviewVO> getUseMoneyOverviewHx(@Valid UseMoneyPageReqVO pageReqVO) {