|
@ -15,8 +15,11 @@ import com.epmet.dao.StaffLoginLogDao; |
|
|
import com.epmet.dto.CustomerAgencyDTO; |
|
|
import com.epmet.dto.CustomerAgencyDTO; |
|
|
import com.epmet.dto.CustomerStaffDTO; |
|
|
import com.epmet.dto.CustomerStaffDTO; |
|
|
import com.epmet.dto.form.yt.CommunityLoginFormDTO; |
|
|
import com.epmet.dto.form.yt.CommunityLoginFormDTO; |
|
|
|
|
|
import com.epmet.dto.form.yt.CountActivityFormDTO; |
|
|
|
|
|
import com.epmet.dto.result.yt.ActivityTatalInfo; |
|
|
import com.epmet.dto.result.yt.CommunityLoginResultDTO; |
|
|
import com.epmet.dto.result.yt.CommunityLoginResultDTO; |
|
|
import com.epmet.dto.result.yt.LoginLogCountByLevelResultDTO; |
|
|
import com.epmet.dto.result.yt.LoginLogCountByLevelResultDTO; |
|
|
|
|
|
import com.epmet.dto.result.yt.AccountActivityInfo; |
|
|
import com.epmet.entity.StaffLoginLogEntity; |
|
|
import com.epmet.entity.StaffLoginLogEntity; |
|
|
import com.epmet.feign.EpmetUserOpenFeignClient; |
|
|
import com.epmet.feign.EpmetUserOpenFeignClient; |
|
|
import com.epmet.service.CustomerAgencyService; |
|
|
import com.epmet.service.CustomerAgencyService; |
|
@ -108,21 +111,21 @@ public class StaffLoginLogServiceImpl extends BaseServiceImpl<StaffLoginLogDao, |
|
|
// 市下面区县账号
|
|
|
// 市下面区县账号
|
|
|
LambdaQueryWrapper<StaffLoginLogEntity> districtWrapper = new LambdaQueryWrapper<>(); |
|
|
LambdaQueryWrapper<StaffLoginLogEntity> districtWrapper = new LambdaQueryWrapper<>(); |
|
|
districtWrapper.eq(StaffLoginLogEntity::getPid, orgId) |
|
|
districtWrapper.eq(StaffLoginLogEntity::getPid, orgId) |
|
|
.eq(StaffLoginLogEntity::getAgencyLevel,Constant.DISTRICT) |
|
|
.eq(StaffLoginLogEntity::getAgencyLevel, Constant.DISTRICT) |
|
|
.between(null != startDate && null != endDate, StaffLoginLogEntity::getLoginTime, startDate, endDate); |
|
|
.between(null != startDate && null != endDate, StaffLoginLogEntity::getLoginTime, startDate, endDate); |
|
|
resultDTO.setDistrictCount(baseDao.selectCount(districtWrapper)); |
|
|
resultDTO.setDistrictCount(baseDao.selectCount(districtWrapper)); |
|
|
|
|
|
|
|
|
// 市级下面所有街道
|
|
|
// 市级下面所有街道
|
|
|
LambdaQueryWrapper<StaffLoginLogEntity> streetWrapper = new LambdaQueryWrapper<>(); |
|
|
LambdaQueryWrapper<StaffLoginLogEntity> streetWrapper = new LambdaQueryWrapper<>(); |
|
|
streetWrapper.like(StaffLoginLogEntity::getOrgIdPath, orgIdPath) |
|
|
streetWrapper.like(StaffLoginLogEntity::getOrgIdPath, orgIdPath) |
|
|
.eq(StaffLoginLogEntity::getAgencyLevel,Constant.STREET) |
|
|
.eq(StaffLoginLogEntity::getAgencyLevel, Constant.STREET) |
|
|
.between(null != startDate && null != endDate, StaffLoginLogEntity::getLoginTime, startDate, endDate); |
|
|
.between(null != startDate && null != endDate, StaffLoginLogEntity::getLoginTime, startDate, endDate); |
|
|
resultDTO.setStreetCount(baseDao.selectCount(streetWrapper)); |
|
|
resultDTO.setStreetCount(baseDao.selectCount(streetWrapper)); |
|
|
|
|
|
|
|
|
// 市级下面所有社区
|
|
|
// 市级下面所有社区
|
|
|
LambdaQueryWrapper<StaffLoginLogEntity> communityWrapper = new LambdaQueryWrapper<>(); |
|
|
LambdaQueryWrapper<StaffLoginLogEntity> communityWrapper = new LambdaQueryWrapper<>(); |
|
|
communityWrapper.like(StaffLoginLogEntity::getOrgIdPath, orgIdPath) |
|
|
communityWrapper.like(StaffLoginLogEntity::getOrgIdPath, orgIdPath) |
|
|
.eq(StaffLoginLogEntity::getAgencyLevel,Constant.COMMUNITY) |
|
|
.eq(StaffLoginLogEntity::getAgencyLevel, Constant.COMMUNITY) |
|
|
.between(null != startDate && null != endDate, StaffLoginLogEntity::getLoginTime, startDate, endDate); |
|
|
.between(null != startDate && null != endDate, StaffLoginLogEntity::getLoginTime, startDate, endDate); |
|
|
resultDTO.setCommunityCount(baseDao.selectCount(communityWrapper)); |
|
|
resultDTO.setCommunityCount(baseDao.selectCount(communityWrapper)); |
|
|
|
|
|
|
|
@ -138,14 +141,14 @@ public class StaffLoginLogServiceImpl extends BaseServiceImpl<StaffLoginLogDao, |
|
|
// 区县下所有的街道
|
|
|
// 区县下所有的街道
|
|
|
LambdaQueryWrapper<StaffLoginLogEntity> streetWrapper = new LambdaQueryWrapper<>(); |
|
|
LambdaQueryWrapper<StaffLoginLogEntity> streetWrapper = new LambdaQueryWrapper<>(); |
|
|
streetWrapper.like(StaffLoginLogEntity::getOrgIdPath, orgIdPath) |
|
|
streetWrapper.like(StaffLoginLogEntity::getOrgIdPath, orgIdPath) |
|
|
.eq(StaffLoginLogEntity::getAgencyLevel,Constant.STREET) |
|
|
.eq(StaffLoginLogEntity::getAgencyLevel, Constant.STREET) |
|
|
.between(null != startDate && null != endDate, StaffLoginLogEntity::getLoginTime, startDate, endDate); |
|
|
.between(null != startDate && null != endDate, StaffLoginLogEntity::getLoginTime, startDate, endDate); |
|
|
resultDTO.setStreetCount(baseDao.selectCount(streetWrapper)); |
|
|
resultDTO.setStreetCount(baseDao.selectCount(streetWrapper)); |
|
|
|
|
|
|
|
|
// 去线下所有社区
|
|
|
// 去线下所有社区
|
|
|
LambdaQueryWrapper<StaffLoginLogEntity> communityWrapper = new LambdaQueryWrapper<>(); |
|
|
LambdaQueryWrapper<StaffLoginLogEntity> communityWrapper = new LambdaQueryWrapper<>(); |
|
|
communityWrapper.like(StaffLoginLogEntity::getOrgIdPath, orgIdPath) |
|
|
communityWrapper.like(StaffLoginLogEntity::getOrgIdPath, orgIdPath) |
|
|
.eq(StaffLoginLogEntity::getAgencyLevel,Constant.COMMUNITY) |
|
|
.eq(StaffLoginLogEntity::getAgencyLevel, Constant.COMMUNITY) |
|
|
.between(null != startDate && null != endDate, StaffLoginLogEntity::getLoginTime, startDate, endDate); |
|
|
.between(null != startDate && null != endDate, StaffLoginLogEntity::getLoginTime, startDate, endDate); |
|
|
resultDTO.setCommunityCount(baseDao.selectCount(communityWrapper)); |
|
|
resultDTO.setCommunityCount(baseDao.selectCount(communityWrapper)); |
|
|
|
|
|
|
|
@ -159,10 +162,11 @@ public class StaffLoginLogServiceImpl extends BaseServiceImpl<StaffLoginLogDao, |
|
|
.between(null != startDate && null != endDate, StaffLoginLogEntity::getLoginTime, startDate, endDate); |
|
|
.between(null != startDate && null != endDate, StaffLoginLogEntity::getLoginTime, startDate, endDate); |
|
|
resultDTO.setStreetCount(baseDao.selectCount(streetWrapper)); |
|
|
resultDTO.setStreetCount(baseDao.selectCount(streetWrapper)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 街道下所有社区
|
|
|
// 街道下所有社区
|
|
|
LambdaQueryWrapper<StaffLoginLogEntity> communityWrapper = new LambdaQueryWrapper<>(); |
|
|
LambdaQueryWrapper<StaffLoginLogEntity> communityWrapper = new LambdaQueryWrapper<>(); |
|
|
communityWrapper.like(StaffLoginLogEntity::getOrgIdPath, orgIdPath) |
|
|
communityWrapper.like(StaffLoginLogEntity::getOrgIdPath, orgIdPath) |
|
|
.eq(StaffLoginLogEntity::getAgencyLevel,Constant.COMMUNITY) |
|
|
.eq(StaffLoginLogEntity::getAgencyLevel, Constant.COMMUNITY) |
|
|
.between(null != startDate && null != endDate, StaffLoginLogEntity::getLoginTime, startDate, endDate); |
|
|
.between(null != startDate && null != endDate, StaffLoginLogEntity::getLoginTime, startDate, endDate); |
|
|
resultDTO.setCommunityCount(baseDao.selectCount(communityWrapper)); |
|
|
resultDTO.setCommunityCount(baseDao.selectCount(communityWrapper)); |
|
|
|
|
|
|
|
@ -180,6 +184,18 @@ public class StaffLoginLogServiceImpl extends BaseServiceImpl<StaffLoginLogDao, |
|
|
return resultDTO; |
|
|
return resultDTO; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public PageData<AccountActivityInfo> getAccountActivityInfo(CountActivityFormDTO formDTO) { |
|
|
|
|
|
List<AccountActivityInfo> accountActivityInfos = baseDao.selectListActivityInfo(formDTO); |
|
|
|
|
|
int total = CollectionUtils.isEmpty(accountActivityInfos) ? NumConstant.ZERO : accountActivityInfos.size(); |
|
|
|
|
|
return new PageData<>(accountActivityInfos, total); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public ActivityTatalInfo getActivityTotal(CountActivityFormDTO formDTO) { |
|
|
|
|
|
return baseDao.selectOneActivityTotal(formDTO); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 下级社区账号登录次数排名 |
|
|
* 下级社区账号登录次数排名 |
|
|
* |
|
|
* |
|
@ -197,7 +213,7 @@ public class StaffLoginLogServiceImpl extends BaseServiceImpl<StaffLoginLogDao, |
|
|
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); |
|
|
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); |
|
|
List<CommunityLoginResultDTO> list = baseDao.pageCommunityCount(formDTO.getOrgId(), formDTO.getStartDate(), formDTO.getEndDate()); |
|
|
List<CommunityLoginResultDTO> list = baseDao.pageCommunityCount(formDTO.getOrgId(), formDTO.getStartDate(), formDTO.getEndDate()); |
|
|
PageInfo<CommunityLoginResultDTO> pageInfo = new PageInfo<>(list); |
|
|
PageInfo<CommunityLoginResultDTO> pageInfo = new PageInfo<>(list); |
|
|
return new PageData<>(list, pageInfo.getTotal(),formDTO.getPageSize()); |
|
|
return new PageData<>(list, pageInfo.getTotal(), formDTO.getPageSize()); |
|
|
} |
|
|
} |
|
|
// 不分页
|
|
|
// 不分页
|
|
|
List<CommunityLoginResultDTO> list = baseDao.pageCommunityCount(formDTO.getOrgId(), formDTO.getStartDate(), formDTO.getEndDate()); |
|
|
List<CommunityLoginResultDTO> list = baseDao.pageCommunityCount(formDTO.getOrgId(), formDTO.getStartDate(), formDTO.getEndDate()); |
|
@ -243,16 +259,16 @@ public class StaffLoginLogServiceImpl extends BaseServiceImpl<StaffLoginLogDao, |
|
|
public PageData<CommunityLoginResultDTO> pageDistrictCount(String orgId, String level, Date startDate, Date endDate, Boolean isPage, Integer pageNo, Integer pageSize) { |
|
|
public PageData<CommunityLoginResultDTO> pageDistrictCount(String orgId, String level, Date startDate, Date endDate, Boolean isPage, Integer pageNo, Integer pageSize) { |
|
|
if (StringUtils.isBlank(orgId)) { |
|
|
if (StringUtils.isBlank(orgId)) { |
|
|
CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(EpmetRequestHolder.getLoginUserCustomerId(), EpmetRequestHolder.getLoginUserId()); |
|
|
CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(EpmetRequestHolder.getLoginUserCustomerId(), EpmetRequestHolder.getLoginUserId()); |
|
|
orgId=staffInfoCacheResult.getAgencyId(); |
|
|
orgId = staffInfoCacheResult.getAgencyId(); |
|
|
} |
|
|
} |
|
|
if (isPage) { |
|
|
if (isPage) { |
|
|
PageHelper.startPage(pageNo, pageSize); |
|
|
PageHelper.startPage(pageNo, pageSize); |
|
|
List<CommunityLoginResultDTO> list = baseDao.pageDistrictCount(orgId, startDate, endDate); |
|
|
List<CommunityLoginResultDTO> list = baseDao.pageDistrictCount(orgId, startDate, endDate); |
|
|
PageInfo<CommunityLoginResultDTO> pageInfo = new PageInfo<>(list); |
|
|
PageInfo<CommunityLoginResultDTO> pageInfo = new PageInfo<>(list); |
|
|
return new PageData<>(list, pageInfo.getTotal(),pageSize); |
|
|
return new PageData<>(list, pageInfo.getTotal(), pageSize); |
|
|
} |
|
|
} |
|
|
// 不分页
|
|
|
// 不分页
|
|
|
List<CommunityLoginResultDTO> list = baseDao.pageDistrictCount(orgId,startDate, endDate); |
|
|
List<CommunityLoginResultDTO> list = baseDao.pageDistrictCount(orgId, startDate, endDate); |
|
|
int total = CollectionUtils.isEmpty(list) ? NumConstant.ZERO : list.size(); |
|
|
int total = CollectionUtils.isEmpty(list) ? NumConstant.ZERO : list.size(); |
|
|
return new PageData<>(list, total, total); |
|
|
return new PageData<>(list, total, total); |
|
|
} |
|
|
} |
|
@ -269,19 +285,19 @@ public class StaffLoginLogServiceImpl extends BaseServiceImpl<StaffLoginLogDao, |
|
|
* @return |
|
|
* @return |
|
|
*/ |
|
|
*/ |
|
|
@Override |
|
|
@Override |
|
|
public PageData<CommunityLoginResultDTO> streetCount(String orgId,Date startDate, Date endDate, Boolean isPage, Integer pageNo, Integer pageSize) { |
|
|
public PageData<CommunityLoginResultDTO> streetCount(String orgId, Date startDate, Date endDate, Boolean isPage, Integer pageNo, Integer pageSize) { |
|
|
if (StringUtils.isBlank(orgId)) { |
|
|
if (StringUtils.isBlank(orgId)) { |
|
|
CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(EpmetRequestHolder.getLoginUserCustomerId(), EpmetRequestHolder.getLoginUserId()); |
|
|
CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(EpmetRequestHolder.getLoginUserCustomerId(), EpmetRequestHolder.getLoginUserId()); |
|
|
orgId=staffInfoCacheResult.getAgencyId(); |
|
|
orgId = staffInfoCacheResult.getAgencyId(); |
|
|
} |
|
|
} |
|
|
if (isPage) { |
|
|
if (isPage) { |
|
|
PageHelper.startPage(pageNo, pageSize); |
|
|
PageHelper.startPage(pageNo, pageSize); |
|
|
List<CommunityLoginResultDTO> list = baseDao.pageStreetCount(orgId, startDate, endDate); |
|
|
List<CommunityLoginResultDTO> list = baseDao.pageStreetCount(orgId, startDate, endDate); |
|
|
PageInfo<CommunityLoginResultDTO> pageInfo = new PageInfo<>(list); |
|
|
PageInfo<CommunityLoginResultDTO> pageInfo = new PageInfo<>(list); |
|
|
return new PageData<>(list, pageInfo.getTotal(),pageSize); |
|
|
return new PageData<>(list, pageInfo.getTotal(), pageSize); |
|
|
} |
|
|
} |
|
|
// 不分页
|
|
|
// 不分页
|
|
|
List<CommunityLoginResultDTO> list = baseDao.pageStreetCount(orgId,startDate, endDate); |
|
|
List<CommunityLoginResultDTO> list = baseDao.pageStreetCount(orgId, startDate, endDate); |
|
|
int total = CollectionUtils.isEmpty(list) ? NumConstant.ZERO : list.size(); |
|
|
int total = CollectionUtils.isEmpty(list) ? NumConstant.ZERO : list.size(); |
|
|
return new PageData<>(list, total, total); |
|
|
return new PageData<>(list, total, total); |
|
|
} |
|
|
} |
|
|