diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyUserHouseDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyUserHouseDailyDao.java index 9fc1e9dc60..a3a65195ae 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyUserHouseDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyUserHouseDailyDao.java @@ -1,6 +1,7 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.form.FactUserHouseFormDTO; import com.epmet.dto.stats.result.FactUserHouseResultDTO; import com.epmet.entity.stats.FactAgencyUserHouseDailyEntity; import org.apache.ibatis.annotations.Mapper; @@ -19,4 +20,5 @@ public interface FactAgencyUserHouseDailyDao extends BaseDao listPage(Map params); + void deleteByDateId(FactUserHouseFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyUserHouseDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyUserHouseDailyService.java index d0dfe6bfd3..4e42898302 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyUserHouseDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyUserHouseDailyService.java @@ -3,6 +3,7 @@ package com.epmet.service.stats; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.stats.FactAgencyUserHouseDailyDTO; +import com.epmet.dto.stats.form.FactUserHouseFormDTO; import com.epmet.dto.stats.result.FactUserHouseResultDTO; import com.epmet.entity.stats.FactAgencyUserHouseDailyEntity; @@ -76,4 +77,14 @@ public interface FactAgencyUserHouseDailyService extends BaseService params = new HashMap<>(); params.put("dateId", formDTO.getDateId()); params.put("customerId", formDTO.getCustomerId()); @@ -138,6 +142,8 @@ public class FactUserHouseServiceImpl implements FactUserHouseService { return; } + factAgencyUserHouseDailyService.deleteByDateId(formDTO); + formDTO.setLevel("community"); List commList = factGridUserHouseDailyService.statAgency(formDTO); if (!commList.isEmpty()) { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyUserHouseDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyUserHouseDailyDao.xml index a348c0d295..2be091d038 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyUserHouseDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyUserHouseDailyDao.xml @@ -54,4 +54,14 @@ ORDER BY a.CREATED_TIME DESC + + + DELETE + FROM + fact_agency_user_house_daily + WHERE + DATE_ID = #{dateId} + AND CUSTOMER_ID = #{customerId} + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGridUserHouseDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGridUserHouseDailyDao.xml index 77b9f35449..deed30076f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGridUserHouseDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGridUserHouseDailyDao.xml @@ -154,7 +154,7 @@ DELETE FROM - fact_agency_user_house_daily + fact_grid_user_house_daily WHERE DATE_ID = #{dateId} AND CUSTOMER_ID = #{customerId} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsUserHouseService.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsUserHouseService.java index 789d99c3ea..58c930e1a1 100644 --- a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsUserHouseService.java +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsUserHouseService.java @@ -1,7 +1,6 @@ package com.epmet.service; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.StatsFormDTO; import com.epmet.dto.stats.form.FactUserHouseFormDTO; public interface StatsUserHouseService { @@ -14,5 +13,15 @@ public interface StatsUserHouseService { * @author zhy * @date 2022/5/30 10:25 */ - Result execUserHouseStatistical(FactUserHouseFormDTO formDTO); + Result execUserHouseGridStatistical(FactUserHouseFormDTO formDTO); + + /** + * 人房信息统计 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author zhy + * @date 2022/5/30 10:25 + */ + Result execUserHouseAgencyStatistical(FactUserHouseFormDTO formDTO); } diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsUserHouseServiceImpl.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsUserHouseServiceImpl.java index 04d5b287fb..30875e947b 100644 --- a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsUserHouseServiceImpl.java +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsUserHouseServiceImpl.java @@ -1,7 +1,6 @@ package com.epmet.service.impl; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.StatsFormDTO; import com.epmet.dto.stats.form.FactUserHouseFormDTO; import com.epmet.feign.DataStatisticalOpenFeignClient; import com.epmet.service.StatsUserHouseService; @@ -20,7 +19,12 @@ public class StatsUserHouseServiceImpl implements StatsUserHouseService { private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient; @Override - public Result execUserHouseStatistical(FactUserHouseFormDTO formDTO) { + public Result execUserHouseGridStatistical(FactUserHouseFormDTO formDTO) { return dataStatisticalOpenFeignClient.userHouseStatGrid(formDTO); } + + @Override + public Result execUserHouseAgencyStatistical(FactUserHouseFormDTO formDTO) { + return dataStatisticalOpenFeignClient.userHouseStatAgency(formDTO); + } } diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsUserHouseTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsUserHouseTask.java index 0b4cae80f2..1a32b7c1c7 100644 --- a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsUserHouseTask.java +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsUserHouseTask.java @@ -2,10 +2,8 @@ package com.epmet.task; import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.StatsFormDTO; import com.epmet.dto.stats.form.FactUserHouseFormDTO; import com.epmet.service.StatsUserHouseService; -import com.epmet.service.StatsUserService; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -33,11 +31,18 @@ public class StatsUserHouseTask implements ITask { if (StringUtils.isNotBlank(params)) { formDTO = JSON.parseObject(params, FactUserHouseFormDTO.class); } - Result result = statsUserHouseService.execUserHouseStatistical(formDTO); + Result result = statsUserHouseService.execUserHouseGridStatistical(formDTO); if (result.success()) { - logger.info("StatsUserHouseTask定时任务执行成功"); + logger.info("StatsUserHouseTask-grid定时任务执行成功"); } else { - logger.error("StatsUserHouseTask定时任务执行失败:" + result.getMsg()); + logger.error("StatsUserHouseTask-grid定时任务执行失败:" + result.getMsg()); + } + + result = statsUserHouseService.execUserHouseAgencyStatistical(formDTO); + if (result.success()) { + logger.info("StatsUserHouseTask-agency定时任务执行成功"); + } else { + logger.error("StatsUserHouseTask-agency定时任务执行失败:" + result.getMsg()); } } }