fix: 商城支付相关
parent
4aadcef501
commit
80937224e5
|
@ -0,0 +1,22 @@
|
||||||
|
package cn.iocoder.yudao.module.shop.request.member;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Title:MemberChangeTieRequest
|
||||||
|
* @Description: TODO
|
||||||
|
* @author: tangqian
|
||||||
|
* @date: 2023/5/29 14:47
|
||||||
|
* @version: V1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class MemberChangeTieRequest implements Serializable {
|
||||||
|
private static final long serialVersionUID = -7173209981786890536L;
|
||||||
|
@Schema(description = "推广员id")
|
||||||
|
@NotNull(message = "推广员id不能为空")
|
||||||
|
private Long promoterId;
|
||||||
|
}
|
|
@ -24,6 +24,9 @@ import java.util.List;
|
||||||
@Schema(description="会员充值下单请求入参")
|
@Schema(description="会员充值下单请求入参")
|
||||||
public class OrderContentRequest implements Serializable {
|
public class OrderContentRequest implements Serializable {
|
||||||
private static final long serialVersionUID = -9170167938995005780L;
|
private static final long serialVersionUID = -9170167938995005780L;
|
||||||
|
@Schema(description = "用户姓名")
|
||||||
|
private String userName;
|
||||||
|
|
||||||
@Schema(description = "用户电话")
|
@Schema(description = "用户电话")
|
||||||
private String userPhone;
|
private String userPhone;
|
||||||
|
|
||||||
|
@ -37,6 +40,7 @@ public class OrderContentRequest implements Serializable {
|
||||||
@NotEmpty(message = "支付类型不能为空")
|
@NotEmpty(message = "支付类型不能为空")
|
||||||
private String payType;
|
private String payType;
|
||||||
|
|
||||||
|
|
||||||
@Schema(description = "订单信息")
|
@Schema(description = "订单信息")
|
||||||
private List<OrderInfo> orderInfos;
|
private List<OrderInfo> orderInfos;
|
||||||
@Data
|
@Data
|
||||||
|
|
|
@ -70,4 +70,5 @@ public class CreateOrderRequest implements Serializable {
|
||||||
|
|
||||||
@Schema(description = "手机号码")
|
@Schema(description = "手机号码")
|
||||||
private String phone;
|
private String phone;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,6 +43,7 @@ public class OrderPayResultResponse {
|
||||||
|
|
||||||
@Schema(description ="支付宝返回参数")
|
@Schema(description ="支付宝返回参数")
|
||||||
private String body;
|
private String body;
|
||||||
|
|
||||||
//
|
//
|
||||||
// @Schema(description = "支付宝调起支付参数对象(app支付专用)")
|
// @Schema(description = "支付宝调起支付参数对象(app支付专用)")
|
||||||
// private AliPayJsResultVo aliPayConfig;
|
// private AliPayJsResultVo aliPayConfig;
|
||||||
|
|
|
@ -369,4 +369,8 @@ public class StoreOrderDetailInfoResponse implements Serializable {
|
||||||
// private SystemStore systemStore;
|
// private SystemStore systemStore;
|
||||||
// private String mapKey;
|
// private String mapKey;
|
||||||
// private String statusPic;
|
// private String statusPic;
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description ="倒计时")
|
||||||
|
private long countDownTime;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,10 +3,13 @@ package cn.iocoder.yudao.module.shop.controller.app.member;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated;
|
import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated;
|
||||||
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
||||||
|
import cn.iocoder.yudao.module.member.api.user.MemberUserApi;
|
||||||
import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.RechargeGearRespVO;
|
import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.RechargeGearRespVO;
|
||||||
import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.RechargeOrderRespVO;
|
import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.RechargeOrderRespVO;
|
||||||
import cn.iocoder.yudao.module.shop.convert.recharge.RechargeOrderConvert;
|
import cn.iocoder.yudao.module.shop.convert.recharge.RechargeOrderConvert;
|
||||||
import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeOrderDO;
|
import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeOrderDO;
|
||||||
|
import cn.iocoder.yudao.module.shop.request.member.MemberChangeTieRequest;
|
||||||
|
import cn.iocoder.yudao.module.shop.request.order.CreateOrderRequest;
|
||||||
import cn.iocoder.yudao.module.shop.response.member.MemberHeadResponse;
|
import cn.iocoder.yudao.module.shop.response.member.MemberHeadResponse;
|
||||||
import cn.iocoder.yudao.module.shop.service.recharge.PhoneRecordService;
|
import cn.iocoder.yudao.module.shop.service.recharge.PhoneRecordService;
|
||||||
import cn.iocoder.yudao.module.shop.service.recharge.RechargeGearService;
|
import cn.iocoder.yudao.module.shop.service.recharge.RechargeGearService;
|
||||||
|
@ -16,10 +19,8 @@ import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -41,6 +42,7 @@ public class MemberController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private RechargeOrderService rechargeOrderService;
|
private RechargeOrderService rechargeOrderService;
|
||||||
|
|
||||||
|
|
||||||
// 会员档次信息列表
|
// 会员档次信息列表
|
||||||
@Operation(summary = "会员档次信息")
|
@Operation(summary = "会员档次信息")
|
||||||
@RequestMapping(value = "/memberGradeInfo", method = RequestMethod.GET)
|
@RequestMapping(value = "/memberGradeInfo", method = RequestMethod.GET)
|
||||||
|
@ -82,4 +84,13 @@ public class MemberController {
|
||||||
public CommonResult<List<RechargeOrderRespVO>> memberOrderInfoByPhone(@RequestParam String phone) {
|
public CommonResult<List<RechargeOrderRespVO>> memberOrderInfoByPhone(@RequestParam String phone) {
|
||||||
return CommonResult.success(rechargeOrderService.memberOrderInfoByPhone(phone));
|
return CommonResult.success(rechargeOrderService.memberOrderInfoByPhone(phone));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "会员换绑")
|
||||||
|
@RequestMapping(value = "/memberChangeTie", method = RequestMethod.POST)
|
||||||
|
@PreAuthenticated
|
||||||
|
@TenantIgnore
|
||||||
|
public CommonResult<Boolean> memberChangeTie(@Validated @RequestBody MemberChangeTieRequest changeTieRequest) {
|
||||||
|
return CommonResult.success(rechargeOrderService.memberChangeTie(changeTieRequest));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -207,4 +207,16 @@ public class StoreOrder implements Serializable {
|
||||||
|
|
||||||
@Schema(description = "商户系统内部的订单号,32个字符内、可包含字母, 其他说明见商户订单号")
|
@Schema(description = "商户系统内部的订单号,32个字符内、可包含字母, 其他说明见商户订单号")
|
||||||
private String outTradeNo;
|
private String outTradeNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 推广员id
|
||||||
|
*/
|
||||||
|
private Long promoterId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组织id
|
||||||
|
*/
|
||||||
|
private Long deptId;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,4 +91,14 @@ public class StoreOrderInfo implements Serializable {
|
||||||
|
|
||||||
@Schema(description = "商品类型:0-普通,1-秒杀,2-砍价,3-拼团,4-视频号")
|
@Schema(description = "商品类型:0-普通,1-秒杀,2-砍价,3-拼团,4-视频号")
|
||||||
private Integer productType;
|
private Integer productType;
|
||||||
|
/**
|
||||||
|
* 推广员id
|
||||||
|
*/
|
||||||
|
private Long promoterId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组织id
|
||||||
|
*/
|
||||||
|
private Long deptId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,9 +45,12 @@ import org.springframework.transaction.support.TransactionTemplate;
|
||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.time.Instant;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
|
import java.time.ZoneOffset;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@ -403,4 +406,13 @@ public class OrderPayServiceImpl implements OrderPayService {
|
||||||
return localDateTime.format(DateTimeFormatter.ofPattern(pattern));
|
return localDateTime.format(DateTimeFormatter.ofPattern(pattern));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
System.out.println(formatLocalDateTime(LocalDateTime.now().plusMinutes(30),"yyyyMMddHHmmss"));
|
||||||
|
LocalDateTime localDateTime = LocalDateTime.now().plusMinutes(30);
|
||||||
|
long l = localDateTime.toInstant(ZoneOffset.ofHours(8)).toEpochMilli();
|
||||||
|
LocalDateTime a = Instant.ofEpochMilli(l).atZone(ZoneOffset.ofHours(8)).toLocalDateTime();
|
||||||
|
System.out.println(l);
|
||||||
|
System.out.println(a);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,12 +10,16 @@ import cn.iocoder.yudao.framework.common.pojo.DateLimitUtilVo;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
import cn.iocoder.yudao.framework.common.util.date.DateUtils;
|
import cn.iocoder.yudao.framework.common.util.date.DateUtils;
|
||||||
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
|
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
|
||||||
|
import cn.iocoder.yudao.framework.security.core.LoginUser;
|
||||||
|
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||||
|
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
|
||||||
import cn.iocoder.yudao.module.infra.api.config.ApiConfigApi;
|
import cn.iocoder.yudao.module.infra.api.config.ApiConfigApi;
|
||||||
import cn.iocoder.yudao.module.member.api.address.AddressApi;
|
import cn.iocoder.yudao.module.member.api.address.AddressApi;
|
||||||
import cn.iocoder.yudao.module.member.api.address.UserAddressApi;
|
import cn.iocoder.yudao.module.member.api.address.UserAddressApi;
|
||||||
import cn.iocoder.yudao.module.member.api.address.dto.UserAddressRespDTO;
|
import cn.iocoder.yudao.module.member.api.address.dto.UserAddressRespDTO;
|
||||||
import cn.iocoder.yudao.module.member.api.user.MemberUserApi;
|
import cn.iocoder.yudao.module.member.api.user.MemberUserApi;
|
||||||
import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO;
|
import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO;
|
||||||
|
import cn.iocoder.yudao.module.member.api.user.dto.PromoterDTO;
|
||||||
import cn.iocoder.yudao.module.shop.constants.PayConstants;
|
import cn.iocoder.yudao.module.shop.constants.PayConstants;
|
||||||
import cn.iocoder.yudao.module.shop.constants.SysConfigConstants;
|
import cn.iocoder.yudao.module.shop.constants.SysConfigConstants;
|
||||||
import cn.iocoder.yudao.module.shop.convert.order.StoreOrderConvert;
|
import cn.iocoder.yudao.module.shop.convert.order.StoreOrderConvert;
|
||||||
|
@ -51,6 +55,8 @@ import cn.iocoder.yudao.module.shop.vo.order.OrderInfoVo;
|
||||||
import cn.iocoder.yudao.module.shop.vo.order.StoreOrderInfoOldVo;
|
import cn.iocoder.yudao.module.shop.vo.order.StoreOrderInfoOldVo;
|
||||||
import cn.iocoder.yudao.module.shop.vo.order.StoreOrderInfoVo;
|
import cn.iocoder.yudao.module.shop.vo.order.StoreOrderInfoVo;
|
||||||
import cn.iocoder.yudao.module.shop.vo.product.MyRecord;
|
import cn.iocoder.yudao.module.shop.vo.product.MyRecord;
|
||||||
|
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
|
||||||
|
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
@ -64,6 +70,7 @@ import org.springframework.beans.BeanUtils;
|
||||||
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.support.TransactionTemplate;
|
import org.springframework.transaction.support.TransactionTemplate;
|
||||||
|
import org.springframework.util.Assert;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
@ -146,6 +153,12 @@ public class OrderServiceImpl implements OrderService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private StoreProductAttrValueService storeProductAttrValueService;
|
private StoreProductAttrValueService storeProductAttrValueService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MemberUserApi userService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DeptApi deptApi;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 订单列表
|
* 订单列表
|
||||||
*
|
*
|
||||||
|
@ -1158,7 +1171,16 @@ public class OrderServiceImpl implements OrderService {
|
||||||
}
|
}
|
||||||
String orderVoString = redisUtil.get(key).toString();
|
String orderVoString = redisUtil.get(key).toString();
|
||||||
OrderInfoVo orderInfoVo = JSONUtil.toBean(orderVoString, OrderInfoVo.class);
|
OrderInfoVo orderInfoVo = JSONUtil.toBean(orderVoString, OrderInfoVo.class);
|
||||||
|
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||||
|
Assert.notNull(loginUser, "登录失效,请重新登录!");
|
||||||
|
// 获取组织id
|
||||||
|
PromoterDTO promoterDTO = userService.getPromoterDOByUserId(user.getId());
|
||||||
|
Long tenantId = TenantContextHolder.getTenantId();
|
||||||
|
Long deptId = promoterDTO.getDeptId();
|
||||||
|
if (deptId == null) {
|
||||||
|
DeptRespDTO deptRespDTO = deptApi.findParentDept(tenantId);
|
||||||
|
deptId = deptRespDTO.getId();
|
||||||
|
}
|
||||||
// 检测支付方式
|
// 检测支付方式
|
||||||
if (!orderUtil.checkPayType(orderRequest.getPayType())) throw new ServiceException("暂不支持该支付方式,请刷新页面或者联系管理员");
|
if (!orderUtil.checkPayType(orderRequest.getPayType())) throw new ServiceException("暂不支持该支付方式,请刷新页面或者联系管理员");
|
||||||
|
|
||||||
|
@ -1248,6 +1270,8 @@ public class OrderServiceImpl implements OrderService {
|
||||||
soInfo.setPayNum(detailVo.getPayNum());
|
soInfo.setPayNum(detailVo.getPayNum());
|
||||||
soInfo.setWeight(detailVo.getWeight());
|
soInfo.setWeight(detailVo.getWeight());
|
||||||
soInfo.setVolume(detailVo.getVolume());
|
soInfo.setVolume(detailVo.getVolume());
|
||||||
|
soInfo.setPromoterId(user.getPromoterId());
|
||||||
|
soInfo.setDeptId(deptId);
|
||||||
if (ObjectUtil.isNotNull(detailVo.getGiveIntegral()) && detailVo.getGiveIntegral() > 0) {
|
if (ObjectUtil.isNotNull(detailVo.getGiveIntegral()) && detailVo.getGiveIntegral() > 0) {
|
||||||
soInfo.setGiveIntegral(detailVo.getGiveIntegral());
|
soInfo.setGiveIntegral(detailVo.getGiveIntegral());
|
||||||
} else {
|
} else {
|
||||||
|
@ -1334,6 +1358,8 @@ public class OrderServiceImpl implements OrderService {
|
||||||
storeOrder.setPaid(false);
|
storeOrder.setPaid(false);
|
||||||
storeOrder.setCost(BigDecimal.ZERO);
|
storeOrder.setCost(BigDecimal.ZERO);
|
||||||
storeOrder.setType(0);
|
storeOrder.setType(0);
|
||||||
|
storeOrder.setPromoterId(user.getPromoterId());
|
||||||
|
storeOrder.setDeptId(deptId);
|
||||||
if (orderInfoVo.getIsVideo()) {
|
if (orderInfoVo.getIsVideo()) {
|
||||||
storeOrder.setType(1);// 视频号订单
|
storeOrder.setType(1);// 视频号订单
|
||||||
}
|
}
|
||||||
|
|
|
@ -159,6 +159,7 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderMapper, StoreOr
|
||||||
private RechargeGearService rechargeGearService;
|
private RechargeGearService rechargeGearService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private StoreOrderMapper storeOrderMapper;
|
private StoreOrderMapper storeOrderMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 列表(PC)
|
* 列表(PC)
|
||||||
*
|
*
|
||||||
|
@ -1285,6 +1286,7 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderMapper, StoreOr
|
||||||
String s = "MEMBER_1661994584871321602";
|
String s = "MEMBER_1661994584871321602";
|
||||||
System.out.println(s.contains("MEMBER_"));
|
System.out.println(s.contains("MEMBER_"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addPhoneRecord(RechargeOrderDO orderDO, String orderId) {
|
public void addPhoneRecord(RechargeOrderDO orderDO, String orderId) {
|
||||||
List<RechargeOrderInfoDO> infoDOS = rechargeOrderInfoMapper.selectList(Wrappers.<RechargeOrderInfoDO>lambdaQuery().eq(RechargeOrderInfoDO::getOrderNo, orderId));
|
List<RechargeOrderInfoDO> infoDOS = rechargeOrderInfoMapper.selectList(Wrappers.<RechargeOrderInfoDO>lambdaQuery().eq(RechargeOrderInfoDO::getOrderNo, orderId));
|
||||||
List<PhoneRecordDO> recordDOS = new ArrayList<>();
|
List<PhoneRecordDO> recordDOS = new ArrayList<>();
|
||||||
|
@ -1524,7 +1526,7 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderMapper, StoreOr
|
||||||
MemberUserRespDTO userByMobile = userService.getUserByMobile(request.getUserPhone());
|
MemberUserRespDTO userByMobile = userService.getUserByMobile(request.getUserPhone());
|
||||||
// 初始化一个账号
|
// 初始化一个账号
|
||||||
if (Objects.isNull(userByMobile)) {
|
if (Objects.isNull(userByMobile)) {
|
||||||
userService.saveMemberUser(request.getUserPhone(), user.getPromoterId());
|
userService.saveMemberUser(request.getUserPhone(), user.getPromoterId(), request.getUserName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ import javax.validation.*;
|
||||||
import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.*;
|
import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.*;
|
||||||
import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeOrderDO;
|
import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeOrderDO;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.module.shop.request.member.MemberChangeTieRequest;
|
||||||
import cn.iocoder.yudao.module.shop.response.member.MemberHeadResponse;
|
import cn.iocoder.yudao.module.shop.response.member.MemberHeadResponse;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
@ -78,4 +79,6 @@ public interface RechargeOrderService {
|
||||||
MemberHeadResponse memberHeadInfo();
|
MemberHeadResponse memberHeadInfo();
|
||||||
|
|
||||||
List<RechargeOrderRespVO> memberOrderInfoByPhone(String phone);
|
List<RechargeOrderRespVO> memberOrderInfoByPhone(String phone);
|
||||||
|
|
||||||
|
Boolean memberChangeTie(MemberChangeTieRequest changeTieRequest);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ import cn.iocoder.yudao.module.member.api.user.MemberUserApi;
|
||||||
import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO;
|
import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO;
|
||||||
import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeOrderInfoDO;
|
import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeOrderInfoDO;
|
||||||
import cn.iocoder.yudao.module.shop.dal.mysql.recharge.RechargeOrderInfoMapper;
|
import cn.iocoder.yudao.module.shop.dal.mysql.recharge.RechargeOrderInfoMapper;
|
||||||
|
import cn.iocoder.yudao.module.shop.request.member.MemberChangeTieRequest;
|
||||||
import cn.iocoder.yudao.module.shop.request.member.RefundRequest;
|
import cn.iocoder.yudao.module.shop.request.member.RefundRequest;
|
||||||
import cn.iocoder.yudao.module.shop.response.member.MemberHeadResponse;
|
import cn.iocoder.yudao.module.shop.response.member.MemberHeadResponse;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
@ -51,6 +52,8 @@ public class RechargeOrderServiceImpl implements RechargeOrderService {
|
||||||
private MemberUserApi userService;
|
private MemberUserApi userService;
|
||||||
@Resource
|
@Resource
|
||||||
private PhoneRecordService phoneRecordService;
|
private PhoneRecordService phoneRecordService;
|
||||||
|
@Autowired
|
||||||
|
private MemberUserApi memberUserApi;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long createRechargeOrder(RechargeOrderCreateReqVO createReqVO) {
|
public Long createRechargeOrder(RechargeOrderCreateReqVO createReqVO) {
|
||||||
|
@ -210,4 +213,13 @@ public class RechargeOrderServiceImpl implements RechargeOrderService {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean memberChangeTie(MemberChangeTieRequest changeTieRequest) {
|
||||||
|
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||||
|
Assert.notNull(loginUser, "登录失效,请重新登录!");
|
||||||
|
MemberUserRespDTO user = userService.getUser(loginUser.getId());
|
||||||
|
user.setPromoterId(changeTieRequest.getPromoterId());
|
||||||
|
return memberUserApi.updateById(user)>0;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,7 +80,7 @@ public interface MemberUserApi {
|
||||||
MemberUserRespDTO getInfo();
|
MemberUserRespDTO getInfo();
|
||||||
|
|
||||||
|
|
||||||
void saveMemberUser(String phone,Long promoterId);
|
void saveMemberUser(String phone,Long promoterId,String userName);
|
||||||
|
|
||||||
PromoterDTO getPromoterDOByUserId(Long userId);
|
PromoterDTO getPromoterDOByUserId(Long userId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,11 +107,11 @@ public class MemberUserApiImpl implements MemberUserApi {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void saveMemberUser(String phone,Long promoterId) {
|
public void saveMemberUser(String phone,Long promoterId,String userName) {
|
||||||
AppAuthSmsLoginReqVO reqVO = new AppAuthSmsLoginReqVO();
|
AppAuthSmsLoginReqVO reqVO = new AppAuthSmsLoginReqVO();
|
||||||
reqVO.setMobile(phone);
|
reqVO.setMobile(phone);
|
||||||
reqVO.setPromoterId(promoterId);
|
reqVO.setPromoterId(promoterId);
|
||||||
reqVO.setRealName("初始化账号");
|
reqVO.setRealName(userName);
|
||||||
authService.initialize(reqVO);
|
authService.initialize(reqVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue