Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-cloud
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
data-hook
gic-cloud
Commits
f4724411
Commit
f4724411
authored
Sep 10, 2021
by
陶光胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
取数平台调整
parent
6b563d69
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
4 deletions
+32
-4
DataInitUtils.java
...n/java/com/gic/cloud/data/hook/service/DataInitUtils.java
+26
-2
FlatQueryResultServiceImpl.java
...ud/data/hook/service/impl/FlatQueryResultServiceImpl.java
+5
-2
FreeQueryServiceImpl.java
...ic/cloud/data/hook/service/impl/FreeQueryServiceImpl.java
+1
-0
No files found.
gic-cloud-data-hook-service/src/main/java/com/gic/cloud/data/hook/service/DataInitUtils.java
View file @
f4724411
...
@@ -4,7 +4,7 @@ import cn.medubi.client.utils.LogPak;
...
@@ -4,7 +4,7 @@ import cn.medubi.client.utils.LogPak;
import
com.ctrip.framework.apollo.Config
;
import
com.ctrip.framework.apollo.Config
;
import
com.ctrip.framework.apollo.ConfigService
;
import
com.ctrip.framework.apollo.ConfigService
;
import
com.gic.cloud.data.hook.api.dto.DownloadRecord
;
import
com.gic.cloud.data.hook.api.dto.DownloadRecord
;
import
com.gic.cloud.data.hook.
service.impl.FlatQueryResultServiceImpl
;
import
com.gic.cloud.data.hook.
api.dto.DownloadTask
;
import
java.net.InetAddress
;
import
java.net.InetAddress
;
import
java.net.NetworkInterface
;
import
java.net.NetworkInterface
;
...
@@ -15,13 +15,17 @@ import java.util.List;
...
@@ -15,13 +15,17 @@ import java.util.List;
public
class
DataInitUtils
{
public
class
DataInitUtils
{
private
static
LogPak
log
=
new
LogPak
(
DataInitUtils
.
class
);
private
static
LogPak
log
=
new
LogPak
(
DataInitUtils
.
class
);
private
static
String
host
=
""
;
static
{
host
=
getHost
();
}
public
static
List
<
DownloadRecord
>
listByHost
(
List
<
DownloadRecord
>
allList
){
public
static
List
<
DownloadRecord
>
listByHost
(
List
<
DownloadRecord
>
allList
){
List
<
DownloadRecord
>
list
=
new
ArrayList
<>();
List
<
DownloadRecord
>
list
=
new
ArrayList
<>();
Config
config
=
ConfigService
.
getConfig
(
"application"
);
Config
config
=
ConfigService
.
getConfig
(
"application"
);
String
customRouterHost
=
config
.
getProperty
(
"customRouterHost"
,
""
);
String
customRouterHost
=
config
.
getProperty
(
"customRouterHost"
,
""
);
String
customRouterEnterpriseId
=
config
.
getProperty
(
"customRouterEnterpriseId"
,
""
);
String
customRouterEnterpriseId
=
config
.
getProperty
(
"customRouterEnterpriseId"
,
""
);
String
host
=
getHost
();
log
.
debug
(
"查询本机的内网ip"
,
host
);
log
.
debug
(
"查询本机的内网ip"
,
host
);
for
(
DownloadRecord
downloadRecord
:
allList
){
for
(
DownloadRecord
downloadRecord
:
allList
){
if
(
host
.
equals
(
customRouterHost
)){
if
(
host
.
equals
(
customRouterHost
)){
...
@@ -37,6 +41,26 @@ public class DataInitUtils {
...
@@ -37,6 +41,26 @@ public class DataInitUtils {
return
list
;
return
list
;
}
}
public
static
List
<
DownloadTask
>
listTaskByHost
(
List
<
DownloadTask
>
allList
){
List
<
DownloadTask
>
list
=
new
ArrayList
<>();
Config
config
=
ConfigService
.
getConfig
(
"application"
);
String
customRouterHost
=
config
.
getProperty
(
"customRouterHost"
,
""
);
String
customRouterEnterpriseId
=
config
.
getProperty
(
"customRouterEnterpriseId"
,
""
);
log
.
debug
(
"查询本机的内网ip"
,
host
);
for
(
DownloadTask
downloadTask
:
allList
){
if
(
host
.
equals
(
customRouterHost
)){
if
(
customRouterEnterpriseId
.
equals
(
downloadTask
.
getEnterpriseId
())){
list
.
add
(
downloadTask
);
}
}
else
{
if
(!
customRouterEnterpriseId
.
equals
(
downloadTask
.
getEnterpriseId
())){
list
.
add
(
downloadTask
);
}
}
}
return
list
;
}
private
static
String
getHost
(){
private
static
String
getHost
(){
String
localip
=
null
;
// 本地IP,如果没有配置外网IP则返回它
String
localip
=
null
;
// 本地IP,如果没有配置外网IP则返回它
String
netip
=
null
;
// 外网IP
String
netip
=
null
;
// 外网IP
...
...
gic-cloud-data-hook-service/src/main/java/com/gic/cloud/data/hook/service/impl/FlatQueryResultServiceImpl.java
View file @
f4724411
...
@@ -18,6 +18,7 @@ import com.google.common.collect.Lists;
...
@@ -18,6 +18,7 @@ import com.google.common.collect.Lists;
import
com.opencsv.CSVWriter
;
import
com.opencsv.CSVWriter
;
import
com.opencsv.ResultSetHelper
;
import
com.opencsv.ResultSetHelper
;
import
io.netty.handler.codec.http.HttpUtil
;
import
io.netty.handler.codec.http.HttpUtil
;
import
javafx.scene.chart.PieChart
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.concurrent.BasicThreadFactory
;
import
org.apache.commons.lang3.concurrent.BasicThreadFactory
;
...
@@ -358,6 +359,7 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService {
...
@@ -358,6 +359,7 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService {
public
Integer
estimateFlatQueryDownloadTask
(
String
tableId
,
List
<
String
>
enterpriseIds
,
public
Integer
estimateFlatQueryDownloadTask
(
String
tableId
,
List
<
String
>
enterpriseIds
,
List
<
FlatQueryCondition
>
queryConditions
,
String
orderField
,
List
<
FlatQueryCondition
>
queryConditions
,
String
orderField
,
String
orderDir
,
Boolean
execDistinct
,
List
<
String
>
authStoreIdList
)
{
String
orderDir
,
Boolean
execDistinct
,
List
<
String
>
authStoreIdList
)
{
log
.
debug
(
"estimateFlatQueryDownloadTask"
,
tableId
);
Integer
result
=
-
1
;
Integer
result
=
-
1
;
// 生成正式查询
// 生成正式查询
String
preQuery
=
this
.
buildFlatQuerySQL
(
String
preQuery
=
this
.
buildFlatQuerySQL
(
...
@@ -904,12 +906,13 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService {
...
@@ -904,12 +906,13 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService {
@Override
@Override
public
void
run
()
{
public
void
run
()
{
List
<
DownloadTask
>
waitingTasks
=
DownloadTaskServiceImpl
.
getInstance
().
getDownloadTaskOfWaiting
(
QueryDataSource
.
FLAT_QUERY
);
List
<
DownloadTask
>
waitingTasks
=
DownloadTaskServiceImpl
.
getInstance
().
getDownloadTaskOfWaiting
(
QueryDataSource
.
FLAT_QUERY
);
waitingTasks
=
DataInitUtils
.
listTaskByHost
(
waitingTasks
);
for
(
DownloadTask
task
:
waitingTasks
)
{
for
(
DownloadTask
task
:
waitingTasks
)
{
log
.
debug
(
"自助指标待审批任务状态变更"
,
JSON
.
toJSONString
(
task
));
//
log.debug("自助指标待审批任务状态变更", JSON.toJSONString(task));
if
(!
task
.
getApplyId
().
equals
(
""
))
{
if
(!
task
.
getApplyId
().
equals
(
""
))
{
// String applyStatusText = HttpUtils.doGet("http://www.gicdev.com/api-admin/apply-info?type=2&applyId=" + task.getApplyId());
// String applyStatusText = HttpUtils.doGet("http://www.gicdev.com/api-admin/apply-info?type=2&applyId=" + task.getApplyId());
String
applyStatusText
=
HttpUtils
.
doGet
(
"http://hope.demogic.com/api-admin/apply-info?type=2&applyId="
+
task
.
getApplyId
());
String
applyStatusText
=
HttpUtils
.
doGet
(
"http://hope.demogic.com/api-admin/apply-info?type=2&applyId="
+
task
.
getApplyId
());
log
.
debug
(
"runApplyTask.run"
,
"查询自助指标查询 "
+
task
.
getId
()
+
" 审核状态码"
+
applyStatusText
);
//
log.debug("runApplyTask.run", "查询自助指标查询 " + task.getId() + " 审核状态码" + applyStatusText);
if
(
StringUtils
.
isBlank
(
applyStatusText
)){
if
(
StringUtils
.
isBlank
(
applyStatusText
)){
break
;
break
;
}
}
...
...
gic-cloud-data-hook-service/src/main/java/com/gic/cloud/data/hook/service/impl/FreeQueryServiceImpl.java
View file @
f4724411
...
@@ -99,6 +99,7 @@ public class FreeQueryServiceImpl implements IFreeQueryService {
...
@@ -99,6 +99,7 @@ public class FreeQueryServiceImpl implements IFreeQueryService {
@Override
@Override
public
List
<
FreeQueryTable
>
getFreeQueryTableList
()
{
public
List
<
FreeQueryTable
>
getFreeQueryTableList
()
{
log
.
debug
(
"getFreeQueryTableList"
,
"getFreeQueryTableList"
);
return
MysqlHelper
.
getFreeQueryTableList
();
return
MysqlHelper
.
getFreeQueryTableList
();
}
}
...
...
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