| | |
| | | if (couponInfo != null) {
|
| | | // 券链接处理
|
| | | String materialId = "https://item.jd.com/" + id + ".html";
|
| | | String url = JDApiUtil.convertLink(materialId, couponInfo.getLink(), JDApiUtil.POSITION_COUPON + "", null);
|
| | | String url = JDApiUtil.convertLinkWithSubUnionId(materialId, couponInfo.getLink(), JDApiUtil.POSITION_COUPON + "", null);
|
| | | couponInfo.setLink(url);
|
| | | }
|
| | |
|
| | |
| | | if (couponInfo != null) {
|
| | | couponUrl = couponInfo.getLink();
|
| | | }
|
| | | jumpLink = JDApiUtil.convertLink(materialId, couponUrl, JDApiUtil.POSITION_FANLI + "", uid + "");
|
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, JDApiUtil.POSITION_FANLI + "", uid + "");
|
| | | } else {
|
| | | jumpLink = JDApiUtil.convertLink(materialId, couponUrl, JDApiUtil.POSITION_FANLI + "", uid + "");
|
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, JDApiUtil.POSITION_FANLI + "", uid + "");
|
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | |
| | | String jumpLink = null;
|
| | | String materialId = "https://item.jd.com/" + id + ".html";
|
| | |
|
| | | jumpLink = JDApiUtil.convertLink(materialId, couponUrl, JDApiUtil.POSITION_FANLI + "", null + "");
|
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, JDApiUtil.POSITION_FANLI + "", null);
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("native", true);
|
| | |
| | | couponUrl = couponInfo.getLink();
|
| | | }
|
| | | String materialId = "https://item.jd.com/" + goodsId + ".html";
|
| | | String jumpLink = JDApiUtil.convertShortLink(materialId, couponUrl, JDApiUtil.POSITION_SHARE + "", uid + "");
|
| | | String jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, JDApiUtil.POSITION_SHARE + "", uid + "");
|
| | |
|
| | | ShareInfoVO shareInfo = new ShareInfoVO();
|
| | | shareInfo.setClickUrl(jumpLink);
|
| | |
| | | couponUrl = couponInfo.getLink();
|
| | | }
|
| | | String materialId = "https://item.jd.com/" + goodsId + ".html";
|
| | | String shortLink = JDApiUtil.convertShortLink(materialId, couponUrl, JDApiUtil.POSITION_SHARE + "", uid + "");
|
| | | String shortLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, JDApiUtil.POSITION_SHARE + "", uid + "");
|
| | |
|
| | | String content = shareGoodsTextTemplateService.createContentByTemplateJD(template, uid, goods, shortLink,
|
| | | hasCoupon);
|
| | |
| | | }
|
| | |
|
| | | String materialId = "https://item.jd.com/" + id + ".html";
|
| | | String jumpLink = JDApiUtil.convertShortLink(materialId, couponUrl, JDApiUtil.POSITION_SHARE + "", uid);
|
| | | String jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, JDApiUtil.POSITION_SHARE + "", uid);
|
| | |
|
| | | int priceType = 1;
|
| | | BigDecimal price = jdGoods.getPrice();
|
| | |
| | |
|
| | | int insertSelective(UserInfo record);
|
| | |
|
| | | UserInfo selectByPrimaryKey(Long id);
|
| | | UserInfo selectByPrimaryKey(Long id);
|
| | |
|
| | | /**
|
| | | * 查询有效的
|
| | |
| | | List<UserInfo> listByClosed(@Param("appId") String appId, @Param("phone") String phone);
|
| | |
|
| | | long countAvaiableUser();
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 查询满足自动提现用户
|
| | | * |
| | | * @param start
|
| | | * @param count
|
| | | * @return
|
| | | */
|
| | | List<UserInfo> getAutoExtractUser(@Param("start") int start, @Param("count") int count, @Param("money") BigDecimal money,
|
| | | @Param("beganDate") String beganDate, @Param("endDate") String endDate);
|
| | | List<UserInfo> getAutoExtractUser(@Param("start") int start, @Param("count") int count,
|
| | | @Param("money") BigDecimal money, @Param("beganDate") String beganDate, @Param("endDate") String endDate);
|
| | |
|
| | | /**
|
| | | * 根据type检索
|
| | | * @param type
|
| | | * @param start
|
| | | * @param count
|
| | | * @return
|
| | | */
|
| | | List<UserInfo> listByType(@Param("type")int type,@Param("start") long start, @Param("count")int count);
|
| | |
|
| | | long countByType(int type);
|
| | | } |
| | |
| | | package com.yeshi.fanli.dao.mybatis.integral;
|
| | |
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import org.apache.ibatis.annotations.Param;
|
| | |
| | | import com.yeshi.fanli.entity.integral.CodePublishRecord;
|
| | |
|
| | | public interface CodePublishRecordMapper extends BaseMapper<CodePublishRecord> {
|
| | | |
| | |
|
| | | /**
|
| | | * 查询近3天发布记录
|
| | | * |
| | | * @return
|
| | | */
|
| | | List<CodePublishRecord> listValid(@Param("start") long start, @Param("count") int count, @Param("validTime")long validTime);
|
| | | |
| | | |
| | | List<CodePublishRecord> listValid(@Param("start") long start, @Param("count") int count,
|
| | | @Param("validTime") long validTime);
|
| | |
|
| | | /**
|
| | | * 根据最小时间查询
|
| | | * @param start
|
| | | * @param count
|
| | | * @param minTime
|
| | | * @return
|
| | | */
|
| | | List<CodePublishRecord> listByMinTime(@Param("start") long start, @Param("count") int count,
|
| | | @Param("minTime") Date minTime);
|
| | |
|
| | | long countValid(@Param("validTime") long validTime);
|
| | | |
| | | |
| | |
|
| | | long countValidRecord(@Param("uid") long uid, @Param("validTime") long validTime);
|
| | | } |
| | |
| | | @Expose
|
| | | private String lastLoginIp;// 最近一次登录IP
|
| | |
|
| | | @Column(name = "tuiguang_code")
|
| | | @Column(name = "type")
|
| | | @Expose
|
| | | private String tuiGuangCode;// 推广码
|
| | | private Integer type;// 用户类型 0-普通用户 1-虚拟用户
|
| | |
|
| | | @Column(name = "appid")
|
| | | @Expose
|
| | |
| | | @Transient
|
| | | @Expose
|
| | | private String rankIcon;// 等级图标
|
| | | |
| | |
|
| | | // 性别: 1-女 2-男
|
| | | // 性别: 1-女 2-男
|
| | | @Transient
|
| | | @Expose
|
| | | private Integer sex;
|
| | | |
| | |
|
| | | // 微信号
|
| | | @Transient
|
| | | @Expose
|
| | | private String weiXin;
|
| | | |
| | |
|
| | | // 微信提示语
|
| | | @Transient
|
| | | @Expose
|
| | |
| | | private String rankNamePicture;// 等级名称图片
|
| | | @Transient
|
| | | private String taoBaoUid;// 淘宝的用户ID
|
| | | |
| | | //是否为VIP
|
| | |
|
| | | // 是否为VIP
|
| | | @Transient
|
| | | @Expose
|
| | | private boolean vip;
|
| | | |
| | | |
| | |
|
| | | public boolean isVip() {
|
| | | return vip;
|
| | | }
|
| | |
| | | this.appId = appId;
|
| | | }
|
| | |
|
| | | public String getTuiGuangCode() {
|
| | | return tuiGuangCode;
|
| | | }
|
| | |
|
| | | public void setTuiGuangCode(String tuiGuangCode) {
|
| | | this.tuiGuangCode = tuiGuangCode;
|
| | | }
|
| | |
|
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
| | | public void setPayPassword(String payPassword) {
|
| | | this.payPassword = payPassword;
|
| | | }
|
| | | |
| | |
|
| | | public Integer getSex() {
|
| | | return sex;
|
| | | }
|
| | |
| | | this.weiXinTip = weiXinTip;
|
| | | }
|
| | |
|
| | | public Integer getType() {
|
| | | return type;
|
| | | }
|
| | |
|
| | | public void setType(Integer type) {
|
| | | this.type = type;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public int hashCode() {
|
| | | final int prime = 31;
|
| | |
| | |
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | // 发布有效时间
|
| | | // 发布有效时间 3天
|
| | | public static final long VALIDTIME = 3*24*60*60;
|
| | |
|
| | | @Expose
|
| | |
| | | <result column="last_logintime" property="lastLoginTime"
|
| | | jdbcType="BIGINT" />
|
| | | <result column="loginip" property="lastLoginIp" jdbcType="VARCHAR" />
|
| | | <result column="tuiguang_code" property="tuiGuangCode"
|
| | | jdbcType="VARCHAR" />
|
| | | <result column="type" property="type" jdbcType="INTEGER" />
|
| | | <result column="appid" property="appId" jdbcType="VARCHAR" />
|
| | | <result column="my_hongBao" property="myHongBao" jdbcType="DECIMAL" />
|
| | | <result column="pay_password" property="payPassword" jdbcType="VARCHAR" />
|
| | |
| | | <result column="last_logintime" property="lastLoginTime"
|
| | | jdbcType="BIGINT" />
|
| | | <result column="loginip" property="lastLoginIp" jdbcType="VARCHAR" />
|
| | | <result column="tuiguang_code" property="tuiGuangCode"
|
| | | jdbcType="VARCHAR" />
|
| | | <result column="type" property="type" jdbcType="INTEGER" />
|
| | | <result column="appid" property="appId" jdbcType="VARCHAR" />
|
| | | <result column="my_hongBao" property="myHongBao" jdbcType="DECIMAL" />
|
| | | <result column="pay_password" property="payPassword" jdbcType="VARCHAR" />
|
| | |
| | | <result column="showDate" property="showDate" jdbcType="VARCHAR" />
|
| | | <result column="showValue" property="showValue" jdbcType="VARCHAR" />
|
| | | </resultMap>
|
| | | |
| | | <sql id="Base_Column_List">id,identifycode,login_type,wx_open_id,wx_union_id,nick_name,tbName,tbPic,wxName,wxPic,portrait,createtime,last_logintime,loginip,tuiguang_code,appid,my_hongBao,pay_password,sid,rank,phone,state,state_desc
|
| | |
|
| | | <sql id="Base_Column_List">id,identifycode,login_type,wx_open_id,wx_union_id,nick_name,tbName,tbPic,wxName,wxPic,portrait,createtime,last_logintime,loginip,type,appid,my_hongBao,pay_password,sid,rank,phone,state,state_desc
|
| | | </sql>
|
| | | <!-- 不能查询缓存 -->
|
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap"
|
| | |
| | | </delete>
|
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.UserInfo"
|
| | | useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user
|
| | | (id,identifycode,login_type,wx_open_id,wx_union_id,nick_name,tbName,tbPic,wxName,wxPic,portrait,createtime,last_logintime,loginip,tuiguang_code,appid,my_hongBao,pay_password,sid,rank,phone,state,state_desc)
|
| | | (id,identifycode,login_type,wx_open_id,wx_union_id,nick_name,tbName,tbPic,wxName,wxPic,portrait,createtime,last_logintime,loginip,type,appid,my_hongBao,pay_password,sid,rank,phone,state,state_desc)
|
| | | values
|
| | | (#{id,jdbcType=BIGINT},#{openid,jdbcType=VARCHAR},#{loginType,jdbcType=INTEGER},#{wxOpenId,jdbcType=VARCHAR},#{wxUnionId,jdbcType=VARCHAR},#{nickName,jdbcType=VARCHAR},#{tbName,jdbcType=VARCHAR},#{tbPic,jdbcType=VARCHAR},#{wxName,jdbcType=VARCHAR},#{wxPic,jdbcType=VARCHAR},#{portrait,jdbcType=VARCHAR},#{createtime,jdbcType=BIGINT},#{lastLoginTime,jdbcType=BIGINT},#{lastLoginIp,jdbcType=VARCHAR},#{tuiGuangCode,jdbcType=VARCHAR},#{appId,jdbcType=VARCHAR},#{myHongBao,jdbcType=DECIMAL},#{payPassword,jdbcType=VARCHAR},#{system.id,jdbcType=BIGINT},#{rank,jdbcType=INTEGER},#{phone,jdbcType=VARCHAR},#{state,jdbcType=INTEGER},#{stateDesc,jdbcType=VARCHAR})
|
| | | (#{id,jdbcType=BIGINT},#{openid,jdbcType=VARCHAR},#{loginType,jdbcType=INTEGER},#{wxOpenId,jdbcType=VARCHAR},#{wxUnionId,jdbcType=VARCHAR},#{nickName,jdbcType=VARCHAR},#{tbName,jdbcType=VARCHAR},#{tbPic,jdbcType=VARCHAR},#{wxName,jdbcType=VARCHAR},#{wxPic,jdbcType=VARCHAR},#{portrait,jdbcType=VARCHAR},#{createtime,jdbcType=BIGINT},#{lastLoginTime,jdbcType=BIGINT},#{lastLoginIp,jdbcType=VARCHAR},#{type,jdbcType=INTEGER},#{appId,jdbcType=VARCHAR},#{myHongBao,jdbcType=DECIMAL},#{payPassword,jdbcType=VARCHAR},#{system.id,jdbcType=BIGINT},#{rank,jdbcType=INTEGER},#{phone,jdbcType=VARCHAR},#{state,jdbcType=INTEGER},#{stateDesc,jdbcType=VARCHAR})
|
| | | </insert>
|
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.UserInfo"
|
| | | useGeneratedKeys="true" keyProperty="id">
|
| | |
| | | <if test="createtime != null">createtime,</if>
|
| | | <if test="lastLoginTime != null">last_logintime,</if>
|
| | | <if test="lastLoginIp != null">loginip,</if>
|
| | | <if test="tuiGuangCode != null">tuiguang_code,</if>
|
| | | <if test="type != null">type,</if>
|
| | | <if test="appId != null">appid,</if>
|
| | | <if test="myHongBao != null">my_hongBao,</if>
|
| | | <if test="payPassword != null">pay_password,</if>
|
| | |
| | | <if test="createtime != null">#{createtime,jdbcType=BIGINT},</if>
|
| | | <if test="lastLoginTime != null">#{lastLoginTime,jdbcType=BIGINT},</if>
|
| | | <if test="lastLoginIp != null">#{lastLoginIp,jdbcType=VARCHAR},</if>
|
| | | <if test="tuiGuangCode != null">#{tuiGuangCode,jdbcType=VARCHAR},</if>
|
| | | <if test="type != null">#{type,jdbcType=INTEGER},</if>
|
| | | <if test="appId != null">#{appId,jdbcType=VARCHAR},</if>
|
| | | <if test="myHongBao != null">#{myHongBao,jdbcType=DECIMAL},</if>
|
| | | <if test="payPassword != null">#{payPassword,jdbcType=VARCHAR},</if>
|
| | |
| | | #{portrait,jdbcType=VARCHAR},createtime =
|
| | | #{createtime,jdbcType=BIGINT},last_logintime =
|
| | | #{lastLoginTime,jdbcType=BIGINT},loginip =
|
| | | #{lastLoginIp,jdbcType=VARCHAR},tuiguang_code =
|
| | | #{tuiGuangCode,jdbcType=VARCHAR},appid =
|
| | | #{lastLoginIp,jdbcType=VARCHAR},type =
|
| | | #{type,jdbcType=INTEGER},appid =
|
| | | #{appId,jdbcType=VARCHAR},my_hongBao =
|
| | | #{myHongBao,jdbcType=DECIMAL},pay_password =
|
| | | #{payPassword,jdbcType=VARCHAR},sid =
|
| | |
| | | <if test="createtime != null">createtime=#{createtime,jdbcType=BIGINT},</if>
|
| | | <if test="lastLoginTime != null">last_logintime=#{lastLoginTime,jdbcType=BIGINT},</if>
|
| | | <if test="lastLoginIp != null">loginip=#{lastLoginIp,jdbcType=VARCHAR},</if>
|
| | | <if test="tuiGuangCode != null">tuiguang_code=#{tuiGuangCode,jdbcType=VARCHAR},</if>
|
| | | <if test="type != null">type=#{type,jdbcType=INTEGER},</if>
|
| | | <if test="appId != null">appid=#{appId,jdbcType=VARCHAR},</if>
|
| | | <if test="myHongBao != null">my_hongBao=#{myHongBao,jdbcType=DECIMAL},</if>
|
| | | <if test="payPassword != null">pay_password=#{payPassword,jdbcType=VARCHAR},</if>
|
| | |
| | | yeshi_ec_user u
|
| | | where u.state=0
|
| | | </select>
|
| | | |
| | |
|
| | | <select id="getAutoExtractUser" resultMap="BaseResultMap">
|
| | | SELECT u.* FROM `yeshi_ec_user_info_extra` t
|
| | | LEFT JOIN `yeshi_ec_user` u ON u.`id` = t.`uie_uid`
|
| | | WHERE t.`uie_auto_extract` = 1 AND t.uie_active_time <![CDATA[>=]]> #{beganDate} AND t.uie_active_time <![CDATA[<]]> #{endDate}
|
| | | AND (t.`uie_mark` IS NULL OR t.`uie_mark` = '') |
| | | AND u.`state` = 0 AND u.`my_hongBao` <![CDATA[>=]]> #{money} |
| | | AND u.`wx_open_id` IS NOT NULL AND LENGTH(TRIM(u.`wx_open_id`)) <![CDATA[>]]> 0
|
| | | AND u.`wx_open_id` NOT LIKE 'o_b9%'
|
| | | LEFT JOIN `yeshi_ec_user`
|
| | | u ON u.`id` = t.`uie_uid`
|
| | | WHERE t.`uie_auto_extract` = 1 AND
|
| | | t.uie_active_time <![CDATA[>=]]>
|
| | | #{beganDate} AND t.uie_active_time <![CDATA[<]]>
|
| | | #{endDate}
|
| | | AND (t.`uie_mark` IS NULL OR t.`uie_mark` = '')
|
| | | AND u.`state`
|
| | | = 0 AND u.`my_hongBao` <![CDATA[>=]]>
|
| | | #{money}
|
| | | AND u.`wx_open_id` IS NOT NULL AND
|
| | | LENGTH(TRIM(u.`wx_open_id`)) <![CDATA[>]]>
|
| | | 0
|
| | | AND u.`wx_open_id` NOT LIKE 'o_b9%'
|
| | | LIMIT #{start},#{count}
|
| | | </select>
|
| | |
|
| | |
|
| | | <select id="listByType" resultMap="BaseResultMap">
|
| | | select * from yeshi_ec_user u
|
| | | where u.type=#{type} limit #{start},#{count}
|
| | | </select>
|
| | |
|
| | | <select id="countByType" resultType="java.lang.Long"
|
| | | parameterType="java.lang.Integer">
|
| | | select count(*) from
|
| | | yeshi_ec_user u where u.type=#{0}
|
| | | </select>
|
| | |
|
| | | </mapper>
|
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
| | |
|
| | | <mapper namespace="com.yeshi.fanli.dao.mybatis.integral.CodePublishRecordMapper">
|
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.integral.CodePublishRecord">
|
| | | <id column="pr_id" property="id" jdbcType="BIGINT"/>
|
| | | <result column="pr_uid" property="uid" jdbcType="BIGINT"/>
|
| | | <result column="pr_create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
| | | </resultMap>
|
| | | |
| | | <resultMap id="BaseResultVOMap" type="com.yeshi.fanli.entity.integral.CodePublishRecord">
|
| | | <id column="pr_id" property="id" jdbcType="BIGINT"/>
|
| | | <result column="pr_uid" property="uid" jdbcType="BIGINT"/>
|
| | | <result column="pr_create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
| | | <result column="nick_name" property="nickName" jdbcType="VARCHAR"/>
|
| | | <result column="portrait" property="portrait" jdbcType="VARCHAR"/>
|
| | | <result column="uie_invite_code" property="inviteCode" jdbcType="VARCHAR"/>
|
| | | </resultMap>
|
| | | |
| | | <sql id="Base_Column_List">pr_id,pr_uid,pr_create_time</sql>
|
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
|
| | | <include refid="Base_Column_List"/>from yeshi_ec_code_publish_record where pr_id = #{id,jdbcType=BIGINT}
|
| | | </select>
|
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_code_publish_record where pr_id = #{id,jdbcType=BIGINT}</delete>
|
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.integral.CodePublishRecord" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_code_publish_record (pr_id,pr_uid,pr_create_time) values (#{id,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{createTime,jdbcType=TIMESTAMP})</insert>
|
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.integral.CodePublishRecord" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_code_publish_record
|
| | | <trim prefix="(" suffix=")" suffixOverrides=",">
|
| | | <if test="id != null">pr_id,</if>
|
| | | <if test="uid != null">pr_uid,</if>
|
| | | <if test="createTime != null">pr_create_time,</if>
|
| | | </trim>values
|
| | | <trim prefix="(" suffix=")" suffixOverrides=",">
|
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if>
|
| | | <if test="uid != null">#{uid,jdbcType=BIGINT},</if>
|
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
|
| | | </trim>
|
| | | </insert>
|
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.integral.CodePublishRecord">update yeshi_ec_code_publish_record set pr_uid = #{uid,jdbcType=BIGINT},pr_create_time = #{createTime,jdbcType=TIMESTAMP} where pr_id = #{id,jdbcType=BIGINT}</update>
|
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.integral.CodePublishRecord">update yeshi_ec_code_publish_record
|
| | | <set>
|
| | | <if test="uid != null">pr_uid=#{uid,jdbcType=BIGINT},</if>
|
| | | <if test="createTime != null">pr_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
|
| | | </set> where pr_id = #{id,jdbcType=BIGINT}
|
| | | </update>
|
| | | |
| | | <select id="listValid" resultMap="BaseResultVOMap">
|
| | | SELECT p.*,u.`nick_name`,u.`portrait`,e.`uie_invite_code` FROM yeshi_ec_code_publish_record p
|
| | | LEFT JOIN `yeshi_ec_user` u ON u.`id` = p.`pr_uid`
|
| | | LEFT JOIN `yeshi_ec_user_info_extra` e ON e.`uie_uid` = p.`pr_uid`
|
| | | WHERE TIMESTAMPDIFF(SECOND,p.`pr_create_time`,NOW())<![CDATA[<]]> #{validTime}
|
| | | ORDER BY p.`pr_create_time` DESC
|
| | | LIMIT #{start},#{count}
|
| | | </select>
|
| | | |
| | | <select id="countValid" resultType="Long">
|
| | | SELECT IFNULL(COUNT(pr_id),0) FROM yeshi_ec_code_publish_record
|
| | | WHERE TIMESTAMPDIFF(SECOND,`pr_create_time`,NOW())<![CDATA[<]]> #{validTime}
|
| | | </select>
|
| | | |
| | | <select id="countValidRecord" resultType="Long">
|
| | | SELECT IFNULL(COUNT(pr_id),0) FROM yeshi_ec_code_publish_record
|
| | | WHERE pr_uid = #{uid} AND TIMESTAMPDIFF(SECOND,`pr_create_time`,NOW())<![CDATA[<]]> #{validTime}
|
| | | </select>
|
| | | |
| | | <resultMap id="BaseResultMap"
|
| | | type="com.yeshi.fanli.entity.integral.CodePublishRecord">
|
| | | <id column="pr_id" property="id" jdbcType="BIGINT" />
|
| | | <result column="pr_uid" property="uid" jdbcType="BIGINT" />
|
| | | <result column="pr_create_time" property="createTime" jdbcType="TIMESTAMP" />
|
| | | </resultMap>
|
| | |
|
| | | <resultMap id="BaseResultVOMap"
|
| | | type="com.yeshi.fanli.entity.integral.CodePublishRecord">
|
| | | <id column="pr_id" property="id" jdbcType="BIGINT" />
|
| | | <result column="pr_uid" property="uid" jdbcType="BIGINT" />
|
| | | <result column="pr_create_time" property="createTime" jdbcType="TIMESTAMP" />
|
| | | <result column="nick_name" property="nickName" jdbcType="VARCHAR" />
|
| | | <result column="portrait" property="portrait" jdbcType="VARCHAR" />
|
| | | <result column="uie_invite_code" property="inviteCode"
|
| | | jdbcType="VARCHAR" />
|
| | | </resultMap>
|
| | |
|
| | | <sql id="Base_Column_List">pr_id,pr_uid,pr_create_time</sql>
|
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap"
|
| | | parameterType="java.lang.Long">
|
| | | select
|
| | | <include refid="Base_Column_List" />
|
| | | from yeshi_ec_code_publish_record where pr_id = #{id,jdbcType=BIGINT}
|
| | | </select>
|
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
|
| | | yeshi_ec_code_publish_record where pr_id = #{id,jdbcType=BIGINT}
|
| | | </delete>
|
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.integral.CodePublishRecord"
|
| | | useGeneratedKeys="true" keyProperty="id">insert into
|
| | | yeshi_ec_code_publish_record (pr_id,pr_uid,pr_create_time) values
|
| | | (#{id,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{createTime,jdbcType=TIMESTAMP})
|
| | | </insert>
|
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.integral.CodePublishRecord"
|
| | | useGeneratedKeys="true" keyProperty="id">
|
| | | insert into yeshi_ec_code_publish_record
|
| | | <trim prefix="(" suffix=")" suffixOverrides=",">
|
| | | <if test="id != null">pr_id,</if>
|
| | | <if test="uid != null">pr_uid,</if>
|
| | | <if test="createTime != null">pr_create_time,</if>
|
| | | </trim>
|
| | | values
|
| | | <trim prefix="(" suffix=")" suffixOverrides=",">
|
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if>
|
| | | <if test="uid != null">#{uid,jdbcType=BIGINT},</if>
|
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
|
| | | </trim>
|
| | | </insert>
|
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.integral.CodePublishRecord">update
|
| | | yeshi_ec_code_publish_record set pr_uid =
|
| | | #{uid,jdbcType=BIGINT},pr_create_time =
|
| | | #{createTime,jdbcType=TIMESTAMP} where pr_id = #{id,jdbcType=BIGINT}
|
| | | </update>
|
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.integral.CodePublishRecord">
|
| | | update yeshi_ec_code_publish_record
|
| | | <set>
|
| | | <if test="uid != null">pr_uid=#{uid,jdbcType=BIGINT},</if>
|
| | | <if test="createTime != null">pr_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
|
| | | </set>
|
| | | where pr_id = #{id,jdbcType=BIGINT}
|
| | | </update>
|
| | |
|
| | | <select id="listValid" resultMap="BaseResultVOMap">
|
| | | SELECT p.*,u.`nick_name`,u.`portrait`,e.`uie_invite_code` FROM
|
| | | yeshi_ec_code_publish_record p
|
| | | LEFT JOIN `yeshi_ec_user` u ON u.`id` = p.`pr_uid`
|
| | | LEFT JOIN `yeshi_ec_user_info_extra` e ON e.`uie_uid` = p.`pr_uid`
|
| | | WHERE TIMESTAMPDIFF(SECOND,p.`pr_create_time`,NOW())<![CDATA[<]]>
|
| | | #{validTime}
|
| | | ORDER BY p.`pr_create_time` DESC
|
| | | LIMIT #{start},#{count}
|
| | | </select>
|
| | |
|
| | |
|
| | | <select id="listByMinTime" resultMap="BaseResultMap">
|
| | | SELECT * FROM yeshi_ec_code_publish_record p where p.`pr_create_time` >=
|
| | | #{minTime}
|
| | | ORDER BY p.`pr_create_time` DESC
|
| | | LIMIT #{start},#{count}
|
| | | </select>
|
| | |
|
| | | <select id="countValid" resultType="Long">
|
| | | SELECT IFNULL(COUNT(pr_id),0) FROM yeshi_ec_code_publish_record
|
| | | WHERE TIMESTAMPDIFF(SECOND,`pr_create_time`,NOW())<![CDATA[<]]>
|
| | | #{validTime}
|
| | | </select>
|
| | |
|
| | | <select id="countValidRecord" resultType="Long">
|
| | | SELECT IFNULL(COUNT(pr_id),0) FROM yeshi_ec_code_publish_record
|
| | | WHERE pr_uid = #{uid} AND TIMESTAMPDIFF(SECOND,`pr_create_time`,NOW())<![CDATA[<]]>
|
| | | #{validTime}
|
| | | </select>
|
| | |
|
| | | </mapper>
|
| | |
| | |
|
| | | import com.aliyun.openservices.ons.api.Message;
|
| | | import com.aliyun.openservices.ons.api.Producer;
|
| | | import com.aliyun.openservices.ons.api.SendResult;
|
| | | import com.aliyun.openservices.ons.api.transaction.LocalTransactionExecuter;
|
| | | import com.aliyun.openservices.ons.api.transaction.TransactionProducer;
|
| | | import com.aliyun.openservices.ons.api.transaction.TransactionStatus;
|
| | |
| | | import com.yeshi.fanli.util.jd.JDApiUtil;
|
| | | import com.yeshi.fanli.util.pinduoduo.PinDuoDuoApiUtil;
|
| | | import com.yeshi.fanli.util.rocketmq.MQMsgBodyFactory;
|
| | | import com.yeshi.fanli.util.rocketmq.MQTagConstant;
|
| | | import com.yeshi.fanli.util.rocketmq.MQTopicName;
|
| | |
|
| | | @Service
|
| | |
| | | if (order.getValidCode() == 2)
|
| | | return;
|
| | |
|
| | | // 根据ext1与subUnionId跟单
|
| | | String uidStr = order.getExt1();
|
| | | if (StringUtil.isNullOrEmpty(uidStr))
|
| | | uidStr = order.getOrderItemList().get(0).getSubUnionId();
|
| | |
|
| | | Long uid = null;
|
| | | if (!StringUtil.isNullOrEmpty(uidStr) && NumberUtil.isNumeric(uidStr))
|
| | | uid = Long.parseLong(uidStr);
|
| | |
| | | userInfoMapper.updateByPrimaryKeySelective(userInfo);
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Override
|
| | | public void register(UserInfo userInfo) throws UserAccountException {
|
| | | if (!StringUtil.isNullOrEmpty(userInfo.getPhone())) {
|
| | |
| | | userInfo.setNickName(nickName);
|
| | | userInfoMapper.updateByPrimaryKeySelective(userInfo);
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public List<UserInfo> getAutoExtractUser(int start, int count, BigDecimal minSurplus, String beganDate,String endDate) {
|
| | | public List<UserInfo> getAutoExtractUser(int start, int count, BigDecimal minSurplus, String beganDate,
|
| | | String endDate) {
|
| | | return userInfoMapper.getAutoExtractUser(start, count, minSurplus, beganDate, endDate);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<UserInfo> listByType(int type, int page, int count) {
|
| | | return userInfoMapper.listByType(type, (page - 1) * count, count);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countByType(int type) {
|
| | | return userInfoMapper.countByType(type);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.integral.CodePublishRecordMapper;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.integral.CodePublishRecord;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.integral.CodePublishRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
| | |
|
| | | @Resource
|
| | | private CodePublishRecordMapper codePublishRecordMapper;
|
| | | |
| | |
|
| | | @Resource
|
| | | private ThreeSaleSerivce threeSaleSerivce;
|
| | |
|
| | | @Resource
|
| | | private UserInfoService userInfoService;
|
| | |
|
| | | @Override
|
| | | public CodePublishRecord selectByPrimaryKey(Long id) {
|
| | | return codePublishRecordMapper.selectByPrimaryKey(id);
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public void publishInviteCode(Long uid) {
|
| | | CodePublishRecord codePublishRecord = new CodePublishRecord();
|
| | |
| | | codePublishRecord.setCreateTime(new Date());
|
| | | codePublishRecordMapper.insertSelective(codePublishRecord);
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public long countValidRecord(Long uid){
|
| | | public long countValidRecord(Long uid) {
|
| | | return codePublishRecordMapper.countValidRecord(uid, CodePublishRecord.VALIDTIME);
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public List<CodePublishRecord> listValid(long start, int count) {
|
| | | |
| | | List<CodePublishRecord> listValid = codePublishRecordMapper.listValid(start, count, CodePublishRecord.VALIDTIME);
|
| | |
|
| | | List<CodePublishRecord> listValid = codePublishRecordMapper.listValid(start, count,
|
| | | CodePublishRecord.VALIDTIME);
|
| | | if (listValid == null || listValid.size() == 0) {
|
| | | return listValid;
|
| | | }
|
| | | |
| | | for (int i = 0; i < listValid.size(); i ++) {
|
| | |
|
| | | for (int i = 0; i < listValid.size(); i++) {
|
| | | CodePublishRecord codePublishRecord = listValid.get(i);
|
| | | String inviteCode = codePublishRecord.getInviteCode();
|
| | | if (StringUtil.isNullOrEmpty(inviteCode)) {
|
| | |
| | | i--;
|
| | | continue;
|
| | | }
|
| | | |
| | |
|
| | | String index = inviteCode.substring(0, 1);
|
| | | String end = inviteCode.substring(inviteCode.length()-1, inviteCode.length());
|
| | | String end = inviteCode.substring(inviteCode.length() - 1, inviteCode.length());
|
| | | codePublishRecord.setInviteCode("TA的邀请码:" + index + "****" + end);
|
| | | |
| | |
|
| | | String nickName = codePublishRecord.getNickName();
|
| | | if(StringUtil.isNullOrEmpty(nickName)) {
|
| | | if (StringUtil.isNullOrEmpty(nickName)) {
|
| | | nickName = "K****6";
|
| | | } else if (nickName.length() == 1) {
|
| | | // 一个字
|
| | |
| | | } else {
|
| | | // 两个字及其以上
|
| | | String index2 = nickName.substring(0, 1);
|
| | | String end2 = nickName.substring(nickName.length()-1, nickName.length());
|
| | | String end2 = nickName.substring(nickName.length() - 1, nickName.length());
|
| | | nickName = index2 + "****" + end2;
|
| | | }
|
| | | codePublishRecord.setNickName(nickName);
|
| | | |
| | | long firstTeam = threeSaleSerivce.countFirstTeam(codePublishRecord.getUid(), 1);
|
| | | long secondTeam = threeSaleSerivce.countSecondTeam(codePublishRecord.getUid(), 1);
|
| | | codePublishRecord.setTeam(firstTeam + secondTeam);
|
| | |
|
| | | UserInfo user = userInfoService.selectByPKey(codePublishRecord.getUid());
|
| | | if (user != null && user.getType() == 1) {// 假用户
|
| | | long s = Integer
|
| | | .parseInt((206 * (6365705L - codePublishRecord.getUid()) / (6365705L - 6315822L) + 82) + "");
|
| | | codePublishRecord.setTeam(s);
|
| | | } else {// 真用户
|
| | | long firstTeam = threeSaleSerivce.countFirstTeam(codePublishRecord.getUid(), 1);
|
| | | long secondTeam = threeSaleSerivce.countSecondTeam(codePublishRecord.getUid(), 1);
|
| | | codePublishRecord.setTeam(firstTeam + secondTeam);
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | return listValid;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<CodePublishRecord> listByMinTime(long start, int count, Date minTime) {
|
| | | return codePublishRecordMapper.listByMinTime(start, count, minTime);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countValid() {
|
| | | return codePublishRecordMapper.countValid(CodePublishRecord.VALIDTIME);
|
| | | }
|
| | |
|
| | | |
| | | }
|
| | |
| | | */
|
| | | public void saveUserInfo(String nickName, Long uid) throws UserInfoException;
|
| | |
|
| | | |
| | | /**
|
| | | * 获取可提现用户列表
|
| | | * |
| | | * @param page
|
| | | * @param count
|
| | | */
|
| | | public List<UserInfo> getAutoExtractUser(int page, int count, BigDecimal minSurplus, String beganDate,String endDate);
|
| | | public List<UserInfo> getAutoExtractUser(int page, int count, BigDecimal minSurplus, String beganDate,
|
| | | String endDate);
|
| | |
|
| | | /**
|
| | | * 根据类型获取
|
| | | * |
| | | * @param type
|
| | | * @param page
|
| | | * @param count
|
| | | * @return
|
| | | */
|
| | | public List<UserInfo> listByType(int type, int page, int count);
|
| | |
|
| | | /**
|
| | | * 根据类型计数
|
| | | * |
| | | * @param type
|
| | | * @return
|
| | | */
|
| | | public long countByType(int type);
|
| | |
|
| | | }
|
| | |
| | | package com.yeshi.fanli.service.inter.user.integral;
|
| | |
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.integral.CodePublishRecord;
|
| | |
| | |
|
| | | /**
|
| | | * 查询近3天发布记录
|
| | | * |
| | | * @return
|
| | | */
|
| | | public List<CodePublishRecord> listValid(long start, int count);
|
| | | |
| | | |
| | | public long countValid();
|
| | |
|
| | | /**
|
| | | * 根据最小时间查询
|
| | | * |
| | | * @param start
|
| | | * @param count
|
| | | * @param minTime
|
| | | * @return
|
| | | */
|
| | | public List<CodePublishRecord> listByMinTime(long start, int count, Date minTime);
|
| | |
|
| | | public long countValid();
|
| | |
|
| | | public CodePublishRecord selectByPrimaryKey(Long id);
|
| | |
|
| | |
|
| | | /**
|
| | | * 发布
|
| | | * |
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public void publishInviteCode(Long uid);
|
| | |
|
| | |
|
| | | public long countValidRecord(Long uid);
|
| | | }
|
| | |
| | | *
|
| | | * @return
|
| | | */
|
| | | public static String convertLink(String materialId, String couponUrl, String positionId, String ext1) {
|
| | | public static String convertLink1(String materialId, String couponUrl, String positionId, String ext1) {
|
| | | JSONObject json = new JSONObject();
|
| | | json.put("materialId", materialId);
|
| | | json.put("siteId", APP_ID);
|
| | |
| | | return resultJson.optJSONObject("data").optString("clickURL");
|
| | | }
|
| | |
|
| | | /**
|
| | | * 转链接-短连接
|
| | | * |
| | | * @param materialId
|
| | | * @param couponUrl
|
| | | * @param positionId
|
| | | * @param ext1
|
| | | * @return
|
| | | */
|
| | | public static String convertShortLink(String materialId, String couponUrl, String positionId, String ext1) {
|
| | | String url = convertLink(materialId, couponUrl, positionId, ext1);
|
| | | // 暂时注释
|
| | | // if (!StringUtil.isNullOrEmpty(url)) {
|
| | | // url = HttpUtil.getShortLink(url);
|
| | | // }
|
| | | return url;
|
| | | public static String convertLinkWithSubUnionId(String materialId, String couponUrl, String positionId,
|
| | | String subUnionId) {
|
| | | JSONObject json = new JSONObject();
|
| | | json.put("materialId", materialId);
|
| | | json.put("siteId", APP_ID);
|
| | | json.put("positionId", positionId);
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(couponUrl))
|
| | | json.put("couponUrl", couponUrl);
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(subUnionId))
|
| | | json.put("subUnionId", subUnionId);
|
| | | |
| | | //1:长链, 2 :短链 ,3: 长链+短链
|
| | | json.put("chainType", 3);
|
| | | JSONObject root = new JSONObject();
|
| | | root.put("promotionCodeReq", json);
|
| | |
|
| | | String result = baseRequest2("jd.union.open.promotion.bysubunionid.get", null, root);
|
| | |
|
| | | JSONObject resultJson = JSONObject.fromObject(result);
|
| | | result = resultJson.optJSONObject("jd_union_open_promotion_bysubunionid_get_response").optString("result");
|
| | | System.out.println(result);
|
| | | if (result == null) {
|
| | | return null;
|
| | | }
|
| | |
|
| | | resultJson = JSONObject.fromObject(result);
|
| | | return resultJson.optJSONObject("data").optString("shortURL");
|
| | | }
|
| | |
|
| | |
|
| | | public static JDGoods queryGoodsDetail(Long skuId) {
|
| | | List<Long> skuIdList = new ArrayList<>();
|
| | |
| | | }
|
| | | };
|
| | | Collections.sort(couponInfoList, cm);
|
| | | // if (couponInfoList.size() > 0) {
|
| | | // // 设置券信息为最接近的一个
|
| | | // for (int i = couponInfoList.size() - 1; i >= 0; i--) {
|
| | | // if (couponInfoList.get(i).getQuota().compareTo(goods.getPrice()) <= 0) {
|
| | | // goods.setCouponInfo(couponInfoList.get(i));
|
| | | // break;
|
| | | // }
|
| | | // }
|
| | | // if (goods.getCouponInfo() == null)
|
| | | // goods.setCouponInfo(couponInfoList.get(0));
|
| | | // }
|
| | | // |
| | | // if (couponInfoList.size() > 0) {
|
| | | // // 设置券信息为最接近的一个
|
| | | // for (int i = couponInfoList.size() - 1; i >= 0; i--) {
|
| | | // if
|
| | | // (couponInfoList.get(i).getQuota().compareTo(goods.getPrice())
|
| | | // <= 0) {
|
| | | // goods.setCouponInfo(couponInfoList.get(i));
|
| | | // break;
|
| | | // }
|
| | | // }
|
| | | // if (goods.getCouponInfo() == null)
|
| | | // goods.setCouponInfo(couponInfoList.get(0));
|
| | | // }
|
| | | //
|
| | | goods.setCouponInfoList(couponInfoList);
|
| | |
|
| | | }
|
| | |
| | | return null;
|
| | | }
|
| | |
|
| | | public static void test() {
|
| | | JSONObject json = new JSONObject();
|
| | | json.put("materialId", "https://item.jd.com/32376790478.html");
|
| | | json.put("ext1", "437032");
|
| | | JSONObject root = new JSONObject();
|
| | | root.put("promotionCodeReq", json);
|
| | | String result = baseRequest2("jd.union.open.promotion.bysubunionid.get", null, root);
|
| | | System.out.println(result);
|
| | | }
|
| | |
|
| | | }
|