package com.sinosig.core.module.service.logic.impl;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;

import com.sinosig.core.module.service.logic.ICIDGetCPXHXXLogic;
import com.sinosig.core.module.domain.CID;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.kie.api.runtime.KieSession;
import org.kie.api.runtime.KieContainer;

/**
 * 关系型数据实体[GetCPXHXX] 对象
 */
@Service
public class CIDGetCPXHXXLogicImpl implements ICIDGetCPXHXXLogic{

    @Autowired
    private KieContainer kieContainer;

    @Autowired
    private com.sinosig.core.external.service.ICPXHService cpxhservice;

    @Autowired
    private com.sinosig.core.module.service.ICIDService iBzSysDefaultService;

    public void execute(CID et){

          KieSession kieSession = null;
        try{
           kieSession=kieContainer.newKieSession();
           com.sinosig.core.external.domain.CPXH  cidgetcpxhxxcpxh =new com.sinosig.core.external.domain.CPXH();
           kieSession.insert(cidgetcpxhxxcpxh); 
           kieSession.setGlobal("cidgetcpxhxxcpxh",cidgetcpxhxxcpxh);
           kieSession.insert(et); 
           kieSession.setGlobal("cidgetcpxhxxdefault",et);
           kieSession.setGlobal("cpxhservice",cpxhservice);
           kieSession.setGlobal("iBzSysCidDefaultService",iBzSysDefaultService);
           kieSession.startProcess("com.sinosig.core.module.service.logic.cidgetcpxhxx");

        }catch(Exception e){
            System.out.println("执行[获取厂牌信息]处理逻辑发生异常"+e);
        }finally {
            if(kieSession!=null)
            kieSession.destroy();
        }
    }

}
