# EqpMonitorServiceImpl.java

    package com.mycim.server.npw.service;

    import com.alipay.sofa.runtime.api.annotation.SofaService;
    import com.alipay.sofa.runtime.api.annotation.SofaServiceBinding;
    import com.mycim.framework.workflow.editor.WorkflowEditorService;
    import com.mycim.server.npw.manager.EqpMonitorJobCheckManager;
    import com.mycim.server.npw.manager.EqpMonitorLotManager;
    import com.mycim.server.npw.manager.EqpMonitorUnitManager;
    import com.mycim.server.npw.manager.EqpMonitorWorkflowManager;
    import com.mycim.valueobject.bas.NamedObject;
    import com.mycim.valueobject.prp.*;
    import com.mycim.valueobject.wip.Lot;
    import com.mycim.workflow.valueobject.WorkflowEditorModel;
    import com.mycim.workflow.valueobject.WorkflowLinkModel;
    import com.mycim.workflow.valueobject.WorkflowStepModel;
    import com.mycim.workflow.valueobject.WorkflowTemplateModel;
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.stereotype.Service;

    import java.lang.Override;
    import java.util.List;
    import java.util.Map;

    /**
     * @author shijie.deng
     * @version 6.0.0
     * @date 2019/11/12
     **/
    @Service
    @SofaService(interfaceType = EqpMonitorService.class, bindings = {@SofaServiceBinding(bindingType = "bolt")})
    public class EqpMonitorServiceImpl implements EqpMonitorService {

        @Autowired
        private EqpMonitorWorkflowManager dmmWorkflowManager;

        @Autowired
        private WorkflowEditorService workflowEditorService;

        @Autowired
        private EqpMonitorLotManager dmmLotManager;

        @Autowired
        private EqpMonitorUnitManager dmmUnitManager;

        @Autowired
        private EqpMonitorJobCheckManager dmmJobCheckManager;

        @Override
        public List<Map<String, String>> getDMMUsedEqptId(Long workflowRrn, Integer version) {
            return dmmWorkflowManager.getDMMUsedEqptId(workflowRrn, version);
        }

        @Override
        public List<WorkflowStepModel> getStepModels(Long wflRrn, Integer wflVersion) {
            return dmmWorkflowManager.getStepModels(wflRrn, wflVersion);
        }

        @Override
        public void importWorkflow(WorkflowEditorModel editorModel) {
            workflowEditorService.importWorkflow(editorModel);
        }

        @Override
        public void updateModelStatus(Long workflowRrn, Integer version, String stauts) {
            dmmWorkflowManager.updateModelStatus(workflowRrn, version, stauts);
        }

        @Override
        public EqpMonitorModel getDmmModelByWfl(Long workflowRrn, Integer version) {
            return dmmWorkflowManager.getDmmModelByWfl(workflowRrn, version);
        }

        @Override
        public void deleteDMMModel(EqpMonitorModel dmmModel) {
            dmmWorkflowManager.deleteDMMModel(dmmModel);
        }

        @Override
        public long insertDMMModel(EqpMonitorModel dmmModel) {
            return dmmWorkflowManager.insertDMMModel(dmmModel);
        }

        @Override
        public List<EqpMonitorStep> getDmmModelStepsInfo(Long modelRrn) {
            return dmmWorkflowManager.getDmmModelStepsInfo(modelRrn);
        }

        @Override
        public List<Operation> getDmmOperation(String dmmOperationId) {
            return dmmWorkflowManager.getDmmOperation(dmmOperationId);
        }

        @Override
        public void insertTransAttributeValues(Map transInfo) {
            dmmLotManager.insertTransAttributeValues(transInfo);
        }

        @Override
        public long getProductDefaultReticleGroupRrn(long productRrn) {
            return dmmLotManager.getProductDefaultReticleGroupRrn(productRrn);
        }

        @Override
        public void modifySteps(Long modelRrn, List<EqpMonitorStep> stepList) {
            dmmWorkflowManager.modifySteps(modelRrn, stepList);
        }

        @Override
        public void updateDMMModel(EqpMonitorModel dmmModel) {
            dmmWorkflowManager.updateDMMModel(dmmModel);
        }

        @Override
        public boolean checkNpwBankOut(String lotId) {
            return dmmLotManager.checkNpwBankOut(lotId);
        }

        @Override
        public List<EqpMonitorEntityRelation> getDMMRelationByEqptRrn(Long entityRrn) {
            return dmmLotManager.getDMMRelationByEqptRrn(entityRrn);
        }

        @Override
        public void npwBankIn(Map transInfo) {
            dmmLotManager.npwBankIn(transInfo);
        }

        @Override
        public void npwBankOut(Map transInfo) {
            dmmLotManager.npwBankOut(transInfo);
        }

        @Override
        public boolean checkMergeAvailableNpw(Long sourceLotRrn, Long targetLotRrn) {
            return dmmLotManager.checkMergeAvailableNpw(sourceLotRrn, targetLotRrn);
        }

        @Override
        public List<EqpMonitorModel> getModelListByType(String modelType, Long eqptRrn) {
            return dmmWorkflowManager.getModelListByType(modelType, eqptRrn);
        }

        @Override
        public EqpMonitorModel getDMMModelByRrn(Long dmmModelRrn) {
            return dmmWorkflowManager.getDMMModelByRrn(dmmModelRrn);
        }

        @Override
        public void deleteDMMRelation(EqpMonitorEntityRelation relation) {
            dmmWorkflowManager.deleteDMMRelation(relation);
        }

        @Override
        public void insertDMMRelation(EqpMonitorEntityRelation relation) {
            dmmWorkflowManager.insertDMMRelation(relation);
        }

        @Override
        public void dmmRegister(Lot lot, Long dmmProccessRrn, Integer dmmVersion, Map condition) {
            dmmWorkflowManager.dmmRegister(lot, dmmProccessRrn, dmmVersion, condition);
        }

        @Override
        public void importWorkflowModel(WorkflowTemplateModel templateModel, List<WorkflowStepModel> stepModels,
                                        List<WorkflowStepModel> oldStepModels, List<WorkflowLinkModel> linkModels,
                                        List<WorkflowLinkModel> oldLinkModels) {
            dmmWorkflowManager.importWorkflowModel(templateModel, stepModels, oldStepModels, linkModels, oldLinkModels);
        }

        @Override
        public List getDmmEdcHistory(Map condition) {
            return dmmUnitManager.getDmmEdcHistory(condition);
        }

        @Override
        public List<WorkflowStepModel> buildStepModel(Long workflowRrn, Integer version, List<NamedObject> instance,
                                                      String type) {
            return dmmWorkflowManager.buildStepModel(workflowRrn, version, instance, type);
        }

        @Override
        public List<WorkflowStepModel> buildStepModel(Long workflowRrn, Integer version, Route route) {
            return dmmWorkflowManager.buildStepModel(workflowRrn, version, route);
        }

        @Override
        public List<WorkflowStepModel> buildStepModel(List<EqpMonitorStep> stepList, Long workflowRrn, Integer version) {
            return dmmWorkflowManager.buildStepModel(stepList, workflowRrn, version);
        }

        @Override
        public List<EqpMonitorStep> getDmmModelStepsInfo(Long modelRrn, String version) {
            return dmmWorkflowManager.getDmmModelStepsInfo(modelRrn, version);
        }

        @Override
        public void bankIn(Map transInfo) {
            dmmLotManager.bankIn(transInfo);
        }

        @Override
        public List<EqpMonitorEntityRelation> getDMMRelationByMap(Map map) {
            return dmmLotManager.getDMMRelationByMap(map);
        }

        @Override
        public String getFirstLocation(Long dmmModelRrn) {
            return dmmWorkflowManager.getFirstLocation(dmmModelRrn);
        }

        @Override
        public void deleteModelSteps(Long modelRrn) {
            dmmWorkflowManager.deleteModelSteps(modelRrn);
        }

        @Override
        public String checkAvailableEquipmentForNpw(Lot lot, Long equipmentRrn, Long userRrn) {
            return dmmJobCheckManager.checkAvailableEquipmentForNpw(lot, equipmentRrn, userRrn);
        }

    }