package com.engine.htsc.xgtyfk.service.impl;

import com.engine.core.impl.Service;
import com.engine.htsc.xgtyfk.service.GetHkHlService;
import weaver.conn.RecordSet;
import weaver.general.BaseBean;

import java.util.HashMap;
import java.util.Map;

public class GetHkHlServiceImpl extends Service implements GetHkHlService {
    @Override
    public Map<String, String> queryExchangeRate() {
        RecordSet rs = new RecordSet();
        Map<String, String> resp = new HashMap<>();
        try {
            rs.executeQuery("select BZ,HL from uf_HKdolexcrateall order by BZ");
            while (rs.next()) {
                resp.put(rs.getString("BZ"), rs.getString("HL"));
            }
            return resp;
        } catch (Exception e) {
            new BaseBean().writeLog("获取汇率数据异常,error:" + e.getMessage());
            resp.put("error",e.getMessage());
            return resp;
        }
    }
}
