Commit e9549c0a by 杨林龙

完成Dubbo基本开发 yangll

1 parent e37e2b90
......@@ -12,9 +12,9 @@ import java.util.Map;
public interface IndexService {
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> {
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
......@@ -50,10 +50,10 @@ public class ApiCallMgrServiceImpl implements ApiCallMgrService {
}
private Date getStatisticStartTime() {
return DateUtil.beginOfDay(new Date());
return DateUtil.offsetDay(DateUtil.beginOfDay(new Date()), -31);
}
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 {
}
private Date getStatisticStartTime() {
return DateUtil.beginOfDay(new Date());
return DateUtil.offsetDay(DateUtil.beginOfDay(new Date()), -31);
}
private Date getStatisticEndTime() {
return DateUtil.offsetDay(DateUtil.beginOfDay(new Date()), -31);
return DateUtil.beginOfDay(new Date());
}
}
......@@ -5,6 +5,7 @@ import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import cn.com.glsx.openplatform.mapper.PlatformAppDownloadMapper;
import cn.com.glsx.openplatform.mapper.PlatformDeviceMapper;
import cn.com.glsx.openplatform.mapper.PlatformUserMapper;
......@@ -47,8 +48,8 @@ public class IndexServiceImpl implements IndexService {
}
@Override
public Map<String, Integer> getUcDeviceActivationStatistic(String customerName) {
Map<String, Integer> statisticMap;
public Map<String, Long> getUcDeviceActivationStatistic(String customerName) {
Map<String, Long> statisticMap;
List<Map<String, Object>> columnList = this.deviceMapper.getDeviceActivationStatistic(
this.getStatisticStartTime(), this.getStatisticEndTime(),
customerName);
......@@ -58,8 +59,8 @@ public class IndexServiceImpl implements IndexService {
}
@Override
public Map<String, Integer> getUcUserActivityStatistic(String customerName) {
Map<String, Integer> statisticMap;
public Map<String, Long> getUcUserActivityStatistic(String customerName) {
Map<String, Long> statisticMap;
List<Map<String, Object>> columnList = this.userMapper.getUserActivityStatistic(
this.getStatisticStartTime(), this.getStatisticEndTime(),
customerName);
......@@ -69,8 +70,8 @@ public class IndexServiceImpl implements IndexService {
}
@Override
public Map<String, Integer> getUcAppDownloadStatistic(String customerName) {
Map<String, Integer> statisticMap;
public Map<String, Long> getUcAppDownloadStatistic(String customerName) {
Map<String, Long> statisticMap;
List<Map<String, Object>> columnList = this.appDownloadMapper.getAppDownloadStatistic(
this.getStatisticStartTime(), this.getStatisticEndTime(),
customerName);
......@@ -87,11 +88,11 @@ public class IndexServiceImpl implements IndexService {
return DateUtil.beginOfDay(new Date());
}
private Map<String, Integer> convertColumnToMap(List<Map<String, Object>> columnList) {
Map<String, Integer> statisticMap = new HashMap<>();
private Map<String, Long> convertColumnToMap(List<Map<String, Object>> columnList) {
Map<String, Long> statisticMap = new HashMap<>();
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;
......
......@@ -48,7 +48,8 @@
</select>
<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
left join t_platform_api b
on a.api_id = b.id
......@@ -58,10 +59,10 @@
<select id="getApiCallTrendList" resultType="java.util.Map">
select
date_format(create_time,'%Y-%m-%d') as create_time,
count(id)
count(id) as num
from t_platform_api_call
where create_time >= #{startTime,jdbcType=TIMESTAMP}
and create_time &lt; #{endTime,jdbcType=TIMESTAMP}
where create_time >= #{statisticStartTime,jdbcType=TIMESTAMP}
and create_time &lt; #{statisticEndTime,jdbcType=TIMESTAMP}
group by create_time
</select>
</mapper>
\ No newline at end of file
......@@ -68,7 +68,7 @@
<select id="getDeviceGraphData" resultType="java.util.Map">
select
device_type,
count(id)
count(id) as num
from t_platform_device
group by device_type
</select>
......@@ -88,10 +88,10 @@
<select id="getDeviceAccessTrendList" resultType="java.util.Map">
select
date_format(activat_time,'%Y-%m-%d') as activat_time,
count(id)
count(id) as num
from t_platform_device
where activat_time >= #{startTime,jdbcType=TIMESTAMP}
and activat_time &lt; #{endTime,jdbcType=TIMESTAMP}
where activat_time >= #{statisticStartTime,jdbcType=TIMESTAMP}
and activat_time &lt; #{statisticEndTime,jdbcType=TIMESTAMP}
group by activat_time
</select>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!