/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  org.springframework.stereotype.Service
 */
package com.hst.taxService.service.imp;

import com.hst.common.domain.TaxCommonReturnDomain;
import com.hst.common.service.imp.BaseBusinessServiceImp;
import com.hst.framework.constants.WebConstants;
import com.hst.framework.dao.BaseDao;
import com.hst.taxService.dao.imp.TaxDdCommonDaoImp;
import com.hst.taxService.domain.dd.DdinDbrwBdxmAppDomain;
import com.hst.taxService.domain.dd.DdinDbrwBdxmXzxAppDomain;
import com.hst.taxService.domain.dd.DdinDbrwListAppDomain;
import com.hst.taxService.domain.dd.DdinDbrwNrAppDomain;
import com.hst.taxService.domain.dd.DdinDbrwSaveAppDomain;
import com.hst.taxService.domain.dd.DdinSaveCkbzAppDomain;
import com.hst.taxService.domain.dd.DdinSaveHfxxAppDomain;
import com.hst.taxService.domain.dd.DdinSaveRyJhxxAppDomain;
import com.hst.taxService.domain.dd.DdoutCommonReturnDomain;
import com.hst.taxService.domain.dd.DdoutSednMessResponse;
import com.hst.taxService.domain.dd.DdoutSednMessReturnDomain;
import com.hst.taxService.domain.dd.DdoutSendDbrwAppDomain;
import com.hst.taxService.domain.dd.DdoutSendDbrwResponse;
import com.hst.taxService.domain.dd.DdoutSendDbrwReturnDomain;
import com.hst.taxService.domain.dd.DdoutSendMessAppDomain;
import com.hst.taxService.domain.dd.DdoutSendMessDelAppDomain;
import com.hst.taxService.domain.dd.DdoutTbBsryAppDomain;
import com.hst.taxService.domain.dd.DdoutTbBsyResDomain;
import com.hst.taxService.domain.dd.DdoutTbBsyReturnDomain;
import com.hst.taxService.domain.dd.DdoutTbFileAppDomain;
import com.hst.taxService.domain.dd.DdoutTbFileResDomain;
import com.hst.taxService.domain.dd.DdoutTbFileReturnDomain;
import com.hst.taxService.domain.dd.DdoutTbNsrAppDomain;
import com.hst.taxService.domain.dd.DdoutTbSwbmAppDomain;
import com.hst.taxService.domain.dd.DdoutTbSwryAppDomain;
import com.hst.taxService.domain.dd.DdoutTbSwryResDomain;
import com.hst.taxService.domain.dd.DdoutTbSwryReturnDomain;
import com.hst.taxService.service.TaxDdCommonAppService;
import com.ifugle.util.export.DsbServiceUtil;
import org.springframework.stereotype.Service;

@Service
public class TaxDdAppCommonServiceImp
extends BaseBusinessServiceImp
implements TaxDdCommonAppService {
    private BaseDao dao;

    public BaseDao getDao(String daoName) {
        this.dao = (BaseDao)WebConstants.WEB_APP_CONTEXT.getBean(daoName);
        return this.dao;
    }

    @Override
    public TaxCommonReturnDomain inSaveRyJhxx(DdinSaveRyJhxxAppDomain appDomain) throws Exception {
        return ((TaxDdCommonDaoImp)this.getDao("taxDdCommonDaoImp")).inSaveRyJhxx(appDomain);
    }

    @Override
    public TaxCommonReturnDomain inSaveCkbz(DdinSaveCkbzAppDomain appDomain) throws Exception {
        return ((TaxDdCommonDaoImp)this.getDao("taxDdCommonDaoImp")).inSaveCkbz(appDomain);
    }

    @Override
    public TaxCommonReturnDomain inSaveHfxx(DdinSaveHfxxAppDomain appDomain) throws Exception {
        return ((TaxDdCommonDaoImp)this.getDao("taxDdCommonDaoImp")).inSaveHfxx(appDomain);
    }

    @Override
    public TaxCommonReturnDomain inDbrwList(DdinDbrwListAppDomain appDomain) throws Exception {
        return ((TaxDdCommonDaoImp)this.getDao("taxDdCommonDaoImp")).inDbrwList(appDomain);
    }

    @Override
    public TaxCommonReturnDomain inDbrwNr(DdinDbrwNrAppDomain appDomain) throws Exception {
        return ((TaxDdCommonDaoImp)this.getDao("taxDdCommonDaoImp")).inDbrwNr(appDomain);
    }

    @Override
    public TaxCommonReturnDomain inDbrwBdxm(DdinDbrwBdxmAppDomain appDomain) throws Exception {
        return ((TaxDdCommonDaoImp)this.getDao("taxDdCommonDaoImp")).inDbrwBdxm(appDomain);
    }

    @Override
    public TaxCommonReturnDomain inDbrwBdxmXzx(DdinDbrwBdxmXzxAppDomain appDomain) throws Exception {
        return ((TaxDdCommonDaoImp)this.getDao("taxDdCommonDaoImp")).inDbrwBdxmXzx(appDomain);
    }

    @Override
    public TaxCommonReturnDomain inDbrwSave(DdinDbrwSaveAppDomain appDomain) throws Exception {
        return ((TaxDdCommonDaoImp)this.getDao("taxDdCommonDaoImp")).inDbrwSave(appDomain);
    }

    @Override
    public TaxCommonReturnDomain outTbSwbm(DdoutTbSwbmAppDomain appDomain) throws Exception {
        TaxCommonReturnDomain returnDomain = new TaxCommonReturnDomain();
        DdoutCommonReturnDomain res = DsbServiceUtil.sendMess("/dsb/api/tpc/dept", appDomain, DdoutCommonReturnDomain.class);
        returnDomain.setMess(res.getMsg());
        if (res.isSuccess()) {
            returnDomain.setCode("00");
        } else {
            returnDomain.setCode("01");
            returnDomain.setMess(res.getMsg());
        }
        return returnDomain;
    }

    @Override
    public TaxCommonReturnDomain outTbSwry(DdoutTbSwryAppDomain appDomain) throws Exception {
        DdoutTbSwryReturnDomain returnDomain = new DdoutTbSwryReturnDomain();
        DdoutTbSwryResDomain res = DsbServiceUtil.sendMess("/dsb/api/tpc/cy", appDomain, DdoutTbSwryResDomain.class);
        returnDomain.setMess(res.getMsg());
        if (res.isSuccess()) {
            returnDomain.setCode("00");
            if (!res.getData().isEmpty()) {
                returnDomain.setDdid(res.getData().get(0).getDingId());
                returnDomain.setCyzt(res.getData().get(0).getCyzt());
            }
        } else {
            returnDomain.setCode("01");
            returnDomain.setMess(res.getMsg());
        }
        return returnDomain;
    }

    @Override
    public TaxCommonReturnDomain outTbNsr(DdoutTbNsrAppDomain appDomain) throws Exception {
        TaxCommonReturnDomain returnDomain = new TaxCommonReturnDomain();
        DdoutCommonReturnDomain res = DsbServiceUtil.sendMess("/dsb/api/tpc/nsrxx", appDomain, DdoutCommonReturnDomain.class);
        returnDomain.setMess(res.getMsg());
        if (res.isSuccess()) {
            returnDomain.setCode("00");
        } else {
            returnDomain.setCode("01");
            returnDomain.setMess(res.getMsg());
        }
        return returnDomain;
    }

    @Override
    public TaxCommonReturnDomain outTbBsry(DdoutTbBsryAppDomain appDomain) throws Exception {
        DdoutTbBsyReturnDomain returnDomain = new DdoutTbBsyReturnDomain();
        DdoutTbBsyResDomain res = DsbServiceUtil.sendMess("/dsb/api/tpc/nsrxx/bsrxx", appDomain, DdoutTbBsyResDomain.class);
        returnDomain.setMess(res.getMsg());
        if (res.isSuccess()) {
            returnDomain.setCode("00");
            if (!res.getData().isEmpty()) {
                returnDomain.setDdid(res.getData().get(0).getDingId());
                returnDomain.setCyzt(res.getData().get(0).getCyzt());
            }
        } else {
            returnDomain.setCode("01");
            returnDomain.setMess(res.getMsg());
        }
        return returnDomain;
    }

    @Override
    public TaxCommonReturnDomain outSendMess(DdoutSendMessAppDomain appDomain) throws Exception {
        DdoutSednMessReturnDomain returnDomain = new DdoutSednMessReturnDomain();
        DdoutSednMessResponse res = DsbServiceUtil.sendMess("/dsb/api/tpc/xxzx/xxPush", appDomain, DdoutSednMessResponse.class);
        returnDomain.setMess(res.getMsg());
        if (res.isSuccess()) {
            returnDomain.setCode("00");
        } else {
            returnDomain.setMess(res.getMsg());
            returnDomain.setCode("01");
        }
        returnDomain.setErrorList(res.getErrorList());
        return returnDomain;
    }

    @Override
    public TaxCommonReturnDomain outSendMessDel(DdoutSendMessDelAppDomain appDomain) throws Exception {
        TaxCommonReturnDomain returnDomain = new TaxCommonReturnDomain();
        DdoutCommonReturnDomain res = DsbServiceUtil.sendMess("/dsb/api/tpc/xxzx/xxCancle", appDomain, DdoutCommonReturnDomain.class);
        returnDomain.setMess(res.getMsg());
        if (res.isSuccess()) {
            returnDomain.setCode("00");
        } else {
            returnDomain.setMess(res.getMsg());
            returnDomain.setCode("01");
        }
        return returnDomain;
    }

    @Override
    public TaxCommonReturnDomain outSendDbrw(DdoutSendDbrwAppDomain appDomain) throws Exception {
        DdoutSendDbrwReturnDomain returnDomain = new DdoutSendDbrwReturnDomain();
        DdoutSendDbrwResponse res = DsbServiceUtil.sendMess("/dsb/api/tpc/xxzx/xxPush/dbrw", appDomain, DdoutSendDbrwResponse.class);
        returnDomain.setMess(res.getMsg());
        if (res.isSuccess()) {
            returnDomain.setCode("00");
        } else {
            returnDomain.setMess(res.getMsg());
            returnDomain.setCode("01");
        }
        returnDomain.setErrorList(res.getErrorList());
        return returnDomain;
    }

    @Override
    public TaxCommonReturnDomain outFileUpload(DdoutTbFileAppDomain appDomain) throws Exception {
        DdoutTbFileReturnDomain returnDomain = new DdoutTbFileReturnDomain();
        DdoutTbFileResDomain res = DsbServiceUtil.sendMess("/dsb/api/tpc/xxzx/attachment/upload", appDomain, DdoutTbFileResDomain.class);
        returnDomain.setMess(res.getMsg());
        if (res.isSuccess()) {
            returnDomain.setCode("00");
        } else {
            returnDomain.setMess(res.getMsg());
            returnDomain.setCode("01");
        }
        returnDomain.setData(res.getData());
        return returnDomain;
    }
}
