提交 506ebf6f 作者: xiaowang

用户新增时初始化钱包

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