Example #1
0
    // 开始统计
    public override OpRes doStat(object param, GMUser user)
    {
        ParamQueryRecharge p   = (ParamQueryRecharge)param;
        QueryMgr           mgr = user.getSys <QueryMgr>(SysType.sysTypeQuery);

        m_cond.startQuery();
        OpRes res = mgr.makeQuery(param, QueryType.queryTypeRecharge, user, m_cond);

        if (res != OpRes.opres_success)
        {
            return(res);
        }

        IMongoQuery   imq = m_cond.getImq();
        QueryDocument qd  = (QueryDocument)imq;

        if (!qd.Contains("PayTime"))
        {
            return(OpRes.op_res_time_format_error);
        }

        m_result.Clear();
        QueryRecharge   rq         = mgr.getQuery <QueryRecharge>(QueryType.queryTypeRecharge);
        int             serverId   = DBMgr.getInstance().getSpecialServerId(DbName.DB_PAYMENT);
        MapReduceResult map_result = DBMgr.getInstance().executeMapReduce(rq.getPlatInfo().m_tableName,
                                                                          serverId,
                                                                          DbName.DB_PAYMENT,
                                                                          imq,
                                                                          MapReduceTable.getMap("sameOrderId"),
                                                                          MapReduceTable.getReduce("sameOrderId"));
        int count = 0;

        if (map_result != null)
        {
            IEnumerable <BsonDocument> bson = map_result.GetResults();
            foreach (BsonDocument d in bson)
            {
                BsonValue resValue = d["value"];
                count = resValue["total"].ToInt32();
                if (count > 1)
                {
                    ResultSameOrderIdItem tmp = new ResultSameOrderIdItem();
                    m_result.Add(tmp);
                    tmp.m_count   = count;
                    tmp.m_orderId = Convert.ToString(d["_id"]);
                }
            }
        }
        return(OpRes.opres_success);
    }
Example #2
0
    public override OpRes doExport(object param, GMUser user)
    {
        m_cond.startExport();
        QueryMgr mgr = user.getSys <QueryMgr>(SysType.sysTypeQuery);
        OpRes    res = mgr.makeQuery(param, QueryType.queryTypeMoney, user, m_cond);

        if (res != OpRes.opres_success)
        {
            return(res);
        }

        ExportParam ep = new ExportParam();

        ep.m_account    = user.m_user;
        ep.m_dbServerIP = user.m_dbIP;
        ep.m_tableName  = TableName.PUMP_PLAYER_MONEY;
        ep.m_condition  = m_cond.getCond();
        return(RemoteMgr.getInstance().reqExportExcel(ep));
    }
Example #3
0
    public override OpRes doExport(object param, GMUser user)
    {
        m_cond.startExport();
        QueryMgr mgr = user.getSys <QueryMgr>(SysType.sysTypeQuery);
        OpRes    res = mgr.makeQuery(param, QueryType.queryTypeRecharge, user, m_cond);

        if (res != OpRes.opres_success)
        {
            return(res);
        }

        ExportParam ep = new ExportParam();

        ep.m_account    = user.m_user;
        ep.m_dbServerIP = WebConfigurationManager.AppSettings["payment"];
        ep.m_tableName  = "recharge";
        ep.m_condition  = m_cond.getCond();
        // 当前用户操作的DB服务器
        ep.m_condition.Add("userOpDbIp", user.m_dbIP);
        return(RemoteMgr.getInstance().reqExportExcel(ep));
    }
Example #4
0
    // 开始统计
    public override OpRes doStat(object param, GMUser user)
    {
        ParamQueryRecharge p   = (ParamQueryRecharge)param;
        QueryMgr           mgr = user.getSys <QueryMgr>(SysType.sysTypeQuery);

        m_cond.startQuery();
        OpRes res = mgr.makeQuery(param, QueryType.queryTypeRecharge, user, m_cond);

        if (res != OpRes.opres_success)
        {
            return(res);
        }

        IMongoQuery imq = m_cond.getImq();

        m_result.reset();
        QueryRecharge   rq         = mgr.getQuery <QueryRecharge>(QueryType.queryTypeRecharge);
        int             serverId   = DBMgr.getInstance().getSpecialServerId(DbName.DB_PAYMENT);
        MapReduceResult map_result = DBMgr.getInstance().executeMapReduce(rq.getPlatInfo().m_tableName,
                                                                          serverId,
                                                                          DbName.DB_PAYMENT,
                                                                          imq,
                                                                          MapReduceTable.getMap("recharge"),
                                                                          MapReduceTable.getReduce("recharge"));

        if (map_result != null)
        {
            IEnumerable <BsonDocument> bson = map_result.GetResults();
            foreach (BsonDocument d in bson)
            {
                BsonValue resValue = d["value"];
                m_result.m_total += resValue["total"].ToInt32();
                m_result.m_rechargePersonNum++;
                m_result.m_rechargeCount += resValue["rechargeCount"].ToInt32();
            }
        }
        return(OpRes.opres_success);
    }