diff --git a/BBWY.Client/APIServices/BatchPurchaseService.cs b/BBWY.Client/APIServices/BatchPurchaseService.cs index e3ff0f0f..b51eadb0 100644 --- a/BBWY.Client/APIServices/BatchPurchaseService.cs +++ b/BBWY.Client/APIServices/BatchPurchaseService.cs @@ -144,13 +144,10 @@ namespace BBWY.Client.APIServices return SendRequest(globalContext.BBYWApiHost, "api/BatchPurchase/PayPurchaseOrder", new { orderId, - PurchasePlatform, - purchaseAccount, - globalContext.User.Shop.ShopId, - globalContext.User.Shop.ShopName, - globalContext.User.Shop.AppKey, - globalContext.User.Shop.AppSecret, - globalContext.User.Shop.AppToken + Platform = purchaseAccount.PurchasePlatformId, + purchaseAccount.AppKey, + purchaseAccount.AppSecret, + purchaseAccount.AppToken, }, null, HttpMethod.Post); } diff --git a/BBWY.Client/BBWYAppSettings.json b/BBWY.Client/BBWYAppSettings.json index 9622efaf..726de360 100644 --- a/BBWY.Client/BBWYAppSettings.json +++ b/BBWY.Client/BBWYAppSettings.json @@ -1,5 +1,5 @@ { - //"BBWYApiHost": "http://localhost:5000", + // "BBWYApiHost": "http://localhost:5000", "BBWYApiHost": "http://bbwytest.qiyue666.com", "MDSApiHost": "http://mdsapi.qiyue666.com", "JOSApiHost": "", diff --git a/BBWY.Client/Models/BatchPurchase/BatchPublishTask.cs b/BBWY.Client/Models/BatchPurchase/BatchPublishTask.cs index 5c098e61..8f0029a1 100644 --- a/BBWY.Client/Models/BatchPurchase/BatchPublishTask.cs +++ b/BBWY.Client/Models/BatchPurchase/BatchPublishTask.cs @@ -24,33 +24,41 @@ namespace BBWY.Client.Models { #region 属性 + private bool isSelected; + public bool IsSelected { get => isSelected; set { Set(ref isSelected, value); } } - private ObservableCollection positionTypeList = new ObservableCollection { - new ComboBoxItem{IsSelected = false,Content = "本地仓"}, new ComboBoxItem{IsSelected = false,Content = "齐越仓"}, new ComboBoxItem{IsSelected = false,Content = "京东仓"} - - }; - public ObservableCollection PositionTypeList { get => positionTypeList; set { Set(ref positionTypeList, value); } } - private ObservableCollection packTypeList = new ObservableCollection { - new ComboBoxItem{ Content="单件",IsSelected=false }, new ComboBoxItem{ Content="多件",IsSelected=false } + private ObservableCollection worryList = new ObservableCollection { + "否","是" }; - public ObservableCollection PackTypeList { get => packTypeList; set { Set(ref packTypeList, value); } } - - private ObservableCollection basicPackList = new ObservableCollection { - new ComboBoxItem{ Content="快递袋",IsSelected=false }, new ComboBoxItem{ Content="纸箱",IsSelected=false }, new ComboBoxItem{ Content="麻袋",IsSelected=false } + public ObservableCollection WorryList { get => worryList; set { Set(ref worryList, value); } } + + private ObservableCollection positionTypeList = new ObservableCollection { + "本地仓","齐越仓", "京东仓"}; + public ObservableCollection PositionTypeList { get => positionTypeList; set { Set(ref positionTypeList, value); } } + + private ObservableCollection packTypeList = new ObservableCollection { + "单件","多件" }; - public ObservableCollection BasicPackList { get => basicPackList; set { Set(ref basicPackList, value); } } - private ObservableCollection isNeedBarCodeList = new ObservableCollection { - new ComboBoxItem{IsSelected = false,Content = "需要"}, new ComboBoxItem{IsSelected = false,Content = "不需要"}}; - public ObservableCollection IsNeedBarCodeList { get => isNeedBarCodeList; set { Set(ref isNeedBarCodeList, value); } } + public ObservableCollection PackTypeList { get => packTypeList; set { Set(ref packTypeList, value); } } - private ObservableCollection certificatePositionList = new ObservableCollection { - new ComboBoxItem{ Content="无",IsSelected=false }, new ComboBoxItem{ Content="外部包装",IsSelected=false }, new ComboBoxItem{ Content="产品包装",IsSelected=false } + private ObservableCollection basicPackList = new ObservableCollection { + "快递袋","纸箱","麻袋" + }; + public ObservableCollection BasicPackList { get => basicPackList; set { Set(ref basicPackList, value); } } + + private ObservableCollection isNeedBarCodeList = new ObservableCollection { + "需要", "不需要" }; + public ObservableCollection IsNeedBarCodeList { get => isNeedBarCodeList; set { Set(ref isNeedBarCodeList, value); } } + + private ObservableCollection certificatePositionList = new ObservableCollection { + "无","外部包装","产品包装" }; - public ObservableCollection CertificatePositionList { get => certificatePositionList; set { Set(ref certificatePositionList, value); } } - private ObservableCollection availabilityList = new ObservableCollection { - new ComboBoxItem{ Content="已到货",IsSelected=false }, new ComboBoxItem{ Content="部分到货",IsSelected=false }, new ComboBoxItem{ Content="未到货",IsSelected=false } + public ObservableCollection CertificatePositionList { get => certificatePositionList; set { Set(ref certificatePositionList, value); } } + + private ObservableCollection availabilityList = new ObservableCollection { + "已到货","部分到货","未到货" }; - public ObservableCollection AvailabilityList { get => availabilityList; set { Set(ref availabilityList, value); } } + public ObservableCollection AvailabilityList { get => availabilityList; set { Set(ref availabilityList, value); } } private int skuCount; /// diff --git a/BBWY.Client/ViewModels/BatchPurchase/BatchPurchaseOrderListViewModel.cs b/BBWY.Client/ViewModels/BatchPurchase/BatchPurchaseOrderListViewModel.cs index d025c1e2..d6fce42d 100644 --- a/BBWY.Client/ViewModels/BatchPurchase/BatchPurchaseOrderListViewModel.cs +++ b/BBWY.Client/ViewModels/BatchPurchase/BatchPurchaseOrderListViewModel.cs @@ -139,7 +139,13 @@ namespace BBWY.Client.ViewModels var res = batchPurchaseService.CancelOrder(parameters[1].ToString(), purchaseAccount, ""); if (res.Success) { - Task.Factory.StartNew(() => QueryPurchaseOrder(PageIndex)); + if (res.Data.Success) + { + Task.Factory.StartNew(() => QueryPurchaseOrder(PageIndex)); + return; + } + + MessageBox.Show(res.Data.Msg); return; } if (res.Data != null) @@ -162,7 +168,12 @@ namespace BBWY.Client.ViewModels var res = batchPurchaseService.PayOrder(parameters[1].ToString(), PurchasePlatform, purchaseAccount); if (res.Success) { - Task.Factory.StartNew(() => QueryPurchaseOrder(PageIndex)); + if (res.Data.Success) + { + Task.Factory.StartNew(() => QueryPurchaseOrder(PageIndex)); + return; + } + MessageBox.Show(res.Data.Msg); return; } if (res.Data != null) diff --git a/BBWY.Client/ViewModels/PackTask/CreatePackTaskViewModel.cs b/BBWY.Client/ViewModels/PackTask/CreatePackTaskViewModel.cs index cfdd3f44..06ae5ab0 100644 --- a/BBWY.Client/ViewModels/PackTask/CreatePackTaskViewModel.cs +++ b/BBWY.Client/ViewModels/PackTask/CreatePackTaskViewModel.cs @@ -24,6 +24,9 @@ namespace BBWY.Client.ViewModels.PackTask public class CreatePackTaskViewModel : BaseVM, IDenpendency { + #region 属性 + private bool isSelected; + public bool IsSelected { get => isSelected; set { Set(ref isSelected, value); } } private bool isLoading = false; public bool IsLoading { get => isLoading; set { Set(ref isLoading, value); } } @@ -82,12 +85,6 @@ namespace BBWY.Client.ViewModels.PackTask public string SkuName { get => skuName; set { Set(ref skuName, value); } } - //private long barCodeId; - ///// - ///// 条形码id - ///// - //public long BarCodeId { get => barCodeId; set { Set(ref barCodeId, value); } } - private string brand; /// /// 品牌 @@ -131,12 +128,6 @@ namespace BBWY.Client.ViewModels.PackTask /// public int GoodsNumber { get => goodsNumber; set { Set(ref goodsNumber, value); } } - private DateTime endTime; - /// - /// 提交时间 - /// - public DateTime EndTime { get => endTime; set { Set(ref endTime, value); } } - private long taskId; /// @@ -173,14 +164,6 @@ namespace BBWY.Client.ViewModels.PackTask public TaskState Availability { get => availability; set { Set(ref availability, value); } } - - private int taskStatus; - /// - /// 任务状态(已完成=0,未完成=1) - /// - public int TaskStatus { get => taskStatus; set { Set(ref taskStatus, value); } } - - private PackType packType; /// /// 打包类型(单件=0,多件=1) @@ -295,7 +278,7 @@ namespace BBWY.Client.ViewModels.PackTask private string saveTask; /// - /// 设置显示(合格证) + /// 发布按钮(发布/保存) /// public string SaveTask { get => saveTask; set { Set(ref saveTask, value); } } @@ -337,6 +320,8 @@ namespace BBWY.Client.ViewModels.PackTask /// 注意事项(对接备注) /// public string MarkMessage { get => markMessage; set { Set(ref markMessage, value); } } + #endregion + @@ -491,14 +476,14 @@ namespace BBWY.Client.ViewModels.PackTask this.globalContext = globalContext; SetBarCodeCommand = new RelayCommand(SetBarCode); SetCertificateCommand = new RelayCommand(SetCertificate); - SaveBarCodeCommand = new RelayCommand(SaveBarCode); + //SaveBarCodeCommand = new RelayCommand(SaveBarCode); - SetSpuCerCommand = new RelayCommand(SetSpuCer); - SaveSpuCerCommand = new RelayCommand(SaveSpuCer); - InseartCerCommand = new RelayCommand(InseartCer); + //SetSpuCerCommand = new RelayCommand(SetSpuCer); + //SaveSpuCerCommand = new RelayCommand(SaveSpuCer); + //InseartCerCommand = new RelayCommand(InseartCer); - SaveCerCommand = new RelayCommand(SaveCer); - BarLabelCheckCommand = new RelayCommand(BarLabelCheck); + //SaveCerCommand = new RelayCommand(SaveCer); + //BarLabelCheckCommand = new RelayCommand(BarLabelCheck); CerLabelCheckCommand = new RelayCommand(CerLabelCheck); SpuCerLabelCheckCommand = new RelayCommand(SpuCerLabelCheck); @@ -511,84 +496,84 @@ namespace BBWY.Client.ViewModels.PackTask BarLabelCheck(BarcodeLabelModel.精简模板);//默认精简模式 } - private void InseartCer() - { - if (IsSetSpuCertificate) - { - new TipsWindow("无可用模板").Show(); - return; - } - CertificateModel = new CertificateModel() - { - //SpuId = SpuCertificateModel.SpuId, - SkuId = SkuId, - Brand = SpuCertificateModel.Brand, - BrandName = SpuCertificateModel.BrandName, - ExcuteStander = SpuCertificateModel.ExcuteStander, - FactoryNumber = SpuCertificateModel.FactoryNumber, - IsLogo = SpuCertificateModel.IsLogo, - LabelModel = SpuCertificateModel.LabelModel, - ProductAdress = SpuCertificateModel.ProductAdress, - ProductNo = SpuCertificateModel.ProductNo, - Shader = SpuCertificateModel.Shader, - ProductShop = SpuCertificateModel.ProductShop, - ApplyAge = SpuCertificateModel.ApplyAge, - }; - } - - private void SetSpuCer() - { - - if (SpuCertificateModel == null) - { - SpuCertificateModel = new CertificateModel(); - SpuCertificateModel.ProductNo = ProductNo; - SpuCertificateModel.Brand = Brand; - SpuCertificateModel.SkuId = SkuId; - } - if (!string.IsNullOrEmpty(BrandName)) - SpuCertificateModel.BrandName = BrandName; - setSpuCerWindow = new SetSpuCerWindow(); - setSpuCerWindow.Show(); - } - - private void SaveSpuCer() - { - if (string.IsNullOrEmpty(SpuCertificateModel.ExcuteStander) - || string.IsNullOrEmpty(SpuCertificateModel.BrandName) - || string.IsNullOrEmpty(SpuCertificateModel.Brand) || string.IsNullOrEmpty(SpuCertificateModel.ProductShop) - || string.IsNullOrEmpty(SpuCertificateModel.ProductAdress)) - { - new TipsWindow("参数出错!请重新填写!").Show(); - return; - } - var resData = packTaskService.SaveSpuCer(new CerRequest - { - Brand = SpuCertificateModel.Brand, - BrandName = SpuCertificateModel.BrandName, - ProductNo = SpuCertificateModel.ProductNo, - SpuId = SpuCertificateModel.SpuId, - ExcuteStander = SpuCertificateModel.ExcuteStander, - LabelModel = (int)SpuCertificateModel.LabelModel, - FactoryNumber = SpuCertificateModel.FactoryNumber, - IsLogo = SpuCertificateModel.IsLogo, - ProductAdress = SpuCertificateModel.ProductAdress, - ProductShop = SpuCertificateModel.ProductShop, - Shader = SpuCertificateModel.Shader, - SkuId = SpuCertificateModel.SkuId, - ApplyAge = SpuCertificateModel.ApplyAge, - - - - }); - if (resData == null || !resData.Success) - { - IsSetSpuCertificate = false; - return; - } - IsSetSpuCertificate = false; - setSpuCerWindow.Close(); - } + //private void InseartCer() + //{ + // if (IsSetSpuCertificate) + // { + // new TipsWindow("无可用模板").Show(); + // return; + // } + // CertificateModel = new CertificateModel() + // { + // //SpuId = SpuCertificateModel.SpuId, + // SkuId = SkuId, + // Brand = SpuCertificateModel.Brand, + // BrandName = SpuCertificateModel.BrandName, + // ExcuteStander = SpuCertificateModel.ExcuteStander, + // FactoryNumber = SpuCertificateModel.FactoryNumber, + // IsLogo = SpuCertificateModel.IsLogo, + // LabelModel = SpuCertificateModel.LabelModel, + // ProductAdress = SpuCertificateModel.ProductAdress, + // ProductNo = SpuCertificateModel.ProductNo, + // Shader = SpuCertificateModel.Shader, + // ProductShop = SpuCertificateModel.ProductShop, + // ApplyAge = SpuCertificateModel.ApplyAge, + // }; + //} + + //private void SetSpuCer() + //{ + + // if (SpuCertificateModel == null) + // { + // SpuCertificateModel = new CertificateModel(); + // SpuCertificateModel.ProductNo = ProductNo; + // SpuCertificateModel.Brand = Brand; + // SpuCertificateModel.SkuId = SkuId; + // } + // if (!string.IsNullOrEmpty(BrandName)) + // SpuCertificateModel.BrandName = BrandName; + // setSpuCerWindow = new SetSpuCerWindow(); + // setSpuCerWindow.Show(); + //} + + //private void SaveSpuCer() + //{ + // if (string.IsNullOrEmpty(SpuCertificateModel.ExcuteStander) + // || string.IsNullOrEmpty(SpuCertificateModel.BrandName) + // || string.IsNullOrEmpty(SpuCertificateModel.Brand) || string.IsNullOrEmpty(SpuCertificateModel.ProductShop) + // || string.IsNullOrEmpty(SpuCertificateModel.ProductAdress)) + // { + // new TipsWindow("参数出错!请重新填写!").Show(); + // return; + // } + // var resData = packTaskService.SaveSpuCer(new CerRequest + // { + // Brand = SpuCertificateModel.Brand, + // BrandName = SpuCertificateModel.BrandName, + // ProductNo = SpuCertificateModel.ProductNo, + // SpuId = SpuCertificateModel.SpuId, + // ExcuteStander = SpuCertificateModel.ExcuteStander, + // LabelModel = (int)SpuCertificateModel.LabelModel, + // FactoryNumber = SpuCertificateModel.FactoryNumber, + // IsLogo = SpuCertificateModel.IsLogo, + // ProductAdress = SpuCertificateModel.ProductAdress, + // ProductShop = SpuCertificateModel.ProductShop, + // Shader = SpuCertificateModel.Shader, + // SkuId = SpuCertificateModel.SkuId, + // ApplyAge = SpuCertificateModel.ApplyAge, + + + + // }); + // if (resData == null || !resData.Success) + // { + // IsSetSpuCertificate = false; + // return; + // } + // IsSetSpuCertificate = false; + // setSpuCerWindow.Close(); + //} private void OnSearchIncreateKeyWordChanged(string key) { diff --git a/BBWY.Client/Views/BatchPurchase/BatchPublishTaskWindow.xaml b/BBWY.Client/Views/BatchPurchase/BatchPublishTaskWindow.xaml index cd19b6c0..5b87d01b 100644 --- a/BBWY.Client/Views/BatchPurchase/BatchPublishTaskWindow.xaml +++ b/BBWY.Client/Views/BatchPurchase/BatchPublishTaskWindow.xaml @@ -128,9 +128,8 @@ - - - + + @@ -189,7 +188,7 @@ - + diff --git a/BBWY.Client/Views/PackTask/LookCerWindow.xaml b/BBWY.Client/Views/PackTask/LookCerWindow.xaml index 082d697a..1f98d54c 100644 --- a/BBWY.Client/Views/PackTask/LookCerWindow.xaml +++ b/BBWY.Client/Views/PackTask/LookCerWindow.xaml @@ -88,7 +88,7 @@ - + diff --git a/BBWY.Client/Views/PackTask/PrintWindow.xaml b/BBWY.Client/Views/PackTask/PrintWindow.xaml index d8606cc9..ca1e0a6a 100644 --- a/BBWY.Client/Views/PackTask/PrintWindow.xaml +++ b/BBWY.Client/Views/PackTask/PrintWindow.xaml @@ -170,7 +170,7 @@ - + @@ -229,8 +229,6 @@ Height="44" Text="{Binding ProductAdress}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="63,241,0,0"/> - - diff --git a/BBWY.Client/Views/PackTask/SetCerWindow.xaml.cs b/BBWY.Client/Views/PackTask/SetCerWindow.xaml.cs index 287d62aa..193515bf 100644 --- a/BBWY.Client/Views/PackTask/SetCerWindow.xaml.cs +++ b/BBWY.Client/Views/PackTask/SetCerWindow.xaml.cs @@ -37,7 +37,6 @@ namespace BBWY.Client.Views.PackTask this.IsSetSpuCertificate = IsSetSpuCertificate; SetSpuCer.Content = IsSetSpuCertificate ? "设置spu模板" : "修改spu模板"; this.DataContext = this; - } public bool IsSetSpuCertificate { get; set; } public PackTaskService packTaskService { get; set; } diff --git a/BBWY.Server.Business/PlatformSDK/QuanTanBusiness.cs b/BBWY.Server.Business/PlatformSDK/QuanTanBusiness.cs index 091e6a23..8da169df 100644 --- a/BBWY.Server.Business/PlatformSDK/QuanTanBusiness.cs +++ b/BBWY.Server.Business/PlatformSDK/QuanTanBusiness.cs @@ -23,12 +23,12 @@ namespace BBWY.Server.Business public override PayPurchaseOrderResponse PayPurchaseOrder(PayPurchaseOrderRequest payPurchaseOrderRequest) { - var data = payPurchaseOrderRequest.PurchaseAccount; + var qtResponse = quanTanOrderClient.PayOrder(new QuanTanPayOrderRequest { orderId = payPurchaseOrderRequest.OrderId, - userAccount = data.AccountName - }, payPurchaseOrderRequest.PurchaseAccount.AppKey, payPurchaseOrderRequest.PurchaseAccount.AppSecret); + userAccount = payPurchaseOrderRequest.AppToken + }, payPurchaseOrderRequest.AppKey, payPurchaseOrderRequest.AppSecret); if (qtResponse.Status == 200) return new PayPurchaseOrderResponse { Success = true, PurchaseOrderState= PurchaseOrderState.待发货 }; if (qtResponse.Message != null && qtResponse.Message.Contains("已支付")) @@ -36,8 +36,8 @@ namespace BBWY.Server.Business var res = quanTanOrderClient.GetOrderDetail(new QuanTanGetOrderDetailRequest { orderId = payPurchaseOrderRequest.OrderId, - userAccount = data.AccountName - }, payPurchaseOrderRequest.PurchaseAccount.AppKey, payPurchaseOrderRequest.PurchaseAccount.AppSecret); + userAccount = payPurchaseOrderRequest.AppToken + }, payPurchaseOrderRequest.AppKey, payPurchaseOrderRequest.AppSecret); if (res.Status == 200) { PurchaseOrderState purchaseOrder= PurchaseOrderState.待发货; diff --git a/BBWY.Server.Business/PurchaseOrderV2/BatchPurchase/BatchPurchaseBusiness.cs b/BBWY.Server.Business/PurchaseOrderV2/BatchPurchase/BatchPurchaseBusiness.cs index b970581c..121490b9 100644 --- a/BBWY.Server.Business/PurchaseOrderV2/BatchPurchase/BatchPurchaseBusiness.cs +++ b/BBWY.Server.Business/PurchaseOrderV2/BatchPurchase/BatchPurchaseBusiness.cs @@ -441,7 +441,7 @@ namespace BBWY.Server.Business public PayPurchaseOrderResponse PayPurchaseOrder(PayPurchaseOrderRequest request) { - var platformSDKBusiness = platformSDKBusinessList.FirstOrDefault(p => p.Platform == request.PurchasePlatform); + var platformSDKBusiness = platformSDKBusinessList.FirstOrDefault(p => p.Platform == request.Platform); var payOrderResponse = platformSDKBusiness.PayPurchaseOrder(request); if (payOrderResponse.Success) diff --git a/BBWY.Server.Model/Dto/Request/PurchaseOrderV2/BatchPurchase/CancelPurchaseOrderRequest.cs b/BBWY.Server.Model/Dto/Request/PurchaseOrderV2/BatchPurchase/CancelPurchaseOrderRequest.cs index e2c04047..8febce2c 100644 --- a/BBWY.Server.Model/Dto/Request/PurchaseOrderV2/BatchPurchase/CancelPurchaseOrderRequest.cs +++ b/BBWY.Server.Model/Dto/Request/PurchaseOrderV2/BatchPurchase/CancelPurchaseOrderRequest.cs @@ -3,8 +3,6 @@ public class CancelPurchaseOrderRequest: PlatformRequest { public string OrderId { get; set; } - - public string Remark { get; set; } } } diff --git a/BBWY.Server.Model/Dto/Request/PurchaseOrderV2/BatchPurchase/PayPurchaseOrderRequest.cs b/BBWY.Server.Model/Dto/Request/PurchaseOrderV2/BatchPurchase/PayPurchaseOrderRequest.cs index 214041e0..0a6ab9b1 100644 --- a/BBWY.Server.Model/Dto/Request/PurchaseOrderV2/BatchPurchase/PayPurchaseOrderRequest.cs +++ b/BBWY.Server.Model/Dto/Request/PurchaseOrderV2/BatchPurchase/PayPurchaseOrderRequest.cs @@ -8,13 +8,5 @@ namespace BBWY.Server.Model.Dto public class PayPurchaseOrderRequest : PlatformRequest { public string OrderId { get; set; } - - public PurchaseAccount PurchaseAccount { get; set; } - - - /// - /// 采购平台 - /// - public Enums.Platform PurchasePlatform { get; set; } } }