Exemple #1
0
        private void CreateRecord(G_OrderDTO order, G_OrderStatusEnum status, string remark = "")
        {
            var record = new G_OrderRecordDTO();

            record.OrderId     = order.Id;
            record.CreatedBy   = record.ModifiedBy = this.User.Id;
            record.CreatedDate = record.ModifiedDate = DateTime.Now;
            record.Remark      = remark;
            record.Status      = status;
            record.UserCode    = this.User.G_UserDetail.Code;
            record.UserId      = this.User.Id;
            this._IG_OrderRecordService.Create(record);
        }
        private void CreateRecord(Guid orderId, string remark, G_OrderStatusEnum status)
        {
            var orderRecord = new G_OrderRecordDTO
            {
                CreatedBy  = this.User.Id,
                ModifiedBy = this.User.Id,
                Status     = status,
                OrderId    = orderId,
                Remark     = remark,
                UserId     = this.User.Id,
            };

            this._IG_OrderRecordService.Create(orderRecord);
        }
 public G_OrderRecordDTO Create(G_OrderRecordDTO dto)
 {
     return(base.F_Create <G_OrderRecordDTO, G_OrderRecord>(dto
                                                            , _IG_OrderRecordRepository
                                                            , dtoAction => { }));
 }
Exemple #4
0
        private void CreateMessage(G_OrderDTO order, G_OrderRecordDTO record)
        {
            var message = new G_ActivityDTO();

            switch (order.Status)
            {
            case G_OrderStatusEnum.InProcess:
            {
                message.Title       = "您有一笔新订单提交成功!";
                message.Content     = string.Format("订单号:<a code='{0}'>{1}</a><br/>状态:待审核", order.Id, order.Code);
                message.IsGlobal    = false;
                message.IsRead      = false;
                message.ReferenceId = this.User.Id;
                message.CreatedBy   = message.ModifiedBy = this.User.Id;
                this._IG_ActivityService.Create(message);

                var user = this._IG_UserDetailService.GetUserDetailByCode(order.GoJiajuClerkCode);
                if (user != null)
                {
                    message.Title       = "您有一笔新订单待处理!";  //平台
                    message.Content     = string.Format("订单号:<a code='{0}'>{1}</a><br/>状态:待审核", order.Id, order.Code);
                    message.ReferenceId = user.G_UserId;
                    this._IG_ActivityService.Create(message);
                }
            }
            break;

            case G_OrderStatusEnum.GojiajuDenied:
            {
                message.Title       = "您有一笔订单未通过平台审核!";
                message.Content     = string.Format("订单号:<a code='{0}'>{1}</a><br/>状态:平台拒绝<br/>备注:{2}", order.Id, order.Code, record.Remark);
                message.IsGlobal    = false;
                message.IsRead      = false;
                message.ReferenceId = order.CreatedBy;        //订单所有人
                message.CreatedBy   = message.ModifiedBy = this.User.Id;
                this._IG_ActivityService.Create(message);

                message.Title       = "您拒绝了一笔订单申请!";
                message.Content     = string.Format("订单号:<a code='{0}'>{1}</a><br/>状态:平台拒绝", order.Id, order.Code);
                message.ReferenceId = this.User.Id;
                this._IG_ActivityService.Create(message);
            }
            break;

            case G_OrderStatusEnum.GojiajuPassed:
            {
                message.Title       = "您有一笔订单通过平台审核!";
                message.Content     = string.Format("订单号:<a code='{0}'>{1}</a><br/>状态:平台通过<br/>", order.Id, order.Code);
                message.IsGlobal    = false;
                message.IsRead      = false;
                message.ReferenceId = order.CreatedBy;        //订单所有人
                message.CreatedBy   = message.ModifiedBy = this.User.Id;
                this._IG_ActivityService.Create(message);

                message.Title       = "您通过了一笔订单申请!";
                message.Content     = string.Format("订单号:<a code='{0}'>{1}</a><br/>状态:平台通过", order.Id, order.Code);
                message.ReferenceId = this.User.Id;        //平台
                this._IG_ActivityService.Create(message);

                var bankManager = this._IG_UserDetailService.GetUserDetailByCode(order.BankManager);
                if (bankManager != null)
                {
                    message.Title       = "您有一笔订单待处理!";  //银行信贷经理
                    message.Content     = string.Format("订单号:<a code='{0}'>{1}</a><br/>状态:平台通过", order.Id, order.Code);
                    message.ReferenceId = bankManager.G_UserId;
                    this._IG_ActivityService.Create(message);
                }

                var bankClient = this._IG_UserDetailService.GetUserDetailByCode(order.BankManager);
                if (bankClient != null)
                {
                    message.Title       = "您有一笔订单待处理!";  //银行客户经理
                    message.Content     = string.Format("订单号:<a code='{0}'>{1}</a><br/>状态:平台通过", order.Id, order.Code);
                    message.ReferenceId = bankManager.G_UserId;
                    this._IG_ActivityService.Create(message);
                }
            }
            break;

            case G_OrderStatusEnum.BankDenied:
            {
                message.Title       = "您有一笔订单未通过银行审核!";
                message.Content     = string.Format("订单号:<a code='{0}'>{1}</a><br/>状态:银行拒绝<br/>备注:{2}", order.Id, order.Code, record.Remark);
                message.IsGlobal    = false;
                message.IsRead      = false;
                message.ReferenceId = order.CreatedBy;        //订单所有人
                message.CreatedBy   = message.ModifiedBy = this.User.Id;
                this._IG_ActivityService.Create(message);

                message.Title       = "您拒绝了一笔订单申请!";  //银行
                message.Content     = string.Format("订单号:<a code='{0}'>{1}</a><br/>状态:银行拒绝<br/>备注:{2}", order.Id, order.Code, record.Remark);
                message.ReferenceId = this.User.Id;
                this._IG_ActivityService.Create(message);

                var user = this._IG_UserDetailService.GetUserDetailByCode(order.GoJiajuClerkCode);
                if (user != null)
                {
                    message.Title       = "您有一笔订单未通过银行审核!";  //平台
                    message.Content     = string.Format("订单号:<a code='{0}'>{1}</a><br/>状态:银行拒绝<br/>备注:{2}", order.Id, order.Code, record.Remark);
                    message.ReferenceId = user.G_UserId;
                    this._IG_ActivityService.Create(message);
                }
            }
            break;

            case G_OrderStatusEnum.BankPassed:
            {
                message.Title       = "您有一笔订单通过银行审核!";
                message.Content     = string.Format("订单号:<a code='{0}'>{1}</a><br/>状态:银行通过", order.Id, order.Code);
                message.IsGlobal    = false;
                message.IsRead      = false;
                message.ReferenceId = order.CreatedBy;        //订单所有人
                message.CreatedBy   = message.ModifiedBy = this.User.Id;
                this._IG_ActivityService.Create(message);

                message.Title       = "您通过了一笔订单申请!";  //银行
                message.Content     = string.Format("订单号:<a code='{0}'>{1}</a><br/>状态:银行通过", order.Id, order.Code);
                message.ReferenceId = this.User.Id;
                this._IG_ActivityService.Create(message);

                var user = this._IG_UserDetailService.GetUserDetailByCode(order.GoJiajuClerkCode);
                if (user != null)
                {
                    message.Title       = "您有一笔订单通过银行审核!";  //平台
                    message.Content     = string.Format("订单号:<a code='{0}'>{1}</a><br/>状态:银行通过", order.Id, order.Code);
                    message.ReferenceId = user.G_UserId;
                    this._IG_ActivityService.Create(message);
                }
            }
            break;

            case G_OrderStatusEnum.BankSigned:
            {
                message.Title       = "您有一笔订单签约成功!";
                message.Content     = string.Format("订单号:<a code='{0}'>{1}</a><br/>状态:银行拒绝<br/>备注:{2}", order.Id, order.Code, record.Remark);
                message.IsGlobal    = false;
                message.IsRead      = false;
                message.ReferenceId = order.CreatedBy;        //订单所有人
                message.CreatedBy   = message.ModifiedBy = this.User.Id;
                this._IG_ActivityService.Create(message);

                message.Title       = "您签约了一笔订单申请!";  //银行
                message.Content     = string.Format("订单号:<a code='{0}'>{1}</a><br/>状态:银行拒绝<br/>备注:{2}", order.Id, order.Code, record.Remark);
                message.ReferenceId = this.User.Id;
                this._IG_ActivityService.Create(message);

                var user = this._IG_UserDetailService.GetUserDetailByCode(order.GoJiajuClerkCode);
                if (user != null)
                {
                    message.Title       = "您有一笔订单签约成功!";  //平台
                    message.Content     = string.Format("订单号:<a code='{0}'>{1}</a><br/>状态:银行拒绝<br/>备注:{2}", order.Id, order.Code, record.Remark);
                    message.ReferenceId = user.G_UserId;
                    this._IG_ActivityService.Create(message);
                }
            }
            break;

            case G_OrderStatusEnum.SignCanceled:
            {
                message.Title       = "您有一笔订单签约取消!";
                message.Content     = string.Format("订单号:<a code='{0}'>{1}</a><br/>状态:银行拒绝<br/>备注:{2}", order.Id, order.Code, record.Remark);
                message.IsGlobal    = false;
                message.IsRead      = false;
                message.ReferenceId = order.CreatedBy;        //订单所有人
                message.CreatedBy   = message.ModifiedBy = this.User.Id;
                this._IG_ActivityService.Create(message);

                message.Title       = "您取消了一笔订单签约!";  //银行
                message.Content     = string.Format("订单号:<a code='{0}'>{1}</a><br/>状态:银行拒绝<br/>备注:{2}", order.Id, order.Code, record.Remark);
                message.ReferenceId = this.User.Id;
                this._IG_ActivityService.Create(message);

                var user = this._IG_UserDetailService.GetUserDetailByCode(order.GoJiajuClerkCode);
                if (user != null)
                {
                    message.Title       = "您有一笔订单签约取消!";  //平台
                    message.Content     = string.Format("订单号:<a code='{0}'>{1}</a><br/>状态:银行拒绝<br/>备注:{2}", order.Id, order.Code, record.Remark);
                    message.ReferenceId = user.G_UserId;
                    this._IG_ActivityService.Create(message);
                }
            }
            break;

            case G_OrderStatusEnum.Successed:
            {
                message.Title       = "您有一笔订单放款成功!";
                message.Content     = string.Format("订单号:<a code='{0}'>{1}</a><br/>状态:已放款<br/>申请金额:{2}<br/>实际放款:{3}万", order.Id, order.Code, order.LoanAmount, order.GotLoanAmount);
                message.IsGlobal    = false;
                message.IsRead      = false;
                message.ReferenceId = order.CreatedBy;        //订单所有人
                message.CreatedBy   = message.ModifiedBy = this.User.Id;
                this._IG_ActivityService.Create(message);

                message.Title       = "您有一笔订单放款成功!";  //银行
                message.Content     = string.Format("订单号:<a code='{0}'>{1}</a><br/>状态:已放款<br/>申请金额:{2}<br/>实际放款:{3}万", order.Id, order.Code, order.LoanAmount, order.GotLoanAmount);
                message.ReferenceId = this.User.Id;
                this._IG_ActivityService.Create(message);

                var user = this._IG_UserDetailService.GetUserDetailByCode(order.GoJiajuClerkCode);
                if (user != null)
                {
                    message.Title       = "您有一笔订单放款成功!";  //平台
                    message.Content     = string.Format("订单号:<a code='{0}'>{1}</a><br/>状态:已放款<br/>申请金额:{2}<br/>实际放款:{3}万", order.Id, order.Code, order.LoanAmount, order.GotLoanAmount);
                    message.ReferenceId = user.G_UserId;
                    this._IG_ActivityService.Create(message);
                }
            }
            break;

            case G_OrderStatusEnum.Canceled:
            {
            }
            break;
            }
        }