From b832c57ca7f48fb8dd53f12a54737b391fbe8ead Mon Sep 17 00:00:00 2001 From: shanj <18996038927@163.com> Date: Sun, 5 Jun 2022 03:14:19 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=AE=A1=E8=AE=A1=E5=A4=87=E6=B3=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BBWY.Client/APIServices/PurchaseOrderService.cs | 4 ++++ .../ProcurementAudit/AuditPayBill.cs | 2 ++ .../FinancialTerminal/ProcurementAuditViewModel.cs | 9 +++++---- .../Purchase/1688PreviewPurchaseViewModel.cs | 1 + .../Views/FinancialTerminal/ProcurementAudit.xaml | 11 ++++++++++- BBWY.Client/Views/MainWindow.xaml | 2 +- .../PurchaseOrder/PurchaseOrderBusiness.cs | 3 ++- BBWY.Server.Model/Db/PurchaseOrder/PurchaseOrder.cs | 6 ++++++ .../CreateOnlinePurchaseOrderRequest.cs | 6 ++++++ BBWY.Server.Model/Enums.cs | 3 ++- 10 files changed, 39 insertions(+), 8 deletions(-) diff --git a/BBWY.Client/APIServices/PurchaseOrderService.cs b/BBWY.Client/APIServices/PurchaseOrderService.cs index d9a4ef0a..0e9d964e 100644 --- a/BBWY.Client/APIServices/PurchaseOrderService.cs +++ b/BBWY.Client/APIServices/PurchaseOrderService.cs @@ -94,6 +94,8 @@ namespace BBWY.Client.APIServices /// /// /// + /// + /// /// public ApiResponse FastCreateOrder(Consignee consignee, IList purchaseSchemeProductSkuList, @@ -107,6 +109,7 @@ namespace BBWY.Client.APIServices long purchaseAccountId, string buyerAccount, string sellerAccount, + string purchaserId, decimal platformCommissionRatio) { return SendRequest(globalContext.BBYWApiHost, "api/purchaseOrder/NewFastCreateOrder", new @@ -133,6 +136,7 @@ namespace BBWY.Client.APIServices purchaseAccountId, buyerAccount, sellerAccount, + purchaserId, platformCommissionRatio }, null, HttpMethod.Post); } diff --git a/BBWY.Client/Models/FinancialTerminal/ProcurementAudit/AuditPayBill.cs b/BBWY.Client/Models/FinancialTerminal/ProcurementAudit/AuditPayBill.cs index 4c6cdbc4..abf9e715 100644 --- a/BBWY.Client/Models/FinancialTerminal/ProcurementAudit/AuditPayBill.cs +++ b/BBWY.Client/Models/FinancialTerminal/ProcurementAudit/AuditPayBill.cs @@ -69,5 +69,7 @@ namespace BBWY.Client.Models /// public string ErrorMessage { get; set; } + public string Remark { get; set; } + } } diff --git a/BBWY.Client/ViewModels/FinancialTerminal/ProcurementAuditViewModel.cs b/BBWY.Client/ViewModels/FinancialTerminal/ProcurementAuditViewModel.cs index 56c3174a..abbc036b 100644 --- a/BBWY.Client/ViewModels/FinancialTerminal/ProcurementAuditViewModel.cs +++ b/BBWY.Client/ViewModels/FinancialTerminal/ProcurementAuditViewModel.cs @@ -200,7 +200,7 @@ namespace BBWY.Client.ViewModels }; IsLoading = true; var shopList = SelectedDepartment.ShopList.Where(s => s.IsSelected).ToList(); - var sDate = StartDate; + var sDate = StartDate.AddDays(-5); var eDate = EndDate; Task.Factory.StartNew(() => { @@ -408,8 +408,8 @@ namespace BBWY.Client.ViewModels { var array = line.CSVstrToArry(); var sourceMerchantOrderNo = array[2].FormatString(); - if (!string.IsNullOrEmpty(sourceMerchantOrderNo) && sourceMerchantOrderNo.StartsWith("XP")) - continue; //暂时不支持此类商户单号 + //if (!string.IsNullOrEmpty(sourceMerchantOrderNo)) + // continue; //暂时不支持此类商户单号 var expenditureAmount = decimal.Parse(array[7].FormatString()); if (expenditureAmount == 0) //支出为0的账单不参与审计 @@ -426,7 +426,8 @@ namespace BBWY.Client.ViewModels ProductName = array[3].FormatString(), PayTime = DateTime.Parse(array[4].FormatString()), OppositeAccount = array[5].FormatString(), - ExpenditureAmount = Math.Abs(expenditureAmount) + ExpenditureAmount = Math.Abs(expenditureAmount), + Remark = array[11] }; payBill.MerchantOrderNo = payBill.SourceMerchantOrderNo; if (payBill.SourceMerchantOrderNo.StartsWith("T50060NP")) diff --git a/BBWY.Client/ViewModels/Purchase/1688PreviewPurchaseViewModel.cs b/BBWY.Client/ViewModels/Purchase/1688PreviewPurchaseViewModel.cs index 8b2a825a..9714d59e 100644 --- a/BBWY.Client/ViewModels/Purchase/1688PreviewPurchaseViewModel.cs +++ b/BBWY.Client/ViewModels/Purchase/1688PreviewPurchaseViewModel.cs @@ -320,6 +320,7 @@ namespace BBWY.Client.ViewModels purchaseAccount.Id, purchaseAccount.AccountName, purchaseSchemeList[0].PurchaserName, + purchaser.Id, globalContext.User.Shop.PlatformCommissionRatio ?? 0.05M)).ContinueWith(t => { IsLoading = false; diff --git a/BBWY.Client/Views/FinancialTerminal/ProcurementAudit.xaml b/BBWY.Client/Views/FinancialTerminal/ProcurementAudit.xaml index 47c8158c..9c2d9661 100644 --- a/BBWY.Client/Views/FinancialTerminal/ProcurementAudit.xaml +++ b/BBWY.Client/Views/FinancialTerminal/ProcurementAudit.xaml @@ -156,10 +156,19 @@ - + + + + + + + + + diff --git a/BBWY.Client/Views/MainWindow.xaml b/BBWY.Client/Views/MainWindow.xaml index b147d247..3cbac7b1 100644 --- a/BBWY.Client/Views/MainWindow.xaml +++ b/BBWY.Client/Views/MainWindow.xaml @@ -26,7 +26,7 @@ - + diff --git a/BBWY.Server.Business/PurchaseOrder/PurchaseOrderBusiness.cs b/BBWY.Server.Business/PurchaseOrder/PurchaseOrderBusiness.cs index 54a5f0f6..dcaacd6c 100644 --- a/BBWY.Server.Business/PurchaseOrder/PurchaseOrderBusiness.cs +++ b/BBWY.Server.Business/PurchaseOrder/PurchaseOrderBusiness.cs @@ -308,7 +308,8 @@ namespace BBWY.Server.Business SingleOperationAmount = 0, SingleSkuAmount = currentOrderSkuProductAmount / orderSku.ItemTotal.Value, SingleFreight = currentOrderSkuFreightAmount / orderSku.ItemTotal.Value, - StorageType = Enums.StorageType.代发 + StorageType = Enums.StorageType.代发, + PurchaserId = createOnlinePurchaseOrderRequest.PurchaserId }; insertPurchaseOrders.Add(purchaseOrder); #endregion diff --git a/BBWY.Server.Model/Db/PurchaseOrder/PurchaseOrder.cs b/BBWY.Server.Model/Db/PurchaseOrder/PurchaseOrder.cs index 6acfa8f2..50bcb946 100644 --- a/BBWY.Server.Model/Db/PurchaseOrder/PurchaseOrder.cs +++ b/BBWY.Server.Model/Db/PurchaseOrder/PurchaseOrder.cs @@ -82,6 +82,12 @@ namespace BBWY.Server.Model.Db public long? ShopId { get; set; } + /// + /// 采购商Id + /// + [Column(StringLength = 20)] + public string PurchaserId { get; set; } + /// /// 单件Sku成本 /// diff --git a/BBWY.Server.Model/Dto/Request/PurchaseOrder/OnlinePurchase/CreateOnlinePurchaseOrderRequest.cs b/BBWY.Server.Model/Dto/Request/PurchaseOrder/OnlinePurchase/CreateOnlinePurchaseOrderRequest.cs index 5854ff12..6fee8dd6 100644 --- a/BBWY.Server.Model/Dto/Request/PurchaseOrder/OnlinePurchase/CreateOnlinePurchaseOrderRequest.cs +++ b/BBWY.Server.Model/Dto/Request/PurchaseOrder/OnlinePurchase/CreateOnlinePurchaseOrderRequest.cs @@ -35,5 +35,11 @@ public string SellerAccount { get; set; } public decimal PlatformCommissionRatio { get; set; } + + + /// + /// 采购商Id + /// + public string PurchaserId { get; set; } } } diff --git a/BBWY.Server.Model/Enums.cs b/BBWY.Server.Model/Enums.cs index 6e767a6f..4b485901 100644 --- a/BBWY.Server.Model/Enums.cs +++ b/BBWY.Server.Model/Enums.cs @@ -10,7 +10,8 @@ 淘宝 = 0, 京东 = 1, 阿里巴巴 = 2, - 拼多多 = 3 + 拼多多 = 3, + 微信 = 4 } /// From c460efa57c016c57dc0e1dff8c675ffef89c8e4d Mon Sep 17 00:00:00 2001 From: shanj <18996038927@163.com> Date: Sun, 5 Jun 2022 03:37:29 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E9=9D=9E=E8=B4=A2=E5=8A=A1=E9=83=A8?= =?UTF-8?q?=E4=B8=8D=E6=98=BE=E7=A4=BA=E8=B4=A2=E5=8A=A1=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BBWY.Client/ViewModels/MainViewModel.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/BBWY.Client/ViewModels/MainViewModel.cs b/BBWY.Client/ViewModels/MainViewModel.cs index f4ae849b..c818b72f 100644 --- a/BBWY.Client/ViewModels/MainViewModel.cs +++ b/BBWY.Client/ViewModels/MainViewModel.cs @@ -148,10 +148,20 @@ namespace BBWY.Client.ViewModels GlobalContext.User = mdsUserResponse.Data.Map(); #if RELEASE if (GlobalContext.User.TeamName == "财务部") + { App.Current.Dispatcher.Invoke(() => { for (var i = 0; i < 3; i++) { MenuList.RemoveAt(0); } }); + } + else + { + App.Current.Dispatcher.Invoke(() => + { + MenuList.RemoveAt(MenuList.Count() - 1); + }); + } + #endif //请求用户信息接口 From 1a17e3575c3ed41edd854ec2e81e00d90b9c4b35 Mon Sep 17 00:00:00 2001 From: shanj <18996038927@163.com> Date: Wed, 8 Jun 2022 05:59:51 +0800 Subject: [PATCH 3/3] 1 --- .../APIModel/Response/Shop/ShopResponse.cs | 4 ++ BBWY.Client/Models/Shop/Department2.cs | 18 ++++++ BBWY.Client/Models/Shop/Shop.cs | 4 ++ BBWY.Client/Models/User/User.cs | 7 ++- BBWY.Client/ViewModels/MainViewModel.cs | 37 +++++++++++-- BBWY.Client/Views/SelectShop.xaml | 55 +++++++++++++++++++ BBWY.Client/Views/SelectShop.xaml.cs | 36 ++++++++++++ 7 files changed, 156 insertions(+), 5 deletions(-) create mode 100644 BBWY.Client/Models/Shop/Department2.cs create mode 100644 BBWY.Client/Views/SelectShop.xaml create mode 100644 BBWY.Client/Views/SelectShop.xaml.cs diff --git a/BBWY.Client/Models/APIModel/Response/Shop/ShopResponse.cs b/BBWY.Client/Models/APIModel/Response/Shop/ShopResponse.cs index c76b1d4c..29c6e1a0 100644 --- a/BBWY.Client/Models/APIModel/Response/Shop/ShopResponse.cs +++ b/BBWY.Client/Models/APIModel/Response/Shop/ShopResponse.cs @@ -25,5 +25,9 @@ namespace BBWY.Client.Models public string ManagePwd { get; set; } public decimal? PlatformCommissionRatio { get; set; } + + public string TeamId { get; set; } + + public string TeamName { get; set; } } } diff --git a/BBWY.Client/Models/Shop/Department2.cs b/BBWY.Client/Models/Shop/Department2.cs new file mode 100644 index 00000000..6163dfac --- /dev/null +++ b/BBWY.Client/Models/Shop/Department2.cs @@ -0,0 +1,18 @@ +using System.Collections.Generic; + +namespace BBWY.Client.Models +{ + public class Department2 + { + public string Id { get; set; } + + public string Name { get; set; } + + public IList ShopList { get; set; } + + public Department2() + { + ShopList = new List(); + } + } +} diff --git a/BBWY.Client/Models/Shop/Shop.cs b/BBWY.Client/Models/Shop/Shop.cs index ccb3db65..58823ec3 100644 --- a/BBWY.Client/Models/Shop/Shop.cs +++ b/BBWY.Client/Models/Shop/Shop.cs @@ -36,5 +36,9 @@ namespace BBWY.Client.Models /// 店铺扣点 /// public decimal? PlatformCommissionRatio { get; set; } + + public string TeamId { get; set; } + + public string TeamName { get; set; } } } diff --git a/BBWY.Client/Models/User/User.cs b/BBWY.Client/Models/User/User.cs index f7c45709..e782f434 100644 --- a/BBWY.Client/Models/User/User.cs +++ b/BBWY.Client/Models/User/User.cs @@ -1,4 +1,7 @@ -namespace BBWY.Client.Models +using System.Collections.Generic; +using System.Collections.ObjectModel; + +namespace BBWY.Client.Models { public class User : NotifyObject { @@ -20,5 +23,7 @@ public string TeamName { get; set; } public Shop Shop { get => shop; set { Set(ref shop, value); } } + + public IList DepartmentList { get; set; } } } diff --git a/BBWY.Client/ViewModels/MainViewModel.cs b/BBWY.Client/ViewModels/MainViewModel.cs index c818b72f..e2b6e278 100644 --- a/BBWY.Client/ViewModels/MainViewModel.cs +++ b/BBWY.Client/ViewModels/MainViewModel.cs @@ -1,5 +1,6 @@ using BBWY.Client.APIServices; using BBWY.Client.Models; +using BBWY.Client.Views; using BBWY.Common.Extensions; using BBWY.Common.Http; using BBWY.Common.Models; @@ -188,16 +189,44 @@ namespace BBWY.Client.ViewModels var shopList = shopListResponse.Data.Map>(); if (shopList.Count == 1) { + ShowShopChoosePanel = false; ChooseShop(shopList[0], true); } else { + ShowShopChoosePanel = true; + IList department2s = new List(); + foreach (var shop in shopList) + { + var department = department2s.FirstOrDefault(d => d.Id == shop.TeamId); + if (department == null) + { + department = new Department2() { Id = shop.TeamId, Name = shop.TeamName }; + department2s.Add(department); + } + department.ShopList.Add(shop); + } + GlobalContext.User.DepartmentList = department2s; + App.Current.Dispatcher.Invoke(() => { - foreach (var s in shopList) - ShopList.Add(s); + var selectShop = new SelectShop(department2s); + if (selectShop.ShowDialog() == true) + { + ChooseShop(selectShop.Shop, true); + } + else + { + Environment.Exit(Environment.ExitCode); + } }); - ShowShopChoosePanel = true; + + //App.Current.Dispatcher.Invoke(() => + //{ + // foreach (var s in shopList) + // ShopList.Add(s); + //}); + //ShowShopChoosePanel = true; } } } @@ -230,7 +259,7 @@ namespace BBWY.Client.ViewModels } GlobalContext.User.Shop = shop; - ShowShopChoosePanel = false; + //ShowShopChoosePanel = false; Task.Factory.StartNew(GetLogisticsList); } diff --git a/BBWY.Client/Views/SelectShop.xaml b/BBWY.Client/Views/SelectShop.xaml new file mode 100644 index 00000000..b54bf15a --- /dev/null +++ b/BBWY.Client/Views/SelectShop.xaml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BBWY.Client/Views/SelectShop.xaml.cs b/BBWY.Client/Views/SelectShop.xaml.cs new file mode 100644 index 00000000..a22b6233 --- /dev/null +++ b/BBWY.Client/Views/SelectShop.xaml.cs @@ -0,0 +1,36 @@ +using BBWY.Client.Models; +using BBWY.Controls; +using System; +using System.Collections.Generic; +using System.Text; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Shapes; + +namespace BBWY.Client.Views +{ + /// + /// SelectShop.xaml 的交互逻辑 + /// + public partial class SelectShop : BWindow + { + public IList DepartmentList { get; set; } + public Shop Shop { get; set; } + + public SelectShop(IList departmentList) + { + InitializeComponent(); + this.DepartmentList = departmentList; + } + + private void btn_ok_Click(object sender, RoutedEventArgs e) + { + + } + } +}