From ff6e62eec678d6b9633a8385f588dfd1e906ab25 Mon Sep 17 00:00:00 2001 From: "songnan.zhang" Date: Mon, 14 Feb 2022 10:37:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=A4=A9=E6=B4=A5=E6=9D=A1?= =?UTF-8?q?=E7=A0=81=E6=89=93=E5=8D=B0=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- APPQ5/QMAPP.FJC.BLL/TianJin/TJFrmPlaceBLL.cs | 4 +- APPQ5/QMAPP.FJC.DAL/TianJin/TJFrmPlaceDAL.cs | 25 +- .../QMAPP.WinForm/Forms/TianJin/TJFrmPlace.cs | 42 +- .../TianJin/TJPrintPlanLabel.Designer.cs | 512 +++++++++++++++++ .../Forms/TianJin/TJPrintPlanLabel.cs | 513 ++++++++++++++++++ .../Forms/TianJin/TJPrintPlanLabel.resx | 234 ++++++++ APPQ5/QMAPP.WinForm/MainForm.Designer.cs | 10 + APPQ5/QMAPP.WinForm/MainForm.cs | 29 +- APPQ5/QMAPP.WinForm/QMAPP.WinForm.csproj | 9 + 9 files changed, 1353 insertions(+), 25 deletions(-) create mode 100644 APPQ5/QMAPP.WinForm/Forms/TianJin/TJPrintPlanLabel.Designer.cs create mode 100644 APPQ5/QMAPP.WinForm/Forms/TianJin/TJPrintPlanLabel.cs create mode 100644 APPQ5/QMAPP.WinForm/Forms/TianJin/TJPrintPlanLabel.resx diff --git a/APPQ5/QMAPP.FJC.BLL/TianJin/TJFrmPlaceBLL.cs b/APPQ5/QMAPP.FJC.BLL/TianJin/TJFrmPlaceBLL.cs index c74c419..4449a29 100644 --- a/APPQ5/QMAPP.FJC.BLL/TianJin/TJFrmPlaceBLL.cs +++ b/APPQ5/QMAPP.FJC.BLL/TianJin/TJFrmPlaceBLL.cs @@ -175,7 +175,7 @@ namespace QMAPP.FJC.BLL.TianJin /// /// /// - public int AddPasteCard(EPasteCard ppastecard) + public int AddPasteCard(TJEPasteCard ppastecard) { @@ -406,7 +406,7 @@ namespace QMAPP.FJC.BLL.TianJin /// /// /// - public int AddNewPasteCard(EPasteCard ppastecard,int Count) + public int AddNewPasteCard(TJEPasteCard ppastecard,int Count) { try { diff --git a/APPQ5/QMAPP.FJC.DAL/TianJin/TJFrmPlaceDAL.cs b/APPQ5/QMAPP.FJC.DAL/TianJin/TJFrmPlaceDAL.cs index 53ae4cd..a7513ea 100644 --- a/APPQ5/QMAPP.FJC.DAL/TianJin/TJFrmPlaceDAL.cs +++ b/APPQ5/QMAPP.FJC.DAL/TianJin/TJFrmPlaceDAL.cs @@ -466,7 +466,7 @@ namespace QMAPP.FJC.DAL.TianJin /// /// /// - private string Insertdetailcard(int rowindex, EPasteDetailsCard pdecard) + private string Insertdetailcard(int rowindex, TJEPasteDetailsCard pdecard) { #region StringBuilder strSql = new StringBuilder(); @@ -630,11 +630,16 @@ namespace QMAPP.FJC.DAL.TianJin /// 更新FIS队列表。 /// /// - private string updateFisOrder(string pfiskey,string PRODUCTCODE) + private string updateFisOrder(TJEPasteDetailsCard Details) { #region StringBuilder strSql = new StringBuilder(); - strSql.Append(string.Format($" UPDATE T_PP_TJFY_WORKORDER SET STATE =2,PRODUCTCODE = '{PRODUCTCODE}' WHERE PID= '{pfiskey}' ")); + if (!string.IsNullOrEmpty(Details.FIS_KEY)) + strSql.Append(string.Format($" UPDATE T_PP_TJFY_WORKORDER SET STATE =2,PRODUCTCODE = '{Details.SANBARCODE}' WHERE PID= '{Details.FIS_KEY}' ")); + else + { + strSql.Append($"INSERT INTO[dbo].[T_PP_TJFY_WORKORDER] ([PID], [ORDERPLANID], [ORDERPLAN_NO], [SEQ], [MATERIAL_CODE], [MATERIAL_NAME], [PLAN_DATE], [PRODUCTCODE], [MOULD_CODE], [STATE], [UPDATEDATE], [LINENO]) VALUES('{Guid.NewGuid().ToString()}','','','','{Details.PRODNO}','{Details.CARSETDESC_CN}','{DateTime.Now}','{Details.SANBARCODE}','{Details.MOULDCODE}','2','{DateTime.Now}','{Details.LINENO}')"); + } return strSql.ToString(); #endregion @@ -713,7 +718,7 @@ namespace QMAPP.FJC.DAL.TianJin /// /// /// - public int AddPasteCard(EPasteCard ppastecard) + public int AddPasteCard(TJEPasteCard ppastecard) { #region try @@ -786,11 +791,11 @@ namespace QMAPP.FJC.DAL.TianJin sqllist.Add(strSqllog.ToString()); sqllist.Add(strSql.ToString()); - foreach (EPasteDetailsCard decard in ppastecard.DetailsCardlist) + foreach (TJEPasteDetailsCard decard in ppastecard.DetailsCardlist) { int rowindex = strindex; string strinsertsql = Insertdetailcard(rowindex, decard); - string updatesql = updateFisOrder(decard.FIS_KEY, decard.SANBARCODE); + string updatesql = updateFisOrder(decard); string deleteSql = DeleteSPFisOrder(decard.FIS_KEY); @@ -844,7 +849,7 @@ namespace QMAPP.FJC.DAL.TianJin /// /// /// - public int AddNewPasteCard(EPasteCard ppastecard,int Count) + public int AddNewPasteCard(TJEPasteCard ppastecard,int Count) { try { @@ -933,12 +938,12 @@ namespace QMAPP.FJC.DAL.TianJin sqllist.Add(strSql.ToString()); - foreach (EPasteDetailsCard decard in ppastecard.DetailsCardlist) + foreach (TJEPasteDetailsCard decard in ppastecard.DetailsCardlist) { int rowindex = strindex; string strinsertsql = Insertdetailcard(rowindex, decard); //string updatesql = UpdateFISORDERSENDDETAIL(decard.FIS_KEY); - string updatesql2 = updateFisOrder(decard.FIS_KEY, decard.SANBARCODE); + string updatesql2 = updateFisOrder(decard); //string updatesql3 = updateProduct(decard.PRODUCT_PID, decard.VIN, decard.KIN, decard.VWSEQ); sqllist.Add(strinsertsql.ToString()); //sqllist.Add(updatesql.ToString()); @@ -1263,7 +1268,7 @@ namespace QMAPP.FJC.DAL.TianJin strValues.Append("'" + ppastecard.PASTECARDNO + "',"); strValues.Append("'" + ppastecard.PASTECARDDATE + "',"); - strValues.Append("'" + ppastecard.PRODUCTIONNAME + "',"); + strValues.Append("'" + ppastecard.PRODUCTIONNAME + "'"); //strValues.Append("'" + ppastecard.PLANTNAME + "'"); strSql.Append(" INSERT INTO T_DAS_PASTE_CARDINDEX "); diff --git a/APPQ5/QMAPP.WinForm/Forms/TianJin/TJFrmPlace.cs b/APPQ5/QMAPP.WinForm/Forms/TianJin/TJFrmPlace.cs index 7684142..edf8ac8 100644 --- a/APPQ5/QMAPP.WinForm/Forms/TianJin/TJFrmPlace.cs +++ b/APPQ5/QMAPP.WinForm/Forms/TianJin/TJFrmPlace.cs @@ -1225,6 +1225,8 @@ namespace QMAPP.WinForm.Forms.TianJin ArragetxtCode(); return; } + + inputstring += DateTime.Now.ToString("yyyyMMddHHmmssfff"); if (PlaceFirstPositionType == "True") { @@ -1243,8 +1245,15 @@ namespace QMAPP.WinForm.Forms.TianJin } } } - CheckDataBase(inputstring); //检查T_PP_TJFY_WORKORDER 是否存在条码记录 - + string msgs = ""; + CheckDataBase(inputstring,ref msgs); //检查T_PP_TJFY_WORKORDER 是否存在条码记录 + if (!string.IsNullOrEmpty(msgs)) + { + Alert("该条码已扫描!"); + txtCode.Text = ""; + txtCode.Focus(); + return; + } foreach (var rule in _barcodeRules) { if (System.Text.RegularExpressions.Regex.IsMatch(inputstring, rule.REGEX)) @@ -1254,10 +1263,7 @@ namespace QMAPP.WinForm.Forms.TianJin strcarsetdesc_cn = rule.MATERIAL_TYPE; } } - - //主键 - strFiskey = Guid.NewGuid().ToString(); - + CreateNFPaste(inputstring); //创建NF的贴车单以及明细 //CreateNFPaste__(); @@ -1347,8 +1353,15 @@ namespace QMAPP.WinForm.Forms.TianJin #region 判断当前扫描过的数据集合中是否有相同条码 //判断当前扫描过的数据集合中是否有相同条码 - CheckDataBase(Code); - + string msg = ""; + CheckDataBase(Code,ref msg); + if (!string.IsNullOrEmpty(msg)) + { + Alert("该条码已扫描!"); + txtCode.Text = ""; + txtCode.Focus(); + return; + } #endregion #endregion @@ -1552,8 +1565,9 @@ namespace QMAPP.WinForm.Forms.TianJin /// 判断数据库中是否有相同的条码 /// /// 扫描条码 - private void CheckDataBase(string strbarcode) + private void CheckDataBase(string strbarcode,ref string messages) { + var messagess = ""; barcodeidentification = ""; //特殊条码,当丢失条码或者条码损坏时,扫描一个特殊条码 @@ -1562,8 +1576,10 @@ namespace QMAPP.WinForm.Forms.TianJin if (tblbarcode.Rows.Count > 0) { + messagess = "扫描条码重复,请重新扫描。"; Alert("扫描条码重复,请重新扫描。"); } + messages = messagess; } #endregion @@ -1717,11 +1733,11 @@ namespace QMAPP.WinForm.Forms.TianJin nfpastecard.DetailsCardlist = new List(); nfpastecard.PASTE_CARD_KEY = nfpastcardkey; nfpastecard.PASTECARDNO = ""; - nfpastecard.PRODUCTIONNAME = pFisType; + nfpastecard.PRODUCTIONNAME = "DPFY" + pFisType; nfpastecard.PASTECARDDATE = DateTime.Now.ToString(); nfpastecard.OPERATOR = UserBuffer.UserCode; nfpastecard.CREATETIME = DateTime.Now.ToString(); - nfpastecard.PLANTNAME = pFisType.ToString(); + nfpastecard.PLANTNAME = "DPFY"+pFisType.ToString(); } TJEPasteDetailsCard pastdetail = new TJEPasteDetailsCard(); @@ -1770,7 +1786,7 @@ namespace QMAPP.WinForm.Forms.TianJin if (tbl.Rows.Count == 0) { - nfpastecard.PASTECARDNO = WORKCENTER_CODE + DateTime.Now.ToString("yyyyMMdd") + "0001"; + nfpastecard.PASTECARDNO = nfpastecard.PLANTNAME + DateTime.Now.ToString("yyyyMMdd") + "0001"; int delResult = agent.InvokeServiceFunction(QMAPP.ServicesAgent.FrmPlaceManage.TJFrmPlaceBLL_InsertDaspssteCarIndexByPlanName.ToString(), nfpastecard); } else @@ -2079,6 +2095,8 @@ namespace QMAPP.WinForm.Forms.TianJin /// public void SetContainerItem(int itemindex, bool result) { + if (itemindex == 0) + return; if (itemindex == 1) { var label = tpContainer.GetControlFromPosition(0, 0) as Label; diff --git a/APPQ5/QMAPP.WinForm/Forms/TianJin/TJPrintPlanLabel.Designer.cs b/APPQ5/QMAPP.WinForm/Forms/TianJin/TJPrintPlanLabel.Designer.cs new file mode 100644 index 0000000..c31f116 --- /dev/null +++ b/APPQ5/QMAPP.WinForm/Forms/TianJin/TJPrintPlanLabel.Designer.cs @@ -0,0 +1,512 @@ +namespace QMAPP.WinForm.Forms.TianJin +{ + partial class TJPrintPlanLabel + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = 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(); + 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.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(TJPrintPlanLabel)); + this.dgvPlan = new System.Windows.Forms.DataGridView(); + this.dgcOrderNo = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dgcSeq = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dgcMaterialCode = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dgcMaterialName = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dgcState = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dgcPlanDate = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dgcShift = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dataGridViewTextBoxColumn8 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dataGridViewTextBoxColumn9 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dataGridViewTextBoxColumn10 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dataGridViewTextBoxColumn11 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.tpContent = new System.Windows.Forms.TabControl(); + this.tpPlanList = new System.Windows.Forms.TabPage(); + this.toolStrip1 = new System.Windows.Forms.ToolStrip(); + this.tsbPrint = new System.Windows.Forms.ToolStripButton(); + this.tsbOrderOperation = new System.Windows.Forms.ToolStripDropDownButton(); + this.tsmiSuspendOrder = new System.Windows.Forms.ToolStripMenuItem(); + this.tsmiCancelSuspend = new System.Windows.Forms.ToolStripMenuItem(); + this.tsmiDeleteOrder = new System.Windows.Forms.ToolStripMenuItem(); + this.tslblOrderCount = new System.Windows.Forms.ToolStripLabel(); + this.label1 = new System.Windows.Forms.Label(); + this.cbRoutes = new System.Windows.Forms.ComboBox(); + this.cbPlanFilter = new System.Windows.Forms.ComboBox(); + this.label10 = new System.Windows.Forms.Label(); + this.cbListRowcount = new System.Windows.Forms.ComboBox(); + this.cbRefreshRate = new System.Windows.Forms.ComboBox(); + this.label8 = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.timer1 = new System.Windows.Forms.Timer(this.components); + ((System.ComponentModel.ISupportInitialize)(this.dgvPlan)).BeginInit(); + this.tpContent.SuspendLayout(); + this.tpPlanList.SuspendLayout(); + this.toolStrip1.SuspendLayout(); + this.SuspendLayout(); + // + // dgvPlan + // + this.dgvPlan.AllowUserToAddRows = false; + this.dgvPlan.AllowUserToDeleteRows = false; + this.dgvPlan.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.dgvPlan.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells; + this.dgvPlan.BackgroundColor = System.Drawing.SystemColors.ButtonFace; + dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle1.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dgvPlan.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1; + this.dgvPlan.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dgvPlan.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.dgcOrderNo, + this.dgcSeq, + this.dgcMaterialCode, + this.dgcMaterialName, + this.dgcState, + this.dgcPlanDate, + this.dgcShift, + this.dataGridViewTextBoxColumn8, + this.dataGridViewTextBoxColumn9, + this.dataGridViewTextBoxColumn10, + this.dataGridViewTextBoxColumn11}); + this.dgvPlan.Location = new System.Drawing.Point(6, 6); + this.dgvPlan.Name = "dgvPlan"; + this.dgvPlan.ReadOnly = true; + dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle9.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle9.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle9.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle9.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle9.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle9.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dgvPlan.RowHeadersDefaultCellStyle = dataGridViewCellStyle9; + dataGridViewCellStyle10.Padding = new System.Windows.Forms.Padding(0, 0, 8, 0); + this.dgvPlan.RowsDefaultCellStyle = dataGridViewCellStyle10; + this.dgvPlan.RowTemplate.Height = 23; + this.dgvPlan.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.dgvPlan.Size = new System.Drawing.Size(852, 183); + this.dgvPlan.TabIndex = 7; + this.dgvPlan.RowPrePaint += new System.Windows.Forms.DataGridViewRowPrePaintEventHandler(this.dgvPlan_RowPrePaint); + this.dgvPlan.SelectionChanged += new System.EventHandler(this.dgvPlan_SelectionChanged); + // + // dgcOrderNo + // + this.dgcOrderNo.DataPropertyName = "ORDERPLAN_NO"; + dataGridViewCellStyle2.Font = new System.Drawing.Font("宋体", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.dgcOrderNo.DefaultCellStyle = dataGridViewCellStyle2; + this.dgcOrderNo.HeaderText = "订单号"; + this.dgcOrderNo.Name = "dgcOrderNo"; + this.dgcOrderNo.ReadOnly = true; + this.dgcOrderNo.Width = 94; + // + // dgcSeq + // + this.dgcSeq.DataPropertyName = "SEQ"; + dataGridViewCellStyle3.Font = new System.Drawing.Font("宋体", 15.75F); + this.dgcSeq.DefaultCellStyle = dataGridViewCellStyle3; + this.dgcSeq.HeaderText = "顺序号"; + this.dgcSeq.Name = "dgcSeq"; + this.dgcSeq.ReadOnly = true; + this.dgcSeq.Width = 94; + // + // dgcMaterialCode + // + this.dgcMaterialCode.DataPropertyName = "MATERIAL_CODE"; + dataGridViewCellStyle4.Font = new System.Drawing.Font("宋体", 15.75F); + this.dgcMaterialCode.DefaultCellStyle = dataGridViewCellStyle4; + this.dgcMaterialCode.HeaderText = "零件号"; + this.dgcMaterialCode.Name = "dgcMaterialCode"; + this.dgcMaterialCode.ReadOnly = true; + this.dgcMaterialCode.Width = 94; + // + // dgcMaterialName + // + this.dgcMaterialName.DataPropertyName = "MATERIAL_NAME"; + dataGridViewCellStyle5.Font = new System.Drawing.Font("宋体", 15.75F); + this.dgcMaterialName.DefaultCellStyle = dataGridViewCellStyle5; + this.dgcMaterialName.HeaderText = "零件描述"; + this.dgcMaterialName.Name = "dgcMaterialName"; + this.dgcMaterialName.ReadOnly = true; + this.dgcMaterialName.Width = 113; + // + // dgcState + // + dataGridViewCellStyle6.Font = new System.Drawing.Font("宋体", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.dgcState.DefaultCellStyle = dataGridViewCellStyle6; + this.dgcState.HeaderText = "工单状态"; + this.dgcState.MinimumWidth = 80; + this.dgcState.Name = "dgcState"; + this.dgcState.ReadOnly = true; + this.dgcState.Width = 113; + // + // dgcPlanDate + // + this.dgcPlanDate.DataPropertyName = "PLAN_DATE"; + dataGridViewCellStyle7.Font = new System.Drawing.Font("宋体", 15.75F); + this.dgcPlanDate.DefaultCellStyle = dataGridViewCellStyle7; + this.dgcPlanDate.HeaderText = "计划日期"; + this.dgcPlanDate.Name = "dgcPlanDate"; + this.dgcPlanDate.ReadOnly = true; + this.dgcPlanDate.Width = 113; + // + // dgcShift + // + this.dgcShift.DataPropertyName = "SHIFT_CODE"; + dataGridViewCellStyle8.Font = new System.Drawing.Font("宋体", 15.75F); + this.dgcShift.DefaultCellStyle = dataGridViewCellStyle8; + this.dgcShift.HeaderText = "计划类型"; + this.dgcShift.Name = "dgcShift"; + this.dgcShift.ReadOnly = true; + this.dgcShift.Width = 113; + // + // dataGridViewTextBoxColumn8 + // + this.dataGridViewTextBoxColumn8.DataPropertyName = "PID"; + this.dataGridViewTextBoxColumn8.HeaderText = "Pid"; + this.dataGridViewTextBoxColumn8.Name = "dataGridViewTextBoxColumn8"; + this.dataGridViewTextBoxColumn8.ReadOnly = true; + this.dataGridViewTextBoxColumn8.Visible = false; + this.dataGridViewTextBoxColumn8.Width = 66; + // + // dataGridViewTextBoxColumn9 + // + this.dataGridViewTextBoxColumn9.DataPropertyName = "PDID"; + this.dataGridViewTextBoxColumn9.HeaderText = "PROID"; + this.dataGridViewTextBoxColumn9.Name = "dataGridViewTextBoxColumn9"; + this.dataGridViewTextBoxColumn9.ReadOnly = true; + this.dataGridViewTextBoxColumn9.Visible = false; + this.dataGridViewTextBoxColumn9.Width = 96; + // + // dataGridViewTextBoxColumn10 + // + this.dataGridViewTextBoxColumn10.DataPropertyName = "PRODUCTTYPE"; + this.dataGridViewTextBoxColumn10.HeaderText = "PType"; + this.dataGridViewTextBoxColumn10.Name = "dataGridViewTextBoxColumn10"; + this.dataGridViewTextBoxColumn10.ReadOnly = true; + this.dataGridViewTextBoxColumn10.Visible = false; + this.dataGridViewTextBoxColumn10.Width = 93; + // + // dataGridViewTextBoxColumn11 + // + this.dataGridViewTextBoxColumn11.DataPropertyName = "OPERATESTATE"; + this.dataGridViewTextBoxColumn11.HeaderText = "OPERATESTATE"; + this.dataGridViewTextBoxColumn11.Name = "dataGridViewTextBoxColumn11"; + this.dataGridViewTextBoxColumn11.ReadOnly = true; + this.dataGridViewTextBoxColumn11.Visible = false; + this.dataGridViewTextBoxColumn11.Width = 176; + // + // tpContent + // + this.tpContent.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.tpContent.Controls.Add(this.tpPlanList); + this.tpContent.Font = new System.Drawing.Font("微软雅黑", 16F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.tpContent.ItemSize = new System.Drawing.Size(120, 45); + this.tpContent.Location = new System.Drawing.Point(5, 55); + this.tpContent.Name = "tpContent"; + this.tpContent.SelectedIndex = 0; + this.tpContent.Size = new System.Drawing.Size(872, 323); + this.tpContent.TabIndex = 0; + // + // tpPlanList + // + this.tpPlanList.Controls.Add(this.toolStrip1); + this.tpPlanList.Controls.Add(this.dgvPlan); + this.tpPlanList.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.tpPlanList.Location = new System.Drawing.Point(4, 49); + this.tpPlanList.Name = "tpPlanList"; + this.tpPlanList.Padding = new System.Windows.Forms.Padding(3); + this.tpPlanList.Size = new System.Drawing.Size(864, 270); + this.tpPlanList.TabIndex = 0; + this.tpPlanList.Text = "计划列表"; + this.tpPlanList.UseVisualStyleBackColor = true; + // + // toolStrip1 + // + this.toolStrip1.AutoSize = false; + this.toolStrip1.Dock = System.Windows.Forms.DockStyle.Bottom; + this.toolStrip1.ImageScalingSize = new System.Drawing.Size(20, 20); + this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.tsbPrint, + this.tsbOrderOperation, + this.tslblOrderCount}); + this.toolStrip1.Location = new System.Drawing.Point(3, 197); + this.toolStrip1.Name = "toolStrip1"; + this.toolStrip1.Size = new System.Drawing.Size(858, 70); + this.toolStrip1.Stretch = true; + this.toolStrip1.TabIndex = 0; + this.toolStrip1.Text = "toolStrip1"; + // + // tsbPrint + // + this.tsbPrint.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; + this.tsbPrint.Font = new System.Drawing.Font("微软雅黑", 12F); + this.tsbPrint.Image = ((System.Drawing.Image)(resources.GetObject("tsbPrint.Image"))); + this.tsbPrint.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; + this.tsbPrint.ImageTransparentColor = System.Drawing.Color.White; + this.tsbPrint.Name = "tsbPrint"; + this.tsbPrint.Size = new System.Drawing.Size(114, 67); + this.tsbPrint.Text = "打印(&P)"; + this.tsbPrint.Click += new System.EventHandler(this.tsbPrint_Click); + // + // tsbOrderOperation + // + this.tsbOrderOperation.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; + this.tsbOrderOperation.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.tsmiSuspendOrder, + this.tsmiCancelSuspend, + this.tsmiDeleteOrder}); + this.tsbOrderOperation.Font = new System.Drawing.Font("微软雅黑", 12F); + this.tsbOrderOperation.Image = global::QMAPP.WinForm.Resource1.edit; + this.tsbOrderOperation.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; + this.tsbOrderOperation.ImageTransparentColor = System.Drawing.Color.White; + this.tsbOrderOperation.Name = "tsbOrderOperation"; + this.tsbOrderOperation.Size = new System.Drawing.Size(135, 67); + this.tsbOrderOperation.Text = "工单操作"; + // + // tsmiSuspendOrder + // + this.tsmiSuspendOrder.Image = global::QMAPP.WinForm.Resource1.stop; + this.tsmiSuspendOrder.Margin = new System.Windows.Forms.Padding(0, 7, 0, 7); + this.tsmiSuspendOrder.Name = "tsmiSuspendOrder"; + this.tsmiSuspendOrder.Size = new System.Drawing.Size(144, 26); + this.tsmiSuspendOrder.Text = "挂起工单"; + this.tsmiSuspendOrder.TextAlign = System.Drawing.ContentAlignment.BottomCenter; + this.tsmiSuspendOrder.Click += new System.EventHandler(this.tsmiSuspendOrder_Click); + // + // tsmiCancelSuspend + // + this.tsmiCancelSuspend.Image = global::QMAPP.WinForm.Resource1.back; + this.tsmiCancelSuspend.Margin = new System.Windows.Forms.Padding(0, 7, 0, 7); + this.tsmiCancelSuspend.Name = "tsmiCancelSuspend"; + this.tsmiCancelSuspend.Size = new System.Drawing.Size(144, 26); + this.tsmiCancelSuspend.Text = "取消挂起"; + this.tsmiCancelSuspend.Click += new System.EventHandler(this.tsmiCancelSuspend_Click); + // + // tsmiDeleteOrder + // + this.tsmiDeleteOrder.Image = global::QMAPP.WinForm.Resource1.delete; + this.tsmiDeleteOrder.Margin = new System.Windows.Forms.Padding(0, 7, 0, 7); + this.tsmiDeleteOrder.Name = "tsmiDeleteOrder"; + this.tsmiDeleteOrder.Size = new System.Drawing.Size(144, 26); + this.tsmiDeleteOrder.Text = "删除工单"; + this.tsmiDeleteOrder.Click += new System.EventHandler(this.tsmiDeleteOrder_Click); + // + // tslblOrderCount + // + this.tslblOrderCount.Font = new System.Drawing.Font("微软雅黑", 14F); + this.tslblOrderCount.Name = "tslblOrderCount"; + this.tslblOrderCount.Size = new System.Drawing.Size(140, 67); + this.tslblOrderCount.Text = "计划总数:100"; + this.tslblOrderCount.Visible = false; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(12, 13); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(69, 25); + this.label1.TabIndex = 10; + this.label1.Text = "生产线"; + // + // cbRoutes + // + this.cbRoutes.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cbRoutes.FormattingEnabled = true; + this.cbRoutes.Location = new System.Drawing.Point(87, 10); + this.cbRoutes.Name = "cbRoutes"; + this.cbRoutes.Size = new System.Drawing.Size(359, 33); + this.cbRoutes.TabIndex = 1; + // + // cbPlanFilter + // + this.cbPlanFilter.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.cbPlanFilter.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cbPlanFilter.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.cbPlanFilter.FormattingEnabled = true; + this.cbPlanFilter.Items.AddRange(new object[] { + "显示全部工单", + "隐藏挂起工单", + "只看挂起工单"}); + this.cbPlanFilter.Location = new System.Drawing.Point(351, 66); + this.cbPlanFilter.Name = "cbPlanFilter"; + this.cbPlanFilter.Size = new System.Drawing.Size(175, 33); + this.cbPlanFilter.TabIndex = 2; + // + // label10 + // + this.label10.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.label10.AutoSize = true; + this.label10.Font = new System.Drawing.Font("微软雅黑", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label10.Location = new System.Drawing.Point(283, 72); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(65, 20); + this.label10.TabIndex = 16; + this.label10.Text = "工单过滤"; + // + // cbListRowcount + // + this.cbListRowcount.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.cbListRowcount.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cbListRowcount.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.cbListRowcount.FormattingEnabled = true; + this.cbListRowcount.Items.AddRange(new object[] { + "20", + "30", + "40", + "50", + "100"}); + this.cbListRowcount.Location = new System.Drawing.Point(625, 66); + this.cbListRowcount.Name = "cbListRowcount"; + this.cbListRowcount.Size = new System.Drawing.Size(78, 33); + this.cbListRowcount.TabIndex = 3; + // + // cbRefreshRate + // + this.cbRefreshRate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.cbRefreshRate.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cbRefreshRate.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.cbRefreshRate.FormattingEnabled = true; + this.cbRefreshRate.Items.AddRange(new object[] { + "1s", + "2s", + "5s", + "10s", + "15s", + "20s"}); + this.cbRefreshRate.Location = new System.Drawing.Point(802, 66); + this.cbRefreshRate.Name = "cbRefreshRate"; + this.cbRefreshRate.Size = new System.Drawing.Size(66, 33); + this.cbRefreshRate.TabIndex = 4; + // + // label8 + // + this.label8.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.label8.AutoSize = true; + this.label8.Font = new System.Drawing.Font("微软雅黑", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label8.Location = new System.Drawing.Point(529, 72); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(93, 20); + this.label8.TabIndex = 12; + this.label8.Text = "列表显示行数"; + // + // label6 + // + this.label6.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.label6.AutoSize = true; + this.label6.Font = new System.Drawing.Font("微软雅黑", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label6.Location = new System.Drawing.Point(706, 72); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(93, 20); + this.label6.TabIndex = 13; + this.label6.Text = "计划刷新频率"; + // + // timer1 + // + this.timer1.Enabled = true; + this.timer1.Interval = 1000; + this.timer1.Tick += new System.EventHandler(this.timer1_Tick); + // + // PrintPlanLabel + // + this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 25F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(880, 382); + this.Controls.Add(this.cbPlanFilter); + this.Controls.Add(this.label10); + this.Controls.Add(this.cbListRowcount); + this.Controls.Add(this.cbRefreshRate); + this.Controls.Add(this.label8); + this.Controls.Add(this.label6); + this.Controls.Add(this.cbRoutes); + this.Controls.Add(this.label1); + this.Controls.Add(this.tpContent); + this.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.Margin = new System.Windows.Forms.Padding(5, 6, 5, 6); + this.Name = "PrintPlanLabel"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "门板计划标签打印"; + this.Load += new System.EventHandler(this.PrintPlanLabel_Load); + ((System.ComponentModel.ISupportInitialize)(this.dgvPlan)).EndInit(); + this.tpContent.ResumeLayout(false); + this.tpPlanList.ResumeLayout(false); + this.toolStrip1.ResumeLayout(false); + this.toolStrip1.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.DataGridView dgvPlan; + private System.Windows.Forms.DataGridViewTextBoxColumn dgcOrderNo; + private System.Windows.Forms.DataGridViewTextBoxColumn dgcSeq; + private System.Windows.Forms.DataGridViewTextBoxColumn dgcMaterialCode; + private System.Windows.Forms.DataGridViewTextBoxColumn dgcMaterialName; + private System.Windows.Forms.DataGridViewTextBoxColumn dgcState; + private System.Windows.Forms.DataGridViewTextBoxColumn dgcPlanDate; + private System.Windows.Forms.DataGridViewTextBoxColumn dgcShift; + private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn8; + private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn9; + private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn10; + private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn11; + private System.Windows.Forms.TabControl tpContent; + private System.Windows.Forms.TabPage tpPlanList; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.ComboBox cbRoutes; + private System.Windows.Forms.ToolStrip toolStrip1; + private System.Windows.Forms.ToolStripButton tsbPrint; + private System.Windows.Forms.ToolStripDropDownButton tsbOrderOperation; + private System.Windows.Forms.ToolStripMenuItem tsmiSuspendOrder; + private System.Windows.Forms.ToolStripMenuItem tsmiCancelSuspend; + private System.Windows.Forms.ToolStripMenuItem tsmiDeleteOrder; + private System.Windows.Forms.ToolStripLabel tslblOrderCount; + private System.Windows.Forms.ComboBox cbPlanFilter; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.ComboBox cbListRowcount; + private System.Windows.Forms.ComboBox cbRefreshRate; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.Timer timer1; + + } +} \ No newline at end of file diff --git a/APPQ5/QMAPP.WinForm/Forms/TianJin/TJPrintPlanLabel.cs b/APPQ5/QMAPP.WinForm/Forms/TianJin/TJPrintPlanLabel.cs new file mode 100644 index 0000000..0df71d9 --- /dev/null +++ b/APPQ5/QMAPP.WinForm/Forms/TianJin/TJPrintPlanLabel.cs @@ -0,0 +1,513 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using QMAPP.FJC.Entity.Basic; +using QMAPP.FJC.Entity.Operation; +using QMAPP.ServicesAgent; +using QMAPP.MD.Entity; +using QMAPP.Entity; +using QMFrameWork.Data; +using System.Configuration; + +namespace QMAPP.WinForm.Forms.TianJin +{ + public partial class TJPrintPlanLabel : Form + { + QMAPP.ServicesAgent.ServiceAgent _agent = ClientContext.GetServiceAgent(); + List cbsource = null; + + + /// + /// + /// + public TJPrintPlanLabel() + { + InitializeComponent(); + } + + /// + /// 加载工艺路线 + /// + private void LoadProcessRoute() + { + var routes = _agent.InvokeServiceFunction>> + ("ProcessRouteBLL_GetProcessRouteList", new QMAPP.FJC.Entity.Basic.ProcessRoute { }).Result; + routes = routes.OrderBy(p => p.ROUTE_CODE).ToList(); + + cbsource = routes; + cbsource.Insert(0, new QMAPP.FJC.Entity.Basic.ProcessRoute { ROUTE_NAME = "", ROUTE_CODE = "" }); + cbRoutes.DisplayMember = "ROUTE_NAME"; + cbRoutes.ValueMember = "ROUTE_CODE"; + cbRoutes.DataSource = cbsource; + } + + #region 加载列表显示设置 + /// + /// 加载列表显示设置 + /// + private void LoadViewSetting() + { + #region 加载列表显示设置 + string filepath = ConfigurationManager.AppSettings["SaveFilePath"]; + filepath = string.Format("{0}ViewSetting.cfg", filepath); + + var setting = new { ListRowcount = 20, RefreshRate = 5 }; + if (System.IO.File.Exists(filepath)) + { + string settingstring = System.IO.File.ReadAllText(filepath); + setting = Newtonsoft.Json.JsonConvert.DeserializeAnonymousType(settingstring, setting); + } + cbListRowcount.Text = setting.ListRowcount.ToString(); + cbRefreshRate.Text = string.Format("{0}s", setting.RefreshRate); + cbPlanFilter.SelectedIndex = 1; + + cbListRowcount.SelectedIndexChanged += new EventHandler(cbListRowcount_SelectedIndexChanged); + cbRefreshRate.SelectedIndexChanged += new EventHandler(cbRefreshRate_SelectedIndexChanged); + cbPlanFilter.TextChanged += new EventHandler(cbPlanFilter_SelectedIndexChanged); + + #endregion + } + #endregion + #region 列表定时刷新 + private void cbListRowcount_SelectedIndexChanged(object sender, EventArgs e) + { + SaveSetting(); + BindPlanView(); + } + /// + /// 发送指令或者接受完成指令刷新列表 + /// + public void BindPlanView() + { + #region 刷新生产计划 + dgvPlan.AutoGenerateColumns = false; + this.dgvPlan.DataSource = new List(); + + + try + { + DataPage dataPage = new DataPage(); + dataPage.PageSize = int.Parse(cbListRowcount.Text); + dataPage.PageIndex = 1; + dataPage.SortExpression = " ROWVALUE ASC"; + #region 服务查询 + var orderlist = _agent.InvokeServiceFunction>("WorkOrderBLL_GetOrderUnPrinted", cbRoutes.SelectedValue.ToString(), cbPlanFilter.SelectedIndex, dataPage); + #endregion + this.dgvPlan.DataSource = orderlist; + } + catch (Exception ex) + { + WriteLog.WriteError(System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + " " + ex.Message); + } + finally + { + timecounter = 0; + } + #endregion + } + private void cbRefreshRate_SelectedIndexChanged(object sender, EventArgs e) + { + SaveSetting(); + } + private void cbPlanFilter_SelectedIndexChanged(object sender, EventArgs e) + { + BindPlanView(); + SaveSetting(); + } + + private void SaveSetting() + { + string filepath = ConfigurationManager.AppSettings["SaveFilePath"]; + filepath = string.Format("{0}ViewSetting.cfg", filepath); + var setting = new + { + ListRowcount = int.Parse(cbListRowcount.Text), + RefreshRate = int.Parse(cbRefreshRate.Text.Trim('s')), + //PlanFilter = cbPlanFilter.SelectedIndex + }; + string settingstring = Newtonsoft.Json.JsonConvert.SerializeObject(setting); + System.IO.File.WriteAllText(filepath, settingstring); + } + int timecounter = 0; + private void timer1_Tick(object sender, EventArgs e) + { + if (!tsbOrderOperation.DropDown.Visible) + { + timecounter += 1; + if (timecounter > int.Parse(cbRefreshRate.Text.Trim('s')))//计时达到刷新时间 + { + + BindPlanView(); + + } + } + } + #endregion + + private void PrintLabel(List labeldata) + { + #region 计划标签打印 + //string xmlPath = System.Configuration.ConfigurationSettings.AppSettings["XmlName"].ToString(); ; + //BarcodeLib.BarCodeGenerate g = new BarcodeLib.BarCodeGenerate( xmlPath); + //bool b = g.PrintBarCode(_operationServiceParam.main.MAINCODE); + QM.Assist.LabelInfo ll = new QM.Assist.LabelInfo(); + StringBuilder dataline=new StringBuilder(); + foreach (var label in labeldata) + { + string[] texts = new string[6]; + + var sourcetext = label.Description.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries); + + for (int i = 0; i < texts.Length && i < sourcetext.Length; i++) + { + texts[i] = sourcetext[i]; + } + + //OrderNo,OrderType,PlanDate,Name,Class,CarModel,Text1,Text2,Text3,Text4,Text5,Text6 + dataline.AppendFormat("\"{0}\",\"{1}\",\"{2:yyyy-MM-dd HH:mm:ss}\",\"{3}\",\"{4}\",\"{5}\",\"{6}\",\"{7}\",\"{8}\",\"{9}\",\"{10}\",\"{11}\"\r\n", + label.OrderNo,//计划号 + label.OrderType,//计划类型(0:FIS,1:STOCK,2:INSERT) + label.PlanDate,//计划日期 + label.MaterialName,//总成物料名称 + label.Class,// + label.CarModel,//车型 + texts[0],//装配详细信息 + texts[1],//装配详细信息 + texts[2],//装配详细信息 + texts[3],//装配详细信息 + texts[4],//装配详细信息 + texts[5]//装配详细信息 + ); + + + } + + ll.BarCode=dataline.ToString().TrimEnd('\r','\n'); + ll.PrinterName = ""; + QM.Assist.PrintUtil.LabelList2.Add(ll); + QM.Assist.PrintUtil pu = new QM.Assist.PrintUtil(); + pu.PrintLabel2(System.Configuration.ConfigurationManager.AppSettings["proPath"].ToString + (), System.Configuration.ConfigurationManager.AppSettings["PlanLabelTMPPath"].ToString + (), System.Configuration.ConfigurationManager.AppSettings["PlanLabelDATPath"].ToString + ()); + + #endregion + } + + private void PrintPlanLabel_Load(object sender, EventArgs e) + { + LoadViewSetting(); + LoadProcessRoute(); + //如果工位已设定 + if (ClientContext.MachineInfo != null && !string.IsNullOrEmpty(ClientContext.MachineInfo.PID)) + { + //this.comMachine.SelectedValue = ClientContext.MachineInfo.MACHINECODDE; + var route = _agent.InvokeServiceFunction + ("ProcessRouteBLL_GetRouteByMachine", ClientContext.MachineInfo.MACHINECODDE); + if (route != null) + { + this.cbRoutes.SelectedValue = route.ROUTE_CODE; + this.cbRoutes.Enabled = false; + } + else + { + this.cbRoutes.Enabled = true; + } + } + else + { + this.cbRoutes.Enabled = true; + } + BindPlanView(); + cbRoutes.SelectedIndexChanged += new EventHandler(cbRoutes_SelectedIndexChanged); + } + + void cbRoutes_SelectedIndexChanged(object sender, EventArgs e) + { + BindPlanView(); + } + #region 工单操作 + + #region 取消挂起 + /// + /// 取消挂起 + /// + /// + /// + private void tsmiCancelSuspend_Click(object sender, EventArgs e) + { + if (dgvPlan.SelectedRows.Count <= 0) + { + MessageBox.Show("请选择一条工单进行取消挂起操作!"); + return; + } + List ids = new List(); + foreach (System.Windows.Forms.DataGridViewRow row in dgvPlan.SelectedRows) + { + var order = (QMAPP.FJC.Entity.ProductionPlan.WorkOrder)row.DataBoundItem; + if (!int.Equals(order.STATE, 4)) + { + MessageBox.Show("只可取消状态为挂起的工单!"); + return; + } + ids.Add(order.PID); + } + _agent.InvokeServiceFunction(B9IPCService.WorkOrderBLL_CancelSuspend.ToString(), ids); + BindPlanView(); + } + #endregion + + #region 删除工单 + /// + /// 删除工单 + /// + /// + /// + private void tsmiDeleteOrder_Click(object sender, EventArgs e) + { + if (dgvPlan.SelectedRows.Count <= 0) + { + MessageBox.Show("请选择一条工单进行删除操作!"); + return; + } + List ids = new List(); + foreach (System.Windows.Forms.DataGridViewRow row in dgvPlan.SelectedRows) + { + var order = (QMAPP.FJC.Entity.ProductionPlan.WorkOrder)row.DataBoundItem; + if (!int.Equals(order.STATE, 4)) + { + MessageBox.Show("只可删除状态为挂起的工单!"); + return; + } + ids.Add(order.PID); + } + _agent.InvokeServiceFunction(B9IPCService.WorkOrderBLL_DeleteOrder.ToString(), ids); + BindPlanView(); + } + #endregion + + #region 重置工单 + /// + /// 重置工单 + /// + /// + /// + private void tsmiResetOrder_Click(object sender, EventArgs e) + { + if (dgvPlan.SelectedRows.Count <= 0) + { + MessageBox.Show("请选择一条工单进行重置操作!"); + return; + } + List ids = new List(); + foreach (System.Windows.Forms.DataGridViewRow row in dgvPlan.SelectedRows) + { + var order = (QMAPP.FJC.Entity.ProductionPlan.WorkOrder)row.DataBoundItem; + if (!int.Equals(order.STATE, 4)) + { + MessageBox.Show("只可重置状态为挂起的工单!"); + return; + } + ids.Add(order.PID); + } + _agent.InvokeServiceFunction(B9IPCService.WorkOrderBLL_ResetOrder.ToString(), ids); + BindPlanView(); + } + #endregion + + #region 挂起工单 + /// + /// 挂起工单 + /// + /// + /// + private void tsmiSuspendOrder_Click(object sender, EventArgs e) + { + if (dgvPlan.SelectedRows.Count <= 0) + { + MessageBox.Show("请选择一条工单进行挂起操作!"); + return; + } + List ids = new List(); + foreach (System.Windows.Forms.DataGridViewRow row in dgvPlan.SelectedRows) + { + var order = (QMAPP.FJC.Entity.ProductionPlan.WorkOrder)row.DataBoundItem; + if (int.Equals(order.STATE, 2)) + { + MessageBox.Show("不能挂起正在执行的工单!"); + return; + } + ids.Add(order.PID); + } + _agent.InvokeServiceFunction(B9IPCService.WorkOrderBLL_SuspendOrder.ToString(), ids); + BindPlanView(); + } + #endregion + + #region 回收工单 + /// + /// 回收工单 + /// + /// + /// + private void tsmiTakebackOrder_Click(object sender, EventArgs e) + { + if (dgvPlan.SelectedRows.Count <= 0) + { + MessageBox.Show("请选择一条工单进行回收操作!"); + return; + } + List ids = new List(); + foreach (System.Windows.Forms.DataGridViewRow row in dgvPlan.SelectedRows) + { + var order = (QMAPP.FJC.Entity.ProductionPlan.WorkOrder)row.DataBoundItem; + if (!int.Equals(order.STATE, 4)) + { + MessageBox.Show("只可回收状态为挂起的工单!"); + return; + } + ids.Add(order.PID); + } + _agent.InvokeServiceFunction(B9IPCService.WorkOrderBLL_TakeBack.ToString(), ids); + BindPlanView(); + } + #endregion + + #endregion + + #region 工单列表选择发送变化时延时自动刷新 + /// + /// 工单列表选择发送变化时延时自动刷新 + /// + /// + /// + private void dgvPlan_SelectionChanged(object sender, EventArgs e) + { + timecounter = -10; + } + #endregion + + #region 设置计划工单列状态、颜色 + /// + /// 设置计划工单列状态、颜色 + /// + /// + /// + private void dgvPlan_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e) + { + var WORKORDER_STATE_TEXT = new string[] { "初始", "确认", "执行中", "完成", "挂起" }; + var row = dgvPlan.Rows[e.RowIndex]; + var order = (FJC.Entity.ProductionPlan.WorkOrder)row.DataBoundItem; + if (order.STATE >= 0 && order.STATE < WORKORDER_STATE_TEXT.Length) + { + row.Cells[dgcState.Name].Value = WORKORDER_STATE_TEXT[order.STATE]; + } + if (order.STATE == FJC.Entity.EnumGeter.WorkOrderState.Suspended.GetHashCode()) + { + row.DefaultCellStyle.BackColor = Color.LightGray; + row.DefaultCellStyle.ForeColor = Color.Gray; + } + if (order.STATE == FJC.Entity.EnumGeter.WorkOrderState.Executing.GetHashCode()) + { + row.DefaultCellStyle.BackColor = Color.YellowGreen; + dgvPlan.ClearSelection(); + } + } + #endregion + + private void tsbPrint_Click(object sender, EventArgs e) + { + if (dgvPlan.Rows.Count == 0) + { + MessageBox.Show("当前生产线没有未打印标签的计划工单!"); + } + tsbPrint.Enabled = false; + var order1 = (FJC.Entity.ProductionPlan.WorkOrder)dgvPlan.Rows[0].DataBoundItem; + var order2 = (FJC.Entity.ProductionPlan.WorkOrder)dgvPlan.Rows[1].DataBoundItem; + + var orders = new List(); + orders.Add(order1); + //if (string.Equals(order1.SEQ, order2.SEQ)) + //{ + // orders.Add(order2); + //} + + List labels = new List(); + + foreach (var order in orders) + { + var data = DateTime.Now.ToString("yyyyMMddHHmmssfff"); + //var codematch = System.Text.RegularExpressions.Regex.Match(order.PBOM_CODE, "_[LR][FR]_"); + string positioncode = GetNameCode(order.MATERIAL_NAME); + var book = _agent.InvokeServiceFunction("FISPhraseBLL_GetFisPhraseBook", order.MATERIAL_CODE + "", positioncode); + + LabelData labeldata = new LabelData(); + + + labeldata.PlanDate = order.PLAN_DATE; + if (book != null) + { + labeldata.Class = " " + book.Class.Substring(0, 2); + labeldata.Description = book.Text; + labeldata.OrderNo = book.CarModel+ positioncode+ data; + } + var mcresult = _agent.InvokeServiceFunction>("MaterialBLL_Get", new Material { MATERIAL_CODE = order.MATERIAL_CODE }); + var material = mcresult.IsSuccess ? mcresult.Result : null; + if (material != null) + { + labeldata.MaterialName = material.MATERIAL_SHORT; + labeldata.CarModel = material.PROJECTCODE; + } + labels.Add(labeldata); + } + PrintLabel(labels); + + //变更打印状态 0=>1 + foreach (var order in orders) + { + //agent.InvokeServiceFunction("WorkOrderBLL_SetOrderPrinted", order.PID); + } + BindPlanView(); + tsbPrint.Enabled = true; + } + public string GetNameCode(string Name) + { + var Code = ""; + if (!string.IsNullOrEmpty(Name)) + { + if(Name.Contains("左前")) + Code = "FL"; + else if(Name.Contains("左后")) + Code = "RL"; + else if (Name.Contains("右前")) + Code = "FR"; + else if (Name.Contains("右后")) + Code = "RR"; + return Code; + } + else + return null; + } + } + class LabelData + { + public string OrderNo { get; set; } + + public DateTime PlanDate { get; set; } + + public string Class { get; set; } + + public string Description { get; set; } + + public string MaterialName { get; set; } + + public string CarModel { get; set; } + + public object[] OrderType { get; set; } + } +} diff --git a/APPQ5/QMAPP.WinForm/Forms/TianJin/TJPrintPlanLabel.resx b/APPQ5/QMAPP.WinForm/Forms/TianJin/TJPrintPlanLabel.resx new file mode 100644 index 0000000..5cb6633 --- /dev/null +++ b/APPQ5/QMAPP.WinForm/Forms/TianJin/TJPrintPlanLabel.resx @@ -0,0 +1,234 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 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 + + + 17, 17 + + + + + iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAA8SSURBVGhDzZlJcJvnecfppm3SptMm05l4Jqf2oFvdprn0 + 0lOnPTTuTC89dKbLxGkST2xXlpTYY8exKzlyRYkECVILF3EFAYKLSHDfSYn7vgAiiJXYSRALd4IgiOXf + //sBoEhJlOiacayZVwCxfc/vef7P8r5fRsaX9A9IILli0uOXdNnzuwwQpeE7R4YfB0mQ6/yudM6/BMQl + 45CYo81/QefLjkASfC+RiB0Z/5UEEZ6WACI/BMIZwOErfOnPCFKAKVcIddoIDP59xOLRr14Ujrwf0wFb + X6eCaHzoaxJIIpKBzb3XMOksRdXcGkEOYSTIYfzwq5M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sBGnhaXMzQXSO+9gPfo8g9LK4ZSSB + 0NvipoWHEXKncoWRObD9KZYMF9FuMEG1sM9N0uPknC/Kp8gFrqwqJjaNz6014aaKsuHM3z/n5Z2a5JF6 + 2vgznwcd/+CJiBBEisjcNjQcD7T2YkaEIOJWUYCGi1tHa8l8iXi+BYP1XXQsMemMQO3jPZQOsSExByQA + oX8aL57nqc24paTuKZ82nmz7NsMnDD/TGdDL6J6WVjIi22jkCL1gL8KukNYmDfd/G2bHRXQYaLgBUGl3 + ub+lNFpmcL9rAfkdTE4xKrOUCuNvKbjDYgTqedLg8oVOGv6buPH9PGk1z3JXNevAtE2JQds8eFKCBn0I + ZcNW3O/RopBnO7mtWhRxn53fwQGNHs+qYMetMKKKpdLk2oE4BfzcOn+Z11/0/rMREXdjNlE3y/3t+DJK + e3UY0jmwy8lT/M4yNzi1Yzbkti0iU2HA/UYbFsybEBXvSzX8aajjIPE4b+ytbmBU78ZOyvDjN0XEd0UO + jS8GWVl+y4Y/D+TZ1xJHTSdB0rN854uo4ly+KyIi7iecVjnS75/LxY79yP8B7rHGaeJC7ocAAAAASUVO + RK5CYII= + + + + 127, 17 + + + 63 + + \ No newline at end of file diff --git a/APPQ5/QMAPP.WinForm/MainForm.Designer.cs b/APPQ5/QMAPP.WinForm/MainForm.Designer.cs index cb67a7e..c6e15ae 100644 --- a/APPQ5/QMAPP.WinForm/MainForm.Designer.cs +++ b/APPQ5/QMAPP.WinForm/MainForm.Designer.cs @@ -46,6 +46,7 @@ this.btnOperateStation = new System.Windows.Forms.ToolStripMenuItem(); this.PrintCodeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiPrintPlanlabel = new System.Windows.Forms.ToolStripMenuItem(); + this.TJtsmiPrintPlanlabel = new System.Windows.Forms.ToolStripMenuItem(); this.tsmDPAssmblyItem = new System.Windows.Forms.ToolStripMenuItem(); this.btnMendGroup = new System.Windows.Forms.ToolStripMenuItem(); this.btnMendOperate = new System.Windows.Forms.ToolStripMenuItem(); @@ -189,6 +190,7 @@ this.btnOperateStation, this.PrintCodeToolStripMenuItem, this.tsmiPrintPlanlabel, + this.TJtsmiPrintPlanlabel, this.tsmDPAssmblyItem}); this.btnOperateGroup.Name = "btnOperateGroup"; this.btnOperateGroup.Size = new System.Drawing.Size(94, 28); @@ -215,6 +217,13 @@ this.tsmiPrintPlanlabel.Text = "门板计划标签打印"; this.tsmiPrintPlanlabel.Click += new System.EventHandler(this.tsmiPrintPlanlabel_Click); // + // TJtsmiPrintPlanlabel + // + this.TJtsmiPrintPlanlabel.Name = "TJtsmiPrintPlanlabel"; + this.TJtsmiPrintPlanlabel.Size = new System.Drawing.Size(224, 28); + this.TJtsmiPrintPlanlabel.Text = "TJ门板计划标签打印"; + this.TJtsmiPrintPlanlabel.Click += new System.EventHandler(this.TJtsmiPrintPlanlabel_Click); + // // tsmDPAssmblyItem // this.tsmDPAssmblyItem.Name = "tsmDPAssmblyItem"; @@ -480,6 +489,7 @@ private System.Windows.Forms.ToolStripMenuItem tsmiPutIn; private System.Windows.Forms.ToolStripStatusLabel tslServerHost; private System.Windows.Forms.ToolStripMenuItem tsmiPrintPlanlabel; + private System.Windows.Forms.ToolStripMenuItem TJtsmiPrintPlanlabel; private System.Windows.Forms.ToolStripMenuItem tsmiTakeOut; private System.Windows.Forms.ToolStripMenuItem tsmiPartReplace; private System.Windows.Forms.ToolStripMenuItem tsmiCheck; diff --git a/APPQ5/QMAPP.WinForm/MainForm.cs b/APPQ5/QMAPP.WinForm/MainForm.cs index fbc7f4b..f86615c 100644 --- a/APPQ5/QMAPP.WinForm/MainForm.cs +++ b/APPQ5/QMAPP.WinForm/MainForm.cs @@ -779,7 +779,11 @@ namespace QMAPP.WinForm f.Focus(); //打开过就让其获得焦点 } } - + /// + /// 门板计划标签打印 + /// + /// + /// private void tsmiPrintPlanlabel_Click(object sender, EventArgs e) { Form f = Application.OpenForms["PrintPlanLabel"]; //查找是否打开过Form1窗体 @@ -798,6 +802,29 @@ namespace QMAPP.WinForm } } + /// + /// 天津门板计划标签打印 + /// + /// + /// + private void TJtsmiPrintPlanlabel_Click(object sender, EventArgs e) + { + Form f = Application.OpenForms["TJPrintPlanLabel"]; //查找是否打开过Form1窗体 + if (f == null) //没打开过 + { + TJPrintPlanLabel form = new TJPrintPlanLabel(); + //new KeyEvent().SetKeyToTxt(form); + ClientContext.SetUserAuth(form); + form.MdiParent = this; + form.Show(); //重新new一个Show出来 + } + else + { + f.WindowState = FormWindowState.Normal; + f.Focus(); //打开过就让其获得焦点 + } + } + private void tsmiInspectSkipping_Click(object sender, EventArgs e) { Form f = Application.OpenForms["frmInspectSkipping"]; //查找是否打开过Form1窗体 diff --git a/APPQ5/QMAPP.WinForm/QMAPP.WinForm.csproj b/APPQ5/QMAPP.WinForm/QMAPP.WinForm.csproj index 754968d..c66fa77 100644 --- a/APPQ5/QMAPP.WinForm/QMAPP.WinForm.csproj +++ b/APPQ5/QMAPP.WinForm/QMAPP.WinForm.csproj @@ -801,6 +801,12 @@ ReprintForm.cs + + Form + + + TJPrintPlanLabel.cs + TJPastCard.rpt True @@ -1284,6 +1290,9 @@ ReprintForm.cs + + TJPrintPlanLabel.cs + TJDefaultDataSetNum.cs