From 2b88d246c847bffa016575ed8207df76ade7aaf6 Mon Sep 17 00:00:00 2001 From: maqiao <625215135@qq.com> Date: Sat, 6 Jul 2024 10:01:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=A1=B9=E7=9B=AE=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DM_Dal/DM_Dal.csproj | 23 + DM_Dal/Models/AccountModel.cs | 87 + DM_Dal/Models/AccountType.cs | 23 + DM_Dal/Models/ChannelList.cs | 176 + DM_Dal/Models/ChannelStock.cs | 150 + DM_Dal/Models/ChannelStockCount.cs | 25 + DM_Dal/Models/CheckRecordStock.cs | 73 + DM_Dal/Models/Class1.cs | 77 + DM_Dal/Models/DrugInfo.cs | 73 + DM_Dal/Models/DrugManuNo.cs | 31 + DM_Dal/Models/HkcChangeShifts.cs | 32 + DM_Dal/Models/InOutInvoice.cs | 125 + DM_Dal/Models/Invoice.cs | 20 + DM_Dal/Models/MachineRecord.cs | 129 + DM_Dal/Models/OrderDetail.cs | 112 + DM_Dal/Models/OrderFinish.cs | 24 + DM_Dal/Models/OrderInfo.cs | 166 + DM_Dal/Models/PremissionDm.cs | 34 + DM_Dal/Models/RoleDm.cs | 34 + DM_Dal/Models/ShiftsReport.cs | 40 + DM_Dal/Models/UserList.cs | 66 + DM_Dal/MysqlHelperDal.cs | 419 + DM_Dal/dll/SCHelper.Database.dll | Bin 0 -> 13824 bytes DM_Dal/dll/SCHelper.dll | Bin 0 -> 9728 bytes DM_Weight.sln | 31 + DM_Weight/App.config | 74 + DM_Weight/App.xaml | 19 + DM_Weight/App.xaml.cs | 367 + DM_Weight/AssemblyInfo.cs | 10 + DM_Weight/CommonDal/LoginDal.cs | 37 + .../Components/pagination/Pagination.xaml | 43 + .../Components/pagination/Pagination.xaml.cs | 265 + .../pagination/PaginationViewModel.cs | 81 + DM_Weight/Converter/BoardTypeConverter.cs | 109 + .../Converter/ChangeShiftsStatusConverter.cs | 25 + DM_Weight/Converter/DrawerSelectConverter.cs | 36 + DM_Weight/Converter/ForeColorConverter.cs | 31 + DM_Weight/Converter/GroupSumConverter.cs | 48 + DM_Weight/Converter/InputQuantityConverter.cs | 29 + DM_Weight/Converter/MachineTypeConverter.cs | 84 + .../Converter/NullableToEnabelConverter.cs | 27 + DM_Weight/Converter/OrderStatusConverter.cs | 38 + DM_Weight/Converter/PaginationConverter.cs | 56 + DM_Weight/Converter/QuantityCountConverter.cs | 34 + DM_Weight/Converter/ShiftsStateConverter.cs | 30 + DM_Weight/Converter/StatusConverter.cs | 99 + DM_Weight/Converter/TotalCountConverter.cs | 33 + DM_Weight/CustomAttribute/MessageAttribute.cs | 20 + DM_Weight/DM_Weight.csproj | 152 + DM_Weight/Finger/FingerprintUtil.cs | 182 + DM_Weight/HIKVISION/CHCNetSDK.cs | 20375 ++++++++++++++++ DM_Weight/HIKVISION/CHKFunction.cs | 161 + DM_Weight/Images/TbExit.png | Bin 0 -> 5613 bytes DM_Weight/Images/TbJiay.png | Bin 0 -> 5521 bytes DM_Weight/Images/TbKuc.png | Bin 0 -> 20283 bytes DM_Weight/Images/TbQyao.png | Bin 0 -> 5774 bytes DM_Weight/Images/TbSet.png | Bin 0 -> 5554 bytes DM_Weight/Images/TbTuiy.png | Bin 0 -> 5708 bytes DM_Weight/Images/body-bg.jpg | Bin 0 -> 19588 bytes DM_Weight/Images/box-16.jpg | Bin 0 -> 18695 bytes DM_Weight/Images/box.png | Bin 0 -> 5630 bytes DM_Weight/Images/favicon.ico | Bin 0 -> 270398 bytes DM_Weight/Images/finger-bg-r.png | Bin 0 -> 54076 bytes DM_Weight/Images/logo.png | Bin 0 -> 3660 bytes DM_Weight/Models/AccountModel.cs | 87 + DM_Weight/Models/AccountType.cs | 23 + DM_Weight/Models/ChannelList.cs | 180 + DM_Weight/Models/ChannelStock.cs | 181 + DM_Weight/Models/ChannelStockCount.cs | 25 + DM_Weight/Models/CheckRecordStock.cs | 73 + DM_Weight/Models/Class1.cs | 77 + DM_Weight/Models/DrugInfo.cs | 73 + DM_Weight/Models/DrugManuNo.cs | 33 + DM_Weight/Models/HkcChangeShifts.cs | 32 + DM_Weight/Models/InOutInvoice.cs | 125 + DM_Weight/Models/Invoice.cs | 20 + DM_Weight/Models/MachineRecord.cs | 129 + DM_Weight/Models/OrderDetail.cs | 112 + DM_Weight/Models/OrderFinish.cs | 24 + DM_Weight/Models/OrderInfo.cs | 166 + DM_Weight/Models/PremissionDm.cs | 34 + DM_Weight/Models/RoleDm.cs | 34 + DM_Weight/Models/ShiftsReport.cs | 40 + DM_Weight/Models/UserList.cs | 66 + DM_Weight/Port/PortUtil.cs | 1479 ++ DM_Weight/Port/ScreenUtil.cs | 171 + DM_Weight/Report/GridReportUtil.cs | 434 + DM_Weight/ReportTemp/account_book_temp.grf | 615 + DM_Weight/ReportTemp/changeShifts_temp.grf | 345 + DM_Weight/ReportTemp/machine_log_add.grf | 282 + DM_Weight/ReportTemp/machine_log_check.grf | 330 + .../ReportTemp/machine_log_check_new.grf | 313 + .../ReportTemp/machine_log_check_new2.grf | 279 + DM_Weight/ReportTemp/machine_log_return.grf | 282 + DM_Weight/ReportTemp/machine_log_take.grf | 282 + DM_Weight/ReportTemp/stock_template.grf | 345 + DM_Weight/Services/ChannelStockService.cs | 37 + DM_Weight/Services/CommonService.cs | 25 + DM_Weight/Services/MachineRecordService.cs | 79 + DM_Weight/Services/SqlHelper.cs | 163 + DM_Weight/Services/SqlHelperService.cs | 4969 ++++ .../Validation/NotEmptyValidationRule.cs | 20 + .../ViewModels/AccountWindowViewModel.cs | 441 + .../ViewModels/AddDrugControlViewModel.cs | 526 + .../BindingChannelNewDialogViewModel.cs | 661 + .../ViewModels/ChangeShiftsDialogViewModel.cs | 672 + .../ChangeShiftsListWindowViewModel.cs | 192 + .../ChangeShiftsRecordWindowViewModel.cs | 161 + .../ViewModels/ChangeShiftsWindowViewModel.cs | 563 + .../CheckRecordDetailDialogViewModel.cs | 206 + .../CheckRecordNewWindowViewModel.cs | 228 + .../CheckStockNewWindowViewModel.cs | 815 + .../ViewModels/CollectionViewGroupInternal.cs | 6 + DM_Weight/ViewModels/DebugWindowViewModel.cs | 40 + .../DrawerAddDrugWindowViewModel.cs | 375 + .../DrawerTakeDrugWindowViewModel.cs | 369 + .../ViewModels/DrugListWindowViewModel.cs | 393 + .../ViewModels/EditUserDialogViewModel.cs | 220 + .../ViewModels/FingerprintDialogViewModel.cs | 133 + DM_Weight/ViewModels/HomeWindowViewModel.cs | 538 + .../ViewModels/InvoiceInNewWindowViewModel.cs | 859 + .../ViewModels/InvoiceOutWindowViewModel.cs | 273 + .../ViewModels/InvoiceTakeDialogViewModel.cs | 443 + DM_Weight/ViewModels/LoginWindowViewModel.cs | 436 + .../MachineRecordWindowViewModel.cs | 354 + DM_Weight/ViewModels/MainWindowViewModel.cs | 124 + DM_Weight/ViewModels/MaskDialogViewModel.cs | 33 + .../ViewModels/OrderReturnDialogViewModel.cs | 485 + .../ViewModels/OrderTakeDialogViewModel.cs | 470 + .../OrderTakeDrugWindowViewModel.cs | 313 + DM_Weight/ViewModels/PremissionViewModel.cs | 36 + DM_Weight/ViewModels/PrintPdfViewModel.cs | 68 + .../ViewModels/ReturnDrugDialogViewModel.cs | 365 + .../ViewModels/ReturnDrugWindow2ViewModel.cs | 261 + .../ViewModels/ReturnDrugWindowViewModel.cs | 258 + .../ViewModels/ReturnEmptyDialogViewModel.cs | 383 + .../ViewModels/ReturnEmptyWindowViewModel.cs | 140 + .../ViewModels/RoleManagerWindowViewModel.cs | 771 + .../ViewModels/SelfAddDialogViewModel.cs | 452 + .../ViewModels/SelfAddWindowViewModel.cs | 296 + .../ViewModels/SelfTakeDialogViewModel.cs | 331 + .../ViewModels/SelfTakeDrugWindowViewModel.cs | 269 + .../ViewModels/SettingWindowViewModel.cs | 85 + .../ViewModels/ShowMessageDialogViewModel.cs | 54 + .../StockListAccountDialogViewModel.cs | 136 + .../ViewModels/StockListWindowViewModel.cs | 343 + .../ViewModels/UserManagerWindowViewModel.cs | 205 + DM_Weight/Views/AccountWindow.xaml | 257 + DM_Weight/Views/AccountWindow.xaml.cs | 53 + DM_Weight/Views/AddDrugControl.xaml | 417 + DM_Weight/Views/AddDrugControl.xaml.cs | 53 + DM_Weight/Views/ChangeShiftsListWindow.xaml | 136 + .../Views/ChangeShiftsListWindow.xaml.cs | 28 + DM_Weight/Views/ChangeShiftsRecordWindow.xaml | 143 + .../Views/ChangeShiftsRecordWindow.xaml.cs | 28 + DM_Weight/Views/ChangeShiftsWindow.xaml | 288 + DM_Weight/Views/ChangeShiftsWindow.xaml.cs | 28 + DM_Weight/Views/CheckRecordNewWindow.xaml | 203 + DM_Weight/Views/CheckRecordNewWindow.xaml.cs | 28 + DM_Weight/Views/CheckStockNewWindow.xaml | 227 + DM_Weight/Views/CheckStockNewWindow.xaml.cs | 60 + DM_Weight/Views/DebugWindow.xaml | 23 + DM_Weight/Views/DebugWindow.xaml.cs | 28 + .../Views/Dialog/BindingChannelNewDialog.xaml | 256 + .../Dialog/BindingChannelNewDialog.xaml.cs | 48 + .../Views/Dialog/ChangeShiftsDialog.xaml | 322 + .../Views/Dialog/ChangeShiftsDialog.xaml.cs | 28 + .../Views/Dialog/CheckRecordDetailDialog.xaml | 122 + .../Dialog/CheckRecordDetailDialog.xaml.cs | 28 + DM_Weight/Views/Dialog/EditUserDialog.xaml | 106 + DM_Weight/Views/Dialog/EditUserDialog.xaml.cs | 28 + DM_Weight/Views/Dialog/FingerprintDialog.xaml | 59 + .../Views/Dialog/FingerprintDialog.xaml.cs | 28 + DM_Weight/Views/Dialog/InvoiceTakeDialog.xaml | 181 + .../Views/Dialog/InvoiceTakeDialog.xaml.cs | 28 + DM_Weight/Views/Dialog/MaskDialog.xaml | 12 + DM_Weight/Views/Dialog/MaskDialog.xaml.cs | 28 + DM_Weight/Views/Dialog/OrderReturnDialog.xaml | 239 + .../Views/Dialog/OrderReturnDialog.xaml.cs | 28 + DM_Weight/Views/Dialog/OrderTakeDialog.xaml | 229 + .../Views/Dialog/OrderTakeDialog.xaml.cs | 28 + DM_Weight/Views/Dialog/PrintPdfView.xaml | 19 + DM_Weight/Views/Dialog/PrintPdfView.xaml.cs | 61 + DM_Weight/Views/Dialog/ReturnDrugDialog.xaml | 201 + .../Views/Dialog/ReturnDrugDialog.xaml.cs | 28 + DM_Weight/Views/Dialog/ReturnEmptyDialog.xaml | 212 + .../Views/Dialog/ReturnEmptyDialog.xaml.cs | 37 + DM_Weight/Views/Dialog/SelfAddDialog.xaml | 147 + DM_Weight/Views/Dialog/SelfAddDialog.xaml.cs | 28 + DM_Weight/Views/Dialog/SelfTakeDialog.xaml | 143 + DM_Weight/Views/Dialog/SelfTakeDialog.xaml.cs | 28 + DM_Weight/Views/Dialog/ShowMessageDialog.xaml | 23 + .../Views/Dialog/ShowMessageDialog.xaml.cs | 28 + .../Views/Dialog/StockListAccountDialog.xaml | 59 + .../Dialog/StockListAccountDialog.xaml.cs | 28 + DM_Weight/Views/DrawerAddDrugWindow.xaml | 360 + DM_Weight/Views/DrawerAddDrugWindow.xaml.cs | 28 + DM_Weight/Views/DrawerTakeDrugWindow.xaml | 267 + DM_Weight/Views/DrawerTakeDrugWindow.xaml.cs | 28 + DM_Weight/Views/DrugListWindow.xaml | 219 + DM_Weight/Views/DrugListWindow.xaml.cs | 28 + DM_Weight/Views/HomeWindow.xaml | 155 + DM_Weight/Views/HomeWindow.xaml.cs | 28 + DM_Weight/Views/InvoiceInNewWindow.xaml | 309 + DM_Weight/Views/InvoiceInNewWindow.xaml.cs | 40 + DM_Weight/Views/InvoiceOutWindow.xaml | 121 + DM_Weight/Views/InvoiceOutWindow.xaml.cs | 28 + DM_Weight/Views/LoginWindow.xaml | 203 + DM_Weight/Views/LoginWindow.xaml.cs | 37 + DM_Weight/Views/MachineRecordWindow.xaml | 196 + DM_Weight/Views/MachineRecordWindow.xaml.cs | 54 + DM_Weight/Views/MainWindow.xaml | 40 + DM_Weight/Views/MainWindow.xaml.cs | 47 + DM_Weight/Views/OrderTakeDrugWindow.xaml | 134 + DM_Weight/Views/OrderTakeDrugWindow.xaml.cs | 33 + DM_Weight/Views/ReturnDrugWindow.xaml | 124 + DM_Weight/Views/ReturnDrugWindow.xaml.cs | 28 + DM_Weight/Views/ReturnDrugWindow2.xaml | 127 + DM_Weight/Views/ReturnDrugWindow2.xaml.cs | 28 + DM_Weight/Views/ReturnEmptyWindow.xaml | 88 + DM_Weight/Views/ReturnEmptyWindow.xaml.cs | 28 + DM_Weight/Views/RoleManagerWindow.xaml | 196 + DM_Weight/Views/RoleManagerWindow.xaml.cs | 28 + DM_Weight/Views/SelfAddWindow.xaml | 267 + DM_Weight/Views/SelfAddWindow.xaml.cs | 28 + DM_Weight/Views/SelfTakeDrugWindow.xaml | 201 + DM_Weight/Views/SelfTakeDrugWindow.xaml.cs | 28 + DM_Weight/Views/SettingWindow.xaml | 38 + DM_Weight/Views/SettingWindow.xaml.cs | 28 + DM_Weight/Views/StockListWindow.xaml | 268 + DM_Weight/Views/StockListWindow.xaml.cs | 62 + DM_Weight/Views/Test.xaml | 138 + DM_Weight/Views/Test.xaml.cs | 28 + DM_Weight/Views/TestCheckBox.xaml | 29 + DM_Weight/Views/TestCheckBox.xaml.cs | 28 + DM_Weight/Views/UserManagerWindow.xaml | 123 + DM_Weight/Views/UserManagerWindow.xaml.cs | 28 + DM_Weight/favicon.ico | Bin 0 -> 270398 bytes DM_Weight/log4net.config | 53 + DM_Weight/msg/AddDrugEvent.cs | 14 + DM_Weight/msg/CheckBoxCheckEvent.cs | 13 + DM_Weight/msg/DelDrugManoEvent.cs | 14 + DM_Weight/msg/FingerprintEvent.cs | 14 + DM_Weight/msg/PortUtilEvent.cs | 14 + DM_Weight/msg/SnackbarEvent.cs | 14 + DM_Weight/select/OrderTakeSelect.cs | 14 + DM_Weight/util/AlertMsg.cs | 19 + DM_Weight/util/BindingProxy.cs | 18 + DM_Weight/util/CheckComputerFreeState.cs | 53 + DM_Weight/util/DeviceMsg.cs | 33 + DM_Weight/util/DialogServiceExtensions.cs | 55 + DM_Weight/util/FingerprintMsg.cs | 25 + DM_Weight/util/GridViewExtensions.cs | 70 + DM_Weight/util/MD5.cs | 34 + DM_Weight/util/MaterialDialogService.cs | 159 + DM_Weight/util/MsgType.cs | 16 + DM_Weight/util/ReadApp.cs | 23 + DM_Weight/util/SqlSugarHelper.cs | 26 + DM_Weight/util/SqlSugarHelperNew.cs | 51 + DM_Weight/util/TabTip/AnimationHelper.cs | 328 + DM_Weight/util/TabTip/EnvironmentEx.cs | 40 + DM_Weight/util/TabTip/HardwareKeyboard.cs | 111 + DM_Weight/util/TabTip/PoolingTimer.cs | 26 + DM_Weight/util/TabTip/Screen.cs | 101 + DM_Weight/util/TabTip/TabTip.cs | 166 + DM_Weight/util/TabTip/TabTipAutomation.cs | 121 + DM_Weight/util/TabTip/Taskbar.cs | 132 + DM_Weight/util/TransExpV2.cs | 41 + DM_WeightTests/DM_WeightTests.csproj | 23 + DM_WeightTests/Port/ScreenUtilTests.cs | 12 + 270 files changed, 62170 insertions(+) create mode 100644 DM_Dal/DM_Dal.csproj create mode 100644 DM_Dal/Models/AccountModel.cs create mode 100644 DM_Dal/Models/AccountType.cs create mode 100644 DM_Dal/Models/ChannelList.cs create mode 100644 DM_Dal/Models/ChannelStock.cs create mode 100644 DM_Dal/Models/ChannelStockCount.cs create mode 100644 DM_Dal/Models/CheckRecordStock.cs create mode 100644 DM_Dal/Models/Class1.cs create mode 100644 DM_Dal/Models/DrugInfo.cs create mode 100644 DM_Dal/Models/DrugManuNo.cs create mode 100644 DM_Dal/Models/HkcChangeShifts.cs create mode 100644 DM_Dal/Models/InOutInvoice.cs create mode 100644 DM_Dal/Models/Invoice.cs create mode 100644 DM_Dal/Models/MachineRecord.cs create mode 100644 DM_Dal/Models/OrderDetail.cs create mode 100644 DM_Dal/Models/OrderFinish.cs create mode 100644 DM_Dal/Models/OrderInfo.cs create mode 100644 DM_Dal/Models/PremissionDm.cs create mode 100644 DM_Dal/Models/RoleDm.cs create mode 100644 DM_Dal/Models/ShiftsReport.cs create mode 100644 DM_Dal/Models/UserList.cs create mode 100644 DM_Dal/MysqlHelperDal.cs create mode 100644 DM_Dal/dll/SCHelper.Database.dll create mode 100644 DM_Dal/dll/SCHelper.dll create mode 100644 DM_Weight.sln create mode 100644 DM_Weight/App.config create mode 100644 DM_Weight/App.xaml create mode 100644 DM_Weight/App.xaml.cs create mode 100644 DM_Weight/AssemblyInfo.cs create mode 100644 DM_Weight/CommonDal/LoginDal.cs create mode 100644 DM_Weight/Components/pagination/Pagination.xaml create mode 100644 DM_Weight/Components/pagination/Pagination.xaml.cs create mode 100644 DM_Weight/Components/pagination/PaginationViewModel.cs create mode 100644 DM_Weight/Converter/BoardTypeConverter.cs create mode 100644 DM_Weight/Converter/ChangeShiftsStatusConverter.cs create mode 100644 DM_Weight/Converter/DrawerSelectConverter.cs create mode 100644 DM_Weight/Converter/ForeColorConverter.cs create mode 100644 DM_Weight/Converter/GroupSumConverter.cs create mode 100644 DM_Weight/Converter/InputQuantityConverter.cs create mode 100644 DM_Weight/Converter/MachineTypeConverter.cs create mode 100644 DM_Weight/Converter/NullableToEnabelConverter.cs create mode 100644 DM_Weight/Converter/OrderStatusConverter.cs create mode 100644 DM_Weight/Converter/PaginationConverter.cs create mode 100644 DM_Weight/Converter/QuantityCountConverter.cs create mode 100644 DM_Weight/Converter/ShiftsStateConverter.cs create mode 100644 DM_Weight/Converter/StatusConverter.cs create mode 100644 DM_Weight/Converter/TotalCountConverter.cs create mode 100644 DM_Weight/CustomAttribute/MessageAttribute.cs create mode 100644 DM_Weight/DM_Weight.csproj create mode 100644 DM_Weight/Finger/FingerprintUtil.cs create mode 100644 DM_Weight/HIKVISION/CHCNetSDK.cs create mode 100644 DM_Weight/HIKVISION/CHKFunction.cs create mode 100644 DM_Weight/Images/TbExit.png create mode 100644 DM_Weight/Images/TbJiay.png create mode 100644 DM_Weight/Images/TbKuc.png create mode 100644 DM_Weight/Images/TbQyao.png create mode 100644 DM_Weight/Images/TbSet.png create mode 100644 DM_Weight/Images/TbTuiy.png create mode 100644 DM_Weight/Images/body-bg.jpg create mode 100644 DM_Weight/Images/box-16.jpg create mode 100644 DM_Weight/Images/box.png create mode 100644 DM_Weight/Images/favicon.ico create mode 100644 DM_Weight/Images/finger-bg-r.png create mode 100644 DM_Weight/Images/logo.png create mode 100644 DM_Weight/Models/AccountModel.cs create mode 100644 DM_Weight/Models/AccountType.cs create mode 100644 DM_Weight/Models/ChannelList.cs create mode 100644 DM_Weight/Models/ChannelStock.cs create mode 100644 DM_Weight/Models/ChannelStockCount.cs create mode 100644 DM_Weight/Models/CheckRecordStock.cs create mode 100644 DM_Weight/Models/Class1.cs create mode 100644 DM_Weight/Models/DrugInfo.cs create mode 100644 DM_Weight/Models/DrugManuNo.cs create mode 100644 DM_Weight/Models/HkcChangeShifts.cs create mode 100644 DM_Weight/Models/InOutInvoice.cs create mode 100644 DM_Weight/Models/Invoice.cs create mode 100644 DM_Weight/Models/MachineRecord.cs create mode 100644 DM_Weight/Models/OrderDetail.cs create mode 100644 DM_Weight/Models/OrderFinish.cs create mode 100644 DM_Weight/Models/OrderInfo.cs create mode 100644 DM_Weight/Models/PremissionDm.cs create mode 100644 DM_Weight/Models/RoleDm.cs create mode 100644 DM_Weight/Models/ShiftsReport.cs create mode 100644 DM_Weight/Models/UserList.cs create mode 100644 DM_Weight/Port/PortUtil.cs create mode 100644 DM_Weight/Port/ScreenUtil.cs create mode 100644 DM_Weight/Report/GridReportUtil.cs create mode 100644 DM_Weight/ReportTemp/account_book_temp.grf create mode 100644 DM_Weight/ReportTemp/changeShifts_temp.grf create mode 100644 DM_Weight/ReportTemp/machine_log_add.grf create mode 100644 DM_Weight/ReportTemp/machine_log_check.grf create mode 100644 DM_Weight/ReportTemp/machine_log_check_new.grf create mode 100644 DM_Weight/ReportTemp/machine_log_check_new2.grf create mode 100644 DM_Weight/ReportTemp/machine_log_return.grf create mode 100644 DM_Weight/ReportTemp/machine_log_take.grf create mode 100644 DM_Weight/ReportTemp/stock_template.grf create mode 100644 DM_Weight/Services/ChannelStockService.cs create mode 100644 DM_Weight/Services/CommonService.cs create mode 100644 DM_Weight/Services/MachineRecordService.cs create mode 100644 DM_Weight/Services/SqlHelper.cs create mode 100644 DM_Weight/Services/SqlHelperService.cs create mode 100644 DM_Weight/Validation/NotEmptyValidationRule.cs create mode 100644 DM_Weight/ViewModels/AccountWindowViewModel.cs create mode 100644 DM_Weight/ViewModels/AddDrugControlViewModel.cs create mode 100644 DM_Weight/ViewModels/BindingChannelNewDialogViewModel.cs create mode 100644 DM_Weight/ViewModels/ChangeShiftsDialogViewModel.cs create mode 100644 DM_Weight/ViewModels/ChangeShiftsListWindowViewModel.cs create mode 100644 DM_Weight/ViewModels/ChangeShiftsRecordWindowViewModel.cs create mode 100644 DM_Weight/ViewModels/ChangeShiftsWindowViewModel.cs create mode 100644 DM_Weight/ViewModels/CheckRecordDetailDialogViewModel.cs create mode 100644 DM_Weight/ViewModels/CheckRecordNewWindowViewModel.cs create mode 100644 DM_Weight/ViewModels/CheckStockNewWindowViewModel.cs create mode 100644 DM_Weight/ViewModels/CollectionViewGroupInternal.cs create mode 100644 DM_Weight/ViewModels/DebugWindowViewModel.cs create mode 100644 DM_Weight/ViewModels/DrawerAddDrugWindowViewModel.cs create mode 100644 DM_Weight/ViewModels/DrawerTakeDrugWindowViewModel.cs create mode 100644 DM_Weight/ViewModels/DrugListWindowViewModel.cs create mode 100644 DM_Weight/ViewModels/EditUserDialogViewModel.cs create mode 100644 DM_Weight/ViewModels/FingerprintDialogViewModel.cs create mode 100644 DM_Weight/ViewModels/HomeWindowViewModel.cs create mode 100644 DM_Weight/ViewModels/InvoiceInNewWindowViewModel.cs create mode 100644 DM_Weight/ViewModels/InvoiceOutWindowViewModel.cs create mode 100644 DM_Weight/ViewModels/InvoiceTakeDialogViewModel.cs create mode 100644 DM_Weight/ViewModels/LoginWindowViewModel.cs create mode 100644 DM_Weight/ViewModels/MachineRecordWindowViewModel.cs create mode 100644 DM_Weight/ViewModels/MainWindowViewModel.cs create mode 100644 DM_Weight/ViewModels/MaskDialogViewModel.cs create mode 100644 DM_Weight/ViewModels/OrderReturnDialogViewModel.cs create mode 100644 DM_Weight/ViewModels/OrderTakeDialogViewModel.cs create mode 100644 DM_Weight/ViewModels/OrderTakeDrugWindowViewModel.cs create mode 100644 DM_Weight/ViewModels/PremissionViewModel.cs create mode 100644 DM_Weight/ViewModels/PrintPdfViewModel.cs create mode 100644 DM_Weight/ViewModels/ReturnDrugDialogViewModel.cs create mode 100644 DM_Weight/ViewModels/ReturnDrugWindow2ViewModel.cs create mode 100644 DM_Weight/ViewModels/ReturnDrugWindowViewModel.cs create mode 100644 DM_Weight/ViewModels/ReturnEmptyDialogViewModel.cs create mode 100644 DM_Weight/ViewModels/ReturnEmptyWindowViewModel.cs create mode 100644 DM_Weight/ViewModels/RoleManagerWindowViewModel.cs create mode 100644 DM_Weight/ViewModels/SelfAddDialogViewModel.cs create mode 100644 DM_Weight/ViewModels/SelfAddWindowViewModel.cs create mode 100644 DM_Weight/ViewModels/SelfTakeDialogViewModel.cs create mode 100644 DM_Weight/ViewModels/SelfTakeDrugWindowViewModel.cs create mode 100644 DM_Weight/ViewModels/SettingWindowViewModel.cs create mode 100644 DM_Weight/ViewModels/ShowMessageDialogViewModel.cs create mode 100644 DM_Weight/ViewModels/StockListAccountDialogViewModel.cs create mode 100644 DM_Weight/ViewModels/StockListWindowViewModel.cs create mode 100644 DM_Weight/ViewModels/UserManagerWindowViewModel.cs create mode 100644 DM_Weight/Views/AccountWindow.xaml create mode 100644 DM_Weight/Views/AccountWindow.xaml.cs create mode 100644 DM_Weight/Views/AddDrugControl.xaml create mode 100644 DM_Weight/Views/AddDrugControl.xaml.cs create mode 100644 DM_Weight/Views/ChangeShiftsListWindow.xaml create mode 100644 DM_Weight/Views/ChangeShiftsListWindow.xaml.cs create mode 100644 DM_Weight/Views/ChangeShiftsRecordWindow.xaml create mode 100644 DM_Weight/Views/ChangeShiftsRecordWindow.xaml.cs create mode 100644 DM_Weight/Views/ChangeShiftsWindow.xaml create mode 100644 DM_Weight/Views/ChangeShiftsWindow.xaml.cs create mode 100644 DM_Weight/Views/CheckRecordNewWindow.xaml create mode 100644 DM_Weight/Views/CheckRecordNewWindow.xaml.cs create mode 100644 DM_Weight/Views/CheckStockNewWindow.xaml create mode 100644 DM_Weight/Views/CheckStockNewWindow.xaml.cs create mode 100644 DM_Weight/Views/DebugWindow.xaml create mode 100644 DM_Weight/Views/DebugWindow.xaml.cs create mode 100644 DM_Weight/Views/Dialog/BindingChannelNewDialog.xaml create mode 100644 DM_Weight/Views/Dialog/BindingChannelNewDialog.xaml.cs create mode 100644 DM_Weight/Views/Dialog/ChangeShiftsDialog.xaml create mode 100644 DM_Weight/Views/Dialog/ChangeShiftsDialog.xaml.cs create mode 100644 DM_Weight/Views/Dialog/CheckRecordDetailDialog.xaml create mode 100644 DM_Weight/Views/Dialog/CheckRecordDetailDialog.xaml.cs create mode 100644 DM_Weight/Views/Dialog/EditUserDialog.xaml create mode 100644 DM_Weight/Views/Dialog/EditUserDialog.xaml.cs create mode 100644 DM_Weight/Views/Dialog/FingerprintDialog.xaml create mode 100644 DM_Weight/Views/Dialog/FingerprintDialog.xaml.cs create mode 100644 DM_Weight/Views/Dialog/InvoiceTakeDialog.xaml create mode 100644 DM_Weight/Views/Dialog/InvoiceTakeDialog.xaml.cs create mode 100644 DM_Weight/Views/Dialog/MaskDialog.xaml create mode 100644 DM_Weight/Views/Dialog/MaskDialog.xaml.cs create mode 100644 DM_Weight/Views/Dialog/OrderReturnDialog.xaml create mode 100644 DM_Weight/Views/Dialog/OrderReturnDialog.xaml.cs create mode 100644 DM_Weight/Views/Dialog/OrderTakeDialog.xaml create mode 100644 DM_Weight/Views/Dialog/OrderTakeDialog.xaml.cs create mode 100644 DM_Weight/Views/Dialog/PrintPdfView.xaml create mode 100644 DM_Weight/Views/Dialog/PrintPdfView.xaml.cs create mode 100644 DM_Weight/Views/Dialog/ReturnDrugDialog.xaml create mode 100644 DM_Weight/Views/Dialog/ReturnDrugDialog.xaml.cs create mode 100644 DM_Weight/Views/Dialog/ReturnEmptyDialog.xaml create mode 100644 DM_Weight/Views/Dialog/ReturnEmptyDialog.xaml.cs create mode 100644 DM_Weight/Views/Dialog/SelfAddDialog.xaml create mode 100644 DM_Weight/Views/Dialog/SelfAddDialog.xaml.cs create mode 100644 DM_Weight/Views/Dialog/SelfTakeDialog.xaml create mode 100644 DM_Weight/Views/Dialog/SelfTakeDialog.xaml.cs create mode 100644 DM_Weight/Views/Dialog/ShowMessageDialog.xaml create mode 100644 DM_Weight/Views/Dialog/ShowMessageDialog.xaml.cs create mode 100644 DM_Weight/Views/Dialog/StockListAccountDialog.xaml create mode 100644 DM_Weight/Views/Dialog/StockListAccountDialog.xaml.cs create mode 100644 DM_Weight/Views/DrawerAddDrugWindow.xaml create mode 100644 DM_Weight/Views/DrawerAddDrugWindow.xaml.cs create mode 100644 DM_Weight/Views/DrawerTakeDrugWindow.xaml create mode 100644 DM_Weight/Views/DrawerTakeDrugWindow.xaml.cs create mode 100644 DM_Weight/Views/DrugListWindow.xaml create mode 100644 DM_Weight/Views/DrugListWindow.xaml.cs create mode 100644 DM_Weight/Views/HomeWindow.xaml create mode 100644 DM_Weight/Views/HomeWindow.xaml.cs create mode 100644 DM_Weight/Views/InvoiceInNewWindow.xaml create mode 100644 DM_Weight/Views/InvoiceInNewWindow.xaml.cs create mode 100644 DM_Weight/Views/InvoiceOutWindow.xaml create mode 100644 DM_Weight/Views/InvoiceOutWindow.xaml.cs create mode 100644 DM_Weight/Views/LoginWindow.xaml create mode 100644 DM_Weight/Views/LoginWindow.xaml.cs create mode 100644 DM_Weight/Views/MachineRecordWindow.xaml create mode 100644 DM_Weight/Views/MachineRecordWindow.xaml.cs create mode 100644 DM_Weight/Views/MainWindow.xaml create mode 100644 DM_Weight/Views/MainWindow.xaml.cs create mode 100644 DM_Weight/Views/OrderTakeDrugWindow.xaml create mode 100644 DM_Weight/Views/OrderTakeDrugWindow.xaml.cs create mode 100644 DM_Weight/Views/ReturnDrugWindow.xaml create mode 100644 DM_Weight/Views/ReturnDrugWindow.xaml.cs create mode 100644 DM_Weight/Views/ReturnDrugWindow2.xaml create mode 100644 DM_Weight/Views/ReturnDrugWindow2.xaml.cs create mode 100644 DM_Weight/Views/ReturnEmptyWindow.xaml create mode 100644 DM_Weight/Views/ReturnEmptyWindow.xaml.cs create mode 100644 DM_Weight/Views/RoleManagerWindow.xaml create mode 100644 DM_Weight/Views/RoleManagerWindow.xaml.cs create mode 100644 DM_Weight/Views/SelfAddWindow.xaml create mode 100644 DM_Weight/Views/SelfAddWindow.xaml.cs create mode 100644 DM_Weight/Views/SelfTakeDrugWindow.xaml create mode 100644 DM_Weight/Views/SelfTakeDrugWindow.xaml.cs create mode 100644 DM_Weight/Views/SettingWindow.xaml create mode 100644 DM_Weight/Views/SettingWindow.xaml.cs create mode 100644 DM_Weight/Views/StockListWindow.xaml create mode 100644 DM_Weight/Views/StockListWindow.xaml.cs create mode 100644 DM_Weight/Views/Test.xaml create mode 100644 DM_Weight/Views/Test.xaml.cs create mode 100644 DM_Weight/Views/TestCheckBox.xaml create mode 100644 DM_Weight/Views/TestCheckBox.xaml.cs create mode 100644 DM_Weight/Views/UserManagerWindow.xaml create mode 100644 DM_Weight/Views/UserManagerWindow.xaml.cs create mode 100644 DM_Weight/favicon.ico create mode 100644 DM_Weight/log4net.config create mode 100644 DM_Weight/msg/AddDrugEvent.cs create mode 100644 DM_Weight/msg/CheckBoxCheckEvent.cs create mode 100644 DM_Weight/msg/DelDrugManoEvent.cs create mode 100644 DM_Weight/msg/FingerprintEvent.cs create mode 100644 DM_Weight/msg/PortUtilEvent.cs create mode 100644 DM_Weight/msg/SnackbarEvent.cs create mode 100644 DM_Weight/select/OrderTakeSelect.cs create mode 100644 DM_Weight/util/AlertMsg.cs create mode 100644 DM_Weight/util/BindingProxy.cs create mode 100644 DM_Weight/util/CheckComputerFreeState.cs create mode 100644 DM_Weight/util/DeviceMsg.cs create mode 100644 DM_Weight/util/DialogServiceExtensions.cs create mode 100644 DM_Weight/util/FingerprintMsg.cs create mode 100644 DM_Weight/util/GridViewExtensions.cs create mode 100644 DM_Weight/util/MD5.cs create mode 100644 DM_Weight/util/MaterialDialogService.cs create mode 100644 DM_Weight/util/MsgType.cs create mode 100644 DM_Weight/util/ReadApp.cs create mode 100644 DM_Weight/util/SqlSugarHelper.cs create mode 100644 DM_Weight/util/SqlSugarHelperNew.cs create mode 100644 DM_Weight/util/TabTip/AnimationHelper.cs create mode 100644 DM_Weight/util/TabTip/EnvironmentEx.cs create mode 100644 DM_Weight/util/TabTip/HardwareKeyboard.cs create mode 100644 DM_Weight/util/TabTip/PoolingTimer.cs create mode 100644 DM_Weight/util/TabTip/Screen.cs create mode 100644 DM_Weight/util/TabTip/TabTip.cs create mode 100644 DM_Weight/util/TabTip/TabTipAutomation.cs create mode 100644 DM_Weight/util/TabTip/Taskbar.cs create mode 100644 DM_Weight/util/TransExpV2.cs create mode 100644 DM_WeightTests/DM_WeightTests.csproj create mode 100644 DM_WeightTests/Port/ScreenUtilTests.cs diff --git a/DM_Dal/DM_Dal.csproj b/DM_Dal/DM_Dal.csproj new file mode 100644 index 0000000..40b2367 --- /dev/null +++ b/DM_Dal/DM_Dal.csproj @@ -0,0 +1,23 @@ + + + + net6.0-windows + enable + true + AnyCPU;x86 + + + + + + + + + dll\SCHelper.dll + + + dll\SCHelper.Database.dll + + + + diff --git a/DM_Dal/Models/AccountModel.cs b/DM_Dal/Models/AccountModel.cs new file mode 100644 index 0000000..ff50c6f --- /dev/null +++ b/DM_Dal/Models/AccountModel.cs @@ -0,0 +1,87 @@ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DM_Dal.Models +{ + /// + /// 账册 + /// + public class AccountModel + { + /// + /// 总结存 + /// + public int StockQuantity { get; set; } + /// + /// 借入数量 + /// + public int InQuantity { get; set; } + /// + /// 发出数量 + /// + public int OutQuantity { get; set; } + /// + /// 日期 + /// + public string OperationTime { get; set; } + /// + /// 凭证号 + /// + public string InvoiceId { get;set; } + /// + /// 药品名称 + /// + public string DrugName { get; set; } + /// + /// 药品ID + /// + public string DrugId { get; set; } + /// + /// 单位 + /// + public string PackUnit { get; set; } + /// + /// 剂型 + /// + public string Dosage { get; set; } + /// + /// 厂家 + /// + public string Manufactory { get; set; } + /// + /// 批次 + /// + public string ManuNo { get;set; } + /// + /// 效期 + /// + public string EffDate { get; set; } + /// + /// 操作人 + /// + public string OperatorName { get;set; } + /// + /// 复核人 + /// + public string ReviewerName { get; set; } + /// + /// 规格 + /// + public string DrugSpec { get; set; } + + public DrugInfo DrugInfo { get; set; } + + /// + /// 供应单位 + /// + public string SupplierDept { get; set; } + /// + /// 领用部门 + /// + public string ReceiveDept { get; set; } + } +} diff --git a/DM_Dal/Models/AccountType.cs b/DM_Dal/Models/AccountType.cs new file mode 100644 index 0000000..3ccb860 --- /dev/null +++ b/DM_Dal/Models/AccountType.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DM_Dal.Models +{ + /// + /// 账册类型 + /// + public class AccountType + { + /// + /// 账册类型名称 + /// + public string AccountTypeName { get; set; } + /// + /// 账册类型值 + /// + public int AccountTypeValue { get; set; } + } +} diff --git a/DM_Dal/Models/ChannelList.cs b/DM_Dal/Models/ChannelList.cs new file mode 100644 index 0000000..ff4e5f4 --- /dev/null +++ b/DM_Dal/Models/ChannelList.cs @@ -0,0 +1,176 @@ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DM_Dal.Models +{ + //[SugarTable("channel_list")] + public class ChannelList + { + /// + /// + /// + //[SugarColumn(ColumnName = "chnguid", IsPrimaryKey = true)] + //[SugarColumn(ColumnName = "id", IsPrimaryKey = true)] + public string Id { get; set; } + + /// + /// + /// 默认值: NULL + ///// + //[SugarColumn(ColumnName = "machine_id")] + public string MachineId { get; set; } + /// + /// + /// 默认值: NULL + /// + //[SugarColumn(ColumnName = "row_no")] + public int DrawerNo { get; set; } + /// + /// + /// 默认值: NULL + /// + public int ColNo { get; set; } + /// + /// + /// 默认值: NULL + /// + public int PosNo { get; set; } + + + /// + /// + /// 默认值: NULL + /// + public string DrugId { get; set; } + + ///// + ///// + ///// 默认值: NULL + ///// + //[SugarColumn(ColumnName = "manu_no")] + //public string ManuNo { get; set; } + ///// + ///// + ///// 默认值: NULL + ///// + //[SugarColumn(ColumnName = "eff_date")] + //public string EffDate { get; set; } + ///// + ///// + ///// 默认值: NULL + ///// + //[SugarColumn(ColumnName = "quantity")] + //public int Quantity { get; set; } + + /// + /// + /// 默认值: 1 + /// + public int DrawerType { get; set; } + /// + /// + /// 默认值: 1 + /// + public int BoardType { get; set; } + /// + /// + /// 默认值: 1 + /// + + public int? State { get; set; } + + + public bool IsSelected { get; set; } + + public InOutInvoice Invoice { get; set; } + + + 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 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? _channelStocks; + //[Navigate(NavigateType.OneToMany, nameof(ChannelStock.Chnguid))] + //public List channelStocks { get => _channelStocks; set => SetProperty(ref _channelStocks, value); } + + //public int _totalCount; + //[SugarColumn(IsIgnore = true)] + //public int totalCount { get => _totalCount;set=> SetProperty(ref _totalCount, value); } + + } +} diff --git a/DM_Dal/Models/ChannelStock.cs b/DM_Dal/Models/ChannelStock.cs new file mode 100644 index 0000000..aac9065 --- /dev/null +++ b/DM_Dal/Models/ChannelStock.cs @@ -0,0 +1,150 @@ +using System; +using System.Collections.Generic; +using System.Linq; +namespace DM_Dal.Models +{ + /// + /// + /// + [Serializable] + public class ChannelStock + { + /// + /// + /// + //[SugarColumn(ColumnName = "id", IsPrimaryKey = true)] + public string Id { get; set; } + + public string Chnguid { get; set; } + /// + /// + /// 默认值: NULL + /// + public string MachineId { get; set; } + /// + /// + /// 默认值: NULL + /// + public int DrawerNo { get; set; } + /// + /// + /// 默认值: NULL + /// + public int ColNo { get; set; } + /// + /// + /// 默认值: NULL + /// + public int PosNo { get; set; } + + + /// + /// + /// 默认值: NULL + /// + public string DrugId { get; set; } + + /// + /// + /// 默认值: NULL + /// + public string ManuNo { get; set; } + /// + /// + /// 默认值: NULL + /// + public string EffDate { get; set; } + /// + /// + /// 默认值: NULL + /// + public int Quantity { get; set; } + + + + /// + /// + /// 默认值: 1 + /// + public int DrawerType { get; set; } + /// + /// + /// 默认值: 1 + /// + public int BoardType { get; set; } + /// + /// + /// 默认值: 1 + /// + public int? State { get; set; } + + public bool IsSelected { get; set; } + + public InOutInvoice Invoice { get; set; } + + public string Location + { + get => DrawerNo + "-" + ColNo; + } + private int _addQuantity = 0; + public int AddQuantity + { + get; + set; + } + + private int _takeQuantity = 0; + + public int TakeQuantity + { + get; + set; + } + //private string _tipMessage=string.Empty; + //[SugarColumn(IsIgnore = true)] + //public string TipMessage + //{ + // get => _tipMessage; + // set + // { + // SetProperty(ref _tipMessage, value); + // } + //} + private int _returnQuantity = 0; + + public int ReturnQuantity + { + get; + set; + } + + private int _checkQuantity = 0; + + + public int CheckQuantity + { + get; + set; + } + + + public int? CanReturnQuantity { get; set; } + + private DrugInfo? _DrugInfo; + public DrugInfo DrugInfo { get; set; } + + public int process { get; set; } = 0; + + + private DrugManuNo? _drugManuNo; + public DrugManuNo? drugManuNo { get; set; } + + //private string _manuNoEffDate; + //[SugarColumn(IsIgnore = true)] + //public string ManuNoEffDate { get => _manuNoEffDate; set => SetProperty(ref _manuNoEffDate, value); } + + + private ChannelList? _channelList; + public ChannelList ChannelLst { get; set; } + } +} \ No newline at end of file diff --git a/DM_Dal/Models/ChannelStockCount.cs b/DM_Dal/Models/ChannelStockCount.cs new file mode 100644 index 0000000..97e41ab --- /dev/null +++ b/DM_Dal/Models/ChannelStockCount.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DM_Weight.Models +{ + public class ChannelStockCount + { + public int DrawerNo { get; set; } + public int ColNo { get; set; } + public string DrugId { get; set; } + public string ManuNo { get;set; } + public int Quantity { get;set; } + public string EffDate { get; set; } + public string DrugName { get; set; } + public string DrugSpec { get; set; } + public string Dosage { get;set; } + public string ManuFactory { get;set; } + public string SmallUnit { get;set; } + public string PackUnit { get; set; } + public string MachineId { get; set; } + } +} diff --git a/DM_Dal/Models/CheckRecordStock.cs b/DM_Dal/Models/CheckRecordStock.cs new file mode 100644 index 0000000..5817bd9 --- /dev/null +++ b/DM_Dal/Models/CheckRecordStock.cs @@ -0,0 +1,73 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DM_Dal.Models +{ + /// + /// 盘点后药品库存数 + /// + public class CheckRecordStock + { + public int ID { get; set; } + /// + /// 抽屉号 + /// + public int rowNo { get; set; } + /// + /// 列号 + /// + public int colNo { get; set; } + /// + /// 数量 + /// + public int quantity { get; set; } + /// + /// 批次 + /// + public string manuNo { get; set; } + /// + /// 效期 + /// + public string effDate { get; set; } + /// + /// 药品名称 + /// + public string drugName { get; set; } + /// + /// 规格 + /// + public string drugSpec { get; set; } + // + public string packUnit { get; set; } + /// + /// 厂商 + /// + public string manufactory { get; set; } + public int maxStock { get; set; } + public string drugId { get; set; } + public string MachineId { get; set; } + /// + /// 批次总库存 + /// + public int ManuQuantity { get; set; } + /// + /// 操作时间 + /// + public string optdate { get; set; } + /// + /// 操作人 + /// + public string operatorUser { get; set; } + /// + /// 审核人 + /// + public string reviewerUser { get; set; } + + public List manuNoDetails { get;set; } + + public DrugInfo DrugInfo { get; set; } + } +} diff --git a/DM_Dal/Models/Class1.cs b/DM_Dal/Models/Class1.cs new file mode 100644 index 0000000..e03f93d --- /dev/null +++ b/DM_Dal/Models/Class1.cs @@ -0,0 +1,77 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DM_Weight.Models +{ + internal class Class1 + { + } + /// /// 行政区表 + /// /// + public class DistrictModel + { /// /// 主键 /// + private int id; /// /// 代码 /// + private int code; /// /// 名称 /// + private string name; + public int Id { get { return id; } set { id = value; } } + /// /// 代码 /// + public int Code { get { return code; } set { code = value; } } + /// /// 名称 /// + public string Name { get { return name; } set { name = value; } } + } + /// /// 表 /// + public class MapSpotModel + { + private int id; //名称 + + private string name; //代码 + private int code; //个数 + private int allNumber; //面积 + private double allArea; + + + private int hCTureNumber; + + private double hCTrueArea; + + /// + /// 通过个数 + /// + private int hCTruePassNumber; //不通过个数 + private int hCTrueNoPassNumber; //通过率 + private string hCTruePassingRate; //个数 + private int jLTureNumber; //面积 + private double jLTrueArea; //通过个数 + private int jLTruePassNumber; //不通过个数 + private int jLTrueNoPassNumber; //通过率 + private string jLTruePassingRate; + private DistrictModel districtModels; + public int Id { get { return id; } set { id = value; } } + /// /// 名称 /// + public string Name { get { return name; } set { name = value; } } /// /// 代码 /// + public int Code { get { return code; } set { code = value; } } /// /// 个数 /// + public int AllNumber { get { return allNumber; } set { allNumber = value; } } /// /// 面积 /// + public double AllArea { get { return allArea; } set { allArea = value; } } /// /// 个数 /// + public int HCTureNumber { get { return hCTureNumber; } set { hCTureNumber = value; } } /// /// 面积 /// + public double HCTrueArea { get { return hCTrueArea; } set { hCTrueArea = value; } } + /// /// 通过个数 /// + public int HCTruePassNumber { get { return hCTruePassNumber; } set { hCTruePassNumber = value; } } + /// /// /// 不通过个数 /// + public int HCTrueNoPassNumber { get { return hCTrueNoPassNumber; } set { hCTrueNoPassNumber = value; } } + /// /// /// 通过率 /// + public string HCTruePassingRate { get { return hCTruePassingRate; } set { hCTruePassingRate = value; } } /// /// 个数 /// + public int JLTureNumber { get { return jLTureNumber; } set { jLTureNumber = value; } } + /// /// 面积 /// + public double JLTrueArea { get { return jLTrueArea; } set { jLTrueArea = value; } } + /// /// /// 通过个数 /// + public int JLTruePassNumber { get { return jLTruePassNumber; } set { jLTruePassNumber = value; } } + /// /// /// 不通过个数 /// + public int JLTrueNoPassNumber { get { return jLTrueNoPassNumber; } set { jLTrueNoPassNumber = value; } } + /// /// /// 监理单位已审核图斑-通过率 /// + public string JLTruePassingRate { get { return jLTruePassingRate; } set { jLTruePassingRate = value; } } + public DistrictModel DistrictModels { get { return districtModels; } set { districtModels = value; } } + } +} diff --git a/DM_Dal/Models/DrugInfo.cs b/DM_Dal/Models/DrugInfo.cs new file mode 100644 index 0000000..8dee21b --- /dev/null +++ b/DM_Dal/Models/DrugInfo.cs @@ -0,0 +1,73 @@ +using System; +using System.Collections.Generic; +using System.Linq; +namespace DM_Dal.Models +{ + /// + /// + /// + public class DrugInfo + { + /// + /// + /// + //[SugarColumn(ColumnName = "pharmacy")] + //public string Pharmacy { get; set; } + /// + /// ҩƷID + /// + public string DrugId { get; set; } + /// + /// ƴ + /// + public string PyCode { get; set; } + /// + /// + /// + //[SugarColumn(ColumnName = "BD_code")] + //public string BdCode { get; set; } + /// + /// ҩƷ + /// + public string DrugBarcode { get; set; } + + /// + /// ҩƷ���� + /// + public string DrugName { get; set; } + /// + /// + /// + public string DrugBrandname { get; set; } + /// + /// ҩƷ��� + /// + public string DrugSpec { get; set; } + /// + /// ���� + /// + public string Dosage { get; set; } + /// + /// ��װ��λ + /// + public string PackUnit { get; set; } + /// + /// �������� + /// + public string Manufactory { get; set; } + /// + /// ���ҩ�� + /// + public int? MaxStock { get; set; } + //[SugarColumn(IsIgnore=true)] + public List channelStocks { get; set; } + + + public List? DrugManuNos { get; set; } + public int? StockQuantity { get; set; } + + public string drug_name_spec { get; set; } + //[SugarColumn(ColumnName = "drug_name_spec")] + //public string Name { get; set; } + } +} diff --git a/DM_Dal/Models/DrugManuNo.cs b/DM_Dal/Models/DrugManuNo.cs new file mode 100644 index 0000000..24f3aa0 --- /dev/null +++ b/DM_Dal/Models/DrugManuNo.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DM_Dal.Models +{ + public class DrugManuNo + { + private string _id; + public string Id { get; set; } + + private string _drugId; + public string DrugId { get; set; } + + private string _manuNo; + public string ManuNo { get; set; } + + private string _manuDate; + public string ManuDate { get; set; } + + + private string _effDate; + public string EffDate { get; set; } + + //private string _manuNoEffDate; + //[SugarColumn(IsIgnore = true)] + //public string ManuNoEffDate { get => _manuNoEffDate; set => SetProperty(ref _manuNoEffDate, value); } + } +} diff --git a/DM_Dal/Models/HkcChangeShifts.cs b/DM_Dal/Models/HkcChangeShifts.cs new file mode 100644 index 0000000..dc548e2 --- /dev/null +++ b/DM_Dal/Models/HkcChangeShifts.cs @@ -0,0 +1,32 @@ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DM_Dal.Models +{ + //交接班表 + public class HkcChangeShifts + { + public int Id { get; set; } + + public DateTime? OptDate { get; set; } + + public string FromOperator { get; set; } + + public string FromRviewer { get; set; } + public string ToOperator { get;set; } + + public string ToReviewer { get; set; } + + public DateTime? ToDate { get; set; } + + public string State { get; set; } + + public string OptState { get; set; } + + public string Machineid { get; set; } + } +} diff --git a/DM_Dal/Models/InOutInvoice.cs b/DM_Dal/Models/InOutInvoice.cs new file mode 100644 index 0000000..dbfab98 --- /dev/null +++ b/DM_Dal/Models/InOutInvoice.cs @@ -0,0 +1,125 @@ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DM_Dal.Models +{ + public class InOutInvoice + { + /// + /// 主键(序号) + /// + public int Id { get; set; } + + public string InPharmacyId { get; set; } + + public string OutPharmacyId { get; set; } + + /// + /// 库存管理单位(入库单位代码) + /// + public string storage { get; set; } + + /// + /// 单据号 + /// + public string InvoiceNo { get; set; } + + public string InvoiceDate { get; set; } + + /// + /// 药品id + /// + public string DrugId { get; set; } + + + + public DrugInfo DrugInfo { get; set; } + + /// + /// 药品规格 + /// + public string DrugSpec { get; set; } + + /// + /// 计算单位 + /// + public string Units { get; set; } + + /// + /// 厂商标识 + /// + public string FirmId { get; set; } + + /// + /// 包装规格(反映药品含量及包装信息,如0.25g*30) + /// + public string PackageSpec { get; set; } + + /// + /// 数量(以包装单位所计的数量) + /// + public int quantity { get; set; } + + /// + /// 计量单位,可使用任一级管理上方便的包装 + /// + public string PackageUnits { get; set; } + + /// + /// 药品批次 + /// + public string DrugManuNo { get; set; } + + /// + /// 创建时间(入库日期) + /// + public DateTime CreateTime { get; set; } + + /// + /// 1.请领入库 0.其它 + /// + public int Type { get; set; } + + /// + /// 类型描述 + /// + public string TypeDescribe { get; set; } + + /// + /// 供货方 + /// + public string Supplier { get; set; } + + /// + /// 操作人 + /// + public string Operator { get; set; } + + /// + /// 存放库房 + /// + public string SubStorage { get; set; } + + /// + /// 备注 + /// + public string Memos { get; set; } + + public int Status { get; set; } + + public string DrugEffDate { get; set; } + + public string HisId { get; set; } + + public int CancelFlag { get; set; } + + public int CountNum { get; set; } + + public int SumQuantity { get; set; } + + } +} diff --git a/DM_Dal/Models/Invoice.cs b/DM_Dal/Models/Invoice.cs new file mode 100644 index 0000000..c944cb2 --- /dev/null +++ b/DM_Dal/Models/Invoice.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DM_Dal.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; } + } +} diff --git a/DM_Dal/Models/MachineRecord.cs b/DM_Dal/Models/MachineRecord.cs new file mode 100644 index 0000000..a7b071b --- /dev/null +++ b/DM_Dal/Models/MachineRecord.cs @@ -0,0 +1,129 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Security.Principal; +using System.Text; +using System.Threading.Tasks; + +namespace DM_Dal.Models +{ + public class MachineRecord + { + /// + /// 主键 + /// + public int Id { get; set; } + /// + /// 设备id + /// + public string MachineId { get; set; } + /// + /// 药品id + /// + public string DrugId { get; set; } + + public DrugInfo DrugInfo { get; set; } + /// + /// 数量 + /// + public int Quantity { get; set; } + + + public int? StockQuantity { get; set; } + + public int? CheckQuantity { get; set; } + + /// + /// 批号 + /// + public string ManuNo { get; set; } + /// + /// 操作人id + /// + public int? Operator { get; set; } + + public UserList User { get; set; } + /// + /// 审核人id + /// + public int? Reviewer { get; set; } + /// + /// 操作时间 + /// 默认值: CURRENT_TIMESTAMP + /// + public DateTime OperationTime { get; set; } + /// + /// 效期 + /// + public DateTime? EffDate { get; set; } + /// + /// 出库入库类型(1入库2出库31还药32还空瓶4盘点5日结存) + /// + public int Type { get; set; } + /// + /// 出入库调拨单id + /// + public string InvoiceId { get; set; } + /// + /// 列号 + /// + public int ColNo { get; set; } + /// + /// 抽屉号 + /// + public int DrawerNo { get; set; } + /// + /// 取药科室 + /// + public string DepartmentId { get; set; } + /// + /// 是否已经退药(0:没有1:还了部分2:完成) + /// 默认值: 0 + /// + public int Status { get; set; } + /// + /// 退药量 + /// 默认值: 0 + /// + //[SugarColumn(ColumnName = "return_quantity1", IsOnlyIgnoreInsert = true)] + public int ReturnQuantity1 { get; set; } + /// + /// 退空瓶量 + /// 默认值: 0 + /// + //[SugarColumn(ColumnName = "return_quantity2", IsOnlyIgnoreInsert = true + public int ReturnQuantity2 { get; set; } + /// + /// 取药记录id + /// + public int? GetId { get; set; } + /// + /// 是否已经销毁 + /// 默认值: 0 + /// + public int? IsDestroy { get; set; } + + + + public int CanReturnQuantity + { + get => Quantity - ReturnQuantity1 - ReturnQuantity2; + + } + + public bool IsSelected { get; set; } + + /// + /// 药品对应批号库存 + /// + public int? ManunoQuantity { get; set; } + /// + /// 供应单位 + /// + public string SupplierDept { get; set; } + /// + /// 领用部门 + /// + public string ReceiveDept { get; set; } + } +} diff --git a/DM_Dal/Models/OrderDetail.cs b/DM_Dal/Models/OrderDetail.cs new file mode 100644 index 0000000..b274161 --- /dev/null +++ b/DM_Dal/Models/OrderDetail.cs @@ -0,0 +1,112 @@ +using System; +using System.Collections.Generic; +using System.Linq; +namespace DM_Dal.Models +{ + /// + /// + /// + public class OrderDetail + { + /// + /// + /// + public int Id { get; set; } + /// + /// + /// 默认值: NULL + /// + //[SugarColumn(ColumnName = "order_id")] + //public int? OrderId { get; set; } + /// + /// + /// + public string PatientId { get; set; } + /// + /// + /// + public string OrderNo { get; set; } + /// + /// + /// + public DateTime ChargeDate { get; set; } + /// + /// + /// 默认值: NULL + /// + //[SugarColumn(ColumnName = "serial_no")] + //public int? SerialNo { get; set; } + /// + /// + /// + public string DrugId { get; set; } + + public DrugInfo DrugInfo { get; set; } + /// + /// + /// + public int Quantity { get; set; } + /// + /// + /// 默认值: NULL + /// + public string OrderUnit { get; set; } + /// + /// + /// 默认值: 1 + /// + public int? UnitConvercoef { get; set; } + /// + /// + /// 默认值: NULL + /// + public string SetManuNo { get; set; } + /// + /// + /// 默认值: NULL + /// + public string SetEffDate { get; set; } + /// + /// + /// 默认值: NULL + /// + //[SugarColumn(ColumnName = "price")] + //public string Price { get; set; } + /// + /// + /// 默认值: NULL + /// + //[SugarColumn(ColumnName = "total_price")] + //public string TotalPrice { get; set; } + /// + /// + /// 默认值: NULL + /// + public string UseDiscrip { get; set; } + /// + /// + /// 默认值: NULL + /// + public string UseFrequ { get; set; } + /// + /// + /// 默认值: NULL + /// + public string UseOnce { get; set; } + /// + /// + /// 默认值: NULL + /// + public string UseBy { get; set; } + /// + /// + /// 默认值: '0' + /// + public string UseSelf { get; set; } + /// + /// + /// 默认值: NULL + /// + public string UseDosage { get; set; } + } +} \ No newline at end of file diff --git a/DM_Dal/Models/OrderFinish.cs b/DM_Dal/Models/OrderFinish.cs new file mode 100644 index 0000000..c1424ad --- /dev/null +++ b/DM_Dal/Models/OrderFinish.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DM_Dal.Models +{ + public class OrderFinish + { + public int Id { get; set; } + + public string Pharmacy { get; set; } + + public string PatientId { get; set; } + + public string OrderNo { get; set; } + + public int State { get; set; } + + public string Operator { get; set; } + + } +} diff --git a/DM_Dal/Models/OrderInfo.cs b/DM_Dal/Models/OrderInfo.cs new file mode 100644 index 0000000..52c9d47 --- /dev/null +++ b/DM_Dal/Models/OrderInfo.cs @@ -0,0 +1,166 @@ +using System; +using System.Collections.Generic; +using System.Linq; +namespace DM_Dal.Models +{ + /// + /// + /// + public class OrderInfo + { + /// + /// + /// + public int OrderId { get; set; } + /// + /// + /// 默认值: NULL + /// + public string Pharmacy { get; set; } + /// + /// + /// + public string OrderNo { get; set; } + /// + /// + /// + public string PatientId { get; set; } + /// + /// + /// + public string PName { get; set; } + + /// + /// + /// 默认值: NULL + /// + public string Sex { get; set; } + /// + /// + /// 默认值: NULL + /// + public string Age { get; set; } + + /// + /// + /// 默认值: NULL + /// + public string IdNumber { get; set; } + + /// + /// + /// 默认值: NULL + /// + public string PatientCard { get; set; } + /// + /// + /// 默认值: NULL + /// + public string InvoiceNo { get; set; } + /// + /// + /// 默认值: NULL + /// + public string PatientNo { get; set; } + + /// + /// + /// 默认值: NULL + /// + public string DoctorName { get; set; } + /// + /// + /// 默认值: NULL + /// + public DateTime OrderDate { get; set; } + /// + /// + /// + public DateTime ChargeDate { get; set; } + /// + /// + /// 默认值: NULL + /// + public DateTime RecvDate { get; set; } + + + /// + /// + /// 默认值: NULL + /// + public string DeptName { get; set; } + /// + /// + /// 默认值: NULL + /// + public string Disease { get; set; } + /// + /// + /// 默认值: NULL + /// + public string OrderType { get; set; } + /// + /// + /// 默认值: NULL + /// + public string ChargeType { get; set; } + /// + /// + /// + public int State { get; set; } + /// + /// + /// 默认值: 0 + /// + public int? HisDispFlag { get; set; } + + /// + /// + /// 默认值: 0 + /// + public int? CancelFlag { get; set; } + + + /// + /// + /// 默认值: 0 + /// + public int? DmStatus { get; set; } + /// + /// + /// 默认值: NULL + /// + //[SugarColumn(ColumnName = "agent_name")] + //public string AgentName { get; set; } + /// + /// + /// 默认值: NULL + /// + //[SugarColumn(ColumnName = "agent_id_no")] + //public string AgentIdNo { get; set; } + /// + /// + /// 默认值: NULL + /// + public decimal? Costs { get; set; } + /// + /// + /// 默认值: NULL + /// + //[SugarColumn(ColumnName = "payments")] + //public decimal? Payments { get; set; } + /// + /// + /// 默认值: NULL + /// + //[SugarColumn(ColumnName = "dispensary")] + //public string Dispensary { get; set; } + + /// + /// + /// 默认值: NULL + /// + //[SugarColumn(ColumnName = "identity")] + //public string Identity { get; set; } + } +} \ No newline at end of file diff --git a/DM_Dal/Models/PremissionDm.cs b/DM_Dal/Models/PremissionDm.cs new file mode 100644 index 0000000..70e5029 --- /dev/null +++ b/DM_Dal/Models/PremissionDm.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +namespace DM_Dal.Models +{ + /// + /// + /// + [Serializable] + public class PremissionDm + { + /// + /// 主键 + /// + public int Id { get; set; } + /// + /// 菜单名 + /// + public string PremissionName { get; set; } + /// + /// 菜单路径 + /// + public string PremissionPath { get; set; } + /// + /// 图片source + /// + public string PremissionImage { get; set; } + + + public ObservableCollection? Children { get; set; } + + } +} diff --git a/DM_Dal/Models/RoleDm.cs b/DM_Dal/Models/RoleDm.cs new file mode 100644 index 0000000..504e8ae --- /dev/null +++ b/DM_Dal/Models/RoleDm.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Linq; +namespace DM_Dal.Models +{ + /// + /// + /// + public class RoleDm + { + /// + /// + /// + public int? Id { get; set; } + /// + /// + /// + public string RoleName { get; set; } + /// + /// + /// + //[SugarColumn(ColumnName="role_des" )] + //public string RoleDes { get; set; } + /// + /// + /// + ///[SugarColumn(ColumnName="permissions" )] + public List Permissions { get; set; } + /// + /// + /// + public string MachineId { get; set; } + } +} diff --git a/DM_Dal/Models/ShiftsReport.cs b/DM_Dal/Models/ShiftsReport.cs new file mode 100644 index 0000000..e527da0 --- /dev/null +++ b/DM_Dal/Models/ShiftsReport.cs @@ -0,0 +1,40 @@ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DM_Dal.Models +{ + public class ShiftsReport + { + public int Id { get; set; } + + public string DrugName { get; set; } + + public string DrugSpec { get; set; } + + public int? BeforeNum { get; set; } + + public int? GetNum { get; set; } + + public int? UseNum { get; set; } + + public string ManuNo { get; set; } + + public int? Surplus { get; set; } + + public DateTime OptDate { get; set; } + + public string FromOperator { get; set; } + + public string FromReviewer { get; set; } + + public string ToOperator { get; set; } + + public string ToReviewer { get; set; } + + public string MachineId { get; set; } + } +} diff --git a/DM_Dal/Models/UserList.cs b/DM_Dal/Models/UserList.cs new file mode 100644 index 0000000..d72da62 --- /dev/null +++ b/DM_Dal/Models/UserList.cs @@ -0,0 +1,66 @@ +using System; +using System.Collections.Generic; +using System.Linq; +namespace DM_Dal.Models +{ + /// + /// + /// + public class UserList + { + /// + /// + /// + public int Id { get; set; } + /// + /// + /// + public string UserName { get; set; } + /// + /// + /// + public string Nickname { get; set; } + /// + /// + /// + public string PassWord { get; set; } + + /// + /// + /// + public string UserBarcode { get; set; } + + + /// + /// + /// + //[SugarColumn(ColumnName="status" )] + //public int? Status { get; set; } + /// + /// + /// + public int? RoleId { get; set; } + + + public RoleDm? Role { get; set; } + /// + /// + /// + //[SugarColumn(ColumnName="user_card" )] + // public string UserCard { get; set; } + + /// + /// + /// + public string MachineId { get; set; } + /// + /// + /// + public byte[] Sign { get; set; } + + public override string ToString() + { + return "userList = [UserName:" + Nickname + ", UserId:" + UserName + "]"; + } + } +} diff --git a/DM_Dal/MysqlHelperDal.cs b/DM_Dal/MysqlHelperDal.cs new file mode 100644 index 0000000..2a1281b --- /dev/null +++ b/DM_Dal/MysqlHelperDal.cs @@ -0,0 +1,419 @@ +using DM_Dal.Models; +using Newtonsoft.Json; +using SCHelper.Database; +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Xml; + +namespace DM_Dal +{ + public class MysqlHelperDal + { + static string machine_id = ConfigurationManager.AppSettings["machineId"].ToString(); + #region 公共 + ////获取抽屉数量 + public int FindDrawerCount() + { + int count = 0; + string sql = $@"SELECT COUNT(1) FROM (SELECT COUNT(row_no) FROM channel_list WHERE ( drawer_type <> 3 ) AND (machine_id = '{machine_id}') GROUP BY row_no ) CountTable"; + + DataSet ds = DBHelper.GetInstance().ExecuteQuery(sql); + if (ds != null && ds.Tables[0].Rows.Count > 0) + { + + count = Convert.ToInt32(ds.Tables[0].Rows[0][0]); + } + + + return count; + } + #endregion + + #region 用户登录 + //指纹登录 + public UserList CheckUserByFingerPrinter(int fingerPrinterId) + { + UserList? user = null; + int id = fingerPrinterId; + + string sql = $@"select ul.id as id,ul.User_name as userName,r.id as roleId,r.role_name,r.permissions,r.machine_id from user_list ul + INNER JOIN role r on ul.machine_role_id=r.id where ul.Id={fingerPrinterId} and ul.machine_id='{machine_id}' and r.machine_id='{machine_id}'"; + DataSet ds = DBHelper.GetInstance().ExecuteQuery(sql); + if (ds.Tables[0].Rows.Count > 0) + { + + user = new UserList(); + user.Id = ds.Tables[0].Rows[0]["id"] is DBNull ? 0 : Convert.ToInt32(ds.Tables[0].Rows[0]["id"]); + user.UserName = ds.Tables[0].Rows[0]["userName"] is DBNull ? "" : ds.Tables[0].Rows[0]["userName"].ToString(); + user.Nickname = ds.Tables[0].Rows[0]["userName"] is DBNull ? "" : ds.Tables[0].Rows[0]["userName"].ToString(); + user.MachineId = ds.Tables[0].Rows[0]["machine_id"] is DBNull ? "" : ds.Tables[0].Rows[0]["machine_id"].ToString(); + RoleDm role = new RoleDm(); + role.Id = ds.Tables[0].Rows[0]["roleId"] is DBNull ? 0 : Convert.ToInt32(ds.Tables[0].Rows[0]["roleId"]); + role.RoleName = ds.Tables[0].Rows[0]["role_name"] is DBNull ? "" : ds.Tables[0].Rows[0]["role_name"].ToString(); + role.Permissions = JsonConvert.DeserializeObject>(ds.Tables[0].Rows[0]["permissions"] is DBNull ? "" : ds.Tables[0].Rows[0]["permissions"].ToString()); // JsonConvert.SerializeObject(reader.GetString("permissions")).ToList(); + user.Role = role; + } + + return user; + + } + //用户名密码登录 + public UserList CheckUserForLogin(string userName) + { + UserList user = null; + string sql = $@"select ul.id as id,ul.User_name as userName,ul.pass_word,r.id as roleId,r.role_name,r.permissions,r.machine_id from user_list ul + INNER JOIN role r on ul.machine_role_id=r.id where ul.user_ID='{userName}' and ul.machine_id='{machine_id}' and r.machine_id='{machine_id}'"; + DataSet ds = DBHelper.GetInstance().ExecuteQuery(sql); + if (ds.Tables[0].Rows.Count > 0) + { + + user = new UserList(); + user.Id = ds.Tables[0].Rows[0]["id"] is DBNull ? 0 : Convert.ToInt32(ds.Tables[0].Rows[0]["id"]); + user.UserName = ds.Tables[0].Rows[0]["userName"] is DBNull ? "" : ds.Tables[0].Rows[0]["userName"].ToString(); + user.Nickname = ds.Tables[0].Rows[0]["userName"] is DBNull ? "" : ds.Tables[0].Rows[0]["userName"].ToString(); + user.MachineId = ds.Tables[0].Rows[0]["machine_id"] is DBNull ? "" : ds.Tables[0].Rows[0]["machine_id"].ToString(); + RoleDm role = new RoleDm(); + role.Id = ds.Tables[0].Rows[0]["roleId"] is DBNull ? 0 : Convert.ToInt32(ds.Tables[0].Rows[0]["roleId"]); + role.RoleName = ds.Tables[0].Rows[0]["role_name"] is DBNull ? "" : ds.Tables[0].Rows[0]["role_name"].ToString(); + role.Permissions = JsonConvert.DeserializeObject>(ds.Tables[0].Rows[0]["permissions"] is DBNull ? "" : ds.Tables[0].Rows[0]["permissions"].ToString()); // JsonConvert.SerializeObject(reader.GetString("permissions")).ToList(); + user.Role = role; + user.PassWord = ds.Tables[0].Rows[0]["pass_word"] is DBNull ? "" : ds.Tables[0].Rows[0]["pass_word"].ToString(); + } + + return user; + + } + + #endregion + + #region 处方取药 + /// + /// 处方取药 + /// + /// + /// + /// + /// + public List GetOrderInfos(string Code, string SearchValue, string OrderDate, int pageNum, int pageSize, ref int totalCount) + { + List orderInfos = new List(); + totalCount = 0; + pageNum = (pageNum - 1) * pageSize; + string countSql = $@" SELECT COUNT(1) FROM (SELECT oi.order_id FROM order_info oi Inner JOIN order_detail od ON ( oi.order_no = od.order_no ) + Inner JOIN (SELECT chnguid,machine_id,row_no,col_no,pos_no,drug_id,drawer_type,board_type,state FROM channel_list + WHERE ( drawer_type = 1 ) AND (machine_id = '{machine_id}') GROUP BY drug_id ) t + ON ( od.drug_id = t.drug_id ) WHERE ( oi.dm_status = 0 ) + AND ( oi.his_disp_flag = 0 ) AND ( oi.cancel_flag = 0 ) "; + if (!string.IsNullOrEmpty(OrderDate)) + { + countSql += $" AND (DATE_FORMAT(oi.recv_date, '%Y-%m-%d') = '{OrderDate}' ) "; + } + if (!string.IsNullOrEmpty(Code) && !string.IsNullOrEmpty(SearchValue)) + { + if (Code.Equals("OrderNo")) + countSql += $" AND ( oi.order_no = '{SearchValue}' ) "; + else + countSql += $" AND ( oi.patient_id = '{SearchValue}' ) "; + } + countSql += " GROUP BY oi.order_no ) CountTable "; + DataSet ds = DBHelper.GetInstance().ExecuteQuery(countSql); + if (ds != null && ds.Tables[0].Rows.Count > 0) + { + + totalCount = Convert.ToInt32(ds.Tables[0].Rows[0][0]); + } + + + + string sql = $@"SELECT oi.order_id,oi.pharmacy,oi.order_no,oi.patient_id,oi.p_name,oi.sex,oi.age,oi.id_number, + oi.patient_card, oi.invoice_no,oi.patient_no,oi.doctor_name,oi.order_date,oi.charge_date,oi.recv_date, + oi.dept_name,oi.disease,oi.order_type,oi.charge_type,oi.state,oi.his_disp_flag,oi.cancel_flag,oi.dm_status,oi.costs FROM order_info oi Inner JOIN order_detail od ON ( oi.order_no = od.order_no ) Inner JOIN + (SELECT chnguid,machine_id,row_no,col_no,pos_no,drug_id,drawer_type,board_type,state FROM channel_list + WHERE ( drawer_type = 1 ) AND (machine_id = '{machine_id}') GROUP BY drug_id ) t + ON ( od.drug_id = t.drug_id ) + WHERE ( oi.dm_status = 0 ) AND ( oi.his_disp_flag = 0 ) AND ( oi.cancel_flag = 0 ) "; + + if (!string.IsNullOrEmpty(OrderDate)) + { + sql += $" AND (DATE_FORMAT(oi.recv_date, '%Y-%m-%d') = '{OrderDate}' ) "; + } + if (!string.IsNullOrEmpty(Code) && !string.IsNullOrEmpty(SearchValue)) + { + if (Code.Equals("OrderNo")) + sql += $" AND ( oi.order_no = '{SearchValue}' ) "; + else + sql += $" AND ( oi.patient_id = '{SearchValue}' ) "; + } + sql += $" GROUP BY oi.order_no LIMIT {pageNum},{pageSize}"; + + DataSet dsTable = DBHelper.GetInstance().ExecuteQuery(sql); + if (dsTable != null && dsTable.Tables[0].Rows.Count > 0) + { + for (int i = 0; i < dsTable.Tables[0].Rows.Count; i++) + { + + + OrderInfo order = new OrderInfo(); + order.OrderId = Convert.ToInt32(dsTable.Tables[0].Rows[i]["order_id"]); + order.Pharmacy = dsTable.Tables[0].Rows[i]["pharmacy"] is DBNull ? "" : dsTable.Tables[0].Rows[i]["pharmacy"].ToString(); + order.OrderNo = dsTable.Tables[0].Rows[i]["order_no"] is DBNull ? "" : dsTable.Tables[0].Rows[i]["order_no"].ToString(); + order.PatientId = dsTable.Tables[0].Rows[i]["patient_id"] is DBNull ? "" : dsTable.Tables[0].Rows[i]["patient_id"].ToString(); + order.PName = dsTable.Tables[0].Rows[i]["p_name"] is DBNull ? "" : dsTable.Tables[0].Rows[i]["p_name"].ToString(); + order.Sex = dsTable.Tables[0].Rows[i]["sex"] is DBNull ? "" : dsTable.Tables[0].Rows[i]["sex"].ToString(); + order.Age = dsTable.Tables[0].Rows[i]["age"] is DBNull ? "" : dsTable.Tables[0].Rows[i]["age"].ToString(); + order.IdNumber = dsTable.Tables[0].Rows[i]["id_number"] is DBNull ? "" : dsTable.Tables[0].Rows[i]["id_number"].ToString(); + order.PatientCard = dsTable.Tables[0].Rows[i]["patient_card"] is DBNull ? "" : dsTable.Tables[0].Rows[i]["patient_card"].ToString(); + order.InvoiceNo = dsTable.Tables[0].Rows[i]["invoice_no"] is DBNull ? "" : dsTable.Tables[0].Rows[i]["invoice_no"].ToString(); + order.PatientNo = dsTable.Tables[0].Rows[i]["patient_no"] is DBNull ? "" : dsTable.Tables[0].Rows[i]["patient_no"].ToString(); + order.DoctorName = dsTable.Tables[0].Rows[i]["doctor_name"] is DBNull ? "" : dsTable.Tables[0].Rows[i]["doctor_name"].ToString(); + order.OrderDate = dsTable.Tables[0].Rows[i]["order_date"] is DBNull ? DateTime.Now.AddYears(-1) : Convert.ToDateTime(dsTable.Tables[0].Rows[i]["order_date"]); + order.ChargeDate = dsTable.Tables[0].Rows[i]["charge_date"] is DBNull ? DateTime.Now.AddYears(-1) : Convert.ToDateTime(dsTable.Tables[0].Rows[i]["charge_date"]); + order.RecvDate = dsTable.Tables[0].Rows[i]["recv_date"] is DBNull ? DateTime.Now.AddYears(-1) : Convert.ToDateTime(dsTable.Tables[0].Rows[i]["recv_date"]); + order.DeptName = dsTable.Tables[0].Rows[i]["dept_name"] is DBNull ? "" : dsTable.Tables[0].Rows[i]["dept_name"].ToString(); + order.Disease = dsTable.Tables[0].Rows[i]["disease"] is DBNull ? "" : dsTable.Tables[0].Rows[i]["disease"].ToString(); + order.OrderType = dsTable.Tables[0].Rows[i]["order_type"] is DBNull ? "" : dsTable.Tables[0].Rows[i]["order_type"].ToString(); + order.ChargeType = dsTable.Tables[0].Rows[i]["charge_type"] is DBNull ? "" : dsTable.Tables[0].Rows[i]["charge_type"].ToString(); + order.State = Convert.ToInt32(dsTable.Tables[0].Rows[i]["state"]); + order.HisDispFlag = Convert.ToInt32(dsTable.Tables[0].Rows[i]["his_disp_flag"]); + order.CancelFlag = Convert.ToInt32(dsTable.Tables[0].Rows[i]["cancel_flag"]); + order.DmStatus = Convert.ToInt32(dsTable.Tables[0].Rows[i]["dm_status"]); + order.Costs = dsTable.Tables[0].Rows[i]["costs"] is DBNull ? 0 : Convert.ToInt32(dsTable.Tables[0].Rows[i]["costs"]); + orderInfos.Add(order); + } + } + return orderInfos; + } + + /// + /// 根据处方号获取处方详情 + /// + /// + /// + public List GetOrderDetails(string orderNo) + { + + List orderDetails = new List(); + + string strSql = $@"SELECT od.id,od.patient_id,od.order_no,od.charge_date,od.drug_id,od.quantity,od.order_unit, + od.unit_convercoef,od.set_manu_no,od.set_eff_date,od.use_discrip,od.use_frequ,od.use_once,od.use_by, + od.use_self,od.use_dosage,D.drug_name + FROM order_detail od + INNER JOIN DRUG_INFO D ON od.DRUG_ID=D.DRUG_ID + Inner JOIN + (SELECT chsguid,chnguid,machine_id,row_no,col_no,pos_no,drug_id,manu_no,eff_date,quantity,drawer_type,board_type,state + FROM channel_stock WHERE ( drawer_type = 1 ) AND (machine_id = '{machine_id}') GROUP BY drug_id ) t + + ON ( od.drug_id = t.drug_id ) WHERE ( od.order_no = '{orderNo}' )"; + + + DataSet dsTable = DBHelper.GetInstance().ExecuteQuery(strSql); + if (dsTable != null && dsTable.Tables[0].Rows.Count > 0) + { + + for (int i = 0; i < dsTable.Tables[0].Rows.Count; i++) + { + OrderDetail od = new OrderDetail(); + DrugInfo oi = new DrugInfo(); + od.Id = Convert.ToInt32(dsTable.Tables[0].Rows[i]["id"]); + od.PatientId = dsTable.Tables[0].Rows[i]["patient_id"] is DBNull ? "" : dsTable.Tables[0].Rows[i]["patient_id"].ToString(); + od.OrderNo = dsTable.Tables[0].Rows[i]["order_no"] is DBNull ? "" : dsTable.Tables[0].Rows[i]["order_no"].ToString(); + od.ChargeDate = dsTable.Tables[0].Rows[i]["charge_date"] is DBNull ? DateTime.Now.AddYears(-1) : Convert.ToDateTime(dsTable.Tables[0].Rows[i]["charge_date"]); + od.DrugId = dsTable.Tables[0].Rows[i]["drug_id"] is DBNull ? "" : dsTable.Tables[0].Rows[i]["drug_id"].ToString(); + od.Quantity = dsTable.Tables[0].Rows[i]["quantity"] is DBNull ? 0 : Convert.ToInt32(dsTable.Tables[0].Rows[i]["quantity"]); + od.OrderUnit = dsTable.Tables[0].Rows[i]["order_unit"] is DBNull ? "" : dsTable.Tables[0].Rows[i]["order_unit"].ToString(); + od.SetEffDate = dsTable.Tables[0].Rows[i]["set_eff_date"] is DBNull ? "" : dsTable.Tables[0].Rows[i]["set_eff_date"].ToString(); + od.SetManuNo = dsTable.Tables[0].Rows[i]["set_manu_no"] is DBNull ? "" : dsTable.Tables[0].Rows[i]["set_manu_no"].ToString(); + oi.DrugName = dsTable.Tables[0].Rows[i]["drug_name"] is DBNull ? "" : dsTable.Tables[0].Rows[i]["drug_name"].ToString(); + od.DrugInfo = oi; + orderDetails.Add(od); + } + } + return orderDetails; + } + + /// + /// 获取药品对应库存信息 + /// + /// + public List GetChannelStocks(string drugId) + { + List channelStocks = new List(); + string strSql = $@"SELECT cs.chsguid,cs.chnguid,cs.machine_id,cs.row_no,cs.col_no,cs.pos_no,cs.drug_id,cs.manu_no, + cs.eff_date,cs.quantity,cs.drawer_type,cs.board_type,cs.state,D.Drug_Name,D.drug_spec FROM channel_stock cs Inner JOIN channel_list cl ON (( cs.chnguid = cl.chnguid ) AND ( cs.drug_id = cl.drug_id )) + INNER JOIN DRUG_INFO D ON cs.drug_id=D.drug_id + WHERE ( cs.quantity > 0 ) AND ( cs.drawer_type = 1 ) AND (cs.machine_id = '{machine_id}') + AND ( cs.drug_id = '{drugId}' )ORDER BY cs.eff_date ASC,cs.row_no ASC,cs.manu_no ASC "; + DataSet dsTable = DBHelper.GetInstance().ExecuteQuery(strSql); + if (dsTable != null && dsTable.Tables[0].Rows.Count > 0) + { + for (int i = 0; i < dsTable.Tables[0].Rows.Count; i++) + { + ChannelStock channelStock = new ChannelStock(); + DrugInfo drugInfo = new DrugInfo(); + channelStock.Id = dsTable.Tables[0].Rows[i]["chsguid"] is DBNull ? "" : dsTable.Tables[0].Rows[i]["chsguid"].ToString(); + channelStock.Chnguid = dsTable.Tables[0].Rows[i]["chnguid"] is DBNull ? "" : dsTable.Tables[0].Rows[i]["chnguid"].ToString(); + channelStock.MachineId = dsTable.Tables[0].Rows[i]["machine_id"] is DBNull ? "" : dsTable.Tables[0].Rows[i]["machine_id"].ToString(); + channelStock.DrawerNo = dsTable.Tables[0].Rows[i]["row_no"] is DBNull ? 0 : Convert.ToInt32(dsTable.Tables[0].Rows[i]["row_no"]); + channelStock.ColNo = dsTable.Tables[0].Rows[i]["col_no"] is DBNull ? 0 : Convert.ToInt32(dsTable.Tables[0].Rows[i]["col_no"]); + channelStock.DrugId = dsTable.Tables[0].Rows[i]["drug_id"] is DBNull ? "" : dsTable.Tables[0].Rows[i]["drug_id"].ToString(); + channelStock.ManuNo = dsTable.Tables[0].Rows[i]["manu_no"] is DBNull ? "" : dsTable.Tables[0].Rows[i]["manu_no"].ToString(); + channelStock.EffDate = dsTable.Tables[0].Rows[i]["eff_date"] is DBNull ? "" : dsTable.Tables[0].Rows[i]["eff_date"].ToString(); + channelStock.Quantity = dsTable.Tables[0].Rows[i]["quantity"] is DBNull ? 0 : Convert.ToInt32(dsTable.Tables[0].Rows[i]["quantity"]); + channelStock.DrawerType = dsTable.Tables[0].Rows[i]["drawer_type"] is DBNull ? 0 : Convert.ToInt32(dsTable.Tables[0].Rows[i]["drawer_type"]); + channelStock.BoardType = dsTable.Tables[0].Rows[i]["board_type"] is DBNull ? 0 : Convert.ToInt32(dsTable.Tables[0].Rows[i]["board_type"]); + channelStock.State = dsTable.Tables[0].Rows[i]["state"] is DBNull ? 0 : Convert.ToInt32(dsTable.Tables[0].Rows[i]["state"]); + + drugInfo.DrugName = dsTable.Tables[0].Rows[i]["Drug_Name"] is DBNull ? "" : dsTable.Tables[0].Rows[i]["Drug_Name"].ToString(); + drugInfo.DrugSpec = dsTable.Tables[0].Rows[i]["drug_spec"] is DBNull ? "" : dsTable.Tables[0].Rows[i]["drug_spec"].ToString(); + channelStock.DrugInfo = drugInfo; + + channelStocks.Add(channelStock); + } + } + return channelStocks; + } + /// + /// 完成处方取药 + /// + /// + public bool SaveOrderTakeInfo(string orderNo, string orderDeptName, List record, int? operatorUser, int? reviewerUser) + { + bool bFlag = false; + + try + { + string strSql = $"UPDATE order_info SET dm_status=1 WHERE ORDER_NO='{orderNo}'"; + int iResult = DBHelper.GetInstance().ExecuteNonQuery(strSql); + if (iResult > 0) + { + for (int i = 0; i < record.Count; i++) + { + ChannelStock it = record[i]; + + int quantity = it.Quantity - it.TakeQuantity; + // 更新数据 库存信息 + strSql = $"UPDATE channel_stock SET quantity={quantity},manu_no='{it.ManuNo}',eff_date='{it.EffDate}' WHERE chsguid='{it.Id}'"; + + + iResult = DBHelper.GetInstance().ExecuteNonQuery(strSql); + + if (iResult > 0) + { + + + // 获取更新完库存后的药品库存 + List nowChannels = new List(); + string querySql = $@"SELECT Quantity,Manu_No,drug_id FROM channel_stock WHERE drawer_type=1 and machine_id='{machine_id}' AND drug_id='{it.DrugId}' "; + DataSet ds = DBHelper.GetInstance().ExecuteQuery(querySql); + if (ds != null && ds.Tables[0].Rows.Count > 0) + { + for (int j = 0; j < ds.Tables[0].Rows.Count; j++) + { + ChannelStock stock = new ChannelStock(); + stock.Quantity = ds.Tables[0].Rows[j]["Quantity"] is DBNull ? 0 : Convert.ToInt32(ds.Tables[0].Rows[j]["Quantity"]); ; + stock.DrugId = ds.Tables[0].Rows[j]["drug_id"] is DBNull ? "" : ds.Tables[0].Rows[j]["drug_id"].ToString(); + stock.ManuNo = ds.Tables[0].Rows[j]["Manu_No"] is DBNull ? "" : ds.Tables[0].Rows[j]["Manu_No"].ToString(); + nowChannels.Add(stock); + } + } + DateTime EFFDATE = !String.IsNullOrEmpty(it.EffDate) ? DateTime.ParseExact(it.EffDate, "yyyy-MM-dd", System.Globalization.CultureInfo.CurrentCulture) : DateTime.Now; + + int stockQuantity = nowChannels.Sum(it => it.Quantity); + int manunoQuantity = nowChannels.FindAll(it2 => it2.ManuNo == it.ManuNo).Sum(it => it.Quantity); + string supplierDept = ConfigurationManager.AppSettings["receiveDept"].ToString(); + string insertSql = $"INSERT INTO dm_machine_record " + + $"SET MACHINE_ID='{it.MachineId}',drawer_no='{it.DrawerNo}',COL_NO='{it.ColNo}',DRUG_ID='{it.DrugId}',MANU_NO='{it.ManuNo}'," + + $"EFF_DATE='{EFFDATE}',Operator={operatorUser},reviewer={reviewerUser}," + + $"operation_time=NOW(),quantity={it.TakeQuantity},type=2,invoice_id='{orderNo}',stock_quantity={stockQuantity}," + + $"manunoQuantity={manunoQuantity},supplierDept='{supplierDept}',receiveDept='{orderDeptName}'"; + iResult = DBHelper.GetInstance().ExecuteNonQuery(insertSql); + if (iResult > 0) + { + bFlag = true; + } + } + } + } + } + catch (Exception ex) + { + bFlag = false; + } + return bFlag; + } + /// + /// 根据抽屉号、库位号查询库存信息 + /// + /// + /// + /// + public List GetChannelStockList(int rowNo, int colNo) + { + List channel = new List(); + + + string strSql = $"SELECT ROW_NO,COL_NO,eff_date,quantity FROM CHANNEL_STOCK WHERE MACHINE_ID='{ConfigurationManager.AppSettings["machineId"] ?? "DM1"}' AND ROW_NO={rowNo} AND COL_NO={colNo} ORDER BY EFF_DATE"; + DataSet dsTable = DBHelper.GetInstance().ExecuteQuery(strSql); + if (dsTable != null && dsTable.Tables[0].Rows.Count > 0) + { + for (int i = 0; i < dsTable.Tables[0].Rows.Count; i++) + { + + ChannelStock cs = new ChannelStock(); + cs.DrawerNo = dsTable.Tables[0].Rows[0]["row_no"] is DBNull ? 0 : Convert.ToInt32(dsTable.Tables[0].Rows[0]["row_no"]); + cs.ColNo = dsTable.Tables[0].Rows[0]["col_no"] is DBNull ? 0 : Convert.ToInt32(dsTable.Tables[0].Rows[0]["col_no"]); + cs.EffDate = dsTable.Tables[0].Rows[0]["eff_date"] is DBNull ? "" : dsTable.Tables[0].Rows[0]["eff_date"].ToString(); + cs.Quantity = dsTable.Tables[0].Rows[0]["quantity"] is DBNull ? 0 : Convert.ToInt32(dsTable.Tables[0].Rows[0]["quantity"]); + channel.Add(cs); + } + } + return channel; + } + #endregion + + + #region 调拨出库 + + #endregion + + #region 抽屉取药 + /// + /// 通过抽屉号获取库存信息 + /// + /// + public List GetChannelStockByDrawer(int row_no) + { + List channelStocks = new List(); + string strSql = $@"SELECT chsguid,chnguid,machine_id,row_no,col_no,pos_no,drug_id,manu_no,eff_date,quantity,drawer_type,board_type,state FROM channel_stock + WHERE ( row_no = {row_no} ) AND ( drug_id IS NOT NULL ) AND (machine_id = '{machine_id}') AND ( drawer_type = 1 ) AND ( quantity > 0 )ORDER BY col_no ASC,eff_date ASC"; + DataSet ds = DBHelper.GetInstance().ExecuteQuery(strSql); + if (ds != null && ds.Tables[0].Rows.Count > 0) + { + for (int i = 0; i < ds.Tables[0].Rows.Count; i++) + { + ChannelStock stock = new ChannelStock(); + stock.Id = ds.Tables[0].Rows[i]["chsguid"].ToString(); + stock.Chnguid = ds.Tables[0].Rows[i]["chnguid"].ToString(); + stock.DrawerNo = row_no; + stock.ColNo = Convert.ToInt32(ds.Tables[0].Rows[i]["col_no"]); + stock.ManuNo = ds.Tables[0].Rows[i]["chnguid"].ToString(); + stock.EffDate = ds.Tables[0].Rows[i]["eff_date"].ToString(); + stock.Quantity = Convert.ToInt32(ds.Tables[0].Rows[i]["quantity"]); + stock.BoardType = Convert.ToInt32(ds.Tables[0].Rows[i]["board_type"]); + stock.MachineId = ds.Tables[0].Rows[i]["machine_id"].ToString(); + channelStocks.Add(stock); + } + } + return channelStocks; + } + + #endregion + } +} diff --git a/DM_Dal/dll/SCHelper.Database.dll b/DM_Dal/dll/SCHelper.Database.dll new file mode 100644 index 0000000000000000000000000000000000000000..5de3ea3dd950bdc06e5771680fa32caec9c821ec GIT binary patch literal 13824 zcmeHO3vg8Dbw2;y-MbG-YjzFdCGg51A`7vR5MT({K}Z7RA|z`C7?)bCRu{2mwRgF9 zg^?8zQ5+hNn}-|H)|2L8JWbu|#3zVC75WhPy%l`2Xq_&Czpw!W zIvJ~%H#j*G$SUc$P6nLhb`%Yss1}?R$4*RF(y?+j3^`Yt!pXii;jB1z678yBrCH#* z;^5p23Q%(^(f3wx?cUsRhvCMEB9rLvHyYz;Hqpu!gWd*riYRsl#J^!fZR89R^fy$+ zsqsb_X>r7b)|_IKD-pBV3^p!??gddcp+Dx)pfJ@pQG~Nw*%G3MaD}Iszbe?pIrFd+ zIB&$?neO8gA-TN;e+DdI;0^NL@ZBd$pM;H*>{VQe#NIyHYczt+wd4TZmUG*QkQ4YRO7G|?tqUbIuZ zI&4D3M8&#BVs8F|CuhYJ@LDjxCM&n(Lj1QTD2!&jolyszde~Tt zDX^|Kg7G)85270>T2BGMisF2>K!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2|CHRH8cEoIDc^86s)~ znS;+tBN@nFBQ*--KxwUw)127kH^FWcVTmEN%xsu^Az(5FCbHEikP#(nsIexcRZ4*0 zCun}MfAe7F5YQ3qS2yC@({+LdqfM12t`E8NL_dxTG42zuw8SA>FDP6-9b?G|o^#g< zx;nddWZm`I%*cw)k*+l>R%f%>73p=El`BTBU%7Uqb6q;KI%DE%mmp&$K6c>`pPmHX z==cH>mdGOhPBN%8--b%xUv=z7jk53M_erY!KFU2?!8wc1zi06|bXTf3b^6cFKK$nK zj|QH-=3f_l=O=?6cNktjw3AOgt2$S84!!%$$KO5kZJp#cY*1`e(TZ>Sv5 z5Dr;Ght{nb!rp44Tvr;B#o-KF|NnWZ_-tIh7BL<#Q`4X2-#~rt{vO-GF0=#H*MCJZ zP5C;+trwR<2fj4^re6Hzj_~~npQ)x@JUS{g zZl+zp`tVD8Kj=QdE&i|W^pg7CN4zQdH}_PvJ!hdf8;N!bEo z$svDf?8Yc8h+w*nBzEi^{`g8Da{~J_&Ly%}4>C~19?cPt(ik)n#c}sa8v_BKv%xmX z@iBE}TdQSGc0z{@4@$^~SLNkQKVg~r(2#w@H&kV$swXRW&>w< gDwCJ?V|%~7E|URFX#Opxv#M5JM(Ve$-_Q*F58X;&N&o-= literal 0 HcmV?d00001 diff --git a/DM_Weight.sln b/DM_Weight.sln new file mode 100644 index 0000000..c3a9b49 --- /dev/null +++ b/DM_Weight.sln @@ -0,0 +1,31 @@ + +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 +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + 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|x86.ActiveCfg = Debug|x86 + {439FA76B-F874-40DB-BAF2-E3647CD55B10}.Debug|x86.Build.0 = Debug|x86 + {439FA76B-F874-40DB-BAF2-E3647CD55B10}.Release|Any CPU.ActiveCfg = Release|Any CPU + {439FA76B-F874-40DB-BAF2-E3647CD55B10}.Release|Any CPU.Build.0 = Release|Any CPU + {439FA76B-F874-40DB-BAF2-E3647CD55B10}.Release|x86.ActiveCfg = Release|x86 + {439FA76B-F874-40DB-BAF2-E3647CD55B10}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {E50E8179-1102-41F1-92F5-2905C75898A6} + EndGlobalSection +EndGlobal diff --git a/DM_Weight/App.config b/DM_Weight/App.config new file mode 100644 index 0000000..3f827c0 --- /dev/null +++ b/DM_Weight/App.config @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/DM_Weight/App.xaml b/DM_Weight/App.xaml new file mode 100644 index 0000000..704fc50 --- /dev/null +++ b/DM_Weight/App.xaml @@ -0,0 +1,19 @@ + + + + + + + + + + + diff --git a/DM_Weight/App.xaml.cs b/DM_Weight/App.xaml.cs new file mode 100644 index 0000000..4aeeac5 --- /dev/null +++ b/DM_Weight/App.xaml.cs @@ -0,0 +1,367 @@ +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 SqlSugar; +using Microsoft.Extensions.DependencyInjection; +using DM_Weight.Services; +using DM_Weight.Models; +using System.Diagnostics; +using System.Runtime.InteropServices; +//using DM_Dal; +//using DM_Dal.Models; + +namespace DM_Weight +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : PrismApplication + { + #region 当前登录用户的发药人信息 + private static UserList _currentFaUserList = new UserList(); + public static UserList CurrentFaUserList + { + get => _currentFaUserList; + set => _currentFaUserList = value; + } + + #endregion 当前登录用户的发药人信息 + + #region 当前登录用户的审核人信息 + private static UserList _currentShenUserList = new UserList(); + public static UserList CurrentShenUserList + { + get => _currentShenUserList; + set => _currentShenUserList = value; + } + #endregion 当前登录用户的审核人信息 + + private readonly ILog logger = LogManager.GetLogger(typeof(App)); + public App() + { + TabTipAutomation.IgnoreHardwareKeyboard = HardwareKeyboardIgnoreOptions.IgnoreAll; + TabTipAutomation.BindTo(); + TabTipAutomation.BindTo(); + } + + + + protected override Window CreateShell() + { + //UI线程未捕获异常处理事件 + this.DispatcherUnhandledException += OnDispatcherUnhandledException; + //Task线程内未捕获异常处理事件 + TaskScheduler.UnobservedTaskException += OnUnobservedTaskException; + //多线程异常 + AppDomain.CurrentDomain.UnhandledException += OnUnhandledException; + + return Container.Resolve(); + } + + 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.StackTrace};{item.GetType()}{Environment.NewLine}来自:{item.Source}{Environment.NewLine}异常内容:{item.Message}"); + if (item.GetType() == typeof(SqlSugar.SqlSugarException)) + { + //UserList userList = new SqlHelperService().CheckUserByFingerPrinter(1); + } + } + + //将异常标识为已经观察到 + 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) + { + // 注入日志 + XmlConfigurator.ConfigureAndWatch(new FileInfo(AppDomain.CurrentDomain.BaseDirectory + "log4net.config")); + //containerRegistry.RegisterInstance(LogManager.GetLogger("")); + + // 串口工具 + containerRegistry.RegisterSingleton(); + // 指纹机工具 + containerRegistry.RegisterSingleton(); + // 组态屏工具 + containerRegistry.RegisterSingleton(); + containerRegistry.RegisterSingleton(); + + containerRegistry.Register(); + + // 主窗口 + containerRegistry.Register(); + containerRegistry.RegisterForNavigation(); + + // 分页 + //containerRegistry.Register(); + //containerRegistry.Register(); + + // 登录页面 + containerRegistry.RegisterForNavigation(); + + // 布局页面 + containerRegistry.RegisterForNavigation(); + + // 录入指纹模态框 + containerRegistry.RegisterDialog(); + containerRegistry.RegisterForNavigation(); + + + #region 取药 + // 处方取药页面 + containerRegistry.RegisterForNavigation(); + // 处方取药模态框 + containerRegistry.RegisterDialog(); + containerRegistry.RegisterForNavigation(); + // 调拨取药页面 + containerRegistry.RegisterForNavigation(); + // 调拨取药模态框 + containerRegistry.RegisterDialog(); + containerRegistry.RegisterForNavigation(); + // 抽屉取药页面 + containerRegistry.RegisterForNavigation(); + // 自选取药模态框 + containerRegistry.RegisterDialog(); + containerRegistry.RegisterForNavigation(); + // 自选取药页面 + containerRegistry.RegisterForNavigation(); + #endregion + + #region 加药 + // 自选加药页面 + containerRegistry.RegisterForNavigation(); + // 调拨加药页面 + //containerRegistry.RegisterForNavigation(); + // 调拨加药页面 + containerRegistry.RegisterForNavigation(); + + // 调拨取药模态框 + //containerRegistry.RegisterDialog(); + //containerRegistry.RegisterForNavigation(); + // 抽屉加药页面 + containerRegistry.RegisterForNavigation(); + // 自选加药模态框 + containerRegistry.RegisterDialog(); + containerRegistry.RegisterForNavigation(); + //多批次抽屉加药 + containerRegistry.RegisterForNavigation(); + #endregion + + #region 还药 + // 还药页面 + containerRegistry.RegisterForNavigation(); + // 按记录归还药品模态框 + containerRegistry.RegisterDialog(); + containerRegistry.RegisterForNavigation(); + + // 还药页面2 + containerRegistry.RegisterForNavigation(); + // 按处方归还药品模态框 + containerRegistry.RegisterDialog(); + containerRegistry.RegisterForNavigation(); + // 还空瓶页面 + containerRegistry.RegisterForNavigation(); + // 归还空瓶模态框 + containerRegistry.RegisterDialog(); + containerRegistry.RegisterForNavigation(); + #endregion + + #region 库存管理 + // 库存列表页面 + containerRegistry.RegisterForNavigation(); + // 库位绑定模态框 + //containerRegistry.RegisterDialog(); + //containerRegistry.RegisterForNavigation(); + + // 库位绑定模态框 + containerRegistry.RegisterDialog(); + containerRegistry.RegisterForNavigation(); + // 库存盘点页面 + //containerRegistry.RegisterForNavigation(); + containerRegistry.RegisterDialog(); + containerRegistry.RegisterForNavigation(); + // 库存盘点页面--新(类似库存列表页面) + containerRegistry.RegisterForNavigation(); + // 库存盘点页面--新(类似库存列表页面) + //containerRegistry.RegisterForNavigation(); + // 库存盘点页面--新(类似库存列表页面) + containerRegistry.RegisterForNavigation(); + // 药品列表页面 + containerRegistry.RegisterForNavigation(); + //库存列表导出账册弹窗 + //containerRegistry.RegisterForNavigation(); + #endregion + + #region 系统设置 + // 用户管理页面 + containerRegistry.RegisterForNavigation(); + // 编辑用户模态框 + containerRegistry.RegisterDialog(); + containerRegistry.RegisterForNavigation(); + // 角色管理页面 + containerRegistry.RegisterForNavigation(); + // 系统设置 + containerRegistry.RegisterForNavigation(); + // 调试页面 + containerRegistry.RegisterForNavigation(); + + #endregion + + // 设备记录页面 + containerRegistry.RegisterForNavigation(); + + containerRegistry.RegisterForNavigation(); + + //交接班 + //containerRegistry.RegisterForNavigation(); + //交接班记录 + containerRegistry.RegisterForNavigation(); + + containerRegistry.RegisterForNavigation(); + + //交接班 + containerRegistry.RegisterForNavigation(); + + //containerRegistry.RegisterSingleton(() => SqlSugarHelperNew.GetInstance()); + + #region SqlSugar-IOC单例 + //containerRegistry.RegisterSingleton(s => + // { + // SqlSugarScope sqlSugar = new SqlSugarScope(new ConnectionConfig() + // { + // ConnectionString = ConfigurationManager.ConnectionStrings["database"].ToString(), + // DbType = SqlSugar.DbType.MySql, + // IsAutoCloseConnection = true + // }, + // db => + // { + // //单例参数配置,所有上下文生效 + // db.Aop.OnLogExecuting = (sql, pars) => + // { + // //获取IOC对象不要求在一个上下文 + // //vra log=s.GetService() + + // //获取IOC对象要求在一个上下文 + // //var appServive = s.GetService(); + // //var log= appServive?.HttpContext?.RequestServices.GetService(); + // }; + // }); + // return sqlSugar; + // }); + #endregion + + //账册页面 + containerRegistry.RegisterForNavigation(); + //账册服务类 + containerRegistry.Register(); + + + //containerRegistry.Register(); + // 配置数据库信息 + //SCHelper.Database.DBHelper.GetInstance().SetConnectionConfig(SCHelper.Database.SCDbType.MySQL, + // ConfigurationManager.AppSettings["DataBaseIP"], + // ConfigurationManager.AppSettings["DataBaseName"], + // "root", + // ConfigurationManager.AppSettings["Password"]); + + } + + private void PrismApplication_Startup(object sender, StartupEventArgs e) + { + // 配置数据库信息 + SCHelper.Database.DBHelper.GetInstance().SetConnectionConfig(SCHelper.Database.SCDbType.MySQL, + "127.0.0.1", + "hunanxianchang_db", + "root", + "root"); + //获取欲启动程序名 + string processName = System.Diagnostics.Process.GetCurrentProcess().ProcessName; + //检查程序是否已经启动,已经启动则显示提示退出程序 + if (System.Diagnostics.Process.GetProcessesByName(processName).Length > 1) + { + //系统在运行 + 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); + //protected IServiceProvider ConfigureServices(IServiceCollection services) + //{ + // // 创建 SqlSugar 实例 + // var db = new SqlSugarClient(new ConnectionConfig() + // { + // ConnectionString = "server=127.0.0.1;uid=root;pwd=123456;database=mydb", + // DbType = DbType.MySql, + // IsAutoCloseConnection = true, + // InitKeyType = InitKeyType.Attribute + // }); + // // 将实例注册到 IServiceCollection 中 + // services.AddSingleton(db); + //} + } +} diff --git a/DM_Weight/AssemblyInfo.cs b/DM_Weight/AssemblyInfo.cs new file mode 100644 index 0000000..8b5504e --- /dev/null +++ b/DM_Weight/AssemblyInfo.cs @@ -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) +)] diff --git a/DM_Weight/CommonDal/LoginDal.cs b/DM_Weight/CommonDal/LoginDal.cs new file mode 100644 index 0000000..08e2f49 --- /dev/null +++ b/DM_Weight/CommonDal/LoginDal.cs @@ -0,0 +1,37 @@ +using DM_Weight.Models; +using Newtonsoft.Json; +using SCHelper.Database; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Reflection.PortableExecutable; +using System.Text; +using System.Threading.Tasks; + +namespace DM_Weight.CommonDal +{ + public class LoginDal + { + public UserList GetLoginInfo(string userName,string passWord) + { + UserList user = new UserList(); ; + string sql = @"select ul.id as id,ul.User_name as userName,r.id as rId,r.role_name,r.permissions,r.machine_id from user_list ul + INNER JOIN role r on ul.machine_role_id=r.id where ul.Id=@ID and ul.machine_id=@machine_id and r.machine_id=@machine_id"; + DataSet ds= DBHelper.GetInstance().ExecuteQuery(sql); + if (ds != null && ds.Tables[0] != null && ds.Tables[0].Rows.Count>0) + { + user.Id =Convert.ToInt32(ds.Tables[0].Rows[0]["id"] ??0); + user.UserName = ds.Tables[0].Rows[0]["userName"].ToString() ?? ""; + user.Nickname = ds.Tables[0].Rows[0]["userName"].ToString()??""; + user.MachineId = ds.Tables[0].Rows[0]["machine_id"].ToString()??""; + RoleDm role = new RoleDm(); + role.Id = Convert.ToInt32(ds.Tables[0].Rows[0]["rId"] ?? 0); + role.RoleName = ds.Tables[0].Rows[0]["role_name"].ToString() ?? ""; ; + role.Permissions = JsonConvert.DeserializeObject>(ds.Tables[0].Rows[0]["permissions"] is DBNull ? "" : ds.Tables[0].Rows[0]["permissions"].ToString()); // JsonConvert.SerializeObject(reader.GetString("permissions")).ToList(); + user.Role = role; + } + return user; + } + } +} diff --git a/DM_Weight/Components/pagination/Pagination.xaml b/DM_Weight/Components/pagination/Pagination.xaml new file mode 100644 index 0000000..8b3eee6 --- /dev/null +++ b/DM_Weight/Components/pagination/Pagination.xaml @@ -0,0 +1,43 @@ + + + + + + +