|
@ -71,6 +71,7 @@ public class FactUserHouseServiceImpl implements FactUserHouseService { |
|
|
@Override |
|
|
@Override |
|
|
public FactUserHouseResultDTO total(Map<String, Object> params) { |
|
|
public FactUserHouseResultDTO total(Map<String, Object> params) { |
|
|
FactUserHouseResultDTO dto = null; |
|
|
FactUserHouseResultDTO dto = null; |
|
|
|
|
|
// 不查询时间段默认查询当天
|
|
|
if (params.containsKey("startTime") && params.containsKey("endTime")) { |
|
|
if (params.containsKey("startTime") && params.containsKey("endTime")) { |
|
|
if (StringUtils.isNotBlank(params.get("startTime").toString()) && StringUtils.isNotBlank(params.get("endTime").toString())) { |
|
|
if (StringUtils.isNotBlank(params.get("startTime").toString()) && StringUtils.isNotBlank(params.get("endTime").toString())) { |
|
|
params.put("dateId", StringUtils.EMPTY); |
|
|
params.put("dateId", StringUtils.EMPTY); |
|
@ -80,6 +81,7 @@ public class FactUserHouseServiceImpl implements FactUserHouseService { |
|
|
} else { |
|
|
} else { |
|
|
params.put("dateId", DateUtils.getBeforeNDay(NumConstant.ONE)); |
|
|
params.put("dateId", DateUtils.getBeforeNDay(NumConstant.ONE)); |
|
|
} |
|
|
} |
|
|
|
|
|
// 网格纬度查询网格统计表,其余纬度查询组织统计表
|
|
|
if (params.containsKey("level")) { |
|
|
if (params.containsKey("level")) { |
|
|
if (OrgLevelEnum.GRID.getCode().equals(params.get("level").toString())) { |
|
|
if (OrgLevelEnum.GRID.getCode().equals(params.get("level").toString())) { |
|
|
dto = factGridUserHouseDailyService.getTotal(params); |
|
|
dto = factGridUserHouseDailyService.getTotal(params); |
|
@ -95,9 +97,9 @@ public class FactUserHouseServiceImpl implements FactUserHouseService { |
|
|
List<FactUserHouseResultDTO> list = new ArrayList<>(); |
|
|
List<FactUserHouseResultDTO> list = new ArrayList<>(); |
|
|
if (params.containsKey("level")) { |
|
|
if (params.containsKey("level")) { |
|
|
if (OrgLevelEnum.GRID.getCode().equals(params.get("level").toString()) || OrgLevelEnum.COMMUNITY.getCode().equals(params.get("level").toString())) { |
|
|
if (OrgLevelEnum.GRID.getCode().equals(params.get("level").toString()) || OrgLevelEnum.COMMUNITY.getCode().equals(params.get("level").toString())) { |
|
|
list = ConvertUtils.sourceToTarget(factGridUserHouseDailyService.list(params), FactUserHouseResultDTO.class); |
|
|
list = factGridUserHouseDailyService.listExport(params); |
|
|
} else { |
|
|
} else { |
|
|
list = ConvertUtils.sourceToTarget(factAgencyUserHouseDailyService.list(params), FactUserHouseResultDTO.class); |
|
|
list = factAgencyUserHouseDailyService.listExport(params); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
return list; |
|
|
return list; |
|
@ -111,8 +113,10 @@ public class FactUserHouseServiceImpl implements FactUserHouseService { |
|
|
String dateId = formDTO.getDateId(); |
|
|
String dateId = formDTO.getDateId(); |
|
|
String customerId = formDTO.getCustomerId(); |
|
|
String customerId = formDTO.getCustomerId(); |
|
|
|
|
|
|
|
|
|
|
|
// 先删除历史
|
|
|
factGridUserHouseDailyService.deleteByDateId(formDTO); |
|
|
factGridUserHouseDailyService.deleteByDateId(formDTO); |
|
|
|
|
|
|
|
|
|
|
|
// 保证小区是全部网格后,其余数据进行循环匹配
|
|
|
List<FactUserHouseResultDTO> neiList = houseService.neighborhoodStat(formDTO); |
|
|
List<FactUserHouseResultDTO> neiList = houseService.neighborhoodStat(formDTO); |
|
|
List<FactUserHouseResultDTO> houseList = houseService.houseStat(formDTO); |
|
|
List<FactUserHouseResultDTO> houseList = houseService.houseStat(formDTO); |
|
|
List<FactUserHouseResultDTO> userList = icResiUserService.userStat(formDTO); |
|
|
List<FactUserHouseResultDTO> userList = icResiUserService.userStat(formDTO); |
|
@ -173,8 +177,10 @@ public class FactUserHouseServiceImpl implements FactUserHouseService { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 先删除历史
|
|
|
factAgencyUserHouseDailyService.deleteByDateId(formDTO); |
|
|
factAgencyUserHouseDailyService.deleteByDateId(formDTO); |
|
|
|
|
|
|
|
|
|
|
|
// 使用机构表左关联,对不同纬度的机构进行分组统计
|
|
|
formDTO.setLevel("community"); |
|
|
formDTO.setLevel("community"); |
|
|
List<FactUserHouseResultDTO> commList = factGridUserHouseDailyService.statAgency(formDTO); |
|
|
List<FactUserHouseResultDTO> commList = factGridUserHouseDailyService.statAgency(formDTO); |
|
|
if (!commList.isEmpty()) { |
|
|
if (!commList.isEmpty()) { |
|
|