Commit cbd79471 by 吕明尚

修改用户信息

parent fc5eb1a1
package share.system.domain.vo;
import lombok.Data;
import share.system.domain.MemberConfig;
@Data
public class MemberConfigVo extends MemberConfig {
//下一级的额度要求
private Long nextLimitRequirements;
//下一级的会员等级
private Long nextMembershipLevel;
//下一级的会员名称
private String nextMembershipName;
}
...@@ -3,7 +3,6 @@ package share.system.domain.vo; ...@@ -3,7 +3,6 @@ package share.system.domain.vo;
import lombok.Data; import lombok.Data;
import share.system.domain.ConsumerMember; import share.system.domain.ConsumerMember;
import share.system.domain.ConsumerWallet; import share.system.domain.ConsumerWallet;
import share.system.domain.MemberConfig;
import share.system.domain.SConsumer; import share.system.domain.SConsumer;
/** /**
...@@ -33,6 +32,6 @@ public class SConsumerVo extends SConsumer { ...@@ -33,6 +32,6 @@ public class SConsumerVo extends SConsumer {
private ConsumerWallet consumerWallet; private ConsumerWallet consumerWallet;
private MemberConfig memberConfig; private MemberConfigVo memberConfig;
} }
...@@ -381,6 +381,7 @@ public class CallbackServiceImpl implements CallbackService { ...@@ -381,6 +381,7 @@ public class CallbackServiceImpl implements CallbackService {
} }
break; break;
case RECHARGE: case RECHARGE:
logger.debug("开始充值订单支付回调");
Recharge rechargeParam = new Recharge(); Recharge rechargeParam = new Recharge();
rechargeParam.setTerminalTrace(param.getTerminal_trace()); rechargeParam.setTerminalTrace(param.getTerminal_trace());
rechargeParam.setConsumerId(attachVo.getUserId()); rechargeParam.setConsumerId(attachVo.getUserId());
...@@ -443,6 +444,7 @@ public class CallbackServiceImpl implements CallbackService { ...@@ -443,6 +444,7 @@ public class CallbackServiceImpl implements CallbackService {
logger.error("微信支付回调出错"); logger.error("微信支付回调出错");
logger.error(e.toString()); logger.error(e.toString());
} }
logger.debug("结束充值订单支付回调");
if (!aFalse) { if (!aFalse) {
logger.error("saobei wechat pay error : 订单更新失败==》" + param.getTerminal_trace()); logger.error("saobei wechat pay error : 订单更新失败==》" + param.getTerminal_trace());
...@@ -458,6 +460,7 @@ public class CallbackServiceImpl implements CallbackService { ...@@ -458,6 +460,7 @@ public class CallbackServiceImpl implements CallbackService {
} }
break; break;
case RIGHTS: case RIGHTS:
logger.debug("开始权益会员订单回调");
EquityMembersOrder equityMembersOrderParam = new EquityMembersOrder(); EquityMembersOrder equityMembersOrderParam = new EquityMembersOrder();
equityMembersOrderParam.setTerminalTrace(param.getTerminal_trace()); equityMembersOrderParam.setTerminalTrace(param.getTerminal_trace());
equityMembersOrderParam.setConsumerId(attachVo.getUserId()); equityMembersOrderParam.setConsumerId(attachVo.getUserId());
...@@ -520,7 +523,7 @@ public class CallbackServiceImpl implements CallbackService { ...@@ -520,7 +523,7 @@ public class CallbackServiceImpl implements CallbackService {
logger.error("微信支付回调出错"); logger.error("微信支付回调出错");
logger.error(e.toString()); logger.error(e.toString());
} }
logger.debug("结束权益会员订单回调");
if (!aBoolean) { if (!aBoolean) {
logger.error("saobei wechat pay error : 订单更新失败==》" + param.getTerminal_trace()); logger.error("saobei wechat pay error : 订单更新失败==》" + param.getTerminal_trace());
responseVo.setReturn_code(SaobeiStatusEnum.FAIL.getCode()); responseVo.setReturn_code(SaobeiStatusEnum.FAIL.getCode());
......
...@@ -2,6 +2,8 @@ package share.system.service.impl; ...@@ -2,6 +2,8 @@ package share.system.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import share.common.enums.GiveTypeEnum; import share.common.enums.GiveTypeEnum;
...@@ -26,6 +28,7 @@ import java.util.List; ...@@ -26,6 +28,7 @@ import java.util.List;
*/ */
@Service @Service
public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper, ConsumerWallet> implements ConsumerWalletService { public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper, ConsumerWallet> implements ConsumerWalletService {
private static final Logger logger = LoggerFactory.getLogger(ConsumerWalletServiceImpl.class);
@Autowired @Autowired
private ConsumerWalletMapper consumerWalletMapper; private ConsumerWalletMapper consumerWalletMapper;
...@@ -162,6 +165,7 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper, ...@@ -162,6 +165,7 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper,
.eq(MemberConfig::getMemberType, MemberTypeEnum.RECHARGE.getIndex())); .eq(MemberConfig::getMemberType, MemberTypeEnum.RECHARGE.getIndex()));
one.setExpirationDate(DateUtils.addYears(new Date(), memberConfig.getValidityPeriod().intValue())); one.setExpirationDate(DateUtils.addYears(new Date(), memberConfig.getValidityPeriod().intValue()));
consumerMemberService.updateConsumerMember(one); consumerMemberService.updateConsumerMember(one);
logger.debug("修改会员用户");
if (rechargeConf.getGiveType().contains(GiveTypeEnum.AMOUNT.getIndex())) { if (rechargeConf.getGiveType().contains(GiveTypeEnum.AMOUNT.getIndex())) {
BigDecimal balance = consumerWallet.getBalance().add(recharge.getRechargeAmount()).add(rechargeConf.getGiveAmount()); BigDecimal balance = consumerWallet.getBalance().add(recharge.getRechargeAmount()).add(rechargeConf.getGiveAmount());
consumerWallet.setBalance(balance); consumerWallet.setBalance(balance);
...@@ -186,6 +190,7 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper, ...@@ -186,6 +190,7 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper,
balanceLog.setOperationTime(new Date()); balanceLog.setOperationTime(new Date());
balanceLog.setCreateTime(new Date()); balanceLog.setCreateTime(new Date());
balanceLogService.save(balanceLog); balanceLogService.save(balanceLog);
logger.debug("新增余额日志");
} }
if (consumerWallet.getRemainingDuration().compareTo(new BigDecimal(0)) > 0) { if (consumerWallet.getRemainingDuration().compareTo(new BigDecimal(0)) > 0) {
DurationLog durationLog = new DurationLog(); DurationLog durationLog = new DurationLog();
...@@ -196,6 +201,7 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper, ...@@ -196,6 +201,7 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper,
durationLog.setOperationType(YesNoEnum.yes.getIndex()); durationLog.setOperationType(YesNoEnum.yes.getIndex());
durationLog.setCreateTime(new Date()); durationLog.setCreateTime(new Date());
durationLogService.save(durationLog); durationLogService.save(durationLog);
logger.debug("新增时长日志");
} }
if (consumerWallet.getRemainingIntegral().compareTo(new BigDecimal(0)) > 0) { if (consumerWallet.getRemainingIntegral().compareTo(new BigDecimal(0)) > 0) {
IntegralLog integralLog = new IntegralLog(); IntegralLog integralLog = new IntegralLog();
...@@ -206,6 +212,7 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper, ...@@ -206,6 +212,7 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper,
integralLog.setOperationType(YesNoEnum.yes.getIndex()); integralLog.setOperationType(YesNoEnum.yes.getIndex());
integralLog.setCreateTime(new Date()); integralLog.setCreateTime(new Date());
integralLogService.save(integralLog); integralLogService.save(integralLog);
logger.debug("新增积分日志");
} }
return i == 1; return i == 1;
} }
......
...@@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; ...@@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import share.common.core.redis.RedisUtil; import share.common.core.redis.RedisUtil;
...@@ -34,6 +36,7 @@ import java.util.*; ...@@ -34,6 +36,7 @@ import java.util.*;
*/ */
@Service @Service
public class EquityMembersOrderServiceImpl extends ServiceImpl<EquityMembersOrderMapper, EquityMembersOrder> implements EquityMembersOrderService { public class EquityMembersOrderServiceImpl extends ServiceImpl<EquityMembersOrderMapper, EquityMembersOrder> implements EquityMembersOrderService {
private static final Logger logger = LoggerFactory.getLogger(EquityMembersOrderServiceImpl.class);
@Autowired @Autowired
private EquityMembersOrderMapper equityMembersOrderMapper; private EquityMembersOrderMapper equityMembersOrderMapper;
@Autowired @Autowired
...@@ -158,18 +161,21 @@ public class EquityMembersOrderServiceImpl extends ServiceImpl<EquityMembersOrde ...@@ -158,18 +161,21 @@ public class EquityMembersOrderServiceImpl extends ServiceImpl<EquityMembersOrde
newConsumerMember.setMembershipProgress(0L); newConsumerMember.setMembershipProgress(0L);
newConsumerMember.setCreateTime(new Date()); newConsumerMember.setCreateTime(new Date());
consumerMemberService.save(newConsumerMember); consumerMemberService.save(newConsumerMember);
logger.debug("新增权益会员");
Map<String, String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
map.put("consumerId", String.valueOf(newConsumerMember.getConsumerId())); map.put("consumerId", String.valueOf(newConsumerMember.getConsumerId()));
//当前时间加15分钟 //当前时间加15分钟
map.put("expirationTime", newConsumerMember.getExpirationDate().toString()); map.put("expirationTime", newConsumerMember.getExpirationDate().toString());
JSONObject json = new JSONObject(map); JSONObject json = new JSONObject(map);
redisUtil.set(ReceiptRdeisEnum.EQUITY_MEMBERS_TIME.getValue() + equityMembersOrder.getConsumerId(), json.toString()); redisUtil.set(ReceiptRdeisEnum.EQUITY_MEMBERS_TIME.getValue() + equityMembersOrder.getConsumerId(), json.toString());
logger.debug("redis新增权益会员有效期");
} else { } else {
if (consumerMember.getMemberType().equals(MemberTypeEnum.RIGHTS.getIndex())) { if (consumerMember.getMemberType().equals(MemberTypeEnum.RIGHTS.getIndex())) {
//在原来的基础上增加有效期 //在原来的基础上增加有效期
consumerMember.setExpirationDate(DateUtils.addYears(DateUtils.parseDate(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM, consumerMember.getExpirationDate())), consumerMember.setExpirationDate(DateUtils.addYears(DateUtils.parseDate(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM, consumerMember.getExpirationDate())),
equityMembersOrderConfig.getValidityPeriod().intValue())); equityMembersOrderConfig.getValidityPeriod().intValue()));
consumerMemberService.updateConsumerMember(consumerMember); consumerMemberService.updateConsumerMember(consumerMember);
logger.debug("权益会员原来的基础上增加有效期");
} else { } else {
//修改会员类型为权益会员 //修改会员类型为权益会员
consumerMember.setMemberType(MemberTypeEnum.RIGHTS.getIndex()); consumerMember.setMemberType(MemberTypeEnum.RIGHTS.getIndex());
...@@ -179,6 +185,7 @@ public class EquityMembersOrderServiceImpl extends ServiceImpl<EquityMembersOrde ...@@ -179,6 +185,7 @@ public class EquityMembersOrderServiceImpl extends ServiceImpl<EquityMembersOrde
consumerMember.setExpirationDate(DateUtils.addYears(DateUtils.parseDate(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM, new Date())), consumerMember.setExpirationDate(DateUtils.addYears(DateUtils.parseDate(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM, new Date())),
equityMembersOrderConfig.getValidityPeriod().intValue())); equityMembersOrderConfig.getValidityPeriod().intValue()));
consumerMemberService.updateConsumerMember(consumerMember); consumerMemberService.updateConsumerMember(consumerMember);
logger.debug("修改会员类型为权益会员");
} }
Map<String, String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
map.put("consumerId", String.valueOf(consumerMember.getConsumerId())); map.put("consumerId", String.valueOf(consumerMember.getConsumerId()));
......
...@@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; ...@@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -37,6 +39,8 @@ import java.util.Objects; ...@@ -37,6 +39,8 @@ import java.util.Objects;
*/ */
@Service @Service
public class RechargeServiceImpl extends ServiceImpl<RechargeMapper, Recharge> implements RechargeService { public class RechargeServiceImpl extends ServiceImpl<RechargeMapper, Recharge> implements RechargeService {
private static final Logger logger = LoggerFactory.getLogger(RechargeServiceImpl.class);
@Autowired @Autowired
private RechargeMapper rechargeMapper; private RechargeMapper rechargeMapper;
@Autowired @Autowired
...@@ -161,6 +165,7 @@ public class RechargeServiceImpl extends ServiceImpl<RechargeMapper, Recharge> i ...@@ -161,6 +165,7 @@ public class RechargeServiceImpl extends ServiceImpl<RechargeMapper, Recharge> i
consumerMember.setExpirationDate(DateUtils.addYears(new Date(), memberConfig.getValidityPeriod().intValue())); consumerMember.setExpirationDate(DateUtils.addYears(new Date(), memberConfig.getValidityPeriod().intValue()));
consumerMember.setCreateTime(new Date()); consumerMember.setCreateTime(new Date());
consumerMemberService.save(consumerMember); consumerMemberService.save(consumerMember);
logger.debug("新增充值会员");
extracted(recharge); extracted(recharge);
} else { } else {
ConsumerWallet consumerWallet = consumerWalletService.getOne(new LambdaQueryWrapper<ConsumerWallet>().eq(ConsumerWallet::getConsumerId, recharge.getConsumerId())); ConsumerWallet consumerWallet = consumerWalletService.getOne(new LambdaQueryWrapper<ConsumerWallet>().eq(ConsumerWallet::getConsumerId, recharge.getConsumerId()));
...@@ -226,6 +231,7 @@ public class RechargeServiceImpl extends ServiceImpl<RechargeMapper, Recharge> i ...@@ -226,6 +231,7 @@ public class RechargeServiceImpl extends ServiceImpl<RechargeMapper, Recharge> i
consumerWallet.setRemainingIntegral(new BigDecimal(0)); consumerWallet.setRemainingIntegral(new BigDecimal(0));
} }
consumerWallet.setCreateTime(new Date()); consumerWallet.setCreateTime(new Date());
logger.debug("新增会员钱包");
consumerWalletService.addConsumerWallet(consumerWallet); consumerWalletService.addConsumerWallet(consumerWallet);
} }
......
...@@ -20,6 +20,7 @@ import share.common.utils.BaseUtil; ...@@ -20,6 +20,7 @@ import share.common.utils.BaseUtil;
import share.common.utils.DateUtil; import share.common.utils.DateUtil;
import share.system.domain.*; import share.system.domain.*;
import share.system.domain.vo.FrontTokenComponent; import share.system.domain.vo.FrontTokenComponent;
import share.system.domain.vo.MemberConfigVo;
import share.system.domain.vo.SConsumerVo; import share.system.domain.vo.SConsumerVo;
import share.system.mapper.SConsumerMapper; import share.system.mapper.SConsumerMapper;
import share.system.mapper.SStoreConsumerMapper; import share.system.mapper.SStoreConsumerMapper;
...@@ -194,7 +195,18 @@ public class SConsumerServiceImpl extends ServiceImpl<SConsumerMapper, SConsumer ...@@ -194,7 +195,18 @@ public class SConsumerServiceImpl extends ServiceImpl<SConsumerMapper, SConsumer
if (ObjectUtil.isNotEmpty(consumerMember)) { if (ObjectUtil.isNotEmpty(consumerMember)) {
vo.setConsumerMember(consumerMember); vo.setConsumerMember(consumerMember);
MemberConfig memberConfig = memberConfigService.getById(consumerMember.getMemberConfigId()); MemberConfig memberConfig = memberConfigService.getById(consumerMember.getMemberConfigId());
vo.setMemberConfig(memberConfig); MemberConfigVo memberConfigVo = new MemberConfigVo();
BeanUtils.copyProperties(memberConfig, memberConfigVo);
MemberConfig nexMemberConfig = memberConfigService.getOne(new LambdaQueryWrapper<MemberConfig>()
.eq(MemberConfig::getMemberType, memberConfig.getMemberType())
.eq(MemberConfig::getMembershipLevel, memberConfig.getMembershipLevel() + 1)
);
if (ObjectUtil.isNotEmpty(nexMemberConfig)) {
memberConfigVo.setNextLimitRequirements(nexMemberConfig.getLimitRequirements());
memberConfigVo.setNextMembershipLevel(nexMemberConfig.getMembershipLevel());
memberConfigVo.setNextMembershipName(nexMemberConfig.getLevelName());
}
vo.setMemberConfig(memberConfigVo);
} }
if (ObjectUtil.isNotEmpty(consumerWallet)) { if (ObjectUtil.isNotEmpty(consumerWallet)) {
vo.setConsumerWallet(consumerWallet); vo.setConsumerWallet(consumerWallet);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment