Example #1
0
        public ActionResult Step04(Guid orderId)
        {
            ViewBag.orderId = orderId;

            var model = new OrderComplexModel();

            model.Order = this._IG_OrderService.GetByKey(orderId);
            if (string.IsNullOrWhiteSpace(model.Order.IDNo))
            {
                model.Factory = new Base_FactoryDTO();
                model.Stores  = new List <Base_StoreDTO>();
            }
            else
            {
                model.Factory = this._IBase_FactoryService.GetFactoryByCode(model.Order.IDNo) ?? new Base_FactoryDTO();
                model.Stores  = this._IBase_StoreService.GetStoreByCode(model.Order.IDNo);
            }

            return(View(model));
        }
Example #2
0
        public JsonResult CreateStores(OrderComplexModel order)
        {
            if (order == null ||
                order.Stores == null)
            {
                return(Json(new MessageResult {
                    Status = true
                }));
            }
            order.Order = this._IG_OrderService.GetByKey(order.OrderId);
            var listUpdate = new List <Base_StoreDTO>();

            foreach (var item in order.Stores)
            {
                if (string.IsNullOrWhiteSpace(item.Brand) &&
                    string.IsNullOrWhiteSpace(item.Industry) &&
                    string.IsNullOrWhiteSpace(item.Province) &&
                    string.IsNullOrWhiteSpace(item.City) &&
                    string.IsNullOrWhiteSpace(item.Mall) &&
                    string.IsNullOrWhiteSpace(item.Area) &&
                    string.IsNullOrWhiteSpace(item.BusinessLicenseImg)
                    )
                {
                    continue;
                }

                if (order.Order != null)
                {
                    item.IDNo = order.Order.IDNo;
                    //item.PersonalPhone = order.Order.PersonalPhone;
                    item.StoreName = order.Order.Name;
                }
                item.ModifiedBy = this.User.Id;
                if (item.Id != Guid.Empty)
                {
                    listUpdate.Add(item);
                }
                else
                {
                    item.CreatedBy = this.User.Id;
                    this._IBase_StoreService.Create(item);
                }
            }

            this._IBase_StoreService.Update(listUpdate);

            //更新订单状态:在处理
            var model = this._IG_OrderService.GetByKey(order.OrderId);

            //绑定金融客服
            //如果是新创建订单,则进行订单分配。
            if (string.IsNullOrWhiteSpace(order.Order.GoJiajuClerkCode))
            {
                //1、如果未填写推广码,则订单分配默认客服(艾博账号)
                if (string.IsNullOrWhiteSpace(model.ReferenceCode))
                {
                    var defaultAccount = System.Configuration.ConfigurationManager.AppSettings["default:account"].ToString();
                    model.GoJiajuClerkCode = defaultAccount;
                }
                else
                {
                    //2、如果填写推广码,则分配到该金融专员所在机构的金融客服账号
                    var referenceUser = this._IG_UserService.GetGojiajuClerkByReferenceCode(model.ReferenceCode);
                    if (referenceUser != null)
                    {
                        model.GoJiajuClerkCode = referenceUser.G_UserDetail.Code;
                    }
                    else
                    {
                        return(Json(new MessageResult {
                            Status = false, Message = "金融专员账号验证失败"
                        }));
                    }
                }
            }

            model.Status = Ingenious.Infrastructure.Enum.G_OrderStatusEnum.PreProcess;
            this._IG_OrderService.Update(new List <G_OrderDTO> {
                model
            });

            return(Json(new MessageResult {
                Status = true
            }));
        }