zoujiajian 3 rokov pred
rodič
commit
607c39d63e

+ 15 - 1
netflix-dao/src/main/java/com/cyksj/model/entity/DistributeMoneyApply.java

@@ -26,10 +26,24 @@ public class DistributeMoneyApply extends BaseEntity {
 
 	private Status verifyStatus;
 
-	private String phone;
+	private Type type;
+
+	private String account;
 
 	private String realName;
 
+	@Getter
+	public enum Type {
+		zfb("支付宝"),
+		wechat("微信"),
+		;
+		String desc;
+
+		Type(String desc) {
+			this.desc = desc;
+		}
+	}
+
 	@Getter
 	public enum Status {
 		success("审核成功"),

+ 4 - 1
netflix-dao/src/main/java/com/cyksj/model/request/ApplyMoneyReq.java

@@ -1,5 +1,6 @@
 package com.cyksj.model.request;
 
+import com.cyksj.model.entity.DistributeMoneyApply;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -12,7 +13,9 @@ import lombok.Setter;
 @Getter
 @Setter
 public class ApplyMoneyReq {
-	private String phone;
+	private String account;
+
+	private DistributeMoneyApply.Type type;
 
 	private String realName;
 }

+ 5 - 2
netflix-dao/src/main/java/com/cyksj/model/views/DistributeMoneyApplyView.java

@@ -40,8 +40,11 @@ public class DistributeMoneyApplyView {
 	@DbField("dma.real_name")
 	private String realName;
 
-	@DbField("dma.phone")
-	private String phone;
+	@DbField("dma.type")
+	private DistributeMoneyApply.Type type;
+
+	@DbField("dma.account")
+	private String account;
 
 	@DbField("dma.verify_status")
 	private DistributeMoneyApply.Status verifyStatus;

+ 12 - 2
netflix-web/src/main/java/com/cyksj/web/controller/user/DistributePopularizeController.java

@@ -152,7 +152,7 @@ public class DistributePopularizeController {
 		if (user == null) {
 			throw BusinessRuntimeException.getInstance("请先授权登录");
 		}
-		if (ObjectUtil.hasEmpty(applyMoneyReq.getPhone(), applyMoneyReq.getRealName())) {
+		if (ObjectUtil.hasEmpty(applyMoneyReq.getAccount(), applyMoneyReq.getRealName())) {
 			throw BusinessRuntimeException.getInstance("必填项不能为空");
 		}
 		DistributePointsExchangeMoney distributePointsExchangeMoney = distributePointsExchangeMoneyMapper.selectOne(Wrappers.lambdaQuery(DistributePointsExchangeMoney.class).orderByDesc(DistributePointsExchangeMoney::getPoints).last("limit 1"));
@@ -175,7 +175,7 @@ public class DistributePopularizeController {
 			distributeMoneyApply.setPoints(points);
 			distributeMoneyApply.setMoney(num.multiply(distributePointsExchangeMoney.getMoney()));
 			distributeMoneyApply.setVerifyStatus(DistributeMoneyApply.Status.verifying);
-			distributeMoneyApply.setPhone(applyMoneyReq.getPhone());
+			distributeMoneyApply.setAccount(applyMoneyReq.getAccount());
 			distributeMoneyApply.setRealName(applyMoneyReq.getRealName());
 			distributeMoneyApplyMapper.insert(distributeMoneyApply);
 			return GatewayResponse.SUCCESS.newBuilder().toResult(distributeMoneyApply.getMoney().intValue());
@@ -190,4 +190,14 @@ public class DistributePopularizeController {
 	public Result<DistributePointsExchangeMoney> getThreshold() {
 		return GatewayResponse.SUCCESS.newBuilder().toResult(distributePointsExchangeMoneyMapper.selectOne(Wrappers.lambdaQuery(DistributePointsExchangeMoney.class).last("limit 1")));
 	}
+
+	/**
+	 * 提现缓存数据
+	 */
+	@GetMapping("/get/applyMoney/detail")
+	public Result<DistributeMoneyApply> getLastApplyDetail() {
+		Long userId = StpUserUtil.getLoginIdAsLong();
+		DistributeMoneyApply apply = distributeMoneyApplyMapper.selectOne(Wrappers.lambdaQuery(DistributeMoneyApply.class).eq(DistributeMoneyApply::getUserId, userId).orderByDesc(DistributeMoneyApply::getId).last("limit 1"));
+		return GatewayResponse.SUCCESS.newBuilder().toResult(apply);
+	}
 }