package com.malk.diwei.service.impl;

import com.malk.diwei.service.*;
import com.malk.server.common.McR;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

@Service
public class DiweiServiceImpl implements DiweiService {
    @Autowired
    private ClientService clientService;

    @Autowired
    private GoodsService goodsService;

    @Autowired
    private ProcStepService procStepService;

    @Autowired
    private EmployeeService employeeService;

    @Autowired
    private ProcessService processService;

    @Async
    @Override
    public McR syncBaseAll() {
        clientService.syncClient();
        goodsService.syncGoods();
        procStepService.syncProcStep();
        employeeService.syncEmplyee();

        return McR.success();
    }

    @Async
    @Override
    public McR syncProcessAll() {
        processService.syncProcess();
        processService.syncProcessOut();
        processService.syncProcessOut2();
        processService.syncProcessOn();
        processService.syncProcessOn2();

        return McR.success();
    }
}
