From 2df5d1d1f45e7b74b66587baa9346da8018ad486 Mon Sep 17 00:00:00 2001 From: YuanYe <418471657@qq.com> Date: Wed, 30 Oct 2024 14:34:09 +0800 Subject: [PATCH 1/2] 1 --- .../main/java/com/hfkj/dao/BsUserMapper.java | 22 +- .../java/com/hfkj/dao/BsUserSqlProvider.java | 56 ++++ .../src/main/java/com/hfkj/entity/BsUser.java | 132 ++++----- .../java/com/hfkj/entity/BsUserExample.java | 280 ++++++++++++++++++ 4 files changed, 407 insertions(+), 83 deletions(-) diff --git a/service/src/main/java/com/hfkj/dao/BsUserMapper.java b/service/src/main/java/com/hfkj/dao/BsUserMapper.java index 42dc362..3dd804f 100644 --- a/service/src/main/java/com/hfkj/dao/BsUserMapper.java +++ b/service/src/main/java/com/hfkj/dao/BsUserMapper.java @@ -41,6 +41,8 @@ public interface BsUserMapper extends BsUserMapperExt { @Insert({ "insert into bs_user (head_img, `name`, ", "phone, grade, wechat_num, ", + "special_id, wechat_open_id, ", + "wechat_unionid, elm_pid, ", "invite_user_id, invite_time, ", "partner_level, partner_income_per, ", "`status`, create_time, ", @@ -48,6 +50,8 @@ public interface BsUserMapper extends BsUserMapperExt { "ext_2, ext_3)", "values (#{headImg,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, ", "#{phone,jdbcType=VARCHAR}, #{grade,jdbcType=INTEGER}, #{wechatNum,jdbcType=VARCHAR}, ", + "#{specialId,jdbcType=VARCHAR}, #{wechatOpenId,jdbcType=VARCHAR}, ", + "#{wechatUnionid,jdbcType=VARCHAR}, #{elmPid,jdbcType=VARCHAR}, ", "#{inviteUserId,jdbcType=BIGINT}, #{inviteTime,jdbcType=TIMESTAMP}, ", "#{partnerLevel,jdbcType=INTEGER}, #{partnerIncomePer,jdbcType=DECIMAL}, ", "#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ", @@ -69,6 +73,10 @@ public interface BsUserMapper extends BsUserMapperExt { @Result(column="phone", property="phone", jdbcType=JdbcType.VARCHAR), @Result(column="grade", property="grade", jdbcType=JdbcType.INTEGER), @Result(column="wechat_num", property="wechatNum", jdbcType=JdbcType.VARCHAR), + @Result(column="special_id", property="specialId", jdbcType=JdbcType.VARCHAR), + @Result(column="wechat_open_id", property="wechatOpenId", jdbcType=JdbcType.VARCHAR), + @Result(column="wechat_unionid", property="wechatUnionid", jdbcType=JdbcType.VARCHAR), + @Result(column="elm_pid", property="elmPid", jdbcType=JdbcType.VARCHAR), @Result(column="invite_user_id", property="inviteUserId", jdbcType=JdbcType.BIGINT), @Result(column="invite_time", property="inviteTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="partner_level", property="partnerLevel", jdbcType=JdbcType.INTEGER), @@ -84,9 +92,9 @@ public interface BsUserMapper extends BsUserMapperExt { @Select({ "select", - "id, head_img, `name`, phone, grade, wechat_num, invite_user_id, invite_time, ", - "partner_level, partner_income_per, `status`, create_time, update_time, ext_1, ", - "ext_2, ext_3", + "id, head_img, `name`, phone, grade, wechat_num, special_id, wechat_open_id, ", + "wechat_unionid, elm_pid, invite_user_id, invite_time, partner_level, partner_income_per, ", + "`status`, create_time, update_time, ext_1, ext_2, ext_3", "from bs_user", "where id = #{id,jdbcType=BIGINT}" }) @@ -97,6 +105,10 @@ public interface BsUserMapper extends BsUserMapperExt { @Result(column="phone", property="phone", jdbcType=JdbcType.VARCHAR), @Result(column="grade", property="grade", jdbcType=JdbcType.INTEGER), @Result(column="wechat_num", property="wechatNum", jdbcType=JdbcType.VARCHAR), + @Result(column="special_id", property="specialId", jdbcType=JdbcType.VARCHAR), + @Result(column="wechat_open_id", property="wechatOpenId", jdbcType=JdbcType.VARCHAR), + @Result(column="wechat_unionid", property="wechatUnionid", jdbcType=JdbcType.VARCHAR), + @Result(column="elm_pid", property="elmPid", jdbcType=JdbcType.VARCHAR), @Result(column="invite_user_id", property="inviteUserId", jdbcType=JdbcType.BIGINT), @Result(column="invite_time", property="inviteTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="partner_level", property="partnerLevel", jdbcType=JdbcType.INTEGER), @@ -126,6 +138,10 @@ public interface BsUserMapper extends BsUserMapperExt { "phone = #{phone,jdbcType=VARCHAR},", "grade = #{grade,jdbcType=INTEGER},", "wechat_num = #{wechatNum,jdbcType=VARCHAR},", + "special_id = #{specialId,jdbcType=VARCHAR},", + "wechat_open_id = #{wechatOpenId,jdbcType=VARCHAR},", + "wechat_unionid = #{wechatUnionid,jdbcType=VARCHAR},", + "elm_pid = #{elmPid,jdbcType=VARCHAR},", "invite_user_id = #{inviteUserId,jdbcType=BIGINT},", "invite_time = #{inviteTime,jdbcType=TIMESTAMP},", "partner_level = #{partnerLevel,jdbcType=INTEGER},", diff --git a/service/src/main/java/com/hfkj/dao/BsUserSqlProvider.java b/service/src/main/java/com/hfkj/dao/BsUserSqlProvider.java index 107aec7..5150a17 100644 --- a/service/src/main/java/com/hfkj/dao/BsUserSqlProvider.java +++ b/service/src/main/java/com/hfkj/dao/BsUserSqlProvider.java @@ -48,6 +48,22 @@ public class BsUserSqlProvider { sql.VALUES("wechat_num", "#{wechatNum,jdbcType=VARCHAR}"); } + if (record.getSpecialId() != null) { + sql.VALUES("special_id", "#{specialId,jdbcType=VARCHAR}"); + } + + if (record.getWechatOpenId() != null) { + sql.VALUES("wechat_open_id", "#{wechatOpenId,jdbcType=VARCHAR}"); + } + + if (record.getWechatUnionid() != null) { + sql.VALUES("wechat_unionid", "#{wechatUnionid,jdbcType=VARCHAR}"); + } + + if (record.getElmPid() != null) { + sql.VALUES("elm_pid", "#{elmPid,jdbcType=VARCHAR}"); + } + if (record.getInviteUserId() != null) { sql.VALUES("invite_user_id", "#{inviteUserId,jdbcType=BIGINT}"); } @@ -103,6 +119,10 @@ public class BsUserSqlProvider { sql.SELECT("phone"); sql.SELECT("grade"); sql.SELECT("wechat_num"); + sql.SELECT("special_id"); + sql.SELECT("wechat_open_id"); + sql.SELECT("wechat_unionid"); + sql.SELECT("elm_pid"); sql.SELECT("invite_user_id"); sql.SELECT("invite_time"); sql.SELECT("partner_level"); @@ -154,6 +174,22 @@ public class BsUserSqlProvider { sql.SET("wechat_num = #{record.wechatNum,jdbcType=VARCHAR}"); } + if (record.getSpecialId() != null) { + sql.SET("special_id = #{record.specialId,jdbcType=VARCHAR}"); + } + + if (record.getWechatOpenId() != null) { + sql.SET("wechat_open_id = #{record.wechatOpenId,jdbcType=VARCHAR}"); + } + + if (record.getWechatUnionid() != null) { + sql.SET("wechat_unionid = #{record.wechatUnionid,jdbcType=VARCHAR}"); + } + + if (record.getElmPid() != null) { + sql.SET("elm_pid = #{record.elmPid,jdbcType=VARCHAR}"); + } + if (record.getInviteUserId() != null) { sql.SET("invite_user_id = #{record.inviteUserId,jdbcType=BIGINT}"); } @@ -208,6 +244,10 @@ public class BsUserSqlProvider { sql.SET("phone = #{record.phone,jdbcType=VARCHAR}"); sql.SET("grade = #{record.grade,jdbcType=INTEGER}"); sql.SET("wechat_num = #{record.wechatNum,jdbcType=VARCHAR}"); + sql.SET("special_id = #{record.specialId,jdbcType=VARCHAR}"); + sql.SET("wechat_open_id = #{record.wechatOpenId,jdbcType=VARCHAR}"); + sql.SET("wechat_unionid = #{record.wechatUnionid,jdbcType=VARCHAR}"); + sql.SET("elm_pid = #{record.elmPid,jdbcType=VARCHAR}"); sql.SET("invite_user_id = #{record.inviteUserId,jdbcType=BIGINT}"); sql.SET("invite_time = #{record.inviteTime,jdbcType=TIMESTAMP}"); sql.SET("partner_level = #{record.partnerLevel,jdbcType=INTEGER}"); @@ -248,6 +288,22 @@ public class BsUserSqlProvider { sql.SET("wechat_num = #{wechatNum,jdbcType=VARCHAR}"); } + if (record.getSpecialId() != null) { + sql.SET("special_id = #{specialId,jdbcType=VARCHAR}"); + } + + if (record.getWechatOpenId() != null) { + sql.SET("wechat_open_id = #{wechatOpenId,jdbcType=VARCHAR}"); + } + + if (record.getWechatUnionid() != null) { + sql.SET("wechat_unionid = #{wechatUnionid,jdbcType=VARCHAR}"); + } + + if (record.getElmPid() != null) { + sql.SET("elm_pid = #{elmPid,jdbcType=VARCHAR}"); + } + if (record.getInviteUserId() != null) { sql.SET("invite_user_id = #{inviteUserId,jdbcType=BIGINT}"); } diff --git a/service/src/main/java/com/hfkj/entity/BsUser.java b/service/src/main/java/com/hfkj/entity/BsUser.java index 7447507..fa63185 100644 --- a/service/src/main/java/com/hfkj/entity/BsUser.java +++ b/service/src/main/java/com/hfkj/entity/BsUser.java @@ -44,6 +44,26 @@ public class BsUser implements Serializable { */ private String wechatNum; + /** + * 淘宝会员独有 + */ + private String specialId; + + /** + * 微信openid + */ + private String wechatOpenId; + + /** + * 微信unionid + */ + private String wechatUnionid; + + /** + * 饿了么推广位编码 + */ + private String elmPid; + /** * 邀请人id */ @@ -135,6 +155,38 @@ public class BsUser implements Serializable { this.wechatNum = wechatNum; } + public String getSpecialId() { + return specialId; + } + + public void setSpecialId(String specialId) { + this.specialId = specialId; + } + + public String getWechatOpenId() { + return wechatOpenId; + } + + public void setWechatOpenId(String wechatOpenId) { + this.wechatOpenId = wechatOpenId; + } + + public String getWechatUnionid() { + return wechatUnionid; + } + + public void setWechatUnionid(String wechatUnionid) { + this.wechatUnionid = wechatUnionid; + } + + public String getElmPid() { + return elmPid; + } + + public void setElmPid(String elmPid) { + this.elmPid = elmPid; + } + public Long getInviteUserId() { return inviteUserId; } @@ -214,84 +266,4 @@ public class BsUser implements Serializable { public void setExt3(String ext3) { this.ext3 = ext3; } - - @Override - public boolean equals(Object that) { - if (this == that) { - return true; - } - if (that == null) { - return false; - } - if (getClass() != that.getClass()) { - return false; - } - BsUser other = (BsUser) that; - return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) - && (this.getHeadImg() == null ? other.getHeadImg() == null : this.getHeadImg().equals(other.getHeadImg())) - && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName())) - && (this.getPhone() == null ? other.getPhone() == null : this.getPhone().equals(other.getPhone())) - && (this.getGrade() == null ? other.getGrade() == null : this.getGrade().equals(other.getGrade())) - && (this.getWechatNum() == null ? other.getWechatNum() == null : this.getWechatNum().equals(other.getWechatNum())) - && (this.getInviteUserId() == null ? other.getInviteUserId() == null : this.getInviteUserId().equals(other.getInviteUserId())) - && (this.getInviteTime() == null ? other.getInviteTime() == null : this.getInviteTime().equals(other.getInviteTime())) - && (this.getPartnerLevel() == null ? other.getPartnerLevel() == null : this.getPartnerLevel().equals(other.getPartnerLevel())) - && (this.getPartnerIncomePer() == null ? other.getPartnerIncomePer() == null : this.getPartnerIncomePer().equals(other.getPartnerIncomePer())) - && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) - && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) - && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) - && (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1())) - && (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2())) - && (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3())); - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); - result = prime * result + ((getHeadImg() == null) ? 0 : getHeadImg().hashCode()); - result = prime * result + ((getName() == null) ? 0 : getName().hashCode()); - result = prime * result + ((getPhone() == null) ? 0 : getPhone().hashCode()); - result = prime * result + ((getGrade() == null) ? 0 : getGrade().hashCode()); - result = prime * result + ((getWechatNum() == null) ? 0 : getWechatNum().hashCode()); - result = prime * result + ((getInviteUserId() == null) ? 0 : getInviteUserId().hashCode()); - result = prime * result + ((getInviteTime() == null) ? 0 : getInviteTime().hashCode()); - result = prime * result + ((getPartnerLevel() == null) ? 0 : getPartnerLevel().hashCode()); - result = prime * result + ((getPartnerIncomePer() == null) ? 0 : getPartnerIncomePer().hashCode()); - result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); - result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); - result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); - result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode()); - result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode()); - result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode()); - return result; - } - - @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(", headImg=").append(headImg); - sb.append(", name=").append(name); - sb.append(", phone=").append(phone); - sb.append(", grade=").append(grade); - sb.append(", wechatNum=").append(wechatNum); - sb.append(", inviteUserId=").append(inviteUserId); - sb.append(", inviteTime=").append(inviteTime); - sb.append(", partnerLevel=").append(partnerLevel); - sb.append(", partnerIncomePer=").append(partnerIncomePer); - sb.append(", status=").append(status); - sb.append(", createTime=").append(createTime); - sb.append(", updateTime=").append(updateTime); - sb.append(", ext1=").append(ext1); - sb.append(", ext2=").append(ext2); - sb.append(", ext3=").append(ext3); - sb.append(", serialVersionUID=").append(serialVersionUID); - sb.append("]"); - return sb.toString(); - } } \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/entity/BsUserExample.java b/service/src/main/java/com/hfkj/entity/BsUserExample.java index f305789..0526f1c 100644 --- a/service/src/main/java/com/hfkj/entity/BsUserExample.java +++ b/service/src/main/java/com/hfkj/entity/BsUserExample.java @@ -526,6 +526,286 @@ public class BsUserExample { return (Criteria) this; } + public Criteria andSpecialIdIsNull() { + addCriterion("special_id is null"); + return (Criteria) this; + } + + public Criteria andSpecialIdIsNotNull() { + addCriterion("special_id is not null"); + return (Criteria) this; + } + + public Criteria andSpecialIdEqualTo(String value) { + addCriterion("special_id =", value, "specialId"); + return (Criteria) this; + } + + public Criteria andSpecialIdNotEqualTo(String value) { + addCriterion("special_id <>", value, "specialId"); + return (Criteria) this; + } + + public Criteria andSpecialIdGreaterThan(String value) { + addCriterion("special_id >", value, "specialId"); + return (Criteria) this; + } + + public Criteria andSpecialIdGreaterThanOrEqualTo(String value) { + addCriterion("special_id >=", value, "specialId"); + return (Criteria) this; + } + + public Criteria andSpecialIdLessThan(String value) { + addCriterion("special_id <", value, "specialId"); + return (Criteria) this; + } + + public Criteria andSpecialIdLessThanOrEqualTo(String value) { + addCriterion("special_id <=", value, "specialId"); + return (Criteria) this; + } + + public Criteria andSpecialIdLike(String value) { + addCriterion("special_id like", value, "specialId"); + return (Criteria) this; + } + + public Criteria andSpecialIdNotLike(String value) { + addCriterion("special_id not like", value, "specialId"); + return (Criteria) this; + } + + public Criteria andSpecialIdIn(List values) { + addCriterion("special_id in", values, "specialId"); + return (Criteria) this; + } + + public Criteria andSpecialIdNotIn(List values) { + addCriterion("special_id not in", values, "specialId"); + return (Criteria) this; + } + + public Criteria andSpecialIdBetween(String value1, String value2) { + addCriterion("special_id between", value1, value2, "specialId"); + return (Criteria) this; + } + + public Criteria andSpecialIdNotBetween(String value1, String value2) { + addCriterion("special_id not between", value1, value2, "specialId"); + return (Criteria) this; + } + + public Criteria andWechatOpenIdIsNull() { + addCriterion("wechat_open_id is null"); + return (Criteria) this; + } + + public Criteria andWechatOpenIdIsNotNull() { + addCriterion("wechat_open_id is not null"); + return (Criteria) this; + } + + public Criteria andWechatOpenIdEqualTo(String value) { + addCriterion("wechat_open_id =", value, "wechatOpenId"); + return (Criteria) this; + } + + public Criteria andWechatOpenIdNotEqualTo(String value) { + addCriterion("wechat_open_id <>", value, "wechatOpenId"); + return (Criteria) this; + } + + public Criteria andWechatOpenIdGreaterThan(String value) { + addCriterion("wechat_open_id >", value, "wechatOpenId"); + return (Criteria) this; + } + + public Criteria andWechatOpenIdGreaterThanOrEqualTo(String value) { + addCriterion("wechat_open_id >=", value, "wechatOpenId"); + return (Criteria) this; + } + + public Criteria andWechatOpenIdLessThan(String value) { + addCriterion("wechat_open_id <", value, "wechatOpenId"); + return (Criteria) this; + } + + public Criteria andWechatOpenIdLessThanOrEqualTo(String value) { + addCriterion("wechat_open_id <=", value, "wechatOpenId"); + return (Criteria) this; + } + + public Criteria andWechatOpenIdLike(String value) { + addCriterion("wechat_open_id like", value, "wechatOpenId"); + return (Criteria) this; + } + + public Criteria andWechatOpenIdNotLike(String value) { + addCriterion("wechat_open_id not like", value, "wechatOpenId"); + return (Criteria) this; + } + + public Criteria andWechatOpenIdIn(List values) { + addCriterion("wechat_open_id in", values, "wechatOpenId"); + return (Criteria) this; + } + + public Criteria andWechatOpenIdNotIn(List values) { + addCriterion("wechat_open_id not in", values, "wechatOpenId"); + return (Criteria) this; + } + + public Criteria andWechatOpenIdBetween(String value1, String value2) { + addCriterion("wechat_open_id between", value1, value2, "wechatOpenId"); + return (Criteria) this; + } + + public Criteria andWechatOpenIdNotBetween(String value1, String value2) { + addCriterion("wechat_open_id not between", value1, value2, "wechatOpenId"); + return (Criteria) this; + } + + public Criteria andWechatUnionidIsNull() { + addCriterion("wechat_unionid is null"); + return (Criteria) this; + } + + public Criteria andWechatUnionidIsNotNull() { + addCriterion("wechat_unionid is not null"); + return (Criteria) this; + } + + public Criteria andWechatUnionidEqualTo(String value) { + addCriterion("wechat_unionid =", value, "wechatUnionid"); + return (Criteria) this; + } + + public Criteria andWechatUnionidNotEqualTo(String value) { + addCriterion("wechat_unionid <>", value, "wechatUnionid"); + return (Criteria) this; + } + + public Criteria andWechatUnionidGreaterThan(String value) { + addCriterion("wechat_unionid >", value, "wechatUnionid"); + return (Criteria) this; + } + + public Criteria andWechatUnionidGreaterThanOrEqualTo(String value) { + addCriterion("wechat_unionid >=", value, "wechatUnionid"); + return (Criteria) this; + } + + public Criteria andWechatUnionidLessThan(String value) { + addCriterion("wechat_unionid <", value, "wechatUnionid"); + return (Criteria) this; + } + + public Criteria andWechatUnionidLessThanOrEqualTo(String value) { + addCriterion("wechat_unionid <=", value, "wechatUnionid"); + return (Criteria) this; + } + + public Criteria andWechatUnionidLike(String value) { + addCriterion("wechat_unionid like", value, "wechatUnionid"); + return (Criteria) this; + } + + public Criteria andWechatUnionidNotLike(String value) { + addCriterion("wechat_unionid not like", value, "wechatUnionid"); + return (Criteria) this; + } + + public Criteria andWechatUnionidIn(List values) { + addCriterion("wechat_unionid in", values, "wechatUnionid"); + return (Criteria) this; + } + + public Criteria andWechatUnionidNotIn(List values) { + addCriterion("wechat_unionid not in", values, "wechatUnionid"); + return (Criteria) this; + } + + public Criteria andWechatUnionidBetween(String value1, String value2) { + addCriterion("wechat_unionid between", value1, value2, "wechatUnionid"); + return (Criteria) this; + } + + public Criteria andWechatUnionidNotBetween(String value1, String value2) { + addCriterion("wechat_unionid not between", value1, value2, "wechatUnionid"); + return (Criteria) this; + } + + public Criteria andElmPidIsNull() { + addCriterion("elm_pid is null"); + return (Criteria) this; + } + + public Criteria andElmPidIsNotNull() { + addCriterion("elm_pid is not null"); + return (Criteria) this; + } + + public Criteria andElmPidEqualTo(String value) { + addCriterion("elm_pid =", value, "elmPid"); + return (Criteria) this; + } + + public Criteria andElmPidNotEqualTo(String value) { + addCriterion("elm_pid <>", value, "elmPid"); + return (Criteria) this; + } + + public Criteria andElmPidGreaterThan(String value) { + addCriterion("elm_pid >", value, "elmPid"); + return (Criteria) this; + } + + public Criteria andElmPidGreaterThanOrEqualTo(String value) { + addCriterion("elm_pid >=", value, "elmPid"); + return (Criteria) this; + } + + public Criteria andElmPidLessThan(String value) { + addCriterion("elm_pid <", value, "elmPid"); + return (Criteria) this; + } + + public Criteria andElmPidLessThanOrEqualTo(String value) { + addCriterion("elm_pid <=", value, "elmPid"); + return (Criteria) this; + } + + public Criteria andElmPidLike(String value) { + addCriterion("elm_pid like", value, "elmPid"); + return (Criteria) this; + } + + public Criteria andElmPidNotLike(String value) { + addCriterion("elm_pid not like", value, "elmPid"); + return (Criteria) this; + } + + public Criteria andElmPidIn(List values) { + addCriterion("elm_pid in", values, "elmPid"); + return (Criteria) this; + } + + public Criteria andElmPidNotIn(List values) { + addCriterion("elm_pid not in", values, "elmPid"); + return (Criteria) this; + } + + public Criteria andElmPidBetween(String value1, String value2) { + addCriterion("elm_pid between", value1, value2, "elmPid"); + return (Criteria) this; + } + + public Criteria andElmPidNotBetween(String value1, String value2) { + addCriterion("elm_pid not between", value1, value2, "elmPid"); + return (Criteria) this; + } + public Criteria andInviteUserIdIsNull() { addCriterion("invite_user_id is null"); return (Criteria) this; From d800fb228893706708bea1095c64c72c9742f230 Mon Sep 17 00:00:00 2001 From: yuanye <418471657@qq.com> Date: Wed, 30 Oct 2024 16:35:16 +0800 Subject: [PATCH 2/2] Merge branch 'master' of http://gitea.dctpay.com/hurui/youtao --- .../com/hfkj/controller/GoodsController.java | 27 +++++++++++--- .../com/hfkj/controller/TestController.java | 21 +++++++++++ .../hfkj/controller/notify/TaoBaoNotify.java | 35 +++++++++---------- .../main/java/com/hfkj/dao/BsUserMapper.java | 17 +-------- .../java/com/hfkj/dao/BsUserSqlProvider.java | 19 +--------- .../src/main/java/com/hfkj/entity/BsUser.java | 8 ++--- .../java/com/hfkj/entity/BsUserExample.java | 3 -- 7 files changed, 65 insertions(+), 65 deletions(-) diff --git a/cweb/src/main/java/com/hfkj/controller/GoodsController.java b/cweb/src/main/java/com/hfkj/controller/GoodsController.java index 13524fa..4db9f6f 100644 --- a/cweb/src/main/java/com/hfkj/controller/GoodsController.java +++ b/cweb/src/main/java/com/hfkj/controller/GoodsController.java @@ -7,11 +7,13 @@ import com.hfkj.common.exception.SysCode; import com.hfkj.common.security.UserCenter; import com.hfkj.common.utils.ResponseMsgUtil; import com.hfkj.entity.BsOrder; +import com.hfkj.entity.BsUser; import com.hfkj.model.*; import com.hfkj.service.goods.GoodsDataService; import com.hfkj.service.order.BsOrderService; import com.hfkj.service.pdd.PddService; import com.hfkj.service.taobao.TaoBaoService; +import com.hfkj.service.user.BsUserService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; @@ -37,6 +39,8 @@ public class GoodsController { private GoodsDataService goodsDataService; @Autowired private UserCenter userCenter; + @Resource + private BsUserService bsUserService; @@ -147,12 +151,25 @@ public class GoodsController { @RequestMapping(value="/publisher",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "淘宝客-公用-私域用户备案") - public ResponseData publisher(@RequestParam(value = "token" , required = false) String token + public ResponseData publisher(@RequestParam(value = "code" , required = false) String code ) { try { + // 用户session + UserSessionObject userSession = userCenter.getSessionModel(UserSessionObject.class); + JSONObject tokenJson = TaoBaoService.getToken(code); + String token = tokenJson.getString("token_result"); + JSONObject tokenResult = JSONObject.parseObject(token); + + + JSONObject jsonObject = TaoBaoService.publisher(tokenResult.getString("access_token")); + String body = jsonObject.getString("body"); + JSONObject result = JSONObject.parseObject(body); + + BsUser user = bsUserService.getUser(userSession.getUser().getId()); + user.setSpecialId(result.getJSONObject("data").getString("relation_id")); + bsUserService.updateInfo(user); - JSONObject jsonObject = TaoBaoService.publisher(token); - return ResponseMsgUtil.success(jsonObject); + return ResponseMsgUtil.success("绑定成功"); } catch (Exception e) { log.error("error!",e); @@ -168,7 +185,9 @@ public class GoodsController { try { JSONObject jsonObject = TaoBaoService.getToken(code); - return ResponseMsgUtil.success(jsonObject); + String token = jsonObject.getString("token_result"); + JSONObject tokenResult = JSONObject.parseObject(token); + return ResponseMsgUtil.success(tokenResult); } catch (Exception e) { log.error("error!",e); diff --git a/cweb/src/main/java/com/hfkj/controller/TestController.java b/cweb/src/main/java/com/hfkj/controller/TestController.java index 81dd1f3..a5e1ae3 100644 --- a/cweb/src/main/java/com/hfkj/controller/TestController.java +++ b/cweb/src/main/java/com/hfkj/controller/TestController.java @@ -5,6 +5,7 @@ import com.hfkj.common.exception.ErrorCode; import com.hfkj.common.exception.ErrorHelp; import com.hfkj.common.exception.SysCode; +import com.hfkj.common.utils.HttpsUtils; import com.hfkj.common.utils.ResponseMsgUtil; import com.hfkj.model.ResponseData; @@ -157,6 +158,7 @@ public class TestController { otherParam.put("sourceOrderNo", System.currentTimeMillis()); userContributeService.purchase(rebate, userId, otherParam); + return ResponseMsgUtil.success("操作成功"); } catch (Exception e) { @@ -165,6 +167,25 @@ public class TestController { } } + @RequestMapping(value="/authorize",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "获取淘宝code") + public ResponseData authorize() { + try { + + + JSONObject object = HttpsUtils.doGet("https://oauth.taobao.com/authorize?response_type=code&client_id=34807616&redirect_uri=https://yuanqiyoutao.com/crest/taoBaoNotify/notify&state=1212&view=wap"); + + + return ResponseMsgUtil.success(object); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + } diff --git a/cweb/src/main/java/com/hfkj/controller/notify/TaoBaoNotify.java b/cweb/src/main/java/com/hfkj/controller/notify/TaoBaoNotify.java index 75ec422..8dd3d2b 100644 --- a/cweb/src/main/java/com/hfkj/controller/notify/TaoBaoNotify.java +++ b/cweb/src/main/java/com/hfkj/controller/notify/TaoBaoNotify.java @@ -1,16 +1,15 @@ package com.hfkj.controller.notify; import com.alibaba.fastjson.JSONObject; +import com.hfkj.common.utils.HttpsUtils; +import com.hfkj.config.CommonSysConst; import com.hfkj.service.taobao.TaoBaoService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import java.io.PrintWriter; @@ -20,29 +19,29 @@ import java.io.PrintWriter; @Api(value = "淘宝业务通知") public class TaoBaoNotify { - private static Logger log = LoggerFactory.getLogger(TaoBaoService.class); + private static Logger log = LoggerFactory.getLogger(TaoBaoNotify.class); - @RequestMapping(value = "/notify", method = RequestMethod.POST) + @RequestMapping(value = "/notify", method = RequestMethod.GET) @ApiOperation(value = "回调") @ResponseBody - public void notify(@RequestBody String reqBodyStr, HttpServletResponse response) { + public void notify(@RequestParam("code") String code) { try { - JSONObject dataObject = JSONObject.parseObject(reqBodyStr, JSONObject.class); + System.out.println("============token回调任务Start============="); + System.out.println("============token回调任务code=============" + code); + JSONObject object = new JSONObject(); + object.put("code", code); +// JSONObject jsonObject = TaoBaoService.getToken(code); +// if (jsonObject.getBoolean("success")) { +// String token = jsonObject.getString("token_result"); +// JSONObject tokenResult = JSONObject.parseObject(token); +// System.out.println("============token回调任务jsonObject=============" + tokenResult); +// } - log.info("============淘宝回调任务Start============="); - log.info("淘宝-回调参数: " + dataObject); - log.info("============淘宝回调任务End============="); - - - response.setCharacterEncoding("UTF-8"); - response.setContentType("text/html;charset=utf-8"); - PrintWriter writer= response.getWriter(); - writer.write("SUCCESS"); } catch (Exception e) { - log.error("WechatPayController --> wechatNotify() error!", e); + log.error("TaoBaoNotify --> notify() error!", e); } } } diff --git a/service/src/main/java/com/hfkj/dao/BsUserMapper.java b/service/src/main/java/com/hfkj/dao/BsUserMapper.java index 8b5cb9c..b82a0f9 100644 --- a/service/src/main/java/com/hfkj/dao/BsUserMapper.java +++ b/service/src/main/java/com/hfkj/dao/BsUserMapper.java @@ -41,7 +41,6 @@ public interface BsUserMapper extends BsUserMapperExt { @Insert({ "insert into bs_user (head_img, `name`, ", "phone, grade, wechat_num, ", -<<<<<<< HEAD "special_id, wechat_open_id, ", "wechat_unionid, elm_pid, ", "invite_user_id, invite_time, ", @@ -57,8 +56,7 @@ public interface BsUserMapper extends BsUserMapperExt { "#{partnerLevel,jdbcType=INTEGER}, #{partnerIncomePer,jdbcType=DECIMAL}, ", "#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ", "#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ", - "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" -======= + "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})", "wechat_open_id, wechat_unionid, ", "elm_pid, invite_user_id, ", "invite_time, partner_level, ", @@ -73,7 +71,6 @@ public interface BsUserMapper extends BsUserMapperExt { "#{partnerIncomePer,jdbcType=DECIMAL}, #{status,jdbcType=INTEGER}, ", "#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ", "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" ->>>>>>> 9fd569d446b9f1a74c4b28147a3572ee8a076825 }) @Options(useGeneratedKeys=true,keyProperty="id") int insert(BsUser record); @@ -90,10 +87,7 @@ public interface BsUserMapper extends BsUserMapperExt { @Result(column="phone", property="phone", jdbcType=JdbcType.VARCHAR), @Result(column="grade", property="grade", jdbcType=JdbcType.INTEGER), @Result(column="wechat_num", property="wechatNum", jdbcType=JdbcType.VARCHAR), -<<<<<<< HEAD @Result(column="special_id", property="specialId", jdbcType=JdbcType.VARCHAR), -======= ->>>>>>> 9fd569d446b9f1a74c4b28147a3572ee8a076825 @Result(column="wechat_open_id", property="wechatOpenId", jdbcType=JdbcType.VARCHAR), @Result(column="wechat_unionid", property="wechatUnionid", jdbcType=JdbcType.VARCHAR), @Result(column="elm_pid", property="elmPid", jdbcType=JdbcType.VARCHAR), @@ -112,15 +106,12 @@ public interface BsUserMapper extends BsUserMapperExt { @Select({ "select", -<<<<<<< HEAD "id, head_img, `name`, phone, grade, wechat_num, special_id, wechat_open_id, ", "wechat_unionid, elm_pid, invite_user_id, invite_time, partner_level, partner_income_per, ", "`status`, create_time, update_time, ext_1, ext_2, ext_3", -======= "id, head_img, `name`, phone, grade, wechat_num, wechat_open_id, wechat_unionid, ", "elm_pid, invite_user_id, invite_time, partner_level, partner_income_per, `status`, ", "create_time, update_time, ext_1, ext_2, ext_3", ->>>>>>> 9fd569d446b9f1a74c4b28147a3572ee8a076825 "from bs_user", "where id = #{id,jdbcType=BIGINT}" }) @@ -131,10 +122,7 @@ public interface BsUserMapper extends BsUserMapperExt { @Result(column="phone", property="phone", jdbcType=JdbcType.VARCHAR), @Result(column="grade", property="grade", jdbcType=JdbcType.INTEGER), @Result(column="wechat_num", property="wechatNum", jdbcType=JdbcType.VARCHAR), -<<<<<<< HEAD @Result(column="special_id", property="specialId", jdbcType=JdbcType.VARCHAR), -======= ->>>>>>> 9fd569d446b9f1a74c4b28147a3572ee8a076825 @Result(column="wechat_open_id", property="wechatOpenId", jdbcType=JdbcType.VARCHAR), @Result(column="wechat_unionid", property="wechatUnionid", jdbcType=JdbcType.VARCHAR), @Result(column="elm_pid", property="elmPid", jdbcType=JdbcType.VARCHAR), @@ -167,10 +155,7 @@ public interface BsUserMapper extends BsUserMapperExt { "phone = #{phone,jdbcType=VARCHAR},", "grade = #{grade,jdbcType=INTEGER},", "wechat_num = #{wechatNum,jdbcType=VARCHAR},", -<<<<<<< HEAD "special_id = #{specialId,jdbcType=VARCHAR},", -======= ->>>>>>> 9fd569d446b9f1a74c4b28147a3572ee8a076825 "wechat_open_id = #{wechatOpenId,jdbcType=VARCHAR},", "wechat_unionid = #{wechatUnionid,jdbcType=VARCHAR},", "elm_pid = #{elmPid,jdbcType=VARCHAR},", diff --git a/service/src/main/java/com/hfkj/dao/BsUserSqlProvider.java b/service/src/main/java/com/hfkj/dao/BsUserSqlProvider.java index 7cf9f7a..aa32fd1 100644 --- a/service/src/main/java/com/hfkj/dao/BsUserSqlProvider.java +++ b/service/src/main/java/com/hfkj/dao/BsUserSqlProvider.java @@ -48,13 +48,10 @@ public class BsUserSqlProvider { sql.VALUES("wechat_num", "#{wechatNum,jdbcType=VARCHAR}"); } -<<<<<<< HEAD if (record.getSpecialId() != null) { sql.VALUES("special_id", "#{specialId,jdbcType=VARCHAR}"); } -======= ->>>>>>> 9fd569d446b9f1a74c4b28147a3572ee8a076825 if (record.getWechatOpenId() != null) { sql.VALUES("wechat_open_id", "#{wechatOpenId,jdbcType=VARCHAR}"); } @@ -122,10 +119,7 @@ public class BsUserSqlProvider { sql.SELECT("phone"); sql.SELECT("grade"); sql.SELECT("wechat_num"); -<<<<<<< HEAD sql.SELECT("special_id"); -======= ->>>>>>> 9fd569d446b9f1a74c4b28147a3572ee8a076825 sql.SELECT("wechat_open_id"); sql.SELECT("wechat_unionid"); sql.SELECT("elm_pid"); @@ -179,14 +173,9 @@ public class BsUserSqlProvider { if (record.getWechatNum() != null) { sql.SET("wechat_num = #{record.wechatNum,jdbcType=VARCHAR}"); } - -<<<<<<< HEAD if (record.getSpecialId() != null) { sql.SET("special_id = #{record.specialId,jdbcType=VARCHAR}"); } - -======= ->>>>>>> 9fd569d446b9f1a74c4b28147a3572ee8a076825 if (record.getWechatOpenId() != null) { sql.SET("wechat_open_id = #{record.wechatOpenId,jdbcType=VARCHAR}"); } @@ -253,10 +242,7 @@ public class BsUserSqlProvider { sql.SET("phone = #{record.phone,jdbcType=VARCHAR}"); sql.SET("grade = #{record.grade,jdbcType=INTEGER}"); sql.SET("wechat_num = #{record.wechatNum,jdbcType=VARCHAR}"); -<<<<<<< HEAD sql.SET("special_id = #{record.specialId,jdbcType=VARCHAR}"); -======= ->>>>>>> 9fd569d446b9f1a74c4b28147a3572ee8a076825 sql.SET("wechat_open_id = #{record.wechatOpenId,jdbcType=VARCHAR}"); sql.SET("wechat_unionid = #{record.wechatUnionid,jdbcType=VARCHAR}"); sql.SET("elm_pid = #{record.elmPid,jdbcType=VARCHAR}"); @@ -300,13 +286,10 @@ public class BsUserSqlProvider { sql.SET("wechat_num = #{wechatNum,jdbcType=VARCHAR}"); } -<<<<<<< HEAD if (record.getSpecialId() != null) { sql.SET("special_id = #{specialId,jdbcType=VARCHAR}"); } - -======= ->>>>>>> 9fd569d446b9f1a74c4b28147a3572ee8a076825 + if (record.getWechatOpenId() != null) { sql.SET("wechat_open_id = #{wechatOpenId,jdbcType=VARCHAR}"); } diff --git a/service/src/main/java/com/hfkj/entity/BsUser.java b/service/src/main/java/com/hfkj/entity/BsUser.java index 3721e1e..4b28b75 100644 --- a/service/src/main/java/com/hfkj/entity/BsUser.java +++ b/service/src/main/java/com/hfkj/entity/BsUser.java @@ -158,7 +158,6 @@ public class BsUser implements Serializable { this.wechatNum = wechatNum; } -<<<<<<< HEAD public String getSpecialId() { return specialId; } @@ -167,8 +166,6 @@ public class BsUser implements Serializable { this.specialId = specialId; } -======= ->>>>>>> 9fd569d446b9f1a74c4b28147a3572ee8a076825 public String getWechatOpenId() { return wechatOpenId; } @@ -272,8 +269,7 @@ public class BsUser implements Serializable { public void setExt3(String ext3) { this.ext3 = ext3; } -<<<<<<< HEAD -======= + @Override public boolean equals(Object that) { @@ -363,5 +359,5 @@ public class BsUser implements Serializable { sb.append("]"); return sb.toString(); } ->>>>>>> 9fd569d446b9f1a74c4b28147a3572ee8a076825 + } \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/entity/BsUserExample.java b/service/src/main/java/com/hfkj/entity/BsUserExample.java index a63057a..0526f1c 100644 --- a/service/src/main/java/com/hfkj/entity/BsUserExample.java +++ b/service/src/main/java/com/hfkj/entity/BsUserExample.java @@ -526,7 +526,6 @@ public class BsUserExample { return (Criteria) this; } -<<<<<<< HEAD public Criteria andSpecialIdIsNull() { addCriterion("special_id is null"); return (Criteria) this; @@ -597,8 +596,6 @@ public class BsUserExample { return (Criteria) this; } -======= ->>>>>>> 9fd569d446b9f1a74c4b28147a3572ee8a076825 public Criteria andWechatOpenIdIsNull() { addCriterion("wechat_open_id is null"); return (Criteria) this;