Exemple #1
0
        /// <summary>
        /// 发送邮件和短信
        /// </summary>
        /// <param name="soInfo">订单实体</param>
        /// <param name="IsManagerAuditSO">是否主管审核</param>
        /// <param name="isPaySO"></param>
        public virtual void SendMessage(SOInfo soInfo, bool IsManagerAuditSO, bool isPaySO, bool isAutoAudit)
        {
            var soStatus = soInfo.BaseInfo.Status;
            SOSendMessageProcessor soSendMessage = new SOSendMessageProcessor();

            if (soStatus == SOStatus.WaitingOutStock ||
                soStatus == SOStatus.OutStock)
            {
                ProcessSO(new SOAction.SOCommandInfo {
                    Command = SOAction.SOCommand.Split, SOInfo = soInfo, Parameter = new object[] { isAutoAudit }
                });
            }

            //电子卡订单出库发送shipping消息
            if (soInfo.BaseInfo.Status == SOStatus.OutStock &&
                soInfo.BaseInfo.SOType == SOType.ElectronicCard)
            {
                SODA.CreateEGiftCardOrderInvoice(Convert.ToInt32(soInfo.SysNo));
            }

            if (soInfo.BaseInfo.Status == SOStatus.WaitingOutStock)
            {
                soSendMessage.SOAuditedSendEmailToCustomer(soInfo);
                // 并单不发消息
                if (soInfo.ShippingInfo.IsCombine == true)
                {
                    soSendMessage.SendSMS(soInfo, SMSType.OrderAudit);
                }
            }

            if (!isPaySO)
            {
                SOLogProcessor soLog = new SOLogProcessor();
                if (!IsManagerAuditSO)
                {
                    // 如果是主管审核,判断产品价格是否改动,如果改动就发送邮件给相应PM
                    if (soInfo.BaseInfo.IsWholeSale == true)
                    {
                        soSendMessage.PriceChangedSendMail(soInfo);
                    }
                    soLog.WriteSOLog(BizEntity.Common.BizLogType.Sale_SO_Audit, "订单主管审核", soInfo);
                }
                else
                {
                    soLog.WriteSOLog(BizEntity.Common.BizLogType.Sale_SO_Audit, "订单审核", soInfo);
                }
            }
        }