using GalaSoft.MvvmLight; using GalaSoft.MvvmLight.Command; using Microsoft.Win32; using MiniExcelLibs; using SlnMesnac.RfidUpload.NLog; using SlnMesnac.RfidUpload.Business; using SlnMesnac.RfidUpload.Common; using SlnMesnac.RfidUpload.Model; using SlnMesnac.RfidUpload.Model.apiParam; using SlnMesnac.RfidUpload.Model.config; using SlnMesnac.RfidUpload.TouchSocket; using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Threading.Tasks; using ApiServer = SlnMesnac.RfidUpload.TouchSocket.ApiServer; using System.Windows; using System.Threading; using static SlnMesnac.RfidUpload.UI.SelectRouterWindow; using static SlnMesnac.RfidUpload.UI.viewModel.containerStorageQueryByCsbViewModel; using SlnMesnac.RfidUpload.UI.TempData; using slnmesnac.rfidupload.Repository; using TouchSocket.Core; using System.Windows.Interop; using static Dm.net.buffer.ByteArrayBuffer; using System.IO; using System.Collections.Concurrent; using System.Drawing; namespace SlnMesnac.RfidUpload.UI.viewModel { public class MainWindowViewModel : ViewModelBase { private SqlSugarHelper sqliteHelper = SqlSugarHelper.Instance; private CsbHandleBusiness csbHandleBusiness = CsbHandleBusiness.Instance; TransferOrderViewModel transferOrderViewModel = new TransferOrderViewModel(); ContainerTransferOrderViewModel containerTransferOrderViewModel = new ContainerTransferOrderViewModel(); private readonly LogHelper logger = LogHelper.Instance; private readonly HandleBusiness _business = HandleBusiness.Instance; private readonly SerialPortBusiness _serialPortBusiness = SerialPortBusiness.Instance; private ObservableCollection listItems = new ObservableCollection(); private ObservableCollection labelItems = new ObservableCollection(); private WebApiServerApp webApiServerApp = WebApiServerApp.Instance; private ApiServer apiServer = ApiServer.GetInstance(); private AppConfig appConfig = AppConfig.Instance; private JsonChange jsonChange = JsonChange.Instance; private int No = 1; private SysData sysData = SysData.Instance; //暂存库存容器分发配发机构数据 private Institution Institution; #region 参数定义 #region 5秒以后才可以点击 private bool _isButtonEnabled = true; public bool IsButtonEnabled { get { return _isButtonEnabled; } set { _isButtonEnabled = value; RaisePropertyChanged(() => IsButtonEnabled); } } private string finishText = "完成"; public string FinishText { get { return finishText; } set { finishText = value; RaisePropertyChanged(() => FinishText); } } private void ButtonIsEnabled() { Application.Current.Dispatcher.Invoke(() => { FinishText = "请等待.."; IsButtonEnabled = false; }); //Task.Run(() => //{ // Thread.Sleep(5000); // Application.Current.Dispatcher.Invoke(() => // { // FinishText = "完成"; // IsButtonEnabled = true; // }); //}); } #endregion /// /// 标签数量 /// private int labelCountParam = 0; public int LabelCountParam { get { return labelCountParam; } set { labelCountParam = value;RaisePropertyChanged(() => LabelCountParam); } } /// /// 主界面当前调拨单号 /// private string _mainPageDbdh = ""; public string MainPageDbdh { get { return _mainPageDbdh; } set { _mainPageDbdh = value; RaisePropertyChanged(() => MainPageDbdh); } } /// /// 主界面当前送货单号 /// private string _trackNo = ""; public string TrackNo { get { return _trackNo; } set { _trackNo = value; RaisePropertyChanged(() => TrackNo); } } /// /// 主界面当前封发计划 /// private string _mainPageFfjhNo = ""; public string MainPageFfjhNo { get { return _mainPageFfjhNo; } set { _mainPageFfjhNo = value; RaisePropertyChanged(() => MainPageFfjhNo); } } /// /// 主界面提示信息 /// private string _mainPageTipMessage = ""; public string MainPageTipMessage { get { return _mainPageTipMessage; } set { _mainPageTipMessage = value; RaisePropertyChanged(() => MainPageTipMessage); } } /// /// 工作模式 /// private int workModelParam = 0; public int WorkModelParam { get { return workModelParam; } set { workModelParam = value; RaisePropertyChanged(() => WorkModelParam); } } /// /// 分发验证后的对象 /// private TransferOrderInfo _transferOrderInfo = new TransferOrderInfo(); public TransferOrderInfo TransferOrderInfoItem { get { return _transferOrderInfo; } set { _transferOrderInfo = value; RaisePropertyChanged(() => TransferOrderInfoItem); } } private int rfidDeviceStatus = 0; public int RfidDeviceStatus { get { return rfidDeviceStatus; } set { rfidDeviceStatus = value; RaisePropertyChanged(nameof(RfidDeviceStatus)); } } /// /// 日志打印ListBox /// private IEnumerable logInfoListBox; public IEnumerable LogInfoListBox { get { return logInfoListBox; } set { logInfoListBox = value; RaisePropertyChanged(() => LogInfoListBox); } } /// /// 标签信息DataGrid /// private IEnumerable labelInfoDataGrid; public IEnumerable LabelInfoDataGrid { get { return labelInfoDataGrid; } set { labelInfoDataGrid = value; RaisePropertyChanged(() => LabelInfoDataGrid); } } #endregion #region 事件定义 ///// ///// 打开串口 ///// //public RelayCommand OpenSerialPortCommand { get; set; } ///// ///// 关闭串口 ///// //public RelayCommand CloseSerialPortCommand { get; set; } /// /// 导出文件 /// public RelayCommand ExportFilesCommand { get; set; } #endregion /// /// 清空列表 /// public RelayCommand EmptyFilesCommand { get; set; } public RelayCommand FinishCommand { get; set; } public RelayCommand systemSetCommand { get; set; } /// /// 设置工作模式 /// public RelayCommand SetWorkModelCommand { get; set; } /// /// 打开数据重传记录界面 /// public RelayCommand ReUploadRecordCommand { get; set; } public MainWindowViewModel() { //加载标签信息 TouchSocketService.ReceiveCodeDelegateEvent += RefreshLabelInfoDataGrid; TouchSocketService.RefreshStateDelegateEvent += RefreshState; containerStorageQueryByCsbViewModel.RefreshSubmitVerifyEvent += RefreshSubmitVerify; containerStorageQueryByCsbViewModel.RefreshTrackNoEvent += RefreshTrackNo; TransferOrderViewModel.RefreshSubmitVerifyEvent += RefreshSubmitVerify; SelectRouterWindow.RefreshSubmitVerifyEvent += RefreshSubmitVerify; logger.Info("程序启动"); EmptyFilesCommand = new RelayCommand(EmptyFiles); ExportFilesCommand = new RelayCommand(ExportFiles); // OpenSerialPortCommand = new RelayCommand(OpenSerialPort); // CloseSerialPortCommand = new RelayCommand(CloseSerialPort); SetWorkModelCommand = new RelayCommand(SetWorkModel); systemSetCommand = new RelayCommand(SystemSet); FinishCommand = new RelayCommand(Finish); ReUploadRecordCommand = new RelayCommand(ReUploadRecord); this.Init(); // test1(); } private void test1() { int aa = sqliteHelper.GetBatchNo("1234"); sqliteHelper.AddBatchNo("1234"); int aa2 = sqliteHelper.GetBatchNo("1234"); int aa1 = sqliteHelper.GetBatchNo("234"); sqliteHelper.AddBatchNo("234"); int aa11 = sqliteHelper.GetBatchNo("234"); } private void ReUploadRecord() { ReUploadRecordWindow reUploadRecordWindow = new ReUploadRecordWindow(); reUploadRecordWindow.ShowDialog(); } private void RefreshState(bool flag) { if (flag) { RfidDeviceStatus = 1; } else { RfidDeviceStatus = 2; } } /// /// 清除日志文件 /// private void DeleteLogsLogic() { try { //获取当前程序运行目录下的logs文件夹 string logPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Log"); string[] strings = Directory.GetDirectories(logPath); foreach (string s in strings) { string dirName = Path.GetFileName(s); if (!string.IsNullOrEmpty(dirName)) { if (DateTime.TryParse(dirName, out DateTime dt)) { if (dt < DateTime.Now.AddDays(-10)) { Directory.Delete(s, true); } } } } } catch { } } private void Init() { // 初始化定时器 _batchTimer.Elapsed += OnBatchTimerElapsed; _batchTimer.AutoReset = true; _batchTimer.Start(); DeleteLogsLogic(); GetRfidList(); TouchSocketService service = new TouchSocketService(); service.AddTouchSocketAsync(appConfig.RFIDAddress); WorkModelParam = Convert.ToInt32(appConfig.workModel); } private void test() { //UploadRecord aa = sqliteHelper.GetRecordByFfjhNo("3455"); //List strList = aa.StrList.FromJsonString>(); //List strList = new List() //{ // "RFID1111","RFID2222","RFID3333","RFID4444" //}; //UploadRecord uploadRecord = new UploadRecord(); //uploadRecord.FfjhNo = "3455"; //uploadRecord.OpBatch = "1"; //uploadRecord.Ffjhscrq = "1"; //uploadRecord.StationOrgCode = "1"; //uploadRecord.StationOrgName = "1"; //uploadRecord.IsSuccess = 0; //uploadRecord.StrList = strList.ToJsonString(); //sqliteHelper.InsertRecord(uploadRecord); } /// /// 导出文件 /// private void ExportFiles() { try { var info = labelItems.ToList(); // 创建 SaveFileDialog 对象 SaveFileDialog saveFileDialog = new SaveFileDialog(); saveFileDialog.Filter = "Excel文件 (*.xlsx)|*.xlsx|所有文件 (*.*)|*.*"; saveFileDialog.Title = "保存文件"; saveFileDialog.FileName = $"标签信息{DateTime.Now.Date:yyyy-MM-dd}.xlsx"; if (saveFileDialog.ShowDialog() == true) { string filePath = saveFileDialog.FileName; MiniExcel.SaveAs(filePath, info); PrintMessageToListBox($"标签数据导出成功:{filePath}"); } } catch(Exception ex) { PrintMessageToListBox($"标签数据导出异常:{ex.Message}"); logger.Error($"标签数据导出异常", ex); } } private static INIFile iNIFile = new INIFile(System.Environment.CurrentDirectory + "/App.InI"); private void Finish() { try { ButtonIsEnabled(); // MessageBox.Show("数据上传中...5s以后才能再次点击"); if (workModelParam == 1) //新容器入库 { var info = labelItems.ToList(); var strList = info.Select(x => x.result).ToList(); string opBatch = System.Guid.NewGuid().ToString("N").Substring(0, 20); ListPage ls = new ListPage(strList, 500); CsbResult res = new CsbResult(); foreach (var enumerable in ls.GetPage()) { int batchNo = sqliteHelper.GetBatchNo(TrackNo); logger.Info($"=======记录---封发-按调拨单,送货单号:{TrackNo},批次号batchNo:{batchNo}"); res = csbHandleBusiness.containerStorageBatchQueryByCsb(TrackNo,batchNo.ToString(), enumerable.ToList()); PrintMessageToListBox($"新容器入库结果 [{res.GetMsg()}]"); sqliteHelper.AddBatchNo(TrackNo); int batchNo1 = sqliteHelper.GetBatchNo(TrackNo); logger.Info($"=======记录---封发-按调拨单,送货单号:{TrackNo},批次号batchNo+1后,数据库更新为:{batchNo1}"); } MainPageTipMessage = $"新容器入库 [{res.GetMsg()}]"; if (res.IsSuccess) { Task.Run(() => { Thread.Sleep(3000); CsbResult res = csbHandleBusiness.receContainerStorageByCsb(TrackNo, "1"); PrintMessageToListBox($"新容器入库反馈接口 [{res.GetMsg()}]"); Application.Current.Dispatcher.Invoke(() => { MainPageTipMessage = $"新容器入库反馈接口,[{res.GetMsg()}]"; }); EmptyFiles(); }); } } else if (workModelParam == 2) //封发-按调拨单 { var info = labelItems.ToList(); var strList = info.Select(x => x.result).ToList(); //string dbdh = info.First().dbdh; // logger.Info($"记录---封发-按调拨单,dbdh:{dbdh}"); string opBatch = System.Guid.NewGuid().ToString("N").Substring(0, 20); ListPage ls = new ListPage(strList, 500); CsbResult res = new CsbResult(); foreach (var enumerable in ls.GetPage()) { int batchNo = sqliteHelper.GetBatchNo(TransferOrderInfoItem.ffjhNo); logger.Info($"=======记录---封发-按调拨单,TransferOrderInfoItem.ffjhNo:{TransferOrderInfoItem.ffjhNo},批次号batchNo:{batchNo}"); res = csbHandleBusiness.containerScanSealByCsb(TransferOrderInfoItem.ffjhNo, opBatch, TransferOrderInfoItem.ffjhscrq, batchNo.ToString(), enumerable.ToList()); PrintMessageToListBox($"封发-按调拨单结果 [{res.GetMsg()}]"); sqliteHelper.AddBatchNo(TransferOrderInfoItem.ffjhNo); int batchNo1 = sqliteHelper.GetBatchNo(TransferOrderInfoItem.ffjhNo); // logger.Info($"=======记录---封发-按调拨单,dbdh:{TransferOrderInfoItem.ffjhNo},批次号batchNo+1后,数据库更新为:{batchNo1}"); } // MessageBox.Show($"封发-按调拨单 [{res.GetMsg()}]"); MainPageTipMessage = $"封发-按调拨单 [{res.GetMsg()}]"; if (res.IsSuccess) { Task.Run(() => { //若干秒以后调反馈接口,确认是否和实际相符 Thread.Sleep(3000); CsbResult res = csbHandleBusiness.containerScanSealResultByCsb(TransferOrderInfoItem.ffjhNo, opBatch); Application.Current.Dispatcher.Invoke(() => { MainPageTipMessage = $"封发-按调拨单反馈接口,[{res.GetMsg()}]"; PrintMessageToListBox($"封发-按调拨单反馈接口结果 [{res.GetMsg()}]"); // 如果需要弹出消息框,也需要在 UI 线程调用 MessageBox // MessageBox.Show($"封发-按调拨单反馈接口,[{res.GetMsg()}]"); }); EmptyFiles(); }); } } else if (WorkModelParam == 3 || WorkModelParam == 4) //库存容器封发配发 -- 6.13.容器直连配发-开始配发 { //四、6.9接收容器条码接口 var info = labelItems.ToList(); var strList = info.Select(x => x.result).ToList(); string dbdh = info.First().dbdh; string opBatch = OpBatchManager.BathNo; var dt = new Dbt(); dt.opBatch = opBatch; dt.ffjhNo = TransferOrderInfoItem.ffjhNo; dt.No = ""; dt.ffjhscrq = TransferOrderInfoItem.ffjhscrq; dt.stationOrgCode = Institution.stationOrgCode; dt.stationOrgName = Institution.stationOrgName; #region 存数据库 UploadRecord uploadRecord = new UploadRecord(); uploadRecord.FfjhNo = dt.ffjhNo; uploadRecord.OpBatch = dt.opBatch; uploadRecord.Ffjhscrq = dt.ffjhscrq; uploadRecord.StationOrgCode = dt.stationOrgCode; uploadRecord.StationOrgName = dt.stationOrgName; uploadRecord.IsSuccess = 0; uploadRecord.StrList = strList.ToJsonString(); uploadRecord.UploadTime = DateTime.Now.ToString(); sqliteHelper.InsertRecord(uploadRecord); #endregion Action ac = (x, msg) => { if (x == 0) { PrintMessageToListBox($"封发-按调拨单接口结果 [{msg}]"); } if (x == 1) { MainPageTipMessage = $"封发-按调拨单反馈接口,[{msg}]"; PrintMessageToListBox($"封发-按调拨单反馈接口,[{msg}"); } if (x == 2) { MainPageTipMessage = $"校验发运计划结果,[{msg}]"; PrintMessageToListBox($"校验发运计划结果,[{msg}"); } if (x == 3) { MainPageTipMessage = $"库存容器封发配发 -- 6.13.容器直连配发-开始配发,[{msg}]"; PrintMessageToListBox($"库存容器封发配发 -- 6.13.容器直连配发-开始配发,[{msg}"); } if (x == 4) { MainPageTipMessage = $"反馈接收接口,确认是否和实际相符,[{msg}]"; PrintMessageToListBox($"反馈接收接口,确认是否和实际相符,[{msg}"); } }; try { Tool.Push(strList, dt, ac); }catch(Exception ex) { MainPageTipMessage = $"数据上传失败:{ex.Message}"; PrintMessageToListBox($"数据上传失败:{ex.Message}"); } finally { EmptyFiles(); } //string opBatch = OpBatchManager.BathNo; //CsbResult res = csbHandleBusiness.containerAllotByCsb(TransferOrderInfoItem.ffjhNo,opBatch); //MessageBox.Show($"库存容器封发配发 -- 6.13.容器直连配发-开始配发 [{res.GetMsg()}]"); //Task.Run(() => //{ // Thread.Sleep(3000); // //若干秒以后调反馈接口,确认是否和实际相符 // CsbResult res = csbHandleBusiness.containerAllotResultByCsb(TransferOrderInfoItem.ffjhNo, opBatch); // MessageBox.Show($"库存容器封发配发--若干秒以后调反馈接口,确认是否和实际相符[{res.GetMsg()}]"); //}); } else if (workModelParam == -1) { MessageBox.Show("工作模式错误"); return; } }catch(Exception ex) { MessageBox.Show(ex.Message); Application.Current.Dispatcher.Invoke(() => { FinishText = "完成"; IsButtonEnabled = true; }); } finally { } } private void SystemSet() { systemSetWindow systemSetWindow = new systemSetWindow(); systemSetWindow.ShowDialog(); } private void SetWorkModel(object modelFlag) { // WorkModelParam = Convert.ToInt32(modelFlag); int WorkModel = Convert.ToInt32(modelFlag); // appConfig.workModel = this.workModelParam.ToString(); //TransferOrderWindow transferOrderWindow = new TransferOrderWindow(transferOrderViewModel); //transferOrderWindow.ShowDialog(); if(WorkModel == 1) //新容器入库 { containerStorageQueryByCsb storageQueryByCsb = new containerStorageQueryByCsb(); storageQueryByCsb.ShowDialog(); } else if(WorkModel == 2) //容器封发-按调拨单 { TransferOrderWindow transferOrderWindow = new TransferOrderWindow(transferOrderViewModel); transferOrderWindow.ShowDialog(); } else if (WorkModel == 3) //库存容器封发配发 { containerTransferOrderViewModel.BelongPage = 3; ContainerTransferOrderWindow containerTransferOrderWindow = new ContainerTransferOrderWindow(containerTransferOrderViewModel); containerTransferOrderWindow.ShowDialog(); } else if (WorkModel == 4) //卸车容器封发配发 { containerTransferOrderViewModel.BelongPage = 4; ContainerTransferOrderWindow containerTransferOrderWindow = new ContainerTransferOrderWindow(containerTransferOrderViewModel); containerTransferOrderWindow.ShowDialog(); }else if (WorkModel == 5) //退出 { System.Environment.Exit(0); } } /// /// 清空标签信息列表 /// private void EmptyFiles() { Application.Current.Dispatcher.Invoke(() => { FinishText = "完成"; IsButtonEnabled = true; labelItems.Clear(); // 清空 labelItems 集合 LabelInfoDataGrid = Enumerable.Empty(); LabelCountParam = 0; _rfidQueue.Clear(); _dataGridQueue.Clear(); _labelResultSet.Clear(); No = 0; MainPageTipMessage = ""; }); sqliteHelper.DeleteRFIDList(); GetRfidList(); #region test //Task.Run(() => //{ // for (int i = 0; i < 1000; i++) // { // RefreshLabelInfoDataGrid($"B{i}"); // } //}); #endregion } /// /// 从数据库加载到界面 /// private void GetRfidList() { No = 0; labelItems.Clear(); LabelCountParam = 0; _rfidQueue.Clear(); _dataGridQueue.Clear(); _labelResultSet.Clear(); List rfidInfos = sqliteHelper.GetRFIDList(); // 根据 Result 字段去重 rfidInfos = rfidInfos.GroupBy(r => r.Result) .Select(g => g.First()) .ToList(); if (rfidInfos != null&& rfidInfos.Count > 0) { foreach (var item in rfidInfos) { _labelResultSet.Add(item.Result); App.Current.Dispatcher.BeginInvoke((Action)(() => { int no = labelItems.Count; DataGridEnt dataGridEnt = new DataGridEnt(); dataGridEnt.no = ++no; dataGridEnt.dbdh = _transferOrderInfo.dbdh; dataGridEnt.result = item.Result; dataGridEnt.recordtime = DateTime.Now; labelItems.Add(dataGridEnt); LabelInfoDataGrid = labelItems; LabelCountParam += 1; })); } } } /// /// TCP接收到RFID信息---卡死,暂不使用 /// /// private void RefreshLabelInfoDataGrid1(string code) { RfidInfo rfidInfo = new RfidInfo(); rfidInfo.Dbdh = _transferOrderInfo.dbdh; rfidInfo.Result = code; rfidInfo.RecordTime = DateTime.Now.ToString(); sqliteHelper.InsertRFID(rfidInfo); bool IsHas = labelItems.Any(x => x.result == code); if (IsHas) { return; } PrintMessageToListBox(code); App.Current.Dispatcher.BeginInvoke((Action)(() => { int no =labelItems.Count; DataGridEnt dataGridEnt = new DataGridEnt(); dataGridEnt.no = ++no; dataGridEnt.dbdh = _transferOrderInfo.dbdh; dataGridEnt.result = code; dataGridEnt.recordtime = DateTime.Now; labelItems.Add(dataGridEnt); LabelInfoDataGrid = labelItems; LabelCountParam += 1; })); } #region 优化卡死 // 使用线程安全的队列存储待处理的数据 private readonly ConcurrentQueue _rfidQueue = new ConcurrentQueue(); private readonly ConcurrentQueue _dataGridQueue = new ConcurrentQueue(); // 使用 HashSet 提高查找效率 private readonly HashSet _labelResultSet = new HashSet(); // 批量处理数据 private readonly System.Timers.Timer _batchTimer = new System.Timers.Timer(2000); /// /// TCP接收到RFID信息 /// /// private void RefreshLabelInfoDataGrid(string code) { if (string.IsNullOrEmpty(_transferOrderInfo.dbdh)) { return; } // 检查是否已存在 if (_labelResultSet.Contains(code)) { return; } // 添加到 HashSet _labelResultSet.Add(code); // 打印消息------改,批量刷新 PrintMessageToListBox(code); // 创建 RFID 信息并加入队列 var rfidInfo = new RfidInfo { Dbdh = _transferOrderInfo.dbdh, Result = code, RecordTime = DateTime.Now.ToString() }; _rfidQueue.Enqueue(rfidInfo); // 创建界面数据并加入队列 LabelCountParam += 1; int no = labelCountParam; var dataGridEnt = new DataGridEnt { no = no, dbdh = _transferOrderInfo.dbdh, result = code, recordtime = DateTime.Now }; _dataGridQueue.Enqueue(dataGridEnt); } private void OnBatchTimerElapsed(object sender, System.Timers.ElapsedEventArgs e) { // 批量插入数据库 BatchInsertRfidData(); // 批量刷新界面 BatchRefreshUI(); } private void BatchInsertRfidData() { // 从队列中批量取出数据 var batch = new List(); while (_rfidQueue.TryDequeue(out var rfidInfo)) { batch.Add(rfidInfo); if (batch.Count >= 300) // 每批最多 100 条 { break; } } // 批量插入数据库 if (batch.Count > 0) { sqliteHelper.InsertRFIDList(batch); } } private void BatchRefreshUI() { // 从队列中批量取出数据 var batch = new List(); while (_dataGridQueue.TryDequeue(out var dataGridEnt)) { batch.Add(dataGridEnt); if (batch.Count >= 100) { break; } } // 批量更新界面 if (batch.Count > 0) { App.Current.Dispatcher.BeginInvoke((Action)(() => { foreach (var item in batch) { labelItems.Add(item); } LabelInfoDataGrid = new ObservableCollection(labelItems); })); } } #endregion /// /// listBox绑定日志 /// /// private void PrintMessageToListBox(string message) { lock (string.Empty) { try { listItems.Add($"{DateTime.Now.ToString("HH:mm:ss")}==>{message}"); LogInfoListBox = listItems.OrderByDescending(x => x); } catch (Exception ex) { logger.Error("日志数据绑定异常", ex); } } } ///// ///// 转换校验位 ///// ///// //private void GetParity(out int parity) //{ // switch (_selectedParityItems) // { // case "None": // parity = 0; // break; // case "Odd": // parity = 1; // break; // case "Even": // parity = 2; // break; // case "Mark": // parity = 3; // break; // case "Space": // parity = 4; // break; // default: // parity = 0; // break; // } //} /// /// /// model -当前工作模式 /// msg -接口返回信息 /// dbdh -调拨单号 /// /// /// /// private void RefreshSubmitVerify(int model,string msg,TransferOrderInfo transferOrderInfo=null, Institution institution = null) { MainPageTipMessage = msg; appConfig.workModel = model.ToString(); WorkModelParam = model ; if (transferOrderInfo != null) { MainPageDbdh = transferOrderInfo.dbdh; MainPageFfjhNo = transferOrderInfo.ffjhNo; TransferOrderInfoItem = transferOrderInfo; } if(institution != null) { Institution = institution; } } private void RefreshTrackNo(string trackNo) { MainPageTipMessage = "trackNo:" + trackNo; TrackNo = trackNo; } } } class DataGridEnt { public int no { get; set; } public string dbdh { get; set; } public string result { get; set; } public DateTime recordtime { get; set; } }