MessageRouterX82.java 1.6 KB
package com.sy.service.router;

import com.sy.bwAssist.Message;
import com.sy.model.GatherInfo;
import com.sy.service.CommandLogService;
import com.sy.service.EnginCheckService;
import lombok.extern.slf4j.Slf4j;
import org.basis.enhance.groovy.entity.ExecuteParams;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Slf4j
@Service("X82")
public class MessageRouterX82 implements MessageRouterG2 {

    @Autowired
    private EnginCheckService enginCheckService;

    @Autowired
    private CommandLogService commandLogService;

    @Override
    public void route(GatherInfo gatherInfo,String reason) {
        log.info("[G2-SUCCESS]-金二验放通过,下放最终抬杆指令.");
        enginCheck(gatherInfo,reason);
    }

    @Override
    public void faild(GatherInfo gatherInfo,String reason) {
        commandLogService.commandlog(gatherInfo,false,"金二验放失败,原因:"+reason,null,null,0.0,0.0,0.0,0.0);
        ExecuteParams executeParams = enginCheckService.makeParaByGagherInfo(gatherInfo);
        enginCheckService.passFaild(gatherInfo,reason,executeParams);
        log.info("[G2-FEEDBACK-CHECK-FAILD]-{}",reason);

    }

    public void enginCheck(GatherInfo gatherInfo,String reason){
        commandLogService.commandlog(gatherInfo,true,"金二验放通过"+reason,null,null,0.0,0.0,0.0,0.0);
        ExecuteParams executeParams = enginCheckService.makeParaByGagherInfo(gatherInfo);

        enginCheckService.pass(gatherInfo,executeParams);

        enginCheckService.formRelease(gatherInfo,executeParams);

        log.info("引擎验放完结");
    }
}