| | |
| | |
|
| | | @Resource
|
| | | private CustomerContentService customerContentService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserInfoExtraService userInfoExtraService;
|
| | | |
| | |
|
| | | @RequestMapping("getsystemclientparams")
|
| | | public void getSystemClientParams(AcceptData acceptData, Long uid, HttpServletRequest request, PrintWriter out) {
|
| | |
| | | da.setVersionCode(Integer.parseInt(acceptData.getVersion()));
|
| | | da.setIpInfo(ipInfo);
|
| | | da.setChannel(acceptData.getChannel());
|
| | | da.setImei(acceptData.getImei());
|
| | | deviceActiveService.addDeviceActive(da);
|
| | | } catch (Exception e) {
|
| | | }
|
| | | |
| | |
|
| | | // 用户等级更新
|
| | | try {
|
| | | userInfoExtraService.updateUserRankByUid(uid);
|
| | |
| | | userActiveLog.setVersionCode(acceptData.getVersion());
|
| | | userActiveLog.setOsVersion(acceptData.getOsVersion());
|
| | | userActiveLog.setDeviceType(acceptData.getDeviceType());
|
| | | userActiveLog.setDevice(acceptData.getDevice());
|
| | | userActiveLogService.addUserActiveLog(userActiveLog);
|
| | |
|
| | | // 处理用户信息
|
| | |
| | | return findOne(query);
|
| | | }
|
| | |
|
| | | public DouYinClickEvent selectByAndroidId(String androidId) {
|
| | | public DouYinClickEvent selectByUuid(String uuid) {
|
| | | Query query = new Query();
|
| | | query.addCriteria(Criteria.where("androidId").is(androidId));
|
| | | query.addCriteria(Criteria.where("uuid").is(uuid));
|
| | | return findOne(query);
|
| | | }
|
| | |
|
| | |
| | | |
| | | DeviceActive selectFirst(String device); |
| | | |
| | | DeviceActive selectFirstByImei(String imei); |
| | | |
| | | } |
| | |
| | | private String ipInfo;
|
| | | @Column(name = "da_channel")
|
| | | private String channel;// 渠道
|
| | | @Column(name = "da_imei")
|
| | | private String imei;
|
| | |
|
| | | public String getImei() {
|
| | | return imei;
|
| | | }
|
| | |
|
| | | public void setImei(String imei) {
|
| | | this.imei = imei;
|
| | | }
|
| | |
|
| | | public String getChannel() {
|
| | | return channel;
|
| | |
| | | <result column="da_updatetime" property="updateTime" jdbcType="TIMESTAMP" /> |
| | | <result column="da_ip" property="ipInfo" jdbcType="VARCHAR" /> |
| | | <result column="da_channel" property="channel" jdbcType="VARCHAR" /> |
| | | <result column="da_imei" property="imei" 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,da_channel</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,da_imei</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | | select |
| | |
| | | from yeshi_ec_device_active where da_device = #{0} order by da_id |
| | | limit 1 |
| | | </select> |
| | | |
| | | <select id="selectFirstByImei" resultMap="BaseResultMap" |
| | | parameterType="java.lang.String"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_device_active where da_imei = #{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> |
| | | <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_channel) |
| | | (da_id,da_platform,da_device,da_device_token_md5,da_device_token,da_version_code,da_createtime,da_updatetime,da_ip,da_channel,da_imei) |
| | | 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},#{channel,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},#{imei,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="updateTime != null">da_updatetime,</if> |
| | | <if test="ipInfo != null">da_ip,</if> |
| | | <if test="channel != null">da_channel,</if> |
| | | <if test="imei != null">da_imei,</if> |
| | | </trim> |
| | | values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="ipInfo != null">#{ipInfo,jdbcType=VARCHAR},</if> |
| | | <if test="channel != null">#{channel,jdbcType=VARCHAR}</if> |
| | | <if test="imei != null">#{imei,jdbcType=VARCHAR}</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.push.DeviceActive">update |
| | |
| | | #{versionCode,jdbcType=INTEGER},da_createtime = |
| | | #{createTime,jdbcType=TIMESTAMP},da_updatetime = |
| | | #{updateTime,jdbcType=TIMESTAMP},da_ip = #{ipInfo,jdbcType=VARCHAR} |
| | | ,da_channel =#{channel,jdbcType=VARCHAR} where da_id = |
| | | ,da_channel =#{channel,jdbcType=VARCHAR},da_imei =#{imei,jdbcType=VARCHAR} where da_id = |
| | | #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.push.DeviceActive"> |
| | | update yeshi_ec_device_active |
| | |
| | | <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> |
| | | <if test="imei !=null">da_imei =#{imei,jdbcType=VARCHAR},</if> |
| | | </set> |
| | | where da_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public DouYinClickEvent selectByAndroidId(String androidId) {
|
| | | return douYinClickEventDao.selectByAndroidId(androidId);
|
| | | public DouYinClickEvent selectByUuid(String uuid) {
|
| | | return douYinClickEventDao.selectByUuid(uuid);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | updateDeviceActive.setId(da.getId());
|
| | | updateDeviceActive.setUpdateTime(new Date());
|
| | | updateDeviceActive.setVersionCode(deviceActive.getVersionCode());
|
| | | if (StringUtil.isNullOrEmpty(da.getImei()))
|
| | | updateDeviceActive.setImei(deviceActive.getImei());
|
| | | if (!StringUtil.isNullOrEmpty(deviceActive.getDeviceToken())) {
|
| | | updateDeviceActive.setDeviceToken(deviceActive.getDeviceToken());
|
| | | updateDeviceActive.setDeviceTokenMd5(StringUtil.Md5(deviceActive.getDeviceToken()));
|
| | |
| | | return deviceActiveMapper.selectFirst(device);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public DeviceActive getFirstActiveInfoByImei(String imei) {
|
| | | return deviceActiveMapper.selectFirstByImei(imei);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | * @param androidId
|
| | | * @return
|
| | | */
|
| | | public DouYinClickEvent selectByAndroidId(String androidId);
|
| | | public DouYinClickEvent selectByUuid(String uuid);
|
| | |
|
| | | }
|
| | |
| | | * @return
|
| | | */
|
| | | public DeviceActive getFirstActiveInfo(String device);
|
| | | |
| | | /**
|
| | | * 根据IMEI查询
|
| | | * @param imei
|
| | | * @return
|
| | | */
|
| | | public DeviceActive getFirstActiveInfoByImei(String imei);
|
| | |
|
| | | }
|
| | |
| | | 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());
|
| | | DouYinClickEvent event = douYinClickEventService.selectByAid(active.getAid());
|
| | | if (event != null) {
|
| | | if (event.getOs() == 0) {
|
| | | DeviceActive deviceActive = deviceActiveService
|
| | | .getFirstActiveInfoByImei(event.getUuid());
|
| | | if (deviceActive != null) {
|
| | | 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 {// TODO 处理IOS
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | | } 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());
|
| | | }
|
| | | }
|
| | |
|
| | | if (active.getPlatform() == 1) {
|
| | | DeviceActive deviceActive = deviceActiveService
|
| | | .getFirstActiveInfo(active.getDevice());
|
| | | if (deviceActive != null) {
|
| | | DouYinClickEvent event = douYinClickEventService
|
| | | .selectByUuid(deviceActive.getImei());
|
| | | if (event != null) {// 回调
|
| | | if (deviceActive != null)
|
| | | DouYinAdUtil.activeAndroid(event.getCallback(), event.getImei(),
|
| | | deviceActive.getCreateTime().getTime());
|
| | | }
|
| | | }
|
| | | } else {
|
| | | // TODO 兼容IOS
|
| | | }
|
| | | }
|
| | | DouYinDeviceActiveCMQManager.getInstance().delete(key);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | url = url.substring(0, url.length() - 1);
|
| | | String sign = StringUtil.Md5(url + signKey);
|
| | | url += "&sign=" + sign;
|
| | | String result = HttpUtil.post(url);
|
| | | System.out.println(url);
|
| | | String result = HttpUtil.get(url);
|
| | | System.out.println(result);
|
| | | }
|
| | |
|