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());