配置文件添加test,是测试则开药箱及查状态直接返回。核对处方去掉查询数据库
This commit is contained in:
parent
fd77a36296
commit
1ba351b659
|
@ -124,5 +124,6 @@
|
||||||
<add key="wsdSerialPort" value="COM1"/>
|
<add key="wsdSerialPort" value="COM1"/>
|
||||||
<!--温度查询定时执行时间-->
|
<!--温度查询定时执行时间-->
|
||||||
<add key="Interval" value="60000"/>
|
<add key="Interval" value="60000"/>
|
||||||
|
<add key="test" value="Y"/>
|
||||||
</appSettings>
|
</appSettings>
|
||||||
</configuration>
|
</configuration>
|
|
@ -57,6 +57,10 @@ namespace DM_Weight.Port
|
||||||
|
|
||||||
public bool[] GetAllBoxState()
|
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<Exception>()
|
bool[] bools = Policy.Handle<Exception>()
|
||||||
.Retry(3, (exception, retryCount) =>
|
.Retry(3, (exception, retryCount) =>
|
||||||
{
|
{
|
||||||
|
@ -85,6 +89,10 @@ namespace DM_Weight.Port
|
||||||
}
|
}
|
||||||
public bool OpenBoxDoor(int boxNum)
|
public bool OpenBoxDoor(int boxNum)
|
||||||
{
|
{
|
||||||
|
if (ConfigurationManager.AppSettings["test"]!=null&& ConfigurationManager.AppSettings["test"].ToString()=="Y")
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
bool bFlag=false;
|
bool bFlag=false;
|
||||||
Policy.Handle<Exception>().Retry(3, ((exception, retryCount) =>
|
Policy.Handle<Exception>().Retry(3, ((exception, retryCount) =>
|
||||||
{
|
{
|
||||||
|
|
|
@ -360,36 +360,36 @@ namespace DM_Weight.ViewModels
|
||||||
int totalCount = 0;
|
int totalCount = 0;
|
||||||
if (DrawerNo >= 0)
|
if (DrawerNo >= 0)
|
||||||
{
|
{
|
||||||
//查询当前药箱归属的药师
|
////查询当前药箱归属的药师
|
||||||
ChannelList currentList = SqlSugarHelper.Db.Queryable<ChannelList>().Where(cl => cl.DrawerNo == DrawerNo + 1 && cl.MachineId == "DM5").First();//.Select(cl => cl.BelongUser).First();
|
ChannelList currentList = SqlSugarHelper.Db.Queryable<ChannelList>().Where(cl => cl.DrawerNo == DrawerNo + 1 && cl.MachineId == "DM5").First();//.Select(cl => cl.BelongUser).First();
|
||||||
string currentDrawerUser = currentList.BelongUser;
|
//string currentDrawerUser = currentList.BelongUser;
|
||||||
OrderInfoList = SqlSugarHelper.Db.Queryable<OrderInfo>()
|
//OrderInfoList = SqlSugarHelper.Db.Queryable<OrderInfo>()
|
||||||
.Includes(oi => oi.OrderDetailList, od => od.DrugInfo)
|
// .Includes(oi => oi.OrderDetailList, od => od.DrugInfo)
|
||||||
//.Includes(cl => cl.channelStocks, cs => cs.DrugInfo,di=>di.drugBase)
|
// //.Includes(cl => cl.channelStocks, cs => cs.DrugInfo,di=>di.drugBase)
|
||||||
//.InnerJoin<OrderDetail>((oi, od) => oi.OrderNo == od.OrderNo)
|
// //.InnerJoin<OrderDetail>((oi, od) => oi.OrderNo == od.OrderNo)
|
||||||
//.InnerJoin<DrugInfo>((oi, od, di) => od.DrugId == di.DrugId.ToString())
|
// //.InnerJoin<DrugInfo>((oi, od, di) => od.DrugId == di.DrugId.ToString())
|
||||||
.WhereIF(OrderDate != null, oi => oi.RecvDate.ToString("yyyy-MM-dd") == OrderDate)
|
// .WhereIF(OrderDate != null, oi => oi.RecvDate.ToString("yyyy-MM-dd") == OrderDate)
|
||||||
.WhereIF(!String.IsNullOrEmpty(ConfigurationManager.AppSettings["storage"]), oi => oi.Pharmacy == ConfigurationManager.AppSettings["storage"])
|
// .WhereIF(!String.IsNullOrEmpty(ConfigurationManager.AppSettings["storage"]), oi => oi.Pharmacy == ConfigurationManager.AppSettings["storage"])
|
||||||
.Where(oi => oi.DmStatus == 0)
|
// .Where(oi => oi.DmStatus == 0)
|
||||||
.Where(oi => oi.HisDispFlag == 0)
|
// .Where(oi => oi.HisDispFlag == 0)
|
||||||
.Where(oi => oi.CancelFlag == 0)
|
// .Where(oi => oi.CancelFlag == 0)
|
||||||
.Where(oi => oi.DoctorCode == currentDrawerUser)
|
// .Where(oi => oi.DoctorCode == currentDrawerUser)
|
||||||
.OrderBy(oi => oi.OrderId)
|
// .OrderBy(oi => oi.OrderId)
|
||||||
.ToPageList(PageNum, PageSize, ref totalCount);
|
// .ToPageList(PageNum, PageSize, ref totalCount);
|
||||||
|
|
||||||
if (OrderInfoList != null && OrderInfoList.Count() > 0)
|
//if (OrderInfoList != null && OrderInfoList.Count() > 0)
|
||||||
{
|
//{
|
||||||
OrderInfoList.ForEach(oi => oi.ItemIsChecked = true);
|
// 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).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();
|
// 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
|
//else
|
||||||
{
|
//{
|
||||||
TotalDrugList = null;
|
// TotalDrugList = null;
|
||||||
}
|
//}
|
||||||
|
|
||||||
TotalCount = totalCount;
|
//TotalCount = totalCount;
|
||||||
PageCount = (int)Math.Ceiling((double)TotalCount / PageSize);
|
PageCount = (int)Math.Ceiling((double)TotalCount / PageSize);
|
||||||
if (Convert.ToDateTime(currentList.EffDate).ToString("yyyy-MM-dd") == DateTime.Now.ToString("yyyy-MM-dd"))
|
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(() =>
|
get => new DelegateCommand(() =>
|
||||||
{
|
{
|
||||||
CheckOrderAction();
|
//CheckOrderAction();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Grid Margin="6" Grid.Column="0">
|
<Grid Margin="6" Grid.Column="0">
|
||||||
<Grid.Resources>
|
<Grid.Resources>
|
||||||
|
@ -153,11 +153,11 @@
|
||||||
<Setter Property="Foreground" Value="White" />
|
<Setter Property="Foreground" Value="White" />
|
||||||
</Style>
|
</Style>
|
||||||
</ListView.Resources>
|
</ListView.Resources>
|
||||||
<i:Interaction.Triggers>
|
<!--<i:Interaction.Triggers>
|
||||||
<i:EventTrigger EventName="SelectionChanged">
|
<i:EventTrigger EventName="SelectionChanged">
|
||||||
<i:InvokeCommandAction Command="{Binding RowSelected}" />
|
<i:InvokeCommandAction Command="{Binding RowSelected}" />
|
||||||
</i:EventTrigger>
|
</i:EventTrigger>
|
||||||
</i:Interaction.Triggers>
|
</i:Interaction.Triggers>-->
|
||||||
<ListView.View>
|
<ListView.View>
|
||||||
<GridView ColumnHeaderContainerStyle="{StaticResource st}">
|
<GridView ColumnHeaderContainerStyle="{StaticResource st}">
|
||||||
<GridViewColumn Header="选择" Width="30">
|
<GridViewColumn Header="选择" Width="30">
|
||||||
|
@ -199,21 +199,21 @@
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</GridViewColumn.CellTemplate>
|
</GridViewColumn.CellTemplate>
|
||||||
</GridViewColumn>
|
</GridViewColumn>
|
||||||
<GridViewColumn Width="100" Header="药品批次">
|
<GridViewColumn Width="80" Header="药品批次">
|
||||||
<GridViewColumn.CellTemplate>
|
<GridViewColumn.CellTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<ListBox ItemsSource="{Binding OrderDetailList}" DisplayMemberPath="SetManuNo" materialDesign:ListBoxItemAssist.ShowSelection="False"></ListBox>
|
<ListBox ItemsSource="{Binding OrderDetailList}" DisplayMemberPath="SetManuNo" materialDesign:ListBoxItemAssist.ShowSelection="False"></ListBox>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</GridViewColumn.CellTemplate>
|
</GridViewColumn.CellTemplate>
|
||||||
</GridViewColumn>
|
</GridViewColumn>
|
||||||
<GridViewColumn Width="100" Header="药品效期">
|
<GridViewColumn Width="80" Header="药品效期">
|
||||||
<GridViewColumn.CellTemplate>
|
<GridViewColumn.CellTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<ListBox ItemsSource="{Binding OrderDetailList}" DisplayMemberPath="SetEffDate" materialDesign:ListBoxItemAssist.ShowSelection="False"></ListBox>
|
<ListBox ItemsSource="{Binding OrderDetailList}" DisplayMemberPath="SetEffDate" materialDesign:ListBoxItemAssist.ShowSelection="False"></ListBox>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</GridViewColumn.CellTemplate>
|
</GridViewColumn.CellTemplate>
|
||||||
</GridViewColumn>
|
</GridViewColumn>
|
||||||
<GridViewColumn Width="100" Header="数量">
|
<GridViewColumn Width="30" Header="数量">
|
||||||
<GridViewColumn.CellTemplate>
|
<GridViewColumn.CellTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<ListBox ItemsSource="{Binding OrderDetailList}" DisplayMemberPath="Quantity" materialDesign:ListBoxItemAssist.ShowSelection="False"></ListBox>
|
<ListBox ItemsSource="{Binding OrderDetailList}" DisplayMemberPath="Quantity" materialDesign:ListBoxItemAssist.ShowSelection="False"></ListBox>
|
||||||
|
|
Loading…
Reference in New Issue