diff --git a/DM_Weight/App.config b/DM_Weight/App.config index 27b072d..3f0b3a8 100644 --- a/DM_Weight/App.config +++ b/DM_Weight/App.config @@ -124,5 +124,6 @@ + \ No newline at end of file diff --git a/DM_Weight/Port/ModbusHelper.cs b/DM_Weight/Port/ModbusHelper.cs index ce87f4a..5d3c9a5 100644 --- a/DM_Weight/Port/ModbusHelper.cs +++ b/DM_Weight/Port/ModbusHelper.cs @@ -57,6 +57,10 @@ namespace DM_Weight.Port public bool[] GetAllBoxState() { + if (ConfigurationManager.AppSettings["test"] != null && ConfigurationManager.AppSettings["test"].ToString() == "Y") + { + return new bool[] { false,false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false}; + } bool[] bools = Policy.Handle() .Retry(3, (exception, retryCount) => { @@ -85,6 +89,10 @@ namespace DM_Weight.Port } public bool OpenBoxDoor(int boxNum) { + if (ConfigurationManager.AppSettings["test"]!=null&& ConfigurationManager.AppSettings["test"].ToString()=="Y") + { + return true; + } bool bFlag=false; Policy.Handle().Retry(3, ((exception, retryCount) => { diff --git a/DM_Weight/ViewModels/CheckOrderNewWindowViewModel.cs b/DM_Weight/ViewModels/CheckOrderNewWindowViewModel.cs index 7f01d92..8a828d1 100644 --- a/DM_Weight/ViewModels/CheckOrderNewWindowViewModel.cs +++ b/DM_Weight/ViewModels/CheckOrderNewWindowViewModel.cs @@ -360,36 +360,36 @@ namespace DM_Weight.ViewModels int totalCount = 0; if (DrawerNo >= 0) { - //查询当前药箱归属的药师 + ////查询当前药箱归属的药师 ChannelList currentList = SqlSugarHelper.Db.Queryable().Where(cl => cl.DrawerNo == DrawerNo + 1 && cl.MachineId == "DM5").First();//.Select(cl => cl.BelongUser).First(); - string currentDrawerUser = currentList.BelongUser; - OrderInfoList = SqlSugarHelper.Db.Queryable() - .Includes(oi => oi.OrderDetailList, od => od.DrugInfo) - //.Includes(cl => cl.channelStocks, cs => cs.DrugInfo,di=>di.drugBase) - //.InnerJoin((oi, od) => oi.OrderNo == od.OrderNo) - //.InnerJoin((oi, od, di) => od.DrugId == di.DrugId.ToString()) - .WhereIF(OrderDate != null, oi => oi.RecvDate.ToString("yyyy-MM-dd") == OrderDate) - .WhereIF(!String.IsNullOrEmpty(ConfigurationManager.AppSettings["storage"]), oi => oi.Pharmacy == ConfigurationManager.AppSettings["storage"]) - .Where(oi => oi.DmStatus == 0) - .Where(oi => oi.HisDispFlag == 0) - .Where(oi => oi.CancelFlag == 0) - .Where(oi => oi.DoctorCode == currentDrawerUser) - .OrderBy(oi => oi.OrderId) - .ToPageList(PageNum, PageSize, ref totalCount); + //string currentDrawerUser = currentList.BelongUser; + //OrderInfoList = SqlSugarHelper.Db.Queryable() + // .Includes(oi => oi.OrderDetailList, od => od.DrugInfo) + // //.Includes(cl => cl.channelStocks, cs => cs.DrugInfo,di=>di.drugBase) + // //.InnerJoin((oi, od) => oi.OrderNo == od.OrderNo) + // //.InnerJoin((oi, od, di) => od.DrugId == di.DrugId.ToString()) + // .WhereIF(OrderDate != null, oi => oi.RecvDate.ToString("yyyy-MM-dd") == OrderDate) + // .WhereIF(!String.IsNullOrEmpty(ConfigurationManager.AppSettings["storage"]), oi => oi.Pharmacy == ConfigurationManager.AppSettings["storage"]) + // .Where(oi => oi.DmStatus == 0) + // .Where(oi => oi.HisDispFlag == 0) + // .Where(oi => oi.CancelFlag == 0) + // .Where(oi => oi.DoctorCode == currentDrawerUser) + // .OrderBy(oi => oi.OrderId) + // .ToPageList(PageNum, PageSize, ref totalCount); - if (OrderInfoList != null && OrderInfoList.Count() > 0) - { - OrderInfoList.ForEach(oi => oi.ItemIsChecked = true); - //TotalDrugList = OrderInfoList.Where(oi => oi.ItemIsChecked).GroupBy(oi => oi.OrderDetailList.DrugInfo.DrugName).Select(oi => new TotalDrug { DrugName = oi.Key, TotalCount = oi.Sum(item => item.OrderDetailList.Quantity) }).ToList(); - TotalDrugList = OrderInfoList.Where(oi => oi.ItemIsChecked).SelectMany(OrderDetailList => OrderDetailList.OrderDetailList).GroupBy(item => item.DrugInfo.DrugName).Select(group => new TotalDrug { DrugName = group.Key, TotalCount = group.Sum(item => item.Quantity) }).ToList(); + //if (OrderInfoList != null && OrderInfoList.Count() > 0) + //{ + // OrderInfoList.ForEach(oi => oi.ItemIsChecked = true); + // //TotalDrugList = OrderInfoList.Where(oi => oi.ItemIsChecked).GroupBy(oi => oi.OrderDetailList.DrugInfo.DrugName).Select(oi => new TotalDrug { DrugName = oi.Key, TotalCount = oi.Sum(item => item.OrderDetailList.Quantity) }).ToList(); + // TotalDrugList = OrderInfoList.Where(oi => oi.ItemIsChecked).SelectMany(OrderDetailList => OrderDetailList.OrderDetailList).GroupBy(item => item.DrugInfo.DrugName).Select(group => new TotalDrug { DrugName = group.Key, TotalCount = group.Sum(item => item.Quantity) }).ToList(); - } - else - { - TotalDrugList = null; - } + //} + //else + //{ + // TotalDrugList = null; + //} - TotalCount = totalCount; + //TotalCount = totalCount; PageCount = (int)Math.Ceiling((double)TotalCount / PageSize); if (Convert.ToDateTime(currentList.EffDate).ToString("yyyy-MM-dd") == DateTime.Now.ToString("yyyy-MM-dd")) { @@ -562,7 +562,7 @@ namespace DM_Weight.ViewModels { get => new DelegateCommand(() => { - CheckOrderAction(); + //CheckOrderAction(); }); } diff --git a/DM_Weight/Views/CheckOrderNewWindow.xaml b/DM_Weight/Views/CheckOrderNewWindow.xaml index c2d3f88..f5c5271 100644 --- a/DM_Weight/Views/CheckOrderNewWindow.xaml +++ b/DM_Weight/Views/CheckOrderNewWindow.xaml @@ -34,7 +34,7 @@ - + @@ -153,11 +153,11 @@ - + @@ -199,21 +199,21 @@ - + - + - +