修改核对处方时drawerno。去掉温湿度查询中的dispose
This commit is contained in:
		
							parent
							
								
									70e15f7b62
								
							
						
					
					
						commit
						bdd640775d
					
				| 
						 | 
				
			
			@ -1902,7 +1902,8 @@ namespace DM_Weight.Port
 | 
			
		|||
                //{
 | 
			
		||||
                //    wsdSerial.Close();
 | 
			
		||||
                //}
 | 
			
		||||
                master.Dispose();
 | 
			
		||||
                //master.Dispose();
 | 
			
		||||
                logger.Info($"获取温湿度{string.Join("", r)}");
 | 
			
		||||
            }
 | 
			
		||||
            catch (Exception ex)
 | 
			
		||||
            {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -65,7 +65,7 @@ namespace DM_Weight.ViewModels
 | 
			
		|||
            }
 | 
			
		||||
        }
 | 
			
		||||
        //所选药箱号
 | 
			
		||||
        private int _drawerNo = 0;
 | 
			
		||||
        private int _drawerNo = -1;
 | 
			
		||||
 | 
			
		||||
        public int DrawerNo
 | 
			
		||||
        {
 | 
			
		||||
| 
						 | 
				
			
			@ -144,7 +144,7 @@ namespace DM_Weight.ViewModels
 | 
			
		|||
        void RequestData()
 | 
			
		||||
        {
 | 
			
		||||
            int totalCount = 0;
 | 
			
		||||
            if (DrawerNo > 0)
 | 
			
		||||
            if (DrawerNo >= 0)
 | 
			
		||||
            {
 | 
			
		||||
                //查询当前药箱归属的药师
 | 
			
		||||
                string currentDrawerUser = SqlSugarHelper.Db.Queryable<ChannelList>().Where(cl => cl.DrawerNo == DrawerNo && cl.MachineId == "DM5").Select(cl => cl.BelongUser).First();
 | 
			
		||||
| 
						 | 
				
			
			@ -424,13 +424,14 @@ namespace DM_Weight.ViewModels
 | 
			
		|||
 | 
			
		||||
        public async void OpenBoxAction(string strDrawerNo)
 | 
			
		||||
        {
 | 
			
		||||
            DrawerNo = Convert.ToInt32(strDrawerNo)-1;
 | 
			
		||||
            DrawerNo = Convert.ToInt32(strDrawerNo);
 | 
			
		||||
            if (DrawerNo > 0)
 | 
			
		||||
            {
 | 
			
		||||
                DrawerNo -= 1;
 | 
			
		||||
                RequestData();
 | 
			
		||||
                IsEnable = false;
 | 
			
		||||
                Status = 1;
 | 
			
		||||
                _portUtil.SpeakAsync($"正在打开{DrawerNo}号药箱");
 | 
			
		||||
                _portUtil.SpeakAsync($"正在打开{DrawerNo+1}号药箱");
 | 
			
		||||
                //记录开药箱日志
 | 
			
		||||
                SqlSugarHelper.Db.Insertable(new MachineRecord()
 | 
			
		||||
                {
 | 
			
		||||
| 
						 | 
				
			
			@ -439,7 +440,7 @@ namespace DM_Weight.ViewModels
 | 
			
		|||
                    Operator = HomeWindowViewModel.Operator?.Id,
 | 
			
		||||
                    OperationTime = DateTime.Now,
 | 
			
		||||
                    Type = 55,
 | 
			
		||||
                    InvoiceId = $"打开{DrawerNo}号药箱",
 | 
			
		||||
                    InvoiceId = $"打开{DrawerNo+1}号药箱",
 | 
			
		||||
                }).ExecuteCommand();
 | 
			
		||||
                ModbusHelper.GetInstance().OpenBoxDoor(DrawerNo);
 | 
			
		||||
            }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -333,7 +333,7 @@ namespace DM_Weight.ViewModels
 | 
			
		|||
                    GroupNo = temp.GroupNo,
 | 
			
		||||
                    Temp = temp.Temp,
 | 
			
		||||
                    Humi = temp.Humi,
 | 
			
		||||
                    AddTime = temp.AddTime
 | 
			
		||||
                    AddTime = DateTime.Now
 | 
			
		||||
                }).ExecuteCommand();
 | 
			
		||||
                logger.Info($"保存温湿度信息:{temp.Temp},{temp.Humi}");
 | 
			
		||||
            }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -75,26 +75,26 @@
 | 
			
		|||
                <ColumnDefinition />
 | 
			
		||||
            </Grid.ColumnDefinitions>
 | 
			
		||||
 | 
			
		||||
            <Button Margin="0 0  3 0" Grid.Row="0" Grid.Column="0" Width="120" Content="1号药箱" Command="{Binding UpdateDrawerNo}" CommandParameter="1" IsEnabled="{Binding DrawerNo, Converter={StaticResource BoxNumConverter}, ConverterParameter=1}"/>
 | 
			
		||||
            <Button Margin="0 0  3 0" Grid.Row="1" Grid.Column="0" Width="120" Content="2号药箱" Command="{Binding UpdateDrawerNo}" CommandParameter="2" IsEnabled="{Binding DrawerNo, Converter={StaticResource BoxNumConverter}, ConverterParameter=2}"/>
 | 
			
		||||
            <Button Margin="0 0  3 0" Grid.Row="2" Grid.Column="0" Width="120" Content="3号药箱" Command="{Binding UpdateDrawerNo}" CommandParameter="3" IsEnabled="{Binding DrawerNo, Converter={StaticResource BoxNumConverter}, ConverterParameter=3}"/>
 | 
			
		||||
            <Button Margin="0 0  3 0" Grid.Row="3" Grid.Column="0" Width="120" Content="4号药箱" Command="{Binding UpdateDrawerNo}" CommandParameter="4" IsEnabled="{Binding DrawerNo, Converter={StaticResource BoxNumConverter}, ConverterParameter=4}"/>
 | 
			
		||||
            <Button Margin="0 0  3 0" Grid.Row="4" Grid.Column="0" Width="120" Content="5号药箱" Command="{Binding UpdateDrawerNo}" CommandParameter="5" IsEnabled="{Binding DrawerNo, Converter={StaticResource BoxNumConverter}, ConverterParameter=5}"/>
 | 
			
		||||
            <Button Margin="0 0  3 0" Grid.Row="5" Grid.Column="0" Width="120" Content="6号药箱" Command="{Binding UpdateDrawerNo}" CommandParameter="6" IsEnabled="{Binding DrawerNo, Converter={StaticResource BoxNumConverter}, ConverterParameter=6}"/>
 | 
			
		||||
            <Button Margin="0 0  3 0" Grid.Row="6" Grid.Column="0" Width="120" Content="7号药箱" Command="{Binding UpdateDrawerNo}" CommandParameter="7" IsEnabled="{Binding DrawerNo, Converter={StaticResource BoxNumConverter}, ConverterParameter=7}"/>
 | 
			
		||||
            <Button Margin="0 0  3 0" Grid.Row="7" Grid.Column="0" Width="120" Content="8号药箱" Command="{Binding UpdateDrawerNo}" CommandParameter="8" IsEnabled="{Binding DrawerNo, Converter={StaticResource BoxNumConverter}, ConverterParameter=8}"/>
 | 
			
		||||
            <Button Margin="0 0  3 0" Grid.Row="0" Grid.Column="0" Width="120" Content="1号药箱" Command="{Binding UpdateDrawerNo}" CommandParameter="1" IsEnabled="{Binding DrawerNo, Converter={StaticResource BoxNumConverter}, ConverterParameter=0}"/>
 | 
			
		||||
            <Button Margin="0 0  3 0" Grid.Row="1" Grid.Column="0" Width="120" Content="2号药箱" Command="{Binding UpdateDrawerNo}" CommandParameter="2" IsEnabled="{Binding DrawerNo, Converter={StaticResource BoxNumConverter}, ConverterParameter=1}"/>
 | 
			
		||||
            <Button Margin="0 0  3 0" Grid.Row="2" Grid.Column="0" Width="120" Content="3号药箱" Command="{Binding UpdateDrawerNo}" CommandParameter="3" IsEnabled="{Binding DrawerNo, Converter={StaticResource BoxNumConverter}, ConverterParameter=2}"/>
 | 
			
		||||
            <Button Margin="0 0  3 0" Grid.Row="3" Grid.Column="0" Width="120" Content="4号药箱" Command="{Binding UpdateDrawerNo}" CommandParameter="4" IsEnabled="{Binding DrawerNo, Converter={StaticResource BoxNumConverter}, ConverterParameter=3}"/>
 | 
			
		||||
            <Button Margin="0 0  3 0" Grid.Row="4" Grid.Column="0" Width="120" Content="5号药箱" Command="{Binding UpdateDrawerNo}" CommandParameter="5" IsEnabled="{Binding DrawerNo, Converter={StaticResource BoxNumConverter}, ConverterParameter=4}"/>
 | 
			
		||||
            <Button Margin="0 0  3 0" Grid.Row="5" Grid.Column="0" Width="120" Content="6号药箱" Command="{Binding UpdateDrawerNo}" CommandParameter="6" IsEnabled="{Binding DrawerNo, Converter={StaticResource BoxNumConverter}, ConverterParameter=5}"/>
 | 
			
		||||
            <Button Margin="0 0  3 0" Grid.Row="6" Grid.Column="0" Width="120" Content="7号药箱" Command="{Binding UpdateDrawerNo}" CommandParameter="7" IsEnabled="{Binding DrawerNo, Converter={StaticResource BoxNumConverter}, ConverterParameter=6}"/>
 | 
			
		||||
            <Button Margin="0 0  3 0" Grid.Row="7" Grid.Column="0" Width="120" Content="8号药箱" Command="{Binding UpdateDrawerNo}" CommandParameter="8" IsEnabled="{Binding DrawerNo, Converter={StaticResource BoxNumConverter}, ConverterParameter=7}"/>
 | 
			
		||||
                   
 | 
			
		||||
            <Button Margin="0 0  3 0" Grid.Row="8" Grid.Column="0" Width="120" Content="9号药箱" Command="{Binding UpdateDrawerNo}" CommandParameter="9"   IsEnabled="{Binding DrawerNo, Converter={StaticResource BoxNumConverter}, ConverterParameter=9}"/>
 | 
			
		||||
            <Button Margin="0 0  3 0" Grid.Row="0" Grid.Column="1" Width="120" Content="10号药箱" Command="{Binding UpdateDrawerNo}" CommandParameter="10" IsEnabled="{Binding DrawerNo, Converter={StaticResource BoxNumConverter}, ConverterParameter=10}"/>
 | 
			
		||||
            <Button Margin="0 0  3 0" Grid.Row="8" Grid.Column="0" Width="120" Content="9号药箱" Command="{Binding UpdateDrawerNo}" CommandParameter="9"   IsEnabled="{Binding DrawerNo, Converter={StaticResource BoxNumConverter}, ConverterParameter=8}"/>
 | 
			
		||||
            <Button Margin="0 0  3 0" Grid.Row="0" Grid.Column="1" Width="120" Content="10号药箱" Command="{Binding UpdateDrawerNo}" CommandParameter="10" IsEnabled="{Binding DrawerNo, Converter={StaticResource BoxNumConverter}, ConverterParameter=9}"/>
 | 
			
		||||
            
 | 
			
		||||
            <Button Grid.Row="1" Grid.Column="1" Width="120" Content="11号药箱" Command="{Binding UpdateDrawerNo}" CommandParameter="11" IsEnabled="{Binding DrawerNo, Converter={StaticResource BoxNumConverter}, ConverterParameter=11}"/>
 | 
			
		||||
            <Button Grid.Row="2" Grid.Column="1" Width="120" Content="12号药箱" Command="{Binding UpdateDrawerNo}" CommandParameter="12" IsEnabled="{Binding DrawerNo, Converter={StaticResource BoxNumConverter}, ConverterParameter=12}"/>
 | 
			
		||||
            <Button Grid.Row="3" Grid.Column="1" Width="120" Content="13号药箱" Command="{Binding UpdateDrawerNo}" CommandParameter="13" IsEnabled="{Binding DrawerNo, Converter={StaticResource BoxNumConverter}, ConverterParameter=13}"/>
 | 
			
		||||
            <Button Grid.Row="4" Grid.Column="1" Width="120" Content="14号药箱" Command="{Binding UpdateDrawerNo}" CommandParameter="14" IsEnabled="{Binding DrawerNo, Converter={StaticResource BoxNumConverter}, ConverterParameter=14}"/>
 | 
			
		||||
            <Button Grid.Row="5" Grid.Column="1" Width="120" Content="15号药箱" Command="{Binding UpdateDrawerNo}" CommandParameter="15" IsEnabled="{Binding DrawerNo, Converter={StaticResource BoxNumConverter}, ConverterParameter=15}"/>
 | 
			
		||||
            <Button Grid.Row="6" Grid.Column="1" Width="120" Content="16号药箱" Command="{Binding UpdateDrawerNo}" CommandParameter="16" IsEnabled="{Binding DrawerNo, Converter={StaticResource BoxNumConverter}, ConverterParameter=16}"/>
 | 
			
		||||
            <Button Grid.Row="7" Grid.Column="1" Width="120" Content="17号药箱" Command="{Binding UpdateDrawerNo}" CommandParameter="17" IsEnabled="{Binding DrawerNo, Converter={StaticResource BoxNumConverter}, ConverterParameter=17}"/>
 | 
			
		||||
            <Button Grid.Row="8" Grid.Column="1" Width="120" Content="18号药箱" Command="{Binding UpdateDrawerNo}" CommandParameter="18" IsEnabled="{Binding DrawerNo, Converter={StaticResource BoxNumConverter}, ConverterParameter=18}"/>
 | 
			
		||||
            <Button Grid.Row="1" Grid.Column="1" Width="120" Content="11号药箱" Command="{Binding UpdateDrawerNo}" CommandParameter="11" IsEnabled="{Binding DrawerNo, Converter={StaticResource BoxNumConverter}, ConverterParameter=10}"/>
 | 
			
		||||
            <Button Grid.Row="2" Grid.Column="1" Width="120" Content="12号药箱" Command="{Binding UpdateDrawerNo}" CommandParameter="12" IsEnabled="{Binding DrawerNo, Converter={StaticResource BoxNumConverter}, ConverterParameter=11}"/>
 | 
			
		||||
            <Button Grid.Row="3" Grid.Column="1" Width="120" Content="13号药箱" Command="{Binding UpdateDrawerNo}" CommandParameter="13" IsEnabled="{Binding DrawerNo, Converter={StaticResource BoxNumConverter}, ConverterParameter=12}"/>
 | 
			
		||||
            <Button Grid.Row="4" Grid.Column="1" Width="120" Content="14号药箱" Command="{Binding UpdateDrawerNo}" CommandParameter="14" IsEnabled="{Binding DrawerNo, Converter={StaticResource BoxNumConverter}, ConverterParameter=13}"/>
 | 
			
		||||
            <Button Grid.Row="5" Grid.Column="1" Width="120" Content="15号药箱" Command="{Binding UpdateDrawerNo}" CommandParameter="15" IsEnabled="{Binding DrawerNo, Converter={StaticResource BoxNumConverter}, ConverterParameter=14}"/>
 | 
			
		||||
            <Button Grid.Row="6" Grid.Column="1" Width="120" Content="16号药箱" Command="{Binding UpdateDrawerNo}" CommandParameter="16" IsEnabled="{Binding DrawerNo, Converter={StaticResource BoxNumConverter}, ConverterParameter=15}"/>
 | 
			
		||||
            <Button Grid.Row="7" Grid.Column="1" Width="120" Content="17号药箱" Command="{Binding UpdateDrawerNo}" CommandParameter="17" IsEnabled="{Binding DrawerNo, Converter={StaticResource BoxNumConverter}, ConverterParameter=16}"/>
 | 
			
		||||
            <Button Grid.Row="8" Grid.Column="1" Width="120" Content="18号药箱" Command="{Binding UpdateDrawerNo}" CommandParameter="18" IsEnabled="{Binding DrawerNo, Converter={StaticResource BoxNumConverter}, ConverterParameter=17}"/>
 | 
			
		||||
            <!--<Button Grid.Row="8" Grid.Column="1" Width="120" Content="19号药箱" Command="{Binding UpdateDrawerNo}" CommandParameter="19" IsEnabled="{Binding DrawerNo, Converter={StaticResource BoxNumConverter}, ConverterParameter=19}"/>
 | 
			
		||||
            <Button Grid.Row="9" Grid.Column="1" Width="120" Content="20号药箱" Command="{Binding UpdateDrawerNo}" CommandParameter="20" IsEnabled="{Binding DrawerNo, Converter={StaticResource BoxNumConverter}, ConverterParameter=20}"/>-->
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue