forked from luyan/epmet-cloud-lingshan
13 changed files with 282 additions and 14 deletions
@ -0,0 +1,18 @@ |
|||
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 { |
|||
|
|||
/** |
|||
* 人房信息统计 |
|||
* |
|||
* @param formDTO |
|||
* @return com.epmet.commons.tools.utils.Result |
|||
* @author zhy |
|||
* @date 2022/5/30 10:25 |
|||
*/ |
|||
Result execUserHouseStatistical(FactUserHouseFormDTO formDTO); |
|||
} |
@ -0,0 +1,26 @@ |
|||
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; |
|||
import org.slf4j.Logger; |
|||
import org.slf4j.LoggerFactory; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
|
|||
@Service |
|||
public class StatsUserHouseServiceImpl implements StatsUserHouseService { |
|||
|
|||
private Logger logger = LoggerFactory.getLogger(getClass()); |
|||
|
|||
@Autowired |
|||
private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient; |
|||
|
|||
@Override |
|||
public Result execUserHouseStatistical(FactUserHouseFormDTO formDTO) { |
|||
return dataStatisticalOpenFeignClient.userHouseStatGrid(formDTO); |
|||
} |
|||
} |
@ -0,0 +1,43 @@ |
|||
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; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* 人房 |
|||
* |
|||
* @author zhy |
|||
* @date 2022/5/30 10:23 |
|||
*/ |
|||
@Component("statsUserHouseTask") |
|||
public class StatsUserHouseTask implements ITask { |
|||
|
|||
private Logger logger = LoggerFactory.getLogger(getClass()); |
|||
|
|||
@Autowired |
|||
private StatsUserHouseService statsUserHouseService; |
|||
|
|||
@Override |
|||
public void run(String params) { |
|||
logger.info("StatsUserHouseTask定时任务正在执行,参数为:{}", params); |
|||
FactUserHouseFormDTO formDTO = new FactUserHouseFormDTO(); |
|||
if (StringUtils.isNotBlank(params)) { |
|||
formDTO = JSON.parseObject(params, FactUserHouseFormDTO.class); |
|||
} |
|||
Result result = statsUserHouseService.execUserHouseStatistical(formDTO); |
|||
if (result.success()) { |
|||
logger.info("StatsUserHouseTask定时任务执行成功"); |
|||
} else { |
|||
logger.error("StatsUserHouseTask定时任务执行失败:" + result.getMsg()); |
|||
} |
|||
} |
|||
} |
Loading…
Reference in new issue