EnginChanelController.java 1.3 KB
package com.sy.controller;

import com.sy.model.GatherInfo;
import com.sy.service.EnginCheckService;
import lombok.extern.slf4j.Slf4j;
import org.basis.enhance.groovy.entity.EngineExecutorResult;
import org.basis.enhance.groovy.entity.ExecuteParams;
import org.basis.enhance.groovy.entity.ScriptQuery;
import org.basis.enhance.groovy.executor.EngineExecutor;
import org.basis.enhance.groovy.helper.RefreshScriptHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.math.BigDecimal;

@RestController
@Slf4j
@RequestMapping("/chanel")
public class EnginChanelController {

    @Autowired
    EnginCheckService enginCheckService;

    @PostMapping("/check")
    public String x21Check(@RequestBody GatherInfo gatherInfo) {

        ExecuteParams executeParams = enginCheckService.makeParaByGagherInfo(gatherInfo);
        Boolean check = enginCheckService.enginCheckByGatherInfo(gatherInfo,executeParams);
        if (check){
            log.info("脚本验放测试通过");
            //放行
            enginCheckService.pass(gatherInfo,executeParams);

            enginCheckService.formRelease(gatherInfo,executeParams);
        }else {
            log.error("脚本验放测试失败或等待关锁施解封");
        }
        return "ok";
    }
}