1 文件已重命名
27个文件已修改
2个文件已添加
| | |
| | | @RequestMapping("threeShareNew")
|
| | | public String threeShareNew(HttpServletRequest request, HttpSession session, HttpServletResponse response,
|
| | | long uid) {
|
| | | String serverName = request.getServerName();
|
| | | String contextPath = request.getContextPath();
|
| | | UserInfo userInfo = userInfoService.getUserById(uid);
|
| | | if (userInfo == null) {
|
| | | return "share/error";
|
| | |
| | | : DeviceActive.PLATFORM_IOS);
|
| | | da.setVersionCode(Integer.parseInt(acceptData.getVersion()));
|
| | | da.setIpInfo(ipInfo);
|
| | | da.setChannel(acceptData.getChannel());
|
| | | deviceActiveService.addDeviceActive(da);
|
| | | } catch (Exception e) {
|
| | | }
|
| | |
| | | userActiveLog.setVersionCode(acceptData.getVersion());
|
| | | userActiveLog.setOsVersion(acceptData.getOsVersion());
|
| | | userActiveLog.setDeviceType(acceptData.getDeviceType());
|
| | | userActiveLog.setDevice(acceptData.getDevice());
|
| | | |
| | | userActiveLogService.addUserActiveLog(userActiveLog);
|
| | |
|
| | | outUserInfo(acceptData, out, remotIP, find, acceptData.getDevice());
|
| | |
| | | if (userInfoExtra != null && !StringUtil.isNullOrEmpty(userInfoExtra.getWeiXin())) {
|
| | | object.put("weiXin", userInfoExtra.getWeiXin());
|
| | | object.put("weiXinState", 3);
|
| | | object.put("weiXinTip", "添加TA的微信,你可教授TA如何通过返利券赚钱技巧。");
|
| | | object.put("weiXinTip", "添加TA的微信,你可教授TA如何通过板栗快省赚钱技巧。");
|
| | | } else {
|
| | | if (!threeSaleExtraInfoSerivce.isRemindWorker(uid, workerId)) {
|
| | | object.put("weiXinState", 1);
|
| | |
| | | if (userInfoExtra != null && !StringUtil.isNullOrEmpty(userInfoExtra.getWeiXin())) {
|
| | | bossData.put("weiXin", userInfoExtra.getWeiXin());
|
| | | bossData.put("weiXinState", 3);
|
| | | bossData.put("weiXinTip", "添加TA的微信,你可向TA学习如何通过返利券赚钱。");
|
| | | bossData.put("weiXinTip", "添加TA的微信,你可向TA学习如何通过板栗快省赚钱。");
|
| | | } else {
|
| | | if (!threeSaleExtraInfoSerivce.isRemindBoss(boss.getId(), uid)) {
|
| | | bossData.put("weiXinState", 1);
|
| | |
| | | return findOne(query);
|
| | | }
|
| | |
|
| | | public DouYinClickEvent selectByAndroidId(String androidId) {
|
| | | Query query = new Query();
|
| | | query.addCriteria(Criteria.where("androidId").is(androidId));
|
| | | return findOne(query);
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.dto.ad;
|
| | |
|
| | | /**
|
| | | * 抖音广告与设备处理队列
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | public class DouYinDeviceActiveQueueDTO {
|
| | | public final static int TYPE_AD = 1;
|
| | | public final static int TYPE_DEVICE = 2;
|
| | |
|
| | | private int type;
|
| | | private String aid;
|
| | | private String device;
|
| | | private int platform;
|
| | | |
| | | public DouYinDeviceActiveQueueDTO() {
|
| | | }
|
| | |
|
| | | public DouYinDeviceActiveQueueDTO(int type, String aid) {
|
| | | this.type = type;
|
| | | this.aid = aid;
|
| | | }
|
| | |
|
| | | public DouYinDeviceActiveQueueDTO(int type, String device, int platform) {
|
| | | this.type = type;
|
| | | this.device = device;
|
| | | this.platform = platform;
|
| | | }
|
| | |
|
| | | public int getPlatform() {
|
| | | return platform;
|
| | | }
|
| | |
|
| | | public void setPlatform(int platform) {
|
| | | this.platform = platform;
|
| | | }
|
| | |
|
| | | public int getType() {
|
| | | return type;
|
| | | }
|
| | |
|
| | | public void setType(int type) {
|
| | | this.type = type;
|
| | | }
|
| | |
|
| | | public String getAid() {
|
| | | return aid;
|
| | | }
|
| | |
|
| | | public void setAid(String aid) {
|
| | | this.aid = aid;
|
| | | }
|
| | |
|
| | | public String getDevice() {
|
| | | return device;
|
| | | }
|
| | |
|
| | | public void setDevice(String device) {
|
| | | this.device = device;
|
| | | }
|
| | | }
|
File was renamed from fanli/src/main/java/com/yeshi/fanli/dto/ad/DouYinUserActionInfo.java |
| | |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | public class DouYinUserActionInfo {
|
| | | public class DouYinUserActionInfoDTO {
|
| | |
|
| | | // 0: 激活
|
| | | // 1: 注册
|
| | |
| | | private long convTime;// UTC时间戳
|
| | | private int eventType;
|
| | |
|
| | | public DouYinUserActionInfo(String callback, String muid, int os, long convTime,
|
| | | public DouYinUserActionInfoDTO(String callback, String muid, int os, long convTime,
|
| | | int eventType) {
|
| | | this.callback = callback;
|
| | | this.muid = muid;
|
| | |
| | | this.eventType = eventType;
|
| | | }
|
| | |
|
| | | public DouYinUserActionInfo() {
|
| | | public DouYinUserActionInfoDTO() {
|
| | | }
|
| | |
|
| | | public String getCallback() {
|
| | |
| | | */
|
| | | @Table("yeshi_ec_log_user_active")
|
| | | public class UserActiveLog {
|
| | | @Column(name = "ual_id")
|
| | | @Column(name = "lua_id")
|
| | | private Long id;
|
| | | @Column(name = "ual_uid")
|
| | | @Column(name = "lua_uid")
|
| | | private Long uid;
|
| | | @Column(name = "lua_ip")
|
| | | private String ip;
|
| | |
| | | private String deviceType;
|
| | | @Column(name = "lua_os_version")
|
| | | private String osVersion;
|
| | | @Column(name = "lua_device")
|
| | | private String device;//设备号
|
| | |
|
| | | public String getDevice() {
|
| | | return device;
|
| | | }
|
| | |
|
| | | public void setDevice(String device) {
|
| | | this.device = device;
|
| | | }
|
| | |
|
| | | public String getDeviceType() {
|
| | | return deviceType;
|
| | |
| | | private Date updateTime;
|
| | | @Column(name = "da_ip")
|
| | | private String ipInfo;
|
| | | @Column(name = "da_channel")
|
| | | private String channel;// 渠道
|
| | |
|
| | | public String getChannel() {
|
| | | return channel;
|
| | | }
|
| | |
|
| | | public void setChannel(String channel) {
|
| | | this.channel = channel;
|
| | | }
|
| | |
|
| | | public String getIpInfo() {
|
| | | return ipInfo;
|
| | |
| | | InputStream cer = null;
|
| | |
|
| | | int p = deviceList.size() / 50 + 1;
|
| | | JSONObject json = IOSPushFactory.createURLPush("https://0x9.me/TusaI", "返利券苹果端进行了重大更新!请立即升级",
|
| | | "更多优惠券,更高返利,尽在新版苹果端返利券!");
|
| | | JSONObject json = IOSPushFactory.createURLPush("https://0x9.me/TusaI", "板栗快省苹果端进行了重大更新!请立即升级",
|
| | | "更多优惠券,更高返利,尽在新版苹果端板栗快省!");
|
| | | for (int i = 0; i < p; i++) {
|
| | | cer = this.getClass().getClassLoader().getResourceAsStream("certificate/老版本-生产证书.p12");
|
| | | try {
|
| | |
| | | <include refid="Base_Column_List" />
|
| | | from yeshi_ec_user where id = #{id,jdbcType=BIGINT}
|
| | | </select>
|
| | | |
| | | <!-- 不能查询缓存 -->
|
| | |
|
| | | <!-- 不能查询缓存 -->
|
| | | <select id="selectAvailableByPrimaryKey" resultMap="BaseResultMap"
|
| | | parameterType="java.lang.Long" flushCache="true" useCache="false">
|
| | | select
|
| | |
| | | from yeshi_ec_user where appid=#{appId} and identifycode=#{openId}
|
| | | </select>
|
| | | <!-- 根据AppId与电话号码获取用户 -->
|
| | | <select id="listByAppIdAndPhone" resultMap="BaseResultMap">
|
| | | <select id="listByAppIdAndPhone" resultMap="BaseResultMap"
|
| | | useCache="false" flushCache="true">
|
| | | select
|
| | | <include refid="Base_Column_List" />
|
| | | from yeshi_ec_user where appid=#{appId} and phone=#{phone}
|
| | |
| | | uf.`uie_invite_code` = #{inviteCode})
|
| | | LIMIT 1
|
| | | </select>
|
| | | |
| | | |
| | |
|
| | |
|
| | | <select id="countAvaiableUser" resultType="java.lang.Long">
|
| | | SELECT count(*) FROM
|
| | | yeshi_ec_user u
|
| | |
| | | from yeshi_ec_msg_device_read_state where mdrs_id = |
| | | #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <select id="selectByDeviceAndPlatformAndType" resultMap="BaseResultMap"> |
| | | <select id="selectByDeviceAndPlatformAndType" resultMap="BaseResultMap" useCache="false" flushCache="true"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_msg_device_read_state where mdrs_device=#{device} and |
| | | mdrs_platform=#{platform} and mdrs_type=#{type} |
| | | </select> |
| | | <select id="listByDeviceAndPlatform" resultMap="BaseResultMap"> |
| | | <select id="listByDeviceAndPlatform" resultMap="BaseResultMap" useCache="false" flushCache="true"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_msg_device_read_state where mdrs_device=#{device} and |
| | |
| | | <result column="da_createtime" property="createTime" jdbcType="TIMESTAMP" /> |
| | | <result column="da_updatetime" property="updateTime" jdbcType="TIMESTAMP" /> |
| | | <result column="da_ip" property="ipInfo" jdbcType="VARCHAR" /> |
| | | <result column="da_channel" property="channel" jdbcType="VARCHAR" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">da_id,da_platform,da_device,da_device_token_md5,da_device_token,da_version_code,da_createtime,da_updatetime,da_ip |
| | | </sql> |
| | | <sql id="Base_Column_List">da_id,da_platform,da_device,da_device_token_md5,da_device_token,da_version_code,da_createtime,da_updatetime,da_ip,da_channel</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_device_active where da_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | |
| | | <select id="selectByDeviceAndPlatform" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_device_active where da_device = #{device} and |
| | | da_platform=#{platform} order by da_id desc limit 1 |
| | | da_platform=#{platform} order by da_id desc limit 1 |
| | | </select> |
| | | |
| | | <select id="selectFirstByDeviceAndPlatform" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_device_active where da_device = #{device} and |
| | | da_platform=#{platform} limit 1 |
| | | </select> |
| | | |
| | | <select id="selectByDeviceToeknMd5AndPlatform" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_device_active where da_device_token_md5 = |
| | | #{deviceTokenMd5} and da_platform=#{platform} |
| | | </select> |
| | | |
| | | |
| | | <select id="selectFirst" resultMap="BaseResultMap" parameterType="java.lang.String"> |
| | | <select id="selectFirst" resultMap="BaseResultMap" |
| | | parameterType="java.lang.String"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_device_active where da_device = |
| | | #{0} order by da_id limit 1 |
| | | from yeshi_ec_device_active where da_device = #{0} order by da_id |
| | | limit 1 |
| | | </select> |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
| | | yeshi_ec_device_active where da_id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | yeshi_ec_device_active where da_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.push.DeviceActive" |
| | | useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_device_active |
| | | (da_id,da_platform,da_device,da_device_token_md5,da_device_token,da_version_code,da_createtime,da_updatetime,da_ip) |
| | | (da_id,da_platform,da_device,da_device_token_md5,da_device_token,da_version_code,da_createtime,da_updatetime,da_ip,da_channel) |
| | | values |
| | | (#{id,jdbcType=BIGINT},#{platform,jdbcType=INTEGER},#{device,jdbcType=VARCHAR},#{deviceTokenMd5,jdbcType=VARCHAR},#{deviceToken,jdbcType=VARCHAR},#{versionCode,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{ipInfo,jdbcType=VARCHAR}) |
| | | </insert> |
| | | (#{id,jdbcType=BIGINT},#{platform,jdbcType=INTEGER},#{device,jdbcType=VARCHAR},#{deviceTokenMd5,jdbcType=VARCHAR},#{deviceToken,jdbcType=VARCHAR},#{versionCode,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{ipInfo,jdbcType=VARCHAR},#{channel,jdbcType=VARCHAR})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.push.DeviceActive" |
| | | useGeneratedKeys="true" keyProperty="id"> |
| | | insert into yeshi_ec_device_active |
| | |
| | | <if test="createTime != null">da_createtime,</if> |
| | | <if test="updateTime != null">da_updatetime,</if> |
| | | <if test="ipInfo != null">da_ip,</if> |
| | | |
| | | <if test="channel != null">da_channel,</if> |
| | | </trim> |
| | | values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="ipInfo != null">#{ipInfo,jdbcType=VARCHAR},</if> |
| | | <if test="channel != null">#{channel,jdbcType=VARCHAR}</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.push.DeviceActive">update |
| | |
| | | #{deviceToken,jdbcType=VARCHAR},da_version_code = |
| | | #{versionCode,jdbcType=INTEGER},da_createtime = |
| | | #{createTime,jdbcType=TIMESTAMP},da_updatetime = |
| | | #{updateTime,jdbcType=TIMESTAMP},da_ip = |
| | | #{ipInfo,jdbcType=VARCHAR} |
| | | where da_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | #{updateTime,jdbcType=TIMESTAMP},da_ip = #{ipInfo,jdbcType=VARCHAR} |
| | | ,da_channel =#{channel,jdbcType=VARCHAR} where da_id = |
| | | #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.push.DeviceActive"> |
| | | update yeshi_ec_device_active |
| | | <set> |
| | | <if test="platform != null">da_platform=#{platform,jdbcType=INTEGER},</if> |
| | | <if test="device != null">da_device=#{device,jdbcType=VARCHAR},</if> |
| | | <if test="deviceTokenMd5 != null">da_device_token_md5=#{deviceTokenMd5,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="deviceTokenMd5 != null">da_device_token_md5=#{deviceTokenMd5,jdbcType=VARCHAR},</if> |
| | | <if test="deviceToken != null">da_device_token=#{deviceToken,jdbcType=VARCHAR},</if> |
| | | <if test="versionCode != null">da_version_code=#{versionCode,jdbcType=INTEGER},</if> |
| | | <if test="createTime != null">da_createtime=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">da_updatetime=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="ipInfo != null">da_ip=#{ipInfo,jdbcType=VARCHAR},</if> |
| | | <if test="channel !=null">da_channel =#{channel,jdbcType=VARCHAR},</if> |
| | | </set> |
| | | where da_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | |
| | | <result column="lua_device_type" property="deviceType" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="lua_os_version" property="osVersion" jdbcType="VARCHAR" /> |
| | | <result column="lua_device" property="device" jdbcType="VARCHAR" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">lua_id,lua_uid,lua_ip,lua_channel,lua_version_code,lua_createtime,lua_updatetime,lua_device_type,lua_os_version |
| | | <sql id="Base_Column_List">lua_id,lua_uid,lua_ip,lua_channel,lua_version_code,lua_createtime,lua_updatetime,lua_device_type,lua_os_version,lua_device |
| | | </sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_log_user_active where lua_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | <select id="selectLatestByUid" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_log_user_active where lua_uid = #{0} order by lua_id desc limit 1 |
| | | from yeshi_ec_log_user_active where lua_uid = #{0} order by lua_id |
| | | desc limit 1 |
| | | </select> |
| | | |
| | | <select id="selectFirstActiveInfo" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_log_user_active where lua_uid = #{0} order by lua_id limit 1 |
| | | from yeshi_ec_log_user_active where lua_uid = #{0} order by lua_id |
| | | limit 1 |
| | | </select> |
| | | |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
| | | yeshi_ec_log_user_active where lua_id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | yeshi_ec_log_user_active where lua_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.UserActiveLog" |
| | | useGeneratedKeys="true" keyProperty="id">insert into |
| | | yeshi_ec_log_user_active |
| | | (lua_id,lua_uid,lua_ip,lua_channel,lua_version_code,lua_createtime,lua_updatetime,lua_device_type,lua_os_version) |
| | | (lua_id,lua_uid,lua_ip,lua_channel,lua_version_code,lua_createtime,lua_updatetime,lua_device_type,lua_os_version,lua_device) |
| | | values |
| | | (#{id,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{ip,jdbcType=VARCHAR},#{channel,jdbcType=VARCHAR},#{versionCode,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{deviceType,jdbcType=VARCHAR},#{osVersion,jdbcType=VARCHAR}) |
| | | (#{id,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{ip,jdbcType=VARCHAR},#{channel,jdbcType=VARCHAR},#{versionCode,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{deviceType,jdbcType=VARCHAR},#{osVersion,jdbcType=VARCHAR},#{device,jdbcType=VARCHAR}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.UserActiveLog" |
| | | useGeneratedKeys="true" keyProperty="id"> |
| | |
| | | <if test="updateTime != null">lua_updatetime,</if> |
| | | <if test="deviceType != null">lua_device_type,</if> |
| | | <if test="osVersion != null">lua_os_version,</if> |
| | | <if test="device != null">lua_device,</if> |
| | | </trim> |
| | | values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="deviceType != null">#{deviceType,jdbcType=VARCHAR},</if> |
| | | <if test="osVersion != null">#{osVersion,jdbcType=VARCHAR}</if> |
| | | <if test="device != null">#{device,jdbcType=VARCHAR}</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.user.UserActiveLog">update |
| | |
| | | #{createTime,jdbcType=TIMESTAMP},lua_updatetime = |
| | | #{updateTime,jdbcType=TIMESTAMP} ,lua_device_type |
| | | =#{deviceType,jdbcType=VARCHAR} ,lua_os_version |
| | | =#{osVersion,jdbcType=VARCHAR} where lua_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | =#{osVersion,jdbcType=VARCHAR},lua_device |
| | | =#{device,jdbcType=VARCHAR} where lua_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.user.UserActiveLog"> |
| | | update yeshi_ec_log_user_active |
| | | <set> |
| | |
| | | <if test="versionCode != null">lua_version_code=#{versionCode,jdbcType=VARCHAR},</if> |
| | | <if test="createTime != null">lua_createtime=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">lua_updatetime=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="id !=null">lua_id =#{id,jdbcType=BIGINT},</if> |
| | | <if test="deviceType !=null">lua_device_type =#{deviceType,jdbcType=VARCHAR},</if> |
| | | <if test="osVersion !=null">lua_os_version =#{osVersion,jdbcType=VARCHAR},</if> |
| | | <if test="device !=null">lua_device =#{device,jdbcType=VARCHAR},</if> |
| | | </set> |
| | | where lua_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | |
| | | import com.yeshi.fanli.dao.ad.DouYinClickEventDao;
|
| | | import com.yeshi.fanli.entity.ad.DouYinClickEvent;
|
| | | import com.yeshi.fanli.service.inter.ad.DouYinClickEventService;
|
| | | import com.yeshi.fanli.util.cmq.DouYinDeviceActiveCMQManager;
|
| | |
|
| | | @Service
|
| | | public class DouYinClickEventServiceImpl implements DouYinClickEventService {
|
| | |
| | | public void save(DouYinClickEvent event) {
|
| | | // 查询
|
| | | DouYinClickEvent old = douYinClickEventDao.selectByAid(event.getAid());
|
| | | if (old == null)
|
| | | if (old == null) {
|
| | | douYinClickEventDao.save(event);
|
| | | DouYinDeviceActiveCMQManager.getInstance().addAdActive(event.getAid());
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public DouYinClickEvent selectByAid(String aid) {
|
| | | return douYinClickEventDao.selectByAid(aid);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public DouYinClickEvent selectByAndroidId(String androidId) {
|
| | | return douYinClickEventDao.selectByAndroidId(androidId);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | buffer.append(" ");
|
| | | buffer.append("早安~\n");
|
| | | buffer.append("我的邀请码:【邀请码】\n");
|
| | | buffer.append("购物省钱返利券App:【邀请链接】");
|
| | | buffer.append("购物省钱板栗快省App:【邀请链接】");
|
| | |
|
| | | content = content.replaceAll("\\,", "\\,").replaceAll("\\.", "\\。").replaceAll("\\;", "\\;")
|
| | | .replaceAll("\\!", "\\!").replaceAll("\\?", "\\?").replaceAll("\\:", "\\:");
|
| | |
| | | stList.add(identifyCode);
|
| | | if (stList.size() >= limitCount) {// 触发报警
|
| | | if ("1".equalsIgnoreCase(configService.get("can_send_emergency_msg")))
|
| | | EmergencyUtil.baoJin(key, "返利券【分享赚】", phones);
|
| | | EmergencyUtil.baoJin(key, "板栗快省【分享赚】", phones);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | stList.add(identifyCode);
|
| | | if (stList.size() >= limitCount) {// 触发报警
|
| | | if ("1".equalsIgnoreCase(configService.get("can_send_emergency_msg")))
|
| | | EmergencyUtil.baoJin(key, "返利券【领券返利】", phones);
|
| | | EmergencyUtil.baoJin(key, "板栗快省【领券返利】", phones);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | Config config = new Config();
|
| | | config.setCreatetime(System.currentTimeMillis() + "");
|
| | | config.setKey(KEY_ZHUSHOU);
|
| | | config.setName("消息-返利券小助手");
|
| | | config.setName("消息-板栗快省小助手");
|
| | | config.setValue(new Gson().toJson(dto));
|
| | | configService.save(config);
|
| | | }
|
| | |
| | | // 加资金
|
| | | userMoneyService.addUserMoney(uid, money, detail);
|
| | | pushMsg(uid, "关于近期订单与资金异常的排查与修复结果通知",
|
| | | "尊敬的用户,经仔细核对您账户中的订单,发现您账户中有未统计或错误统计的订单,我们已经为您补齐资金,对应资金已经存入您的账户余额中,敬请查收注查收。感谢信任,返利券App终将成为您最信任的购物省钱助手。");
|
| | | "尊敬的用户,经仔细核对您账户中的订单,发现您账户中有未统计或错误统计的订单,我们已经为您补齐资金,对应资金已经存入您的账户余额中,敬请查收注查收。感谢信任,板栗快省App终将成为您最信任的购物省钱助手。");
|
| | | userMoneyMsgNotificationService.systemEqualize(uid, "订单统计异常修复", money, userInfoService.getBalance(uid));
|
| | | } catch (UserMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | |
| | |
|
| | | } else {// 资金需要减少,不要扣钱
|
| | | pushMsg(uid, "关于近期订单与资金异常的排查与修复结果通知",
|
| | | "尊敬的用户,经仔细核对您账户中的订单,发现您账户中有错误统计的订单,我们已经为您恢复正常,所涉及订单多统计出来的资金,不会被扣除,即您账户中的资金将保持不变,已提现的资金,也不会收回,敬请知晓。感谢信任,返利券App终将成为您最信任的购物省钱助手。");
|
| | | "尊敬的用户,经仔细核对您账户中的订单,发现您账户中有错误统计的订单,我们已经为您恢复正常,所涉及订单多统计出来的资金,不会被扣除,即您账户中的资金将保持不变,已提现的资金,也不会收回,敬请知晓。感谢信任,板栗快省App终将成为您最信任的购物省钱助手。");
|
| | | // userMoneyMsgNotificationService.systemEqualize(uid, "订单统计异常修复",
|
| | | // money, userInfoService.getBalance(uid));
|
| | | // 加入提现审核异常保护中
|
| | |
| | | import com.yeshi.fanli.entity.push.DeviceActive;
|
| | | import com.yeshi.fanli.service.inter.push.DeviceActiveService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.cmq.DouYinDeviceActiveCMQManager;
|
| | |
|
| | | @Service
|
| | | public class DeviceActiveServiceImpl implements DeviceActiveService {
|
| | |
| | | }
|
| | |
|
| | | deviceActiveMapper.insertSelective(deviceActive);
|
| | | DouYinDeviceActiveCMQManager.getInstance().addDeviceActive(deviceActive.getDevice(),
|
| | | deviceActive.getPlatform());
|
| | | } else {
|
| | | DeviceActive updateDeviceActive = new DeviceActive();
|
| | | updateDeviceActive.setId(da.getId());
|
| | |
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (userInfoExtra == null || StringUtil.isNullOrEmpty(userInfoExtra.getInviteCode())) {
|
| | | tips.add("确认领取后,你将成为赠送者的一级队员;");
|
| | | tips.add("返利券奖励券,可用于“已到账”的返利订单,在返利的基础上再获得一定比例的返利;");
|
| | | tips.add("板栗快省奖励券,可用于“已到账”的返利订单,在返利的基础上再获得一定比例的返利;");
|
| | | tips.add("成功领取后,请到“我的-福利中心”中查看。");
|
| | | } else {
|
| | | tips.add("返利券奖励券,可用于“已到账”的返利订单,在返利的基础上再获得一定比例的返利;");
|
| | | tips.add("板栗快省奖励券,可用于“已到账”的返利订单,在返利的基础上再获得一定比例的返利;");
|
| | | tips.add("成功领取后,请到“我的-福利中心”中查看。");
|
| | | }
|
| | | } else {
|
| | |
| | | String defaultNickName = Constant.systemCommonConfig.getDefaultNickName();
|
| | | if (!StringUtil.isNullOrEmpty(defaultNickName) && !StringUtil.isNullOrEmpty(weiXinUser.getNickname())) {
|
| | | defaultNickName = defaultNickName + uid;
|
| | | if ((defaultNickName.equals(user.getNickName()) || "返利券".equals(user.getNickName()))) {
|
| | | if ((defaultNickName.equals(user.getNickName()) || "板栗快省".equals(user.getNickName()))) {
|
| | | updateUserInfo.setNickName(weiXinUser.getNickname());
|
| | | }
|
| | | }
|
| | |
| | | String defaultNickName = Constant.systemCommonConfig.getDefaultNickName();
|
| | | if (!StringUtil.isNullOrEmpty(defaultNickName) && !StringUtil.isNullOrEmpty(weiXinUser.getNickname())) {
|
| | | defaultNickName = defaultNickName + uid;
|
| | | if ((defaultNickName.equals(user.getNickName()) || "返利券".equals(user.getNickName()))) {
|
| | | if ((defaultNickName.equals(user.getNickName()) || "板栗快省".equals(user.getNickName()))) {
|
| | | updateUserInfo.setNickName(weiXinUser.getNickname());
|
| | | }
|
| | | }
|
| | |
| | | userActiveLog.setCreateTime(new Date());
|
| | | userActiveLog.setUpdateTime(new Date());
|
| | | userActiveLogMapper.insertSelective(userActiveLog);
|
| | | } else if (latestLog != null) {
|
| | | // 如果设备 ,版本,渠道有变化则需要更改
|
| | | String oldIdentify = latestLog.getDevice() + "#" + latestLog.getVersionCode() + "#"
|
| | | + latestLog.getChannel();
|
| | | String newIdentify = userActiveLog.getDevice() + "#" + userActiveLog.getVersionCode() + "#"
|
| | | + userActiveLog.getChannel();
|
| | | if (!oldIdentify.equalsIgnoreCase(newIdentify)) {// 设备信息变化要记录信息
|
| | | userActiveLog.setCreateTime(new Date());
|
| | | userActiveLog.setUpdateTime(new Date());
|
| | | userActiveLogMapper.insertSelective(userActiveLog);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | |
|
| | | @Override
|
| | | public UserActiveLog getFirstActiveInfo(Long uid) {
|
| | | |
| | | |
| | |
|
| | | return userActiveLogMapper.selectFirstActiveInfo(uid);
|
| | | }
|
| | |
|
| | | |
| | | |
| | | |
| | | |
| | | }
|
| | |
| | | import com.yeshi.fanli.util.wx.WXLoginUtil;
|
| | | import com.yeshi.fanli.vo.user.UserInfoExtraVO;
|
| | |
|
| | |
|
| | | @Service
|
| | | public class UserInfoExtraServiceImpl implements UserInfoExtraService {
|
| | |
|
| | | @Resource
|
| | | private UserInfoExtraMapper userInfoExtraMapper;
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserRankRecordMapper userRankRecordMapper;
|
| | |
|
| | |
| | |
|
| | | @Resource
|
| | | private ConfigService configService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private ThreeSaleSerivce threeSaleSerivce;
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserInfoService userInfoService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserAccountService userAccountService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private ForbiddenUserIdentifyCodeService forbiddenUserIdentifyCodeService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserInviteRecordService userInviteRecordService;
|
| | | |
| | |
|
| | | @Override
|
| | | public UserInfoExtraVO getRankInfo(Long uid) throws UserInfoExtraException, Exception {
|
| | |
| | | throw new UserInfoExtraException(1, "用户附加信息不存在");
|
| | | }
|
| | |
|
| | | // 等级对照表 |
| | | // 等级对照表
|
| | | String contrast = configService.get("user_rank_contrast");
|
| | | extraVO.setRankContrast(contrast);
|
| | | // 特别提醒
|
| | |
| | | extraVO.setRankTip(rankTip);
|
| | |
|
| | | Integer rankOrderNum = extraVO.getRankOrderNum();
|
| | | |
| | |
|
| | | UserRank userRank = extraVO.getUserRank();
|
| | | // 青铜等级不返回恭喜语句 注:青铜等级id 必须为1
|
| | | if (userRank != null && userRank.getId() != null && userRank.getId() > 1) {
|
| | | |
| | |
|
| | | String rankMsg = null;
|
| | | Integer rankSource = extraVO.getRankSource();
|
| | | switch (rankSource) {
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public void updateUserRankByUid(Long uid) throws UserInfoExtraException{
|
| | | public void updateUserRankByUid(Long uid) throws UserInfoExtraException {
|
| | | if (uid == null || uid == 0) {
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | boolean isupdateRank = true;
|
| | | |
| | |
|
| | | UserInfoExtra userInfoExtra = userInfoExtraMapper.getInfoExtraByUid(uid);
|
| | | if (userInfoExtra != null && userInfoExtra.getId() != null) {
|
| | | // 判断当月是否已更新
|
| | |
| | | if (sdf.format(rankUpdateTime).equals(sdf.format(new Date()))) {
|
| | | isupdateRank = false;
|
| | | }
|
| | | } |
| | | }
|
| | | } else {
|
| | | userInfoExtra = new UserInfoExtra();
|
| | | userInfoExtra.setUserInfo(new UserInfo(uid));
|
| | | }
|
| | | |
| | |
|
| | | // 更新等级
|
| | | if (isupdateRank) {
|
| | | updateRank(userInfoExtra);
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public void createUserInfoExtra (Long uid) throws UserInfoExtraException{
|
| | | public void createUserInfoExtra(Long uid) throws UserInfoExtraException {
|
| | | UserInfoExtra userInfoExtra = userInfoExtraMapper.getInfoExtraByUid(uid);
|
| | | if (userInfoExtra != null) {
|
| | | return;
|
| | | } |
| | | |
| | | }
|
| | |
|
| | | userInfoExtra = new UserInfoExtra();
|
| | | userInfoExtra.setUserInfo(new UserInfo(uid));
|
| | | userInfoExtra.setFirstLoginTime(new Date());
|
| | |
| | | userInfoExtra.setUpdateTime(new Date());
|
| | | userInfoExtraMapper.insertSelective(userInfoExtra);
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public UserInfoExtra updateRank(UserInfoExtra userInfoExtra) throws UserInfoExtraException {
|
| | | UserInfo userInfo = userInfoExtra.getUserInfo();
|
| | | if (userInfo == null ) {
|
| | | if (userInfo == null) {
|
| | | throw new UserInfoExtraException(1, "用户不存在");
|
| | | }
|
| | | |
| | |
|
| | | Long uid = userInfo.getId();
|
| | | if (uid == null ) {
|
| | | if (uid == null) {
|
| | | throw new UserInfoExtraException(1, "用户ID不存在");
|
| | | } |
| | | |
| | | }
|
| | |
|
| | | List<UserRank> listRank = userRankService.getAllRank();
|
| | | if (listRank == null || listRank.size() == 0) {
|
| | | throw new UserInfoExtraException(1, "系统等级不存在");
|
| | |
| | | userInfoExtra.setRankSource(Constant.TYPE_REBATE);
|
| | | }
|
| | |
|
| | | |
| | | if (rank != null) {
|
| | | userInfoExtra.setUserRank(rank);
|
| | | } else {
|
| | |
| | | break;
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | // 等级更新时间 当月1号
|
| | | Calendar calendar1=Calendar.getInstance();
|
| | | calendar1.set(Calendar.DAY_OF_MONTH, 1);
|
| | | Calendar calendar1 = Calendar.getInstance();
|
| | | calendar1.set(Calendar.DAY_OF_MONTH, 1);
|
| | | userInfoExtra.setRankUpdateTime(calendar1.getTime());
|
| | | |
| | |
|
| | | // 保存信息并返回
|
| | | saveUserInfoExtra(userInfoExtra);
|
| | | |
| | |
|
| | | UserRankRecord userRankRecord = new UserRankRecord();
|
| | | userRankRecord.setUid(uid);
|
| | | userRankRecord.setRankId(rank.getId());
|
| | | userRankRecord.setCreateTime(new Date());
|
| | | userRankRecordMapper.insertSelective(userRankRecord);
|
| | | |
| | |
|
| | | return userInfoExtra;
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | return userInfoExtra;
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public String activateInviteCode(Long uid, String inviteCode) throws UserInfoExtraException{
|
| | | public String activateInviteCode(Long uid, String inviteCode) throws UserInfoExtraException {
|
| | | if (uid == null || inviteCode == null) {
|
| | | throw new UserInfoExtraException(1, "用户id、邀请码不能为空");
|
| | | }
|
| | | |
| | |
|
| | | // 被邀请人信息
|
| | | UserInfo invitee = userInfoService.selectByPKey(uid);
|
| | | if (invitee == null) {
|
| | | throw new UserInfoExtraException(1, "用户不存在");
|
| | | }
|
| | | |
| | |
|
| | | UserInfoExtra extra = userInfoExtraMapper.getInfoExtraByUid(uid);
|
| | | if (extra != null) {
|
| | | String inviteCodeHas = extra.getInviteCode();
|
| | |
| | | throw new UserInfoExtraException(1, "已存在邀请码,请刷新页面");
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | // 邀请人信息
|
| | | UserInfo inviter = userInfoService.getInfoByPhoneOrInviteCode(inviteCode, inviteCode);
|
| | | if (inviter == null) {
|
| | | throw new UserInfoExtraException(1, "上级邀请码不存在");
|
| | | }
|
| | | |
| | |
|
| | | // 绑定关系
|
| | | try {
|
| | | threeSaleSerivce.bindRelationshipByInviteCode(invitee, inviter);
|
| | |
| | | }
|
| | | throw new UserInfoExtraException(1, "激活失败");
|
| | | }
|
| | | |
| | | |
| | |
|
| | | // 邀请码有效、生成邀请码
|
| | | String code = UserUtil.getInviteCode(uid); |
| | | String code = UserUtil.getInviteCode(uid);
|
| | | if (code == null || code.trim().length() == 0) {
|
| | | throw new UserInfoExtraException(1, "激活码生成失败");
|
| | | }
|
| | | |
| | |
|
| | | UserInfoExtra userInfoExtra = new UserInfoExtra();
|
| | | userInfoExtra.setUserInfo(invitee);
|
| | | userInfoExtra.setInviteCode(code);
|
| | | |
| | |
|
| | | // 保存额外信息
|
| | | saveUserInfoExtra(userInfoExtra);
|
| | | |
| | | |
| | |
|
| | | Long id = userInfoExtra.getId();
|
| | | if (id == null) {
|
| | | throw new UserInfoExtraException(1, "激活码生成失败");
|
| | | }
|
| | | |
| | |
|
| | | return code;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public void activationInviteWX(WXAccountInfoDTO wxAccount, Long uid, String code) throws UserInfoExtraException{
|
| | | public void activationInviteWX(WXAccountInfoDTO wxAccount, Long uid, String code) throws UserInfoExtraException {
|
| | | if (uid == null || code == null) {
|
| | | throw new UserInfoExtraException(1, "激活信息不完整");
|
| | | }
|
| | | |
| | |
|
| | | // 用户信息
|
| | | UserInfo invitee = userInfoService.selectByPKey(uid);
|
| | | if (invitee == null) {
|
| | | throw new UserInfoExtraException(1, "用户不存在");
|
| | | }
|
| | | |
| | |
|
| | | // 用户额外信息
|
| | | UserInfoExtra extra = userInfoExtraMapper.getInfoExtraByUid(uid);
|
| | | if (extra != null) {
|
| | |
| | | throw new UserInfoExtraException(1, "已经激活, 无需再次激活");
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | // 获取微信信息
|
| | | WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code,wxAccount.getAppId(),wxAccount.getAppSecret());
|
| | | WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code, wxAccount.getAppId(),
|
| | | wxAccount.getAppSecret());
|
| | | if (weiXinUser == null) {
|
| | | throw new UserInfoExtraException(1, "微信授权失败");
|
| | | }
|
| | |
| | | if (wxUnionId == null || wxUnionId.trim().length() == 0) {
|
| | | throw new UserInfoExtraException(1, "微信授权失败");
|
| | | }
|
| | | |
| | |
|
| | | // 验证数据
|
| | | String wxUnionIdExist = invitee.getWxUnionId();
|
| | | if (StringUtil.isNullOrEmpty(wxUnionIdExist)) {
|
| | |
| | | if (newUser != null) {
|
| | | throw new UserInfoExtraException(1, "此微信已被其他帐号绑定");
|
| | | }
|
| | | |
| | |
|
| | | // 自动绑定微信
|
| | | UserInfo updateUserInfo = new UserInfo(uid);
|
| | | updateUserInfo.setWxOpenId(weiXinUser.getOpenid());
|
| | | updateUserInfo.setWxUnionId(weiXinUser.getUnionid());
|
| | | updateUserInfo.setWxName(weiXinUser.getNickname());
|
| | | updateUserInfo.setWxPic(weiXinUser.getHeadimgurl());
|
| | | |
| | |
|
| | | // 将默认昵称替换成微信昵称
|
| | | String defaultNickName = Constant.systemCommonConfig.getDefaultNickName();
|
| | | if (!StringUtil.isNullOrEmpty(defaultNickName) && !StringUtil.isNullOrEmpty(weiXinUser.getNickname())) {
|
| | | defaultNickName = defaultNickName + uid;
|
| | | if ((defaultNickName.equals(invitee.getNickName()) || "返利券".equals(invitee.getNickName()))) {
|
| | | if ((defaultNickName.equals(invitee.getNickName()) || "返利券".equals(invitee.getNickName())
|
| | | || invitee.getNickName().startsWith(Constant.systemCommonConfig.getDefaultNickName()))) {
|
| | | updateUserInfo.setNickName(weiXinUser.getNickname());
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | // 将默认头像替换成微信头像
|
| | | String defaultPortrait = Constant.systemCommonConfig.getDefaultPortrait();
|
| | | if (!StringUtil.isNullOrEmpty(weiXinUser.getHeadimgurl()) && !StringUtil.isNullOrEmpty(defaultPortrait)
|
| | | && defaultPortrait.equals(invitee.getPortrait())) {
|
| | | updateUserInfo.setPortrait(weiXinUser.getHeadimgurl());
|
| | | }
|
| | | |
| | |
|
| | | userInfoService.updateByPrimaryKeySelective(updateUserInfo);
|
| | | |
| | | } else if (!wxUnionId.equals(wxUnionIdExist)){
|
| | |
|
| | | } else if (!wxUnionId.equals(wxUnionIdExist)) {
|
| | | throw new UserInfoExtraException(1, "绑定微信与激活微信不一致");
|
| | | }
|
| | | |
| | | |
| | |
|
| | | // 邀请人ID -1.5.3新版
|
| | | Long inviterId = userInviteRecordService.getNewestInviterId(wxUnionId);
|
| | | |
| | |
|
| | | // 兼容1.5.3 之前版本
|
| | | ThreeSale threeSale = threeSaleSerivce.getByWorkerId(uid);
|
| | | if (inviterId == null && threeSale != null) {
|
| | | Long bossId = threeSale.getBoss().getId();
|
| | | UserInfoExtra inviterExtra = userInfoExtraMapper.getInfoExtraByUid(bossId);
|
| | | if (inviterExtra != null && inviterExtra.getInviteCode() == null ) {
|
| | | if (inviterExtra != null && inviterExtra.getInviteCode() == null) {
|
| | | // 更新邀请码
|
| | | UserInfoExtra inviterInfoExtra = new UserInfoExtra();
|
| | | inviterInfoExtra.setId(inviterExtra.getId());
|
| | |
| | | userInfoExtraMapper.updateByPrimaryKeySelective(inviterInfoExtra);
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | // 没有被邀请过
|
| | | if (inviterId == null && threeSale == null) {
|
| | | throw new UserInfoExtraException(1, "没有对应的邀请关系");
|
| | | }
|
| | | |
| | |
|
| | | // 绑定关系
|
| | | try {
|
| | | threeSaleSerivce.bindRelationshipByWX(invitee, inviterId, threeSale);
|
| | |
| | | }
|
| | | throw new UserInfoExtraException(1, "关系绑定时失败");
|
| | | }
|
| | | |
| | | |
| | |
|
| | | // 邀请码有效、生成邀请码
|
| | | String inviteCode = UserUtil.getInviteCode(uid); |
| | | String inviteCode = UserUtil.getInviteCode(uid);
|
| | | if (inviteCode == null || inviteCode.trim().length() == 0) {
|
| | | throw new UserInfoExtraException(1, "激活码生成失败");
|
| | | }
|
| | |
| | | userInfoExtraMapper.insertSelective(userInfoExtra);
|
| | | }
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public UserInfoExtra getUserInfoExtra(Long uid) {
|
| | | return userInfoExtraMapper.getInfoExtraByUid(uid);
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public UserInfoExtraVO getInfoExtraVOByUid(Long uid) {
|
| | | return userInfoExtraMapper.getInfoExtraVOByUid(uid);
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public String getUserInviteCode(Long uid) throws UserInfoExtraException {
|
| | | |
| | |
|
| | | UserInfoExtra userInfoExtra = userInfoExtraMapper.getInfoExtraByUid(uid);
|
| | | if (userInfoExtra == null) {
|
| | | userInfoExtra = new UserInfoExtra();
|
| | | }
|
| | | |
| | |
|
| | | // 邀请码
|
| | | String inviteCode = userInfoExtra.getInviteCode();
|
| | | |
| | |
|
| | | if (inviteCode == null || inviteCode.trim().length() == 0) {
|
| | | // 判断用户
|
| | | int relationshipNum = threeSaleSerivce.getSuccessRelationshipNum(uid);
|
| | | |
| | |
|
| | | if (relationshipNum > 0) {
|
| | | // 邀请码有效、生成邀请码
|
| | | inviteCode = UserUtil.getInviteCode(uid); |
| | | inviteCode = UserUtil.getInviteCode(uid);
|
| | | if (inviteCode == null || inviteCode.trim().length() == 0) {
|
| | | throw new UserInfoExtraException(1, "激活码生成失败");
|
| | | }
|
| | | |
| | |
|
| | | // 保存邀请码
|
| | | userInfoExtra.setUserInfo(new UserInfo(uid));
|
| | | userInfoExtra.setInviteCode(inviteCode);
|
| | |
| | | saveUserInfoExtra(userInfoExtra);
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | return inviteCode;
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public long countByRankId(Long rankId) {
|
| | | return userInfoExtraMapper.countByRankId(rankId);
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public boolean isNewUser(Long uid) {
|
| | | boolean isNew = false;
|
| | | if (uid == null) {
|
| | | return isNew;
|
| | | }
|
| | | |
| | |
|
| | | UserInfoExtra extra = userInfoExtraMapper.getInfoExtraByUid(uid);
|
| | | if (extra != null && extra.getFirstLoginTime() != null) {
|
| | | try {
|
| | |
| | | }
|
| | | return isNew;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public UserRank gerUserRank(Long uid) {
|
| | | if(uid == null) {
|
| | | if (uid == null) {
|
| | | return null;
|
| | | }
|
| | | |
| | |
|
| | | UserInfoExtra userInfoExtra = userInfoExtraMapper.gerUserRank(uid);
|
| | | if (userInfoExtra == null) {
|
| | | return null;
|
| | | }
|
| | | return userInfoExtra.getUserRank();
|
| | | }
|
| | | |
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public UserInfo getUserByInviteCode(String inviteCode) throws UserInfoExtraException{
|
| | | public UserInfo getUserByInviteCode(String inviteCode) throws UserInfoExtraException {
|
| | | if (StringUtil.isNullOrEmpty(inviteCode)) {
|
| | | throw new UserInfoExtraException(1, "邀请码不能为空");
|
| | | }
|
| | |
| | | }
|
| | | return inviter;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public UserInfo getInviterInfo(WXAccountInfoDTO wxAccount,Long uid, String code) throws UserInfoExtraException{
|
| | | public UserInfo getInviterInfo(WXAccountInfoDTO wxAccount, Long uid, String code) throws UserInfoExtraException {
|
| | | if (code == null) {
|
| | | throw new UserInfoExtraException(1, "code信息不完整");
|
| | | }
|
| | | |
| | |
|
| | | // 用户信息
|
| | | UserInfo invitee = userInfoService.selectByPKey(uid);
|
| | | if (invitee == null) {
|
| | | throw new UserInfoExtraException(1, "用户不存在");
|
| | | }
|
| | | |
| | |
|
| | | // 用户额外信息
|
| | | UserInfoExtra extra = userInfoExtraMapper.getInfoExtraByUid(uid);
|
| | | if (extra != null) {
|
| | |
| | | throw new UserInfoExtraException(1, "已经激活, 无需再次激活");
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | // 获取微信信息
|
| | | WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUser(code,wxAccount.getAppId(),wxAccount.getAppSecret());
|
| | | WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUser(code, wxAccount.getAppId(), wxAccount.getAppSecret());
|
| | | if (weiXinUser == null) {
|
| | | throw new UserInfoExtraException(1, "微信授权失败");
|
| | | }
|
| | |
| | | if (wxUnionId == null || wxUnionId.trim().length() == 0) {
|
| | | throw new UserInfoExtraException(1, "微信授权失败");
|
| | | }
|
| | | |
| | |
|
| | | // 验证数据
|
| | | String wxUnionIdExist = invitee.getWxUnionId();
|
| | | if (StringUtil.isNullOrEmpty(wxUnionIdExist)) {
|
| | |
| | | if (newUser != null) {
|
| | | throw new UserInfoExtraException(1, "此微信已被其他帐号绑定");
|
| | | }
|
| | | } else if (!wxUnionId.equals(wxUnionIdExist)){
|
| | | } else if (!wxUnionId.equals(wxUnionIdExist)) {
|
| | | throw new UserInfoExtraException(1, "绑定微信与激活微信不一致");
|
| | | }
|
| | | |
| | |
|
| | | // 邀请人ID
|
| | | Long inviterId = userInviteRecordService.getNewestInviterId(wxUnionId);
|
| | | if (inviterId == null) {
|
| | | throw new UserInfoExtraException(1, "没有对应的邀请关系");
|
| | | }
|
| | | |
| | |
|
| | | UserInfo inviter = userInfoService.selectByPKey(inviterId);
|
| | | if (inviter == null) {
|
| | | throw new UserInfoExtraException(1, "对应的邀请关系不存在");
|
| | |
| | | addModifyRecord(uid, ModifyTypeEnum.bindWeiXin, user.getWxUnionId());
|
| | | }
|
| | |
|
| | | if (user.getNickName() != null && !user.getNickName().startsWith("返利券")) {
|
| | | if (user.getNickName() != null && !user.getNickName().startsWith("返利券")&&!user.getNickName().startsWith(Constant.systemCommonConfig.getDefaultNickName())) {
|
| | | addModifyRecord(uid, ModifyTypeEnum.nickName, user.getNickName() + "");
|
| | | }
|
| | |
|
| | |
| | |
|
| | | public interface DouYinClickEventService {
|
| | |
|
| | | /**
|
| | | * 缓存到数据库
|
| | | * |
| | | * @param event
|
| | | */
|
| | | public void save(DouYinClickEvent event);
|
| | | |
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 根据广告ID查询
|
| | | * |
| | | * @param aid
|
| | | * @return
|
| | | */
|
| | | public DouYinClickEvent selectByAid(String aid);
|
| | |
|
| | | /**
|
| | | * 根据androidID查询
|
| | | * @param androidId
|
| | | * @return
|
| | | */
|
| | | public DouYinClickEvent selectByAndroidId(String androidId);
|
| | |
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | public static String getAppName(String platform, String version) {
|
| | | if (VersionUtil.greaterThan_2_0(platform, version))
|
| | | return Constant.systemCommonConfig.getProjectChineseName();
|
| | | else
|
| | | return "返利券";
|
| | | // if (VersionUtil.greaterThan_2_0(platform, version))
|
| | | return Constant.systemCommonConfig.getProjectChineseName();
|
| | | // else
|
| | | // return "返利券";
|
| | | }
|
| | |
|
| | | public static WXAccountInfoDTO getWXAccount(String platform, String version) {
|
| | | // if (VersionUtil.greaterThan_2_0(platform, version)) {
|
| | | // return new WXAccountInfoDTO("wxa99686bb65a9f466", "57390718ddedaa1591f6876cdcf96f43", "wx879fb78463222cd5",
|
| | | // "2ad8ec333a9f96b13c5c5c1c2b13cd67");
|
| | | // } else {
|
| | | return new WXAccountInfoDTO("wx43617e2ed82c5b28", "f8a65908fb4681bdd181de70f6ab9a3b", "wx5c0d167c6e3ad726",
|
| | | "0c79d5869bb0f2d7c13e43f9a18f440d");
|
| | | // }
|
| | | // return new WXAccountInfoDTO("wx43617e2ed82c5b28",
|
| | | // "f8a65908fb4681bdd181de70f6ab9a3b", "wx5c0d167c6e3ad726",
|
| | | // "0c79d5869bb0f2d7c13e43f9a18f440d");
|
| | | return new WXAccountInfoDTO("wxa99686bb65a9f466", "57390718ddedaa1591f6876cdcf96f43", "wx5c0d167c6e3ad726",
|
| | | "0c79d5869bb0f2d7c13e43f9a18f440d");
|
| | | }
|
| | | }
|
| | |
| | | import org.yeshi.utils.tencentcloud.COSManager;
|
| | | import org.yeshi.utils.tencentcloud.entity.COSInitParams;
|
| | |
|
| | | import com.yeshi.fanli.dto.ad.DouYinDeviceActiveQueueDTO;
|
| | | import com.yeshi.fanli.dto.money.UserMoneyChangeDTO;
|
| | | import com.yeshi.fanli.entity.ad.DouYinClickEvent;
|
| | | import com.yeshi.fanli.entity.bus.user.AlipayTransferResultInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.bus.user.Order;
|
| | |
| | | import com.yeshi.fanli.entity.order.CommonOrder;
|
| | | import com.yeshi.fanli.entity.order.HongBaoOrder;
|
| | | import com.yeshi.fanli.entity.pdd.PDDOrder;
|
| | | import com.yeshi.fanli.entity.push.DeviceActive;
|
| | | import com.yeshi.fanli.entity.push.PushQueueRecord;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrder;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoWeiQuanOrder;
|
| | | import com.yeshi.fanli.exception.order.TaoBaoWeiQuanException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.ad.DouYinClickEventService;
|
| | | import com.yeshi.fanli.service.inter.lable.BoutiqueAutoRuleService;
|
| | | import com.yeshi.fanli.service.inter.lable.LabelService;
|
| | | import com.yeshi.fanli.service.inter.money.UserMoneyDebtService;
|
| | |
| | | import com.yeshi.fanli.service.inter.order.jd.JDOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.pdd.PDDOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.tb.TaoBaoOrderService;
|
| | | import com.yeshi.fanli.service.inter.push.DeviceActiveService;
|
| | | import com.yeshi.fanli.service.inter.push.IOSPushService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | |
| | | import com.yeshi.fanli.service.inter.user.integral.IntegralGetService;
|
| | | import com.yeshi.fanli.service.inter.user.integral.IntegralTaskRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.util.ad.DouYinAdUtil;
|
| | | import com.yeshi.fanli.util.cmq.DouYinDeviceActiveCMQManager;
|
| | | import com.yeshi.fanli.util.cmq.HongBaoRecieveCMQManager;
|
| | | import com.yeshi.fanli.util.cmq.JDOrderCMQManager;
|
| | | import com.yeshi.fanli.util.cmq.PDDOrderCMQManager;
|
| | |
| | | @Resource
|
| | | private IntegralTaskRecordService integralTaskRecordService;
|
| | |
|
| | | @Resource
|
| | | private DeviceActiveService deviceActiveService;
|
| | |
|
| | | private static boolean isInited = false;
|
| | |
|
| | | public void onApplicationEvent(ContextRefreshedEvent arg0) {
|
| | |
| | | doImportantTaoBaoGoodsUpdateJob();// 淘宝重要商品的信息更新
|
| | | doHongBaoRecieveIntegralGetJob();// 返利到账,金币增加
|
| | | doPlaceOrderIntegralJob();// 下单赠送金币任务
|
| | | doDouYinDeviceActiveJob();// 抖音设备激活广告监测
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | });
|
| | | }
|
| | |
|
| | | @Resource
|
| | | private DouYinClickEventService douYinClickEventService;
|
| | |
|
| | | // 抖音
|
| | | public void doDouYinDeviceActiveJob() {
|
| | | executor.execute(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | | while (true) {
|
| | | Map<String, DouYinDeviceActiveQueueDTO> map = DouYinDeviceActiveCMQManager.getInstance()
|
| | | .consume(16);
|
| | | if (map != null) {
|
| | | // 是否是首单
|
| | | for (Iterator<String> its = map.keySet().iterator(); its.hasNext();) {
|
| | | String key = its.next();
|
| | | DouYinDeviceActiveQueueDTO active = map.get(key);
|
| | | if (active.getType() == DouYinDeviceActiveQueueDTO.TYPE_AD) {// 抖音
|
| | | DeviceActive deviceActive = deviceActiveService.getFirstActiveInfo(active.getDevice());
|
| | | if (deviceActive != null) {
|
| | | DouYinClickEvent event = douYinClickEventService.selectByAid(active.getAid());
|
| | | if (event != null) {
|
| | | if (event.getOs() == 0)
|
| | | DouYinAdUtil.activeAndroid(event.getCallback(), event.getImei(),
|
| | | deviceActive.getCreateTime().getTime());
|
| | | else if (event.getOs() == 1)
|
| | | DouYinAdUtil.activeIOS(event.getCallback(), event.getIdfa(),
|
| | | deviceActive.getCreateTime().getTime());
|
| | | }
|
| | | }
|
| | |
|
| | | } else if (active.getType() == DouYinDeviceActiveQueueDTO.TYPE_DEVICE) {// 设备
|
| | | // TODO 兼容IOS
|
| | | if (active.getPlatform() == 1) {
|
| | | DouYinClickEvent event = douYinClickEventService
|
| | | .selectByAndroidId(active.getDevice());
|
| | | if (event != null) {// 回调
|
| | | DeviceActive deviceActive = deviceActiveService
|
| | | .getFirstActiveInfo(active.getDevice());
|
| | | if (deviceActive != null)
|
| | | DouYinAdUtil.activeAndroid(event.getCallback(), event.getImei(),
|
| | | deviceActive.getCreateTime().getTime());
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | });
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import org.yeshi.utils.HttpUtil;
|
| | | import org.yeshi.utils.StringUtil;
|
| | |
|
| | | import com.yeshi.fanli.dto.ad.DouYinUserActionInfo;
|
| | | import com.yeshi.fanli.dto.ad.DouYinUserActionInfoDTO;
|
| | |
|
| | | public class DouYinAdUtil {
|
| | |
|
| | | public final static String SIGN_KEY = "tdqaWqs-Xkkxe-nea-UDsPtnorzpARzgB";
|
| | | public final static String SIGN_KEY = "TuXUwRE-aosga-mno-LTxzgvSbhrkUKbK";
|
| | |
|
| | | // 上传用户行为
|
| | | private static void postUserAction(DouYinUserActionInfo info, String signKey) {
|
| | | private static void postUserAction(DouYinUserActionInfoDTO info, String signKey) {
|
| | | String url = "http://ad.toutiao.com/track/activate/";
|
| | | Map<String, String> map = new HashMap<>();
|
| | | map.put("callback", info.getCallback());
|
| | |
| | | * @param callBack
|
| | | */
|
| | | public static void activeAndroid(String callBack, String imei, Long convTime) {
|
| | | DouYinUserActionInfo info = new DouYinUserActionInfo(callBack, StringUtil.Md5(imei), 0,
|
| | | DouYinUserActionInfoDTO info = new DouYinUserActionInfoDTO(callBack, StringUtil.Md5(imei), 0,
|
| | | convTime == null ? System.currentTimeMillis() / 1000 : convTime / 1000,
|
| | | DouYinUserActionInfo.EVENT_TYPE_ACTIVE);
|
| | | DouYinUserActionInfoDTO.EVENT_TYPE_ACTIVE);
|
| | | postUserAction(info, SIGN_KEY);
|
| | | }
|
| | |
|
| | | public static void activeIOS(String callBack, String idfa, Long convTime) {
|
| | | DouYinUserActionInfo info = new DouYinUserActionInfo(callBack, idfa, 1,
|
| | | DouYinUserActionInfoDTO info = new DouYinUserActionInfoDTO(callBack, idfa, 1,
|
| | | convTime == null ? System.currentTimeMillis() / 1000 : convTime / 1000,
|
| | | DouYinUserActionInfo.EVENT_TYPE_ACTIVE);
|
| | | DouYinUserActionInfoDTO.EVENT_TYPE_ACTIVE);
|
| | | postUserAction(info, SIGN_KEY);
|
| | | }
|
| | |
|
| | |
| | | * 注册
|
| | | */
|
| | | public static void registerAndroid(String callBack, String imei, Long convTime) {
|
| | | DouYinUserActionInfo info = new DouYinUserActionInfo(callBack, StringUtil.Md5(imei), 0,
|
| | | DouYinUserActionInfoDTO info = new DouYinUserActionInfoDTO(callBack, StringUtil.Md5(imei), 0,
|
| | | convTime == null ? System.currentTimeMillis() / 1000 : convTime / 1000,
|
| | | DouYinUserActionInfo.EVENT_TYPE_REGISTER);
|
| | | DouYinUserActionInfoDTO.EVENT_TYPE_REGISTER);
|
| | | postUserAction(info, SIGN_KEY);
|
| | | }
|
| | |
|
| | | public static void registerIOS(String callBack, String idfa, Long convTime) {
|
| | | DouYinUserActionInfo info = new DouYinUserActionInfo(callBack, idfa, 1,
|
| | | DouYinUserActionInfoDTO info = new DouYinUserActionInfoDTO(callBack, idfa, 1,
|
| | | convTime == null ? System.currentTimeMillis() / 1000 : convTime / 1000,
|
| | | DouYinUserActionInfo.EVENT_TYPE_REGISTER);
|
| | | DouYinUserActionInfoDTO.EVENT_TYPE_REGISTER);
|
| | | postUserAction(info, SIGN_KEY);
|
| | | }
|
| | |
|
| | |
| | | */
|
| | |
|
| | | public static void validOrderAndroid(String callBack, String imei, Long convTime) {
|
| | | DouYinUserActionInfo info = new DouYinUserActionInfo(callBack, StringUtil.Md5(imei), 0,
|
| | | DouYinUserActionInfoDTO info = new DouYinUserActionInfoDTO(callBack, StringUtil.Md5(imei), 0,
|
| | | convTime == null ? System.currentTimeMillis() / 1000 : convTime / 1000,
|
| | | DouYinUserActionInfo.EVENT_TYPE_ORDER);
|
| | | DouYinUserActionInfoDTO.EVENT_TYPE_ORDER);
|
| | | postUserAction(info, SIGN_KEY);
|
| | | }
|
| | |
|
| | | public static void validOrderIOS(String callBack, String idfa, Long convTime) {
|
| | | DouYinUserActionInfo info = new DouYinUserActionInfo(callBack, idfa, 1,
|
| | | DouYinUserActionInfoDTO info = new DouYinUserActionInfoDTO(callBack, idfa, 1,
|
| | | convTime == null ? System.currentTimeMillis() / 1000 : convTime / 1000,
|
| | | DouYinUserActionInfo.EVENT_TYPE_ORDER);
|
| | | DouYinUserActionInfoDTO.EVENT_TYPE_ORDER);
|
| | | postUserAction(info, SIGN_KEY);
|
| | | }
|
| | |
|
| | |
| | | */
|
| | |
|
| | | public static void retainedAndroid(String callBack, String imei, Long convTime) {
|
| | | DouYinUserActionInfo info = new DouYinUserActionInfo(callBack, StringUtil.Md5(imei), 0,
|
| | | DouYinUserActionInfoDTO info = new DouYinUserActionInfoDTO(callBack, StringUtil.Md5(imei), 0,
|
| | | convTime == null ? System.currentTimeMillis() / 1000 : convTime / 1000,
|
| | | DouYinUserActionInfo.EVENT_TYPE_CILIU);
|
| | | DouYinUserActionInfoDTO.EVENT_TYPE_CILIU);
|
| | | postUserAction(info, SIGN_KEY);
|
| | | }
|
| | |
|
| | | public static void retainedIOS(String callBack, String idfa, Long convTime) {
|
| | | DouYinUserActionInfo info = new DouYinUserActionInfo(callBack, idfa, 1,
|
| | | DouYinUserActionInfoDTO info = new DouYinUserActionInfoDTO(callBack, idfa, 1,
|
| | | convTime == null ? System.currentTimeMillis() / 1000 : convTime / 1000,
|
| | | DouYinUserActionInfo.EVENT_TYPE_CILIU);
|
| | | DouYinUserActionInfoDTO.EVENT_TYPE_CILIU);
|
| | | postUserAction(info, SIGN_KEY);
|
| | | }
|
| | |
|
New file |
| | |
| | | package com.yeshi.fanli.util.cmq;
|
| | |
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import org.yeshi.utils.CMQUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.qcloud.cmq.Message;
|
| | | import com.yeshi.fanli.dto.ad.DouYinDeviceActiveQueueDTO;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | public class DouYinDeviceActiveCMQManager {
|
| | |
|
| | | private static String secretId = "AKIDTlpgJhLjOozvd6QI2XnpfGbgV4NQJk25";
|
| | | private static String secretKey = "xhCSUHo55oHUQ6XicFcmfIgspX0EEzWo";
|
| | | private static DouYinDeviceActiveCMQManager jdOrderCMQManager;
|
| | | private static CMQUtil cmqUtil;
|
| | |
|
| | | public static String DOUYIN_DEVICE_ACTIVE = "douyin-device-active";
|
| | |
|
| | | static {
|
| | | cmqUtil = CMQUtil.getInstance(secretId, secretKey);
|
| | | DOUYIN_DEVICE_ACTIVE += "-" + Constant.systemCommonConfig.getProjectName();
|
| | | cmqUtil.createQueue(DOUYIN_DEVICE_ACTIVE);
|
| | | }
|
| | |
|
| | | public static DouYinDeviceActiveCMQManager getInstance() {
|
| | | if (jdOrderCMQManager == null)
|
| | | jdOrderCMQManager = new DouYinDeviceActiveCMQManager();
|
| | | return jdOrderCMQManager;
|
| | | }
|
| | |
|
| | | public void addDeviceActive(String device, int platform) {
|
| | | if (StringUtil.isNullOrEmpty(device) || platform == 0)
|
| | | return;
|
| | | DouYinDeviceActiveQueueDTO dto = new DouYinDeviceActiveQueueDTO(DouYinDeviceActiveQueueDTO.TYPE_DEVICE, device,
|
| | | platform);
|
| | | cmqUtil.sendMsg(DOUYIN_DEVICE_ACTIVE, new Gson().toJson(dto));
|
| | | }
|
| | |
|
| | | public void addAdActive(String aid) {
|
| | | if (StringUtil.isNullOrEmpty(aid))
|
| | | return;
|
| | | DouYinDeviceActiveQueueDTO dto = new DouYinDeviceActiveQueueDTO(DouYinDeviceActiveQueueDTO.TYPE_AD, aid);
|
| | | cmqUtil.sendMsg(DOUYIN_DEVICE_ACTIVE, new Gson().toJson(dto));
|
| | | }
|
| | |
|
| | | public Map<String, DouYinDeviceActiveQueueDTO> consume(int count) {
|
| | | List<Message> list = cmqUtil.recieveMsg(count, DOUYIN_DEVICE_ACTIVE);
|
| | | Map<String, DouYinDeviceActiveQueueDTO> map = new HashMap<>();
|
| | | if (list != null)
|
| | | for (Message msg : list) {
|
| | | String result = msg.msgBody;
|
| | | map.put(msg.receiptHandle, new Gson().fromJson(result, DouYinDeviceActiveQueueDTO.class));
|
| | | }
|
| | | return map;
|
| | | }
|
| | |
|
| | | public void delete(String receiptHandle) {
|
| | | cmqUtil.deleteMsg(DOUYIN_DEVICE_ACTIVE, receiptHandle);
|
| | | }
|
| | |
|
| | | }
|