From c9927c06a608b4baf85669d9cbe570d7fffc361d Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期二, 08 八月 2023 16:14:49 +0800
Subject: [PATCH] 获取fileID的方法进行修改

---
 ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceFunddetailServiceImpl.java |   29 +++++++++++++++--------------
 1 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceFunddetailServiceImpl.java b/ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceFunddetailServiceImpl.java
index f7add24..afcc2ca 100644
--- a/ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceFunddetailServiceImpl.java
+++ b/ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceFunddetailServiceImpl.java
@@ -6,6 +6,7 @@
 import java.util.Date;
 import java.util.List;
 
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.ruoyi.common.tax.TaxtUtils;
 import com.ruoyi.project.domain.*;
 import com.ruoyi.project.domain.vo.TaxMoneyVO;
@@ -101,7 +102,7 @@
      * @return
      */
     @Override
-    public Double getTaxBeforeByBeneFiciaryNo(TaxMoneyVO taxMoneyVo) {
+    public Double getTaxByBeneFiciaryNo(TaxMoneyVO taxMoneyVo) {
         Double sum = 0.00;
         Double totalScore = 0.00;
         List<ServiceFunddetail> taxationByBeneFiciaryNo = serviceFunddetailMapper.getTaxBeforeByBeneFiciaryNo(taxMoneyVo);
@@ -123,7 +124,7 @@
     /**
      * 鏍规嵁绋庡悗宸ヨ祫锛岀畻鍑虹◣鍓嶅伐璧�
      *
-     * @param money
+     * @param taxMoneyVo
      * @return
      */
     @Override
@@ -139,7 +140,7 @@
             totalScore = taxationByBeneFiciaryNo.stream().mapToDouble(ServiceFunddetail::getTaxamount).sum();
         }
         //璁$畻鍑烘�荤殑绋庡悗钖叕锛堝寘鍚湰娆★級
-        sum = sum + taxMoneyVo.getMoney();
+        sum = sum + Double.valueOf(taxMoneyVo.getMoney());
         //绋庡墠鎬婚噾棰�
         String taxationBefore = TaxtUtils.getTaxationBefore(new BigDecimal(sum));
         //鎬讳釜绋�
@@ -200,18 +201,18 @@
         ServiceFunddetail serviceFunddetail = serviceFunddetailMapper.selectById(id);
         Long fundid = serviceFunddetail.getFundid();
         ServiceFund serviceFund = serviceFundMapper.selectById(fundid);
+        if (ObjectUtils.isNotEmpty(serviceFund)) {
+            Double pretax = serviceFund.getPretaxcost();
+            Double aftertax = serviceFund.getTaxedcost();
+            pretax = pretax - serviceFunddetail.getAmount();
+            aftertax = aftertax - serviceFunddetail.getTaxedamount();
+            Double amount = pretax + aftertax;
 
-        Double pretax = serviceFund.getPretaxcost();
-        Double aftertax = serviceFund.getTaxedcost();
-        pretax = pretax - serviceFunddetail.getAmount();
-        aftertax = aftertax - serviceFunddetail.getTaxedamount();
-        Double amount = pretax + aftertax;
-
-        serviceFund.setPretaxcost(pretax);
-        serviceFund.setTaxedcost(aftertax);
-        serviceFund.setAmountrequested(amount);
-        int updateAmount = serviceFundMapper.updateById(serviceFund);
-
+            serviceFund.setPretaxcost(pretax);
+            serviceFund.setTaxedcost(aftertax);
+            serviceFund.setAmountrequested(amount);
+            int updateAmount = serviceFundMapper.updateById(serviceFund);
+        }
         return serviceFunddetailMapper.deleteById(id);
     }
 

--
Gitblit v1.9.3