OtcRealTimeAction.java 1.39 KB
package com.cjs.cms.action.report;

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

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.cjs.cms.biz.report.ReportBiz;
import com.cjs.cms.dao.report.OtcRealTimeDao;
import com.cjs.cms.util.lang.JsonUtil;
import com.cjs.cms.util.lang.PageUtils;

/**
 * 成交
 * 
 * @author tongyufu
 *
 */
@RestController
@RequestMapping("/report/trade")
public class OtcRealTimeAction {

    @Autowired
    private ReportBiz      reportBiz;
    @Autowired
    private OtcRealTimeDao otcRealTimeDao;

    /** 成交统计 */
    @RequestMapping("queryOtcTradeSum")
    public String queryOtcTradeSum(@RequestParam Map<String, Object> params) {
        reportBiz.formatDate(params);
        PageUtils.processOralcePage(params);
        List<Map<String, Object>> trades = otcRealTimeDao.queryOtcTradeSum(params);
        int total = otcRealTimeDao.queryOtcTradeSumTotal(params);
        Map<String, Object> footer = otcRealTimeDao.queryOtcTradeSumFoot(params);
        if (footer == null) {
            footer = new HashMap<String, Object>();
        }
        footer.put("OTC_CODE", "汇总");
        return JsonUtil.toPageJson(trades, total, footer);
    }

}