/// <summary> /// 退款通用处理逻辑 /// </summary> /// <param name="model"></param> /// <param name="oper"></param> /// <param name="desc"></param> /// <returns></returns> public bool GeneralDrawbackProc(int oper, string desc, DrawbackInfoModel model) { StringBuilder strSql = new StringBuilder(); bool mark = true; List <OrderProjectItem> itemList = new List <OrderProjectItem>(); model.pName = GetProductName(model.busId, model.orderTypeId); //获取订单包含的业务 if (model.orderTypeId == 1) { itemList = GetProductItemId(model.oid); } if (model.orderTypeId != 1)//实物、京东、手机订单只更新状态 { AddDrawbackRec(model.oid, model.accid, model.pName, oper, 1, model.RealPayMoney, model.busQuantity, desc); } else { foreach (var item in itemList) { if (item.itemId == 3)//高级版处理 { mark = mark && AdvanceDrawback(model.accid, oper, item); } else if (item.itemId == 1)//短信处理 { mark = mark && SmsDrawback(model.accid, oper, item); } else { mark = mark && AppDrawback(model.accid, oper, item); } } } if (mark) { AddDrawbackRec(model.oid, model.accid, model.pName, oper, 1, model.RealPayMoney, model.busQuantity, desc); return(true); } else { return(false); } }
//public static OrderPartition GetOrderType(DateTime stDate, DateTime edDate) //{ // T_OrderInfoDAL dal = new T_OrderInfoDAL(); // return dal.GetOrderType(stDate, edDate); //} #region 退款处理 /// <summary> /// 处理退款逻辑 /// </summary> /// <param name="accid"></param> /// <param name="oper"></param> /// <param name="oid"></param> /// <param name="desc"></param> /// <returns></returns> public static bool DrawbackProcess(int accid, int oid, int oper, string desc) { T_OrderInfoDAL dal = new T_OrderInfoDAL(); //获取退款信息 DrawbackInfoModel drawbackModel = dal.GetDrawbackOrderInfo(oid); if (drawbackModel == null) { return(false);//获取订单信息出错 } else { if (dal.GeneralDrawbackProc(oper, desc, drawbackModel)) { return(dal.UpdateOrderStatus(drawbackModel.RealPayMoney, oid, accid)); } else { return(false); } } }