From e28cb5d1f5687d53d25ec55cf01a3e46c3f37a6b Mon Sep 17 00:00:00 2001 From: wangw <1594593906@qq.com> Date: Sun, 29 Sep 2024 10:57:27 +0800 Subject: [PATCH] =?UTF-8?q?=E8=90=A5=E4=B8=9A=E6=9D=BF=E5=9D=97=20?= =?UTF-8?q?=E7=BF=BB=E5=8F=B0=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cashier/service/impl/SummaryServiceImpl.java | 4 +++- .../impl/shopimpl/TbShopInfoServiceImpl.java | 15 --------------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/SummaryServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/SummaryServiceImpl.java index 518daffd..9d56f52a 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/SummaryServiceImpl.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/SummaryServiceImpl.java @@ -166,7 +166,9 @@ public class SummaryServiceImpl implements SummaryService { if(saleNum.compareTo(BigDecimal.ZERO) == 0 || saleNum.compareTo(new BigDecimal(tables)) < 0){ count.put("turnoverRate","0%");//翻台率 }else { - count.put("turnoverRate",saleNum.divide(new BigDecimal(tables),0,RoundingMode.DOWN).subtract(BigDecimal.ONE).multiply(new BigDecimal("100"))+"%");//翻台率 + BigDecimal turnoverRate = saleNum.divide(new BigDecimal(tables), 4, RoundingMode.DOWN).subtract(BigDecimal.ONE) + .multiply(new BigDecimal("100")); + count.put("turnoverRate", turnoverRate.setScale(2, RoundingMode.DOWN) + "%"); } count.put("saveAmount",orderMap.get("saveAmount"));//优惠金额 count.put("saveNum",orderMap.get("saveNum"));//优惠单数 diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopInfoServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopInfoServiceImpl.java index 826447e4..8b156fbb 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopInfoServiceImpl.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopInfoServiceImpl.java @@ -1,18 +1,3 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ package cn.ysk.cashier.service.impl.shopimpl; import cn.ysk.cashier.config.security.security.TokenProvider;