Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
open-source
/
open-platform-admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 17f29119
authored
Dec 17, 2020
by
tyfanchz
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
用户控制台总览统计
1 parent
7eb234b8
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
31 additions
and
37 deletions
src/main/java/com/glsx/controller/IndexController.java
src/main/java/com/glsx/service/IndexService.java
src/main/java/com/glsx/service/impl/IndexServiceImpl.java
src/main/resources/mapper/PlatformAppDownloadMapper.xml
src/main/resources/mapper/PlatformDeviceMapper.xml
src/main/resources/mapper/PlatformUserMapper.xml
src/main/java/com/glsx/controller/IndexController.java
View file @
17f2911
package
com
.
glsx
.
controller
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
com.glsx.service.ApiCallMgrService
;
import
com.glsx.service.AppDownloadMgrService
;
...
...
@@ -118,22 +117,22 @@ public class IndexController {
@RequestMapping
(
value
=
"/getUcDeviceActivationStatistic"
,
method
=
RequestMethod
.
GET
)
public
R
getUcDeviceActivationStatistic
(
String
customerName
)
{
List
<
Map
<
String
,
Integer
>>
statisticList
=
this
.
indexService
Map
<
String
,
Integer
>
statisticMap
=
this
.
indexService
.
getUcDeviceActivationStatistic
(
customerName
);
return
R
.
ok
().
data
(
statistic
List
);
return
R
.
ok
().
data
(
statistic
Map
);
}
@RequestMapping
(
value
=
"/getUcUserActivityStatistic"
,
method
=
RequestMethod
.
GET
)
public
R
getUcUserActivityStatistic
(
String
customerName
)
{
List
<
Map
<
String
,
Integer
>>
statisticList
=
this
.
indexService
Map
<
String
,
Integer
>
statisticMap
=
this
.
indexService
.
getUcUserActivityStatistic
(
customerName
);
return
R
.
ok
().
data
(
statistic
List
);
return
R
.
ok
().
data
(
statistic
Map
);
}
@RequestMapping
(
value
=
"/getUcAppDownloadStatistic"
,
method
=
RequestMethod
.
GET
)
public
R
getUcAppDownloadStatistic
(
String
customerName
)
{
List
<
Map
<
String
,
Integer
>>
statisticList
=
this
.
indexService
Map
<
String
,
Integer
>
statisticMap
=
this
.
indexService
.
getUcAppDownloadStatistic
(
customerName
);
return
R
.
ok
().
data
(
statistic
List
);
return
R
.
ok
().
data
(
statistic
Map
);
}
}
src/main/java/com/glsx/service/IndexService.java
View file @
17f2911
package
com
.
glsx
.
service
;
import
java.util.List
;
import
java.util.Map
;
/**
...
...
@@ -13,9 +12,9 @@ import java.util.Map;
public
interface
IndexService
{
Map
<
String
,
Integer
>
getUcSummaryStatistic
(
String
customerName
);
List
<
Map
<
String
,
Integer
>
>
getUcDeviceActivationStatistic
(
String
customerName
);
Map
<
String
,
Integer
>
getUcDeviceActivationStatistic
(
String
customerName
);
List
<
Map
<
String
,
Integer
>
>
getUcUserActivityStatistic
(
String
customerName
);
Map
<
String
,
Integer
>
getUcUserActivityStatistic
(
String
customerName
);
List
<
Map
<
String
,
Integer
>
>
getUcAppDownloadStatistic
(
String
customerName
);
Map
<
String
,
Integer
>
getUcAppDownloadStatistic
(
String
customerName
);
}
src/main/java/com/glsx/service/impl/IndexServiceImpl.java
View file @
17f2911
package
com
.
glsx
.
service
.
impl
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
...
...
@@ -49,36 +48,36 @@ public class IndexServiceImpl implements IndexService {
}
@Override
public
List
<
Map
<
String
,
Integer
>
>
getUcDeviceActivationStatistic
(
String
customerName
)
{
List
<
Map
<
String
,
Integer
>>
statisticList
;
public
Map
<
String
,
Integer
>
getUcDeviceActivationStatistic
(
String
customerName
)
{
Map
<
String
,
Integer
>
statisticMap
;
List
<
Map
<
String
,
Object
>>
columnList
=
this
.
deviceMapper
.
getDeviceActivationStatistic
(
this
.
getStatisticStartTime
(),
this
.
getStatisticEndTime
(),
customerName
);
statistic
List
=
this
.
convertColumnToMap
(
columnList
,
"activateTime"
,
"count"
);
statistic
Map
=
this
.
convertColumnToMap
(
columnList
);
return
statistic
List
;
return
statistic
Map
;
}
@Override
public
List
<
Map
<
String
,
Integer
>
>
getUcUserActivityStatistic
(
String
customerName
)
{
List
<
Map
<
String
,
Integer
>>
statisticList
;
public
Map
<
String
,
Integer
>
getUcUserActivityStatistic
(
String
customerName
)
{
Map
<
String
,
Integer
>
statisticMap
;
List
<
Map
<
String
,
Object
>>
columnList
=
this
.
userMapper
.
getUserActivityStatistic
(
this
.
getStatisticStartTime
(),
this
.
getStatisticEndTime
(),
customerName
);
statistic
List
=
this
.
convertColumnToMap
(
columnList
,
"lastLoginTime"
,
"count"
);
statistic
Map
=
this
.
convertColumnToMap
(
columnList
);
return
statistic
List
;
return
statistic
Map
;
}
@Override
public
List
<
Map
<
String
,
Integer
>
>
getUcAppDownloadStatistic
(
String
customerName
)
{
List
<
Map
<
String
,
Integer
>>
statisticList
;
public
Map
<
String
,
Integer
>
getUcAppDownloadStatistic
(
String
customerName
)
{
Map
<
String
,
Integer
>
statisticMap
;
List
<
Map
<
String
,
Object
>>
columnList
=
this
.
appDownloadMapper
.
getAppDownloadStatistic
(
this
.
getStatisticStartTime
(),
this
.
getStatisticEndTime
(),
customerName
);
statistic
List
=
this
.
convertColumnToMap
(
columnList
,
"appDownloadTime"
,
"count"
);
statistic
Map
=
this
.
convertColumnToMap
(
columnList
);
return
statistic
List
;
return
statistic
Map
;
}
private
Date
getStatisticStartTime
()
{
...
...
@@ -89,16 +88,13 @@ public class IndexServiceImpl implements IndexService {
return
DateUtil
.
offsetDay
(
DateUtil
.
beginOfDay
(
new
Date
()),
-
31
);
}
private
List
<
Map
<
String
,
Integer
>>
convertColumnToMap
(
List
<
Map
<
String
,
Object
>>
columnList
,
String
key
,
String
value
)
{
List
<
Map
<
String
,
Integer
>>
statisticList
=
new
ArrayList
<>();
private
Map
<
String
,
Integer
>
convertColumnToMap
(
List
<
Map
<
String
,
Object
>>
columnList
)
{
Map
<
String
,
Integer
>
statisticMap
=
new
HashMap
<>();
for
(
Map
<
String
,
Object
>
columnMap
:
columnList
)
{
Map
<
String
,
Integer
>
statisticMap
=
new
HashMap
<>();
statisticMap
.
put
((
String
)
columnMap
.
get
(
key
),
(
Integer
)
columnMap
.
get
(
value
));
statisticList
.
add
(
statisticMap
);
statisticMap
.
put
((
String
)
columnMap
.
get
(
"time"
),
(
Integer
)
columnMap
.
get
(
"count"
));
}
return
statistic
List
;
return
statistic
Map
;
}
}
src/main/resources/mapper/PlatformAppDownloadMapper.xml
View file @
17f2911
...
...
@@ -25,7 +25,7 @@
</select>
<select
id=
"getAppDownloadStatistic"
resultType=
"map"
>
select date_format(pad.create_time, '%Y-%m-%d') `
appDownloadT
ime`,
select date_format(pad.create_time, '%Y-%m-%d') `
t
ime`,
count(pad.create_time) `count`
from t_platform_app_download pad
left join t_platform_customer pc on pc.id = pad.customer_id
...
...
@@ -36,7 +36,7 @@
and pc.customer_name = #{customerName,jdbcType=VARCHAR}
</if>
</where>
group by
appDownloadT
ime
group by
t
ime
</select>
...
...
src/main/resources/mapper/PlatformDeviceMapper.xml
View file @
17f2911
...
...
@@ -80,7 +80,7 @@
</select>
<select
id=
"getDeviceActivationStatistic"
resultType=
"map"
>
select date_format(pd.activat_time, '%Y-%m-%d') `
activateT
ime`,
select date_format(pd.activat_time, '%Y-%m-%d') `
t
ime`,
count(pd.activat_time) `count`
from t_platform_device pd
left join t_platform_customer pc on pc.id = pd.customer_id
...
...
@@ -91,7 +91,7 @@
and pc.customer_name = #{customerName,jdbcType=VARCHAR}
</if>
</where>
group by
activateT
ime
group by
t
ime
</select>
...
...
src/main/resources/mapper/PlatformUserMapper.xml
View file @
17f2911
...
...
@@ -78,7 +78,7 @@
</select>
<select
id=
"getUserActivityStatistic"
resultType=
"map"
>
select date_format(pu.last_login_time, '%Y-%m-%d') `
lastLoginT
ime`,
select date_format(pu.last_login_time, '%Y-%m-%d') `
t
ime`,
count(pu.last_login_time) `count`
from t_platform_user pu
left join t_platform_customer pc on pc.id = pu.customer_id
...
...
@@ -89,7 +89,7 @@
and pc.customer_name = #{customerName,jdbcType=VARCHAR}
</if>
</where>
group by
lastLoginT
ime
group by
t
ime
</select>
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment