init: 潍柴发动机线 中央控制程序 项目首次入库

This commit is contained in:
XingCheng3
2026-06-08 12:05:16 +08:00
commit 196c66b9ff
547 changed files with 379162 additions and 0 deletions

View File

@@ -0,0 +1,237 @@
namespace PlanExecute_Query
{
partial class PlanExecute
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
this.dgv_PlanDetail = new System.Windows.Forms.DataGridView();
this.btn_Refresh = new System.Windows.Forms.Button();
this.cb_Area = new System.Windows.Forms.ComboBox();
this.label1 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.dtp_Start = new System.Windows.Forms.DateTimePicker();
this.dtp_End = new System.Windows.Forms.DateTimePicker();
this.cmb_State = new System.Windows.Forms.ComboBox();
this.label2 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.txt_OrderNum = new System.Windows.Forms.TextBox();
((System.ComponentModel.ISupportInitialize)(this.dgv_PlanDetail)).BeginInit();
this.SuspendLayout();
//
// dgv_PlanDetail
//
this.dgv_PlanDetail.AllowUserToAddRows = false;
this.dgv_PlanDetail.AllowUserToDeleteRows = false;
this.dgv_PlanDetail.AllowUserToResizeRows = false;
this.dgv_PlanDetail.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.dgv_PlanDetail.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.dgv_PlanDetail.BackgroundColor = System.Drawing.SystemColors.ButtonHighlight;
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle1.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, 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.dgv_PlanDetail.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
this.dgv_PlanDetail.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgv_PlanDetail.Location = new System.Drawing.Point(12, 42);
this.dgv_PlanDetail.MultiSelect = false;
this.dgv_PlanDetail.Name = "dgv_PlanDetail";
this.dgv_PlanDetail.ReadOnly = true;
this.dgv_PlanDetail.RowHeadersVisible = false;
this.dgv_PlanDetail.RowTemplate.Height = 26;
this.dgv_PlanDetail.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dgv_PlanDetail.Size = new System.Drawing.Size(1425, 754);
this.dgv_PlanDetail.TabIndex = 72;
//
// btn_Refresh
//
this.btn_Refresh.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btn_Refresh.Location = new System.Drawing.Point(719, 6);
this.btn_Refresh.Name = "btn_Refresh";
this.btn_Refresh.Size = new System.Drawing.Size(83, 26);
this.btn_Refresh.TabIndex = 74;
this.btn_Refresh.Text = "查询";
this.btn_Refresh.UseVisualStyleBackColor = true;
this.btn_Refresh.Click += new System.EventHandler(this.btn_Refresh_Click);
//
// cb_Area
//
this.cb_Area.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cb_Area.FormattingEnabled = true;
this.cb_Area.Items.AddRange(new object[] {
"内装线",
"活塞连杆分线",
"缸盖线"});
this.cb_Area.Location = new System.Drawing.Point(1139, 10);
this.cb_Area.Name = "cb_Area";
this.cb_Area.Size = new System.Drawing.Size(128, 20);
this.cb_Area.TabIndex = 75;
this.cb_Area.Visible = false;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label1.Location = new System.Drawing.Point(1070, 13);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(67, 14);
this.label1.TabIndex = 76;
this.label1.Text = "所属分线";
this.label1.Visible = false;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label3.Location = new System.Drawing.Point(9, 13);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(67, 14);
this.label3.TabIndex = 76;
this.label3.Text = "生产日期";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label4.Location = new System.Drawing.Point(188, 13);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(22, 14);
this.label4.TabIndex = 76;
this.label4.Text = "到";
//
// dtp_Start
//
this.dtp_Start.CustomFormat = "yyyy-MM-dd";
this.dtp_Start.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.dtp_Start.Location = new System.Drawing.Point(80, 9);
this.dtp_Start.Name = "dtp_Start";
this.dtp_Start.Size = new System.Drawing.Size(101, 21);
this.dtp_Start.TabIndex = 78;
//
// dtp_End
//
this.dtp_End.CustomFormat = "yyyy-MM-dd";
this.dtp_End.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.dtp_End.Location = new System.Drawing.Point(216, 9);
this.dtp_End.Name = "dtp_End";
this.dtp_End.Size = new System.Drawing.Size(101, 21);
this.dtp_End.TabIndex = 78;
//
// cmb_State
//
this.cmb_State.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmb_State.FormattingEnabled = true;
this.cmb_State.Items.AddRange(new object[] {
"未上线",
"已上线"});
this.cmb_State.Location = new System.Drawing.Point(406, 10);
this.cmb_State.Name = "cmb_State";
this.cmb_State.Size = new System.Drawing.Size(95, 20);
this.cmb_State.TabIndex = 75;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label2.Location = new System.Drawing.Point(339, 13);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(67, 14);
this.label2.TabIndex = 76;
this.label2.Text = "执行状态";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label5
//
this.label5.AutoSize = true;
this.label5.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label5.Location = new System.Drawing.Point(522, 13);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(52, 14);
this.label5.TabIndex = 76;
this.label5.Text = "订单号";
this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// txt_OrderNum
//
this.txt_OrderNum.Location = new System.Drawing.Point(574, 9);
this.txt_OrderNum.Name = "txt_OrderNum";
this.txt_OrderNum.Size = new System.Drawing.Size(126, 21);
this.txt_OrderNum.TabIndex = 79;
//
// PlanExecute
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1446, 808);
this.Controls.Add(this.txt_OrderNum);
this.Controls.Add(this.dtp_End);
this.Controls.Add(this.dtp_Start);
this.Controls.Add(this.cmb_State);
this.Controls.Add(this.cb_Area);
this.Controls.Add(this.btn_Refresh);
this.Controls.Add(this.dgv_PlanDetail);
this.Controls.Add(this.label4);
this.Controls.Add(this.label3);
this.Controls.Add(this.label5);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Name = "PlanExecute";
this.ShowIcon = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "计划执行情况";
this.Load += new System.EventHandler(this.PlanExecute_Query_Load);
((System.ComponentModel.ISupportInitialize)(this.dgv_PlanDetail)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.DataGridView dgv_PlanDetail;
private System.Windows.Forms.Button btn_Refresh;
private System.Windows.Forms.ComboBox cb_Area;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.DateTimePicker dtp_Start;
private System.Windows.Forms.DateTimePicker dtp_End;
private System.Windows.Forms.ComboBox cmb_State;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.TextBox txt_OrderNum;
}
}

View File

@@ -0,0 +1,112 @@
using DC_A95.MES_A95;
using MesWork;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using static System.Configuration.ConfigurationManager;
namespace PlanExecute_Query
{
/// <summary>
/// 计划执行情况查询
/// </summary>
public partial class PlanExecute : Form
{
/// <summary>
/// 构造
/// </summary>
public PlanExecute()
{
InitializeComponent();
//this.WindowState = FormWindowState.Maximized;
var end = DateTime.Now.AddDays(5);
var start = end.AddDays(-8);
dtp_Start.Value = start;
dtp_End.Value = end;
cb_Area.SelectedItem = "内装线";
}
/// <summary>
/// 钩子
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void PlanExecute_Query_Load(object sender, EventArgs e)
{
Refresh_PlanInfo();
}
/// <summary>
/// 刷新日志的显示
/// </summary>
private void Refresh_PlanInfo()
{
var dt = Select_PlanInfo();
dgv_PlanDetail.DataSource = dt;
}
/// <summary>
/// 查询日志
/// </summary>
/// <returns></returns>
private DataTable Select_PlanInfo()
{
//var area= cb_Area.Text;
var start = dtp_Start.Value;
var end = dtp_End.Value;
var tblName = "";
//内装线
//活塞连杆分线
//缸盖线
//if (area == "内装线") tblName = "大柴_接口_SAP生产计划_执行计划";
//else if (area == "缸盖线") tblName = "大柴_接口_SAP生产计划_执行计划_缸盖";
//else if (area == "活塞连杆分线") tblName = "大柴_接口_SAP生产计划_执行计划_活塞连杆";
var whereStr = "";
whereStr = $" WHERE 计划开始时间>='{start.Date}' and 计划开始时间<='{end.Date}'";
if(cmb_State.Text.Trim()=="未上线")
{
whereStr += $" AND [执行状态] = {PlanExec_State.Waiting}";
}
else if (cmb_State.Text.Trim() == "已上线")
{
whereStr += $" AND [执行状态] = {PlanExec_State.HasExec}";
}
if (txt_OrderNum.Text != "")
{
whereStr += $" AND [订单号] = '{txt_OrderNum.Text}'";
}
//var sql = $"SELECT Top(200) a.[订单类型],a.[生产日期],a.[上线序号],a.[上线总排序],a.[发动机流水号] as 发动机号,a.[机型号],a.[订单号],a.[订单数量],a.[创建时间],a.[执行状态],a.[是否冷试],a.[是否热试],b.当前工位"
// + $" FROM [大柴_接口_SAP生产计划_执行计划] a LEFT JOIN [大柴_上线记录_内装线] b ON a.发动机流水号=b.发动机流水号 {whereStr}"
// + " order by a.[上线总排序]";
var sql = $"SELECT TOP (1000) [AID] ,[发动机编号],[订货号],[订货号ID] ,[机型号] ,[工单ID] ,[工单号] ,[BOM头ID] ,[MES计划顺序] ,[计划开始时间] ,[总装上线扫描时间] ,[计划同步时间] ,[计划状态] ,[执行状态] ,[执行时间] ,[LineID]" +
$" FROM[WC_WP12T_13L].[dbo].[潍柴_接口_生产计划_执行计划] { whereStr}"
+ " order by [MES计划顺序]";
DataLinkMesWork.SQLCommon.ExecuteDataTable(sql, MesWorkForm.ConnectionString,out DataTable dt, out string err2);
return dt;
}
/// <summary>
/// 手动刷新
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btn_Refresh_Click(object sender, EventArgs e)
{
var area = cb_Area.Text;
var start = dtp_Start.Value;
var end = dtp_End.Value;
var dt = Select_PlanInfo();
dgv_PlanDetail.DataSource = dt;
}
}
}

View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>