添加项目文件。
| 
						 | 
					@ -0,0 +1,13 @@
 | 
				
			||||||
 | 
					<Project Sdk="Microsoft.NET.Sdk">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  <PropertyGroup>
 | 
				
			||||||
 | 
					    <TargetFramework>net6.0-windows</TargetFramework>
 | 
				
			||||||
 | 
					    <Nullable>enable</Nullable>
 | 
				
			||||||
 | 
					    <UseWPF>true</UseWPF>
 | 
				
			||||||
 | 
					  </PropertyGroup>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  <ItemGroup>
 | 
				
			||||||
 | 
					    <PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.39" />
 | 
				
			||||||
 | 
					  </ItemGroup>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					</Project>
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,75 @@
 | 
				
			||||||
 | 
					using Microsoft.Xaml.Behaviors;
 | 
				
			||||||
 | 
					using System.Collections.ObjectModel;
 | 
				
			||||||
 | 
					using System.Windows;
 | 
				
			||||||
 | 
					using System.Windows.Controls;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Commons.ValidatRules
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    public class ValidationErrorMappingBehavior : Behavior<FrameworkElement>
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        #region Properties
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public static readonly DependencyProperty ValidationErrorsProperty =
 | 
				
			||||||
 | 
					            DependencyProperty.Register("ValidationErrors", typeof(ObservableCollection<ValidationError>),
 | 
				
			||||||
 | 
					                typeof(ValidationErrorMappingBehavior), new PropertyMetadata(new ObservableCollection<ValidationError>()));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public ObservableCollection<ValidationError> ValidationErrors
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get { return (ObservableCollection<ValidationError>)this.GetValue(ValidationErrorsProperty); }
 | 
				
			||||||
 | 
					            set { this.SetValue(ValidationErrorsProperty, value); }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public static readonly DependencyProperty HasValidationErrorProperty = DependencyProperty.Register("HasValidationError",
 | 
				
			||||||
 | 
					            typeof(bool), typeof(ValidationErrorMappingBehavior), new PropertyMetadata(false));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public bool HasValidationError
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get { return (bool)this.GetValue(HasValidationErrorProperty); }
 | 
				
			||||||
 | 
					            set { this.SetValue(HasValidationErrorProperty, value); }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        #endregion
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        #region Constructors
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public ValidationErrorMappingBehavior()
 | 
				
			||||||
 | 
					            : base()
 | 
				
			||||||
 | 
					        { }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        #endregion
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        #region Events & Event Methods
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        private void Validation_Error(object sender, ValidationErrorEventArgs e)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            if (e.Action == ValidationErrorEventAction.Added)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                this.ValidationErrors.Add(e.Error);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            else
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                this.ValidationErrors.Remove(e.Error);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            this.HasValidationError = this.ValidationErrors.Count > 0;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        #endregion
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        #region Support Methods
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        protected override void OnAttached()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            base.OnAttached();
 | 
				
			||||||
 | 
					            Validation.AddErrorHandler(this.AssociatedObject, Validation_Error);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        protected override void OnDetaching()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            base.OnDetaching();
 | 
				
			||||||
 | 
					            Validation.RemoveErrorHandler(this.AssociatedObject, Validation_Error);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        #endregion
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,51 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Microsoft Visual Studio Solution File, Format Version 12.00
 | 
				
			||||||
 | 
					# Visual Studio Version 17
 | 
				
			||||||
 | 
					VisualStudioVersion = 17.3.32922.545
 | 
				
			||||||
 | 
					MinimumVisualStudioVersion = 10.0.40219.1
 | 
				
			||||||
 | 
					Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DM_Weight", "DM_Weight\DM_Weight.csproj", "{439FA76B-F874-40DB-BAF2-E3647CD55B10}"
 | 
				
			||||||
 | 
					EndProject
 | 
				
			||||||
 | 
					Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DM_Weight.Commons", "DM_Weight.Commons\DM_Weight.Commons.csproj", "{7F9FA18B-5C28-476E-97D4-B5504B8DEB9B}"
 | 
				
			||||||
 | 
					EndProject
 | 
				
			||||||
 | 
					Global
 | 
				
			||||||
 | 
						GlobalSection(SolutionConfigurationPlatforms) = preSolution
 | 
				
			||||||
 | 
							Debug|Any CPU = Debug|Any CPU
 | 
				
			||||||
 | 
							Debug|x64 = Debug|x64
 | 
				
			||||||
 | 
							Debug|x86 = Debug|x86
 | 
				
			||||||
 | 
							Release|Any CPU = Release|Any CPU
 | 
				
			||||||
 | 
							Release|x64 = Release|x64
 | 
				
			||||||
 | 
							Release|x86 = Release|x86
 | 
				
			||||||
 | 
						EndGlobalSection
 | 
				
			||||||
 | 
						GlobalSection(ProjectConfigurationPlatforms) = postSolution
 | 
				
			||||||
 | 
							{439FA76B-F874-40DB-BAF2-E3647CD55B10}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 | 
				
			||||||
 | 
							{439FA76B-F874-40DB-BAF2-E3647CD55B10}.Debug|Any CPU.Build.0 = Debug|Any CPU
 | 
				
			||||||
 | 
							{439FA76B-F874-40DB-BAF2-E3647CD55B10}.Debug|x64.ActiveCfg = Debug|x64
 | 
				
			||||||
 | 
							{439FA76B-F874-40DB-BAF2-E3647CD55B10}.Debug|x64.Build.0 = Debug|x64
 | 
				
			||||||
 | 
							{439FA76B-F874-40DB-BAF2-E3647CD55B10}.Debug|x86.ActiveCfg = Debug|x86
 | 
				
			||||||
 | 
							{439FA76B-F874-40DB-BAF2-E3647CD55B10}.Debug|x86.Build.0 = Debug|x86
 | 
				
			||||||
 | 
							{439FA76B-F874-40DB-BAF2-E3647CD55B10}.Release|Any CPU.ActiveCfg = Debug|Any CPU
 | 
				
			||||||
 | 
							{439FA76B-F874-40DB-BAF2-E3647CD55B10}.Release|Any CPU.Build.0 = Debug|Any CPU
 | 
				
			||||||
 | 
							{439FA76B-F874-40DB-BAF2-E3647CD55B10}.Release|x64.ActiveCfg = Release|x64
 | 
				
			||||||
 | 
							{439FA76B-F874-40DB-BAF2-E3647CD55B10}.Release|x64.Build.0 = Release|x64
 | 
				
			||||||
 | 
							{439FA76B-F874-40DB-BAF2-E3647CD55B10}.Release|x86.ActiveCfg = Debug|x86
 | 
				
			||||||
 | 
							{439FA76B-F874-40DB-BAF2-E3647CD55B10}.Release|x86.Build.0 = Debug|x86
 | 
				
			||||||
 | 
							{7F9FA18B-5C28-476E-97D4-B5504B8DEB9B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 | 
				
			||||||
 | 
							{7F9FA18B-5C28-476E-97D4-B5504B8DEB9B}.Debug|Any CPU.Build.0 = Debug|Any CPU
 | 
				
			||||||
 | 
							{7F9FA18B-5C28-476E-97D4-B5504B8DEB9B}.Debug|x64.ActiveCfg = Debug|Any CPU
 | 
				
			||||||
 | 
							{7F9FA18B-5C28-476E-97D4-B5504B8DEB9B}.Debug|x64.Build.0 = Debug|Any CPU
 | 
				
			||||||
 | 
							{7F9FA18B-5C28-476E-97D4-B5504B8DEB9B}.Debug|x86.ActiveCfg = Debug|Any CPU
 | 
				
			||||||
 | 
							{7F9FA18B-5C28-476E-97D4-B5504B8DEB9B}.Debug|x86.Build.0 = Debug|Any CPU
 | 
				
			||||||
 | 
							{7F9FA18B-5C28-476E-97D4-B5504B8DEB9B}.Release|Any CPU.ActiveCfg = Release|Any CPU
 | 
				
			||||||
 | 
							{7F9FA18B-5C28-476E-97D4-B5504B8DEB9B}.Release|Any CPU.Build.0 = Release|Any CPU
 | 
				
			||||||
 | 
							{7F9FA18B-5C28-476E-97D4-B5504B8DEB9B}.Release|x64.ActiveCfg = Release|Any CPU
 | 
				
			||||||
 | 
							{7F9FA18B-5C28-476E-97D4-B5504B8DEB9B}.Release|x64.Build.0 = Release|Any CPU
 | 
				
			||||||
 | 
							{7F9FA18B-5C28-476E-97D4-B5504B8DEB9B}.Release|x86.ActiveCfg = Release|Any CPU
 | 
				
			||||||
 | 
							{7F9FA18B-5C28-476E-97D4-B5504B8DEB9B}.Release|x86.Build.0 = Release|Any CPU
 | 
				
			||||||
 | 
						EndGlobalSection
 | 
				
			||||||
 | 
						GlobalSection(SolutionProperties) = preSolution
 | 
				
			||||||
 | 
							HideSolutionNode = FALSE
 | 
				
			||||||
 | 
						EndGlobalSection
 | 
				
			||||||
 | 
						GlobalSection(ExtensibilityGlobals) = postSolution
 | 
				
			||||||
 | 
							SolutionGuid = {E50E8179-1102-41F1-92F5-2905C75898A6}
 | 
				
			||||||
 | 
						EndGlobalSection
 | 
				
			||||||
 | 
					EndGlobal
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,129 @@
 | 
				
			||||||
 | 
					<?xml version="1.0" encoding="utf-8"?>
 | 
				
			||||||
 | 
					<configuration>
 | 
				
			||||||
 | 
					  <connectionStrings>
 | 
				
			||||||
 | 
						<!-- 数据库连接字符串 -->
 | 
				
			||||||
 | 
						<!--<add name="database" connectionString="server=127.0.0.1;database=wpf_dm_program;userid=root;password=qq1223" />-->
 | 
				
			||||||
 | 
						<add name="database" connectionString="server=127.0.0.1;port=3306;database=xiangtan_mazuike_xx;userid=root;password=root" />
 | 
				
			||||||
 | 
					  </connectionStrings>
 | 
				
			||||||
 | 
						<!--<runtime>
 | 
				
			||||||
 | 
							--><!--配置之后,Appdomain.CurrentDomain.UnhandledException 事件的 IsTerminating 就变成了 false 啦!也就是说,程序并不会因为这次的异常而崩溃退出。--><!--
 | 
				
			||||||
 | 
							<legacyUnhandledExceptionPolicy enabled="1"/>
 | 
				
			||||||
 | 
						</runtime>-->
 | 
				
			||||||
 | 
						<appSettings>
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
							<!-- 设备id -->
 | 
				
			||||||
 | 
							<add key="machineId" value="DM5" />
 | 
				
			||||||
 | 
							<!-- 毒麻设备id -->
 | 
				
			||||||
 | 
							<add key="dm_machineId" value="DM3" />
 | 
				
			||||||
 | 
							<!--请领药库-->
 | 
				
			||||||
 | 
							<add key="colloctedId" value="住院,DM2,门诊,DM22" />
 | 
				
			||||||
 | 
							<!-- 供应单位 -->
 | 
				
			||||||
 | 
							<add key="supplierDept" value="药库" />
 | 
				
			||||||
 | 
							<!-- 领用部门 -->
 | 
				
			||||||
 | 
							<add key="receiveDept" value="麻精药房" />
 | 
				
			||||||
 | 
							<!--部门-->
 | 
				
			||||||
 | 
							<add key="department" value="急诊药房"/>
 | 
				
			||||||
 | 
						    
 | 
				
			||||||
 | 
							<!--登录人 0全部用户可登录;1仅当班人、审核人可登录-->
 | 
				
			||||||
 | 
							<add key="loginUser" value="0"/>
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
							<!--2023/7/13 药房代码 有则写无则空 -->
 | 
				
			||||||
 | 
							<add key="storage" value="" />
 | 
				
			||||||
 | 
							<!-- 登录模式 1单人登录2双人登录 -->
 | 
				
			||||||
 | 
							<add key="loginMode" value="1" />
 | 
				
			||||||
 | 
							<!-- 登录顺序,指定先登录的人的名称有效值,只有在登录模式等于2时才会生效; 发药人:【operator】审核人:【reviewer】 -->
 | 
				
			||||||
 | 
							<add key="firstLogin" value="operator" />
 | 
				
			||||||
 | 
							<!-- 按处方还药或者按取药记录还药 1:处方(ReturnDrugWindow2)2:药品(ReturnDrugWindow)-->
 | 
				
			||||||
 | 
							<add key="returnDrugMode" value="2" />
 | 
				
			||||||
 | 
							<!-- 自动退出时间,单位秒,为0时不自动退出 -->
 | 
				
			||||||
 | 
							<add key="autoExit" value="0"/>
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
							<!-- 无操作退出录像时间,单位秒,为0时不退出录像 -->
 | 
				
			||||||
 | 
							<add key="stopRecord" value="180"/>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							<add key="gridConnectionString" value="MYSQL; Database=xiangxiang; Password=root; Port=3306; Server=127.0.0.1; User=root;"/>
 | 
				
			||||||
 | 
							<!-- 查询处方是orderNo还是orderGroupNo -->
 | 
				
			||||||
 | 
							<add key="OrderNoName" value="orderNo" />
 | 
				
			||||||
 | 
							<!-- 后门耗材板地址 没有则填写0-->
 | 
				
			||||||
 | 
							<add key="DoorAddr" value="1" />
 | 
				
			||||||
 | 
							<!-- 是否有can总线串口-->
 | 
				
			||||||
 | 
							<add key="CanBusExsit" value="true" />
 | 
				
			||||||
 | 
							<!-- 单支抽屉储物箱有则写地址无则为0-->
 | 
				
			||||||
 | 
							<add key="StorageBoxAddr" value="1" />
 | 
				
			||||||
 | 
							<!-- 抽屉串口使用的协议232或者485 -->
 | 
				
			||||||
 | 
							<add key="DrawerProtocol" value="485" />
 | 
				
			||||||
 | 
							<!-- 抽屉串口的串口号 -->
 | 
				
			||||||
 | 
							<add key="DrawerPortPath" value="COM11" />
 | 
				
			||||||
 | 
							<!-- can总线串口的串口号 -->
 | 
				
			||||||
 | 
							<add key="CanBusPortPath" value="COM3" />
 | 
				
			||||||
 | 
							<!-- 条码枪串口的串口号 -->
 | 
				
			||||||
 | 
							<add key="ScanCodePortPath" value="COM8" />
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
							<!--是否有冰箱抽屉0无,1有一个,2两个-->
 | 
				
			||||||
 | 
							<add key="hasFridge" value="0"/>
 | 
				
			||||||
 | 
							<!-- 冰箱的串口号 -->
 | 
				
			||||||
 | 
							<add key="FridgePortPath" value="COM7" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							<!--冰箱抽屉温度区间-->
 | 
				
			||||||
 | 
							<add key="temperatureRange" value="2-8"/>
 | 
				
			||||||
 | 
							<!--冰箱抽屉温度-->
 | 
				
			||||||
 | 
							<add key="temperatureValue" value="3.2"/>
 | 
				
			||||||
 | 
							<!--温度查询定时执行时间-->
 | 
				
			||||||
 | 
							<add key="Interval" value="60000"/>
 | 
				
			||||||
 | 
							<!--冰箱状态1关闭;0打开-->
 | 
				
			||||||
 | 
							<add key="FridgeState" value="0"/>
 | 
				
			||||||
 | 
							<!--报警状态1关闭;0打开-->
 | 
				
			||||||
 | 
							<add key="AlarmState" value="0"/>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							<!--冰箱2抽屉温度区间-->
 | 
				
			||||||
 | 
							<add key="temperatureRange2" value="2-8"/>
 | 
				
			||||||
 | 
							<!--冰箱2状态1关闭;0打开-->
 | 
				
			||||||
 | 
							<add key="FridgeState2" value="0"/>
 | 
				
			||||||
 | 
							<!--冰箱2报警状态1关闭;0打开-->
 | 
				
			||||||
 | 
							<add key="AlarmState2" value="0"/>
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
							<!-- 抽屉串口的串口号 --><!--
 | 
				
			||||||
 | 
							<add key="DrawerPortPath" value="COM11" />
 | 
				
			||||||
 | 
							--><!-- can总线串口的串口号 --><!--
 | 
				
			||||||
 | 
							<add key="CanBusPortPath" value="COM12" />
 | 
				
			||||||
 | 
							--><!-- 条码枪串口的串口号 --><!--
 | 
				
			||||||
 | 
							<add key="ScanPortPath" value="COM7" />-->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							<!-- 指纹机类型 1:无屏幕;2:有屏幕 -->
 | 
				
			||||||
 | 
							<add  key="machineType" value="2"/>
 | 
				
			||||||
 | 
							<!-- 指纹机号码 -->
 | 
				
			||||||
 | 
							<add  key="machineNumber" value="1"/>
 | 
				
			||||||
 | 
							<!-- 指纹机ip -->
 | 
				
			||||||
 | 
							<add  key="fingerIp" value="192.168.50.201"/>
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
							<!-- 多处方取药 0:不启用 1:启用-->
 | 
				
			||||||
 | 
							<add  key="MultiOrder" value="1"/>
 | 
				
			||||||
 | 
							<!-- 多批次抽屉加药 0:不启用 1:启用
 | 
				
			||||||
 | 
							     启用channel_list记录库位信息 -->
 | 
				
			||||||
 | 
							<add  key="MultiBatch" value="0"/>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							<!--海康威视IP-->
 | 
				
			||||||
 | 
							<add key="HIKIP" value="192.168.1.15"/>
 | 
				
			||||||
 | 
							<!--海康威视端口-->
 | 
				
			||||||
 | 
							<add key="HIKPort" value="8000"/>
 | 
				
			||||||
 | 
							<!--海康威视用户名-->
 | 
				
			||||||
 | 
							<add key="HIKUser" value="admin"/>
 | 
				
			||||||
 | 
							<!--海康威视密码-->
 | 
				
			||||||
 | 
							<add key="HIKPassword" value="HKC123456"/>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							<!--交接柜网口地址及端口-->
 | 
				
			||||||
 | 
							<add key="modbusIp" value="127.0.0.1"/>
 | 
				
			||||||
 | 
							<add key="modbusPort" value="4002"/>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							<!--温湿度串口-->
 | 
				
			||||||
 | 
							<add key="wsdSerialPort" value="COM1"/>
 | 
				
			||||||
 | 
							<!--温度查询定时执行时间-->
 | 
				
			||||||
 | 
							<add key="Interval" value="60000"/>
 | 
				
			||||||
 | 
							<add key="test" value="Y"/>
 | 
				
			||||||
 | 
						</appSettings>
 | 
				
			||||||
 | 
					</configuration>
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,19 @@
 | 
				
			||||||
 | 
					<prism:PrismApplication x:Class="DM_Weight.App"
 | 
				
			||||||
 | 
					             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
 | 
				
			||||||
 | 
					             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
 | 
				
			||||||
 | 
					             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
 | 
				
			||||||
 | 
					             xmlns:d1p1="http://schemas.openxmlformats.org/markup-compatibility/2006"
 | 
				
			||||||
 | 
					             d1p1:Ignorable="d"
 | 
				
			||||||
 | 
					             xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
 | 
				
			||||||
 | 
					             xmlns:local="clr-namespace:DM_Weight"
 | 
				
			||||||
 | 
					             xmlns:prism="http://prismlibrary.com/" Startup="PrismApplication_Startup">
 | 
				
			||||||
 | 
					    <Application.Resources>
 | 
				
			||||||
 | 
					        <ResourceDictionary>
 | 
				
			||||||
 | 
					            <ResourceDictionary.MergedDictionaries>
 | 
				
			||||||
 | 
					                <materialDesign:BundledTheme BaseTheme="Light" PrimaryColor="Indigo" SecondaryColor="Cyan" />
 | 
				
			||||||
 | 
					                <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            </ResourceDictionary.MergedDictionaries>
 | 
				
			||||||
 | 
					        </ResourceDictionary>
 | 
				
			||||||
 | 
					    </Application.Resources>
 | 
				
			||||||
 | 
					    </prism:PrismApplication>
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,341 @@
 | 
				
			||||||
 | 
					using DM_Weight.Finger;
 | 
				
			||||||
 | 
					using DM_Weight.Port;
 | 
				
			||||||
 | 
					using DM_Weight.util.TabTip;
 | 
				
			||||||
 | 
					using DM_Weight.util;
 | 
				
			||||||
 | 
					using DM_Weight.ViewModels;
 | 
				
			||||||
 | 
					using DM_Weight.Views.Dialog;
 | 
				
			||||||
 | 
					using DM_Weight.Views;
 | 
				
			||||||
 | 
					using log4net.Config;
 | 
				
			||||||
 | 
					using Prism.Ioc;
 | 
				
			||||||
 | 
					using Prism.Services.Dialogs;
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.ComponentModel;
 | 
				
			||||||
 | 
					using System.Configuration;
 | 
				
			||||||
 | 
					using System.Data;
 | 
				
			||||||
 | 
					using System.IO;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					using System.Windows;
 | 
				
			||||||
 | 
					using System.Windows.Controls;
 | 
				
			||||||
 | 
					using Prism.Unity;
 | 
				
			||||||
 | 
					using log4net;
 | 
				
			||||||
 | 
					using System.Windows.Interop;
 | 
				
			||||||
 | 
					using System.Windows.Threading;
 | 
				
			||||||
 | 
					using System.Timers;
 | 
				
			||||||
 | 
					using DM_Weight.HIKVISION;
 | 
				
			||||||
 | 
					using System.Runtime.InteropServices;
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    /// <summary>
 | 
				
			||||||
 | 
					    /// Interaction logic for App.xaml
 | 
				
			||||||
 | 
					    /// </summary>
 | 
				
			||||||
 | 
					    public partial class App : PrismApplication
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        private readonly ILog logger = LogManager.GetLogger(typeof(App));
 | 
				
			||||||
 | 
					        public App()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            TabTipAutomation.IgnoreHardwareKeyboard = HardwareKeyboardIgnoreOptions.IgnoreAll;
 | 
				
			||||||
 | 
					            TabTipAutomation.BindTo<TextBox>();
 | 
				
			||||||
 | 
					            TabTipAutomation.BindTo<PasswordBox>();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        protected override Window CreateShell()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            logger.Info("进入APP-CreateShell");
 | 
				
			||||||
 | 
					            //UI线程未捕获异常处理事件
 | 
				
			||||||
 | 
					            this.DispatcherUnhandledException += OnDispatcherUnhandledException;
 | 
				
			||||||
 | 
					            //Task线程内未捕获异常处理事件
 | 
				
			||||||
 | 
					            TaskScheduler.UnobservedTaskException += OnUnobservedTaskException;
 | 
				
			||||||
 | 
					            //多线程异常
 | 
				
			||||||
 | 
					            AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            logger.Info("进入APP-CreateShell-2");
 | 
				
			||||||
 | 
					            return Container.Resolve<MainWindow>();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        void OnDispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            logger.Error($"发生错误:{e.Exception.Message}");
 | 
				
			||||||
 | 
					            e.Handled = true;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        void OnUnobservedTaskException(object sender, UnobservedTaskExceptionEventArgs e)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            foreach (Exception item in e.Exception.InnerExceptions)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                logger.Error($"异常类型:{item.GetType()}{Environment.NewLine}来自:{item.Source}{Environment.NewLine}异常内容:{item.Message}");
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            //将异常标识为已经观察到 
 | 
				
			||||||
 | 
					            e.SetObserved();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        void OnUnhandledException(object sender, UnhandledExceptionEventArgs e)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            logger.Error($"Unhandled exception.{e.ToString()}");
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        protected override void InitializeShell(Window shell)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            base.InitializeShell(shell);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        protected override void RegisterTypes(IContainerRegistry containerRegistry)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            logger.Info("进入APP-RegisterTypes");
 | 
				
			||||||
 | 
					            // 注入日志
 | 
				
			||||||
 | 
					            XmlConfigurator.ConfigureAndWatch(new FileInfo(AppDomain.CurrentDomain.BaseDirectory + "log4net.config"));
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterInstance<ILog>(LogManager.GetLogger(""));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            // 串口工具
 | 
				
			||||||
 | 
					            containerRegistry.RegisterSingleton<PortUtil>();
 | 
				
			||||||
 | 
					            // 指纹机工具
 | 
				
			||||||
 | 
					            containerRegistry.RegisterSingleton<FingerprintUtil>();
 | 
				
			||||||
 | 
					            // 组态屏工具
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterSingleton<ScreenUtil>();
 | 
				
			||||||
 | 
					            // 录像机
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterSingleton<CHKFunction>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            containerRegistry.Register<IDialogService, MaterialDialogService>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            // 主窗口
 | 
				
			||||||
 | 
					            containerRegistry.Register<MainWindow>();
 | 
				
			||||||
 | 
					            containerRegistry.RegisterForNavigation<MainWindow, MainWindowViewModel>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            // 分页
 | 
				
			||||||
 | 
					            //containerRegistry.Register<Pagination>();
 | 
				
			||||||
 | 
					            //containerRegistry.Register<PaginationViewModel>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            // 登录页面
 | 
				
			||||||
 | 
					            containerRegistry.RegisterForNavigation<LoginWindow, LoginWindowViewModel>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            // 布局页面
 | 
				
			||||||
 | 
					            containerRegistry.RegisterForNavigation<HomeWindow, HomeWindowViewModel>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            // 录入指纹模态框
 | 
				
			||||||
 | 
					            containerRegistry.RegisterDialog<FingerprintDialog>();
 | 
				
			||||||
 | 
					            containerRegistry.RegisterForNavigation<FingerprintDialog, FingerprintDialogViewModel>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            #region 取药
 | 
				
			||||||
 | 
					            // 处方取药页面
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterForNavigation<OrderTakeDrugWindow, OrderTakeDrugWindowViewModel>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterForNavigation<OrderTakeDrugNewWindow, OrderTakeDrugNewWindowViewModel>();
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterForNavigation<OrderTakeAllDrugDialog, OrderTakeAllDrugDialogViewModel>();
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterForNavigation<OrderTakeNewDialog, OrderTakeNewDialogViewModel>();
 | 
				
			||||||
 | 
					            ////交接柜补药
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterForNavigation<AddToJiaoJieWindow, AddToJiaoJieWindowViewModel>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            // 处方取药模态框
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterDialog<OrderTakeDialog>();
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterForNavigation<OrderTakeDialog, OrderTakeDialogViewModel>();
 | 
				
			||||||
 | 
					            //// 调拨取药页面
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterForNavigation<InvoiceOutWindow, InvoiceOutWindowViewModel>();
 | 
				
			||||||
 | 
					            //// 调拨取药模态框
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterDialog<InvoiceTakeDialog>();
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterForNavigation<InvoiceTakeDialog, InvoiceTakeDialogViewModel>();
 | 
				
			||||||
 | 
					            //// 抽屉取药页面
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterForNavigation<DrawerTakeDrugWindow, DrawerTakeDrugWindowViewModel>();
 | 
				
			||||||
 | 
					            //// 自选取药模态框
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterDialog<SelfTakeDialog>();
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterForNavigation<SelfTakeDialog, SelfTakeDialogViewModel>();
 | 
				
			||||||
 | 
					            //// 自选取药页面
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterForNavigation<SelfTakeDrugWindow, SelfTakeDrugWindowViewModel>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            ////多处方取药
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterForNavigation<MultiOrderTakeDrugWindow, MultiOrderTakeDrugWindowViewModel>();
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterDialog<MultiOrderTakeDialog>();
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterForNavigation<MultiOrderTakeDialog,MultiOrderTakeDialogViewModel>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            ////手术排程
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterForNavigation<SurgeryTakeWindow, SurgeryTakeWindowViewModel>();
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterDialog<SurgeryTakeDialog>();
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterForNavigation<SurgeryTakeDialog, SurgeryTakeDialogViewModel>();
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterDialog<AddSurgeryDialog>();
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterForNavigation<AddSurgeryDialog, AddSurgeryDialogViewModel>();
 | 
				
			||||||
 | 
					            //开药箱
 | 
				
			||||||
 | 
					            containerRegistry.RegisterForNavigation<OpenBoxWindow, OpenBoxWindowViewModel>();
 | 
				
			||||||
 | 
					            containerRegistry.RegisterForNavigation<OpenBoxNewWindow, OpenBoxNewWindowViewModel>();
 | 
				
			||||||
 | 
					            //交接柜补药
 | 
				
			||||||
 | 
					            containerRegistry.RegisterForNavigation<AdditionWindow, AdditionWindowViewModel>();
 | 
				
			||||||
 | 
					            //核对处方
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterForNavigation<CheckOrderWindow, CheckOrderWindowViewModel>();
 | 
				
			||||||
 | 
					            //管理员根据药箱进行核对处方
 | 
				
			||||||
 | 
					            containerRegistry.RegisterForNavigation<CheckOrderNewWindow, CheckOrderNewWindowViewModel>();
 | 
				
			||||||
 | 
					            //麻醉师核对其名下单子
 | 
				
			||||||
 | 
					            containerRegistry.RegisterForNavigation<CheckSelfOrderWindow, CheckSelfOrderWindowViewModel>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            #endregion
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            //#region 加药
 | 
				
			||||||
 | 
					            // 自选加药页面
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterForNavigation<SelfAddWindow, SelfAddWindowViewModel>();
 | 
				
			||||||
 | 
					            //// 调拨加药页面
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterForNavigation<InvoiceInWindow, InvoiceInWindowViewModel>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            //// 调拨取药模态框
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterDialog<InvoiceAddDialog>();
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterForNavigation<InvoiceAddDialog, InvoiceAddDialogViewModel>();
 | 
				
			||||||
 | 
					            //// 抽屉加药页面
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterForNavigation<DrawerAddDrugWindow, DrawerAddDrugWindowViewModel>();
 | 
				
			||||||
 | 
					            //// 自选加药模态框
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterDialog<SelfAddDialog>();
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterForNavigation<SelfAddDialog, SelfAddDialogViewModel>();
 | 
				
			||||||
 | 
					            ////多批次抽屉加药
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterForNavigation<AddDrugControl, AddDrugControlViewModel>();
 | 
				
			||||||
 | 
					            ////药品请领
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterForNavigation<CollectDrugWindow, CollectDrugWindowViewModel>();
 | 
				
			||||||
 | 
					            //// 药品请领模态框
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterDialog<CollectDrugDialog>();
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterForNavigation<CollectDrugDialog, CollectDrugDialogViewModel>(); 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            ////请领列表
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterForNavigation<ApplyListWindow, ApplyListWindowViewModel>();
 | 
				
			||||||
 | 
					            ////请领入库
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterForNavigation<ApplyInStockWindow, ApplyInStockWindowViewModel>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            //#endregion
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            //#region 还药
 | 
				
			||||||
 | 
					            //// 还药页面
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterForNavigation<ReturnDrugWindow, ReturnDrugWindowViewModel>();
 | 
				
			||||||
 | 
					            //// 按记录归还药品模态框
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterDialog<ReturnDrugDialog>();
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterForNavigation<ReturnDrugDialog, ReturnDrugDialogViewModel>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            //// 还药页面2
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterForNavigation<ReturnDrugWindow2, ReturnDrugWindow2ViewModel>();
 | 
				
			||||||
 | 
					            //// 按处方归还药品模态框
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterDialog<OrderReturnDialog>();
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterForNavigation<OrderReturnDialog, OrderReturnDialogViewModel>();
 | 
				
			||||||
 | 
					            //// 还空瓶页面
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterForNavigation<ReturnEmptyWindow, ReturnEmptyWindowViewModel>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            ////空瓶销毁页面
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterForNavigation<ReturnEmptyDestoryWindow, ReturnEmptyDestoryWindowViewModel>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            //// 归还空瓶模态框
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterDialog<ReturnEmptyDialog>();
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterForNavigation<ReturnEmptyDialog, ReturnEmptyDialogViewModel>();
 | 
				
			||||||
 | 
					            //// 空瓶销毁模态框
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterDialog<DestoryEmptyDialog>();
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterForNavigation<DestoryEmptyDialog, DestoryEmptyDialogViewModel>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            //#endregion
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            //#region 库存管理
 | 
				
			||||||
 | 
					            //// 库存列表页面
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterForNavigation<StockListWindow, StockListWindowViewModel>();
 | 
				
			||||||
 | 
					            //// 库位绑定模态框
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterDialog<BindingChannelDialog>();
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterForNavigation<BindingChannelDialog, BindingChannelDialogViewModel>();
 | 
				
			||||||
 | 
					            ////同一药品多批次库位绑定
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterForNavigation<BindingChannelNewDialog, BindingChannelNewDialogViewModel>();
 | 
				
			||||||
 | 
					            //// 库存盘点页面
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterForNavigation<CheckStockWindow, CheckStockWindowViewModel>();
 | 
				
			||||||
 | 
					            //// 药品列表页面
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterForNavigation<DrugListWindow, DrugListWindowViewModel>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            ////交接班记录
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterForNavigation<ChangeShiftsListWindow, ChangeShiftsListWindowViewModel>();
 | 
				
			||||||
 | 
					            ////交接班弹窗
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterDialog<ChangeShiftsDialog>();
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterForNavigation<ChangeShiftsDialog, ChangeShiftsDialogViewModel>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterForNavigation<AccountWindow,AccountWindowViewModel>();
 | 
				
			||||||
 | 
					            //#endregion
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            #region 系统设置
 | 
				
			||||||
 | 
					            // 用户管理页面
 | 
				
			||||||
 | 
					            containerRegistry.RegisterForNavigation<UserManagerWindow, UserManagerWindowViewModel>();
 | 
				
			||||||
 | 
					            // 编辑用户模态框
 | 
				
			||||||
 | 
					            containerRegistry.RegisterDialog<EditUserDialog>();
 | 
				
			||||||
 | 
					            containerRegistry.RegisterForNavigation<EditUserDialog, EditUserDialogViewModel>();
 | 
				
			||||||
 | 
					            // 角色管理页面
 | 
				
			||||||
 | 
					            containerRegistry.RegisterForNavigation<RoleManagerWindow, RoleManagerWindowViewModel>();
 | 
				
			||||||
 | 
					            // 系统设置
 | 
				
			||||||
 | 
					            containerRegistry.RegisterForNavigation<SettingWindow, SettingWindowViewModel>();
 | 
				
			||||||
 | 
					            // 调试页面
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterForNavigation<DebugWindow, DebugWindowViewModel>();
 | 
				
			||||||
 | 
					            //主设置页面
 | 
				
			||||||
 | 
					            containerRegistry.RegisterForNavigation<SettingMainWindow, SettingMainWindowViewModel>();
 | 
				
			||||||
 | 
					            //两个冰箱抽屉设置页面
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterForNavigation<FridgeWindow, FridgeWindowViewModel>();
 | 
				
			||||||
 | 
					            ////只有一个冰箱抽屉设置页面
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterForNavigation<FridgeOnlyWindow, FridgeOnlyWindowViewModel>();
 | 
				
			||||||
 | 
					            //绑定药箱套餐
 | 
				
			||||||
 | 
					            containerRegistry.RegisterForNavigation<BindBoxPackageWindow, BindBoxPackageWindowViewModel>();
 | 
				
			||||||
 | 
					            //药箱设置
 | 
				
			||||||
 | 
					            containerRegistry.RegisterForNavigation<SettingBoxWindow, SettingBoxWindowViewModel>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            //操作记录
 | 
				
			||||||
 | 
					            containerRegistry.RegisterForNavigation<MachineRecordWindow, MachineRecordWindowViewModel>();
 | 
				
			||||||
 | 
					            //温湿度记录
 | 
				
			||||||
 | 
					            containerRegistry.RegisterForNavigation<WSDRecordWindow, WSDRecordWindowViewModel>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            #endregion
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            // 设备记录页面
 | 
				
			||||||
 | 
					            //containerRegistry.RegisterForNavigation<MachineRecordWindow, MachineRecordWindowViewModel>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            containerRegistry.RegisterForNavigation<ShowMessageDialog, ShowMessageDialogViewModel>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            logger.Info("结束APP-RegisterTypes");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        private void PrismApplication_Startup(object sender, StartupEventArgs e)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            //获取欲启动程序名
 | 
				
			||||||
 | 
					            string processName = System.Diagnostics.Process.GetCurrentProcess().ProcessName;
 | 
				
			||||||
 | 
					            logger.Info($"欲启动程序名:{processName}");
 | 
				
			||||||
 | 
					            //检查程序是否已经启动,已经启动则显示提示退出程序
 | 
				
			||||||
 | 
					            if (System.Diagnostics.Process.GetProcessesByName(processName).Length > 1)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                logger.Info($"系统在运行!");
 | 
				
			||||||
 | 
					                //系统在运行
 | 
				
			||||||
 | 
					                RaiseOtherProcess();
 | 
				
			||||||
 | 
					                Application.Current.Shutdown();
 | 
				
			||||||
 | 
					                return;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        private static void RaiseOtherProcess()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            Process proc = Process.GetCurrentProcess();
 | 
				
			||||||
 | 
					            foreach (Process otherProc in Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName))
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                if (proc.Id != otherProc.Id)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    IntPtr hWnd = otherProc.MainWindowHandle;
 | 
				
			||||||
 | 
					                    if (IsIconic(hWnd))
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        ShowWindowAsync(hWnd, 9);
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    SetForegroundWindow(hWnd);
 | 
				
			||||||
 | 
					                    break;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        [DllImport("user32.dll")]
 | 
				
			||||||
 | 
					        private static extern bool SetForegroundWindow(IntPtr hWnd);
 | 
				
			||||||
 | 
					        [DllImport("user32.dll")]
 | 
				
			||||||
 | 
					        private static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow);
 | 
				
			||||||
 | 
					        [DllImport("user32.dll")]
 | 
				
			||||||
 | 
					        private static extern bool IsIconic(IntPtr hWnd);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,10 @@
 | 
				
			||||||
 | 
					using System.Windows;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[assembly: ThemeInfo(
 | 
				
			||||||
 | 
					    ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
 | 
				
			||||||
 | 
					                                     //(used if a resource is not found in the page,
 | 
				
			||||||
 | 
					                                     // or application resource dictionaries)
 | 
				
			||||||
 | 
					    ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
 | 
				
			||||||
 | 
					                                              //(used if a resource is not found in the page,
 | 
				
			||||||
 | 
					                                              // app, or any theme specific resource dictionaries)
 | 
				
			||||||
 | 
					)]
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,42 @@
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Common
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    public class CRC16MODBUS
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        /// Name: CRC-16/MODBUS    x16+x15+x2+1
 | 
				
			||||||
 | 
					        /// Poly: 0x8005
 | 
				
			||||||
 | 
					        /// Init: 0xFFFF
 | 
				
			||||||
 | 
					        /// Refin: true
 | 
				
			||||||
 | 
					        /// Refout: true
 | 
				
			||||||
 | 
					        /// Xorout: 0x0000
 | 
				
			||||||
 | 
					        ///******************************添加数据CRC16MODBUS校验位*******************************************
 | 
				
			||||||
 | 
					        public static byte[] CrcModBus(byte[] buffer, int start = 0, int len = 0)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            if (buffer == null || buffer.Length == 0) return null;
 | 
				
			||||||
 | 
					            if (start < 0) return null;
 | 
				
			||||||
 | 
					            if (len == 0) len = buffer.Length - start;
 | 
				
			||||||
 | 
					            int length = start + len;
 | 
				
			||||||
 | 
					            if (length > buffer.Length) return null;
 | 
				
			||||||
 | 
					            ushort crc = 0xFFFF;// Initial value
 | 
				
			||||||
 | 
					            for (int i = start; i < length; i++)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                crc ^= buffer[i];
 | 
				
			||||||
 | 
					                for (int j = 0; j < 8; j++)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    if ((crc & 1) > 0)
 | 
				
			||||||
 | 
					                        crc = (ushort)((crc >> 1) ^ 0xA001);// 0xA001 = reverse 0x8005
 | 
				
			||||||
 | 
					                    else
 | 
				
			||||||
 | 
					                        crc = (ushort)(crc >> 1);
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            byte[] ret = BitConverter.GetBytes(crc);
 | 
				
			||||||
 | 
					            //Array.Reverse(ret);
 | 
				
			||||||
 | 
					            return ret;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,31 @@
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Configuration;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					using System.Xml;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Common
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    public class CommonClass
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        //手动实现调用配置的逻辑 规避修改配置文件后不起作用的问题
 | 
				
			||||||
 | 
					        public static string ReadAppSetting(string key)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            string xPath = "/configuration/appSettings//add[@key='" + key + "']";
 | 
				
			||||||
 | 
					            XmlDocument doc = new XmlDocument();
 | 
				
			||||||
 | 
					            string exeFileName = System.Reflection.Assembly.GetExecutingAssembly().GetName().Name;
 | 
				
			||||||
 | 
					            doc.Load(exeFileName + ".dll.config");
 | 
				
			||||||
 | 
					            XmlNode node = doc.SelectSingleNode(xPath);
 | 
				
			||||||
 | 
					            return node.Attributes["value"].Value;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        public static void SaveAppSetting(string key,string value)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            Configuration _configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
 | 
				
			||||||
 | 
					            _configuration.AppSettings.Settings[key].Value = value;
 | 
				
			||||||
 | 
					            _configuration.Save();
 | 
				
			||||||
 | 
					            ConfigurationManager.RefreshSection(key);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,24 @@
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Common
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    public class PrismManager
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        ///// <summary>
 | 
				
			||||||
 | 
					        ///// 主页面区域,主要呈现登录页及登录后页面
 | 
				
			||||||
 | 
					        ///// </summary>
 | 
				
			||||||
 | 
					        //public static readonly string MainViewRegionName = "MainContent";
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 设置菜单页面跳转,主要呈现设置下子菜单
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        public static readonly string SettingViewRegionName = "SettingViewContent";
 | 
				
			||||||
 | 
					        ///// <summary>
 | 
				
			||||||
 | 
					        ///// 主页面各菜单页
 | 
				
			||||||
 | 
					        ///// </summary>
 | 
				
			||||||
 | 
					        //public static readonly string HomeViewRegionName = "HomeViewContent";
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,61 @@
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Configuration;
 | 
				
			||||||
 | 
					using System.Globalization;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					using System.Windows.Controls;
 | 
				
			||||||
 | 
					using System.Windows.Data;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Common
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    //设置冰箱温度规则
 | 
				
			||||||
 | 
					    public class TemperatureRangeRule : ValidationRule
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        //冰箱温度设置区间为取自配置文件(2~8度)
 | 
				
			||||||
 | 
					        public override ValidationResult Validate(object value, CultureInfo cultureInfo)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            bool flag = false;
 | 
				
			||||||
 | 
					            string tips = string.Empty;
 | 
				
			||||||
 | 
					            try
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                string[] rang = value.ToString().Split('-');
 | 
				
			||||||
 | 
					                if (rang.Length >= 2)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    bool bSRange = int.TryParse(rang[0], out int sRange);
 | 
				
			||||||
 | 
					                    bool bERange = int.TryParse(rang[1], out int eRange);
 | 
				
			||||||
 | 
					                    if (bSRange && bERange)
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        if ((sRange < 2 || eRange > 8||sRange>8||eRange<2))
 | 
				
			||||||
 | 
					                        {
 | 
				
			||||||
 | 
					                            tips = "温度区间设置2-8度,请检查输入";
 | 
				
			||||||
 | 
					                            return new ValidationResult(flag, tips);
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
 | 
					                        else
 | 
				
			||||||
 | 
					                        {
 | 
				
			||||||
 | 
					                            flag = true;
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    else
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        tips = "请输入正确的数值";
 | 
				
			||||||
 | 
					                        return new ValidationResult(flag, tips);
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                else
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    tips = "请输入正确的数值";
 | 
				
			||||||
 | 
					                    return new ValidationResult(flag, tips);
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                return new ValidationResult(flag, tips);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            catch (Exception ex)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                tips = $"校验异常{ex.ToString()}";
 | 
				
			||||||
 | 
					                return new ValidationResult(flag, tips);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,43 @@
 | 
				
			||||||
 | 
					<UserControl x:Class="DM_Weight.Components.pagination.Pagination"
 | 
				
			||||||
 | 
					             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
 | 
				
			||||||
 | 
					             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
 | 
				
			||||||
 | 
					             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
 | 
				
			||||||
 | 
					             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
 | 
				
			||||||
 | 
					             xmlns:local="clr-namespace:DM_Weight.Components.pagination"
 | 
				
			||||||
 | 
					             xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    <Grid>
 | 
				
			||||||
 | 
					        <StackPanel Margin="0 6 20 6" HorizontalAlignment="Right" Orientation="Horizontal">
 | 
				
			||||||
 | 
					            <TextBlock x:Name="InfoBlock" Padding="0 0 6 0" VerticalAlignment="Center" />
 | 
				
			||||||
 | 
					            <Button
 | 
				
			||||||
 | 
					                ToolTip="首页"
 | 
				
			||||||
 | 
					                Style="{StaticResource MaterialDesignIconForegroundButton}"
 | 
				
			||||||
 | 
					                Command="{x:Static local:Pagination.FirstCommand}"
 | 
				
			||||||
 | 
					                Name="First"
 | 
				
			||||||
 | 
					                Content="{materialDesign:PackIcon PageFirst}" />
 | 
				
			||||||
 | 
					            <Button
 | 
				
			||||||
 | 
					                ToolTip="上一页"
 | 
				
			||||||
 | 
					                Style="{StaticResource MaterialDesignIconForegroundButton}"
 | 
				
			||||||
 | 
					                Command="{x:Static local:Pagination.PrevCommand}"
 | 
				
			||||||
 | 
					                Name="Prve"
 | 
				
			||||||
 | 
					                Content="{materialDesign:PackIcon ChevronLeft}"/>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            <TextBlock x:Name="CurrentPageText" Padding="6 0 6 0" VerticalAlignment="Center" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            <Button
 | 
				
			||||||
 | 
					                ToolTip="下一页"
 | 
				
			||||||
 | 
					                Style="{StaticResource MaterialDesignIconForegroundButton}"
 | 
				
			||||||
 | 
					                Command="{x:Static local:Pagination.NextCommand}"
 | 
				
			||||||
 | 
					                Name="Next"
 | 
				
			||||||
 | 
					                Content="{materialDesign:PackIcon ChevronRight}"/>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            <Button
 | 
				
			||||||
 | 
					                ToolTip="末页"
 | 
				
			||||||
 | 
					                Style="{StaticResource MaterialDesignIconForegroundButton}"
 | 
				
			||||||
 | 
					                Command="{x:Static local:Pagination.EndCommand}"
 | 
				
			||||||
 | 
					                Name="End"
 | 
				
			||||||
 | 
					                Content="{materialDesign:PackIcon PageLast}" />
 | 
				
			||||||
 | 
					        </StackPanel>
 | 
				
			||||||
 | 
					    </Grid>
 | 
				
			||||||
 | 
					</UserControl>
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,265 @@
 | 
				
			||||||
 | 
					using NetTaste;
 | 
				
			||||||
 | 
					using Prism.Commands;
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.ComponentModel;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Reflection;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					using System.Windows;
 | 
				
			||||||
 | 
					using System.Windows.Controls;
 | 
				
			||||||
 | 
					using System.Windows.Data;
 | 
				
			||||||
 | 
					using System.Windows.Documents;
 | 
				
			||||||
 | 
					using System.Windows.Input;
 | 
				
			||||||
 | 
					using System.Windows.Media;
 | 
				
			||||||
 | 
					using System.Windows.Media.Imaging;
 | 
				
			||||||
 | 
					using System.Windows.Navigation;
 | 
				
			||||||
 | 
					using System.Windows.Shapes;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Components.pagination
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    /// <summary>
 | 
				
			||||||
 | 
					    /// Pagination.xaml 的交互逻辑
 | 
				
			||||||
 | 
					    /// </summary>
 | 
				
			||||||
 | 
					    public partial class Pagination : UserControl
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        public Pagination()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            InitializeComponent();
 | 
				
			||||||
 | 
					            ResetInfoText();
 | 
				
			||||||
 | 
					            ResetCurrentPageText();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        static Pagination()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            InitializeCommands();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        private static readonly Type _typeofSelf = typeof(Pagination);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        private static void InitializeCommands()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            FirstCommand = new RoutedCommand("First", _typeofSelf);
 | 
				
			||||||
 | 
					            PrevCommand = new RoutedCommand("Prev", _typeofSelf);
 | 
				
			||||||
 | 
					            NextCommand = new RoutedCommand("Next", _typeofSelf);
 | 
				
			||||||
 | 
					            EndCommand = new RoutedCommand("End", _typeofSelf);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            CommandManager.RegisterClassCommandBinding(_typeofSelf,
 | 
				
			||||||
 | 
					                new CommandBinding(FirstCommand, OnFirstComman, OnCanFirstComman));
 | 
				
			||||||
 | 
					            CommandManager.RegisterClassCommandBinding(_typeofSelf,
 | 
				
			||||||
 | 
					                new CommandBinding(PrevCommand, OnPrevCommand, OnCanPrevCommand));
 | 
				
			||||||
 | 
					            CommandManager.RegisterClassCommandBinding(_typeofSelf,
 | 
				
			||||||
 | 
					                new CommandBinding(NextCommand, OnNextCommand, OnCanNextCommand));
 | 
				
			||||||
 | 
					            CommandManager.RegisterClassCommandBinding(_typeofSelf,
 | 
				
			||||||
 | 
					                new CommandBinding(EndCommand, OnEndCommand, OnCanEndCommand));
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public static RoutedCommand FirstCommand { get; private set; }
 | 
				
			||||||
 | 
					        private static void OnFirstComman(object sender, RoutedEventArgs e)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            var ctrl = sender as Pagination;
 | 
				
			||||||
 | 
					            ctrl.CurrentPage = 1;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        private static void OnCanFirstComman(object sender, CanExecuteRoutedEventArgs e)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            var ctrl = sender as Pagination;
 | 
				
			||||||
 | 
					            e.CanExecute = ctrl.CurrentPage > 1;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public static RoutedCommand PrevCommand { get; private set; }
 | 
				
			||||||
 | 
					        private static void OnPrevCommand(object sender, RoutedEventArgs e)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            var ctrl = sender as Pagination;
 | 
				
			||||||
 | 
					            ctrl.CurrentPage--;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        private static void OnCanPrevCommand(object sender, CanExecuteRoutedEventArgs e)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            var ctrl = sender as Pagination;
 | 
				
			||||||
 | 
					            e.CanExecute = ctrl.CurrentPage > 1;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public static RoutedCommand NextCommand { get; private set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        private static void OnNextCommand(object sender, RoutedEventArgs e)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            var ctrl = sender as Pagination;
 | 
				
			||||||
 | 
					            ctrl.CurrentPage++;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        private static void OnCanNextCommand(object sender, CanExecuteRoutedEventArgs e)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            var ctrl = sender as Pagination;
 | 
				
			||||||
 | 
					            e.CanExecute = ctrl.CurrentPage < ctrl.PageCount;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        public static RoutedCommand EndCommand { get; private set; }
 | 
				
			||||||
 | 
					        private static void OnEndCommand(object sender, RoutedEventArgs e)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            var ctrl = sender as Pagination;
 | 
				
			||||||
 | 
					            ctrl.CurrentPage = ctrl.PageCount;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        private static void OnCanEndCommand(object sender, CanExecuteRoutedEventArgs e)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            var ctrl = sender as Pagination;
 | 
				
			||||||
 | 
					            e.CanExecute = ctrl.CurrentPage < ctrl.PageCount;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        // 默认当前页码
 | 
				
			||||||
 | 
					        public static int DefaultCurrentPage = 1;
 | 
				
			||||||
 | 
					        // 默认总条数
 | 
				
			||||||
 | 
					        public static int DefaultTotalPages = 0;
 | 
				
			||||||
 | 
					        // 默认每页条数列表
 | 
				
			||||||
 | 
					        public static List<int> DefaultPageSizeList = new List<int> { 10, 20, 50, 100 };
 | 
				
			||||||
 | 
					        // 是否显示页码条数信息
 | 
				
			||||||
 | 
					        public static bool DefaultInfoTextIsEnabel = true;
 | 
				
			||||||
 | 
					        // 默认每页条数
 | 
				
			||||||
 | 
					        public static int DefaultPageSize = 10;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public static readonly DependencyProperty CurrentPageProperty = DependencyProperty
 | 
				
			||||||
 | 
					                .Register("CurrentPage",
 | 
				
			||||||
 | 
					                typeof(int),
 | 
				
			||||||
 | 
					                typeof(Pagination),
 | 
				
			||||||
 | 
					                new FrameworkPropertyMetadata(DefaultCurrentPage, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault));
 | 
				
			||||||
 | 
					        public static readonly DependencyProperty PageSizeProperty = DependencyProperty
 | 
				
			||||||
 | 
					                .Register("PageSize",
 | 
				
			||||||
 | 
					                typeof(int),
 | 
				
			||||||
 | 
					                typeof(Pagination),
 | 
				
			||||||
 | 
					                new FrameworkPropertyMetadata(DefaultPageSize, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault));
 | 
				
			||||||
 | 
					        public static readonly DependencyProperty TotalPagesProperty = DependencyProperty
 | 
				
			||||||
 | 
					                .Register("TotalPages",
 | 
				
			||||||
 | 
					                typeof(int),
 | 
				
			||||||
 | 
					                typeof(Pagination),
 | 
				
			||||||
 | 
					                new FrameworkPropertyMetadata(DefaultTotalPages, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, new PropertyChangedCallback(OnItemsSourceChanged)));
 | 
				
			||||||
 | 
					        public static readonly DependencyProperty InfoTextIsEnabelProperty = DependencyProperty
 | 
				
			||||||
 | 
					                .Register("InfoTextIsEnabel",
 | 
				
			||||||
 | 
					                typeof(bool),
 | 
				
			||||||
 | 
					                typeof(Pagination),
 | 
				
			||||||
 | 
					                new FrameworkPropertyMetadata(DefaultInfoTextIsEnabel, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault));
 | 
				
			||||||
 | 
					        private static void OnItemsSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            Pagination p = (Pagination)d;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            p.ResetInfoText();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [Bindable(true)]
 | 
				
			||||||
 | 
					        [Category("Appearance")]
 | 
				
			||||||
 | 
					        public int CurrentPage
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get { return (int)GetValue(CurrentPageProperty); }
 | 
				
			||||||
 | 
					            set
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                SetValue(CurrentPageProperty, value);
 | 
				
			||||||
 | 
					                if (InfoTextIsEnabel)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    ResetInfoText();
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                ResetCurrentPageText();
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        //private static void OnCurrentPageChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
 | 
				
			||||||
 | 
					        //{
 | 
				
			||||||
 | 
					        //    Pagination p = d as Pagination;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        //    if (p != null)
 | 
				
			||||||
 | 
					        //    {
 | 
				
			||||||
 | 
					        //        Console.WriteLine(e.NewValue);
 | 
				
			||||||
 | 
					        //    }
 | 
				
			||||||
 | 
					        //}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [Bindable(true)]
 | 
				
			||||||
 | 
					        [Category("Appearance")]
 | 
				
			||||||
 | 
					        public int PageSize
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get { return (int)GetValue(PageSizeProperty); }
 | 
				
			||||||
 | 
					            set
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                SetValue(PageSizeProperty, value);
 | 
				
			||||||
 | 
					                if (InfoTextIsEnabel)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    ResetInfoText();
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                ResetCurrentPageText();
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [Bindable(true)]
 | 
				
			||||||
 | 
					        [Category("Appearance")]
 | 
				
			||||||
 | 
					        public int TotalPages
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get { return (int)GetValue(TotalPagesProperty); }
 | 
				
			||||||
 | 
					            set
 | 
				
			||||||
 | 
					            { 
 | 
				
			||||||
 | 
					                SetValue(TotalPagesProperty, value);
 | 
				
			||||||
 | 
					                if (InfoTextIsEnabel)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    ResetInfoText();
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                ResetCurrentPageText();
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public bool InfoTextIsEnabel
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get { return (bool)GetValue(InfoTextIsEnabelProperty); }
 | 
				
			||||||
 | 
					            set { SetValue(InfoTextIsEnabelProperty, value); }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public int PageCount
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => (int)Math.Ceiling((double)TotalPages / PageSize);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public void ResetInfoText()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            this.Dispatcher.BeginInvoke(() =>
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                if (InfoTextIsEnabel)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    if (TotalPages <= PageSize)
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        this.InfoBlock.Text = $"1-{TotalPages}/{TotalPages}";
 | 
				
			||||||
 | 
					                        if (TotalPages == 0)
 | 
				
			||||||
 | 
					                        {
 | 
				
			||||||
 | 
					                            this.InfoBlock.Text = $"0-{TotalPages}/{TotalPages}";
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
 | 
					                    } else
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        this.InfoBlock.Text = ((CurrentPage - 1) * PageSize + 1) + "-" + (CurrentPage * PageSize > TotalPages ? TotalPages : CurrentPage * PageSize) + "/" + TotalPages;
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    
 | 
				
			||||||
 | 
					                } else
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    this.InfoBlock.Visibility = Visibility.Visible;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                
 | 
				
			||||||
 | 
					            });
 | 
				
			||||||
 | 
					            
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public void ResetCurrentPageText()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            this.Dispatcher.BeginInvoke(() =>
 | 
				
			||||||
 | 
					            { 
 | 
				
			||||||
 | 
					                this.CurrentPageText.Text = CurrentPage + "";
 | 
				
			||||||
 | 
					            });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,81 @@
 | 
				
			||||||
 | 
					using Prism.Commands;
 | 
				
			||||||
 | 
					using Prism.Mvvm;
 | 
				
			||||||
 | 
					using Prism.Regions;
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					using System.Windows;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Components.pagination
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    public class PaginationViewModel: BindableBase, IRegionMemberLifetime
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        public static readonly DependencyProperty PageSizeProperty = DependencyProperty
 | 
				
			||||||
 | 
					        .Register("CurrentPage",
 | 
				
			||||||
 | 
					                typeof(int),
 | 
				
			||||||
 | 
					                typeof(Pagination),
 | 
				
			||||||
 | 
					                new FrameworkPropertyMetadata(10));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        // 每页条数
 | 
				
			||||||
 | 
					        private int _pageSize = 10;
 | 
				
			||||||
 | 
					        // 当前页码
 | 
				
			||||||
 | 
					        private int _currentPage = 1;
 | 
				
			||||||
 | 
					        // 总条数
 | 
				
			||||||
 | 
					        private int _totalPages = 0;
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        public int PageSize { get=> _pageSize;  set => SetProperty(ref _pageSize, value); }
 | 
				
			||||||
 | 
					        public int CurrentPage { get => _currentPage; set => SetProperty(ref _currentPage, value); }
 | 
				
			||||||
 | 
					        public int TotalPages { get => _totalPages; set => SetProperty(ref _totalPages, value); }
 | 
				
			||||||
 | 
					        // 总页数 
 | 
				
			||||||
 | 
					        public int PageCount
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => (int)Math.Ceiling((double)TotalPages/ PageSize);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public string InfoText
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => ((CurrentPage - 1) * PageSize + 1) + "-" + (CurrentPage * PageSize > TotalPages ? TotalPages : CurrentPage * PageSize) + "/" + TotalPages;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public bool KeepAlive => false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public DelegateCommand ToFirst
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => new(() =>
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                CurrentPage = 1;
 | 
				
			||||||
 | 
					            });
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public DelegateCommand ToPrve
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => new(() =>
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                CurrentPage -= 1;
 | 
				
			||||||
 | 
					            });
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public DelegateCommand ToNext
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => new(() =>
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                CurrentPage += 1;
 | 
				
			||||||
 | 
					            });
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public DelegateCommand ToEnd
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => new(() =>
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                CurrentPage = PageCount;
 | 
				
			||||||
 | 
					            });
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,91 @@
 | 
				
			||||||
 | 
					using DM_Weight.Models;
 | 
				
			||||||
 | 
					using DM_Weight.util;
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Collections.ObjectModel;
 | 
				
			||||||
 | 
					using System.Configuration;
 | 
				
			||||||
 | 
					using System.Globalization;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					using System.Windows.Data;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Converter
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    /// <summary>
 | 
				
			||||||
 | 
					    /// 请领列表页面状态转换
 | 
				
			||||||
 | 
					    /// </summary>
 | 
				
			||||||
 | 
					    public class ApplyListConverter : IValueConverter
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            //用户名
 | 
				
			||||||
 | 
					            if (parameter.ToString().Equals("UserId"))
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                int val = int.Parse(value.ToString());
 | 
				
			||||||
 | 
					                if (val <= 0)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    return "";
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                string userName = SqlSugarHelper.Db.Queryable<UserList>().Where(ul => ul.Id == val).Select(ul => new { ul.Nickname }).First().Nickname;
 | 
				
			||||||
 | 
					                return userName;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            //请领单状态
 | 
				
			||||||
 | 
					            if (parameter.ToString().Equals("PleaseStatus"))
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                int val = int.Parse(value.ToString());
 | 
				
			||||||
 | 
					                string retStr = "状态:";
 | 
				
			||||||
 | 
					                switch (val)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    case 0:
 | 
				
			||||||
 | 
					                        return retStr + "已创建";
 | 
				
			||||||
 | 
					                    case 1:
 | 
				
			||||||
 | 
					                        return retStr + "审核通过";
 | 
				
			||||||
 | 
					                    case 2:
 | 
				
			||||||
 | 
					                        return retStr + "已出库";
 | 
				
			||||||
 | 
					                    case 3:
 | 
				
			||||||
 | 
					                        return retStr + "已入库";
 | 
				
			||||||
 | 
					                    default:
 | 
				
			||||||
 | 
					                        return retStr + "状态未知";
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            //处方状态
 | 
				
			||||||
 | 
					            if (parameter.ToString().Equals("OrderStatus"))
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                int val = int.Parse(value.ToString());
 | 
				
			||||||
 | 
					                switch (val)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    case 0:
 | 
				
			||||||
 | 
					                        return "已申请";
 | 
				
			||||||
 | 
					                    case 1:
 | 
				
			||||||
 | 
					                        return "已接收";
 | 
				
			||||||
 | 
					                    case 2:
 | 
				
			||||||
 | 
					                        return "已退回";
 | 
				
			||||||
 | 
					                    default:
 | 
				
			||||||
 | 
					                        return "状态未知";
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            //请领药库
 | 
				
			||||||
 | 
					            if (parameter.ToString().Equals("machineId"))
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                string val = value.ToString();
 | 
				
			||||||
 | 
					                string[] colloctedId = ConfigurationManager.AppSettings["colloctedId"].Split(',');
 | 
				
			||||||
 | 
					                if (Array.IndexOf(colloctedId, val)>0)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    return colloctedId[Array.IndexOf(colloctedId, val) - 1].ToString();
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                else
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    return "未知";
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            return "";
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            throw new NotImplementedException();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,106 @@
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Globalization;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					using System.Windows.Data;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Converter
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    public class BoardTypeConverter : IMultiValueConverter
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        public object Convert(object[] value, Type targetType, object parameter, CultureInfo culture)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            int BoardType = int.Parse(value[0].ToString());
 | 
				
			||||||
 | 
					            int DrawerType = int.Parse(value[1].ToString());
 | 
				
			||||||
 | 
					            switch (BoardType)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                case 1:
 | 
				
			||||||
 | 
					                    if (DrawerType == 1)
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        return "物理隔断";
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    else if(DrawerType == 2)
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        return "内置回收";
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    else
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        return "外置回收";
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                case 2:
 | 
				
			||||||
 | 
					                    if (DrawerType == 1)
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        return "单支计数";
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    else if (DrawerType == 2)
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        return "计数回收(内置)";
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    else
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        return "计数回收(外置)";
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                case 3:
 | 
				
			||||||
 | 
					                    if (DrawerType == 1)
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        return "管控药盒";
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    else if (DrawerType == 2)
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        return "药盒回收(内置)";
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    else
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        return "外置回收";
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                case 4:
 | 
				
			||||||
 | 
					                    if (DrawerType == 1)
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        return "储物箱";
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    else if (DrawerType == 2)
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        return "内置回收";
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    else
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        return "外置回收";
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                case 5:
 | 
				
			||||||
 | 
					                    if (DrawerType == 1)
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        return "智能显示";
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    else if (DrawerType == 2)
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        return "内置回收";
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    else
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        return "外置回收";
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                case 6:
 | 
				
			||||||
 | 
					                    if (DrawerType == 1)
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        return "称重计数";
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    else if (DrawerType == 2)
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        return "称重回收(内置)";
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    else
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        return "计数回收(外置)";
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            return "";
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            throw new NotImplementedException();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,31 @@
 | 
				
			||||||
 | 
					using SqlSugar.Extensions;
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Globalization;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					using System.Windows;
 | 
				
			||||||
 | 
					using System.Windows.Data;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Converter
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    class BoxNumConverter : IValueConverter
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            if(parameter==null)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                return value.ObjToBool();
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            string str=value.ToString();
 | 
				
			||||||
 | 
					            return !(str == parameter.ToString());
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            throw new NotImplementedException();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,28 @@
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Globalization;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					using System.Windows;
 | 
				
			||||||
 | 
					using System.Windows.Data;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Converter
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    internal class DrawerSelectConverter : IMultiValueConverter
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        public object Convert(object[] value, Type targetType, object parameter, CultureInfo culture)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            //int iLength = value[0].ToString().Length;
 | 
				
			||||||
 | 
					            int iLength = value[0].ToString().IndexOf("号药箱");
 | 
				
			||||||
 | 
					            int ButtonDrawerNo = int.Parse(value[0].ToString().Substring(0, iLength));
 | 
				
			||||||
 | 
					            int SelectedDrawerNo = int.Parse(value[1].ToString());
 | 
				
			||||||
 | 
					            return ButtonDrawerNo == SelectedDrawerNo;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            throw new NotImplementedException();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,30 @@
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Globalization;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					using System.Windows.Data;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Converter
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    public class ForeColorConverter : IValueConverter
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            if ((bool)value)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                return "#3ECFED";
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            else
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                return "#808080";
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            throw new NotImplementedException();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,40 @@
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Collections.ObjectModel;
 | 
				
			||||||
 | 
					using System.Globalization;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					using System.Windows.Data;
 | 
				
			||||||
 | 
					using DM_Weight.Models;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Converter
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    public class GroupSumConverter : IValueConverter
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        #region 分组组内求和
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            var total = 0;
 | 
				
			||||||
 | 
					            // DataGrid分组后对应的组及组内元素CollectionViewGroup.Items 类型是ReadOnlyObservableCollection<object>
 | 
				
			||||||
 | 
					            if (value is ReadOnlyObservableCollection<object> items)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                foreach (var item in items)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    var de = item as OrderDetail;
 | 
				
			||||||
 | 
					                    total += de.Quantity;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            return "用药总数:" + total;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            throw new NotImplementedException();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        #endregion
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,26 @@
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Globalization;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					using System.Windows.Data;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Converter
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    public class InputQuantityConverter : IValueConverter
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        public bool ReadOnlyValue { get; set; } = true;
 | 
				
			||||||
 | 
					        public bool NotReadOnlyValue { get; set; } = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            return int.Parse(value.ToString()) == 2 || int.Parse(value.ToString()) == 6 ? ReadOnlyValue : NotReadOnlyValue;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            return Binding.DoNothing;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,27 @@
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Globalization;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					using System.Windows.Data;
 | 
				
			||||||
 | 
					using System.Windows;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Converter
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    public class NullableToEnabelConverter : IValueConverter
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        public bool NullValue { get; set; } = false;
 | 
				
			||||||
 | 
					        public bool NotNullValue { get; set; } = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            return value == null ? NullValue : NotNullValue;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            return Binding.DoNothing;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,34 @@
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Globalization;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					using System.Windows.Data;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Converter
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    class OpenBoxSelectConverter : IMultiValueConverter
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        public object Convert(object[] value, Type targetType, object parameter, CultureInfo culture)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            int ButtonDrawerNo=0;
 | 
				
			||||||
 | 
					            switch (value[0].ToString())
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                case "开名下药箱":
 | 
				
			||||||
 | 
					                    ButtonDrawerNo = 0;
 | 
				
			||||||
 | 
					                    break;
 | 
				
			||||||
 | 
					                case "开公共药箱":
 | 
				
			||||||
 | 
					                    ButtonDrawerNo = 1;
 | 
				
			||||||
 | 
					                    break;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            int SelectedDrawerNo = int.Parse(value[1].ToString());
 | 
				
			||||||
 | 
					            return ButtonDrawerNo == SelectedDrawerNo;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            throw new NotImplementedException();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,33 @@
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Globalization;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					using System.Windows;
 | 
				
			||||||
 | 
					using System.Windows.Data;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Converter
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    public class OpenStatusConverter : IValueConverter
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            bool status = bool.Parse(value.ToString());
 | 
				
			||||||
 | 
					                if (status)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    return Visibility.Visible;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                else
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    return Visibility.Collapsed;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            return Visibility.Collapsed;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            throw new NotImplementedException();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,38 @@
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Globalization;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					using System.Windows.Data;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Converter
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    public class OrderStatusConverter : IValueConverter
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            string strRet = string.Empty;
 | 
				
			||||||
 | 
					            switch (value.ToString())
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                case "0":
 | 
				
			||||||
 | 
					                    strRet = "待取药";
 | 
				
			||||||
 | 
					                    break;
 | 
				
			||||||
 | 
					                    case "1":
 | 
				
			||||||
 | 
					                    strRet = "已取药";
 | 
				
			||||||
 | 
					                    break;
 | 
				
			||||||
 | 
					                    case "2":
 | 
				
			||||||
 | 
					                    strRet = "已退回";
 | 
				
			||||||
 | 
					                    break;
 | 
				
			||||||
 | 
					                default:
 | 
				
			||||||
 | 
					                    break;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            return strRet;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            throw new NotImplementedException();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,56 @@
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Globalization;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					using System.Windows.Data;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Converter
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    public class PaginationConverter : IMultiValueConverter
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            string type = values[0].ToString();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            if (!string.IsNullOrEmpty(type) && "First".Equals(type))
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                int CurrentPage = int.Parse(values[1].ToString());
 | 
				
			||||||
 | 
					                return CurrentPage > 1;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            if (!string.IsNullOrEmpty(type) && "Prve".Equals(type))
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                int CurrentPage = int.Parse(values[1].ToString());
 | 
				
			||||||
 | 
					                return CurrentPage > 1;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            if (!string.IsNullOrEmpty(type) && "Next".Equals(type))
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                int CurrentPage = int.Parse(values[1].ToString());
 | 
				
			||||||
 | 
					                int PageCount = int.Parse(values[2].ToString());
 | 
				
			||||||
 | 
					                return PageCount > CurrentPage;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            if (!string.IsNullOrEmpty(type) && "End".Equals(type))
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                int CurrentPage = int.Parse(values[1].ToString());
 | 
				
			||||||
 | 
					                int PageCount = int.Parse(values[2].ToString());
 | 
				
			||||||
 | 
					                return PageCount > CurrentPage;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            if (!string.IsNullOrEmpty(type) && "InfoText".Equals(type))
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                int CurrentPage = int.Parse(values[1].ToString());
 | 
				
			||||||
 | 
					                int PageCount = int.Parse(values[2].ToString());
 | 
				
			||||||
 | 
					                int PageSize = int.Parse(values[3].ToString());
 | 
				
			||||||
 | 
					                int TotalPages = int.Parse(values[4].ToString());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                return ((CurrentPage - 1) * PageSize + 1) + "-" + (CurrentPage * PageSize > TotalPages ? TotalPages : CurrentPage * PageSize) + "/" + TotalPages; ;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            return false;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            throw new NotImplementedException();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,25 @@
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Globalization;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					using System.Windows.Data;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Converter
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    public class QuantityCountConverter : IValueConverter
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        public bool IsEnabled { get; set; } = true;
 | 
				
			||||||
 | 
					        public bool NotIsEnabled { get; set; } = false;
 | 
				
			||||||
 | 
					        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            return int.Parse(value.ToString()) <= 0 ? IsEnabled : NotIsEnabled;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            throw new NotImplementedException();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,30 @@
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Globalization;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					using System.Windows.Data;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Converter
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    public class ShiftsStateConverter : IValueConverter
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            if (value.ToString().Equals("1"))
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                return "已交班";
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            else
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                return "未交班";
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            throw new NotImplementedException();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,97 @@
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Globalization;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					using System.Windows;
 | 
				
			||||||
 | 
					using System.Windows.Data;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Converter
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    internal class StatusConverter : IValueConverter
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            int status = int.Parse(value.ToString());
 | 
				
			||||||
 | 
					            //完成
 | 
				
			||||||
 | 
					            if (parameter.ToString().Equals("CompleteBtn"))
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                if (status == 3)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    return Visibility.Visible;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                else
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    return Visibility.Collapsed;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            //关闭
 | 
				
			||||||
 | 
					            if (parameter.ToString().Equals("CloseBtn"))
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                if (status > 0 && status < 3)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    return false;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                else
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    return true;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            if (parameter.ToString().Equals("opearBtnLoading"))
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                if (status > 0 && status < 3)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    return true;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                else
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    return false;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            //取药
 | 
				
			||||||
 | 
					            if (parameter.ToString().Equals("opearBtnVisible"))
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                if (status < 3)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    return Visibility.Visible;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                else
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    return Visibility.Collapsed;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            //取消
 | 
				
			||||||
 | 
					            if (parameter.ToString().Equals("CancelBtn"))
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                if (status ==3)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    return Visibility.Visible;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                else
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    return Visibility.Collapsed;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            //确认核销、刷新
 | 
				
			||||||
 | 
					            if (parameter.ToString().Equals("ConfirmVsRefresh"))
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                if (status == 0)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    return Visibility.Visible;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                else
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    return Visibility.Collapsed;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            return Visibility.Collapsed;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            throw new NotImplementedException();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,46 @@
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Globalization;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					using System.Windows.Data;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Converter
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    internal class StockStatusConverter : IValueConverter
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            int status = int.Parse(value.ToString());
 | 
				
			||||||
 | 
					            if (parameter.ToString() == "EnableState")
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                if (status == 1)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    return true;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                else
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    return false;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            if (parameter.ToString() == "TextState")
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                if (status == 0)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    return "未取药";
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                else
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    return "已取药待入库";
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            return "";
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            throw new NotImplementedException();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,35 @@
 | 
				
			||||||
 | 
					using DM_Weight.Models;
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Collections.ObjectModel;
 | 
				
			||||||
 | 
					using System.Globalization;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					using System.Windows.Data;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Converter
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    public class TotalCountConverter : IValueConverter
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            var total = 0;
 | 
				
			||||||
 | 
					            // DataGrid分组后对应的组及组内元素CollectionViewGroup.Items 类型是ReadOnlyObservableCollection<object>
 | 
				
			||||||
 | 
					            if (value is List<ChannelStock> items)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                foreach (var item in items)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    var de = item as ChannelStock;
 | 
				
			||||||
 | 
					                    total += de.Quantity;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            return total;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            throw new NotImplementedException();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,20 @@
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    public sealed class MessageAttribute : Attribute
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        public MessageAttribute()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        public MessageAttribute(int value)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,136 @@
 | 
				
			||||||
 | 
					<Project Sdk="Microsoft.NET.Sdk">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  <PropertyGroup>
 | 
				
			||||||
 | 
					    <OutputType>WinExe</OutputType>
 | 
				
			||||||
 | 
					    <TargetFramework>net6.0-windows</TargetFramework>
 | 
				
			||||||
 | 
					    <Nullable>enable</Nullable>
 | 
				
			||||||
 | 
					    <UseWPF>true</UseWPF>
 | 
				
			||||||
 | 
					    <PackageIcon></PackageIcon>
 | 
				
			||||||
 | 
					    <Product>毒麻管理程序</Product>
 | 
				
			||||||
 | 
					    <ApplicationIcon>Images\favicon.ico</ApplicationIcon>
 | 
				
			||||||
 | 
					    <Platforms>AnyCPU;x86;x64</Platforms>
 | 
				
			||||||
 | 
					  </PropertyGroup>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						<ItemGroup>
 | 
				
			||||||
 | 
							<None Remove="Images\body-bg.jpg" />
 | 
				
			||||||
 | 
							<None Remove="Images\box-16.jpg" />
 | 
				
			||||||
 | 
							<None Remove="Images\box.png" />
 | 
				
			||||||
 | 
							<None Remove="Images\favicon.ico" />
 | 
				
			||||||
 | 
							<None Remove="Images\finger-bg-r.png" />
 | 
				
			||||||
 | 
							<None Remove="Images\logo.png" />
 | 
				
			||||||
 | 
							<None Remove="Images\TbExit.png" />
 | 
				
			||||||
 | 
							<None Remove="Images\TbJiay.png" />
 | 
				
			||||||
 | 
							<None Remove="Images\TbKuc.png" />
 | 
				
			||||||
 | 
							<None Remove="Images\TbQyao.png" />
 | 
				
			||||||
 | 
							<None Remove="Images\TbSet.png" />
 | 
				
			||||||
 | 
							<None Remove="Images\TbTuiy.png" />
 | 
				
			||||||
 | 
						</ItemGroup>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  <ItemGroup>
 | 
				
			||||||
 | 
					    <COMReference Include="zkemkeeper">
 | 
				
			||||||
 | 
					      <WrapperTool>tlbimp</WrapperTool>
 | 
				
			||||||
 | 
					      <VersionMinor>0</VersionMinor>
 | 
				
			||||||
 | 
					      <VersionMajor>1</VersionMajor>
 | 
				
			||||||
 | 
					      <Guid>fe9ded34-e159-408e-8490-b720a5e632c7</Guid>
 | 
				
			||||||
 | 
					      <Lcid>0</Lcid>
 | 
				
			||||||
 | 
					      <Isolated>false</Isolated>
 | 
				
			||||||
 | 
					      <EmbedInteropTypes>False</EmbedInteropTypes>
 | 
				
			||||||
 | 
					    </COMReference>
 | 
				
			||||||
 | 
					    <COMReference Include="gregn6Lib">
 | 
				
			||||||
 | 
					      <WrapperTool>tlbimp</WrapperTool>
 | 
				
			||||||
 | 
					      <VersionMinor>0</VersionMinor>
 | 
				
			||||||
 | 
					      <VersionMajor>6</VersionMajor>
 | 
				
			||||||
 | 
					      <Guid>4018f953-1bfe-441e-8a04-dc8ba1ff060e</Guid>
 | 
				
			||||||
 | 
					      <Lcid>0</Lcid>
 | 
				
			||||||
 | 
					      <Isolated>false</Isolated>
 | 
				
			||||||
 | 
					      <EmbedInteropTypes>False</EmbedInteropTypes>
 | 
				
			||||||
 | 
					    </COMReference>
 | 
				
			||||||
 | 
					  </ItemGroup>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  <ItemGroup>
 | 
				
			||||||
 | 
					    <Content Include="Images\favicon.ico" />
 | 
				
			||||||
 | 
					  </ItemGroup>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  <ItemGroup>
 | 
				
			||||||
 | 
						<Resource Include="Images\body-bg.jpg" />
 | 
				
			||||||
 | 
					    <Resource Include="Images\box-16.jpg" />
 | 
				
			||||||
 | 
					    <Resource Include="Images\box.png" />
 | 
				
			||||||
 | 
					    <Resource Include="Images\favicon.ico" />
 | 
				
			||||||
 | 
					    <Resource Include="Images\finger-bg-r.png" />
 | 
				
			||||||
 | 
					    <Resource Include="Images\logo.png" />
 | 
				
			||||||
 | 
					    <Resource Include="Images\TbExit.png" />
 | 
				
			||||||
 | 
					    <Resource Include="Images\TbJiay.png" />
 | 
				
			||||||
 | 
					    <Resource Include="Images\TbKuc.png" />
 | 
				
			||||||
 | 
					    <Resource Include="Images\TbQyao.png" />
 | 
				
			||||||
 | 
					    <Resource Include="Images\TbSet.png" />
 | 
				
			||||||
 | 
					    <Resource Include="Images\TbTuiy.png" />
 | 
				
			||||||
 | 
					  </ItemGroup>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  <ItemGroup>
 | 
				
			||||||
 | 
					    <PackageReference Include="log4net" Version="2.0.15" />
 | 
				
			||||||
 | 
					    <PackageReference Include="MaterialDesignThemes" Version="4.8.0" />
 | 
				
			||||||
 | 
					    <PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.39" />
 | 
				
			||||||
 | 
					    <PackageReference Include="NModbus4.NetCore" Version="2.0.1" />
 | 
				
			||||||
 | 
					    <PackageReference Include="Polly" Version="8.4.1" />
 | 
				
			||||||
 | 
					    <PackageReference Include="Prism.Unity" Version="8.1.97" />
 | 
				
			||||||
 | 
					    <PackageReference Include="SqlSugarCore" Version="5.1.4.67" />
 | 
				
			||||||
 | 
					    <PackageReference Include="SuperSimpleTcp" Version="3.0.10" />
 | 
				
			||||||
 | 
					    <PackageReference Include="System.Drawing.Common" Version="7.0.0" />
 | 
				
			||||||
 | 
					    <PackageReference Include="System.IO.Ports" Version="7.0.0" />
 | 
				
			||||||
 | 
					    <PackageReference Include="System.Management" Version="7.0.1" />
 | 
				
			||||||
 | 
					    <PackageReference Include="System.Reactive" Version="5.0.0" />
 | 
				
			||||||
 | 
					    <PackageReference Include="System.Speech" Version="7.0.0" />
 | 
				
			||||||
 | 
					    <PackageReference Include="System.Text.Encoding.CodePages" Version="7.0.0" />
 | 
				
			||||||
 | 
					  </ItemGroup>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  <ItemGroup>
 | 
				
			||||||
 | 
					    <ApplicationDefinition Update="App.xaml">
 | 
				
			||||||
 | 
					      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
 | 
				
			||||||
 | 
					    </ApplicationDefinition>
 | 
				
			||||||
 | 
					  </ItemGroup>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  <ItemGroup>
 | 
				
			||||||
 | 
					    <None Update="App.config">
 | 
				
			||||||
 | 
					      <CopyToOutputDirectory>Never</CopyToOutputDirectory>
 | 
				
			||||||
 | 
					    </None>
 | 
				
			||||||
 | 
					    <None Update="log4net.config">
 | 
				
			||||||
 | 
					      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
 | 
				
			||||||
 | 
					    </None>
 | 
				
			||||||
 | 
					    <None Update="ReportTemp\account_book_temp.grf">
 | 
				
			||||||
 | 
					      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
 | 
				
			||||||
 | 
					    </None>
 | 
				
			||||||
 | 
					    <None Update="ReportTemp\changeShifts_temp.grf">
 | 
				
			||||||
 | 
					      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
 | 
				
			||||||
 | 
					    </None>
 | 
				
			||||||
 | 
					    <None Update="ReportTemp\machine_log_check.grf">
 | 
				
			||||||
 | 
					      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
 | 
				
			||||||
 | 
					    </None>
 | 
				
			||||||
 | 
					    <None Update="ReportTemp\machine_log_return.grf">
 | 
				
			||||||
 | 
					      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
 | 
				
			||||||
 | 
					    </None>
 | 
				
			||||||
 | 
					    <None Update="ReportTemp\machine_log_add.grf">
 | 
				
			||||||
 | 
					      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
 | 
				
			||||||
 | 
					    </None>
 | 
				
			||||||
 | 
					    <None Update="ReportTemp\machine_log_take.grf">
 | 
				
			||||||
 | 
					      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
 | 
				
			||||||
 | 
					    </None>
 | 
				
			||||||
 | 
					    <None Update="ReportTemp\orderUse_template.grf">
 | 
				
			||||||
 | 
					      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
 | 
				
			||||||
 | 
					    </None>
 | 
				
			||||||
 | 
					    <None Update="ReportTemp\ReturnEmptyDistory_template.grf">
 | 
				
			||||||
 | 
					      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
 | 
				
			||||||
 | 
					    </None>
 | 
				
			||||||
 | 
					    <None Update="ReportTemp\stock_template.grf">
 | 
				
			||||||
 | 
					      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
 | 
				
			||||||
 | 
					    </None>
 | 
				
			||||||
 | 
					  </ItemGroup>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  <ItemGroup>
 | 
				
			||||||
 | 
					    <Folder Include="HIKVISION\" />
 | 
				
			||||||
 | 
					  </ItemGroup>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  <ItemGroup>
 | 
				
			||||||
 | 
					    <ProjectReference Include="..\DM_Weight.Commons\DM_Weight.Commons.csproj" />
 | 
				
			||||||
 | 
					  </ItemGroup>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					</Project>
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,182 @@
 | 
				
			||||||
 | 
					using log4net;
 | 
				
			||||||
 | 
					using log4net.Repository.Hierarchy;
 | 
				
			||||||
 | 
					using Microsoft.Data.SqlClient.Server;
 | 
				
			||||||
 | 
					using Newtonsoft.Json;
 | 
				
			||||||
 | 
					using Prism.Events;
 | 
				
			||||||
 | 
					using SqlSugar;
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Configuration;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					using DM_Weight.Models;
 | 
				
			||||||
 | 
					using DM_Weight.msg;
 | 
				
			||||||
 | 
					using DM_Weight.util;
 | 
				
			||||||
 | 
					using zkemkeeper;
 | 
				
			||||||
 | 
					namespace DM_Weight.Finger
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    public class FingerprintUtil
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        private readonly ILog logger = LogManager.GetLogger(typeof(FingerprintUtil));
 | 
				
			||||||
 | 
					        public zkemkeeper.CZKEMClass axCZKEM1; //= new zkemkeeper.CZKEMClass();
 | 
				
			||||||
 | 
					        public bool bIsConnected = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        private string fingerIp = ConfigurationManager.AppSettings["fingerIp"].ToString();
 | 
				
			||||||
 | 
					        private int fingerPort = 4370;
 | 
				
			||||||
 | 
					        private int machineNumber = Convert.ToInt32(ConfigurationManager.AppSettings["machineNumber"].ToString());
 | 
				
			||||||
 | 
					        private int machineType = Convert.ToInt32(ConfigurationManager.AppSettings["machineType"].ToString());
 | 
				
			||||||
 | 
					        private readonly IEventAggregator _eventAggregator;
 | 
				
			||||||
 | 
					        public FingerprintUtil(IEventAggregator eventAggregator)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            _eventAggregator = eventAggregator;
 | 
				
			||||||
 | 
					            logger.Info($"进入构造器,开始连接指纹机");
 | 
				
			||||||
 | 
					           // Task.Run(() =>
 | 
				
			||||||
 | 
					           //{
 | 
				
			||||||
 | 
					               ConnectionMain();
 | 
				
			||||||
 | 
					           //});
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public void ConnectionMain()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            try
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                axCZKEM1 = new CZKEMClass();
 | 
				
			||||||
 | 
					                bIsConnected = axCZKEM1.Connect_Net(fingerIp, fingerPort);
 | 
				
			||||||
 | 
					                logger.Info($"连接指纹机,IP:{fingerIp},端口:{fingerPort},机器号:{machineNumber},连接结果:{bIsConnected}");
 | 
				
			||||||
 | 
					                if (bIsConnected)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    if (axCZKEM1.RegEvent(machineNumber, 65535))
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        this.axCZKEM1.OnAttTransactionEx += new zkemkeeper._IZKEMEvents_OnAttTransactionExEventHandler(axCZKEM1_OnAttTransactionEx);
 | 
				
			||||||
 | 
					                        //this.axCZKEM1.OnEnrollFinger += new zkemkeeper._IZKEMEvents_OnEnrollFingerEventHandler(axCZKEM1_OnEnrollFinger);
 | 
				
			||||||
 | 
					                        this.axCZKEM1.OnEnrollFingerEx += new zkemkeeper._IZKEMEvents_OnEnrollFingerExEventHandler(axCZKEM1_OnEnrollFingerEx);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                _eventAggregator.GetEvent<FingerprintEvent>().Publish(new FingerprintMsg()
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    Message = "CONNECT",
 | 
				
			||||||
 | 
					                    Result = bIsConnected,
 | 
				
			||||||
 | 
					                });
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            catch(Exception ex)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                logger.Info($"连接指纹机异常{ex.Message.ToString()}");
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        //If your fingerprint(or your card) passes the verification,this event will be triggered
 | 
				
			||||||
 | 
					        private void axCZKEM1_OnAttTransactionEx(string sEnrollNumber, int iIsInValid, int iAttState, int iVerifyMethod, int iYear, int iMonth, int iDay, int iHour, int iMinute, int iSecond, int iWorkCode)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            FingerprintMsg message = new FingerprintMsg()
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                Message = "LOGIN",
 | 
				
			||||||
 | 
					                Id = Convert.ToInt32(sEnrollNumber),
 | 
				
			||||||
 | 
					                VerifyMethod = iVerifyMethod
 | 
				
			||||||
 | 
					            };
 | 
				
			||||||
 | 
					            logger.Info($"触发用户验证通过事件,用户id:{sEnrollNumber}验证方式:{iVerifyMethod}");
 | 
				
			||||||
 | 
					            _eventAggregator.GetEvent<FingerprintEvent>().Publish(message);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        //When you are enrolling your finger,this event will be triggered.
 | 
				
			||||||
 | 
					        private void axCZKEM1_OnEnrollFinger(int iEnrollNumber, int iFingerIndex, int iActionResult, int iTemplateLength)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            FingerprintMsg message = new FingerprintMsg()
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                Message = "INS_FINGER",
 | 
				
			||||||
 | 
					                Id = iEnrollNumber,
 | 
				
			||||||
 | 
					                FingerIndex = iFingerIndex
 | 
				
			||||||
 | 
					            };
 | 
				
			||||||
 | 
					            
 | 
				
			||||||
 | 
					            axCZKEM1.StartIdentify();
 | 
				
			||||||
 | 
					            axCZKEM1.RefreshData(1);
 | 
				
			||||||
 | 
					            
 | 
				
			||||||
 | 
					            logger.Info($"触发用户登记指纹事件,用户id:{iEnrollNumber}指纹索引:{iFingerIndex}登记结果:{(iActionResult == 0)}");
 | 
				
			||||||
 | 
					            message.Result = (iActionResult == 0);
 | 
				
			||||||
 | 
					            _eventAggregator.GetEvent<FingerprintEvent>().Publish(message);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        private void axCZKEM1_OnEnrollFingerEx(string iEnrollNumber, int iFingerIndex, int iActionResult, int iTemplateLength)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            FingerprintMsg message = new FingerprintMsg()
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                Message = "INS_FINGER",
 | 
				
			||||||
 | 
					                Id = Convert.ToInt32(iEnrollNumber),
 | 
				
			||||||
 | 
					                FingerIndex = iFingerIndex
 | 
				
			||||||
 | 
					            };
 | 
				
			||||||
 | 
					            axCZKEM1.StartIdentify();
 | 
				
			||||||
 | 
					            axCZKEM1.RefreshData(1);
 | 
				
			||||||
 | 
					            logger.Info($"触发用户登记指纹事件1,用户id:{iEnrollNumber}指纹索引:{iFingerIndex}登记结果:{(iActionResult == 0)}");
 | 
				
			||||||
 | 
					            message.Result = (iActionResult == 0);
 | 
				
			||||||
 | 
					            _eventAggregator.GetEvent<FingerprintEvent>().Publish(message);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /**
 | 
				
			||||||
 | 
					         * 删除用户
 | 
				
			||||||
 | 
					         */
 | 
				
			||||||
 | 
					        public bool DelUser(int Id)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            bool result = false;
 | 
				
			||||||
 | 
					            axCZKEM1.EnableDevice(machineNumber, false);
 | 
				
			||||||
 | 
					            if (machineType == 1)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                result = axCZKEM1.DeleteEnrollData(machineNumber, Id, machineNumber, 12);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            else
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                result = axCZKEM1.SSR_DeleteEnrollData(machineNumber, Id.ToString(), 12);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            axCZKEM1.RefreshData(machineNumber);
 | 
				
			||||||
 | 
					            axCZKEM1.EnableDevice(machineNumber, true);
 | 
				
			||||||
 | 
					            return result;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /**
 | 
				
			||||||
 | 
					         * 添加或修改用户
 | 
				
			||||||
 | 
					         */
 | 
				
			||||||
 | 
					        public bool SaveUser(UserList User)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            bool result = false;
 | 
				
			||||||
 | 
					            axCZKEM1.SetStrCardNumber(User.UserBarcode);
 | 
				
			||||||
 | 
					            if (machineType == 1)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                result = axCZKEM1.SetUserInfo(machineNumber, User.Id, User.Nickname, "123456", 0, true);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            else
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                result = axCZKEM1.SSR_SetUserInfo(machineNumber, User.Id.ToString(), User.Nickname, "123456", 0, true);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            return result;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /**
 | 
				
			||||||
 | 
					         * 添加或修改用户指纹
 | 
				
			||||||
 | 
					         */
 | 
				
			||||||
 | 
					        public bool SaveFingerprint(int Id, int FingerIndex)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            bool result = false;
 | 
				
			||||||
 | 
					            // 取消其他操作
 | 
				
			||||||
 | 
					            bool res2 = axCZKEM1.CancelOperation();
 | 
				
			||||||
 | 
					            if (machineType == 1)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                // 删除源指纹
 | 
				
			||||||
 | 
					                bool res = axCZKEM1.DelUserTmp(machineNumber, Id, FingerIndex);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            else
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                // 删除源指纹
 | 
				
			||||||
 | 
					                bool res = axCZKEM1.SSR_DelUserTmp(machineNumber, Id.ToString(), FingerIndex);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            // 添加新指纹
 | 
				
			||||||
 | 
					            result = axCZKEM1.StartEnrollEx(Id.ToString(), FingerIndex, 3);
 | 
				
			||||||
 | 
					            return result;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,250 @@
 | 
				
			||||||
 | 
					using DM_Weight.util;
 | 
				
			||||||
 | 
					using PreviewDemo;
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					using System.Windows.Controls;
 | 
				
			||||||
 | 
					using System.Windows;
 | 
				
			||||||
 | 
					using DM_Weight.Port;
 | 
				
			||||||
 | 
					using log4net;
 | 
				
			||||||
 | 
					using System.Runtime.InteropServices;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.HIKVISION
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    public class CHKFunction
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        private readonly ILog logger = LogManager.GetLogger(typeof(CHKFunction));
 | 
				
			||||||
 | 
					        private bool m_bInitSDK = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        private Int32 m_lRealHandle = -1;
 | 
				
			||||||
 | 
					        public static int HKUserId = -1;
 | 
				
			||||||
 | 
					        private uint iLastErr = 0;
 | 
				
			||||||
 | 
					        private string str;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public CHCNetSDK.NET_DVR_USER_LOGIN_INFO struLogInfo;
 | 
				
			||||||
 | 
					        public CHCNetSDK.NET_DVR_DEVICEINFO_V40 DeviceInfo;
 | 
				
			||||||
 | 
					        public CHCNetSDK.NET_DVR_TIME m_struTimeCfg;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        private System.ComponentModel.Container components = null;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public CHKFunction()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            logger.Info("CHKFunction");
 | 
				
			||||||
 | 
					            HIKInit();
 | 
				
			||||||
 | 
					            HIKLogin();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public bool HIKInit()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            try
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                logger.Info("HIKInit");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                m_bInitSDK = CHCNetSDK.NET_DVR_Init();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                logger.Info($"HIKInit-{m_bInitSDK}");
 | 
				
			||||||
 | 
					                if (m_bInitSDK == false)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    //MessageBox.Show("NET_DVR_Init error!");
 | 
				
			||||||
 | 
					                    //return;
 | 
				
			||||||
 | 
					                    logger.Info("NET_DVR_Init error!");
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                else
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    //保存SDK日志 To save the SDK log
 | 
				
			||||||
 | 
					                    CHCNetSDK.NET_DVR_SetLogToFile(3, "C:\\SdkLog\\", true);
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            catch (Exception ex)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                logger.Info($"HIKInit Exception:{ex.Message}");
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            return m_bInitSDK;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public int HIKLogin()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            try
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                logger.Info("HIKLogin");
 | 
				
			||||||
 | 
					                string ip = ReadApp.ReadAppSetting("HIKIP");
 | 
				
			||||||
 | 
					                string port = ReadApp.ReadAppSetting("HIKPort");
 | 
				
			||||||
 | 
					                string userName = ReadApp.ReadAppSetting("HIKUser");
 | 
				
			||||||
 | 
					                string password = ReadApp.ReadAppSetting("HIKPassword");
 | 
				
			||||||
 | 
					                if (HKUserId < 0)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    struLogInfo = new CHCNetSDK.NET_DVR_USER_LOGIN_INFO();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    //设备IP地址或者域名
 | 
				
			||||||
 | 
					                    byte[] byIP = System.Text.Encoding.Default.GetBytes(ip);
 | 
				
			||||||
 | 
					                    struLogInfo.sDeviceAddress = new byte[129];
 | 
				
			||||||
 | 
					                    byIP.CopyTo(struLogInfo.sDeviceAddress, 0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    //设备用户名
 | 
				
			||||||
 | 
					                    byte[] byUserName = System.Text.Encoding.Default.GetBytes(userName);
 | 
				
			||||||
 | 
					                    struLogInfo.sUserName = new byte[64];
 | 
				
			||||||
 | 
					                    byUserName.CopyTo(struLogInfo.sUserName, 0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    //设备密码
 | 
				
			||||||
 | 
					                    byte[] byPassword = System.Text.Encoding.Default.GetBytes(password);
 | 
				
			||||||
 | 
					                    struLogInfo.sPassword = new byte[64];
 | 
				
			||||||
 | 
					                    byPassword.CopyTo(struLogInfo.sPassword, 0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    struLogInfo.wPort = ushort.Parse(port);//设备服务端口号
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    //if (LoginCallBack == null)
 | 
				
			||||||
 | 
					                    //{
 | 
				
			||||||
 | 
					                    //    LoginCallBack = new CHCNetSDK.LOGINRESULTCALLBACK(cbLoginCallBack);//注册回调函数                    
 | 
				
			||||||
 | 
					                    //}
 | 
				
			||||||
 | 
					                    //struLogInfo.cbLoginResult = LoginCallBack;
 | 
				
			||||||
 | 
					                    struLogInfo.bUseAsynLogin = false; //是否异步登录:0- 否,1- 是 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    DeviceInfo = new CHCNetSDK.NET_DVR_DEVICEINFO_V40();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    //登录设备 Login the device
 | 
				
			||||||
 | 
					                    HKUserId = CHCNetSDK.NET_DVR_Login_V40(ref struLogInfo, ref DeviceInfo);
 | 
				
			||||||
 | 
					                    if (HKUserId < 0)
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        iLastErr = CHCNetSDK.NET_DVR_GetLastError();
 | 
				
			||||||
 | 
					                        str = "NET_DVR_Login_V40 failed, error code= " + iLastErr; //登录失败,输出错误号
 | 
				
			||||||
 | 
					                        logger.Info(str);
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    else
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        //登录成功
 | 
				
			||||||
 | 
					                        //MessageBox.Show("Login Success!");
 | 
				
			||||||
 | 
					                        logger.Info("Login Success!");
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                else
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    //注销登录 Logout the device
 | 
				
			||||||
 | 
					                    if (m_lRealHandle >= 0)
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        //MessageBox.Show("Please stop live view firstly");
 | 
				
			||||||
 | 
					                        logger.Info("Please stop live view firstly");
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    if (!CHCNetSDK.NET_DVR_Logout(HKUserId))
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        iLastErr = CHCNetSDK.NET_DVR_GetLastError();
 | 
				
			||||||
 | 
					                        str = "NET_DVR_Logout failed, error code= " + iLastErr;
 | 
				
			||||||
 | 
					                        logger.Info(str);
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    HKUserId = -1;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            catch (Exception ex)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                logger.Info($"HIKLogin Exception:{ex.Message}");
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            return HKUserId;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public void HIKLoginOut()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            try
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                if (m_lRealHandle >= 0)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    bool stopRealPlay = CHCNetSDK.NET_DVR_StopRealPlay(m_lRealHandle);
 | 
				
			||||||
 | 
					                    logger.Info($"录像机NET_DVR_StopRealPlay接口返回{stopRealPlay}");
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                if (HKUserId >= 0)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    bool logout = CHCNetSDK.NET_DVR_Logout(HKUserId);
 | 
				
			||||||
 | 
					                    logger.Info($"录像机NET_DVR_Logout接口返回{logout}");
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                if (m_bInitSDK == true)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    bool cleanUp = CHCNetSDK.NET_DVR_Cleanup();
 | 
				
			||||||
 | 
					                    logger.Info($"录像机NET_DVR_Cleanup接口返回{cleanUp}");
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            catch (Exception ex)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                logger.Info($"HIKLoginOut Exception{ex.Message}");
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public bool HIKStartDVRRecord()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            bool isStart = false;
 | 
				
			||||||
 | 
					            try
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                isStart = CHCNetSDK.NET_DVR_StartDVRRecord(HKUserId, 0xffff, 0);
 | 
				
			||||||
 | 
					                logger.Info($"录像机NET_DVR_StartDVRRecord接口返回{isStart}");
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            catch (Exception ex)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                logger.Info($"HIKStartDVRRecord Exception{ex.Message}");
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            return isStart;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        public bool HIKStopDVRRecord()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            bool isStop = false;
 | 
				
			||||||
 | 
					            try
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                isStop = CHCNetSDK.NET_DVR_StopDVRRecord(HKUserId, 0xffff);
 | 
				
			||||||
 | 
					                logger.Info($"录像机NET_DVR_StopDVRRecord接口返回{isStop}");
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            catch (Exception ex)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                logger.Info($"HIKStopDVRRecord Exception{ex.Message}");
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            return isStop;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        public void HIK_DVR_TIME()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            try
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                UInt32 dwReturn = 0;
 | 
				
			||||||
 | 
					                Int32 nSize = Marshal.SizeOf(m_struTimeCfg);
 | 
				
			||||||
 | 
					                IntPtr ptrTimeCfg = Marshal.AllocHGlobal(nSize);
 | 
				
			||||||
 | 
					                Marshal.StructureToPtr(m_struTimeCfg, ptrTimeCfg, false);
 | 
				
			||||||
 | 
					                if (CHCNetSDK.NET_DVR_GetDVRConfig(HKUserId, CHCNetSDK.NET_DVR_GET_TIMECFG, -1, ptrTimeCfg, (UInt32)nSize, ref dwReturn))
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    m_struTimeCfg = (CHCNetSDK.NET_DVR_TIME)Marshal.PtrToStructure(ptrTimeCfg, typeof(CHCNetSDK.NET_DVR_TIME));
 | 
				
			||||||
 | 
					                    logger.Info($"录像机时间接口{Convert.ToString(m_struTimeCfg.dwYear)}- {Convert.ToString(m_struTimeCfg.dwMonth)}- {Convert.ToString(m_struTimeCfg.dwDay)}- {Convert.ToString(m_struTimeCfg.dwHour)}- {Convert.ToString(m_struTimeCfg.dwMinute)}- {Convert.ToString(m_struTimeCfg.dwSecond)}");
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            catch (Exception ex)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                logger.Info($"HIK_DVR_TIME Exception{ex.Message}");
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 清理所有正在使用的资源。
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        //public void Dispose()
 | 
				
			||||||
 | 
					        //{
 | 
				
			||||||
 | 
					        //    if (m_lRealHandle >= 0)
 | 
				
			||||||
 | 
					        //    {
 | 
				
			||||||
 | 
					        //       bool stopRealPlay=  CHCNetSDK.NET_DVR_StopRealPlay(m_lRealHandle);
 | 
				
			||||||
 | 
					        //    }
 | 
				
			||||||
 | 
					        //    if (HKUserId >= 0)
 | 
				
			||||||
 | 
					        //    {
 | 
				
			||||||
 | 
					        //        CHCNetSDK.NET_DVR_Logout(HKUserId);
 | 
				
			||||||
 | 
					        //    }
 | 
				
			||||||
 | 
					        //    if (m_bInitSDK == true)
 | 
				
			||||||
 | 
					        //    {
 | 
				
			||||||
 | 
					        //        CHCNetSDK.NET_DVR_Cleanup();
 | 
				
			||||||
 | 
					        //    }
 | 
				
			||||||
 | 
					        //}
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
		 After Width: | Height: | Size: 5.5 KiB  | 
| 
		 After Width: | Height: | Size: 5.4 KiB  | 
| 
		 After Width: | Height: | Size: 20 KiB  | 
| 
		 After Width: | Height: | Size: 5.6 KiB  | 
| 
		 After Width: | Height: | Size: 5.4 KiB  | 
| 
		 After Width: | Height: | Size: 5.6 KiB  | 
| 
		 After Width: | Height: | Size: 19 KiB  | 
| 
		 After Width: | Height: | Size: 18 KiB  | 
| 
		 After Width: | Height: | Size: 5.5 KiB  | 
| 
		 After Width: | Height: | Size: 264 KiB  | 
| 
		 After Width: | Height: | Size: 53 KiB  | 
| 
		 After Width: | Height: | Size: 3.6 KiB  | 
| 
						 | 
					@ -0,0 +1,152 @@
 | 
				
			||||||
 | 
					using SqlSugar;
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Models
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    [SugarTable("account_book_g2")]
 | 
				
			||||||
 | 
					    public class AccountBookG2
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 主键
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "id",IsPrimaryKey =true)]
 | 
				
			||||||
 | 
					        public int Id { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 药品id
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "drug_id")]
 | 
				
			||||||
 | 
					        public string DrugId { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 1领入2发出3日结4总结5转结
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "type")]
 | 
				
			||||||
 | 
					        public int Type { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 科室
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "department")]
 | 
				
			||||||
 | 
					        public string Department { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 设备内记录凭证
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "invoice_no")] 
 | 
				
			||||||
 | 
					        public string InvoiceNo { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 处方号或凭证号
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "order_no")]
 | 
				
			||||||
 | 
					        public string OrderNo { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 批次
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "manu_no")]
 | 
				
			||||||
 | 
					        public string ManuNo { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 效期
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "eff_date")]
 | 
				
			||||||
 | 
					        public string EffDate { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 上日结存
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "yesterday_quantity")]
 | 
				
			||||||
 | 
					        public int YQuantity { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 收入
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "add_quantity")]
 | 
				
			||||||
 | 
					        public int AddQuantity { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 发出
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "out_quantity")]
 | 
				
			||||||
 | 
					        public int OutQuantity { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 批次结存
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "manu_stock")]
 | 
				
			||||||
 | 
					        public int ManuStock { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 总结存
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "total_stock")]
 | 
				
			||||||
 | 
					        public int TotalStock { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  发药领药人id
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "user_id1")]
 | 
				
			||||||
 | 
					        public int? UserId1 { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 复核人id
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "user_id2")]
 | 
				
			||||||
 | 
					        public int? UserId2 { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 设备id
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "machine_id")]
 | 
				
			||||||
 | 
					        public string MachineId { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 日期
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "create_date")]
 | 
				
			||||||
 | 
					        public string CreateDate { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 插入更新时间(当前时间戳)
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "create_time")]
 | 
				
			||||||
 | 
					        public DateTime CreateTime { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 药品名称
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(IsIgnore = true)]
 | 
				
			||||||
 | 
					        public string DrugName { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 规格
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(IsIgnore =true)]
 | 
				
			||||||
 | 
					        public string DrugSpec { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 厂家
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(IsIgnore =true)]
 | 
				
			||||||
 | 
					        public string Manufactory { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 发药人
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(IsIgnore =true)]
 | 
				
			||||||
 | 
					        public string OperatorName { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 复核人
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(IsIgnore =true)]
 | 
				
			||||||
 | 
					        public string ReviewerName { get;set; }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,23 @@
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Models
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    /// <summary>
 | 
				
			||||||
 | 
					    /// 账册类型
 | 
				
			||||||
 | 
					    /// </summary>
 | 
				
			||||||
 | 
					    public class AccountType
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 账册类型名称
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        public string AccountTypeName { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 账册类型值
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        public int AccountTypeValue { get; set; }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,213 @@
 | 
				
			||||||
 | 
					using Prism.Commands;
 | 
				
			||||||
 | 
					using Prism.Mvvm;
 | 
				
			||||||
 | 
					using SqlSugar;
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Models
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    [SugarTable("channel_list")]
 | 
				
			||||||
 | 
					    public class ChannelList : BindableBase
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "chnguid", IsPrimaryKey = true)]
 | 
				
			||||||
 | 
					        //[SugarColumn(ColumnName = "id", IsPrimaryKey = true)]
 | 
				
			||||||
 | 
					        public string Id { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: NULL
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "machine_id")]
 | 
				
			||||||
 | 
					        public string MachineId { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: NULL
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "row_no")]
 | 
				
			||||||
 | 
					        public int DrawerNo { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: NULL
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "col_no")]
 | 
				
			||||||
 | 
					        public int ColNo { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: NULL
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "pos_no")]
 | 
				
			||||||
 | 
					        public int PosNo { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: NULL
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "drug_id")]
 | 
				
			||||||
 | 
					        public string DrugId { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        ///// <summary>
 | 
				
			||||||
 | 
					        /////  
 | 
				
			||||||
 | 
					        ///// 默认值: NULL
 | 
				
			||||||
 | 
					        /////</summary>
 | 
				
			||||||
 | 
					        //[SugarColumn(ColumnName = "manu_no")]
 | 
				
			||||||
 | 
					        //public string ManuNo { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        ///这个值 用于控制柜子使用与未使用的状态
 | 
				
			||||||
 | 
					        ///自始至终未使用是空值,打开了则记录当前打开时间,根据时间修改按钮颜色
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "eff_date")]
 | 
				
			||||||
 | 
					        public string EffDate { get; set; }
 | 
				
			||||||
 | 
					        ///// <summary>
 | 
				
			||||||
 | 
					        /////  
 | 
				
			||||||
 | 
					        ///// 默认值: NULL
 | 
				
			||||||
 | 
					        /////</summary>
 | 
				
			||||||
 | 
					        //[SugarColumn(ColumnName = "quantity")]
 | 
				
			||||||
 | 
					        //public int Quantity { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: 1 (公共药箱值为1,归属个人药箱值为0)
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "drawer_type")]
 | 
				
			||||||
 | 
					        public int DrawerType { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 药箱状态  1药箱在,0药箱不在;(药箱在时开药箱为:取药箱,药箱不在时开药箱为:还药箱)
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "drawer_state")]
 | 
				
			||||||
 | 
					        public int DrawerState { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: 1
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(IsIgnore =true)]
 | 
				
			||||||
 | 
					        public int BoardType { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: 1
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        //[SugarColumn(IsIgnore = true)]
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "state")]
 | 
				
			||||||
 | 
					        public int? State { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(IsIgnore = true)]
 | 
				
			||||||
 | 
					        public bool IsSelected { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(IsIgnore = true)]
 | 
				
			||||||
 | 
					        public InOutInvoice Invoice { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(IsIgnore = true)]
 | 
				
			||||||
 | 
					        public string Location
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => DrawerNo + "-" + ColNo;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName ="yh_no")]
 | 
				
			||||||
 | 
					        public string BelongUser
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get;set;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        //private int _addQuantity = 0;
 | 
				
			||||||
 | 
					        //[SugarColumn(IsIgnore = true)]
 | 
				
			||||||
 | 
					        //public int AddQuantity
 | 
				
			||||||
 | 
					        //{
 | 
				
			||||||
 | 
					        //    get => _addQuantity;
 | 
				
			||||||
 | 
					        //    set
 | 
				
			||||||
 | 
					        //    {
 | 
				
			||||||
 | 
					        //        SetProperty(ref _addQuantity, value);
 | 
				
			||||||
 | 
					        //    }
 | 
				
			||||||
 | 
					        //}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        //private int _takeQuantity = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        //[SugarColumn(IsIgnore = true)]
 | 
				
			||||||
 | 
					        //public int TakeQuantity
 | 
				
			||||||
 | 
					        //{
 | 
				
			||||||
 | 
					        //    get => _takeQuantity;
 | 
				
			||||||
 | 
					        //    set
 | 
				
			||||||
 | 
					        //    {
 | 
				
			||||||
 | 
					        //        if (value > Quantity)
 | 
				
			||||||
 | 
					        //        {
 | 
				
			||||||
 | 
					        //            throw new ArgumentException("取药数量不能大于库存");
 | 
				
			||||||
 | 
					        //        }
 | 
				
			||||||
 | 
					        //        SetProperty(ref _takeQuantity, value);
 | 
				
			||||||
 | 
					        //    }
 | 
				
			||||||
 | 
					        //}
 | 
				
			||||||
 | 
					        //private int _returnQuantity = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        //[SugarColumn(IsIgnore = true)]
 | 
				
			||||||
 | 
					        //public int ReturnQuantity
 | 
				
			||||||
 | 
					        //{
 | 
				
			||||||
 | 
					        //    get => _returnQuantity;
 | 
				
			||||||
 | 
					        //    set
 | 
				
			||||||
 | 
					        //    {
 | 
				
			||||||
 | 
					        //        SetProperty(ref _returnQuantity, value);
 | 
				
			||||||
 | 
					        //    }
 | 
				
			||||||
 | 
					        //}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        //private int _checkQuantity = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        //[SugarColumn(IsIgnore = true)]
 | 
				
			||||||
 | 
					        //public int CheckQuantity
 | 
				
			||||||
 | 
					        //{
 | 
				
			||||||
 | 
					        //    get => _checkQuantity;
 | 
				
			||||||
 | 
					        //    set
 | 
				
			||||||
 | 
					        //    {
 | 
				
			||||||
 | 
					        //        if (value < 0)
 | 
				
			||||||
 | 
					        //        {
 | 
				
			||||||
 | 
					        //            throw new ArgumentException("盘点数量不能是负数");
 | 
				
			||||||
 | 
					        //        }
 | 
				
			||||||
 | 
					        //        SetProperty(ref _checkQuantity, value);
 | 
				
			||||||
 | 
					        //    }
 | 
				
			||||||
 | 
					        //}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        //[SugarColumn(IsIgnore = true)]
 | 
				
			||||||
 | 
					        //public int? CanReturnQuantity { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        private DrugInfo? _DrugInfo;
 | 
				
			||||||
 | 
					        [Navigate(NavigateType.ManyToOne, nameof(DrugId))]
 | 
				
			||||||
 | 
					        public DrugInfo Drug { get => _DrugInfo; set => SetProperty(ref _DrugInfo, value); }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        //[SugarColumn(IsIgnore = true)]
 | 
				
			||||||
 | 
					        //public int process { get; set; } = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        private DrugManuNo? _drugManuNo;
 | 
				
			||||||
 | 
					        [SugarColumn(IsIgnore = true)]
 | 
				
			||||||
 | 
					        public DrugManuNo? drugManuNo { get => _drugManuNo; set => SetProperty(ref _drugManuNo, value); }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        private List<ChannelStock>? _channelStocks;
 | 
				
			||||||
 | 
					        [Navigate(NavigateType.OneToMany, nameof(ChannelStock.Chnguid))]
 | 
				
			||||||
 | 
					        public List<ChannelStock> channelStocks { get => _channelStocks; set => SetProperty(ref _channelStocks, value); }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        //private DelegateCommand<ChannelList> _addManunoCommand;
 | 
				
			||||||
 | 
					        //[SugarColumn(IsIgnore = true)]
 | 
				
			||||||
 | 
					        //public DelegateCommand<ChannelList> AddManunoCommand
 | 
				
			||||||
 | 
					        //{
 | 
				
			||||||
 | 
					        //    get
 | 
				
			||||||
 | 
					        //    {
 | 
				
			||||||
 | 
					        //        if (_addManunoCommand == null)
 | 
				
			||||||
 | 
					        //            _addManunoCommand = new DelegateCommand<ChannelList>(o => DoDelete(o));
 | 
				
			||||||
 | 
					        //        return _addManunoCommand;
 | 
				
			||||||
 | 
					        //    }
 | 
				
			||||||
 | 
					        //}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        //private void DoDelete(ChannelList parameter)
 | 
				
			||||||
 | 
					        //{
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        //}
 | 
				
			||||||
 | 
					        //药品规格
 | 
				
			||||||
 | 
					        private string _drugSpec;
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "drug_manu_no")]
 | 
				
			||||||
 | 
					        public string DrugSpec { get=> _drugSpec;set=>SetProperty(ref _drugSpec, value); }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,212 @@
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using Prism.Mvvm;
 | 
				
			||||||
 | 
					using SqlSugar;
 | 
				
			||||||
 | 
					namespace DM_Weight.Models
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    /// <summary>
 | 
				
			||||||
 | 
					    /// 
 | 
				
			||||||
 | 
					    ///</summary>
 | 
				
			||||||
 | 
					    [SugarTable("channel_stock")]
 | 
				
			||||||
 | 
					    public class ChannelStock : BindableBase
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "chsguid", IsPrimaryKey = true)]
 | 
				
			||||||
 | 
					        //[SugarColumn(ColumnName = "id", IsPrimaryKey = true)]
 | 
				
			||||||
 | 
					        public string Id { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "chnguid")]
 | 
				
			||||||
 | 
					        public string Chnguid { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: NULL
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "machine_id")]
 | 
				
			||||||
 | 
					        public string MachineId { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: NULL
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "row_no")]
 | 
				
			||||||
 | 
					        public int DrawerNo { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: NULL
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "col_no")]
 | 
				
			||||||
 | 
					        public int ColNo { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: NULL
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "pos_no")]
 | 
				
			||||||
 | 
					        public int PosNo { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: NULL
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "drug_id")]
 | 
				
			||||||
 | 
					        public string DrugId { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: NULL
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "manu_no")]
 | 
				
			||||||
 | 
					        public string ManuNo { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: NULL
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "eff_date")]
 | 
				
			||||||
 | 
					        public string EffDate { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: NULL
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "quantity")]
 | 
				
			||||||
 | 
					        public int Quantity { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: 1
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "drawer_type")]
 | 
				
			||||||
 | 
					        public int DrawerType { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: 1
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "board_type")]
 | 
				
			||||||
 | 
					        public int BoardType { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: 1(用于标识毒麻柜是否给交接柜补药:0未补,1已补)
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "state")]
 | 
				
			||||||
 | 
					        public int? State { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(IsIgnore = true)]
 | 
				
			||||||
 | 
					        public bool IsSelected { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(IsIgnore = true)]
 | 
				
			||||||
 | 
					        public InOutInvoice Invoice { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(IsIgnore = true)]
 | 
				
			||||||
 | 
					        public string Location
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => DrawerNo + "-" + ColNo;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        private int _addQuantity = 0;
 | 
				
			||||||
 | 
					        [SugarColumn(IsIgnore = true)]
 | 
				
			||||||
 | 
					        public int AddQuantity
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => _addQuantity;
 | 
				
			||||||
 | 
					            set
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                SetProperty(ref _addQuantity, value);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        private int _takeQuantity = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(IsIgnore = true)]
 | 
				
			||||||
 | 
					        public int TakeQuantity
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => _takeQuantity;
 | 
				
			||||||
 | 
					            set
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                if (value > Quantity)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    throw new ArgumentException("取药数量不能大于库存");
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                SetProperty(ref _takeQuantity, value);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        //private string _tipMessage=string.Empty;
 | 
				
			||||||
 | 
					        //[SugarColumn(IsIgnore = true)]
 | 
				
			||||||
 | 
					        //public string TipMessage
 | 
				
			||||||
 | 
					        //{
 | 
				
			||||||
 | 
					        //    get => _tipMessage;
 | 
				
			||||||
 | 
					        //    set
 | 
				
			||||||
 | 
					        //    {
 | 
				
			||||||
 | 
					        //        SetProperty(ref _tipMessage, value);
 | 
				
			||||||
 | 
					        //    }
 | 
				
			||||||
 | 
					        //}
 | 
				
			||||||
 | 
					        private int _returnQuantity = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(IsIgnore = true)]
 | 
				
			||||||
 | 
					        public int ReturnQuantity
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => _returnQuantity;
 | 
				
			||||||
 | 
					            set
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                SetProperty(ref _returnQuantity, value);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        private int _checkQuantity = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(IsIgnore = true)]
 | 
				
			||||||
 | 
					        public int CheckQuantity
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => _checkQuantity;
 | 
				
			||||||
 | 
					            set
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                if (value < 0)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    throw new ArgumentException("盘点数量不能是负数");
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                SetProperty(ref _checkQuantity, value);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 药品基数
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        private int _baseQuantity = 0;
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "Check_Quantity")]
 | 
				
			||||||
 | 
					        public int BaseQuantity
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => _baseQuantity;
 | 
				
			||||||
 | 
					            set
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                SetProperty(ref _baseQuantity, value);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(IsIgnore = true)]
 | 
				
			||||||
 | 
					        public int? CanReturnQuantity { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [Navigate(NavigateType.ManyToOne, nameof(DrugId))]
 | 
				
			||||||
 | 
					        public DrugInfo DrugInfo { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(IsIgnore = true)]
 | 
				
			||||||
 | 
					        public int process { get; set; } = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(IsIgnore = true)]
 | 
				
			||||||
 | 
					        public DrugManuNo? drugManuNo { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        private ChannelList? _channelList;
 | 
				
			||||||
 | 
					        [Navigate(NavigateType.ManyToOne, nameof(Chnguid))]
 | 
				
			||||||
 | 
					        public ChannelList ChannelLst { get => _channelList; set => SetProperty(ref _channelList, value); }
 | 
				
			||||||
 | 
					        [SugarColumn(IsIgnore = true)]
 | 
				
			||||||
 | 
					        public DrugPleaseClaim PleaseClaim { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        //dm_machine_record表id值
 | 
				
			||||||
 | 
					        [SugarColumn(IsIgnore = true)]
 | 
				
			||||||
 | 
					        public int? MachineRecordId { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(IsIgnore =true)]
 | 
				
			||||||
 | 
					        public string OrderNos { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,122 @@
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					using System.Windows.Controls;
 | 
				
			||||||
 | 
					using Newtonsoft.Json;
 | 
				
			||||||
 | 
					using SqlSugar;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Models
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    /// <summary>
 | 
				
			||||||
 | 
					    /// 处方、请领单中间表
 | 
				
			||||||
 | 
					    /// </summary>
 | 
				
			||||||
 | 
					    [SugarTable("order_apply")]
 | 
				
			||||||
 | 
					    public class CollectDrug
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 是否选择
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(IsIgnore =true)]
 | 
				
			||||||
 | 
					        public bool IsSelected { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 主键
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "Applyid")]
 | 
				
			||||||
 | 
					        public int Applyid { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 药品请领单号
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "Drug_plase_id")]
 | 
				
			||||||
 | 
					        public string DrugPleaseClaimId { get; set; }
 | 
				
			||||||
 | 
					        /// 处方
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "OrderNo")]
 | 
				
			||||||
 | 
					        public string OrderNo { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 药品ID
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "Drug_Id")]
 | 
				
			||||||
 | 
					        public string DrugId { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 患者ID
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(IsIgnore =true)]
 | 
				
			||||||
 | 
					        public string PatientId { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 姓名
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(IsIgnore = true)]
 | 
				
			||||||
 | 
					        public string PName { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 性别
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(IsIgnore = true)]
 | 
				
			||||||
 | 
					        public string Sex { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 年龄
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(IsIgnore = true)] 
 | 
				
			||||||
 | 
					        public string Age { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 身份证号
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(IsIgnore = true)] 
 | 
				
			||||||
 | 
					        public string IdNumber { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 科室
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(IsIgnore = true)] 
 | 
				
			||||||
 | 
					        public string DeptName { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 药品名称
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(IsIgnore = true)] 
 | 
				
			||||||
 | 
					        public string DrugName { get;set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 规格
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(IsIgnore = true)] 
 | 
				
			||||||
 | 
					        public string DrugSpec { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 厂家
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(IsIgnore = true)] 
 | 
				
			||||||
 | 
					        public string Manufactory { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 数量
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "Quantity")]
 | 
				
			||||||
 | 
					        public int Quantity { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "Createdate")]
 | 
				
			||||||
 | 
					        public DateTime Createdate { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 状态
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "Status")] 
 | 
				
			||||||
 | 
					        public int Status { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "Machine_id")] 
 | 
				
			||||||
 | 
					        public string MachineId { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "Current_Machine_id")]
 | 
				
			||||||
 | 
					        public string CurrentMachineId { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [Navigate(NavigateType.OneToOne, nameof(DrugId))]
 | 
				
			||||||
 | 
					        public DrugInfo drugInfo { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 请领表
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [Navigate(NavigateType.ManyToOne, nameof(DrugPleaseClaimId))]
 | 
				
			||||||
 | 
					        public DrugPleaseClaim drugPleaseClaim { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(IsIgnore = true)]
 | 
				
			||||||
 | 
					        public List<DrugPleaseManuNo> ManuNoList { get; set; }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,36 @@
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					using SqlSugar;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Models
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    [SugarTable("destory_detail")]
 | 
				
			||||||
 | 
					    public class DestoryDetail
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "id", IsPrimaryKey = true)]
 | 
				
			||||||
 | 
					        public int ID { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "operatorid")]
 | 
				
			||||||
 | 
					        public int? Operatorid { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "reviewerid")]
 | 
				
			||||||
 | 
					        public int? Reviewerid { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "recordId")]
 | 
				
			||||||
 | 
					        public int RecordId { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "orderId")]
 | 
				
			||||||
 | 
					        public int OrderId { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "machine_id")]
 | 
				
			||||||
 | 
					        public string MachineId { get; set; }
 | 
				
			||||||
 | 
					            
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,31 @@
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					using Prism.Mvvm;
 | 
				
			||||||
 | 
					using SqlSugar;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Models
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    /// <summary>
 | 
				
			||||||
 | 
					    /// 药品基数表
 | 
				
			||||||
 | 
					    /// </summary>
 | 
				
			||||||
 | 
					    [SugarTable("drug_base")]
 | 
				
			||||||
 | 
					    public class DrugBase:BindableBase
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        private int _baseId = 0;
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "baseid", IsPrimaryKey = true)]
 | 
				
			||||||
 | 
					        public int BaseId { get=> _baseId; set { SetProperty(ref _baseId, value); } }
 | 
				
			||||||
 | 
					        private string _drugId;
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "drugid")]
 | 
				
			||||||
 | 
					        public string DrugId { get => _drugId; set { SetProperty(ref _drugId, value); } }
 | 
				
			||||||
 | 
					        private string _machineId = "";
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "machine_id")]
 | 
				
			||||||
 | 
					        public string MachineId { get => _machineId; set { SetProperty(ref _machineId, value); } }
 | 
				
			||||||
 | 
					        private int _baseQuantity = 0;
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "baseQuantity")]
 | 
				
			||||||
 | 
					        public int BaseQuantity { get=>_baseQuantity; set{ SetProperty(ref _baseQuantity, value); } }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,105 @@
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using Prism.Mvvm;
 | 
				
			||||||
 | 
					using SqlSugar;
 | 
				
			||||||
 | 
					namespace DM_Weight.Models
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    /// <summary>
 | 
				
			||||||
 | 
					    /// 
 | 
				
			||||||
 | 
					    ///</summary>
 | 
				
			||||||
 | 
					    [SugarTable("drug_info")]
 | 
				
			||||||
 | 
					    public class DrugInfo:BindableBase
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        //[SugarColumn(ColumnName = "pharmacy")]
 | 
				
			||||||
 | 
					        //public string Pharmacy { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// ҩƷID 
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "drug_id", IsPrimaryKey = true)]
 | 
				
			||||||
 | 
					        public string DrugId { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// ƴ 
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "py_code")]
 | 
				
			||||||
 | 
					        public string PyCode { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        //[SugarColumn(ColumnName = "BD_code")]
 | 
				
			||||||
 | 
					        //public string BdCode { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// ҩƷ 
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "drug_barcode")]
 | 
				
			||||||
 | 
					        public string DrugBarcode { get; set; }
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// ҩƷ<D2A9><C6B7><EFBFBD><EFBFBD> 
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "drug_name")]
 | 
				
			||||||
 | 
					        public string DrugName { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "drug_brand_name")]
 | 
				
			||||||
 | 
					        public string DrugBrandname { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// ҩƷ<D2A9><C6B7><EFBFBD> 
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "drug_spec")]
 | 
				
			||||||
 | 
					        public string DrugSpec { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// <20><><EFBFBD><EFBFBD> 
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "dosage")]
 | 
				
			||||||
 | 
					        public string Dosage { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// <20><>װ<EFBFBD><D7B0>λ 
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "pack_unit")]
 | 
				
			||||||
 | 
					        public string PackUnit { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "manufactory")]
 | 
				
			||||||
 | 
					        public string Manufactory { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// <20><><EFBFBD>ҩ<EFBFBD><D2A9> 
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "max_stock")]
 | 
				
			||||||
 | 
					        public int? MaxStock { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 药品类型
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName ="drug_type")]
 | 
				
			||||||
 | 
					        public string DrugType { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        //[SugarColumn(IsIgnore=true)]
 | 
				
			||||||
 | 
					        [Navigate(NavigateType.OneToMany, nameof(ChannelStock.DrugId), nameof(DrugId))]//BookA表中的studenId
 | 
				
			||||||
 | 
					        public List<ChannelStock> channelStocks { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [Navigate(NavigateType.OneToMany, nameof(DrugManuNo.DrugId))]//BookA表中的studenId
 | 
				
			||||||
 | 
					        public List<DrugManuNo>? DrugManuNos { get; set; }
 | 
				
			||||||
 | 
					        [SugarColumn(IsIgnore = true)]
 | 
				
			||||||
 | 
					        public int? StockQuantity { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        private DrugBase _base;
 | 
				
			||||||
 | 
					        [Navigate(NavigateType.OneToOne, nameof(DrugBase.DrugId), nameof(DrugId))]
 | 
				
			||||||
 | 
					        public DrugBase drugBase
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get=> _base;
 | 
				
			||||||
 | 
					            set { SetProperty(ref _base, value); }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        [SugarColumn(IsIgnore = true)]
 | 
				
			||||||
 | 
					        public string drug_name_spec { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,35 @@
 | 
				
			||||||
 | 
					using Prism.Mvvm;
 | 
				
			||||||
 | 
					using SqlSugar;
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Models
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    [SugarTable("drug_manu_no")]
 | 
				
			||||||
 | 
					    public class DrugManuNo : BindableBase
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        private string _id;
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "dmnguid", IsPrimaryKey = true)]
 | 
				
			||||||
 | 
					        public string Id { get => _id; set => SetProperty(ref _id, value); }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        private string _drugId;
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "drug_id")]
 | 
				
			||||||
 | 
					        public string DrugId { get => _drugId; set => SetProperty(ref _drugId, value); }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        private string _manuNo;
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "manu_no")]
 | 
				
			||||||
 | 
					        public string ManuNo { get => _manuNo; set => SetProperty(ref _manuNo, value); }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        private string _manuDate;
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "manu_date")]
 | 
				
			||||||
 | 
					        public string ManuDate { get => _manuDate; set => SetProperty(ref _manuDate, value); }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        private string _effDate;
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "eff_date")]
 | 
				
			||||||
 | 
					        public string EffDate { get => _effDate; set => SetProperty(ref _effDate, value); }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,130 @@
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					using Newtonsoft.Json;
 | 
				
			||||||
 | 
					using SqlSugar;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Models
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    /// <summary>
 | 
				
			||||||
 | 
					    /// 请领申请表
 | 
				
			||||||
 | 
					    /// </summary>
 | 
				
			||||||
 | 
					    [SugarTable("drug_please_claim")]
 | 
				
			||||||
 | 
					    public class DrugPleaseClaim
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "id")]
 | 
				
			||||||
 | 
					        public int Id { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "drug_id")]
 | 
				
			||||||
 | 
					        public string DrugId { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 请领数量
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "get_quantity")]
 | 
				
			||||||
 | 
					        public int GetQuantity { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 交处方张数
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "return_prescription_quantity")]
 | 
				
			||||||
 | 
					        public int ReturnPrQuantity { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 处方用量
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "prescription_quantity")]
 | 
				
			||||||
 | 
					        public int PrescriptionQuantity { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 空瓶数量
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "empties_quantity")]
 | 
				
			||||||
 | 
					        public int EmptiesQuantity { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 实发数
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "issue_quantity")]
 | 
				
			||||||
 | 
					        public int IssueQuantity { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 批次(多条)
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "drug_manu_no")]
 | 
				
			||||||
 | 
					        [JsonProperty("drug_manu_no")]
 | 
				
			||||||
 | 
					        public string _DrugManuNos { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 备注1
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "notes_nn")]
 | 
				
			||||||
 | 
					        public string NotesNN { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 备注2
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "notes_n")]
 | 
				
			||||||
 | 
					        public string NotesN { get;set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 32:三级向二级请领;23:二级向三级退;
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "type")]
 | 
				
			||||||
 | 
					        public int Type { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 0:创建完成;1:二级已授权;2:一级已查阅;3:已关联His
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "state")]
 | 
				
			||||||
 | 
					        public int State { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 凭证号
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "voucher")]
 | 
				
			||||||
 | 
					        public string Voucher { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 机器id
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "machine_id")]
 | 
				
			||||||
 | 
					        public string MachineId { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 创建时间
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "do_date")]
 | 
				
			||||||
 | 
					        public DateTime DoDate { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 申请人
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "apply_user")]
 | 
				
			||||||
 | 
					        public int ApplyUser { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 复核人
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "exp_user")]
 | 
				
			||||||
 | 
					        public int ReviewUser { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "please_no", IsPrimaryKey = true)]
 | 
				
			||||||
 | 
					        public string PleaseNo { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "department")]
 | 
				
			||||||
 | 
					        public string Department { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "totalQuantity")]
 | 
				
			||||||
 | 
					        public int TotalQuantity { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        //[Navigate(NavigateType.ManyToMany, nameof(PleaseNo))]
 | 
				
			||||||
 | 
					        //public CollectDrug collectDrug { get; set; }
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        [Navigate(NavigateType.OneToOne, nameof(DrugId))]
 | 
				
			||||||
 | 
					        public DrugInfo DrugInfo { get; set; }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,21 @@
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Models
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    public class DrugPleaseManuNo
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        public string DrugId { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public string ManuNo { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public string EffDate { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public int Quantity { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,20 @@
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Models
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    public class DrugPleaseState
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 药品请领状态名
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        public string StateName { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  药品请领状态值
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        public int StateValue { get; set; }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,14 @@
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Models
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    public class DrugType
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        public int TypeValue { get; set; }
 | 
				
			||||||
 | 
					        public string TypeName { get; set; }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,45 @@
 | 
				
			||||||
 | 
					using Prism.Mvvm;
 | 
				
			||||||
 | 
					using SqlSugar;
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Models
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    //交接班表
 | 
				
			||||||
 | 
					    [SugarTable("hkc_changeshifts")]
 | 
				
			||||||
 | 
					    public class HkcChangeShifts : BindableBase
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "id", IsPrimaryKey = true)]
 | 
				
			||||||
 | 
					        public int Id { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "optDate")]
 | 
				
			||||||
 | 
					        public DateTime? OptDate { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "FromOperator")]
 | 
				
			||||||
 | 
					        public string FromOperator { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "FromRviewer")]
 | 
				
			||||||
 | 
					        public string FromRviewer { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "ToOperator")]
 | 
				
			||||||
 | 
					        public string ToOperator { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "ToReviewer")]
 | 
				
			||||||
 | 
					        public string ToReviewer { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "ToDate")]
 | 
				
			||||||
 | 
					        public DateTime? ToDate { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "State")]
 | 
				
			||||||
 | 
					        public string State { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "optState")]
 | 
				
			||||||
 | 
					        public string OptState { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "machine_id")]
 | 
				
			||||||
 | 
					        public string Machineid { get; set; }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,149 @@
 | 
				
			||||||
 | 
					using SqlSugar;
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Reactive;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Models
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    [SugarTable("in_out_invoice")]
 | 
				
			||||||
 | 
					    public class InOutInvoice
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 主键(序号)       
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity =true)]
 | 
				
			||||||
 | 
					        public int Id { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "in_pharmacy_id")]
 | 
				
			||||||
 | 
					        public string InPharmacyId { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "out_pharmacy_id")]
 | 
				
			||||||
 | 
					        public string OutPharmacyId { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 库存管理单位(入库单位代码) 
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "storage")]
 | 
				
			||||||
 | 
					        public string storage { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					         /// <summary>
 | 
				
			||||||
 | 
					         /// 单据号
 | 
				
			||||||
 | 
					         /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "invoice_no")]
 | 
				
			||||||
 | 
					        public string InvoiceNo { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "invoice_date")]
 | 
				
			||||||
 | 
					        public string InvoiceDate { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 药品id
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "drug_id")]
 | 
				
			||||||
 | 
					        public string DrugId { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [Navigate(NavigateType.ManyToOne, nameof(DrugId))]
 | 
				
			||||||
 | 
					        public DrugInfo DrugInfo { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 药品规格
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "drug_spec")]
 | 
				
			||||||
 | 
					        public string DrugSpec { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 计算单位
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "units")]
 | 
				
			||||||
 | 
					        public string Units { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 厂商标识
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "firm_id")]
 | 
				
			||||||
 | 
					        public string FirmId { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 包装规格(反映药品含量及包装信息,如0.25g*30)   
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "package_spec")]
 | 
				
			||||||
 | 
					        public string PackageSpec { get; set; }
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 数量(以包装单位所计的数量)      
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "quantity")]
 | 
				
			||||||
 | 
					        public int quantity { get; set; }
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 计量单位,可使用任一级管理上方便的包装
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "package_units")]
 | 
				
			||||||
 | 
					        public string PackageUnits { get; set; }
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 药品批次
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "drug_manu_no")]
 | 
				
			||||||
 | 
					        public string DrugManuNo { get; set; }
 | 
				
			||||||
 | 
					       
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 创建时间(入库日期)
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "create_time")]
 | 
				
			||||||
 | 
					        public DateTime CreateTime { get; set; }
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 1.请领入库 0.其它
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "type")]
 | 
				
			||||||
 | 
					        public int Type { get; set; }
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 类型描述
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "type_describe")]
 | 
				
			||||||
 | 
					        public string TypeDescribe { get; set; }
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 供货方
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "supplier")]
 | 
				
			||||||
 | 
					        public string Supplier { get; set; }
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 操作人
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "operator")]
 | 
				
			||||||
 | 
					        public string Operator { get; set; }
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 存放库房
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "sub_storage")]
 | 
				
			||||||
 | 
					        public string SubStorage { get; set; }
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 备注
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "memos")]
 | 
				
			||||||
 | 
					        public string Memos { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "status")]
 | 
				
			||||||
 | 
					        public int Status { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "drug_eff_date")]
 | 
				
			||||||
 | 
					        public string DrugEffDate { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "his_id")]
 | 
				
			||||||
 | 
					        public string HisId { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "cancel_flag")]
 | 
				
			||||||
 | 
					        public int CancelFlag { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,20 @@
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Models
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    [Serializable]
 | 
				
			||||||
 | 
					    public class Invoice
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        public string InvoiceNo { get; set; }
 | 
				
			||||||
 | 
					        public string InvoiceDate { get; set; }
 | 
				
			||||||
 | 
					        public int Count { get; set; }
 | 
				
			||||||
 | 
					        public int Quantity { get; set; }
 | 
				
			||||||
 | 
					        public int Status { get; set; }
 | 
				
			||||||
 | 
					        public string PharmacyName1 { get; set; }
 | 
				
			||||||
 | 
					        public string PharmacyName2 { get; set; }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,199 @@
 | 
				
			||||||
 | 
					using Prism.Mvvm;
 | 
				
			||||||
 | 
					using SqlSugar;
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Security.Principal;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Models
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    [SugarTable("dm_machine_record")]
 | 
				
			||||||
 | 
					    public class MachineRecord : BindableBase
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 主键 
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true)]
 | 
				
			||||||
 | 
					        public int Id { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 设备id 
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "machine_id")]
 | 
				
			||||||
 | 
					        public string MachineId { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 药品id 
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "drug_id")]
 | 
				
			||||||
 | 
					        public string DrugId { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [Navigate(NavigateType.ManyToOne, nameof(DrugId))]
 | 
				
			||||||
 | 
					        public DrugInfo DrugInfo { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 数量 
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "quantity")]
 | 
				
			||||||
 | 
					        public int Quantity { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        //[SugarColumn(ColumnName = "stock_quantity")]
 | 
				
			||||||
 | 
					        //public int? StockQuantity { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        //[SugarColumn(ColumnName = "check_quantity")]
 | 
				
			||||||
 | 
					        //public int? CheckQuantity { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 批号 
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "manu_no")]
 | 
				
			||||||
 | 
					        public string ManuNo { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 操作人id 
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "operator")]
 | 
				
			||||||
 | 
					        public int? Operator { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [Navigate(NavigateType.ManyToOne, nameof(Operator))]
 | 
				
			||||||
 | 
					        public UserList User { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 审核人id 
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "reviewer")]
 | 
				
			||||||
 | 
					        public int? Reviewer { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 操作时间 
 | 
				
			||||||
 | 
					        /// 默认值: CURRENT_TIMESTAMP
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "operation_time")]
 | 
				
			||||||
 | 
					        public DateTime OperationTime { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 效期 
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "eff_date")]
 | 
				
			||||||
 | 
					        public DateTime? EffDate { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 出库入库类型(1入库2出库31还药32还空瓶) 
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "type")]
 | 
				
			||||||
 | 
					        public int Type { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///操作类型(1放入药箱;0取走药箱) 
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "option_type")]
 | 
				
			||||||
 | 
					        public int OptionType { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 出入库调拨单id 
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "invoice_id")]
 | 
				
			||||||
 | 
					        public string InvoiceId { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 列号 
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "col_no")]
 | 
				
			||||||
 | 
					        public int ColNo { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 抽屉号 
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "drawer_no")]
 | 
				
			||||||
 | 
					        public int DrawerNo { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 取药科室 
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "department_id")]
 | 
				
			||||||
 | 
					        public string DepartmentId { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 是否已经退药(0:没有1:还了部分2:完成) 
 | 
				
			||||||
 | 
					        /// 默认值: 0
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "status", IsOnlyIgnoreInsert = true)]
 | 
				
			||||||
 | 
					        public int Status { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 退药量 
 | 
				
			||||||
 | 
					        /// 默认值: 0
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        private int returnQuantity1;
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "return_quantity1", IsOnlyIgnoreInsert = true)]
 | 
				
			||||||
 | 
					        public int ReturnQuantity1 { get => returnQuantity1; set => SetProperty(ref returnQuantity1, value); }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 退空瓶量 
 | 
				
			||||||
 | 
					        /// 默认值: 0
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        private int returnQuantity2;
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "return_quantity2", IsOnlyIgnoreInsert = true)]
 | 
				
			||||||
 | 
					        public int ReturnQuantity2 { get => returnQuantity2; set => SetProperty(ref returnQuantity2, value); }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 取药记录id 
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "get_id")]
 | 
				
			||||||
 | 
					        public int? GetId { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 是否已经销毁 
 | 
				
			||||||
 | 
					        /// 默认值: 0
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "is_destroy", IsOnlyIgnoreInsert = true)]
 | 
				
			||||||
 | 
					        public int? IsDestroy { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 销毁操作人 
 | 
				
			||||||
 | 
					        /// 默认值: 0
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "take_user", IsOnlyIgnoreInsert = true)]
 | 
				
			||||||
 | 
					        public string TakeUser { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 销毁审核人 
 | 
				
			||||||
 | 
					        /// 默认值: 0
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "fuzeren", IsOnlyIgnoreInsert = true)]
 | 
				
			||||||
 | 
					        public string DestoryReviewerUser { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(IsIgnore = true)]
 | 
				
			||||||
 | 
					        public int CanReturnQuantity
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => Quantity - ReturnQuantity1 - ReturnQuantity2;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(IsIgnore = true)]
 | 
				
			||||||
 | 
					        public bool IsSelected { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 已核销数量
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        private int hasCheckNum;
 | 
				
			||||||
 | 
					        [SugarColumn(IsIgnore = true)]
 | 
				
			||||||
 | 
					        public int HasCheckNum
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => hasCheckNum;
 | 
				
			||||||
 | 
					            set => SetProperty(ref hasCheckNum, value);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        private int checkQuantity;
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 核销数量
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(IsIgnore = true)]
 | 
				
			||||||
 | 
					        public int CheckQuantity
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => checkQuantity;
 | 
				
			||||||
 | 
					            set
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                if (value > Quantity - hasCheckNum)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    throw new ArgumentException("核销数量不能大于取药数量");
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                //退空瓶
 | 
				
			||||||
 | 
					                ReturnQuantity2 = value + hasCheckNum;
 | 
				
			||||||
 | 
					                //退药量
 | 
				
			||||||
 | 
					                ReturnQuantity1 = Quantity - value - hasCheckNum;
 | 
				
			||||||
 | 
					                SetProperty(ref checkQuantity, value);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [Navigate(NavigateType.OneToMany, nameof(SurgicalScheduleDetail.GetRecordId))]
 | 
				
			||||||
 | 
					        public List<SurgicalScheduleDetail> _SurgicalScheduleDetailLst { get; set; }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,16 @@
 | 
				
			||||||
 | 
					using Prism.Mvvm;
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Models
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    public class OrderDepartment : BindableBase
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        //科室
 | 
				
			||||||
 | 
					        public string _deptName="全部";
 | 
				
			||||||
 | 
					        public string DeptName { get=>_deptName; set { SetProperty(ref _deptName, value); } }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,147 @@
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using SqlSugar;
 | 
				
			||||||
 | 
					namespace DM_Weight.Models
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    /// <summary>
 | 
				
			||||||
 | 
					    /// 
 | 
				
			||||||
 | 
					    ///</summary>
 | 
				
			||||||
 | 
					    [SugarTable("order_detail_sm")]
 | 
				
			||||||
 | 
					    public class OrderDetail
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        //[SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true)]
 | 
				
			||||||
 | 
					        //public int Id { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: NULL
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "order_id", IsPrimaryKey = true)]
 | 
				
			||||||
 | 
					        public int? OrderId { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "patient_id")]
 | 
				
			||||||
 | 
					        public string PatientId { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "order_no")]
 | 
				
			||||||
 | 
					        public string OrderNo { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "charge_date")]
 | 
				
			||||||
 | 
					        public DateTime ChargeDate { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: NULL
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        //[SugarColumn(ColumnName = "serial_no")]
 | 
				
			||||||
 | 
					        //public int? SerialNo { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "drug_id")]
 | 
				
			||||||
 | 
					        public string DrugId { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [Navigate(NavigateType.ManyToOne, nameof(DrugId))]
 | 
				
			||||||
 | 
					        public DrugInfo DrugInfo { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "quantity")]
 | 
				
			||||||
 | 
					        public int Quantity { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: NULL
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "order_unit")]
 | 
				
			||||||
 | 
					        public string OrderUnit { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: 1
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "unit_convercoef")]
 | 
				
			||||||
 | 
					        public int? UnitConvercoef { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: NULL
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "set_manu_no")]
 | 
				
			||||||
 | 
					        public string SetManuNo { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: NULL
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "set_eff_date")]
 | 
				
			||||||
 | 
					        public string SetEffDate { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: NULL
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        //[SugarColumn(ColumnName = "price")]
 | 
				
			||||||
 | 
					        //public string Price { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: NULL
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        //[SugarColumn(ColumnName = "total_price")]
 | 
				
			||||||
 | 
					        //public string TotalPrice { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: NULL
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "use_discrip")]
 | 
				
			||||||
 | 
					        public string UseDiscrip { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: NULL
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "use_frequ")]
 | 
				
			||||||
 | 
					        public string UseFrequ { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: NULL
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "use_once")]
 | 
				
			||||||
 | 
					        public string UseOnce { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: NULL
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "use_by")]
 | 
				
			||||||
 | 
					        public string UseBy { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: '0'
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "use_self")]
 | 
				
			||||||
 | 
					        public string UseSelf { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: NULL
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "use_dosage")]
 | 
				
			||||||
 | 
					        public string UseDosage { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        //[Navigate(NavigateType.ManyToOne, nameof(OrderNo))]
 | 
				
			||||||
 | 
					        //public OrderInfo _OrderInfo { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(IsIgnore =true)]
 | 
				
			||||||
 | 
					        public string DrawerNo { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(IsIgnore =true)]
 | 
				
			||||||
 | 
					        public string ColNo { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [Navigate(NavigateType.ManyToOne, nameof(OrderId))]
 | 
				
			||||||
 | 
					        public OrderInfo _OrderInfo { get; set; }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,32 @@
 | 
				
			||||||
 | 
					using SqlSugar;
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Models
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    [SugarTable("hkc_order_finish")] 
 | 
				
			||||||
 | 
					    public class OrderFinish
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "id", IsPrimaryKey = true)]
 | 
				
			||||||
 | 
					        public int Id { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "pharmacy")]
 | 
				
			||||||
 | 
					        public string Pharmacy { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "patient_id")]
 | 
				
			||||||
 | 
					        public string PatientId { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "order_no")]
 | 
				
			||||||
 | 
					        public string OrderNo { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "state")]
 | 
				
			||||||
 | 
					        public int State { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "operator")]
 | 
				
			||||||
 | 
					        public string Operator { get; set; }
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,262 @@
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using Prism.Mvvm;
 | 
				
			||||||
 | 
					using SqlSugar;
 | 
				
			||||||
 | 
					namespace DM_Weight.Models
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    /// <summary>
 | 
				
			||||||
 | 
					    /// 
 | 
				
			||||||
 | 
					    ///</summary>
 | 
				
			||||||
 | 
					    [SugarTable("order_info_sm")]
 | 
				
			||||||
 | 
					    public class OrderInfo:BindableBase
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 是否选中
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        private bool _itemIsChecked;
 | 
				
			||||||
 | 
					        [SugarColumn(IsIgnore = true)]
 | 
				
			||||||
 | 
					        public bool ItemIsChecked { get=> _itemIsChecked; set=>SetProperty(ref _itemIsChecked,value); }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        private int _orderId;
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "order_id", IsPrimaryKey = true, IsIdentity = true)]
 | 
				
			||||||
 | 
					        public int OrderId { get=> _orderId; set=>SetProperty(ref _orderId,value); }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: NULL
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        private string _pharmacy;
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "pharmacy")]
 | 
				
			||||||
 | 
					        public string Pharmacy { get=>_pharmacy; set=>SetProperty(ref _pharmacy,value); }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        private string _orderNo;
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "order_no")]
 | 
				
			||||||
 | 
					        public string OrderNo { get=> _orderNo; set=>SetProperty(ref _orderNo,value); }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        private string _patientId;
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "patient_id")]
 | 
				
			||||||
 | 
					        public string PatientId { get=> _patientId; set=>SetProperty(ref _patientId,value); }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        private string _pName;
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "p_name")]
 | 
				
			||||||
 | 
					        public string PName { get=> _pName; set=>SetProperty(ref _pName,value); }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: NULL
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        private string _sex;
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "sex")]
 | 
				
			||||||
 | 
					        public string Sex { get=> _sex; set=>SetProperty(ref _sex,value); }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: NULL
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        private string _age;
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "age")]
 | 
				
			||||||
 | 
					        public string Age { get=> _age; set=>SetProperty(ref _age,value); }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: NULL
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        private string _idNumber;
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "id_number")]
 | 
				
			||||||
 | 
					        public string IdNumber { get=> _idNumber; set=> SetProperty(ref _idNumber, value); }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: NULL
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        private string _patientCard;
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "patient_card")]
 | 
				
			||||||
 | 
					        public string PatientCard { get=> _patientCard; set=>SetProperty(ref _patientCard,value); }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: NULL
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        private string _invoiceNo;
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "invoice_no")]
 | 
				
			||||||
 | 
					        public string InvoiceNo { get=> _invoiceNo; set=>SetProperty(ref _invoiceNo,value); }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: NULL
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        private string _patientNo;
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "patient_no")]
 | 
				
			||||||
 | 
					        public string PatientNo { get=> _patientNo; set=>SetProperty(ref _patientNo,value); }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: NULL
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        private string _doctorName;
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "doctor_name")]
 | 
				
			||||||
 | 
					        public string DoctorName { get=> _doctorName; set=>SetProperty(ref _doctorName,value); }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: NULL
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        private DateTime _orderDate;
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "order_date")]
 | 
				
			||||||
 | 
					        public DateTime OrderDate { get=> _orderDate; set=>SetProperty(ref _orderDate,value); }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        private DateTime _chargeDate;
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "charge_date")]
 | 
				
			||||||
 | 
					        public DateTime ChargeDate { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: NULL
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        private DateTime _recvDate;
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "recv_date")]
 | 
				
			||||||
 | 
					        public DateTime RecvDate { get=> _recvDate; set=>SetProperty(ref _recvDate,value); }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: NULL
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        private string _deptName;
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "dept_name")]
 | 
				
			||||||
 | 
					        public string DeptName { get=> _deptName; set=>SetProperty(ref _deptName,value); }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: NULL
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        private string _disease;
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "disease")]
 | 
				
			||||||
 | 
					        public string Disease { get=> _disease; set=>SetProperty(ref _disease,value); }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: NULL
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        private string _orderType;
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "order_type")]
 | 
				
			||||||
 | 
					        public string OrderType { get=> _orderType; set=>SetProperty(ref _orderType,value); }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: NULL
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        private string _chargeType;
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "charge_type")]
 | 
				
			||||||
 | 
					        public string ChargeType { get=> _chargeType; set=>SetProperty(ref _chargeType,value); }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        private int _state;
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "state")]
 | 
				
			||||||
 | 
					        public int State { get=> _state; set=>SetProperty(ref _state,value); }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: 0
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        private int? _hisDispFlag;
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "his_disp_flag")]
 | 
				
			||||||
 | 
					        public int? HisDispFlag { get=> _hisDispFlag; set=>SetProperty(ref _hisDispFlag,value); }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: 0
 | 
				
			||||||
 | 
					        ///</summary>]
 | 
				
			||||||
 | 
					        private int? _cancelFlag;
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "cancel_flag")]
 | 
				
			||||||
 | 
					        public int? CancelFlag { get=> _cancelFlag; set=>SetProperty(ref _cancelFlag,value); }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  添加值1药师已确认,2管理已核对处方
 | 
				
			||||||
 | 
					        /// 默认值: 0
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        private int? _dmStatus;
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "dm_status")]
 | 
				
			||||||
 | 
					        public int? DmStatus { get=> _dmStatus; set=>SetProperty(ref _dmStatus,value); }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: NULL
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        //[SugarColumn(ColumnName = "agent_name")]
 | 
				
			||||||
 | 
					        //public string AgentName { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: NULL
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        //[SugarColumn(ColumnName = "agent_id_no")]
 | 
				
			||||||
 | 
					        //public string AgentIdNo { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: NULL
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "costs")]
 | 
				
			||||||
 | 
					        public decimal? Costs { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 药品请领状态(0未请领;1已请领)
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "apply_status")]
 | 
				
			||||||
 | 
					        public int ApplyStatus { get;set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: NULL
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "machine_id")]
 | 
				
			||||||
 | 
					        public string MachineId { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: NULL
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        //[SugarColumn(ColumnName = "payments")]
 | 
				
			||||||
 | 
					        //public decimal? Payments { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: NULL
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        //[SugarColumn(ColumnName = "dispensary")]
 | 
				
			||||||
 | 
					        //public string Dispensary { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        /// 默认值: NULL
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        //[SugarColumn(ColumnName = "identity")]
 | 
				
			||||||
 | 
					        //public string Identity { get; set; }
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        [Navigate(NavigateType.OneToMany, nameof(OrderDetail.OrderId))]
 | 
				
			||||||
 | 
					        public List<OrderDetail> OrderDetailList { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        //一个处方对应一种药
 | 
				
			||||||
 | 
					        [Navigate(NavigateType.OneToOne, nameof(OrderDetail.OrderId))]
 | 
				
			||||||
 | 
					        public OrderDetail _OrderDetail { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        //处方下药品总数
 | 
				
			||||||
 | 
					        [SugarColumn(IsIgnore =true)]
 | 
				
			||||||
 | 
					        public int TotalQuantity { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        //麻醉师工号
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "anaesthetist_code")]
 | 
				
			||||||
 | 
					        public string DoctorCode { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        //麻醉师姓名
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "anaesthetist_name")]
 | 
				
			||||||
 | 
					        public string AnaesthetistName { get; set; }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,35 @@
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Collections.ObjectModel;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using SqlSugar;
 | 
				
			||||||
 | 
					namespace DM_Weight.Models
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    /// <summary>
 | 
				
			||||||
 | 
					    /// 
 | 
				
			||||||
 | 
					    ///</summary>
 | 
				
			||||||
 | 
					    [Serializable]
 | 
				
			||||||
 | 
					    public class PremissionDm
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 主键 
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					         public int Id { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 菜单名 
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					         public string PremissionName { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 菜单路径 
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					         public string PremissionPath { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 图片source 
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        public string PremissionImage { get; set; }
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        public ObservableCollection<PremissionDm>? Children { get; set; }
 | 
				
			||||||
 | 
					     
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,102 @@
 | 
				
			||||||
 | 
					using SqlSugar;
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Models
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    [SugarTable("rejection_report")]
 | 
				
			||||||
 | 
					    public class RejectionReport
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 主键
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "id", IsPrimaryKey = true)]
 | 
				
			||||||
 | 
					        public int Id { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 发药时间
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "SendDate")]
 | 
				
			||||||
 | 
					        public DateTime SendDate { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 发药者
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "SendUser")]
 | 
				
			||||||
 | 
					        public string SendUser { get;set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 领药者
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "ReceiveUser")]
 | 
				
			||||||
 | 
					        public string ReceiveUser { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 实发数
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "RealNum")]
 | 
				
			||||||
 | 
					        public int RealNum { get;set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 实物数
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "InfactNum")]
 | 
				
			||||||
 | 
					        public int InfactNum { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 空安瓿
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "EmptyNum")]
 | 
				
			||||||
 | 
					        public int EmptyNum { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 还药时间
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "ReturnTime")]
 | 
				
			||||||
 | 
					        public string ReturnTime { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 还药者
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "ReturnUser")]
 | 
				
			||||||
 | 
					        public string ReturnUser { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 接收者
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "ReturnReceiveUser")]
 | 
				
			||||||
 | 
					        public string ReturnReceiveUser { get;set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 补充者
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "AddUser")]
 | 
				
			||||||
 | 
					        public string AddUser { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 核对者
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "AddCheckUser")]
 | 
				
			||||||
 | 
					        public string AddCheckUser { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 操作时间
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "OperationTime")]
 | 
				
			||||||
 | 
					        public DateTime OperationTime { get; set; }
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "DrugId")]
 | 
				
			||||||
 | 
					        public string DrugId { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 药品名称
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "DrugName")]
 | 
				
			||||||
 | 
					        public string DrugName { get; set;}
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 药品规格
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "DrugSpec")]
 | 
				
			||||||
 | 
					        public string DrugSpec { get;set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 总基数
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "BaseNum")]
 | 
				
			||||||
 | 
					        public string BaseNum { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 药箱号
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "DrawerNo")]
 | 
				
			||||||
 | 
					        public int DrawerNo { get; set; }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,40 @@
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using SqlSugar;
 | 
				
			||||||
 | 
					namespace DM_Weight.Models
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    /// <summary>
 | 
				
			||||||
 | 
					    /// 
 | 
				
			||||||
 | 
					    ///</summary>
 | 
				
			||||||
 | 
					    [SugarTable("role")]
 | 
				
			||||||
 | 
					    public class RoleDm
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					         [SugarColumn(ColumnName="id" ,IsPrimaryKey = true ,IsIdentity = true  )]
 | 
				
			||||||
 | 
					         public int? Id { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					         [SugarColumn(ColumnName="role_name"    )]
 | 
				
			||||||
 | 
					         public string RoleName { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        //[SugarColumn(ColumnName="role_des"    )]
 | 
				
			||||||
 | 
					        //public string RoleDes { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        ///[SugarColumn(ColumnName="permissions"    )]
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "permissions", ColumnDataType = "varchar(4000)" /*可以设置类型*/, IsJson = true)]//必填
 | 
				
			||||||
 | 
					        public List<PremissionDm> Permissions { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					         [SugarColumn(ColumnName="machine_id"    )]
 | 
				
			||||||
 | 
					         public string MachineId { get; set; }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,56 @@
 | 
				
			||||||
 | 
					using SqlSugar;
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Models
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    [SugarTable("SettingPage")]
 | 
				
			||||||
 | 
					    public class SettingPage
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
 | 
				
			||||||
 | 
					        public string Id { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 页面名称
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "Name")]
 | 
				
			||||||
 | 
					        public string Name { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 页面连接
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "Url")]
 | 
				
			||||||
 | 
					        public string Url { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///可用标志
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "Flag")]
 | 
				
			||||||
 | 
					        public string Flag { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// view名称
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "ViewName")]
 | 
				
			||||||
 | 
					        public string ViewName { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 图标名称
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "IconName")]
 | 
				
			||||||
 | 
					        public string Icon { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 层级
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "Level")]
 | 
				
			||||||
 | 
					        public int Level { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 父级id
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "Parentid")]
 | 
				
			||||||
 | 
					        public int Parentid { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 0可用1不可用
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "State")]
 | 
				
			||||||
 | 
					        public int State { get; set; }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,55 @@
 | 
				
			||||||
 | 
					using SqlSugar;
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Models
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    [SugarTable("hkc_shiftsreport")]
 | 
				
			||||||
 | 
					    public class ShiftsReport
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "id", IsPrimaryKey = true)]
 | 
				
			||||||
 | 
					        public int Id { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "drug_name")]
 | 
				
			||||||
 | 
					        public string DrugName { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "drug_spec")]
 | 
				
			||||||
 | 
					        public string DrugSpec { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "beforeNum")]
 | 
				
			||||||
 | 
					        public int? BeforeNum { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "getNum")]
 | 
				
			||||||
 | 
					        public int? GetNum { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "useNum")]
 | 
				
			||||||
 | 
					        public int? UseNum { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "manu_no")]
 | 
				
			||||||
 | 
					        public string ManuNo { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "surplus")]
 | 
				
			||||||
 | 
					        public int? Surplus { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "opt_Date")]
 | 
				
			||||||
 | 
					        public DateTime OptDate { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "FromOperator")]
 | 
				
			||||||
 | 
					        public string FromOperator { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "FromReviewer")]
 | 
				
			||||||
 | 
					        public string FromReviewer { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "ToOperator")]
 | 
				
			||||||
 | 
					        public string ToOperator { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "ToReviewer")]
 | 
				
			||||||
 | 
					        public string ToReviewer { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "machineId")]
 | 
				
			||||||
 | 
					        public string MachineId { get; set; }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,176 @@
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					using SqlSugar;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Models
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    [SugarTable("surgical_schedule")]
 | 
				
			||||||
 | 
					    public class SurgicalSchedule
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 主键
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "id", IsPrimaryKey = true)]
 | 
				
			||||||
 | 
					        public int Id { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 手术ID
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "operation_id")]
 | 
				
			||||||
 | 
					        public string OperationId { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 患者id
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "patient_id")]
 | 
				
			||||||
 | 
					        public string PatientId { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 患者姓名
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "patient_name")]
 | 
				
			||||||
 | 
					        public string PName { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 住院号
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "hospital_no")]
 | 
				
			||||||
 | 
					        public string HospitalNo { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 床号
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "bed_no")]
 | 
				
			||||||
 | 
					        public string BedNo { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 性别
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "sex")]
 | 
				
			||||||
 | 
					        public string Sex { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 年龄
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "age")]
 | 
				
			||||||
 | 
					        public string Age { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 出生日期
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "birthday")]
 | 
				
			||||||
 | 
					        public DateTime Birthday { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 身份证号
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "id_number")]
 | 
				
			||||||
 | 
					        public string IdNumber { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 住院病区
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "ward_code")]
 | 
				
			||||||
 | 
					        public string WardCode { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 联系电话
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "link_tel")]
 | 
				
			||||||
 | 
					        public string LinkTel { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 联系地址
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "link_addr")]
 | 
				
			||||||
 | 
					        public string LinkAddr { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 入院日期
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "in_date")]
 | 
				
			||||||
 | 
					        public string Indate { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 入院诊断
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "in_diagnosis")]
 | 
				
			||||||
 | 
					        public string Indiagnosis { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 医生姓名
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "doctor_name")]
 | 
				
			||||||
 | 
					        public string DoctorName { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 手术间代码
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "op_room_code")]
 | 
				
			||||||
 | 
					        public string OpRoomCode { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 手术间名称
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "op_room_name")]
 | 
				
			||||||
 | 
					        public string OpRoomName { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 麻醉医生编码
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "ana_doctor_code")]
 | 
				
			||||||
 | 
					        public string AnaDoctorCode { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 麻醉医生姓名
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "ana_doctor_name")]
 | 
				
			||||||
 | 
					        public string AnaDoctorName { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 手术开始时间
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "begin_time")]
 | 
				
			||||||
 | 
					        public DateTime BeginTime { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 手术计划开始时间
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "schedule_time")]
 | 
				
			||||||
 | 
					        public DateTime ScheduleTime { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 手术完成时间
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "end_time")]
 | 
				
			||||||
 | 
					        public DateTime EndTime { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 数据插入时间
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "insert_time")]
 | 
				
			||||||
 | 
					        public DateTime InsertTime { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 最后一次更新时间
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "update_time")]
 | 
				
			||||||
 | 
					        public DateTime UpdateTime { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// HIS状态1:新开2:作废
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "his_state")]
 | 
				
			||||||
 | 
					        public int HisState { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///取药状态0未取1已取2已还
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "dm_status")]
 | 
				
			||||||
 | 
					        public int DmStatus { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "anaesthesia")]
 | 
				
			||||||
 | 
					        public string Anaesthesia { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [Navigate(NavigateType.OneToMany, nameof(SurgicalSchedule.OperationId))]
 | 
				
			||||||
 | 
					        public SurgicalScheduleDetail _SurgicalScheduleDetail { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,68 @@
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					using SqlSugar;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Models
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    [SugarTable("surgical_schedule_detail")]
 | 
				
			||||||
 | 
					    public class SurgicalScheduleDetail
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 主键
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "id",IsPrimaryKey =true)]
 | 
				
			||||||
 | 
					        public  int Id { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 手术id
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "operation_id")]
 | 
				
			||||||
 | 
					        public string OperationId { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 取药记录id
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "get_record_id")]
 | 
				
			||||||
 | 
					        public int GetRecordId { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 处方数量
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "quantity")]
 | 
				
			||||||
 | 
					        public int Quantity { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 药品id
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "drug_id")]
 | 
				
			||||||
 | 
					        public string DrugId { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 批次
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "manu_no")]
 | 
				
			||||||
 | 
					        public string ManuNo { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 效期
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "eff_date")]
 | 
				
			||||||
 | 
					        public string EffDate { get;set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 状态
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "status")]
 | 
				
			||||||
 | 
					        public int Status { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 操作人
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "insert_user_id")]
 | 
				
			||||||
 | 
					        public int? InsertUserId { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,32 @@
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					using SqlSugar;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Models
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    /// <summary>
 | 
				
			||||||
 | 
					    /// 温湿度
 | 
				
			||||||
 | 
					    /// </summary>
 | 
				
			||||||
 | 
					    [SugarTable("temperature_humidity")]
 | 
				
			||||||
 | 
					    public class TemperatureHumidityInfo
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "id", IsPrimaryKey = true)]
 | 
				
			||||||
 | 
					        public int ID { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "groupNo")]
 | 
				
			||||||
 | 
					        public string GroupNo { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "temp")]
 | 
				
			||||||
 | 
					        public string Temp { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "humi")]
 | 
				
			||||||
 | 
					        public string Humi { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [SugarColumn(ColumnName = "addTime")]
 | 
				
			||||||
 | 
					        public DateTime AddTime { get; set; }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,77 @@
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using SqlSugar;
 | 
				
			||||||
 | 
					namespace DM_Weight.Models
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    /// <summary>
 | 
				
			||||||
 | 
					    /// 
 | 
				
			||||||
 | 
					    ///</summary>
 | 
				
			||||||
 | 
					    [SugarTable("user_list")]
 | 
				
			||||||
 | 
					    public class UserList
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					         [SugarColumn(ColumnName="id" ,IsPrimaryKey = true ,IsIdentity = true  )]
 | 
				
			||||||
 | 
					         public int Id { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					         [SugarColumn(ColumnName="user_id"    )]
 | 
				
			||||||
 | 
					         public string UserName { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					         [SugarColumn(ColumnName="user_name"    )]
 | 
				
			||||||
 | 
					         public string Nickname { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					         [SugarColumn(ColumnName="pass_word"    )]
 | 
				
			||||||
 | 
					         public string PassWord { get; set; }
 | 
				
			||||||
 | 
					       
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					         [SugarColumn(ColumnName="user_barcode"    )]
 | 
				
			||||||
 | 
					         public string UserBarcode { get; set; }
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					         //[SugarColumn(ColumnName="status"    )]
 | 
				
			||||||
 | 
					         //public int? Status { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					         [SugarColumn(ColumnName="machine_role_id"    )]
 | 
				
			||||||
 | 
					         public int? RoleId { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [Navigate(NavigateType.ManyToOne, nameof(RoleId))]
 | 
				
			||||||
 | 
					        public RoleDm? Role { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					        //[SugarColumn(ColumnName="user_card"    )]
 | 
				
			||||||
 | 
					        // public string UserCard { get; set; }
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					         [SugarColumn(ColumnName="machine_id"    )]
 | 
				
			||||||
 | 
					         public string MachineId { get; set; }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        ///  
 | 
				
			||||||
 | 
					        ///</summary>
 | 
				
			||||||
 | 
					         [SugarColumn(ColumnName="sign"    )]
 | 
				
			||||||
 | 
					         public byte[] Sign { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public override string ToString()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            return "userList = [UserName:" + Nickname + ", UserId:" + UserName + "]";
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,149 @@
 | 
				
			||||||
 | 
					using DM_Weight.ViewModels;
 | 
				
			||||||
 | 
					using log4net;
 | 
				
			||||||
 | 
					using log4net.Repository.Hierarchy;
 | 
				
			||||||
 | 
					using Modbus.Device;
 | 
				
			||||||
 | 
					using Polly;
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Configuration;
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Net;
 | 
				
			||||||
 | 
					using System.Net.Sockets;
 | 
				
			||||||
 | 
					using System.Runtime.InteropServices;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Port
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    public class ModbusHelper
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        private ModbusIpMaster master;
 | 
				
			||||||
 | 
					        private Socket socket;
 | 
				
			||||||
 | 
					        private TcpClient client;
 | 
				
			||||||
 | 
					        private static ModbusHelper instance;
 | 
				
			||||||
 | 
					        private static readonly object objLock = new object();
 | 
				
			||||||
 | 
					        private readonly ILog logger = LogManager.GetLogger(typeof(CheckOrderNewWindowViewModel));
 | 
				
			||||||
 | 
					        public ModbusHelper()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            if (ConfigurationManager.AppSettings["test"] == null || !(ConfigurationManager.AppSettings["test"].ToString().Equals("Y")))
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                socket = MakeKeepALiveSocket();
 | 
				
			||||||
 | 
					                client = new TcpClient();
 | 
				
			||||||
 | 
					                client.Client = socket;
 | 
				
			||||||
 | 
					                master = ModbusIpMaster.CreateIp(client);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        public static ModbusHelper GetInstance()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            if (instance == null)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                lock (objLock)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    if (instance == null)
 | 
				
			||||||
 | 
					                        instance = new ModbusHelper();
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            return instance;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        private void SetModusIpMaster()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            Debug.WriteLine("SetModusIpMaster");
 | 
				
			||||||
 | 
					            socket = MakeKeepALiveSocket();
 | 
				
			||||||
 | 
					            client = new TcpClient();
 | 
				
			||||||
 | 
					            client.Client = socket;
 | 
				
			||||||
 | 
					            master = ModbusIpMaster.CreateIp(client);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public bool[] GetAllBoxState()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            if (ConfigurationManager.AppSettings["test"] != null && ConfigurationManager.AppSettings["test"].ToString().Equals("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>()
 | 
				
			||||||
 | 
					                .Retry(3, (exception, retryCount) =>
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    this.Dispose();
 | 
				
			||||||
 | 
					                    //Debug.WriteLine($"获取所有箱子门状态出错,第{retryCount}次重试", exception);
 | 
				
			||||||
 | 
					                    logger.Info($"获取所有箱子门状态出错,第{retryCount}次重试, 异常信息{exception}");
 | 
				
			||||||
 | 
					                    this.SetModusIpMaster();
 | 
				
			||||||
 | 
					                    // return TimeSpan.FromSeconds (1);
 | 
				
			||||||
 | 
					                }).Execute<bool[]>(() =>
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    bool[] flags = new bool[18];
 | 
				
			||||||
 | 
					                    var result = master.ReadInputRegisters(1, 0x0033, 2);
 | 
				
			||||||
 | 
					                    var r1 = Convert.ToString(((int)result[0] >> 14) | ((int)result[1] << 2), 2).PadLeft(18, '0');
 | 
				
			||||||
 | 
					                    var r2 = r1.ToCharArray();
 | 
				
			||||||
 | 
					                    Debug.WriteLine("r2=>" + string.Join(", ", r2));
 | 
				
			||||||
 | 
					                    for (int i = 0; i < 18; i++)
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        flags[i] = r2[17 - i] == '1' ? true : false;
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    logger.Info($"获取所有箱子门状态返回:{string.Join(',', flags)}");
 | 
				
			||||||
 | 
					                    return flags;
 | 
				
			||||||
 | 
					                });
 | 
				
			||||||
 | 
					            return bools;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        public bool OpenBoxDoor(int boxNum)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            if (ConfigurationManager.AppSettings["test"] != null && ConfigurationManager.AppSettings["test"].ToString().Equals("Y"))
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                return true;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            bool bFlag = false;
 | 
				
			||||||
 | 
					            Policy.Handle<Exception>().Retry(3, ((exception, retryCount) =>
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                this.Dispose();
 | 
				
			||||||
 | 
					                //Debug.WriteLine($"打开箱子出错,第{retryCount}次重试", exception);
 | 
				
			||||||
 | 
					                logger.Info($"打开箱子出错,第{retryCount}次重试,异常信息{exception}");
 | 
				
			||||||
 | 
					                this.SetModusIpMaster();
 | 
				
			||||||
 | 
					                //return TimeSpan.FromSeconds (1);
 | 
				
			||||||
 | 
					            })).Execute(() =>
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                logger.Info($"正在打开{boxNum}号药箱");
 | 
				
			||||||
 | 
					                master.WriteSingleRegister(1, (ushort)boxNum, 14);
 | 
				
			||||||
 | 
					                logger.Info($"开门指令已发送{(ushort)boxNum}");
 | 
				
			||||||
 | 
					                //Console.WriteLine($"开门指令已发送{(ushort)boxNum}");
 | 
				
			||||||
 | 
					                bFlag = true;
 | 
				
			||||||
 | 
					            });
 | 
				
			||||||
 | 
					            return bFlag;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        private void Dispose()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            socket.Shutdown(SocketShutdown.Both);
 | 
				
			||||||
 | 
					            socket.Close();
 | 
				
			||||||
 | 
					            client.Close();
 | 
				
			||||||
 | 
					            master.Dispose();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        public static Socket MakeKeepALiveSocket()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            uint dummy = 0;
 | 
				
			||||||
 | 
					            byte[] inOptionValues = new byte[Marshal.SizeOf(dummy) * 3];
 | 
				
			||||||
 | 
					            BitConverter.GetBytes((uint)1).CopyTo(inOptionValues, 0);//启用Keep-Alive
 | 
				
			||||||
 | 
					            BitConverter.GetBytes((uint)10000).CopyTo(inOptionValues, Marshal.SizeOf(dummy));//在这个时间间隔内没有数据交互,则发送探测包
 | 
				
			||||||
 | 
					            BitConverter.GetBytes((uint)10000).CopyTo(inOptionValues, Marshal.SizeOf(dummy) * 2);//发探测包时间间隔
 | 
				
			||||||
 | 
					            //IPEndPoint iep = new IPEndPoint(IPAddress.Parse("192.168.1.13"), 502);
 | 
				
			||||||
 | 
					            string modbusIp = ConfigurationManager.AppSettings["modbusIp"].ToString();
 | 
				
			||||||
 | 
					            int modbusPort = Convert.ToInt32(ConfigurationManager.AppSettings["modbusPort"]);
 | 
				
			||||||
 | 
					            IPEndPoint iep = new IPEndPoint(IPAddress.Parse(modbusIp), modbusPort);
 | 
				
			||||||
 | 
					            Socket _socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
 | 
				
			||||||
 | 
					            _socket = Policy.Handle<Exception>()
 | 
				
			||||||
 | 
					              .Retry(3, (exception, retryCount) =>
 | 
				
			||||||
 | 
					              {
 | 
				
			||||||
 | 
					                  Console.WriteLine($"建立Socket,第{retryCount}次重试", exception);
 | 
				
			||||||
 | 
					                  // return TimeSpan.FromSeconds (1);
 | 
				
			||||||
 | 
					              })
 | 
				
			||||||
 | 
					              .Execute<Socket>(() =>
 | 
				
			||||||
 | 
					              {
 | 
				
			||||||
 | 
					                  _socket.IOControl(IOControlCode.KeepAliveValues, inOptionValues, null);
 | 
				
			||||||
 | 
					                  _socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.KeepAlive, true);
 | 
				
			||||||
 | 
					                  _socket.Connect(iep);
 | 
				
			||||||
 | 
					                  return _socket;
 | 
				
			||||||
 | 
					              });
 | 
				
			||||||
 | 
					            return _socket;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,171 @@
 | 
				
			||||||
 | 
					using DM_Weight.Models;
 | 
				
			||||||
 | 
					using log4net;
 | 
				
			||||||
 | 
					using SuperSimpleTcp;
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.IO;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Channels;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					using System.Windows.Markup;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Port
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    public class ScreenUtil
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        private readonly ILog logger = LogManager.GetLogger(typeof(ScreenUtil));
 | 
				
			||||||
 | 
					        SimpleTcpServer server = new SimpleTcpServer("0.0.0.0:8888");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        string ipport { get; set; } = "";
 | 
				
			||||||
 | 
					        public ScreenUtil()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            server.Events.ClientConnected += (object sender, ConnectionEventArgs e) =>
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                ipport = e.IpPort;
 | 
				
			||||||
 | 
					                logger.Info($"[{e.IpPort}] client connected");
 | 
				
			||||||
 | 
					            };
 | 
				
			||||||
 | 
					            server.Events.ClientDisconnected += (object sender, ConnectionEventArgs e) =>
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                logger.Info($"[{e.IpPort}] client disconnected: {e.Reason}");
 | 
				
			||||||
 | 
					            };
 | 
				
			||||||
 | 
					            server.Events.DataReceived += (object sender, DataReceivedEventArgs e) =>
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                logger.Info($"[{e.IpPort}]: {e.Data.Array}");
 | 
				
			||||||
 | 
					            };
 | 
				
			||||||
 | 
					            // let's go!
 | 
				
			||||||
 | 
					            server.Start();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        private byte[] head = new byte[] { 0xee, 0xb1, 0x12 };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        private byte[] end = new byte[] { 0xFF, 0xFC, 0xFF, 0xFF };
 | 
				
			||||||
 | 
					        public void SetStockInfo(ChannelStock channel, int screenId)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            // 添加画面id
 | 
				
			||||||
 | 
					            byte[] a = Copy2NewArr(head, HighLow(screenId));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
 | 
				
			||||||
 | 
					            //if (channel.DrugInfo.DrugName != null)
 | 
				
			||||||
 | 
					            //{
 | 
				
			||||||
 | 
					            byte[] content = Encoding.GetEncoding("gb2312").GetBytes(channel.DrugInfo?.DrugName??"");
 | 
				
			||||||
 | 
					                a = WriteInfo(a, content, channel.ColNo * 10 + 1);
 | 
				
			||||||
 | 
					            //}
 | 
				
			||||||
 | 
					            //if (channel.DrugInfo.Manufactory != null)
 | 
				
			||||||
 | 
					            //{
 | 
				
			||||||
 | 
					                byte[] content1 = Encoding.GetEncoding("gb2312").GetBytes(channel.DrugInfo?.Manufactory?? "");
 | 
				
			||||||
 | 
					                a = WriteInfo(a, content1, channel.ColNo * 10 + 2);
 | 
				
			||||||
 | 
					            //}
 | 
				
			||||||
 | 
					            //if (channel.DrugInfo.DrugSpec != null)
 | 
				
			||||||
 | 
					            //{
 | 
				
			||||||
 | 
					                byte[] content2 = Encoding.GetEncoding("gb2312").GetBytes(channel.DrugInfo?.DrugSpec ?? "");
 | 
				
			||||||
 | 
					                a = WriteInfo(a, content2, channel.ColNo * 10 + 3);
 | 
				
			||||||
 | 
					            //}
 | 
				
			||||||
 | 
					            //if (channel.ManuNo != null)
 | 
				
			||||||
 | 
					            //{
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                byte[] content3 = Encoding.GetEncoding("gb2312").GetBytes(channel.ManuNo);
 | 
				
			||||||
 | 
					                a = WriteInfo(a, content3, channel.ColNo * 10 + 4);
 | 
				
			||||||
 | 
					            //}
 | 
				
			||||||
 | 
					            //if (channel.EffDate != null)
 | 
				
			||||||
 | 
					            //{
 | 
				
			||||||
 | 
					                byte[] content4 = Encoding.GetEncoding("gb2312").GetBytes(channel.EffDate);
 | 
				
			||||||
 | 
					                a = WriteInfo(a, content4, channel.ColNo * 10 + 5);
 | 
				
			||||||
 | 
					            //}
 | 
				
			||||||
 | 
					            //if (channel.Quantity != null)
 | 
				
			||||||
 | 
					            //{
 | 
				
			||||||
 | 
					                byte[] content5 = Encoding.GetEncoding("gb2312").GetBytes(channel.Quantity.ToString());
 | 
				
			||||||
 | 
					                a = WriteInfo(a, content5, channel.ColNo * 10 + 6);
 | 
				
			||||||
 | 
					            //}
 | 
				
			||||||
 | 
					            // 添加结束块
 | 
				
			||||||
 | 
					            byte[] b = Copy2NewArr(a, end);
 | 
				
			||||||
 | 
					            server.Send(ipport, b);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public void TellChange(int d)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            byte[] buffer = new byte[] { 0xee, 0xb5, 0x01, 0x00, 0xFF, 0xFC, 0xFF, 0xFF };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public void SetStockInfo(List<ChannelStock> channels, int screenId)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            // 添加画面id
 | 
				
			||||||
 | 
					            byte[] a = Copy2NewArr(head, HighLow(screenId));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            for (int i = 0; i < channels.Count; i++)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                ChannelStock channel = channels[i];
 | 
				
			||||||
 | 
					                if (channel.DrugInfo.DrugName != null)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    byte[] content = Encoding.ASCII.GetBytes(channel.DrugInfo.DrugName);
 | 
				
			||||||
 | 
					                    a = WriteInfo(a, content, channels[0].DrawerNo * 10 + 1);
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                if (channel.DrugInfo.Manufactory != null)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    byte[] content = Encoding.ASCII.GetBytes(channel.DrugInfo.Manufactory);
 | 
				
			||||||
 | 
					                    a = WriteInfo(a, content, channels[0].DrawerNo * 10 + 2);
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                if (channel.DrugInfo.DrugSpec != null)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    byte[] content = Encoding.ASCII.GetBytes(channel.DrugInfo.DrugSpec);
 | 
				
			||||||
 | 
					                    a = WriteInfo(a, content, channels[0].DrawerNo * 10 + 3);
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                if (channel.ManuNo != null)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    byte[] content = Encoding.ASCII.GetBytes(channel.ManuNo);
 | 
				
			||||||
 | 
					                    a = WriteInfo(a, content, channels[0].DrawerNo * 10 + 4);
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                if (channel.EffDate != null)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    byte[] content = Encoding.ASCII.GetBytes(channel.EffDate);
 | 
				
			||||||
 | 
					                    a = WriteInfo(a, content, channels[0].DrawerNo * 10 + 5);
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                if (channel.Quantity != null)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    byte[] content = Encoding.ASCII.GetBytes(channel.Quantity.ToString());
 | 
				
			||||||
 | 
					                    a = WriteInfo(a, content, channels[0].DrawerNo * 10 + 6);
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            // 添加结束块
 | 
				
			||||||
 | 
					            byte[] b = Copy2NewArr(a, end);
 | 
				
			||||||
 | 
					            server.Send(ipport, b);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public byte[] WriteInfo(byte[] a, byte[] content, int id)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            // 添加控件id
 | 
				
			||||||
 | 
					            byte[] b = Copy2NewArr(a, HighLow(id));
 | 
				
			||||||
 | 
					            // 添加需要向控件内写入的字节长度
 | 
				
			||||||
 | 
					            byte[] c = Copy2NewArr(b, HighLow(content.Length));
 | 
				
			||||||
 | 
					            // 写入内容
 | 
				
			||||||
 | 
					            return Copy2NewArr(c, content);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public byte[] HighLow(int data)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            byte high = Convert.ToByte((data >> 8) & 0x00ff); //位运算:右移8位
 | 
				
			||||||
 | 
					            byte low = Convert.ToByte(data & 0x00ff);         //去掉高位
 | 
				
			||||||
 | 
					            return new byte[] {high, low};
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public byte[] Copy2NewArr(byte[] source1, byte[] source2)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            byte[] target = new byte[source1.Length + source2.Length];
 | 
				
			||||||
 | 
					            Buffer.BlockCopy(source1, 0, target, 0, source1.Length);
 | 
				
			||||||
 | 
					            Buffer.BlockCopy(source2, 0, target, source1.Length, source2.Length);
 | 
				
			||||||
 | 
					            return target;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,92 @@
 | 
				
			||||||
 | 
					using DM_Weight.Models;
 | 
				
			||||||
 | 
					using log4net.Repository.Hierarchy;
 | 
				
			||||||
 | 
					using Modbus.Device;
 | 
				
			||||||
 | 
					using Polly;
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.IO.Ports;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Port
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    public class TemperatureHumidityJob
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        public TemperatureHumidityJob()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            //try
 | 
				
			||||||
 | 
					            //{
 | 
				
			||||||
 | 
					            //    using (SerialPort serialPort = new SerialPort("com1"))
 | 
				
			||||||
 | 
					            //    {
 | 
				
			||||||
 | 
					            //        serialPort.BaudRate = 9600;
 | 
				
			||||||
 | 
					            //        serialPort.DataBits = 8;
 | 
				
			||||||
 | 
					            //        serialPort.Parity = Parity.None;
 | 
				
			||||||
 | 
					            //        serialPort.StopBits = StopBits.One;
 | 
				
			||||||
 | 
					            //        if (!serialPort.IsOpen)
 | 
				
			||||||
 | 
					            //        {
 | 
				
			||||||
 | 
					            //            serialPort.Open();
 | 
				
			||||||
 | 
					            //        }
 | 
				
			||||||
 | 
					            //        var master = ModbusSerialMaster.CreateRtu(wsdSerial);
 | 
				
			||||||
 | 
					            //        int no = 1;
 | 
				
			||||||
 | 
					            //        switch (Global.CabinetNo)
 | 
				
			||||||
 | 
					            //        {
 | 
				
			||||||
 | 
					            //            case "1":
 | 
				
			||||||
 | 
					            //                no = 1;
 | 
				
			||||||
 | 
					            //                break;
 | 
				
			||||||
 | 
					            //            case "2":
 | 
				
			||||||
 | 
					            //                no = 9;
 | 
				
			||||||
 | 
					            //                break;
 | 
				
			||||||
 | 
					            //            case "3":
 | 
				
			||||||
 | 
					            //                no = 5;
 | 
				
			||||||
 | 
					            //                break;
 | 
				
			||||||
 | 
					            //            case "4":
 | 
				
			||||||
 | 
					            //                no = 3;
 | 
				
			||||||
 | 
					            //                break;
 | 
				
			||||||
 | 
					            //            case "5":
 | 
				
			||||||
 | 
					            //                no = 2;
 | 
				
			||||||
 | 
					            //                break;
 | 
				
			||||||
 | 
					            //            case "6":
 | 
				
			||||||
 | 
					            //                no = 6;
 | 
				
			||||||
 | 
					            //                break;
 | 
				
			||||||
 | 
					            //            case "7":
 | 
				
			||||||
 | 
					            //                no = 8;
 | 
				
			||||||
 | 
					            //                break;
 | 
				
			||||||
 | 
					            //            case "8":
 | 
				
			||||||
 | 
					            //                no = 4;
 | 
				
			||||||
 | 
					            //                break;
 | 
				
			||||||
 | 
					            //            case "9":
 | 
				
			||||||
 | 
					            //                no = 7;
 | 
				
			||||||
 | 
					            //                break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            //        }
 | 
				
			||||||
 | 
					            //        var r = master.ReadHoldingRegisters((byte)no, 00, 2);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            //        if (r != null && r.Length > 0)
 | 
				
			||||||
 | 
					            //        {
 | 
				
			||||||
 | 
					            //            var result = string.Join("", r);
 | 
				
			||||||
 | 
					            //            var result1 = result.Substring(0, 3);
 | 
				
			||||||
 | 
					            //            var result2 = result.Substring(3, 3);
 | 
				
			||||||
 | 
					            //            float temp = Int32.Parse(result2) / 10.0F;
 | 
				
			||||||
 | 
					            //            float humi = Int32.Parse(result1) / 10.0F;
 | 
				
			||||||
 | 
					            //            TemperatureHumidityInfo temperatureHumidityInfo = new TemperatureHumidityInfo();
 | 
				
			||||||
 | 
					            //            temperatureHumidityInfo.GroupNo = "DM1"
 | 
				
			||||||
 | 
					            //            temperatureHumidityInfo.Temp = temp;
 | 
				
			||||||
 | 
					            //            temperatureHumidityInfo.Humi = humi;
 | 
				
			||||||
 | 
					            //            _temperatureHumidityService.SaveTemperatureAndHumidity(temperatureHumidityInfo);
 | 
				
			||||||
 | 
					            //        }
 | 
				
			||||||
 | 
					            //        if (serialPort.IsOpen)
 | 
				
			||||||
 | 
					            //        {
 | 
				
			||||||
 | 
					            //            serialPort.Close();
 | 
				
			||||||
 | 
					            //        }
 | 
				
			||||||
 | 
					            //        master.Dispose();
 | 
				
			||||||
 | 
					            //    }
 | 
				
			||||||
 | 
					            //}
 | 
				
			||||||
 | 
					            //catch (Exception ex)
 | 
				
			||||||
 | 
					            //{
 | 
				
			||||||
 | 
					            //    logger.LogError(ex.Message);
 | 
				
			||||||
 | 
					            //}
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,369 @@
 | 
				
			||||||
 | 
					using gregn6Lib;
 | 
				
			||||||
 | 
					using Newtonsoft.Json;
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.IO;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					using DM_Weight.Models;
 | 
				
			||||||
 | 
					using System.Configuration;
 | 
				
			||||||
 | 
					using DM_Weight.util;
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Report
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    public class GridReportUtil
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        // 定义Grid++Report报表主对象
 | 
				
			||||||
 | 
					        public static GridppReport Report = new GridppReport();
 | 
				
			||||||
 | 
					        public static string gridConnectionString = ConfigurationManager.AppSettings["gridConnectionString"];
 | 
				
			||||||
 | 
					        /**
 | 
				
			||||||
 | 
					         * 打印预览
 | 
				
			||||||
 | 
					         * tempname: 模板文件名称
 | 
				
			||||||
 | 
					         * data: 模板数据
 | 
				
			||||||
 | 
					         */
 | 
				
			||||||
 | 
					        public static void PrintReport(string tempname, object data)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            // 定义Grid++Report报表主对象
 | 
				
			||||||
 | 
					            GridppReport Report = new GridppReport();
 | 
				
			||||||
 | 
					            // 加载模板文件
 | 
				
			||||||
 | 
					            Report.LoadFromFile(new FileInfo(AppDomain.CurrentDomain.BaseDirectory) + "ReportTemp//" + tempname);
 | 
				
			||||||
 | 
					            string s = JsonConvert.SerializeObject(data);
 | 
				
			||||||
 | 
					            // 加载数据
 | 
				
			||||||
 | 
					            Report.LoadDataFromXML(JsonConvert.SerializeObject(data));
 | 
				
			||||||
 | 
					            Report.PrintPreview(true);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public static void PrintReportStock()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            // 定义Grid++Report报表主对象
 | 
				
			||||||
 | 
					            GridppReport Report = new GridppReport();
 | 
				
			||||||
 | 
					            //Report.Initialize += new _IGridppReportEvents_InitializeEventHandler(() =>
 | 
				
			||||||
 | 
					            //{
 | 
				
			||||||
 | 
					            //    Report.ParameterByName("machine_id").Value = (ConfigurationManager.AppSettings["machineId"] ?? "DM1");
 | 
				
			||||||
 | 
					            //});
 | 
				
			||||||
 | 
					            string machine_id = (ConfigurationManager.AppSettings["machineId"] ?? "DM1");
 | 
				
			||||||
 | 
					            string SQL = $@"SELECT cl.`row_no` AS drawerNo,cl.`col_no` AS colNo,cl.`quantity` AS quantity,cl.`manu_no` AS manuNo,cl.`eff_date` AS effDate,
 | 
				
			||||||
 | 
					                          di.`drug_name` AS drugName,di.`drug_spec` AS drugSpec,di.`pack_unit` AS packUnit,di.`manufactory` AS manuFactory,di.`max_stock` AS baseQuantity,
 | 
				
			||||||
 | 
					                          cl.`drug_id` AS drugId FROM channel_stock cl INNER JOIN drug_info di ON di.`drug_id` = cl.`drug_id` WHERE cl.`machine_id` =  '{machine_id}' AND cl.`drawer_type` = 1 ORDER BY cl.`drug_id`";
 | 
				
			||||||
 | 
					            // 加载模板文件
 | 
				
			||||||
 | 
					            Report.LoadFromFile(new FileInfo(AppDomain.CurrentDomain.BaseDirectory) + "ReportTemp//" + "stock_template.grf");
 | 
				
			||||||
 | 
					            Report.DetailGrid.Recordset.ConnectionString = gridConnectionString;
 | 
				
			||||||
 | 
					            Report.DetailGrid.Recordset.QuerySQL = SQL;
 | 
				
			||||||
 | 
					            Report.PrintPreview(true);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        public static void PrintReportAccountBook(DateTime? startDate, DateTime? endDate)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            DateTime? p_startDate = startDate ?? Convert.ToDateTime("2010-1-1");
 | 
				
			||||||
 | 
					            DateTime? p_endDate = endDate ?? DateTime.Now.AddDays(1);
 | 
				
			||||||
 | 
					            string p_machine_id = (ConfigurationManager.AppSettings["machineId"] ?? "DM1");
 | 
				
			||||||
 | 
					            // 定义Grid++Report报表主对象
 | 
				
			||||||
 | 
					            GridppReport Report = new GridppReport();
 | 
				
			||||||
 | 
					            // 加载模板文件
 | 
				
			||||||
 | 
					            Report.LoadFromFile(new FileInfo(AppDomain.CurrentDomain.BaseDirectory) + "ReportTemp//" + "account_book_temp.grf");
 | 
				
			||||||
 | 
					            string SQL = string.Empty;
 | 
				
			||||||
 | 
					            Report.DetailGrid.Recordset.ConnectionString = gridConnectionString;
 | 
				
			||||||
 | 
					            //Report.Initialize += new _IGridppReportEvents_InitializeEventHandler(() =>
 | 
				
			||||||
 | 
					            //{
 | 
				
			||||||
 | 
					            //    Report.ParameterByName("machine_id").Value = (ConfigurationManager.AppSettings["machineId"] ?? "DM1");
 | 
				
			||||||
 | 
					            //    Report.ParameterByName("startDate").Value = startDate ?? Convert.ToDateTime("2010-1-1");
 | 
				
			||||||
 | 
					            //    Report.ParameterByName("endDate").Value = endDate ?? DateTime.Now.AddDays(1);
 | 
				
			||||||
 | 
					            //});
 | 
				
			||||||
 | 
					            //Report.DetailGrid.Recordset.QuerySQL = SQL;
 | 
				
			||||||
 | 
					            SQL = $@"SELECT  mr.`stock_quantity` AS `stockQuantity`, IF(mr.`type` IN (1, 31), mr.`quantity`, IF(mr.`type` = 4 AND mr.`quantity` > 0, mr.`quantity`, 0)) 
 | 
				
			||||||
 | 
					                        AS `inQuantity`, IF(mr.`type` = 2, mr.`quantity`, IF(mr.`type` = 4 AND mr.`quantity` < 0, (0 - mr.`quantity`), 0)) AS `outQuantity`,
 | 
				
			||||||
 | 
					                         mr.`operation_time` AS `operationTime`, mr.`invoice_id` AS `invoiceId`, di.`drug_name` AS `drugName`, di.`drug_id` AS `drugId`,
 | 
				
			||||||
 | 
					                         di.`drug_spec` AS `drugSpec`, di.`pack_unit` AS `packUnit`, di.`dosage` AS `dosage`, di.`manufactory` AS `manufactory`, 
 | 
				
			||||||
 | 
					                        mr.`manu_no` AS `manuNo`, mr.`eff_date` AS `effDate`, u1.`user_name` AS `operatorName`, u2.`user_name` AS `reviewerName` FROM 
 | 
				
			||||||
 | 
					                        dm_machine_record mr  LEFT JOIN drug_info di ON mr.`drug_id` = di.`drug_id`  LEFT JOIN user_list u1 ON mr.`operator` = u1.`id`  
 | 
				
			||||||
 | 
					                        LEFT JOIN user_list u2 ON mr.`reviewer` = u2.`id` WHERE mr.`machine_id` = '{p_machine_id}' AND mr.`operation_time` > '{p_startDate}'
 | 
				
			||||||
 | 
					                        AND mr.`operation_time` < '{p_endDate}'  ORDER BY mr.`drug_id`, mr.`operation_time`, mr.`id`";
 | 
				
			||||||
 | 
					            Report.DetailGrid.Recordset.QuerySQL = SQL;
 | 
				
			||||||
 | 
					            Report.PrintPreview(true);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        public static void PrintReportAccountBook(DateTime? startDate, DateTime? endDate, int type, string drug_id)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            // 定义Grid++Report报表主对象
 | 
				
			||||||
 | 
					            GridppReport Report = new GridppReport();
 | 
				
			||||||
 | 
					            // 加载模板文件
 | 
				
			||||||
 | 
					            Report.LoadFromFile(new FileInfo(AppDomain.CurrentDomain.BaseDirectory) + "ReportTemp//" + "account_book_temp.grf");
 | 
				
			||||||
 | 
					            Report.DetailGrid.Recordset.ConnectionString = gridConnectionString;
 | 
				
			||||||
 | 
					            DateTime? p_startDate = startDate ?? Convert.ToDateTime("2010-1-1");
 | 
				
			||||||
 | 
					            DateTime? p_endDate = endDate ?? DateTime.Now.AddDays(1);
 | 
				
			||||||
 | 
					            string p_machine_id = (ConfigurationManager.AppSettings["machineId"] ?? "DM1");
 | 
				
			||||||
 | 
					            string SQL = $@" SELECT ac.create_date as operationTime, ac.TYPE,
 | 
				
			||||||
 | 
						                     if(ac.type in(1,2),0,ac.yesterday_quantity) as YQuantity,if(ac.type in(3,4),0,ac.add_quantity) as inQuantity,if(ac.type in(3,4),0,ac.out_quantity) as outQuantity,
 | 
				
			||||||
 | 
						                     if(ac.type in(1,2),0,ac.manu_stock) as ManuStock,ac.total_stock AS stockQuantity, -- if(ac.type in(1,2),0,ac.total_stock) as TotalStock,
 | 
				
			||||||
 | 
						                     ac.invoice_no as invoiceId, ac.manu_no as manuNo,ac.eff_date as effDate,di.drug_id,di.drug_name as DrugName,di.drug_spec as DrugSpec,di.manufactory as manufactory,di.pack_unit AS packUnit,di.dosage,u1.user_name as operatorName,u2.user_name as reviewerName
 | 
				
			||||||
 | 
						                     FROM account_book_g2 ac left join drug_info di on ac.drug_id=di.drug_id left join user_list u1 on ac.user_id1=u1.id left join user_list u2 on ac.user_id2=u2.id
 | 
				
			||||||
 | 
					 		                    WHERE ac.machine_id='{p_machine_id}' and create_time>'{p_startDate}' AND create_time<'{p_endDate}' ";
 | 
				
			||||||
 | 
					            if (!string.IsNullOrEmpty(drug_id))
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                SQL += " AND ac.drug_id='" + drug_id + "' ";
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            if (type > 0)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                if (type == 1)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    SQL += " WHERE AddQuantity>0 ";
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                if (type == 2)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    SQL += " WHERE OutQuantity>0 ";
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                if (type == 3)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    SQL += " WHERE type=3 ";
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                if (type == 4)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    SQL += " WHERE type=4  ";
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            SQL += " ORDER BY di.drug_id,ac.create_date desc";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            Report.DetailGrid.Recordset.QuerySQL = SQL;
 | 
				
			||||||
 | 
					            Report.PrintPreview(true);
 | 
				
			||||||
 | 
					            //string filePath = AppDomain.CurrentDomain.BaseDirectory + "ReportTemp//" + "account_book_temp.pdf";
 | 
				
			||||||
 | 
					            //if (File.Exists(filePath))
 | 
				
			||||||
 | 
					            //{
 | 
				
			||||||
 | 
					            //    try
 | 
				
			||||||
 | 
					            //    {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            //        File.Delete(filePath);
 | 
				
			||||||
 | 
					            //    }
 | 
				
			||||||
 | 
					            //    catch (Exception ex)
 | 
				
			||||||
 | 
					            //    {
 | 
				
			||||||
 | 
					            //        FindAndKillProcess();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            //    }
 | 
				
			||||||
 | 
					            //}
 | 
				
			||||||
 | 
					            //Report.ExportDirect(GRExportType.gretPDF, filePath, false, true);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        public static void PrintReportMechineRecord(int type, DateTime? startDate, DateTime? endDate)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            // 定义Grid++Report报表主对象
 | 
				
			||||||
 | 
					            GridppReport Report = new GridppReport();
 | 
				
			||||||
 | 
					            DateTime? p_startDate = startDate ?? Convert.ToDateTime("2010-1-1");
 | 
				
			||||||
 | 
					            DateTime? p_endDate = endDate ?? DateTime.Now.AddDays(1);
 | 
				
			||||||
 | 
					            string p_machine_id = (ConfigurationManager.AppSettings["machineId"] ?? "DM1");
 | 
				
			||||||
 | 
					            string SQL = string.Empty;
 | 
				
			||||||
 | 
					            //Report.Initialize += new _IGridppReportEvents_InitializeEventHandler(() =>
 | 
				
			||||||
 | 
					            //{
 | 
				
			||||||
 | 
					            //    Report.ParameterByName("machine_id").Value = (ConfigurationManager.AppSettings["machineId"] ?? "DM1");
 | 
				
			||||||
 | 
					            //    Report.ParameterByName("startDate").Value = startDate??DateTime.Now.AddYears(-10);
 | 
				
			||||||
 | 
					            //    Report.ParameterByName("endDate").Value = endDate??DateTime.Now.AddDays(1);
 | 
				
			||||||
 | 
					            //});
 | 
				
			||||||
 | 
					            // 加载模板文件
 | 
				
			||||||
 | 
					            if (type == 1)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                Report.LoadFromFile(new FileInfo(AppDomain.CurrentDomain.BaseDirectory) + "ReportTemp//" + "machine_log_add.grf");
 | 
				
			||||||
 | 
					                SQL = $@"SELECT dmr.`drawer_no` AS drawerNo,dmr.`col_no` AS colNo,dmr.`type` AS `type`,dmr.`quantity` AS quantity,
 | 
				
			||||||
 | 
					                      dmr.`manu_no` AS manuNo,dmr.`eff_date` AS effDate,dmr.`operation_time` AS operationTime,
 | 
				
			||||||
 | 
					                      di.`drug_name` AS drugName,di.`drug_spec` AS drugSpec,di.`pack_unit` AS packUnit,
 | 
				
			||||||
 | 
					                      di.`manufactory` AS manuFactory,di.`max_stock` AS baseQuantity,dmr.`drug_id` AS drugId,
 | 
				
			||||||
 | 
					                      ul.`user_name` AS nickname FROM dm_machine_record dmr LEFT JOIN drug_info di ON di.`drug_id` = dmr.`drug_id`
 | 
				
			||||||
 | 
					                    LEFT JOIN user_list ul ON ul.`id` = dmr.`Operator` WHERE dmr.`type` = 1 AND dmr.`machine_id` = '{p_machine_id}'
 | 
				
			||||||
 | 
					                     AND dmr.`operation_time` > '{p_startDate}' AND dmr.`operation_time` < '{p_endDate}'";
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            else if (type == 2)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                Report.LoadFromFile(new FileInfo(AppDomain.CurrentDomain.BaseDirectory) + "ReportTemp//" + "machine_log_take.grf");
 | 
				
			||||||
 | 
					                SQL = $@" SELECT dmr.`drawer_no` AS drawerNo,dmr.`col_no` AS colNo,dmr.`type` AS `type`,dmr.`quantity` AS quantity,
 | 
				
			||||||
 | 
					                      dmr.`manu_no` AS manuNo,dmr.`eff_date` AS effDate,dmr.`operation_time` AS operationTime,
 | 
				
			||||||
 | 
					                      di.`drug_name` AS drugName,di.`drug_spec` AS drugSpec,di.`pack_unit` AS packUnit,
 | 
				
			||||||
 | 
					                      di.`manufactory` AS manuFactory,di.`max_stock` AS baseQuantity,dmr.`drug_id` AS drugId,
 | 
				
			||||||
 | 
					                      ul.`user_name` AS nickname FROM dm_machine_record dmr LEFT JOIN drug_info di ON di.`drug_id` = dmr.`drug_id`
 | 
				
			||||||
 | 
					                    LEFT JOIN user_list ul ON ul.`id` = dmr.`Operator` WHERE dmr.`type` = 2 
 | 
				
			||||||
 | 
					                     AND dmr.`machine_id` ='{p_machine_id}'  AND dmr.`operation_time` > '{p_startDate}'
 | 
				
			||||||
 | 
					                     AND dmr.`operation_time` < '{p_endDate}'";
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            else if (type == 3)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                Report.LoadFromFile(new FileInfo(AppDomain.CurrentDomain.BaseDirectory) + "ReportTemp//" + "machine_log_return.grf");
 | 
				
			||||||
 | 
					                SQL = $@" SELECT dmr.`drawer_no` AS drawerNo,dmr.`col_no` AS colNo,dmr.`type` AS `type`,
 | 
				
			||||||
 | 
					                      CONCAT(dmr.`quantity`,IF(dmr.`type`=32,""(空瓶)"","""")) AS quantity,dmr.`manu_no` AS manuNo,
 | 
				
			||||||
 | 
					                      dmr.`eff_date` AS effDate,dmr.`operation_time` AS operationTime,di.`drug_name` AS drugName,
 | 
				
			||||||
 | 
					                      di.`drug_spec` AS drugSpec,di.`pack_unit` AS packUnit,
 | 
				
			||||||
 | 
					                      di.`manufactory` AS manuFactory,di.`max_stock` AS baseQuantity,
 | 
				
			||||||
 | 
					                      dmr.`drug_id` AS drugId,ul.`user_name` AS nickname FROM dm_machine_record dmr
 | 
				
			||||||
 | 
					                    LEFT JOIN drug_info di ON di.`drug_id` = dmr.`drug_id` LEFT JOIN user_list ul ON ul.`id` = dmr.`Operator`
 | 
				
			||||||
 | 
					                    WHERE dmr.`type` in (31, 32) AND dmr.`machine_id` = '{p_machine_id}' AND dmr.`operation_time` > '{p_startDate}'
 | 
				
			||||||
 | 
					                     AND dmr.`operation_time` < '{p_endDate}'";
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            else
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                Report.LoadFromFile(new FileInfo(AppDomain.CurrentDomain.BaseDirectory) + "ReportTemp//" + "machine_log_check.grf");
 | 
				
			||||||
 | 
					                SQL = $@" SELECT dmr.`drawer_no` AS drawerNo,dmr.`col_no` AS colNo,dmr.`type` AS `type`,dmr.`quantity` AS quantity,
 | 
				
			||||||
 | 
					                          dmr.`manu_no` AS manuNo,dmr.`eff_date` AS effDate,dmr.`operation_time` AS operationTime,
 | 
				
			||||||
 | 
					                          di.`drug_name` AS drugName,di.`drug_spec` AS drugSpec,di.`pack_unit` AS packUnit,
 | 
				
			||||||
 | 
					                          di.`manufactory` AS manuFactory,di.`max_stock` AS baseQuantity,dmr.`drug_id` AS drugId,
 | 
				
			||||||
 | 
					                          ul.`user_name` AS nickname FROM dm_machine_record dmr LEFT JOIN drug_info di ON di.`drug_id` = dmr.`drug_id`
 | 
				
			||||||
 | 
					                        LEFT JOIN user_list ul ON ul.`id` = dmr.`Operator` WHERE dmr.`type` = 4 
 | 
				
			||||||
 | 
					                         AND dmr.`machine_id` = '{p_machine_id}' AND dmr.`operation_time` > '{p_startDate}'
 | 
				
			||||||
 | 
					                        AND dmr.`operation_time` < '{p_endDate}'";
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            Report.DetailGrid.Recordset.ConnectionString = gridConnectionString;
 | 
				
			||||||
 | 
					            Report.DetailGrid.Recordset.QuerySQL = SQL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            Report.PrintPreview(true);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /**
 | 
				
			||||||
 | 
					         * 打印预览
 | 
				
			||||||
 | 
					         * tempname: 模板文件名称
 | 
				
			||||||
 | 
					         * data: 模板数据
 | 
				
			||||||
 | 
					         */
 | 
				
			||||||
 | 
					        public static void PrintMachineRecordReport(List<MachineRecord> data)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            // 定义Grid++Report报表主对象
 | 
				
			||||||
 | 
					            GridppReport Report = new GridppReport();
 | 
				
			||||||
 | 
					            // 加载模板文件
 | 
				
			||||||
 | 
					            Report.LoadFromFile(new FileInfo(AppDomain.CurrentDomain.BaseDirectory) + "ReportTemp//machine_log.grf");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            // 加载数据
 | 
				
			||||||
 | 
					            Report.ParameterByName("type").AsInteger = 1;
 | 
				
			||||||
 | 
					            Report.PrintPreview(true);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        //交接班记录报表
 | 
				
			||||||
 | 
					        public static void PrintChangeShiftsReport(DateTime? startDate, DateTime? endDate)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            DateTime? p_startDate = startDate ?? Convert.ToDateTime("2010-1-1");
 | 
				
			||||||
 | 
					            DateTime? p_endDate = endDate ?? DateTime.Now.AddDays(1);
 | 
				
			||||||
 | 
					            string p_machine_id = (ConfigurationManager.AppSettings["machineId"] ?? "DM1");
 | 
				
			||||||
 | 
					            // 定义Grid++Report报表主对象
 | 
				
			||||||
 | 
					            GridppReport Report = new GridppReport();
 | 
				
			||||||
 | 
					            // 加载模板文件
 | 
				
			||||||
 | 
					            Report.LoadFromFile(new FileInfo(AppDomain.CurrentDomain.BaseDirectory) + "ReportTemp//" + "changeShifts_temp.grf");
 | 
				
			||||||
 | 
					            string SQL = string.Empty;
 | 
				
			||||||
 | 
					            Report.DetailGrid.Recordset.ConnectionString = gridConnectionString;
 | 
				
			||||||
 | 
					            Report.Initialize += new _IGridppReportEvents_InitializeEventHandler(() =>
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                Report.ParameterByName("machine_id").Value = (ConfigurationManager.AppSettings["machineId"] ?? "DM1");
 | 
				
			||||||
 | 
					                Report.ParameterByName("startDate").Value = startDate ?? Convert.ToDateTime("2010-1-1");
 | 
				
			||||||
 | 
					                Report.ParameterByName("endDate").Value = endDate ?? DateTime.Now.AddDays(1);
 | 
				
			||||||
 | 
					            });
 | 
				
			||||||
 | 
					            SQL = $@"SELECT opt_date,drug_name,drug_spec,beforenum,getnum,usenum,manu_no,surplus,CONCAT(fromoperator,' ',fromreviewer) as fromoperator,
 | 
				
			||||||
 | 
					                    CONCAT(tooperator,' ',toreviewer) as tooperator
 | 
				
			||||||
 | 
					                    from `hkc_shiftsreport` WHERE `machineid` = '{p_machine_id}' AND `opt_date` > '{p_startDate}'
 | 
				
			||||||
 | 
					                        AND opt_date < '{p_endDate}'  ORDER BY opt_date";
 | 
				
			||||||
 | 
					            Report.DetailGrid.Recordset.QuerySQL = SQL;
 | 
				
			||||||
 | 
					            //Report.PrintPreview(true);
 | 
				
			||||||
 | 
					            string filePath = AppDomain.CurrentDomain.BaseDirectory + "ReportTemp//" + "changeShifts_temp.pdf";
 | 
				
			||||||
 | 
					            if (File.Exists(filePath))
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                try
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    File.Delete(filePath);
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                catch (Exception ex)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    FindAndKillProcess();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            Report.ExportDirect(GRExportType.gretPDF, filePath, false, true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        public static bool FindAndKillProcess()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            foreach (Process clsProcess in Process.GetProcesses())
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                if (clsProcess.ProcessName.Contains("wps") || clsProcess.ProcessName.Contains("msedge"))
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    clsProcess.Kill();
 | 
				
			||||||
 | 
					                    //return true;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            //process not found, return false
 | 
				
			||||||
 | 
					            return false;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 空安瓿回收销毁报表
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        /// <param name="startDate"></param>
 | 
				
			||||||
 | 
					        /// <param name="endDate"></param>
 | 
				
			||||||
 | 
					        public static void PrintEmptyDestoryReport(DateTime? startDate, DateTime? endDate)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            // 定义Grid++Report报表主对象
 | 
				
			||||||
 | 
					            GridppReport Report = new GridppReport();
 | 
				
			||||||
 | 
					            DateTime? p_startDate = startDate ?? Convert.ToDateTime("2010-1-1");
 | 
				
			||||||
 | 
					            DateTime? p_endDate = endDate ?? DateTime.Now.AddDays(1);
 | 
				
			||||||
 | 
					            string p_machine_id = (ConfigurationManager.AppSettings["machineId"] ?? "DM1");
 | 
				
			||||||
 | 
					            string SQL = string.Empty;
 | 
				
			||||||
 | 
					            Report.LoadFromFile(new FileInfo(AppDomain.CurrentDomain.BaseDirectory) + "ReportTemp//" + "ReturnEmptyDistory_template.grf");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            SQL = $@"
 | 
				
			||||||
 | 
					                    SELECT di.drug_id, di.drug_name as drugName,di.dosage,di.drug_spec as drugSpec,di.big_unit,oi.Order_Date, CONCAT(oi.p_name,'/',oi.dept_name) as userDeptName,
 | 
				
			||||||
 | 
					                    od.Quantity,mr.Manu_No,ul.user_name as retuenUser,u2.user_name as returnReviewer,u3.User_name as distoryUser,u4.User_name as distoryRevierer,(od.Quantity-mr.return_quantity2) as needReturnEmptyCount
 | 
				
			||||||
 | 
					                    from order_info oi inner join order_detail od on oi.order_no=od.order_no 
 | 
				
			||||||
 | 
					                    inner join (SELECT id as mrId,manu_no,invoice_id,id,operator,reviewer, sum(return_quantity2) as return_quantity2  FROM dm_machine_record where type=2  and machine_id='{ConfigurationManager.AppSettings["machineId"] ?? "DM3"}'  GROUP BY invoice_id) mr on oi.order_no=mr.invoice_id 
 | 
				
			||||||
 | 
					                    INNER JOIN drug_info di on od.drug_id=di.drug_id
 | 
				
			||||||
 | 
					                    LEFT JOIN (SELECT manu_no,invoice_id,id,operator,reviewer,get_id  from dm_machine_record where type=32  and machine_id='{ConfigurationManager.AppSettings["machineId"] ?? "DM3"}') re on re.get_id=mr.id 
 | 
				
			||||||
 | 
					                    LEFT JOIN (SELECT recordId,operatorid,reviewerid,machine_id FROM destory_detail WHERE machine_id='{ConfigurationManager.AppSettings["machineId"] ?? "DM3"}') ddl on re.id=ddl.recordId 
 | 
				
			||||||
 | 
					                    -- LEFT JOIN (SELECT User_name,machine_id,id FROM user_list  WHERE machine_id='{ConfigurationManager.AppSettings["machineId"] ?? "DM3"}') ul0 on mr.operator=ul0.id
 | 
				
			||||||
 | 
					                    -- LEFT JOIN (SELECT User_name,machine_id,id FROM user_list  WHERE machine_id='{ConfigurationManager.AppSettings["machineId"] ?? "DM3"}') ul00 on re.reviewer=ul00.id 
 | 
				
			||||||
 | 
					                    LEFT JOIN (SELECT User_name,machine_id,id FROM user_list  WHERE machine_id='{ConfigurationManager.AppSettings["machineId"] ?? "DM3"}') ul on re.operator=ul.id 
 | 
				
			||||||
 | 
					                    LEFT JOIN (SELECT User_name,machine_id,id FROM user_list  WHERE machine_id='{ConfigurationManager.AppSettings["machineId"] ?? "DM3"}') u2 on re.reviewer=u2.id 
 | 
				
			||||||
 | 
					                    LEFT JOIN (SELECT User_name,machine_id,id FROM user_list  WHERE machine_id='{ConfigurationManager.AppSettings["machineId"] ?? "DM3"}') u3 on ddl.operatorid=u3.id 
 | 
				
			||||||
 | 
					                    LEFT JOIN  (SELECT User_name,machine_id,id FROM user_list  WHERE machine_id='{ConfigurationManager.AppSettings["machineId"] ?? "DM3"}') u4 on ddl.reviewerid=u4.id 
 | 
				
			||||||
 | 
					                    WHERE
 | 
				
			||||||
 | 
					                    oi.Pharmacy='{ConfigurationManager.AppSettings["storage"] ?? ""}' and oi.Order_Date>'{startDate}' and oi.Order_Date<'{endDate}' GROUP BY Order_Date";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            Report.DetailGrid.Recordset.ConnectionString = gridConnectionString;
 | 
				
			||||||
 | 
					            Report.DetailGrid.Recordset.QuerySQL = SQL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            Report.PrintPreview(true);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 发药登记表
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        /// <param name="startDate"></param>
 | 
				
			||||||
 | 
					        /// <param name="endDate"></param>
 | 
				
			||||||
 | 
					        public static void OrderUseReport(DateTime? startDate,DateTime? endDate, string drug_id)
 | 
				
			||||||
 | 
					        { 
 | 
				
			||||||
 | 
					            // 定义Grid++Report报表主对象
 | 
				
			||||||
 | 
					            GridppReport Report = new GridppReport();
 | 
				
			||||||
 | 
					            DateTime? p_startDate = startDate ?? Convert.ToDateTime("2010-1-1");
 | 
				
			||||||
 | 
					            DateTime? p_endDate = endDate ?? DateTime.Now.AddDays(1);
 | 
				
			||||||
 | 
					            string p_machine_id = (ConfigurationManager.AppSettings["machineId"] ?? "DM1");
 | 
				
			||||||
 | 
					            string SQL = string.Empty;
 | 
				
			||||||
 | 
					            Report.LoadFromFile(new FileInfo(AppDomain.CurrentDomain.BaseDirectory) + "ReportTemp//" + "orderUse_template.grf");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            SQL = $@"
 | 
				
			||||||
 | 
					                    SELECT oi.p_name,oi.age,oi.sex,oi.id_number,oi.patientno,oi.disease,od.drug_id,oi.doctor_name,oi.order_no,oi.order_date,
 | 
				
			||||||
 | 
						                    dmr.id,dmr.`drawer_no` AS drawerNo,dmr.`col_no` AS colNo,dmr.`type` AS `type`,dmr.`quantity` AS quantity,
 | 
				
			||||||
 | 
					                      dmr.`manu_no` AS manuNo,dmr.`eff_date` AS effDate,dmr.`operation_time` AS operationTime,
 | 
				
			||||||
 | 
					                      di.`drug_name` AS drugName,di.`drug_spec` AS drugSpec,di.`pack_unit` AS packUnit,
 | 
				
			||||||
 | 
					                      di.`manufactory` AS manuFactory,di.`max_stock` AS baseQuantity,dmr.`drug_id` AS drugId,
 | 
				
			||||||
 | 
					                      ul.`user_name` AS nickname,U2.`user_name` AS reviewNickname FROM dm_machine_record dmr 
 | 
				
			||||||
 | 
										  
 | 
				
			||||||
 | 
										  INNER JOIN ORDER_INFO oi on dmr.invoice_id=oi.order_no
 | 
				
			||||||
 | 
										  INNER JOIN order_detail od on oi.order_no=od.order_no and oi.order_id=od.order_id
 | 
				
			||||||
 | 
										  
 | 
				
			||||||
 | 
										  LEFT JOIN drug_info di ON di.`drug_id` = dmr.`drug_id`
 | 
				
			||||||
 | 
					                      LEFT JOIN (select id,user_name from user_list where machine_id='{ConfigurationManager.AppSettings["machineId"] ?? "DM3"}') ul ON ul.`id` = dmr.`Operator` 
 | 
				
			||||||
 | 
					                     LEFT JOIN (select id,user_name from user_list where machine_id='{ConfigurationManager.AppSettings["machineId"] ?? "DM3"}') U2 ON U2.ID=dmr.reviewer
 | 
				
			||||||
 | 
					                     WHERE  dmr.`type` = 2  and oi.Pharmacy='{ConfigurationManager.AppSettings["storage"] ?? ""}'
 | 
				
			||||||
 | 
					                     AND dmr.`machine_id` ='{ConfigurationManager.AppSettings["machineId"] ?? "DM3"}'   AND oi.`order_date` > '{startDate}'
 | 
				
			||||||
 | 
					                     AND oi.`order_date` < '{endDate}'";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            if (!string.IsNullOrEmpty(drug_id))
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                SQL += " AND ac.drug_id='" + drug_id + "' ";
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            Report.DetailGrid.Recordset.ConnectionString = gridConnectionString;
 | 
				
			||||||
 | 
					            Report.DetailGrid.Recordset.QuerySQL = SQL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            Report.PrintPreview(true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,432 @@
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						"Version":"6.3.0.1",
 | 
				
			||||||
 | 
						"Font":{
 | 
				
			||||||
 | 
							"Name":"宋体",
 | 
				
			||||||
 | 
							"Size":105000,
 | 
				
			||||||
 | 
							"Weight":400,
 | 
				
			||||||
 | 
							"Charset":134
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						"Printer":{
 | 
				
			||||||
 | 
							"Oriention":"Landscape"
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						"DetailGrid":{
 | 
				
			||||||
 | 
							"CenterView":true,
 | 
				
			||||||
 | 
							"PrintAdaptMethod":"ResizeToFit",
 | 
				
			||||||
 | 
							"AppendBlankRow":true,
 | 
				
			||||||
 | 
							"Recordset":{
 | 
				
			||||||
 | 
								"QuerySQL":"SELECT \r\n  cl.`row_no` AS drawerNo,\r\n  cl.`col_no` AS colNo,\r\n  cl.`quantity` AS quantity,\r\n  cl.`manu_no` AS manuNo,\r\n  cl.`eff_date` AS effDate,\r\n  di.`drug_name` AS drugName,\r\n  di.`drug_spec` AS drugSpec,\r\n  di.`pack_unit` AS packUnit,\r\n  di.`manufactory` AS manuFactory,\r\n  di.`max_stock` AS baseQuantity,\r\n  cl.`drug_id` AS drugId\r\nFROM\r\n  channel_stock cl\r\nINNER JOIN drug_info di ON di.`drug_id` = cl.`drug_id`\r\nWHERE cl.`machine_id` =  :machine_id\r\n AND cl.`drawer_type` = 1\r\n ORDER BY cl.`drug_id`",
 | 
				
			||||||
 | 
								"Field":[
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"Order_Date"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"userDeptName",
 | 
				
			||||||
 | 
										"Format":"0"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"drugName"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"Quantity",
 | 
				
			||||||
 | 
										"Type":"Integer"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"Manu_No"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"retuenUser"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"returnReviewer",
 | 
				
			||||||
 | 
										"Type":"Integer"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"distoryUser"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"distoryRevierer"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"drugSpec"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"dosage"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"big_unit"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"drug_id"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"needReturnEmptyCount"
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								]
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							"Column":[
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"日期",
 | 
				
			||||||
 | 
									"Width":3.175
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"科室/患者",
 | 
				
			||||||
 | 
									"Width":5.3975
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"Dept_Name",
 | 
				
			||||||
 | 
									"Width":1.61396
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"批号",
 | 
				
			||||||
 | 
									"Width":2.98979
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"空安瓿回收人",
 | 
				
			||||||
 | 
									"Width":2.98979
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"空安瓿交回人",
 | 
				
			||||||
 | 
									"Width":2.99
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"数量",
 | 
				
			||||||
 | 
									"Width":2
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"空安瓿销毁执行人",
 | 
				
			||||||
 | 
									"Width":2.98979
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"空安瓿销毁审核人",
 | 
				
			||||||
 | 
									"Width":2.99
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							],
 | 
				
			||||||
 | 
							"ColumnContent":{
 | 
				
			||||||
 | 
								"Height":0.79375,
 | 
				
			||||||
 | 
								"ColumnContentCell":[
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"日期",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"Order_Date"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"科室/患者",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"userDeptName"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"Dept_Name",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"Quantity"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"批号",
 | 
				
			||||||
 | 
										"DataField":"Manu_No"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"空安瓿回收人",
 | 
				
			||||||
 | 
										"DataField":"retuenUser"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"空安瓿交回人",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"returnReviewer"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"数量",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"distoryUser"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"空安瓿销毁执行人",
 | 
				
			||||||
 | 
										"DataField":"distoryRevierer"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"空安瓿销毁审核人",
 | 
				
			||||||
 | 
										"DataField":"needReturnEmptyCount"
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								]
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							"ColumnTitle":{
 | 
				
			||||||
 | 
								"Height":1.7,
 | 
				
			||||||
 | 
								"RepeatStyle":"OnGroupHeaderPage",
 | 
				
			||||||
 | 
								"ColumnTitleCell":[
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"日期",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":142500,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"日期"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"科室/患者",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":142500,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"科室/患者"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"Dept_Name",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":142500,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"数量"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"批号",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":142500,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"批号"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"空安瓿回收人",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":142500,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"空安瓿\r\n回收人"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"空安瓿交回人",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":142500,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"空安瓿\r\n交回人"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"数量",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":142500,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"空安瓿\r\n销毁\r\n执行人"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"空安瓿销毁执行人",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":142500,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"空安瓿\r\n销毁\r\n审核人"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"空安瓿销毁审核人",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":142500,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"待回收\r\n空安瓿\r\n数量"
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								]
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							"Group":[
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"Group1",
 | 
				
			||||||
 | 
									"ByFields":"drug_id",
 | 
				
			||||||
 | 
									"GroupHeader":{
 | 
				
			||||||
 | 
										"PrintGridBorder":false,
 | 
				
			||||||
 | 
										"RepeatOnPage":true,
 | 
				
			||||||
 | 
										"Control":[
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"StaticBox",
 | 
				
			||||||
 | 
												"Name":"StaticBox16",
 | 
				
			||||||
 | 
												"Top":0.0529167,
 | 
				
			||||||
 | 
												"Width":1.19063,
 | 
				
			||||||
 | 
												"Height":0.978958,
 | 
				
			||||||
 | 
												"Font":{
 | 
				
			||||||
 | 
													"Name":"宋体",
 | 
				
			||||||
 | 
													"Size":105000,
 | 
				
			||||||
 | 
													"Bold":true,
 | 
				
			||||||
 | 
													"Charset":134
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
												"Text":"品名:"
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"FieldBox",
 | 
				
			||||||
 | 
												"Name":"FieldBox7",
 | 
				
			||||||
 | 
												"Left":1.16417,
 | 
				
			||||||
 | 
												"Top":0.0529167,
 | 
				
			||||||
 | 
												"Width":5.63563,
 | 
				
			||||||
 | 
												"Height":0.978958,
 | 
				
			||||||
 | 
												"Font":{
 | 
				
			||||||
 | 
													"Name":"宋体",
 | 
				
			||||||
 | 
													"Size":105000,
 | 
				
			||||||
 | 
													"Bold":true,
 | 
				
			||||||
 | 
													"Charset":134
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
												"DataField":"drugName"
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"StaticBox",
 | 
				
			||||||
 | 
												"Name":"StaticBox17",
 | 
				
			||||||
 | 
												"Left":6.93208,
 | 
				
			||||||
 | 
												"Top":0.0529167,
 | 
				
			||||||
 | 
												"Width":1.11125,
 | 
				
			||||||
 | 
												"Height":0.978958,
 | 
				
			||||||
 | 
												"Font":{
 | 
				
			||||||
 | 
													"Name":"宋体",
 | 
				
			||||||
 | 
													"Size":105000,
 | 
				
			||||||
 | 
													"Bold":true,
 | 
				
			||||||
 | 
													"Charset":134
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
												"Text":"剂型:"
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"FieldBox",
 | 
				
			||||||
 | 
												"Name":"FieldBox8",
 | 
				
			||||||
 | 
												"Left":8.01688,
 | 
				
			||||||
 | 
												"Top":0.0529167,
 | 
				
			||||||
 | 
												"Width":3.175,
 | 
				
			||||||
 | 
												"Height":0.978958,
 | 
				
			||||||
 | 
												"Font":{
 | 
				
			||||||
 | 
													"Name":"宋体",
 | 
				
			||||||
 | 
													"Size":105000,
 | 
				
			||||||
 | 
													"Bold":true,
 | 
				
			||||||
 | 
													"Charset":134
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
												"DataField":"dosage"
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"StaticBox",
 | 
				
			||||||
 | 
												"Name":"StaticBox18",
 | 
				
			||||||
 | 
												"Left":11.5888,
 | 
				
			||||||
 | 
												"Top":0.0529167,
 | 
				
			||||||
 | 
												"Width":1.21708,
 | 
				
			||||||
 | 
												"Height":0.978958,
 | 
				
			||||||
 | 
												"Font":{
 | 
				
			||||||
 | 
													"Name":"宋体",
 | 
				
			||||||
 | 
													"Size":105000,
 | 
				
			||||||
 | 
													"Bold":true,
 | 
				
			||||||
 | 
													"Charset":134
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
												"Text":"规格:"
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"FieldBox",
 | 
				
			||||||
 | 
												"Name":"FieldBox10",
 | 
				
			||||||
 | 
												"Left":16.5365,
 | 
				
			||||||
 | 
												"Top":0.0529167,
 | 
				
			||||||
 | 
												"Width":2.83104,
 | 
				
			||||||
 | 
												"Height":0.978958,
 | 
				
			||||||
 | 
												"Font":{
 | 
				
			||||||
 | 
													"Name":"宋体",
 | 
				
			||||||
 | 
													"Size":105000,
 | 
				
			||||||
 | 
													"Bold":true,
 | 
				
			||||||
 | 
													"Charset":134
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
												"DataField":"drugSpec"
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"StaticBox",
 | 
				
			||||||
 | 
												"Name":"StaticBox20",
 | 
				
			||||||
 | 
												"Left":19.7379,
 | 
				
			||||||
 | 
												"Top":0.0529167,
 | 
				
			||||||
 | 
												"Width":2.01083,
 | 
				
			||||||
 | 
												"Height":0.978958,
 | 
				
			||||||
 | 
												"Font":{
 | 
				
			||||||
 | 
													"Name":"宋体",
 | 
				
			||||||
 | 
													"Size":105000,
 | 
				
			||||||
 | 
													"Bold":true,
 | 
				
			||||||
 | 
													"Charset":134
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
												"Text":"单位:"
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"FieldBox",
 | 
				
			||||||
 | 
												"Name":"FieldBox11",
 | 
				
			||||||
 | 
												"Left":21.7223,
 | 
				
			||||||
 | 
												"Top":0.05,
 | 
				
			||||||
 | 
												"Width":5.92667,
 | 
				
			||||||
 | 
												"Height":0.978958,
 | 
				
			||||||
 | 
												"Font":{
 | 
				
			||||||
 | 
													"Name":"宋体",
 | 
				
			||||||
 | 
													"Size":105000,
 | 
				
			||||||
 | 
													"Bold":true,
 | 
				
			||||||
 | 
													"Charset":134
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
												"DataField":"big_unit"
 | 
				
			||||||
 | 
											}
 | 
				
			||||||
 | 
										],
 | 
				
			||||||
 | 
										"NewPageColumn":"Before"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									"GroupFooter":{
 | 
				
			||||||
 | 
										"Height":0.635
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							]
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						"Parameter":[
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								"Name":"machine_id",
 | 
				
			||||||
 | 
								"Value":"DM3"
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						],
 | 
				
			||||||
 | 
						"ReportHeader":[
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								"Name":"ReportHeader1",
 | 
				
			||||||
 | 
								"Height":2.40771,
 | 
				
			||||||
 | 
								"Control":[
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Type":"StaticBox",
 | 
				
			||||||
 | 
										"Name":"StaticBox1",
 | 
				
			||||||
 | 
										"Center":"Horizontal",
 | 
				
			||||||
 | 
										"Left":8.99583,
 | 
				
			||||||
 | 
										"Top":0.608542,
 | 
				
			||||||
 | 
										"Width":9.18104,
 | 
				
			||||||
 | 
										"Height":1.21708,
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":217500,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"回收销毁记录"
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								],
 | 
				
			||||||
 | 
								"RepeatOnPage":true
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						]
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,618 @@
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						"Version":"6.8.1.1",
 | 
				
			||||||
 | 
						"Font":{
 | 
				
			||||||
 | 
							"Name":"宋体",
 | 
				
			||||||
 | 
							"Size":105000,
 | 
				
			||||||
 | 
							"Weight":400,
 | 
				
			||||||
 | 
							"Charset":134
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						"Printer":{
 | 
				
			||||||
 | 
							"Oriention":"Landscape",
 | 
				
			||||||
 | 
							"LeftMargin":1,
 | 
				
			||||||
 | 
							"TopMargin":1.42875,
 | 
				
			||||||
 | 
							"RightMargin":1,
 | 
				
			||||||
 | 
							"BottomMargin":1.8
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						"DetailGrid":{
 | 
				
			||||||
 | 
							"CenterView":true,
 | 
				
			||||||
 | 
							"AppendBlankRow":true,
 | 
				
			||||||
 | 
							"Recordset":{
 | 
				
			||||||
 | 
								"Field":[
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"日期",
 | 
				
			||||||
 | 
										"Type":"DateTime",
 | 
				
			||||||
 | 
										"Format":"M/d",
 | 
				
			||||||
 | 
										"DBFieldName":"operationTime"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"操作类型",
 | 
				
			||||||
 | 
										"DBFieldName":"type"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"批号",
 | 
				
			||||||
 | 
										"DBFieldName":"manuNo"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"上次批次结存",
 | 
				
			||||||
 | 
										"Type":"Integer",
 | 
				
			||||||
 | 
										"DBFieldName":"beforeManuQuan"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"入库数量",
 | 
				
			||||||
 | 
										"Type":"Integer",
 | 
				
			||||||
 | 
										"DBFieldName":"inQuantity"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"出库数量",
 | 
				
			||||||
 | 
										"Type":"Integer",
 | 
				
			||||||
 | 
										"DBFieldName":"outQuantity"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"批号结存",
 | 
				
			||||||
 | 
										"Type":"Integer",
 | 
				
			||||||
 | 
										"DBFieldName":"manuQuantity"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"总结存",
 | 
				
			||||||
 | 
										"Type":"Integer",
 | 
				
			||||||
 | 
										"DBFieldName":"stockQuantity"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"收/发药人",
 | 
				
			||||||
 | 
										"DBFieldName":"operatorName"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"复核人",
 | 
				
			||||||
 | 
										"DBFieldName":"reviewerName"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"药品名称",
 | 
				
			||||||
 | 
										"DBFieldName":"drugName"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"规格",
 | 
				
			||||||
 | 
										"DBFieldName":"drugSpec"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"单位",
 | 
				
			||||||
 | 
										"DBFieldName":"bigUnit"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"剂型",
 | 
				
			||||||
 | 
										"DBFieldName":"dosage"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"厂家",
 | 
				
			||||||
 | 
										"DBFieldName":"manuFactory"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"有效期",
 | 
				
			||||||
 | 
										"Type":"DateTime",
 | 
				
			||||||
 | 
										"Format":"yy/M/d",
 | 
				
			||||||
 | 
										"DBFieldName":"effDate"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"sign1",
 | 
				
			||||||
 | 
										"Type":"Binary"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"sign2",
 | 
				
			||||||
 | 
										"Type":"Binary"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"drugId",
 | 
				
			||||||
 | 
										"DBFieldName":"drug_Id"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"凭证号",
 | 
				
			||||||
 | 
										"DBFieldName":"invoiceId"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"供应单位",
 | 
				
			||||||
 | 
										"DBFieldName":"supplierDept"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"领用部门",
 | 
				
			||||||
 | 
										"DBFieldName":"receiveDept"
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								]
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							"Column":[
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"日期",
 | 
				
			||||||
 | 
									"Width":1.77271
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"凭证号",
 | 
				
			||||||
 | 
									"Width":2.19604
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"批号",
 | 
				
			||||||
 | 
									"Width":3.99521
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"有效期",
 | 
				
			||||||
 | 
									"Width":2.43417
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"入库数量",
 | 
				
			||||||
 | 
									"Width":1.79917
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"出库数量",
 | 
				
			||||||
 | 
									"Width":1.79917
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"Column4",
 | 
				
			||||||
 | 
									"Width":1.98438
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"收/发药人",
 | 
				
			||||||
 | 
									"Width":2.80458
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"复核人",
 | 
				
			||||||
 | 
									"Width":2.80458
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"Column2",
 | 
				
			||||||
 | 
									"Width":2.35479
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"Column3",
 | 
				
			||||||
 | 
									"Width":2.38125
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							],
 | 
				
			||||||
 | 
							"ColumnContent":{
 | 
				
			||||||
 | 
								"Height":0.85,
 | 
				
			||||||
 | 
								"ColumnContentCell":[
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"日期",
 | 
				
			||||||
 | 
										"WordWrap":true,
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"ShrinkFontToFit":true,
 | 
				
			||||||
 | 
										"DataField":"日期"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"凭证号",
 | 
				
			||||||
 | 
										"DataField":"凭证号"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"批号",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"批号"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"有效期",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"有效期"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"入库数量",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"入库数量"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"出库数量",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"出库数量"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"Column4",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"总结存"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"收/发药人",
 | 
				
			||||||
 | 
										"FreeCell":true,
 | 
				
			||||||
 | 
										"Control":[
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"FieldBox",
 | 
				
			||||||
 | 
												"Name":"FieldBox12",
 | 
				
			||||||
 | 
												"Dock":"Fill",
 | 
				
			||||||
 | 
												"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
												"DataField":"收/发药人"
 | 
				
			||||||
 | 
											}
 | 
				
			||||||
 | 
										]
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"复核人",
 | 
				
			||||||
 | 
										"FreeCell":true,
 | 
				
			||||||
 | 
										"Control":[
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"FieldBox",
 | 
				
			||||||
 | 
												"Name":"FieldBox13",
 | 
				
			||||||
 | 
												"Dock":"Fill",
 | 
				
			||||||
 | 
												"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
												"DataField":"复核人"
 | 
				
			||||||
 | 
											}
 | 
				
			||||||
 | 
										]
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"Column2",
 | 
				
			||||||
 | 
										"FreeCell":true,
 | 
				
			||||||
 | 
										"Control":[
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"FieldBox",
 | 
				
			||||||
 | 
												"Name":"FieldBox14",
 | 
				
			||||||
 | 
												"Dock":"Fill",
 | 
				
			||||||
 | 
												"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
												"DataField":"供应单位"
 | 
				
			||||||
 | 
											}
 | 
				
			||||||
 | 
										]
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"Column3",
 | 
				
			||||||
 | 
										"FreeCell":true,
 | 
				
			||||||
 | 
										"Control":[
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"FieldBox",
 | 
				
			||||||
 | 
												"Name":"FieldBox15",
 | 
				
			||||||
 | 
												"Dock":"Fill",
 | 
				
			||||||
 | 
												"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
												"DataField":"领用部门"
 | 
				
			||||||
 | 
											}
 | 
				
			||||||
 | 
										]
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								]
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							"ColumnTitle":{
 | 
				
			||||||
 | 
								"Height":1.19063,
 | 
				
			||||||
 | 
								"RepeatStyle":"OnGroupHeaderPage",
 | 
				
			||||||
 | 
								"ColumnTitleCell":[
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"日期",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":105000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"日期"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"凭证号",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":105000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"凭证号"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"批号",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":105000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"批号"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"有效期",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":105000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"有效\r\n期"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"入库数量",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":105000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"借入\r\n数量"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"出库数量",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":105000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"发出\r\n数量"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"Column4",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":105000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"总结存"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"收/发药人",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":105000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"发药人"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"复核人",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":105000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"复核人"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"Column2",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":105000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"供应单位"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"Column3",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":105000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"领用部门"
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								]
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							"Group":[
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"Group1",
 | 
				
			||||||
 | 
									"ByFields":"drugId",
 | 
				
			||||||
 | 
									"GroupHeader":{
 | 
				
			||||||
 | 
										"NewPage":"Before",
 | 
				
			||||||
 | 
										"PrintGridBorder":false,
 | 
				
			||||||
 | 
										"RepeatOnPage":true,
 | 
				
			||||||
 | 
										"Control":[
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"StaticBox",
 | 
				
			||||||
 | 
												"Name":"StaticBox15",
 | 
				
			||||||
 | 
												"Left":28.3898,
 | 
				
			||||||
 | 
												"Top":0.238125,
 | 
				
			||||||
 | 
												"Width":2.01083,
 | 
				
			||||||
 | 
												"Height":0.79375,
 | 
				
			||||||
 | 
												"Text":"生产厂家:"
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"MemoBox",
 | 
				
			||||||
 | 
												"Name":"MemoBox11",
 | 
				
			||||||
 | 
												"Left":30.3742,
 | 
				
			||||||
 | 
												"Top":0.211667,
 | 
				
			||||||
 | 
												"Width":5.3975,
 | 
				
			||||||
 | 
												"Height":0.79375,
 | 
				
			||||||
 | 
												"Text":"[#manuFactory#]"
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"StaticBox",
 | 
				
			||||||
 | 
												"Name":"StaticBox16",
 | 
				
			||||||
 | 
												"Top":0.0529167,
 | 
				
			||||||
 | 
												"Width":1.19063,
 | 
				
			||||||
 | 
												"Height":0.978958,
 | 
				
			||||||
 | 
												"Font":{
 | 
				
			||||||
 | 
													"Name":"宋体",
 | 
				
			||||||
 | 
													"Size":105000,
 | 
				
			||||||
 | 
													"Bold":true,
 | 
				
			||||||
 | 
													"Charset":134
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
												"Text":"品名:"
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"FieldBox",
 | 
				
			||||||
 | 
												"Name":"FieldBox7",
 | 
				
			||||||
 | 
												"Left":1.16417,
 | 
				
			||||||
 | 
												"Top":0.0529167,
 | 
				
			||||||
 | 
												"Width":5.63563,
 | 
				
			||||||
 | 
												"Height":0.978958,
 | 
				
			||||||
 | 
												"Font":{
 | 
				
			||||||
 | 
													"Name":"宋体",
 | 
				
			||||||
 | 
													"Size":105000,
 | 
				
			||||||
 | 
													"Bold":true,
 | 
				
			||||||
 | 
													"Charset":134
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
												"DataField":"药品名称"
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"StaticBox",
 | 
				
			||||||
 | 
												"Name":"StaticBox17",
 | 
				
			||||||
 | 
												"Left":6.93208,
 | 
				
			||||||
 | 
												"Top":0.0529167,
 | 
				
			||||||
 | 
												"Width":1.11125,
 | 
				
			||||||
 | 
												"Height":0.978958,
 | 
				
			||||||
 | 
												"Font":{
 | 
				
			||||||
 | 
													"Name":"宋体",
 | 
				
			||||||
 | 
													"Size":105000,
 | 
				
			||||||
 | 
													"Bold":true,
 | 
				
			||||||
 | 
													"Charset":134
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
												"Text":"规格:"
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"FieldBox",
 | 
				
			||||||
 | 
												"Name":"FieldBox8",
 | 
				
			||||||
 | 
												"Left":8.01688,
 | 
				
			||||||
 | 
												"Top":0.0529167,
 | 
				
			||||||
 | 
												"Width":3.175,
 | 
				
			||||||
 | 
												"Height":0.978958,
 | 
				
			||||||
 | 
												"Font":{
 | 
				
			||||||
 | 
													"Name":"宋体",
 | 
				
			||||||
 | 
													"Size":105000,
 | 
				
			||||||
 | 
													"Bold":true,
 | 
				
			||||||
 | 
													"Charset":134
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
												"DataField":"规格"
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"StaticBox",
 | 
				
			||||||
 | 
												"Name":"StaticBox18",
 | 
				
			||||||
 | 
												"Left":11.5888,
 | 
				
			||||||
 | 
												"Top":0.0529167,
 | 
				
			||||||
 | 
												"Width":1.21708,
 | 
				
			||||||
 | 
												"Height":0.978958,
 | 
				
			||||||
 | 
												"Font":{
 | 
				
			||||||
 | 
													"Name":"宋体",
 | 
				
			||||||
 | 
													"Size":105000,
 | 
				
			||||||
 | 
													"Bold":true,
 | 
				
			||||||
 | 
													"Charset":134
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
												"Text":"单位:"
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"FieldBox",
 | 
				
			||||||
 | 
												"Name":"FieldBox9",
 | 
				
			||||||
 | 
												"Left":12.7794,
 | 
				
			||||||
 | 
												"Top":0.0529167,
 | 
				
			||||||
 | 
												"Width":1.87854,
 | 
				
			||||||
 | 
												"Height":0.978958,
 | 
				
			||||||
 | 
												"Font":{
 | 
				
			||||||
 | 
													"Name":"宋体",
 | 
				
			||||||
 | 
													"Size":105000,
 | 
				
			||||||
 | 
													"Bold":true,
 | 
				
			||||||
 | 
													"Charset":134
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
												"DataField":"单位"
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"StaticBox",
 | 
				
			||||||
 | 
												"Name":"StaticBox19",
 | 
				
			||||||
 | 
												"Left":15.3988,
 | 
				
			||||||
 | 
												"Top":0.0529167,
 | 
				
			||||||
 | 
												"Width":1.16417,
 | 
				
			||||||
 | 
												"Height":0.978958,
 | 
				
			||||||
 | 
												"Font":{
 | 
				
			||||||
 | 
													"Name":"宋体",
 | 
				
			||||||
 | 
													"Size":105000,
 | 
				
			||||||
 | 
													"Bold":true,
 | 
				
			||||||
 | 
													"Charset":134
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
												"Text":"剂型:"
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"FieldBox",
 | 
				
			||||||
 | 
												"Name":"FieldBox10",
 | 
				
			||||||
 | 
												"Left":16.5365,
 | 
				
			||||||
 | 
												"Top":0.0529167,
 | 
				
			||||||
 | 
												"Width":2.83104,
 | 
				
			||||||
 | 
												"Height":0.978958,
 | 
				
			||||||
 | 
												"Font":{
 | 
				
			||||||
 | 
													"Name":"宋体",
 | 
				
			||||||
 | 
													"Size":105000,
 | 
				
			||||||
 | 
													"Bold":true,
 | 
				
			||||||
 | 
													"Charset":134
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
												"DataField":"剂型"
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"StaticBox",
 | 
				
			||||||
 | 
												"Name":"StaticBox20",
 | 
				
			||||||
 | 
												"Left":19.7379,
 | 
				
			||||||
 | 
												"Top":0.0529167,
 | 
				
			||||||
 | 
												"Width":2.01083,
 | 
				
			||||||
 | 
												"Height":0.978958,
 | 
				
			||||||
 | 
												"Font":{
 | 
				
			||||||
 | 
													"Name":"宋体",
 | 
				
			||||||
 | 
													"Size":105000,
 | 
				
			||||||
 | 
													"Bold":true,
 | 
				
			||||||
 | 
													"Charset":134
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
												"Text":"生产厂家:"
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"FieldBox",
 | 
				
			||||||
 | 
												"Name":"FieldBox11",
 | 
				
			||||||
 | 
												"Left":21.7223,
 | 
				
			||||||
 | 
												"Top":0.05,
 | 
				
			||||||
 | 
												"Width":5.92667,
 | 
				
			||||||
 | 
												"Height":0.978958,
 | 
				
			||||||
 | 
												"Font":{
 | 
				
			||||||
 | 
													"Name":"宋体",
 | 
				
			||||||
 | 
													"Size":105000,
 | 
				
			||||||
 | 
													"Bold":true,
 | 
				
			||||||
 | 
													"Charset":134
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
												"DataField":"厂家"
 | 
				
			||||||
 | 
											}
 | 
				
			||||||
 | 
										],
 | 
				
			||||||
 | 
										"NewPageColumn":"Before"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									"GroupFooter":{
 | 
				
			||||||
 | 
										"Visible":false
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							]
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						"Parameter":[
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								"Name":"machine_id"
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								"Name":"startDate",
 | 
				
			||||||
 | 
								"DataType":"DateTime"
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								"Name":"endDate",
 | 
				
			||||||
 | 
								"DataType":"DateTime"
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						],
 | 
				
			||||||
 | 
						"ReportHeader":[
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								"Name":"ReportHeader1",
 | 
				
			||||||
 | 
								"Height":1.79917,
 | 
				
			||||||
 | 
								"Control":[
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Type":"MemoBox",
 | 
				
			||||||
 | 
										"Name":"MemoBox1",
 | 
				
			||||||
 | 
										"Dock":"Fill",
 | 
				
			||||||
 | 
										"Center":"Both",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":262500,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"麻醉、精神药品逐笔专用账册"
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								],
 | 
				
			||||||
 | 
								"RepeatOnPage":true
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						]
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,345 @@
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						"Version":"6.3.0.1",
 | 
				
			||||||
 | 
						"Font":{
 | 
				
			||||||
 | 
							"Name":"宋体",
 | 
				
			||||||
 | 
							"Size":105000,
 | 
				
			||||||
 | 
							"Weight":400,
 | 
				
			||||||
 | 
							"Charset":134
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						"Printer":{
 | 
				
			||||||
 | 
							"Oriention":"Landscape",
 | 
				
			||||||
 | 
							"LeftMargin":1,
 | 
				
			||||||
 | 
							"TopMargin":1.4287,
 | 
				
			||||||
 | 
							"RightMargin":1,
 | 
				
			||||||
 | 
							"BottomMargin":1.8
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						"DetailGrid":{
 | 
				
			||||||
 | 
							"CenterView":true,
 | 
				
			||||||
 | 
							"Recordset":{
 | 
				
			||||||
 | 
								"Field":[
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"日期",
 | 
				
			||||||
 | 
										"Type":"DateTime",
 | 
				
			||||||
 | 
										"Format":"yyyy/MM/dd",
 | 
				
			||||||
 | 
										"DBFieldName":"opt_date"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"品名",
 | 
				
			||||||
 | 
										"DBFieldName":"drug_name"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"规格",
 | 
				
			||||||
 | 
										"DBFieldName":"drug_spec"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"上班结存数",
 | 
				
			||||||
 | 
										"Type":"Integer",
 | 
				
			||||||
 | 
										"DBFieldName":"beforenum"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"领用数",
 | 
				
			||||||
 | 
										"Type":"Integer",
 | 
				
			||||||
 | 
										"DBFieldName":"getnum"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"消耗数",
 | 
				
			||||||
 | 
										"Type":"Integer",
 | 
				
			||||||
 | 
										"DBFieldName":"usenum"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"批号",
 | 
				
			||||||
 | 
										"DBFieldName":"manu_no"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"余",
 | 
				
			||||||
 | 
										"Type":"Integer",
 | 
				
			||||||
 | 
										"DBFieldName":"surplus"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"交班人",
 | 
				
			||||||
 | 
										"DBFieldName":"fromoperator"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"接班人",
 | 
				
			||||||
 | 
										"DBFieldName":"tooperator"
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								]
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							"Column":[
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"日期",
 | 
				
			||||||
 | 
									"Width":2.56646
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"品名",
 | 
				
			||||||
 | 
									"Width":4.60375
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"规格",
 | 
				
			||||||
 | 
									"Width":2.59292
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"上班结存数",
 | 
				
			||||||
 | 
									"Width":1.4
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"领用数",
 | 
				
			||||||
 | 
									"Width":1.4
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"消耗数",
 | 
				
			||||||
 | 
									"Width":1.4
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"批号",
 | 
				
			||||||
 | 
									"Width":1.98438
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"余",
 | 
				
			||||||
 | 
									"Width":0.608542
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"交班人",
 | 
				
			||||||
 | 
									"Width":2.80458
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"接班人",
 | 
				
			||||||
 | 
									"Width":2.35479
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							],
 | 
				
			||||||
 | 
							"ColumnContent":{
 | 
				
			||||||
 | 
								"Height":0.85,
 | 
				
			||||||
 | 
								"ColumnContentCell":[
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"日期",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"日期"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"品名",
 | 
				
			||||||
 | 
										"DataField":"品名"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"规格",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"规格"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"上班结存数",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"上班结存数"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"领用数",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"领用数"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"消耗数",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"消耗数"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"批号",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"批号"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"余",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"余"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"交班人",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"交班人"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"接班人",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"接班人"
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								]
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							"ColumnTitle":{
 | 
				
			||||||
 | 
								"Height":1.00542,
 | 
				
			||||||
 | 
								"RepeatStyle":"OnPage",
 | 
				
			||||||
 | 
								"ColumnTitleCell":[
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"日期",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":105000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"日期"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"品名",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":105000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"品名"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"规格",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":105000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"规格"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"上班结存数",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":105000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"WordWrap":true,
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"上班\r\n结存数"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"领用数",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":105000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"WordWrap":true,
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"领用数"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"消耗数",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":105000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"WordWrap":true,
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"消耗数"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"批号",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":105000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"批号"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"余",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":105000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"余"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"交班人",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":105000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"交班人"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"接班人",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":105000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"接班人"
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								]
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							"Group":[
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"Group1",
 | 
				
			||||||
 | 
									"ByFields":"日期",
 | 
				
			||||||
 | 
									"GroupHeader":{
 | 
				
			||||||
 | 
										"Height":0,
 | 
				
			||||||
 | 
										"PrintGridBorder":false,
 | 
				
			||||||
 | 
										"NewPageColumn":"Before"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									"GroupFooter":{
 | 
				
			||||||
 | 
										"Visible":false,
 | 
				
			||||||
 | 
										"PrintGridBorder":false
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							]
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						"Parameter":[
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								"Name":"machine_id"
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								"Name":"startDate",
 | 
				
			||||||
 | 
								"DataType":"DateTime"
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								"Name":"endDate",
 | 
				
			||||||
 | 
								"DataType":"DateTime"
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						],
 | 
				
			||||||
 | 
						"ReportHeader":[
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								"Name":"ReportHeader1",
 | 
				
			||||||
 | 
								"Height":1.79917,
 | 
				
			||||||
 | 
								"Control":[
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Type":"MemoBox",
 | 
				
			||||||
 | 
										"Name":"MemoBox1",
 | 
				
			||||||
 | 
										"Dock":"Fill",
 | 
				
			||||||
 | 
										"Center":"Both",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":262500,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"交接班记录"
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								],
 | 
				
			||||||
 | 
								"RepeatOnPage":true
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						]
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,283 @@
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						"Version":"6.3.0.1",
 | 
				
			||||||
 | 
						"Font":{
 | 
				
			||||||
 | 
							"Name":"宋体",
 | 
				
			||||||
 | 
							"Size":105000,
 | 
				
			||||||
 | 
							"Weight":400,
 | 
				
			||||||
 | 
							"Charset":134
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						"Printer":{
 | 
				
			||||||
 | 
							"LeftMargin":0.3175,
 | 
				
			||||||
 | 
							"TopMargin":0.899583,
 | 
				
			||||||
 | 
							"RightMargin":0.396875
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						"DetailGrid":{
 | 
				
			||||||
 | 
							"CenterView":true,
 | 
				
			||||||
 | 
							"AppendBlankRow":true,
 | 
				
			||||||
 | 
							"Recordset":{
 | 
				
			||||||
 | 
								"QuerySQL":"SELECT \r\n  dmr.`drawer_no` AS drawerNo,\r\n  dmr.`col_no` AS colNo,\r\n  dmr.`type` AS `type`,\r\n  dmr.`quantity` AS quantity,\r\n  dmr.`manu_no` AS manuNo,\r\n  dmr.`eff_date` AS effDate,\r\n  dmr.`operation_time` AS operationTime,\r\n  di.`drug_name` AS drugName,\r\n  di.`drug_spec` AS drugSpec,\r\n  di.`pack_unit` AS packUnit,\r\n  di.`manufactory` AS manuFactory,\r\n  di.`max_stock` AS baseQuantity,\r\n  dmr.`drug_id` AS drugId,\r\n  ul.`user_name` AS nickname\r\nFROM\r\n  dm_machine_record dmr\r\nLEFT JOIN drug_info di ON di.`drug_id` = dmr.`drug_id`\r\nLEFT JOIN user_list ul ON ul.`id` = dmr.`Operator`\r\nWHERE dmr.`type` = 1 \r\n AND dmr.`machine_id` = :machine_id\r\n AND dmr.`operation_time` > :startDate\r\n AND dmr.`operation_time` < :endDate",
 | 
				
			||||||
 | 
								"Field":[
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"操作人",
 | 
				
			||||||
 | 
										"DBFieldName":"Nickname"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"时间",
 | 
				
			||||||
 | 
										"Type":"DateTime",
 | 
				
			||||||
 | 
										"Format":"yyyy/MM/dd HH:mm:ss",
 | 
				
			||||||
 | 
										"DBFieldName":"operationTime"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"药品名称",
 | 
				
			||||||
 | 
										"DBFieldName":"DrugName"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"数量",
 | 
				
			||||||
 | 
										"DBFieldName":"quantity"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"批次",
 | 
				
			||||||
 | 
										"DBFieldName":"manuNo"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"效期",
 | 
				
			||||||
 | 
										"Type":"DateTime",
 | 
				
			||||||
 | 
										"Format":"yyyy/MM/dd",
 | 
				
			||||||
 | 
										"DBFieldName":"effDate"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"库位",
 | 
				
			||||||
 | 
										"DBFieldName":"drawerNo"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"colNo"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"type2",
 | 
				
			||||||
 | 
										"Type":"Integer",
 | 
				
			||||||
 | 
										"DBFieldName":"type"
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								]
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							"Column":[
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"操作人",
 | 
				
			||||||
 | 
									"Width":2.38125
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"时间",
 | 
				
			||||||
 | 
									"Width":3.78354
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"药品名称",
 | 
				
			||||||
 | 
									"Width":4.63021
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"数量",
 | 
				
			||||||
 | 
									"Width":1.98438
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"批次",
 | 
				
			||||||
 | 
									"Width":2.61938
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"效期",
 | 
				
			||||||
 | 
									"Width":2.38125
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"库位",
 | 
				
			||||||
 | 
									"Width":2.59292
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							],
 | 
				
			||||||
 | 
							"ColumnContent":{
 | 
				
			||||||
 | 
								"Height":1.00542,
 | 
				
			||||||
 | 
								"ColumnContentCell":[
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"操作人",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"操作人"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"时间",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"时间"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"药品名称",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"药品名称"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"数量",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"数量"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"批次",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"批次"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"效期",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"效期"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"库位",
 | 
				
			||||||
 | 
										"FreeCell":true,
 | 
				
			||||||
 | 
										"Control":[
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"FieldBox",
 | 
				
			||||||
 | 
												"Name":"FieldBox1",
 | 
				
			||||||
 | 
												"Left":9.60438,
 | 
				
			||||||
 | 
												"Top":-2.16958,
 | 
				
			||||||
 | 
												"Width":2.80458,
 | 
				
			||||||
 | 
												"Height":0.661458
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"MemoBox",
 | 
				
			||||||
 | 
												"Name":"MemoBox1",
 | 
				
			||||||
 | 
												"Dock":"Fill",
 | 
				
			||||||
 | 
												"Center":"Both",
 | 
				
			||||||
 | 
												"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
												"Text":"[#库位#] - [#colNo#]"
 | 
				
			||||||
 | 
											}
 | 
				
			||||||
 | 
										]
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								]
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							"ColumnTitle":{
 | 
				
			||||||
 | 
								"Height":1.40229,
 | 
				
			||||||
 | 
								"RepeatStyle":"OnPage",
 | 
				
			||||||
 | 
								"ColumnTitleCell":[
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"操作人",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":120000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"操作人"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"时间",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":120000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"时间"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"药品名称",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":120000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"药品名称"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"数量",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":120000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"数量"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"批次",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":120000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"批次"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"效期",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":120000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"效期"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"库位",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":120000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"库位"
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								]
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						"Parameter":[
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								"Name":"startDate",
 | 
				
			||||||
 | 
								"DataType":"DateTime",
 | 
				
			||||||
 | 
								"Format":"yyyy-MM-dd hh:mm:ss",
 | 
				
			||||||
 | 
								"Value":"2023/1/1"
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								"Name":"endDate",
 | 
				
			||||||
 | 
								"DataType":"DateTime",
 | 
				
			||||||
 | 
								"Format":"yyyy-MM-dd hh:mm:ss",
 | 
				
			||||||
 | 
								"Value":"2023/4/28 23:59:59"
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								"Name":"machine_id",
 | 
				
			||||||
 | 
								"Value":"DM3"
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						],
 | 
				
			||||||
 | 
						"ReportHeader":[
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								"Name":"ReportHeader1",
 | 
				
			||||||
 | 
								"Height":1.79917,
 | 
				
			||||||
 | 
								"Control":[
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Type":"MemoBox",
 | 
				
			||||||
 | 
										"Name":"MemoBox2",
 | 
				
			||||||
 | 
										"Left":7.59354,
 | 
				
			||||||
 | 
										"Top":0.211667,
 | 
				
			||||||
 | 
										"Width":5.60917,
 | 
				
			||||||
 | 
										"Height":1.19063,
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":217500,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"入库记录"
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								],
 | 
				
			||||||
 | 
								"RepeatOnPage":true
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						]
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,283 @@
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						"Version":"6.3.0.1",
 | 
				
			||||||
 | 
						"Font":{
 | 
				
			||||||
 | 
							"Name":"宋体",
 | 
				
			||||||
 | 
							"Size":105000,
 | 
				
			||||||
 | 
							"Weight":400,
 | 
				
			||||||
 | 
							"Charset":134
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						"Printer":{
 | 
				
			||||||
 | 
							"LeftMargin":0.3175,
 | 
				
			||||||
 | 
							"TopMargin":0.899583,
 | 
				
			||||||
 | 
							"RightMargin":0.396875
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						"DetailGrid":{
 | 
				
			||||||
 | 
							"CenterView":true,
 | 
				
			||||||
 | 
							"AppendBlankRow":true,
 | 
				
			||||||
 | 
							"Recordset":{
 | 
				
			||||||
 | 
								"QuerySQL":"SELECT \r\n  dmr.`drawer_no` AS drawerNo,\r\n  dmr.`col_no` AS colNo,\r\n  dmr.`type` AS `type`,\r\n  dmr.`quantity` AS quantity,\r\n  dmr.`manu_no` AS manuNo,\r\n  dmr.`eff_date` AS effDate,\r\n  dmr.`operation_time` AS operationTime,\r\n  di.`drug_name` AS drugName,\r\n  di.`drug_spec` AS drugSpec,\r\n  di.`pack_unit` AS packUnit,\r\n  di.`manufactory` AS manuFactory,\r\n  di.`max_stock` AS baseQuantity,\r\n  dmr.`drug_id` AS drugId,\r\n  ul.`user_name` AS nickname\r\nFROM\r\n  dm_machine_record dmr\r\nLEFT JOIN drug_info di ON di.`drug_id` = dmr.`drug_id`\r\nLEFT JOIN user_list ul ON ul.`id` = dmr.`Operator`\r\nWHERE dmr.`type` = 4 \r\n AND dmr.`machine_id` = :machine_id\r\n AND dmr.`operation_time` > :startDate\r\n AND dmr.`operation_time` < :endDate",
 | 
				
			||||||
 | 
								"Field":[
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"操作人",
 | 
				
			||||||
 | 
										"DBFieldName":"Nickname"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"时间",
 | 
				
			||||||
 | 
										"Type":"DateTime",
 | 
				
			||||||
 | 
										"Format":"yyyy/MM/dd HH:mm:ss",
 | 
				
			||||||
 | 
										"DBFieldName":"operationTime"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"药品名称",
 | 
				
			||||||
 | 
										"DBFieldName":"DrugName"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"数量",
 | 
				
			||||||
 | 
										"DBFieldName":"quantity"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"批次",
 | 
				
			||||||
 | 
										"DBFieldName":"manuNo"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"效期",
 | 
				
			||||||
 | 
										"Type":"DateTime",
 | 
				
			||||||
 | 
										"Format":"yyyy/MM/dd",
 | 
				
			||||||
 | 
										"DBFieldName":"effDate"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"库位",
 | 
				
			||||||
 | 
										"DBFieldName":"drawerNo"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"colNo"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"type2",
 | 
				
			||||||
 | 
										"Type":"Integer",
 | 
				
			||||||
 | 
										"DBFieldName":"type"
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								]
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							"Column":[
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"操作人",
 | 
				
			||||||
 | 
									"Width":2.38125
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"时间",
 | 
				
			||||||
 | 
									"Width":3.78354
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"药品名称",
 | 
				
			||||||
 | 
									"Width":4.63021
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"数量",
 | 
				
			||||||
 | 
									"Width":1.98438
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"批次",
 | 
				
			||||||
 | 
									"Width":2.61938
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"效期",
 | 
				
			||||||
 | 
									"Width":2.38125
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"库位",
 | 
				
			||||||
 | 
									"Width":2.59292
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							],
 | 
				
			||||||
 | 
							"ColumnContent":{
 | 
				
			||||||
 | 
								"Height":1.00542,
 | 
				
			||||||
 | 
								"ColumnContentCell":[
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"操作人",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"操作人"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"时间",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"时间"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"药品名称",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"药品名称"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"数量",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"数量"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"批次",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"批次"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"效期",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"效期"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"库位",
 | 
				
			||||||
 | 
										"FreeCell":true,
 | 
				
			||||||
 | 
										"Control":[
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"FieldBox",
 | 
				
			||||||
 | 
												"Name":"FieldBox1",
 | 
				
			||||||
 | 
												"Left":9.60438,
 | 
				
			||||||
 | 
												"Top":-2.16958,
 | 
				
			||||||
 | 
												"Width":2.80458,
 | 
				
			||||||
 | 
												"Height":0.661458
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"MemoBox",
 | 
				
			||||||
 | 
												"Name":"MemoBox1",
 | 
				
			||||||
 | 
												"Dock":"Fill",
 | 
				
			||||||
 | 
												"Center":"Both",
 | 
				
			||||||
 | 
												"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
												"Text":"[#库位#] - [#colNo#]"
 | 
				
			||||||
 | 
											}
 | 
				
			||||||
 | 
										]
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								]
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							"ColumnTitle":{
 | 
				
			||||||
 | 
								"Height":1.40229,
 | 
				
			||||||
 | 
								"RepeatStyle":"OnPage",
 | 
				
			||||||
 | 
								"ColumnTitleCell":[
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"操作人",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":120000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"操作人"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"时间",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":120000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"时间"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"药品名称",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":120000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"药品名称"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"数量",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":120000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"数量"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"批次",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":120000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"批次"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"效期",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":120000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"效期"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"库位",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":120000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"库位"
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								]
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						"Parameter":[
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								"Name":"startDate",
 | 
				
			||||||
 | 
								"DataType":"DateTime",
 | 
				
			||||||
 | 
								"Format":"yyyy-MM-dd hh:mm:ss",
 | 
				
			||||||
 | 
								"Value":"2023/1/1"
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								"Name":"endDate",
 | 
				
			||||||
 | 
								"DataType":"DateTime",
 | 
				
			||||||
 | 
								"Format":"yyyy-MM-dd hh:mm:ss",
 | 
				
			||||||
 | 
								"Value":"2023/4/28 23:59:59"
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								"Name":"machine_id",
 | 
				
			||||||
 | 
								"Value":"DM3"
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						],
 | 
				
			||||||
 | 
						"ReportHeader":[
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								"Name":"ReportHeader1",
 | 
				
			||||||
 | 
								"Height":1.79917,
 | 
				
			||||||
 | 
								"Control":[
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Type":"MemoBox",
 | 
				
			||||||
 | 
										"Name":"MemoBox2",
 | 
				
			||||||
 | 
										"Left":7.59354,
 | 
				
			||||||
 | 
										"Top":0.211667,
 | 
				
			||||||
 | 
										"Width":5.60917,
 | 
				
			||||||
 | 
										"Height":1.19063,
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":217500,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"盘点记录"
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								],
 | 
				
			||||||
 | 
								"RepeatOnPage":true
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						]
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,283 @@
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						"Version":"6.3.0.1",
 | 
				
			||||||
 | 
						"Font":{
 | 
				
			||||||
 | 
							"Name":"宋体",
 | 
				
			||||||
 | 
							"Size":105000,
 | 
				
			||||||
 | 
							"Weight":400,
 | 
				
			||||||
 | 
							"Charset":134
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						"Printer":{
 | 
				
			||||||
 | 
							"LeftMargin":0.3175,
 | 
				
			||||||
 | 
							"TopMargin":0.899583,
 | 
				
			||||||
 | 
							"RightMargin":0.396875
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						"DetailGrid":{
 | 
				
			||||||
 | 
							"CenterView":true,
 | 
				
			||||||
 | 
							"AppendBlankRow":true,
 | 
				
			||||||
 | 
							"Recordset":{
 | 
				
			||||||
 | 
								"QuerySQL":"SELECT \r\n  dmr.`drawer_no` AS drawerNo,\r\n  dmr.`col_no` AS colNo,\r\n  dmr.`type` AS `type`,\r\n  CONCAT(dmr.`quantity`,IF(dmr.`type`=32,\"(空瓶)\",\"\")) AS quantity,\r\n  dmr.`manu_no` AS manuNo,\r\n  dmr.`eff_date` AS effDate,\r\n  dmr.`operation_time` AS operationTime,\r\n  di.`drug_name` AS drugName,\r\n  di.`drug_spec` AS drugSpec,\r\n  di.`pack_unit` AS packUnit,\r\n  di.`manufactory` AS manuFactory,\r\n  di.`max_stock` AS baseQuantity,\r\n  dmr.`drug_id` AS drugId,\r\n  ul.`user_name` AS nickname\r\nFROM\r\n  dm_machine_record dmr\r\nLEFT JOIN drug_info di ON di.`drug_id` = dmr.`drug_id`\r\nLEFT JOIN user_list ul ON ul.`id` = dmr.`Operator`\r\nWHERE dmr.`type` in (31, 32)\r\n AND dmr.`machine_id` = :machine_id\r\n AND dmr.`operation_time` > :startDate\r\n AND dmr.`operation_time` < :endDate",
 | 
				
			||||||
 | 
								"Field":[
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"操作人",
 | 
				
			||||||
 | 
										"DBFieldName":"Nickname"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"时间",
 | 
				
			||||||
 | 
										"Type":"DateTime",
 | 
				
			||||||
 | 
										"Format":"yyyy/MM/dd HH:mm:ss",
 | 
				
			||||||
 | 
										"DBFieldName":"operationTime"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"药品名称",
 | 
				
			||||||
 | 
										"DBFieldName":"DrugName"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"数量",
 | 
				
			||||||
 | 
										"DBFieldName":"quantity"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"批次",
 | 
				
			||||||
 | 
										"DBFieldName":"manuNo"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"效期",
 | 
				
			||||||
 | 
										"Type":"DateTime",
 | 
				
			||||||
 | 
										"Format":"yyyy/MM/dd",
 | 
				
			||||||
 | 
										"DBFieldName":"effDate"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"库位",
 | 
				
			||||||
 | 
										"DBFieldName":"drawerNo"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"colNo"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"type2",
 | 
				
			||||||
 | 
										"Type":"Integer",
 | 
				
			||||||
 | 
										"DBFieldName":"type"
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								]
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							"Column":[
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"操作人",
 | 
				
			||||||
 | 
									"Width":2.38125
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"时间",
 | 
				
			||||||
 | 
									"Width":3.78354
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"药品名称",
 | 
				
			||||||
 | 
									"Width":4.63021
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"数量",
 | 
				
			||||||
 | 
									"Width":1.98438
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"批次",
 | 
				
			||||||
 | 
									"Width":2.61938
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"效期",
 | 
				
			||||||
 | 
									"Width":2.38125
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"库位",
 | 
				
			||||||
 | 
									"Width":2.59292
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							],
 | 
				
			||||||
 | 
							"ColumnContent":{
 | 
				
			||||||
 | 
								"Height":1.00542,
 | 
				
			||||||
 | 
								"ColumnContentCell":[
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"操作人",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"操作人"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"时间",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"时间"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"药品名称",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"药品名称"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"数量",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"数量"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"批次",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"批次"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"效期",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"效期"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"库位",
 | 
				
			||||||
 | 
										"FreeCell":true,
 | 
				
			||||||
 | 
										"Control":[
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"FieldBox",
 | 
				
			||||||
 | 
												"Name":"FieldBox1",
 | 
				
			||||||
 | 
												"Left":9.60438,
 | 
				
			||||||
 | 
												"Top":-2.16958,
 | 
				
			||||||
 | 
												"Width":2.80458,
 | 
				
			||||||
 | 
												"Height":0.661458
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"MemoBox",
 | 
				
			||||||
 | 
												"Name":"MemoBox1",
 | 
				
			||||||
 | 
												"Dock":"Fill",
 | 
				
			||||||
 | 
												"Center":"Both",
 | 
				
			||||||
 | 
												"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
												"Text":"[#库位#] - [#colNo#]"
 | 
				
			||||||
 | 
											}
 | 
				
			||||||
 | 
										]
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								]
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							"ColumnTitle":{
 | 
				
			||||||
 | 
								"Height":1.40229,
 | 
				
			||||||
 | 
								"RepeatStyle":"OnPage",
 | 
				
			||||||
 | 
								"ColumnTitleCell":[
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"操作人",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":120000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"操作人"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"时间",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":120000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"时间"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"药品名称",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":120000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"药品名称"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"数量",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":120000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"数量"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"批次",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":120000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"批次"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"效期",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":120000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"效期"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"库位",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":120000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"库位"
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								]
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						"Parameter":[
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								"Name":"startDate",
 | 
				
			||||||
 | 
								"DataType":"DateTime",
 | 
				
			||||||
 | 
								"Format":"yyyy-MM-dd hh:mm:ss",
 | 
				
			||||||
 | 
								"Value":"2023/1/1"
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								"Name":"endDate",
 | 
				
			||||||
 | 
								"DataType":"DateTime",
 | 
				
			||||||
 | 
								"Format":"yyyy-MM-dd hh:mm:ss",
 | 
				
			||||||
 | 
								"Value":"2023/4/28 23:59:59"
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								"Name":"machine_id",
 | 
				
			||||||
 | 
								"Value":"DM3"
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						],
 | 
				
			||||||
 | 
						"ReportHeader":[
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								"Name":"ReportHeader1",
 | 
				
			||||||
 | 
								"Height":1.79917,
 | 
				
			||||||
 | 
								"Control":[
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Type":"MemoBox",
 | 
				
			||||||
 | 
										"Name":"MemoBox2",
 | 
				
			||||||
 | 
										"Left":7.59354,
 | 
				
			||||||
 | 
										"Top":0.211667,
 | 
				
			||||||
 | 
										"Width":5.60917,
 | 
				
			||||||
 | 
										"Height":1.19063,
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":217500,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"归还记录"
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								],
 | 
				
			||||||
 | 
								"RepeatOnPage":true
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						]
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,283 @@
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						"Version":"6.3.0.1",
 | 
				
			||||||
 | 
						"Font":{
 | 
				
			||||||
 | 
							"Name":"宋体",
 | 
				
			||||||
 | 
							"Size":105000,
 | 
				
			||||||
 | 
							"Weight":400,
 | 
				
			||||||
 | 
							"Charset":134
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						"Printer":{
 | 
				
			||||||
 | 
							"LeftMargin":0.3175,
 | 
				
			||||||
 | 
							"TopMargin":0.899583,
 | 
				
			||||||
 | 
							"RightMargin":0.396875
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						"DetailGrid":{
 | 
				
			||||||
 | 
							"CenterView":true,
 | 
				
			||||||
 | 
							"AppendBlankRow":true,
 | 
				
			||||||
 | 
							"Recordset":{
 | 
				
			||||||
 | 
								"QuerySQL":"SELECT \r\n  dmr.`drawer_no` AS drawerNo,\r\n  dmr.`col_no` AS colNo,\r\n  dmr.`type` AS `type`,\r\n  dmr.`quantity` AS quantity,\r\n  dmr.`manu_no` AS manuNo,\r\n  dmr.`eff_date` AS effDate,\r\n  dmr.`operation_time` AS operationTime,\r\n  di.`drug_name` AS drugName,\r\n  di.`drug_spec` AS drugSpec,\r\n  di.`pack_unit` AS packUnit,\r\n  di.`manufactory` AS manuFactory,\r\n  di.`max_stock` AS baseQuantity,\r\n  dmr.`drug_id` AS drugId,\r\n  ul.`user_name` AS nickname\r\nFROM\r\n  dm_machine_record dmr\r\nLEFT JOIN drug_info di ON di.`drug_id` = dmr.`drug_id`\r\nLEFT JOIN user_list ul ON ul.`id` = dmr.`Operator`\r\nWHERE dmr.`type` = 2 \r\n AND dmr.`machine_id` = :machine_id\r\n AND dmr.`operation_time` > :startDate\r\n AND dmr.`operation_time` < :endDate",
 | 
				
			||||||
 | 
								"Field":[
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"操作人",
 | 
				
			||||||
 | 
										"DBFieldName":"Nickname"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"时间",
 | 
				
			||||||
 | 
										"Type":"DateTime",
 | 
				
			||||||
 | 
										"Format":"yyyy/MM/dd HH:mm:ss",
 | 
				
			||||||
 | 
										"DBFieldName":"operationTime"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"药品名称",
 | 
				
			||||||
 | 
										"DBFieldName":"DrugName"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"数量",
 | 
				
			||||||
 | 
										"DBFieldName":"quantity"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"批次",
 | 
				
			||||||
 | 
										"DBFieldName":"manuNo"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"效期",
 | 
				
			||||||
 | 
										"Type":"DateTime",
 | 
				
			||||||
 | 
										"Format":"yyyy/MM/dd",
 | 
				
			||||||
 | 
										"DBFieldName":"effDate"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"库位",
 | 
				
			||||||
 | 
										"DBFieldName":"drawerNo"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"colNo"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"type2",
 | 
				
			||||||
 | 
										"Type":"Integer",
 | 
				
			||||||
 | 
										"DBFieldName":"type"
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								]
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							"Column":[
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"操作人",
 | 
				
			||||||
 | 
									"Width":2.38125
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"时间",
 | 
				
			||||||
 | 
									"Width":3.78354
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"药品名称",
 | 
				
			||||||
 | 
									"Width":4.63021
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"数量",
 | 
				
			||||||
 | 
									"Width":1.98438
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"批次",
 | 
				
			||||||
 | 
									"Width":2.61938
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"效期",
 | 
				
			||||||
 | 
									"Width":2.38125
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"库位",
 | 
				
			||||||
 | 
									"Width":2.59292
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							],
 | 
				
			||||||
 | 
							"ColumnContent":{
 | 
				
			||||||
 | 
								"Height":1.00542,
 | 
				
			||||||
 | 
								"ColumnContentCell":[
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"操作人",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"操作人"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"时间",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"时间"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"药品名称",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"药品名称"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"数量",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"数量"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"批次",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"批次"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"效期",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"效期"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"库位",
 | 
				
			||||||
 | 
										"FreeCell":true,
 | 
				
			||||||
 | 
										"Control":[
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"FieldBox",
 | 
				
			||||||
 | 
												"Name":"FieldBox1",
 | 
				
			||||||
 | 
												"Left":9.60438,
 | 
				
			||||||
 | 
												"Top":-2.16958,
 | 
				
			||||||
 | 
												"Width":2.80458,
 | 
				
			||||||
 | 
												"Height":0.661458
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"MemoBox",
 | 
				
			||||||
 | 
												"Name":"MemoBox1",
 | 
				
			||||||
 | 
												"Dock":"Fill",
 | 
				
			||||||
 | 
												"Center":"Both",
 | 
				
			||||||
 | 
												"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
												"Text":"[#库位#] - [#colNo#]"
 | 
				
			||||||
 | 
											}
 | 
				
			||||||
 | 
										]
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								]
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							"ColumnTitle":{
 | 
				
			||||||
 | 
								"Height":1.40229,
 | 
				
			||||||
 | 
								"RepeatStyle":"OnPage",
 | 
				
			||||||
 | 
								"ColumnTitleCell":[
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"操作人",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":120000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"操作人"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"时间",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":120000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"时间"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"药品名称",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":120000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"药品名称"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"数量",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":120000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"数量"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"批次",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":120000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"批次"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"效期",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":120000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"效期"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"库位",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":120000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"库位"
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								]
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						"Parameter":[
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								"Name":"startDate",
 | 
				
			||||||
 | 
								"DataType":"DateTime",
 | 
				
			||||||
 | 
								"Format":"yyyy-MM-dd hh:mm:ss",
 | 
				
			||||||
 | 
								"Value":"2023/1/1"
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								"Name":"endDate",
 | 
				
			||||||
 | 
								"DataType":"DateTime",
 | 
				
			||||||
 | 
								"Format":"yyyy-MM-dd hh:mm:ss",
 | 
				
			||||||
 | 
								"Value":"2023/4/28 23:59:59"
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								"Name":"machine_id",
 | 
				
			||||||
 | 
								"Value":"DM3"
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						],
 | 
				
			||||||
 | 
						"ReportHeader":[
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								"Name":"ReportHeader1",
 | 
				
			||||||
 | 
								"Height":1.79917,
 | 
				
			||||||
 | 
								"Control":[
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Type":"MemoBox",
 | 
				
			||||||
 | 
										"Name":"MemoBox2",
 | 
				
			||||||
 | 
										"Left":7.59354,
 | 
				
			||||||
 | 
										"Top":0.211667,
 | 
				
			||||||
 | 
										"Width":5.60917,
 | 
				
			||||||
 | 
										"Height":1.19063,
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":217500,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"出库记录"
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								],
 | 
				
			||||||
 | 
								"RepeatOnPage":true
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						]
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,633 @@
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						"Version":"6.3.0.1",
 | 
				
			||||||
 | 
						"Font":{
 | 
				
			||||||
 | 
							"Name":"宋体",
 | 
				
			||||||
 | 
							"Size":105000,
 | 
				
			||||||
 | 
							"Weight":400,
 | 
				
			||||||
 | 
							"Charset":134
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						"Printer":{
 | 
				
			||||||
 | 
							"Oriention":"Landscape",
 | 
				
			||||||
 | 
							"TopMargin":0.3175,
 | 
				
			||||||
 | 
							"RightMargin":0.8996,
 | 
				
			||||||
 | 
							"BottomMargin":0.3969
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						"DetailGrid":{
 | 
				
			||||||
 | 
							"CenterView":true,
 | 
				
			||||||
 | 
							"AppendBlankRow":true,
 | 
				
			||||||
 | 
							"Recordset":{
 | 
				
			||||||
 | 
								"QuerySQL":"SELECT \r\n  dmr.`drawer_no` AS drawerNo,\r\n  dmr.`col_no` AS colNo,\r\n  dmr.`type` AS `type`,\r\n  dmr.`quantity` AS quantity,\r\n  dmr.`manu_no` AS manuNo,\r\n  dmr.`eff_date` AS effDate,\r\n  dmr.`operation_time` AS operationTime,\r\n  di.`drug_name` AS drugName,\r\n  di.`drug_spec` AS drugSpec,\r\n  di.`pack_unit` AS packUnit,\r\n  di.`manufactory` AS manuFactory,\r\n  di.`max_stock` AS baseQuantity,\r\n  dmr.`drug_id` AS drugId,\r\n  ul.`user_name` AS nickname\r\nFROM\r\n  dm_machine_record dmr\r\nLEFT JOIN drug_info di ON di.`drug_id` = dmr.`drug_id`\r\nLEFT JOIN user_list ul ON ul.`id` = dmr.`Operator`\r\nWHERE dmr.`type` = 2 \r\n AND dmr.`machine_id` = :machine_id\r\n AND dmr.`operation_time` > :startDate\r\n AND dmr.`operation_time` < :endDate",
 | 
				
			||||||
 | 
								"Field":[
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"患者姓名",
 | 
				
			||||||
 | 
										"DBFieldName":"p_name"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"性别",
 | 
				
			||||||
 | 
										"DBFieldName":"sex"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"年龄",
 | 
				
			||||||
 | 
										"Type":"Integer",
 | 
				
			||||||
 | 
										"DBFieldName":"age"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"身份证号",
 | 
				
			||||||
 | 
										"DBFieldName":"id_number"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"病历号",
 | 
				
			||||||
 | 
										"DBFieldName":"patientno"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"疾病名称",
 | 
				
			||||||
 | 
										"Format":"yyyy/MM/dd",
 | 
				
			||||||
 | 
										"DBFieldName":"disease"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"药品ID",
 | 
				
			||||||
 | 
										"DBFieldName":"drugId"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"数量",
 | 
				
			||||||
 | 
										"Type":"Integer",
 | 
				
			||||||
 | 
										"DBFieldName":"quantity"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"处方医生",
 | 
				
			||||||
 | 
										"DBFieldName":"doctor_name"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"处方编号",
 | 
				
			||||||
 | 
										"DBFieldName":"order_no"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"处方日期",
 | 
				
			||||||
 | 
										"DBFieldName":"order_date"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"发药人",
 | 
				
			||||||
 | 
										"DBFieldName":"nickname"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"复核人",
 | 
				
			||||||
 | 
										"DBFieldName":"reviewNickname"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"批号",
 | 
				
			||||||
 | 
										"DBFieldName":"manuNo"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"麻醉卡号"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"代办人姓名"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"代办人身份证号"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"编号"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"药品名称",
 | 
				
			||||||
 | 
										"DBFieldName":"drugName"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"规格",
 | 
				
			||||||
 | 
										"DBFieldName":"drugSpec"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"单位",
 | 
				
			||||||
 | 
										"DBFieldName":"packUnit"
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								]
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							"Column":[
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"患者姓名",
 | 
				
			||||||
 | 
									"Width":2.38125
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"性别",
 | 
				
			||||||
 | 
									"Width":1.00542
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"年龄",
 | 
				
			||||||
 | 
									"Width":0.978958
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"身份证号",
 | 
				
			||||||
 | 
									"Width":5.00063
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"病历号",
 | 
				
			||||||
 | 
									"Width":2.77813
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"疾病名称",
 | 
				
			||||||
 | 
									"Width":3.01625
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"药品ID",
 | 
				
			||||||
 | 
									"Width":2.59292
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"数量",
 | 
				
			||||||
 | 
									"Width":1.69333
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"处方医生",
 | 
				
			||||||
 | 
									"Width":2.32833
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"处方编号",
 | 
				
			||||||
 | 
									"Width":2.80458
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"发药人",
 | 
				
			||||||
 | 
									"Width":3.20146
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"复核人",
 | 
				
			||||||
 | 
									"Width":1.69333
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"批号",
 | 
				
			||||||
 | 
									"Width":1.69333
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"麻醉卡号",
 | 
				
			||||||
 | 
									"Width":3.59833
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"代办人姓名",
 | 
				
			||||||
 | 
									"Width":1.69333
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"代办人身份证号",
 | 
				
			||||||
 | 
									"Width":1.69333
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"Column10",
 | 
				
			||||||
 | 
									"Width":2.14313
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"Column11",
 | 
				
			||||||
 | 
									"Width":1.69333
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							],
 | 
				
			||||||
 | 
							"ColumnContent":{
 | 
				
			||||||
 | 
								"Height":1.00542,
 | 
				
			||||||
 | 
								"ColumnContentCell":[
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"患者姓名",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"患者姓名"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"性别",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"性别"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"年龄",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"年龄"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"身份证号",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"身份证号"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"病历号",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"病历号"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"疾病名称",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"疾病名称"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"药品ID",
 | 
				
			||||||
 | 
										"DataField":"药品ID"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"数量",
 | 
				
			||||||
 | 
										"DataField":"数量"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"处方医生",
 | 
				
			||||||
 | 
										"DataField":"处方医生"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"处方编号",
 | 
				
			||||||
 | 
										"DataField":"处方编号"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"发药人",
 | 
				
			||||||
 | 
										"DataField":"处方日期"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"复核人",
 | 
				
			||||||
 | 
										"DataField":"发药人"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"批号",
 | 
				
			||||||
 | 
										"DataField":"复核人"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"麻醉卡号",
 | 
				
			||||||
 | 
										"DataField":"批号"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"代办人姓名",
 | 
				
			||||||
 | 
										"DataField":"麻醉卡号"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"代办人身份证号",
 | 
				
			||||||
 | 
										"DataField":"代办人姓名"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"Column10",
 | 
				
			||||||
 | 
										"DataField":"代办人身份证号"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"Column11"
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								]
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							"ColumnTitle":{
 | 
				
			||||||
 | 
								"Height":1.40229,
 | 
				
			||||||
 | 
								"RepeatStyle":"OnGroupHeaderPage",
 | 
				
			||||||
 | 
								"ColumnTitleCell":[
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"患者姓名",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":120000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"患者\r\n姓名"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"性别",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":120000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"性\r\n别"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"年龄",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":120000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"年\r\n龄"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"身份证号",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":120000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"身份证号"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"病历号",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":120000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"病历号"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"疾病名称",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":120000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"疾病名称"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"药品ID",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":120000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"药品ID"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"数量",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":120000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"数\r\n量"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"处方医生",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":120000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"处方\r\n医生"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"处方编号",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":120000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"处方编号"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"发药人",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":120000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"处方日期"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"复核人",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":120000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"发药人"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"批号",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":120000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"复核人"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"麻醉卡号",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":120000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"批号"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"代办人姓名",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":120000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"麻醉卡号"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"代办人身份证号",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":120000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"代办人\r\n姓名"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"Column10",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":120000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"代办人\r\n身份证"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"Column11",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":120000,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"编号"
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								]
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							"Group":[
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"Group1",
 | 
				
			||||||
 | 
									"ByFields":"药品ID",
 | 
				
			||||||
 | 
									"GroupHeader":{
 | 
				
			||||||
 | 
										"PrintGridBorder":false,
 | 
				
			||||||
 | 
										"RepeatOnPage":true,
 | 
				
			||||||
 | 
										"Control":[
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"StaticBox",
 | 
				
			||||||
 | 
												"Name":"StaticBox16",
 | 
				
			||||||
 | 
												"Top":0.0529167,
 | 
				
			||||||
 | 
												"Width":1.19063,
 | 
				
			||||||
 | 
												"Height":0.978958,
 | 
				
			||||||
 | 
												"Font":{
 | 
				
			||||||
 | 
													"Name":"宋体",
 | 
				
			||||||
 | 
													"Size":105000,
 | 
				
			||||||
 | 
													"Bold":true,
 | 
				
			||||||
 | 
													"Charset":134
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
												"Text":"药品名称:"
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"FieldBox",
 | 
				
			||||||
 | 
												"Name":"FieldBox7",
 | 
				
			||||||
 | 
												"Left":1.16417,
 | 
				
			||||||
 | 
												"Top":0.0529167,
 | 
				
			||||||
 | 
												"Width":5.63563,
 | 
				
			||||||
 | 
												"Height":0.978958,
 | 
				
			||||||
 | 
												"Font":{
 | 
				
			||||||
 | 
													"Name":"宋体",
 | 
				
			||||||
 | 
													"Size":105000,
 | 
				
			||||||
 | 
													"Bold":true,
 | 
				
			||||||
 | 
													"Charset":134
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
												"DataField":"药品名称"
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"StaticBox",
 | 
				
			||||||
 | 
												"Name":"StaticBox17",
 | 
				
			||||||
 | 
												"Left":6.93208,
 | 
				
			||||||
 | 
												"Top":0.0529167,
 | 
				
			||||||
 | 
												"Width":1.11125,
 | 
				
			||||||
 | 
												"Height":0.978958,
 | 
				
			||||||
 | 
												"Font":{
 | 
				
			||||||
 | 
													"Name":"宋体",
 | 
				
			||||||
 | 
													"Size":105000,
 | 
				
			||||||
 | 
													"Bold":true,
 | 
				
			||||||
 | 
													"Charset":134
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
												"Text":"规格:"
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"FieldBox",
 | 
				
			||||||
 | 
												"Name":"FieldBox8",
 | 
				
			||||||
 | 
												"Left":8.01688,
 | 
				
			||||||
 | 
												"Top":0.0529167,
 | 
				
			||||||
 | 
												"Width":3.175,
 | 
				
			||||||
 | 
												"Height":0.978958,
 | 
				
			||||||
 | 
												"Font":{
 | 
				
			||||||
 | 
													"Name":"宋体",
 | 
				
			||||||
 | 
													"Size":105000,
 | 
				
			||||||
 | 
													"Bold":true,
 | 
				
			||||||
 | 
													"Charset":134
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
												"DataField":"规格"
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"StaticBox",
 | 
				
			||||||
 | 
												"Name":"StaticBox15",
 | 
				
			||||||
 | 
												"Left":11.59,
 | 
				
			||||||
 | 
												"Top":0.05,
 | 
				
			||||||
 | 
												"Width":2.01083,
 | 
				
			||||||
 | 
												"Height":0.79375,
 | 
				
			||||||
 | 
												"Font":{
 | 
				
			||||||
 | 
													"Name":"宋体",
 | 
				
			||||||
 | 
													"Size":105000,
 | 
				
			||||||
 | 
													"Bold":true,
 | 
				
			||||||
 | 
													"Charset":134
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
												"Text":"单位:"
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"FieldBox",
 | 
				
			||||||
 | 
												"Name":"FieldBox9",
 | 
				
			||||||
 | 
												"Left":12.78,
 | 
				
			||||||
 | 
												"Top":0.05,
 | 
				
			||||||
 | 
												"Width":1.88,
 | 
				
			||||||
 | 
												"Height":0.98,
 | 
				
			||||||
 | 
												"Font":{
 | 
				
			||||||
 | 
													"Name":"宋体",
 | 
				
			||||||
 | 
													"Size":105000,
 | 
				
			||||||
 | 
													"Bold":true,
 | 
				
			||||||
 | 
													"Charset":134
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
												"DataField":"单位"
 | 
				
			||||||
 | 
											}
 | 
				
			||||||
 | 
										],
 | 
				
			||||||
 | 
										"NewPageColumn":"Before"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									"GroupFooter":{
 | 
				
			||||||
 | 
										"Height":0.635
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							]
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						"Parameter":[
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								"Name":"startDate",
 | 
				
			||||||
 | 
								"DataType":"DateTime",
 | 
				
			||||||
 | 
								"Format":"yyyy-MM-dd hh:mm:ss",
 | 
				
			||||||
 | 
								"Value":"2023/1/1"
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								"Name":"endDate",
 | 
				
			||||||
 | 
								"DataType":"DateTime",
 | 
				
			||||||
 | 
								"Format":"yyyy-MM-dd hh:mm:ss",
 | 
				
			||||||
 | 
								"Value":"2023/4/28 23:59:59"
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								"Name":"machine_id",
 | 
				
			||||||
 | 
								"Value":"DM3"
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						],
 | 
				
			||||||
 | 
						"ReportHeader":[
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								"Name":"ReportHeader1",
 | 
				
			||||||
 | 
								"Height":1.79917,
 | 
				
			||||||
 | 
								"Control":[
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Type":"MemoBox",
 | 
				
			||||||
 | 
										"Name":"MemoBox2",
 | 
				
			||||||
 | 
										"Left":7.59354,
 | 
				
			||||||
 | 
										"Top":0.211667,
 | 
				
			||||||
 | 
										"Width":5.60917,
 | 
				
			||||||
 | 
										"Height":1.19063,
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":217500,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"发药登记表"
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								],
 | 
				
			||||||
 | 
								"RepeatOnPage":true
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						]
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,346 @@
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						"Version":"6.3.0.1",
 | 
				
			||||||
 | 
						"Font":{
 | 
				
			||||||
 | 
							"Name":"宋体",
 | 
				
			||||||
 | 
							"Size":105000,
 | 
				
			||||||
 | 
							"Weight":400,
 | 
				
			||||||
 | 
							"Charset":134
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						"Printer":{
 | 
				
			||||||
 | 
							"Oriention":"Landscape"
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						"DetailGrid":{
 | 
				
			||||||
 | 
							"CenterView":true,
 | 
				
			||||||
 | 
							"PrintAdaptMethod":"ResizeToFit",
 | 
				
			||||||
 | 
							"AppendBlankRow":true,
 | 
				
			||||||
 | 
							"Recordset":{
 | 
				
			||||||
 | 
								"QuerySQL":"SELECT \r\n  cl.`row_no` AS drawerNo,\r\n  cl.`col_no` AS colNo,\r\n  cl.`quantity` AS quantity,\r\n  cl.`manu_no` AS manuNo,\r\n  cl.`eff_date` AS effDate,\r\n  di.`drug_name` AS drugName,\r\n  di.`drug_spec` AS drugSpec,\r\n  di.`pack_unit` AS packUnit,\r\n  di.`manufactory` AS manuFactory,\r\n  di.`max_stock` AS baseQuantity,\r\n  cl.`drug_id` AS drugId\r\nFROM\r\n  channel_stock cl\r\nINNER JOIN drug_info di ON di.`drug_id` = cl.`drug_id`\r\nWHERE cl.`machine_id` =  :machine_id\r\n AND cl.`drawer_type` = 1\r\n ORDER BY cl.`drug_id`",
 | 
				
			||||||
 | 
								"Field":[
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"drugName"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"drugSpec"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"manuFactory"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"quantityCount"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"manuNo"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"effDate"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"quantity",
 | 
				
			||||||
 | 
										"Type":"Integer",
 | 
				
			||||||
 | 
										"Format":"0"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"drawerNo"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"drugId"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"baseQuantity",
 | 
				
			||||||
 | 
										"Type":"Integer"
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								]
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							"Column":[
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"drugName",
 | 
				
			||||||
 | 
									"Width":5.37104
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"drugSpec"
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"manuFactory",
 | 
				
			||||||
 | 
									"Width":4.60375
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"Column1"
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"quantityCount",
 | 
				
			||||||
 | 
									"Width":2.59292
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"manuNo"
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"effDate"
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"quantity",
 | 
				
			||||||
 | 
									"Width":2.43417
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							],
 | 
				
			||||||
 | 
							"ColumnContent":{
 | 
				
			||||||
 | 
								"Height":0.79375,
 | 
				
			||||||
 | 
								"ColumnContentCell":[
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"drugName",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"drugName"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"drugSpec",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"drugSpec"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"manuFactory",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"manuFactory"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"Column1",
 | 
				
			||||||
 | 
										"FreeCell":true
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"quantityCount",
 | 
				
			||||||
 | 
										"FreeCell":true
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"manuNo",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"manuNo"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"effDate",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"effDate"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"quantity",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"quantity"
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								]
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							"ColumnTitle":{
 | 
				
			||||||
 | 
								"Height":1.19063,
 | 
				
			||||||
 | 
								"RepeatStyle":"OnPage",
 | 
				
			||||||
 | 
								"ColumnTitleCell":[
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"drugName",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":142500,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"药品名称"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"drugSpec",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":142500,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"规格"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"manuFactory",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":142500,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"厂家"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"Column1",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":142500,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"基数"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"quantityCount",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":142500,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"总库存"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"manuNo",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":142500,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"批次"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"effDate",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":142500,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"效期"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"quantity",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":142500,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"数量"
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								]
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							"Group":[
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"drugId",
 | 
				
			||||||
 | 
									"ByFields":"drugId",
 | 
				
			||||||
 | 
									"GroupHeader":{
 | 
				
			||||||
 | 
										"Visible":false,
 | 
				
			||||||
 | 
										"Height":0.79375,
 | 
				
			||||||
 | 
										"RepeatOnPage":true,
 | 
				
			||||||
 | 
										"OccupyColumn":true,
 | 
				
			||||||
 | 
										"IncludeFooter":true,
 | 
				
			||||||
 | 
										"OccupiedColumns":"drugName;drugSpec;manuFactory;quantityCount;Column1",
 | 
				
			||||||
 | 
										"VAlign":"Middle"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									"GroupFooter":{
 | 
				
			||||||
 | 
										"Visible":false,
 | 
				
			||||||
 | 
										"Height":0.396875
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"Group1",
 | 
				
			||||||
 | 
									"ByFields":"drugId",
 | 
				
			||||||
 | 
									"GroupHeader":{
 | 
				
			||||||
 | 
										"Control":[
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"MemoBox",
 | 
				
			||||||
 | 
												"Name":"MemoBox3",
 | 
				
			||||||
 | 
												"AlignColumn":"drugName",
 | 
				
			||||||
 | 
												"Width":5.3975,
 | 
				
			||||||
 | 
												"Height":1.19063,
 | 
				
			||||||
 | 
												"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
												"Text":"[#drugName#]"
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"MemoBox",
 | 
				
			||||||
 | 
												"Name":"MemoBox4",
 | 
				
			||||||
 | 
												"AlignColumn":"drugSpec",
 | 
				
			||||||
 | 
												"Left":5.37104,
 | 
				
			||||||
 | 
												"Width":3.01625,
 | 
				
			||||||
 | 
												"Height":1.19063,
 | 
				
			||||||
 | 
												"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
												"Text":"[#drugSpec#]"
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"MemoBox",
 | 
				
			||||||
 | 
												"Name":"MemoBox5",
 | 
				
			||||||
 | 
												"AlignColumn":"manuFactory",
 | 
				
			||||||
 | 
												"Left":8.36083,
 | 
				
			||||||
 | 
												"Width":4.63021,
 | 
				
			||||||
 | 
												"Height":1.19063,
 | 
				
			||||||
 | 
												"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
												"Text":"[#manuFactory#]"
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"MemoBox",
 | 
				
			||||||
 | 
												"Name":"MemoBox6",
 | 
				
			||||||
 | 
												"AlignColumn":"Column1",
 | 
				
			||||||
 | 
												"Left":12.9646,
 | 
				
			||||||
 | 
												"Width":3.01625,
 | 
				
			||||||
 | 
												"Height":1.19063,
 | 
				
			||||||
 | 
												"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
												"Text":"[#baseQuantity#]"
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"SummaryBox",
 | 
				
			||||||
 | 
												"Name":"SummaryBox1",
 | 
				
			||||||
 | 
												"AlignColumn":"quantityCount",
 | 
				
			||||||
 | 
												"Left":15.9544,
 | 
				
			||||||
 | 
												"Width":2.61938,
 | 
				
			||||||
 | 
												"Height":1.19063,
 | 
				
			||||||
 | 
												"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
												"DataField":"quantity",
 | 
				
			||||||
 | 
												"Format":"0"
 | 
				
			||||||
 | 
											}
 | 
				
			||||||
 | 
										],
 | 
				
			||||||
 | 
										"OccupyColumn":true,
 | 
				
			||||||
 | 
										"SameAsColumn":false,
 | 
				
			||||||
 | 
										"OccupiedColumns":"Column1;drugName;drugSpec;manuFactory;quantityCount",
 | 
				
			||||||
 | 
										"VAlign":"Middle"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									"GroupFooter":{
 | 
				
			||||||
 | 
										"Visible":false
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							]
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						"Parameter":[
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								"Name":"machine_id",
 | 
				
			||||||
 | 
								"Value":"DM3"
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						],
 | 
				
			||||||
 | 
						"ReportHeader":[
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								"Name":"ReportHeader1",
 | 
				
			||||||
 | 
								"Height":2.40771,
 | 
				
			||||||
 | 
								"Control":[
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Type":"StaticBox",
 | 
				
			||||||
 | 
										"Name":"StaticBox1",
 | 
				
			||||||
 | 
										"Center":"Horizontal",
 | 
				
			||||||
 | 
										"Left":8.89,
 | 
				
			||||||
 | 
										"Top":0.608542,
 | 
				
			||||||
 | 
										"Width":9.18104,
 | 
				
			||||||
 | 
										"Height":1.21708,
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":217500,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"毒麻药品库存信息"
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								],
 | 
				
			||||||
 | 
								"RepeatOnPage":true
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						]
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,558 @@
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						"Version":"6.8.1.1",
 | 
				
			||||||
 | 
						"Font":{
 | 
				
			||||||
 | 
							"Name":"宋体",
 | 
				
			||||||
 | 
							"Size":105000,
 | 
				
			||||||
 | 
							"Weight":400,
 | 
				
			||||||
 | 
							"Charset":134
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						"Printer":{
 | 
				
			||||||
 | 
							"Oriention":"Landscape",
 | 
				
			||||||
 | 
							"LeftMargin":1,
 | 
				
			||||||
 | 
							"TopMargin":1.42875,
 | 
				
			||||||
 | 
							"RightMargin":1,
 | 
				
			||||||
 | 
							"BottomMargin":1.8
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						"DetailGrid":{
 | 
				
			||||||
 | 
							"CenterView":true,
 | 
				
			||||||
 | 
							"IsCrossTab":true,
 | 
				
			||||||
 | 
							"FixCols":2,
 | 
				
			||||||
 | 
							"AppendBlankRow":true,
 | 
				
			||||||
 | 
							"Recordset":{
 | 
				
			||||||
 | 
								"Field":[
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"DMYear"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"DMMonth"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"DMDay"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"TotalBaseNum"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"OperationTime"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"SendUser"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"ReceiveUser"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"SendNum"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"InfactNum"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"EmptyNum"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"ReturnTime"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"ReturnUser"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"ReturnReceiveUser"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"AddUser"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"AddCheckUser"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"drugId"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"drugName"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Name":"drugSpec"
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								]
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							"Column":[
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"Column4"
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"Column6"
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"Column31"
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"Column14"
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"Column19"
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"Column20"
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"Column22"
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"Column23"
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"Column24"
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							],
 | 
				
			||||||
 | 
							"ColumnContent":{
 | 
				
			||||||
 | 
								"Height":2.19604,
 | 
				
			||||||
 | 
								"ColumnContentCell":[
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"Column4",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"OperationTime"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"Column6",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"SendUser"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"Column31",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"ReceiveUser"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"Column14",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"SendNum"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"Column19",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"InfactNum"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"Column20",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"EmptyNum"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"Column22",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"ReturnTime"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"Column23",
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"DataField":"ReturnUser"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Column":"Column24",
 | 
				
			||||||
 | 
										"DataField":"ReturnReceiveUser"
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								]
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							"ColumnTitle":{
 | 
				
			||||||
 | 
								"Height":3.96875,
 | 
				
			||||||
 | 
								"RepeatStyle":"OnGroupHeaderPage",
 | 
				
			||||||
 | 
								"ColumnTitleCell":[
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":true,
 | 
				
			||||||
 | 
										"Name":"Column3",
 | 
				
			||||||
 | 
										"ColumnTitleCell":[
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"GroupTitle":true,
 | 
				
			||||||
 | 
												"Name":"Column12",
 | 
				
			||||||
 | 
												"ColumnTitleCell":[
 | 
				
			||||||
 | 
													{
 | 
				
			||||||
 | 
														"GroupTitle":true,
 | 
				
			||||||
 | 
														"Name":"Column25",
 | 
				
			||||||
 | 
														"ColumnTitleCell":[
 | 
				
			||||||
 | 
															{
 | 
				
			||||||
 | 
																"GroupTitle":true,
 | 
				
			||||||
 | 
																"Name":"Column26",
 | 
				
			||||||
 | 
																"ColumnTitleCell":[
 | 
				
			||||||
 | 
																	{
 | 
				
			||||||
 | 
																		"GroupTitle":false,
 | 
				
			||||||
 | 
																		"Column":"Column4",
 | 
				
			||||||
 | 
																		"TextAlign":"BottomCenter",
 | 
				
			||||||
 | 
																		"Text":"发药时间"
 | 
				
			||||||
 | 
																	},
 | 
				
			||||||
 | 
																	{
 | 
				
			||||||
 | 
																		"GroupTitle":false,
 | 
				
			||||||
 | 
																		"Column":"Column6",
 | 
				
			||||||
 | 
																		"TextAlign":"BottomCenter",
 | 
				
			||||||
 | 
																		"Text":"发药者"
 | 
				
			||||||
 | 
																	}
 | 
				
			||||||
 | 
																],
 | 
				
			||||||
 | 
																"TextAlign":"MiddleRight",
 | 
				
			||||||
 | 
																"Text":"交接状态",
 | 
				
			||||||
 | 
																"BorderCustom":true,
 | 
				
			||||||
 | 
																"Border":{
 | 
				
			||||||
 | 
																	"Styles":"[DrawBottom]"
 | 
				
			||||||
 | 
																}
 | 
				
			||||||
 | 
															}
 | 
				
			||||||
 | 
														]
 | 
				
			||||||
 | 
													}
 | 
				
			||||||
 | 
												],
 | 
				
			||||||
 | 
												"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
												"Text":"药品信息",
 | 
				
			||||||
 | 
												"BorderCustom":true,
 | 
				
			||||||
 | 
												"Border":{
 | 
				
			||||||
 | 
													"Styles":"[DrawRight]"
 | 
				
			||||||
 | 
												}
 | 
				
			||||||
 | 
											}
 | 
				
			||||||
 | 
										],
 | 
				
			||||||
 | 
										"BorderCustom":true,
 | 
				
			||||||
 | 
										"Border":{
 | 
				
			||||||
 | 
											"Styles":"[DrawRight]"
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":true,
 | 
				
			||||||
 | 
										"Name":"Column27",
 | 
				
			||||||
 | 
										"ColumnTitleCell":[
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"GroupTitle":true,
 | 
				
			||||||
 | 
												"Name":"Column28",
 | 
				
			||||||
 | 
												"ColumnTitleCell":[
 | 
				
			||||||
 | 
													{
 | 
				
			||||||
 | 
														"GroupTitle":true,
 | 
				
			||||||
 | 
														"Name":"Column29",
 | 
				
			||||||
 | 
														"ColumnTitleCell":[
 | 
				
			||||||
 | 
															{
 | 
				
			||||||
 | 
																"GroupTitle":true,
 | 
				
			||||||
 | 
																"Name":"Column30",
 | 
				
			||||||
 | 
																"ColumnTitleCell":[
 | 
				
			||||||
 | 
																	{
 | 
				
			||||||
 | 
																		"GroupTitle":false,
 | 
				
			||||||
 | 
																		"Column":"Column31",
 | 
				
			||||||
 | 
																		"TextAlign":"BottomCenter",
 | 
				
			||||||
 | 
																		"Text":"领药者"
 | 
				
			||||||
 | 
																	}
 | 
				
			||||||
 | 
																]
 | 
				
			||||||
 | 
															}
 | 
				
			||||||
 | 
														],
 | 
				
			||||||
 | 
														"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
														"Text":"总基数"
 | 
				
			||||||
 | 
													}
 | 
				
			||||||
 | 
												],
 | 
				
			||||||
 | 
												"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
												"Text":"规格"
 | 
				
			||||||
 | 
											}
 | 
				
			||||||
 | 
										],
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"品名"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":true,
 | 
				
			||||||
 | 
										"Name":"Column32",
 | 
				
			||||||
 | 
										"ColumnTitleCell":[
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"GroupTitle":true,
 | 
				
			||||||
 | 
												"Name":"Column33",
 | 
				
			||||||
 | 
												"ColumnTitleCell":[
 | 
				
			||||||
 | 
													{
 | 
				
			||||||
 | 
														"GroupTitle":true,
 | 
				
			||||||
 | 
														"Name":"Column34",
 | 
				
			||||||
 | 
														"ColumnTitleCell":[
 | 
				
			||||||
 | 
															{
 | 
				
			||||||
 | 
																"GroupTitle":true,
 | 
				
			||||||
 | 
																"Name":"Column35",
 | 
				
			||||||
 | 
																"ColumnTitleCell":[
 | 
				
			||||||
 | 
																	{
 | 
				
			||||||
 | 
																		"GroupTitle":false,
 | 
				
			||||||
 | 
																		"Column":"Column14",
 | 
				
			||||||
 | 
																		"TextAlign":"BottomCenter",
 | 
				
			||||||
 | 
																		"Text":"实发数"
 | 
				
			||||||
 | 
																	},
 | 
				
			||||||
 | 
																	{
 | 
				
			||||||
 | 
																		"GroupTitle":false,
 | 
				
			||||||
 | 
																		"Column":"Column19",
 | 
				
			||||||
 | 
																		"TextAlign":"BottomCenter",
 | 
				
			||||||
 | 
																		"Text":"实物数"
 | 
				
			||||||
 | 
																	},
 | 
				
			||||||
 | 
																	{
 | 
				
			||||||
 | 
																		"GroupTitle":false,
 | 
				
			||||||
 | 
																		"Column":"Column20",
 | 
				
			||||||
 | 
																		"TextAlign":"BottomCenter",
 | 
				
			||||||
 | 
																		"Text":"空安瓿"
 | 
				
			||||||
 | 
																	}
 | 
				
			||||||
 | 
																],
 | 
				
			||||||
 | 
																"FreeCell":true,
 | 
				
			||||||
 | 
																"Control":[
 | 
				
			||||||
 | 
																	{
 | 
				
			||||||
 | 
																		"Type":"StaticBox",
 | 
				
			||||||
 | 
																		"Name":"StaticBox1",
 | 
				
			||||||
 | 
																		"Width":2.98979,
 | 
				
			||||||
 | 
																		"Height":1.00542,
 | 
				
			||||||
 | 
																		"Border":{
 | 
				
			||||||
 | 
																			"Styles":"[DrawRight]"
 | 
				
			||||||
 | 
																		},
 | 
				
			||||||
 | 
																		"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
																		"Text":"发药"
 | 
				
			||||||
 | 
																	},
 | 
				
			||||||
 | 
																	{
 | 
				
			||||||
 | 
																		"Type":"StaticBox",
 | 
				
			||||||
 | 
																		"Name":"StaticBox2",
 | 
				
			||||||
 | 
																		"Left":2.98979,
 | 
				
			||||||
 | 
																		"Width":6.00604,
 | 
				
			||||||
 | 
																		"Height":1.00542,
 | 
				
			||||||
 | 
																		"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
																		"Text":"还药"
 | 
				
			||||||
 | 
																	}
 | 
				
			||||||
 | 
																]
 | 
				
			||||||
 | 
															}
 | 
				
			||||||
 | 
														],
 | 
				
			||||||
 | 
														"Text":"[#TotalNum#]"
 | 
				
			||||||
 | 
													}
 | 
				
			||||||
 | 
												],
 | 
				
			||||||
 | 
												"Text":"[#drugSpec#]"
 | 
				
			||||||
 | 
											}
 | 
				
			||||||
 | 
										],
 | 
				
			||||||
 | 
										"Text":"[drugName]"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"Column22",
 | 
				
			||||||
 | 
										"TextAlign":"BottomCenter",
 | 
				
			||||||
 | 
										"Text":"还药时间"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"Column23",
 | 
				
			||||||
 | 
										"TextAlign":"BottomCenter",
 | 
				
			||||||
 | 
										"Text":"还药者"
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"GroupTitle":false,
 | 
				
			||||||
 | 
										"Column":"Column24",
 | 
				
			||||||
 | 
										"TextAlign":"BottomCenter",
 | 
				
			||||||
 | 
										"Text":"接收者"
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								]
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							"Group":[
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									"Name":"Group1",
 | 
				
			||||||
 | 
									"ByFields":"drugId",
 | 
				
			||||||
 | 
									"GroupHeader":{
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									"GroupFooter":{
 | 
				
			||||||
 | 
										"Height":2.40771,
 | 
				
			||||||
 | 
										"Control":[
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"StaticBox",
 | 
				
			||||||
 | 
												"Name":"StaticBox4",
 | 
				
			||||||
 | 
												"AlignColumn":"Column31",
 | 
				
			||||||
 | 
												"AlignColumnEx":"Column4",
 | 
				
			||||||
 | 
												"Width":8.96938,
 | 
				
			||||||
 | 
												"Height":2,
 | 
				
			||||||
 | 
												"Border":{
 | 
				
			||||||
 | 
													"Styles":"[DrawRight]"
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
												"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
												"Text":"日消耗总计(支)"
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"StaticBox",
 | 
				
			||||||
 | 
												"Name":"StaticBox5",
 | 
				
			||||||
 | 
												"AlignColumn":"Column14",
 | 
				
			||||||
 | 
												"Left":8.96938,
 | 
				
			||||||
 | 
												"Width":2.98979,
 | 
				
			||||||
 | 
												"Height":1,
 | 
				
			||||||
 | 
												"Border":{
 | 
				
			||||||
 | 
													"Styles":"[DrawRight|DrawBottom]"
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
												"TextAlign":"BottomCenter",
 | 
				
			||||||
 | 
												"Text":"安瓿"
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"StaticBox",
 | 
				
			||||||
 | 
												"Name":"StaticBox6",
 | 
				
			||||||
 | 
												"AlignColumn":"Column19",
 | 
				
			||||||
 | 
												"Left":11.9592,
 | 
				
			||||||
 | 
												"Width":2.99,
 | 
				
			||||||
 | 
												"Height":1,
 | 
				
			||||||
 | 
												"Border":{
 | 
				
			||||||
 | 
													"Styles":"[DrawRight|DrawBottom]"
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
												"TextAlign":"BottomCenter",
 | 
				
			||||||
 | 
												"Text":"处方"
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"StaticBox",
 | 
				
			||||||
 | 
												"Name":"StaticBox7",
 | 
				
			||||||
 | 
												"AlignColumn":"Column20",
 | 
				
			||||||
 | 
												"Left":14.949,
 | 
				
			||||||
 | 
												"Width":2.99,
 | 
				
			||||||
 | 
												"Height":1,
 | 
				
			||||||
 | 
												"Border":{
 | 
				
			||||||
 | 
													"Styles":"[DrawRight|DrawBottom]"
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
												"TextAlign":"BottomCenter",
 | 
				
			||||||
 | 
												"Text":"补充"
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"MemoBox",
 | 
				
			||||||
 | 
												"Name":"MemoBox2",
 | 
				
			||||||
 | 
												"AlignColumn":"Column14",
 | 
				
			||||||
 | 
												"Left":8.96938,
 | 
				
			||||||
 | 
												"Top":1.00542,
 | 
				
			||||||
 | 
												"Width":2.9898,
 | 
				
			||||||
 | 
												"Height":1,
 | 
				
			||||||
 | 
												"Border":{
 | 
				
			||||||
 | 
													"Styles":"[DrawRight]"
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
												"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
												"Text":"[#Sum(EmptyNum)#]"
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"MemoBox",
 | 
				
			||||||
 | 
												"Name":"MemoBox3",
 | 
				
			||||||
 | 
												"AlignColumn":"Column19",
 | 
				
			||||||
 | 
												"Left":11.9592,
 | 
				
			||||||
 | 
												"Top":1.0054,
 | 
				
			||||||
 | 
												"Width":2.98979,
 | 
				
			||||||
 | 
												"Height":1,
 | 
				
			||||||
 | 
												"Border":{
 | 
				
			||||||
 | 
													"Styles":"[DrawRight]"
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
												"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
												"Text":"[#Sum(SendNum-InfactNum)#]"
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"MemoBox",
 | 
				
			||||||
 | 
												"Name":"MemoBox4",
 | 
				
			||||||
 | 
												"AlignColumn":"Column20",
 | 
				
			||||||
 | 
												"Left":14.949,
 | 
				
			||||||
 | 
												"Top":1.0054,
 | 
				
			||||||
 | 
												"Width":2.98979,
 | 
				
			||||||
 | 
												"Height":1,
 | 
				
			||||||
 | 
												"Border":{
 | 
				
			||||||
 | 
													"Styles":"[DrawRight]"
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
												"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
												"Text":"[#Sum(SendNum-InfactNum)#]"
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"StaticBox",
 | 
				
			||||||
 | 
												"Name":"StaticBox8",
 | 
				
			||||||
 | 
												"AlignColumn":"Column22",
 | 
				
			||||||
 | 
												"AlignColumnEx":"Column23",
 | 
				
			||||||
 | 
												"Left":17.9388,
 | 
				
			||||||
 | 
												"Width":5.97958,
 | 
				
			||||||
 | 
												"Height":1,
 | 
				
			||||||
 | 
												"Border":{
 | 
				
			||||||
 | 
													"Styles":"[DrawRight|DrawBottom]"
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
												"TextAlign":"BottomCenter",
 | 
				
			||||||
 | 
												"Text":"补充者"
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"StaticBox",
 | 
				
			||||||
 | 
												"Name":"StaticBox9",
 | 
				
			||||||
 | 
												"AlignColumn":"Column24",
 | 
				
			||||||
 | 
												"Left":23.9183,
 | 
				
			||||||
 | 
												"Width":2.98979,
 | 
				
			||||||
 | 
												"Height":1,
 | 
				
			||||||
 | 
												"Border":{
 | 
				
			||||||
 | 
													"Styles":"[DrawRight|DrawBottom]"
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
												"TextAlign":"BottomCenter",
 | 
				
			||||||
 | 
												"Text":"核对者"
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"MemoBox",
 | 
				
			||||||
 | 
												"Name":"MemoBox5",
 | 
				
			||||||
 | 
												"AlignColumn":"Column22",
 | 
				
			||||||
 | 
												"AlignColumnEx":"Column23",
 | 
				
			||||||
 | 
												"Left":17.9388,
 | 
				
			||||||
 | 
												"Top":1.0054,
 | 
				
			||||||
 | 
												"Width":5.97958,
 | 
				
			||||||
 | 
												"Height":1.00542,
 | 
				
			||||||
 | 
												"Border":{
 | 
				
			||||||
 | 
													"Styles":"[DrawRight]"
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
												"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
												"Text":"[#AddUser#]"
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												"Type":"MemoBox",
 | 
				
			||||||
 | 
												"Name":"MemoBox6",
 | 
				
			||||||
 | 
												"AlignColumn":"Column24",
 | 
				
			||||||
 | 
												"Left":23.9183,
 | 
				
			||||||
 | 
												"Top":1.00542,
 | 
				
			||||||
 | 
												"Width":2.96333,
 | 
				
			||||||
 | 
												"Height":1.00542,
 | 
				
			||||||
 | 
												"Border":{
 | 
				
			||||||
 | 
													"Styles":"[DrawRight]"
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
												"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
												"Text":"[#AddCheckUser#]"
 | 
				
			||||||
 | 
											}
 | 
				
			||||||
 | 
										]
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							],
 | 
				
			||||||
 | 
							"CrossTab":{
 | 
				
			||||||
 | 
								"PercentFormat":"0.##%",
 | 
				
			||||||
 | 
								"HCrossFields":"drugId",
 | 
				
			||||||
 | 
								"VCrossFields":"OperationTime",
 | 
				
			||||||
 | 
								"ListCols":3,
 | 
				
			||||||
 | 
								"TotalCols":3
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						"Parameter":[
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								"Name":"machine_id"
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								"Name":"startDate",
 | 
				
			||||||
 | 
								"DataType":"DateTime"
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								"Name":"endDate",
 | 
				
			||||||
 | 
								"DataType":"DateTime"
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						],
 | 
				
			||||||
 | 
						"ReportHeader":[
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								"Name":"ReportHeader1",
 | 
				
			||||||
 | 
								"Height":1.79917,
 | 
				
			||||||
 | 
								"Control":[
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Type":"MemoBox",
 | 
				
			||||||
 | 
										"Name":"MemoBox1",
 | 
				
			||||||
 | 
										"Dock":"Fill",
 | 
				
			||||||
 | 
										"Center":"Both",
 | 
				
			||||||
 | 
										"Font":{
 | 
				
			||||||
 | 
											"Name":"宋体",
 | 
				
			||||||
 | 
											"Size":262500,
 | 
				
			||||||
 | 
											"Bold":true,
 | 
				
			||||||
 | 
											"Charset":134
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										"TextAlign":"MiddleCenter",
 | 
				
			||||||
 | 
										"Text":"麻醉科小药箱麻醉、精神药品(注射剂)使用与交接记录([#Year#])年"
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								],
 | 
				
			||||||
 | 
								"RepeatOnPage":true
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								"Name":"ReportHeader2",
 | 
				
			||||||
 | 
								"Height":0.608542,
 | 
				
			||||||
 | 
								"Control":[
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										"Type":"StaticBox",
 | 
				
			||||||
 | 
										"Name":"StaticBox3",
 | 
				
			||||||
 | 
										"Left":24.7915,
 | 
				
			||||||
 | 
										"Width":4.81542,
 | 
				
			||||||
 | 
										"Height":0.608542,
 | 
				
			||||||
 | 
										"Text":"[#DMYear#]年[#DMMonth#]月"
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								]
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						]
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,20 @@
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Globalization;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					using System.Windows.Controls;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Validation
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    public class NotEmptyValidationRule : ValidationRule
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        public override ValidationResult Validate(object value, CultureInfo cultureInfo)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            return string.IsNullOrWhiteSpace((value ?? "").ToString())
 | 
				
			||||||
 | 
					                ? new ValidationResult(false, "字段不能为空")
 | 
				
			||||||
 | 
					                : ValidationResult.ValidResult;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,221 @@
 | 
				
			||||||
 | 
					using DM_Weight.Models;
 | 
				
			||||||
 | 
					using DM_Weight.msg;
 | 
				
			||||||
 | 
					using DM_Weight.Port;
 | 
				
			||||||
 | 
					using DM_Weight.util;
 | 
				
			||||||
 | 
					using log4net;
 | 
				
			||||||
 | 
					using Prism.Commands;
 | 
				
			||||||
 | 
					using Prism.Events;
 | 
				
			||||||
 | 
					using Prism.Mvvm;
 | 
				
			||||||
 | 
					using Prism.Regions;
 | 
				
			||||||
 | 
					using Prism.Services.Dialogs;
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.ComponentModel;
 | 
				
			||||||
 | 
					using System.Configuration;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					using System.Windows;
 | 
				
			||||||
 | 
					using System.Windows.Data;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.ViewModels
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    public class AdditionWindowViewModel : BindableBase, INavigationAware, IRegionMemberLifetime
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        public bool KeepAlive => false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        private readonly ILog logger = LogManager.GetLogger(typeof(AdditionWindowViewModel));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        private List<ChannelStock> channelStocks;
 | 
				
			||||||
 | 
					        public List<ChannelStock> ChannelStocks
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => channelStocks;
 | 
				
			||||||
 | 
					            set => SetProperty(ref channelStocks, value);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        List<ChannelStock> selectedStock = new List<ChannelStock>();
 | 
				
			||||||
 | 
					        private object _finishStatus = Visibility.Collapsed;
 | 
				
			||||||
 | 
					        public object FinishStatus
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => _finishStatus;
 | 
				
			||||||
 | 
					            set => SetProperty(ref _finishStatus, value);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        IDialogService _dialogService;
 | 
				
			||||||
 | 
					        IEventAggregator _eventAggregator;
 | 
				
			||||||
 | 
					        private PortUtil _portUtil;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public AdditionWindowViewModel(IDialogService dialogService, IEventAggregator eventAggregator, PortUtil portUtil)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            _dialogService = dialogService;
 | 
				
			||||||
 | 
					            _eventAggregator = eventAggregator;
 | 
				
			||||||
 | 
					            _portUtil = portUtil;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        public bool IsNavigationTarget(NavigationContext navigationContext)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            return true;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public void OnNavigatedFrom(NavigationContext navigationContext)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            _eventAggregator.GetEvent<IsSelectedEvent>().Unsubscribe(SetIsSelected);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public void OnNavigatedTo(NavigationContext navigationContext)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            _eventAggregator.GetEvent<IsSelectedEvent>().Subscribe(SetIsSelected);
 | 
				
			||||||
 | 
					            RequestData();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        private void RequestData()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            ChannelStocks = SqlSugarHelper.Db.Queryable<ChannelStock>()
 | 
				
			||||||
 | 
					                .Includes<ChannelList>(cs => cs.ChannelLst)
 | 
				
			||||||
 | 
					                .Includes<DrugInfo>(cs => cs.DrugInfo)
 | 
				
			||||||
 | 
					                .Where(cs => cs.MachineId == (ConfigurationManager.AppSettings["machineId"] ?? "DM5") && cs.BaseQuantity > cs.Quantity)
 | 
				
			||||||
 | 
					                .OrderBy(cs => cs.Chnguid)
 | 
				
			||||||
 | 
					                .OrderBy(cs => cs.DrawerNo)
 | 
				
			||||||
 | 
					                .ToList();
 | 
				
			||||||
 | 
					            ChannelStocks= ChannelStocks.GroupBy(it=>new {it.DrawerNo,it.DrugId})
 | 
				
			||||||
 | 
					                .Select(it=>
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    var ret = it.First();
 | 
				
			||||||
 | 
					                    ret.Quantity = it.Sum(itx => itx.Quantity);
 | 
				
			||||||
 | 
					                    return ret;
 | 
				
			||||||
 | 
					                }).ToList();
 | 
				
			||||||
 | 
					            ChannelStocks.ForEach(cs => cs.AddQuantity = cs.BaseQuantity - cs.Quantity);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        //开药箱放入药品
 | 
				
			||||||
 | 
					        public DelegateCommand OpenBoxCommand
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => new DelegateCommand(() =>
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                selectedStock = ChannelStocks.FindAll(cs => cs.ChannelLst.IsSelected).ToList();
 | 
				
			||||||
 | 
					                if (selectedStock != null && selectedStock.Count > 0)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    int drawerNo = 0;
 | 
				
			||||||
 | 
					                    for (int i = 0; i < selectedStock.Count; i++)
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        if (!(drawerNo == selectedStock[i].DrawerNo))
 | 
				
			||||||
 | 
					                        {
 | 
				
			||||||
 | 
					                            drawerNo = selectedStock[i].DrawerNo;
 | 
				
			||||||
 | 
					                            _portUtil.SpeakAsync($"正在打开{selectedStock[i].DrawerNo}号药箱");
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
 | 
					                        ModbusHelper.GetInstance().OpenBoxDoor(selectedStock[i].DrawerNo - 1);
 | 
				
			||||||
 | 
					                        Thread.Sleep(100);
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                else
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    AlertMsg alertMsg = new AlertMsg
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        Message = $"未选择药箱,请先选择药箱",
 | 
				
			||||||
 | 
					                        Type = MsgType.ERROR,
 | 
				
			||||||
 | 
					                    };
 | 
				
			||||||
 | 
					                    _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
 | 
				
			||||||
 | 
					                    return;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                FinishStatus = Visibility.Visible;
 | 
				
			||||||
 | 
					            });
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        //完成按钮
 | 
				
			||||||
 | 
					        public DelegateCommand AddFinish
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => new DelegateCommand(() =>
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                var f = SqlSugarHelper.Db.UseTran(() =>
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    //更新 交接柜 库存信息
 | 
				
			||||||
 | 
					                    if (selectedStock != null && selectedStock.Count > 0)
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        for (int j = 0; j < selectedStock.Count; j++)
 | 
				
			||||||
 | 
					                        {
 | 
				
			||||||
 | 
					                            // 更新数据 交接柜 库存信息
 | 
				
			||||||
 | 
					                            ChannelStock jiaojie_it = selectedStock[j];
 | 
				
			||||||
 | 
					                            SqlSugarHelper.Db.Updateable(new ChannelStock()
 | 
				
			||||||
 | 
					                            {
 | 
				
			||||||
 | 
					                                Quantity = jiaojie_it.BaseQuantity,
 | 
				
			||||||
 | 
					                                //ManuNo = it.ManuNo,
 | 
				
			||||||
 | 
					                                //EffDate = it.EffDate,
 | 
				
			||||||
 | 
					                                //Id = jiaojie_it.Id,
 | 
				
			||||||
 | 
					                                DrugId=jiaojie_it.DrugId,
 | 
				
			||||||
 | 
					                                DrawerNo=jiaojie_it.DrawerNo,
 | 
				
			||||||
 | 
					                                MachineId=jiaojie_it.MachineId,
 | 
				
			||||||
 | 
					                            }).UpdateColumns(jiaojie_it => new { jiaojie_it.Quantity }).WhereColumns(jiaojie_it=>new { jiaojie_it.DrugId, jiaojie_it.DrawerNo, jiaojie_it.MachineId }).ExecuteCommand();
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                        List<ChannelStock> jiaojie = selectedStock.GroupBy(cs => cs.DrawerNo).Select(cs => cs.FirstOrDefault()).ToList();
 | 
				
			||||||
 | 
					                        if (jiaojie != null && jiaojie.Count > 0)
 | 
				
			||||||
 | 
					                        {
 | 
				
			||||||
 | 
					                            for (int j = 0; j < jiaojie.Count; j++)
 | 
				
			||||||
 | 
					                            {
 | 
				
			||||||
 | 
					                                ChannelStock jiaojie_it = jiaojie[j];
 | 
				
			||||||
 | 
					                                ChannelList jiaojieList = new ChannelList();
 | 
				
			||||||
 | 
					                                jiaojieList.State = 0;
 | 
				
			||||||
 | 
					                                jiaojieList.Id = jiaojie_it.ChannelLst.Id;
 | 
				
			||||||
 | 
					                                //更新交接柜状态为 已取药未入库
 | 
				
			||||||
 | 
					                                var result = SqlSugarHelper.Db.Updateable(jiaojieList)
 | 
				
			||||||
 | 
					                                .UpdateColumns(it => new { it.State, it.Id }).ExecuteCommand();
 | 
				
			||||||
 | 
					                            }
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                });
 | 
				
			||||||
 | 
					                if (f.Data)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    RequestData();
 | 
				
			||||||
 | 
					                    AlertMsg alertMsg = new AlertMsg
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        Message = "操作完成",
 | 
				
			||||||
 | 
					                        Type = MsgType.SUCCESS,
 | 
				
			||||||
 | 
					                    };
 | 
				
			||||||
 | 
					                    _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                if (!f.IsSuccess)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    AlertMsg alertMsg = new AlertMsg
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        Message = "操作失败!",
 | 
				
			||||||
 | 
					                        Type = MsgType.ERROR,
 | 
				
			||||||
 | 
					                    };
 | 
				
			||||||
 | 
					                    _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            });
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        //刷新
 | 
				
			||||||
 | 
					        public DelegateCommand QueryCommand
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => new DelegateCommand(() => RequestData());
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        //设置选中药箱的复选框状态
 | 
				
			||||||
 | 
					        private void SetIsSelected(ChannelStock channelStock)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            if (channelStock != null)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                if (channelStock.ChannelLst.State == 1)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    channelStock.ChannelLst.IsSelected = !channelStock.ChannelLst.IsSelected;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                else
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    return;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                if (channelStock != null && ChannelStocks != null)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    ChannelStocks = ChannelStocks.Select(x =>
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        for (int i = 0; i < ChannelStocks.Count; i++)
 | 
				
			||||||
 | 
					                        {
 | 
				
			||||||
 | 
					                            if (ChannelStocks[i].DrawerNo == channelStock.DrawerNo)
 | 
				
			||||||
 | 
					                            {
 | 
				
			||||||
 | 
					                                ChannelStocks[i].ChannelLst = channelStock.ChannelLst;
 | 
				
			||||||
 | 
					                            }
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
 | 
					                        return x;
 | 
				
			||||||
 | 
					                    }).ToList();
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                ICollectionView vw = CollectionViewSource.GetDefaultView(ChannelStocks);
 | 
				
			||||||
 | 
					                vw.GroupDescriptions.Add(new PropertyGroupDescription("ChannelLst"));
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,76 @@
 | 
				
			||||||
 | 
					using DM_Weight.Models;
 | 
				
			||||||
 | 
					using DM_Weight.util;
 | 
				
			||||||
 | 
					using Prism.Mvvm;
 | 
				
			||||||
 | 
					using Prism.Regions;
 | 
				
			||||||
 | 
					using Prism.Services.Dialogs;
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.ViewModels
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    public class BindBoxDialogViewModel : BindableBase, IDialogAware, IRegionMemberLifetime
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        public string Title =>"药箱药品绑定";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public bool KeepAlive => false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        private int _drawerNo = 0;
 | 
				
			||||||
 | 
					        public int DrawerNo
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => _drawerNo;
 | 
				
			||||||
 | 
					            set
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                SetProperty(ref _drawerNo, value);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        private List<DrugInfo>? _drugInfos;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public List<DrugInfo>? DrugInfos
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => _drugInfos;
 | 
				
			||||||
 | 
					            set => SetProperty(ref _drugInfos, value);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public static BindBoxDialogViewModel vm;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public event Action<IDialogResult> RequestClose;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public bool CanCloseDialog()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            return true;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public void OnDialogClosed()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public void OnDialogOpened(IDialogParameters parameters)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            if (parameters.ContainsKey("DrawerNo"))
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                DrawerNo = parameters.GetValue<int>("DrawerNo");
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public void UpdateComboBoxItems(string text)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            string str = @"SELECT d.drug_id,d.py_code,d.drug_barcode,d.drug_name,d.drug_brand_name,d.drug_spec,d.dosage,d.pack_unit,
 | 
				
			||||||
 | 
					                        d.manufactory,d.max_stock,CONCAT(drug_name,'  ',drug_spec)as drug_name_spec FROM `drug_info` d";
 | 
				
			||||||
 | 
					            if (string.IsNullOrEmpty(text))
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                DrugInfos = SqlSugarHelper.Db.SqlQueryable<DrugInfo>(str).OrderBy(di => di.DrugName).OrderBy(di => di.DrugId).ToList();
 | 
				
			||||||
 | 
					                return;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            if (DrugInfos != null)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                DrugInfos.Clear();
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            DrugInfos = SqlSugarHelper.Db.SqlQueryable<DrugInfo>(str).Where(di => di.DrugName.Contains(text) || di.PyCode.Contains(text)).OrderBy(di => di.DrugName).OrderBy(di => di.DrugId).ToList();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,493 @@
 | 
				
			||||||
 | 
					using DM_Weight.Models;
 | 
				
			||||||
 | 
					using DM_Weight.msg;
 | 
				
			||||||
 | 
					using DM_Weight.Port;
 | 
				
			||||||
 | 
					using DM_Weight.util;
 | 
				
			||||||
 | 
					using MaterialDesignThemes.Wpf;
 | 
				
			||||||
 | 
					using Prism.Commands;
 | 
				
			||||||
 | 
					using Prism.Events;
 | 
				
			||||||
 | 
					using Prism.Mvvm;
 | 
				
			||||||
 | 
					using Prism.Regions;
 | 
				
			||||||
 | 
					using Prism.Services.Dialogs;
 | 
				
			||||||
 | 
					using SqlSugar;
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Configuration;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					using System.Windows.Media;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.ViewModels
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    public class BindBoxPackageWindowViewModel : BindableBase, INavigationAware, IRegionMemberLifetime
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        public static BindBoxPackageWindowViewModel vm;
 | 
				
			||||||
 | 
					        private int _drawerNo = 1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public int DrawerNo
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => _drawerNo;
 | 
				
			||||||
 | 
					            set => SetProperty(ref _drawerNo, value);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        private SolidColorBrush _colorBrush;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public SolidColorBrush SnackbarBackground
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => _colorBrush;
 | 
				
			||||||
 | 
					            set => SetProperty(ref _colorBrush, value);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        private ISnackbarMessageQueue _snackbarMessageQueue = new SnackbarMessageQueue(TimeSpan.FromSeconds(3));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public ISnackbarMessageQueue SnackbarMessageQueue
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => _snackbarMessageQueue;
 | 
				
			||||||
 | 
					            set => SetProperty(ref _snackbarMessageQueue, value);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        private List<ChannelStock>? _channels;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public List<ChannelStock>? Channels
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => _channels;
 | 
				
			||||||
 | 
					            set => SetProperty(ref _channels, value);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        private ChannelStock _channelStock;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public ChannelStock Channel
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get { return _channelStock; }
 | 
				
			||||||
 | 
					            set
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                if (value != null)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    DrugInfo = DrugInfos.Where(di => di.DrugId == value.DrugInfo.DrugId).First();
 | 
				
			||||||
 | 
					                    BaseQuantity = value.BaseQuantity.ToString();
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                SetProperty(ref _channelStock, value);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        private List<DrugInfo>? _drugInfos;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public List<DrugInfo>? DrugInfos
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => _drugInfos;
 | 
				
			||||||
 | 
					            set => SetProperty(ref _drugInfos, value);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        private DrugInfo? _drugInfo;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public DrugInfo? DrugInfo
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => _drugInfo;
 | 
				
			||||||
 | 
					            set
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                SetProperty(ref _drugInfo, value);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        //药品基数
 | 
				
			||||||
 | 
					        private string _baseQuantity;
 | 
				
			||||||
 | 
					        public string BaseQuantity { get => _baseQuantity; set { SetProperty(ref _baseQuantity, value); } }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        private bool _isEnable = true;
 | 
				
			||||||
 | 
					        public bool IsEnable { get => _isEnable; set => SetProperty(ref _isEnable, value); }
 | 
				
			||||||
 | 
					        private int _status = 0;
 | 
				
			||||||
 | 
					        public int Status { get => _status; set { SetProperty(ref _status, value); } }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public bool KeepAlive => false;
 | 
				
			||||||
 | 
					        //抽屉号列表
 | 
				
			||||||
 | 
					        public static List<int> iList = new List<int>();
 | 
				
			||||||
 | 
					        //第几个抽屉号下标
 | 
				
			||||||
 | 
					        //public static int iNumber = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        //private PortUtil _portUtil;
 | 
				
			||||||
 | 
					        IEventAggregator _eventAggregator;
 | 
				
			||||||
 | 
					        public BindBoxPackageWindowViewModel(IEventAggregator eventAggregator)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            vm = this;
 | 
				
			||||||
 | 
					            //_portUtil = portUtil;
 | 
				
			||||||
 | 
					            _eventAggregator = eventAggregator;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        private void RequestData()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            Channels?.Clear();
 | 
				
			||||||
 | 
					            BaseQuantity = "";
 | 
				
			||||||
 | 
					            var list = SqlSugarHelper.Db.Queryable<ChannelStock>()
 | 
				
			||||||
 | 
					                //.Includes(cl => cl.channelStocks, cs => cs.DrugInfo,di=>di.drugBase)
 | 
				
			||||||
 | 
					                .Includes(cs => cs.DrugInfo)
 | 
				
			||||||
 | 
					                .Where(cs => cs.MachineId.Equals("DM5"))
 | 
				
			||||||
 | 
					                .Where(cs => cs.DrawerNo == DrawerNo).ToList();
 | 
				
			||||||
 | 
					            if (list != null && list.Count > 0)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                Channels = list;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            else
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                Channels = null;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public void OnNavigatedTo(NavigationContext navigationContext)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            RequestDrug();
 | 
				
			||||||
 | 
					            RequestData();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public bool IsNavigationTarget(NavigationContext navigationContext)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            return true;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public void OnNavigatedFrom(NavigationContext navigationContext)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            // 取消消息订阅
 | 
				
			||||||
 | 
					            //_eventAggregator.GetEvent<PortUtilEvent>().Unsubscribe(DoMyPrismEvent);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public DelegateCommand<string> UpdateDrawerNo
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => new DelegateCommand<string>((DrawerNo) =>
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                this.DrawerNo = Convert.ToInt32(DrawerNo);
 | 
				
			||||||
 | 
					                RequestData();
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            );
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        private void RequestDrug()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            //var list = SqlSugarHelper.Db.Queryable<DrugInfo>().Includes<DrugManuNo>(di => di.DrugManuNos).OrderBy(di => di.DrugId).ToList();
 | 
				
			||||||
 | 
					            //DrugInfos = list;
 | 
				
			||||||
 | 
					            string str = "SELECT d.drug_id,d.py_code,d.drug_barcode,d.drug_name,d.drug_brand_name,d.drug_spec,d.dosage,d.pack_unit,d.manufactory,d.max_stock,CONCAT(drug_name,' / ',drug_spec,' / ',manufactory) as drug_name_spec FROM `drug_info` d";
 | 
				
			||||||
 | 
					            DrugInfos = SqlSugarHelper.Db.SqlQueryable<DrugInfo>(str).OrderBy(di => di.DrugName).OrderBy(di => di.DrugId).ToList();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        public DelegateCommand BindingDrug
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => new DelegateCommand(BindDrugAction);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        //绑定
 | 
				
			||||||
 | 
					        private void BindDrugAction()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            if (DrugInfo == null || BaseQuantity == null)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                SnackbarBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#b71c1c"));
 | 
				
			||||||
 | 
					                SnackbarMessageQueue.Enqueue("请选择药品并输入药品基数");
 | 
				
			||||||
 | 
					                return;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            int baseQuantity;
 | 
				
			||||||
 | 
					            if (!int.TryParse(BaseQuantity, out baseQuantity))
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                SnackbarBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#b71c1c"));
 | 
				
			||||||
 | 
					                SnackbarMessageQueue.Enqueue("药品基数请输入正确的整数");
 | 
				
			||||||
 | 
					                return;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            if (Channels != null)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                int iNum = Channels.Where(cs => cs.DrugId == DrugInfo.DrugId.ToString()).Count();
 | 
				
			||||||
 | 
					                if (iNum > 0)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    SnackbarBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#b71c1c"));
 | 
				
			||||||
 | 
					                    SnackbarMessageQueue.Enqueue("该药品已在药箱绑定,请选择其他药品");
 | 
				
			||||||
 | 
					                    return;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            var f = SqlSugarHelper.Db.UseTran(() =>
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                string chnguid = SqlSugarHelper.Db.Queryable<ChannelList>().Where(cs => cs.MachineId == ConfigurationManager.AppSettings["machineId"].ToString() && cs.DrawerNo == DrawerNo).Select(cs => cs.Id).First();
 | 
				
			||||||
 | 
					                SqlSugarHelper.Db.Insertable(new ChannelStock()
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    Chnguid = chnguid,
 | 
				
			||||||
 | 
					                    DrawerNo = DrawerNo,
 | 
				
			||||||
 | 
					                    DrugId = DrugInfo.DrugId.ToString(),
 | 
				
			||||||
 | 
					                    BaseQuantity = baseQuantity,
 | 
				
			||||||
 | 
					                    Id = Guid.NewGuid().ToString(),
 | 
				
			||||||
 | 
					                    MachineId = "DM5"
 | 
				
			||||||
 | 
					                }).ExecuteCommand();
 | 
				
			||||||
 | 
					                // 保存数据 入库记录
 | 
				
			||||||
 | 
					                SqlSugarHelper.Db.Insertable(new MachineRecord()
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    MachineId = "DM5",
 | 
				
			||||||
 | 
					                    DrawerNo = DrawerNo,
 | 
				
			||||||
 | 
					                    DrugId = DrugInfo.DrugId.ToString(),
 | 
				
			||||||
 | 
					                    Operator = HomeWindowViewModel.Operator?.Id,
 | 
				
			||||||
 | 
					                    OperationTime = DateTime.Now,
 | 
				
			||||||
 | 
					                    Quantity = baseQuantity,
 | 
				
			||||||
 | 
					                    Type = 55,
 | 
				
			||||||
 | 
					                    InvoiceId = "绑定药箱",
 | 
				
			||||||
 | 
					                }).ExecuteCommand();
 | 
				
			||||||
 | 
					                return true;
 | 
				
			||||||
 | 
					            });
 | 
				
			||||||
 | 
					            if (f.Data)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                SnackbarBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#00e676"));
 | 
				
			||||||
 | 
					                SnackbarMessageQueue.Enqueue("药品已绑定药箱");
 | 
				
			||||||
 | 
					                RequestDrug();
 | 
				
			||||||
 | 
					                RequestData();
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public void UpdateComboBoxItems(string text)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            string str = @"SELECT d.drug_id,d.py_code,d.drug_barcode,d.drug_name,d.drug_brand_name,d.drug_spec,d.dosage,d.pack_unit,
 | 
				
			||||||
 | 
					                        d.manufactory,d.max_stock,CONCAT(drug_name,' / ',drug_spec,' / ',manufactory) as drug_name_spec FROM `drug_info` d";
 | 
				
			||||||
 | 
					            if (string.IsNullOrEmpty(text))
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                DrugInfos = SqlSugarHelper.Db.SqlQueryable<DrugInfo>(str).OrderBy(di => di.DrugName).OrderBy(di => di.DrugId).ToList();
 | 
				
			||||||
 | 
					                return;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            if (DrugInfos != null)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                DrugInfos.Clear();
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            DrugInfos = SqlSugarHelper.Db.SqlQueryable<DrugInfo>(str).Where(di => di.DrugName.Contains(text) || di.PyCode.Contains(text)).OrderBy(di => di.DrugName).OrderBy(di => di.DrugId).ToList();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        //解绑
 | 
				
			||||||
 | 
					        public DelegateCommand RemoveBinding
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => new DelegateCommand(() => RemoveBindingAction());
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        private void RemoveBindingAction()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            try
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                if (Channels == null)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    SnackbarBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#b71c1c"));
 | 
				
			||||||
 | 
					                    SnackbarMessageQueue.Enqueue("所选药箱中无可解绑药品");
 | 
				
			||||||
 | 
					                    return;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                if (Channel != null)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    //解绑选定行的单个药品
 | 
				
			||||||
 | 
					                    SqlSugarHelper.Db.Deleteable(Channel).ExecuteCommand();
 | 
				
			||||||
 | 
					                    // 保存数据 入库记录
 | 
				
			||||||
 | 
					                    SqlSugarHelper.Db.Insertable(new MachineRecord()
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        MachineId = "DM5",
 | 
				
			||||||
 | 
					                        DrawerNo = DrawerNo,
 | 
				
			||||||
 | 
					                        DrugId = Channel.DrugId.ToString(),
 | 
				
			||||||
 | 
					                        Operator = HomeWindowViewModel.Operator?.Id,
 | 
				
			||||||
 | 
					                        OperationTime = DateTime.Now,
 | 
				
			||||||
 | 
					                        Quantity = Channel.Quantity,
 | 
				
			||||||
 | 
					                        Type = 55,
 | 
				
			||||||
 | 
					                        InvoiceId = "解绑药箱单个药品",
 | 
				
			||||||
 | 
					                    }).ExecuteCommand();
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                else
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    //解绑药箱下的所有药品
 | 
				
			||||||
 | 
					                    Channels.ForEach(item =>
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                        SqlSugarHelper.Db.Deleteable(item).ExecuteCommand();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                        // 保存数据 入库记录
 | 
				
			||||||
 | 
					                        SqlSugarHelper.Db.Insertable(new MachineRecord()
 | 
				
			||||||
 | 
					                        {
 | 
				
			||||||
 | 
					                            MachineId = "DM5",
 | 
				
			||||||
 | 
					                            DrawerNo = DrawerNo,
 | 
				
			||||||
 | 
					                            DrugId = item.DrugId.ToString(),
 | 
				
			||||||
 | 
					                            Operator = HomeWindowViewModel.Operator?.Id,
 | 
				
			||||||
 | 
					                            OperationTime = DateTime.Now,
 | 
				
			||||||
 | 
					                            Quantity = item.Quantity,
 | 
				
			||||||
 | 
					                            Type = 55,
 | 
				
			||||||
 | 
					                            InvoiceId = "绑定药箱全部药品",
 | 
				
			||||||
 | 
					                        }).ExecuteCommand();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                RequestDrug();
 | 
				
			||||||
 | 
					                RequestData();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            catch (Exception ex)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                SnackbarBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#b71c1c"));
 | 
				
			||||||
 | 
					                SnackbarMessageQueue.Enqueue("解绑操作异常");
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        //保存修改的药品基数
 | 
				
			||||||
 | 
					        public DelegateCommand SaveCommand
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => new DelegateCommand(() =>
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                if (DrugInfo.DrugId != Channel.DrugId)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    SnackbarBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#b71c1c"));
 | 
				
			||||||
 | 
					                    SnackbarMessageQueue.Enqueue("只能修改药品基数,不能更换绑定药品!");
 | 
				
			||||||
 | 
					                    return;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                int baseQty = 0;
 | 
				
			||||||
 | 
					                if (int.TryParse(BaseQuantity, out baseQty))
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    Channel.BaseQuantity = Convert.ToInt32(baseQty);
 | 
				
			||||||
 | 
					                    int iUpdate= SqlSugarHelper.Db.Updateable<ChannelStock>(Channel).ExecuteCommand();
 | 
				
			||||||
 | 
					                    if (iUpdate > 0)
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                        SnackbarBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#00e676"));
 | 
				
			||||||
 | 
					                        SnackbarMessageQueue.Enqueue("保存修改完成!");
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    else
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                        SnackbarBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#00e676"));
 | 
				
			||||||
 | 
					                        SnackbarMessageQueue.Enqueue("保存修改失败!");
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                else
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    SnackbarBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#b71c1c"));
 | 
				
			||||||
 | 
					                    SnackbarMessageQueue.Enqueue("药品基数只能是正整数,请检查输入!");
 | 
				
			||||||
 | 
					                    return;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            });
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        //刷新
 | 
				
			||||||
 | 
					        public DelegateCommand Query
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => new DelegateCommand(RequestData);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        //打开全部药箱
 | 
				
			||||||
 | 
					        public DelegateCommand OpenBox
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => new DelegateCommand(() => OpenBoxAction());
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        private void OpenBoxAction()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            iList = SqlSugarHelper.Db.Queryable<ChannelList>().Where(cl => cl.MachineId == "DM5")
 | 
				
			||||||
 | 
					                .Select(cl => cl.DrawerNo).ToList();
 | 
				
			||||||
 | 
					            if (iList.Count > 0)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                for (int i = 0; i < iList.Count; i++)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    //记录开药箱日志
 | 
				
			||||||
 | 
					                    SqlSugarHelper.Db.Insertable(new MachineRecord()
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        MachineId = "DM5",
 | 
				
			||||||
 | 
					                        DrawerNo = DrawerNo,
 | 
				
			||||||
 | 
					                        Operator = HomeWindowViewModel.Operator?.Id,
 | 
				
			||||||
 | 
					                        OperationTime = DateTime.Now,
 | 
				
			||||||
 | 
					                        Type = 55,
 | 
				
			||||||
 | 
					                        InvoiceId = $"打开{DrawerNo}号药箱",
 | 
				
			||||||
 | 
					                    }).ExecuteCommand();
 | 
				
			||||||
 | 
					                    IsEnable = false;
 | 
				
			||||||
 | 
					                    Status = 1;
 | 
				
			||||||
 | 
					                    Console.WriteLine($"正在打开{iList[i]}号药箱");
 | 
				
			||||||
 | 
					                    ModbusHelper.GetInstance().OpenBoxDoor(iList[i] - 1);
 | 
				
			||||||
 | 
					                    //iNumber++;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                ModbusHelper.GetInstance().GetAllBoxState();
 | 
				
			||||||
 | 
					                if (Status == 2)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    Status = 3;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                IsEnable = true;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        void DoMyPrismEvent(DeviceMsg msg)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            switch (msg.EventType)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                // 药箱打开
 | 
				
			||||||
 | 
					                case EventType.DRAWEROPEN:
 | 
				
			||||||
 | 
					                    //记录开药箱日志
 | 
				
			||||||
 | 
					                    SqlSugarHelper.Db.Insertable(new MachineRecord()
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        MachineId = "DM5",
 | 
				
			||||||
 | 
					                        //DrawerNo = _portUtil.DrawerNo,
 | 
				
			||||||
 | 
					                        Operator = HomeWindowViewModel.Operator?.Id,
 | 
				
			||||||
 | 
					                        OperationTime = DateTime.Now,
 | 
				
			||||||
 | 
					                        Type = 55,
 | 
				
			||||||
 | 
					                        InvoiceId = "药箱打开",
 | 
				
			||||||
 | 
					                    }).ExecuteCommand();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    //if (iNumber < iList.Count)
 | 
				
			||||||
 | 
					                    //{
 | 
				
			||||||
 | 
					                    //    //_portUtil.DrawerNo = iList[iNumber];
 | 
				
			||||||
 | 
					                    //    iNumber++;
 | 
				
			||||||
 | 
					                    //    if (Status == 1)
 | 
				
			||||||
 | 
					                    //    {
 | 
				
			||||||
 | 
					                    //        Status = 2;
 | 
				
			||||||
 | 
					                    //    }
 | 
				
			||||||
 | 
					                    //    //_portUtil.OpenBox();
 | 
				
			||||||
 | 
					                    //}
 | 
				
			||||||
 | 
					                    //else
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        //iNumber = 0;
 | 
				
			||||||
 | 
					                        //_portUtil.GetBoxStatus();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    break;
 | 
				
			||||||
 | 
					                // 药箱关闭
 | 
				
			||||||
 | 
					                case EventType.DRAWERCLOSE:
 | 
				
			||||||
 | 
					                    //记录药箱操作日志
 | 
				
			||||||
 | 
					                    SqlSugarHelper.Db.Insertable(new MachineRecord()
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        MachineId = "DM5",
 | 
				
			||||||
 | 
					                        //DrawerNo = _portUtil.DrawerNo,
 | 
				
			||||||
 | 
					                        Operator = HomeWindowViewModel.Operator?.Id,
 | 
				
			||||||
 | 
					                        OperationTime = DateTime.Now,
 | 
				
			||||||
 | 
					                        Type = 55,
 | 
				
			||||||
 | 
					                        InvoiceId = "药箱关闭",
 | 
				
			||||||
 | 
					                    }).ExecuteCommand();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    if (Status == 2)
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        Status = 3;
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    IsEnable = true;
 | 
				
			||||||
 | 
					                    DrawerNo = -1;
 | 
				
			||||||
 | 
					                    //_portUtil.Operate = false;
 | 
				
			||||||
 | 
					                    break;
 | 
				
			||||||
 | 
					                // 打开失败
 | 
				
			||||||
 | 
					                case EventType.OPENERROR:
 | 
				
			||||||
 | 
					                    AlertMsg alertMsg = new AlertMsg
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        Message = msg.Message,
 | 
				
			||||||
 | 
					                        Type = MsgType.ERROR
 | 
				
			||||||
 | 
					                    };
 | 
				
			||||||
 | 
					                    _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    IsEnable = true;
 | 
				
			||||||
 | 
					                    DrawerNo = -1;
 | 
				
			||||||
 | 
					                    Status = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    //记录药箱操作日志
 | 
				
			||||||
 | 
					                    SqlSugarHelper.Db.Insertable(new MachineRecord()
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        MachineId = "DM5",
 | 
				
			||||||
 | 
					                        //DrawerNo = _portUtil.DrawerNo,
 | 
				
			||||||
 | 
					                        Operator = HomeWindowViewModel.Operator?.Id,
 | 
				
			||||||
 | 
					                        OperationTime = DateTime.Now,
 | 
				
			||||||
 | 
					                        Type = 55,
 | 
				
			||||||
 | 
					                        InvoiceId = "药箱打开失败",
 | 
				
			||||||
 | 
					                    }).ExecuteCommand();
 | 
				
			||||||
 | 
					                    //_portUtil.Operate = false;
 | 
				
			||||||
 | 
					                    break;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,971 @@
 | 
				
			||||||
 | 
					using DM_Weight.Models;
 | 
				
			||||||
 | 
					using DM_Weight.msg;
 | 
				
			||||||
 | 
					using DM_Weight.Port;
 | 
				
			||||||
 | 
					using DM_Weight.select;
 | 
				
			||||||
 | 
					using DM_Weight.util;
 | 
				
			||||||
 | 
					using log4net;
 | 
				
			||||||
 | 
					using log4net.Repository.Hierarchy;
 | 
				
			||||||
 | 
					using Prism.Commands;
 | 
				
			||||||
 | 
					using Prism.Events;
 | 
				
			||||||
 | 
					using Prism.Mvvm;
 | 
				
			||||||
 | 
					using Prism.Regions;
 | 
				
			||||||
 | 
					using Prism.Services.Dialogs;
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Configuration;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Linq.Expressions;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					using System.Timers;
 | 
				
			||||||
 | 
					using System.Windows;
 | 
				
			||||||
 | 
					using System.Windows.Media;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.ViewModels
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    public class CheckOrderNewWindowViewModel : BindableBase, INavigationAware, IRegionMemberLifetime
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        private readonly ILog logger = LogManager.GetLogger(typeof(CheckOrderNewWindowViewModel));
 | 
				
			||||||
 | 
					        System.Timers.Timer CheckBoxStatusTimer;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        private int _pageNum = 1;
 | 
				
			||||||
 | 
					        public int PageNum
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => _pageNum;
 | 
				
			||||||
 | 
					            set
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                SetProperty(ref _pageNum, value);
 | 
				
			||||||
 | 
					                RequestData();
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        private int _pageCount = 1;
 | 
				
			||||||
 | 
					        public int PageCount
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => _pageCount;
 | 
				
			||||||
 | 
					            set
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                SetProperty(ref _pageCount, value);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        private int _pageSize = 10;
 | 
				
			||||||
 | 
					        public int PageSize
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => _pageSize;
 | 
				
			||||||
 | 
					            set
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                SetProperty(ref _pageSize, value);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        private int _totalCount = 0;
 | 
				
			||||||
 | 
					        public int TotalCount
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => _totalCount;
 | 
				
			||||||
 | 
					            set
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                SetProperty(ref _totalCount, value);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        //所选药箱号
 | 
				
			||||||
 | 
					        private int _drawerNo = -1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public int DrawerNo
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => _drawerNo;
 | 
				
			||||||
 | 
					            set => SetProperty(ref _drawerNo, value);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        private string _orderDate = DateTime.Now.ToString("yyyy-MM-dd");
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 查询条件  处方日期
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        public string OrderDate
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get { return _orderDate; }
 | 
				
			||||||
 | 
					            set
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                if (!String.IsNullOrEmpty(value))
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    SetProperty(ref _orderDate, DateTime.Parse(value).ToString("yyyy-MM-dd"));
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                else
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    SetProperty(ref _orderDate, value);
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                RequestData();
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        private bool _isEnable = true;
 | 
				
			||||||
 | 
					        public bool IsEnable { get => _isEnable; set => SetProperty(ref _isEnable, value); }
 | 
				
			||||||
 | 
					        private int _status = 0;
 | 
				
			||||||
 | 
					        public int Status { get => _status; set { SetProperty(ref _status, value); } }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        private List<OrderInfo> _ordersList = new List<OrderInfo>();
 | 
				
			||||||
 | 
					        public List<OrderInfo> OrderInfoList
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => _ordersList;
 | 
				
			||||||
 | 
					            set => SetProperty(ref _ordersList, value);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        private List<TotalDrug>? _totalDrugList = new List<TotalDrug>();
 | 
				
			||||||
 | 
					        public List<TotalDrug>? TotalDrugList
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => _totalDrugList;
 | 
				
			||||||
 | 
					            set => SetProperty(ref _totalDrugList, value);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        private OrderInfo _selectOrderInfo;
 | 
				
			||||||
 | 
					        public OrderInfo selectOrderInfo { get => _selectOrderInfo; set => SetProperty(ref _selectOrderInfo, value); }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        #region 18个药箱号的可用状态
 | 
				
			||||||
 | 
					        private bool _IsEnabled1 = true;
 | 
				
			||||||
 | 
					        public bool IsEnabled1 { get => _IsEnabled1; set => SetProperty(ref _IsEnabled1, value); }
 | 
				
			||||||
 | 
					        private bool _IsEnabled2 = true;
 | 
				
			||||||
 | 
					        public bool IsEnabled2 { get => _IsEnabled2; set => SetProperty(ref _IsEnabled2, value); }
 | 
				
			||||||
 | 
					        private bool _IsEnabled3 = true;
 | 
				
			||||||
 | 
					        public bool IsEnabled3 { get => _IsEnabled3; set => SetProperty(ref _IsEnabled3, value); }
 | 
				
			||||||
 | 
					        private bool _IsEnabled4 = true;
 | 
				
			||||||
 | 
					        public bool IsEnabled4 { get => _IsEnabled4; set => SetProperty(ref _IsEnabled4, value); }
 | 
				
			||||||
 | 
					        private bool _IsEnabled5 = true;
 | 
				
			||||||
 | 
					        public bool IsEnabled5 { get => _IsEnabled5; set => SetProperty(ref _IsEnabled5, value); }
 | 
				
			||||||
 | 
					        private bool _IsEnabled6 = true;
 | 
				
			||||||
 | 
					        public bool IsEnabled6 { get => _IsEnabled6; set => SetProperty(ref _IsEnabled6, value); }
 | 
				
			||||||
 | 
					        private bool _IsEnabled7 = true;
 | 
				
			||||||
 | 
					        public bool IsEnabled7 { get => _IsEnabled7; set => SetProperty(ref _IsEnabled7, value); }
 | 
				
			||||||
 | 
					        private bool _IsEnabled8 = true;
 | 
				
			||||||
 | 
					        public bool IsEnabled8 { get => _IsEnabled8; set => SetProperty(ref _IsEnabled8, value); }
 | 
				
			||||||
 | 
					        private bool _IsEnabled9 = true;
 | 
				
			||||||
 | 
					        public bool IsEnabled9 { get => _IsEnabled9; set => SetProperty(ref _IsEnabled9, value); }
 | 
				
			||||||
 | 
					        private bool _IsEnabled10 = true;
 | 
				
			||||||
 | 
					        public bool IsEnabled10 { get => _IsEnabled10; set => SetProperty(ref _IsEnabled10, value); }
 | 
				
			||||||
 | 
					        private bool _IsEnabled11 = true;
 | 
				
			||||||
 | 
					        public bool IsEnabled11 { get => _IsEnabled11; set => SetProperty(ref _IsEnabled11, value); }
 | 
				
			||||||
 | 
					        private bool _IsEnabled12 = true;
 | 
				
			||||||
 | 
					        public bool IsEnabled12 { get => _IsEnabled12; set => SetProperty(ref _IsEnabled12, value); }
 | 
				
			||||||
 | 
					        private bool _IsEnabled13 = true;
 | 
				
			||||||
 | 
					        public bool IsEnabled13 { get => _IsEnabled13; set => SetProperty(ref _IsEnabled13, value); }
 | 
				
			||||||
 | 
					        private bool _IsEnabled14 = true;
 | 
				
			||||||
 | 
					        public bool IsEnabled14 { get => _IsEnabled14; set => SetProperty(ref _IsEnabled14, value); }
 | 
				
			||||||
 | 
					        private bool _IsEnabled15 = true;
 | 
				
			||||||
 | 
					        public bool IsEnabled15 { get => _IsEnabled15; set => SetProperty(ref _IsEnabled15, value); }
 | 
				
			||||||
 | 
					        private bool _IsEnabled16 = true;
 | 
				
			||||||
 | 
					        public bool IsEnabled16 { get => _IsEnabled16; set => SetProperty(ref _IsEnabled16, value); }
 | 
				
			||||||
 | 
					        private bool _IsEnabled17 = true;
 | 
				
			||||||
 | 
					        public bool IsEnabled17 { get => _IsEnabled17; set => SetProperty(ref _IsEnabled17, value); }
 | 
				
			||||||
 | 
					        private bool _IsEnabled18 = true;
 | 
				
			||||||
 | 
					        public bool IsEnabled18 { get => _IsEnabled18; set => SetProperty(ref _IsEnabled18, value); }
 | 
				
			||||||
 | 
					        #endregion
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        #region 按钮颜色
 | 
				
			||||||
 | 
					        private Brush _button1Color = Brushes.White;
 | 
				
			||||||
 | 
					        public Brush Button1Color
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => _button1Color;
 | 
				
			||||||
 | 
					            set => SetProperty(ref _button1Color, value);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        private Brush _button2Color = Brushes.White;
 | 
				
			||||||
 | 
					        public Brush Button2Color
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => _button2Color;
 | 
				
			||||||
 | 
					            set => SetProperty(ref _button2Color, value);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        private Brush _button3Color = Brushes.White;
 | 
				
			||||||
 | 
					        public Brush Button3Color
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => _button3Color;
 | 
				
			||||||
 | 
					            set => SetProperty(ref _button3Color, value);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        private Brush _button4Color = Brushes.White;
 | 
				
			||||||
 | 
					        public Brush Button4Color
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => _button4Color;
 | 
				
			||||||
 | 
					            set => SetProperty(ref _button4Color, value);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        private Brush _button5Color = Brushes.White;
 | 
				
			||||||
 | 
					        public Brush Button5Color
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => _button5Color;
 | 
				
			||||||
 | 
					            set => SetProperty(ref _button5Color, value);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        private Brush _button6Color = Brushes.White;
 | 
				
			||||||
 | 
					        public Brush Button6Color
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => _button6Color;
 | 
				
			||||||
 | 
					            set => SetProperty(ref _button6Color, value);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        private Brush _button7Color = Brushes.White;
 | 
				
			||||||
 | 
					        public Brush Button7Color
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => _button7Color;
 | 
				
			||||||
 | 
					            set => SetProperty(ref _button7Color, value);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        private Brush _button8Color = Brushes.White;
 | 
				
			||||||
 | 
					        public Brush Button8Color
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => _button8Color;
 | 
				
			||||||
 | 
					            set => SetProperty(ref _button8Color, value);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        private Brush _button9Color = Brushes.White;
 | 
				
			||||||
 | 
					        public Brush Button9Color
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => _button9Color;
 | 
				
			||||||
 | 
					            set => SetProperty(ref _button9Color, value);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        private Brush _button10Color = Brushes.White;
 | 
				
			||||||
 | 
					        public Brush Button10Color
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => _button10Color;
 | 
				
			||||||
 | 
					            set => SetProperty(ref _button10Color, value);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        private Brush _button11Color = Brushes.White;
 | 
				
			||||||
 | 
					        public Brush Button11Color
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => _button11Color;
 | 
				
			||||||
 | 
					            set => SetProperty(ref _button11Color, value);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        private Brush _button12Color = Brushes.White;
 | 
				
			||||||
 | 
					        public Brush Button12Color
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => _button12Color;
 | 
				
			||||||
 | 
					            set => SetProperty(ref _button12Color, value);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        private Brush _button13Color = Brushes.White;
 | 
				
			||||||
 | 
					        public Brush Button13Color
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => _button13Color;
 | 
				
			||||||
 | 
					            set => SetProperty(ref _button13Color, value);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        private Brush _button14Color = Brushes.White;
 | 
				
			||||||
 | 
					        public Brush Button14Color
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => _button14Color;
 | 
				
			||||||
 | 
					            set => SetProperty(ref _button14Color, value);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        private Brush _button15Color = Brushes.White;
 | 
				
			||||||
 | 
					        public Brush Button15Color
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => _button15Color;
 | 
				
			||||||
 | 
					            set => SetProperty(ref _button15Color, value);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        private Brush _button16Color = Brushes.White;
 | 
				
			||||||
 | 
					        public Brush Button16Color
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => _button16Color;
 | 
				
			||||||
 | 
					            set => SetProperty(ref _button16Color, value);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        private Brush _button17Color = Brushes.White;
 | 
				
			||||||
 | 
					        public Brush Button17Color
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => _button17Color;
 | 
				
			||||||
 | 
					            set => SetProperty(ref _button17Color, value);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        private Brush _button18Color = Brushes.White;
 | 
				
			||||||
 | 
					        public Brush Button18Color
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => _button18Color;
 | 
				
			||||||
 | 
					            set => SetProperty(ref _button18Color, value);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        #endregion
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        IEventAggregator _eventAggregator;
 | 
				
			||||||
 | 
					        private PortUtil _portUtil;
 | 
				
			||||||
 | 
					        public CheckOrderNewWindowViewModel(PortUtil portUtil, IEventAggregator eventAggregator)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            _portUtil = portUtil;
 | 
				
			||||||
 | 
					            _eventAggregator = eventAggregator;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        private string? _searchValue;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 查询条件 查询字段值
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        public string? SearchValue
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get { return _searchValue; }
 | 
				
			||||||
 | 
					            set
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                SetProperty(ref _searchValue, value);
 | 
				
			||||||
 | 
					                RequestData();
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        void RequestData()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            int totalCount = 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();
 | 
				
			||||||
 | 
					                string currentDrawerUser = currentList.BelongUser;
 | 
				
			||||||
 | 
					                OrderInfoList = SqlSugarHelper.Db.Queryable<OrderInfo>()
 | 
				
			||||||
 | 
					                                .Includes(oi => oi.OrderDetailList, od => od.DrugInfo)
 | 
				
			||||||
 | 
					                               //.Includes(cl => cl.channelStocks, cs => cs.DrugInfo,di=>di.drugBase)
 | 
				
			||||||
 | 
					                               //.InnerJoin<OrderDetail>((oi, od) => oi.OrderNo == od.OrderNo)
 | 
				
			||||||
 | 
					                               //.InnerJoin<DrugInfo>((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 == 1)
 | 
				
			||||||
 | 
					                               .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);
 | 
				
			||||||
 | 
					                    OrderInfoList.ForEach(oi => oi.OrderDetailList.ForEach(od => od.DrugInfo = od.DrugInfo ?? new DrugInfo()));
 | 
				
			||||||
 | 
					                    //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;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                TotalCount = totalCount;
 | 
				
			||||||
 | 
					                PageCount = (int)Math.Ceiling((double)TotalCount / PageSize);
 | 
				
			||||||
 | 
					                if (Convert.ToDateTime(currentList.EffDate).ToString("yyyy-MM-dd") == DateTime.Now.ToString("yyyy-MM-dd"))
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    switch (DrawerNo)
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        case 1:
 | 
				
			||||||
 | 
					                            _button1Color = Brushes.Yellow;
 | 
				
			||||||
 | 
					                            break;
 | 
				
			||||||
 | 
					                        case 2:
 | 
				
			||||||
 | 
					                            _button2Color = Brushes.Yellow;
 | 
				
			||||||
 | 
					                            break;
 | 
				
			||||||
 | 
					                        case 3:
 | 
				
			||||||
 | 
					                            _button3Color = Brushes.Yellow;
 | 
				
			||||||
 | 
					                            break;
 | 
				
			||||||
 | 
					                        case 4:
 | 
				
			||||||
 | 
					                            _button4Color = Brushes.Yellow;
 | 
				
			||||||
 | 
					                            break;
 | 
				
			||||||
 | 
					                        case 5:
 | 
				
			||||||
 | 
					                            _button5Color = Brushes.Yellow;
 | 
				
			||||||
 | 
					                            break;
 | 
				
			||||||
 | 
					                        case 6:
 | 
				
			||||||
 | 
					                            _button6Color = Brushes.Yellow;
 | 
				
			||||||
 | 
					                            break;
 | 
				
			||||||
 | 
					                        case 7:
 | 
				
			||||||
 | 
					                            _button7Color = Brushes.Yellow;
 | 
				
			||||||
 | 
					                            break;
 | 
				
			||||||
 | 
					                        case 8:
 | 
				
			||||||
 | 
					                            _button8Color = Brushes.Yellow;
 | 
				
			||||||
 | 
					                            break;
 | 
				
			||||||
 | 
					                        case 9:
 | 
				
			||||||
 | 
					                            _button9Color = Brushes.Yellow;
 | 
				
			||||||
 | 
					                            break;
 | 
				
			||||||
 | 
					                        case 10:
 | 
				
			||||||
 | 
					                            _button10Color = Brushes.Yellow;
 | 
				
			||||||
 | 
					                            break;
 | 
				
			||||||
 | 
					                        case 11:
 | 
				
			||||||
 | 
					                            _button11Color = Brushes.Yellow;
 | 
				
			||||||
 | 
					                            break;
 | 
				
			||||||
 | 
					                        case 12:
 | 
				
			||||||
 | 
					                            _button12Color = Brushes.Yellow;
 | 
				
			||||||
 | 
					                            break;
 | 
				
			||||||
 | 
					                        case 13:
 | 
				
			||||||
 | 
					                            _button13Color = Brushes.Yellow;
 | 
				
			||||||
 | 
					                            break;
 | 
				
			||||||
 | 
					                        case 14:
 | 
				
			||||||
 | 
					                            _button14Color = Brushes.Yellow;
 | 
				
			||||||
 | 
					                            break;
 | 
				
			||||||
 | 
					                        case 15:
 | 
				
			||||||
 | 
					                            _button15Color = Brushes.Yellow;
 | 
				
			||||||
 | 
					                            break;
 | 
				
			||||||
 | 
					                        case 16:
 | 
				
			||||||
 | 
					                            _button16Color = Brushes.Yellow;
 | 
				
			||||||
 | 
					                            break;
 | 
				
			||||||
 | 
					                        case 17:
 | 
				
			||||||
 | 
					                            _button17Color = Brushes.Yellow;
 | 
				
			||||||
 | 
					                            break;
 | 
				
			||||||
 | 
					                        case 18:
 | 
				
			||||||
 | 
					                            _button18Color = Brushes.Yellow;
 | 
				
			||||||
 | 
					                            break;
 | 
				
			||||||
 | 
					                        default:
 | 
				
			||||||
 | 
					                            break;
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            List<ChannelList> chlList = SqlSugarHelper.Db.Queryable<ChannelList>().Where(cl => cl.MachineId == "DM5").ToList();//.Select(cl => cl.BelongUser).First();
 | 
				
			||||||
 | 
					            if (chlList != null && chlList.Count > 0)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                for (int i = 0; i < chlList.Count; i++)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    ChannelList chl = chlList[i];
 | 
				
			||||||
 | 
					                    if (Convert.ToDateTime(chl.EffDate).ToString("yyyy-MM-dd") == DateTime.Now.ToString("yyyy-MM-dd"))
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        switch (chl.DrawerNo)
 | 
				
			||||||
 | 
					                        {
 | 
				
			||||||
 | 
					                            case 1:
 | 
				
			||||||
 | 
					                                Button1Color = Brushes.Yellow;
 | 
				
			||||||
 | 
					                                break;
 | 
				
			||||||
 | 
					                            case 2:
 | 
				
			||||||
 | 
					                                Button2Color = Brushes.Yellow;
 | 
				
			||||||
 | 
					                                break;
 | 
				
			||||||
 | 
					                            case 3:
 | 
				
			||||||
 | 
					                                Button3Color = Brushes.Yellow;
 | 
				
			||||||
 | 
					                                break;
 | 
				
			||||||
 | 
					                            case 4:
 | 
				
			||||||
 | 
					                                Button4Color = Brushes.Yellow;
 | 
				
			||||||
 | 
					                                break;
 | 
				
			||||||
 | 
					                            case 5:
 | 
				
			||||||
 | 
					                                Button5Color = Brushes.Yellow;
 | 
				
			||||||
 | 
					                                break;
 | 
				
			||||||
 | 
					                            case 6:
 | 
				
			||||||
 | 
					                                Button6Color = Brushes.Yellow;
 | 
				
			||||||
 | 
					                                break;
 | 
				
			||||||
 | 
					                            case 7:
 | 
				
			||||||
 | 
					                                Button7Color = Brushes.Yellow;
 | 
				
			||||||
 | 
					                                break;
 | 
				
			||||||
 | 
					                            case 8:
 | 
				
			||||||
 | 
					                                Button8Color = Brushes.Yellow;
 | 
				
			||||||
 | 
					                                break;
 | 
				
			||||||
 | 
					                            case 9:
 | 
				
			||||||
 | 
					                                Button9Color = Brushes.Yellow;
 | 
				
			||||||
 | 
					                                break;
 | 
				
			||||||
 | 
					                            case 10:
 | 
				
			||||||
 | 
					                                Button10Color = Brushes.Yellow;
 | 
				
			||||||
 | 
					                                break;
 | 
				
			||||||
 | 
					                            case 11:
 | 
				
			||||||
 | 
					                                Button11Color = Brushes.Yellow;
 | 
				
			||||||
 | 
					                                break;
 | 
				
			||||||
 | 
					                            case 12:
 | 
				
			||||||
 | 
					                                Button12Color = Brushes.Yellow;
 | 
				
			||||||
 | 
					                                break;
 | 
				
			||||||
 | 
					                            case 13:
 | 
				
			||||||
 | 
					                                Button13Color = Brushes.Yellow;
 | 
				
			||||||
 | 
					                                break;
 | 
				
			||||||
 | 
					                            case 14:
 | 
				
			||||||
 | 
					                                Button14Color = Brushes.Yellow;
 | 
				
			||||||
 | 
					                                break;
 | 
				
			||||||
 | 
					                            case 15:
 | 
				
			||||||
 | 
					                                Button15Color = Brushes.Yellow;
 | 
				
			||||||
 | 
					                                break;
 | 
				
			||||||
 | 
					                            case 16:
 | 
				
			||||||
 | 
					                                Button16Color = Brushes.Yellow;
 | 
				
			||||||
 | 
					                                break;
 | 
				
			||||||
 | 
					                            case 17:
 | 
				
			||||||
 | 
					                                Button17Color = Brushes.Yellow;
 | 
				
			||||||
 | 
					                                break;
 | 
				
			||||||
 | 
					                            case 18:
 | 
				
			||||||
 | 
					                                Button18Color = Brushes.Yellow;
 | 
				
			||||||
 | 
					                                break;
 | 
				
			||||||
 | 
					                            default:
 | 
				
			||||||
 | 
					                                break;
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        public DelegateCommand RowSelected
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => new DelegateCommand(() =>
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                if (selectOrderInfo != null)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    OrderInfoList = OrderInfoList.Select(x =>
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        if (x.OrderNo == selectOrderInfo.OrderNo)
 | 
				
			||||||
 | 
					                        {
 | 
				
			||||||
 | 
					                            x.ItemIsChecked = !x.ItemIsChecked;
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
 | 
					                        return x;
 | 
				
			||||||
 | 
					                    }).ToList();
 | 
				
			||||||
 | 
					                    if (OrderInfoList != null && OrderInfoList.Count() > 0)
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        //TotalDrugList = OrderInfoList.Where(oi => oi.ItemIsChecked).GroupBy(oi => oi._OrderDetail.DrugInfo.DrugName).Select(oi => new TotalDrug { DrugName = oi.Key, TotalCount = oi.Sum(item => item._OrderDetail.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();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            });
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        public DelegateCommand Query
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => new DelegateCommand(() =>
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                RequestData();
 | 
				
			||||||
 | 
					            });
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        //确认
 | 
				
			||||||
 | 
					        public DelegateCommand CheckOrder
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => new DelegateCommand(() =>
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                CheckOrderAction();
 | 
				
			||||||
 | 
					            });
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        void CheckOrderAction()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            var confirmData = OrderInfoList.Where(oi => oi.ItemIsChecked == true).ToList();
 | 
				
			||||||
 | 
					            if (confirmData.Count > 0)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                var f = SqlSugarHelper.Db.UseTran(() =>
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    string empChannelStock = string.Empty;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    for (int i = 0; i < confirmData.Count; i++)
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        OrderInfo oi = confirmData[i];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                        //更新处方状态
 | 
				
			||||||
 | 
					                        if (oi.DmStatus == 1)
 | 
				
			||||||
 | 
					                        {
 | 
				
			||||||
 | 
					                            SqlSugarHelper.Db.Updateable(new OrderInfo()
 | 
				
			||||||
 | 
					                            {
 | 
				
			||||||
 | 
					                                DmStatus = 2,
 | 
				
			||||||
 | 
					                                OrderNo = oi.OrderNo
 | 
				
			||||||
 | 
					                            }).UpdateColumns(it => new { it.DmStatus }).WhereColumns(it => new { it.OrderNo }).ExecuteCommand();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                            SqlSugarHelper.Db.Insertable(new OrderFinish()
 | 
				
			||||||
 | 
					                            {
 | 
				
			||||||
 | 
					                                OrderNo = oi.OrderNo,
 | 
				
			||||||
 | 
					                                PatientId = oi.PatientId,
 | 
				
			||||||
 | 
					                                Pharmacy = oi.Pharmacy,
 | 
				
			||||||
 | 
					                                State = 2,
 | 
				
			||||||
 | 
					                                Operator = HomeWindowViewModel.Operator?.Nickname,
 | 
				
			||||||
 | 
					                            });
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                        //Expression<Func<ChannelStock, bool>> updateExp = it => it.ManuNo == oi._OrderDetail.SetManuNo && it.EffDate == oi._OrderDetail.SetEffDate;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                        for (int j = 0; j < oi.OrderDetailList.Count; j++)
 | 
				
			||||||
 | 
					                        {
 | 
				
			||||||
 | 
					                            oi._OrderDetail = oi.OrderDetailList[j];
 | 
				
			||||||
 | 
					                            int drawerNo = DrawerNo + 1;
 | 
				
			||||||
 | 
					                            ChannelStock cs = SqlSugarHelper.Db.Queryable<ChannelStock>()
 | 
				
			||||||
 | 
					                                             .Where(cs => cs.DrugId == oi._OrderDetail.DrugId
 | 
				
			||||||
 | 
					                                                    && cs.ManuNo == oi._OrderDetail.SetManuNo
 | 
				
			||||||
 | 
					                                                   // && cs.EffDate == oi._OrderDetail.SetEffDate
 | 
				
			||||||
 | 
					                                                    && cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM5")
 | 
				
			||||||
 | 
					                                                    && cs.DrawerNo == drawerNo
 | 
				
			||||||
 | 
					                                                    &&cs.Quantity>=oi._OrderDetail.Quantity).First();
 | 
				
			||||||
 | 
					                            if (cs == null)
 | 
				
			||||||
 | 
					                            {
 | 
				
			||||||
 | 
					                                empChannelStock += $"{oi.OrderNo},{oi._OrderDetail.DrugId},{oi._OrderDetail.SetManuNo},{oi._OrderDetail.SetEffDate};";
 | 
				
			||||||
 | 
					                                continue;
 | 
				
			||||||
 | 
					                            }
 | 
				
			||||||
 | 
					                            cs.Quantity = cs.Quantity - oi._OrderDetail.Quantity;
 | 
				
			||||||
 | 
					                            // 更新数据 库存信息
 | 
				
			||||||
 | 
					                            SqlSugarHelper.Db.Updateable(cs).UpdateColumns(it => new { it.Quantity }).ExecuteCommand();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                            if (cs != null)
 | 
				
			||||||
 | 
					                            {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                                SqlSugarHelper.Db.Insertable(new MachineRecord()
 | 
				
			||||||
 | 
					                                {
 | 
				
			||||||
 | 
					                                    MachineId = ConfigurationManager.AppSettings["dm_machineId"].ToString(),
 | 
				
			||||||
 | 
					                                    DrawerNo = cs.DrawerNo,
 | 
				
			||||||
 | 
					                                    ColNo = cs.ColNo,
 | 
				
			||||||
 | 
					                                    DrugId = cs.DrugId,
 | 
				
			||||||
 | 
					                                    ManuNo = cs.ManuNo,
 | 
				
			||||||
 | 
					                                    EffDate = !String.IsNullOrEmpty(cs.EffDate) ? DateTime.ParseExact(cs.EffDate, "yyyy-MM-dd", System.Globalization.CultureInfo.CurrentCulture) : null,
 | 
				
			||||||
 | 
					                                    Operator = HomeWindowViewModel.Operator?.Id,
 | 
				
			||||||
 | 
					                                    Reviewer = HomeWindowViewModel.Reviewer?.Id,
 | 
				
			||||||
 | 
					                                    OperationTime = DateTime.Now,
 | 
				
			||||||
 | 
					                                    Quantity = oi._OrderDetail.Quantity,
 | 
				
			||||||
 | 
					                                    Type = 2,
 | 
				
			||||||
 | 
					                                    InvoiceId = oi.OrderNo
 | 
				
			||||||
 | 
					                                    //, StockQuantity = nowChannels.Sum(it => it.Quantity)
 | 
				
			||||||
 | 
					                                }).ExecuteCommand();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                                #region 记录 注射剂使用与交接记录报表
 | 
				
			||||||
 | 
					                                //查询发药时间
 | 
				
			||||||
 | 
					                                //MachineRecord SendMachineRecord = SqlSugarHelper.Db.Queryable<MachineRecord>().Where(mr => mr.DrawerNo == cs.DrawerNo && mr.Type == 2)
 | 
				
			||||||
 | 
					                                //.OrderByDescending(mr => mr.OperationTime)
 | 
				
			||||||
 | 
					                                //.First();
 | 
				
			||||||
 | 
					                                //string retUser = SqlSugarHelper.Db.Queryable<ChannelList>().Where(cl => cl.MachineId == (ConfigurationManager.AppSettings["machineId"] ?? "DM5") && cl.DrawerNo == cs.DrawerNo)
 | 
				
			||||||
 | 
					                                //.Select(cl => cl.BelongUser).First();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                                RejectionReport rejectionReport = SqlSugarHelper.Db.Queryable<RejectionReport>().Where(rp => rp.DrugId == cs.DrugId && rp.DrawerNo == cs.DrawerNo).OrderByDescending(rp => rp.SendDate).First();
 | 
				
			||||||
 | 
					                                if (rejectionReport != null)
 | 
				
			||||||
 | 
					                                {
 | 
				
			||||||
 | 
					                                    //发药信息
 | 
				
			||||||
 | 
					                                    //RejectionReport rejectionReport = new RejectionReport();
 | 
				
			||||||
 | 
					                                    //rejectionReport.SendDate = SendMachineRecord.OperationTime;
 | 
				
			||||||
 | 
					                                    //rejectionReport.SendUser = SendMachineRecord.Operator.ToString();
 | 
				
			||||||
 | 
					                                    //rejectionReport.ReceiveUser = retUser;
 | 
				
			||||||
 | 
					                                    rejectionReport.RealNum = cs.BaseQuantity;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                                    //还药信息
 | 
				
			||||||
 | 
					                                    rejectionReport.InfactNum = cs.BaseQuantity - oi._OrderDetail.Quantity;
 | 
				
			||||||
 | 
					                                    rejectionReport.EmptyNum = oi._OrderDetail.Quantity;
 | 
				
			||||||
 | 
					                                    rejectionReport.ReturnTime = DateTime.Now.ToString();
 | 
				
			||||||
 | 
					                                    rejectionReport.ReturnUser = rejectionReport.SendUser;
 | 
				
			||||||
 | 
					                                    rejectionReport.ReturnReceiveUser = rejectionReport.ReceiveUser;// SendMachineRecord.Operator.ToString();
 | 
				
			||||||
 | 
					                                    rejectionReport.DrugId = oi._OrderDetail.DrugId;
 | 
				
			||||||
 | 
					                                    rejectionReport.DrugName = oi._OrderDetail.DrugInfo.DrugName;
 | 
				
			||||||
 | 
					                                    rejectionReport.DrugSpec = oi._OrderDetail.DrugInfo.DrugSpec;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                                    rejectionReport.OperationTime = DateTime.Now;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                                    int iRejectionReport = SqlSugarHelper.Db.Updateable(rejectionReport).ExecuteCommand();
 | 
				
			||||||
 | 
					                                }
 | 
				
			||||||
 | 
					                                #endregion
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                            }
 | 
				
			||||||
 | 
					                            //保存账册
 | 
				
			||||||
 | 
					                            int iInsertResult = SqlSugarHelper.Db.Insertable(new AccountBookG2()
 | 
				
			||||||
 | 
					                            {
 | 
				
			||||||
 | 
					                                DrugId = oi._OrderDetail.DrugId,
 | 
				
			||||||
 | 
					                                Type = 2,
 | 
				
			||||||
 | 
					                                Department = oi.DeptName,
 | 
				
			||||||
 | 
					                                OrderNo = oi.OrderNo,
 | 
				
			||||||
 | 
					                                ManuNo = cs.ManuNo,
 | 
				
			||||||
 | 
					                                EffDate = cs.EffDate,
 | 
				
			||||||
 | 
					                                OutQuantity = oi._OrderDetail.Quantity,
 | 
				
			||||||
 | 
					                                UserId1 = HomeWindowViewModel.Operator?.Id,
 | 
				
			||||||
 | 
					                                UserId2 = HomeWindowViewModel.Reviewer?.Id,
 | 
				
			||||||
 | 
					                                MachineId = ConfigurationManager.AppSettings["dm_machineId"].ToString(),
 | 
				
			||||||
 | 
					                                CreateDate = DateTime.Now.ToString("yyyy-MM-dd"),
 | 
				
			||||||
 | 
					                                CreateTime = DateTime.Now,
 | 
				
			||||||
 | 
					                                InvoiceNo = oi.OrderNo
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                            }).ExecuteCommand();
 | 
				
			||||||
 | 
					                            //修改凌晨生成的日结存与总结存数据
 | 
				
			||||||
 | 
					                            AccountBookG2 accountBookG2Day = SqlSugarHelper.Db.Queryable<AccountBookG2>()
 | 
				
			||||||
 | 
					                            .Where(ab => ab.MachineId.Equals(ConfigurationManager.AppSettings["dm_machineId"].ToString()))
 | 
				
			||||||
 | 
					                            .Where(ab => ab.Type == 3)
 | 
				
			||||||
 | 
					                            .Where(ab => ab.DrugId == oi._OrderDetail.DrugId)
 | 
				
			||||||
 | 
					                            .Where(ab => ab.ManuNo == cs.ManuNo)
 | 
				
			||||||
 | 
					                            .Where(ab => ab.CreateDate == DateTime.Now.ToString("yyyy-MM-dd")).First();
 | 
				
			||||||
 | 
					                            if (accountBookG2Day != null)
 | 
				
			||||||
 | 
					                            {
 | 
				
			||||||
 | 
					                                accountBookG2Day.ManuStock = accountBookG2Day.ManuStock - oi._OrderDetail.Quantity;
 | 
				
			||||||
 | 
					                                SqlSugarHelper.Db.Updateable(accountBookG2Day).ExecuteCommand();
 | 
				
			||||||
 | 
					                            }
 | 
				
			||||||
 | 
					                            else
 | 
				
			||||||
 | 
					                            {
 | 
				
			||||||
 | 
					                                //生成日结存时可能没有该库位的绑定信息,需要写入日结存
 | 
				
			||||||
 | 
					                                int iDayResult = SqlSugarHelper.Db.Insertable(new AccountBookG2()
 | 
				
			||||||
 | 
					                                {
 | 
				
			||||||
 | 
					                                    DrugId = oi._OrderDetail.DrugId,
 | 
				
			||||||
 | 
					                                    Type = 3,
 | 
				
			||||||
 | 
					                                    ManuNo = cs.ManuNo,
 | 
				
			||||||
 | 
					                                    EffDate = cs.EffDate,
 | 
				
			||||||
 | 
					                                    YQuantity = 0,
 | 
				
			||||||
 | 
					                                    ManuStock = oi._OrderDetail.Quantity,
 | 
				
			||||||
 | 
					                                    TotalStock = oi._OrderDetail.Quantity,
 | 
				
			||||||
 | 
					                                    UserId1 = HomeWindowViewModel.Operator?.Id,
 | 
				
			||||||
 | 
					                                    UserId2 = HomeWindowViewModel.Reviewer?.Id,
 | 
				
			||||||
 | 
					                                    MachineId = ConfigurationManager.AppSettings["dm_machineId"].ToString(),
 | 
				
			||||||
 | 
					                                    CreateDate = DateTime.Now.ToString("yyyy-MM-dd"),
 | 
				
			||||||
 | 
					                                    InvoiceNo = "日结存"
 | 
				
			||||||
 | 
					                                }).ExecuteCommand();
 | 
				
			||||||
 | 
					                                if (iDayResult <= 0)
 | 
				
			||||||
 | 
					                                {
 | 
				
			||||||
 | 
					                                    logger.Info($"未写入日结存数据{oi._OrderDetail.DrugId}-{cs.ManuNo}-{cs.EffDate}-{cs.Quantity}");
 | 
				
			||||||
 | 
					                                }
 | 
				
			||||||
 | 
					                            }
 | 
				
			||||||
 | 
					                            //修改凌晨生成的日结存与总结存数据
 | 
				
			||||||
 | 
					                            AccountBookG2 accountBookG2Total = SqlSugarHelper.Db.Queryable<AccountBookG2>()
 | 
				
			||||||
 | 
					                            .Where(ab => ab.MachineId.Equals(ConfigurationManager.AppSettings["dm_machineId"].ToString()))
 | 
				
			||||||
 | 
					                            .Where(ab => ab.Type == 4)
 | 
				
			||||||
 | 
					                            .Where(ab => ab.DrugId == oi._OrderDetail.DrugId)
 | 
				
			||||||
 | 
					                            .Where(ab => ab.CreateDate == DateTime.Now.ToString("yyyy-MM-dd")).First();
 | 
				
			||||||
 | 
					                            if (accountBookG2Total != null)
 | 
				
			||||||
 | 
					                            {
 | 
				
			||||||
 | 
					                                accountBookG2Total.TotalStock = accountBookG2Total.TotalStock - oi._OrderDetail.Quantity;
 | 
				
			||||||
 | 
					                                SqlSugarHelper.Db.Updateable(accountBookG2Total).ExecuteCommand();
 | 
				
			||||||
 | 
					                            }
 | 
				
			||||||
 | 
					                            else
 | 
				
			||||||
 | 
					                            {
 | 
				
			||||||
 | 
					                                //生成总结存时可能没有该库位的绑定信息,需要写入总结存
 | 
				
			||||||
 | 
					                                int iTotalResult = SqlSugarHelper.Db.Insertable(new AccountBookG2()
 | 
				
			||||||
 | 
					                                {
 | 
				
			||||||
 | 
					                                    DrugId = oi._OrderDetail.DrugId,
 | 
				
			||||||
 | 
					                                    Type = 4,
 | 
				
			||||||
 | 
					                                    YQuantity = 0,
 | 
				
			||||||
 | 
					                                    ManuStock = oi._OrderDetail.Quantity,
 | 
				
			||||||
 | 
					                                    TotalStock = oi._OrderDetail.Quantity,
 | 
				
			||||||
 | 
					                                    UserId1 = HomeWindowViewModel.Operator?.Id,
 | 
				
			||||||
 | 
					                                    UserId2 = HomeWindowViewModel.Reviewer?.Id,
 | 
				
			||||||
 | 
					                                    MachineId = ConfigurationManager.AppSettings["dm_machineId"].ToString(),
 | 
				
			||||||
 | 
					                                    CreateDate = DateTime.Now.ToString("yyyy-MM-dd"),
 | 
				
			||||||
 | 
					                                    InvoiceNo = "总结存"
 | 
				
			||||||
 | 
					                                }).ExecuteCommand();
 | 
				
			||||||
 | 
					                                if (iTotalResult <= 0)
 | 
				
			||||||
 | 
					                                {
 | 
				
			||||||
 | 
					                                    logger.Info($"未写入总结存数据{oi._OrderDetail.DrugId}-{oi._OrderDetail.Quantity}");
 | 
				
			||||||
 | 
					                                }
 | 
				
			||||||
 | 
					                            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    if (!string.IsNullOrEmpty(empChannelStock))
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        AlertMsg alertMsg = new AlertMsg
 | 
				
			||||||
 | 
					                        {
 | 
				
			||||||
 | 
					                            Message = $"所选单子中对应药品批次效期无效{empChannelStock}",
 | 
				
			||||||
 | 
					                            Type = MsgType.ERROR,
 | 
				
			||||||
 | 
					                        };
 | 
				
			||||||
 | 
					                        _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
 | 
				
			||||||
 | 
					                        logger.Info($"所选单子对应药品批次效期无效{empChannelStock}");
 | 
				
			||||||
 | 
					                        throw new Exception("事务回滚");
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    return true;
 | 
				
			||||||
 | 
					                });
 | 
				
			||||||
 | 
					                if (f.Data)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    RequestData();
 | 
				
			||||||
 | 
					                    AlertMsg alertMsg = new AlertMsg
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        Message = "所选单子已核对完成",
 | 
				
			||||||
 | 
					                        Type = MsgType.SUCCESS,
 | 
				
			||||||
 | 
					                    };
 | 
				
			||||||
 | 
					                    _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
 | 
				
			||||||
 | 
					                    RequestData();
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                if (!f.IsSuccess)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    AlertMsg alertMsg = new AlertMsg
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        Message = "核对失败!",
 | 
				
			||||||
 | 
					                        Type = MsgType.ERROR,
 | 
				
			||||||
 | 
					                    };
 | 
				
			||||||
 | 
					                    _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                Status = 0;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            else
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                AlertMsg alertMsg = new AlertMsg
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    Message = "请勾选要核对单数据",
 | 
				
			||||||
 | 
					                    Type = MsgType.ERROR
 | 
				
			||||||
 | 
					                };
 | 
				
			||||||
 | 
					                _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 选择药箱,打开药箱
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        public DelegateCommand<string> UpdateDrawerNo
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => new DelegateCommand<string>(OpenBoxAction);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public bool KeepAlive => false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public async void OpenBoxAction(string strDrawerNo)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            DrawerNo = Convert.ToInt32(strDrawerNo);
 | 
				
			||||||
 | 
					            MachineRecord machineRecord = new MachineRecord();
 | 
				
			||||||
 | 
					            machineRecord.MachineId = "DM5";
 | 
				
			||||||
 | 
					            machineRecord.DrawerNo = DrawerNo + 1;
 | 
				
			||||||
 | 
					            machineRecord.Operator = HomeWindowViewModel.Operator?.Id;
 | 
				
			||||||
 | 
					            machineRecord.OperationTime = DateTime.Now;
 | 
				
			||||||
 | 
					            machineRecord.Type = 55;
 | 
				
			||||||
 | 
					            machineRecord.InvoiceId = $"打开{DrawerNo + 1}号药箱";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            if (DrawerNo > 0)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                RequestData();
 | 
				
			||||||
 | 
					                Status = 1;
 | 
				
			||||||
 | 
					                _portUtil.SpeakAsync($"正在打开{DrawerNo + 1}号药箱");
 | 
				
			||||||
 | 
					                //logger.Info($"正在打开{DrawerNo + 1}号药箱");
 | 
				
			||||||
 | 
					                //记录开药箱日志
 | 
				
			||||||
 | 
					                SqlSugarHelper.Db.Insertable(machineRecord).ExecuteCommand();
 | 
				
			||||||
 | 
					                ModbusHelper.GetInstance().OpenBoxDoor(DrawerNo);
 | 
				
			||||||
 | 
					                //设置对应药箱按钮可用状态
 | 
				
			||||||
 | 
					                SetIsEnableStatus(DrawerNo, false);
 | 
				
			||||||
 | 
					                //_eventAggregator.GetEvent<BoxOpenStatusEvent>().Publish();
 | 
				
			||||||
 | 
					                if (CheckBoxStatusTimer is null)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    CheckBoxStatusTimer = new System.Timers.Timer();
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                if (!CheckBoxStatusTimer.Enabled)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    CheckBoxStatusTimer.Elapsed += new System.Timers.ElapsedEventHandler(GetAllBoxState);
 | 
				
			||||||
 | 
					                    CheckBoxStatusTimer.Interval = 3000;
 | 
				
			||||||
 | 
					                    CheckBoxStatusTimer.Start();
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                //设置对应药箱按钮可用状态
 | 
				
			||||||
 | 
					                //SetIsEnableStatus(DrawerNo, false);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        private void SetIsEnableStatus(int drawerNO, bool status)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            switch (drawerNO)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                case 0:
 | 
				
			||||||
 | 
					                    IsEnabled1 = status;
 | 
				
			||||||
 | 
					                    break;
 | 
				
			||||||
 | 
					                case 1:
 | 
				
			||||||
 | 
					                    IsEnabled2 = status;
 | 
				
			||||||
 | 
					                    break;
 | 
				
			||||||
 | 
					                case 2:
 | 
				
			||||||
 | 
					                    IsEnabled3 = status;
 | 
				
			||||||
 | 
					                    break;
 | 
				
			||||||
 | 
					                case 3:
 | 
				
			||||||
 | 
					                    IsEnabled4 = status;
 | 
				
			||||||
 | 
					                    break;
 | 
				
			||||||
 | 
					                case 4:
 | 
				
			||||||
 | 
					                    IsEnabled5 = status;
 | 
				
			||||||
 | 
					                    break;
 | 
				
			||||||
 | 
					                case 5:
 | 
				
			||||||
 | 
					                    IsEnabled6 = status;
 | 
				
			||||||
 | 
					                    break;
 | 
				
			||||||
 | 
					                case 6:
 | 
				
			||||||
 | 
					                    IsEnabled7 = status;
 | 
				
			||||||
 | 
					                    break;
 | 
				
			||||||
 | 
					                case 7:
 | 
				
			||||||
 | 
					                    IsEnabled8 = status;
 | 
				
			||||||
 | 
					                    break;
 | 
				
			||||||
 | 
					                case 8:
 | 
				
			||||||
 | 
					                    IsEnabled9 = status;
 | 
				
			||||||
 | 
					                    break;
 | 
				
			||||||
 | 
					                case 9:
 | 
				
			||||||
 | 
					                    IsEnabled10 = status;
 | 
				
			||||||
 | 
					                    break;
 | 
				
			||||||
 | 
					                case 10:
 | 
				
			||||||
 | 
					                    IsEnabled11 = status;
 | 
				
			||||||
 | 
					                    break;
 | 
				
			||||||
 | 
					                case 11:
 | 
				
			||||||
 | 
					                    IsEnabled12 = status;
 | 
				
			||||||
 | 
					                    break;
 | 
				
			||||||
 | 
					                case 12:
 | 
				
			||||||
 | 
					                    IsEnabled13 = status;
 | 
				
			||||||
 | 
					                    break;
 | 
				
			||||||
 | 
					                case 13:
 | 
				
			||||||
 | 
					                    IsEnabled14 = status;
 | 
				
			||||||
 | 
					                    break;
 | 
				
			||||||
 | 
					                case 14:
 | 
				
			||||||
 | 
					                    IsEnabled15 = status;
 | 
				
			||||||
 | 
					                    break;
 | 
				
			||||||
 | 
					                case 15:
 | 
				
			||||||
 | 
					                    IsEnabled16 = status;
 | 
				
			||||||
 | 
					                    break;
 | 
				
			||||||
 | 
					                case 16:
 | 
				
			||||||
 | 
					                    IsEnabled17 = status;
 | 
				
			||||||
 | 
					                    break;
 | 
				
			||||||
 | 
					                case 17:
 | 
				
			||||||
 | 
					                    IsEnabled18 = status;
 | 
				
			||||||
 | 
					                    break;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public void OnNavigatedTo(NavigationContext navigationContext)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            RequestData();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public bool IsNavigationTarget(NavigationContext navigationContext)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            return true;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public void OnNavigatedFrom(NavigationContext navigationContext)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        private void GetAllBoxState(object sender, ElapsedEventArgs e)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            //查询药箱是否关闭,如果已经关闭则按钮可用,可继续开该编号的药箱
 | 
				
			||||||
 | 
					            if (DrawerNo >= 0)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                bool[] boolArrs =  ModbusHelper.GetInstance().GetAllBoxState();
 | 
				
			||||||
 | 
					                bool allFalse = Array.TrueForAll(boolArrs, b => b == false);
 | 
				
			||||||
 | 
					                if (allFalse)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    if (CheckBoxStatusTimer.Enabled)
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        CheckBoxStatusTimer.Stop();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                for (int i = 0; i < boolArrs.Length; i++)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    //设置对应药箱按钮可用状态
 | 
				
			||||||
 | 
					                    SetIsEnableStatus(i, !boolArrs[i]);
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        //void DoMyPrismEvent(DeviceMsg msg)
 | 
				
			||||||
 | 
					        //{
 | 
				
			||||||
 | 
					        //    switch (msg.EventType)
 | 
				
			||||||
 | 
					        //    {
 | 
				
			||||||
 | 
					        //        // 药箱打开
 | 
				
			||||||
 | 
					        //        case EventType.DRAWEROPEN:
 | 
				
			||||||
 | 
					        //            if (Status == 1)
 | 
				
			||||||
 | 
					        //            {
 | 
				
			||||||
 | 
					        //                Status = 2;
 | 
				
			||||||
 | 
					        //            }
 | 
				
			||||||
 | 
					        //            //记录开药箱日志
 | 
				
			||||||
 | 
					        //            SqlSugarHelper.Db.Insertable(new MachineRecord()
 | 
				
			||||||
 | 
					        //            {
 | 
				
			||||||
 | 
					        //                MachineId = "DM5",
 | 
				
			||||||
 | 
					        //                DrawerNo = _portUtil.DrawerNo,
 | 
				
			||||||
 | 
					        //                Operator = HomeWindowViewModel.Operator?.Id,
 | 
				
			||||||
 | 
					        //                OperationTime = DateTime.Now,
 | 
				
			||||||
 | 
					        //                Type = 55,
 | 
				
			||||||
 | 
					        //                InvoiceId = $"打开{DrawerNo}号药箱",
 | 
				
			||||||
 | 
					        //            }).ExecuteCommand();
 | 
				
			||||||
 | 
					        //            _portUtil.GetBoxStatus();
 | 
				
			||||||
 | 
					        //            break;
 | 
				
			||||||
 | 
					        //        // 药箱关闭
 | 
				
			||||||
 | 
					        //        case EventType.DRAWERCLOSE:
 | 
				
			||||||
 | 
					        //            //记录药箱操作日志
 | 
				
			||||||
 | 
					        //            SqlSugarHelper.Db.Insertable(new MachineRecord()
 | 
				
			||||||
 | 
					        //            {
 | 
				
			||||||
 | 
					        //                MachineId = "DM5",
 | 
				
			||||||
 | 
					        //                DrawerNo = _portUtil.DrawerNo,
 | 
				
			||||||
 | 
					        //                Operator = HomeWindowViewModel.Operator?.Id,
 | 
				
			||||||
 | 
					        //                OperationTime = DateTime.Now,
 | 
				
			||||||
 | 
					        //                Type = 55,
 | 
				
			||||||
 | 
					        //                InvoiceId = "药箱关闭",
 | 
				
			||||||
 | 
					        //            }).ExecuteCommand();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        //            if (Status == 2)
 | 
				
			||||||
 | 
					        //            {
 | 
				
			||||||
 | 
					        //                Status = 3;
 | 
				
			||||||
 | 
					        //            }
 | 
				
			||||||
 | 
					        //            _portUtil.Operate = false;
 | 
				
			||||||
 | 
					        //            break;
 | 
				
			||||||
 | 
					        //        // 打开失败
 | 
				
			||||||
 | 
					        //        case EventType.OPENERROR:
 | 
				
			||||||
 | 
					        //            AlertMsg alertMsg = new AlertMsg
 | 
				
			||||||
 | 
					        //            {
 | 
				
			||||||
 | 
					        //                Message = msg.Message,
 | 
				
			||||||
 | 
					        //                Type = MsgType.ERROR
 | 
				
			||||||
 | 
					        //            };
 | 
				
			||||||
 | 
					        //            _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        //            Status = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        //            //记录药箱操作日志
 | 
				
			||||||
 | 
					        //            SqlSugarHelper.Db.Insertable(new MachineRecord()
 | 
				
			||||||
 | 
					        //            {
 | 
				
			||||||
 | 
					        //                MachineId = "DM5",
 | 
				
			||||||
 | 
					        //                DrawerNo = _portUtil.DrawerNo,
 | 
				
			||||||
 | 
					        //                Operator = HomeWindowViewModel.Operator?.Id,
 | 
				
			||||||
 | 
					        //                OperationTime = DateTime.Now,
 | 
				
			||||||
 | 
					        //                Type = 55,
 | 
				
			||||||
 | 
					        //                InvoiceId = "药箱打开失败",
 | 
				
			||||||
 | 
					        //            }).ExecuteCommand();
 | 
				
			||||||
 | 
					        //            _portUtil.Operate = false;
 | 
				
			||||||
 | 
					        //            break;
 | 
				
			||||||
 | 
					        //    }
 | 
				
			||||||
 | 
					        //}
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    public class TotalDrug
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        public string DrugName { get; set; }
 | 
				
			||||||
 | 
					        public int TotalCount { get; set; }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,12 @@
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.ViewModels
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    public class DrugBaseWindowViewModel
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||