|
|
@ -93,9 +93,32 @@ public class ClockService implements IClockService { |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<ClockVo.SiteClockStatistics> getSiteClickStatistics(QueryDto<JourneyDto.StatisticsDate> params) { |
|
|
|
public List<ClockVo.SiteClockStatistics> getSiteClickStatistics(QueryDto<JourneyDto.StatisticsDate> params) throws Exception { |
|
|
|
List<ClockVo.SiteClockStatistics> siteClockStatisticsList = new ArrayList<>(); |
|
|
|
//1、获取日期的开始结束时间
|
|
|
|
JourneyDto.StatisticsDate statisticsDate = params.getParam(); |
|
|
|
Long startTime = statisticsDate.getStartTime() == null ? DateUtil.getZeroTime(new Date()) : statisticsDate.getStartTime(); |
|
|
|
Long endTime = statisticsDate.getEndTime() == null ? System.currentTimeMillis() : statisticsDate.getEndTime(); |
|
|
|
|
|
|
|
return null; |
|
|
|
//TODO 1、获取所有场景(暂时只获取学校的场所)
|
|
|
|
SiteExample siteExample = new SiteExample(); |
|
|
|
siteExample.createCriteria().andParentCodeEqualTo("SXDX"); |
|
|
|
List<Site> siteList = siteDao.selectByExample(siteExample); |
|
|
|
if(CollectionUtil.isNotEmpty(siteList)){ |
|
|
|
for(Site site:siteList){ |
|
|
|
//2、获取场景的二维码(包括进出),查找每个二维码下的打卡记录
|
|
|
|
int number = siteClockInDao.getClockInNumberBySiteId(site.getId()); |
|
|
|
ClockVo.SiteClockStatistics siteClockStatistics = new ClockVo.SiteClockStatistics(); |
|
|
|
siteClockStatistics.setSiteId(site.getId()); |
|
|
|
siteClockStatistics.setSiteName(site.getSiteName()); |
|
|
|
siteClockStatistics.setLatitude(site.getLatitude()); |
|
|
|
siteClockStatistics.setLongitude(site.getLongitude()); |
|
|
|
siteClockStatistics.setNumber(number); |
|
|
|
siteClockStatisticsList.add(siteClockStatistics); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return siteClockStatisticsList; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -125,6 +148,7 @@ public class ClockService implements IClockService { |
|
|
|
//添加场所二维码记录
|
|
|
|
SiteQrcode siteQrcode = new SiteQrcode(); |
|
|
|
siteQrcode.setId(snowflake.nextId()); |
|
|
|
siteQrcode.setSiteId(createQRCode.getId()); |
|
|
|
siteQrcode.setOutOrIn((byte) createQRCode.getType()); |
|
|
|
String type = "in"; |
|
|
|
if(createQRCode.getType() == 1){ |
|
|
|