示例#1
0
 public object PurchaseQueryApplyform(ApplyformQueryCondition condition, Pagination pagination)
 {
     try
     {
         if (condition.ApplyformType == ApplyformType.Refund || condition.ApplyformType == ApplyformType.Scrap)
         {
             if (!string.IsNullOrWhiteSpace(condition.RefundStatusText) && condition.RefundStatusText != "全部")
             {
                 var statues = Service.Order.StatusService.GetRoleRefundApplyformStatus(OrderRole.Purchaser).Where(s => s.Value == condition.RefundStatusText).Select(s => s.Key);
                 if (statues.Any())
                 {
                     condition.ApplyDetailStatus = 0;
                     foreach (var status in statues)
                     {
                         condition.ApplyDetailStatus |= (byte)status;
                     }
                 }
             }
         }
         else if (condition.ApplyformType == ApplyformType.Postpone)
         {
             if (!string.IsNullOrWhiteSpace(condition.PostponeStatusText) && condition.PostponeStatusText != "全部")
             {
                 var statues = Service.Order.StatusService.GetRolePostponeApplyformStatus(OrderRole.Purchaser).Where(s => s.Value == condition.PostponeStatusText).Select(s => s.Key);
                 if (statues.Any())
                 {
                     condition.ApplyDetailStatus = 0;
                     foreach (var status in statues)
                     {
                         condition.ApplyDetailStatus |= (byte)status;
                     }
                 }
             }
         }
         condition.Purchaser = CurrentCompany.CompanyId;
         var applyform = from item in Service.ApplyformQueryService.QueryApplyforms(condition, pagination)
                         select new
         {
             ApplyformId   = item.ApplyformId,
             ProductType   = item.ProductType.GetDescription(),
             PNR           = item.OriginalPNR.ToListString(),
             Voyage        = item.Flights.Join("<br />", f => string.Format("{0}-{1}", f.DepartureCity, f.ArrivalCity)),
             FlightInfo    = item.Flights.Join("<br />", f => string.Format("{0}{1}<br />{2} / {3}", f.Carrier, f.FlightNo, string.IsNullOrEmpty(f.Bunk) ? "-" : f.Bunk, getDiscountText(f.Discount))),
             TakeoffTime   = item.Flights.Join("<br />", f => f.TakeoffTime.ToString("yyyy-MM-dd<br />HH:mm")),
             Passenger     = item.Passengers.Join("<br />"),
             ApplyType     = item.ApplyformType,
             ApplyTypeText = item.ApplyformType.GetDescription(),
             Status        = GetProcessStatus(item, OrderRole.Purchaser),
             Applier       = item.ApplierAccount,
             AppliedTime   = item.AppliedTime.ToString("yyyy-MM-dd<br />HH:mm:ss")
         };
         return(new { Applyforms = applyform, Pagination = pagination });
     }
     catch (Exception ex)
     {
         LogService.SaveExceptionLog(ex);
         throw;
     }
 }
示例#2
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     if (valiate())
     {
         string companyId = hfdCompanyId.Value;
         if (!string.IsNullOrWhiteSpace(companyId))
         {
             CompanyDetailInfo companyDetail = CompanyService.GetCompanyDetail(Guid.Parse(companyId));
             if (companyDetail != null)
             {
                 var merchant = new MerchantDTO
                 {
                     AccountNo      = companyDetail.UserName,
                     AdministorName = companyDetail.Contact,
                     ContactPhone   = companyDetail.ContactPhone,
                     Email          = companyDetail.ContactEmail,
                     LegalPerson    = companyDetail.Contact,
                     LegalPhone     = companyDetail.ContactPhone,
                     LoginPassword  = companyDetail.UserPassword,
                     MerchantNo     = companyDetail.UserName,
                     Rate           = decimal.Parse(txtPosRate.Text.Trim()) / 100
                 };
                 if (companyDetail.AccountType == AccountBaseType.Individual)
                 {
                     merchant.CompanyName      = companyDetail.Contact + "分销";
                     merchant.OrganizationCode = "12345678-9";
                     merchant.LegalCarID       = companyDetail.CertNo;
                 }
                 else
                 {
                     merchant.CompanyName      = companyDetail.CompanyName;
                     merchant.OrganizationCode = companyDetail.OrginationCode;
                     merchant.LegalCarID       = txtContactCertNo.Text.Trim();
                 }
                 try
                 {
                     MerchantBaseService.MerchantOpening(merchant);
                     var item = new OperationLog(OperationModule.单位,
                                                 OperationType.Insert,
                                                 CurrentUser.UserName,
                                                 OperatorRole.Platform,
                                                 merchant.AccountNo,
                                                 string.Format("将账号{0}设为商户", merchant.AccountNo));
                     LogService.SaveOperationLog(item);
                     ShowMessage("设为商户成功");
                 }
                 catch (Exception ex)
                 {
                     ShowExceptionMessage(ex, "设为商户");
                 }
             }
         }
     }
 }
示例#3
0
 public object ProviderQueryApplyform(ApplyformQueryCondition condition, Pagination pagination)
 {
     try
     {
         if (condition.ApplyformType == ApplyformType.Refund || condition.ApplyformType == ApplyformType.Scrap)
         {
             if (!string.IsNullOrWhiteSpace(condition.RefundStatusText) && condition.RefundStatusText != "全部")
             {
                 var statues = Service.Order.StatusService.GetRoleRefundApplyformStatus(this.CurrentCompany.CompanyType == CompanyType.Provider ? OrderRole.Provider : OrderRole.Supplier).Where(s => s.Value == condition.RefundStatusText).Select(s => s.Key);
                 if (statues.Any())
                 {
                     condition.ApplyDetailStatus = 0;
                     foreach (var status in statues)
                     {
                         condition.ApplyDetailStatus |= (byte)status;
                     }
                 }
             }
         }
         if (this.CurrentCompany.CompanyType == CompanyType.Provider)
         {
             condition.Provider = CurrentCompany.CompanyId;
         }
         else
         {
             condition.Supplier = CurrentCompany.CompanyId;
         }
         var applyform = Service.ApplyformQueryService.ProviderQueryApplyforms(condition, pagination).Select(form => new
         {
             form.ApplyformId,
             PNR    = form.OriginalPNR == null ? string.Empty : form.OriginalPNR.ToListString(),
             Voyage = form.Flights.Join("<br />",
                                        f => string.Format("{0}-{1}", f.DepartureCity, f.ArrivalCity)),
             FlightInfo = form.Flights.Join("<br />",
                                            f => string.Format(
                                                "{0}{1}<br />{2} / {3}",
                                                f.Carrier,
                                                f.FlightNo,
                                                string.IsNullOrEmpty(f.Bunk) ? "-" : f.Bunk,
                                                getDiscountText
                                                    (f.Discount))),
             TakeoffTime = form.Flights.Join("<br />",
                                             f => f.TakeoffTime.ToString("yyyy-MM-dd<br />HH:mm")),
             Passenger = form.Passengers.Join("<br />"),
             ApplyType = form.ApplyformType.GetDescription(),
             form.ApplyformType,
             ProcessStatus = GetProcessStatus(form,
                                              CurrentCompany.CompanyType == CompanyType.Provider ? OrderRole.Provider : OrderRole.Supplier),
             AppliedTime = form.AppliedTime.ToString("yyyy-MM-dd<br />HH:mm"),
             form.ApplierAccount,
             ProductType = form.ProductType.GetDescription(),
             NeedProcess = form.ApplyformType == ApplyformType.BlanceRefund && ((BalanceRefundProcessStatus)form.ApplyDetailStatus == BalanceRefundProcessStatus.AppliedForProvider || (BalanceRefundProcessStatus)form.ApplyDetailStatus == BalanceRefundProcessStatus.DeniedByProviderTreasurer)
         });
         return(new { Applyforms = applyform, Pagination = pagination });
     }
     catch (Exception ex)
     {
         LogService.SaveExceptionLog(ex);
         throw;
     }
 }
示例#4
0
 public object QueryOEMApplyform(ApplyformQueryCondition condition, Pagination pagination)
 {
     try
     {
         var oem = ChinaPay.B3B.Service.Organization.OEMService.QueryOEM(CurrentCompany.CompanyId);
         if (oem == null)
         {
             throw new Exception("没有找到对应的oem信息");
         }
         condition.OEMID = oem.Id;
         if (condition.ApplyformType == ApplyformType.Refund || condition.ApplyformType == ApplyformType.Scrap)
         {
             if (!string.IsNullOrWhiteSpace(condition.RefundStatusText) && condition.RefundStatusText != "全部")
             {
                 var statues = Service.Order.StatusService.GetRoleRefundApplyformStatus(OrderRole.OEMOwner).Where(s => s.Value == condition.RefundStatusText).Select(s => s.Key);
                 if (statues.Any())
                 {
                     condition.ApplyDetailStatus = 0;
                     foreach (var status in statues)
                     {
                         condition.ApplyDetailStatus |= (byte)status;
                     }
                 }
             }
         }
         else if (condition.ApplyformType == ApplyformType.Postpone)
         {
             if (!string.IsNullOrWhiteSpace(condition.PostponeStatusText) && condition.PostponeStatusText != "全部")
             {
                 var statues = Service.Order.StatusService.GetRolePostponeApplyformStatus(OrderRole.OEMOwner).Where(s => s.Value == condition.PostponeStatusText).Select(s => s.Key);
                 if (statues.Any())
                 {
                     condition.ApplyDetailStatus = 0;
                     foreach (var status in statues)
                     {
                         condition.ApplyDetailStatus |= (byte)status;
                     }
                 }
             }
         }
         List <ApplyformListView> forms = ApplyformQueryService.QueryApplyforms(condition, pagination).ToList();
         var lockInfos = LockService.Query(forms.Select(form => form.ApplyformId.ToString())).ToList();
         var applyform = forms.Select(form =>
         {
             LockInfo lockInfo = lockInfos.FirstOrDefault(l => l.Key == form.ApplyformId.ToString());
             return(new
             {
                 form.ApplyformId,
                 PNR = form.OriginalPNR == null ? string.Empty : form.OriginalPNR.ToListString(),
                 Voyage = IEnumerableExtension.Join <FlightListView>(form.Flights, "<br />",
                                                                     f =>
                                                                     string.Format(
                                                                         "{0}{1}-{2}{3}",
                                                                         f.DepartureCity,
                                                                         f.DepartureAirport,
                                                                         f.ArrivalCity,
                                                                         f.ArrivalAirport)),
                 FlightInfo = form.Flights.Join("<br />", f => string.Format(
                                                    "{0}{1}<br />{2} / {3}",
                                                    f.Carrier,
                                                    f.FlightNo,
                                                    string.IsNullOrEmpty(f.Bunk) ? "-" : f.Bunk, getDiscountText
                                                        (f.Discount))),
                 TakeoffTime = form.Flights.Join("<br />", f =>
                                                 f.TakeoffTime.
                                                 ToString(
                                                     "yyyy-MM-dd<br />HH:mm")),
                 Passengers = String.Join("<br />", (IEnumerable <string>)form.Passengers),
                 ApplyTypeDesc = form.ApplyformType.GetDescription(),
                 ApplyType = form.ApplyformType,
                 ProcessStatus = GetProcessStatus(form, OrderRole.OEMOwner),
                 form.AppliedTime,
                 form.ApplierAccount,
                 ProductType = form.ProductType.GetDescription(),
                 LockInfo = lockInfo == null
                                ? string.Empty
                                : lockInfo.Company ==
                            CurrentCompany.CompanyId
                                      ? string.Format("{0}<br />{1}", lockInfo.Account, lockInfo.Name)
                                      : string.Format("{0}<br />({1})", lockInfo.LockRole.GetDescription(), lockInfo.Account),
                 RenderSupperUnLock = lockInfo != null,
                 RefundType = form.RefundType.HasValue ? form.RefundType.GetDescription() : string.Empty,
                 IsRefund = form.ApplyformType == ApplyformType.Refund,
                 EnableQueryPaymentInfo = form.ApplyformType == ApplyformType.Postpone && (PostponeApplyformStatus)form.ApplyDetailStatus == PostponeApplyformStatus.Agreed
             });
         });
         return(new { Applyforms = applyform, Pagination = pagination });
     }
     catch (Exception ex)
     {
         LogService.SaveExceptionLog(ex);
         throw;
     }
 }
示例#5
0
        /// <summary>
        /// 查询申请单支付状态,补单
        /// </summary>
        /// <param name="applyformId"></param>
        /// <returns></returns>
        public string QueryPaymentInfo(decimal applyformId)
        {
            bool paySuccess = false;
            var  applyform  = ApplyformQueryService.QueryApplyform(applyformId) as PostponeApplyform;

            if (applyform == null)
            {
                return("改期申请单不存在");
            }
            if (applyform.Status != PostponeApplyformStatus.Agreed)
            {
                return("OK");
            }
            try
            {
#if (DEBUG)
                var tradeResult = AccountTradeService.PayTradeQuery(applyformId.ToString());
                if (tradeResult == null)
                {
                    return("查询支付信息失败");
                }
                if (tradeResult.Status != PayStatus.PaySuccess)
                {
                    return("没有查询到支付成功信息");
                }
                var paramArray = tradeResult.CustomParameter.Split('|');
                if (paramArray.Length >= 3)
                {
                    var operatorAccount = paramArray[2];
                    ChinaPay.B3B.DataTransferObject.Common.PayInterface   payInterface   = ChinaPay.B3B.Service.Tradement.NotifyService.ParsePayInterface(tradeResult.payInterface);
                    ChinaPay.B3B.DataTransferObject.Common.PayAccountType payAccountType = ChinaPay.B3B.Service.Tradement.NotifyService.ParsePayAccountType(tradeResult.payAccountType);
                    ApplyformProcessService.PostponeFeePaySuccess(
                        applyform.Id,
                        tradeResult.AccountNo,
                        tradeResult.TradeNo,
                        tradeResult.FillChargeId.ToString(),//channelTradeNo
                        tradeResult.PayTime.Value,
                        payInterface,
                        payAccountType,
                        operatorAccount);
                    paySuccess = true;
                }
                LogService.SaveTradementLog(new TradementLog()
                {
                    OrderId     = applyform.OrderId,
                    ApplyformId = applyformId,
                    Type        = TradementBusinessType.SubPay,
                    Request     = string.Empty,
                    Response    = string.Empty,
                    Remark      = "改期支付补单",
                    Time        = DateTime.Now
                });
#else
                QueryPaymentProcess queryPayment = new QueryPaymentProcess(applyformId.ToString());
                if (queryPayment.Execute() && queryPayment.PaySuccess)
                {
                    var paramArray = queryPayment.ExtraParams.Split('|');
                    if (paramArray.Length >= 3)
                    {
                        var operatorAccount = paramArray[2];
                        ApplyformProcessService.PostponeFeePaySuccess(
                            applyform.Id,
                            queryPayment.PayAccount,
                            queryPayment.PayTradeNo,
                            queryPayment.ChannelTradeNo,
                            queryPayment.PayTime,
                            queryPayment.PayChannel,
                            queryPayment.PayAccountType,
                            operatorAccount);
                        paySuccess = true;
                    }
                    LogService.SaveTradementLog(new TradementLog()
                    {
                        OrderId     = applyform.OrderId,
                        ApplyformId = applyformId,
                        Type        = TradementBusinessType.SubPay,
                        Request     = string.Empty,
                        Response    = queryPayment.ExtraParams,
                        Remark      = "改期支付补单",
                        Time        = DateTime.Now
                    });
                }
                else
                {
                    return("查询支付信息失败");
                }
#endif
            }
            catch (Exception ex)
            {
                LogService.SaveExceptionLog(ex, "补单");
                paySuccess = false;
            }
            return(paySuccess?"OK":"ERROR");
        }
示例#6
0
 public object PlatformProcessApplyformNew(ApplyformQueryCondition condition, Pagination pagination)
 {
     try
     {
         if (condition.ApplyformType == ApplyformType.Refund || condition.ApplyformType == ApplyformType.Scrap)
         {
             if (!string.IsNullOrWhiteSpace(condition.RefundStatusText) && condition.RefundStatusText != "全部")
             {
                 var statues = Service.Order.StatusService.GetRoleRefundApplyformStatus(OrderRole.Platform).Where(s => s.Value == condition.RefundStatusText).Select(s => s.Key);
                 if (statues.Any())
                 {
                     condition.ApplyDetailStatus = 0;
                     foreach (var status in statues)
                     {
                         condition.ApplyDetailStatus |= (byte)status;
                     }
                 }
             }
         }
         else if (condition.ApplyformType == ApplyformType.Postpone)
         {
             if (!string.IsNullOrWhiteSpace(condition.PostponeStatusText) && condition.PostponeStatusText != "全部")
             {
                 var statues = Service.Order.StatusService.GetRolePostponeApplyformStatus(OrderRole.Platform).Where(s => s.Value == condition.PostponeStatusText).Select(s => s.Key);
                 if (statues.Any())
                 {
                     condition.ApplyDetailStatus = 0;
                     foreach (var status in statues)
                     {
                         condition.ApplyDetailStatus |= (byte)status;
                     }
                 }
             }
         }
         List <ApplyformListView> forms = ApplyformQueryService.PlatformQueryApplyformsForProcessNew(condition, pagination).ToList();
         var lockInfos = LockService.Query(forms.Select(form => form.ApplyformId.ToString())).ToList();
         var date      = DateTime.Now.ToString("yyMMdd");
         var applyform = forms.Select(form =>
         {
             LockInfo lockInfo = lockInfos.FirstOrDefault(l => l.Key == form.ApplyformId.ToString());
             return(new
             {
                 form.ApplyformId,
                 PNR = form.OriginalPNR == null ? string.Empty : form.OriginalPNR.ToListString(),
                 Voyage = form.Flights.Join("<br />",
                                            f =>
                                            string.Format(
                                                "{0}-{1}",
                                                f.DepartureCity,
                                                f.ArrivalCity)),
                 FlightInfo = form.Flights.Join("<br />",
                                                f => string.Format(
                                                    "{0}{1}<br />{2} / {3}",
                                                    f.Carrier,
                                                    f.FlightNo,
                                                    string.IsNullOrEmpty(f.Bunk) ? "-" : f.Bunk, getDiscountText
                                                        (f.Discount))),
                 TakeoffTime = form.Flights.Join("<br />",
                                                 f =>
                                                 f.TakeoffTime.ToString(
                                                     "yyyy-MM-dd<br />HH:mm")),
                 TakeoffTimeIsToday = form.Flights.Join("|", f => f.TakeoffTime.ToString("yyMMdd") == date ? "1" : "0"),
                 Passengers = string.Join("<br />", form.Passengers),
                 ApplyType = form.ApplyformType.GetDescription(),
                 ProcessStatus = form.ApplyformType == ApplyformType.Postpone ?
                                 Service.Order.StatusService.GetPostponeApplyformStatus((PostponeApplyformStatus)form.ApplyDetailStatus, OrderRole.Platform) :
                                 Service.Order.StatusService.GetRefundApplyformStatus((RefundApplyformStatus)form.ApplyDetailStatus, OrderRole.Platform),
                 AppliedTime =
                     form.AppliedTime.ToString("yyyy-MM-dd<br />HH:mm"),
                 form.ApplierAccount,
                 form.ApplyformType,
                 ProductType = form.ProductType.GetDescription(),
                 RefundType = form.RefundType.HasValue ? form.RefundType.GetDescription() : "",
                 form.RequireRevisePrice,
                 LockInfo = lockInfo == null
                                ? string.Empty
                                : lockInfo.Company ==
                            CurrentCompany.CompanyId
                                      ? string.Format("{0}<br />{1}", lockInfo.Account, lockInfo.Name)
                                      : string.Format("{0}<br />({1})", lockInfo.LockRole.GetDescription(),
                                                      lockInfo.Account)
             });
         });
         return(new { Applyforms = applyform, Pagination = pagination });
     }
     catch (Exception ex)
     {
         LogService.SaveExceptionLog(ex);
         throw;
     }
 }