/// <summary>会员搜索 /// </summary> protected void RCB_MemberItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e) { var combo = (RadComboBox)o; combo.Items.Clear(); string userName = e.Text.Trim(); if (!string.IsNullOrEmpty(userName) && userName.Length >= 2) { var salePlatformId = new Guid(RCB_SalePlatform.SelectedValue); var list = MemberCenterSao.GetUserToDic(salePlatformId, userName); var totalCount = list.Count; if (e.NumberOfItems >= totalCount) { e.EndOfItems = true; } else { foreach (var item in list) { var rcb = new RadComboBoxItem { Text = item.Value, Value = item.Key.ToString() }; combo.Items.Add(rcb); } } } }
protected void RG_MemberMentionApply_NeedDataSource(object sender, GridNeedDataSourceEventArgs e) { var pageIndex = RG_MemberMentionApply.CurrentPageIndex + 1; var pageSize = RG_MemberMentionApply.PageSize; int totalCount; IList <MemberMentionApplyInfo> list = MemberCenterSao.GetMemberMentionApplyByPage(SearchKey, ApplyNo, BankAccountName, StartTime, EndTime, Convert.ToInt32(SearchState), SaleFilialeId, SalePlatformId, RdBankAccounts.Text, pageIndex, pageSize, out totalCount); RG_MemberMentionApply.DataSource = list; RG_MemberMentionApply.VirtualItemCount = totalCount; }
/// <summary> /// 退回申请 /// </summary> /// <param name="salePlatformId"></param> /// <param name="applyId"></param> protected void ReturnApply(Guid salePlatformId, Guid applyId) { var errorMsg = new StringBuilder(); MemberMentionApplyInfo memberMentionApplyInfo = MemberCenterSao.GetMemberMentionApply(salePlatformId, applyId); if (memberMentionApplyInfo.State == (int)MemberMentionState.Process) { #region 退回申请 try { string errorMessage; var result = MemberCenterSao.ReturnBackWithdrawApply(salePlatformId, applyId, txt_RefuseReason.Text.Trim(), Common.WebControl.RetrunUserAndTime("提现退回"), out errorMessage); if (!result) { throw new Exception("会员名:" + memberMentionApplyInfo.UserName + "提现单号:" + memberMentionApplyInfo.ApplyNo + " " + errorMessage); } Common.WebControl.AddOperationLog(Personnel.PersonnelId, Personnel.RealName, memberMentionApplyInfo.Id, memberMentionApplyInfo.ApplyNo, OperationPoint.MemberWithdrawCash.PayRefuse.GetBusinessInfo(), "提现退回"); } catch (Exception ex) { errorMsg.Append("退回申请失败!" + ex.Message).Append("\\n"); } #endregion #region 发送短信 try { MemberBaseInfo memberBaseInfo = MemberCenterSao.GetUserBase(salePlatformId, memberMentionApplyInfo.MemberId); if (memberBaseInfo != null) { if (!string.IsNullOrEmpty(memberBaseInfo.Mobile)) { //百秀退回申请不发送短信 var baishopFilialeId = new Guid("444E0C93-1146-4386-BAE2-CB352DA70499"); if (memberMentionApplyInfo.SaleFilialeId != baishopFilialeId) { string msg = "您好,您的提现申请已退回,原因:" + txt_RefuseReason.Text + "。详情可致电4006202020咨询。感谢您对可得网支持!"; MailSMSSao.SendShortMessage(memberMentionApplyInfo.SaleFilialeId, memberMentionApplyInfo.SalePlatformId, memberBaseInfo.Mobile, msg); } } } } catch (Exception ex) { errorMsg.Append("退回申请成功,短信发送失败! " + "会员名:" + memberMentionApplyInfo.UserName + "提现单号:" + memberMentionApplyInfo.ApplyNo + " " + ex.Message).Append("\\n"); } #endregion } if (!string.IsNullOrEmpty(errorMsg.ToString())) { throw new Exception(errorMsg.ToString()); } }
protected void RGMemberReckoning_NeedDataSource(object source, GridNeedDataSourceEventArgs e) { int pageIndex = RGMemberReckoning.CurrentPageIndex + 1; int pageSize = RGMemberReckoning.PageSize; int totalCount = 0; var list = new List <MemberReckoningInfo>(); if (IsPostBack) { list = MemberCenterSao.SearchReckoningByPage(SaleFilialeID, StartTime, EndTime, FlowType, TradeCode, pageIndex, pageSize, out totalCount).ToList(); } RGMemberReckoning.DataSource = list; RGMemberReckoning.VirtualItemCount = totalCount; }
protected void RgMemberMentionApplyNeedDataSource(object sender, GridNeedDataSourceEventArgs e) { var pageIndex = RG_MemberMentionApply.CurrentPageIndex + 1; var pageSize = RG_MemberMentionApply.PageSize; int totalCount; IList <MemberMentionApplyInfo> list = MemberCenterSao.GetMemberMentionApplyByPage(SearchKey, string.Empty, string.Empty, StartTime, EndTime, int.Parse(SearchState), SaleFilialeId, SalePlatformId, string.Empty, pageIndex, pageSize, out totalCount); RG_MemberMentionApply.DataSource = list; RG_MemberMentionApply.VirtualItemCount = totalCount; }
protected void Ib_Search_Click(object sender, ImageClickEventArgs e) { NonceOrderState = (OrderState)Convert.ToInt32(RCB_OrderState.SelectedValue); StartTime = RDP_StartTime.SelectedDate ?? DateTime.MinValue; //EndTime = RDP_EndTime.SelectedDate != null ? RDP_EndTime.SelectedDate.Value : DateTime.MinValue; PaidNo = RTB_PaidNo.Text.Trim(); //支付号 var orderNo = RTB_Search.Text.Trim(); //订单号 var mobil = RTB_Mobil.Text.Trim(); //手机号 var realName = RTB_RealName.Text.Trim(); //收货人 var userName = RTB_UserName.Text.Trim(); //会员名 var expressNo = RTB_ExpressNo.Text.Trim(); //快递号 if (string.IsNullOrWhiteSpace(PaidNo) && string.IsNullOrWhiteSpace(orderNo) && string.IsNullOrWhiteSpace(mobil) && string.IsNullOrWhiteSpace(realName) && string.IsNullOrWhiteSpace(userName) && string.IsNullOrWhiteSpace(expressNo)) { RefreshRadTextBoxBorderColor(Color.Red); RAM.Alert("系统提示:必须满足一个搜索条件!"); return; } RefreshRadTextBoxBorderColor(Color.Empty); SaleFilialeId = new Guid(RCB_SaleFiliale.SelectedValue); SalePlatformId = new Guid(RCB_SalePlatform.SelectedValue); if (!string.IsNullOrEmpty(RTB_UserName.Text)) { var salePlatformId = SalePlatformId; if (SaleFilialeId == new Guid("B6B39773-E76E-4A53-9AAC-634E7DF973EA")) //门店总公司 { salePlatformId = new Guid("3FE5AEF4-2CFD-4998-8D88-385321179B80"); //可得官网 } if (salePlatformId == Guid.Empty) { RAM.Alert("温馨提示:通过会员名称搜索数据必须选择具体的销售平台,谢谢配合!"); return; } var info = MemberCenterSao.GetUserBase(salePlatformId, RTB_UserName.Text); if (info != null) { MemberIdOrConsignee = info.MemberId; } else { RAM.Alert("温馨提示:请核对会员名称是否正确!"); return; } } else { MemberIdOrConsignee = Guid.Empty; } RGMGO.Rebind(); }
/// <summary> /// /// </summary> /// <param name="salePlateId"></param> protected void BindProblemType(Guid salePlateId) { var dics = new Dictionary <Guid, string> { { Guid.Empty, string.Empty } }; var data = MemberCenterSao.GetMemberTypeProblemTypeList(salePlateId); if (data != null && data.Count > 0) { foreach (var item in data) { dics.Add(item.Key, item.Value); } } RcbProblemId.DataSource = dics; RcbProblemId.DataBind(); }
/// <summary>绑定数据源 /// </summary> protected void RadGridMemberBalanceManage_NeedDataSource(object source, GridNeedDataSourceEventArgs e) { var pageIndex = IsSerarch ? 1 : RadGridMemberBalanceManage.CurrentPageIndex + 1; var pageSize = RadGridMemberBalanceManage.PageSize; int totalCount; IList <MemeberBalanceChangeInfo> list = MemberCenterSao.SearchUserBalanceChangeListByPage(SaleFilialeID, SalePlatformID, MemberId, ChangeState, ChangeType, TradeCode, StartTime, EndTime, TypeOfProblemId, bool.Parse(rbl_IsOfficial.SelectedValue), pageIndex, pageSize, out totalCount); RadGridMemberBalanceManage.DataSource = list; RadGridMemberBalanceManage.VirtualItemCount = totalCount; #region 绑定导出Grid IList <MemeberBalanceChangeInfo> exportList = MemberCenterSao.SearchUserBalanceChangeListByPage(SaleFilialeID, SalePlatformID, MemberId, ChangeState, ChangeType, TradeCode, StartTime, EndTime, TypeOfProblemId, bool.Parse(rbl_IsOfficial.SelectedValue), 1, 999999, out totalCount); ExportExcel.DataSource = exportList; ExportExcel.DataBind(); #endregion }
/// <summary> /// 打款完成 /// </summary> /// <param name="salePlatformId"></param> /// <param name="applyId"></param> protected void PayFinish(Guid salePlatformId, Guid applyId) { var errorMsg = new StringBuilder(); MemberMentionApplyInfo memberMentionApplyInfo = MemberCenterSao.GetMemberMentionApply(salePlatformId, applyId); if (memberMentionApplyInfo.State == (int)MemberMentionState.Process) { var orderNoStr = string.Empty; if (!string.IsNullOrWhiteSpace(memberMentionApplyInfo.OrderNo)) { orderNoStr = string.Format("[订单号:{0}]", memberMentionApplyInfo.OrderNo); } if (!string.IsNullOrWhiteSpace(memberMentionApplyInfo.ThirdPartyOrderNo) || memberMentionApplyInfo.ThirdPartyOrderNo == "-") { orderNoStr = string.Format("{0}[第三方平台订单号:{1}]", orderNoStr, memberMentionApplyInfo.ThirdPartyOrderNo); } var rdescription = string.Format("[余额提现(提现会员:{0};提现申请单号:{1};提现到:{2};操作人:{3}),资金减少,{4})]", memberMentionApplyInfo.UserName, memberMentionApplyInfo.ApplyNo, memberMentionApplyInfo.BankName, Personnel.RealName, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); var info = new WasteBookInfo(Guid.NewGuid(), new Guid(RCB_BankAccountsId.SelectedValue), memberMentionApplyInfo.ApplyNo, rdescription + orderNoStr, -memberMentionApplyInfo.Amount, (Int32)AuditingState.Yes, (Int32)WasteBookType.Decrease, memberMentionApplyInfo.SaleFilialeId) { LinkTradeCode = memberMentionApplyInfo.ApplyNo, LinkTradeType = (int)WasteBookLinkTradeType.WithdrawDeposit, BankTradeCode = string.Empty, State = (int)WasteBookState.Currently, IsOut = false }; var memo = "提现" + memberMentionApplyInfo.ApplyNo + "取走余额;"; var description = "提现" + memberMentionApplyInfo.ApplyNo + ",提走余额;" + Common.WebControl.RetrunUserAndTime("提现受理"); #region 提现 using (var ts = new TransactionScope(TransactionScopeOption.Required)) { try { if (info.Income != 0) { _wasteBook.Insert(info); } string errorMessage; var result = MemberCenterSao.CompleteWithdrawApply(salePlatformId, applyId, memo, description, out errorMessage); if (!result) { throw new Exception("会员名:" + memberMentionApplyInfo.UserName + "提现单号:" + memberMentionApplyInfo.ApplyNo + " " + errorMessage); } //提现打款完成增加操作记录添加 Common.WebControl.AddOperationLog(Personnel.PersonnelId, Personnel.RealName, info.WasteBookId, info.TradeCode, OperationPoint.MemberWithdrawCash.PaySuccess.GetBusinessInfo(), string.Empty); ts.Complete(); } catch (Exception ex) { errorMsg.Append("提现失败!" + ex.Message).Append("\\n"); } finally { ts.Dispose(); } } #endregion #region 发送短信 try { MemberBaseInfo memberBaseInfo = MemberCenterSao.GetUserBase(salePlatformId, memberMentionApplyInfo.MemberId); if (memberBaseInfo != null) { if (!string.IsNullOrEmpty(memberBaseInfo.Mobile)) { //可得完成打款发送短信 var keedeFilialeId = FilialeManager.GetList().First(f => f.Code.ToLower() == "kede").ID; if (memberMentionApplyInfo.SaleFilialeId == keedeFilialeId) { const string MSG = "您好,您的提现申请已收到,现已完成打款,一般2-5个工作日到账,请注意查收。详情可致电4006202020咨询。感谢您对可得网支持!"; MailSMSSao.SendShortMessage(memberMentionApplyInfo.SaleFilialeId, memberMentionApplyInfo.SalePlatformId, memberBaseInfo.Mobile, MSG); } } } } catch (Exception ex) { errorMsg.Append("提现成功,短信发送失败! " + "会员名:" + memberMentionApplyInfo.UserName + "提现单号:" + memberMentionApplyInfo.ApplyNo + " " + ex.Message).Append("\\n"); } #endregion } if (!string.IsNullOrEmpty(errorMsg.ToString())) { throw new Exception(errorMsg.ToString()); } }
/// <summary>订单导入 /// </summary> public bool AddOrderAndInvoice(GoodsOrderInfo goodsOrder, IList <GoodsOrderDetailInfo> goodsOrderDetailList, InvoiceInfo invoiceInfo, out string errorMessage) { errorMessage = string.Empty; if (goodsOrderDetailList.Count == 0) { errorMessage = "订单明细没有数据!"; return(false); } Boolean isEdit = false; #region 验证B2C订单信息 (订单目前是走推送服务) var filialeList = FilialeManager.GetB2CFilialeList(); if (filialeList.Any(act => act.ID == goodsOrder.SaleFilialeId)) { try { var info = OrderSao.GetGoodsOrderInfo(goodsOrder.SaleFilialeId, goodsOrder.OrderId); if (info == null) { errorMessage = "获取B2C订单信息不存在"; return(false); } if (info.OrderState == (int)OrderState.Cancellation) { return(true); } } catch (Exception ex) { errorMessage = "获取B2C订单信息异常" + ex.Message; throw ex; } } #endregion var localGoodsOrderInfo = _goodsOrderDao.GetGoodsOrder(goodsOrder.OrderId); goodsOrder.HostingFilialeId = WMSSao.GetHostingFilialeIdByWarehouseIdGoodsTypes(goodsOrder.DeliverWarehouseId, goodsOrder.SaleFilialeId, goodsOrderDetailList.Select(ent => ent.GoodsType).Distinct()); IList <GoodsOrderDetailInfo> localGoodsOrderDetails = new List <GoodsOrderDetailInfo>(); if (localGoodsOrderInfo != null && localGoodsOrderInfo.OrderId != Guid.Empty) { isEdit = true; if (localGoodsOrderInfo.OrderState == (int)OrderState.Cancellation) { return(true); } localGoodsOrderDetails = _goodsOrderDetailDao.GetGoodsOrderDetailList(goodsOrder.OrderId); } using (var ts = new TransactionScope(TransactionScopeOption.Required)) { //1.订单导入,先删后插 if (isEdit) { var success = _goodsOrderDao.Delete(goodsOrder.OrderId); if (!success) { errorMessage = "删除订单失败"; return(false); } } //2.插入订单和订单明细 var insertSuccess = _goodsOrderDao.Insert(goodsOrder, out errorMessage); if (!insertSuccess) { errorMessage = string.Format("添加订单信息失败:{0}", errorMessage); return(false); } var insertDetailSuccess = _goodsOrderDetailDao.Insert(goodsOrderDetailList, goodsOrder, out errorMessage); if (!insertDetailSuccess) { errorMessage = string.Format("添加订单商品明细失败:{0}", errorMessage); return(false); } //3.记录销量 //异步销量 if (goodsOrder.OrderState == (int)OrderState.WaitOutbound || goodsOrder.OrderState == (int)OrderState.StockUp || goodsOrder.OrderState == (int)OrderState.RequirePurchase || goodsOrder.OrderState == (int)OrderState.Redeploy) { var orderJsonStr = new Framework.Core.Serialize.JsonSerializer().Serialize(goodsOrder); var orderDetailJsonStr = new Framework.Core.Serialize.JsonSerializer().Serialize(goodsOrderDetailList); var asynGoodsDaySalesStatisticsInfo = isEdit ? ASYN_GoodsDaySalesStatisticsInfo.EditGoodsDaySale(goodsOrder.OrderNo, orderJsonStr, orderDetailJsonStr, new Framework.Core.Serialize.JsonSerializer().Serialize(localGoodsOrderDetails)) : ASYN_GoodsDaySalesStatisticsInfo.AddGoodsDaySale(goodsOrder.OrderNo, orderJsonStr, orderDetailJsonStr); var asynResult = _goodsOrderDetailDao.InsertASYN_GoodsDaySalesStatisticsInfo(asynGoodsDaySalesStatisticsInfo); if (!asynResult) { errorMessage = "销量记录到异步失败!"; return(false); } } //4.发票插入 if (invoiceInfo != null && invoiceInfo.InvoiceId != Guid.Empty) { invoiceInfo.DeliverWarehouseId = goodsOrder.DeliverWarehouseId; var insertInvoiceSuccess = _invoiceDao.Insert(invoiceInfo, new Dictionary <Guid, string> { { goodsOrder.OrderId, goodsOrder.OrderNo } }); if (!insertInvoiceSuccess) { errorMessage = "插入发票失败"; return(false); } } //5.配货中,会员中心交互 MemberCenterSao.OrderAllocateGoods(goodsOrder.SalePlatformId, goodsOrder.OrderId); //提交事务 ts.Complete(); return(true); } }