package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.busi.jx;

import cn.estsh.i3plus.ext.mes.api.busi.jx.IJxCenterWorkingBoardService;
import cn.estsh.i3plus.ext.mes.pojo.util.MesExtConstWords;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * @Author : wangjie
 * @CreateDate : 2022-02-15
 * @Modify:
 **/
@Slf4j
@Service
public class JxCenterWorkingBoardDispatchService implements IJxCenterWorkingBoardService {

    @Override
    public Map<String, Object> queryCenterWorkingBoardData(Map<String, Object> dataMap) {

        switch ((String) dataMap.get(MesExtConstWords.FLAG)) {

            case "center01":
                return new JxCenterWorkingBoardCenterOneService(new JxCenterWorkingBoardProxyCenterService(), new JxCenterWorkingBoardProxyWorkingStatusService(new JxCenterWorkingBoardProxySpcrService())).queryCenterWorkingBoardData(dataMap);

            case "center02":
                return new JxCenterWorkingBoardCenterTwoService(new JxCenterWorkingBoardProxyCenterService(),
                        new JxCenterWorkingBoardProxyOrderService(new JxCenterWorkingBoardProxyOutPutService(new JxCenterWorkingBoardProxyRepairService(new JxCenterWorkingBoardProxySpcrService())))).queryCenterWorkingBoardData(dataMap);

            case "center03":
                return new JxCenterWorkingBoardCenterThreeService(new JxCenterWorkingBoardProxyCenterService(), new JxCenterWorkingBoardProxyOrderService(new JxCenterWorkingBoardProxyOutPutService())).queryCenterWorkingBoardData(dataMap);

            case "monitor01":
                return new JxCenterWorkingBoardMonitorOneService(new JxCenterWorkingBoardProxyAllCenterService(), new JxCenterWorkingBoardProxyWorkingStatusService(),
                        new JxCenterWorkingBoardProxyOrderService(new JxCenterWorkingBoardProxyOutPutService(new JxCenterWorkingBoardProxyRepairService(new JxCenterWorkingBoardProxySpcrService())))).queryCenterWorkingBoardData(dataMap);

            default:
                return dataMap;

        }
    }

}