ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceFundController.java
@@ -355,8 +355,37 @@ @RepeatSubmit @Options(useGeneratedKeys = true, keyProperty = "id") public AjaxResult addOrUpdateNew(@RequestBody ServiceFundVO serviceFundVO) { // 2026-11-23:剔除 blob:/data: 这类浏览器临时附件地址,避免落库后无法预览 int droppedAttach = sanitizeAttachments(serviceFundVO); AjaxResult result = AjaxResult.success(serviceFundService.addOrUpdateNew(serviceFundVO)); if (droppedAttach > 0) { result.put("attachWarn", "检测到 " + droppedAttach + " 个附件地址无效(浏览器临时地址),已自动剔除,请重新上传这些附件后再保存。"); } return result; } return AjaxResult.success(serviceFundService.addOrUpdateNew(serviceFundVO)); /** * 2026-11-23:清洗整单明细里的临时附件地址(blob:/data:/file:)。 * * @return 被剔除的附件条数 */ private int sanitizeAttachments(ServiceFundVO serviceFundVO) { if (serviceFundVO == null || CollectionUtils.isEmpty(serviceFundVO.getServiceFunddetails())) { return 0; } int dropped = 0; for (ServiceFunddetailVO detail : serviceFundVO.getServiceFunddetails()) { if (detail == null) { continue; } dropped += com.ruoyi.project.common.AttachmentUrlSanitizer.sanitize(detail.getAnnexfilesList()); dropped += com.ruoyi.project.common.AttachmentUrlSanitizer.sanitize(detail.getInvoicefilesList()); } if (dropped > 0) { log.warn("报销单保存:剔除 {} 个临时附件地址(blob:/data:),单据 fundid={}", dropped, serviceFundVO.getId()); } return dropped; } /** @@ -409,6 +438,8 @@ List<ServiceFund> infoByInfoIdList = serviceFundService.queryInfoById(serviceFund); log.info("修改费用申请,通过入参查询 serviceFundService.queryInfoById数据为空,入参:{}", infoByInfoIdList.size()); if (CollectionUtils.isEmpty(infoByInfoIdList)) { // 2026-11-23:同样剔除临时附件地址(blob:/data:),避免落库后无法预览 sanitizeAttachments(serviceFundVO); Long id = serviceFundService.addOrUpdateNew(serviceFundVO); serviceFund.setId(id); } ruoyi-common/src/main/java/com/ruoyi/common/tax/TaxtUtils.java
@@ -81,22 +81,22 @@ taxMoney = money; } //第一个参数是除数,第二个参数代表保留几位小数,第三个代表的是使用的模式 if (money.doubleValue() > 800 && money.doubleValue() <= 3360) { taxMoney = money.subtract(new BigDecimal(160)).divide(new BigDecimal("0.8"), 2, BigDecimal.ROUND_HALF_UP); if (money.doubleValue() > 800 && money.doubleValue() <= 3358.88) { taxMoney = money.subtract(new BigDecimal(160)).divide(new BigDecimal("0.79972"), 2, BigDecimal.ROUND_HALF_UP); } if (money.doubleValue() > 3360 && money.doubleValue() <= 21000) { taxMoney = money.divide(new BigDecimal("0.84"), 2, BigDecimal.ROUND_HALF_UP); if (money.doubleValue() > 3358.88 && money.doubleValue() <= 20993.44) { taxMoney = money.divide(new BigDecimal("0.79972"), 2, BigDecimal.ROUND_HALF_UP); } if (money.doubleValue() > 21000 && money.doubleValue() <= 49500) { if (money.doubleValue() > 20993.44 && money.doubleValue() <= 49485.78) { money = money.subtract(new BigDecimal(2000)); taxMoney = money.divide(new BigDecimal("0.76"), 2, BigDecimal.ROUND_HALF_UP); taxMoney = money.divide(new BigDecimal("0.759755"), 2, BigDecimal.ROUND_HALF_UP); } if (money.doubleValue() > 49500) { if (money.doubleValue() > 49485.78) { money = money.subtract(new BigDecimal(7000)); taxMoney = money.divide(new BigDecimal("0.68"), 2, BigDecimal.ROUND_HALF_UP); taxMoney = money.divide(new BigDecimal("0.67979"), 2, BigDecimal.ROUND_HALF_UP); } @@ -112,8 +112,6 @@ public static void main(String[] args) { String taxation = getTaxation(BigDecimal.valueOf(43000)); String taxationBefore = getTaxationBefore(BigDecimal.valueOf(205892.36)); System.out.println("taxation:" + taxation + "============taxationBefore: " + taxationBefore); }