From 3de54185395aa599ec16483ac9d283271e6c8d29 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期四, 27 七月 2023 14:21:00 +0800
Subject: [PATCH] 代码提交
---
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceFundController.java | 30 +++++++++++++++++++++++++++---
ruoyi-project/src/main/java/com/ruoyi/project/domain/ServiceFunddetail.java | 2 +-
ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceFunddetailServiceImpl.java | 23 ++++++++++++-----------
3 files changed, 40 insertions(+), 15 deletions(-)
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceFundController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceFundController.java
index 782e319..5596ef6 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceFundController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceFundController.java
@@ -11,6 +11,7 @@
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.exception.ServiceException;
+import com.ruoyi.common.tax.TaxtUtils;
import com.ruoyi.common.utils.bean.DtoConversionUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.project.domain.*;
@@ -436,7 +437,30 @@
// addReiSharedDatd(serviceFundVO, 1);
// }
List<ServiceFunddetail> serviceFunddetails = serviceFundVO.getServiceFunddetails();
- serviceFunddetails.forEach(item -> item.setFundid(id));
+// serviceFunddetails.forEach(item -> item.setFundid(id));
+ for (ServiceFunddetail serviceFunddetail : serviceFunddetails) {
+ serviceFunddetail.setFundid(id);
+ if (!serviceFunddetail.getTaxedamount().equals(Double.NaN) && !serviceFunddetail.getAmount().equals(Double.NaN)) {
+ // 绋庡墠绋庡悗閮戒笉涓虹┖
+ continue;
+ } else if (!serviceFunddetail.getTaxedamount().equals(Double.NaN)) {
+ // 绋庡悗姹傜◣鍓�
+ Double taxationBefore = Double.valueOf(TaxtUtils.getTaxationBefore(BigDecimal.valueOf(serviceFunddetail.getTaxedamount())));
+ // 绋庨噾
+ String taxation = TaxtUtils.getTaxation(BigDecimal.valueOf(taxationBefore));
+ serviceFunddetail.setAmount(Double.valueOf(taxationBefore));
+ serviceFunddetail.setTaxamount(Double.parseDouble(taxation));
+ } else if (!serviceFunddetail.getAmount().equals(Double.NaN)) {
+ // 绋庡墠姹傜◣鍚�
+ double tax = Double.parseDouble(TaxtUtils.getTaxation(BigDecimal.valueOf(serviceFunddetail.getAmount())));
+ BigDecimal taxAfterMoney = BigDecimal.valueOf(serviceFunddetail.getAmount()).subtract(BigDecimal.valueOf(tax));
+ serviceFunddetail.setTaxamount(tax);
+ serviceFunddetail.setTaxedamount(taxAfterMoney.doubleValue());
+ }
+
+ }
+
+
serviceFunddetailService.saveBatch(serviceFunddetails);
return AjaxResult.success(id);
}
@@ -592,7 +616,7 @@
@PutMapping
@RepeatSubmit
public AjaxResult edit(@RequestBody ServiceFund serviceFund) {
- List<ServiceFund> infoByInfoIdList = serviceFundService.getInfoByInfoId(serviceFund.getId());
+ List<ServiceFund> infoByInfoIdList = serviceFundService.getInfoByInfoId(serviceFund.getInfoid());
for (ServiceFund sf : infoByInfoIdList) {
//濡傛灉绛変簬100锛岃鏄庡凡缁忚蛋鍒板尰闄㈣储鍔¢偅杈逛簡锛涜储鍔¢偅杈瑰彇鏁版嵁鏄粠鍒嗕韩琛ㄥ彇锛屾墍浠ワ紝杩欓噷鐩存帴寰�鍒嗕韩琛ㄩ噷娣诲姞鏁版嵁灏辫浜�
if (sf.getBackflowlevel() == 100 || sf.getBackflowlevel() == 199) {
@@ -771,7 +795,7 @@
dataMap.put("list", newsList);
for (int i = 0; i < lists.size(); i++) {
Map<String, Object> map = lists.get(i);
- map.put("XH", i+1);
+ map.put("XH", i + 1);
}
dataMap.put("item", lists);
diff --git a/ruoyi-project/src/main/java/com/ruoyi/project/domain/ServiceFunddetail.java b/ruoyi-project/src/main/java/com/ruoyi/project/domain/ServiceFunddetail.java
index bf2f0d1..5577deb 100644
--- a/ruoyi-project/src/main/java/com/ruoyi/project/domain/ServiceFunddetail.java
+++ b/ruoyi-project/src/main/java/com/ruoyi/project/domain/ServiceFunddetail.java
@@ -140,7 +140,7 @@
private String itemtype;
/** 鐢宠閲戦 */
- @ApiModelProperty("鐢宠閲戦")
+ @ApiModelProperty("鐢宠閲戦(绋庡墠閲戦)")
@Excel(name = "鐢宠閲戦")
private Double amount;
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 cb73f8a..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;
@@ -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