From 3db944578af704f433fc6f4bc37180c8fed48ce9 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期六, 16 十二月 2023 10:40:51 +0800
Subject: [PATCH] 代码提交,添加apply_time
---
ruoyi-project/src/main/java/com/ruoyi/project/domain/ServiceFundShared.java | 8 ++++
ruoyi-project/src/main/resources/mapper/project/ServiceFundSharedMapper.xml | 2 +
ruoyi-project/src/main/resources/mapper/project/ServiceReimbursementMapper.xml | 2 +
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceReimbursementController.java | 4 +
ruoyi-project/src/main/java/com/ruoyi/project/domain/ServiceReimbursementShared.java | 3 +
ruoyi-project/src/main/java/com/ruoyi/project/domain/ServiceFund.java | 7 +++
ruoyi-project/src/main/resources/mapper/project/ServiceFundMapper.xml | 1
ruoyi-project/src/main/resources/mapper/project/ServiceReimbursementSharedMapper.xml | 2 +
ruoyi-common/src/main/java/com/ruoyi/common/tax/TaxtUtils.java | 36 ++++++++++-------
ruoyi-project/src/main/java/com/ruoyi/project/domain/ServiceReimbursement.java | 4 +-
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceFundController.java | 1
11 files changed, 52 insertions(+), 18 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 8dfea46..a3aaae5 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
@@ -648,6 +648,7 @@
return toAjax(false);
}
for (ServiceFund sf : infoByInfoIdList) {
+ sf.setApplyTime(new Date());
//濡傛灉绛変簬100锛岃鏄庡凡缁忚蛋鍒板尰闄㈣储鍔¢偅杈逛簡锛涜储鍔¢偅杈瑰彇鏁版嵁鏄粠鍒嗕韩琛ㄥ彇锛屾墍浠ワ紝杩欓噷鐩存帴寰�鍒嗕韩琛ㄩ噷娣诲姞鏁版嵁灏辫浜�
if (sf.getBackflowlevel() != null && sf.getBackflowlevel() == 199) {
//灏唂und琛ㄧ殑瀹℃牳鐘舵�佹敼鎴�100
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceReimbursementController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceReimbursementController.java
index 37f5124..0656f3a 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceReimbursementController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceReimbursementController.java
@@ -221,10 +221,11 @@
//@PreAuthorize("@ss.hasPermi('project:reimbursement:add')")
@Log(title = "鎶ラ攢鐢宠", businessType = BusinessType.INSERT)
@PostMapping
- @RepeatSubmit
+ @RepeatSubmit
@Options(useGeneratedKeys = true, keyProperty = "id")
public AjaxResult add(@RequestBody ServiceReimbursement serviceReimbursement) {
if (!Objects.isNull(serviceReimbursement)) {
+ serviceReimbursement.setCreateTime(new Date());
serviceReimbursement.setCheckstatus(serviceReimbursement.getCheckstatus() == null ? 1 : serviceReimbursement.getCheckstatus());
boolean b = serviceReimbursementService.save(serviceReimbursement);
Long id = serviceReimbursement.getId();
@@ -242,6 +243,7 @@
@PostMapping("/travelexpensereport")
public AjaxResult travelexpensereport(@RequestBody CheckFundVO checkFundVO) {
ServiceReimbursement serviceReimbursement = serviceReimbursementService.getById(checkFundVO.getFundid());
+ serviceReimbursement.setApplyTime(new Date());
//濡傛灉绛変簬100锛岃鏄庡凡缁忚蛋鍒板尰闄㈣储鍔¢偅杈逛簡锛涜储鍔¢偅杈瑰彇鏁版嵁鏄粠鍒嗕韩琛ㄥ彇锛屾墍浠ワ紝杩欓噷鐩存帴寰�鍒嗕韩琛ㄩ噷娣诲姞鏁版嵁灏辫浜�;
if (!Objects.isNull(serviceReimbursement) && serviceReimbursement.getBackflowlevel() != null) {
if (serviceReimbursement.getBackflowlevel() == 100 || serviceReimbursement.getBackflowlevel() == 199) {
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/tax/TaxtUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/tax/TaxtUtils.java
index 2389e95..fbbde5d 100644
--- a/ruoyi-common/src/main/java/com/ruoyi/common/tax/TaxtUtils.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/tax/TaxtUtils.java
@@ -8,6 +8,7 @@
import lombok.extern.slf4j.Slf4j;
import java.math.BigDecimal;
+import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.Collection;
import java.util.List;
@@ -31,32 +32,35 @@
*/
public static String getTaxation(BigDecimal money) {
//褰揦<=800鏃讹紝涓◣T=0
- BigDecimal taxMoney = new BigDecimal(0.0);
+ BigDecimal taxMoney = BigDecimal.valueOf(0.0);
//褰�800<X<=4000鏃讹紝涓◣T=(X-800)*20%
if (money.doubleValue() > 800 && money.doubleValue() <= 4000) {
BigDecimal subtract = money.subtract(new BigDecimal(800));
- taxMoney = subtract.multiply(new BigDecimal(0.2));
+ taxMoney = subtract.multiply(BigDecimal.valueOf(0.2));
}
- BigDecimal multiply = money.multiply(new BigDecimal(0.8));
+ BigDecimal multiply = money.multiply(BigDecimal.valueOf(0.8));
// 褰揦>4000鏃�
//(1)褰揦*(1-20%)<=20000鏃讹紝涓◣T=X*(1-20%)*20%
if (money.doubleValue() > 4000 && multiply.doubleValue() <= 20000) {
- taxMoney = multiply.multiply(new BigDecimal(0.2));
+ taxMoney = multiply.multiply(BigDecimal.valueOf(0.2));
}
//(2)褰�20000<X*(1-20%)<=50000鏃讹紝涓◣T=X*(1-20%)*30%-2000
if (multiply.doubleValue() > 20000 && multiply.doubleValue() <= 50000) {
- taxMoney = multiply.multiply(new BigDecimal(0.3)).subtract(new BigDecimal(2000));
+ taxMoney = multiply.multiply(BigDecimal.valueOf(0.3)).subtract(BigDecimal.valueOf(2000));
}
//X*(1-20%)>50000鏃讹紝涓◣T=X*(1-20%)*40%-7000
if (multiply.doubleValue() > 50000) {
- taxMoney = multiply.multiply(new BigDecimal(0.4)).subtract(new BigDecimal(7000));
+ taxMoney = multiply.multiply(BigDecimal.valueOf(0.4)).subtract(BigDecimal.valueOf(7000));
}
- DecimalFormat decimalFormat = new DecimalFormat("#.00");
+ DecimalFormat decimalFormat = new DecimalFormat("#0.00");
+ //杩涗竴娉�
+ decimalFormat.setRoundingMode(RoundingMode.CEILING);
String format = decimalFormat.format(taxMoney);
+ log.info("绋庨噾涓猴細{}", format);
return format;
}
@@ -68,31 +72,33 @@
*/
public static String getTaxationBefore(BigDecimal money) {
//褰揦<=800鏃讹紝涓◣T=0
- BigDecimal taxMoney = new BigDecimal(0.0);
+ BigDecimal taxMoney = BigDecimal.valueOf(0.00);
if (money.doubleValue() <= 800) {
taxMoney = money;
}
//绗竴涓弬鏁版槸闄ゆ暟锛岀浜屼釜鍙傛暟浠h〃淇濈暀鍑犱綅灏忔暟锛岀涓変釜浠h〃鐨勬槸浣跨敤鐨勬ā寮�
if (money.doubleValue() > 800 && money.doubleValue() <= 3360) {
- taxMoney = money.subtract(new BigDecimal(160)).divide(new BigDecimal(0.8), 2, BigDecimal.ROUND_UP);
+ taxMoney = money.subtract(new BigDecimal(160)).divide(new BigDecimal(0.8), 2, BigDecimal.ROUND_CEILING);
}
if (money.doubleValue() > 3360 && money.doubleValue() <= 21000) {
- taxMoney = money.divide(new BigDecimal(0.84), 2, BigDecimal.ROUND_DOWN);
+ taxMoney = money.divide(new BigDecimal(0.84), 2, BigDecimal.ROUND_CEILING);
}
if (money.doubleValue() > 21000 && money.doubleValue() <= 40000) {
money = money.subtract(new BigDecimal(2000));
- taxMoney = money.divide(new BigDecimal(0.76), 2, BigDecimal.ROUND_DOWN);
+ taxMoney = money.divide(new BigDecimal(0.76), 2, BigDecimal.ROUND_CEILING);
}
if (money.doubleValue() > 40000) {
money = money.subtract(new BigDecimal(7000));
- taxMoney = money.divide(new BigDecimal(0.68), 2, BigDecimal.ROUND_DOWN);
+ taxMoney = money.divide(new BigDecimal(0.68), 2, BigDecimal.ROUND_CEILING);
}
- DecimalFormat decimalFormat = new DecimalFormat("#.00");
+ DecimalFormat decimalFormat = new DecimalFormat("#0.00");
+ //杩涗竴娉�
+ decimalFormat.setRoundingMode(RoundingMode.CEILING);
String format = decimalFormat.format(taxMoney);
log.info("绋庡墠閲戦涓猴細{}", format);
return format;
@@ -100,8 +106,8 @@
public static void main(String[] args) {
- String taxation = getTaxation(new BigDecimal(400));
- String taxationBefore = getTaxationBefore(new BigDecimal(400));
+ String taxation = getTaxation(BigDecimal.valueOf(80589.723));
+ String taxationBefore = getTaxationBefore(BigDecimal.valueOf(900.531));
System.out.println(taxation + " " + taxationBefore);
diff --git a/ruoyi-project/src/main/java/com/ruoyi/project/domain/ServiceFund.java b/ruoyi-project/src/main/java/com/ruoyi/project/domain/ServiceFund.java
index adef112..0af5e04 100644
--- a/ruoyi-project/src/main/java/com/ruoyi/project/domain/ServiceFund.java
+++ b/ruoyi-project/src/main/java/com/ruoyi/project/domain/ServiceFund.java
@@ -355,5 +355,12 @@
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date fundtaxtime;
+ /**
+ * 涓婃姤鏃堕棿
+ */
+ @ApiModelProperty("涓婃姤鏃堕棿")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ @Excel(name = "涓婃姤鏃堕棿", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+ private Date applyTime;
}
diff --git a/ruoyi-project/src/main/java/com/ruoyi/project/domain/ServiceFundShared.java b/ruoyi-project/src/main/java/com/ruoyi/project/domain/ServiceFundShared.java
index f268af3..4fdcd2f 100644
--- a/ruoyi-project/src/main/java/com/ruoyi/project/domain/ServiceFundShared.java
+++ b/ruoyi-project/src/main/java/com/ruoyi/project/domain/ServiceFundShared.java
@@ -1,6 +1,8 @@
package com.ruoyi.project.domain;
+import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
@@ -388,5 +390,11 @@
@ApiModelProperty("缁╂晥锛�1銆佹湀搴︺��2瀛e害銆�3骞村害")
@Excel(name = "缁╂晥锛�1銆佹湀搴︺��2瀛e害銆�3骞村害")
private Integer performancetype;
+
+ /** 涓婃姤鏃堕棿 */
+ @ApiModelProperty("涓婃姤鏃堕棿")
+ @TableField(fill = FieldFill.INSERT)
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date applyTime;
}
diff --git a/ruoyi-project/src/main/java/com/ruoyi/project/domain/ServiceReimbursement.java b/ruoyi-project/src/main/java/com/ruoyi/project/domain/ServiceReimbursement.java
index e6dd99f..3a6f242 100644
--- a/ruoyi-project/src/main/java/com/ruoyi/project/domain/ServiceReimbursement.java
+++ b/ruoyi-project/src/main/java/com/ruoyi/project/domain/ServiceReimbursement.java
@@ -337,8 +337,8 @@
@Excel(name = "缁╂晥锛�1銆佹湀搴︺��2瀛e害銆�3骞村害")
private Integer performancetype;
-// @ApiModelProperty("寮�濮嬫椂闂�")
-// private Date starttime;
+ @ApiModelProperty("涓婃姤鏃堕棿")
+ private Date applyTime;
//
// @ApiModelProperty("缁撴潫鏃堕棿")
// private Date endtime;
diff --git a/ruoyi-project/src/main/java/com/ruoyi/project/domain/ServiceReimbursementShared.java b/ruoyi-project/src/main/java/com/ruoyi/project/domain/ServiceReimbursementShared.java
index deff20c..d7c1dcc 100644
--- a/ruoyi-project/src/main/java/com/ruoyi/project/domain/ServiceReimbursementShared.java
+++ b/ruoyi-project/src/main/java/com/ruoyi/project/domain/ServiceReimbursementShared.java
@@ -386,5 +386,8 @@
@ApiModelProperty("缁╂晥锛�1銆佹湀搴︺��2瀛e害銆�3骞村害")
@Excel(name = "缁╂晥锛�1銆佹湀搴︺��2瀛e害銆�3骞村害")
private Integer performancetype;
+
+ @ApiModelProperty("涓婃姤鏃堕棿")
+ private Date applyTime;
}
diff --git a/ruoyi-project/src/main/resources/mapper/project/ServiceFundMapper.xml b/ruoyi-project/src/main/resources/mapper/project/ServiceFundMapper.xml
index 4156250..aa38a59 100644
--- a/ruoyi-project/src/main/resources/mapper/project/ServiceFundMapper.xml
+++ b/ruoyi-project/src/main/resources/mapper/project/ServiceFundMapper.xml
@@ -59,6 +59,7 @@
<result property="performancetype" column="performancetype"/>
<result property="istax" column="istax"/>
<result property="fundtaxtime" column="fundtaxtime"/>
+ <result property="applyTime" column="apply_time"/>
</resultMap>
diff --git a/ruoyi-project/src/main/resources/mapper/project/ServiceFundSharedMapper.xml b/ruoyi-project/src/main/resources/mapper/project/ServiceFundSharedMapper.xml
index 916a662..be017b3 100644
--- a/ruoyi-project/src/main/resources/mapper/project/ServiceFundSharedMapper.xml
+++ b/ruoyi-project/src/main/resources/mapper/project/ServiceFundSharedMapper.xml
@@ -62,6 +62,7 @@
<result property="bh" column="bh"/>
<result property="checkstatus" column="checkstatus"/>
<result property="performancetype" column="performancetype"/>
+ <result property="applyTime" column="apply_time"/>
</resultMap>
<sql id="selectServiceFundSharedVo">
@@ -121,6 +122,7 @@
riqi,
bh,
checkstatus,
+ applytime,
performancetype
from service_fund_shared
</sql>
diff --git a/ruoyi-project/src/main/resources/mapper/project/ServiceReimbursementMapper.xml b/ruoyi-project/src/main/resources/mapper/project/ServiceReimbursementMapper.xml
index be2d22b..466fb65 100644
--- a/ruoyi-project/src/main/resources/mapper/project/ServiceReimbursementMapper.xml
+++ b/ruoyi-project/src/main/resources/mapper/project/ServiceReimbursementMapper.xml
@@ -62,6 +62,7 @@
<result property="bh" column="bh"/>
<result property="checkstatus" column="checkstatus"/>
<result property="performancetype" column="performancetype"/>
+ <result property="applyTime" column="apply_time"/>
</resultMap>
<sql id="selectServiceReimbursementVo">
@@ -119,6 +120,7 @@
riqi,
bh,
checkstatus,
+ apply_time,
performancetype
from service_reimbursement
</sql>
diff --git a/ruoyi-project/src/main/resources/mapper/project/ServiceReimbursementSharedMapper.xml b/ruoyi-project/src/main/resources/mapper/project/ServiceReimbursementSharedMapper.xml
index a150213..750f9f0 100644
--- a/ruoyi-project/src/main/resources/mapper/project/ServiceReimbursementSharedMapper.xml
+++ b/ruoyi-project/src/main/resources/mapper/project/ServiceReimbursementSharedMapper.xml
@@ -65,6 +65,7 @@
<result property="bh" column="bh"/>
<result property="checkstatus" column="checkstatus"/>
<result property="performancetype" column="performancetype"/>
+ <result property="applyTime" column="apply_time"/>
</resultMap>
<sql id="selectServiceReimbursementSharedVo">
@@ -127,6 +128,7 @@
riqi,
bh,
checkstatus,
+ apply_time,
performancetype
from service_reimbursement_shared
</sql>
--
Gitblit v1.9.3