Example #1
0
        public static void FailedGroupBuyProcess(ProductGroupBuyingEntity group)
        {
            //获取需要处理的订单号
            List <int> soSysNolist = SODA.GetSOSysNoListByReferenceSysno(group.SystemNumber, CompanyCode);

            Console.WriteLine(string.Format("团购号:{0}", group.SystemNumber));

            foreach (int soSysNo in soSysNolist)
            {
                Console.WriteLine(string.Format("订单:{0}", soSysNo));

                SOEntity soEntity = SODA.GetSOEntity(soSysNo, CompanyCode);


                //审核NetPay
                try
                {
                    if (ExistsNetPay(soSysNo))
                    {
                        AuditNetPay(soSysNo);

                        CreateAO(soSysNo);
                    }

                    AbandonSO(soSysNo);
                }
                catch (Exception ex)
                {
                    UpdateSOGroupBuyStatus(soSysNo, "F");
                    Dealfault(ex);
                    continue;
                }

                UpdateSOGroupBuyStatus(soSysNo, "S");

                SendFailedMail(soEntity, group);
            }

            //EndGroupBuying(group.SystemNumber);
        }
Example #2
0
        public static void FullGroupBuyProcess(ProductGroupBuyingEntity group)
        {
            List <int> soSysNolist = SODA.GetSOSysNoListByReferenceSysno(group.SystemNumber, CompanyCode);

            Console.WriteLine(string.Format("团购号:{0}", group.SystemNumber));

            foreach (int soSysNo in soSysNolist)
            {
                Console.WriteLine(string.Format("订单:{0}", soSysNo));

                SOEntity soEntity = SODA.GetSOEntity(soSysNo, CompanyCode);


                //更新订单
                try
                {
                    UpdateSO(soSysNo);

                    if (ExistsNetPay(soSysNo))
                    {
                        AuditNetPay(soSysNo);
                    }
                }
                catch (Exception ex)
                {
                    UpdateSOGroupBuyStatus(soSysNo, "F");
                    Dealfault(ex);
                    continue;
                }

                UpdateSOGroupBuyStatus(soSysNo, "S");
            }

            if (group.Status == "F")
            {
                //EndGroupBuying(group.SystemNumber);
            }
        }