Beispiel #1
0
        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);
                }
            }
        }