示例#1
0
        private async void UpdateTable1()
        {
            btnSearch.Enabled            = false;
            wbDataStatistic.DocumentText = "";
            var r = new Dictionary <string, object>();

            r["datepoint"] = dtpSearchDate.Value;
            r["limit-amt"] = nudAmt.Value;

            var p = await DataStatistic.VipStatistic(r);

            if (p.IsOk)
            {
                var    rows = JArray.Parse(p.AsString).ToList();
                string info;
                info = string.Format(@"<table border=1 cellspacing=0 align=center>
                        <tr><th width=80 {0}>ID</th>
                        <th width=100 {0}>帐户名</th>
                        <th width=100 {0}>真实姓名</th>
                        <th width=150 {0}>当前客户经理</th>
                        <th width=120 {0}>手机</th>
                        <th width=100 {0}>当月投资额</th>
                        <th width=100 {0}>投资余额</th>
                        <th width=150 {0}>当月买入债权额</th></tr>", "bgcolor=#A9A9A9");

                if (rows.Count == 0)
                {
                    info += "</table>";
                    wbDataStatistic.DocumentText = info;
                    btnSearch.Enabled            = true;
                    Commons.ShowInfoBox(this, "未查询到数据!");
                    return;
                }

                foreach (var row in rows)
                {
                    info += string.Format(@"<tr><td {0}>&nbsp;{1}</td>
                    <td {0}>&nbsp;{2}</td>
                    <td {0}>&nbsp;{3}</td>
                    <td {0}>&nbsp;{4}</td>
                    <td {0}>&nbsp;{5}</td>
                    <td align=right valign=middle>&nbsp;{6}</td>
                    <td align=right valign=middle>&nbsp;{7}</td>
                    <td align=right valign=middle>&nbsp;{8}</td></tr>"
                                          , "align=center valign=middle", row["auId"].ToStdString(), row["loginName"].ToStdString()
                                          , row["realName"].ToStdString(), row["uName"].ToStdString(), row["mobile"].ToStdString(), row["monthSumAmt"].ToMoney()
                                          , row["blanceAmt"].ToMoney(), row["monthSumCredit"].ToMoney());
                }

                info += "</table>";

                wbDataStatistic.DocumentText = info;
            }
            else
            {
                Commons.ShowResultErrorBox(this, p);
            }
            btnSearch.Enabled = true;
        }
示例#2
0
 /// <summary>
 /// 数据统计
 /// </summary>
 public static void Statistics(DataStatisticType type, object msg = null)
 {
     SetConsole(msg + "");
     DataStatistic?.Send(new DataStatisticItem()
     {
         StatisticType = type, Data = msg
     });
 }
示例#3
0
        /// <summary>
        /// 记录 崩溃
        /// 崩溃数据会被上传
        /// </summary>
        public static void Crash(Exception ex)
        {
            SetConsole(ex.StackTrace);

            DataStatistic?.Send(new DataStatisticItem()
            {
                StatisticType = DataStatisticType.Crash, Data = ex
            });
            LogSave?.Save(ex);
        }
示例#4
0
        /// <summary> 释放托管数据 </summary>
        protected virtual void ReleaseTrust()
        {
            if (LogSave != null)
            {
                LogSave.Stop();
                LogSave = null;
            }

            if (DataStatistic != null)
            {
                DataStatistic.Stop();
                DataStatistic = null;
            }
        }
        private void ExportDate(int year)
        {
            var label = new List <string>();
            var times = new List <DateTime>();

            if (year == DateTime.Now.Year)
            {
                for (int i = 1; i <= DateTime.Now.Month; ++i)
                {
                    label.Add(string.Format("{0}年{1}月", year, i));
                    times.Add(new DateTime(year, i, 1));
                }
            }
            else
            {
                for (int i = 1; i <= 12; ++i)
                {
                    label.Add(string.Format("{0}年{1}月", year, i));
                    times.Add(new DateTime(year, i, 1));
                }
            }

            var dlg = new ExportExcel2Dlg(label, m_model);

            dlg.StartPosition = FormStartPosition.CenterParent;
            dlg.GetCellStr   += GetCellStr;

            for (int i = 0; i < times.Count; ++i)
            {
                var r = new Dictionary <string, object>();
                r["datepoint"] = times[i];
                dlg.ALL_SERVERS.Add((all) => {
                    var dic = new Dictionary <string, object>();
                    var d1  = DataStatistic.MonthStatistic1(r).Result;
                    var d2  = DataStatistic.MonthStatistic2(r).Result;
                    var d3  = DataStatistic.MonthStatistic3(r).Result;
                    var d4  = DataStatistic.MonthStatistic4(r).Result;
                    var d5  = DataStatistic.MonthStatistic5(r).Result;
                    Commons.DictionaryAddResult(dic, d1);
                    Commons.DictionaryAddResult(dic, d2);
                    Commons.DictionaryAddResult(dic, d3);
                    Commons.DictionaryAddResult(dic, d4);
                    Commons.DictionaryAddResult(dic, d5);
                    all.Add(dic);
                });
            }
            dlg.ShowDialog();
        }
示例#6
0
        static LogX()
        {
            LogSetting = Locator.GetInstance <ILogSetting>();
            if (LogSetting != null)
            {
                LogSave = Locator.GetInstance <ILogSave>();
                if (LogSave != null)
                {
                    LogSave.Start(LogSetting);
                }
            }

            LogReport = Locator.GetInstance <ILogReport>();

            LogViewer = Locator.GetInstance <ILogViewer>();

            DataStatistic = Locator.GetInstance <IDataStatistic>();
            if (DataStatistic != null)
            {
                DataStatistic.Start();
            }
        }
示例#7
0
        private async void UpdateTable1()
        {
            btnSearch.Enabled            = false;
            wbInvestorsInfo.DocumentText = "";
            var r = new Dictionary <string, object>();

            r["datepoint"] = dtpSearchDate.Value.TruncToEnd();
            var p = await DataStatistic.DailyStatistic(r);

            if (p.IsOk)
            {
                var d = p.AsDictionary;

                string info;
                info = string.Format(@"<table border=1 cellspacing=0 align=center>
                    <tr>
                    <td {0} {1}><b>新增注册人数</b></td><td {0} {2}>&nbsp;{3}</td> <td {0} {1}><b>总注册人数</b></td><td {0} {2}>&nbsp;{4}</td>
                    </tr><tr>
                    <td {0} {1}><b>新增投资人数</b></td><td {0} {2}>&nbsp;{5}</td> <td {0} {1}><b>总投资人数</b></td><td {0} {2}>&nbsp;{6}</td>
                    </tr><tr>
                    <td {0} {1}><b>充值人数(仅投资人)</b></td><td {0} {2}>&nbsp;{7}</td> <td {0} {1}><b>总充值人数(仅投资人)</b></td><td {0} {2}>&nbsp;{8}</td>
                    </tr><tr>
                    <td {0} {1}><b>充值人数(其他)</b></td><td {0} {2}>&nbsp;{9}</td> <td {0} {1}><b>总充值人数(其他)</b></td><td {0} {2}>&nbsp;{10}</td>
                    </tr><tr>
                    <td {0} {1}><b>提现人数(仅投资人)</b></td><td {0} {2}>&nbsp;{11}</td> <td {0} {1}><b>总提现人数(仅投资人)</b></td><td {0} {2}>&nbsp;{12}</td>
                    </tr><tr>
                    <td {0} {1}><b>提现人数(其他)</b></td><td {0} {2}>&nbsp;{13}</td> <td {0} {1}><b>总提现人数(其他)</b></td><td {0} {2}>&nbsp;{14}</td>
                    </tr><tr>
                    <td {0} {1}><b>投资人数</b></td><td {0} {2}>&nbsp;{15}</td> <td {0} {1}><b>&nbsp;</b></td><td {0} {2}>&nbsp;</td>
                    </tr><tr>
                    <td {0} {1}><b>投资人充值金额(元)</b></td><td {0} {2}>&nbsp;{16}</td> <td {0} {1}><b>投资人总充值金额(元)</b></td><td {0} {2}>&nbsp;{17}</td>
                    </tr><tr>
                    <td {0} {1}><b>其他充值金额(元)</b></td><td {0} {2}>&nbsp;{18}</td> <td {0} {1}><b>其他总充值金额(元)</b></td><td {0} {2}>&nbsp;{19}</td>
                    </tr><tr>
                    <td {0} {1}><b>投资人提现金额(元)</b></td><td {0} {2}>&nbsp;{20}</td> <td {0} {1}><b>投资人总提现金额(元)</b></td><td {0} {2}>&nbsp;{21}</td>
                    </tr><tr>
                    <td {0} {1}><b>其他提现金额(元)</b></td><td {0} {2}>&nbsp;{22}</td> <td {0} {1}><b>其他总提现金额(元)</b></td><td {0} {2}>&nbsp;{23}</td>
                    </tr><tr>
                    <td {0} {1}><b>投资金额(元)</b></td><td {0} {2}>&nbsp;{24}</td> <td {0} {1}><b>总投资金额(元)</b></td><td {0} {2}>&nbsp;{25}</td>
                    </tr><tr>
                    <td {0} {1}><b>债权转让成交金额(元)</b></td><td {0} {2}>&nbsp;{26}</td> <td {0} {1}><b>总债权转让成交金额(元)</b></td><td {0} {2}>&nbsp;{27}</td>
                    </tr><tr>
                    <td {0} {1}><b>借款余额(元)</b></td><td {0} {2}>&nbsp;{28}</td> <td {0} {1}><b>&nbsp;</b></td><td {0} {2}>&nbsp;</td>
                    </tr><tr>
                    <td {0} {1}><b>还款服务费(元)</b></td><td {0} {2}>&nbsp;{29}</td> <td {0} {1}><b>债权转让服务费(元)</b></td><td {0} {2}>&nbsp;{30}</td>
                    </tr>
                    </table>", "align=center valign=middle", "width=200", "width=110"
                                     , d.GetOrDefault <string>("newRegCount"), d.GetOrDefault <string>("totalRegCount")
                                     , d.GetOrDefault <string>("newInvestCount"), d.GetOrDefault <string>("totalInvestCount")
                                     , d.GetOrDefault <string>("rechargeCountInvestor"), d.GetOrDefault <string>("totalRechargeCountInvestor")
                                     , d.GetOrDefault <string>("rechargeCountOther"), d.GetOrDefault <string>("totalRechargeCountOther")
                                     , d.GetOrDefault <string>("withdrawCountInvestor"), d.GetOrDefault <string>("totalWithdrawCountInvestor")
                                     , d.GetOrDefault <string>("withdrawCountOther"), d.GetOrDefault <string>("totalWithdrawCountOther")
                                     , d.GetOrDefault <string>("investCount")
                                     , d.GetOrDefault <string>("rechargeAmtInvestor"), d.GetOrDefault <string>("totalRechargeAmtInvestor")
                                     , d.GetOrDefault <string>("rechargeAmtOther"), d.GetOrDefault <string>("totalRechargeAmtOther")
                                     , d.GetOrDefault <string>("withdrawAmtInvestor"), d.GetOrDefault <string>("totalWithdrawAmtInvestor")
                                     , d.GetOrDefault <string>("withdrawAmtOther"), d.GetOrDefault <string>("totalWithdrawAmtOther")
                                     , d.GetOrDefault <string>("investAmt"), d.GetOrDefault <string>("totalInvestAmt")
                                     , d.GetOrDefault <string>("creditAmt"), d.GetOrDefault <string>("totalCreditAmt")
                                     , d.GetOrDefault <string>("loanBalanceAmt")
                                     , d.GetOrDefault <string>("repayFeeAmt"), d.GetOrDefault <string>("creditFeeAmt"));

                info += string.Format(@"<p> </p>
                    <dl><dt>投资注册人数:</dt>
                    <dd>第一次投资时间在{0}的人数</dd></dl>
                    <dl><dt>新增注册人数:</dt>
                    <dd>注册时间在{0}的人数</dd></dl>
                    <dl><dt>提现人数:</dt>
                    <dd>在{0}曾经成功提现的人数(分为投资人和其他两类)</dd></dl>
                    <dl><dt>充值人数:</dt>
                    <dd>在{0}曾经成功充值的人数(分为投资人和其他两类)</dd></dl>
                    <dl><dt>投资人数:</dt>
                    <dd>在{0}曾经成功投资的人数</dd></dl>
                    <dl><dt>提现金额:</dt>
                    <dd>在{0}曾经成功提现的总金额(分为投资人和其他两类)</dd></dl>
                    <dl><dt>充值金额:</dt>
                    <dd>在{0}曾经成功充值的总金额(分为投资人和其他两类)</dd></dl>
                    <dl><dt>投资金额:</dt>
                    <dd>在{0}曾经成功投资的总金额</dd></dl>
                    <dl><dt>债权转让成交金额:</dt>
                    <dd>在{0}曾经成功转让的标价总额</dd></dl>
                    <dl><dt>借款余额:</dt>
                    <dd>新系统截止到统计日期结束的总放款-总还本</dd></dl>"
                                      , "指定日的00:00:00到指定日的23:59:59之间");

                wbInvestorsInfo.DocumentText = info;
            }
            else
            {
                Commons.ShowResultErrorBox(this, p);
            }
            btnSearch.Enabled = true;
        }
示例#8
0
        private void UpdateTable1(bool initial)
        {
            var allData = new Dictionary <string, object>();

            if (!initial)
            {
                btnSearch.Enabled            = false;
                wbInvestorsInfo.DocumentText = "";
                var r = new Dictionary <string, object>();
                r["datepoint"] = dtpSearchDate.Value.AddDays(1).TruncToStart();
                var dlg = new BatchProcessMultipleServers();
                dlg.StartPosition = FormStartPosition.CenterParent;
                dlg.ALL_SEVERS.Add(async() => { return(await DataStatistic.DailyStatistic1(r)); });
                dlg.ALL_SEVERS.Add(async() => { return(await DataStatistic.DailyStatistic2(r)); });
                dlg.ALL_SEVERS.Add(async() => { return(await DataStatistic.DailyStatistic3(r)); });
                dlg.ALL_SEVERS.Add(async() => { return(await DataStatistic.DailyStatistic4(r)); });
                dlg.ALL_SEVERS.Add(async() => { return(await DataStatistic.DailyStatistic5(r)); });
                dlg.ShowDialog();

                foreach (var d in dlg.AllResult)
                {
                    if (d.IsOk)
                    {
                        Commons.DictionaryAddResult(allData, d);
                    }
                }
            }

            string info = "<p>人数单位:个,金额单位:元</p>";

            info += "<table border=1 cellspacing=0 align=center>";
            for (int row = 0; row < m_allData.Count; ++row)
            {
                info += string.Format("<tr><td {0} {1}><b>&nbsp;{3}</b></td><td {0} {2}>&nbsp;{4}</td> <td {0} {1}><b>&nbsp;{5}</b></td><td {0} {2}>&nbsp;{6}</td></tr>",
                                      "align=center valign=middle", "width=210", "width=110",
                                      m_allData[row].Item1, allData.GetOrDefault <string>(m_allData[row].Item2),
                                      m_allData[row].Item3, allData.GetOrDefault <string>(m_allData[row].Item4));
            }
            info += "</table>";

            info += string.Format(@"<p> </p>
                    <dl><dt>投资注册人数:</dt>
                    <dd>第一次投资时间在{0}的人数</dd></dl>
                    <dl><dt>新增注册人数:</dt>
                    <dd>注册时间在{0}的人数</dd></dl>
                    <dl><dt>提现人数:</dt>
                    <dd>在{0}曾经成功提现的人数(分为投资人和其他两类)</dd></dl>
                    <dl><dt>充值人数:</dt>
                    <dd>在{0}曾经成功充值的人数(分为投资人和其他两类)</dd></dl>
                    <dl><dt>投资人数:</dt>
                    <dd>在{0}曾经成功投资的人数</dd></dl>
                    <dl><dt>提现金额:</dt>
                    <dd>在{0}曾经成功提现的总金额(分为投资人和其他两类)</dd></dl>
                    <dl><dt>充值金额:</dt>
                    <dd>在{0}曾经成功充值的总金额(分为投资人和其他两类)</dd></dl>
                    <dl><dt>投资金额:</dt>
                    <dd>在{0}曾经成功投资的总金额</dd></dl>
                    <dl><dt>债权转让成交金额:</dt>
                    <dd>在{0}曾经成功转让的标价总额</dd></dl>
                    <dl><dt>借款余额:</dt>
                    <dd>新系统截止到统计日期结束的总放款-总还本</dd></dl>"
                                  , "指定日的00:00:00到指定日的23:59:59之间");

            wbInvestorsInfo.DocumentText = info;

            btnSearch.Enabled = true;
        }
示例#9
0
        public void proveraRacunaDevijacijeFail(string s, int i, int j, int k)
        {
            DataStatistic data = new DataStatistic(s, i, j, k);

            Assert.AreNotEqual(1, data.dev);
        }
示例#10
0
 public static void Statistics(DataStatisticItem item)
 {
     SetConsole(item?.ToString() + "");
     DataStatistic?.Send(item);
 }
示例#11
0
        private void UpdateTable(bool initial)
        {
            var allData = new Dictionary <string, object>();

            if (!initial)
            {
                btnSearch.Enabled            = false;
                wbDataStatistic.DocumentText = "";

                var r   = new Dictionary <string, object>();
                var now = dtpSearchDate.Value;
                r["datepoint1"] = new DateTime(now.Year, now.Month, 1).AddDays(-1).TruncToEnd();
                r["datepoint2"] = new DateTime(now.Year, now.Month, 1).AddMonths(1).TruncToStart();
                var dlg = new BatchProcessMultipleServers();
                dlg.StartPosition = FormStartPosition.CenterParent;
                dlg.ALL_SEVERS.Add(async() => { return(await DataStatistic.MonthStatistic1(r)); });
                dlg.ALL_SEVERS.Add(async() => { return(await DataStatistic.MonthStatistic2(r)); });
                dlg.ALL_SEVERS.Add(async() => { return(await DataStatistic.MonthStatistic3(r)); });
                dlg.ALL_SEVERS.Add(async() => { return(await DataStatistic.MonthStatistic4(r)); });
                dlg.ALL_SEVERS.Add(async() => { return(await DataStatistic.MonthStatistic5(r)); });
                dlg.ShowDialog();

                foreach (var d in dlg.AllResult)
                {
                    if (d.IsOk)
                    {
                        Commons.DictionaryAddResult(allData, d);
                    }
                }
            }

            string info = "<p>人数单位:个,金额单位:元</p>";

            info += "<table border=1 cellspacing=0 align=center>";
            for (int row = 0; row < m_model.Count; ++row)
            {
                info += string.Format("<tr><td {0} {1}><b>&nbsp;{3}</b></td><td {0} {2}>&nbsp;{4}</td> <td {0} {1}><b>&nbsp;{5}</b></td><td {0} {2}>&nbsp;{6}</td></tr>",
                                      "align=center valign=middle", "width=220", "width=110",
                                      GetCellStr(m_model[row][0], allData), GetCellStr(m_model[row][1], allData),
                                      GetCellStr(m_model[row][2], allData), GetCellStr(m_model[row][3], allData));
            }
            info += "</table>";

            info += string.Format(@"<p> </p>
                                   <dl><dt>投资注册人数:</dt>
                                   <dd>第一次投资时间在{0}的人数</dd></dl>
                                   <dl><dt>新增注册人数:</dt>
                                   <dd>注册时间在{0}的人数</dd></dl>
                                   <dl><dt>提现人数:</dt>
                                   <dd>在{0}曾经成功提现的人数(分为投资人和其他两类)</dd></dl>
                                   <dl><dt>充值人数:</dt>
                                   <dd>在{0}曾经成功充值的人数(分为投资人和其他两类)</dd></dl>
                                   <dl><dt>投资人数:</dt>
                                   <dd>在{0}曾经成功投资的人数</dd></dl>
                                   <dl><dt>提现金额:</dt>
                                   <dd>在{0}曾经成功提现的总金额(分为投资人和其他两类)</dd></dl>
                                   <dl><dt>充值金额:</dt>
                                   <dd>在{0}曾经成功充值的总金额(分为投资人和其他两类)</dd></dl>
                                   <dl><dt>投资金额:</dt>
                                   <dd>在{0}曾经成功投资的总金额</dd></dl>
                                   <dl><dt>债权转让成交金额:</dt>
                                   <dd>在{0}曾经成功转让的标价总额</dd></dl>
                                   <dl><dt>借款余额:</dt>
                                   <dd>新系统截止到统计月结束的总放款-总还本</dd></dl>", "指定月");

            wbDataStatistic.DocumentText = info;


            btnSearch.Enabled = true;
        }