From b3be11f03a2537238fef3ea59503029ee822b7b0 Mon Sep 17 00:00:00 2001 From: huanghongfeng <huanghongfeng@hnkhzn.com> Date: 星期日, 07 七月 2024 17:38:07 +0800 Subject: [PATCH] PDA,大屏 --- 代码管理/PCS/WCS_Server/WIDESEA_WCS/Common/equipment/info_interaction.cs | 19 ++++++++++--------- 1 files changed, 10 insertions(+), 9 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/Common/equipment/info_interaction.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/Common/equipment/info_interaction.cs" index 5cdec05..476cbab 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/Common/equipment/info_interaction.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/Common/equipment/info_interaction.cs" @@ -1,4 +1,5 @@ -锘縰sing System; +锘縰sing OfficeOpenXml.FormulaParsing.Excel.Functions.Text; +using System; using System.Collections.Generic; using System.Linq; using System.Reflection; @@ -111,7 +112,7 @@ client.Write(key.FirstOrDefault(x => x.name == "oi_on").dbAddress, (byte)0);//鐢宠澶嶄綅 throw new Exception($"{key.Key}鏈壘鍒扮被鍨媨o_wp_type}鐨勮溅杞弬鏁癨n鍐欏叆杈婇亾淇℃伅锛歩_status锛�2,oi_on锛�0"); } - var Work = workinfoRepository.Find(x => x.SN == o_wp_id && x.processCode == "17").OrderByDescending(x => x.CreateTime).FirstOrDefault(); + var Work = workinfoRepository.Find(x => x.SN == o_wp_id && (key.Key.Contains("4鍗曞厓") ? x.processCode == "28" : x.processCode == "17")).OrderByDescending(x => x.CreateTime).FirstOrDefault(); if (Work == null) { client.Write(key.FirstOrDefault(x => x.name == "i_status").dbAddress, (byte)3);//鐘舵�� @@ -153,20 +154,20 @@ if (Convert.ToByte(oi_on) == 1) { var o_wp_id = DBExtension.Read(key.FirstOrDefault(x => x.name == "o_wp_id"), client); - if (string.IsNullOrEmpty(o_wp_id.ToString())) + if (!string.IsNullOrEmpty(o_wp_id.ToString())) { - var Work = workinfoRepository.Find(x => x.SN == o_wp_id && x.processCode == "17").OrderByDescending(x => x.CreateTime).FirstOrDefault(); + var Work = workinfoRepository.Find(x => x.SN == o_wp_id && (key.Key.Contains("4鍗曞厓") ? x.processCode == "28" : x.processCode == "17")).OrderByDescending(x => x.CreateTime).FirstOrDefault(); if (Work == null) { client.Write(key.FirstOrDefault(x => x.name == "i_status").dbAddress, (byte)2);//鐘舵�� client.Write(key.FirstOrDefault(x => x.name == "oi_on").dbAddress, (byte)0);//鐢宠澶嶄綅 throw new Exception($"{key.Key}鏈壘鍒癝N锛歿o_wp_id}鐨勫伐鍗曚俊鎭痋n鍐欏叆杈婇亾淇℃伅锛歩_status锛�2,oi_on锛�0"); } - client.Write(key.FirstOrDefault(x => x.name == "i_job_id").dbAddress, Work.jobID);//宸ュ崟缂栧彿 - client.Write(key.FirstOrDefault(x => x.name == "i_heat_id").dbAddress, Work.heatID);//鐐変唬鍙� - client.Write(key.FirstOrDefault(x => x.name == "i_billet_id").dbAddress, Work.billetID.ToString());//閽㈠澂鍙� - client.Write(key.FirstOrDefault(x => x.name == "i_batch_id").dbAddress, Work.heatBatchID);//鐑鐞嗘壒娆� - client.Write(key.FirstOrDefault(x => x.name == "i_drawing_id").dbAddress, Work.drawingNo);//鍥惧彿 + client.Write(key.FirstOrDefault(x => x.name == "i_job_id").dbAddress, Encoding.UTF8.GetBytes(Work.jobID));//宸ュ崟缂栧彿 + client.Write(key.FirstOrDefault(x => x.name == "i_heat_id").dbAddress, Encoding.UTF8.GetBytes(Work.heatID));//鐐変唬鍙� + client.Write(key.FirstOrDefault(x => x.name == "i_billet_id").dbAddress, Encoding.UTF8.GetBytes(Work.billetID.ToString()));//閽㈠澂鍙� + client.Write(key.FirstOrDefault(x => x.name == "i_batch_id").dbAddress, Encoding.UTF8.GetBytes(Work.heatBatchID));//鐑鐞嗘壒娆� + client.Write(key.FirstOrDefault(x => x.name == "i_drawing_id").dbAddress, Encoding.UTF8.GetBytes(Work.drawingNo));//鍥惧彿 client.Write(key.FirstOrDefault(x => x.name == "i_status").dbAddress, (byte)1);//鐘舵�� client.Write(key.FirstOrDefault(x => x.name == "oi_on").dbAddress, (byte)0);//鐢宠澶嶄綅 WriteLog.Write_Log(key.Key + "杈婇亾", "璐存爣鏈�", "SN鍙凤細" + o_wp_id.ToString(), -- Gitblit v1.9.3