diff --git a/ButcherManageClient/Login.cs b/ButcherManageClient/Login.cs index f9959f1..6d9d514 100644 --- a/ButcherManageClient/Login.cs +++ b/ButcherManageClient/Login.cs @@ -70,13 +70,13 @@ namespace ButcherManageClient ButcherAppContext.Context.UserConfig.Connection = false; } -#if DEBUG +//#if DEBUG // var form = AfterLoginUtil.CreateForm("分割称重"); -#endif +//#endif -#if DEBUG +//#if DEBUG var form = AfterLoginUtil.CreateForm(ButcherAppContext.Context.UserConfig.Role); -#endif +//#endif // var form = AfterLoginUtil.CreateForm("分割入库"); // var form = AfterLoginUtil.CreateForm("分割称重"); diff --git a/TrunksIousOutInStore/LocalSyncBO/TrunksIousOutInStoreRecord.cs b/TrunksIousOutInStore/LocalSyncBO/TrunksIousOutInStoreRecord.cs index c59bb96..36ffb86 100644 --- a/TrunksIousOutInStore/LocalSyncBO/TrunksIousOutInStoreRecord.cs +++ b/TrunksIousOutInStore/LocalSyncBO/TrunksIousOutInStoreRecord.cs @@ -4,20 +4,18 @@ using BO.BO; using Forks.EnterpriseServices.DataForm; using Forks.EnterpriseServices.DomainObjects2; using Newtonsoft.Json; -using TrunksIousOutInStore.Rpc; namespace TrunksIousOutInStore.LocalSyncBO { - [Serializable] - [MapToTable("TrunksIousOutInStoreRecord")] - [DFClass] - public class TrunksIousOutInStoreRecord: LocalSyncBase + public class TrunksIousOutInStoreRecord { public string BarCode { get; set; } - public long? Goods_ID { get; set; } + public string Goods_Name { get; set; } + public long? ID { get; set; } + private int mNumber = 1; public int Number { @@ -25,24 +23,10 @@ namespace TrunksIousOutInStore.LocalSyncBO set { mNumber = value; } } - public decimal? BeforeWeight { get; set; } - public decimal? Weight { get; set; } - public decimal? DiscontWeight { get { return (BeforeWeight ?? 0) - (Weight ?? 0); } } + public decimal? BeforeWeight { get; set; } - public string CarcassStatus{ get; set; }// 胴体状态 - public override string GetDtoJson() - { - var config = new MapperConfiguration(cfg => { - cfg.CreateMap(); - }); - var mapper = config.CreateMapper(); - var dto = mapper.Map(this); - dto.Client_ID = this.ID; - return JsonConvert.SerializeObject(dto); - } + public decimal LossWeight { get { return (BeforeWeight ?? 0) - (Weight ?? 0); } } } - - } diff --git a/TrunksIousOutInStore/LocalSyncBO/TrunksIousOutInStoreRecordExt.cs b/TrunksIousOutInStore/LocalSyncBO/TrunksIousOutInStoreRecordExt.cs new file mode 100644 index 0000000..9024554 --- /dev/null +++ b/TrunksIousOutInStore/LocalSyncBO/TrunksIousOutInStoreRecordExt.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace TrunksIousOutInStore.LocalSyncBO +{ + [Serializable] + public class TrunksIousOutInStoreRecordExt + { + public long? WorkShop_ID { get; set; } + + public long? WorkUnit_ID { get; set; } + + public long? Store_ID { get; set; } + + public long? ProductBatch_ID { get; set; } + + public string ProductBatch { get; set; } + + public decimal? Weight { get; set; } + + public long? ID { get; set; } + + public string Creator { get; set; } + } +} diff --git a/TrunksIousOutInStore/Rpc/TrunksIousOutInStoreRecordDto.cs b/TrunksIousOutInStore/Rpc/TrunksIousOutInStoreRecordDto.cs deleted file mode 100644 index 612fb5c..0000000 --- a/TrunksIousOutInStore/Rpc/TrunksIousOutInStoreRecordDto.cs +++ /dev/null @@ -1,24 +0,0 @@ -using BO.BO.Dtos; -using Forks.EnterpriseServices.DataForm; - -namespace TrunksIousOutInStore.Rpc -{ - [DFClass] - public class TrunksIousOutInStoreRecordDto: SyncBaseDto - { - - public string BarCode { get; set; } - public string Goods_Name { get; set; } - public string Goods_Spec { get; set; } - - private int mNumber = 1; - public int Number { - get { return mNumber; } - set { mNumber = value; } - } - - public decimal? Weight { get; set; } - - public int WeightType { get; set; }// 称重类型 跟白条状态有关 - } -} diff --git a/TrunksIousOutInStore/Rpc/TrunksIousOutInStoreRecordRpc.cs b/TrunksIousOutInStore/Rpc/TrunksIousOutInStoreRecordRpc.cs deleted file mode 100644 index 05ecc40..0000000 --- a/TrunksIousOutInStore/Rpc/TrunksIousOutInStoreRecordRpc.cs +++ /dev/null @@ -1,62 +0,0 @@ -using BO; -using Forks.EnterpriseServices.DomainObjects2.DQuery; -using Forks.JsonRpc.Client; -using Newtonsoft.Json; -using TrunksIousOutInStore.LocalSyncBO; - -namespace TrunksIousOutInStore.Rpc -{ - public class TrunksIousOutInStoreRecordRpc: SyncToServerBase - { - // 定义一个静态变量来保存类的实例 - private static TrunksIousOutInStoreRecordRpc uniqueInstance; - - // 定义一个标识确保线程同步 - private static readonly object locker = new object(); - - // 定义私有构造函数,使外界不能创建该类实例 - private TrunksIousOutInStoreRecordRpc() - { - } - - /// - /// 定义公有方法提供一个全局访问点,同时你也可以定义公有属性来提供全局访问点 - /// - /// - public static TrunksIousOutInStoreRecordRpc GetInstance() - { - // 当第一个线程运行到这里时,此时会对locker对象 "加锁", - // 当第二个线程运行该方法时,首先检测到locker对象为"加锁"状态,该线程就会挂起等待第一个线程解锁 - // lock语句运行完之后(即线程运行完之后)会对该对象"解锁" - // 双重锁定只需要一句判断就可以了 - if (uniqueInstance == null) - { - lock (locker) - { - // 如果类的实例不存在则创建,否则直接返回 - if (uniqueInstance == null) - { - uniqueInstance = new TrunksIousOutInStoreRecordRpc(); - } - } - } - return uniqueInstance; - } - - - protected override string InsertRpcUrl { - get { return "/MainSystem/B3ClientService/Rpcs/BillRpc/TrunksIousOutInStoreRecord_/TrunksIousOutInStoreRecordRpc/Insert"; } - } - - protected override string UpdateRpcUrl - { - get { return "/MainSystem/B3ClientService/Rpcs/BillRpc/TrunksIousOutInStoreRecord_/TrunksIousOutInStoreRecordRpc/Update"; } - } - - protected override string DeleteRpcUrl - { - get { return "/MainSystem/B3ClientService/Rpcs/BillRpc/TrunksIousOutInStoreRecord_/TrunksIousOutInStoreRecordRpc/Delete"; } - } - - } -} diff --git a/TrunksIousOutInStore/TrunksIousOutInStore.csproj b/TrunksIousOutInStore/TrunksIousOutInStore.csproj index 2166d00..271bac9 100644 --- a/TrunksIousOutInStore/TrunksIousOutInStore.csproj +++ b/TrunksIousOutInStore/TrunksIousOutInStore.csproj @@ -63,9 +63,8 @@ - + - @@ -112,7 +111,9 @@ - + + + diff --git a/TrunksIousOutInStore/TrunksIousOutInStoreClientGoodsSet.cs b/TrunksIousOutInStore/TrunksIousOutInStoreClientGoodsSet.cs index be9f48b..960b1f3 100644 --- a/TrunksIousOutInStore/TrunksIousOutInStoreClientGoodsSet.cs +++ b/TrunksIousOutInStore/TrunksIousOutInStoreClientGoodsSet.cs @@ -7,8 +7,8 @@ using BO.BO.Dtos; namespace TrunksIousOutInStore { - public class TrunksIousOutInStoreClientGoodsSet:ClientGoodsSetDto - { + //public class TrunksIousOutInStoreClientGoodsSet:ClientGoodsSetDto + //{ - } + //} } diff --git a/TrunksIousOutInStore/TrunksIousOutInStoreForm.Designer.cs b/TrunksIousOutInStore/TrunksIousOutInStoreForm.Designer.cs index 0e9f74b..7a2e4bf 100644 --- a/TrunksIousOutInStore/TrunksIousOutInStoreForm.Designer.cs +++ b/TrunksIousOutInStore/TrunksIousOutInStoreForm.Designer.cs @@ -28,22 +28,24 @@ /// private void InitializeComponent() { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle14 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle15 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.panel1 = new System.Windows.Forms.Panel(); this.btnEnableWeight = new System.Windows.Forms.Button(); this.picNetStatus = new System.Windows.Forms.PictureBox(); this.label10 = new System.Windows.Forms.Label(); this.panel3 = new System.Windows.Forms.Panel(); + this.cbxBatch = new System.Windows.Forms.ComboBox(); this.cbxStore = new System.Windows.Forms.ComboBox(); + this.lbStore = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); this.cbxWorkUnit = new System.Windows.Forms.ComboBox(); this.label5 = new System.Windows.Forms.Label(); @@ -54,6 +56,7 @@ this.btnWeightSet = new System.Windows.Forms.Button(); this.splitContainer2 = new System.Windows.Forms.SplitContainer(); this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.gridChecked = new BWP.WinFormControl.UDataGridView(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.gridUnCheck = new System.Windows.Forms.DataGridView(); this.uncheck序号 = new System.Windows.Forms.DataGridViewTextBoxColumn(); @@ -61,7 +64,6 @@ this.uncheck产品名称 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.uncheck数量 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.uncheck重量 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.gridChecked = new BWP.WinFormControl.UDataGridView(); this.序号 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.条码 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.产品名称 = new System.Windows.Forms.DataGridViewTextBoxColumn(); @@ -69,8 +71,6 @@ this.入库重量 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.胴体重量 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.损耗 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.lbStore = new System.Windows.Forms.Label(); - this.cbxBatch = new System.Windows.Forms.ComboBox(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); @@ -83,9 +83,9 @@ this.splitContainer2.Panel1.SuspendLayout(); this.splitContainer2.SuspendLayout(); this.groupBox2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.gridChecked)).BeginInit(); this.groupBox1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.gridUnCheck)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.gridChecked)).BeginInit(); this.SuspendLayout(); // // splitContainer1 @@ -170,6 +170,16 @@ this.panel3.Size = new System.Drawing.Size(234, 139); this.panel3.TabIndex = 35; // + // cbxBatch + // + this.cbxBatch.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cbxBatch.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.cbxBatch.FormattingEnabled = true; + this.cbxBatch.Location = new System.Drawing.Point(75, 106); + this.cbxBatch.Name = "cbxBatch"; + this.cbxBatch.Size = new System.Drawing.Size(121, 24); + this.cbxBatch.TabIndex = 43; + // // cbxStore // this.cbxStore.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; @@ -180,6 +190,15 @@ this.cbxStore.Size = new System.Drawing.Size(121, 24); this.cbxStore.TabIndex = 43; // + // lbStore + // + this.lbStore.AutoSize = true; + this.lbStore.Location = new System.Drawing.Point(9, 113); + this.lbStore.Name = "lbStore"; + this.lbStore.Size = new System.Drawing.Size(65, 12); + this.lbStore.TabIndex = 42; + this.lbStore.Text = "批 次:"; + // // label1 // this.label1.AutoSize = true; @@ -287,6 +306,46 @@ this.groupBox2.TabStop = false; this.groupBox2.Text = "已提交"; // + // gridChecked + // + this.gridChecked.AllowUserToAddRows = false; + this.gridChecked.AllowUserToDeleteRows = false; + this.gridChecked.AllowUserToResizeColumns = false; + this.gridChecked.AllowUserToResizeRows = false; + dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); + this.gridChecked.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; + this.gridChecked.BackgroundColor = System.Drawing.Color.White; + dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle2.Font = new System.Drawing.Font("宋体", 12F); + dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.gridChecked.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; + this.gridChecked.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.gridChecked.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.序号, + this.条码, + this.产品名称, + this.数量, + this.入库重量, + this.胴体重量, + this.损耗}); + this.gridChecked.Dock = System.Windows.Forms.DockStyle.Fill; + this.gridChecked.Location = new System.Drawing.Point(3, 17); + this.gridChecked.MultiSelect = false; + this.gridChecked.Name = "gridChecked"; + this.gridChecked.ReadOnly = true; + this.gridChecked.RowHeadersVisible = false; + dataGridViewCellStyle6.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); + this.gridChecked.RowsDefaultCellStyle = dataGridViewCellStyle6; + this.gridChecked.RowTemplate.Height = 23; + this.gridChecked.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.gridChecked.Size = new System.Drawing.Size(659, 157); + this.gridChecked.TabIndex = 4; + // // groupBox1 // this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) @@ -305,17 +364,17 @@ this.gridUnCheck.AllowUserToDeleteRows = false; this.gridUnCheck.AllowUserToResizeColumns = false; this.gridUnCheck.AllowUserToResizeRows = false; - dataGridViewCellStyle10.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); - this.gridUnCheck.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle10; + dataGridViewCellStyle7.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); + this.gridUnCheck.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle7; this.gridUnCheck.BackgroundColor = System.Drawing.Color.White; - dataGridViewCellStyle11.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle11.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle11.Font = new System.Drawing.Font("宋体", 12F); - dataGridViewCellStyle11.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle11.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle11.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle11.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.gridUnCheck.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle11; + dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle8.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle8.Font = new System.Drawing.Font("宋体", 12F); + dataGridViewCellStyle8.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle8.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle8.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.gridUnCheck.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle8; this.gridUnCheck.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.gridUnCheck.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.uncheck序号, @@ -329,9 +388,9 @@ this.gridUnCheck.Name = "gridUnCheck"; this.gridUnCheck.ReadOnly = true; this.gridUnCheck.RowHeadersVisible = false; - dataGridViewCellStyle12.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle12.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); - this.gridUnCheck.RowsDefaultCellStyle = dataGridViewCellStyle12; + dataGridViewCellStyle9.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle9.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); + this.gridUnCheck.RowsDefaultCellStyle = dataGridViewCellStyle9; this.gridUnCheck.RowTemplate.Height = 23; this.gridUnCheck.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.gridUnCheck.Size = new System.Drawing.Size(664, 200); @@ -376,46 +435,6 @@ this.uncheck重量.Name = "uncheck重量"; this.uncheck重量.ReadOnly = true; // - // gridChecked - // - this.gridChecked.AllowUserToAddRows = false; - this.gridChecked.AllowUserToDeleteRows = false; - this.gridChecked.AllowUserToResizeColumns = false; - this.gridChecked.AllowUserToResizeRows = false; - dataGridViewCellStyle13.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); - this.gridChecked.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle13; - this.gridChecked.BackgroundColor = System.Drawing.Color.White; - dataGridViewCellStyle14.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle14.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle14.Font = new System.Drawing.Font("宋体", 12F); - dataGridViewCellStyle14.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle14.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle14.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle14.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.gridChecked.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle14; - this.gridChecked.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; - this.gridChecked.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { - this.序号, - this.条码, - this.产品名称, - this.数量, - this.入库重量, - this.胴体重量, - this.损耗}); - this.gridChecked.Dock = System.Windows.Forms.DockStyle.Fill; - this.gridChecked.Location = new System.Drawing.Point(3, 17); - this.gridChecked.MultiSelect = false; - this.gridChecked.Name = "gridChecked"; - this.gridChecked.ReadOnly = true; - this.gridChecked.RowHeadersVisible = false; - dataGridViewCellStyle18.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle18.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); - this.gridChecked.RowsDefaultCellStyle = dataGridViewCellStyle18; - this.gridChecked.RowTemplate.Height = 23; - this.gridChecked.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.gridChecked.Size = new System.Drawing.Size(659, 157); - this.gridChecked.TabIndex = 4; - // // 序号 // this.序号.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells; @@ -453,8 +472,8 @@ // 入库重量 // this.入库重量.DataPropertyName = "Weight"; - dataGridViewCellStyle15.Format = "#0.######"; - this.入库重量.DefaultCellStyle = dataGridViewCellStyle15; + dataGridViewCellStyle3.Format = "#0.######"; + this.入库重量.DefaultCellStyle = dataGridViewCellStyle3; this.入库重量.HeaderText = "入库重量"; this.入库重量.Name = "入库重量"; this.入库重量.ReadOnly = true; @@ -462,40 +481,21 @@ // 胴体重量 // this.胴体重量.DataPropertyName = "BeforeWeight"; - dataGridViewCellStyle16.Format = "#0.######"; - this.胴体重量.DefaultCellStyle = dataGridViewCellStyle16; + dataGridViewCellStyle4.Format = "#0.######"; + this.胴体重量.DefaultCellStyle = dataGridViewCellStyle4; this.胴体重量.HeaderText = "胴体重量"; this.胴体重量.Name = "胴体重量"; this.胴体重量.ReadOnly = true; // // 损耗 // - this.损耗.DataPropertyName = "DiscontWeight"; - dataGridViewCellStyle17.Format = "#0.######"; - this.损耗.DefaultCellStyle = dataGridViewCellStyle17; + this.损耗.DataPropertyName = "LossWeight"; + dataGridViewCellStyle5.Format = "#0.######"; + this.损耗.DefaultCellStyle = dataGridViewCellStyle5; this.损耗.HeaderText = "损耗"; this.损耗.Name = "损耗"; this.损耗.ReadOnly = true; // - // lbStore - // - this.lbStore.AutoSize = true; - this.lbStore.Location = new System.Drawing.Point(9, 113); - this.lbStore.Name = "lbStore"; - this.lbStore.Size = new System.Drawing.Size(65, 12); - this.lbStore.TabIndex = 42; - this.lbStore.Text = "批 次:"; - // - // cbxBatch - // - this.cbxBatch.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cbxBatch.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.cbxBatch.FormattingEnabled = true; - this.cbxBatch.Location = new System.Drawing.Point(75, 106); - this.cbxBatch.Name = "cbxBatch"; - this.cbxBatch.Size = new System.Drawing.Size(121, 24); - this.cbxBatch.TabIndex = 43; - // // TrunksIousOutInStoreForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -509,8 +509,6 @@ this.Text = "白条入库"; this.WindowState = System.Windows.Forms.FormWindowState.Maximized; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.TrunksIousOutInStoreForm_FormClosing); - this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.TrunksIousOutInStoreForm_FormClosed); - this.Load += new System.EventHandler(this.TrunksIousOutInStoreForm_Load); this.splitContainer1.Panel1.ResumeLayout(false); this.splitContainer1.Panel2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); @@ -526,9 +524,9 @@ ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit(); this.splitContainer2.ResumeLayout(false); this.groupBox2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.gridChecked)).EndInit(); this.groupBox1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.gridUnCheck)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.gridChecked)).EndInit(); this.ResumeLayout(false); } @@ -552,14 +550,11 @@ private BWP.WinFormControl.UDataGridView gridChecked; private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.DataGridView gridUnCheck; - private System.Windows.Forms.DataGridViewTextBoxColumn uncheck序号; - private System.Windows.Forms.DataGridViewTextBoxColumn uncheck条码; - private System.Windows.Forms.DataGridViewTextBoxColumn uncheck产品名称; - private System.Windows.Forms.DataGridViewTextBoxColumn uncheck数量; - private System.Windows.Forms.DataGridViewTextBoxColumn uncheck重量; private System.Windows.Forms.PictureBox picNetStatus; private System.Windows.Forms.Label label10; private System.Windows.Forms.Button btnEnableWeight; + private System.Windows.Forms.ComboBox cbxBatch; + private System.Windows.Forms.Label lbStore; private System.Windows.Forms.DataGridViewTextBoxColumn 序号; private System.Windows.Forms.DataGridViewTextBoxColumn 条码; private System.Windows.Forms.DataGridViewTextBoxColumn 产品名称; @@ -567,7 +562,10 @@ private System.Windows.Forms.DataGridViewTextBoxColumn 入库重量; private System.Windows.Forms.DataGridViewTextBoxColumn 胴体重量; private System.Windows.Forms.DataGridViewTextBoxColumn 损耗; - private System.Windows.Forms.ComboBox cbxBatch; - private System.Windows.Forms.Label lbStore; + private System.Windows.Forms.DataGridViewTextBoxColumn uncheck序号; + private System.Windows.Forms.DataGridViewTextBoxColumn uncheck条码; + private System.Windows.Forms.DataGridViewTextBoxColumn uncheck产品名称; + private System.Windows.Forms.DataGridViewTextBoxColumn uncheck数量; + private System.Windows.Forms.DataGridViewTextBoxColumn uncheck重量; } } \ No newline at end of file diff --git a/TrunksIousOutInStore/TrunksIousOutInStoreForm.cs b/TrunksIousOutInStore/TrunksIousOutInStoreForm.cs index ce7f1a4..3b533e5 100644 --- a/TrunksIousOutInStore/TrunksIousOutInStoreForm.cs +++ b/TrunksIousOutInStore/TrunksIousOutInStoreForm.cs @@ -21,7 +21,6 @@ using BWP.WinFormControl.WeightDataFormat; using Forks.JsonRpc.Client; using Newtonsoft.Json; using TrunksIousOutInStore.LocalSyncBO; -using TrunksIousOutInStore.Rpc; namespace TrunksIousOutInStore { @@ -35,9 +34,6 @@ namespace TrunksIousOutInStore private readonly string BaseRpcUrl = "/MainSystem/B3ClientService/Rpcs/BillRpc/TrunksIousOutInStoreRecord_/TrunksIousOutInStoreRecordRpc/"; - - // BardCodeHooK BarCode = new BardCodeHooK(); - #region weightNeed SerialPort weightPort; private IDataFormat _dataFormat; @@ -61,9 +57,9 @@ namespace TrunksIousOutInStore { if (_inQueryThread != null && _inQueryThread.IsAlive) DisableWeight(); - if (tdSyncUnSubmit != null && tdSyncUnSubmit.IsAlive) + if (tdSyncUnSubmit != null && tdSyncUnSubmit.IsAlive) tdSyncUnSubmit.Abort(); - if (tdSyncSubmited != null && tdSyncSubmited.IsAlive) + if (tdSyncSubmited != null && tdSyncSubmited.IsAlive) tdSyncSubmited.Abort(); if (_tcCheckNetStatus != null && _tcCheckNetStatus.IsAlive) { @@ -71,9 +67,7 @@ namespace TrunksIousOutInStore } }; - // BarCode.BarCodeEvent += new BardCodeHooK.BardCodeDeletegate(BarCode_BarCodeEvent); - - tdSyncUnSubmit=new Thread(SyncUnSubmit); + tdSyncUnSubmit = new Thread(SyncUnSubmit); tdSyncSubmited = new Thread(SyncSubmited); tdSyncUnSubmit.Start(); tdSyncSubmited.Start(); @@ -124,31 +118,6 @@ namespace TrunksIousOutInStore } } - - // void BarCode_BarCodeEvent(BardCodeHooK.BarCodes barCode) - // { - // ShowInfo(barCode); - // } - // private delegate void ShowInfoDelegate(BardCodeHooK.BarCodes barCode); - // - // private void ShowInfo(BardCodeHooK.BarCodes barCode) - // { - // if (this.InvokeRequired) - // { - // this.BeginInvoke(new ShowInfoDelegate(ShowInfo), new object[] { barCode }); - // } - // else - // { - // if (barCode.IsValid) - // { - // // var code = UrlUtil.GetBarCode(barCode.BarCode.Trim()); - // // var goodsName = UrlUtil.GetGoodsName(barCode.BarCode); - // var code = barCode.BarCode.Trim(); - // doInsertUnSubmit(code, "", null); - // } - // } - // } - #region weightNeed void OpenSerialPort() { @@ -237,13 +206,13 @@ namespace TrunksIousOutInStore { if (string.IsNullOrEmpty(str)) str = "0"; - this.Invoke(new Action(delegate () + this.Invoke(new Action(delegate() { lblChengZhong.Text = string.Format(format, decimal.Parse(str)); if (str != "0") { //AddWeightDetail(decimal.Parse(lblChengZhong.Text)); - doInsertUnSubmit( decimal.Parse(lblChengZhong.Text)); + doInsertUnSubmit(decimal.Parse(lblChengZhong.Text)); } })); } @@ -252,7 +221,7 @@ namespace TrunksIousOutInStore decimal num = 0; if (decimal.TryParse(str, out num)) { - this.Invoke(new Action(delegate () + this.Invoke(new Action(delegate() { lblChengZhong.Text = string.Format(format, num); })); @@ -261,7 +230,7 @@ namespace TrunksIousOutInStore } if (WeighAvgControl.TryGetValue(out num)) { - this.Invoke(new Action(delegate () + this.Invoke(new Action(delegate() { //lblChengZhong.Text = string.Format(format, num); if (str != "0") @@ -454,38 +423,43 @@ namespace TrunksIousOutInStore { lock (_obj) { - //称重 - //找到称重为空条码不为空的 - var fd = unSubmitList.LastOrDefault(x => !string.IsNullOrWhiteSpace(x.BarCode) && x.Weight == null); - if (fd == null) - { + //称重 + //找到称重为空条码不为空的 + var fd = unSubmitList.LastOrDefault(x => !string.IsNullOrWhiteSpace(x.BarCode) && x.Weight == null); + if (fd == null) + { //todo 记录一个异常 - // record.ID = unSumbitList.Max(x => x.ID) + 1; -// unSumbitList.Add(record); - } - else + // record.ID = unSumbitList.Max(x => x.ID) + 1; + // unSumbitList.Add(record); + } + else + { + var record = new TrunksIousOutInStoreRecordExt(); + record.ID = fd.ID; + record.Creator = ButcherAppContext.Context.UserConfig.UserName; + record.Weight = weight; + + this.Invoke(new Action(() => { - //给条码赋值 - fd.Weight = weight; - //请求中间服务器 - string biaosh = ""; - string store=""; - this.Invoke(new Action(() => + if (cbxWorkShop.SelectedValue != null) + record.WorkShop_ID = Convert.ToInt64(cbxWorkShop.SelectedValue); + if (cbxWorkUnit.SelectedValue != null) + record.WorkUnit_ID = Convert.ToInt64(cbxWorkUnit.SelectedValue); + if (cbxStore.SelectedValue != null) + record.Store_ID = Convert.ToInt64(cbxStore.SelectedValue); + if (cbxBatch.SelectedValue != null) { - biaosh = cbxWorkUnit.Text; - store = cbxStore.Text; - })); - RpcFacade.Call(BaseRpcUrl+ "SetWeight", fd.ID, weight, biaosh, store); - } - - gridUnCheck.Refresh(); - Application.DoEvents(); - // BindUnCheckGrid(); + record.ProductBatch_ID = Convert.ToInt64(cbxBatch.SelectedValue); + record.ProductBatch = cbxBatch.SelectedText; + } + unSubmitList.Remove(fd); + BindUnSubmitGrid(); + })); + RpcFacade.Call(BaseRpcUrl + "SetWeight", JsonConvert.SerializeObject(record)); + } } } - - public string RoleName { get { return "白条入库"; } @@ -494,14 +468,6 @@ namespace TrunksIousOutInStore { return this; } - - private void TrunksIousOutInStoreForm_Load(object sender, EventArgs e) - { - // BarCode.Start(); - - - //GridUnCheckFocus(); - } private void TrunksIousOutInStoreForm_FormClosing(object sender, FormClosingEventArgs e) { @@ -522,58 +488,34 @@ namespace TrunksIousOutInStore BindingList unSubmitList = new BindingList(); BindingList submitedList = new BindingList(); - // ConcurrentQueue barCodequeue=new ConcurrentQueue(); - - - -// private static object _unSubmitListObj=new object(); -// void AddUnSubmitList(TrunksIousOutInStoreRecord record) -// { -// lock (_unSubmitListObj) -// { -// unSubmitList.Add(record); -// } -// } -// void RemoveUnSubmitList(TrunksIousOutInStoreRecord record) -// { -// lock (_unSubmitListObj) -// { -// unSubmitList.Remove(record); -// } -// } void SyncUnSubmit() { while (true) { - var json = RpcFacade.Call("/MainSystem/B3ClientService/Rpcs/BillRpc/TrunksIousOutInStoreRecord_/TrunksIousOutInStoreRecordRpc/GetUnSubmitList"); + var json = RpcFacade.Call(BaseRpcUrl + "GetUnSubmitList"); var list = JsonConvert.DeserializeObject>(json); if (this.IsHandleCreated) { this.Invoke(new Action(() => { - if (list.Count > 0) + unSubmitList.Clear(); + foreach (TrunksIousOutInStoreRecord record in list) { - unSubmitList.Clear(); - foreach (TrunksIousOutInStoreRecord record in list) - { - unSubmitList.Add(record); - } + unSubmitList.Add(record); } BindUnSubmitGrid(); })); } - - Thread.Sleep(2000); - } + } } void SyncSubmited() { while (true) { - var json = RpcFacade.Call("/MainSystem/B3ClientService/Rpcs/BillRpc/TrunksIousOutInStoreRecord_/TrunksIousOutInStoreRecordRpc/GetSubmitedList"); + var json = RpcFacade.Call(BaseRpcUrl + "GetSubmitedList"); var list = JsonConvert.DeserializeObject>(json); if (this.IsHandleCreated) @@ -607,7 +549,6 @@ namespace TrunksIousOutInStore { gridUnCheck.Refresh(); } -// gridUnCheck.CurrentCell = null; } void BindSubmitedGrid() { @@ -619,7 +560,6 @@ namespace TrunksIousOutInStore { gridChecked.Refresh(); } -// gridChecked.CurrentCell = null; } @@ -629,20 +569,11 @@ namespace TrunksIousOutInStore if (f.ShowDialog() == DialogResult.OK) { -// enableWeight_Click(sender, e); -// GridUnCheckFocus(); + // enableWeight_Click(sender, e); + // GridUnCheckFocus(); } } -// void GridUnCheckFocus() -// { -// gridUnCheck.Focus(); -// } - - private void TrunksIousOutInStoreForm_FormClosed(object sender, FormClosedEventArgs e) - { - // BarCode.Stop(); - } private bool _enableWeight = false; private void btnEnableWeight_Click(object sender, EventArgs e) { @@ -666,56 +597,5 @@ namespace TrunksIousOutInStore DisableWeight(); } } - - private void btnCreateBill_Click(object sender, EventArgs e) - { -// GridUnCheckFocus(); - } - -// BwpBarCodes barCodes = new BwpBarCodes(); -// -// private void TrunksIousOutInStoreForm_KeyDown(object sender, KeyEventArgs e) -// { -// if (e.KeyData == (Keys.ShiftKey | Keys.Shift)) -// { -// return; -// } -// TimeSpan ts = DateTime.Now.Subtract(barCodes.Time); -// var str = BwpBarCodeUtil.GetStringByKeyKeyEventArgs(e); -// barCodes.StringBuilder.Append(str); -// -// if (ts.TotalMilliseconds < 50) -// { -// if (e.KeyData == Keys.Enter && barCodes.BarCode.Length > 0) -// { -// //回车 -// barCodes.IsValid = true; -// barCodes.StringBuilder.Remove(barCodes.StringBuilder.Length - 1, 1); -// } -// } -// try -// { -// if (barCodes.IsValid) -// { -// // MessageBox.Show(barCodes.BarCode); -// var code = UrlUtil.GetBarCode(barCodes.BarCode.ToLower().Trim()); -// var goodsName = UrlUtil.GetGoodsName(barCodes.BarCode.ToLower()); -// -// doInsertUnSubmit(code, goodsName, null); -// barCodes.StringBuilder = new StringBuilder(); -// } -// } -// catch(Exception ex) -// { -// MessageBox.Show(ex.ToString()); -// } -// finally -// { -// -// barCodes.IsValid = false; //最后一定要 设置barCode无效 -// barCodes.Time = DateTime.Now; -// } -// -// } } } diff --git a/TrunksIousOutInStore/TrunksIousOutInStoreForm.resx b/TrunksIousOutInStore/TrunksIousOutInStoreForm.resx index de08b16..2a60b91 100644 --- a/TrunksIousOutInStore/TrunksIousOutInStoreForm.resx +++ b/TrunksIousOutInStore/TrunksIousOutInStoreForm.resx @@ -117,40 +117,40 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True