shanji 3 years ago
parent
commit
13e5431ab1
  1. 4
      BBWY.Client/APIServices/PurchaseOrderService.cs
  2. 4
      BBWY.Client/Models/APIModel/Response/Shop/ShopResponse.cs
  3. 2
      BBWY.Client/Models/FinancialTerminal/ProcurementAudit/AuditPayBill.cs
  4. 18
      BBWY.Client/Models/Shop/Department2.cs
  5. 4
      BBWY.Client/Models/Shop/Shop.cs
  6. 7
      BBWY.Client/Models/User/User.cs
  7. 9
      BBWY.Client/ViewModels/FinancialTerminal/ProcurementAuditViewModel.cs
  8. 47
      BBWY.Client/ViewModels/MainViewModel.cs
  9. 1
      BBWY.Client/ViewModels/Purchase/1688PreviewPurchaseViewModel.cs
  10. 11
      BBWY.Client/Views/FinancialTerminal/ProcurementAudit.xaml
  11. 2
      BBWY.Client/Views/MainWindow.xaml
  12. 55
      BBWY.Client/Views/SelectShop.xaml
  13. 36
      BBWY.Client/Views/SelectShop.xaml.cs
  14. 3
      BBWY.Server.Business/PurchaseOrder/PurchaseOrderBusiness.cs
  15. 6
      BBWY.Server.Model/Db/PurchaseOrder/PurchaseOrder.cs
  16. 6
      BBWY.Server.Model/Dto/Request/PurchaseOrder/OnlinePurchase/CreateOnlinePurchaseOrderRequest.cs
  17. 3
      BBWY.Server.Model/Enums.cs

4
BBWY.Client/APIServices/PurchaseOrderService.cs

@ -94,6 +94,8 @@ namespace BBWY.Client.APIServices
/// <param name="purchaseAccountId"></param> /// <param name="purchaseAccountId"></param>
/// <param name="buyerAccount"></param> /// <param name="buyerAccount"></param>
/// <param name="sellerAccount"></param> /// <param name="sellerAccount"></param>
/// <param name="purchaserId"></param>
/// <param name="platformCommissionRatio"></param>
/// <returns></returns> /// <returns></returns>
public ApiResponse<object> FastCreateOrder(Consignee consignee, public ApiResponse<object> FastCreateOrder(Consignee consignee,
IList<PurchaseSchemeProductSku> purchaseSchemeProductSkuList, IList<PurchaseSchemeProductSku> purchaseSchemeProductSkuList,
@ -107,6 +109,7 @@ namespace BBWY.Client.APIServices
long purchaseAccountId, long purchaseAccountId,
string buyerAccount, string buyerAccount,
string sellerAccount, string sellerAccount,
string purchaserId,
decimal platformCommissionRatio) decimal platformCommissionRatio)
{ {
return SendRequest<object>(globalContext.BBYWApiHost, "api/purchaseOrder/NewFastCreateOrder", new return SendRequest<object>(globalContext.BBYWApiHost, "api/purchaseOrder/NewFastCreateOrder", new
@ -133,6 +136,7 @@ namespace BBWY.Client.APIServices
purchaseAccountId, purchaseAccountId,
buyerAccount, buyerAccount,
sellerAccount, sellerAccount,
purchaserId,
platformCommissionRatio platformCommissionRatio
}, null, HttpMethod.Post); }, null, HttpMethod.Post);
} }

4
BBWY.Client/Models/APIModel/Response/Shop/ShopResponse.cs

@ -25,5 +25,9 @@ namespace BBWY.Client.Models
public string ManagePwd { get; set; } public string ManagePwd { get; set; }
public decimal? PlatformCommissionRatio { get; set; } public decimal? PlatformCommissionRatio { get; set; }
public string TeamId { get; set; }
public string TeamName { get; set; }
} }
} }

2
BBWY.Client/Models/FinancialTerminal/ProcurementAudit/AuditPayBill.cs

@ -69,5 +69,7 @@ namespace BBWY.Client.Models
/// </summary> /// </summary>
public string ErrorMessage { get; set; } public string ErrorMessage { get; set; }
public string Remark { get; set; }
} }
} }

18
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<Shop> ShopList { get; set; }
public Department2()
{
ShopList = new List<Shop>();
}
}
}

4
BBWY.Client/Models/Shop/Shop.cs

@ -36,5 +36,9 @@ namespace BBWY.Client.Models
/// 店铺扣点 /// 店铺扣点
/// </summary> /// </summary>
public decimal? PlatformCommissionRatio { get; set; } public decimal? PlatformCommissionRatio { get; set; }
public string TeamId { get; set; }
public string TeamName { get; set; }
} }
} }

7
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 public class User : NotifyObject
{ {
@ -20,5 +23,7 @@
public string TeamName { get; set; } public string TeamName { get; set; }
public Shop Shop { get => shop; set { Set(ref shop, value); } } public Shop Shop { get => shop; set { Set(ref shop, value); } }
public IList<Department2> DepartmentList { get; set; }
} }
} }

9
BBWY.Client/ViewModels/FinancialTerminal/ProcurementAuditViewModel.cs

@ -200,7 +200,7 @@ namespace BBWY.Client.ViewModels
}; };
IsLoading = true; IsLoading = true;
var shopList = SelectedDepartment.ShopList.Where(s => s.IsSelected).ToList(); var shopList = SelectedDepartment.ShopList.Where(s => s.IsSelected).ToList();
var sDate = StartDate; var sDate = StartDate.AddDays(-5);
var eDate = EndDate; var eDate = EndDate;
Task.Factory.StartNew(() => Task.Factory.StartNew(() =>
{ {
@ -409,8 +409,8 @@ namespace BBWY.Client.ViewModels
{ {
var array = line.CSVstrToArry(); var array = line.CSVstrToArry();
var sourceMerchantOrderNo = array[2].FormatString(); var sourceMerchantOrderNo = array[2].FormatString();
if (!string.IsNullOrEmpty(sourceMerchantOrderNo) && sourceMerchantOrderNo.StartsWith("XP")) //if (!string.IsNullOrEmpty(sourceMerchantOrderNo))
continue; //暂时不支持此类商户单号 // continue; //暂时不支持此类商户单号
var expenditureAmount = decimal.Parse(array[7].FormatString()); var expenditureAmount = decimal.Parse(array[7].FormatString());
if (expenditureAmount == 0) //支出为0的账单不参与审计 if (expenditureAmount == 0) //支出为0的账单不参与审计
@ -427,7 +427,8 @@ namespace BBWY.Client.ViewModels
ProductName = array[3].FormatString(), ProductName = array[3].FormatString(),
PayTime = DateTime.Parse(array[4].FormatString()), PayTime = DateTime.Parse(array[4].FormatString()),
OppositeAccount = array[5].FormatString(), OppositeAccount = array[5].FormatString(),
ExpenditureAmount = Math.Abs(expenditureAmount) ExpenditureAmount = Math.Abs(expenditureAmount),
Remark = array[11]
}; };
payBill.MerchantOrderNo = payBill.SourceMerchantOrderNo; payBill.MerchantOrderNo = payBill.SourceMerchantOrderNo;
if (payBill.SourceMerchantOrderNo.StartsWith("T50060NP")) if (payBill.SourceMerchantOrderNo.StartsWith("T50060NP"))

47
BBWY.Client/ViewModels/MainViewModel.cs

@ -1,5 +1,6 @@
using BBWY.Client.APIServices; using BBWY.Client.APIServices;
using BBWY.Client.Models; using BBWY.Client.Models;
using BBWY.Client.Views;
using BBWY.Common.Extensions; using BBWY.Common.Extensions;
using BBWY.Common.Http; using BBWY.Common.Http;
using BBWY.Common.Models; using BBWY.Common.Models;
@ -148,10 +149,20 @@ namespace BBWY.Client.ViewModels
GlobalContext.User = mdsUserResponse.Data.Map<User>(); GlobalContext.User = mdsUserResponse.Data.Map<User>();
#if RELEASE #if RELEASE
if (GlobalContext.User.TeamName == "财务部") if (GlobalContext.User.TeamName == "财务部")
{
App.Current.Dispatcher.Invoke(() => App.Current.Dispatcher.Invoke(() =>
{ {
for (var i = 0; i < 3; i++) { MenuList.RemoveAt(0); } for (var i = 0; i < 3; i++) { MenuList.RemoveAt(0); }
}); });
}
else
{
App.Current.Dispatcher.Invoke(() =>
{
MenuList.RemoveAt(MenuList.Count() - 1);
});
}
#endif #endif
//请求用户信息接口 //请求用户信息接口
@ -178,16 +189,44 @@ namespace BBWY.Client.ViewModels
var shopList = shopListResponse.Data.Map<IList<Shop>>(); var shopList = shopListResponse.Data.Map<IList<Shop>>();
if (shopList.Count == 1) if (shopList.Count == 1)
{ {
ShowShopChoosePanel = false;
ChooseShop(shopList[0], true); ChooseShop(shopList[0], true);
} }
else else
{ {
ShowShopChoosePanel = true;
IList<Department2> department2s = new List<Department2>();
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(() => App.Current.Dispatcher.Invoke(() =>
{ {
foreach (var s in shopList) var selectShop = new SelectShop(department2s);
ShopList.Add(s); 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;
} }
} }
} }
@ -220,7 +259,7 @@ namespace BBWY.Client.ViewModels
} }
GlobalContext.User.Shop = shop; GlobalContext.User.Shop = shop;
ShowShopChoosePanel = false; //ShowShopChoosePanel = false;
Task.Factory.StartNew(GetLogisticsList); Task.Factory.StartNew(GetLogisticsList);
} }

1
BBWY.Client/ViewModels/Purchase/1688PreviewPurchaseViewModel.cs

@ -320,6 +320,7 @@ namespace BBWY.Client.ViewModels
purchaseAccount.Id, purchaseAccount.Id,
purchaseAccount.AccountName, purchaseAccount.AccountName,
purchaseSchemeList[0].PurchaserName, purchaseSchemeList[0].PurchaserName,
purchaser.Id,
globalContext.User.Shop.PlatformCommissionRatio ?? 0.05M)).ContinueWith(t => globalContext.User.Shop.PlatformCommissionRatio ?? 0.05M)).ContinueWith(t =>
{ {
IsLoading = false; IsLoading = false;

11
BBWY.Client/Views/FinancialTerminal/ProcurementAudit.xaml

@ -156,10 +156,19 @@
<DataGridTextColumn Header="支付时间" Width="130" Binding="{Binding PayTime,StringFormat=yyyy-MM-dd HH:mm:ss}" ElementStyle="{StaticResource verticalCenterTextBlock}"/> <DataGridTextColumn Header="支付时间" Width="130" Binding="{Binding PayTime,StringFormat=yyyy-MM-dd HH:mm:ss}" ElementStyle="{StaticResource verticalCenterTextBlock}"/>
<DataGridTextColumn Header="对方账号" Width="100" Binding="{Binding OppositeAccount}" ElementStyle="{StaticResource verticalCenterTextBlock}"/> <DataGridTextColumn Header="对方账号" Width="100" Binding="{Binding OppositeAccount}" ElementStyle="{StaticResource verticalCenterTextBlock}"/>
<DataGridTextColumn Header="支出金额" Width="60" Binding="{Binding ExpenditureAmount}" ElementStyle="{StaticResource middleTextBlock}"/> <DataGridTextColumn Header="支出金额" Width="60" Binding="{Binding ExpenditureAmount}" ElementStyle="{StaticResource middleTextBlock}"/>
<DataGridTextColumn Header="商户订单号" Width="200" Binding="{Binding SourceMerchantOrderNo}" ElementStyle="{StaticResource verticalCenterTextBlock}"/> <!--<DataGridTextColumn Header="商户订单号" Width="200" Binding="{Binding SourceMerchantOrderNo}" ElementStyle="{StaticResource verticalCenterTextBlock}"/>-->
<DataGridTemplateColumn Header="商户订单号" Width="200">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text="{Binding SourceMerchantOrderNo}" Background="Transparent" BorderThickness="0"
IsReadOnly="True" VerticalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Header="归属店铺" Width="100" Binding="{Binding BelongShop}" ElementStyle="{StaticResource verticalCenterTextBlock}"/> <DataGridTextColumn Header="归属店铺" Width="100" Binding="{Binding BelongShop}" ElementStyle="{StaticResource verticalCenterTextBlock}"/>
<DataGridTextColumn Header="关联采购单" Width="140" Binding="{Binding RelationPurchaseOrderId}" ElementStyle="{StaticResource verticalCenterTextBlock}"/> <DataGridTextColumn Header="关联采购单" Width="140" Binding="{Binding RelationPurchaseOrderId}" ElementStyle="{StaticResource verticalCenterTextBlock}"/>
<DataGridTextColumn Header="关联销售单" Width="140" Binding="{Binding RelationShopOrderId}" ElementStyle="{StaticResource verticalCenterTextBlock}"/> <DataGridTextColumn Header="关联销售单" Width="140" Binding="{Binding RelationShopOrderId}" ElementStyle="{StaticResource verticalCenterTextBlock}"/>
<DataGridTextColumn Header="备注" Width="*" Binding="{Binding Remark}" ElementStyle="{StaticResource verticalCenterTextBlock}"/>
<DataGridTextColumn Header="异常内容" Width="*" Binding="{Binding ErrorMessage}" Foreground="Red" ElementStyle="{StaticResource verticalCenterTextBlock}"/> <DataGridTextColumn Header="异常内容" Width="*" Binding="{Binding ErrorMessage}" Foreground="Red" ElementStyle="{StaticResource verticalCenterTextBlock}"/>
</DataGrid.Columns> </DataGrid.Columns>
</DataGrid> </DataGrid>

2
BBWY.Client/Views/MainWindow.xaml

@ -26,7 +26,7 @@
<!--<TextBlock Text="{Binding GlobalContext.User.TeamName}" Margin="5,0,0,0"/> <!--<TextBlock Text="{Binding GlobalContext.User.TeamName}" Margin="5,0,0,0"/>
<TextBlock Text="{Binding GlobalContext.User.Shop.Platform}" Margin="5,0,0,0"/>--> <TextBlock Text="{Binding GlobalContext.User.Shop.Platform}" Margin="5,0,0,0"/>-->
<TextBlock Text="{Binding GlobalContext.User.Shop.Name}" Margin="5,0,0,0"/> <TextBlock Text="{Binding GlobalContext.User.Shop.Name}" Margin="5,0,0,0"/>
<TextBlock Text="v10017" Margin="5,0,0,0"/> <TextBlock Text="v10018" Margin="5,0,0,0"/>
</StackPanel> </StackPanel>
</Border> </Border>
<Grid Grid.Row="1"> <Grid Grid.Row="1">

55
BBWY.Client/Views/SelectShop.xaml

@ -0,0 +1,55 @@
<c:BWindow x:Class="BBWY.Client.Views.SelectShop"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:BBWY.Client.Views"
mc:Ignorable="d"
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls"
Title="SelectShop" Height="200" Width="300"
CloseButtonVisibility="Visible"
CloseButtonColor="{StaticResource WindowButtonColor}"
MinButtonVisibility="Collapsed"
MaxButtonVisibility="Collapsed"
RightButtonGroupMargin="0,5,5,0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition/>
<RowDefinition Height="40"/>
</Grid.RowDefinitions>
<Border BorderThickness="0,0,0,1" BorderBrush="{StaticResource MainMenu.BorderBrush}"
Background="{StaticResource Border.Background}">
<TextBlock Text="选择店铺" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<Grid Grid.Row="1" VerticalAlignment="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBlock Text="团队" HorizontalAlignment="Right" VerticalAlignment="Center"/>
<ComboBox x:Name="cbx_department"
ItemsSource="{Binding DepartmentList,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type c:BWindow}}}"
SelectedIndex="0"
DisplayMemberPath="Name"
Width="150" Height="25"
HorizontalAlignment="Left" VerticalContentAlignment="Center"
Grid.Column="1" Margin="5,5,0,5"/>
<TextBlock Text="店铺" HorizontalAlignment="Right" Grid.Row="1" VerticalAlignment="Center" />
<ComboBox x:Name="cbx_shop" Width="150" Height="25"
SelectedIndex="0"
HorizontalAlignment="Left" VerticalContentAlignment="Center"
DisplayMemberPath="Name"
Grid.Column="1" Grid.Row="1" Margin="5,5,0,5"/>
</Grid>
<c:BButton x:Name="btn_ok" Content="确定" Grid.Row="2" Width="60" HorizontalAlignment="Right" Margin="0,0,8,0"
Click="btn_ok_Click"/>
</Grid>
</c:BWindow>

36
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
{
/// <summary>
/// SelectShop.xaml 的交互逻辑
/// </summary>
public partial class SelectShop : BWindow
{
public IList<Department2> DepartmentList { get; set; }
public Shop Shop { get; set; }
public SelectShop(IList<Department2> departmentList)
{
InitializeComponent();
this.DepartmentList = departmentList;
}
private void btn_ok_Click(object sender, RoutedEventArgs e)
{
}
}
}

3
BBWY.Server.Business/PurchaseOrder/PurchaseOrderBusiness.cs

@ -308,7 +308,8 @@ namespace BBWY.Server.Business
SingleOperationAmount = 0, SingleOperationAmount = 0,
SingleSkuAmount = currentOrderSkuProductAmount / orderSku.ItemTotal.Value, SingleSkuAmount = currentOrderSkuProductAmount / orderSku.ItemTotal.Value,
SingleFreight = currentOrderSkuFreightAmount / orderSku.ItemTotal.Value, SingleFreight = currentOrderSkuFreightAmount / orderSku.ItemTotal.Value,
StorageType = Enums.StorageType. StorageType = Enums.StorageType.,
PurchaserId = createOnlinePurchaseOrderRequest.PurchaserId
}; };
insertPurchaseOrders.Add(purchaseOrder); insertPurchaseOrders.Add(purchaseOrder);
#endregion #endregion

6
BBWY.Server.Model/Db/PurchaseOrder/PurchaseOrder.cs

@ -82,6 +82,12 @@ namespace BBWY.Server.Model.Db
public long? ShopId { get; set; } public long? ShopId { get; set; }
/// <summary>
/// 采购商Id
/// </summary>
[Column(StringLength = 20)]
public string PurchaserId { get; set; }
/// <summary> /// <summary>
/// 单件Sku成本 /// 单件Sku成本
/// </summary> /// </summary>

6
BBWY.Server.Model/Dto/Request/PurchaseOrder/OnlinePurchase/CreateOnlinePurchaseOrderRequest.cs

@ -35,5 +35,11 @@
public string SellerAccount { get; set; } public string SellerAccount { get; set; }
public decimal PlatformCommissionRatio { get; set; } public decimal PlatformCommissionRatio { get; set; }
/// <summary>
/// 采购商Id
/// </summary>
public string PurchaserId { get; set; }
} }
} }

3
BBWY.Server.Model/Enums.cs

@ -10,7 +10,8 @@
= 0, = 0,
= 1, = 1,
= 2, = 2,
= 3 = 3,
= 4
} }
/// <summary> /// <summary>

Loading…
Cancel
Save