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

计划转long

parent 96fec3ee
...@@ -100,7 +100,7 @@ public class UniversalProcess { ...@@ -100,7 +100,7 @@ public class UniversalProcess {
/******************************************** JDBC *************************************************************/ /******************************************** JDBC *************************************************************/
@Cached(name="appchannel_novel", cacheType = CacheType.LOCAL) @Cached(name="appchannel_novel", cacheType = CacheType.LOCAL)
@CacheRefresh(refresh = 300) @CacheRefresh(refresh = 300)
public Integer getAppChannel(int platformId, int channelId){ public Integer getAppChannel(int platformId, Long channelId){
try { 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); 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) { } catch (EmptyResultDataAccessException e) {
......
...@@ -56,11 +56,11 @@ public class DyStoryUniversalProcess extends UniversalProcess { ...@@ -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); 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); 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 { ...@@ -75,7 +75,7 @@ public class DyStoryUniversalProcess extends UniversalProcess {
@Cached(name="attribute_rule_store_novel", cacheType = CacheType.LOCAL) @Cached(name="attribute_rule_store_novel", cacheType = CacheType.LOCAL)
@CacheRefresh(refresh = 300) @CacheRefresh(refresh = 300)
public String getAttributeRuleByPlatformIdAndChannelId(int platformId,int channelId) { public String getAttributeRuleByPlatformIdAndChannelId(int platformId,Long channelId) {
try { 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); 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) { } catch (EmptyResultDataAccessException e) {
......
...@@ -47,7 +47,7 @@ public class ParameterSetupStoryNovelFlow extends NodeFlow<StoryNovelAction> { ...@@ -47,7 +47,7 @@ public class ParameterSetupStoryNovelFlow extends NodeFlow<StoryNovelAction> {
action.setCurrentDateStr(DateTimUtils.getCurrentDateString()); action.setCurrentDateStr(DateTimUtils.getCurrentDateString());
if (CallBackType.active.getType().equals(0)) { 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> { ...@@ -62,8 +62,8 @@ public class ParameterSetupStoryNovelFlow extends NodeFlow<StoryNovelAction> {
deliveryDeviceInfo.setPromotion_id(storyLogin.getAdid()); deliveryDeviceInfo.setPromotion_id(storyLogin.getAdid());
deliveryDeviceInfo.setBook_id(storyLogin.getBookId()); deliveryDeviceInfo.setBook_id(storyLogin.getBookId());
action.setDeliveryDeviceInfo(deliveryDeviceInfo); action.setDeliveryDeviceInfo(deliveryDeviceInfo);
action.setChannelId(NumberUtils.parseInteger(storyLogin.getChannel())); action.setChannelId(NumberUtils.parseLong(storyLogin.getChannel()));
action.setPlanId(NumberUtils.parseInteger((storyLogin.getAdid()))); action.setPlanId(NumberUtils.parseLong((storyLogin.getAdid())));
action.setMediaName(storyLogin.getMedia()); action.setMediaName(storyLogin.getMedia());
action.setMedia(Media.getMedia(action.getMediaName(), Platform.DY_STORY)); action.setMedia(Media.getMedia(action.getMediaName(), Platform.DY_STORY));
} }
......
...@@ -39,7 +39,7 @@ public class PaySpduFlow extends NodeSwitchFlow<StoryNovelAction> { ...@@ -39,7 +39,7 @@ public class PaySpduFlow extends NodeSwitchFlow<StoryNovelAction> {
@Override @Override
public void process(StoryNovelAction action) { public void process(StoryNovelAction action) {
int platformId = action.getPlatformId(); int platformId = action.getPlatformId();
int channelId = action.getChannelId(); Long channelId = action.getChannelId();
String shaveMakeCall = up.getAttributeRuleByPlatformIdAndChannelId(platformId,channelId); String shaveMakeCall = up.getAttributeRuleByPlatformIdAndChannelId(platformId,channelId);
if (StringUtils.isEmpty(shaveMakeCall)) { if (StringUtils.isEmpty(shaveMakeCall)) {
//直接回传,走回传流 //直接回传,走回传流
......
...@@ -56,11 +56,11 @@ public class NovelUniversalProcess extends UniversalProcess { ...@@ -56,11 +56,11 @@ public class NovelUniversalProcess extends UniversalProcess {
/******************************************** ASSEMBLE KEY ***************************************************/ /******************************************** 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); 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); return String.format("%s_callback_%d_%d_%d_%s", attributionType, platformId, channelOrPlanId, sprDedu, dateStr);
} }
......
...@@ -62,12 +62,12 @@ public class ParameterSetupFlow extends NodeFlow<NovelAction> { ...@@ -62,12 +62,12 @@ public class ParameterSetupFlow extends NodeFlow<NovelAction> {
action.setNewUser(DateTimUtils.isCurrentDayTime(clientInfo.getUser().getRegistrationDate())); action.setNewUser(DateTimUtils.isCurrentDayTime(clientInfo.getUser().getRegistrationDate()));
action.setCurrentDateStr(DateTimUtils.getCurrentDateString()); action.setCurrentDateStr(DateTimUtils.getCurrentDateString());
action.setRegistrationDate(clientInfo.getUser().getRegistrationDate()); action.setRegistrationDate(clientInfo.getUser().getRegistrationDate());
action.setChannelId(clientInfo.getChannel()); action.setChannelId((long)clientInfo.getChannel());
//非商店吊起参数设置 //非商店吊起参数设置
if (Objects.nonNull(deliveryDeviceInfo)) { if (Objects.nonNull(deliveryDeviceInfo)) {
action.setChannelId(NumberUtils.parseInteger(deliveryDeviceInfo.getDj_channel())); action.setChannelId(NumberUtils.parseLong(deliveryDeviceInfo.getDj_channel()));
action.setPlanId(NumberUtils.parseInteger((deliveryDeviceInfo.getAd_plan_id()))); action.setPlanId(NumberUtils.parseLong((deliveryDeviceInfo.getAd_plan_id())));
action.setAdvertiserId(deliveryDeviceInfo.getAdvertiser_id()); action.setAdvertiserId(deliveryDeviceInfo.getAdvertiser_id());
action.setMediaName(deliveryDeviceInfo.getMedia()); action.setMediaName(deliveryDeviceInfo.getMedia());
action.setMedia(Media.getMedia(action.getMediaName(), Platform.NOVEL)); action.setMedia(Media.getMedia(action.getMediaName(), Platform.NOVEL));
......
...@@ -7,9 +7,11 @@ import com.alicp.jetcache.anno.CacheType; ...@@ -7,9 +7,11 @@ import com.alicp.jetcache.anno.CacheType;
import com.alicp.jetcache.anno.Cached; import com.alicp.jetcache.anno.Cached;
import com.lwby.marketing.att.bystory.DyStoryFlowExecutor; import com.lwby.marketing.att.bystory.DyStoryFlowExecutor;
import com.lwby.marketing.att.bystory.DyStoryUniversalProcess; import com.lwby.marketing.att.bystory.DyStoryUniversalProcess;
import com.lwby.marketing.att.novel.AttributionType;
import com.lwby.marketing.po.CrossCallback; import com.lwby.marketing.po.CrossCallback;
import com.lwby.marketing.util.DateTimUtils; import com.lwby.marketing.util.DateTimUtils;
import com.lwby.marketing.vo.CrossPlatformAccount; import com.lwby.marketing.vo.CrossPlatformAccount;
import com.lwby.marketing.vo.DeliveryDeviceInfo;
import com.lwby.marketing.vo.StoryNovelAction; import com.lwby.marketing.vo.StoryNovelAction;
import com.lwby.marketing.vo.StoreUserUploadEventBO; import com.lwby.marketing.vo.StoreUserUploadEventBO;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -72,8 +74,11 @@ public class AttrController { ...@@ -72,8 +74,11 @@ public class AttrController {
@RequestMapping("dedu") @RequestMapping("dedu")
public void testDedu() { public void testDedu() {
String totalCountKey = up.getTotalCountKey(AttributionType.CHANNEL, 5, 50007L, "1", 50, "2024-03-20");
System.out.println(totalCountKey);
Integer platformId = 5; Integer platformId = 5;
Integer channelId = 123213; Long channelId = 50007L;
Integer sprDedu = up.getAppChannel(platformId, channelId); Integer sprDedu = up.getAppChannel(platformId, channelId);
if (sprDedu == null || sprDedu == 100) { if (sprDedu == null || sprDedu == 100) {
System.out.println(sprDedu); System.out.println(sprDedu);
...@@ -178,6 +183,14 @@ public class AttrController { ...@@ -178,6 +183,14 @@ public class AttrController {
@RequestMapping("testcross") @RequestMapping("testcross")
public void 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" JSONObject platformPrizeExpireJson = com.alibaba.fastjson2.JSON.parseObject("{\n"
+ " \"5\": 259200,\n" + " \"5\": 259200,\n"
+ " \"6\": 259200,\n" + " \"6\": 259200,\n"
......
...@@ -3,7 +3,7 @@ package com.lwby.marketing.util; ...@@ -3,7 +3,7 @@ package com.lwby.marketing.util;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
public class NumberUtils { public class NumberUtils {
public static int parseInteger(String value) { public static Long parseLong(String value) {
return StringUtils.isNotBlank(value) ? Integer.parseInt(value) : -1; return StringUtils.isNotBlank(value) ? Long.parseLong(value) : -1;
} }
} }
...@@ -13,8 +13,8 @@ public class NovelAction extends Action { ...@@ -13,8 +13,8 @@ public class NovelAction extends Action {
DeliveryDeviceInfo deliveryDeviceInfo; DeliveryDeviceInfo deliveryDeviceInfo;
int platformId; int platformId;
long userId; long userId;
int channelId; Long channelId;
int planId; Long planId;
String advertiserId; String advertiserId;
String deviceId; String deviceId;
String mediaName; String mediaName;
......
...@@ -18,8 +18,8 @@ public class StoryNovelAction extends Action { ...@@ -18,8 +18,8 @@ public class StoryNovelAction extends Action {
String openId; String openId;
int platformId; int platformId;
long userId; long userId;
int channelId; Long channelId;
int planId; Long planId;
String mediaName; String mediaName;
Integer type; Integer type;
Media media; 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