/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  javax.annotation.Resource
 *  org.apache.commons.logging.Log
 *  org.apache.commons.logging.LogFactory
 *  org.apache.struts2.convention.annotation.Action
 *  org.apache.struts2.convention.annotation.Result
 *  org.springframework.context.annotation.Scope
 *  org.springframework.stereotype.Controller
 */
package com.hst.taxService.action;

import com.hst.business.domain.XtTaxServiceLogDomain;
import com.hst.common.action.ExtendAction;
import com.hst.common.domain.BaseAppServiceDomain;
import com.hst.common.domain.TaxCommonAppServiceDomain;
import com.hst.common.domain.TaxCommonReturnDomain;
import com.hst.common.service.BaseBusinessService;
import com.hst.common.util.DomainUtil;
import com.hst.common.util.HstJsonUtil;
import com.hst.framework.constants.AppServiceConstants;
import com.hst.framework.constants.WebConstants;
import com.hst.framework.util.HstToolsUtil;
import com.hst.taxService.service.Gt3CommonAppService;
import javax.annotation.Resource;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Result;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

@Controller
@Scope(value="prototype")
@Action(value="/service/gt3Common", results={@Result(name="doGt3Service", type="json")})
public class Gt3CommonAppAction
extends ExtendAction {
    private static final long serialVersionUID = 1L;
    public static Log _logger = LogFactory.getLog(Gt3CommonAppAction.class);
    private TaxCommonAppServiceDomain domain;

    /*
     * Loose catch block
     */
    public String doGt3Service() throws Exception {
        block158: {
            Gt3CommonAppService service = (Gt3CommonAppService)this.getService();
            BaseAppServiceDomain appDomain = null;
            TaxCommonReturnDomain returnDomain = null;
            TaxCommonReturnDomain errorDomain = null;
            XtTaxServiceLogDomain taxLogDomain = null;
            try {
                if ("Y".equals(WebConstants.TAX_SERVICE_LOG)) {
                    taxLogDomain = new XtTaxServiceLogDomain();
                    taxLogDomain.setRecvData(this.getDomain().getParmJson());
                    service.saveTaxLog(taxLogDomain);
                }
                String ywId = this.getDomain().getYwId();
                returnDomain = DomainUtil.getDomain(ywId);
                try {
                    appDomain = DomainUtil.getAppServiceDomain(ywId, this.getDomain().getParmJson());
                    if (appDomain == null) {
                        this.handleException(returnDomain, AppServiceConstants.TAX_JSONPARSE_ERROR);
                        return "doGt3Service";
                    }
                }
                catch (Exception exception) {
                    block156: {
                        block157: {
                            this.handleException(returnDomain, AppServiceConstants.TAX_JSONPARSE_ERROR);
                            if (!"Y".equals(WebConstants.TAX_SERVICE_LOG)) break block156;
                            if (errorDomain != null || !"00".equals(returnDomain.getCode())) {
                                taxLogDomain.setClbz("9");
                                if (errorDomain != null) {
                                    taxLogDomain.setErrMess(errorDomain.getMess());
                                } else {
                                    taxLogDomain.setErrMess(returnDomain.getMess());
                                }
                                break block157;
                            }
                            taxLogDomain.setClbz("1");
                            if (!HstToolsUtil.isNullOrEmpty(this.domain.getRetJson())) {
                                taxLogDomain.setBackData(this.domain.getRetJson());
                            }
                        }
                        service.updateTaxLog(taxLogDomain);
                    }
                    taxLogDomain = null;
                    errorDomain = null;
                    appDomain = null;
                    returnDomain = null;
                    return "doGt3Service";
                }
                if (AppServiceConstants.YWID_GT3_HXZGDJCXNSRDJXX.equals(ywId)) {
                    returnDomain = service.hxzgDjCxNsrdjxx(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGDJZRRJJDJ.equals(ywId)) {
                    returnDomain = service.hxzgDjZrrjjDj(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGDJCXNSRYHXX.equals(ywId)) {
                    returnDomain = service.hxzgDjCxNsrYhxx(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGDJCXNSRSFZXX.equals(ywId)) {
                    returnDomain = service.hxzgDjCxNsrSfzxx(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGDJCXNSRDSQCXX.equals(ywId)) {
                    returnDomain = service.hxzgDjCxNsrDsqcxx(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGSBZZSXGMSBSAVE.equals(ywId)) {
                    returnDomain = service.hxzgSbZzsXgmSbSave(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGSBWTDZSBSAVE.equals(ywId)) {
                    returnDomain = service.hxzgSbWtdzSbSave(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGSBSBZF.equals(ywId)) {
                    returnDomain = service.hxzgSbSbZf(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGZSWSZSAVE.equals(ywId)) {
                    returnDomain = service.HxzgZsWszSave(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGZSFQYHKK.equals(ywId)) {
                    returnDomain = service.HxzgZsFqyhkk(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGZSDYYHDJKPZ.equals(ywId)) {
                    returnDomain = service.HxzgZsDyyhdjkpz(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGZSCXYHDJKPZWJKXX.equals(ywId)) {
                    returnDomain = service.HxzgZsCxyhdjkpzwjkxx(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGZSWTDZWSZHZSSKK.equals(ywId)) {
                    returnDomain = service.HxzgZsWtdzwszhzsskk(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGZSYHDJSPZCLJK.equals(ywId)) {
                    returnDomain = service.HxzgZsYhdjspzcljk(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGFPCXNSRFPJC.equals(ywId)) {
                    returnDomain = service.HxzgFpCxnsrfpjc(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGSBCXSDDWPZKC.equals(ywId)) {
                    returnDomain = service.HxzgSbCxsddwpzkc(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGPZCXSDDWKCXX.equals(ywId)) {
                    returnDomain = service.HxzgPzCxsddwkcxx(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGZSSFXYSAVE.equals(ywId)) {
                    returnDomain = service.HxzgZsSfxyxxSave(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGZSZFSFXYXX.equals(ywId)) {
                    returnDomain = service.HxzgZsZfSfxyxx(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGZSFSSFXY.equals(ywId)) {
                    returnDomain = service.HxzgZsFsSfxyxx(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGZSQXSFXY.equals(ywId)) {
                    returnDomain = service.HxzgZsQxSfxyxx(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGZSGXSFXY.equals(ywId)) {
                    returnDomain = service.HxzgZsGxSfxyxx(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGCXSFXY.equals(ywId)) {
                    returnDomain = service.HxzgZsCxSfxyxx(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGDJCXNSRJYXX.equals(ywId)) {
                    returnDomain = service.hxzgDjCxNsrjyxx(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGCXNSRDKFPYJXX.equals(ywId)) {
                    returnDomain = service.hxzgZsCxNsrdkfpyjxx(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGZGCXRJTSSH.equals(ywId)) {
                    returnDomain = service.hxzgZsCxRjtssh(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGZMWCJYHDSSGLZMSQBXXSAVE.equals(ywId)) {
                    returnDomain = service.hxzgZmWcjyhdssglzmsqbxxSave(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGFPLGBJBXXSAVE.equals(ywId)) {
                    returnDomain = service.hxzgFpLgbjbxxSave(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGFPFSXXSAVE.equals(ywId)) {
                    returnDomain = service.hxzgFpFsxxSave(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGFPFPYJJXXSAVE.equals(ywId)) {
                    returnDomain = service.hxzgFpFpyjjxxSave(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGFPCXNSRPZHDXX.equals(ywId)) {
                    returnDomain = service.hxzgFpCxnsrpzhdxx(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGFPCXNSRFPLGBQKXX.equals(ywId)) {
                    returnDomain = service.hxzgFpCxnsrfplgbqkxx(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGFPCXNSRPZHDGPRXX.equals(ywId)) {
                    returnDomain = service.hxzgFpCxnsrpzhdgprxx(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGFPCXFPFSXXLB.equals(ywId)) {
                    returnDomain = service.hxzgFpCxfpfsxxlb(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGFPDKFPZF.equals(ywId)) {
                    returnDomain = service.hxzgFpDkfpZf(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGFPDKFPSQZF.equals(ywId)) {
                    returnDomain = service.hxzgFpDkfpsqZf(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGFPKJDKFP.equals(ywId)) {
                    returnDomain = service.hxzgFpKjdkfp(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGFPDKSQTYJDSAVE.equals(ywId)) {
                    returnDomain = service.hxzgFpDksqtyjdSave(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGFPDKSQZZSSAVE.equals(ywId)) {
                    returnDomain = service.hxzgFpDksqzzsSave(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGFPDKSQZZSPTFPSAVE.equals(ywId)) {
                    returnDomain = service.hxzgFpDksqzzsptfpSave(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGDJCXWBNSRJYDBYDJXX.equals(ywId)) {
                    returnDomain = service.hxzgDjCxWbnsrjydbydjxx(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGZSDKFPSSKK.equals(ywId)) {
                    returnDomain = service.hxzgZsDkfpsskk(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGFPCXTDZSBMDJXH.equals(ywId)) {
                    returnDomain = service.hxzgFpCxTdzsbmDjxh(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGZSSKYDZSPKKZTCX.equals(ywId)) {
                    returnDomain = service.hxzgZsSkyDzspkkztcx(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGPZSWRYSPJC.equals(ywId)) {
                    returnDomain = service.hxzgPzSwrySpjc(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGZRRDJEXISTS.equals(ywId)) {
                    returnDomain = service.hxzgZrrDjExists(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGSBSBQKCXSS.equals(ywId)) {
                    returnDomain = service.hxzgSbSbqkcxss(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGSBWSBXXCX.equals(ywId)) {
                    returnDomain = service.hxzgSbWsbxxcx(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGZSCXRKXXTOFX.equals(ywId)) {
                    returnDomain = service.hxzgZsCxrkxxtofx(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGZSCXWKKSBBXX.equals(ywId)) {
                    returnDomain = service.hxzgZsCxwkksbbxx(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGDJBCSWJDBXXJYSJX.equals(ywId)) {
                    returnDomain = service.hxzgDjBcswjdbxxjysjx(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGSBZFYZPZXH.equals(ywId)) {
                    returnDomain = service.hxzgSbZfYzpzxh(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGFPCXZRRDKFP.equals(ywId)) {
                    returnDomain = service.hxzgFpCxZrrDkfp(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGQTGETCURTIME.equals(ywId)) {
                    returnDomain = service.hxzgQtGetCurtime(appDomain);
                } else if (AppServiceConstants.YWID_GT3_GSGLDJCXZRRDJXXWBXT.equals(ywId)) {
                    returnDomain = service.gsglDjCxZrrDjxxWbxt(appDomain);
                } else if (AppServiceConstants.YWID_GT3_GSGLSBGRSDSSCJYSDA.equals(ywId)) {
                    returnDomain = service.gsglSbGrsdsScjysdA(appDomain);
                } else if (AppServiceConstants.YWID_GT3_GSGLSBGRSDSSCJYSDAZF.equals(ywId)) {
                    returnDomain = service.gsglSbGrsdsScjysdAZf(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGSBBCFXMTYSB.equals(ywId)) {
                    returnDomain = service.hxzgSbBcFxmtysb(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGSBBCFJSSBB.equals(ywId)) {
                    returnDomain = service.hxzgSbBcFjssbb(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGZSGRSBPLFQSSKKBYQYZH.equals(ywId)) {
                    returnDomain = service.hxzgZsGrsbplfqsskkByQyzh(appDomain);
                } else if (AppServiceConstants.YWID_GT3_HXZGZSGCXYSKMYSFPBLXX.equals(ywId)) {
                    returnDomain = service.hxzgZsCxYskmYsfpblxx(appDomain);
                }
                if (returnDomain == null) {
                    returnDomain = new TaxCommonReturnDomain();
                    this.handleException(returnDomain, AppServiceConstants.TAX_APP_ERROR);
                    return "doGt3Service";
                }
                if (AppServiceConstants.TAX_APP_SUCCESS.equals(returnDomain.getCode())) {
                    try {
                        this.domain.setRetJson(HstJsonUtil.beanToJson(returnDomain));
                        break block158;
                    }
                    catch (Exception exception) {
                        this.handleException(returnDomain, AppServiceConstants.TAX_BEAN_TO_JSON_ERROR);
                        if ("Y".equals(WebConstants.TAX_SERVICE_LOG)) {
                            if (errorDomain != null || !"00".equals(returnDomain.getCode())) {
                                taxLogDomain.setClbz("9");
                                if (errorDomain != null) {
                                    taxLogDomain.setErrMess(errorDomain.getMess());
                                } else {
                                    taxLogDomain.setErrMess(returnDomain.getMess());
                                }
                            } else {
                                taxLogDomain.setClbz("1");
                                if (!HstToolsUtil.isNullOrEmpty(this.domain.getRetJson())) {
                                    taxLogDomain.setBackData(this.domain.getRetJson());
                                }
                            }
                            service.updateTaxLog(taxLogDomain);
                        }
                        taxLogDomain = null;
                        errorDomain = null;
                        appDomain = null;
                        returnDomain = null;
                        return "doGt3Service";
                    }
                }
                this.handleServiceException(returnDomain, returnDomain.getCode(), returnDomain.getMess());
                return "doGt3Service";
                {
                    catch (Exception e) {
                        errorDomain = this.handleException(e);
                        this.handleException(returnDomain, errorDomain.getCode(), errorDomain.getMess());
                        break block158;
                    }
                    catch (Throwable throwable) {
                        throw throwable;
                    }
                }
            }
            finally {
                if ("Y".equals(WebConstants.TAX_SERVICE_LOG)) {
                    if (errorDomain != null || !"00".equals(returnDomain.getCode())) {
                        taxLogDomain.setClbz("9");
                        if (errorDomain != null) {
                            taxLogDomain.setErrMess(errorDomain.getMess());
                        } else {
                            taxLogDomain.setErrMess(returnDomain.getMess());
                        }
                    } else {
                        taxLogDomain.setClbz("1");
                        if (!HstToolsUtil.isNullOrEmpty(this.domain.getRetJson())) {
                            taxLogDomain.setBackData(this.domain.getRetJson());
                        }
                    }
                    service.updateTaxLog(taxLogDomain);
                }
                taxLogDomain = null;
                errorDomain = null;
                appDomain = null;
                returnDomain = null;
            }
        }
        return "doGt3Service";
    }

    public String commonHandle(BaseAppServiceDomain appDomain) throws Exception {
        return AppServiceConstants.TAX_APP_SUCCESS;
    }

    public void handleException(TaxCommonReturnDomain returnDomain, String code) throws Exception {
        if (returnDomain == null) {
            returnDomain = new TaxCommonReturnDomain();
        }
        returnDomain.setCode(code);
        String message = this.handleExceptionMessage(returnDomain.getCode());
        returnDomain.setMess(message);
        this.domain.setRetJson(HstJsonUtil.beanToJson(returnDomain));
        if (WebConstants.LOG_KZ_ERRORS.equals("Y")) {
            _logger.error((Object)message);
        }
    }

    public void handleException(TaxCommonReturnDomain returnDomain, String code, String error) throws Exception {
        if (returnDomain == null) {
            returnDomain = new TaxCommonReturnDomain();
        }
        returnDomain.setCode(code);
        String message = this.handleExceptionMessage(returnDomain.getCode());
        if (HstToolsUtil.isNullOrEmpty(error)) {
            returnDomain.setMess(message);
        } else {
            returnDomain.setMess(String.valueOf(message) + error);
        }
        this.domain.setRetJson(HstJsonUtil.beanToJson(returnDomain));
    }

    public void handleServiceException(TaxCommonReturnDomain returnDomain, String code, String error) throws Exception {
        returnDomain.setCode(code);
        String message = this.handleExceptionMessage(returnDomain.getCode());
        if (HstToolsUtil.isNullOrEmpty(error)) {
            returnDomain.setMess(message);
        } else {
            returnDomain.setMess(String.valueOf(message) + error);
        }
        this.domain.setRetJson(HstJsonUtil.beanToJson(returnDomain));
    }

    public String handleExceptionMessage(String code) throws Exception {
        String message = "";
        if (HstToolsUtil.isNullOrEmpty(code)) {
            return message;
        }
        message = AppServiceConstants.TAX_CODE_MESS_MAP.containsKey(code) ? AppServiceConstants.TAX_CODE_MESS_MAP.get(code) : (code.length() <= 2 ? "" : "\u672a\u5b9a\u4e49\u7684\u9519\u8bef\uff01");
        return message;
    }

    @Override
    @Resource(name="gt3CommonAppServiceImp")
    public void setService(BaseBusinessService service) {
        super.setService(service);
    }

    @Override
    public TaxCommonAppServiceDomain getDomain() {
        if (this.domain == null) {
            this.domain = new TaxCommonAppServiceDomain();
        }
        return this.domain;
    }

    public void setDomain(TaxCommonAppServiceDomain domain) {
        this.domain = domain;
    }
}
