From 21619ffd680dfc66682ca3b6761eda5b74bdb70a Mon Sep 17 00:00:00 2001 From: liusheng <337615773@qq.com> Date: 星期三, 02 八月 2023 15:34:26 +0800 Subject: [PATCH] 专家劳务下载bug修复 --- ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceFundController.java | 26 +++++++++++++++----------- 1 files changed, 15 insertions(+), 11 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 75d99f4..2e8ae0f 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 @@ -447,7 +447,7 @@ for (ServiceFunddetail serviceFunddetail : serviceFunddetails) { serviceFunddetail.setFundid(id); - if (serviceFunddetail.getTaxedamount() != 0.0 && serviceFunddetail.getAmount() != 0.0 && serviceFunddetail.getTaxedamount() != null && serviceFunddetail.getTaxedamount() != null) { + if (serviceFunddetail.getTaxedamount() != 0.0 && serviceFunddetail.getAmount() != 0.0 && serviceFunddetail.getTaxedamount() != null && serviceFunddetail.getAmount() != null) { // 绋庡墠绋庡悗閮戒笉涓虹┖ if (serviceFunddetail.getId() == null) { serviceFunddetailService.save(serviceFunddetail); @@ -456,8 +456,8 @@ } continue; } else if (serviceFunddetail.getTaxedamount() != 0.0 && serviceFunddetail.getTaxedamount() != null) { - // 绋庡悗姹傜◣鍓�,濡傛灉鏄笓瀹惰垂鐢宠 鎴� 鍋蜂笓瀹惰垂鐢宠 鎵嶄細璁$畻绋庡墠绋庡悗 - if (StringUtils.isNotEmpty(serviceFunddetail.getApplytype()) && serviceFunddetail.getApplytype().equals("1") || serviceFunddetail.getApplytype().equals("2")) { + // 绋庡悗姹傜◣鍓�,濡傛灉鏄笓瀹惰垂鐢宠 鎴� 浼︾悊涓撳璐圭敵璇� 鎵嶄細璁$畻绋庡墠绋庡悗 + if (StringUtils.isNotEmpty(serviceFundVO.getApplytype()) && serviceFundVO.getApplytype().equals("1") || serviceFundVO.getApplytype().equals("2")) { Double taxationBefore = Double.valueOf(TaxtUtils.getTaxationBefore(BigDecimal.valueOf(serviceFunddetail.getTaxedamount()))); // 绋庨噾 String taxation = TaxtUtils.getTaxation(BigDecimal.valueOf(taxationBefore)); @@ -465,8 +465,8 @@ serviceFunddetail.setTaxamount(Double.parseDouble(taxation)); } } else if (serviceFunddetail.getAmount() != 0.0 && serviceFunddetail.getAmount() != null) { - // 绋庡墠姹傜◣鍚�,濡傛灉鏄笓瀹惰垂鐢宠 鎴� 鍋蜂笓瀹惰垂鐢宠 鎵嶄細璁$畻绋庡墠绋庡悗 - if (StringUtils.isNotEmpty(serviceFunddetail.getApplytype()) && serviceFunddetail.getApplytype().equals("1") || serviceFunddetail.getApplytype().equals("2")) { + // 绋庡墠姹傜◣鍚�,濡傛灉鏄笓瀹惰垂鐢宠 鎴� 浼︾悊涓撳璐圭敵璇� 鎵嶄細璁$畻绋庡墠绋庡悗 + if (StringUtils.isNotEmpty(serviceFundVO.getApplytype()) && serviceFundVO.getApplytype().equals("1") || serviceFundVO.getApplytype().equals("2")) { double tax = Double.parseDouble(TaxtUtils.getTaxation(BigDecimal.valueOf(serviceFunddetail.getAmount()))); BigDecimal taxAfterMoney = BigDecimal.valueOf(serviceFunddetail.getAmount()).subtract(BigDecimal.valueOf(tax)); serviceFunddetail.setTaxamount(tax); @@ -480,8 +480,11 @@ } else { serviceFunddetailService.updateById(serviceFunddetail); } - taxBefore = taxBefore + serviceFunddetail.getAmount(); - taxAfter = taxAfter + serviceFunddetail.getTaxedamount(); + if (serviceFundVO.getApplytype().equals("1") || serviceFundVO.getApplytype().equals("2")) { + //濡傛灉鏄笓瀹惰垂鐢宠 鎴� 浼︾悊涓撳璐圭敵璇� 鎵嶄細璁$畻绋庡墠绋庡悗 + taxBefore = taxBefore + serviceFunddetail.getAmount(); + taxAfter = taxAfter + serviceFunddetail.getTaxedamount(); + } } //灏嗙◣鍓嶃�佺◣鍚庨噾棰濇洿鏂板埌fund琛ㄤ腑 serviceFundVO.setPretaxcost(taxBefore); @@ -491,6 +494,7 @@ // serviceFunddetailService.saveBatch(serviceFunddetails); return AjaxResult.success(id); } + /** * 瀹℃牳璐圭敤 @@ -643,7 +647,7 @@ @PutMapping @RepeatSubmit public AjaxResult edit(@RequestBody ServiceFund serviceFund) { - List<ServiceFund> infoByInfoIdList = serviceFundService.getInfoByInfoId(serviceFund.getInfoid()); + List<ServiceFund> infoByInfoIdList = serviceFundService.queryInfoById(serviceFund); for (ServiceFund sf : infoByInfoIdList) { //濡傛灉绛変簬100锛岃鏄庡凡缁忚蛋鍒板尰闄㈣储鍔¢偅杈逛簡锛涜储鍔¢偅杈瑰彇鏁版嵁鏄粠鍒嗕韩琛ㄥ彇锛屾墍浠ワ紝杩欓噷鐩存帴寰�鍒嗕韩琛ㄩ噷娣诲姞鏁版嵁灏辫浜� if (sf.getBackflowlevel() == 100 || sf.getBackflowlevel() == 199) { @@ -738,11 +742,11 @@ dataMap.put("JXZXM", serviceFund.getDonorname() == null ? "" : serviceFund.getDonorname()); dataMap.put("JSR", serviceFund.getUsername() == null ? "" : serviceFund.getUsername()); // dataMap.put("FYXM1", "鏀粯涓撳璐圭敤锛屽叾涓◣鍓嶉噾棰�" + serviceFund.getPretaxcost() + "鍏冿紝绋庡悗閲戦" + serviceFund.getTaxedcost() + "鍏冦��"); - dataMap.put("FYXM1", "浜轰綋鍣ㄥ畼鎹愮尞涓撳鍔冲姟璐�:" + serviceFund.getTaxedcost() + "鍏� (鍏朵腑绋庡悗璐圭敤鐢变腑蹇冩壙鎷呯◣璐�)銆�"); + dataMap.put("FYXM1", "浜轰綋鍣ㄥ畼鎹愮尞涓撳鍔冲姟璐�:" + serviceFund.getPretaxcost() + "鍏� (鍏朵腑绋庡悗璐圭敤鐢变腑蹇冩壙鎷呯◣璐�)銆�"); dataMap.put("FYXM2", ""); dataMap.put("FYXM3", ""); - dataMap.put("JEXS", serviceFund.getAmountrequested()); - dataMap.put("JEDS", convert(serviceFund.getAmountrequested()) + "鏁�"); + dataMap.put("JEXS", serviceFund.getPretaxcost()); + dataMap.put("JEDS", convert(serviceFund.getPretaxcost()) + "鏁�"); dataMap.put("BXBZ", serviceFund.getRemark() == null ? "" : serviceFund.getRemark()); -- Gitblit v1.9.3