package com.zt.plat.module.erp.job;

import com.xxl.job.core.handler.annotation.XxlJob;
import com.zt.plat.framework.tenant.core.job.TenantJob;
import com.zt.plat.module.erp.service.erp.*;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class ErpJob {

    @Resource
    private ErpAssetService erpAssetService;
    @Resource
    private ErpBomService erpBomService;
    @Resource
    private ErpCompanyService erpCompanyService;
    @Resource
    private ErpCostcenterService erpCostcenterService;
    @Resource
    private ErpCustomerService erpCustomerService;
    @Resource
    private ErpFactoryService erpFactoryService;
    @Resource
    private ErpInternalOrderService erpInternalOrderService;
    @Resource
    private ErpMaterialService erpMaterialService;
    @Resource
    private ErpProcessService erpProcessService;
    @Resource
    private ErpProductiveOrderService erpProductiveOrderService;
    @Resource
    private ErpProductiveVersionService erpProductiveVersionService;
    @Resource
    private ErpPurchaseOrganizationService erpPurchaseOrganizationService;
    @Resource
    private ErpSalesOrganizationService erpSalesOrganizationService;
    @Resource
    private ErpWarehouseService erpWarehouseService;

    @XxlJob("callErpRfcInterface")
    @TenantJob
    public void execute() {
        erpCompanyService.callErpRfcInterface();
        erpFactoryService.callErpRfcInterface();
        erpCustomerService.callErpRfcInterface();
        erpAssetService.callErpRfcInterface();
        erpBomService.callErpRfcInterface();
        erpCostcenterService.callErpRfcInterface();
        erpInternalOrderService.callErpRfcInterface();
        erpMaterialService.callErpRfcInterface();
        erpProcessService.callErpRfcInterface();
        erpProductiveOrderService.callErpRfcInterface();
        erpProductiveVersionService.callErpRfcInterface();
        erpPurchaseOrganizationService.callErpRfcInterface();
        erpSalesOrganizationService.callErpRfcInterface();
        erpWarehouseService.callErpRfcInterface();
    }
}
