public void FromWrapper(SPPaymentInfoWrapper wrapper)
 {
     this.Id              = wrapper.Id;
     this.MobileNumber    = wrapper.MobileNumber;
     this.ChannelID       = (wrapper.ChannelID != null) ? wrapper.ChannelID.Id : 0;
     this.ClientID        = (wrapper.ClientID != null) ? wrapper.ClientID.Id : 0;
     this.Message         = wrapper.Message;
     this.IsIntercept     = wrapper.IsIntercept;
     this.CreateDate      = wrapper.CreateDate;
     this.Cpid            = wrapper.Cpid;
     this.Mid             = wrapper.Mid;
     this.Port            = wrapper.Port;
     this.Ywid            = wrapper.Ywid;
     this.Linkid          = wrapper.Linkid;
     this.Dest            = wrapper.Dest;
     this.Price           = wrapper.Price;
     this.Ip              = wrapper.Ip;
     this.SucesssToSend   = wrapper.SucesssToSend;
     this.ExtendField1    = wrapper.ExtendField1;
     this.ExtendField2    = wrapper.ExtendField2;
     this.ExtendField3    = wrapper.ExtendField3;
     this.ExtendField4    = wrapper.ExtendField4;
     this.ExtendField5    = wrapper.ExtendField5;
     this.ExtendField6    = wrapper.ExtendField6;
     this.ExtendField7    = wrapper.ExtendField7;
     this.ExtendField8    = wrapper.ExtendField8;
     this.RequestContent  = wrapper.RequestContent;
     this.City            = wrapper.City;
     this.Province        = wrapper.Province;
     this.IsTestData      = wrapper.IsTestData;
     this.ChannleClientID = wrapper.ChannleClientID;
     this.IsSycnData      = wrapper.IsSycnData;
     this.SSycnDataUrl    = wrapper.SSycnDataUrl;
     this.SycnRetryTimes  = wrapper.SycnRetryTimes;
 }
Exemplo n.º 2
0
        public bool CheckPaymentNeedSend(int id)
        {
            SPPaymentInfoWrapper spPaymentInfoWrapper = SPPaymentInfoWrapper.FindById(id);

            if (spPaymentInfoWrapper == null)
            {
                return(false);
            }

            if (spPaymentInfoWrapper.IsIntercept.HasValue && spPaymentInfoWrapper.IsIntercept.Value)
            {
                return(false);
            }

            if (spPaymentInfoWrapper.SucesssToSend.HasValue && spPaymentInfoWrapper.SucesssToSend.Value)
            {
                return(false);
            }

            if (spPaymentInfoWrapper.SycnRetryTimes.HasValue && spPaymentInfoWrapper.SycnRetryTimes.Value > 1)
            {
                return(false);
            }

            return(true);
        }
Exemplo n.º 3
0
        public List <SPSSendUrlEntity> GetSSendUrlByClientChannelIDAndDate(DateTime startDate, DateTime endDate, int ClientChannelID, int maxRetryCount)
        {
            this.Server.ScriptTimeout = 360;

            List <SPPaymentInfoWrapper> spReSendPaymentInfos = SPPaymentInfoWrapper.FindAllNotSendData(ClientChannelID, startDate.Date, endDate.Date, maxRetryCount);

            return(ChangePaymentToUrl(spReSendPaymentInfos));
        }
        protected void store1_Refresh(object sender, StoreRefreshDataEventArgs e)
        {
            int    recordCount   = 0;
            string sortFieldName = "";

            if (e.Sort != null)
            {
                sortFieldName = e.Sort;
            }

            int startIndex = 0;

            if (e.Start > -1)
            {
                startIndex = e.Start;
            }

            int limit = this.PagingToolBar1.PageSize;

            int pageIndex = 1;

            if ((startIndex % limit) == 0)
            {
                pageIndex = startIndex / limit + 1;
            }
            else
            {
                pageIndex = startIndex / limit;
            }

            int channelID = 0;

            if (!string.IsNullOrEmpty(e.Parameters["ChannelID"]))
            {
                channelID = Convert.ToInt32(e.Parameters["ChannelID"]);
            }
            int clientChannelID = 0;

            if (!string.IsNullOrEmpty(e.Parameters["ChannelClientID"]))
            {
                clientChannelID = Convert.ToInt32(e.Parameters["ChannelClientID"]);
            }
            List <string> phones = new List <string>();

            if (!string.IsNullOrEmpty(e.Parameters["txtPhone"]))
            {
                phones = StringUtil.SplitMLineTextToArray(e.Parameters["txtPhone"].Trim(), "|");
            }

            store1.DataSource = SPPaymentInfoWrapper.FindAllByChannelIDAndClientChannelIDAndPhoneListByOrderBy(channelID, clientChannelID, phones, sortFieldName,
                                                                                                               (e.Dir == Coolite.Ext.Web.SortDirection.DESC),
                                                                                                               pageIndex, limit, out recordCount);
            e.TotalCount = recordCount;

            store1.DataBind();
        }
Exemplo n.º 5
0
        private SPSSendUrlEntity PaymentToSendUrlEntity(SPPaymentInfoWrapper reSendPaymentInfo)
        {
            SPSSendUrlEntity sendUrlEntity = new SPSSendUrlEntity();

            sendUrlEntity.PaymentID      = reSendPaymentInfo.Id;
            sendUrlEntity.ClientID       = reSendPaymentInfo.ClientID.Id;
            sendUrlEntity.ChannelID      = reSendPaymentInfo.ChannelID.Id;
            sendUrlEntity.SycnRetryTimes = (reSendPaymentInfo.SycnRetryTimes.HasValue
                                                ? reSendPaymentInfo.SycnRetryTimes.Value
                                                : 0);
            sendUrlEntity.SendUrl = reSendPaymentInfo.ReBuildUrl();
            return(sendUrlEntity);
        }
        public void RefreshPage()
        {
            try
            {
                int clientChannleID = Convert.ToInt32(this.hidClientChannelID.Text);
                SPClientChannelSettingWrapper obj = SPClientChannelSettingWrapper.FindById(clientChannleID);


                this.hidClientID.Text    = obj.ClinetID.Id.ToString();
                this.hidChannelID.Text   = obj.ChannelID.Id.ToString();
                this.lblChannleName.Text = obj.ChannelName;
                this.lblClientName.Text  = obj.ClientName;

                int downCount = SPPaymentInfoWrapper.FindAllPaymentCountByDateAndType(DateTime.Now.Date,
                                                                                      DateTime.Now.Date,
                                                                                      clientChannleID,
                                                                                      DataType.Down.ToString());

                int interceptCount = SPPaymentInfoWrapper.FindAllPaymentCountByDateAndType(DateTime.Now.Date,
                                                                                           DateTime.Now.Date,
                                                                                           clientChannleID,
                                                                                           DataType.Intercept.ToString());

                this.lblDownCount.Text          = downCount.ToString();
                this.lblSycnCount.Text          = interceptCount.ToString();
                this.btnResetIntercept.Disabled = !(obj.SyncData.HasValue && obj.SyncData.Value);

                int maxChangeCount = Convert.ToInt32(hidMaxChangeCount.Text);

                numMaxCount.MaxValue = Math.Min(interceptCount, maxChangeCount);
                numMaxCount.Text     = Math.Min(interceptCount, Convert.ToInt32(numMaxCount.MaxValue)).ToString();

                SPClientChannelSettingWrapper clientChannelSetting =
                    SPClientChannelSettingWrapper.FindById(clientChannleID);

                if (!(clientChannelSetting.SyncData.HasValue && clientChannelSetting.SyncData.Value))
                {
                    btnResetIntercept.Disabled = true;
                }
                else
                {
                    btnResetIntercept.Disabled = false;
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Exemplo n.º 7
0
        protected void storeData_Refresh(object sender, StoreRefreshDataEventArgs e)
        {
            int    recordCount   = 0;
            string sortFieldName = "";

            if (e.Sort != null)
            {
                sortFieldName = e.Sort;
            }

            int startIndex = 0;

            if (e.Start > -1)
            {
                startIndex = e.Start;
            }

            int limit = this.PagingToolBar1.PageSize;

            int pageIndex = 1;

            if ((startIndex % limit) == 0)
            {
                pageIndex = startIndex / limit + 1;
            }
            else
            {
                pageIndex = startIndex / limit;
            }

            DataTable dt = SPPaymentInfoWrapper.FindAllDataTableByOrderByAndCleintIDAndChanneLIDAndDate(ChannleID, this.SPClientID, Convert.ToDateTime(this.StartDate), Convert.ToDateTime(this.EndDate), DType, "CreateDate", true, pageIndex, limit, out recordCount);

            SPClientWrapper spClientWrapper = SPClientWrapper.FindById(this.SPClientID);

            SPClientChannelSettingWrapper clientChannelSettingWrapper = spClientWrapper.DefaultClientChannelSetting;

            bool isSycnData = (clientChannelSettingWrapper != null && clientChannelSettingWrapper.SyncData.HasValue &&
                               clientChannelSettingWrapper.SyncData.Value);

            if (storeData.Reader.Count == 0)
            {
                storeData.Reader.Add(GetJsonReaderByDataTable(SPChannelWrapper.FindById(this.ChannleID), isSycnData));
            }

            storeData.DataSource = dt;
            e.TotalCount         = recordCount;

            storeData.DataBind();
        }
Exemplo n.º 8
0
        protected override void ExecuteInternal(JobExecutionContext context)
        {
            logger.Info("日报表任务开始。。。");

            try
            {
                SPPaymentInfoWrapper.RendAllData(DateTime.Now.AddDays(-1));

                logger.Info("日报表任务成功。。。");
            }
            catch (Exception ex)
            {
                logger.Error("日报表任务失败:" + ex.Message);
            }
        }
 private bool CheckPaymentIsDataType(SPPaymentInfoWrapper payment, string dataType)
 {
     if (dataType == DataType.Down.ToString())
     {
         if (payment.IsIntercept.HasValue && !payment.IsIntercept.Value)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     else if (dataType == DataType.DownNotSycn.ToString())
     {
         if (payment.IsIntercept.HasValue && !payment.IsIntercept.Value && payment.IsSycnData.HasValue && !payment.IsSycnData.Value)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     else if (dataType == DataType.DownSycn.ToString())
     {
         if (payment.IsIntercept.HasValue && !payment.IsIntercept.Value && payment.SucesssToSend.HasValue && payment.SucesssToSend.Value)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     else if (dataType == DataType.SycnFailed.ToString())
     {
         if (payment.IsIntercept.HasValue && !payment.IsIntercept.Value && payment.SucesssToSend.HasValue && !payment.SucesssToSend.Value && payment.IsSycnData.HasValue && payment.IsSycnData.Value)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     return(false);
 }
        public void ChangeInterceptCount(string dateTime, int clientID, string newIntercept)
        {
            try
            {
                SPClientWrapper clientWrapper = SPClientWrapper.FindById(clientID);

                int newInterceptCount = Convert.ToInt32(newIntercept);

                DateTime date = Convert.ToDateTime(dateTime);

                DayliyReport dayReport = clientWrapper.GetDayReport(date);

                if (newInterceptCount < 0)
                {
                    ScriptManager.AjaxSuccess      = false;
                    ScriptManager.AjaxErrorMessage = "扣量不得小于0";
                    return;
                }

                if (newInterceptCount > dayReport.TotalCount)
                {
                    ScriptManager.AjaxSuccess      = false;
                    ScriptManager.AjaxErrorMessage = "扣量不得大于当日总量:" + dayReport.TotalCount.ToString();
                    return;
                }


                //ScriptManager.AjaxSuccess = false;
                //ScriptManager.AjaxErrorMessage = string.Format("日期{0} 总量:{1} 点播 {2} 扣量 {3} 同步 {4}", dateTime, dayReport.TotalCount, dayReport.DownCount, dayReport.InterceptCount, dayReport.SycnCount);
                //return;



                SPPaymentInfoWrapper.UpdateRecordAndReport(dayReport, clientWrapper, newInterceptCount);

                ScriptManager.AjaxSuccess = true;
            }
            catch (Exception ex)
            {
                ScriptManager.AjaxSuccess      = false;
                ScriptManager.AjaxErrorMessage = string.Format(ex.Message);
                return;
            }
        }
        public void RefreshPage()
        {
            int clientChannleID = Convert.ToInt32(this.Request.QueryString["ClientChannelID"]);

            SPClientChannelSettingWrapper obj = SPClientChannelSettingWrapper.FindById(clientChannleID);


            this.lblChannleName.Text = obj.ChannelName;
            this.lblClientName.Text  = obj.ClientName;


            int downCount = SPPaymentInfoWrapper.FindAllPaymentCountByDateAndType(System.DateTime.Now.Date,
                                                                                  System.DateTime.Now.Date,
                                                                                  clientChannleID,
                                                                                  DataType.Down.ToString());

            int downSycnCount = SPPaymentInfoWrapper.FindAllPaymentCountByDateAndType(System.DateTime.Now.Date,
                                                                                      System.DateTime.Now.Date,
                                                                                      clientChannleID,
                                                                                      DataType.DownSycn.ToString());


            int downNotSycn = SPPaymentInfoWrapper.FindAllPaymentCountByDateAndType(System.DateTime.Now.Date,
                                                                                    System.DateTime.Now.Date,
                                                                                    clientChannleID,
                                                                                    DataType.DownNotSycn.ToString());

            int sycnFailed = SPPaymentInfoWrapper.FindAllPaymentCountByDateAndType(System.DateTime.Now.Date,
                                                                                   System.DateTime.Now.Date,
                                                                                   clientChannleID,
                                                                                   DataType.SycnFailed.ToString());



            this.lblDownCount.Text        = downCount.ToString();
            this.lblSycnCount.Text        = downSycnCount.ToString();
            this.lblDownNotSycnCount.Text = downNotSycn.ToString();
            this.lblSycnFailedCount.Text  = sycnFailed.ToString();

            this.btnReSendDown.Disabled        = (downCount <= 0);
            this.btnReSendSycn.Disabled        = (downSycnCount <= 0);
            this.btnReSendDownNotSycn.Disabled = (downNotSycn <= 0);
            this.btnReSendSycnFailed.Disabled  = (sycnFailed <= 0);
        }
Exemplo n.º 12
0
        public List <SPSSendUrlEntity> GetAllClientChannelNeedSendData(int maxDataCount, int maxAllDataCount)
        {
            this.Server.ScriptTimeout = 360;

            List <SPSSendUrlEntity> sendUrlEntities = new List <SPSSendUrlEntity>();

            List <SPClientChannelSettingWrapper> allNeedResendChannleClientSetting = SPClientChannelSettingWrapper.GetAllNeedRendSetting();

            int dataCount = 0;

            foreach (SPClientChannelSettingWrapper channelSetting in allNeedResendChannleClientSetting)
            {
                List <SPPaymentInfoWrapper> spReSendPaymentInfos = SPPaymentInfoWrapper.FindAllNotSendData(channelSetting.ChannelID.Id,
                                                                                                           channelSetting.ClinetID.Id, System.DateTime.Now.Date,
                                                                                                           System.DateTime.Now.Date, maxDataCount);

                foreach (SPPaymentInfoWrapper reSendPaymentInfo in spReSendPaymentInfos)
                {
                    if (!reSendPaymentInfo.IsIntercept.HasValue)
                    {
                        continue;
                    }

                    if (reSendPaymentInfo.IsIntercept.Value)
                    {
                        continue;
                    }

                    SPSSendUrlEntity sendUrlEntity = PaymentToSendUrlEntity(reSendPaymentInfo);

                    sendUrlEntities.Add(sendUrlEntity);

                    dataCount++;

                    if (dataCount >= maxAllDataCount)
                    {
                        return(sendUrlEntities);
                    }
                }
            }

            return(sendUrlEntities);
        }
Exemplo n.º 13
0
        protected void store1_Refresh(object sender, StoreRefreshDataEventArgs e)
        {
            DateTime startDate = Convert.ToDateTime(this.dfReportStartDate.DateField.Value);

            SPClientGroupWrapper spClientGroupWrapper = SPClientGroupWrapper.FindById(this.ClientGroupID);

            if (startDate < spClientGroupWrapper.GetDT())
            {
                startDate = spClientGroupWrapper.GetDT();
            }

            DateTime endDate = Convert.ToDateTime(this.dfReportEndDate.DateField.Value);


            store1.DataSource = SPPaymentInfoWrapper.GetClientMobileCount(SPClientID, startDate, endDate);


            store1.DataBind();
        }
        protected void storeData_Refresh(object sender, StoreRefreshDataEventArgs e)
        {
            int    recordCount   = 0;
            string sortFieldName = "";

            if (e.Sort != null)
            {
                sortFieldName = e.Sort;
            }

            int startIndex = 0;

            if (e.Start > -1)
            {
                startIndex = e.Start;
            }

            int limit = this.PagingToolBar1.PageSize;

            int pageIndex = 1;

            if ((startIndex % limit) == 0)
            {
                pageIndex = startIndex / limit + 1;
            }
            else
            {
                pageIndex = startIndex / limit;
            }

            DataTable dt = SPPaymentInfoWrapper.FindAllDataTableByOrderByAndCleintIDAndChanneLIDAndDateNoIntercept(ChannleID, this.SPClientID, Convert.ToDateTime(this.StartDate), Convert.ToDateTime(this.EndDate), "", false, pageIndex, limit, out recordCount);

            if (storeData.Reader.Count == 0)
            {
                storeData.Reader.Add(GetJsonReaderByDataTable(SPChannelWrapper.FindById(this.ChannleID)));
            }

            storeData.DataSource = dt;
            e.TotalCount         = recordCount;

            storeData.DataBind();
        }
Exemplo n.º 15
0
        public SPPaymentInfoWrapper ToWrapper()
        {
            SPPaymentInfoWrapper wrapper = new SPPaymentInfoWrapper();

            wrapper.Id              = this.Id;
            wrapper.MobileNumber    = this.MobileNumber;
            wrapper.ChannelID       = (this.ChannelID == null) ? null : SPChannelWrapper.FindById(this.ChannelID);
            wrapper.ClientID        = (this.ClientID == null) ? null : SPClientWrapper.FindById(this.ClientID);
            wrapper.Message         = this.Message;
            wrapper.IsIntercept     = this.IsIntercept;
            wrapper.CreateDate      = this.CreateDate;
            wrapper.Cpid            = this.Cpid;
            wrapper.Mid             = this.Mid;
            wrapper.Port            = this.Port;
            wrapper.Ywid            = this.Ywid;
            wrapper.Linkid          = this.Linkid;
            wrapper.Dest            = this.Dest;
            wrapper.Price           = this.Price;
            wrapper.Ip              = this.Ip;
            wrapper.SucesssToSend   = this.SucesssToSend;
            wrapper.ExtendField1    = this.ExtendField1;
            wrapper.ExtendField2    = this.ExtendField2;
            wrapper.ExtendField3    = this.ExtendField3;
            wrapper.ExtendField4    = this.ExtendField4;
            wrapper.ExtendField5    = this.ExtendField5;
            wrapper.ExtendField6    = this.ExtendField6;
            wrapper.ExtendField7    = this.ExtendField7;
            wrapper.ExtendField8    = this.ExtendField8;
            wrapper.IsReport        = this.IsReport;
            wrapper.RequestContent  = this.RequestContent;
            wrapper.City            = this.City;
            wrapper.Province        = this.Province;
            wrapper.IsTestData      = this.IsTestData;
            wrapper.ChannleClientID = this.ChannleClientID;
            wrapper.IsSycnData      = this.IsSycnData;
            wrapper.SSycnDataUrl    = this.SSycnDataUrl;
            wrapper.SycnRetryTimes  = this.SycnRetryTimes;

            return(wrapper);
        }
Exemplo n.º 16
0
        public void UpdatePaymentSend(int id, bool isSendOk, string sendUrl, int sycnRetryTimes)
        {
            SPPaymentInfoWrapper spPaymentInfoWrapper = SPPaymentInfoWrapper.FindById(id);

            if (spPaymentInfoWrapper.IsIntercept.HasValue && spPaymentInfoWrapper.IsIntercept.Value)
            {
                return;
            }

            if (isSendOk)
            {
                spPaymentInfoWrapper.SucesssToSend = isSendOk;
            }

            spPaymentInfoWrapper.IsSycnData = true;

            spPaymentInfoWrapper.SSycnDataUrl = sendUrl;

            spPaymentInfoWrapper.SycnRetryTimes = sycnRetryTimes;

            SPPaymentInfoWrapper.Update(spPaymentInfoWrapper);
        }
Exemplo n.º 17
0
        protected void ToExcel(object sender, EventArgs e)
        {
            DataTable dt =
                SPPaymentInfoWrapper.FindAllDataTableByOrderByAndCleintIDAndChanneLIDAndDate(ChannleID,
                                                                                             this.SPClientID, Convert.ToDateTime(this.StartDate),
                                                                                             Convert.ToDateTime(this.EndDate), DType, "CreateDate", true);

            this.Response.Clear();
            this.Response.ContentType = "application/vnd.ms-excel";
            this.Response.AddHeader("Content-Disposition", "attachment; filename=submittedData.xls");

            StringBuilder sb = new StringBuilder();

            sb.AppendLine("<table>");
            sb.AppendLine("<tr>");
            for (int i = 0; i < dt.Columns.Count; i++)
            {
                sb.AppendLine("<td>" + dt.Columns[i].ColumnName + "</td>");
            }
            sb.AppendLine("</tr>");
            for (int j = 0; j < dt.Rows.Count; j++)
            {
                sb.AppendLine("<tr>");
                for (int i = 0; i < dt.Columns.Count; i++)
                {
                    sb.AppendLine("<td style='mso-number-format:\"\\@\"'>" + dt.Rows[j][dt.Columns[i].ColumnName] + "</td>");
                }
                sb.AppendLine("</tr>");
            }

            sb.AppendLine("</table>");

            this.Response.Write(sb.ToString());

            this.Response.End();
        }
        protected void ToExcel(object sender, EventArgs e)
        {
            this.Server.ScriptTimeout = 120;

            int channelID = 0;

            if (this.cmbChannelID.SelectedItem != null && !string.IsNullOrEmpty(this.cmbChannelID.SelectedItem.Value.ToString()))
            {
                channelID = Convert.ToInt32(this.cmbChannelID.SelectedItem.Value.ToString());
            }
            int clientChannelID = 0;

            if (this.cmbCode.SelectedItem != null && !string.IsNullOrEmpty(this.cmbCode.SelectedItem.Value.ToString()))
            {
                clientChannelID = Convert.ToInt32(this.cmbCode.SelectedItem.Value.ToString());
            }
            List <string> phones = new List <string>();

            if (!string.IsNullOrEmpty(this.txtPhone.Text.Trim()))
            {
                phones = StringUtil.SplitMLineTextToArray(this.txtPhone.Text.Trim(), "|");
            }

            int recordCount = 0;

            List <SPPaymentInfoWrapper> paymentInfoWrappers = SPPaymentInfoWrapper.FindAllByChannelIDAndClientChannelIDAndPhoneListByOrderBy(channelID, clientChannelID, phones, SPPaymentInfoWrapper.PROPERTY_NAME_ID,
                                                                                                                                             false,
                                                                                                                                             1, 1000, out recordCount);



            this.Response.Clear();
            this.Response.ContentType = "application/vnd.ms-excel";
            this.Response.AddHeader("Content-Disposition", "attachment; filename=exportData.xls");
            StringBuilder sb = new StringBuilder();

            sb.AppendLine("<table>");
            sb.AppendLine("<tr>");
            sb.AppendLine("<td>linkid</td><td>通道名</td><td>指令</td><td>下家名</td><td>下家别名</td><td>下家组名</td><td>手机号</td><td>上行指令</td><td>通道号码</td><td>日期</td>");
            sb.AppendLine("</tr>");
            foreach (SPPaymentInfoWrapper spPaymentInfoWrapper in paymentInfoWrappers)
            {
                sb.AppendLine("<tr>");
                sb.AppendFormat("<td style='vnd.ms-excel.numberformat:@'>{0}</td><td style='vnd.ms-excel.numberformat:@'>{1}</td><td style='vnd.ms-excel.numberformat:@'>{2}</td><td style='vnd.ms-excel.numberformat:@'>{3}</td><td style='vnd.ms-excel.numberformat:@'>{4}</td><td style='vnd.ms-excel.numberformat:@'>{5}</td><td style='vnd.ms-excel.numberformat:@'>{6}</td><td style='vnd.ms-excel.numberformat:@'>{7}</td><td style='vnd.ms-excel.numberformat:@'>{8}</td><td style='vnd.ms-excel.numberformat:@'>{9}</td>",
                                spPaymentInfoWrapper.Linkid,
                                spPaymentInfoWrapper.ChannelName,
                                spPaymentInfoWrapper.Code,
                                spPaymentInfoWrapper.ClientName,
                                spPaymentInfoWrapper.ClientAlias,
                                spPaymentInfoWrapper.ClientGroupName,
                                spPaymentInfoWrapper.MobileNumber,
                                spPaymentInfoWrapper.Ywid,
                                spPaymentInfoWrapper.Cpid, spPaymentInfoWrapper.CreateDate);
                sb.AppendLine("");
                sb.AppendLine("</tr>");
            }

            sb.AppendLine("</table>");
            this.Response.Write(sb.ToString());
            this.Response.End();
        }
Exemplo n.º 19
0
 public void AutoMatch(int channelID, int clientID)
 {
     SPPaymentInfoWrapper.AutoMatch(channelID, clientID, DateTime.Now.Date, DateTime.Now.Date.AddDays(1), DataType.All.ToString());
 }
Exemplo n.º 20
0
 private static void UpdatePaymentSendSuccessAndUrl(string url, int paymentID)
 {
     SPPaymentInfoWrapper.UpdateUrlSuccessSend(paymentID, url);
 }
        protected void store1_Refresh(object sender, StoreRefreshDataEventArgs e)
        {
            int    recordCount   = 0;
            string sortFieldName = "";

            if (e.Sort != null)
            {
                sortFieldName = e.Sort;
            }

            int startIndex = 0;

            if (e.Start > -1)
            {
                startIndex = e.Start;
            }

            int limit = this.PagingToolBar1.PageSize;

            int pageIndex = 1;

            if ((startIndex % limit) == 0)
            {
                pageIndex = startIndex / limit + 1;
            }
            else
            {
                pageIndex = startIndex / limit;
            }

            DateTime startDate = Convert.ToDateTime(this.dfReportStartDate.DateField.Value);


            SPClientWrapper spClientWrapper = SPClientWrapper.FindById(this.SPClientID);

            if (startDate < spClientWrapper.GetDT())
            {
                startDate = spClientWrapper.GetDT();
            }

            string province = "";

            if (this.cmbProvince.SelectedItem != null)
            {
                province = this.cmbProvince.SelectedItem.Value;
            }

            string city = "";

            if (!string.IsNullOrEmpty(this.txtCity.Text.Trim()))
            {
                city = this.txtCity.Text.Trim();
            }

            string phone = "";

            if (!string.IsNullOrEmpty(this.txtMoblie.Text.Trim()))
            {
                phone = this.txtMoblie.Text.Trim();
            }

            List <SPPaymentInfoWrapper> list = SPPaymentInfoWrapper.FindAllByOrderByAndCleintIDAndChanneLIDAndDateAndProviceNoIntercept(ChannelID, this.SPClientID, startDate, Convert.ToDateTime(this.dfReportEndDate.DateField.Value), province, city, phone, sortFieldName, (e.Dir == Coolite.Ext.Web.SortDirection.DESC), pageIndex, limit, out recordCount);

            store1.DataSource = list;
            e.TotalCount      = recordCount;

            store1.DataBind();
        }
        protected void store1_Refresh(object sender, StoreRefreshDataEventArgs e)
        {
            int    recordCount   = 0;
            string sortFieldName = "";

            if (e.Sort != null)
            {
                sortFieldName = e.Sort;
            }

            int startIndex = 0;

            if (e.Start > -1)
            {
                startIndex = e.Start;
            }

            int limit = this.PagingToolBar1.PageSize;

            int pageIndex = 1;

            if ((startIndex % limit) == 0)
            {
                pageIndex = startIndex / limit + 1;
            }
            else
            {
                pageIndex = startIndex / limit;
            }


            List <SPPaymentInfoWrapper> list = null;


            DateTime startDate = DateTime.MinValue;

            if (this.dfStartDate.DateField.Value != null)
            {
                startDate = Convert.ToDateTime(this.dfStartDate.DateField.Value);
            }

            DateTime endDate = DateTime.MinValue;

            if (this.dfEndDate.DateField.Value != null)
            {
                endDate = Convert.ToDateTime(this.dfEndDate.DateField.Value);
            }

            if (SPClientID > 0)
            {
                list = SPPaymentInfoWrapper.FindAllByOrderByAndClientIDAndDate(SPClientID, startDate, endDate, sortFieldName, (e.Dir == Coolite.Ext.Web.SortDirection.DESC), pageIndex, limit, out recordCount);
            }
            else
            {
                list = SPPaymentInfoWrapper.FindAllDefaultClientPaymentByOrderByDate(startDate, endDate, sortFieldName, (e.Dir == Coolite.Ext.Web.SortDirection.DESC), pageIndex, limit, out recordCount);
            }



            store1.DataSource = list;
            e.TotalCount      = recordCount;

            store1.DataBind();
        }
Exemplo n.º 23
0
        public List <SPSSendUrlEntity> GetAllClientChannelNeedSendHistoryData(int maxDataCount, int maxAllDataCount, DateTime startDate, DateTime endDate)
        {
            this.Server.ScriptTimeout = 360;

            List <SPSSendUrlEntity> sendUrlEntities = new List <SPSSendUrlEntity>();

            List <SPClientChannelSettingWrapper> allNeedResendChannleClientSetting = SPClientChannelSettingWrapper.GetAllNeedRendSetting();

            int dataCount = 0;

            DateTime startDateTime = startDate;

            if (startDate > System.DateTime.Now.AddDays(-1))
            {
                startDateTime = System.DateTime.Now.AddDays(-1);
            }
            DateTime endDateTime = endDate;

            if (endDate > System.DateTime.Now.AddDays(-1))
            {
                endDateTime = System.DateTime.Now.AddDays(-1);
            }

            foreach (SPClientChannelSettingWrapper channelSetting in allNeedResendChannleClientSetting)
            {
                List <SPPaymentInfoWrapper> spReSendPaymentInfos = SPPaymentInfoWrapper.FindAllNotSendData(channelSetting.ChannelID.Id,
                                                                                                           channelSetting.ClinetID.Id, startDateTime.Date,
                                                                                                           endDateTime.Date, maxDataCount);

                foreach (SPPaymentInfoWrapper reSendPaymentInfo in spReSendPaymentInfos)
                {
                    if (!reSendPaymentInfo.IsIntercept.HasValue)
                    {
                        continue;
                    }

                    if (reSendPaymentInfo.IsIntercept.Value)
                    {
                        continue;
                    }


                    SPSSendUrlEntity sendUrlEntity = new SPSSendUrlEntity();
                    sendUrlEntity.PaymentID      = reSendPaymentInfo.Id;
                    sendUrlEntity.ClientID       = channelSetting.ClinetID.Id;
                    sendUrlEntity.ChannelID      = channelSetting.ChannelID.Id;
                    sendUrlEntity.SycnRetryTimes = (reSendPaymentInfo.SycnRetryTimes.HasValue
                                                        ? reSendPaymentInfo.SycnRetryTimes.Value
                                                        : 0);
                    sendUrlEntity.SendUrl = reSendPaymentInfo.ReBuildUrl();

                    sendUrlEntities.Add(sendUrlEntity);

                    dataCount++;

                    if (dataCount >= maxAllDataCount)
                    {
                        return(sendUrlEntities);
                    }
                }
            }

            return(sendUrlEntities);
        }
        protected void btnResetIntercept_Click(object sender, AjaxEventArgs e)
        {
            try
            {
                CurrentStep      = 0;
                CurrentStepCount = 0;
                prgProcess.Text  = "";

                int clientChannleID = Convert.ToInt32(this.hidClientChannelID.Text);


                SPClientChannelSettingWrapper clientChannelSetting =
                    SPClientChannelSettingWrapper.FindById(clientChannleID);


                if (!(clientChannelSetting.SyncData.HasValue && clientChannelSetting.SyncData.Value))
                {
                    Ext.Msg.Alert("错误", "该通道无法同步数据");
                    winProgress.Hide();
                    return;
                }



                int maxChangeCount = Convert.ToInt32(hidMaxChangeCount.Text);

                int recordCount = 0;

                DataSet ds = SPPaymentInfoWrapper.FindAllPaymentIDByDateAndType(System.DateTime.Now.Date,
                                                                                System.DateTime.Now.Date,
                                                                                clientChannleID,
                                                                                DataType.Intercept.ToString(),
                                                                                maxChangeCount);

                List <UrlSendTask> tasks = new List <UrlSendTask>();

                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    SPPaymentInfoWrapper payment =
                        SPPaymentInfoWrapper.FindById(dr[SPPaymentInfoWrapper.PROPERTY_NAME_ID]);

                    if (payment != null && payment.IsIntercept.HasValue && payment.IsIntercept.Value)
                    {
                        payment.IsIntercept    = false;
                        payment.IsSycnData     = true;
                        payment.SycnRetryTimes = 0;
                        payment.SucesssToSend  = false;


                        SPPaymentInfoWrapper.Update(payment);

                        tasks.Add(payment.BulidSendTask());
                    }
                }

                ThreadPool.QueueUserWorkItem(LongAction, tasks);
                ScriptManager1.AddScript("{0}.startTask('longactionprogress');", TaskManager1.ClientID);
            }
            catch (Exception ex)
            {
                Coolite.Ext.Web.ScriptManager.AjaxSuccess      = false;
                Coolite.Ext.Web.ScriptManager.AjaxErrorMessage = "错误信息:" + ex.Message;
            }
        }
        private void ReSendPayment(string dataType)
        {
            CurrentStep      = 0;
            CurrentStepCount = 0;
            prgProcess.Text  = "";

            int clientChannleID = Convert.ToInt32(this.hidClientChannelID.Text);


            SPClientChannelSettingWrapper clientChannelSetting =
                SPClientChannelSettingWrapper.FindById(clientChannleID);


            if (!(clientChannelSetting.SyncData.HasValue && clientChannelSetting.SyncData.Value))
            {
                Ext.Msg.Alert("错误", "该通道无法同步数据");
                prgProcess.Hide();
                return;
            }


            int maxChangeCount = Convert.ToInt32(hidMaxChangeCount.Text);

            int recordCount = 0;

            DataSet ds = SPPaymentInfoWrapper.FindAllPaymentIDByDateAndType(System.DateTime.Now.Date,
                                                                            System.DateTime.Now.Date,
                                                                            clientChannleID,
                                                                            dataType,
                                                                            maxChangeCount);

            List <UrlSendTask> tasks = new List <UrlSendTask>();

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                SPPaymentInfoWrapper payment =
                    SPPaymentInfoWrapper.FindById(dr[SPPaymentInfoWrapper.PROPERTY_NAME_ID]);



                if (payment != null && CheckPaymentIsDataType(payment, dataType))
                {
                    payment.IsIntercept    = false;
                    payment.IsSycnData     = true;
                    payment.SycnRetryTimes = 0;
                    payment.SucesssToSend  = false;


                    SPPaymentInfoWrapper.Update(payment);

                    tasks.Add(payment.BulidSendTask());
                }
            }

            if (tasks.Count <= 0)
            {
                Ext.Msg.Alert("错误", "没有需要重发的数据");
                prgProcess.Hide();
                return;
            }

            ThreadPool.QueueUserWorkItem(LongAction, tasks);
            ScriptManager1.AddScript("{0}.startTask('longactionprogress');", TaskManager2.ClientID);
        }
Exemplo n.º 26
0
 public int[] GetGetAllClientChannelIDNeed(DateTime startDate, DateTime endDate)
 {
     this.Server.ScriptTimeout = 360;
     return(SPPaymentInfoWrapper.GetGetAllClientChannelIDNeed(startDate.Date, endDate.Date));
 }