/// <summary> /// 系统直接发放或者收回用户积分 /// </summary> /// <param name="refundBalanceInfo"></param> private void TransferPointRefund(RefundBalanceInfo refundBalanceInfo) { int pointAmount = Convert.ToInt32(Decimal.Round(refundBalanceInfo.CashAmt.Value * pointExchangeRate, 0)); if (pointAmount != 0) { AdjustPointRequest transferPointInfo = new AdjustPointRequest() { CustomerSysNo = refundBalanceInfo.CustomerSysNo.Value, Point = pointAmount, PointType = (int)AdjustPointType.RefundCashToPoints, Memo = refundBalanceInfo.SysNo.ToString(), SOSysNo = refundBalanceInfo.OriginalSOSysNo, OperationType = AdjustPointOperationType.AddOrReduce }; ExternalDomainBroker.AdjustPoint(transferPointInfo); } }
/// <summary> /// 积分撤销操作 /// </summary> /// <param name="refundInfo"></param> private void AbandonPoint(RefundBalanceInfo refundBalanceInfo) { int pointAmount = refundBalanceInfo.PointAmt.Value; if (refundBalanceInfo.PointAmt > 0) { AdjustPointRequest itemPointInfo = new AdjustPointRequest() { CustomerSysNo = refundBalanceInfo.CustomerSysNo.Value, Point = pointAmount, PointType = (int)AdjustPointType.ReturnProductPoint, Memo = "RoBalanceRefundPointPart", SOSysNo = refundBalanceInfo.OriginalSOSysNo, Source = "RMA Domain", OperationType = AdjustPointOperationType.Abandon }; ExternalDomainBroker.AdjustPoint(itemPointInfo); } }
private void VoidTransferPostage2Point(RMARequestInfo request) { var customerRank = ExternalDomainBroker.GetCustomerRank(request.CustomerSysNo.Value); TriStatus?stat = null; DateTime oldMaxReceiveTime; if (!string.IsNullOrEmpty(AppSettingManager.GetSetting("RMA", "OldMaxReceiveTime"))) { oldMaxReceiveTime = DateTime.Parse(AppSettingManager.GetSetting("RMA", "OldMaxReceiveTime")); } else { oldMaxReceiveTime = DateTime.Parse("2010-2-23 10:00:00"); } if (request.ReceiveTime < oldMaxReceiveTime && (int)customerRank >= (int)CustomerRank.Golden) { request.PostageToPoint = 50; if (!(request.ShipViaCode.ToLower().Contains("ozzo") || request.ShipViaCode.ToLower().Contains("奥硕"))) { int point = 0 - request.PostageToPoint.Value; AdjustPointRequest adjustInfo = new AdjustPointRequest(); adjustInfo.CustomerSysNo = request.CustomerSysNo.Value; adjustInfo.Point = point; adjustInfo.PointType = (int)AdjustPointType.RMAPostageManuToPoints; adjustInfo.Source = "RMA"; adjustInfo.Memo = ResouceManager.GetMessageString("RMA.Request", "AdjustInfoMemo"); adjustInfo.OperationType = AdjustPointOperationType.Abandon; adjustInfo.SOSysNo = request.SysNo; ExternalDomainBroker.AdjustPoint(adjustInfo); } } else if (request.ShipViaCode == RMAConst.ShipVia_PostOffice && request.PostageToPoint.HasValue && request.PostageToPoint.Value > 0) { try { int re = ExternalDomainBroker.GetCustomerPointAddRequestStatus(request.SysNo.Value); stat = (TriStatus)re; } catch (BizException e) { //邮资转积分有可能关闭,此时将没有调整记录 if (string.Compare(e.Message, "Cannot find any matched AdjustPointRequest") == 0) { return; } else { throw e; } } if (stat != null && stat.Value == TriStatus.Origin) { ExternalDomainBroker.AbandonAdjustPointRequest(request.SysNo.Value); } } }