From 75a8e9362f4fff56dbe920b55d93eec4a5c820a3 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: Wed, 28 Aug 2024 17:18:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BC=9A=E5=91=98=E4=BD=99?= =?UTF-8?q?=E9=A2=9D=E5=8F=98=E5=8A=A8=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/cashierservice/service/PayService.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/PayService.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/PayService.java index df8ee78..f2733cc 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/PayService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/PayService.java @@ -1120,7 +1120,7 @@ public class PayService { return "success"; } - public void giveActivate(TbShopUser tbShopUser, BigDecimal memAmount,Integer flowId){ + public BigDecimal giveActivate(TbShopUser tbShopUser, BigDecimal memAmount,Integer flowId){ TbActivate activate = tbActivateMapper.selectByAmount(tbShopUser.getShopId(), memAmount); if (ObjectUtil.isNotEmpty(activate) && ObjectUtil.isNotNull(activate)) { if (activate.getIsGiftPro() != null && activate.getIsGiftPro() == 1) { @@ -1155,7 +1155,10 @@ public class PayService { flow.setBalance(tbShopUser.getAmount()); flow.setCreateTime(new Date()); tbShopUserFlowMapper.insert(flow); + return amount; } + + return null; } @@ -1203,7 +1206,7 @@ public class PayService { flow.setCreateTime(new Date()); tbShopUserFlowMapper.insert(flow); //会员活动 - giveActivate(tbShopUser,memberIn.getAmount(),flow.getId()); + BigDecimal awardAmount= giveActivate(tbShopUser,memberIn.getAmount(),flow.getId()); JSONObject jsonObject = new JSONObject(); jsonObject.put("shopId", memberIn.getShopId()); jsonObject.put("type", "wxMemberIn"); @@ -1215,7 +1218,7 @@ public class PayService { JSONObject baObj=new JSONObject(); baObj.put("userId", tbShopUser.getUserId()); baObj.put("shopId",tbShopUser.getShopId()); - baObj.put("amount",memberIn.getAmount()); + baObj.put("amount",ObjectUtil.isNull(awardAmount)?memberIn.getAmount():memberIn.getAmount().add(awardAmount)); baObj.put("balance",tbShopUser.getAmount()); baObj.put("type","充值"); baObj.put("time",flow.getCreateTime());