CustomsCheckScript.groovy 1009 字节
package com.sy.groovy

import com.sy.model.GatherInfo
import com.sy.service.impl.GatherInfoHandle
import org.basis.enhance.groovy.entity.ExecuteParams
import org.springframework.context.ApplicationContext

//转人工查验
class CustomsCheckScript extends Script implements ChannelCheckScript{

    Boolean check(ExecuteParams executeParams) {
        String NORECORD = "转人工查验";
        GatherInfo gatherInfo = (GatherInfo) executeParams.get("GatherInfo");
        // 调用方法
        ApplicationContext context = getContext();
        // 获取容器中的bean
        GatherInfoHandle gatherInfoHandle = context.getBean(GatherInfoHandle.class);

        gatherInfoHandle.sendBw(gatherInfo,false,NORECORD,null,null);

        return false
    }

    @Override
    Object run() {
        return null
    }

    // 获取spring容器
    ApplicationContext getContext() {
        // 获取spring IOC容器
        ApplicationContext context = applicationContext;
        return context;
    }
}