Search in sources :

Example 1 with MarketTradesSelf

use of hry.trade.websoketContext.model.MarketTradesSelf in project benchmark by seelunzi.

the class ExOrderServiceImpl method getNewList.

/*     */
/*     */
/*     */
public String getNewList(String header, Integer count) /*     */
{
    /* 160 */
    if (null == count) {
        /* 161 */
        count = Integer.valueOf(10);
    /*     */
    }
    /* 163 */
    ExOrderDao exOrderDao = (ExOrderDao) this.dao;
    /* 164 */
    String[] headarry = header.split(":");
    /* 165 */
    Map<String, Object> seramap = new HashMap();
    /* 166 */
    seramap.put("website", headarry[0]);
    /* 167 */
    seramap.put("currencyType", headarry[1]);
    /* 168 */
    seramap.put("coinCode", headarry[2].split("_")[0]);
    /* 169 */
    seramap.put("fixPriceCoinCode", headarry[2].split("_")[1]);
    /* 170 */
    seramap.put("count", count);
    /* 171 */
    List<ExOrder> list = exOrderDao.findNewList(seramap);
    /* 172 */
    for (ExOrder l : list) {
        /* 173 */
        l.setTransactionPrice(l.getTransactionPrice().setScale(4, 4));
        /* 174 */
        l.setTransactionCount(l.getTransactionCount().setScale(4, 4));
    /*     */
    }
    /* 176 */
    MarketTradesSelf marketTrades = new MarketTradesSelf();
    /* 177 */
    marketTrades.setTrades(list);
    /* 178 */
    SimplePropertyPreFilter s = new SimplePropertyPreFilter(ExOrder.class, new String[] { "coinCode", "transactionTime", "transactionPrice", "transactionCount" });
    /* 179 */
    return JSON.toJSONString(marketTrades, s, new SerializerFeature[0]).toString();
/*     */
}
Also used : SimplePropertyPreFilter(com.alibaba.fastjson.serializer.SimplePropertyPreFilter) SerializerFeature(com.alibaba.fastjson.serializer.SerializerFeature) ExOrder(hry.trade.entrust.model.ExOrder) JSONObject(com.alibaba.fastjson.JSONObject) ExOrderDao(hry.trade.entrust.dao.ExOrderDao) MarketTradesSelf(hry.trade.websoketContext.model.MarketTradesSelf)

Aggregations

JSONObject (com.alibaba.fastjson.JSONObject)1 SerializerFeature (com.alibaba.fastjson.serializer.SerializerFeature)1 SimplePropertyPreFilter (com.alibaba.fastjson.serializer.SimplePropertyPreFilter)1 ExOrderDao (hry.trade.entrust.dao.ExOrderDao)1 ExOrder (hry.trade.entrust.model.ExOrder)1 MarketTradesSelf (hry.trade.websoketContext.model.MarketTradesSelf)1