/*
 * 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.common.util.HstWxServiceUtil;
import com.hst.framework.constants.WebConstants;
import com.hst.framework.dao.BaseDao;
import com.hst.taxService.dao.imp.TaxArmAppDaoImp;
import com.hst.taxService.domain.arm.ArmDkfpGetDsSpjcAppDomain;
import com.hst.taxService.domain.arm.ArmDkfpGetDsdzSfzxxAppDomain;
import com.hst.taxService.domain.arm.ArmDkfpGetSqxxAppDomain;
import com.hst.taxService.domain.arm.ArmDkfpGetSqxxReturnDomain;
import com.hst.taxService.domain.arm.ArmDkfpJksImportReturnDomain;
import com.hst.taxService.domain.arm.ArmDkfpPrintDsspAppDomain;
import com.hst.taxService.domain.arm.ArmDkfpSaveKjxxAppDomain;
import com.hst.taxService.domain.arm.DkfpGetNsrBsyxxAppDomain;
import com.hst.taxService.domain.arm.DkfpJksImportAppDomain;
import com.hst.taxService.domain.arm.DkfpJksImportDomain;
import com.hst.taxService.domain.arm.DkfpJksImportReturnDomain;
import com.hst.taxService.domain.arm.DkfpJksSaveAppDomain;
import com.hst.taxService.domain.bsdt.DkfpPubImportRequestDomain;
import com.hst.taxService.domain.bsdt.DkfpPubImportResponseDomain;
import com.hst.taxService.domain.hxzg.HxzgYjkpRequestDomain;
import com.hst.taxService.domain.hxzg.HxzgYjkpResponseDomain;
import com.hst.taxService.domain.hxzg.YjkpDzssfxxGridDomain;
import com.hst.taxService.domain.hxzg.YjkpJbxxFormDomain;
import com.hst.taxService.domain.hxzg.YjkpZskpFormDomain;
import com.hst.taxService.service.TaxArmCommonAppService;
import java.util.ArrayList;
import org.springframework.stereotype.Service;

@Service
public class TaxArmAppCommonServiceImp
extends BaseBusinessServiceImp
implements TaxArmCommonAppService {
    private BaseDao dao;

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

    @Override
    public TaxCommonReturnDomain DkfpGetSqxx(ArmDkfpGetSqxxAppDomain appDomain) throws Exception {
        ArmDkfpGetSqxxReturnDomain returnDomain = (ArmDkfpGetSqxxReturnDomain)((TaxArmAppDaoImp)this.getDao("taxArmAppDaoImp")).DkfpGetSqxx(appDomain);
        if ("02".equals(returnDomain.getCode())) {
            DkfpPubImportRequestDomain reqDomain = new DkfpPubImportRequestDomain();
            reqDomain.setBid("Bsdt.DkfpPubImport");
            reqDomain.setDkfpsqdbh(appDomain.getSQDBH());
            reqDomain.setQzdrbz("N");
            reqDomain.setSlrDm(appDomain.getSLRDM());
            DkfpPubImportResponseDomain dkfpPubImportResponseDomain = HstWxServiceUtil.sendMess(WebConstants.GT3JK_SJ_BSPT, reqDomain, "Bsdt.DkfpPubImport", DkfpPubImportResponseDomain.class);
            if ("00".equals(dkfpPubImportResponseDomain.equals(dkfpPubImportResponseDomain.getCode()))) {
                return ((TaxArmAppDaoImp)this.getDao("taxArmAppDaoImp")).DkfpGetSqxx(appDomain);
            }
            returnDomain.setCode(dkfpPubImportResponseDomain.getCode());
            returnDomain.setMess(dkfpPubImportResponseDomain.getMess());
        }
        return returnDomain;
    }

    @Override
    public TaxCommonReturnDomain DkfpGetDsdzSfzxx(ArmDkfpGetDsdzSfzxxAppDomain appDomain) throws Exception {
        return ((TaxArmAppDaoImp)this.getDao("taxArmAppDaoImp")).DkfpGetDsdzSfzxx(appDomain);
    }

    @Override
    public TaxCommonReturnDomain DkfpPrintDssp(ArmDkfpPrintDsspAppDomain appDomain) throws Exception {
        return ((TaxArmAppDaoImp)this.getDao("taxArmAppDaoImp")).DkfpPrintDssp(appDomain);
    }

    @Override
    public TaxCommonReturnDomain DkfpSaveKjxx(ArmDkfpSaveKjxxAppDomain appDomain) throws Exception {
        return ((TaxArmAppDaoImp)this.getDao("taxArmAppDaoImp")).DkfpSaveKjxx(appDomain);
    }

    @Override
    public TaxCommonReturnDomain DkfpGetNsrBsyxx(DkfpGetNsrBsyxxAppDomain appDomain) throws Exception {
        return ((TaxArmAppDaoImp)this.getDao("taxArmAppDaoImp")).DkfpGetNsrBsyxx(appDomain);
    }

    @Override
    public TaxCommonReturnDomain DkfpJksSave(DkfpJksSaveAppDomain appDomain) throws Exception {
        return ((TaxArmAppDaoImp)this.getDao("taxArmAppDaoImp")).DkfpJksSave(appDomain);
    }

    @Override
    public TaxCommonReturnDomain DkfpJksImport(DkfpJksImportAppDomain appDomain) throws Exception {
        ArmDkfpJksImportReturnDomain returnDomain = new ArmDkfpJksImportReturnDomain();
        TaxArmAppDaoImp dao = (TaxArmAppDaoImp)this.getDao("taxArmAppDaoImp");
        DkfpJksImportReturnDomain importReturnDomain = (DkfpJksImportReturnDomain)dao.DkfpJksImport(appDomain);
        if (!"00".equals(importReturnDomain.getCode())) {
            returnDomain.setCode(importReturnDomain.getCode());
            returnDomain.setMess(importReturnDomain.getMess());
            return returnDomain;
        }
        DkfpJksImportDomain importDomain = importReturnDomain.getDataList().get(0);
        HxzgYjkpRequestDomain yjkpRequestDomain = new HxzgYjkpRequestDomain();
        yjkpRequestDomain.setSwryDm(importDomain.getSWRY_DM());
        yjkpRequestDomain.setDlzh(importDomain.getDLZH());
        yjkpRequestDomain.setDlmm(importDomain.getDLMM());
        yjkpRequestDomain.setGwssswjg(importDomain.getGWSSSWJG());
        yjkpRequestDomain.setGwxh(importDomain.getGWXH());
        YjkpJbxxFormDomain jbxxFormDomain = new YjkpJbxxFormDomain();
        jbxxFormDomain.setNsrsbh(importDomain.getNSRSBH());
        jbxxFormDomain.setDjxh(importDomain.getDJXH());
        jbxxFormDomain.setNsrmc(importDomain.getNSRMC());
        jbxxFormDomain.setDjzclxDm(importDomain.getDJZCLX_DM());
        jbxxFormDomain.setZgswskfjDm(importDomain.getZGSWSKFJ_DM());
        jbxxFormDomain.setSksxDm(importDomain.getSKSX_DM());
        jbxxFormDomain.setSjly(importDomain.getSJLY());
        jbxxFormDomain.setAjbh(importDomain.getAJBH());
        jbxxFormDomain.setTfrq(importDomain.getTFRQ());
        jbxxFormDomain.setXzqhszDm(importDomain.getXZQHSZ_DM());
        jbxxFormDomain.setJdxzDm(importDomain.getJDXZ_DM());
        yjkpRequestDomain.setJbxxForm(jbxxFormDomain);
        YjkpZskpFormDomain zskpFormDomain = new YjkpZskpFormDomain();
        zskpFormDomain.setSfjnfs("72");
        zskpFormDomain.setPzzl(importDomain.getPZZL_DM());
        zskpFormDomain.setPzzg(importDomain.getPZZG_DM());
        zskpFormDomain.setPzqshm(importDomain.getPZHM());
        zskpFormDomain.setSfdysp("1");
        yjkpRequestDomain.setZskpForm(zskpFormDomain);
        ArrayList<YjkpDzssfxxGridDomain> dzssfxxGrid = new ArrayList<YjkpDzssfxxGridDomain>();
        YjkpDzssfxxGridDomain dzssfxxGridDomain = new YjkpDzssfxxGridDomain();
        dzssfxxGridDomain.setDksquuid(importDomain.getDKSQUUID());
        dzssfxxGridDomain.setYsfpblDm(importDomain.getYSFPBL_DM());
        dzssfxxGridDomain.setYskmDm(importDomain.getYSKM_DM());
        dzssfxxGridDomain.setSkgkDm(importDomain.getSKGK_DM());
        dzssfxxGridDomain.setJsyj(importDomain.getJSYJ());
        dzssfxxGridDomain.setSl1(importDomain.getSL1());
        dzssfxxGridDomain.setYjse(importDomain.getYJSE());
        dzssfxxGridDomain.setYbtse(importDomain.getYBTSE());
        dzssfxxGrid.add(dzssfxxGridDomain);
        yjkpRequestDomain.setDzssfxxGrid(dzssfxxGrid);
        HxzgYjkpResponseDomain yjkpResponseDomain = HstWxServiceUtil.sendMess(WebConstants.HXZG_URL, yjkpRequestDomain, "hxzg.yjkp", HxzgYjkpResponseDomain.class);
        if ("00".equals(yjkpResponseDomain.getCode())) {
            returnDomain.setCode("00");
            returnDomain.setDzsphm(yjkpResponseDomain.getDzsphm());
            returnDomain.setNsrsbh(yjkpResponseDomain.getNsrsbh());
            returnDomain.setNsrmc(yjkpResponseDomain.getNsrmc());
            returnDomain.setDjzclx(yjkpResponseDomain.getDjzclx());
            returnDomain.setTfrq_year(yjkpResponseDomain.getTfrq_year());
            returnDomain.setTfrq_month(yjkpResponseDomain.getTfrq_month());
            returnDomain.setTfrq_day(yjkpResponseDomain.getTfrq_day());
            returnDomain.setZsjg(yjkpResponseDomain.getZsjg());
            returnDomain.setGdszsjgmc(yjkpResponseDomain.getGdszsjgmc());
            returnDomain.setList(yjkpResponseDomain.getList());
            returnDomain.setKprymc(yjkpResponseDomain.getKprymc());
            returnDomain.setHjje_num(yjkpResponseDomain.getHjje_num());
            returnDomain.setHjje_chn(yjkpResponseDomain.getHjje_chn());
            returnDomain.setBz(yjkpResponseDomain.getBz());
            returnDomain.setZcdz(yjkpResponseDomain.getZcdz());
            returnDomain.setYsfpblmc(yjkpResponseDomain.getYsfpblmc());
            returnDomain.setYskmmc(yjkpResponseDomain.getYskmmc());
            try {
                dao.DkfpJksImportHxcl(appDomain.getSQDBH(), yjkpResponseDomain.getDzsphm(), "Y");
            }
            catch (Exception e) {
                e.getStackTrace();
                _logger.error((Object)("\u4e1a\u52a1id\uff1a" + appDomain.getBid() + "\u7533\u8bf7\u5355\u7f16\u53f7\uff1a" + appDomain.getSQDBH() + "\u7535\u5b50\u7a0e\u7968\u53f7\u7801\uff1a" + yjkpResponseDomain.getDzsphm() + "\u5f00\u5177\u7a0e\u52a1\u6536\u73b0\u7f34\u6b3e\u4e66\u65f6\uff0c\u540e\u7eed\u5904\u7406\u62a5\u9519\uff1a" + e.getMessage()));
            }
            returnDomain.setMess("\u64cd\u4f5c\u6210\u529f");
        } else {
            returnDomain.setCode(yjkpResponseDomain.getCode());
            returnDomain.setMess(yjkpResponseDomain.getMess());
        }
        return returnDomain;
    }

    @Override
    public TaxCommonReturnDomain DkfpGetDsSpjc(ArmDkfpGetDsSpjcAppDomain appDomain) throws Exception {
        return ((TaxArmAppDaoImp)this.getDao("taxArmAppDaoImp")).DkfpGetDsSpjc(appDomain);
    }
}
