From d6b8919294100363a9408a9fc1af81ff96a57b55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=89=9B=E5=8F=89=E9=97=AA=E9=97=AA?= <18322780655@163.com> Date: Tue, 20 Aug 2024 14:46:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=A2=9E=E5=8A=A0=E5=87=8F?= =?UTF-8?q?=E5=B0=91=E7=94=A8=E6=88=B7=E8=B5=84=E9=87=91=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/shopimpl/TbShopUserServiceImpl.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopUserServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopUserServiceImpl.java index f0dfc99a..e397431e 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopUserServiceImpl.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopUserServiceImpl.java @@ -196,7 +196,7 @@ public class TbShopUserServiceImpl implements TbShopUserService { public void modfiyAccount(Map map) { if(ObjectUtil.isNull(map)||ObjectUtil.isEmpty(map)||!map.containsKey("id")||!map.containsKey("type")||!map.containsKey("amount") ||ObjectUtil.isEmpty(map.get("id"))||ObjectUtil.isNull(map.get("id"))||ObjectUtil.isNull(map.get("type"))||ObjectUtil.isEmpty(map.get("type")) - ||ObjectUtil.isEmpty(map.get("amount"))||ObjectUtil.isNull(map.get("amount")) + ||ObjectUtil.isEmpty(map.get("amount"))||ObjectUtil.isNull(map.get("amount"))||!map.containsKey("operationType")||ObjectUtil.isEmpty(map.get("operationType"))||ObjectUtil.isNull(map.get("operationType")) ){ throw new BadRequestException("参数错误"); @@ -220,17 +220,18 @@ public class TbShopUserServiceImpl implements TbShopUserService { throw new BadRequestException("账户余额不足,请输入正确的金额"); } + String operationType=map.get("operationType").toString(); String type=map.get("type").toString(); TbShopUserFlow flow=new TbShopUserFlow(); - if("in".equals(type)){ + if("in".equals(operationType)){ flow.setType("+"); - flow.setBizName("充值退款"); - flow.setBizCode("manualIn"); + flow.setBizName("inMoney".equals(type)?"充值退款":"消费退款"); + flow.setBizCode("inMoney".equals(type)?"inMoneyIn":"consumeIn"); tbShopUser.setAmount(tbShopUser.getAmount().add(amount)); - }else if("out".equals(type)){ - flow.setBizCode("manualOut"); - flow.setBizName("消费"); + }else if("out".equals(operationType)){ + flow.setBizName("inMoney".equals(type)?"充值退款扣除":"消费扣除"); + flow.setBizCode("inMoney".equals(type)?"inMoneyOut":"consumeOut"); flow.setType("-"); tbShopUser.setAmount(tbShopUser.getAmount().subtract(amount)); }else {