1 文件已重命名
37个文件已修改
3个文件已添加
| | |
| | | this.HMaterID = new System.Windows.Forms.Label(); |
| | | this.timer = new System.Windows.Forms.Timer(this.components); |
| | | this.Time_CLHB = new System.Windows.Forms.Timer(this.components); |
| | | this.labHMakerID = new System.Windows.Forms.Label(); |
| | | this.txtHMakerNumber = new System.Windows.Forms.TextBox(); |
| | | this.label5 = new System.Windows.Forms.Label(); |
| | | this.txtHMaker = new System.Windows.Forms.TextBox(); |
| | | this.label6 = new System.Windows.Forms.Label(); |
| | | this.SuspendLayout(); |
| | | // |
| | | // cmbEquipFile |
| | | // |
| | | this.cmbEquipFile.FormattingEnabled = true; |
| | | this.cmbEquipFile.Location = new System.Drawing.Point(128, 39); |
| | | this.cmbEquipFile.Location = new System.Drawing.Point(121, 74); |
| | | this.cmbEquipFile.Name = "cmbEquipFile"; |
| | | this.cmbEquipFile.Size = new System.Drawing.Size(186, 26); |
| | | this.cmbEquipFile.TabIndex = 13; |
| | |
| | | // txtEquipFile |
| | | // |
| | | this.txtEquipFile.AutoSize = true; |
| | | this.txtEquipFile.Location = new System.Drawing.Point(69, 47); |
| | | this.txtEquipFile.Location = new System.Drawing.Point(62, 82); |
| | | this.txtEquipFile.Name = "txtEquipFile"; |
| | | this.txtEquipFile.Size = new System.Drawing.Size(53, 18); |
| | | this.txtEquipFile.TabIndex = 14; |
| | |
| | | // |
| | | // btnBegin |
| | | // |
| | | this.btnBegin.Location = new System.Drawing.Point(52, 91); |
| | | this.btnBegin.Location = new System.Drawing.Point(45, 126); |
| | | this.btnBegin.Name = "btnBegin"; |
| | | this.btnBegin.Size = new System.Drawing.Size(70, 37); |
| | | this.btnBegin.TabIndex = 15; |
| | |
| | | // |
| | | // txtBegin |
| | | // |
| | | this.txtBegin.Location = new System.Drawing.Point(128, 97); |
| | | this.txtBegin.Location = new System.Drawing.Point(121, 132); |
| | | this.txtBegin.Name = "txtBegin"; |
| | | this.txtBegin.Size = new System.Drawing.Size(186, 28); |
| | | this.txtBegin.TabIndex = 16; |
| | | // |
| | | // txtEnd |
| | | // |
| | | this.txtEnd.Location = new System.Drawing.Point(478, 100); |
| | | this.txtEnd.Location = new System.Drawing.Point(471, 135); |
| | | this.txtEnd.Name = "txtEnd"; |
| | | this.txtEnd.Size = new System.Drawing.Size(186, 28); |
| | | this.txtEnd.TabIndex = 18; |
| | | // |
| | | // btnEnd |
| | | // |
| | | this.btnEnd.Location = new System.Drawing.Point(402, 94); |
| | | this.btnEnd.Location = new System.Drawing.Point(395, 129); |
| | | this.btnEnd.Name = "btnEnd"; |
| | | this.btnEnd.Size = new System.Drawing.Size(70, 37); |
| | | this.btnEnd.TabIndex = 17; |
| | |
| | | // |
| | | // btnSave |
| | | // |
| | | this.btnSave.Location = new System.Drawing.Point(744, 26); |
| | | this.btnSave.Location = new System.Drawing.Point(737, 61); |
| | | this.btnSave.Name = "btnSave"; |
| | | this.btnSave.Size = new System.Drawing.Size(115, 37); |
| | | this.btnSave.TabIndex = 19; |
| | |
| | | // label4 |
| | | // |
| | | this.label4.AutoSize = true; |
| | | this.label4.Location = new System.Drawing.Point(40, 167); |
| | | this.label4.Location = new System.Drawing.Point(33, 202); |
| | | this.label4.Name = "label4"; |
| | | this.label4.Size = new System.Drawing.Size(53, 18); |
| | | this.label4.TabIndex = 21; |
| | |
| | | // |
| | | // txtLj |
| | | // |
| | | this.txtLj.Location = new System.Drawing.Point(112, 164); |
| | | this.txtLj.Location = new System.Drawing.Point(105, 199); |
| | | this.txtLj.Name = "txtLj"; |
| | | this.txtLj.Size = new System.Drawing.Size(608, 28); |
| | | this.txtLj.TabIndex = 20; |
| | | // |
| | | // btnLj |
| | | // |
| | | this.btnLj.Location = new System.Drawing.Point(735, 155); |
| | | this.btnLj.Location = new System.Drawing.Point(728, 190); |
| | | this.btnLj.Name = "btnLj"; |
| | | this.btnLj.Size = new System.Drawing.Size(115, 42); |
| | | this.btnLj.TabIndex = 22; |
| | |
| | | // |
| | | // txtHBathNo |
| | | // |
| | | this.txtHBathNo.Location = new System.Drawing.Point(478, 31); |
| | | this.txtHBathNo.Location = new System.Drawing.Point(471, 66); |
| | | this.txtHBathNo.Name = "txtHBathNo"; |
| | | this.txtHBathNo.Size = new System.Drawing.Size(186, 28); |
| | | this.txtHBathNo.TabIndex = 24; |
| | |
| | | // HBathNo |
| | | // |
| | | this.HBathNo.AutoSize = true; |
| | | this.HBathNo.Location = new System.Drawing.Point(408, 36); |
| | | this.HBathNo.Location = new System.Drawing.Point(401, 71); |
| | | this.HBathNo.Name = "HBathNo"; |
| | | this.HBathNo.Size = new System.Drawing.Size(62, 18); |
| | | this.HBathNo.TabIndex = 25; |
| | |
| | | // |
| | | // btnRest |
| | | // |
| | | this.btnRest.Location = new System.Drawing.Point(744, 88); |
| | | this.btnRest.Location = new System.Drawing.Point(737, 123); |
| | | this.btnRest.Name = "btnRest"; |
| | | this.btnRest.Size = new System.Drawing.Size(115, 37); |
| | | this.btnRest.TabIndex = 26; |
| | |
| | | // |
| | | this.ListData.FormattingEnabled = true; |
| | | this.ListData.ItemHeight = 18; |
| | | this.ListData.Location = new System.Drawing.Point(5, 204); |
| | | this.ListData.Location = new System.Drawing.Point(-2, 239); |
| | | this.ListData.Name = "ListData"; |
| | | this.ListData.Size = new System.Drawing.Size(932, 472); |
| | | this.ListData.TabIndex = 27; |
| | | // |
| | | // txtHMaterNumber |
| | | // |
| | | this.txtHMaterNumber.Location = new System.Drawing.Point(478, 66); |
| | | this.txtHMaterNumber.Location = new System.Drawing.Point(471, 101); |
| | | this.txtHMaterNumber.Name = "txtHMaterNumber"; |
| | | this.txtHMaterNumber.Size = new System.Drawing.Size(186, 28); |
| | | this.txtHMaterNumber.TabIndex = 28; |
| | |
| | | // HMaterID |
| | | // |
| | | this.HMaterID.AutoSize = true; |
| | | this.HMaterID.Location = new System.Drawing.Point(458, 9); |
| | | this.HMaterID.Location = new System.Drawing.Point(326, 74); |
| | | this.HMaterID.Name = "HMaterID"; |
| | | this.HMaterID.Size = new System.Drawing.Size(80, 18); |
| | | this.HMaterID.TabIndex = 29; |
| | |
| | | this.Time_CLHB.Interval = 3600000; |
| | | this.Time_CLHB.Tick += new System.EventHandler(this.Time_CLHB_Tick); |
| | | // |
| | | // labHMakerID |
| | | // |
| | | this.labHMakerID.AutoSize = true; |
| | | this.labHMakerID.Location = new System.Drawing.Point(674, 20); |
| | | this.labHMakerID.Name = "labHMakerID"; |
| | | this.labHMakerID.Size = new System.Drawing.Size(107, 18); |
| | | this.labHMakerID.TabIndex = 34; |
| | | this.labHMakerID.Text = "labHMakerID"; |
| | | this.labHMakerID.Visible = false; |
| | | // |
| | | // txtHMakerNumber |
| | | // |
| | | this.txtHMakerNumber.Location = new System.Drawing.Point(471, 17); |
| | | this.txtHMakerNumber.Name = "txtHMakerNumber"; |
| | | this.txtHMakerNumber.Size = new System.Drawing.Size(186, 28); |
| | | this.txtHMakerNumber.TabIndex = 33; |
| | | // |
| | | // label5 |
| | | // |
| | | this.label5.AutoSize = true; |
| | | this.label5.Location = new System.Drawing.Point(401, 22); |
| | | this.label5.Name = "label5"; |
| | | this.label5.Size = new System.Drawing.Size(53, 18); |
| | | this.label5.TabIndex = 32; |
| | | this.label5.Text = "编码:"; |
| | | // |
| | | // txtHMaker |
| | | // |
| | | this.txtHMaker.Location = new System.Drawing.Point(125, 17); |
| | | this.txtHMaker.Name = "txtHMaker"; |
| | | this.txtHMaker.Size = new System.Drawing.Size(189, 28); |
| | | this.txtHMaker.TabIndex = 20; |
| | | this.txtHMaker.Enter += new System.EventHandler(this.txtHMaker_Enter); |
| | | this.txtHMaker.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtHMaker_KeyDown); |
| | | this.txtHMaker.Leave += new System.EventHandler(this.txtHMaker_Leave); |
| | | // |
| | | // label6 |
| | | // |
| | | this.label6.AutoSize = true; |
| | | this.label6.Location = new System.Drawing.Point(47, 22); |
| | | this.label6.Name = "label6"; |
| | | this.label6.Size = new System.Drawing.Size(71, 18); |
| | | this.label6.TabIndex = 31; |
| | | this.label6.Text = "制单人:"; |
| | | // |
| | | // EquipmentCollectionForm |
| | | // |
| | | this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F); |
| | | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; |
| | | this.ClientSize = new System.Drawing.Size(942, 693); |
| | | this.ClientSize = new System.Drawing.Size(942, 723); |
| | | this.Controls.Add(this.labHMakerID); |
| | | this.Controls.Add(this.txtHMakerNumber); |
| | | this.Controls.Add(this.label5); |
| | | this.Controls.Add(this.txtHMaker); |
| | | this.Controls.Add(this.label6); |
| | | this.Controls.Add(this.HMaterID); |
| | | this.Controls.Add(this.txtHMaterNumber); |
| | | this.Controls.Add(this.ListData); |
| | |
| | | this.Controls.Add(this.cmbEquipFile); |
| | | this.Name = "EquipmentCollectionForm"; |
| | | this.Text = "设备数据采集"; |
| | | this.Activated += new System.EventHandler(this.EquipmentCollectionForm_Activated); |
| | | this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.EquipmentCollectionForm_FormClosing); |
| | | this.Load += new System.EventHandler(this.EquipmentCollectionForm_Load); |
| | | this.ResumeLayout(false); |
| | |
| | | private System.Windows.Forms.Label HMaterID; |
| | | private System.Windows.Forms.Timer Time_CLHB; |
| | | private System.Windows.Forms.Timer timer; |
| | | private System.Windows.Forms.Label labHMakerID; |
| | | private System.Windows.Forms.TextBox txtHMakerNumber; |
| | | private System.Windows.Forms.Label label5; |
| | | private System.Windows.Forms.TextBox txtHMaker; |
| | | private System.Windows.Forms.Label label6; |
| | | } |
| | | } |
| | |
| | | this.btnSave.Enabled = false; |
| | | this.txtHMaterNumber.ReadOnly = true; |
| | | //this.btnRest.Enabled = false; |
| | | //制单编码只读 |
| | | this.txtHMakerNumber.ReadOnly = true; |
| | | //制单人提示 |
| | | this.txtHMaker.ForeColor = Color.LightGray; |
| | | this.txtHMaker.Text = "请输入用户编码!"; |
| | | |
| | | bindCbox(); |
| | | |
| | | } |
| | |
| | | else |
| | | { |
| | | this.txtBegin.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); |
| | | //this.txtBegin.Text = "2024-09-24 09:47:39"; |
| | | //this.txtBegin.Text = "2024-11-04 15:40:27"; |
| | | this.btnBegin.Enabled = false; |
| | | if (cmbEquipFile.SelectedIndex == 1) |
| | | { |
| | |
| | | { |
| | | if (e.KeyCode == Keys.Enter) |
| | | { |
| | | if (this.txtHMakerNumber.Text == "") |
| | | { |
| | | MessageBox.Show("请输入制单人信息!"); |
| | | } |
| | | else { |
| | | Get_DisplayBard(); |
| | | } |
| | | //this.txtHBathNo.ReadOnly = true; |
| | | Get_DisplayBard(); |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | ",HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType,HICMOEntryID,HQCSchemeID,HShiftsID,HErrTreatment" + |
| | | ",HProcID,HBatchNo,HInSpectQty ,HRightQty ,HUnRightQty ,HUnKnowQty " + |
| | | ") " + |
| | | " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "',1,getdate(),'',getdate()" + |
| | | " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "',1,getdate(),'" + this.txtHMaker.Text + "',getdate()" + |
| | | "," + DateTime.Now.Year + "," + DateTime.Now.Month + ",''" + |
| | | "," + HSourceID + ",0,'',0,0,0" + |
| | | ",'',0," + HMaterID + ",'', " + HLastResults + |
| | | ",'',0," + HMaterID + ",'" + this.labHMakerID.Text + "', " + HLastResults + |
| | | ",0,0,'','',0," + HQCSchemeID + ",0,''" + |
| | | "," + HProcID + ",'" + HBatchNo + "',"+ HInSpectQty + ","+ HRightQty + ", "+ HUnRightQty + ", " + HUnKnowQty + ") "); |
| | | "," + HProcID + ",'" + HBatchNo + "'," + HInSpectQty + "," + HRightQty + ", " + HUnRightQty + ", " + HUnKnowQty + ") "); |
| | | |
| | | |
| | | oCN.Commit(); |
| | |
| | | } |
| | | } |
| | | |
| | | public async Task<JsonResult> EquipResultList(string url, StringContent postData, string Type) |
| | | { |
| | | |
| | | // 创建 HttpClient 实例 |
| | | using (HttpClient client = new HttpClient()) |
| | | { |
| | | JsonResult jsonResult = new JsonResult(); |
| | | try |
| | | { |
| | | HttpResponseMessage response; |
| | | if (Type == "POST") |
| | | { // 发起 POST 请求 |
| | | response = await client.PostAsync(url, postData); |
| | | } |
| | | else |
| | | { |
| | | // 发起 get 请求 |
| | | response = await client.GetAsync(url); |
| | | } |
| | | |
| | | |
| | | // 确保请求成功 |
| | | if (response.IsSuccessStatusCode) |
| | | { |
| | | // 读取响应内容 |
| | | string responseBody = await response.Content.ReadAsStringAsync(); |
| | | jsonResult = JsonConvert.DeserializeObject<JsonResult>(responseBody); |
| | | } |
| | | else |
| | | { |
| | | MessageBox.Show($"请求失败,: {response.StatusCode}"); |
| | | } |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MessageBox.Show("请求报错:" + ex.Message); |
| | | } |
| | | return jsonResult; |
| | | } |
| | | } |
| | | |
| | | |
| | | //获取ID |
| | | public async Task<JsonResult> FindAccessToken(string url) |
| | | { |
| | |
| | | //获取良品、不良品明细 |
| | | public async Task<JsonEquipmentData> FindAllDevicePropsDetailByTimeRange(string url, string token,string nos, string HBegin, string HEnd) |
| | | { |
| | | string basePropIds = DBHelper.GetConfigKey(AppDomain.CurrentDomain.BaseDirectory + "Config/SQLAPI.config", "basePropIds"); |
| | | basePropIds = "[" + basePropIds + "]"; |
| | | nos = nos.Replace(",", "\",\""); |
| | | string stringJson = "{\"token\":\"" + token + "\",\"deviceNos\":[\"" + nos + "\"],\"startTime\":\"" + HBegin + "\",\"endTime\":\"" + HEnd + "\",\"basePropIds\":[473,474,489,508, 562, 563, 564, 565, 566, 567, 568, 569, 570,571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 597, 600, 601, 602, 603, 604, 605, 593, 594, 595]}"; |
| | | string stringJson = "{\"token\":\"" + token + "\",\"deviceNos\":[\"" + nos + "\"],\"startTime\":\"" + HBegin + "\",\"endTime\":\"" + HEnd + "\",\"basePropIds\":" + basePropIds + "}"; |
| | | //设备列表接口 |
| | | string urls = url + EquipmentType.Nine; |
| | | |
| | |
| | | return jsonResult; |
| | | } |
| | | |
| | | //获取设备运行时间 开机 停机 待机 关机 |
| | | public async Task<JsonResult> FindDeviceStatusTimeByNo(string url, string token, string nos, string HBegin, string HEnd) |
| | | { |
| | | nos = nos.Replace(",", "\",\""); |
| | | nos = "\"" + nos + "\""; |
| | | string stringJson = "{\"token\":\"" + token + "\",\"no\":" + nos + ",\"startTime\":\"" + HBegin + "\",\"endTime\":\"" + HEnd + "\"}"; |
| | | var postData = new StringContent(stringJson, System.Text.Encoding.UTF8, "application/json"); |
| | | string urls = url + EquipmentType.Five; |
| | | JsonResult jsonResult = await EquipResultList(urls, postData, "POST"); |
| | | return jsonResult; |
| | | } |
| | | |
| | | //下拉框绑定数据 |
| | | private void bindCbox() |
| | | { |
| | | IList<Info> infoList = new List<Info>(); |
| | | Info info1 = new Info() { Id = "CMR_QC_SE_001", Name = "螺母全检" }; |
| | | Info info2 = new Info() { Id = "CMR_ZZ_SE_001", Name = "螺母压装" }; |
| | | Info info1 = new Info() { Id = "CMR-QC-SE-001", Name = "螺母全检" }; |
| | | Info info2 = new Info() { Id = "CMR-ZZ-SE-001", Name = "螺母压装" }; |
| | | Info info3 = new Info() { Id = "ZSJ07", Name = "注塑机#07" }; |
| | | //Info info3 = new Info() { Id = "3", Name = "王五" }; |
| | | infoList.Add(info1); |
| | |
| | | //定时获取数据 |
| | | private async void timer_Tick(object sender, EventArgs e) |
| | | { |
| | | //测试全检 |
| | | //this.timer.Enabled = false; |
| | | |
| | | string Url = DBHelper.GetConfigKey(AppDomain.CurrentDomain.BaseDirectory + "Config/SQLAPI.config", "sUrl"); |
| | | string urls = Url + EquipmentType.One; |
| | | // 准备要发送的表单数据 |
| | |
| | | //获取去设备编码 |
| | | for (int i = 0; i < jsonResult.data.Count; i++) |
| | | { |
| | | if (jsonResult.data[i].no.Contains("CMR_ZZ_SE_001")) |
| | | if (jsonResult.data[i].no.Contains("CMR-ZZ-SE-001")) |
| | | { |
| | | nos += jsonResult.data[i].no + ","; |
| | | } |
| | |
| | | //获取去设备编码 |
| | | for (int i = 0; i < jsonResult.data.Count; i++) |
| | | { |
| | | if (jsonResult.data[i].no.Contains("CMR-ZS-SE")) |
| | | { |
| | | nos += jsonResult.data[i].no + ","; |
| | | } |
| | | else if (jsonResult.data[i].no.Contains("CMR_ZZ_SE_")) |
| | | { |
| | | nos += jsonResult.data[i].no + ","; |
| | | } |
| | | nos += jsonResult.data[i].no + ","; |
| | | //if (jsonResult.data[i].no.Contains("CMR-ZS-SE")) |
| | | //{ |
| | | // nos += jsonResult.data[i].no + ","; |
| | | //} |
| | | //else if (jsonResult.data[i].no.Contains("CMR_ZZ_SE_")) |
| | | //{ |
| | | // nos += jsonResult.data[i].no + ","; |
| | | //} |
| | | } |
| | | nos = nos.Substring(0, nos.Length - 1); |
| | | |
| | | JsonEquipmentData jsonEquipment = await FindAllDevicePropsDetailByTimeRange(Url, token, nos, TimeDate, time); |
| | | |
| | | var JsonData = "{\"data\":["; |
| | | |
| | | for (int i = 0; i < jsonEquipment.data.Count; i++) |
| | | { |
| | | if (jsonEquipment.data[i].deviceNo.Contains("CMR_ZZ_SE_")) |
| | | if (jsonEquipment.data[i].deviceNo.Contains("CMR-ZZ-SE-")) |
| | | { |
| | | for (int j = 0; j < jsonEquipment.data[i].props.Count; j++) |
| | | { |
| | |
| | | |
| | | for (int i = 0; i < EquipmentStaus.data.Count; i++) |
| | | { |
| | | //卷绕的设备运行 开关停机时间 |
| | | if (EquipmentStaus.data[i].no.Contains("CMR-JR-SD-")) |
| | | { |
| | | string HBegDate = DateTime.Now.ToString("yyyy-MM-dd 00:00:00"); |
| | | string HEndDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); |
| | | |
| | | JsonResult HEqDate = await FindDeviceStatusTimeByNo(Url, token, EquipmentStaus.data[i].no, HBegDate, HEndDate); |
| | | |
| | | JsonData += "{\"HDate\":\"" + HEndDate + "\",\"HTechParamName\":\"开机时长\",\"HResult\":\"" + ((float)(HEqDate.data.onlineTime / 60 / 60)).ToString("0.00") + "\",\"HCount\":1,\"HSourceCode\":\"" + EquipmentStaus.data[i].no + "\"},"; |
| | | JsonData += "{\"HDate\":\"" + HEndDate + "\",\"HTechParamName\":\"关机时长\",\"HResult\":\"" + ((float)(HEqDate.data.offlineTime / 60 / 60)).ToString("0.00") + "\",\"HCount\":1,\"HSourceCode\":\"" + EquipmentStaus.data[i].no + "\"},"; |
| | | JsonData += "{\"HDate\":\"" + HEndDate + "\",\"HTechParamName\":\"停机时长\",\"HResult\":\"" + ((float)(HEqDate.data.standbyTime / 60 / 60)).ToString("0.00") + "\",\"HCount\":1,\"HSourceCode\":\"" + EquipmentStaus.data[i].no + "\"},"; |
| | | JsonData += "{\"HDate\":\"" + HEndDate + "\",\"HTechParamName\":\"运行时长\",\"HResult\":\"" + ((float)(HEqDate.data.runTime / 60 / 60)).ToString("0.00") + "\",\"HCount\":1,\"HSourceCode\":\"" + EquipmentStaus.data[i].no + "\"},"; |
| | | } |
| | | |
| | | string staus = ""; |
| | | switch (EquipmentStaus.data[i].status) |
| | | { |
| | |
| | | { |
| | | nos += "''" + jsonEquipment.data[i].no + "'',"; |
| | | } |
| | | else if (jsonEquipment.data[i].no.Contains("CMR_ZZ_SE_")) |
| | | else if (jsonEquipment.data[i].no.Contains("CMR-ZZ-SE-")) |
| | | { |
| | | nos += "''" + jsonEquipment.data[i].no + "'',"; |
| | | } |
| | |
| | | e.Cancel = true; |
| | | } |
| | | } |
| | | |
| | | private void txtHMaker_Leave(object sender, EventArgs e) |
| | | { |
| | | if (string.IsNullOrWhiteSpace(txtHMaker.Text)) |
| | | { |
| | | this.txtHMaker.ForeColor = Color.LightGray; |
| | | txtHMaker.Text = "请输入用户编码!"; |
| | | } |
| | | } |
| | | |
| | | private void txtHMaker_Enter(object sender, EventArgs e) |
| | | { |
| | | if (txtHMaker.Text.Trim() == "请输入用户编码!") |
| | | { |
| | | txtHMaker.Text = ""; |
| | | this.txtHMaker.ForeColor = Color.Black; |
| | | } |
| | | } |
| | | |
| | | private void txtHMaker_KeyDown(object sender, KeyEventArgs e) |
| | | { |
| | | if (e.KeyCode == Keys.Enter) |
| | | { |
| | | SelectHMaker(this.txtHMaker.Text); |
| | | } |
| | | } |
| | | |
| | | |
| | | //查询职员信息 |
| | | public void SelectHMaker(string txtHMaker) |
| | | { |
| | | try |
| | | { |
| | | DataSet ds = oCN.RunProcReturn("select HItemID,HName,HNumber from Gy_Employee where HNumber='" + txtHMaker + "' or HName ='" + txtHMaker + "'", "Gy_Employee"); |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | string HName = ds.Tables[0].Rows[0]["HName"].ToString(); |
| | | string HMakerID = ds.Tables[0].Rows[0]["HItemID"].ToString(); |
| | | string HNumber = ds.Tables[0].Rows[0]["HNumber"].ToString(); |
| | | this.txtHMaker.Text = HName; |
| | | this.txtHMakerNumber.Text = HNumber; |
| | | this.labHMakerID.Text = HMakerID; |
| | | this.txtHMaker.ReadOnly = true; |
| | | } |
| | | else |
| | | { |
| | | MessageBox.Show(this, "编码:" + txtHMaker + ",查无数据,可能是输入编码有误!", "提示"); |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | MessageBox.Show(this, e.Message, "提示"); |
| | | } |
| | | } |
| | | |
| | | private void EquipmentCollectionForm_Activated(object sender, EventArgs e) |
| | | { |
| | | //光标选中制单人 |
| | | this.txtHMaker.Focus(); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | public class JsonData |
| | | { |
| | | public double onlineTime { get; set; } |
| | | public double offlineTime { get; set; } |
| | | public double standbyTime { get; set; } |
| | | public double runTime { get; set; } |
| | | public string expirationTime { get; set; } |
| | | public string token { get; set; } |
| | | public string deviceNo { get; set; } |
| | |
| | | //良品 不良品 明细 注塑机数据 |
| | | public static string Nine = "/api/third/findAllDevicePropsDetailByTimeRange"; |
| | | //注塑机数据 |
| | | public static string Ten = "/api/third/findAllDevicePropsDetailByTimeRange"; |
| | | //public static string Ten = "/api/third/findAllDevicePropsDetailByTimeRange"; |
| | | //public static string Eleven = "Monday"; |
| | | //public static string Twelve = "Monday"; |
| | | } |
| | |
| | | <FileAlignment>512</FileAlignment> |
| | | <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> |
| | | <Deterministic>true</Deterministic> |
| | | <IsWebBootstrapper>false</IsWebBootstrapper> |
| | | <PublishUrl>publish\</PublishUrl> |
| | | <Install>true</Install> |
| | | <InstallFrom>Disk</InstallFrom> |
| | |
| | | <MapFileExtensions>true</MapFileExtensions> |
| | | <ApplicationRevision>0</ApplicationRevision> |
| | | <ApplicationVersion>1.0.0.%2a</ApplicationVersion> |
| | | <IsWebBootstrapper>false</IsWebBootstrapper> |
| | | <UseApplicationTrust>false</UseApplicationTrust> |
| | | <BootstrapperEnabled>true</BootstrapperEnabled> |
| | | </PropertyGroup> |
| | |
| | | <add key="sDataBase" value="HX_LMESsys_test"></add> |
| | | <add key="sUser" value="HX_USER"></add> |
| | | <add key="sPassword" value="lc@841022"></add> |
| | | <!--<add key="sUrl" value="https://30.10.7.6:8066"></add>--><!--内部测试--> |
| | | <add key="sUrl" value="https://hzsme.nps.iiot.youngsunnb.com/"></add><!--斯莫尔外网测试--> |
| | | <add key="basePropIds" value="279,473,474,489,508, 562, 563, 564, 565, 566, 567, 568, 569, 570,571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586,593, 594, 595, 597, 600, 601, 602, 603, 604, 605,609,608,610,611,612,613,614,615,616,617,620,621,622,623,624,625,626,627,628,629,630,631,632,633,634,635,636,637"></add> |
| | | <!--内部测试--> |
| | | <!--<add key="sUrl" value="https://30.10.7.6:8066"></add>--> |
| | | <!--斯莫尔外网测试--> |
| | | <add key="sUrl" value="https://hzsme.nps.iiot.youngsunnb.com/"></add> |
| | | <!--47--> |
| | | <!--<add key="sServer" value="47.96.97.237,15127"></add> |
| | | <add key="sDataBase" value="HX_LMESsys"></add> |
| | |
| | | E:\智云mes\SRM\WFormSynchronizeData_SMR\WFormSynchronizeData_SMR\EquipmentCollectionForm\obj\Debug\EquipmentCollectionForm.csproj.CopyComplete |
| | | E:\智云mes\SRM\WFormSynchronizeData_SMR\WFormSynchronizeData_SMR\EquipmentCollectionForm\obj\Debug\EquipmentCollectionForm.exe |
| | | E:\智云mes\SRM\WFormSynchronizeData_SMR\WFormSynchronizeData_SMR\EquipmentCollectionForm\obj\Debug\EquipmentCollectionForm.pdb |
| | | E:\智云mes\SRM\WFormSynchronizeData_SMR\WFormSynchronizeData_SMR\EquipmentCollectionForm\obj\Debug\EquipmentCollectionForm.csproj.AssemblyReference.cache |
| | |
| | | { |
| | | Application.EnableVisualStyles(); |
| | | Application.SetCompatibleTextRenderingDefault(false); |
| | | Application.Run(new ReadCoordinateExcelFrom()); |
| | | Application.Run(new ReadCSV()); |
| | | } |
| | | } |
| | | } |
| | |
| | | this.ListSelect.ItemHeight = 18; |
| | | this.ListSelect.Location = new System.Drawing.Point(19, 195); |
| | | this.ListSelect.Name = "ListSelect"; |
| | | this.ListSelect.Size = new System.Drawing.Size(766, 310); |
| | | this.ListSelect.Size = new System.Drawing.Size(845, 310); |
| | | this.ListSelect.TabIndex = 21; |
| | | // |
| | | // btnSelect |
| | |
| | | // |
| | | this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F); |
| | | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; |
| | | this.ClientSize = new System.Drawing.Size(800, 520); |
| | | this.ClientSize = new System.Drawing.Size(876, 520); |
| | | this.Controls.Add(this.label1); |
| | | this.Controls.Add(this.ListSelect); |
| | | this.Controls.Add(this.btnSelect); |
| | |
| | | this.btnGH.Enabled = false; |
| | | this.btnSelect.Enabled = false; |
| | | num = 1; |
| | | //ReadCsv(); |
| | | } |
| | | else if (num == 1) |
| | | { |
| | |
| | | string Date = DateTime.Now.ToString("yyMMdd"); |
| | | string HBath = this.txtHBath.Text; |
| | | |
| | | string Year = DateTime.Now.Year.ToString(); |
| | | Year = Year.Substring(Year.Length - 2, 2); |
| | | string Month = DateTime.Now.Month.ToString(); |
| | | Month = Month.Length > 1 ? Month : "0" + Month; |
| | | string Day = DateTime.Now.Day.ToString(); |
| | | Day = Day.Length > 1 ? Day : "0" + Day; |
| | | |
| | | //注:斯莫尔组装3 在E盘 _332009 |
| | | //其余在D盘 _C332001_2M |
| | | //string csv_file_path = $@"C:\Users\admin\Desktop\新建文件夹 (2)\20231123.csv"; |
| | | //string csv_file_path = $@"D:\THLCR_Data\{HBath}\{HBath}_{Date}_C332001_2M.csv"; //组装1 组装2路径 |
| | | string csv_file_path = $@"E:\THLCR_Data\{HBath}\{HBath}_{Date}_332009.csv"; //组装3路径 |
| | | //15车间缺少路径 D:\DATA SAVE\年\年月\年月日\批次号\数据保存.csv |
| | | //string csv_file_path = $@"D:\DATA SAVE\{Year}\{Year + Month}\{Year + Month + Day}\{HBath}\数据保存.csv"; |
| | | |
| | | |
| | | bool flag = File.Exists(csv_file_path); |
| | | |
| | | if (flag) |
| | | { |
| | | DataTable dt = new DataTable(); |
| | | //string HTypeName = "无尘"; |
| | | //string csv_file_path_Read = @"C:\Users\admin\Desktop\新建文件夹 (2)\20231123_1.csv"; |
| | | //string csv_file_path_Read = $@"D:\THLCR_Data\{HBath}\{HBath}_{Date}_C332001_2M_Read.csv"; //组装1 组装2路径 |
| | | string csv_file_path_Read = $@"E:\THLCR_Data\{HBath}\{HBath}_{Date}_332009_Read.csv"; //组装3路径 |
| | | //string csv_file_path_Read = $@"E:\THLCR_Data\{HBath}\{HBath}_{Date}_332009_Read.csv"; //组装3路径 |
| | | string HTypeName = "15"; |
| | | //15车间缺少路径 D:\DATA SAVE\年\年月\年月日\批次号\数据保存.csv |
| | | //string csv_file_path_Read = $@"C:\Users\admin\Desktop\新建文件夹 (2)\DATA SAVE\数据保存_MES读取.csv"; |
| | | |
| | | string csv_file_path_Read = $@"D:\DATA SAVE\{Year}\{Year + Month}\{Year + Month + Day}\{HBath}\数据保存_MES读取.csv"; |
| | | |
| | | File.Copy(csv_file_path, csv_file_path_Read, true); |
| | | |
| | |
| | | parser.Close(); |
| | | |
| | | //获取当前时间 |
| | | DateTime ActionTime = DateTime.Parse(DateTime.Now.AddMinutes(-1).ToString("yyyy-MM-dd HH:mm:ss")); |
| | | DateTime ActionTime = DateTime.Parse(DateTime.Now.AddMinutes(-2).ToString("yyyy-MM-dd HH:mm:ss")); |
| | | DateTime EndTime = DateTime.Parse(DateTime.Now.AddMinutes(1).ToString("yyyy-MM-dd HH:mm:00")); |
| | | |
| | | foreach (DataRow item in dt.Rows) |
| | | { |
| | | DateTime NowTime = DateTime.Parse(item["测试时间"].ToString()); |
| | | string HBadCodeSN = item["序号"].ToString(); |
| | | |
| | | if (((NowTime >= ActionTime && NowTime < EndTime) || dt.Rows.Count <= 20) && HBadCodeSN != "") |
| | | if (HTypeName == "无尘") |
| | | { |
| | | DateTime NowTime = DateTime.Parse(item["测试时间"].ToString()); |
| | | string HBadCodeSN = item["序号"].ToString(); |
| | | |
| | | string HSourceCode = this.HSouce.Text; //设备编号 组装1 9994 组装2 9995 组装3 9996 |
| | | string HEmpCode = this.HEmpCode.Text; |
| | | string HBarCode = item["序号"].ToString(); |
| | | string HCreateTime = item["测试时间"].ToString(); |
| | | string HDate = DateTime.Parse(item["测试时间"].ToString()).ToString("yyyy-MM-dd"); |
| | | string HResult = item["分选"].ToString() == "PASS" ? "OK" : "NG"; |
| | | string HProcNumber = "005"; |
| | | int HFlag = 0; |
| | | //string HEmpCode = ""; |
| | | if (HBadCodeSN != "") |
| | | if (((NowTime >= ActionTime && NowTime < EndTime) || dt.Rows.Count <= 20) && HBadCodeSN != "") |
| | | { |
| | | string HType = ""; |
| | | int HCount = 1; |
| | | |
| | | DataSet ds = oCN.RunProcReturn(@"select * from Sb_EquipMentCollection_SN where HBarCode='" + HBarCode + "' and HCreateTime='" + HCreateTime + "'", "Sb_EquipMentCollection_SN"); |
| | | |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | string HSourceCode = this.HSouce.Text; //设备编号 组装1 9994 组装2 9995 组装3 9996 |
| | | string HEmpCode = this.HEmpCode.Text; |
| | | string HBarCode = item["序号"].ToString(); |
| | | string HCreateTime = item["测试时间"].ToString(); |
| | | string HDate = DateTime.Parse(item["测试时间"].ToString()).ToString("yyyy-MM-dd"); |
| | | string HResult = item["分选"].ToString() == "PASS" ? "OK" : "NG"; |
| | | string HProcNumber = "005"; |
| | | int HFlag = 0; |
| | | //string HEmpCode = ""; |
| | | if (HBadCodeSN != "") |
| | | { |
| | | string sql = $@"insert into Sb_EquipMentCollection_SN(HSourceCode,HEmpCode,HType,HBarCode,HCount,HCreateTime,HDate,HResult,HProcNumber,HFlag) |
| | | values('{HSourceCode}','{HEmpCode}','{HType}','{HBarCode}','{HCount}','{HCreateTime}','{HDate}','{HResult}','{HProcNumber}','{HFlag}')"; |
| | | oCN.RunProc(sql); |
| | | ListSelect.Items.Add("条码:" + HBarCode + ",日期:" + HCreateTime + ",结果:" + HResult); |
| | | } |
| | | } |
| | | string HType = ""; |
| | | int HCount = 1; |
| | | |
| | | for (int i = 0; i < dt.Columns.Count; i++) |
| | | { |
| | | if (dt.Columns[i].ColumnName.Contains("Hz")) |
| | | { |
| | | string HType = dt.Columns[i].ColumnName; |
| | | string HCount = item[HType].ToString(); |
| | | |
| | | DataSet ds = oCN.RunProcReturn(@"select * from Sb_EquipMentCollectionTechParam_SN where HBarCode='" + HBarCode + "' and HType='" + HType + "'", "Sb_EquipMentCollectionTechParam_SN"); |
| | | DataSet ds = oCN.RunProcReturn(@"select * from Sb_EquipMentCollection_SN where HBarCode='" + HBarCode + "' and HCreateTime='" + HCreateTime + "'", "Sb_EquipMentCollection_SN"); |
| | | |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | string sql = $@"insert into Sb_EquipMentCollectionTechParam_SN(HSourceCode,HEmpCode,HType,HBarCode,HCount,HCreateTime,HDate,HResult,HProcNumber,HFlag) |
| | | values('{HSourceCode}','{HEmpCode}','{HType}','{HBarCode}','{HCount}','{HCreateTime}','{HDate}','{HResult}','{HProcNumber}','{HFlag}')"; |
| | | string sql = $@"insert into Sb_EquipMentCollection_SN(HSourceCode,HEmpCode,HType,HBarCode,HCount,HCreateTime,HDate,HResult,HProcNumber,HFlag) |
| | | values('{HSourceCode}','{HEmpCode}','{HType}','{HBarCode}','{HCount}','{HCreateTime}','{HDate}','{HResult}','{HProcNumber}','{HFlag}')"; |
| | | oCN.RunProc(sql); |
| | | //ListSelect.Items.Add("条码:" + HBarCode + ",日期:" + HCreateTime + ",结果:" + HResult); |
| | | ListSelect.Items.Add("条码:" + HBarCode + ",日期:" + HCreateTime + ",结果:" + HResult); |
| | | } |
| | | } |
| | | |
| | | for (int i = 0; i < dt.Columns.Count; i++) |
| | | { |
| | | if (dt.Columns[i].ColumnName.Contains("Hz")) |
| | | { |
| | | string HType = dt.Columns[i].ColumnName; |
| | | string HCount = item[HType].ToString(); |
| | | |
| | | DataSet ds = oCN.RunProcReturn(@"select * from Sb_EquipMentCollectionTechParam_SN where HBarCode='" + HBarCode + "' and HType='" + HType + "'", "Sb_EquipMentCollectionTechParam_SN"); |
| | | |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | string sql = $@"insert into Sb_EquipMentCollectionTechParam_SN(HSourceCode,HEmpCode,HType,HBarCode,HCount,HCreateTime,HDate,HResult,HProcNumber,HFlag) |
| | | values('{HSourceCode}','{HEmpCode}','{HType}','{HBarCode}','{HCount}','{HCreateTime}','{HDate}','{HResult}','{HProcNumber}','{HFlag}')"; |
| | | oCN.RunProc(sql); |
| | | //ListSelect.Items.Add("条码:" + HBarCode + ",日期:" + HCreateTime + ",结果:" + HResult); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (HTypeName == "15") |
| | | { |
| | | DateTime NowTime = DateTime.Parse(item["CS_时间"].ToString()); |
| | | string HBadCodeSN = item["CS_DM码"].ToString(); |
| | | |
| | | if (((NowTime >= ActionTime && NowTime < EndTime) || dt.Rows.Count <= 20) && HBadCodeSN != "") |
| | | { |
| | | |
| | | string HSourceCode = this.HSouce.Text; //设备编号 组装1 9994 组装2 9995 组装3 9996 |
| | | string HEmpCode = this.HEmpCode.Text; |
| | | string HBarCode = item["CS_DM码"].ToString(); |
| | | string HCreateTime = item["CS_时间"].ToString(); |
| | | string HDate = DateTime.Parse(item["CS_时间"].ToString()).ToString("yyyy-MM-dd"); |
| | | string HResult = item["CS_总结果"].ToString(); |
| | | string HProcNumber = "005"; |
| | | int HFlag = 0; |
| | | |
| | | if (HResult != "") { |
| | | if (HBadCodeSN != "") |
| | | { |
| | | string HType = ""; |
| | | int HCount = 1; |
| | | |
| | | DataSet ds = oCN.RunProcReturn(@"select * from Sb_EquipMentCollection_SN where HBarCode='" + HBarCode + "' and HCreateTime='" + HCreateTime + "'", "Sb_EquipMentCollection_SN"); |
| | | |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | string sql = $@"insert into Sb_EquipMentCollection_SN(HSourceCode,HEmpCode,HType,HBarCode,HCount,HCreateTime,HDate,HResult,HProcNumber,HFlag) |
| | | values('{HSourceCode}','{HEmpCode}','{HType}','{HBarCode}','{HCount}','{HCreateTime}','{HDate}','{HResult}','{HProcNumber}','{HFlag}')"; |
| | | oCN.RunProc(sql); |
| | | ListSelect.Items.Add("条码:" + HBarCode + ",日期:" + HCreateTime + ",结果:" + HResult); |
| | | } |
| | | } |
| | | |
| | | for (int i = 0; i < dt.Columns.Count; i++) |
| | | { |
| | | if (dt.Columns[i].ColumnName.Contains("CS_")) |
| | | { |
| | | string HType = dt.Columns[i].ColumnName; |
| | | string HCount = item[HType].ToString(); |
| | | string HResult_TechParam = ""; |
| | | if (HType != "CS_时间" && HType != "CS_DM码" && HType != "CS_总结果") |
| | | { |
| | | HResult_TechParam = HCount; |
| | | double number = 0; |
| | | if (!Double.TryParse(HCount, out number)) |
| | | { |
| | | HCount = "0"; |
| | | } |
| | | |
| | | DataSet ds = oCN.RunProcReturn(@"select * from Sb_EquipMentCollectionTechParam_SN where HBarCode='" + HBarCode + "' and HType='" + HType + "'", "Sb_EquipMentCollectionTechParam_SN"); |
| | | |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | string sql = $@"insert into Sb_EquipMentCollectionTechParam_SN(HSourceCode,HEmpCode,HType,HBarCode,HCount,HCreateTime,HDate,HResult,HProcNumber,HFlag) |
| | | values('{HSourceCode}','{HEmpCode}','{HType}','{HBarCode}','{(HCount == "" ? " 0" : HCount)}','{HCreateTime}','{HDate}','{HResult_TechParam}','{HProcNumber}','{HFlag}')"; |
| | | oCN.RunProc(sql); |
| | | //ListSelect.Items.Add("条码:" + HBarCode + ",日期:" + HCreateTime + ",结果:" + HResult); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | this.HTakeSampleCheckBillNo = new System.Windows.Forms.Label(); |
| | | this.HTakeSampleCheckBillID = new System.Windows.Forms.Label(); |
| | | this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog(); |
| | | this.txtHMaker = new System.Windows.Forms.TextBox(); |
| | | this.label6 = new System.Windows.Forms.Label(); |
| | | this.txtHMakerNumber = new System.Windows.Forms.TextBox(); |
| | | this.label5 = new System.Windows.Forms.Label(); |
| | | this.labHMakerID = new System.Windows.Forms.Label(); |
| | | this.SuspendLayout(); |
| | | // |
| | | // label1 |
| | | // |
| | | this.label1.AutoSize = true; |
| | | this.label1.Location = new System.Drawing.Point(29, 34); |
| | | this.label1.Location = new System.Drawing.Point(29, 86); |
| | | this.label1.Name = "label1"; |
| | | this.label1.Size = new System.Drawing.Size(89, 18); |
| | | this.label1.TabIndex = 0; |
| | |
| | | "首件检验单", |
| | | "工序检验单", |
| | | "巡检检验单"}); |
| | | this.cmbJYSelect.Location = new System.Drawing.Point(124, 30); |
| | | this.cmbJYSelect.Location = new System.Drawing.Point(124, 82); |
| | | this.cmbJYSelect.Name = "cmbJYSelect"; |
| | | this.cmbJYSelect.Size = new System.Drawing.Size(121, 26); |
| | | this.cmbJYSelect.TabIndex = 1; |
| | |
| | | // label2 |
| | | // |
| | | this.label2.AutoSize = true; |
| | | this.label2.Location = new System.Drawing.Point(521, 34); |
| | | this.label2.Location = new System.Drawing.Point(521, 86); |
| | | this.label2.Name = "label2"; |
| | | this.label2.Size = new System.Drawing.Size(71, 18); |
| | | this.label2.TabIndex = 2; |
| | | this.label2.Text = "流转卡:"; |
| | | this.label2.Text = "取样单:"; |
| | | // |
| | | // txtLzk |
| | | // |
| | | this.txtLzk.Location = new System.Drawing.Point(599, 29); |
| | | this.txtLzk.Location = new System.Drawing.Point(599, 81); |
| | | this.txtLzk.Name = "txtLzk"; |
| | | this.txtLzk.Size = new System.Drawing.Size(194, 28); |
| | | this.txtLzk.TabIndex = 3; |
| | |
| | | // |
| | | // txtPcm |
| | | // |
| | | this.txtPcm.Location = new System.Drawing.Point(867, 29); |
| | | this.txtPcm.Location = new System.Drawing.Point(867, 81); |
| | | this.txtPcm.Name = "txtPcm"; |
| | | this.txtPcm.Size = new System.Drawing.Size(100, 28); |
| | | this.txtPcm.TabIndex = 4; |
| | |
| | | // label3 |
| | | // |
| | | this.label3.AutoSize = true; |
| | | this.label3.Location = new System.Drawing.Point(799, 34); |
| | | this.label3.Location = new System.Drawing.Point(799, 86); |
| | | this.label3.Name = "label3"; |
| | | this.label3.Size = new System.Drawing.Size(71, 18); |
| | | this.label3.TabIndex = 5; |
| | |
| | | // |
| | | // btnLj |
| | | // |
| | | this.btnLj.Location = new System.Drawing.Point(779, 85); |
| | | this.btnLj.Location = new System.Drawing.Point(779, 137); |
| | | this.btnLj.Name = "btnLj"; |
| | | this.btnLj.Size = new System.Drawing.Size(115, 42); |
| | | this.btnLj.TabIndex = 6; |
| | |
| | | // |
| | | // txtLj |
| | | // |
| | | this.txtLj.Location = new System.Drawing.Point(124, 94); |
| | | this.txtLj.Location = new System.Drawing.Point(124, 146); |
| | | this.txtLj.Name = "txtLj"; |
| | | this.txtLj.Size = new System.Drawing.Size(637, 28); |
| | | this.txtLj.TabIndex = 7; |
| | |
| | | // label4 |
| | | // |
| | | this.label4.AutoSize = true; |
| | | this.label4.Location = new System.Drawing.Point(52, 97); |
| | | this.label4.Location = new System.Drawing.Point(52, 149); |
| | | this.label4.Name = "label4"; |
| | | this.label4.Size = new System.Drawing.Size(53, 18); |
| | | this.label4.TabIndex = 8; |
| | |
| | | // |
| | | this.ListData.FormattingEnabled = true; |
| | | this.ListData.ItemHeight = 18; |
| | | this.ListData.Location = new System.Drawing.Point(49, 158); |
| | | this.ListData.Location = new System.Drawing.Point(55, 198); |
| | | this.ListData.Name = "ListData"; |
| | | this.ListData.Size = new System.Drawing.Size(952, 346); |
| | | this.ListData.TabIndex = 9; |
| | | // |
| | | // btnSave |
| | | // |
| | | this.btnSave.Location = new System.Drawing.Point(900, 85); |
| | | this.btnSave.Location = new System.Drawing.Point(900, 137); |
| | | this.btnSave.Name = "btnSave"; |
| | | this.btnSave.Size = new System.Drawing.Size(63, 42); |
| | | this.btnSave.TabIndex = 10; |
| | |
| | | // cmbPro |
| | | // |
| | | this.cmbPro.FormattingEnabled = true; |
| | | this.cmbPro.Location = new System.Drawing.Point(339, 30); |
| | | this.cmbPro.Location = new System.Drawing.Point(339, 82); |
| | | this.cmbPro.Name = "cmbPro"; |
| | | this.cmbPro.Size = new System.Drawing.Size(156, 26); |
| | | this.cmbPro.TabIndex = 12; |
| | |
| | | // txtPro |
| | | // |
| | | this.txtPro.AutoSize = true; |
| | | this.txtPro.Location = new System.Drawing.Point(280, 34); |
| | | this.txtPro.Location = new System.Drawing.Point(280, 86); |
| | | this.txtPro.Name = "txtPro"; |
| | | this.txtPro.Size = new System.Drawing.Size(53, 18); |
| | | this.txtPro.TabIndex = 11; |
| | |
| | | // HTakeSampleCheckBillNo |
| | | // |
| | | this.HTakeSampleCheckBillNo.AutoSize = true; |
| | | this.HTakeSampleCheckBillNo.Location = new System.Drawing.Point(32, 76); |
| | | this.HTakeSampleCheckBillNo.Location = new System.Drawing.Point(32, 128); |
| | | this.HTakeSampleCheckBillNo.Name = "HTakeSampleCheckBillNo"; |
| | | this.HTakeSampleCheckBillNo.Size = new System.Drawing.Size(206, 18); |
| | | this.HTakeSampleCheckBillNo.TabIndex = 13; |
| | |
| | | // HTakeSampleCheckBillID |
| | | // |
| | | this.HTakeSampleCheckBillID.AutoSize = true; |
| | | this.HTakeSampleCheckBillID.Location = new System.Drawing.Point(258, 73); |
| | | this.HTakeSampleCheckBillID.Location = new System.Drawing.Point(258, 125); |
| | | this.HTakeSampleCheckBillID.Name = "HTakeSampleCheckBillID"; |
| | | this.HTakeSampleCheckBillID.Size = new System.Drawing.Size(206, 18); |
| | | this.HTakeSampleCheckBillID.TabIndex = 14; |
| | | this.HTakeSampleCheckBillID.Text = "HTakeSampleCheckBillID"; |
| | | this.HTakeSampleCheckBillID.Visible = false; |
| | | // |
| | | // txtHMaker |
| | | // |
| | | this.txtHMaker.Location = new System.Drawing.Point(124, 26); |
| | | this.txtHMaker.Name = "txtHMaker"; |
| | | this.txtHMaker.Size = new System.Drawing.Size(170, 28); |
| | | this.txtHMaker.TabIndex = 2; |
| | | this.txtHMaker.Enter += new System.EventHandler(this.txtHMaker_Enter); |
| | | this.txtHMaker.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtHMaker_KeyDown); |
| | | this.txtHMaker.Leave += new System.EventHandler(this.txtHMaker_Leave); |
| | | // |
| | | // label6 |
| | | // |
| | | this.label6.AutoSize = true; |
| | | this.label6.Location = new System.Drawing.Point(46, 31); |
| | | this.label6.Name = "label6"; |
| | | this.label6.Size = new System.Drawing.Size(71, 18); |
| | | this.label6.TabIndex = 15; |
| | | this.label6.Text = "制单人:"; |
| | | // |
| | | // txtHMakerNumber |
| | | // |
| | | this.txtHMakerNumber.Location = new System.Drawing.Point(401, 26); |
| | | this.txtHMakerNumber.Name = "txtHMakerNumber"; |
| | | this.txtHMakerNumber.Size = new System.Drawing.Size(170, 28); |
| | | this.txtHMakerNumber.TabIndex = 18; |
| | | // |
| | | // label5 |
| | | // |
| | | this.label5.AutoSize = true; |
| | | this.label5.Location = new System.Drawing.Point(323, 31); |
| | | this.label5.Name = "label5"; |
| | | this.label5.Size = new System.Drawing.Size(53, 18); |
| | | this.label5.TabIndex = 17; |
| | | this.label5.Text = "编码:"; |
| | | // |
| | | // labHMakerID |
| | | // |
| | | this.labHMakerID.AutoSize = true; |
| | | this.labHMakerID.Location = new System.Drawing.Point(596, 29); |
| | | this.labHMakerID.Name = "labHMakerID"; |
| | | this.labHMakerID.Size = new System.Drawing.Size(107, 18); |
| | | this.labHMakerID.TabIndex = 19; |
| | | this.labHMakerID.Text = "labHMakerID"; |
| | | this.labHMakerID.Visible = false; |
| | | // |
| | | // ReadCoordinateExcelFrom |
| | | // |
| | | this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F); |
| | | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; |
| | | this.ClientSize = new System.Drawing.Size(1033, 538); |
| | | this.ClientSize = new System.Drawing.Size(1033, 565); |
| | | this.Controls.Add(this.labHMakerID); |
| | | this.Controls.Add(this.txtHMakerNumber); |
| | | this.Controls.Add(this.label5); |
| | | this.Controls.Add(this.txtHMaker); |
| | | this.Controls.Add(this.label6); |
| | | this.Controls.Add(this.HTakeSampleCheckBillID); |
| | | this.Controls.Add(this.HTakeSampleCheckBillNo); |
| | | this.Controls.Add(this.cmbPro); |
| | |
| | | private System.Windows.Forms.Label HTakeSampleCheckBillNo; |
| | | private System.Windows.Forms.Label HTakeSampleCheckBillID; |
| | | private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1; |
| | | private System.Windows.Forms.TextBox txtHMaker; |
| | | private System.Windows.Forms.Label label6; |
| | | private System.Windows.Forms.TextBox txtHMakerNumber; |
| | | private System.Windows.Forms.Label label5; |
| | | private System.Windows.Forms.Label labHMakerID; |
| | | } |
| | | } |
| | |
| | | using NPOI.XSSF.UserModel; // 对于.xlsx文件 |
| | | using NPOI.HSSF.UserModel; // 对于.xls文件 |
| | | using System.Collections.Generic; |
| | | using System.Runtime.InteropServices; |
| | | using System.Drawing; |
| | | |
| | | namespace WFormReadData_SMR |
| | | { |
| | |
| | | //路径只读 |
| | | this.txtLj.ReadOnly = true; |
| | | this.txtPcm.ReadOnly = true; |
| | | //制单编码只读 |
| | | this.txtHMakerNumber.ReadOnly = true; |
| | | //制单人提示 |
| | | this.txtHMaker.ForeColor = Color.LightGray; |
| | | this.txtHMaker.Text = "请输入用户编码!"; |
| | | SelectHProList(); |
| | | } |
| | | |
| | |
| | | MessageBox.Show("流转卡没有扫描!"); |
| | | } |
| | | else { |
| | | |
| | | //路径赋值给文本 |
| | | using (FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog()) |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | //显示数据 |
| | | ShowData(ds); |
| | | //显示数据 CMR-L-066 轮廓仪 |
| | | ShowData(ds, "CMR-L-066"); |
| | | } |
| | | |
| | | //根据文件路径找到对应文件 并获取对应的数据 |
| | |
| | | } |
| | | } |
| | | } |
| | | //显示数据 |
| | | ShowData(ds); |
| | | //显示数据 CMR-L-067 三坐标 |
| | | ShowData(ds, "CMR-L-067"); |
| | | } |
| | | |
| | | //根据文件路径找到对应文件 并获取对应的数据 |
| | |
| | | } |
| | | |
| | | //把数据显示在页面上 |
| | | public void ShowData(DataSet ds) { |
| | | public void ShowData(DataSet ds,string HNumber) { |
| | | //清空网格内容 |
| | | ListData.Items.Clear(); |
| | | //清空表格内容 |
| | |
| | | dataTable.Columns.Add("Actual"); |
| | | dataTable.Columns.Add("HUpLimit"); |
| | | dataTable.Columns.Add("HDownLimit"); |
| | | dataTable.Columns.Add("HInspectInstruMentID"); |
| | | |
| | | for (int i = 0; i < ds.Tables.Count; i++) |
| | | { |
| | | //修改是在哪个设备上进行的数据采集 b.HInspectInstruMentID=1 三坐标1 轮廓仪2 |
| | | DataSet dataSet = oCN.RunProcReturn(@"select a.HInterID HQCSchemeID,b.HQCCheckItemID, ch.HNumber HQCCheckItemNumber,m.HNumber,HUpLimit,HDownLimit,HTargetVal |
| | | DataSet dataSet = oCN.RunProcReturn(@"select b.HInspectInstruMentID,a.HInterID HQCSchemeID,b.HQCCheckItemID, ch.HNumber HQCCheckItemNumber,m.HNumber,HUpLimit,HDownLimit,HTargetVal |
| | | from Sc_ProcessExchangeBillMain pr with(nolock) |
| | | inner join Gy_QCCheckProjectMain a with(nolock) on pr.HMaterID=a.HMaterID |
| | | inner join Gy_QCCheckProjectSub b with(nolock) on a.HInterID=b.HInterID and b.HInspectInstruMentID=1 |
| | | inner join Gy_QCCheckProjectSub b with(nolock) on a.HInterID=b.HInterID |
| | | inner join Gy_InspectInstruMent men with(nolock) on b.HInspectInstruMentID=men.HItemID and men.HNumber='"+ HNumber + @"' |
| | | left join Gy_Material m with(nolock) on a.HMaterID=m.HItemID |
| | | left join Gy_QCCheckItem ch with(nolock) on b.HQCCheckItemID=ch.HItemID |
| | | where pr.HBillNo='" + this.txtLzk.Text + "'", "Gy_QCCheckProjectMain"); |
| | |
| | | dr["Actual"] = ds.Tables[i].Rows[k]["Actual"].ToString(); |
| | | dr["HUpLimit"] = dataSet.Tables[0].Rows[j]["HUpLimit"].ToString(); |
| | | dr["HDownLimit"] = dataSet.Tables[0].Rows[j]["HDownLimit"].ToString(); |
| | | dr["HInspectInstruMentID"] = dataSet.Tables[0].Rows[j]["HInspectInstruMentID"].ToString(); |
| | | ListData.Items.Add("检验项目:" + ds.Tables[i].Rows[k]["Characteristic"].ToString() + ",实测值:" + ds.Tables[i].Rows[k]["Actual"].ToString() + ",上公差:" + dataSet.Tables[0].Rows[j]["HUpLimit"].ToString() + ",下公差:" + dataSet.Tables[0].Rows[j]["HDownLimit"].ToString()); |
| | | break; |
| | | } |
| | |
| | | ",getdate(),0,''," + HProcExchInterID + |
| | | "," + HProcExchEntryID + ",'" + HProcExchBillNo + "','',0,0" + |
| | | "," + dataTable.Rows[i]["CharacteristicID"].ToString() + ",'" + dataTable.Rows[i]["HQCStd"].ToString() + "','','"+ dataTable.Rows[i]["HQCStd"].ToString() + "','" + HLastResult + "'" + |
| | | ",'" + dataTable.Rows[i]["HUpLimit"].ToString() + "','" + dataTable.Rows[i]["HDownLimit"].ToString() + "',''" + ",0,0,0,0,0,0,'',0,'" + dataTable.Rows[i]["Actual"].ToString() + "','" + dataTable.Rows[i]["HQCStd"].ToString() + "','" + dataTable.Rows[i]["HUpLimit"].ToString() + "','" + dataTable.Rows[i]["HDownLimit"].ToString() + "','','',0,'1',0,'"+ HLastResult + "'" + |
| | | ",'" + dataTable.Rows[i]["HUpLimit"].ToString() + "','" + dataTable.Rows[i]["HDownLimit"].ToString() + "',''" + ",0,0,0,0,0,0,'',0,'" + dataTable.Rows[i]["Actual"].ToString() + "','" + dataTable.Rows[i]["HQCStd"].ToString() + "','" + dataTable.Rows[i]["HUpLimit"].ToString() + "','" + dataTable.Rows[i]["HDownLimit"].ToString() + "','','',0,'2'," + dataTable.Rows[i]["HInspectInstruMentID"].ToString() + ",'" + HLastResult + "'" + |
| | | ") "); |
| | | } |
| | | |
| | | |
| | | //主表 |
| | | oCN.RunProc("Insert Into QC_FirstPieceCheckBillMain " + |
| | | "(HBillType,HBillSubType,HInterID,HBillNo,HBillStatus,HDate,HMaker,HMakeDate" + |
| | |
| | | ",HProcExchBillNo,HProcExchQty,HMaterID,HFirstCheckEmp,HLastResult" + |
| | | ",HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType,HICMOEntryID,HQCSchemeID,HShiftsID,HErrTreatment" + |
| | | ",HTakeSampleCheckBillID,HTakeSampleCheckBillNo,HProcID" + |
| | | ") " + |
| | | " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "',1,getdate(),'',getdate()" + |
| | | ",HBatchNo) " + |
| | | " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "',1,getdate(),'" + this.txtHMaker.Text + "',getdate()" + |
| | | "," + DateTime.Now.Year + "," + DateTime.Now.Month + ",''" + |
| | | "," + HSourceID + "," + HICMOInterID + ",'" + HICMOBillNo + "'," + HPlanQty + "," + HProcExchInterID + "," + HProcExchEntryID + |
| | | ",'" + HProcExchBillNo + "'," + HQty + "," + HMaterID + ",'', " + HLastResults + |
| | | ",'" + HProcExchBillNo + "'," + HQty + "," + HMaterID + ",'"+this.labHMakerID.Text + "', " + HLastResults + |
| | | "," + HProcExchInterID + "," + HProcExchEntryID + ",'" + HProcExchBillNo + "',''," + HICMOEntryID + "," + HQCSchemeID + ",0,''" + |
| | | "," + this.HTakeSampleCheckBillID.Text + ",'" + this.HTakeSampleCheckBillNo.Text + "',"+ HProcID + ") "); |
| | | "," + this.HTakeSampleCheckBillID.Text + ",'" + this.HTakeSampleCheckBillNo.Text + "'," + HProcID + "" + |
| | | ",'" + this.txtPcm.Text + "') "); |
| | | |
| | | oCN.Commit(); |
| | | |
| | |
| | | + HInterID + ",'" + HBillNo + "'," + (i + 1) + ",''" + |
| | | ",getdate(),0,''," + HProcExchInterID + |
| | | "," + HProcExchEntryID + ",'" + HProcExchBillNo + "','',0,0," + dataTable.Rows[i]["CharacteristicID"].ToString() + ",'" + dataTable.Rows[i]["HQCStd"].ToString() + "','','"+ dataTable.Rows[i]["HQCStd"].ToString() + "','" + HLastResult + "'" + |
| | | ",'" + dataTable.Rows[i]["HUpLimit"].ToString() + "','" + dataTable.Rows[i]["HDownLimit"].ToString() + "',''" + ",0,0,0,0,0,0,'',0,'" + dataTable.Rows[i]["Actual"].ToString() + "','" + dataTable.Rows[i]["HQCStd"].ToString() + "','" + dataTable.Rows[i]["HUpLimit"].ToString() + "','" + dataTable.Rows[i]["HDownLimit"].ToString() + "','','',0,'1',0,'"+ HLastResult + "'" + ") "); |
| | | ",'" + dataTable.Rows[i]["HUpLimit"].ToString() + "','" + dataTable.Rows[i]["HDownLimit"].ToString() + "',''" + ",0,0,0,0,0,0,'',0,'" + dataTable.Rows[i]["Actual"].ToString() + "','" + dataTable.Rows[i]["HQCStd"].ToString() + "','" + dataTable.Rows[i]["HUpLimit"].ToString() + "','" + dataTable.Rows[i]["HDownLimit"].ToString() + "','','',0,'2'," + dataTable.Rows[i]["HInspectInstruMentID"].ToString() + ",'" + HLastResult + "'" + ") "); |
| | | } |
| | | |
| | | //主表 |
| | |
| | | ",HSourceID,HICMOInterID,HICMOBillNo,HICMOQty,HProcExchInterID,HProcExchEntryID" + |
| | | ",HProcExchBillNo,HProcExchQty,HMaterID,HFirstCheckEmp,HLastResult" + |
| | | ",HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType,HICMOEntryID,HQCSchemeID,HShiftsID,HErrTreatment" + |
| | | ",HTakeSampleCheckBillID,HTakeSampleCheckBillNo,HProcID) " + |
| | | " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "',1,getdate(),'',getdate()" + |
| | | ",HTakeSampleCheckBillID,HTakeSampleCheckBillNo,HProcID,HBatchNo) " + |
| | | " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "',1,getdate(),'"+this.txtHMaker.Text + "',getdate()" + |
| | | "," + DateTime.Now.Year + "," + DateTime.Now.Month + ",''" + |
| | | "," + HSourceID + "," + HICMOInterID + ",'" + HICMOBillNo + "'," + HPlanQty + "," + HProcExchInterID + "," + HProcExchEntryID + |
| | | ",'" + HProcExchBillNo + "'," + HQty + "," + HMaterID + ",'', " + HLastResults + |
| | | ",'" + HProcExchBillNo + "'," + HQty + "," + HMaterID + ",'" + this.labHMakerID.Text + "', " + HLastResults + |
| | | "," + HProcExchInterID + "," + HProcExchEntryID + ",'" + HProcExchBillNo + "',''," + HICMOEntryID + "," + HQCSchemeID + ",0,''" + |
| | | "," + this.HTakeSampleCheckBillID.Text + ",'" + this.HTakeSampleCheckBillNo.Text + "',"+ HProcID + ") "); |
| | | "," + this.HTakeSampleCheckBillID.Text + ",'" + this.HTakeSampleCheckBillNo.Text + "',"+ HProcID + ",'" + this.txtPcm.Text + "') "); |
| | | |
| | | oCN.Commit(); |
| | | |
| | |
| | | ",getdate(),0,''," + HProcExchInterID + |
| | | "," + HProcExchEntryID + ",'" + HProcExchBillNo + "','',0,0,0," + dataTable.Rows[i]["CharacteristicID"].ToString() + ",'" + dataTable.Rows[i]["HQCStd"].ToString() + "','','" + HLastResult + "'" + |
| | | ",0,'',0,0,0,0,0,0,'',0,'" + dataTable.Rows[i]["Actual"].ToString() + "','" + dataTable.Rows[i]["HQCStd"].ToString() + "','" + dataTable.Rows[i]["HUpLimit"].ToString() + "','" + dataTable.Rows[i]["HDownLimit"].ToString() + |
| | | "','','',0,'',0,'"+ HLastResult + "'" + |
| | | "','','',0,'2'," + dataTable.Rows[i]["HInspectInstruMentID"].ToString() + ",'" + HLastResult + "'" + |
| | | ",'"+ dataTable.Rows[i]["HQCStd"].ToString() + "') "); |
| | | } |
| | | |
| | |
| | | ",HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType,HICMOEntryID,HQCSchemeID,HICMOQty" + |
| | | ",HProcExchQty,HShiftsID,HErrTreatment" + |
| | | ",HTakeSampleCheckBillID,HTakeSampleCheckBillNo" + |
| | | ") " + |
| | | " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "',1,getdate(),'',getdate()" + |
| | | ",HBatchNo) " + |
| | | " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "',1,getdate(),'" + this.txtHMaker.Text + "',getdate()" + |
| | | "," + DateTime.Now.Year + "," + DateTime.Now.Month + ",''" + |
| | | "," + HICMOInterID + ",'" + HICMOBillNo + "'," + HProcExchInterID + "," + HProcExchEntryID + ",'" + HProcExchBillNo + "'" + |
| | | "," + HMaterID + "," + HProcID + "," + HSourceID + ",0,0,0,0,0,0,'" + HLastResults + "'" + |
| | | "," + HMaterID + "," + HProcID + "," + HSourceID + ",0,0,0,0,0," + this.labHMakerID.Text + ",'" + HLastResults + "'" + |
| | | ",'','',0,'',''" + |
| | | ",0,0,'',0,0,0,0,'',0," + HProcExchInterID + "," + HProcExchEntryID + ",'" + HProcExchBillNo + "',''," + HICMOEntryID + "," + HQCSchemeID + "," + HPlanQty + "," + HQty + ",0,''" + |
| | | "," + this.HTakeSampleCheckBillID.Text + ",'" + this.HTakeSampleCheckBillNo.Text + "') "); |
| | | "," + this.HTakeSampleCheckBillID.Text + ",'" + this.HTakeSampleCheckBillNo.Text + "'" + |
| | | ",'" + this.txtPcm.Text + "') "); |
| | | |
| | | |
| | | oCN.Commit(); |
| | |
| | | { |
| | | if (e.KeyCode == Keys.Enter) |
| | | { |
| | | SelectHBardCode(this.txtLzk.Text); |
| | | if (this.txtHMakerNumber.Text == "") |
| | | { |
| | | MessageBox.Show("请输入制单人信息!"); |
| | | } |
| | | else { |
| | | SelectHBardCode(this.txtLzk.Text); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | try |
| | | { |
| | | string cmbPro = this.cmbPro.SelectedValue.ToString(); |
| | | DataSet ds = oCN.RunProcReturn("select * from h_v_Sc_ProcessExchangeBillQuerySub where 单据号='" + HBillNo + "' and HProcID='"+ cmbPro + "'", "h_v_Sc_ProcessExchangeBillQuerySub"); |
| | | |
| | | DataSet ds = oCN.RunProcReturn("select * from h_v_QC_TakeSampleCheckBillList where 单据号='" + HBillNo + "' and HProcID='" + cmbPro + "'", "h_v_QC_TakeSampleCheckBillList"); |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_QC_TakeSampleCheckBillList where 单据号='" + HBillNo + "' and HProcID='" + cmbPro + "'", "h_v_QC_TakeSampleCheckBillList"); |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | MessageBox.Show("当前工序对应的单据,查无数据!"); |
| | | } |
| | | else |
| | | { |
| | | string HProjectNum = ds.Tables[0].Rows[0]["HProjectNum"].ToString(); |
| | | this.txtPcm.Text = HProjectNum.Split('-')[0]; |
| | | this.txtLzk.Text = ds.Tables[0].Rows[0]["工序流转卡号"].ToString(); |
| | | this.HTakeSampleCheckBillID.Text = ds.Tables[0].Rows[0]["hmainid"].ToString(); |
| | | this.HTakeSampleCheckBillNo.Text = ds.Tables[0].Rows[0]["单据号"].ToString(); |
| | | this.txtLzk.ReadOnly = true; |
| | | } |
| | | MessageBox.Show("当前工序对应的取样单据,查无数据!"); |
| | | } |
| | | else |
| | | { |
| | | string HProjectNum = ds.Tables[0].Rows[0]["HProjectNum"].ToString(); |
| | | this.txtPcm.Text = HProjectNum.Split('-')[0]; |
| | | this.HTakeSampleCheckBillID.Text = "0"; |
| | | this.HTakeSampleCheckBillNo.Text = ""; |
| | | this.txtLzk.Text = ds.Tables[0].Rows[0]["工序流转卡号"].ToString(); |
| | | this.HTakeSampleCheckBillID.Text = ds.Tables[0].Rows[0]["hmainid"].ToString(); |
| | | this.HTakeSampleCheckBillNo.Text = ds.Tables[0].Rows[0]["单据号"].ToString(); |
| | | this.txtLzk.ReadOnly = true; |
| | | this.label2.Text = "流转卡:"; |
| | | } |
| | | |
| | | //DataSet ds = oCN.RunProcReturn("select * from h_v_Sc_ProcessExchangeBillQuerySub where 单据号='" + HBillNo + "' and HProcID='"+ cmbPro + "'", "h_v_Sc_ProcessExchangeBillQuerySub"); |
| | | //if (ds.Tables[0].Rows.Count == 0) |
| | | //{ |
| | | |
| | | //} |
| | | //else |
| | | //{ |
| | | // string HProjectNum = ds.Tables[0].Rows[0]["HProjectNum"].ToString(); |
| | | // this.txtPcm.Text = HProjectNum.Split('-')[0]; |
| | | // this.HTakeSampleCheckBillID.Text = "0"; |
| | | // this.HTakeSampleCheckBillNo.Text = ""; |
| | | // this.txtLzk.ReadOnly = true; |
| | | //} |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | |
| | | private void ReadCoordinateExcelFrom_Activated(object sender, EventArgs e) |
| | | { |
| | | //光标选中流转卡 |
| | | this.txtLzk.Focus(); |
| | | //光标选中制单人 |
| | | this.txtHMaker.Focus(); |
| | | } |
| | | |
| | | private void ReadCoordinateExcelFrom_FormClosing(object sender, FormClosingEventArgs e) |
| | |
| | | e.Cancel = true; |
| | | } |
| | | } |
| | | |
| | | private void txtHMaker_Leave(object sender, EventArgs e) |
| | | { |
| | | if (string.IsNullOrWhiteSpace(txtHMaker.Text)) |
| | | { |
| | | this.txtHMaker.ForeColor = Color.LightGray; |
| | | txtHMaker.Text = "请输入用户编码!"; |
| | | } |
| | | } |
| | | |
| | | private void txtHMaker_Enter(object sender, EventArgs e) |
| | | { |
| | | if (txtHMaker.Text.Trim() == "请输入用户编码!") |
| | | { |
| | | txtHMaker.Text = ""; |
| | | this.txtHMaker.ForeColor = Color.Black; |
| | | } |
| | | } |
| | | |
| | | private void txtHMaker_KeyDown(object sender, KeyEventArgs e) |
| | | { |
| | | if (e.KeyCode == Keys.Enter) |
| | | { |
| | | SelectHMaker(this.txtHMaker.Text); |
| | | } |
| | | |
| | | } |
| | | |
| | | //查询职员信息 |
| | | public void SelectHMaker(string txtHMaker) { |
| | | try |
| | | { |
| | | DataSet ds = oCN.RunProcReturn("select HItemID,HName,HNumber from Gy_Employee where HNumber='" + txtHMaker + "' or HName ='" + txtHMaker + "'", "Gy_Employee"); |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | string HName = ds.Tables[0].Rows[0]["HName"].ToString(); |
| | | string HMakerID = ds.Tables[0].Rows[0]["HItemID"].ToString(); |
| | | string HNumber = ds.Tables[0].Rows[0]["HNumber"].ToString(); |
| | | this.txtHMaker.Text = HName; |
| | | this.txtHMakerNumber.Text = HNumber; |
| | | this.labHMakerID.Text = HMakerID; |
| | | this.txtHMaker.ReadOnly = true; |
| | | } |
| | | else |
| | | { |
| | | MessageBox.Show(this, txtHMaker + ",查无数据,可能是输入编码有误!", "提示"); |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | MessageBox.Show(this, e.Message, "提示"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | E:\智云mes\SRM\WFormSynchronizeData_SMR\WFormSynchronizeData_SMR\WFormReadData_SMR\bin\Debug\NPOI.OpenXml4Net.pdb |
| | | E:\智云mes\SRM\WFormSynchronizeData_SMR\WFormSynchronizeData_SMR\WFormReadData_SMR\bin\Debug\NPOI.OpenXml4Net.xml |
| | | E:\智云mes\SRM\WFormSynchronizeData_SMR\WFormSynchronizeData_SMR\WFormReadData_SMR\bin\Debug\NPOI.OpenXmlFormats.pdb |
| | | E:\智云mes\SRM\WFormSynchronizeData_SMR\WFormSynchronizeData_SMR\WFormReadData_SMR\obj\Debug\WFormReadData_SMR.csproj.AssemblyReference.cache |
| | | E:\智云mes\SRM\WFormSynchronizeData_SMR\WFormSynchronizeData_SMR\WFormReadData_SMR\obj\Debug\WFormReadData_SMR.Properties.Resources.resources |
| | | E:\智云mes\SRM\WFormSynchronizeData_SMR\WFormSynchronizeData_SMR\WFormReadData_SMR\obj\Debug\WFormReadData_SMR.ReadCoordinateExcelFrom.resources |
| | | E:\智云mes\SRM\WFormSynchronizeData_SMR\WFormSynchronizeData_SMR\WFormReadData_SMR\obj\Debug\WFormReadData_SMR.ReadCSV.resources |
| | |
| | | //判断这个条码之前的状态是否为NG |
| | | DataSet ds = oCN.RunProcReturn(@"select * from Sb_EquipMentCollection_SN WITH(NOLOCK) where HBarCode='" + HBadCodeSN + "' and HCreateTime<'" + dic["HCreateTime"].ToString() + "' and HResult='NG'", "Sb_EquipMentCollection_SN"); |
| | | |
| | | //查询出站单是否包含条码 |
| | | DataSet ds1 = oCN.RunProcReturn(@"select a.HSourceID,a.HProcID,* from Sc_StationOutBillMain a WITH(NOLOCK) |
| | | inner join Sc_StationOutBillSub_SN sn WITH(NOLOCK) on a.HInterID=sn.HInterID |
| | | left join Gy_Source s WITH(NOLOCK) on a.HSourceID=s.HItemID |
| | |
| | | //查询职员 |
| | | ds = oCN.RunProcReturn("select * from Gy_Employee WITH(NOLOCK) where HNumber='" + dic["HEmpCode"].ToString() + "' ", "Gy_Employee"); |
| | | long HEmpIDs = 0; |
| | | string HEmpName = ""; |
| | | if (ds.Tables[0].Rows.Count != 0) |
| | | { |
| | | HEmpIDs = long.Parse(ds.Tables[0].Rows[0]["HItemID"].ToString());//职员ID |
| | | HEmpName = ds.Tables[0].Rows[0]["HName"].ToString(); |
| | | } |
| | | |
| | | long HDeptID = 0; |
| | |
| | | string HBillSubType = "3791"; |
| | | |
| | | int HBillStatus = 1; |
| | | string HMaker = "";//制单人 |
| | | string HMaker = HEmpName;//制单人 |
| | | string HMouldNum = "";//模穴号 |
| | | int HYear = DateTime.Now.Year; |
| | | double HPeriod = DateTime.Now.Month; |
| | |
| | | CustomWriteLog("条码:" + HBadCodeSN + "工序:"+ HProcNumber + ",出站时间:" + HMakeTime, "TM" + DateTime.Now.ToString("yyyy-MM-dd")); |
| | | |
| | | //反写工序出站单的合格数量 |
| | | oCN.RunProc("update Sc_StationOutBillMain set HQty+=1,HBadCount-=1 where HInterID='" + HInterID + "'"); |
| | | //oCN.RunProc("update Sc_StationOutBillMain set HQty+=1,HBadCount-=1 where HInterID='" + HInterID + "'"); |
| | | oCN.RunProc("update Sc_StationOutBillMain set HQty+=1 where HInterID='" + HInterID + "'"); |
| | | //反写条码状态 |
| | | oCN.RunProc("update Gy_BarCodeBill set HStatus='' where HBarCode='" + HBadCodeSN + "'"); |
| | | } |
| | |
| | | { |
| | | |
| | | |
| | | DataSet ds = oCN.RunProcReturn("select * from Sc_StationOutBillMain WITH(NOLOCK) where HInterID=" + HInterID + " and HBillNo='" + HBillNo + "'", "Sc_StationOutBillMain"); |
| | | DataSet ds = oCN.RunProcReturn(@"select a.HProcExchInterID,a.HProcExchEntryID,a.HProcExchBillNo,a.HProcID,p.HNumber from Sc_StationOutBillMain a WITH(NOLOCK) |
| | | left join Gy_Process p WITH(NOLOCK) on a.HProcID=p.HItemID where HInterID=" + HInterID + " and HBillNo='" + HBillNo + "'", "Sc_StationOutBillMain"); |
| | | string HProcExchInterID = ds.Tables[0].Rows[0]["HProcExchInterID"].ToString(); |
| | | string HProcExchEntryID = ds.Tables[0].Rows[0]["HProcExchEntryID"].ToString(); |
| | | string HProcExchBillNo = ds.Tables[0].Rows[0]["HProcExchBillNo"].ToString(); |
| | | string HProcID = ds.Tables[0].Rows[0]["HProcID"].ToString(); |
| | | string HProcNum = ds.Tables[0].Rows[0]["HNumber"].ToString(); |
| | | //注:因为 组装 拍照 时间间隔比较短 所以目前只明确组装工序才可以保存工艺参数 之后如果有其他工序的话 需要增加工序字段 |
| | | if (HProcID == "88") { |
| | | ds = oCN.RunProcReturn(@"select s.HItemID HMouldID,t.HItemID HTechParamID,HCount,HCreateTime from Sb_EquipMentCollectionTechParam_SN a WITH(NOLOCK) |
| | | if (HProcID == "88"|| HProcNum=="005") { |
| | | ds = oCN.RunProcReturn(@"select s.HItemID HMouldID,t.HItemID HTechParamID,HCount,HCreateTime,a.HResult from Sb_EquipMentCollectionTechParam_SN a WITH(NOLOCK) |
| | | inner join Gy_Source s WITH(NOLOCK) on a.HSourceCode=s.HNumber |
| | | inner join Gy_TechnologyParameter t WITH(NOLOCK) on a.HType=t.HName |
| | | where a.HFlag=0 and a.HBarCode='" + HBadCodeSN + "'", "Sb_EquipMentCollectionTechParam_SN"); |
| | |
| | | string HTechParamID = ds.Tables[0].Rows[i]["HTechParamID"].ToString(); |
| | | string HCount = ds.Tables[0].Rows[i]["HCount"].ToString(); |
| | | string HGetTime = ds.Tables[0].Rows[i]["HCreateTime"].ToString(); |
| | | string HResult = ds.Tables[0].Rows[i]["HResult"].ToString(); |
| | | |
| | | DataSet dataSet = oCN.RunProcReturn("select * from Sc_StationOutBillSub_TechParam WITH(NOLOCK) where HInterID=" + HInterID + " and HBillNo_bak='" + HBillNo + "'", "Sc_StationOutBillSub_TechParam"); |
| | | |
| | | sql = "insert into Sc_StationOutBillSub_TechParam(HInterID,HBillNo_bak,HEntryID ,HSourceInterID,HSourceEntryID,HSourceBillNo,HTechParamID,HRelValue,HGetTime,HBarCode,HMouldID)" + |
| | | $"values({HInterID},'{HBillNo}',{(dataSet.Tables[0].Rows.Count + 1)},{HProcExchInterID},{HProcExchEntryID},'{HProcExchBillNo}',{HTechParamID},{HCount},'{HGetTime}','{HBadCodeSN}',{HMouldID})"; |
| | | sql = "insert into Sc_StationOutBillSub_TechParam(HInterID,HBillNo_bak,HEntryID ,HSourceInterID,HSourceEntryID,HSourceBillNo,HTechParamID,HRelValue,HGetTime,HBarCode,HMouldID,HRemark)" + |
| | | $"values({HInterID},'{HBillNo}',{(dataSet.Tables[0].Rows.Count + 1)},{HProcExchInterID},{HProcExchEntryID},'{HProcExchBillNo}',{HTechParamID},{HCount},'{HGetTime}','{HBadCodeSN}',{HMouldID},'{HResult}')"; |
| | | |
| | | oCN.RunProc(sql); |
| | | } |
| | |
| | | { |
| | | try |
| | | { |
| | | |
| | | DataSet ds = oCN.RunProcReturn(@"select * from Gy_BarCodeBill where HBarCode='" + HBadCodeSN + "'", "Gy_BarCodeBill"); |
| | | //判断条码是否存在条码档案 |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | string HSourceBillNo = ds.Tables[0].Rows[0]["HSourceBillNo"].ToString(); |
| | | DataSet dataTable = oCN.RunProcReturn(@"select * from Sc_ProcessExchangeBillMain where HBillNo='" + HSourceBillNo + "'", "Sc_ProcessExchangeBillMain"); |
| | | //判断条码的源单 流转卡是否被删除 |
| | | if (dataTable.Tables[0].Rows.Count == 0) |
| | | { |
| | | //如果源单已经删除 则条码也删除重新生成 |
| | | oCN.RunProc("delete from Gy_BarCodeBill where HBarCode='" + HBadCodeSN + "'"); |
| | | |
| | | //重新查询条码档案 进入新增方法 |
| | | ds = oCN.RunProcReturn(@"select * from Gy_BarCodeBill where HBarCode='" + HBadCodeSN + "'", "Gy_BarCodeBill"); |
| | | } |
| | | } |
| | | |
| | | //判断条码是否在数据库里 |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | //判断长度是否为29位 |
| | | //判断长度是否为29位 无尘车间 |
| | | if (HBadCodeSN.Length == 29) |
| | | { |
| | | string str1 = HBadCodeSN.Substring(18, 8); |
| | |
| | | CustomWriteLog("条码:" + HBadCodeSN + ",流转卡不存在!", DateTime.Now.ToString("yyyy-MM-dd")); |
| | | return 2; |
| | | } |
| | | } |
| | | } |
| | | //判断长度是否为50位 15车间 |
| | | else if (HBadCodeSN.Length == 50) |
| | | { |
| | | string str1 = HBadCodeSN.Substring(42, 8); |
| | | ds = oCN.RunProcReturn("select * from Sc_ProcessExchangeBillMain where HProjectNum like'" + str1 + "-1%'", "Sc_ProcessExchangeBillMain"); |
| | | //判断是否能找到对应的流转卡 |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | string HProcExchBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString(); |
| | | get_HBardBillSave(HBadCodeSN, HProcExchBillNo); |
| | | } |
| | | else |
| | | { |
| | | oCN.RollBack(); |
| | | CustomWriteLog("条码:" + HBadCodeSN + ",流转卡不存在!", DateTime.Now.ToString("yyyy-MM-dd")); |
| | | return 2; |
| | | } |
| | | } |
| | | else |
| | |
| | | //定时读取数据 |
| | | private void timer1_Tick(object sender, EventArgs e) |
| | | { |
| | | DataTable list = oCN.RunProcReturn("select * from Sb_EquipMentCollection_SN WITH(NOLOCK) where HFlag=0 order by HCreateTime", "Sb_EquipMentCollection_SN").Tables[0]; |
| | | DataTable list = oCN.RunProcReturn("select top 100 * from Sb_EquipMentCollection_SN WITH(NOLOCK) where HFlag=0 order by HCreateTime asc", "Sb_EquipMentCollection_SN").Tables[0]; |
| | | |
| | | //循环集合 |
| | | for (int i = 0; i < list.Rows.Count; i++) |
| | |
| | | string HResult = list.Rows[i]["HResult"].ToString(); |
| | | string HBadCodeSN = list.Rows[i]["HBarCode"].ToString(); |
| | | string HCreateTime = list.Rows[i]["HCreateTime"].ToString(); |
| | | |
| | | //HBadCodeSN = "P1099081-00-E:SDU324292189300"; |
| | | //HResult = "OK"; |
| | | //开始事务 |
| | | oCN.BeginTran(); |
| | | |
| | | if (HResult == "OK") |
| | | if (HResult == "OK") |
| | | { |
| | | flag = HResultOK(list.Rows[i]); |
| | | } |
New file |
| | |
| | | 2024/10/2 14:47:23 条码:AAA971538000000000@7000534480@24081600148@00003Z93,流转卡不存在! |
New file |
| | |
| | | 2024/10/22 11:27:13 条码:P1099081-00-E:SDU324292189300,流转卡不存在! |
New file |
| | |
| | | 2024/10/2 15:34:22 条码:AAA971538000000000@7000534480@24081600148@00003Z93工序:005,出站时间:2024/10/2 14:07:00 |
| | | |
| | | 2024/10/2 15:39:51 条码:AAA971538000000000@7000534480@24081600148@00003Z93工序:005,出站时间:2024/10/2 14:07:00 |
| | | |
| | | 2024/10/2 15:40:14 条码:AAA971538000000000@7000534480@24081600148@00003Z93工序:005,出站时间:2024/10/2 14:07:00 |
| | | |
| | | 2024/10/2 15:40:52 条码:AAA971538000000000@7000534480@24081600148@00003Z93工序:005,出站时间:2024/10/2 14:07:00 |
| | | |
| | | 2024/10/2 15:41:46 条码:AAA971538000000000@7000534480@24081600148@00003Z93工序:005,出站时间:2024/10/2 14:07:00 |
| | | |
| | | 2024/10/2 15:48:03 条码:AAA971538000000000@7000534480@24081600148@00003Z93工序:005,出站时间:2024/10/2 14:07:00 |
| | | |
| | | 2024/10/2 16:25:03 条码:AAA971538000000000@7000534480@24081600148@00003Z93工序:005,出站时间:2024/10/2 14:07:00 |
| | | |
| | | 2024/10/2 16:29:18 条码:AAA971538000000000@7000534480@24081600153@00003Z93工序:005,出站时间:2024/10/2 14:07:00 |
| | | |
| | | 2024/10/2 16:29:37 条码:AAA971538000000000@7000534480@24081600149@00003Z93工序:005,出站时间:2024/10/2 14:07:00 |
| | | |
| | | 2024/10/2 17:12:30 条码:AAA971538000000000@7000534480@24081600150@00003Z93工序:005,出站时间:2024/10/2 14:07:00 |
| | | |
| | | 2024/10/2 17:12:52 条码:AAA971538000000000@7000534480@24081600151@00003Z93工序:005,出站时间:2024/10/2 14:07:00 |
| | | |
| | | 2024/10/2 17:41:38 条码:AAA971538000000000@7000534480@24081600176@00003Z93工序:005,出站时间:2024/10/2 17:33:00 |
| | | |
| | | 2024/10/2 17:58:03 条码:AAA971538000000000@7000534480@24081600176@00003Z93工序:005,出站时间:2024/10/2 17:49:00 |
| | |
| | | <dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" /> |
| | | </dsig:Transforms> |
| | | <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" /> |
| | | <dsig:DigestValue>uZI4sKjHwUeWiuQrdLaXP7lIa632KPsHC9N2B7k0PtI=</dsig:DigestValue> |
| | | <dsig:DigestValue>bVguW12HBlVMcR5UEGU4s7byOkXtf/f99RtiXyEXIsQ=</dsig:DigestValue> |
| | | </hash> |
| | | </dependentAssembly> |
| | | </dependency> |
| | |
| | | </dependentAssembly> |
| | | </dependency> |
| | | <dependency> |
| | | <dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="WFormSynchronizeData_SMR.exe" size="49584"> |
| | | <dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="WFormSynchronizeData_SMR.exe" size="50608"> |
| | | <assemblyIdentity name="WFormSynchronizeData_SMR" version="1.0.0.0" language="neutral" processorArchitecture="msil" /> |
| | | <hash> |
| | | <dsig:Transforms> |
| | | <dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" /> |
| | | </dsig:Transforms> |
| | | <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" /> |
| | | <dsig:DigestValue>qAA6vs4V5oxyn1YmsE9FZFfZ7Dx5uSChCUrB4n4m9x4=</dsig:DigestValue> |
| | | <dsig:DigestValue>GytkBAS4Vk32KHXvjGXEgPiZg/PczZRYYBoz7vBcoes=</dsig:DigestValue> |
| | | </hash> |
| | | </dependentAssembly> |
| | | </dependency> |
| | |
| | | <dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" /> |
| | | </dsig:Transforms> |
| | | <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" /> |
| | | <dsig:DigestValue>uZI4sKjHwUeWiuQrdLaXP7lIa632KPsHC9N2B7k0PtI=</dsig:DigestValue> |
| | | <dsig:DigestValue>bVguW12HBlVMcR5UEGU4s7byOkXtf/f99RtiXyEXIsQ=</dsig:DigestValue> |
| | | </hash> |
| | | </dependentAssembly> |
| | | </dependency> |
| | |
| | | </dependentAssembly> |
| | | </dependency> |
| | | <dependency> |
| | | <dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="WFormSynchronizeData_SMR.exe" size="49584"> |
| | | <dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="WFormSynchronizeData_SMR.exe" size="50608"> |
| | | <assemblyIdentity name="WFormSynchronizeData_SMR" version="1.0.0.0" language="neutral" processorArchitecture="msil" /> |
| | | <hash> |
| | | <dsig:Transforms> |
| | | <dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" /> |
| | | </dsig:Transforms> |
| | | <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" /> |
| | | <dsig:DigestValue>qAA6vs4V5oxyn1YmsE9FZFfZ7Dx5uSChCUrB4n4m9x4=</dsig:DigestValue> |
| | | <dsig:DigestValue>GytkBAS4Vk32KHXvjGXEgPiZg/PczZRYYBoz7vBcoes=</dsig:DigestValue> |
| | | </hash> |
| | | </dependentAssembly> |
| | | </dependency> |