Commit 55f0cee5 authored by 宋新宇's avatar 宋新宇

计划转long

parent 96fec3ee
......@@ -100,7 +100,7 @@ public class UniversalProcess {
/******************************************** JDBC *************************************************************/
@Cached(name="appchannel_novel", cacheType = CacheType.LOCAL)
@CacheRefresh(refresh = 300)
public Integer getAppChannel(int platformId, int channelId){
public Integer getAppChannel(int platformId, Long channelId){
try {
return lwbyJdbcTemplate.queryForObject(String.format("select spr_dedu from app_channel where platform_id=%d and channel_id=%s ORDER BY update_time DESC LIMIT 1",platformId,String.valueOf(channelId)),Integer.class);
} catch (EmptyResultDataAccessException e) {
......
......@@ -56,11 +56,11 @@ public class DyStoryUniversalProcess extends UniversalProcess {
);
}
public String getTotalCountKey(AttributionType attributionType, int platformId, int channelOrPlanId,String goodsId ,int sprDedu, String dateStr) {
public String getTotalCountKey(AttributionType attributionType, int platformId, Long channelOrPlanId,String goodsId ,int sprDedu, String dateStr) {
return String.format("%s_total_%d_%d_%s_%d_%s", attributionType, platformId, channelOrPlanId,goodsId, sprDedu, dateStr);
}
public String getCallbackCountKey(AttributionType attributionType, int platformId, int channelOrPlanId,String goodsId, int sprDedu, String dateStr) {
public String getCallbackCountKey(AttributionType attributionType, int platformId, Long channelOrPlanId,String goodsId, int sprDedu, String dateStr) {
return String.format("%s_callback_%d_%d_%s_%d_%s", attributionType, platformId, channelOrPlanId,goodsId, sprDedu, dateStr);
}
......@@ -75,7 +75,7 @@ public class DyStoryUniversalProcess extends UniversalProcess {
@Cached(name="attribute_rule_store_novel", cacheType = CacheType.LOCAL)
@CacheRefresh(refresh = 300)
public String getAttributeRuleByPlatformIdAndChannelId(int platformId,int channelId) {
public String getAttributeRuleByPlatformIdAndChannelId(int platformId,Long channelId) {
try {
return lwbyJdbcTemplate.queryForObject(String.format("select shave_make_call from attribute_rule where channel_id=%d and platform_id=%d",channelId,platformId),String.class);
} catch (EmptyResultDataAccessException e) {
......
......@@ -47,7 +47,7 @@ public class ParameterSetupStoryNovelFlow extends NodeFlow<StoryNovelAction> {
action.setCurrentDateStr(DateTimUtils.getCurrentDateString());
if (CallBackType.active.getType().equals(0)) {
action.setChannelId(action.getClientInfo().getChannel());
action.setChannelId((long)action.getClientInfo().getChannel());
}
......@@ -62,8 +62,8 @@ public class ParameterSetupStoryNovelFlow extends NodeFlow<StoryNovelAction> {
deliveryDeviceInfo.setPromotion_id(storyLogin.getAdid());
deliveryDeviceInfo.setBook_id(storyLogin.getBookId());
action.setDeliveryDeviceInfo(deliveryDeviceInfo);
action.setChannelId(NumberUtils.parseInteger(storyLogin.getChannel()));
action.setPlanId(NumberUtils.parseInteger((storyLogin.getAdid())));
action.setChannelId(NumberUtils.parseLong(storyLogin.getChannel()));
action.setPlanId(NumberUtils.parseLong((storyLogin.getAdid())));
action.setMediaName(storyLogin.getMedia());
action.setMedia(Media.getMedia(action.getMediaName(), Platform.DY_STORY));
}
......
......@@ -39,7 +39,7 @@ public class PaySpduFlow extends NodeSwitchFlow<StoryNovelAction> {
@Override
public void process(StoryNovelAction action) {
int platformId = action.getPlatformId();
int channelId = action.getChannelId();
Long channelId = action.getChannelId();
String shaveMakeCall = up.getAttributeRuleByPlatformIdAndChannelId(platformId,channelId);
if (StringUtils.isEmpty(shaveMakeCall)) {
//直接回传,走回传流
......
......@@ -56,11 +56,11 @@ public class NovelUniversalProcess extends UniversalProcess {
/******************************************** ASSEMBLE KEY ***************************************************/
public String getTotalCountKey(AttributionType attributionType, int platformId, int channelOrPlanId, int sprDedu, String dateStr) {
public String getTotalCountKey(AttributionType attributionType, int platformId, Long channelOrPlanId, int sprDedu, String dateStr) {
return String.format("%s_total_%d_%d_%d_%s", attributionType, platformId, channelOrPlanId, sprDedu, dateStr);
}
public String getCallbackCountKey(AttributionType attributionType, int platformId, int channelOrPlanId, int sprDedu, String dateStr) {
public String getCallbackCountKey(AttributionType attributionType, int platformId, Long channelOrPlanId, int sprDedu, String dateStr) {
return String.format("%s_callback_%d_%d_%d_%s", attributionType, platformId, channelOrPlanId, sprDedu, dateStr);
}
......
......@@ -62,12 +62,12 @@ public class ParameterSetupFlow extends NodeFlow<NovelAction> {
action.setNewUser(DateTimUtils.isCurrentDayTime(clientInfo.getUser().getRegistrationDate()));
action.setCurrentDateStr(DateTimUtils.getCurrentDateString());
action.setRegistrationDate(clientInfo.getUser().getRegistrationDate());
action.setChannelId(clientInfo.getChannel());
action.setChannelId((long)clientInfo.getChannel());
//非商店吊起参数设置
if (Objects.nonNull(deliveryDeviceInfo)) {
action.setChannelId(NumberUtils.parseInteger(deliveryDeviceInfo.getDj_channel()));
action.setPlanId(NumberUtils.parseInteger((deliveryDeviceInfo.getAd_plan_id())));
action.setChannelId(NumberUtils.parseLong(deliveryDeviceInfo.getDj_channel()));
action.setPlanId(NumberUtils.parseLong((deliveryDeviceInfo.getAd_plan_id())));
action.setAdvertiserId(deliveryDeviceInfo.getAdvertiser_id());
action.setMediaName(deliveryDeviceInfo.getMedia());
action.setMedia(Media.getMedia(action.getMediaName(), Platform.NOVEL));
......
......@@ -7,9 +7,11 @@ import com.alicp.jetcache.anno.CacheType;
import com.alicp.jetcache.anno.Cached;
import com.lwby.marketing.att.bystory.DyStoryFlowExecutor;
import com.lwby.marketing.att.bystory.DyStoryUniversalProcess;
import com.lwby.marketing.att.novel.AttributionType;
import com.lwby.marketing.po.CrossCallback;
import com.lwby.marketing.util.DateTimUtils;
import com.lwby.marketing.vo.CrossPlatformAccount;
import com.lwby.marketing.vo.DeliveryDeviceInfo;
import com.lwby.marketing.vo.StoryNovelAction;
import com.lwby.marketing.vo.StoreUserUploadEventBO;
import lombok.extern.slf4j.Slf4j;
......@@ -72,8 +74,11 @@ public class AttrController {
@RequestMapping("dedu")
public void testDedu() {
String totalCountKey = up.getTotalCountKey(AttributionType.CHANNEL, 5, 50007L, "1", 50, "2024-03-20");
System.out.println(totalCountKey);
Integer platformId = 5;
Integer channelId = 123213;
Long channelId = 50007L;
Integer sprDedu = up.getAppChannel(platformId, channelId);
if (sprDedu == null || sprDedu == 100) {
System.out.println(sprDedu);
......@@ -178,6 +183,14 @@ public class AttrController {
@RequestMapping("testcross")
public void testCross() {
DeliveryDeviceInfo deliveryDeviceInfo = new DeliveryDeviceInfo();
deliveryDeviceInfo.setDevice_id("1231eqw");
deliveryDeviceInfo.setPlatform_id("6");
up.set("opt",120,JSON.toJSONString(deliveryDeviceInfo));
DeliveryDeviceInfo opt = up.get(DeliveryDeviceInfo.class, "opt");
JSONObject platformPrizeExpireJson = com.alibaba.fastjson2.JSON.parseObject("{\n"
+ " \"5\": 259200,\n"
+ " \"6\": 259200,\n"
......
......@@ -3,7 +3,7 @@ package com.lwby.marketing.util;
import org.apache.commons.lang3.StringUtils;
public class NumberUtils {
public static int parseInteger(String value) {
return StringUtils.isNotBlank(value) ? Integer.parseInt(value) : -1;
public static Long parseLong(String value) {
return StringUtils.isNotBlank(value) ? Long.parseLong(value) : -1;
}
}
......@@ -13,8 +13,8 @@ public class NovelAction extends Action {
DeliveryDeviceInfo deliveryDeviceInfo;
int platformId;
long userId;
int channelId;
int planId;
Long channelId;
Long planId;
String advertiserId;
String deviceId;
String mediaName;
......
......@@ -18,8 +18,8 @@ public class StoryNovelAction extends Action {
String openId;
int platformId;
long userId;
int channelId;
int planId;
Long channelId;
Long planId;
String mediaName;
Integer type;
Media media;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment