/// <summary> /// 更新备注 /// </summary> /// <param name="Id"></param> /// <param name="Remark"></param> /// <returns></returns> public Jinher.AMP.BTP.Deploy.CustomDTO.ResultDTO UpdateRemarkExt(System.Guid Id, string Remark) { var result = new ResultDTO { isSuccess = true }; try { ContextSession contextSession = ContextFactory.CurrentThreadContext; var couponRefundDetail = CouponRefundDetail.ObjectSet().Where(x => x.Id == Id).FirstOrDefault(); if (couponRefundDetail != null) { couponRefundDetail.Remark = Remark; } var count = contextSession.SaveChanges(); if (count <= 0) { result.isSuccess = false; } } catch (Exception ex) { result.isSuccess = false; } return(result); }
/// <summary> /// 售中退款时,回退用户易捷币和易捷抵用券 /// </summary> public static ResultDTO OrderRefund(ContextSession contextSession, CommodityOrder commodityOrder, OrderRefund orderRefund, decimal commodityPrice, Guid useryjcouponid) { if (commodityOrder.EsAppId != Jinher.AMP.YJB.Deploy.CustomDTO.YJBConsts.YJAppId) { return(ResultDTO.Successed); } //var result = YJBSV.RefundAllOrderJournal(commodityOrder.Id); //if (!result.IsSuccess) //{ // LogHelper.Error("售中退款时,回退用户易捷币失败,订单ID:" + commodityOrder.Id + ",错误内容:" + result.Message); // LogOrderErrorInfo(contextSession, commodityOrder, "售中退款时,回退用回退用户易捷币失败户易捷币"); //} //return result; #region 记录抵用券退款明细表 var orderitemorder = (from i in OrderItem.ObjectSet() where commodityOrder.Id == i.CommodityOrderId select i).ToList(); var user = CBCSV.GetUserNameAndCode(commodityOrder.UserId); foreach (var item in orderitemorder) { CouponRefundDetail couponRefundDetailDTO = new CouponRefundDetail(); couponRefundDetailDTO.Id = Guid.NewGuid(); couponRefundDetailDTO.SubTime = DateTime.Now; couponRefundDetailDTO.ModifiedOn = DateTime.Now; couponRefundDetailDTO.RefundTime = DateTime.Now; couponRefundDetailDTO.ReceiveAccount = user != null ? user.Item2 : ""; couponRefundDetailDTO.ReceiveName = user != null ? user.Item1 : ""; couponRefundDetailDTO.CommodityCouponMoney = commodityPrice; couponRefundDetailDTO.FreightCouponMoney = 0; couponRefundDetailDTO.CommodityRefundMoney = orderRefund.RefundMoney; couponRefundDetailDTO.FreightRefundMoney = orderRefund.RefundFreightPrice; couponRefundDetailDTO.RefundTotalMoney = commodityPrice + orderRefund.RefundMoney + orderRefund.RefundFreightPrice; couponRefundDetailDTO.ShopName = commodityOrder.AppName; couponRefundDetailDTO.OrderNo = commodityOrder.Code; couponRefundDetailDTO.CommoidtyName = item.Name; couponRefundDetailDTO.ReceivePhone = commodityOrder.ReceiptPhone; couponRefundDetailDTO.ConsigneeName = commodityOrder.ReceiptUserName; couponRefundDetailDTO.Remark = ""; couponRefundDetailDTO.EntityState = System.Data.EntityState.Added; contextSession.SaveObject(couponRefundDetailDTO); } contextSession.SaveChanges(); #endregion var mobile = user != null ? user.Item2 : ""; var result = YJBSV.RefundOrderJournal(commodityOrder.Id, orderRefund.RefundYJBMoney, commodityPrice, mobile, commodityOrder.UserId, useryjcouponid); if (!result.IsSuccess) { LogHelper.Error("售中退款时,回退用户易捷币失败,订单ID:" + commodityOrder.Id + ",错误内容:" + result.Message); LogOrderErrorInfo(contextSession, commodityOrder, "售中退款时,回退用回退用户易捷币失败户易捷币"); } return(result); }
public Jinher.AMP.BTP.Deploy.CustomDTO.ResultDTO <Jinher.AMP.BTP.Deploy.CustomDTO.ListResult <Jinher.AMP.BTP.Deploy.CouponRefundDetailDTO> > GetCouponRefundListExt(RefundCouponSearchDTO search) { try { var query = CouponRefundDetail.ObjectSet().Where(x => x.Id != Guid.Empty); if (!string.IsNullOrEmpty(search.OrderNo)) { query = query.Where(x => x.OrderNo == search.OrderNo); } if (!string.IsNullOrEmpty(search.ReceiveAccount)) { query = query.Where(x => x.ReceiveAccount == search.ReceiveAccount); } if (!string.IsNullOrEmpty(search.ReceiveName)) { query = query.Where(x => x.ReceiveName == search.ReceiveName); } if (!string.IsNullOrEmpty(search.RefundStartTime.ToString()) && search.RefundStartTime != DateTime.MinValue) { query = query.Where(x => x.RefundTime >= search.RefundStartTime); } if (!string.IsNullOrEmpty(search.RefundEndTime.ToString()) && search.RefundEndTime != DateTime.MinValue) { var endtime = search.RefundEndTime.AddDays(1); query = query.Where(x => x.RefundTime < endtime); } var count = query.Count(); var querydata = query.OrderByDescending(q => q.SubTime).Skip((search.PageIndex - 1) * search.PageSize).Take(search.PageSize).ToList(); var data = new BE.CouponRefundDetail().ToEntityDataList(querydata); return(new ResultDTO <ListResult <Jinher.AMP.BTP.Deploy.CouponRefundDetailDTO> > { isSuccess = true, Data = new ListResult <Jinher.AMP.BTP.Deploy.CouponRefundDetailDTO> { List = data, Count = count } }); } catch (Exception ex) { LogHelper.Error("CouponRefundBP.GetCouponRefundListExt 异常", ex); return(new ResultDTO <ListResult <Jinher.AMP.BTP.Deploy.CouponRefundDetailDTO> > { isSuccess = false, Data = null }); } }