|
|
@@ -214,6 +214,11 @@ public class SysPcAddressServiceImpl extends ServiceImpl<SysPcAddressMapper, Sys
|
|
|
public PcAddressHistoryInfoVo getPcAddress(String startTime, String endTime, String source) {
|
|
|
PcAddressHistoryInfoVo pcAddressHistoryInfoVo = new PcAddressHistoryInfoVo();
|
|
|
if (StringUtils.isEmpty(startTime) || startTime.equals(endTime)) {
|
|
|
+ if (StringUtils.isNullOrEmpty(startTime)) {
|
|
|
+ Date date = new Date();
|
|
|
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+ startTime = simpleDateFormat.format(date);
|
|
|
+ }
|
|
|
QueryWrapper<SysPcAddressHistory> queryWrapper = new QueryWrapper<>();
|
|
|
// 指定 COUNT(DISTINCT user_id) 查询
|
|
|
queryWrapper.select("COUNT(DISTINCT user_id) AS total")
|
|
|
@@ -223,11 +228,6 @@ public class SysPcAddressServiceImpl extends ServiceImpl<SysPcAddressMapper, Sys
|
|
|
Map<String, Object> result = sysPcAddressHistoryService.getMap(queryWrapper);
|
|
|
Long total = (Long) result.get("total");
|
|
|
pcAddressHistoryInfoVo.setOnlineNum(total);
|
|
|
- if (StringUtils.isNullOrEmpty(startTime)) {
|
|
|
- Date date = new Date();
|
|
|
- SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
- startTime = simpleDateFormat.format(date);
|
|
|
- }
|
|
|
|
|
|
List<PcAddressHistoryTimeVo> pcAddress = sysPcAddressHistoryMapper.getPcAddress(startTime,source);
|
|
|
pcAddressHistoryInfoVo.setList(pcAddress);
|