Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
L
label
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
提交
打开侧边栏
zhenxin.ma
label
提交
b98a80ff
提交
b98a80ff
编写于
8月 14, 2020
作者:
wuyunfeng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改SessionProcessHeart
上级
2df226da
变更
2
展开全部
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
209 行增加
和
203 行删除
+209
-203
SessionProcessHeart.scala
src/main/scala/com/session/SessionProcessHeart.scala
+191
-167
SessionProcessPref.scala
src/main/scala/com/session/SessionProcessPref.scala
+18
-36
未找到文件。
src/main/scala/com/session/SessionProcessHeart.scala
浏览文件 @
b98a80ff
此差异已折叠。
点击以展开。
src/main/scala/com/session/SessionProcessPref.scala
浏览文件 @
b98a80ff
...
...
@@ -218,41 +218,22 @@ class SessionProcessPref extends java.io.Serializable{
// }
//3.拆分 component_tag字段
val
component_tag
:
String
=
StringUtils
.
getNotNullString
(
row
.
getAs
[
String
](
"component_tag"
))
var
menu_code
:
String
=
""
var
action_code
:
String
=
""
var
position
:
String
=
""
var
label_value
:
String
=
""
var
label_class
:
String
=
""
val
tagArr
=
Array
(
"menu_code"
,
"action_code"
,
"position"
,
"label_value"
,
"label_class"
)
val
tagMap
=
scala
.
collection
.
immutable
.
Map
[
String
,
String
]()
tagArr
.
foreach
(
r
=>
tagMap
.+(
r
->
""
))
//将符合要求的component_tag进行切割,获取 aciton_code,label_value
if
(
component_tag
.
contains
(
"#"
))
{
//按照#号切割
val
strs
:
Array
[
String
]
=
component_tag
.
split
(
"#"
)
strs
.
length
match
{
case
1
=>
{
menu_code
=
strs
(
0
)
}
case
2
=>
{
menu_code
=
strs
(
0
)
action_code
=
strs
(
1
)
}
case
3
=>
{
menu_code
=
strs
(
0
)
action_code
=
strs
(
1
)
position
=
strs
(
2
)
}
case
4
=>
{
menu_code
=
strs
(
0
)
action_code
=
strs
(
1
)
position
=
strs
(
2
)
label_value
=
strs
(
3
).
substring
(
0
,
math
.
min
(
250
,
strs
(
3
).
length
))
}
case
_
=>
{
menu_code
=
strs
(
0
)
action_code
=
strs
(
1
)
position
=
strs
(
2
)
label_value
=
strs
(
3
).
substring
(
0
,
math
.
min
(
250
,
strs
(
3
).
length
))
label_class
=
strs
(
4
).
substring
(
0
,
math
.
min
(
250
,
strs
(
4
).
length
))
var
index
=
0
for
(
value
<-
strs
)
{
val
filedName
=
tagArr
.
apply
(
index
)
if
(
"label_value"
.
equals
(
filedName
))
{
tagMap
.+(
filedName
->
value
.
substring
(
0
,
math
.
min
(
250
,
strs
(
3
).
length
)))
}
else
{
tagMap
.+(
filedName
->
value
)
}
index
+=
1
}
}
// //匹配menu_code:如果上述截取出来的menu_code为(''||null||0||length(menu_code)>3 ) and action is ACTION_VIEW
...
...
@@ -282,7 +263,8 @@ class SessionProcessPref extends java.io.Serializable{
StringUtils
.
getNotNullString
(
row
.
getAs
[
String
](
"user_token_tourist"
)),
StringUtils
.
getNotNullString
(
row
.
getAs
[
String
](
"class_name"
)),
StringUtils
.
getNotNullString
(
row
.
getAs
[
String
](
"view_path"
)),
action
,
component_tag
,
menu_code
,
action_code
,
position
,
label_value
,
label_class
,
action
,
component_tag
,
tagMap
(
"menu_code"
),
tagMap
(
"action_code"
),
tagMap
(
"position"
),
tagMap
(
"label_value"
),
tagMap
(
"label_class"
),
StringUtils
.
getNotNullString
(
row
.
getAs
[
String
](
"app_version"
)),
StringUtils
.
getNotNullString
(
row
.
getAs
[
String
](
"device_type"
)),
StringUtils
.
getNotNullString
(
row
.
getAs
[
String
](
"device_brand"
)),
...
...
@@ -317,11 +299,11 @@ class SessionProcessPref extends java.io.Serializable{
//以下的所有逻辑是为了补全user_id字段
//第一步:首先筛选出不符合的use_id数据,将这些user_id置为字符串'0'
val
noMatchUserIdDF
:
Dataset
[
Row
]
=
DF
.
where
(
"user_id ='' OR user_id = '0' OR LENGTH(user_id) = 24"
)
.
selectExpr
(
"pseudo_session"
,
"'0' as user_id"
,
"mobile"
,
"device_token"
,
"user_token"
,
"view_class"
,
"view_path"
,
"action"
,
"component_tag"
,
"menu_code"
,
"action_code"
,
"position"
,
"label_value"
,
"label_class"
,
"app_version"
,
"device_type"
,
"device_brand"
,
"device_model"
,
"net_type"
,
"created_time"
,
"date_time"
,
"web_data"
,
"web_data_type"
,
"alternate_info"
,
"login_state"
,
"first_app_version"
,
"serviceName"
)
//
.selectExpr("pseudo_session","'0' as user_id","mobile","device_token","user_token",
//
"view_class","view_path","action" ,"component_tag","menu_code",
//
"action_code","position","label_value","label_class","app_version","device_type",
//
"device_brand","device_model","net_type","created_time",
//
"date_time","web_data","web_data_type","alternate_info","login_state","first_app_version","serviceName")
noMatchUserIdDF
.
createOrReplaceTempView
(
MyConfigSession
.
VIEW_SESSION_NO_MATCH
)
//1.筛选出上一步没有匹配到的user_id,先按照mobile_phone进行匹配
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录