admin
2019-11-28 42c471753bc7bc8523c437e1066afb1781fa7991
京东短链解决,邀请码发布假用户增加
16个文件已修改
327 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ShareControllerV2.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/h5/H5RecommendController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/UserInfoMapper.java 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/integral/CodePublishRecordMapper.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/UserInfo.java 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/integral/CodePublishRecord.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/UserInfoMapper.xml 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/integral/CodePublishRecordMapper.xml 65 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderProcessServiceImpl.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserAccountServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserInfoServiceImpl.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/integral/CodePublishRecordServiceImpl.java 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserInfoService.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/integral/CodePublishRecordService.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/jd/JDApiUtil.java 62 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java
@@ -706,7 +706,7 @@
        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);
        }
@@ -1181,9 +1181,9 @@
            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();
@@ -1209,7 +1209,7 @@
        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);
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ShareControllerV2.java
@@ -617,7 +617,7 @@
            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);
@@ -1020,7 +1020,7 @@
            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);
fanli/src/main/java/com/yeshi/fanli/controller/h5/H5RecommendController.java
@@ -463,7 +463,7 @@
        }
        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();
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/UserInfoMapper.java
@@ -199,13 +199,24 @@
    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);
}
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/integral/CodePublishRecordMapper.java
@@ -1,5 +1,6 @@
package com.yeshi.fanli.dao.mybatis.integral;
import java.util.Date;
import java.util.List;
import org.apache.ibatis.annotations.Param;
@@ -11,13 +12,23 @@
    
    /**
     * 查询近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);
}
fanli/src/main/java/com/yeshi/fanli/entity/bus/user/UserInfo.java
@@ -79,9 +79,9 @@
    @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
@@ -126,7 +126,6 @@
    @Expose
    private String rankIcon;// 等级图标
    
    // 性别: 1-女  2-男
    @Transient
    @Expose
@@ -152,7 +151,6 @@
    @Transient
    @Expose
    private boolean vip;
    
    public boolean isVip() {
        return vip;
@@ -293,14 +291,6 @@
        this.appId = appId;
    }
    public String getTuiGuangCode() {
        return tuiGuangCode;
    }
    public void setTuiGuangCode(String tuiGuangCode) {
        this.tuiGuangCode = tuiGuangCode;
    }
    public Long getId() {
        return id;
    }
@@ -437,6 +427,14 @@
        this.weiXinTip = weiXinTip;
    }
    public Integer getType() {
        return type;
    }
    public void setType(Integer type) {
        this.type = type;
    }
    @Override
    public int hashCode() {
        final int prime = 31;
fanli/src/main/java/com/yeshi/fanli/entity/integral/CodePublishRecord.java
@@ -19,7 +19,7 @@
    private static final long serialVersionUID = 1L;
    
    // 发布有效时间
    // 发布有效时间 3天
    public static final long VALIDTIME  = 3*24*60*60;
    @Expose
fanli/src/main/java/com/yeshi/fanli/mapping/UserInfoMapper.xml
@@ -18,8 +18,7 @@
        <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" />
@@ -48,8 +47,7 @@
        <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" />
@@ -88,7 +86,7 @@
        <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"
@@ -117,9 +115,9 @@
    </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">
@@ -139,7 +137,7 @@
            <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>
@@ -165,7 +163,7 @@
            <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>
@@ -187,8 +185,8 @@
        #{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 =
@@ -213,7 +211,7 @@
            <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>
@@ -703,13 +701,33 @@
    
    <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}
        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.`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>
fanli/src/main/java/com/yeshi/fanli/mapping/integral/CodePublishRecordMapper.xml
@@ -2,64 +2,97 @@
<!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">
    <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">
    <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"/>
        <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 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
    <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>
        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
    <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}
        </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
        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}
        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}
        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}
        WHERE pr_uid = #{uid} AND TIMESTAMPDIFF(SECOND,`pr_create_time`,NOW())<![CDATA[<]]>
        #{validTime}
  </select>
  
</mapper>
fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderProcessServiceImpl.java
@@ -20,7 +20,6 @@
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;
@@ -89,7 +88,6 @@
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
@@ -740,7 +738,11 @@
        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);
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserAccountServiceImpl.java
@@ -670,6 +670,7 @@
        userInfoMapper.updateByPrimaryKeySelective(userInfo);
    }
    @Transactional
    @Override
    public void register(UserInfo userInfo) throws UserAccountException {
        if (!StringUtil.isNullOrEmpty(userInfo.getPhone())) {
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserInfoServiceImpl.java
@@ -650,10 +650,20 @@
        userInfoMapper.updateByPrimaryKeySelective(userInfo);
    }
    
    @Override
    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> getAutoExtractUser(int start, int count, BigDecimal minSurplus, String beganDate,String endDate) {
        return userInfoMapper.getAutoExtractUser(start, count, minSurplus, beganDate, endDate);
    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);
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/user/integral/CodePublishRecordServiceImpl.java
@@ -8,7 +8,9 @@
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;
@@ -21,6 +23,9 @@
    
    @Resource
    private ThreeSaleSerivce threeSaleSerivce;
    @Resource
    private UserInfoService userInfoService;
    @Override
    public CodePublishRecord selectByPrimaryKey(Long id) {
@@ -40,11 +45,11 @@
        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;
        }
@@ -76,19 +81,29 @@
            }
            codePublishRecord.setNickName(nickName);
            
            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);
    }
    
}
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserInfoService.java
@@ -182,12 +182,31 @@
     */
    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);
}
fanli/src/main/java/com/yeshi/fanli/service/inter/user/integral/CodePublishRecordService.java
@@ -1,5 +1,6 @@
package com.yeshi.fanli.service.inter.user.integral;
import java.util.Date;
import java.util.List;
import com.yeshi.fanli.entity.integral.CodePublishRecord;
@@ -8,24 +9,32 @@
    /**
     * 查询近3天发布记录
     *
     * @return
     */
    public List<CodePublishRecord> listValid(long start, int count);
    
    /**
     * 根据最小时间查询
     *
     * @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);
}
fanli/src/main/java/com/yeshi/fanli/util/jd/JDApiUtil.java
@@ -114,7 +114,7 @@
     * 
     * @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);
@@ -142,23 +142,37 @@
        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<>();
@@ -420,7 +434,9 @@
//                if (couponInfoList.size() > 0) {
//                    // 设置券信息为最接近的一个
//                    for (int i = couponInfoList.size() - 1; i >= 0; i--) {
//                        if (couponInfoList.get(i).getQuota().compareTo(goods.getPrice()) <= 0) {
                // if
                // (couponInfoList.get(i).getQuota().compareTo(goods.getPrice())
                // <= 0) {
//                            goods.setCouponInfo(couponInfoList.get(i));
//                            break;
//                        }
@@ -679,4 +695,14 @@
        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);
    }
}