fix
Helius
2021-09-23 1008bf87e2ad08d6e98a9c8131de0f4867746e01
src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallOrderInfoServiceImpl.java
@@ -6,6 +6,7 @@
import cc.mrbird.febs.common.utils.AppContants;
import cc.mrbird.febs.common.utils.LoginUserUtil;
import cc.mrbird.febs.common.utils.MallUtils;
import cc.mrbird.febs.common.utils.RedisUtils;
import cc.mrbird.febs.mall.conversion.MallOrderInfoConversion;
import cc.mrbird.febs.mall.conversion.MallOrderRefundConversion;
import cc.mrbird.febs.mall.dto.*;
@@ -54,13 +55,14 @@
    private final MallOrderRefundMapper mallOrderRefundMapper;
    private final MallOrderRefundOperationMapper mallOrderRefundOperationMapper;
    private final MallShoppingCartMapper mallShoppingCartMapper;
    private final RedisUtils redisUtils;
    @Override
    @Transactional(rollbackFor = Exception.class)
    public Long createOrder(AddOrderDto addOrderDto) {
        MallMember member = LoginUserUtil.getLoginUser();
        MallAddressInfo address = mallAddressInfoMapper.selectById(addOrderDto.getAddressId());
        MallAddressInfo address = mallAddressInfoMapper.selectAddressInfoByMemberIdAndId(member.getId(), addOrderDto.getAddressId());
        if (address == null) {
            throw new FebsException("地址不存在");
        }
@@ -121,6 +123,9 @@
        orderInfo.setAmount(total);
        this.baseMapper.updateById(orderInfo);
        String redisKey = StrUtil.format(AppContants.REDIS_ORDER_OVERTIME, member.getId(), orderInfo.getId());
        redisUtils.set(redisKey, orderInfo.getId(), 900);
        return orderInfo.getId();
    }
@@ -176,7 +181,12 @@
        }
        MallMember mallMember = memberMapper.selectById(orderInfo.getMemberId());
        if (!mallMember.getTradePassword().equals(SecureUtil.md5(tradePwd))) {
        if (StrUtil.isBlank(mallMember.getTradePassword())) {
            throw new FebsException("未设置支付密码");
        }
        if (!SecureUtil.md5(tradePwd).equals(mallMember.getTradePassword())) {
            throw new FebsException("支付密码错误");
        }