From d3b5c1badd7f652c4d629a97b0c95b06607bb849 Mon Sep 17 00:00:00 2001
From: sinake <sinake1@qq.com>
Date: 星期五, 30 十月 2026 15:52:57 +0800
Subject: [PATCH] 器管回款显示列表内容调整

---
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceDonorchargeorganController.java |  104 ++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 96 insertions(+), 8 deletions(-)

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceDonorchargeorganController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceDonorchargeorganController.java
index 63356ee..e41c09b 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceDonorchargeorganController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceDonorchargeorganController.java
@@ -6,13 +6,17 @@
 import com.ruoyi.common.annotation.RepeatSubmit;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.PageDomain;
 import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.core.page.TableSupport;
 import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.common.exception.base.BaseException;
+import com.ruoyi.common.utils.PageUtils;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.bean.DtoConversionUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.project.domain.*;
+import com.ruoyi.project.domain.dto.OrganfeeExportDto;
 import com.ruoyi.project.service.IServiceDonorchargeorganService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -22,6 +26,7 @@
 import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.*;
 
+import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
@@ -44,7 +49,7 @@
      * 鏌ヨ鎹愮尞鍣ㄥ畼鍒楄〃
      */
     @ApiOperation("鏌ヨ鎹愮尞鍣ㄥ畼鍒楄〃")
-    @PreAuthorize("@ss.hasPermi('project:donorchargeorgan:list')")
+//    // @PreAuthorize("@ss.hasPermi('project:donorchargeorgan:list')")
     @GetMapping("/list")
     public TableDataInfo list(ServiceDonorchargeorgan serviceDonorchargeorgan) {
         log.info("鏌ヨ鎹愮尞鍣ㄥ畼鍒楄〃鐨勫叆鍙傦細{}", serviceDonorchargeorgan);
@@ -63,15 +68,14 @@
                 serviceDonorchargeorganVO.setAnnexFilesList(rbDetailFiles);
             }
         }
-
-        return getDataTable(serviceDonorchargeorganVOList);
+        return getDataTable2(serviceDonorchargeorganVOList, list);
     }
 
     /**
      * 瀵煎嚭鎹愮尞鍣ㄥ畼鍒楄〃
      */
     @ApiOperation("瀵煎嚭鎹愮尞鍣ㄥ畼鍒楄〃")
-    @PreAuthorize("@ss.hasPermi('project:donorchargeorgan:export')")
+//    // @PreAuthorize("@ss.hasPermi('project:donorchargeorgan:export')")
     @Log(title = "鎹愮尞鍣ㄥ畼", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(ServiceDonorchargeorgan serviceDonorchargeorgan) {
@@ -81,10 +85,82 @@
     }
 
     /**
+     * 瀵煎嚭鍣ㄥ畼璐圭敤鍒楄〃锛堟煡璇㈡潯浠朵笌鍒楄〃鎺ュ彛涓�鑷达紝鍚姤鍛婃棩鏈熷尯闂达級
+     */
+    @ApiOperation("瀵煎嚭鍣ㄥ畼璐圭敤鍒楄〃")
+    @Log(title = "鍣ㄥ畼璐圭敤", businessType = BusinessType.EXPORT)
+    @GetMapping("/exportOrganfee")
+    public AjaxResult exportOrganfee(ServiceDonorchargeorgan serviceDonorchargeorgan) {
+        log.info("瀵煎嚭鍣ㄥ畼璐圭敤鍒楄〃鐨勫叆鍙傦細{}", serviceDonorchargeorgan);
+        List<ServiceDonorchargeorgan> list = null;
+        if (Boolean.TRUE.equals(serviceDonorchargeorgan.getPaymentidIsNotNull())) {
+            list = serviceDonorchargeorganService.queryList(serviceDonorchargeorgan);
+        } else {
+            list = serviceDonorchargeorganService.queryListBypaymentidIsNull(serviceDonorchargeorgan);
+        }
+        List<OrganfeeExportDto> exportList = new ArrayList<>(list.size());
+        for (ServiceDonorchargeorgan serviceDonorchargeorganItem : list) {
+            OrganfeeExportDto exportDto = DtoConversionUtils.sourceToTarget(serviceDonorchargeorganItem, OrganfeeExportDto.class);
+            exportDto.setOrganStateName(organStateName(serviceDonorchargeorganItem.getOrganState()));
+            BigDecimal receivableBalance = receivableBalance(serviceDonorchargeorganItem.getOrgancharge(), serviceDonorchargeorganItem.getAmount());
+            exportDto.setReceivableBalance(receivableBalance);
+            exportDto.setPayStatus(payStatus(receivableBalance));
+            exportList.add(exportDto);
+        }
+        ExcelUtil<OrganfeeExportDto> util = new ExcelUtil<OrganfeeExportDto>(OrganfeeExportDto.class);
+        return util.exportExcel(exportList, "鍣ㄥ畼璐圭敤鏁版嵁");
+    }
+
+    /**
+     * 鍣ㄥ畼鐘舵�佸�艰浆鏂囨湰
+     */
+    private String organStateName(String organState) {
+        if (StringUtils.isEmpty(organState)) {
+            return "";
+        }
+        switch (organState) {
+            case "1":
+                return "绉绘";
+            case "2":
+                return "寮冪敤";
+            case "3":
+                return "搴撳瓨";
+            case "4":
+                return "澶卞姛";
+            case "5":
+                return "鐩寸郴鍏嶉櫎";
+            case "6":
+                return "涓嶈壇浜嬩欢";
+            default:
+                return organState;
+        }
+    }
+
+    /**
+     * 搴旀敹閲戦-瀹炴敹閲戦鐨勫樊棰濓紝搴旀敹閲戦涓虹┖鏃惰繑鍥� null
+     */
+    private BigDecimal receivableBalance(BigDecimal organcharge, BigDecimal amount) {
+        if (organcharge == null) {
+            return null;
+        }
+        return organcharge.subtract(amount == null ? BigDecimal.ZERO : amount);
+    }
+
+    /**
+     * 宸涓� 0 宸蹭粯锛屽叾瀹冩湭浠�
+     */
+    private String payStatus(BigDecimal receivableBalance) {
+        if (receivableBalance == null) {
+            return "";
+        }
+        return receivableBalance.compareTo(BigDecimal.ZERO) == 0 ? "宸蹭粯" : "鏈粯";
+    }
+
+    /**
      * 鑾峰彇鎹愮尞鍣ㄥ畼璇︾粏淇℃伅
      */
     @ApiOperation("鑾峰彇鎹愮尞鍣ㄥ畼璇︾粏淇℃伅")
-    @PreAuthorize("@ss.hasPermi('project:donorchargeorgan:query')")
+//    // @PreAuthorize("@ss.hasPermi('project:donorchargeorgan:query')")
     @GetMapping(value = "/getInfo/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(serviceDonorchargeorganService.getById(id));
@@ -94,7 +170,7 @@
      * 鏂板鎹愮尞鍣ㄥ畼
      */
     @ApiOperation("鏂板鎹愮尞鍣ㄥ畼")
-    @PreAuthorize("@ss.hasPermi('project:donorchargeorgan:add')")
+//    // @PreAuthorize("@ss.hasPermi('project:donorchargeorgan:add')")
     @Log(title = "鎹愮尞鍣ㄥ畼", businessType = BusinessType.INSERT)
     @PostMapping("/add")
     @RepeatSubmit
@@ -111,7 +187,7 @@
      * 淇敼鎹愮尞鍣ㄥ畼
      */
     @ApiOperation("淇敼鎹愮尞鍣ㄥ畼")
-    @PreAuthorize("@ss.hasPermi('project:donorchargeorgan:edit')")
+//    // @PreAuthorize("@ss.hasPermi('project:donorchargeorgan:edit')")
     @Log(title = "鎹愮尞鍣ㄥ畼", businessType = BusinessType.UPDATE)
     @PostMapping("/edit")
     @RepeatSubmit
@@ -127,7 +203,7 @@
      * 鍒犻櫎鎹愮尞鍣ㄥ畼
      */
     @ApiOperation("鍒犻櫎鎹愮尞鍣ㄥ畼")
-    @PreAuthorize("@ss.hasPermi('project:donorchargeorgan:remove')")
+//    // @PreAuthorize("@ss.hasPermi('project:donorchargeorgan:remove')")
     @Log(title = "鎹愮尞鍣ㄥ畼", businessType = BusinessType.DELETE)
     @GetMapping("/remove/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids) {
@@ -164,4 +240,16 @@
     public TableDataInfo getListBySpStatChange(@RequestBody SpStatChangeReq spStatChangeReq) {
         return getDataTable(serviceDonorchargeorganService.getListBySpStatChange(spStatChangeReq));
     }
+
+    /**
+     * 瀵煎嚭鏀舵缁熻
+     */
+    @ApiOperation("瀵煎嚭鏀舵缁熻")
+    @Log(title = "鏀舵缁熻", businessType = BusinessType.EXPORT)
+    @GetMapping("/exportChange")
+    public AjaxResult exportChange(SpStatChangeReq spStatChangeReq) {
+        List<SpStatChange> list = serviceDonorchargeorganService.getListBySpStatChange(spStatChangeReq);
+        ExcelUtil<SpStatChange> util = new ExcelUtil<SpStatChange>(SpStatChange.class);
+        return util.exportExcel(list, "鏀舵缁熻鏁版嵁");
+    }
 }

--
Gitblit v1.9.3