Commit e5863dea authored by shiyu's avatar shiyu

新增开户行信息,新增介绍记录

parent 1930e872
......@@ -99,6 +99,12 @@ public class UserBillVo implements Entity {
@ExcelProperty(value = "真实姓名", index = 5)
private String realName;
/**
* 银行卡号真实姓名
*/
@ExcelProperty(value = "开户行", index = 6)
private String bankName;
/**
* 结款凭证
*/
......
......@@ -170,6 +170,7 @@ public class SysFinanceServiceImpl implements SysFinanceService {
if (userBankCard != null) {
userBillVo.setBankCardId(userBankCard.getCardId());
userBillVo.setRealName(userBankCard.getName());
userBillVo.setBankName(userBankCard.getBankName());
}
if (userBill.getState() == BillEnum.BillStateEnum.PAID.getCode()) {
//查询结款凭证
......@@ -401,6 +402,7 @@ public class SysFinanceServiceImpl implements SysFinanceService {
settlementRecord.setUserId(userBill.getUserId());
settlementRecord.setBankCardId(userBankCard.getCardId());
settlementRecord.setRealUserName(userBankCard.getName());
settlementRecord.setBankName(userBankCard.getBankName());
settlementRecord.setSettleAmount(userBill.getTotalEntryAmount());
settlementRecord.setSettleTime(now);
settlementRecord.setCreateTime(now);
......
......@@ -131,4 +131,9 @@ public interface CommConsts {
* 微信手续费,按照最高的1%计算
*/
public final static double WX_COMMISSION_REBATE = 0.01;
/**
* 默认介绍佣金比例
*/
public final static double REBATE = 0.03;
}
package com.wwdz.ch.db.dao.distribution;
import com.wwdz.ch.db.domain.distribution.IntroduceRecord;
public interface IntroduceRecordDao {
boolean insert(IntroduceRecord introduceRecord);
IntroduceRecord findByUserId(long userId);
IntroduceRecord findByDoubleId(long userId, long introducerId);
boolean isExisted(long userId);
}
package com.wwdz.ch.db.domain.distribution;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import com.xxdxxs.entity.Entity;
import lombok.Data;
/**
* @author shiyu
* @date 2024/08/06
*/
@Data
public class IntroduceRecord implements Entity {
private Long id;
/**
* 被介绍的用户id
*/
private Long userId;
/**
* 介绍人id
*/
private Long introducerId;
/**
* 分享记录id
*/
private String shareRecordId;
/**
* 创建时间
*/
private Date createTime;
private static final long serialVersionUID = 1L;
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", userId=").append(userId);
sb.append(", introducerId=").append(introducerId);
sb.append(", shareRecordId=").append(shareRecordId);
sb.append(", createTime=").append(createTime);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
IntroduceRecord other = (IntroduceRecord) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
&& (this.getIntroducerId() == null ? other.getIntroducerId() == null : this.getIntroducerId().equals(other.getIntroducerId()))
&& (this.getShareRecordId() == null ? other.getShareRecordId() == null : this.getShareRecordId().equals(other.getShareRecordId()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
result = prime * result + ((getIntroducerId() == null) ? 0 : getIntroducerId().hashCode());
result = prime * result + ((getShareRecordId() == null) ? 0 : getShareRecordId().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
return result;
}
/**
* This enum was generated by MyBatis Generator.
* This enum corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public enum Column {
id("id", "id", "BIGINT", false),
userId("user_id", "userId", "BIGINT", false),
introducerId("introducer_id", "introducerId", "BIGINT", false),
shareRecordId("share_record_id", "shareRecordId", "VARCHAR", false),
createTime("create_time", "createTime", "TIMESTAMP", false);
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private static final String BEGINNING_DELIMITER = "`";
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private static final String ENDING_DELIMITER = "`";
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final String column;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final boolean isColumnNameDelimited;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final String javaProperty;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final String jdbcType;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String value() {
return this.column;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getValue() {
return this.column;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getJavaProperty() {
return this.javaProperty;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getJdbcType() {
return this.jdbcType;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
this.column = column;
this.javaProperty = javaProperty;
this.jdbcType = jdbcType;
this.isColumnNameDelimited = isColumnNameDelimited;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String desc() {
return this.getEscapedColumnName() + " DESC";
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String asc() {
return this.getEscapedColumnName() + " ASC";
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public static Column[] excludes(Column ... excludes) {
ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
}
}
\ No newline at end of file
package com.wwdz.ch.db.domain.distribution;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class IntroduceRecordExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public IntroduceRecordExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public IntroduceRecordExample orderBy(String orderByClause) {
this.setOrderByClause(orderByClause);
return this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public IntroduceRecordExample orderBy(String ... orderByClauses) {
StringBuffer sb = new StringBuffer();
for (int i = 0; i < orderByClauses.length; i++) {
sb.append(orderByClauses[i]);
if (i < orderByClauses.length - 1) {
sb.append(" , ");
}
}
this.setOrderByClause(sb.toString());
return this;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria(this);
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public static Criteria newAndCreateCriteria() {
IntroduceRecordExample example = new IntroduceRecordExample();
return example.createCriteria();
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdEqualToColumn(IntroduceRecord.Column column) {
addCriterion(new StringBuilder("id = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdNotEqualToColumn(IntroduceRecord.Column column) {
addCriterion(new StringBuilder("id <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdGreaterThanColumn(IntroduceRecord.Column column) {
addCriterion(new StringBuilder("id > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdGreaterThanOrEqualToColumn(IntroduceRecord.Column column) {
addCriterion(new StringBuilder("id >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdLessThanColumn(IntroduceRecord.Column column) {
addCriterion(new StringBuilder("id < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIdLessThanOrEqualToColumn(IntroduceRecord.Column column) {
addCriterion(new StringBuilder("id <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andUserIdIsNull() {
addCriterion("user_id is null");
return (Criteria) this;
}
public Criteria andUserIdIsNotNull() {
addCriterion("user_id is not null");
return (Criteria) this;
}
public Criteria andUserIdEqualTo(Long value) {
addCriterion("user_id =", value, "userId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserIdEqualToColumn(IntroduceRecord.Column column) {
addCriterion(new StringBuilder("user_id = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserIdNotEqualTo(Long value) {
addCriterion("user_id <>", value, "userId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserIdNotEqualToColumn(IntroduceRecord.Column column) {
addCriterion(new StringBuilder("user_id <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserIdGreaterThan(Long value) {
addCriterion("user_id >", value, "userId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserIdGreaterThanColumn(IntroduceRecord.Column column) {
addCriterion(new StringBuilder("user_id > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserIdGreaterThanOrEqualTo(Long value) {
addCriterion("user_id >=", value, "userId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserIdGreaterThanOrEqualToColumn(IntroduceRecord.Column column) {
addCriterion(new StringBuilder("user_id >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserIdLessThan(Long value) {
addCriterion("user_id <", value, "userId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserIdLessThanColumn(IntroduceRecord.Column column) {
addCriterion(new StringBuilder("user_id < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserIdLessThanOrEqualTo(Long value) {
addCriterion("user_id <=", value, "userId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUserIdLessThanOrEqualToColumn(IntroduceRecord.Column column) {
addCriterion(new StringBuilder("user_id <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUserIdIn(List<Long> values) {
addCriterion("user_id in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotIn(List<Long> values) {
addCriterion("user_id not in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdBetween(Long value1, Long value2) {
addCriterion("user_id between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotBetween(Long value1, Long value2) {
addCriterion("user_id not between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andIntroducerIdIsNull() {
addCriterion("introducer_id is null");
return (Criteria) this;
}
public Criteria andIntroducerIdIsNotNull() {
addCriterion("introducer_id is not null");
return (Criteria) this;
}
public Criteria andIntroducerIdEqualTo(Long value) {
addCriterion("introducer_id =", value, "introducerId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIntroducerIdEqualToColumn(IntroduceRecord.Column column) {
addCriterion(new StringBuilder("introducer_id = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIntroducerIdNotEqualTo(Long value) {
addCriterion("introducer_id <>", value, "introducerId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIntroducerIdNotEqualToColumn(IntroduceRecord.Column column) {
addCriterion(new StringBuilder("introducer_id <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIntroducerIdGreaterThan(Long value) {
addCriterion("introducer_id >", value, "introducerId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIntroducerIdGreaterThanColumn(IntroduceRecord.Column column) {
addCriterion(new StringBuilder("introducer_id > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIntroducerIdGreaterThanOrEqualTo(Long value) {
addCriterion("introducer_id >=", value, "introducerId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIntroducerIdGreaterThanOrEqualToColumn(IntroduceRecord.Column column) {
addCriterion(new StringBuilder("introducer_id >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIntroducerIdLessThan(Long value) {
addCriterion("introducer_id <", value, "introducerId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIntroducerIdLessThanColumn(IntroduceRecord.Column column) {
addCriterion(new StringBuilder("introducer_id < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIntroducerIdLessThanOrEqualTo(Long value) {
addCriterion("introducer_id <=", value, "introducerId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIntroducerIdLessThanOrEqualToColumn(IntroduceRecord.Column column) {
addCriterion(new StringBuilder("introducer_id <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIntroducerIdIn(List<Long> values) {
addCriterion("introducer_id in", values, "introducerId");
return (Criteria) this;
}
public Criteria andIntroducerIdNotIn(List<Long> values) {
addCriterion("introducer_id not in", values, "introducerId");
return (Criteria) this;
}
public Criteria andIntroducerIdBetween(Long value1, Long value2) {
addCriterion("introducer_id between", value1, value2, "introducerId");
return (Criteria) this;
}
public Criteria andIntroducerIdNotBetween(Long value1, Long value2) {
addCriterion("introducer_id not between", value1, value2, "introducerId");
return (Criteria) this;
}
public Criteria andShareRecordIdIsNull() {
addCriterion("share_record_id is null");
return (Criteria) this;
}
public Criteria andShareRecordIdIsNotNull() {
addCriterion("share_record_id is not null");
return (Criteria) this;
}
public Criteria andShareRecordIdEqualTo(String value) {
addCriterion("share_record_id =", value, "shareRecordId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andShareRecordIdEqualToColumn(IntroduceRecord.Column column) {
addCriterion(new StringBuilder("share_record_id = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andShareRecordIdNotEqualTo(String value) {
addCriterion("share_record_id <>", value, "shareRecordId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andShareRecordIdNotEqualToColumn(IntroduceRecord.Column column) {
addCriterion(new StringBuilder("share_record_id <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andShareRecordIdGreaterThan(String value) {
addCriterion("share_record_id >", value, "shareRecordId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andShareRecordIdGreaterThanColumn(IntroduceRecord.Column column) {
addCriterion(new StringBuilder("share_record_id > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andShareRecordIdGreaterThanOrEqualTo(String value) {
addCriterion("share_record_id >=", value, "shareRecordId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andShareRecordIdGreaterThanOrEqualToColumn(IntroduceRecord.Column column) {
addCriterion(new StringBuilder("share_record_id >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andShareRecordIdLessThan(String value) {
addCriterion("share_record_id <", value, "shareRecordId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andShareRecordIdLessThanColumn(IntroduceRecord.Column column) {
addCriterion(new StringBuilder("share_record_id < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andShareRecordIdLessThanOrEqualTo(String value) {
addCriterion("share_record_id <=", value, "shareRecordId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andShareRecordIdLessThanOrEqualToColumn(IntroduceRecord.Column column) {
addCriterion(new StringBuilder("share_record_id <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andShareRecordIdLike(String value) {
addCriterion("share_record_id like", value, "shareRecordId");
return (Criteria) this;
}
public Criteria andShareRecordIdNotLike(String value) {
addCriterion("share_record_id not like", value, "shareRecordId");
return (Criteria) this;
}
public Criteria andShareRecordIdIn(List<String> values) {
addCriterion("share_record_id in", values, "shareRecordId");
return (Criteria) this;
}
public Criteria andShareRecordIdNotIn(List<String> values) {
addCriterion("share_record_id not in", values, "shareRecordId");
return (Criteria) this;
}
public Criteria andShareRecordIdBetween(String value1, String value2) {
addCriterion("share_record_id between", value1, value2, "shareRecordId");
return (Criteria) this;
}
public Criteria andShareRecordIdNotBetween(String value1, String value2) {
addCriterion("share_record_id not between", value1, value2, "shareRecordId");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null");
return (Criteria) this;
}
public Criteria andCreateTimeIsNotNull() {
addCriterion("create_time is not null");
return (Criteria) this;
}
public Criteria andCreateTimeEqualTo(Date value) {
addCriterion("create_time =", value, "createTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeEqualToColumn(IntroduceRecord.Column column) {
addCriterion(new StringBuilder("create_time = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCreateTimeNotEqualTo(Date value) {
addCriterion("create_time <>", value, "createTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeNotEqualToColumn(IntroduceRecord.Column column) {
addCriterion(new StringBuilder("create_time <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThan(Date value) {
addCriterion("create_time >", value, "createTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeGreaterThanColumn(IntroduceRecord.Column column) {
addCriterion(new StringBuilder("create_time > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("create_time >=", value, "createTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeGreaterThanOrEqualToColumn(IntroduceRecord.Column column) {
addCriterion(new StringBuilder("create_time >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCreateTimeLessThan(Date value) {
addCriterion("create_time <", value, "createTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeLessThanColumn(IntroduceRecord.Column column) {
addCriterion(new StringBuilder("create_time < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
addCriterion("create_time <=", value, "createTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeLessThanOrEqualToColumn(IntroduceRecord.Column column) {
addCriterion(new StringBuilder("create_time <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCreateTimeIn(List<Date> values) {
addCriterion("create_time in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotIn(List<Date> values) {
addCriterion("create_time not in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeBetween(Date value1, Date value2) {
addCriterion("create_time between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
addCriterion("create_time not between", value1, value2, "createTime");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private IntroduceRecordExample example;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
protected Criteria(IntroduceRecordExample example) {
super();
this.example = example;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public IntroduceRecordExample example() {
return this.example;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIf(boolean ifAdd, ICriteriaAdd add) {
if (ifAdd) {
add.add(this);
}
return this;
}
/**
* This interface was generated by MyBatis Generator.
* This interface corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public interface ICriteriaAdd {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
Criteria add(Criteria add);
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}
\ No newline at end of file
......@@ -34,6 +34,11 @@ public class SettlementRecord implements Entity {
*/
private String bankCardId;
/**
* 开户行名称
*/
private String bankName;
/**
* 真实姓名
*/
......
......@@ -8,7 +8,7 @@ import lombok.Data;
/**
* @author shiyu
* @date 2024/07/09
* @date 2024/08/06
*/
@Data
public class UserBankCard implements Entity {
......@@ -29,6 +29,11 @@ public class UserBankCard implements Entity {
*/
private String name;
/**
* 开户行名称
*/
private String bankName;
/**
* 创建时间
*/
......@@ -51,6 +56,7 @@ public class UserBankCard implements Entity {
sb.append(", userId=").append(userId);
sb.append(", cardId=").append(cardId);
sb.append(", name=").append(name);
sb.append(", bankName=").append(bankName);
sb.append(", createTime=").append(createTime);
sb.append(", state=").append(state);
sb.append(", serialVersionUID=").append(serialVersionUID);
......@@ -74,6 +80,7 @@ public class UserBankCard implements Entity {
&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
&& (this.getCardId() == null ? other.getCardId() == null : this.getCardId().equals(other.getCardId()))
&& (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
&& (this.getBankName() == null ? other.getBankName() == null : this.getBankName().equals(other.getBankName()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getState() == null ? other.getState() == null : this.getState().equals(other.getState()));
}
......@@ -86,6 +93,7 @@ public class UserBankCard implements Entity {
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
result = prime * result + ((getCardId() == null) ? 0 : getCardId().hashCode());
result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
result = prime * result + ((getBankName() == null) ? 0 : getBankName().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getState() == null) ? 0 : getState().hashCode());
return result;
......@@ -103,6 +111,7 @@ public class UserBankCard implements Entity {
userId("user_id", "userId", "BIGINT", false),
cardId("card_id", "cardId", "VARCHAR", false),
name("name", "name", "VARCHAR", true),
bankName("bank_name", "bankName", "VARCHAR", false),
createTime("create_time", "createTime", "TIMESTAMP", false),
state("state", "state", "INTEGER", true);
......
......@@ -696,6 +696,148 @@ public class UserBankCardExample {
return (Criteria) this;
}
public Criteria andBankNameIsNull() {
addCriterion("bank_name is null");
return (Criteria) this;
}
public Criteria andBankNameIsNotNull() {
addCriterion("bank_name is not null");
return (Criteria) this;
}
public Criteria andBankNameEqualTo(String value) {
addCriterion("bank_name =", value, "bankName");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bank_card
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andBankNameEqualToColumn(UserBankCard.Column column) {
addCriterion(new StringBuilder("bank_name = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andBankNameNotEqualTo(String value) {
addCriterion("bank_name <>", value, "bankName");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bank_card
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andBankNameNotEqualToColumn(UserBankCard.Column column) {
addCriterion(new StringBuilder("bank_name <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andBankNameGreaterThan(String value) {
addCriterion("bank_name >", value, "bankName");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bank_card
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andBankNameGreaterThanColumn(UserBankCard.Column column) {
addCriterion(new StringBuilder("bank_name > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andBankNameGreaterThanOrEqualTo(String value) {
addCriterion("bank_name >=", value, "bankName");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bank_card
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andBankNameGreaterThanOrEqualToColumn(UserBankCard.Column column) {
addCriterion(new StringBuilder("bank_name >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andBankNameLessThan(String value) {
addCriterion("bank_name <", value, "bankName");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bank_card
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andBankNameLessThanColumn(UserBankCard.Column column) {
addCriterion(new StringBuilder("bank_name < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andBankNameLessThanOrEqualTo(String value) {
addCriterion("bank_name <=", value, "bankName");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bank_card
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andBankNameLessThanOrEqualToColumn(UserBankCard.Column column) {
addCriterion(new StringBuilder("bank_name <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andBankNameLike(String value) {
addCriterion("bank_name like", value, "bankName");
return (Criteria) this;
}
public Criteria andBankNameNotLike(String value) {
addCriterion("bank_name not like", value, "bankName");
return (Criteria) this;
}
public Criteria andBankNameIn(List<String> values) {
addCriterion("bank_name in", values, "bankName");
return (Criteria) this;
}
public Criteria andBankNameNotIn(List<String> values) {
addCriterion("bank_name not in", values, "bankName");
return (Criteria) this;
}
public Criteria andBankNameBetween(String value1, String value2) {
addCriterion("bank_name between", value1, value2, "bankName");
return (Criteria) this;
}
public Criteria andBankNameNotBetween(String value1, String value2) {
addCriterion("bank_name not between", value1, value2, "bankName");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null");
return (Criteria) this;
......
package com.wwdz.ch.db.impl.distribution;
import com.wwdz.ch.db.dao.distribution.IntroduceRecordDao;
import com.wwdz.ch.db.domain.distribution.IntroduceRecord;
import com.wwdz.ch.db.domain.distribution.IntroduceRecordExample;
import com.wwdz.ch.db.mapper.distribution.IntroduceRecordMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
@Repository
public class IntroduceRecordDaoImpl implements IntroduceRecordDao {
@Autowired
IntroduceRecordMapper introduceRecordMapper;
@Override
public boolean insert(IntroduceRecord introduceRecord) {
return introduceRecordMapper.insert(introduceRecord) > 0;
}
@Override
public IntroduceRecord findByUserId(long userId) {
IntroduceRecordExample example = new IntroduceRecordExample();
IntroduceRecordExample.Criteria criteria = example.createCriteria();
criteria.andUserIdEqualTo(userId);
return introduceRecordMapper.selectOneByExample(example);
}
@Override
public IntroduceRecord findByDoubleId(long userId, long introducerId) {
IntroduceRecordExample example = new IntroduceRecordExample();
IntroduceRecordExample.Criteria criteria = example.createCriteria();
criteria.andUserIdEqualTo(userId);
criteria.andIntroducerIdEqualTo(introducerId);
return introduceRecordMapper.selectOneByExample(example);
}
@Override
public boolean isExisted(long userId) {
IntroduceRecordExample example = new IntroduceRecordExample();
IntroduceRecordExample.Criteria criteria = example.createCriteria();
criteria.andUserIdEqualTo(userId);
return introduceRecordMapper.countByExample(example) > 0;
}
}
package com.wwdz.ch.db.mapper.distribution;
import com.wwdz.ch.db.domain.distribution.IntroduceRecord;
import com.wwdz.ch.db.domain.distribution.IntroduceRecordExample;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
@Mapper
public interface IntroduceRecordMapper {
long countByExample(IntroduceRecordExample example);
int deleteByExample(IntroduceRecordExample example);
int deleteByPrimaryKey(Long id);
int insert(IntroduceRecord record);
int insertSelective(IntroduceRecord record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
IntroduceRecord selectOneByExample(IntroduceRecordExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
IntroduceRecord selectOneByExampleSelective(@Param("example") IntroduceRecordExample example, @Param("selective") IntroduceRecord.Column ... selective);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
List<IntroduceRecord> selectByExampleSelective(@Param("example") IntroduceRecordExample example, @Param("selective") IntroduceRecord.Column ... selective);
List<IntroduceRecord> selectByExample(IntroduceRecordExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table introduce_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
IntroduceRecord selectByPrimaryKeySelective(@Param("id") Long id, @Param("selective") IntroduceRecord.Column ... selective);
IntroduceRecord selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") IntroduceRecord record, @Param("example") IntroduceRecordExample example);
int updateByExample(@Param("record") IntroduceRecord record, @Param("example") IntroduceRecordExample example);
int updateByPrimaryKeySelective(IntroduceRecord record);
int updateByPrimaryKey(IntroduceRecord record);
}
\ No newline at end of file
......@@ -3,11 +3,8 @@ package com.wwdz.ch.db.mapper.distribution;
import com.wwdz.ch.db.domain.distribution.UserBankCard;
import com.wwdz.ch.db.domain.distribution.UserBankCardExample;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface UserBankCardMapper {
long countByExample(UserBankCardExample example);
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.wwdz.ch.db.mapper.distribution.IntroduceRecordMapper">
<resultMap id="BaseResultMap" type="com.wwdz.ch.db.domain.distribution.IntroduceRecord">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="user_id" jdbcType="BIGINT" property="userId" />
<result column="introducer_id" jdbcType="BIGINT" property="introducerId" />
<result column="share_record_id" jdbcType="VARCHAR" property="shareRecordId" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, user_id, introducer_id, share_record_id, create_time
</sql>
<select id="selectByExample" parameterType="com.wwdz.ch.db.domain.distribution.IntroduceRecordExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
'true' as QUERYID,
<include refid="Base_Column_List" />
from introduce_record
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExampleSelective" parameterType="map" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
'true' as QUERYID,
<if test="example.distinct">
distinct
</if>
<choose>
<when test="selective != null and selective.length > 0">
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, user_id, introducer_id, share_record_id, create_time
</otherwise>
</choose>
from introduce_record
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
<if test="example.orderByClause != null">
order by ${example.orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from introduce_record
where id = #{id,jdbcType=BIGINT}
</select>
<select id="selectByPrimaryKeySelective" parameterType="map" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
<choose>
<when test="selective != null and selective.length > 0">
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, user_id, introducer_id, share_record_id, create_time
</otherwise>
</choose>
from introduce_record
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from introduce_record
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.wwdz.ch.db.domain.distribution.IntroduceRecordExample">
delete from introduce_record
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.wwdz.ch.db.domain.distribution.IntroduceRecord">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into introduce_record (user_id, introducer_id, share_record_id,
create_time)
values (#{userId,jdbcType=BIGINT}, #{introducerId,jdbcType=BIGINT}, #{shareRecordId,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.wwdz.ch.db.domain.distribution.IntroduceRecord">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into introduce_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null">
user_id,
</if>
<if test="introducerId != null">
introducer_id,
</if>
<if test="shareRecordId != null">
share_record_id,
</if>
<if test="createTime != null">
create_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null">
#{userId,jdbcType=BIGINT},
</if>
<if test="introducerId != null">
#{introducerId,jdbcType=BIGINT},
</if>
<if test="shareRecordId != null">
#{shareRecordId,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.wwdz.ch.db.domain.distribution.IntroduceRecordExample" resultType="java.lang.Long">
select count(*) from introduce_record
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update introduce_record
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=BIGINT},
</if>
<if test="record.introducerId != null">
introducer_id = #{record.introducerId,jdbcType=BIGINT},
</if>
<if test="record.shareRecordId != null">
share_record_id = #{record.shareRecordId,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update introduce_record
set id = #{record.id,jdbcType=BIGINT},
user_id = #{record.userId,jdbcType=BIGINT},
introducer_id = #{record.introducerId,jdbcType=BIGINT},
share_record_id = #{record.shareRecordId,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.wwdz.ch.db.domain.distribution.IntroduceRecord">
update introduce_record
<set>
<if test="userId != null">
user_id = #{userId,jdbcType=BIGINT},
</if>
<if test="introducerId != null">
introducer_id = #{introducerId,jdbcType=BIGINT},
</if>
<if test="shareRecordId != null">
share_record_id = #{shareRecordId,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.wwdz.ch.db.domain.distribution.IntroduceRecord">
update introduce_record
set user_id = #{userId,jdbcType=BIGINT},
introducer_id = #{introducerId,jdbcType=BIGINT},
share_record_id = #{shareRecordId,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT}
</update>
<select id="selectOneByExample" parameterType="com.wwdz.ch.db.domain.distribution.IntroduceRecordExample" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
'true' as QUERYID,
<include refid="Base_Column_List" />
from introduce_record
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
limit 1
</select>
<select id="selectOneByExampleSelective" parameterType="map" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
'true' as QUERYID,
<choose>
<when test="selective != null and selective.length > 0">
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, user_id, introducer_id, share_record_id, create_time
</otherwise>
</choose>
from introduce_record
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
<if test="example.orderByClause != null">
order by ${example.orderByClause}
</if>
limit 1
</select>
</mapper>
\ No newline at end of file
......@@ -6,6 +6,7 @@
<result column="user_id" jdbcType="BIGINT" property="userId" />
<result column="card_id" jdbcType="VARCHAR" property="cardId" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="bank_name" jdbcType="VARCHAR" property="bankName" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="state" jdbcType="INTEGER" property="state" />
</resultMap>
......@@ -68,7 +69,7 @@
</where>
</sql>
<sql id="Base_Column_List">
id, user_id, card_id, `name`, create_time, `state`
id, user_id, card_id, `name`, bank_name, create_time, `state`
</sql>
<select id="selectByExample" parameterType="com.wwdz.ch.db.domain.distribution.UserBankCardExample" resultMap="BaseResultMap">
select
......@@ -97,13 +98,13 @@
distinct
</if>
<choose>
<when test="selective != null and selective.length > 0">
<when test="selective != null and selective.length &gt; 0">
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, user_id, card_id, `name`, create_time, `state`
id, user_id, card_id, `name`, bank_name, create_time, `state`
</otherwise>
</choose>
from user_bank_card
......@@ -128,13 +129,13 @@
-->
select
<choose>
<when test="selective != null and selective.length > 0">
<when test="selective != null and selective.length &gt; 0">
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, user_id, card_id, `name`, create_time, `state`
id, user_id, card_id, `name`, bank_name, create_time, `state`
</otherwise>
</choose>
from user_bank_card
......@@ -155,9 +156,11 @@
SELECT LAST_INSERT_ID()
</selectKey>
insert into user_bank_card (user_id, card_id, `name`,
create_time, `state`)
bank_name, create_time, `state`
)
values (#{userId,jdbcType=BIGINT}, #{cardId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{state,jdbcType=INTEGER})
#{bankName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{state,jdbcType=INTEGER}
)
</insert>
<insert id="insertSelective" parameterType="com.wwdz.ch.db.domain.distribution.UserBankCard">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
......@@ -174,6 +177,9 @@
<if test="name != null">
`name`,
</if>
<if test="bankName != null">
bank_name,
</if>
<if test="createTime != null">
create_time,
</if>
......@@ -191,6 +197,9 @@
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="bankName != null">
#{bankName,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
......@@ -220,6 +229,9 @@
<if test="record.name != null">
`name` = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.bankName != null">
bank_name = #{record.bankName,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
......@@ -237,6 +249,7 @@
user_id = #{record.userId,jdbcType=BIGINT},
card_id = #{record.cardId,jdbcType=VARCHAR},
`name` = #{record.name,jdbcType=VARCHAR},
bank_name = #{record.bankName,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
`state` = #{record.state,jdbcType=INTEGER}
<if test="_parameter != null">
......@@ -255,6 +268,9 @@
<if test="name != null">
`name` = #{name,jdbcType=VARCHAR},
</if>
<if test="bankName != null">
bank_name = #{bankName,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
......@@ -269,6 +285,7 @@
set user_id = #{userId,jdbcType=BIGINT},
card_id = #{cardId,jdbcType=VARCHAR},
`name` = #{name,jdbcType=VARCHAR},
bank_name = #{bankName,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
`state` = #{state,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT}
......@@ -300,13 +317,13 @@
select
'true' as QUERYID,
<choose>
<when test="selective != null and selective.length > 0">
<when test="selective != null and selective.length &gt; 0">
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, user_id, card_id, `name`, create_time, `state`
id, user_id, card_id, `name`, bank_name, create_time, `state`
</otherwise>
</choose>
from user_bank_card
......
......@@ -72,7 +72,7 @@
<javaClientGenerator type="XMLMAPPER" targetPackage="com.wwdz.ch.db.mapper.distribution"
targetProject="ch-dao/src/main/java"/>
<table tableName="distribution_order" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true">
<table tableName="user_bank_card" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true">
<generatedKey column="id" sqlStatement="Mysql" identity="true" />
</table>
......
......@@ -136,6 +136,9 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
@Autowired
GroupPurchaseService groupPurchaseService;
@Autowired
IntroduceRecordDao introduceRecordDao;
@Transactional
@Override
public Result createDistributionOrder(DistributionOrderRequestDto dto) {
......@@ -258,25 +261,23 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
AuctionRecord firstAuctionRecord = auctionRecordDao.findFirstRecord(dto.getItemId(), auctionRecord.getUserId());
String shareRecordId = firstAuctionRecord.getShareRecordId();*/
//查询该用户和藏家的介绍人
FollowFansRecordRequestDto queryFollowFansRecordRequestDto = new FollowFansRecordRequestDto();
queryFollowFansRecordRequestDto.setFollowerId(auctionConfig.getCreatorId());
queryFollowFansRecordRequestDto.setFansId(dto.getBuyerId());
FollowFansRecord followFansRecord = followFansRecordDao.findOne(queryFollowFansRecordRequestDto);
//查询该用户介绍人
long introducerId;
//没有关注记录,则介绍费算作平台的
if (followFansRecord == null) {
IntroduceRecord introduceRecord = introduceRecordDao.findByUserId(dto.getBuyerId());
if (introduceRecord == null) {
introducerId = CommConsts.SYSTEM_ACCOUNT;
IntroduceRecord newRecord = new IntroduceRecord();
newRecord.setUserId(dto.getBuyerId());
newRecord.setIntroducerId(introducerId);
newRecord.setShareRecordId(CommConsts.DEFAULT_SHARE_ID);
newRecord.setCreateTime(new Date());
introduceRecordDao.insert(newRecord);
} else {
//把介绍人作为该订单的分享链接字段的值
introducerId = followFansRecord.getIntroducerId();
introducerId = introduceRecord.getIntroducerId();
}
//查询该用户和藏家的介绍人
FollowFansRecordRequestDto followFansRecordRequestDto = new FollowFansRecordRequestDto();
followFansRecordRequestDto.setFollowerId(auctionConfig.getCreatorId());
followFansRecordRequestDto.setFansId(auctionRecord.getUserId());
double rebate = distributorProfitService.getIntroduceRebate(followFansRecordRequestDto);
//查询佣金比例
double rebate = distributorProfitService.getIntroduceRebate(auctionRecord.getUserId(), introducerId);
DistributionOrder distributionOrder = new DistributionOrder();
distributionOrder.setIntroducerId(introducerId);
......@@ -411,21 +412,22 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
}
String prepayId = (String) prePayResult.getData();
//查询该用户和藏家的介绍人
FollowFansRecordRequestDto followFansRecordRequestDto = new FollowFansRecordRequestDto();
followFansRecordRequestDto.setFollowerId(supplierItem.getCreatorId());
followFansRecordRequestDto.setFansId(dto.getBuyerId());
FollowFansRecord followFansRecord = followFansRecordDao.findOne(followFansRecordRequestDto);
//查询该用户介绍人
long introducerId;
//没有关注记录,则介绍费算作平台的
if (followFansRecord == null) {
IntroduceRecord introduceRecord = introduceRecordDao.findByUserId(dto.getBuyerId());
if (introduceRecord == null) {
introducerId = CommConsts.SYSTEM_ACCOUNT;
IntroduceRecord newRecord = new IntroduceRecord();
newRecord.setUserId(dto.getBuyerId());
newRecord.setIntroducerId(introducerId);
newRecord.setShareRecordId(CommConsts.DEFAULT_SHARE_ID);
newRecord.setCreateTime(new Date());
introduceRecordDao.insert(newRecord);
} else {
//把介绍人作为该订单的分享链接字段的值
introducerId = followFansRecord.getIntroducerId();
introducerId = introduceRecord.getIntroducerId();
}
//介绍人分佣
double rebate = distributorProfitService.getIntroduceRebate(followFansRecordRequestDto);
//查询佣金比例
double rebate = distributorProfitService.getIntroduceRebate(dto.getBuyerId(), introducerId);
DistributionOrder distributionOrder = new DistributionOrder();
distributionOrder.setIntroduceRebate(BigDecimal.valueOf(rebate));
......@@ -516,21 +518,22 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
}
long amount = groupPurchaseConfig.getPrice() * dto.getItemNum();
SupplierItem supplierItem = supplierItemDao.findById(itemId);
//查询该用户和藏家的介绍人
FollowFansRecordRequestDto followFansRecordRequestDto = new FollowFansRecordRequestDto();
followFansRecordRequestDto.setFollowerId(supplierItem.getCreatorId());
followFansRecordRequestDto.setFansId(dto.getUserId());
FollowFansRecord followFansRecord = followFansRecordDao.findOne(followFansRecordRequestDto);
//查询该用户介绍人
long introducerId;
//没有关注记录,则介绍费算作平台的
if (followFansRecord == null) {
IntroduceRecord introduceRecord = introduceRecordDao.findByUserId(dto.getBuyerId());
if (introduceRecord == null) {
introducerId = CommConsts.SYSTEM_ACCOUNT;
IntroduceRecord newRecord = new IntroduceRecord();
newRecord.setUserId(dto.getBuyerId());
newRecord.setIntroducerId(introducerId);
newRecord.setShareRecordId(CommConsts.DEFAULT_SHARE_ID);
newRecord.setCreateTime(new Date());
introduceRecordDao.insert(newRecord);
} else {
//把介绍人作为该订单的分享链接字段的值
introducerId = followFansRecord.getIntroducerId();
introducerId = introduceRecord.getIntroducerId();
}
//查询该用户和藏家的介绍人
double rebate = distributorProfitService.getIntroduceRebate(followFansRecordRequestDto);
//查询佣金比例
double rebate = distributorProfitService.getIntroduceRebate(dto.getBuyerId(), introducerId);
String distributionOrderId = IdUtils.getOrderNumber(DISTRIBUTION_ORDER_PREFIX);
DistributionOrderRequestDto prePayDto = new DistributionOrderRequestDto();
......@@ -1258,7 +1261,11 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
FollowFansRecordRequestDto followFansRecordRequestDto = new FollowFansRecordRequestDto();
followFansRecordRequestDto.setFollowerId(supplierItem.getCreatorId());
followFansRecordRequestDto.setFansId(distributionOrder.getBuyerId());
double rebate = distributorProfitService.getIntroduceRebate(followFansRecordRequestDto);
IntroduceRecord introduceRecord = introduceRecordDao.findByUserId(distributionOrder.getBuyerId());
double rebate = CommConsts.REBATE;
if (introduceRecord != null) {
rebate = distributorProfitService.getIntroduceRebate(distributionOrder.getBuyerId(), introduceRecord.getIntroducerId());
}
distributionOrderDetailVo.setIntroduceRebate(PriceUtil.convertPriceFromStr(String.valueOf(rebate)).toString());
distributionOrderDetailVo.setProfit(PriceUtil.convertPriceFenToYuan(distributorProfit.getProfit()));
}
......
package com.wwdz.ch.wx.impl.distribution;
import com.wwdz.ch.core.consts.CommConsts;
import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.core.util.PriceUtil;
import com.wwdz.ch.db.dao.CollectorWhiteListDao;
import com.wwdz.ch.db.dao.FollowFansRecordDao;
import com.wwdz.ch.db.dao.distribution.DistributorProfitDao;
import com.wwdz.ch.db.dao.distribution.IntroduceRecordDao;
import com.wwdz.ch.db.domain.CollectorWhiteList;
import com.wwdz.ch.db.domain.FollowFansRecord;
import com.wwdz.ch.db.domain.distribution.IntroduceRecord;
import com.wwdz.ch.db.dto.request.FollowFansRecordRequestDto;
import com.wwdz.ch.db.dto.request.distribution.SupplierItemRequestDto;
import com.wwdz.ch.wx.service.distribution.DistributorProfitService;
......@@ -35,15 +38,21 @@ public class DistributorProfitServiceImpl implements DistributorProfitService {
@Autowired
CollectorWhiteListDao collectorWhiteListDao;
@Autowired
IntroduceRecordDao introduceRecordDao;
@Override
public Double getIntroduceRebate(FollowFansRecordRequestDto dto) {
double rebate = 0.03;
public Double getIntroduceRebate(long userId, long introducerId) {
double rebate = CommConsts.REBATE;
try {
FollowFansRecord followFansRecord = followFansRecordDao.findOne(dto);
if (followFansRecord == null) {
if (introducerId == CommConsts.SYSTEM_ACCOUNT) {
return rebate;
}
IntroduceRecord introduceRecord = introduceRecordDao.findByDoubleId(userId, introducerId);
if (introduceRecord == null) {
return rebate;
}
Date createTime = followFansRecord.getCreateTime();
Date createTime = introduceRecord.getCreateTime();
Date now = new Date();
int year = 0;
for (int i = 1; i <= 3; i++) {
......
......@@ -148,6 +148,9 @@ public class SupplierItemServiceImpl implements SupplierItemService {
@Autowired
GroupPurchaseService groupPurchaseService;
@Autowired
IntroduceRecordDao introduceRecordDao;
@Override
public Result findList(SupplierItemRequestDto dto) {
try {
......@@ -546,6 +549,16 @@ public class SupplierItemServiceImpl implements SupplierItemService {
itemId = collectionShareRecord.getShareTargetId();
if (collectionShareRecord != null && collectionShareRecord.getItemUserId().longValue() != dto.getUserId().longValue()) {
//保存介绍记录
if (!introduceRecordDao.isExisted(dto.getUserId())) {
IntroduceRecord introduceRecord = new IntroduceRecord();
introduceRecord.setUserId(dto.getUserId());
introduceRecord.setIntroducerId(introducerId);
introduceRecord.setShareRecordId(shareRecordId);
introduceRecord.setCreateTime(now);
introduceRecordDao.insert(introduceRecord);
}
//客态进入别人的藏馆,自动关注
FollowFansRecordRequestDto followFansRecordRequestDto = new FollowFansRecordRequestDto();
followFansRecordRequestDto.setFollowerId(collectionShareRecord.getItemUserId());
......@@ -843,6 +856,15 @@ public class SupplierItemServiceImpl implements SupplierItemService {
collectionShareRecord = collectionShareRecordDao.findById(dto.getShareRecordId());
itemId = collectionShareRecord.getShareTargetId();
if (collectionShareRecord != null && collectionShareRecord.getItemUserId().longValue() != dto.getUserId().longValue()) {
//保存介绍记录
if (!introduceRecordDao.isExisted(dto.getUserId())) {
IntroduceRecord introduceRecord = new IntroduceRecord();
introduceRecord.setUserId(dto.getUserId());
introduceRecord.setIntroducerId(collectionShareRecord.getSharerId());
introduceRecord.setShareRecordId(dto.getShareRecordId());
introduceRecord.setCreateTime(new Date());
introduceRecordDao.insert(introduceRecord);
}
//客态进入别人的藏馆,自动关注
FollowFansRecordRequestDto followFansRecordRequestDto = new FollowFansRecordRequestDto();
followFansRecordRequestDto.setFollowerId(collectionShareRecord.getItemUserId());
......@@ -984,6 +1006,16 @@ public class SupplierItemServiceImpl implements SupplierItemService {
itemId = collectionShareRecord.getShareTargetId();
if (collectionShareRecord != null && collectionShareRecord.getItemUserId().longValue() != dto.getUserId().longValue()) {
//保存介绍记录
if (!introduceRecordDao.isExisted(dto.getUserId())) {
IntroduceRecord introduceRecord = new IntroduceRecord();
introduceRecord.setUserId(dto.getUserId());
introduceRecord.setIntroducerId(introducerId);
introduceRecord.setShareRecordId(dto.getShareRecordId());
introduceRecord.setCreateTime(new Date());
introduceRecordDao.insert(introduceRecord);
}
//客态进入别人的藏馆,自动关注
FollowFansRecordRequestDto followFansRecordRequestDto = new FollowFansRecordRequestDto();
followFansRecordRequestDto.setFollowerId(collectionShareRecord.getItemUserId());
......
......@@ -8,10 +8,10 @@ public interface DistributorProfitService {
/**
* 获取介绍人当前的佣金比例
* @param dto
* @param userId, introducerId
* @return
*/
Double getIntroduceRebate(FollowFansRecordRequestDto dto);
Double getIntroduceRebate(long userId, long introducerId);
/**
* 获取预计分佣金额
......
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