From 4729ed87ce662b237b24dae7ba896c4b184f76dd Mon Sep 17 00:00:00 2001 From: chenhao Date: Fri, 26 Sep 2025 10:26:15 +0800 Subject: [PATCH] =?UTF-8?q?feat(currency):=20=E5=AE=9E=E7=8E=B0=E7=B2=BE?= =?UTF-8?q?=E7=A1=AE=E8=B4=A7=E5=B8=81=E5=9B=9B=E8=88=8D=E4=BA=94=E5=85=A5?= =?UTF-8?q?=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加 preciseCurrencyRound 函数以提高货币计算精度 - 替换所有 toFixed(2) 调用为 preciseCurrencyRound以避免浮点数误差 - 更新折扣和金额计算逻辑以使用新的四舍五入方法 - 修正项目订单和产品信息中的货币显示格式- 调整JavaScript文件版本号以确保更新生效 - 移除sunxuepu@pcitech.com从CSS邮件列表中 - 添加待办事项完成页面控制器方法 --- .../main/resources/static/ruoyi/js/common.js | 7 +- .../src/main/resources/templates/include.html | 2 +- .../src/main/resources/templates/index.html | 2 +- .../templates/layout/product-list.html | 73 +++++++++---------- .../resources/templates/manage/order/add.html | 2 +- .../templates/manage/order/edit.html | 4 +- .../templates/project/info/edit.html | 12 +-- .../templates/project/order/add.html | 24 +++--- .../templates/project/order/approve.html | 18 ++--- .../templates/project/order/edit.html | 22 +++--- .../templates/system/product/edit.html | 2 +- .../templates/system/product/product.html | 2 +- .../flowable/controller/TodoController.java | 6 ++ .../impl/ProjectOrderInfoServiceImpl.java | 2 +- 14 files changed, 94 insertions(+), 84 deletions(-) diff --git a/ruoyi-admin/src/main/resources/static/ruoyi/js/common.js b/ruoyi-admin/src/main/resources/static/ruoyi/js/common.js index cbfcb55d..cacab7f3 100644 --- a/ruoyi-admin/src/main/resources/static/ruoyi/js/common.js +++ b/ruoyi-admin/src/main/resources/static/ruoyi/js/common.js @@ -245,7 +245,12 @@ var closeItem = function(dataId){ }); } } - +function preciseCurrencyRound(amount,decimalPlace) { + if (decimalPlace){ + return Number(Math.round(amount + `e${decimalPlace}`) + `e-${decimalPlace}`); + } + return Number(Math.round(amount + 'e2') + 'e-2'); +} /** 创建选项卡 */ function createMenuItem(dataUrl, menuName, isRefresh) { var panelUrl = window.frameElement.getAttribute('data-id'), diff --git a/ruoyi-admin/src/main/resources/templates/include.html b/ruoyi-admin/src/main/resources/templates/include.html index d375c2d5..8f4fda01 100644 --- a/ruoyi-admin/src/main/resources/templates/include.html +++ b/ruoyi-admin/src/main/resources/templates/include.html @@ -38,7 +38,7 @@ - + diff --git a/ruoyi-admin/src/main/resources/templates/index.html b/ruoyi-admin/src/main/resources/templates/index.html index 76aa351f..2ba4e355 100644 --- a/ruoyi-admin/src/main/resources/templates/index.html +++ b/ruoyi-admin/src/main/resources/templates/index.html @@ -275,7 +275,7 @@ - + diff --git a/ruoyi-admin/src/main/resources/templates/system/product/product.html b/ruoyi-admin/src/main/resources/templates/system/product/product.html index 8dc0d763..f14ab9ad 100644 --- a/ruoyi-admin/src/main/resources/templates/system/product/product.html +++ b/ruoyi-admin/src/main/resources/templates/system/product/product.html @@ -116,7 +116,7 @@ field: 'guidanceDiscount', title: '指导折扣', formatter: function(value, row, index) { - return value?(value * 100).toFixed(2) + '%' :'-'; + return value?preciseCurrencyRound(value * 100) + '%' :'-'; } }, { diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/flowable/controller/TodoController.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/flowable/controller/TodoController.java index 5011d6d3..19c421f7 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/flowable/controller/TodoController.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/flowable/controller/TodoController.java @@ -34,6 +34,12 @@ public class TodoController extends BaseController { mmap.put("user", getSysUser()); return prefix + "/todo"; } + @GetMapping("/complete") + public String complete(ModelMap mmap) + { + mmap.put("user", getSysUser()); + return prefix + "/complete"; + } /** * 查询待办列表 */ diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectOrderInfoServiceImpl.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectOrderInfoServiceImpl.java index 71a83da1..a85c5d09 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectOrderInfoServiceImpl.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectOrderInfoServiceImpl.java @@ -115,7 +115,7 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService, To private TaskService taskService; - private static final List CSS_EMAIL_LIST = Arrays.asList("wangxiaojun@pcitech.com", "sunxuepu@pcitech.com", "huiwang@pcitech.com", "zhaoqian1@pcitech.com", "pci-ict@pcitech.com"); + private static final List CSS_EMAIL_LIST = Arrays.asList("wangxiaojun@pcitech.com", "huiwang@pcitech.com", "zhaoqian1@pcitech.com", "pci-ict@pcitech.com"); @Autowired private IBuApproveConfigService approveConfigService;