rk
17 小时以前 ab9cd2c82bd64de8e33510db1d1e78a5b3b4de70
server/services/src/main/java/com/doumee/service/business/impl/MemberServiceImpl.java
@@ -286,8 +286,6 @@
            String token = JwtTokenUtil.generateTokenForRedis(member.getId(), Constants.ZERO, JSONObject.toJSONString(member), redisTemplate);
            accountResponse.setToken(token);
            accountResponse.setMember(member);
            // 门店用户身份时,返回申请的门店状态
            fillShopInfo(accountResponse, member);
            return accountResponse;
        } catch (WxErrorException e) {
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "微信登录异常!请联系管理员");
@@ -341,8 +339,6 @@
            AccountResponse accountResponse = new AccountResponse();
            accountResponse.setToken(token);
            accountResponse.setMember(member);
            // 门店用户身份时,返回申请的门店状态
            fillShopInfo(accountResponse, member);
            return accountResponse;
        } catch (Exception e) {
            e.printStackTrace();
@@ -353,15 +349,23 @@
    /**
     * 门店用户身份时,填充门店审核状态
     */
    private void fillShopInfo(AccountResponse response, Member member) {
        if (Constants.TWO.equals(member.getUserType())) {
            ShopInfo shopInfo = shopInfoMapper.selectOne(new QueryWrapper<ShopInfo>().lambda()
                    .eq(ShopInfo::getRegionMemberId, member.getId())
    private void fillShopInfo(UserCenterVO userCenterVO, Member member) {
        ShopInfo shopInfo = shopInfoMapper.selectOne(new QueryWrapper<ShopInfo>().lambda()
                .eq(ShopInfo::getRegionMemberId, member.getId())
                .eq(ShopInfo::getDeleted, Constants.ZERO)
                .last("limit 1"));
        if (shopInfo != null) {
            userCenterVO.setShopId(shopInfo.getId());
            userCenterVO.setShopAuditStatus(shopInfo.getAuditStatus());
        }
        // 根据openid查询当前绑定的门店
        if (StringUtils.isNotBlank(member.getOpenid())) {
            ShopInfo bindShop = shopInfoMapper.selectOne(new QueryWrapper<ShopInfo>().lambda()
                    .eq(ShopInfo::getOpenid, member.getOpenid())
                    .eq(ShopInfo::getDeleted, Constants.ZERO)
                    .last("limit 1"));
            if (shopInfo != null) {
                response.setShopId(shopInfo.getId());
                response.setShopAuditStatus(shopInfo.getAuditStatus());
            if (bindShop != null) {
                userCenterVO.setBindShopId(String.valueOf(bindShop.getId()));
            }
        }
    }
@@ -398,6 +402,7 @@
        userCenterVO.setName(member.getName());
        userCenterVO.setTelephone(member.getTelephone());
        userCenterVO.setCoverImage(member.getCoverImage());
        userCenterVO.setOpenid(member.getOpenid());
        if(StringUtils.isNotBlank(member.getCoverImage())){
            String path  = systemDictDataBiz.queryByCode(Constants.OSS,Constants.RESOURCE_PATH).getCode()
                    +systemDictDataBiz.queryByCode(Constants.OSS,Constants.MEMBER_FILES).getCode();
@@ -417,6 +422,14 @@
                .eq(Orders::getDeleted, Constants.ZERO)
                .in(Orders::getStatus, Arrays.stream(waitReceiveStatuses).boxed().collect(Collectors.toList())));
        userCenterVO.setWaitReceiveCount(waitReceiveCount.intValue());
        // 退款中订单数量
        Long refundingCount = ordersMapper.selectCount(new QueryWrapper<Orders>().lambda()
                .eq(Orders::getMemberId, memberId)
                .eq(Orders::getDeleted, Constants.ZERO)
                .eq(Orders::getStatus, 98));
        userCenterVO.setRefundingCount(refundingCount.intValue());
        // 门店用户身份时,返回申请的门店状态
        fillShopInfo(userCenterVO, member);
        return userCenterVO;
    }