添加会员变动与通知

This commit is contained in:
牛叉闪闪
2024-08-28 17:18:41 +08:00
parent e49e72e088
commit f01391014a
2 changed files with 13 additions and 9 deletions

View File

@@ -357,7 +357,7 @@ public class MemberService {
flow.setCreateTime(new Date());
tbShopUserFlowMapper.insert(flow);
BigDecimal fl=null;
TbActivate activate = tbActivateMapper.selectByAmount(shopInfo.getId().toString(), memberIn.getAmount());
if (ObjectUtil.isNotEmpty(activate) && ObjectUtil.isNotNull(activate)) {
BigDecimal awardAmount = BigDecimal.ZERO;
@@ -383,6 +383,7 @@ public class MemberService {
flow.setBalance(shopUser.getAmount());
flow.setCreateTime(new Date());
tbShopUserFlowMapper.insert(flow);
fl=awardAmount;
}
JSONObject jsonObject = new JSONObject();
@@ -396,7 +397,7 @@ public class MemberService {
JSONObject baObj=new JSONObject();
baObj.put("userId",shopUser.getUserId());
baObj.put("shopId",shopInfo.getId());
baObj.put("amount",amount);
baObj.put("amount",ObjectUtil.isNull(fl)?amount:amount.add(fl));
baObj.put("balance",shopUser.getAmount());
baObj.put("type","扫码充值");
baObj.put("time",flow.getCreateTime());
@@ -549,7 +550,7 @@ public class MemberService {
JSONObject baObj=new JSONObject();
baObj.put("userId",shopUser.getUserId());
baObj.put("shopId",shopUser.getShopId());
baObj.put("amount",memberIn.getAmount());
baObj.put("amount",memberIn.getAmount().add(awardAmount));
baObj.put("balance",shopUser.getAmount());
baObj.put("type","充值");
baObj.put("time",flow.getCreateTime());
@@ -656,6 +657,7 @@ public class MemberService {
flow.setBalance(shopUser.getAmount());
flow.setCreateTime(new Date());
tbShopUserFlowMapper.insert(flow);
BigDecimal fl=null;
TbActivate activate = tbActivateMapper.selectByAmount(shopInfo.getId().toString(), memberIn.getAmount());
if (ObjectUtil.isNotEmpty(activate) && ObjectUtil.isNotNull(activate)) {
@@ -683,6 +685,8 @@ public class MemberService {
flow.setCreateTime(new Date());
tbShopUserFlowMapper.insert(flow);
fl=awardAmount;
}
@@ -698,7 +702,7 @@ public class MemberService {
JSONObject baObj=new JSONObject();
baObj.put("userId",shopUser.getUserId());
baObj.put("shopId",shopInfo.getId());
baObj.put("amount",amount);
baObj.put("amount",ObjectUtil.isNull(fl)?amount:amount.add(fl));
baObj.put("balance",shopUser.getAmount());
baObj.put("type","充值");
baObj.put("time",flow.getCreateTime());