package com.yifu.cloud.plus.v1.job.compont;


import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprCspProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsDeclarer;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @Author huyc
 * @Description 定时任务具体执行类
 * @Date 10:48 2022/8/17
 * @Param
 * @return
 **/
@Component(value = "cspTask")
@Slf4j
@EnableConfigurationProperties(DaprCspProperties.class)
public class CspTask {

	@Autowired
	private DaprCspProperties daprCspProperties;

	public void autoDoLeave() throws Exception {
		log.info("-------------离职待办派单-定时任务开始------------");
		HttpDaprUtil.invokeMethodPost(daprCspProperties.getAppUrl(), daprCspProperties.getAppId(),
				"/employeeregistrationleave/inner/autoDoLeave", "", String.class,
				SecurityConstants.FROM_IN);
		log.info("-------------离职待办派单-定时任务结束------------");
	}

}