提交 9327e999 作者: xiaowang

用户钱包的扣除

上级 8b2197a6
package com.mmc.iuav.user.model.vo.wallet;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
import java.util.Date;
/**
* @author 23214
* 飞手方钱包记录
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class FlyerWalletFlowVO {
@ApiModelProperty(value = "用户ID")
private Integer userAccountId;
@ApiModelProperty(value = "支付方式 100(订单发布) 200(无人接单取消订单)300(有人接单取消订单)400(飞手抢单)500(客服判定飞手无责取消订单)600(飞手有责取消订单)700(正常结算)800(修改订单金额状态)900(飞手未确认修改金额状态)1000(飞手确认修改金额状态)")
private Integer modeOfPayment;
@ApiModelProperty(value = "云享金(需要正负)")
private BigDecimal cashAmount;
@ApiModelProperty(value = "佣金(需要正负)")
private BigDecimal salaryAmount;
@ApiModelProperty(value = "支付时间")
private Date timeOfPayment;
@ApiModelProperty(value = "操作者用户id")
private Integer operateUserAccountId;
@ApiModelProperty(value = "云享金违约金(需要正负)")
private BigDecimal yxjCashPledge;
@ApiModelProperty(value = "佣金违约金(需要正负)")
private BigDecimal salaryCashPledge;
@ApiModelProperty(value = "订单的百分比违约金(这笔钱是给发布方的)")
private BigDecimal percentagePenaltyOfOrder;
}
\ No newline at end of file
package com.mmc.iuav.user.model.vo.wallet;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
import java.util.Date;
/**
* @author 23214
* 发布方钱包记录
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PublisherWalletFlowVO {
@ApiModelProperty(value = "用户ID")
private Integer userAccountId;
@ApiModelProperty(value = "支付方式 100(订单发布) 200(无人接单取消订单)300(有人接单取消订单)400(飞手抢单)500(客服判定飞手无责取消订单)" +
"600(飞手有责取消订单)700(正常结算)800(修改订单金额状态)900(飞手未确认修改金额状态)1000(飞手确认修改金额状态)")
private Integer modeOfPayment;
@ApiModelProperty(value = "云享金(需要正负)注:结算时修改金额如果大于原订单,需要支付的云享金,也传这个字段")
private BigDecimal cashAmount;
@ApiModelProperty(value = "佣金(需要正负)注:结算时修改金额如果大于原订单,需要支付的佣金,也传这个字段")
private BigDecimal salaryAmount;
@ApiModelProperty(value = "支付时间")
private Date timeOfPayment;
@ApiModelProperty(value = "操作者用户id")
private Integer operateUserAccountId;
@ApiModelProperty(value = "云享金违约金(需要正负)")
private BigDecimal yxjCashPledge;
@ApiModelProperty(value = "佣金违约金(需要正负)")
private BigDecimal salaryCashPledge;
@ApiModelProperty(value = "订单的百分比违约金(这笔钱是给飞手的) (需要正负)")
private BigDecimal percentagePenaltyOfOrder;
@ApiModelProperty(value = "加急单云享金金额 (需要正负)")
private BigDecimal urgentYxjAmount;
@ApiModelProperty(value = "加急单佣金金额 (需要正负)")
private BigDecimal urgentSalaryAmount;
@ApiModelProperty(value = "置顶单云享金金额 (需要正负)")
private BigDecimal topYxjAmount;
@ApiModelProperty(value = "置顶单佣金金额 (需要正负)")
private BigDecimal topSalaryAmount;
@ApiModelProperty(value = "飞手应得订单金额 (正数)")
private BigDecimal flyerSalaryAmount;
@ApiModelProperty(value = "修改后金额(注:①飞手未确认时,后面支付的需要退的佣金那部分钱 ②飞手确认时,修改后的金额小于原佣金,需要退多余的佣金那部分钱 ③如果全部是微信支付的则不用传值)")
private BigDecimal refundSalaryAmount;
@ApiModelProperty(value = "修改后金额(注:①飞手未确认时,后面支付的需要退的云享金那部分钱 ②飞手确认时,修改后的金额小于原佣金,需要退多余的云享金那部分钱 ③如果全部是微信支付的则不用传值)")
private BigDecimal refundCashAmount;
}
\ No newline at end of file
package com.mmc.iuav.user.model.vo.wallet;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @Author LW
* @date 2023/8/19 16:24
* 概要:
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class TopUpCashVO {
private Integer userAccountId;
private String orderNo;
private Integer amount;
private String tradeState;
}
package com.mmc.iuav.user.model.vo.wallet;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Author LW
* @date 2023/8/21 17:59
* 概要:
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class WalletFlowVO implements Serializable {
private static final long serialVersionUID = -8848411142632397203L;
private PublisherWalletFlowVO publisherWalletFlowVO;
private FlyerWalletFlowVO flyerWalletFlowVO;
}
...@@ -3,12 +3,10 @@ package com.mmc.iuav.user.controller.wallet; ...@@ -3,12 +3,10 @@ package com.mmc.iuav.user.controller.wallet;
import com.mmc.iuav.response.ResultBody; import com.mmc.iuav.response.ResultBody;
import com.mmc.iuav.user.controller.BaseController; import com.mmc.iuav.user.controller.BaseController;
import com.mmc.iuav.user.model.dto.wallet.PayWalletDTO; import com.mmc.iuav.user.model.dto.wallet.PayWalletDTO;
import com.mmc.iuav.user.model.vo.wallet.WalletFlowVO;
import com.mmc.iuav.user.service.wallet.PayWalletService; import com.mmc.iuav.user.service.wallet.PayWalletService;
import io.swagger.annotations.*; import io.swagger.annotations.*;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore; import springfox.documentation.annotations.ApiIgnore;
import javax.annotation.Resource; import javax.annotation.Resource;
...@@ -50,4 +48,20 @@ public class PayWalletController extends BaseController { ...@@ -50,4 +48,20 @@ public class PayWalletController extends BaseController {
return payWalletService.initPayWallet(userAccountId); return payWalletService.initPayWallet(userAccountId);
} }
@ApiOperation(value = "feign-云享金充值接口")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@ApiIgnore
@GetMapping("feignTopUpCash")
public ResultBody feignTopUpCash(@RequestParam Integer userAccountId) {
// return payWalletService.feignTopUpCash(userAccountId);
return null;
}
@ApiOperation(value = "feign-钱包流水记录")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@PostMapping("feignWalletFlow")
public ResultBody feignWalletFlow(@RequestBody WalletFlowVO walletFlowVO) {
return payWalletService.feignWalletFlow(walletFlowVO);
}
} }
package com.mmc.iuav.user.dao.wallet; package com.mmc.iuav.user.dao.wallet;
import com.mmc.iuav.user.entity.wallet.PayLogDO;
import com.mmc.iuav.user.entity.wallet.PayWalletDO; import com.mmc.iuav.user.entity.wallet.PayWalletDO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
...@@ -13,4 +14,8 @@ public interface PayWalletDao { ...@@ -13,4 +14,8 @@ public interface PayWalletDao {
PayWalletDO getPayWalletByUser(Integer userAccountId); PayWalletDO getPayWalletByUser(Integer userAccountId);
void insertPayWalletInfo(PayWalletDO wallet); void insertPayWalletInfo(PayWalletDO wallet);
void insertPayLogDO(PayLogDO payWalletDO);
int updatePayWallet(PayWalletDO updatePayWallet);
} }
package com.mmc.iuav.user.entity.wallet; package com.mmc.iuav.user.entity.wallet;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
/** /**
...@@ -9,6 +14,9 @@ import java.util.Date; ...@@ -9,6 +14,9 @@ import java.util.Date;
* @author makejava * @author makejava
* @since 2023-08-18 16:18:01 * @since 2023-08-18 16:18:01
*/ */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PayLogDO implements Serializable { public class PayLogDO implements Serializable {
private static final long serialVersionUID = 752682324297846133L; private static final long serialVersionUID = 752682324297846133L;
...@@ -26,17 +34,17 @@ public class PayLogDO implements Serializable { ...@@ -26,17 +34,17 @@ public class PayLogDO implements Serializable {
*/ */
private String payNo; private String payNo;
/** /**
* 0手动变更(大于0充值or小于0扣除) 100订单扣除 150订单冻结 200订单完成 250提现扣除 * 0手动变更(大于0充值or小于0扣除) 50订单取消 100订单扣除 150订单冻结 200订单完成 250充值 300 提现扣除
*/ */
private Integer payMethod; private Integer payMethod;
/** /**
* 云享金变动金额(正数充值,负数扣除) * 云享金变动金额(正数充值,负数扣除)
*/ */
private Double cashAmtPaid; private BigDecimal cashAmtPaid;
/** /**
* 佣金变动金额(正数入账,负数扣除) * 佣金变动金额(正数入账,负数扣除)
*/ */
private Double salaryAmtPaid; private BigDecimal salaryAmtPaid;
/** /**
* 支付时间 * 支付时间
*/ */
...@@ -53,103 +61,5 @@ public class PayLogDO implements Serializable { ...@@ -53,103 +61,5 @@ public class PayLogDO implements Serializable {
private Date createTime; private Date createTime;
private Date updateTime; private Date updateTime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getUserAccountId() {
return userAccountId;
}
public void setUserAccountId(Integer userAccountId) {
this.userAccountId = userAccountId;
}
public Integer getOrderNo() {
return orderNo;
}
public void setOrderNo(Integer orderNo) {
this.orderNo = orderNo;
}
public String getPayNo() {
return payNo;
}
public void setPayNo(String payNo) {
this.payNo = payNo;
}
public Integer getPayMethod() {
return payMethod;
}
public void setPayMethod(Integer payMethod) {
this.payMethod = payMethod;
}
public Double getCashAmtPaid() {
return cashAmtPaid;
}
public void setCashAmtPaid(Double cashAmtPaid) {
this.cashAmtPaid = cashAmtPaid;
}
public Double getSalaryAmtPaid() {
return salaryAmtPaid;
}
public void setSalaryAmtPaid(Double salaryAmtPaid) {
this.salaryAmtPaid = salaryAmtPaid;
}
public Date getPayTime() {
return payTime;
}
public void setPayTime(Date payTime) {
this.payTime = payTime;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public Integer getOperateUser() {
return operateUser;
}
public void setOperateUser(Integer operateUser) {
this.operateUser = operateUser;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
} }
...@@ -53,6 +53,8 @@ public class PayWalletDO implements Serializable { ...@@ -53,6 +53,8 @@ public class PayWalletDO implements Serializable {
*/ */
private BigDecimal salaryFreeze; private BigDecimal salaryFreeze;
private BigDecimal wxCashFreeze;
/** /**
* 提现总额 * 提现总额
*/ */
...@@ -78,6 +80,7 @@ public class PayWalletDO implements Serializable { ...@@ -78,6 +80,7 @@ public class PayWalletDO implements Serializable {
this.salaryPaid = BigDecimal.ZERO; this.salaryPaid = BigDecimal.ZERO;
this.salaryFreeze = BigDecimal.ZERO; this.salaryFreeze = BigDecimal.ZERO;
this.salaryWdl = BigDecimal.ZERO; this.salaryWdl = BigDecimal.ZERO;
this.wxCashFreeze = BigDecimal.ZERO;
} }
} }
package com.mmc.iuav.user.enums;
/**
* @Author LW
* @date 2023/8/19 18:53
* 概要:
*/
public enum PayMethodEnums {
PUBLISH_ORDER(100, "订单发布"),
CANCEL_ORDER_TAKING(200, "未接单时取消订单"),
RECEIVED_ORDER_CANCEL(300, "已接单取消订单"),
FLYING_ORDER_TAKING(400, "飞手抢单"),
CUSTOMER_SERVICE_CANCEL_ORDER(500, "客服判定飞手无责取消订单"),
FLYER_CANCEL_ORDER(600, "飞手有责取消订单"),
NORMAL_SETTLEMENT(700, "正常结算"),
MODIFY_THE_ORDER(800, "修改订单金额状态(大于)"),
FLYING_HAND_NOT_CONFIRMED_GT(900, "飞手未确认修改金额大于原订单状态"),
FLYING_HAND_CONFIRM_GT(1000, "飞手确认修改金额大于原订单状态"),
FLYING_HAND_CONFIRM_LT(1000, "飞手确认修改金额小于原订单状态");
PayMethodEnums(Integer code, String method) {
this.code = code;
this.method = method;
}
private Integer code;
private String method;
public Integer getCode() {
return this.code;
}
public String getMethod() {
return this.method;
}
}
package com.mmc.iuav.user.service.wallet; package com.mmc.iuav.user.service.wallet;
import com.mmc.iuav.response.ResultBody; import com.mmc.iuav.response.ResultBody;
import com.mmc.iuav.user.model.vo.wallet.WalletFlowVO;
/** /**
* @Author LW * @Author LW
...@@ -11,4 +12,6 @@ public interface PayWalletService { ...@@ -11,4 +12,6 @@ public interface PayWalletService {
ResultBody getPayWalletInfo(Integer userAccountId); ResultBody getPayWalletInfo(Integer userAccountId);
ResultBody initPayWallet(Integer userAccountId); ResultBody initPayWallet(Integer userAccountId);
ResultBody feignWalletFlow(WalletFlowVO walletFlowVO);
} }
...@@ -10,6 +10,42 @@ ...@@ -10,6 +10,42 @@
values (#{userAccountId}, #{cashAmt}, #{cashPaid}, #{cashFreeze}, #{salaryAmt}, #{salaryPaid}, #{salaryFreeze}, values (#{userAccountId}, #{cashAmt}, #{cashPaid}, #{cashFreeze}, #{salaryAmt}, #{salaryPaid}, #{salaryFreeze},
#{salaryWdl}) #{salaryWdl})
</insert> </insert>
<insert id="insertPayLogDO">
insert into pay_log (user_account_id,
pay_no,
pay_method,
cash_amt_paid,
salary_amt_paid,
pay_time,
remark,
operate_user)
values (#{userAccountId}, #{payNo}, #{payMethod}, #{cashAmtPaid}, #{salaryAmtPaid}, #{payTime}, #{remark},
#{operateUser})
</insert>
<update id="updatePayWallet">
update pay_wallet
<set>
<if test="pid != null">
pid = #{pid} + 1,
</if>
<if test="cashAmt != null">
cash_amt = #{cashAmt},
</if>
<if test="cashFreeze != null">
cash_freeze = #{cashFreeze},
</if>
<if test="salaryAmt != null">
salary_amt = #{salaryAmt},
</if>
<if test="salaryFreeze != null">
salary_freeze = #{salaryFreeze},
</if>
<if test="salaryWdl != null">
salary_wdl =#{salaryWdl}
</if>
</set>
where user_account_id = #{userAccountId} and pid = #{pid}
</update>
<select id="getPayWalletByUser" resultType="com.mmc.iuav.user.entity.wallet.PayWalletDO"> <select id="getPayWalletByUser" resultType="com.mmc.iuav.user.entity.wallet.PayWalletDO">
select id, select id,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论