/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  org.springframework.beans.factory.annotation.Autowired
 *  org.springframework.stereotype.Repository
 */
package com.hst.taxService.dao.imp;

import com.hst.common.domain.TaxCommonReturnDomain;
import com.hst.framework.common.HstSqlMapClientTemplate;
import com.hst.framework.util.HstToolsUtil;
import com.hst.taxService.dao.TaxDxptAppDao;
import com.hst.taxService.domain.dxpt.DxptCheckSjYzmAppDomain;
import com.hst.taxService.domain.dxpt.DxptGetNsrSjYzmAppDomain;
import java.util.HashMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

@Repository
public class TaxDxptAppDaoImp
implements TaxDxptAppDao {
    @Autowired
    private HstSqlMapClientTemplate sqlMapClientTemplate;

    @Override
    public TaxCommonReturnDomain queryNsrSjYzm(DxptGetNsrSjYzmAppDomain domain) throws Exception {
        HashMap<String, Object> map = new HashMap<String, Object>();
        map.put("nsrsbh", domain.getNsrsbh());
        map.put("sjhm", domain.getSjhm());
        map.put("dxnr", HstToolsUtil.GBK2ISO(domain.getDxnr()));
        if (HstToolsUtil.isNullOrEmpty(domain.getYxsj())) {
            map.put("yxsj", 30);
        } else {
            map.put("yxsj", Integer.valueOf(domain.getYxsj()));
        }
        if (HstToolsUtil.isNullOrEmpty(domain.getYxsj())) {
            map.put("yzmlen", 6);
        } else {
            map.put("yzmlen", Integer.valueOf(domain.getYzmlen()));
        }
        map.put("code", null);
        map.put("mess", null);
        this.sqlMapClientTemplate.queryForObject("queryNsrSjYzm", map);
        TaxCommonReturnDomain returnDomain = new TaxCommonReturnDomain();
        returnDomain.setCode((String)map.get("code"));
        returnDomain.setMess(HstToolsUtil.ISO2GBK((String)map.get("mess")));
        return returnDomain;
    }

    @Override
    public TaxCommonReturnDomain checkNsrSjYzm(DxptCheckSjYzmAppDomain domain) throws Exception {
        HashMap<String, String> map = new HashMap<String, String>();
        map.put("sjhm", domain.getSjhm());
        map.put("yzm", domain.getYzm());
        map.put("code", null);
        map.put("mess", null);
        this.sqlMapClientTemplate.queryForObject("checkNsrSjYzm", map);
        TaxCommonReturnDomain returnDomain = new TaxCommonReturnDomain();
        returnDomain.setCode((String)map.get("code"));
        returnDomain.setMess(HstToolsUtil.ISO2GBK((String)map.get("mess")));
        return returnDomain;
    }
}
