Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-spark-tag-4.0
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangxiaokang
gic-spark-tag-4.0
Commits
650d1da6
Commit
650d1da6
authored
Aug 28, 2020
by
guos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
会员标签4.0
parent
e868abef
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
12 deletions
+8
-12
TagOnlineConsumptionStoreFilter.java
...com/gic/spark/filter/TagOnlineConsumptionStoreFilter.java
+5
-0
TagFilterFactory.java
src/main/java/com/gic/spark/tag/TagFilterFactory.java
+0
-3
TagProcessManager.java
src/main/java/com/gic/spark/tag/TagProcessManager.java
+3
-9
No files found.
src/main/java/com/gic/spark/filter/TagOnlineConsumptionStoreFilter.java
View file @
650d1da6
...
@@ -27,9 +27,14 @@ public class TagOnlineConsumptionStoreFilter extends AbstractTagConsumRecordFilt
...
@@ -27,9 +27,14 @@ public class TagOnlineConsumptionStoreFilter extends AbstractTagConsumRecordFilt
private
static
TagOnlineConsumptionStoreFilter
instance
;
private
static
TagOnlineConsumptionStoreFilter
instance
;
public
static
TagOnlineConsumptionStoreFilter
getInstance
()
{
public
static
TagOnlineConsumptionStoreFilter
getInstance
()
{
if
(
null
==
instance
){
instance
=
new
TagOnlineConsumptionStoreFilter
();
}
return
instance
;
return
instance
;
}
}
private
TagOnlineConsumptionStoreFilter
(){}
@Override
@Override
public
List
<
DataSourceEntity
>
necessarySourceList
()
{
public
List
<
DataSourceEntity
>
necessarySourceList
()
{
List
<
DataSourceEntity
>
result
=
new
ArrayList
();
List
<
DataSourceEntity
>
result
=
new
ArrayList
();
...
...
src/main/java/com/gic/spark/tag/TagFilterFactory.java
View file @
650d1da6
...
@@ -24,10 +24,8 @@ public class TagFilterFactory {
...
@@ -24,10 +24,8 @@ public class TagFilterFactory {
private
TagFilterFactory
(){}
private
TagFilterFactory
(){}
public
BaseTagFilter
getTagFilter
(
TagConditionDTO
conditionDTO
){
public
BaseTagFilter
getTagFilter
(
TagConditionDTO
conditionDTO
){
System
.
out
.
println
(
"conditionDTO==>"
+
JSONObject
.
toJSONString
(
conditionDTO
));
BaseTagFilter
tagFilter
=
null
;
BaseTagFilter
tagFilter
=
null
;
if
(
StringUtils
.
isNotEmpty
(
conditionDTO
.
getTagEsFieldName
())){
if
(
StringUtils
.
isNotEmpty
(
conditionDTO
.
getTagEsFieldName
())){
System
.
out
.
println
(
"tagEsFieldName==>"
+
conditionDTO
.
getTagEsFieldName
());
switch
(
conditionDTO
.
getTagEsFieldName
())
{
switch
(
conditionDTO
.
getTagEsFieldName
())
{
//积分信息
//积分信息
case
TagConstant
.
TAG_CODE_ACCUMULATED_INTEGRAL
:
case
TagConstant
.
TAG_CODE_ACCUMULATED_INTEGRAL
:
...
@@ -154,7 +152,6 @@ public class TagFilterFactory {
...
@@ -154,7 +152,6 @@ public class TagFilterFactory {
tagFilter
=
TagHistoryOnlineConsumptionStoreFilter
.
getInstance
();
tagFilter
=
TagHistoryOnlineConsumptionStoreFilter
.
getInstance
();
break
;
break
;
case
TagConstant
.
TAG_CODE_ONLINE_CONSUMPTION_STORE
:
case
TagConstant
.
TAG_CODE_ONLINE_CONSUMPTION_STORE
:
System
.
out
.
println
(
"TAG_CODE_ONLINE_CONSUMPTION_STORE==>"
+
conditionDTO
.
getTagEsFieldName
());
tagFilter
=
TagOnlineConsumptionStoreFilter
.
getInstance
();
tagFilter
=
TagOnlineConsumptionStoreFilter
.
getInstance
();
break
;
break
;
...
...
src/main/java/com/gic/spark/tag/TagProcessManager.java
View file @
650d1da6
...
@@ -129,7 +129,6 @@ public class TagProcessManager {
...
@@ -129,7 +129,6 @@ public class TagProcessManager {
public
void
process
(
boolean
extractData
){
public
void
process
(
boolean
extractData
){
System
.
out
.
println
(
"sceneCrowdDTOList==>"
+
JSONObject
.
toJSONString
(
sceneCrowdDTOList
));
Map
<
Integer
,
List
<
TagProcessEntity
>>
tagGroupByEnterpriseMap
=
new
HashMap
<>();
Map
<
Integer
,
List
<
TagProcessEntity
>>
tagGroupByEnterpriseMap
=
new
HashMap
<>();
Map
<
Long
,
BaseTagFilter
>
tagIdToFilterMap
=
new
HashMap
();
Map
<
Long
,
BaseTagFilter
>
tagIdToFilterMap
=
new
HashMap
();
...
@@ -138,17 +137,14 @@ public class TagProcessManager {
...
@@ -138,17 +137,14 @@ public class TagProcessManager {
LinkedList
<
TagConditionGroupDTO
>
conditionGroupDTOS
=
sceneCrowdDTO
.
getConditionGroupDTOList
();
LinkedList
<
TagConditionGroupDTO
>
conditionGroupDTOS
=
sceneCrowdDTO
.
getConditionGroupDTOList
();
for
(
int
i
=
0
;
i
<
conditionGroupDTOS
.
size
();
i
++){
for
(
int
i
=
0
;
i
<
conditionGroupDTOS
.
size
();
i
++){
System
.
out
.
println
(
"conditionGroupDTOS.szie==>"
+
conditionGroupDTOS
.
size
());
TagProcessEntity
entity
=
new
TagProcessEntity
();
TagProcessEntity
entity
=
new
TagProcessEntity
();
entity
.
enterpriseId
=
sceneCrowdDTO
.
getEnterprise_Id
();
entity
.
enterpriseId
=
sceneCrowdDTO
.
getEnterprise_Id
();
entity
.
tagGroupId
=
sceneCrowdDTO
.
getId
();
entity
.
tagGroupId
=
sceneCrowdDTO
.
getId
();
entity
.
level
=
i
+
1
;
entity
.
level
=
i
+
1
;
entity
.
tagList
=
conditionGroupDTOS
.
get
(
i
).
getConditionInfos
();
entity
.
tagList
=
conditionGroupDTOS
.
get
(
i
).
getConditionInfos
();
System
.
out
.
println
(
"entity==>"
+
JSONObject
.
toJSONString
(
entity
));
for
(
TagConditionDTO
conditionDTO:
entity
.
tagList
){
//将tag同filter进行映射
for
(
TagConditionDTO
conditionDTO:
entity
.
tagList
){
//将tag同filter进行映射
BaseTagFilter
tagFilter
=
TagFilterFactory
.
getInstance
().
getTagFilter
(
conditionDTO
);
BaseTagFilter
tagFilter
=
TagFilterFactory
.
getInstance
().
getTagFilter
(
conditionDTO
);
System
.
out
.
println
(
"tagFilter==>"
+
tagFilter
);
if
(
null
!=
tagFilter
){
if
(
null
!=
tagFilter
){
tagIdToFilterMap
.
put
(
conditionDTO
.
getTagId
(),
tagFilter
);
tagIdToFilterMap
.
put
(
conditionDTO
.
getTagId
(),
tagFilter
);
/*for(DataSourceEntity sourceEntity:tagFilter.necessarySourceList()){
/*for(DataSourceEntity sourceEntity:tagFilter.necessarySourceList()){
...
@@ -169,12 +165,10 @@ public class TagProcessManager {
...
@@ -169,12 +165,10 @@ public class TagProcessManager {
}
}
tagGroupByEnterpriseMap
.
get
(
sceneCrowdDTO
.
getEnterprise_Id
()).
add
(
entity
);
tagGroupByEnterpriseMap
.
get
(
sceneCrowdDTO
.
getEnterprise_Id
()).
add
(
entity
);
System
.
out
.
println
(
"tagGroupByEnterpriseMap1==>"
+
JSONObject
.
toJSONString
(
tagGroupByEnterpriseMap
));
}
}
}
}
}
}
System
.
out
.
println
(
"tagGroupByEnterpriseMap==>"
+
JSONObject
.
toJSONString
(
tagGroupByEnterpriseMap
));
//准备标签需要的数据
//准备标签需要的数据
for
(
Map
.
Entry
<
Integer
,
List
<
TagProcessEntity
>>
enterpriseTagEntry
:
tagGroupByEnterpriseMap
.
entrySet
())
{
for
(
Map
.
Entry
<
Integer
,
List
<
TagProcessEntity
>>
enterpriseTagEntry
:
tagGroupByEnterpriseMap
.
entrySet
())
{
...
@@ -182,9 +176,9 @@ public class TagProcessManager {
...
@@ -182,9 +176,9 @@ public class TagProcessManager {
for
(
TagConditionDTO
conditionDTO
:
processEntity
.
tagList
)
{
for
(
TagConditionDTO
conditionDTO
:
processEntity
.
tagList
)
{
if
(
tagIdToFilterMap
.
containsKey
(
conditionDTO
.
getTagId
()))
{
if
(
tagIdToFilterMap
.
containsKey
(
conditionDTO
.
getTagId
()))
{
for
(
DataSourceEntity
sourceEntity
:
tagIdToFilterMap
.
get
(
conditionDTO
.
getTagId
()).
necessarySourceList
())
{
for
(
DataSourceEntity
sourceEntity
:
tagIdToFilterMap
.
get
(
conditionDTO
.
getTagId
()).
necessarySourceList
())
{
System
.
out
.
println
(
"enterpriseId==>"
+
enterpriseTagEntry
.
getKey
());
//
System.out.println("enterpriseId==>"+enterpriseTagEntry.getKey());
System
.
out
.
println
(
"SourceKey==>"
+
sourceEntity
.
getSourceKey
());
//
System.out.println("SourceKey==>"+sourceEntity.getSourceKey());
System
.
out
.
println
(
"HiveTableName==>"
+
sourceEntity
.
getHiveTableName
());
//
System.out.println("HiveTableName==>"+sourceEntity.getHiveTableName());
DataSourceManager
.
getInstance
().
addSourceEntity
(
sourceEntity
,
enterpriseTagEntry
.
getKey
().
intValue
());
DataSourceManager
.
getInstance
().
addSourceEntity
(
sourceEntity
,
enterpriseTagEntry
.
getKey
().
intValue
());
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment