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
fcae3536
Commit
fcae3536
authored
Jan 25, 2021
by
李增强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
m
parent
7d22ad6f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
16 deletions
+21
-16
lib/qm_tj.dart
lib/qm_tj.dart
+5
-5
lib/src/tj/app.dart
lib/src/tj/app.dart
+5
-4
lib/src/tj/exposure.dart
lib/src/tj/exposure.dart
+5
-2
lib/src/tj/page.dart
lib/src/tj/page.dart
+4
-3
lib/src/tj/tap.dart
lib/src/tj/tap.dart
+2
-2
No files found.
lib/qm_tj.dart
View file @
fcae3536
...
@@ -29,11 +29,11 @@ class QMTJ {
...
@@ -29,11 +29,11 @@ class QMTJ {
_tap
=
Tap
(
_db
);
_tap
=
Tap
(
_db
);
_exposure
=
Exposure
(
_db
);
_exposure
=
Exposure
(
_db
);
_db
.
init
();
_db
.
init
();
Future
.
delayed
(
Duration
(
seconds:
5
)).
then
((
value
)
{
Future
.
delayed
(
Duration
(
seconds:
5
)).
then
((
value
)
async
{
_app
.
upload
();
await
_app
.
upload
();
_page
.
upload
();
await
_page
.
upload
();
_tap
.
upload
();
await
_tap
.
upload
();
_exposure
.
upload
();
await
_exposure
.
upload
();
});
});
}
}
...
...
lib/src/tj/app.dart
View file @
fcae3536
...
@@ -6,6 +6,7 @@ import '../../src/utils.dart';
...
@@ -6,6 +6,7 @@ import '../../src/utils.dart';
class
App
{
class
App
{
DB
_db
;
DB
_db
;
String
_appStartUpId
;
String
_appStartUpId
;
int
startUpTime
=
Utils
.
getDateNow
();
App
(
DB
db
)
{
App
(
DB
db
)
{
_db
=
db
;
_db
=
db
;
...
@@ -17,7 +18,7 @@ class App {
...
@@ -17,7 +18,7 @@ class App {
// APP 启动生成本次启动ID
// APP 启动生成本次启动ID
if
(
_appStartUpId
==
null
)
{
if
(
_appStartUpId
==
null
)
{
type
=
1
;
type
=
1
;
_appStartUpId
=
Utils
.
md5
(
Utils
.
getDateNow
()
.
toString
());
_appStartUpId
=
Utils
.
md5
(
startUpTime
.
toString
());
}
}
int
disappearTime
=
0
;
int
disappearTime
=
0
;
int
appearTime
=
Utils
.
getDateNow
();
int
appearTime
=
Utils
.
getDateNow
();
...
@@ -49,9 +50,9 @@ class App {
...
@@ -49,9 +50,9 @@ class App {
}
}
// 上传数据至接口
// 上传数据至接口
void
upload
()
async
{
Future
<
void
>
upload
()
async
{
await
_db
.
ready
;
await
_db
.
ready
;
List
<
Map
>
list
=
await
_db
.
db
.
query
(
"app_tj"
,
limit:
100
,
offset:
0
);
List
<
Map
>
list
=
await
_db
.
db
.
query
(
"app_tj"
,
where:
"disappear_time < ?"
,
whereArgs:
[
startUpTime
],
limit:
100
,
offset:
0
);
if
(
list
.
length
==
0
)
{
if
(
list
.
length
==
0
)
{
return
;
return
;
}
}
...
@@ -71,7 +72,7 @@ class App {
...
@@ -71,7 +72,7 @@ class App {
Utils
.
log
(
"app upload_result"
,
{
"ok"
:
result
,
"length"
:
list
.
length
});
Utils
.
log
(
"app upload_result"
,
{
"ok"
:
result
,
"length"
:
list
.
length
});
}
}
if
(
list
.
length
==
100
)
{
if
(
list
.
length
==
100
)
{
upload
();
await
upload
();
}
}
}
}
}
}
lib/src/tj/exposure.dart
View file @
fcae3536
...
@@ -29,7 +29,7 @@ class Exposure {
...
@@ -29,7 +29,7 @@ class Exposure {
}
}
// 上传数据至接口
// 上传数据至接口
void
upload
()
async
{
Future
<
void
>
upload
()
async
{
await
_db
.
ready
;
await
_db
.
ready
;
List
<
Map
>
list
=
await
_db
.
db
.
query
(
"exposure_tj"
,
limit:
100
,
offset:
0
);
List
<
Map
>
list
=
await
_db
.
db
.
query
(
"exposure_tj"
,
limit:
100
,
offset:
0
);
if
(
list
.
length
==
0
)
{
if
(
list
.
length
==
0
)
{
...
@@ -52,7 +52,10 @@ class Exposure {
...
@@ -52,7 +52,10 @@ class Exposure {
"exposure_tj upload_result"
,
{
"ok"
:
result
,
"length"
:
list
.
length
});
"exposure_tj upload_result"
,
{
"ok"
:
result
,
"length"
:
list
.
length
});
}
}
if
(
list
.
length
==
100
)
{
if
(
list
.
length
==
100
)
{
upload
();
await
upload
();
}
}
}
}
}
}
lib/src/tj/page.dart
View file @
fcae3536
...
@@ -5,6 +5,7 @@ import '../../src/utils.dart';
...
@@ -5,6 +5,7 @@ import '../../src/utils.dart';
class
Page
{
class
Page
{
DB
_db
;
DB
_db
;
int
startUpTime
=
Utils
.
getDateNow
();
Page
(
DB
db
)
{
Page
(
DB
db
)
{
_db
=
db
;
_db
=
db
;
...
@@ -57,9 +58,9 @@ class Page {
...
@@ -57,9 +58,9 @@ class Page {
}
}
// 上传数据至接口
// 上传数据至接口
void
upload
()
async
{
Future
<
void
>
upload
()
async
{
await
_db
.
ready
;
await
_db
.
ready
;
List
<
Map
>
list
=
await
_db
.
db
.
query
(
"page_tj"
,
limit:
100
,
offset:
0
);
List
<
Map
>
list
=
await
_db
.
db
.
query
(
"page_tj"
,
where:
'disappear_time < ?'
,
whereArgs:
[
startUpTime
],
limit:
100
,
offset:
0
);
if
(
list
.
length
==
0
)
{
if
(
list
.
length
==
0
)
{
return
;
return
;
}
}
...
@@ -79,7 +80,7 @@ class Page {
...
@@ -79,7 +80,7 @@ class Page {
Utils
.
log
(
"page upload_result"
,
{
"ok"
:
result
,
"length"
:
list
.
length
});
Utils
.
log
(
"page upload_result"
,
{
"ok"
:
result
,
"length"
:
list
.
length
});
}
}
if
(
list
.
length
==
100
)
{
if
(
list
.
length
==
100
)
{
upload
();
await
upload
();
}
}
}
}
}
}
lib/src/tj/tap.dart
View file @
fcae3536
...
@@ -32,7 +32,7 @@ class Tap {
...
@@ -32,7 +32,7 @@ class Tap {
}
}
// 上传数据至接口
// 上传数据至接口
void
upload
()
async
{
Future
<
void
>
upload
()
async
{
await
_db
.
ready
;
await
_db
.
ready
;
List
<
Map
>
list
=
await
_db
.
db
.
query
(
"tap_tj"
,
limit:
100
,
offset:
0
);
List
<
Map
>
list
=
await
_db
.
db
.
query
(
"tap_tj"
,
limit:
100
,
offset:
0
);
if
(
list
.
length
==
0
)
{
if
(
list
.
length
==
0
)
{
...
@@ -54,7 +54,7 @@ class Tap {
...
@@ -54,7 +54,7 @@ class Tap {
Utils
.
log
(
"tap_tj upload_result"
,
{
"ok"
:
result
,
"length"
:
list
.
length
});
Utils
.
log
(
"tap_tj upload_result"
,
{
"ok"
:
result
,
"length"
:
list
.
length
});
}
}
if
(
list
.
length
==
100
)
{
if
(
list
.
length
==
100
)
{
upload
();
await
upload
();
}
}
}
}
}
}
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