|
@@ -28,6 +28,7 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
@@ -202,8 +203,6 @@ public class SysPcAddressServiceImpl extends ServiceImpl<SysPcAddressMapper, Sys
|
|
|
@Override
|
|
@Override
|
|
|
public PcAddressHistoryInfoVo getPcAddress(String dates) {
|
|
public PcAddressHistoryInfoVo getPcAddress(String dates) {
|
|
|
PcAddressHistoryInfoVo pcAddressHistoryInfoVo = new PcAddressHistoryInfoVo();
|
|
PcAddressHistoryInfoVo pcAddressHistoryInfoVo = new PcAddressHistoryInfoVo();
|
|
|
- List<PcAddressHistoryTimeVo> pcAddress = sysPcAddressHistoryMapper.getPcAddress(dates);
|
|
|
|
|
- pcAddressHistoryInfoVo.setList(pcAddress);
|
|
|
|
|
QueryWrapper<SysPcAddressHistory> queryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<SysPcAddressHistory> queryWrapper = new QueryWrapper<>();
|
|
|
// 指定 COUNT(DISTINCT user_id) 查询
|
|
// 指定 COUNT(DISTINCT user_id) 查询
|
|
|
queryWrapper.select("COUNT(DISTINCT user_id) AS total").likeRight(StringUtils.isNotEmpty(dates), "operation_time", dates)
|
|
queryWrapper.select("COUNT(DISTINCT user_id) AS total").likeRight(StringUtils.isNotEmpty(dates), "operation_time", dates)
|
|
@@ -211,6 +210,13 @@ public class SysPcAddressServiceImpl extends ServiceImpl<SysPcAddressMapper, Sys
|
|
|
Map<String, Object> result = sysPcAddressHistoryService.getMap(queryWrapper);
|
|
Map<String, Object> result = sysPcAddressHistoryService.getMap(queryWrapper);
|
|
|
Long total = (Long) result.get("total");
|
|
Long total = (Long) result.get("total");
|
|
|
pcAddressHistoryInfoVo.setOnlineNum(total);
|
|
pcAddressHistoryInfoVo.setOnlineNum(total);
|
|
|
|
|
+ if (StringUtils.isNullOrEmpty(dates)) {
|
|
|
|
|
+ Date date = new Date();
|
|
|
|
|
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
+ dates = simpleDateFormat.format(date);
|
|
|
|
|
+ }
|
|
|
|
|
+ List<PcAddressHistoryTimeVo> pcAddress = sysPcAddressHistoryMapper.getPcAddress(dates);
|
|
|
|
|
+ pcAddressHistoryInfoVo.setList(pcAddress);
|
|
|
|
|
|
|
|
return pcAddressHistoryInfoVo;
|
|
return pcAddressHistoryInfoVo;
|
|
|
}
|
|
}
|