diff --git a/DM_Weight/App.config b/DM_Weight/App.config index bd01fb4..60c148d 100644 --- a/DM_Weight/App.config +++ b/DM_Weight/App.config @@ -61,6 +61,8 @@ + + \ No newline at end of file diff --git a/DM_Weight/Report/GridReportUtil.cs b/DM_Weight/Report/GridReportUtil.cs index 3272696..f206326 100644 --- a/DM_Weight/Report/GridReportUtil.cs +++ b/DM_Weight/Report/GridReportUtil.cs @@ -301,7 +301,7 @@ namespace DM_Weight.Report }); Report.LoadFromFile(new FileInfo(AppDomain.CurrentDomain.BaseDirectory) + "ReportTemp//account_book_order.grf"); - SQL = $@"SELECT DISTINCT oi.recv_date,oi.p_name,oi.sex,oi.age,oi.id_number,oi.patient_no,oi.disease,dm.manu_no,od.Quantity,oi.doctor_name,oi.order_no,dm.reviewer,dm.operator,ul.user_name operatorName,ul2.user_name reviewerName + SQL = $@"SELECT DISTINCT oi.recv_date,oi.p_name,oi.sex,oi.age,oi.id_number,oi.patient_no,oi.patient_id,oi.disease,dm.manu_no,od.Quantity,oi.doctor_name,oi.order_no,dm.reviewer,dm.operator,ul.user_name operatorName,ul2.user_name reviewerName ,di.Drug_name,di.Drug_spec,di.big_unit,di.drug_id,dm.receivePerson from order_info oi inner join order_detail od on oi.order_no=od.Order_No LEFT JOIN dm_machine_record dm on oi.order_no=dm.invoice_id diff --git a/DM_Weight/ReportTemp/account_book_order.grf b/DM_Weight/ReportTemp/account_book_order.grf index 0562a7c..9356d8a 100644 --- a/DM_Weight/ReportTemp/account_book_order.grf +++ b/DM_Weight/ReportTemp/account_book_order.grf @@ -43,7 +43,7 @@ { "Name":"病历号", "Type":"Integer", - "DBFieldName":"patient_no" + "DBFieldName":"patient_id" }, { "Name":"疾病名称", diff --git a/DM_Weight/ViewModels/MainWindowViewModel.cs b/DM_Weight/ViewModels/MainWindowViewModel.cs index 532a969..048f8f4 100644 --- a/DM_Weight/ViewModels/MainWindowViewModel.cs +++ b/DM_Weight/ViewModels/MainWindowViewModel.cs @@ -76,7 +76,7 @@ namespace DM_Weight.ViewModels _screenUtil = screenUtil; _regionManager = regionManager; _container = container; - _portUtil = portUtil; + _portUtil = portUtil; //this.SqlSugarHelper.Db=sqlSugarScope; System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() => @@ -88,8 +88,11 @@ namespace DM_Weight.ViewModels _regionManager.RequestNavigate("MainRegion", "BeforeLogin"); })); - - Task.Factory.StartNew(() => BindStock()); + string bAutoWriteNum = ConfigurationManager.AppSettings["AutoWriteNum"] ?? "false"; + if (bAutoWriteNum == "true") + { + Task.Factory.StartNew(() => BindStock()); + } } void doMyPrismEvent2(AlertMsg msg) @@ -111,11 +114,12 @@ namespace DM_Weight.ViewModels //写标签数量 async Task BindStock() { - List singleChannels = SqlSugarHelper.Db.Queryable().Where(cs => cs.BoardType == 5&&cs.Quantity>0) - .Where(cs => cs.DrugId !=null) - .Where(cs=>cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1")).ToList(); + List singleChannels = SqlSugarHelper.Db.Queryable().Where(cs => cs.BoardType == 5 && cs.Quantity > 0) + .Where(cs => cs.DrugId != null) + .Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1")).ToList(); singleChannels = singleChannels.GroupBy(cs => new { cs.DrawerNo, cs.ColNo }) - .Select(cs => { + .Select(cs => + { var ret = cs.First(); ret.Quantity = cs.Sum(xt => xt.Quantity); return ret;