Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
open-source
/
rpc-openplatform
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit e9549c0a
authored
Dec 18, 2020
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
完成Dubbo基本开发 yangll
1 parent
e37e2b90
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
28 additions
and
25 deletions
rpc-openplatform-api/src/main/java/cn/com/glsx/openplatform/service/IndexService.java
rpc-openplatform-container/src/main/java/cn/com/glsx/openplatform/mapper/PlatformCustomerMapper.java
rpc-openplatform-container/src/main/java/cn/com/glsx/openplatform/service/ApiCallMgrServiceImpl.java
rpc-openplatform-container/src/main/java/cn/com/glsx/openplatform/service/DeviceMgrServiceImpl.java
rpc-openplatform-container/src/main/java/cn/com/glsx/openplatform/service/IndexServiceImpl.java
rpc-openplatform-container/src/main/resources/META-INF/orm/PlatformApiCallMapper.xml
rpc-openplatform-container/src/main/resources/META-INF/orm/PlatformDeviceMapper.xml
rpc-openplatform-api/src/main/java/cn/com/glsx/openplatform/service/IndexService.java
View file @
e9549c0
...
@@ -12,9 +12,9 @@ import java.util.Map;
...
@@ -12,9 +12,9 @@ import java.util.Map;
public
interface
IndexService
{
public
interface
IndexService
{
Map
<
String
,
Integer
>
getUcSummaryStatistic
(
String
customerName
);
Map
<
String
,
Integer
>
getUcSummaryStatistic
(
String
customerName
);
Map
<
String
,
Integer
>
getUcDeviceActivationStatistic
(
String
customerName
);
Map
<
String
,
Long
>
getUcDeviceActivationStatistic
(
String
customerName
);
Map
<
String
,
Integer
>
getUcUserActivityStatistic
(
String
customerName
);
Map
<
String
,
Long
>
getUcUserActivityStatistic
(
String
customerName
);
Map
<
String
,
Integer
>
getUcAppDownloadStatistic
(
String
customerName
);
Map
<
String
,
Long
>
getUcAppDownloadStatistic
(
String
customerName
);
}
}
rpc-openplatform-container/src/main/java/cn/com/glsx/openplatform/mapper/PlatformCustomerMapper.java
View file @
e9549c0
...
@@ -27,5 +27,5 @@ public interface PlatformCustomerMapper extends OreMapper<PlatformCustomer> {
...
@@ -27,5 +27,5 @@ public interface PlatformCustomerMapper extends OreMapper<PlatformCustomer> {
List
<
String
>
getAddressOptionList
(
@Param
(
"id"
)
int
id
);
List
<
String
>
getAddressOptionList
(
@Param
(
"id"
)
int
id
);
String
getAddressStr
(
@Param
(
"
province"
)
Integer
province
);
String
getAddressStr
(
@Param
(
"
id"
)
Integer
id
);
}
}
\ No newline at end of file
\ No newline at end of file
rpc-openplatform-container/src/main/java/cn/com/glsx/openplatform/service/ApiCallMgrServiceImpl.java
View file @
e9549c0
...
@@ -50,10 +50,10 @@ public class ApiCallMgrServiceImpl implements ApiCallMgrService {
...
@@ -50,10 +50,10 @@ public class ApiCallMgrServiceImpl implements ApiCallMgrService {
}
}
private
Date
getStatisticStartTime
()
{
private
Date
getStatisticStartTime
()
{
return
DateUtil
.
beginOfDay
(
new
Date
()
);
return
DateUtil
.
offsetDay
(
DateUtil
.
beginOfDay
(
new
Date
()),
-
31
);
}
}
private
Date
getStatisticEndTime
()
{
private
Date
getStatisticEndTime
()
{
return
DateUtil
.
offsetDay
(
DateUtil
.
beginOfDay
(
new
Date
()),
-
31
);
return
DateUtil
.
beginOfDay
(
new
Date
()
);
}
}
}
}
rpc-openplatform-container/src/main/java/cn/com/glsx/openplatform/service/DeviceMgrServiceImpl.java
View file @
e9549c0
...
@@ -69,10 +69,11 @@ public class DeviceMgrServiceImpl implements DeviceMgrService {
...
@@ -69,10 +69,11 @@ public class DeviceMgrServiceImpl implements DeviceMgrService {
}
}
private
Date
getStatisticStartTime
()
{
private
Date
getStatisticStartTime
()
{
return
DateUtil
.
beginOfDay
(
new
Date
());
return
DateUtil
.
offsetDay
(
DateUtil
.
beginOfDay
(
new
Date
()),
-
31
);
}
}
private
Date
getStatisticEndTime
()
{
private
Date
getStatisticEndTime
()
{
return
DateUtil
.
offsetDay
(
DateUtil
.
beginOfDay
(
new
Date
()),
-
31
);
return
DateUtil
.
beginOfDay
(
new
Date
()
);
}
}
}
}
rpc-openplatform-container/src/main/java/cn/com/glsx/openplatform/service/IndexServiceImpl.java
View file @
e9549c0
...
@@ -5,6 +5,7 @@ import java.util.Date;
...
@@ -5,6 +5,7 @@ import java.util.Date;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
cn.com.glsx.openplatform.mapper.PlatformAppDownloadMapper
;
import
cn.com.glsx.openplatform.mapper.PlatformAppDownloadMapper
;
import
cn.com.glsx.openplatform.mapper.PlatformDeviceMapper
;
import
cn.com.glsx.openplatform.mapper.PlatformDeviceMapper
;
import
cn.com.glsx.openplatform.mapper.PlatformUserMapper
;
import
cn.com.glsx.openplatform.mapper.PlatformUserMapper
;
...
@@ -47,8 +48,8 @@ public class IndexServiceImpl implements IndexService {
...
@@ -47,8 +48,8 @@ public class IndexServiceImpl implements IndexService {
}
}
@Override
@Override
public
Map
<
String
,
Integer
>
getUcDeviceActivationStatistic
(
String
customerName
)
{
public
Map
<
String
,
Long
>
getUcDeviceActivationStatistic
(
String
customerName
)
{
Map
<
String
,
Integer
>
statisticMap
;
Map
<
String
,
Long
>
statisticMap
;
List
<
Map
<
String
,
Object
>>
columnList
=
this
.
deviceMapper
.
getDeviceActivationStatistic
(
List
<
Map
<
String
,
Object
>>
columnList
=
this
.
deviceMapper
.
getDeviceActivationStatistic
(
this
.
getStatisticStartTime
(),
this
.
getStatisticEndTime
(),
this
.
getStatisticStartTime
(),
this
.
getStatisticEndTime
(),
customerName
);
customerName
);
...
@@ -58,8 +59,8 @@ public class IndexServiceImpl implements IndexService {
...
@@ -58,8 +59,8 @@ public class IndexServiceImpl implements IndexService {
}
}
@Override
@Override
public
Map
<
String
,
Integer
>
getUcUserActivityStatistic
(
String
customerName
)
{
public
Map
<
String
,
Long
>
getUcUserActivityStatistic
(
String
customerName
)
{
Map
<
String
,
Integer
>
statisticMap
;
Map
<
String
,
Long
>
statisticMap
;
List
<
Map
<
String
,
Object
>>
columnList
=
this
.
userMapper
.
getUserActivityStatistic
(
List
<
Map
<
String
,
Object
>>
columnList
=
this
.
userMapper
.
getUserActivityStatistic
(
this
.
getStatisticStartTime
(),
this
.
getStatisticEndTime
(),
this
.
getStatisticStartTime
(),
this
.
getStatisticEndTime
(),
customerName
);
customerName
);
...
@@ -69,8 +70,8 @@ public class IndexServiceImpl implements IndexService {
...
@@ -69,8 +70,8 @@ public class IndexServiceImpl implements IndexService {
}
}
@Override
@Override
public
Map
<
String
,
Integer
>
getUcAppDownloadStatistic
(
String
customerName
)
{
public
Map
<
String
,
Long
>
getUcAppDownloadStatistic
(
String
customerName
)
{
Map
<
String
,
Integer
>
statisticMap
;
Map
<
String
,
Long
>
statisticMap
;
List
<
Map
<
String
,
Object
>>
columnList
=
this
.
appDownloadMapper
.
getAppDownloadStatistic
(
List
<
Map
<
String
,
Object
>>
columnList
=
this
.
appDownloadMapper
.
getAppDownloadStatistic
(
this
.
getStatisticStartTime
(),
this
.
getStatisticEndTime
(),
this
.
getStatisticStartTime
(),
this
.
getStatisticEndTime
(),
customerName
);
customerName
);
...
@@ -87,11 +88,11 @@ public class IndexServiceImpl implements IndexService {
...
@@ -87,11 +88,11 @@ public class IndexServiceImpl implements IndexService {
return
DateUtil
.
beginOfDay
(
new
Date
());
return
DateUtil
.
beginOfDay
(
new
Date
());
}
}
private
Map
<
String
,
Integer
>
convertColumnToMap
(
List
<
Map
<
String
,
Object
>>
columnList
)
{
private
Map
<
String
,
Long
>
convertColumnToMap
(
List
<
Map
<
String
,
Object
>>
columnList
)
{
Map
<
String
,
Integer
>
statisticMap
=
new
HashMap
<>();
Map
<
String
,
Long
>
statisticMap
=
new
HashMap
<>();
for
(
Map
<
String
,
Object
>
columnMap
:
columnList
)
{
for
(
Map
<
String
,
Object
>
columnMap
:
columnList
)
{
statisticMap
.
put
((
String
)
columnMap
.
get
(
"time"
),
(
Integer
)
columnMap
.
get
(
"count"
));
statisticMap
.
put
((
String
)
columnMap
.
get
(
"time"
),
(
Long
)
columnMap
.
get
(
"count"
));
}
}
return
statisticMap
;
return
statisticMap
;
...
...
rpc-openplatform-container/src/main/resources/META-INF/orm/PlatformApiCallMapper.xml
View file @
e9549c0
...
@@ -48,7 +48,8 @@
...
@@ -48,7 +48,8 @@
</select>
</select>
<select
id=
"getApiCallGraphData"
resultType=
"java.util.Map"
>
<select
id=
"getApiCallGraphData"
resultType=
"java.util.Map"
>
select b.api_classification ,count(a.id)
select b.api_classification ,
count(a.id) as num
from t_platform_api_call a
from t_platform_api_call a
left join t_platform_api b
left join t_platform_api b
on a.api_id = b.id
on a.api_id = b.id
...
@@ -58,10 +59,10 @@
...
@@ -58,10 +59,10 @@
<select
id=
"getApiCallTrendList"
resultType=
"java.util.Map"
>
<select
id=
"getApiCallTrendList"
resultType=
"java.util.Map"
>
select
select
date_format(create_time,'%Y-%m-%d') as create_time,
date_format(create_time,'%Y-%m-%d') as create_time,
count(id)
count(id)
as num
from t_platform_api_call
from t_platform_api_call
where create_time >= #{startTime,jdbcType=TIMESTAMP}
where create_time >= #{sta
tisticSta
rtTime,jdbcType=TIMESTAMP}
and create_time
<
#{
e
ndTime,jdbcType=TIMESTAMP}
and create_time
<
#{
statisticE
ndTime,jdbcType=TIMESTAMP}
group by create_time
group by create_time
</select>
</select>
</mapper>
</mapper>
\ No newline at end of file
\ No newline at end of file
rpc-openplatform-container/src/main/resources/META-INF/orm/PlatformDeviceMapper.xml
View file @
e9549c0
...
@@ -68,7 +68,7 @@
...
@@ -68,7 +68,7 @@
<select
id=
"getDeviceGraphData"
resultType=
"java.util.Map"
>
<select
id=
"getDeviceGraphData"
resultType=
"java.util.Map"
>
select
select
device_type,
device_type,
count(id)
count(id)
as num
from t_platform_device
from t_platform_device
group by device_type
group by device_type
</select>
</select>
...
@@ -88,10 +88,10 @@
...
@@ -88,10 +88,10 @@
<select
id=
"getDeviceAccessTrendList"
resultType=
"java.util.Map"
>
<select
id=
"getDeviceAccessTrendList"
resultType=
"java.util.Map"
>
select
select
date_format(activat_time,'%Y-%m-%d') as activat_time,
date_format(activat_time,'%Y-%m-%d') as activat_time,
count(id)
count(id)
as num
from t_platform_device
from t_platform_device
where activat_time >= #{startTime,jdbcType=TIMESTAMP}
where activat_time >= #{sta
tisticSta
rtTime,jdbcType=TIMESTAMP}
and activat_time
<
#{
e
ndTime,jdbcType=TIMESTAMP}
and activat_time
<
#{
statisticE
ndTime,jdbcType=TIMESTAMP}
group by activat_time
group by activat_time
</select>
</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