public string MakeUpInvoice(int accId, decimal invoiceMoney, int oid, string invoiceAddressee, string invoicePhone, string invoiceName, string invoiceAdress) { var invoiceModel = new T_Order_Invoice(); invoiceModel.accId = accId; invoiceModel.oid = oid; invoiceModel.createDate = DateTime.Now; invoiceModel.invoiceMoney = invoiceMoney; invoiceModel.invoiceName = invoiceName; invoiceModel.invoiceAddressee = invoiceAddressee; invoiceModel.invoiceDesc = "信息服务费"; invoiceModel.invoicePhone = invoicePhone; invoiceModel.invoiceAddress = invoiceAdress; invoiceModel.invoiceStatus = 0; invoiceModel.invoiceNo = ""; int invoiceId = T_Order_InvoiceBLL.AddInvoice(invoiceModel); bool status = T_OrderInfoBLL.SetInvoiceId(accId, oid, invoiceId); if (status) { return("1"); } else { return("0"); } }
/// <summary> /// 退款操作 /// </summary> /// <param name="oid"></param> /// <param name="accid"></param> /// <param name="dDesc"></param> /// <returns></returns> public string Drawback(int oid, int accid, string dDesc) { ManageUserModel uM = (ManageUserModel)Session["logUser"]; int uid = uM.UserID; return(T_OrderInfoBLL.DrawbackProcess(accid, oid, uid, dDesc) ? "1" : "0"); }
public static string GetNewUsrOrder(DateTime stDate, DateTime edDate) { NewUsrOrder model = new NewUsrOrder(); List <NewOrderProduct> list = T_OrderInfoBLL.GetNewUsrOrder(stDate, edDate); List <int> accidList = new List <int>(); int allAcc = 0; List <string> prodList = list.Select(x => x.displayName).Distinct().ToList(); foreach (string pName in prodList) { NewUsrOrderItem item = new NewUsrOrderItem(); accidList = list.Where(x => x.displayName == pName).Select(x => x.accId).ToList(); item.ProductName = pName; item.UsrCount = accidList.Count; item.AccidList = CommonLib.Helper.JsonSerializeObject(accidList); model.DataList.Add(item); } //if (allAcc != 0) //{ // foreach (NewUsrOrderItem item in model.DataList) // { // item.Ratio = (item.UsrCount*100/allAcc).ToString("f2") + "%"; // } //} model.DataList = model.DataList.OrderBy(x => x.UsrCount).ToList(); model.DataList.Reverse(); return(CommonLib.Helper.JsonSerializeObject(model)); }
/// <summary> /// 获取充值状态列表 /// </summary> /// <param name="page"></param> /// <param name="phoneNum"></param> /// <param name="orderNo"></param> /// <returns></returns> public static string GetRechargeOrderList(int page, string phoneNum, string orderNo) { var model = MobileRecharge.GetHistoryOrder(page, 15, phoneNum, orderNo); if (model.error_code == 0) { if (model.result.data != null) { foreach (var item in model.result.data) { //获取当前最后记录对应的订单ID //int lastOid = Sys_RechargeRecordBLL.GetLastOid(); var tempModel = T_OrderInfoBLL.GetRechargeOrderListExtend(item.uorderid); if (tempModel != null) { //更新的订单如果在记录表没有记录则插入信息 if (Sys_RechargeRecordBLL.CheckExist(tempModel.oid) == 0) { RechargeRecord recordModel = new RechargeRecord(); recordModel.AccId = tempModel.accId; recordModel.AddTime = item.addtime; recordModel.CardName = item.cardname; recordModel.Oid = tempModel.oid; recordModel.OrderNo = item.uorderid; recordModel.State = item.game_state; recordModel.CardNum = Convert.ToInt32(item.cardnum); recordModel.RealNum = Convert.ToDecimal(item.uordercash); recordModel.PaidNum = tempModel.RealPayMoney; recordModel.GapNum = recordModel.RealNum - recordModel.PaidNum; Sys_RechargeRecordBLL.AddNewRecord(recordModel); } item.accModel = T_AccountBLL.GetAccountBasic(tempModel.accId); } } model.result.Summary = Sys_RechargeRecordBLL.GetRecordSum(); return(CommonLib.Helper.JsonSerializeObject(model, "yyyy-MM-dd HH:mm:ss")); } else { return(""); } } return(CommonLib.Helper.JsonSerializeObject(model)); }
public string AddExpressInfo(int oid, int accId, string expressCompany, string expressCode) { ManageUserModel uM = (ManageUserModel)Session["logUser"]; int uid = uM.UserID; string uName = uM.Name; int reVal = T_OrderInfoBLL.AddExpressInfo(oid, accId, expressCompany, expressCode, uid, uName); //发货完成后推送消息 if (reVal == 1) { //获取实物商品名称 T_OrderInfoDAL dal = new T_OrderInfoDAL(); string goodsName = dal.GetMaterialGoodsName(Convert.ToInt32(dal.GetBusIdByOid(oid))); try { #region Kafka Message 实物订单发货后 AfterExpress eModel = new AfterExpress(); eModel.EventId = 5; eModel.AccId = accId; eModel.GoodsName = goodsName; eModel.ExpressName = expressCompany; eModel.ExpressCode = expressCode; string specModel = CommonLib.Helper.JsonSerializeObject(eModel); KafkaMessage mSend = new KafkaMessage(); mSend.SendMsg(5, specModel); #endregion } catch (Exception ex) { Logger.Error("实物订单发货后推送模板消息错误", ex); } } return(reVal.ToString()); }
public string ConfirmOfflineOrder(decimal confirmMoney, string confirmRemark, int oid) { ManageUserModel uM = (ManageUserModel)System.Web.HttpContext.Current.Session["logUser"]; if (T_OrderInfoBLL.SetConfirmInfo(oid, confirmMoney, confirmRemark, Convert.ToInt32(uM.UserID), HttpContext.Request.UserHostAddress, DateTime.Now)) { //远程调用处理 var orderInfo = T_OrderInfoBLL.GetModel(oid); int iResult = T_OrderInfoBLL.RemoteConfirm(orderInfo.accId, orderInfo.orderNo, orderInfo.RealPayMoney.ToString()); if (iResult == 1) { return("1"); } else { return("2"); } } else { return("2"); } }
public string DeleteOrder(int oid) { return(T_OrderInfoBLL.DeleteOrder(oid).ToString()); }
/// <summary> /// 获取订单信息 /// </summary> /// <param name="stDate"></param> /// <param name="edDate"></param> /// <returns></returns> public static Dictionary <string, decimal> GetOrderInfo(DateTime stDate, DateTime edDate) { Dictionary <string, decimal> dic = new Dictionary <string, decimal>() { { "总订单", 0 }, { "Saas服务", 0 }, { "短信", 0 }, { "话费", 0 }, { "硬件", 0 }, { "总订单笔数", 0 }, { "Saas服务笔数", 0 }, { "短信笔数", 0 }, { "话费笔数", 0 }, { "硬件笔数", 0 } }; //获取订单类型 List <OrderInfoModel> tOrdList = T_OrderInfoBLL.GetOrderInfoByDate(stDate, edDate, 0); decimal tSelf = 0; decimal tSms = 0; decimal tMaterial = 0; decimal tPhone = 0; foreach (var item in tOrdList) { OrderItemProp tempModel = T_Order_businessBLL.GetListItemProps(Convert.ToInt32(item.busId), item.accId); if (tempModel.SelfMark == "1") { tSelf += Convert.ToDecimal(item.RealPayMoney); dic["Saas服务笔数"] += 1; } else if (tempModel.PureSms == "1") { tSms += Convert.ToDecimal(item.RealPayMoney); dic["短信笔数"] += 1; } else { tPhone += Convert.ToDecimal(item.RealPayMoney); dic["话费笔数"] += 1; } } //获取实物商品相关统计(实物商品计入他营产品) List <OrderInfoModel> MaterialList = T_OrderInfoBLL.GetOrderInfoByDate(stDate, edDate, 1); if (MaterialList != null && MaterialList.Count > 0) { foreach (var item in MaterialList) { tMaterial += Convert.ToDecimal(item.RealPayMoney); dic["硬件笔数"] += 1; } } dic["Saas服务"] = tSelf; dic["短信"] = tSms; dic["话费"] = tPhone; dic["硬件"] = tMaterial; dic["总订单"] = tSelf + tSms + tPhone + tMaterial; dic["总订单笔数"] = dic["Saas服务笔数"] + dic["短信笔数"] + dic["话费笔数"] + dic["硬件笔数"]; return(dic); }
/// <summary> /// 得到一个店铺的订单 /// </summary> /// <param name="accid"></param> /// <returns></returns> public static DetailOrder GetAccountOrder(int accid) { List <dynamic> orderList = T_OrderInfoBLL.GetListByAccId(accid); string str = ""; OrderItemProp propModel = new OrderItemProp(); DetailOrder orderModel = new DetailOrder(); foreach (dynamic item in orderList) { str = item.orderPayType.ToString(); switch (str) { case "0": item.orderPayType = "平台订单"; break; case "1": item.orderPayType = "线下订单"; break; case "2": item.orderPayType = "支付宝"; break; case "3": item.orderPayType = "财付通"; break; case "4": item.orderPayType = "快钱"; break; case "5": item.orderPayType = "微信支付"; break; case "6": item.orderPayType = "IOS支付"; break; case "7": item.orderPayType = "安卓支付"; break; } if (item.orderTypeId != 2) { OrderItemProp tempModel = T_Order_businessBLL.GetListItemProps(Convert.ToInt32(item.busId), accid); if (propModel.isFreeSms == 1 && tempModel.isFreeSms == 1) { propModel.Profit += Convert.ToDouble(item.RealPayMoney); propModel.SumMoney += Convert.ToDouble(item.RealPayMoney); } else { propModel.Cost += tempModel.Cost; propModel.Profit += Convert.ToDouble(item.RealPayMoney); propModel.SumMoney += Convert.ToDouble(item.RealPayMoney) - tempModel.Cost; propModel.isFreeSms = tempModel.isFreeSms; } } else { propModel.Cost += Convert.ToDouble(item.busSumMoney); propModel.Profit += Convert.ToDouble(item.RealPayMoney); propModel.SumMoney += Convert.ToDouble(item.RealPayMoney) - Convert.ToDouble(item.busSumMoney); } } propModel.Cost = Math.Round(propModel.Cost, 2); propModel.Profit = Math.Round(propModel.Profit, 2); propModel.SumMoney = Math.Round(propModel.SumMoney, 2); orderModel.DataList = orderList; orderModel.SumInfo = propModel; return(orderModel); }
public static string GetOrderType(string dataType, DateTime BgTime, DateTime EdTime) { FusionPieModel model = new FusionPieModel(); string strJson = ""; DateTime bgTime = new DateTime(); DateTime edTime = new DateTime(); if (dataType == "oth") { bgTime = BgTime; edTime = EdTime.AddHours(23).AddMinutes(59).AddSeconds(59); } else if (dataType == "month") { DateTime FirstDay = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1); DateTime LastDay = FirstDay.AddMonths(1).AddDays(-1); bgTime = FirstDay; edTime = LastDay.AddHours(23).AddMinutes(59).AddSeconds(59); } else if (dataType == "lastmonth") { DateTime nowTime = DateTime.Now.AddMonths(-1); DateTime FirstDay = new DateTime(nowTime.Year, nowTime.Month, 1); DateTime LastDay = FirstDay.AddMonths(1).AddDays(-1); bgTime = FirstDay; edTime = LastDay.AddHours(23).AddMinutes(59).AddSeconds(59); } else if (dataType == "3month") { DateTime nowTime = DateTime.Now.AddMonths(-2); DateTime FirstDay = new DateTime(nowTime.Year, nowTime.Month, 1); DateTime LastDay = FirstDay.AddMonths(3).AddDays(-1); bgTime = FirstDay; edTime = LastDay.AddHours(23).AddMinutes(59).AddSeconds(59); } else if (dataType == "today") { bgTime = DateTime.Today.AddHours(0).AddMinutes(0).AddSeconds(0); edTime = DateTime.Today.AddHours(23).AddMinutes(59).AddSeconds(59); } List <OrderInfoModel> list = T_OrderInfoBLL.GetOrderInfoByDate(bgTime, edTime, 0); double self = 0; double other = 0; double otherServ = 0; //int count = 0;//调试信息 foreach (var item in list) { OrderItemProp tempModel = T_Order_businessBLL.GetListItemProps(Convert.ToInt32(item.busId), item.accId); if (tempModel.SelfMark == "1") { self += Convert.ToDouble(item.RealPayMoney); } else if (tempModel.PureSms == "1") { otherServ += Convert.ToDouble(item.RealPayMoney); //count++; } else { other += Convert.ToDouble(item.RealPayMoney); } } //获取实物商品相关统计(实物商品计入他营产品) List <OrderInfoModel> MaterialList = T_OrderInfoBLL.GetOrderInfoByDate(bgTime, edTime, 1); if (MaterialList != null && MaterialList.Count > 0) { foreach (var item in MaterialList) { other += Convert.ToDouble(item.RealPayMoney); } } //获取京东订单那相关统计(订单商品计入他营产品) List <OrderInfoModel> JdList = T_OrderInfoBLL.GetOrderInfoByDate(bgTime, edTime, 2); if (MaterialList != null && MaterialList.Count > 0) { foreach (var item in MaterialList) { other += Convert.ToDouble(item.RealPayMoney); } } //OrderPartition orderMoney = T_OrderInfoBLL.GetOrderType(bgTime, edTime); double allMoney = self + other + otherServ; model.chart.caption = "产品类型比例"; model.chart.baseFontSize = "12"; model.chart.showpercentvalues = "1"; PieData servData = new PieData(); servData.label = "第三方服务"; servData.value = GetBaiFen(Convert.ToDouble(otherServ), allMoney); servData.toolText = "第三方服务," + GetBaiFen(Convert.ToDouble(otherServ), allMoney) + "% (¥" + ControlHelper.formats(otherServ, 2).ToString() + ")"; model.data.Add(servData); PieData selfData = new PieData(); selfData.label = "Saas服务"; selfData.value = GetBaiFen(Convert.ToDouble(self), allMoney); selfData.toolText = "Saas服务," + GetBaiFen(Convert.ToDouble(self), allMoney) + "% (¥" + ControlHelper.formats(self, 2).ToString() + ")"; model.data.Add(selfData); PieData otherData = new PieData(); otherData.label = "他营"; otherData.value = GetBaiFen(Convert.ToDouble(other), allMoney); otherData.toolText = "他营," + GetBaiFen(Convert.ToDouble(other), allMoney) + "% (¥" + ControlHelper.formats(other, 2).ToString() + ")"; model.data.Add(otherData); return(CommonLib.Helper.JsonSerializeObject(model)); }
public static decimal GetCouponByCondition(string strWhere) { return(T_OrderInfoBLL.GetCouponByCondition(strWhere)); }
public static decimal GetIntegralSumByCondition(string strWhere) { return(T_OrderInfoBLL.GetIntegralSumByCondition(strWhere)); }
/// <summary> /// 获取符合条件列表的行数 /// </summary> /// <param name="strWhere"></param> /// <returns></returns> public static int GetPageCount(string strWhere) { return(T_OrderInfoBLL.GetPageCount(strWhere)); }
/// <summary> /// 获取分页后的订单信息 /// </summary> /// <param name="pageIndex"></param> /// <param name="pageSize"></param> /// <param name="Column"></param> /// <param name="strWhere"></param> /// <returns></returns> public static List <OrderInfoModel> GetPage(int pageIndex, int pageSize, string Column, string strWhere) { return(T_OrderInfoBLL.GetPage(pageIndex, pageSize, Column, strWhere)); }
/// <summary> /// 补充话费并记录日志 /// </summary> /// <param name="accid"></param> /// <param name="oid"></param> /// <param name="uid"></param> /// <returns></returns> public static string RechargeProc(int accid, int oid, int uid) { //获取订单相关信息 T_OrderInfo mobileModel = T_OrderInfoBLL.GetModel(oid); string newOrdNum = mobileModel.orderNo.Substring(0, mobileModel.orderNo.Length - 2); Random rd = new Random(); var randNum = newOrdNum + rd.Next(1, 100); while (randNum == mobileModel.orderNo) { randNum = newOrdNum + rd.Next(1, 100); } string cardNum = ""; if (mobileModel.busPrice / 10 >= 9) { cardNum = "100"; } else if (mobileModel.busPrice / 10 >= 4) { cardNum = "50"; } else if (mobileModel.busPrice / 10 >= 2) { cardNum = "30"; } //去掉手机号中的空格 string phoneNum = mobileModel.remark.Replace(" ", ""); //调用话费补充接口 var result = MobileRecharge.MobileCharge(phoneNum, cardNum, randNum); //var result = MobileRecharge.CheckPhoneNum(mobileModel.remark, cardNum); //string errInfo = ""; if (result.error_code == 0) { //记录话费补充日志 if (T_OrderInfoBLL.RechargeLog(accid, uid, oid, (int)mobileModel.busPrice, 0, result.reason, randNum)) { return("1"); } else { Logger.Info("补充提交成功,记录日志出错!"); return("补充提交成功,记录日志出错!"); } } else { if (T_OrderInfoBLL.RechargeLog(accid, uid, oid, (int)mobileModel.busPrice, 1, result.reason, randNum)) { return("补充提交失败【" + result.reason + "】!"); } else { Logger.Info("补充提交失败,记录日志出错!"); return("补充提交失败【" + result.reason + "】,记录日志出错!"); } //return "补充接口返回错误码!" + result.error_code; } }