220 lines
		
	
	
		
			5.9 KiB
		
	
	
	
		
			C#
		
	
	
	
		
		
			
		
	
	
			220 lines
		
	
	
		
			5.9 KiB
		
	
	
	
		
			C#
		
	
	
	
| 
								 | 
							
								using System;
							 | 
						|||
| 
								 | 
							
								using System.Collections.Generic;
							 | 
						|||
| 
								 | 
							
								using System.Linq;
							 | 
						|||
| 
								 | 
							
								using Prism.Mvvm;
							 | 
						|||
| 
								 | 
							
								using SqlSugar;
							 | 
						|||
| 
								 | 
							
								namespace DM_Weight.Models
							 | 
						|||
| 
								 | 
							
								{
							 | 
						|||
| 
								 | 
							
								    /// <summary>
							 | 
						|||
| 
								 | 
							
								    /// 
							 | 
						|||
| 
								 | 
							
								    ///</summary>
							 | 
						|||
| 
								 | 
							
								    [SugarTable("channel_stock")]
							 | 
						|||
| 
								 | 
							
								    public class ChannelStock : BindableBase
							 | 
						|||
| 
								 | 
							
								    {
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        ///  
							 | 
						|||
| 
								 | 
							
								        ///</summary>
							 | 
						|||
| 
								 | 
							
								        [SugarColumn(ColumnName = "chsguid", IsPrimaryKey = true)]
							 | 
						|||
| 
								 | 
							
								        //[SugarColumn(ColumnName = "id", IsPrimaryKey = true)]
							 | 
						|||
| 
								 | 
							
								        public string Id { get; set; }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        [SugarColumn(ColumnName = "chnguid")]
							 | 
						|||
| 
								 | 
							
								        public string Chnguid { get; set; }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        ///  
							 | 
						|||
| 
								 | 
							
								        /// 默认值: NULL
							 | 
						|||
| 
								 | 
							
								        ///</summary>
							 | 
						|||
| 
								 | 
							
								        [SugarColumn(ColumnName = "machine_id")]
							 | 
						|||
| 
								 | 
							
								        public string MachineId { get; set; }
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        ///  
							 | 
						|||
| 
								 | 
							
								        /// 默认值: NULL
							 | 
						|||
| 
								 | 
							
								        ///</summary>
							 | 
						|||
| 
								 | 
							
								        [SugarColumn(ColumnName = "row_no")]
							 | 
						|||
| 
								 | 
							
								        public int DrawerNo { get; set; }
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        ///  
							 | 
						|||
| 
								 | 
							
								        /// 默认值: NULL
							 | 
						|||
| 
								 | 
							
								        ///</summary>
							 | 
						|||
| 
								 | 
							
								        [SugarColumn(ColumnName = "col_no")]
							 | 
						|||
| 
								 | 
							
								        public int ColNo { get; set; }
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        ///  
							 | 
						|||
| 
								 | 
							
								        /// 默认值: NULL
							 | 
						|||
| 
								 | 
							
								        ///</summary>
							 | 
						|||
| 
								 | 
							
								        [SugarColumn(ColumnName = "pos_no")]
							 | 
						|||
| 
								 | 
							
								        public int PosNo { get; set; }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        ///  
							 | 
						|||
| 
								 | 
							
								        /// 默认值: NULL
							 | 
						|||
| 
								 | 
							
								        ///</summary>
							 | 
						|||
| 
								 | 
							
								        [SugarColumn(ColumnName = "drug_id")]
							 | 
						|||
| 
								 | 
							
								        public string DrugId { get; set; }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        ///  
							 | 
						|||
| 
								 | 
							
								        /// 默认值: NULL
							 | 
						|||
| 
								 | 
							
								        ///</summary>
							 | 
						|||
| 
								 | 
							
								        [SugarColumn(ColumnName = "manu_no")]
							 | 
						|||
| 
								 | 
							
								        public string ManuNo { get; set; }
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        ///  
							 | 
						|||
| 
								 | 
							
								        /// 默认值: NULL
							 | 
						|||
| 
								 | 
							
								        ///</summary>
							 | 
						|||
| 
								 | 
							
								        [SugarColumn(ColumnName = "eff_date")]
							 | 
						|||
| 
								 | 
							
								        public string EffDate { get; set; }
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        ///  
							 | 
						|||
| 
								 | 
							
								        /// 默认值: NULL
							 | 
						|||
| 
								 | 
							
								        ///</summary>
							 | 
						|||
| 
								 | 
							
								        [SugarColumn(ColumnName = "quantity")]
							 | 
						|||
| 
								 | 
							
								        public int Quantity { get; set; }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        ///  
							 | 
						|||
| 
								 | 
							
								        /// 默认值: 1
							 | 
						|||
| 
								 | 
							
								        ///</summary>
							 | 
						|||
| 
								 | 
							
								        [SugarColumn(ColumnName = "drawer_type")]
							 | 
						|||
| 
								 | 
							
								        public int DrawerType { get; set; }
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        ///  
							 | 
						|||
| 
								 | 
							
								        /// 默认值: 1
							 | 
						|||
| 
								 | 
							
								        ///</summary>
							 | 
						|||
| 
								 | 
							
								        [SugarColumn(ColumnName = "board_type")]
							 | 
						|||
| 
								 | 
							
								        public int BoardType { get; set; }
							 | 
						|||
| 
								 | 
							
								        private int? _state = 0;
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        ///  
							 | 
						|||
| 
								 | 
							
								        /// 默认值: 1(用于标识毒麻柜是否给交接柜补药:0未补,1已补)
							 | 
						|||
| 
								 | 
							
								        ///</summary>
							 | 
						|||
| 
								 | 
							
								        [SugarColumn(ColumnName = "state")]
							 | 
						|||
| 
								 | 
							
								        public int? State
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            get => _state;
							 | 
						|||
| 
								 | 
							
								            set { SetProperty(ref _state, value); }
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        [SugarColumn(IsIgnore = true)]
							 | 
						|||
| 
								 | 
							
								        public bool IsSelected { get; set; }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        [SugarColumn(IsIgnore = true)]
							 | 
						|||
| 
								 | 
							
								        public string Location
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            get => DrawerNo + "-" + ColNo;
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								        private int _addQuantity = 0;
							 | 
						|||
| 
								 | 
							
								        [SugarColumn(IsIgnore = true)]
							 | 
						|||
| 
								 | 
							
								        public int AddQuantity
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            get => _addQuantity;
							 | 
						|||
| 
								 | 
							
								            set
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                SetProperty(ref _addQuantity, value);
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        private int _takeQuantity = 0;
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        [SugarColumn(IsIgnore = true)]
							 | 
						|||
| 
								 | 
							
								        public int TakeQuantity
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            get => _takeQuantity;
							 | 
						|||
| 
								 | 
							
								            set
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                if (value > Quantity)
							 | 
						|||
| 
								 | 
							
								                {
							 | 
						|||
| 
								 | 
							
								                    throw new ArgumentException("取药数量不能大于库存");
							 | 
						|||
| 
								 | 
							
								                }
							 | 
						|||
| 
								 | 
							
								                SetProperty(ref _takeQuantity, value);
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								        //private string _tipMessage=string.Empty;
							 | 
						|||
| 
								 | 
							
								        //[SugarColumn(IsIgnore = true)]
							 | 
						|||
| 
								 | 
							
								        //public string TipMessage
							 | 
						|||
| 
								 | 
							
								        //{
							 | 
						|||
| 
								 | 
							
								        //    get => _tipMessage;
							 | 
						|||
| 
								 | 
							
								        //    set
							 | 
						|||
| 
								 | 
							
								        //    {
							 | 
						|||
| 
								 | 
							
								        //        SetProperty(ref _tipMessage, value);
							 | 
						|||
| 
								 | 
							
								        //    }
							 | 
						|||
| 
								 | 
							
								        //}
							 | 
						|||
| 
								 | 
							
								        private int _returnQuantity = 0;
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        [SugarColumn(IsIgnore = true)]
							 | 
						|||
| 
								 | 
							
								        public int ReturnQuantity
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            get => _returnQuantity;
							 | 
						|||
| 
								 | 
							
								            set
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                SetProperty(ref _returnQuantity, value);
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        private int _checkQuantity = 0;
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        [SugarColumn(IsIgnore = true)]
							 | 
						|||
| 
								 | 
							
								        public int CheckQuantity
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            get => _checkQuantity;
							 | 
						|||
| 
								 | 
							
								            set
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                if (value < 0)
							 | 
						|||
| 
								 | 
							
								                {
							 | 
						|||
| 
								 | 
							
								                    throw new ArgumentException("盘点数量不能是负数");
							 | 
						|||
| 
								 | 
							
								                }
							 | 
						|||
| 
								 | 
							
								                SetProperty(ref _checkQuantity, value);
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 药品基数
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        private int _baseQuantity = 0;
							 | 
						|||
| 
								 | 
							
								        [SugarColumn(ColumnName = "Check_Quantity")]
							 | 
						|||
| 
								 | 
							
								        public int BaseQuantity
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            get => _baseQuantity;
							 | 
						|||
| 
								 | 
							
								            set
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                SetProperty(ref _baseQuantity, value);
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        [SugarColumn(IsIgnore = true)]
							 | 
						|||
| 
								 | 
							
								        public int? CanReturnQuantity { get; set; }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        [Navigate(NavigateType.ManyToOne, nameof(DrugId))]
							 | 
						|||
| 
								 | 
							
								        public DrugInfo DrugInfo { get; set; }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        [SugarColumn(IsIgnore = true)]
							 | 
						|||
| 
								 | 
							
								        public int process { get; set; } = 0;
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        [SugarColumn(IsIgnore = true)]
							 | 
						|||
| 
								 | 
							
								        public DrugManuNo? drugManuNo { get; set; }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        //private ChannelList? _channelList;
							 | 
						|||
| 
								 | 
							
								        //[Navigate(NavigateType.ManyToOne, nameof(Chnguid))]
							 | 
						|||
| 
								 | 
							
								        //public ChannelList ChannelLst { get => _channelList; set => SetProperty(ref _channelList, value); }
							 | 
						|||
| 
								 | 
							
								        //[SugarColumn(IsIgnore = true)]
							 | 
						|||
| 
								 | 
							
								        //public DrugPleaseClaim PleaseClaim { get; set; }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        //dm_machine_record表id值
							 | 
						|||
| 
								 | 
							
								        [SugarColumn(IsIgnore = true)]
							 | 
						|||
| 
								 | 
							
								        public int? MachineRecordId { get; set; }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        [SugarColumn(IsIgnore =true)]
							 | 
						|||
| 
								 | 
							
								        public string OrderNos { get; set; }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        //交接柜加药数量
							 | 
						|||
| 
								 | 
							
								        [SugarColumn(ColumnName = "col_no1")]
							 | 
						|||
| 
								 | 
							
								        public int AddToJJNum { get; set; }
							 | 
						|||
| 
								 | 
							
								        //需要加药数量
							 | 
						|||
| 
								 | 
							
								        [SugarColumn(ColumnName = "col_no2")]
							 | 
						|||
| 
								 | 
							
								        public int NeedNum { get; set; }
							 | 
						|||
| 
								 | 
							
								    }
							 | 
						|||
| 
								 | 
							
								}
							 |