private static void SendMessage4SO(int soSysNO, IMaintainSOV31 service)
        {
            AuditSOSendMailV31 actionPara = new AuditSOSendMailV31()
            {
                Header = new Newegg.Oversea.Framework.Contract.MessageHeader()
                {
                    OperationUser    = new OperationUser(SendMailUserDisplayName, SendMailUserLoginName, SendMailStoreSourceDirectoryKey, SendMailCompanyCode),
                    CompanyCode      = SendMailCompanyCode,
                    StoreCompanyCode = SendMailStoreCompanyCode
                }
                ,
                Body = soSysNO
            };

            actionPara = service.AuditSOSendMail(actionPara);

            if (actionPara.Faults != null &&
                actionPara.Faults.Count > 0)
            {
                string tmpSendMessageException = actionPara.Faults[0].ErrorDescription + "\r\n" +
                                                 actionPara.Faults[0].ErrorDetail;
                throw (new Exception(tmpSendMessageException));
            }

            SOAutoAuditSendMessageDA.UpdateSO4PassAutoAuditSendMessage(soSysNO);
        }
Beispiel #2
0
        /// <summary>
        /// 作废订单
        /// </summary>
        /// <param name="soNumber"></param>
        public static void AbandonSO(int soNumber)
        {
            SOV31 msg = new SOV31()
            {
                Body = new SOMsg()
                {
                    SOMaster = new SOMasterMsg()
                    {
                        SystemNumber = soNumber
                    }
                },
                Header = ServiceAdapterHelper.ApplyMessageHeader()
            };


            IMaintainSOV31 service = ServiceBroker.FindService <IMaintainSOV31>();

            try
            {
                msg = service.SystemAbandonSO(msg);
                ServiceAdapterHelper.DealServiceFault(msg.Faults);
            }
            finally
            {
                ServiceBroker.DisposeService <IMaintainSOV31>(service);
            }
        }
        public static void SendMessage(JobContext jobContext)
        {
            BizLogFile = jobContext.Properties["BizLog"];
            //从配置文件中获取自动审核一次最多提取的单数
            TopCount = GetAutoAuditSendMessageTopCount();
            //从配置文件获取为邮件发送JOB中调用WCF服务时所使用到的信息
            GetAutoAuditSendMessageLoginInfo();
            //自动审单时审单人编号
            AuditUserSysNo = GetAutoAuditUserSysNo();

            List <int> sendMailSysNoList = SOAutoAuditSendMessageDA.GetSOList4Audit2SendMessage(TopCount, SendMailCompanyCode);

            if (sendMailSysNoList.Count > 0)
            {
                jobContext.Message += string.Format("共获取到{0}条附合条件的记录\r\n", sendMailSysNoList.Count);
                WriteLog(string.Format("共获取到{0}条附合条件的记录\r\n", sendMailSysNoList.Count));

                IMaintainSOV31 service      = ServiceBroker.FindService <IMaintainSOV31>();
                int            successCount = 0;
                try
                {
                    foreach (int x in sendMailSysNoList)
                    {
                        try
                        {
                            SendMessage4SO(x, service);
                            successCount++;
                            jobContext.Message += string.Format("已为审单通过成功发送邮件,单号:{0}\r\n", x);
                            WriteLog(string.Format("已为审单通过成功发送邮件,单号:{0}", x));
                        }
                        catch (Exception ex)
                        {
                            jobContext.Message += string.Format("发送邮件异常,单号:{0},异常:\r\n", x, ex.Message);
                            WriteLog(string.Format("发送邮件异常,单号:{0},异常:", x, ex.Message));
                        }
                    }
                }
                finally
                {
                    ServiceBroker.DisposeService <IMaintainSOV31>(service);
                }

                jobContext.Message += string.Format("执行结束,成功{0}条,失败{1}条\r\n",
                                                    successCount, sendMailSysNoList.Count - successCount);
                WriteLog(string.Format("执行结束,成功{0}条,失败{1}条\r\n",
                                       successCount, sendMailSysNoList.Count - successCount));
            }
            else
            {
                jobContext.Message += string.Format("没有附合条件的记录\r\n");
                WriteLog("没有附合条件的记录\r\n");
            }
        }
Beispiel #4
0
        /// <summary>
        /// 更新订单
        /// </summary>
        /// <param name="soSysNo"></param>
        public static void UpdateSO4GroupBuying(int soSysNo)
        {
            SimpleTypeDataContract <int> SysNo = new SimpleTypeDataContract <int>
            {
                Value  = soSysNo,
                Header = ServiceAdapterHelper.ApplyMessageHeader()
            };


            IMaintainSOV31 service = ServiceBroker.FindService <IMaintainSOV31>();

            try
            {
                DefaultDataContract msg = service.UpdateSO4GroupBuying(SysNo);
                ServiceAdapterHelper.DealServiceFault(msg.Faults);
            }
            finally
            {
                ServiceBroker.DisposeService <IMaintainSOV31>(service);
            }
        }
Beispiel #5
0
        public static void UpdateSO4GroupBuyingV2(int soSysNo, int gourpBuySysNo, int productSysNo)
        {
            SOGroupBuyAjustV31 message = new SOGroupBuyAjustV31()
            {
                Body = new SOGroupBuyAjustMsg(), Header = ServiceAdapterHelper.ApplyMessageHeader()
            };

            message.Body.SOSysNo       = soSysNo;
            message.Body.GroupBuySysNo = gourpBuySysNo;
            message.Body.ProductSysNo  = productSysNo;

            IMaintainSOV31 service = ServiceBroker.FindService <IMaintainSOV31>();

            try
            {
                DefaultDataContract msg = service.UpdateSO4GroupBuyingV2(message);
                ServiceAdapterHelper.DealServiceFault(msg.Faults);
            }
            finally
            {
                ServiceBroker.DisposeService <IMaintainSOV31>(service);
            }
        }