Commit 96940a93 authored by shiyu's avatar shiyu

保证金

parent aee26c6d
......@@ -4,6 +4,8 @@ import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import com.xxdxxs.entity.Entity;
import lombok.Data;
/**
......@@ -11,7 +13,7 @@ import lombok.Data;
* @date 2024/11/06
*/
@Data
public class UserAccount implements Serializable {
public class UserAccount implements Entity {
private Long id;
/**
......@@ -49,6 +51,11 @@ public class UserAccount implements Serializable {
*/
private Long earnestAmount;
/**
* 保证金可用额度
*/
private Long earnestUsableAmount;
/**
* 创建时间
*/
......@@ -75,6 +82,7 @@ public class UserAccount implements Serializable {
sb.append(", introduceAmount=").append(introduceAmount);
sb.append(", introduceWaitEntryAmount=").append(introduceWaitEntryAmount);
sb.append(", earnestAmount=").append(earnestAmount);
sb.append(", earnestUsableAmount=").append(earnestUsableAmount);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", serialVersionUID=").append(serialVersionUID);
......@@ -102,6 +110,7 @@ public class UserAccount implements Serializable {
&& (this.getIntroduceAmount() == null ? other.getIntroduceAmount() == null : this.getIntroduceAmount().equals(other.getIntroduceAmount()))
&& (this.getIntroduceWaitEntryAmount() == null ? other.getIntroduceWaitEntryAmount() == null : this.getIntroduceWaitEntryAmount().equals(other.getIntroduceWaitEntryAmount()))
&& (this.getEarnestAmount() == null ? other.getEarnestAmount() == null : this.getEarnestAmount().equals(other.getEarnestAmount()))
&& (this.getEarnestUsableAmount() == null ? other.getEarnestUsableAmount() == null : this.getEarnestUsableAmount().equals(other.getEarnestUsableAmount()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
}
......@@ -118,6 +127,7 @@ public class UserAccount implements Serializable {
result = prime * result + ((getIntroduceAmount() == null) ? 0 : getIntroduceAmount().hashCode());
result = prime * result + ((getIntroduceWaitEntryAmount() == null) ? 0 : getIntroduceWaitEntryAmount().hashCode());
result = prime * result + ((getEarnestAmount() == null) ? 0 : getEarnestAmount().hashCode());
result = prime * result + ((getEarnestUsableAmount() == null) ? 0 : getEarnestUsableAmount().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
return result;
......@@ -139,6 +149,7 @@ public class UserAccount implements Serializable {
introduceAmount("introduce_amount", "introduceAmount", "BIGINT", false),
introduceWaitEntryAmount("introduce_wait_entry_amount", "introduceWaitEntryAmount", "BIGINT", false),
earnestAmount("earnest_amount", "earnestAmount", "BIGINT", false),
earnestUsableAmount("earnest_usable_amount", "earnestUsableAmount", "BIGINT", false),
createTime("create_time", "createTime", "TIMESTAMP", false),
updateTime("update_time", "updateTime", "TIMESTAMP", false);
......
......@@ -1204,6 +1204,138 @@ public class UserAccountExample {
return (Criteria) this;
}
public Criteria andEarnestUsableAmountIsNull() {
addCriterion("earnest_usable_amount is null");
return (Criteria) this;
}
public Criteria andEarnestUsableAmountIsNotNull() {
addCriterion("earnest_usable_amount is not null");
return (Criteria) this;
}
public Criteria andEarnestUsableAmountEqualTo(Long value) {
addCriterion("earnest_usable_amount =", value, "earnestUsableAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_account
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andEarnestUsableAmountEqualToColumn(UserAccount.Column column) {
addCriterion(new StringBuilder("earnest_usable_amount = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andEarnestUsableAmountNotEqualTo(Long value) {
addCriterion("earnest_usable_amount <>", value, "earnestUsableAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_account
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andEarnestUsableAmountNotEqualToColumn(UserAccount.Column column) {
addCriterion(new StringBuilder("earnest_usable_amount <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andEarnestUsableAmountGreaterThan(Long value) {
addCriterion("earnest_usable_amount >", value, "earnestUsableAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_account
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andEarnestUsableAmountGreaterThanColumn(UserAccount.Column column) {
addCriterion(new StringBuilder("earnest_usable_amount > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andEarnestUsableAmountGreaterThanOrEqualTo(Long value) {
addCriterion("earnest_usable_amount >=", value, "earnestUsableAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_account
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andEarnestUsableAmountGreaterThanOrEqualToColumn(UserAccount.Column column) {
addCriterion(new StringBuilder("earnest_usable_amount >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andEarnestUsableAmountLessThan(Long value) {
addCriterion("earnest_usable_amount <", value, "earnestUsableAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_account
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andEarnestUsableAmountLessThanColumn(UserAccount.Column column) {
addCriterion(new StringBuilder("earnest_usable_amount < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andEarnestUsableAmountLessThanOrEqualTo(Long value) {
addCriterion("earnest_usable_amount <=", value, "earnestUsableAmount");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_account
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andEarnestUsableAmountLessThanOrEqualToColumn(UserAccount.Column column) {
addCriterion(new StringBuilder("earnest_usable_amount <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andEarnestUsableAmountIn(List<Long> values) {
addCriterion("earnest_usable_amount in", values, "earnestUsableAmount");
return (Criteria) this;
}
public Criteria andEarnestUsableAmountNotIn(List<Long> values) {
addCriterion("earnest_usable_amount not in", values, "earnestUsableAmount");
return (Criteria) this;
}
public Criteria andEarnestUsableAmountBetween(Long value1, Long value2) {
addCriterion("earnest_usable_amount between", value1, value2, "earnestUsableAmount");
return (Criteria) this;
}
public Criteria andEarnestUsableAmountNotBetween(Long value1, Long value2) {
addCriterion("earnest_usable_amount not between", value1, value2, "earnestUsableAmount");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null");
return (Criteria) this;
......
package com.wwdz.ch.db.impl.openShop;
import com.wwdz.ch.db.dao.openShop.UserAccountDao;
import com.wwdz.ch.db.domain.openShop.UserAccount;
import com.wwdz.ch.db.mapper.UserMapper;
import com.wwdz.ch.db.mapper.openShop.UserAccountMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
@Repository
public class UserAccountDaoImpl implements UserAccountDao {
@Autowired
UserAccountMapper userAccountMapper;
@Override
public boolean insert(UserAccount userAccount) {
return false;
}
@Override
public boolean update(UserAccount userAccount) {
return false;
}
@Override
public UserAccount findByUserId(long userId) {
return null;
}
}
......@@ -3,8 +3,10 @@ package com.wwdz.ch.db.mapper.openShop;
import com.wwdz.ch.db.domain.openShop.UserAccount;
import com.wwdz.ch.db.domain.openShop.UserAccountExample;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface UserAccountMapper {
long countByExample(UserAccountExample example);
......
......@@ -8,9 +8,11 @@ import com.wwdz.ch.core.util.IdUtils;
import com.wwdz.ch.core.util.PriceUtil;
import com.wwdz.ch.db.dao.openShop.EarnestOrderDao;
import com.wwdz.ch.db.dao.openShop.EarnestRecordDao;
import com.wwdz.ch.db.dao.openShop.UserAccountDao;
import com.wwdz.ch.db.domain.openShop.EarnestOrder;
import com.wwdz.ch.db.dto.request.distribution.DistributionOrderRequestDto;
import com.wwdz.ch.db.dto.request.openShop.EarnestOrderRequestDto;
import com.wwdz.ch.db.dto.request.openShop.EarnestRecordRequestDto;
import com.wwdz.ch.wx.service.openShop.AuctionEarnestService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -32,6 +34,9 @@ public class AuctionEarnestServiceImpl implements AuctionEarnestService {
@Autowired
WxPayServiceApi wxPayServiceApi;
@Autowired
UserAccountDao userAccountDao;
@Override
public Result payEarnest(EarnestOrderRequestDto dto) {
try {
......@@ -74,4 +79,20 @@ public class AuctionEarnestServiceImpl implements AuctionEarnestService {
}
return Result.failed();
}
@Override
public Result occupyEarnest(EarnestRecordRequestDto dto) {
try {
return Result.success();
} catch (Exception e) {
logger.error("占用保证金失败 error : {}", e);
}
return Result.failed();
}
@Override
public Result releaseEarnest(EarnestRecordRequestDto dto) {
return null;
}
}
......@@ -2,6 +2,7 @@ package com.wwdz.ch.wx.service.openShop;
import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.db.dto.request.openShop.EarnestOrderRequestDto;
import com.wwdz.ch.db.dto.request.openShop.EarnestRecordRequestDto;
public interface AuctionEarnestService {
......@@ -13,7 +14,6 @@ public interface AuctionEarnestService {
Result payEarnest(EarnestOrderRequestDto dto);
/**
* 获取支付参数
* 预支付并返回支付所需要的前端参数
......@@ -21,6 +21,16 @@ public interface AuctionEarnestService {
*/
Result getPayParam(EarnestOrderRequestDto dto);
/**
* 占用保证金
* @return
*/
Result occupyEarnest(EarnestRecordRequestDto dto);
/**
* 释放保证金
* @param dto
* @return
*/
Result releaseEarnest(EarnestRecordRequestDto dto);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment