提交 506ebf6f 作者: xiaowang

用户新增时初始化钱包

上级 98989c95
......@@ -28,16 +28,12 @@ public class PayWalletDTO implements Serializable {
private String userName;
@ApiModelProperty(value = "云享金余额")
private BigDecimal cashAmt;
@ApiModelProperty(value = "已消耗云享金")
private BigDecimal cashPaid;
@ApiModelProperty(value = "云享金总金额")
private BigDecimal totalCash;
@ApiModelProperty(value = "已冻结云享金")
private BigDecimal cashFreeze;
@ApiModelProperty(value = "佣金余额")
private BigDecimal salaryAmt;
@ApiModelProperty(value = "已消耗佣金")
private BigDecimal salaryPaid;
@ApiModelProperty(value = "已冻结佣金")
private BigDecimal salaryFreeze;
@ApiModelProperty(value = "佣金总额度")
......
......@@ -29,39 +29,48 @@ public class PayWalletController extends BaseController {
@ApiOperation(value = "获取当前用户消费(钱包)信息")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = PayWalletDTO.class)})
@GetMapping("getCurrentUserPayWalletInfo")
public ResultBody getCurrentUserPayWalletInfo(HttpServletRequest request) {
public ResultBody<PayWalletDTO> getCurrentUserPayWalletInfo(HttpServletRequest request) {
return payWalletService.getPayWalletInfo(this.getUserLoginInfoFromRedis(request).getUserAccountId());
}
@ApiOperation(value = "获取用户消费(钱包)信息")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = PayWalletDTO.class)})
@GetMapping("getPayWalletInfo")
public ResultBody getPayWalletInfo(
public ResultBody<PayWalletDTO> getPayWalletInfo(
@ApiParam(value = "用户userAccountId", required = true) @RequestParam Integer userAccountId) {
return ResultBody.success(payWalletService.getPayWalletInfo(userAccountId));
}
@ApiOperation(value = "feign-初始化钱包")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@ApiIgnore
@GetMapping("feignInitPayWallet")
public ResultBody feignInitPayWallet(@RequestParam Integer userAccountId) {
return payWalletService.initPayWallet(userAccountId);
}
// @ApiOperation(value = "feign-初始化钱包")
// @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
// @ApiIgnore
// @GetMapping("feignInitPayWallet")
// public ResultBody feignInitPayWallet(@RequestParam Integer userAccountId) {
// return payWalletService.initPayWallet(userAccountId);
// }
@ApiIgnore
@ApiOperation(value = "feign-云享金充值增加金额")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@ApiIgnore
@PostMapping("feignTopUpCash")
public ResultBody feignTopUpCash(@RequestBody TopUpOrderVO topUpOrderVO) {
return payWalletService.feignTopUpCash(topUpOrderVO);
}
@ApiIgnore
@ApiOperation(value = "feign-钱包流水记录")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@PostMapping("feignWalletFlow")
public ResultBody feignWalletFlow(@RequestBody WalletFlowVO walletFlowVO) {
return payWalletService.feignWalletFlow(walletFlowVO);
}
@ApiOperation(value = "用户账单明细")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@GetMapping("customerBillingDetail")
public ResultBody customerBillingDetail(Integer userAccountId) {
return payWalletService.customerBillingDetail(userAccountId);
}
}
......@@ -67,8 +67,7 @@ public class PayWalletDO implements Serializable {
public PayWalletDTO buildPayWalletDTO() {
return PayWalletDTO.builder().id(this.id).userAccountId(this.userAccountId)
.cashAmt(this.cashAmt).cashFreeze(this.cashFreeze)
.cashPaid(this.cashPaid).salaryAmt(this.salaryAmt)
.salaryFreeze(this.salaryFreeze).salaryPaid(this.salaryPaid)
.salaryAmt(this.salaryAmt).salaryFreeze(this.salaryFreeze)
.rebateWdl(this.salaryWdl).build();
}
......
......@@ -18,6 +18,7 @@ import com.mmc.iuav.user.model.dto.LoginSuccessDTO;
import com.mmc.iuav.user.model.qo.LoginUserQO;
import com.mmc.iuav.user.model.vo.*;
import com.mmc.iuav.user.service.*;
import com.mmc.iuav.user.service.wallet.PayWalletService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -25,6 +26,7 @@ import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.security.NoSuchAlgorithmException;
import java.util.concurrent.TimeUnit;
......@@ -66,8 +68,12 @@ public class AuthServiceImpl implements AuthService {
@Autowired
private AuthHandler authHandler;
@Resource
private PayWalletService payWalletService;
@Transactional
@Override
public ResultBody appletLogin(WxLoginVO wxLoginVO) {
String unionId;
String openId;
......@@ -101,6 +107,8 @@ public class AuthServiceImpl implements AuthService {
userAccountDO.setSource(wxLoginVO.getSource());
userAccountService.insertUserAccount(userAccountDO);
userAccountVO = userAccountDO.buildUserAccountVO();
// 创建用户钱包
payWalletService.initPayWallet(userAccountDO.getId());
payClient.createWallet(userAccountDO.getId());
// 查询之前有没有实名过
RealNameAuthDO nameAuthByUnionId = realNameAuthDao.getRealNameAuthBakByUnionId(unionId);
......
......@@ -17,4 +17,7 @@ public interface PayWalletService {
ResultBody feignWalletFlow(WalletFlowVO walletFlowVO);
ResultBody feignTopUpCash(TopUpOrderVO topUpOrderVO);
ResultBody customerBillingDetail(Integer userAccountId);
}
......@@ -451,4 +451,10 @@ public class PayWalletServiceImpl implements PayWalletService {
return ResultBody.error("充值时钱包操作错误!");
}
}
@Override
public ResultBody customerBillingDetail(Integer userAccountId) {
return null;
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论