| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.common.core.utils.DateUtils; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | |
| | | } |
| | | |
| | | public static String getMobileByWX(String accessToken, String code) throws Exception { |
| | | String method = "POST"; |
| | | Map<String, String> headers = new HashMap<>(16); |
| | | headers.put("Content-Type", "application/json"); |
| | | headers.put("Accept", "application/json"); |
| | |
| | | appUserInfoVo.setNickName(member.getNickName()); |
| | | appUserInfoVo.setRealName(member.getRealName()); |
| | | appUserInfoVo.setPhonenumber(member.getMobile()); |
| | | //绑定会员显示绑定店铺 |
| | | if (member.getRelationShopId() != null && member.getBindingFlag() == 1) { |
| | | appUserInfoVo.setRelationShopId(member.getRelationShopId()); |
| | | Shop shop = shopService.getShop(member.getRelationShopId()).getData(); |
| | |
| | | appUserInfoVo.setBirthday(member.getBirthday()); |
| | | appUserInfoVo.setGender(member.getGender()); |
| | | appUserInfoVo.setAvatar(member.getAvatar()); |
| | | //待支付待核销统计 |
| | | AppOrderTotalVo appOrderTotalVo = orderService.getAppOrderTotal(userId).getData(); |
| | | appUserInfoVo.setNoPayCount(appOrderTotalVo.getNoPayCount()); |
| | | appUserInfoVo.setNoUseCount(appOrderTotalVo.getNoUseCount()); |
| | | //积分 |
| | | MemberTotal memberTotal = memberTotalService.getById(member.getMemberId()); |
| | | appUserInfoVo.setIntegral(memberTotal.getUseableIntegral()); |
| | | return appUserInfoVo; |
| | |
| | | String phoneNumber = merMemberAddDto.getPhonenumber(); |
| | | Member oldMember = this.getByMobile(phoneNumber); |
| | | // Check if the member already exists |
| | | if (oldMember != null) { |
| | | if (oldMember != null && oldMember.getBindingFlag() == 1) { |
| | | throw new ServiceException(AppErrorConstant.MOBILE_USER_DOUBLE); |
| | | } |
| | | if (oldMember != null && oldMember.getBindingFlag() == 0) { |
| | | oldMember.setRelationShopId(merMemberAddDto.getShopId()); |
| | | oldMember.setBindingFlag(1); |
| | | this.updateById(oldMember); |
| | | return oldMember.getUserId(); |
| | | } |
| | | // Get the sysUser by mobile number |
| | | SysUser sysUser = sysUserService.getSysUserByMobile(phoneNumber).getData(); |
| | |
| | | //活跃度赋值 |
| | | Date lastPayTime; |
| | | for (MgtMemberPageVo mgtMemberPageVo : memberPageVoList) { |
| | | if(null != mgtMemberPageVo.getRelationShopId() && 1 == mgtMemberPageVo.getBindingFlag()){ |
| | | R<Shop> shop_r = remoteShopService.getShop(mgtMemberPageVo.getRelationShopId()); |
| | | if(shop_r.getCode() == 200){ |
| | | Shop data = shop_r.getData(); |
| | | if(null != data){ |
| | | mgtMemberPageVo.setRelationShopName(data.getShopName()); |
| | | } |
| | | } |
| | | } |
| | | lastPayTime = mgtMemberPageVo.getLastPayTime(); |
| | | StringJoiner sj = new StringJoiner(","); |
| | | if (lastPayTime != null) { |
| | |
| | | mgtMemberGetVo.setLastPayTime(memberTotal.getLastPayTime()); |
| | | mgtMemberGetVo.setGoodsType(member.getGoodsType()); |
| | | if(member.getBindingFlag()==1){ |
| | | mgtMemberGetVo.setRelationShopName(member.getRelationShopName()); |
| | | R<Shop> shop = remoteShopService.getShop(member.getRelationShopId()); |
| | | if(shop.getCode() == 200){ |
| | | Shop data = shop.getData(); |
| | | if(null != data){ |
| | | mgtMemberGetVo.setRelationShopName(data.getShopName()); |
| | | } |
| | | } |
| | | } |
| | | mgtMemberGetVo.setIntegral(memberTotal.getTotalIntegral()); |
| | | mgtMemberGetVo.setMemberFrom(member.getCustomerSource()); |