package cn.iocoder.yudao.module.pay.job.divide;

import cn.iocoder.yudao.framework.quartz.core.handler.JobHandler;
import cn.iocoder.yudao.framework.tenant.core.job.TenantJob;
import cn.iocoder.yudao.module.pay.service.divide.DivideService;
import cn.iocoder.yudao.module.pay.service.wxprofitsharing.WxProfitsharingService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 支付通知 Job
 * 通过不断扫描待通知的 PayNotifyTaskDO 记录，回调业务线的回调接口
 *
 * @author 芋道源码
 */
@Component
@Slf4j
public class PayDivideResultJob implements JobHandler {

    @Resource
    private WxProfitsharingService profitsharingService;

    @Override
    @TenantJob
    public String execute(String param) throws Exception {
        int divideResult = profitsharingService.getDivideResult();
        return String.format("获取分账结果 %s 个", divideResult);
    }

}
