Commit e9549c0a by 杨林龙

完成Dubbo基本开发 yangll

1 parent e37e2b90
...@@ -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);
} }
...@@ -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
...@@ -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());
} }
} }
...@@ -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());
} }
} }
...@@ -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;
......
...@@ -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 >= #{statisticStartTime,jdbcType=TIMESTAMP}
and create_time &lt; #{endTime,jdbcType=TIMESTAMP} and create_time &lt; #{statisticEndTime,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
...@@ -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 >= #{statisticStartTime,jdbcType=TIMESTAMP}
and activat_time &lt; #{endTime,jdbcType=TIMESTAMP} and activat_time &lt; #{statisticEndTime,jdbcType=TIMESTAMP}
group by activat_time group by activat_time
</select> </select>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!