/*
 * 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.dao.BaseDao;
import com.hst.framework.util.HstToolsUtil;
import com.hst.taxService.domain.qtty.EmsWlxx;
import com.hst.taxService.domain.qtty.QttyEmsYdgxAppDomain;
import com.hst.taxService.domain.qtty.QttyEmsYdgxReturnDomain;
import com.hst.taxService.domain.qtty.QttyEmsYdxxcxAppDomain;
import com.hst.taxService.domain.qtty.QttyEmsYdxxcxDomain;
import com.hst.taxService.domain.qtty.QttyEmsYdxxcxReturnDomain;
import com.hst.taxService.domain.qtty.QttyEmscxReturnDomain;
import com.hst.taxService.domain.qtty.QttyYjxxDomain;
import com.hst.taxService.domain.qtty.QttyYjxxMxDomain;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

@Repository
public class TaxWxEmsxxAppDaoImp
implements BaseDao {
    @Autowired
    private HstSqlMapClientTemplate sqlMapClientTemplate;

    public TaxCommonReturnDomain doEmsYdxxCx(QttyEmsYdxxcxAppDomain domain) throws Exception {
        QttyEmsYdxxcxReturnDomain returnDomain = null;
        HashMap<String, String> map = new HashMap<String, String>();
        map.put("kddbh", domain.getKddbh());
        map.put("wlzt", "");
        map.put("code", "");
        map.put("mess", "");
        map.put("wlxxList", null);
        this.sqlMapClientTemplate.queryForObjectByCurr("pWebjkQttyEmsydxxcx", "wlxxList", map);
        ArrayList<QttyEmsYdxxcxDomain> dataList = new ArrayList();
        dataList = (List)map.get("wlxxList");
        returnDomain = new QttyEmsYdxxcxReturnDomain();
        returnDomain.setCode((String)map.get("code"));
        returnDomain.setWlzt((String)map.get("wlzt"));
        returnDomain.setMess(HstToolsUtil.ISO2GBK((String)map.get("mess")));
        returnDomain.setDataList(dataList);
        return returnDomain;
    }

    public TaxCommonReturnDomain doEmsYdgx(QttyEmsYdgxAppDomain domain) throws Exception {
        QttyEmsYdgxReturnDomain returnDomain = null;
        HashMap<String, String> map = new HashMap<String, String>();
        map.put("kddbh", domain.getKddbh());
        map.put("sssxSlxh", domain.getSssxSlxh());
        map.put("code", "");
        map.put("mess", "");
        this.sqlMapClientTemplate.queryForObjectByCurr("pWebjkQttyEmsydgx", "", map);
        returnDomain = new QttyEmsYdgxReturnDomain();
        returnDomain.setCode((String)map.get("code"));
        returnDomain.setMess(HstToolsUtil.ISO2GBK((String)map.get("mess")));
        return returnDomain;
    }

    public TaxCommonReturnDomain doEmsYdgxHxcl(QttyYjxxDomain domain) throws Exception {
        QttyEmsYdgxReturnDomain returnDomain = null;
        HashMap<String, String> map = new HashMap<String, String>();
        map.put("kddbh", domain.getKddbh());
        map.put("wlzt", domain.getWlzt());
        map.put("qsrsm", domain.getQsrsm());
        map.put("jjrq", domain.getJjrq());
        map.put("pssj", domain.getPssj());
        map.put("qsthsj", domain.getQsthsj());
        map.put("code", "");
        map.put("mess", "");
        this.sqlMapClientTemplate.queryForObjectByCurr("pWebjkQttyEmsydgxHxcl", "", map);
        returnDomain = new QttyEmsYdgxReturnDomain();
        returnDomain.setCode((String)map.get("code"));
        returnDomain.setMess(HstToolsUtil.ISO2GBK((String)map.get("mess")));
        return returnDomain;
    }

    public void doSaveWlztMx(QttyEmscxReturnDomain domain) throws Exception {
        HashMap<String, String> map = new HashMap<String, String>();
        map.put("kddbh", domain.getKddbh());
        this.sqlMapClientTemplate.delete("deleteSssxSlsqYjxxWlztMx", map);
        int i = 1;
        for (EmsWlxx wlxxMx : domain.getData()) {
            QttyYjxxMxDomain wlxxDom = new QttyYjxxMxDomain();
            wlxxDom.setKddbh(domain.getKddbh());
            wlxxDom.setClsj(wlxxMx.getAcceptTime());
            wlxxDom.setXh(String.valueOf(i));
            wlxxDom.setNr(String.valueOf(wlxxMx.getAcceptTime()) + " " + wlxxMx.getAcceptAddress() + " " + wlxxMx.getRemark());
            this.sqlMapClientTemplate.insert("insertSssxSlsqYjxxWlztMx", wlxxDom);
            ++i;
        }
    }
}
