using BBWY.Client.APIServices; using BBWY.Client.Models.PackTask; using BBWY.Client.Models; using BBWY.Client.Views.PackTask; using BBWY.Common.Models; using GalaSoft.MvvmLight.Command; using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Windows.Input; using System.Windows; using BBWY.Client.Models.QualityTask; using BBWY.Client.Views.QualityTask; using BBWY.Client.Models.APIModel.Response.PackPurchaseTask; using NPOI.Util.ArrayExtensions; using System.Threading.Tasks; using Org.BouncyCastle.Asn1.Crmf; using System.Runtime.InteropServices.WindowsRuntime; using NPOI.Util; using BBWY.Controls; using WebSocketSharp; using BBWY.Client.APIServices.QiKu; using BarcodeLib; using System.Runtime.ConstrainedExecution; using BBWY.Client.Models.APIModel; namespace BBWY.Client.ViewModels { public class QualityViewModel : BaseVM { #region 属性 public int? goodProductQuantity; public int? arrivalQuantity; /// /// 到货数量 /// public int? ArrivalQuantity { get => arrivalQuantity; set { Set(ref arrivalQuantity, value); } } /// /// 良品数量 /// public int? GoodProductQuantity { get => goodProductQuantity; set { Set(ref goodProductQuantity, value); } } ///// ///// 预计完成时间 ///// //public DateTime? PreCompeteTime { get; set; } private ObservableCollection purchaseSkuList; public ObservableCollection PurchaseSkuList { get => purchaseSkuList; set { Set(ref purchaseSkuList, value); } } private string searchSkuId; public string SearchSkuId { get => searchSkuId; set { Set(ref searchSkuId, value); } } // public long TaskId { get; set; } //private bool isSelected; //public bool IsSelected { get => isSelected; set { Set(ref isSelected, value); } } private ObservableCollection worryList = new ObservableCollection { "否","是" }; 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 PackTypeList { get => packTypeList; set { Set(ref packTypeList, value); } } 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 isNeedCerList = new ObservableCollection { "需要", "不需要" }; public ObservableCollection IsNeedCerList { get => isNeedCerList; set { Set(ref isNeedCerList, value); } } private ObservableCollection certificatePositionList = new ObservableCollection { "无需合格证","外部包装","产品包装" }; 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); } } //private int floorDragNumber; //public int FloorDragNumber { get => floorDragNumber; set { Set(ref floorDragNumber, value); } } //private ObservableCollection floorDragNumberList = new ObservableCollection //{ //}; //public ObservableCollection FloorDragNumberList { get => floorDragNumberList; set { Set(ref floorDragNumberList, value); } } private ObservableCollection wareHourseList = new ObservableCollection { }; public ObservableCollection WareHourseList { get => wareHourseList; set { Set(ref wareHourseList, value); } } private int wareHourseCount; public int WareHourseCount { get => wareHourseCount; set { Set(ref wareHourseCount, value); } } private int? storeGetSelfCount; /// /// 商家自取数 /// public int? StoreGetSelfCount { get => storeGetSelfCount; set { Set(ref storeGetSelfCount, value); } } private int skuCount; /// /// Sku任务数 /// public int SkuCount { get => skuCount; set { Set(ref skuCount, value); } } private string skuId; /// /// Sku /// public string SkuId { get => skuId; set { Set(ref skuId, value); } } public string orderId; public string OrderId { get => orderId; set { Set(ref orderId, value); } } private string logo; /// /// 店铺Sku图链接 /// public string Logo { get => logo; set { Set(ref logo, value); } } private string skuName; /// /// 采购Sku名称 /// public string SkuName { get => skuName; set { Set(ref skuName, value); } } private string brand; /// /// 品牌 /// public string Brand { get => brand; set { Set(ref brand, value); } } private string productNo; /// /// 货号 /// public string ProductNo { get => productNo; set { Set(ref productNo, value); } } private string brandName; /// /// 品名(手写上传) /// public string BrandName { get => brandName; set { Set(ref brandName, value); } } private int goodsNumber; /// /// 配件数 /// public int GoodsNumber { get => goodsNumber; set { Set(ref goodsNumber, value); } } private Worry isWorry; /// /// 是否加急 /// public Worry IsWorry { get => isWorry; set { Set(ref isWorry, value); } } private Availability availability; /// /// 到货情况(待收货=0,部分收货=1,已到货=2) /// public Availability Availability { get => availability; set { Set(ref availability, value); } } private PackType packType; /// /// 打包类型(单件=0,多件=1) /// public PackType PackType { get => packType; set { Set(ref packType, value); } } private BasicPack basicPack; /// /// 基础包装(快递袋=0,纸箱=1,麻袋=2) /// public BasicPack BasicPack { get => basicPack; set { Set(ref basicPack, value); } } private PositionType positionType; /// /// 落仓(商家仓=0,云仓=1,京仓=2,聚水潭=3) /// public PositionType PositionType { get => positionType; set { Set(ref positionType, value); } } private string skuTitle; /// /// sku配件商品名称 /// public string SkuTitle { get => skuTitle; set { Set(ref skuTitle, value); } } private Need isNeedBarCode; /// /// 是否需要合格证 /// public Need IsNeedBarCode { get => isNeedBarCode; set { Set(ref isNeedBarCode, value); } } private Need isNeedCertificateModel; /// /// 是否需要条形码 /// public Need IsNeedCertificateModel { get => isNeedCertificateModel; set { Set(ref isNeedCertificateModel, value); } } private BrandMarkType brandMarkType; /// /// 是否需要条形码 /// public BrandMarkType BrandMarkType { get => brandMarkType; set { Set(ref brandMarkType, value); } } private List brandMarkTypeList = new List { BrandMarkType.无需遮盖, BrandMarkType.需遮盖, BrandMarkType.无需贴商标 }; /// /// 是否需要条形码 /// public List BrandMarkTypeList { get => brandMarkTypeList; set { Set(ref brandMarkTypeList, value); } } private BarCodeModel barCodeModel; /// /// 条形码 /// public BarCodeModel BarCodeModel { get => barCodeModel; set { Set(ref barCodeModel, value); } } public DateTime CreateTime { get; set; } private bool isSetBarCode; /// /// 设置显示(条形码) /// public bool IsSetBarCode { get => isSetBarCode; set { Set(ref isSetBarCode, value); // IsNeedBarCode = IsSetBarCode ? Need.不需要 : Need.需要; } } private bool isSetCertificate; /// /// 设置显示(合格证) /// public bool IsSetCertificate { get => isSetCertificate; set { Set(ref isSetCertificate, value); //IsNeedCertificateModel = IsSetCertificate ? Need.不需要 : Need.需要; } } private string setSpuCerStatus; public string SetSpuCerStatus { get => setSpuCerStatus; set { Set(ref setSpuCerStatus, value); } } private bool isSetSpuCertificate = true; /// /// 设置spu显示(合格证) /// public bool IsSetSpuCertificate { get => isSetSpuCertificate; set { Set(ref isSetSpuCertificate, value); SetSpuCerStatus = IsSetSpuCertificate ? "设置spu模板" : "修改spu模板"; } } private string saveTask; /// /// 设置显示(合格证) /// public string SaveTask { get => saveTask; set { Set(ref saveTask, value); } } private string spuId; /// /// 合格证 /// public string SpuId { get => spuId; set { Set(ref spuId, value); } } private CertificateModel spuCertificateModel; /// /// spu合格证 /// public CertificateModel SpuCertificateModel { get => spuCertificateModel; set { Set(ref spuCertificateModel, value); } } private CertificateModel certificateModel; /// /// 合格证 /// public CertificateModel CertificateModel { get => certificateModel; set { Set(ref certificateModel, value); } } /// /// 合格证位置(外部包装=0,产品包装=1) /// private CertificatePosition certificatePosition; /// /// 合格证位置(外部包装=0,产品包装=1) /// public CertificatePosition CertificatePosition { get => certificatePosition; set { Set(ref certificatePosition, value); } } /// /// 注意事项(对接备注) /// private string markMessage; /// /// 注意事项(对接备注) /// public string MarkMessage { get => markMessage; set { Set(ref markMessage, value); } } /// /// 注意事项(对接备注) /// private string showMarkMessage; /// /// 注意事项(对接备注) /// public string ShowMarkMessage { get => showMarkMessage; set { Set(ref showMarkMessage, value); } } private ObservableCollection increateList; /// /// 增量耗材查询关键字 /// public ObservableCollection IncreateList { get => increateList; set { Set(ref increateList, value); } } string[] increates = new string[] { "气泡纸", "气泡袋", "POP袋", "折纸箱", "气泡纸封边", "彩盒", "剪胶", "剪彩带", "快递袋", "收纳盒", "纸箱子", "装纸箱", "封边", "胶带", "折彩盒" }; PackPurchaseTaskService packPurchaseTaskService; PackTaskService packTaskService; ProductService productService; GlobalContext globalContext; private bool isLoading = false; public bool IsLoading { get => isLoading; set { Set(ref isLoading, value); } } PurchaseService purchaseService; MarkMessageService markMessageService; QualityTaskService qualityTaskService; SaveType? saveType; public string OriginShopName { get; set; } private string skuPurchaseSchemeId; public string SkuPurchaseSchemeId { get => skuPurchaseSchemeId; set { Set(ref skuPurchaseSchemeId, value); } } public Platform Platform { get; set; } public string ShopId { get; set; } public long TaskId { get; set; } public string UserName { get; set; } public ICommand SetBarCodeCommand { get; set; } public ICommand SetCertificateCommand { get; set; } public ICommand LookBarCommand { get; set; } public ICommand LookCerCommand { get; set; } public ICommand OpenSkuDetailCommand { get; set; } public ICommand CompeteQualityTaskCommand { get; set; } public ICommand SearchSkuCommand { get; set; } public ICommand QualityTaskExceptionCommand { get; set; } #endregion public QualityViewModel(ProductService productService, GlobalContext globalContext, PackPurchaseTaskService packPurchaseTaskService, PurchaseService purchaseService, PackTaskService packTaskService, MarkMessageService markMessageService, QualityTaskService qualityTaskService, PackTaskAbortService packTaskAbortService) { this.packPurchaseTaskService = packPurchaseTaskService; this.productService = productService; this.globalContext = globalContext; this.purchaseService = purchaseService; this.packTaskService = packTaskService; this.markMessageService = markMessageService; this.qualityTaskService = qualityTaskService; this.packTaskAbortService = packTaskAbortService; OpenSkuDetailCommand = new RelayCommand(OpenSkuDetail); SetBarCodeCommand = new RelayCommand(SetBarCode); SetCertificateCommand = new RelayCommand(SetCertificate); LookBarCommand = new RelayCommand(LookBar); LookCerCommand = new RelayCommand(LookCer); CompeteQualityTaskCommand = new RelayCommand(CompeteQualityTask); IncreateList = new ObservableCollection(); foreach (var item in increates) { IncreateList.Add(new IncreateModel { IncreateName = item, IsSelected = false }); } QualityTaskExceptionCommand = new RelayCommand(QualityTaskException); if (IsCanPackModelList == null) { var res = packTaskService.GetTaskAbortEnum(); if (res.Success) { IsCanPackModelList = res.Data.IsCanPackModelList; ShelvesNumberList = res.Data.ShelvesNumberList; FloorNumberList = res.Data.FloorNumberList; } } } List IsCanPackModelList { get; set; } List ShelvesNumberList { get; set; } List FloorNumberList { get; set; } PackTaskAbortService packTaskAbortService; #region 方法 private void QualityTaskException(object obj) { AddExceptionWindow addExceptionWindow = new AddExceptionWindow(packTaskAbortService, TaskId, Models.TaskState.待验收, () => { var window = obj as BWindow; App.Current.Dispatcher.Invoke(new Action(() => { window.Close(); })); ReflashWindow?.Invoke(); }, IsCanPackModelList, ShelvesNumberList, FloorNumberList); addExceptionWindow.ShowDialog(); } private void CompeteQualityTask(object obj) { //if (ArrivalQuantity == null) //{ // MessageBox.Show($"请输入到货数量"); // return; //} //if (GoodProductQuantity == null) //{ // MessageBox.Show($"请输入良品数量"); // return; //} //if (GoodProductQuantity > ArrivalQuantity) //{ // MessageBox.Show($"良品数量不能大于到货数量"); // return; //} // //if (GoodProductQuantity < SkuCount) //{ // MessageBox.Show($"良品数量不能低于任务数"); // return; // //if (MessageBox.Show("良品数小于任务数,确认则任务将异常挂起,是否确认?", "任务异常", MessageBoxButton.OKCancel, MessageBoxImage.Question) != MessageBoxResult.OK) // //{ // // return; // //} // //var res = qualityTaskService.QualityTaskException(TaskId, 0 , "良品数量小于任务数", TaskState.待验收); // //if (res == null || !res.Success) // //{ // // MessageBox.Show(res?.Msg); // // return; // //} // //App.Current.Dispatcher.Invoke(new Action(() => // //{ // // window.Close(); // //})); //} //if (ArrivalQuantity == 0) //{ // MessageBox.Show($"到货数量不能为0!"); // return; //} var request = new Models.APIModel.Request.QualityTaskRequest { //BasicPack = BasicPack, // ArrivalQuantity = SkuCount, // GoodProductQuantity = SkuCount, // Increment1 = string.Join(",", IncreateList.Where(i => i.IsSelected).Select(i => i.IncreateName)), BrandName = BrandName, //CertificatePosition = CertificatePosition, //OrderId = OrderId, //PackType = PackType, //GoodsNumber = GoodsNumber, //SkuGoodsTitle = SkuTitle, //SkuId = SkuId, TaskId = TaskId, BrandMarkType = BrandMarkType }; if (IsNeedBarCode == Need.需要) { if (BarCodeModel == null || BarCodeModel.Id <= 0) { MessageBox.Show("条形码不能为空"); return; } request.BarcodeId = BarCodeModel.Id; } if (IsNeedPrintCer == Need.需要) if (PurchaseSkuList != null && PurchaseSkuList.Count > 0 && purchaseSkuList.Any(p => p.IsNeedCer)) { if (PurchaseSkuList.Where(p => p.IsSetCertificate).Count() > 0) { MessageBox.Show("存在未确认的合格证,请先完成确认!"); return; } if (purchaseSkuList.Any(p => p.IsNeedCer && p.CerDTO == null)) { MessageBox.Show("有未设置的合格证,请设置完所有的合格证再保存"); return; } if (PurchaseSkuList.Where(p => p.IsNeedCer && p.CerDTO.Id > 0).Count() <= 0) { MessageBox.Show("无可选的合格证打印!"); return; } request.CerId = string.Join(",", PurchaseSkuList.Where(p => p.IsNeedCer && p.CerDTO.Id > 0).Select(p => p.CerDTO.Id)); } try { BatchPrintWindow batchPrint = new BatchPrintWindow(BrandMarkType, IsNeedPrintCer, TaskId, BrandName, SkuCount, PurchaseSkuList.Where(p => p.IsNeedCer && p.CerDTO != null && p.CerDTO.Id > 0).Select(p => p.CerDTO).ToArray() , BarCodeModel, qualityTaskService, () => { ReflashWindow?.Invoke(); var window = obj as BWindow; App.Current.Dispatcher.Invoke(new Action(() => { window.Close(); })); }); batchPrint.ShowDialog(); } catch (Exception ex) { System.Windows.MessageBox.Show(ex.Message); } } private void SetBarCode() { if (string.IsNullOrEmpty(SkuId)) { return; } if (BarCodeModel == null) { var resCode = packPurchaseTaskService.SearchBarCode(SkuId); if (resCode == null || !resCode.Success) { BarCodeModel = new BarCodeModel(); BarCodeModel.ProductNo = ProductNo; BarCodeModel.Brand = Brand; BarCodeModel.SkuId = SkuId; BarCodeModel.SkuName = SkuName; BarCodeModel.ShopName = OriginShopName; } else { BarCodeModel = resCode.Data; } } if (!string.IsNullOrEmpty(BrandName)) BarCodeModel.BrandName = BrandName; SetBarCodeWindow setBarCodeWindow = new SetBarCodeWindow(); setBarCodeWindow.LoadData(BarCodeModel, packTaskService); setBarCodeWindow.SaveResult = b => { BarCodeModel = b; IsSetBarCode = false; IsNeedBarCode = Need.需要; }; setBarCodeWindow.Show(); } /// /// 设置合格证 /// private void SetCertificate(PurchaseSku model) { if (model.CerDTO == null) { model.CerDTO = new CertificateModel { ProductNo = ProductNo, Brand = Brand, SkuId = SkuId, PurchaseSkuId = model.PurchaseSkuId }; } if (!string.IsNullOrEmpty(BrandName)) model.CerDTO.BrandName = BrandName; bool isNeedClick = true; if (CreateTime < Convert.ToDateTime("2023-08-21")) { isNeedClick = false; } else { isNeedClick = model.IsSetCertificate; } QualitySetCerWindow setCerWindow = new QualitySetCerWindow(isNeedClick, OrderId); setCerWindow.LoadData(model.IsNeedCer, model.CerDTO, packPurchaseTaskService, spuCertificateModel, IsSetSpuCertificate, saveType); setCerWindow.SaveResult = (s, PackCerState) => { if (string.IsNullOrEmpty(s.PurchaseSkuId)) { var sku = PurchaseSkuList.SingleOrDefault(p => p.CerDTO.GoodsNumber == s.GoodsNumber); sku.CerDTO = s; sku.IsSetCertificate = false; sku.IsNeedCer = PackCerState == PackCerState.合格证信息; IsNeedCertificateModel = Need.需要; return; } var skus = PurchaseSkuList.SingleOrDefault(p => p.CerDTO != null && p.CerDTO.PurchaseSkuId == s.PurchaseSkuId); skus.CerDTO = s; skus.IsSetCertificate = false; skus.IsNeedCer = PackCerState == PackCerState.合格证信息; IsNeedCertificateModel = Need.需要; }; setCerWindow.Show(); } /// /// 查看合格证 /// private void LookCer(CertificateModel certificate) { QualityLookCerWindow lookCerWindow = new QualityLookCerWindow(certificate); lookCerWindow.Show(); } /// /// 查看条形码 /// private void LookBar() { LookBarCodeWindow look = new LookBarCodeWindow(); look.SetData(BarCodeModel); look.Show(); } /// /// 搜索 skuId(todo:) /// public void LoadData(PackTaskModel model, Need cer, BrandMarkType brandMarkType, QualityTaskResponse qualityTaskResponse) { CreateTime = model.EndTime; OriginShopName = model.ShopName; // FloorDragNumber = 0; PurchaseSkuList = new ObservableCollection(); WareHourseList = new ObservableCollection(); TaskId = model.TaskId; OrderId = model.OrderId; SkuId = model.SkuId; SkuName = model.ItemList[0].SkuName; Logo = model.ItemList[0].Logo.Replace("80x80", "200x200"); BrandName = model.ItemList[0].BrandName; SkuCount = model.SkuCount; Brand = model.Brand; ProductNo = model.ProductNo; PackType = model.PackType; GoodsNumber = model.GoodsNumber; SkuTitle = model.SkuTitle; BasicPack = model.BasicPack; CertificatePosition = model.CertificatePosition; IncreateList = new ObservableCollection(); string[] increateDatas = model.Increment1?.Split(','); bool isSelected = false; foreach (var item in increates) { isSelected = false; if (increateDatas != null && increateDatas.Count() > 0 && increateDatas.Contains(item)) { isSelected = true; } App.Current.Dispatcher.Invoke(() => { IncreateList.Add(new IncreateModel { IncreateName = item, IsSelected = isSelected }); }); } Task.Factory.StartNew(() => { var resShow = markMessageService.ShowTaskMarkMessage(TaskId); if (resShow != null && resShow.Success && resShow.Data != null) { ShowMarkMessage = string.Join("\r\n", resShow.Data.Select(d => d.ToString())); } StoreGetSelfCount = qualityTaskResponse.StoreGetSelfCount; SkuPurchaseSchemeId = qualityTaskResponse.SkuPurchaseSchemeId; saveType = qualityTaskResponse.SaveType; if (saveType == null) { saveType = OrderId.IsNullOrEmpty() ? SaveType.C端 : SaveType.B端; } BarCodeModel = qualityTaskResponse.BarCodeDTO; IsNeedBarCode = qualityTaskResponse.IsNeedBar ? Need.需要 : Need.不需要; IsSetBarCode = qualityTaskResponse.BarCodeDTO == null ? true : false; IsNeedCertificateModel = qualityTaskResponse.IsNeedCer ? Need.需要 : Need.不需要; if (qualityTaskResponse.WareHourses != null) qualityTaskResponse.WareHourses.ToList().ForEach(w => { App.Current.Dispatcher.Invoke(new Action(() => { WareHourseList.Add(w); })); }); WareHourseCount = WareHourseList.Count(); if (qualityTaskResponse.PurchaseSkus != null) { int goodsIndex = 0; foreach (var item in qualityTaskResponse.PurchaseSkus) { goodsIndex++; if (item.CerDTO != null) item.CerDTO.GoodsNumberIndex = goodsIndex; item.IsSetCertificate = true; if (string.IsNullOrEmpty(item.PurchaseProductId)) { App.Current.Dispatcher.Invoke(new Action(() => { PurchaseSkuList.Add(item); })); continue; } var list = purchaseService.GetPurchaseSkuBasicInfo(item.PurchaseProductId); if (list == null && !list.Success && list.Data == null) { App.Current.Dispatcher.Invoke(new Action(() => { PurchaseSkuList.Add(item); })); continue; } PurchaseSkuItemBasicInfoResponse skuItem = null; if (list.Data != null) skuItem = list.Data.ItemList.FirstOrDefault(f => f.PurchaseSkuId == item.PurchaseSkuId); App.Current.Dispatcher.Invoke(new Action(() => { PurchaseSkuList.Add(new PurchaseSku { Logo = skuItem?.Logo, Title = skuItem?.Title, IsNeedCer = item.IsNeedCer, PurchaseSkuId = item.PurchaseSkuId, CerDTO = item.CerDTO, IsSetCertificate = item.IsNeedCer, }); })); //PurchaseSkuList.Add(item); } //if (cer == Need.不需要 && PurchaseSkuList != null) // foreach (var item in PurchaseSkuList) // { // item.IsNeedCer = false; // } } if (BarCodeModel == null) { //加载品牌品名数据 var shopList = globalContext.User.ShopList; var shop = shopList.FirstOrDefault(s => s.ShopName == model.ShopName); if (shop != null) { var skuResponse = productService.GetProductSkuList(string.Empty, SkuId, shop.Platform, shop.AppKey, shop.AppSecret, shop.AppToken); if (skuResponse.Success) { if (skuResponse.Data.Count == 0) { return; } Logo = skuResponse.Data[0].Logo.Replace("80x80", "200x200"); SkuName = skuResponse.Data[0].Title; SpuId = skuResponse.Data[0].ProductId; var productApiResponse = productService.GetProductList(skuResponse.Data[0].ProductId, string.Empty, string.Empty, 1, shop.Platform, shop.AppKey, shop.AppSecret, shop.AppToken); if (productApiResponse.Success) { if (productApiResponse.Data.Count == 0) { return; } ProductNo = productApiResponse.Data.Items[0].ProductItemNum; Brand = productApiResponse.Data.Items[0].BrandName; } } else { App.Current.Dispatcher.Invoke(() => MessageBox.Show(skuResponse.Msg, "加载sku")); return; } } } if (cer == Need.不需要) { CertificatePosition = CertificatePosition.无需合格证; } BrandMarkType = brandMarkType; IsNeedPrintCer = cer; }); } private Need IsNeedPrintCer; public Action ReflashWindow { get; set; } private void OpenSkuDetail(object param) { var paramList = (object[])param; // var orderId = paramList[0].ToString(); var skuId = paramList[0].ToString(); var url = $"https://item.jd.com/{skuId}.html"; try { System.Diagnostics.Process.Start("explorer.exe", url); } catch (Exception ex) { Clipboard.SetText(url); MessageBox.Show($"{ex.Message}\r\n调用浏览器失败,网页链接已复制到剪切板,请手动打开浏览器访问", "提示"); } } #endregion } }