13 changed files with 143 additions and 19 deletions
			
			
		@ -0,0 +1,13 @@ | 
				
			|||
package com.epmet.service; | 
				
			|||
 | 
				
			|||
import com.epmet.commons.tools.utils.Result; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * @Author zxc | 
				
			|||
 * @DateTime 2020/9/17 3:05 下午 | 
				
			|||
 */ | 
				
			|||
public interface DimPartyMemberService { | 
				
			|||
 | 
				
			|||
    Result getPartyInfo(String date); | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,27 @@ | 
				
			|||
package com.epmet.service.impl; | 
				
			|||
 | 
				
			|||
import com.epmet.commons.tools.utils.Result; | 
				
			|||
import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; | 
				
			|||
import com.epmet.feign.DataStatisticalOpenFeignClient; | 
				
			|||
import com.epmet.service.DimPartyMemberService; | 
				
			|||
import org.springframework.beans.factory.annotation.Autowired; | 
				
			|||
import org.springframework.stereotype.Service; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * @Author zxc | 
				
			|||
 * @DateTime 2020/9/17 3:06 下午 | 
				
			|||
 */ | 
				
			|||
@Service | 
				
			|||
public class DimPartyMemberServiceImpl implements DimPartyMemberService { | 
				
			|||
 | 
				
			|||
    @Autowired | 
				
			|||
    private DataStatisticalOpenFeignClient statsFeignClient; | 
				
			|||
 | 
				
			|||
 | 
				
			|||
    @Override | 
				
			|||
    public Result getPartyInfo(String dateId) { | 
				
			|||
        CustomerIdAndDateIdFormDTO c = new CustomerIdAndDateIdFormDTO(); | 
				
			|||
        c.setDateId(dateId); | 
				
			|||
        return statsFeignClient.getPartyInfo(c); | 
				
			|||
    } | 
				
			|||
} | 
				
			|||
@ -0,0 +1,30 @@ | 
				
			|||
package com.epmet.task; | 
				
			|||
 | 
				
			|||
import com.epmet.commons.tools.utils.Result; | 
				
			|||
import com.epmet.service.DimPartyMemberService; | 
				
			|||
import lombok.extern.slf4j.Slf4j; | 
				
			|||
import org.springframework.beans.factory.annotation.Autowired; | 
				
			|||
import org.springframework.stereotype.Component; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * @Author zxc | 
				
			|||
 * @DateTime 2020/9/17 3:04 下午 | 
				
			|||
 */ | 
				
			|||
@Slf4j | 
				
			|||
@Component("dimPartyMemberTask") | 
				
			|||
public class DimPartyMemberTask implements ITask{ | 
				
			|||
 | 
				
			|||
    @Autowired | 
				
			|||
    private DimPartyMemberService dimPartyMemberService; | 
				
			|||
 | 
				
			|||
    @Override | 
				
			|||
    public void run(String params) { | 
				
			|||
        log.info("dimPartyMemberTask定时任务正在执行,参数为:{}", params); | 
				
			|||
        Result result = dimPartyMemberService.getPartyInfo(params); | 
				
			|||
        if (result.success()){ | 
				
			|||
            log.info("dimPartyMemberTask定时任务执行成功"); | 
				
			|||
        }else { | 
				
			|||
            log.error("dimPartyMemberTask定时任务执行失败:" + result.getMsg()); | 
				
			|||
        } | 
				
			|||
    } | 
				
			|||
} | 
				
			|||
					Loading…
					
					
				
		Reference in new issue