Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
QM_TJ
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李增强
QM_TJ
Commits
95016b34
Commit
95016b34
authored
Jan 23, 2021
by
李增强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
m
parent
bec1ce93
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
6 deletions
+39
-6
lib/qm_tj.dart
lib/qm_tj.dart
+39
-6
No files found.
lib/qm_tj.dart
View file @
95016b34
...
...
@@ -8,6 +8,7 @@ import 'package:crypto/crypto.dart' as crypto;
class
QMTJ
{
static
DB
_db
;
static
Http
_http
;
static
String
_appStartUpId
;
static
Future
<
bool
>
ready
;
...
...
@@ -19,16 +20,12 @@ class QMTJ {
}
static
init
()
{
_http
=
Http
(
scheme:
"http"
,
host:
"8.135.58.206"
,
port:
8802
);
_appStartUpId
=
_md5
(
_getDateNow
().
toString
());
ready
=
new
Future
<
bool
>(()
async
{
_db
=
new
DB
();
await
_db
.
init
();
List
<
Map
>
list
=
await
_db
.
db
.
query
(
"page_tj"
);
print
(
"+++++++++++++++++++++++++++++
${list.length}
"
);
List
<
String
>
ids
=
[
list
[
0
][
'id'
],
list
[
1
][
'id'
],
list
[
2
][
'id'
]];
List
<
Map
>
list2
=
await
_db
.
db
.
rawQuery
(
"select * FROM page_tj where id in('
${ids.join("','")}
')"
);
print
(
"++++++++++++
$ids
+++++++++++++++++
${list2.length}
+++++
${"select * FROM page_tj where id in(\"${ids.join('","')}
\"
)"
}
");
uploadPageTj
();
return
true
;
});
}
...
...
@@ -185,6 +182,42 @@ class QMTJ {
await
_db
.
db
.
insert
(
"exposure_tj"
,
map
);
}
// 上传页面统计
static
void
uploadPageTj
()
async
{
List
<
Map
>
list
=
await
_db
.
db
.
query
(
"page_tj"
,
limit:
100
,
offset:
0
);
if
(
list
.
length
==
0
)
{
return
;
}
list
=
list
.
map
((
e
)
{
var
item
=
{
"app_version"
:
'0.0.1'
,
"app_channel"
:
"APP渠道"
,
"devices_id"
:
'3A26610FFE43D5838DDE7A40BA2E3E2C'
,
"inter"
:
'4G'
,
"source"
:
e
[
'source'
],
"page_id"
:
e
[
'page_id'
],
"last_page_id"
:
e
[
'last_page_id'
],
"come_time"
:
e
[
'appear_time'
],
"out_time"
:
e
[
'disappear_time'
],
"extras"
:
json
.
decode
(
e
[
'extras'
])
};
Map
project
=
{
"event_name"
:
"page_scan"
,
"app"
:
"xx"
,
"event_info"
:
item
};
return
project
;
}).
toList
();
_http
.
post
(
"/collection"
,
{
"project"
:
json
.
encode
(
list
)}).
then
((
value
)
{
if
(
isDebug
)
{
log
(
"upload_page_tj"
,
value
);
}
});
}
/// 获取当前时间戳,单位:秒
static
int
_getDateNow
()
{
int
now
=
(
DateTime
.
now
().
millisecondsSinceEpoch
/
1000
).
floor
();
...
...
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