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.ICIDGetOrgNameByUserLogic;
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;

/**
 * 关系型数据实体[GetOrgNameByUser] 对象
 */
@Service
public class CIDGetOrgNameByUserLogicImpl implements ICIDGetOrgNameByUserLogic{

    @Autowired
    private KieContainer kieContainer;

    @Autowired
    private com.sinosig.core.external.service.IORGUSERService orguserservice;

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

    public void execute(CID et){

          KieSession kieSession = null;
        try{
           kieSession=kieContainer.newKieSession();
           kieSession.insert(et); 
           kieSession.setGlobal("cidgetorgnamebyuserdefault",et);
           com.sinosig.core.external.domain.ORGUSER  cidgetorgnamebyuserorguser =new com.sinosig.core.external.domain.ORGUSER();
           kieSession.insert(cidgetorgnamebyuserorguser); 
           kieSession.setGlobal("cidgetorgnamebyuserorguser",cidgetorgnamebyuserorguser);
           kieSession.setGlobal("orguserservice",orguserservice);
           kieSession.setGlobal("iBzSysCidDefaultService",iBzSysDefaultService);
           kieSession.startProcess("com.sinosig.core.module.service.logic.cidgetorgnamebyuser");

        }catch(Exception e){
            System.out.println("执行[获取人员的机构]处理逻辑发生异常"+e);
        }finally {
            if(kieSession!=null)
            kieSession.destroy();
        }
    }

}
