package com.eactive.eai.rms.onl.vo;

//import com.eactive.eai.rms.common.datasource.DataSourceContextHolder;

public class NewReportVo {
    private String statcYmd;        // 통계년월일
    private String eaiMoniSvcDstcd; // EAI모니터링서비스구분코드
    private String eaiBzwkDstcd;    // EAI업무구분코드
    private String eaiSvcName;      // EAI서비스명
    private String intfacSendTranCd; // 인터페이스송신거래코드
    private String screnNo;          // 화면번호 ( 2010.01.17 추가 )
    private String testAutonYn;      // 테스트자동화여부
    private int eaiTranSucssNoitm;   // EAI거래성공건수
    private int eaiTranFailNoitm;    // EAI거래실패건수
    private int eaiTranWholNoitm;    // EAI거래전체건수
    
    // 임시저장소로만 사용한다. 
    private int tasSuccess;
    private int tasFail;
    private int tasTotal;
    
    // 향후 DB 필드 추가 필요함
    private String adapter1 ; // 기동어댑터
    private String adapter2 ; // 수동어댑터
    private String osidInstiNo ; //대외기관코드
    
    private String eaiDesc ; // 한글명
    
    // 부분합을 위해서 추가함
    private String applCode; // 어플리케이션코드
    private String subType1; // 취급/개설
    private String subType2; // 요청/응답
    
    private int eaiSvcCount ;    // eai서비스갯수
    private int eaiSvcCountSuccess ;  // 성공한 eai서비스갯수
    private int eaiSvcCountTas ;    // eai서비스갯수
    private int eaiSvcCountSuccessTas ;  // 성공한 eai서비스갯수
    
    private int kfmPos = 0 ;
    private int kjnPos = 0 ;

    public void addSuccess(int s) {
        eaiTranSucssNoitm += s ;
        eaiTranWholNoitm  += s ;
    }
    
    public void addFail(int f) {
        eaiTranFailNoitm += f ;
        eaiTranWholNoitm += f ;
    }
    
    public void addTasSuccess(int s) {
        tasSuccess += s;
        tasTotal   += s;
    }
    
    public void addTasFail( int f) {
        tasFail += f;
        tasTotal += f;
    }
    
    public void addEaiSvcCount( int a) {
        eaiSvcCount += a ;
    }
    
    public void addEaiSvcCountSuccess( int a ){
        eaiSvcCountSuccess += a ;
    }

    public void addEaiSvcCountTas( int a) {
        eaiSvcCountTas += a ;
    }
    
    public void addEaiSvcCountSuccessTas( int a ){
        eaiSvcCountSuccessTas += a ;
    }

    public void resetCount() {
        eaiTranSucssNoitm = 0 ;
        eaiTranFailNoitm = 0 ;
        eaiTranWholNoitm = 0 ;
        
        tasSuccess = 0 ;
        tasFail    = 0 ;
        tasTotal   = 0 ;
        
        eaiSvcCount = 0 ;
        eaiSvcCountSuccess = 0 ;
        eaiSvcCountTas = 0 ;
        eaiSvcCountSuccessTas = 0 ;
        
        kfmPos = 0 ;
        kjnPos = 0 ;        
    }
    
    
    public void copyData( NewReportVo s ) {
        statcYmd = s.getStatcYmd();
        eaiMoniSvcDstcd = s.getEaiMoniSvcDstcd();
        eaiBzwkDstcd = s.getEaiBzwkDstcd();
        
        //eaiSvcName = s.getEaiSvcName();
        setEaiSvcName( s.getEaiSvcName() );        
        
        intfacSendTranCd = s.getIntfacSendTranCd();
        testAutonYn = s.getTestAutonYn();
        eaiTranSucssNoitm = s.getEaiTranSucssNoitm();
        eaiTranFailNoitm = s.getEaiTranFailNoitm();
        eaiTranWholNoitm = s.getEaiTranWholNoitm();
        
        adapter1 = s.getAdapter1();
        adapter2 = s.getAdapter2();
        osidInstiNo = s.getOsidInstiNo();
        
        tasSuccess = s.getTasSuccess();
        tasFail    = s.getTasFail();
        tasTotal   = s.getTasTotal();
        
        applCode   = s.getApplCode();
        subType1   = s.getSubType1();
        subType2   = s.getSubType2();  
        
        eaiSvcCount = s.getEaiSvcCount();
        eaiSvcCountSuccess = s.getEaiSvcCountSuccess();
        eaiSvcCountTas = s.getEaiSvcCountTas();
        eaiSvcCountSuccessTas = s.getEaiSvcCountSuccessTas();
        
        kfmPos = s.getKfmPos();
        kjnPos = s.getKjnPos();        
    }
    
    
    
    
    /**
     * @return the eaiSvcCount
     */
    public int getEaiSvcCount() {
        return eaiSvcCount;
    }

    /**
     * @param eaiSvcCount the eaiSvcCount to set
     */
    public void setEaiSvcCount(int eaiSvcCount) {
        this.eaiSvcCount = eaiSvcCount;
    }

    /**
     * @return the eaiSvcCountSuccess
     */
    public int getEaiSvcCountSuccess() {
        return eaiSvcCountSuccess;
    }

    /**
     * @param eaiSvcCountSuccess the eaiSvcCountSuccess to set
     */
    public void setEaiSvcCountSuccess(int eaiSvcCountSuccess) {
        this.eaiSvcCountSuccess = eaiSvcCountSuccess;
    }

    
    
    /**
     * @return the eaiSvcCountTas
     */
    public int getEaiSvcCountTas() {
        return eaiSvcCountTas;
    }

    /**
     * @param eaiSvcCountTas the eaiSvcCountTas to set
     */
    public void setEaiSvcCountTas(int eaiSvcCountTas) {
        this.eaiSvcCountTas = eaiSvcCountTas;
    }

    /**
     * @return the eaiSvcCountSuccessTas
     */
    public int getEaiSvcCountSuccessTas() {
        return eaiSvcCountSuccessTas;
    }

    /**
     * @param eaiSvcCountSuccessTas the eaiSvcCountSuccessTas to set
     */
    public void setEaiSvcCountSuccessTas(int eaiSvcCountSuccessTas) {
        this.eaiSvcCountSuccessTas = eaiSvcCountSuccessTas;
    }

    /**
     * @return the tasSuccess
     */
    public int getTasSuccess() {
        return tasSuccess;
    }

    /**
     * @param tasSuccess the tasSuccess to set
     */
    public void setTasSuccess(int tasSuccess) {
        this.tasSuccess = tasSuccess;
    }

    /**
     * @return the tasFail
     */
    public int getTasFail() {
        return tasFail;
    }

    /**
     * @param tasFail the tasFail to set
     */
    public void setTasFail(int tasFail) {
        this.tasFail = tasFail;
    }

    /**
     * @return the tasTotal
     */
    public int getTasTotal() {
        return tasTotal;
    }

    /**
     * @param tasTotal the tasTotal to set
     */
    public void setTasTotal(int tasTotal) {
        this.tasTotal = tasTotal;
    }

    
    
    
    
    
    /**
     * @return the kfmPos
     */
    public int getKfmPos() {
        return kfmPos;
    }

    /**
     * @param kfmPos the kfmPos to set
     */
    public void setKfmPos(int kfmPos) {
        this.kfmPos = kfmPos;
    }

    /**
     * @return the kjnPos
     */
    public int getKjnPos() {
        return kjnPos;
    }

    /**
     * @param kjnPos the kjnPos to set
     */
    public void setKjnPos(int kjnPos) {
        this.kjnPos = kjnPos;
    }

    /**
     * @return the applCode
     */
    public String getApplCode() {
        return applCode;
    }

    /**
     * @param applCode the applCode to set
     */
    public void setApplCode(String applCode) {
        this.applCode = applCode;
    }

    /**
     * @return the subType1
     */
    public String getSubType1() {
        return subType1;
    }

    /**
     * @param subType1 the subType1 to set
     */
    public void setSubType1(String subType1) {
        this.subType1 = subType1;
    }

    /**
     * @return the subType2
     */
    public String getSubType2() {
        return subType2;
    }

    /**
     * @param subType2 the subType2 to set
     */
    public void setSubType2(String subType2) {
        this.subType2 = subType2;
    }

    /**
     * @return the statcYmd
     */
    public String getStatcYmd() {
        return statcYmd;
    }
    /**
     * @param statcYmd the statcYmd to set
     */
    public void setStatcYmd(String statcYmd) {
        this.statcYmd = statcYmd;
    }
    /**
     * @return the eaiMoniSvcDstcd
     */
    public String getEaiMoniSvcDstcd() {
        return eaiMoniSvcDstcd;
    }
    /**
     * @param eaiMoniSvcDstcd the eaiMoniSvcDstcd to set
     */
    public void setEaiMoniSvcDstcd(String eaiMoniSvcDstcd) {
        this.eaiMoniSvcDstcd = eaiMoniSvcDstcd;
    }
    /**
     * @return the eaiBzwkDstcd
     */
    public String getEaiBzwkDstcd() {
        return eaiBzwkDstcd;
    }
    /**
     * @param eaiBzwkDstcd the eaiBzwkDstcd to set
     */
    public void setEaiBzwkDstcd(String eaiBzwkDstcd) {
        this.eaiBzwkDstcd = eaiBzwkDstcd;
    }
    /**
     * @return the eaiSvcName
     */
    public String getEaiSvcName() {
        return eaiSvcName;
    }
    /**
     * @param eaiSvcName the eaiSvcName to set
     */
    public void setEaiSvcName(String eaiSvcName) {
        this.eaiSvcName = eaiSvcName;
        
        int len = eaiSvcName.length();
        
        if( eaiSvcName.length() > 8 ) {
            applCode = eaiSvcName.substring(0,3);
            if( applCode.equals(eaiSvcName.substring(len-6, len-3)) ) {
                subType1 = "개설" ;
            } else {
                subType1 = "취급" ;
            }
            
            if( "S".equals(eaiSvcName.substring(len-2, len-1)) ) {
                subType2 = "요청" ; // Sxx
            } else {
                subType2 = "응답" ; // Rxx
            }            
        }
    }
    /**
     * @return the intfacSendTranCd
     */
    public String getIntfacSendTranCd() {
        return intfacSendTranCd;
    }
    /**
     * @param intfacSendTranCd the intfacSendTranCd to set
     */
    public void setIntfacSendTranCd(String intfacSendTranCd) {
        this.intfacSendTranCd = intfacSendTranCd;
    }
    /**
     * @return the testAutonYn
     */
    public String getTestAutonYn() {
        return testAutonYn;
    }
    /**
     * @param testAutonYn the testAutonYn to set
     */
    public void setTestAutonYn(String testAutonYn) {
        this.testAutonYn = testAutonYn;
    }
    /**
     * @return the eaiTranSucssNoitm
     */
    public int getEaiTranSucssNoitm() {
        return eaiTranSucssNoitm;
    }
    /**
     * @param eaiTranSucssNoitm the eaiTranSucssNoitm to set
     */
    public void setEaiTranSucssNoitm(int eaiTranSucssNoitm) {
        this.eaiTranSucssNoitm = eaiTranSucssNoitm;
    }
    /**
     * @return the eaiTranFailNoitm
     */
    public int getEaiTranFailNoitm() {
        return eaiTranFailNoitm;
    }
    /**
     * @param eaiTranFailNoitm the eaiTranFailNoitm to set
     */
    public void setEaiTranFailNoitm(int eaiTranFailNoitm) {
        this.eaiTranFailNoitm = eaiTranFailNoitm;
    }
    /**
     * @return the eaiTranWholNoitm
     */
    public int getEaiTranWholNoitm() {
        return eaiTranWholNoitm;
    }
    /**
     * @param eaiTranWholNoitm the eaiTranWholNoitm to set
     */
    public void setEaiTranWholNoitm(int eaiTranWholNoitm) {
        this.eaiTranWholNoitm = eaiTranWholNoitm;
    }
    
    /**
     * @return the 기동어댑터
     */
    public String getAdapter1() {
        return adapter1;
    }
    /**
     * @param adapter1 the 기동어댑터 to set
     */
    public void setAdapter1(String adapter1) {
        this.adapter1 = adapter1;
    }
    /**
     * @return the 수동어댑터
     */
    public String getAdapter2() {
        return adapter2;
    }
    /**
     * @param adapter2 the 수동어댑터 to set
     */
    public void setAdapter2(String adapter2) {
        this.adapter2 = adapter2;
    }
    
    /**
     * @return the 대외기관코드
     */
    public String getOsidInstiNo() {
        return osidInstiNo;
    }

    /**
     * @param osidInstiNo the osidInstiNo to set
     */
    public void setOsidInstiNo(String osidInstiNo) {
        this.osidInstiNo = osidInstiNo;
    }
    
    

    /**
     * @return the screnNo
     */
    public String getScrenNo() {
        return screnNo;
    }

    /**
     * @param screnNo the screnNo to set
     */
    public void setScrenNo(String screnNo) {
        this.screnNo = screnNo;
    }

    /**
     * @return the eaiDesc
     */
    public String getEaiDesc() {
        return eaiDesc;
    }

    /**
     * @param eaiDesc the eaiDesc to set
     */
    public void setEaiDesc(String eaiDesc) {
        this.eaiDesc = eaiDesc;
    }

    /**
     * 해당 DB 의 테이블 스키마 id 를 리턴한다.
     */
//    public String getSchemaId() {
//        return DataSourceContextHolder.getDataSourceType().getSchemaName();
//    }

}
