From a2c0e716c401ac6ab9069e19e46672271029eeb1 Mon Sep 17 00:00:00 2001 From: Rodney Chen <rodney.chen@hotmail.com> Date: 星期日, 14 七月 2024 14:10:29 +0800 Subject: [PATCH] 增加多语言 --- Tiger.Business.MES/WorkAction/IPQC.cs | 4 +- Tiger.Api/Language.db | 0 Tiger.Business.MES/Transaction/CollectNode.cs | 16 ++++---- Tiger.Business.MES/Transaction/PackingNode.cs | 16 ++++---- Tiger.Business.MES/Transaction/Position.cs | 12 +++--- Tiger.Business.MES/WorkAction/PrintLabel.cs | 8 ++-- Tiger.Business.MES/Transaction/TestNode.cs | 20 +++++----- 7 files changed, 38 insertions(+), 38 deletions(-) diff --git a/Tiger.Api/Language.db b/Tiger.Api/Language.db index b1fbb6e..462791f 100644 --- a/Tiger.Api/Language.db +++ b/Tiger.Api/Language.db Binary files differ diff --git a/Tiger.Business.MES/Transaction/CollectNode.cs b/Tiger.Business.MES/Transaction/CollectNode.cs index f5fe74c..48f92d4 100644 --- a/Tiger.Business.MES/Transaction/CollectNode.cs +++ b/Tiger.Business.MES/Transaction/CollectNode.cs @@ -79,16 +79,16 @@ if (CurBatch.IsNullOrEmpty()) { action.IsSuccessed = false; - action.LocaleMsg = new($"鏈�夋嫨宸ュ崟锛岃鍏堥�夋嫨瑕佺敓浜х殑宸ュ崟"); - //action.LocaleMsg = new("MES.Transaction.CollectNode.Submit.NotSelectOrderException"); + //action.LocaleMsg = new($"鏈�夋嫨宸ュ崟锛岃鍏堥�夋嫨瑕佺敓浜х殑宸ュ崟"); + action.LocaleMsg = new("MES.Transaction.CollectNode.Submit.NotSelectOrderException"); return action; } //鏈夊綋鍓嶅伐鍗曚笖涓嶆槸鎶曞叆锛屽垯鎻愮ず鏉$爜鏈姇鍏ョ敓浜э紝璇峰厛鍘婚绔欐壂鎻� else { action.IsSuccessed = false; - action.LocaleMsg = new($"鏉$爜[{input.SN}]灏氭湭鎶曞叆鐢熶骇锛岃鍏堝幓棣栫珯鎵弿", input.SN); - //action.LocaleMsg = new("MES.Transaction.CollectNode.Submit.NotInputException", input.SN); + //action.LocaleMsg = new($"鏉$爜[{input.SN}]灏氭湭鎶曞叆鐢熶骇锛岃鍏堝幓棣栫珯鎵弿", input.SN); + action.LocaleMsg = new("MES.Transaction.CollectNode.Submit.NotInputException", input.SN); return action; } } @@ -115,8 +115,8 @@ //娌℃湁鍙墽琛岀殑宸ユ ResetSteps(); action.IsSuccessed = false; - action.LocaleMsg = new($"宀椾綅[{CurPosition.POST_CODE}]宸ユ鎵ц寮傚父锛岃閲嶆柊鎵弿浜у搧鏉$爜", CurPosition.POST_CODE); - //action.LocaleMsg = new("MES.Transaction.CollectNode.Submit.WorkStepException", CurPosition.POST_CODE); + //action.LocaleMsg = new($"宀椾綅[{CurPosition.POST_CODE}]宸ユ鎵ц寮傚父锛岃閲嶆柊鎵弿浜у搧鏉$爜", CurPosition.POST_CODE); + action.LocaleMsg = new("MES.Transaction.CollectNode.Submit.WorkStepException", CurPosition.POST_CODE); } catch (Exception ex) { @@ -280,8 +280,8 @@ throw dbTran.ErrorException; } //淇濆瓨鎴愬姛锛岃繑鍥炶繃绔欐秷鎭� - action.LocaleMsg = new($"宸ュ崟[{CurWipSN.WORK_ORDER}]鐨勬潯鐮乕{CurWipSN.SN}]鍦ㄥ矖浣峓{CurWipSN.POST_CODE}]宸ュ簭[{CurWipSN.NODE_NAME}]杩囩珯鎴愬姛锛岀姸鎬乕{CurWipSN.STATUS.GetEnumDesc<MES_WIP_DATA.STATUSs>()}]", CurWipSN.WORK_ORDER, CurWipSN.SN, CurWipSN.POST_CODE, CurWipSN.NODE_NAME, CurWipSN.STATUS.GetEnumDesc<MES_WIP_DATA.STATUSs>()); - //action.LocaleMsg = new("MES.Transaction.CollectNode.ScanSn.PassSuccess", CurWipSN.WORK_ORDER, CurWipSN.SN, CurWipSN.POST_CODE, CurWipSN.NODE_NAME CurWipSN.STATUS.GetEnumDesc<MES_WIP_DATA.STATUSs>()); + //action.LocaleMsg = new($"宸ュ崟[{CurWipSN.WORK_ORDER}]鐨勬潯鐮乕{CurWipSN.SN}]鍦ㄥ矖浣峓{CurWipSN.POST_CODE}]宸ュ簭[{CurWipSN.NODE_NAME}]杩囩珯鎴愬姛锛岀姸鎬乕{CurWipSN.STATUS.GetEnumDesc<MES_WIP_DATA.STATUSs>()}]", CurWipSN.WORK_ORDER, CurWipSN.SN, CurWipSN.POST_CODE, CurWipSN.NODE_NAME, CurWipSN.STATUS.GetEnumDesc<MES_WIP_DATA.STATUSs>()); + action.LocaleMsg = new("MES.Transaction.CollectNode.ScanSn.PassSuccess", CurWipSN.WORK_ORDER, CurWipSN.SN, CurWipSN.POST_CODE, CurWipSN.NODE_NAME CurWipSN.STATUS.GetEnumDesc<MES_WIP_DATA.STATUSs>()); return action; } #endregion Functions diff --git a/Tiger.Business.MES/Transaction/PackingNode.cs b/Tiger.Business.MES/Transaction/PackingNode.cs index 0ef8263..21930ca 100644 --- a/Tiger.Business.MES/Transaction/PackingNode.cs +++ b/Tiger.Business.MES/Transaction/PackingNode.cs @@ -79,16 +79,16 @@ if (CurBatch.IsNullOrEmpty()) { action.IsSuccessed = false; - action.LocaleMsg = new($"鏈�夋嫨宸ュ崟锛岃鍏堥�夋嫨瑕佺敓浜х殑宸ュ崟"); - //action.LocaleMsg = new("MES.Transaction.PackingNode.Submit.NotSelectOrderException"); + //action.LocaleMsg = new($"鏈�夋嫨宸ュ崟锛岃鍏堥�夋嫨瑕佺敓浜х殑宸ュ崟"); + action.LocaleMsg = new("MES.Transaction.PackingNode.Submit.NotSelectOrderException"); return action; } //鏈夊綋鍓嶅伐鍗曚笖涓嶆槸鎶曞叆锛屽垯鎻愮ず鏉$爜鏈姇鍏ョ敓浜э紝璇峰厛鍘婚绔欐壂鎻� else { action.IsSuccessed = false; - action.LocaleMsg = new($"鏉$爜[{input.SN}]灏氭湭鎶曞叆鐢熶骇锛岃鍏堝幓棣栫珯鎵弿", input.SN); - //action.LocaleMsg = new("MES.Transaction.PackingNode.Submit.NotInputException", input.SN); + //action.LocaleMsg = new($"鏉$爜[{input.SN}]灏氭湭鎶曞叆鐢熶骇锛岃鍏堝幓棣栫珯鎵弿", input.SN); + action.LocaleMsg = new("MES.Transaction.PackingNode.Submit.NotInputException", input.SN); return action; } } @@ -115,8 +115,8 @@ //娌℃湁鍙墽琛岀殑宸ユ ResetSteps(); action.IsSuccessed = false; - action.LocaleMsg = new($"宀椾綅[{CurPosition.POST_CODE}]宸ユ鎵ц寮傚父锛岃閲嶆柊鎵弿浜у搧鏉$爜", CurPosition.POST_CODE); - //action.LocaleMsg = new("MES.Transaction.PackingNode.Submit.WorkStepException", CurPosition.POST_CODE); + //action.LocaleMsg = new($"宀椾綅[{CurPosition.POST_CODE}]宸ユ鎵ц寮傚父锛岃閲嶆柊鎵弿浜у搧鏉$爜", CurPosition.POST_CODE); + action.LocaleMsg = new("MES.Transaction.PackingNode.Submit.WorkStepException", CurPosition.POST_CODE); } catch (Exception ex) { @@ -279,8 +279,8 @@ throw dbTran.ErrorException; } //淇濆瓨鎴愬姛锛岃繑鍥炶繃绔欐秷鎭� - action.LocaleMsg = new($"宸ュ崟[{CurWipSN.WORK_ORDER}]鐨勬潯鐮乕{CurWipSN.SN}]鍦ㄥ矖浣峓{CurWipSN.POST_CODE}]宸ュ簭[{CurWipSN.NODE_NAME}]杩囩珯鎴愬姛锛岀姸鎬乕{CurWipSN.STATUS.GetEnumDesc<MES_WIP_DATA.STATUSs>()}]", CurWipSN.WORK_ORDER, CurWipSN.SN, CurWipSN.POST_CODE, CurWipSN.NODE_NAME, CurWipSN.STATUS.GetEnumDesc<MES_WIP_DATA.STATUSs>()); - //action.LocaleMsg = new("MES.Transaction.PackingNode.ScanSn.PassSuccess", CurWipSN.WORK_ORDER, CurWipSN.SN, CurWipSN.POST_CODE, CurWipSN.NODE_NAME CurWipSN.STATUS.GetEnumDesc<MES_WIP_DATA.STATUSs>()); + //action.LocaleMsg = new($"宸ュ崟[{CurWipSN.WORK_ORDER}]鐨勬潯鐮乕{CurWipSN.SN}]鍦ㄥ矖浣峓{CurWipSN.POST_CODE}]宸ュ簭[{CurWipSN.NODE_NAME}]杩囩珯鎴愬姛锛岀姸鎬乕{CurWipSN.STATUS.GetEnumDesc<MES_WIP_DATA.STATUSs>()}]", CurWipSN.WORK_ORDER, CurWipSN.SN, CurWipSN.POST_CODE, CurWipSN.NODE_NAME, CurWipSN.STATUS.GetEnumDesc<MES_WIP_DATA.STATUSs>()); + action.LocaleMsg = new("MES.Transaction.PackingNode.ScanSn.PassSuccess", CurWipSN.WORK_ORDER, CurWipSN.SN, CurWipSN.POST_CODE, CurWipSN.NODE_NAME CurWipSN.STATUS.GetEnumDesc<MES_WIP_DATA.STATUSs>()); return action; } #endregion Functions diff --git a/Tiger.Business.MES/Transaction/Position.cs b/Tiger.Business.MES/Transaction/Position.cs index 498f67b..0989d3b 100644 --- a/Tiger.Business.MES/Transaction/Position.cs +++ b/Tiger.Business.MES/Transaction/Position.cs @@ -86,23 +86,23 @@ if (wo.IsNullOrEmpty()) { action.IsSuccessed = false; - action.LocaleMsg = new($"宸ュ崟[{input.OrderNo}]涓嶅瓨鍦�", input.OrderNo); - //action.LocaleMsg = new("MES.Transaction.Position.SelectOrder.EmptyException", input.OrderNO); + //action.LocaleMsg = new($"宸ュ崟[{input.OrderNo}]涓嶅瓨鍦�", input.OrderNo); + action.LocaleMsg = new("MES.Transaction.Position.SelectOrder.EmptyException", input.OrderNo); return action; } if (wo.STATUS != BIZ_MES_WO.STATUSs.Release.GetValue() && wo.STATUS != BIZ_MES_WO.STATUSs.Working.GetValue()) { action.IsSuccessed = false; - action.LocaleMsg = new($"宸ュ崟[{input.OrderNo}]鐘舵�乕{wo.STATUS.GetEnum<BIZ_MES_WO.STATUSs>().GetName()}]涓嶈兘鐢熶骇"); - //action.LocaleMsg = new("MES.Transaction.Position.SelectOrder.StatusException", input.OrderNO, query.STATUS.GetEnum<BIZ_MES_WO.STATUSs>().GetName()); + //action.LocaleMsg = new($"宸ュ崟[{input.OrderNo}]鐘舵�乕{wo.STATUS.GetEnum<BIZ_MES_WO.STATUSs>().GetName()}]涓嶈兘鐢熶骇"); + action.LocaleMsg = new("MES.Transaction.Position.SelectOrder.StatusException", input.OrderNo, wo.STATUS.GetEnum<BIZ_MES_WO.STATUSs>().GetName()); return action; } var batch = await Biz.Db.Queryable<BIZ_MES_WO_BATCH>().ByAuth(input.AuthOption).Where(q => q.ORDER_NO == input.OrderNo && q.ACT_LINE == CurLine.LINE_CODE).FirstAsync(); if (batch.IsNullOrEmpty()) { action.IsSuccessed = false; - action.LocaleMsg = new($"宸ュ崟[{input.OrderNo}]娌℃湁涓嬪彂鍒颁骇绾跨姸鎬乕{CurLine.LINE_CODE}]"); - //action.LocaleMsg = new("MES.Transaction.Position.SelectOrder.LineException", input.OrderNO, CurLine.LINE_CODE); + //action.LocaleMsg = new($"宸ュ崟[{input.OrderNo}]娌℃湁涓嬪彂鍒颁骇绾跨姸鎬乕{CurLine.LINE_CODE}]"); + action.LocaleMsg = new("MES.Transaction.Position.SelectOrder.LineException", input.OrderNo, CurLine.LINE_CODE); return action; } var wb = new WorkBatch(input.OrderNo).Init(CurLine.LINE_CODE); diff --git a/Tiger.Business.MES/Transaction/TestNode.cs b/Tiger.Business.MES/Transaction/TestNode.cs index 277e745..69592af 100644 --- a/Tiger.Business.MES/Transaction/TestNode.cs +++ b/Tiger.Business.MES/Transaction/TestNode.cs @@ -79,16 +79,16 @@ if (CurBatch.IsNullOrEmpty()) { action.IsSuccessed = false; - action.LocaleMsg = new($"鏈�夋嫨宸ュ崟锛岃鍏堥�夋嫨瑕佺敓浜х殑宸ュ崟"); - //action.LocaleMsg = new("MES.Transaction.TestNode.Submit.NotSelectOrderException"); + //action.LocaleMsg = new($"鏈�夋嫨宸ュ崟锛岃鍏堥�夋嫨瑕佺敓浜х殑宸ュ崟"); + action.LocaleMsg = new("MES.Transaction.TestNode.Submit.NotSelectOrderException"); return action; } //鏈夊綋鍓嶅伐鍗曚笖涓嶆槸鎶曞叆锛屽垯鎻愮ず鏉$爜鏈姇鍏ョ敓浜э紝璇峰厛鍘婚绔欐壂鎻� else { action.IsSuccessed = false; - action.LocaleMsg = new($"鏉$爜[{input.SN}]灏氭湭鎶曞叆鐢熶骇锛岃鍏堝幓棣栫珯鎵弿", input.SN); - //action.LocaleMsg = new("MES.Transaction.TestNode.Submit.NotInputException", input.SN); + //action.LocaleMsg = new($"鏉$爜[{input.SN}]灏氭湭鎶曞叆鐢熶骇锛岃鍏堝幓棣栫珯鎵弿", input.SN); + action.LocaleMsg = new("MES.Transaction.TestNode.Submit.NotInputException", input.SN); return action; } } @@ -114,8 +114,8 @@ //娌℃湁鍙墽琛岀殑宸ユ ResetSteps(); action.IsSuccessed = false; - action.LocaleMsg = new($"宀椾綅[{CurPosition.POST_CODE}]宸ユ鎵ц寮傚父锛岃閲嶆柊鎵弿浜у搧鏉$爜", CurPosition.POST_CODE); - //action.LocaleMsg = new("MES.Transaction.TestNode.Submit.WorkStepException", CurPosition.POST_CODE); + //action.LocaleMsg = new($"宀椾綅[{CurPosition.POST_CODE}]宸ユ鎵ц寮傚父锛岃閲嶆柊鎵弿浜у搧鏉$爜", CurPosition.POST_CODE); + action.LocaleMsg = new("MES.Transaction.TestNode.Submit.WorkStepException", CurPosition.POST_CODE); } catch (Exception ex) { @@ -279,8 +279,8 @@ throw dbTran.ErrorException; } //淇濆瓨鎴愬姛锛岃繑鍥炶繃绔欐秷鎭� - action.LocaleMsg = new($"宸ュ崟[{CurWipSN.WORK_ORDER}]鐨勬潯鐮乕{CurWipSN.SN}]鍦ㄥ矖浣峓{CurWipSN.POST_CODE}]宸ュ簭[{CurWipSN.NODE_NAME}]杩囩珯鎴愬姛锛岀姸鎬乕{CurWipSN.STATUS.GetEnumDesc<MES_WIP_DATA.STATUSs>()}]", CurWipSN.WORK_ORDER, CurWipSN.SN, CurWipSN.POST_CODE, CurWipSN.NODE_NAME, CurWipSN.STATUS.GetEnumDesc<MES_WIP_DATA.STATUSs>()); - //action.LocaleMsg = new("MES.Transaction.TestNode.ScanSn.PassSuccess", CurWipSN.WORK_ORDER, CurWipSN.SN, CurWipSN.POST_CODE, CurWipSN.NODE_NAME CurWipSN.STATUS.GetEnumDesc<MES_WIP_DATA.STATUSs>()); + //action.LocaleMsg = new($"宸ュ崟[{CurWipSN.WORK_ORDER}]鐨勬潯鐮乕{CurWipSN.SN}]鍦ㄥ矖浣峓{CurWipSN.POST_CODE}]宸ュ簭[{CurWipSN.NODE_NAME}]杩囩珯鎴愬姛锛岀姸鎬乕{CurWipSN.STATUS.GetEnumDesc<MES_WIP_DATA.STATUSs>()}]", CurWipSN.WORK_ORDER, CurWipSN.SN, CurWipSN.POST_CODE, CurWipSN.NODE_NAME, CurWipSN.STATUS.GetEnumDesc<MES_WIP_DATA.STATUSs>()); + action.LocaleMsg = new("MES.Transaction.TestNode.ScanSn.PassSuccess", CurWipSN.WORK_ORDER, CurWipSN.SN, CurWipSN.POST_CODE, CurWipSN.NODE_NAME, CurWipSN.STATUS.GetEnumDesc<MES_WIP_DATA.STATUSs>()); return action; } @@ -295,8 +295,8 @@ if (CurBatch.IsNullOrEmpty()) { action.IsSuccessed = false; - action.LocaleMsg = new($"璇峰厛鎵弿瑕佽繃绔欑殑鏉$爜"); - //action.LocaleMsg = new("MES.Transaction.TestNode.GetDefects.NotScanException"); + //action.LocaleMsg = new($"璇峰厛鎵弿瑕佽繃绔欑殑鏉$爜"); + action.LocaleMsg = new("MES.Transaction.TestNode.GetDefects.NotScanException"); return action; } action.Data = CurBatch.GetNodeDefects(PostCode); diff --git a/Tiger.Business.MES/WorkAction/IPQC.cs b/Tiger.Business.MES/WorkAction/IPQC.cs index c2bec36..6d633f1 100644 --- a/Tiger.Business.MES/WorkAction/IPQC.cs +++ b/Tiger.Business.MES/WorkAction/IPQC.cs @@ -35,8 +35,8 @@ var action = new ApiAction<SubmitOutput>(); - action.LocaleMsg = new($"璇锋寜娴嬭瘯椤规彁浜ゆ祴璇曟暟鎹�"); - //action.LocaleMsg = new("MES.WorkAction.IPQC.PleaseTest"); + //action.LocaleMsg = new($"璇锋寜娴嬭瘯椤规彁浜ゆ祴璇曟暟鎹�"); + action.LocaleMsg = new("MES.WorkAction.IPQC.PleaseTest"); return action; } /// <summary> diff --git a/Tiger.Business.MES/WorkAction/PrintLabel.cs b/Tiger.Business.MES/WorkAction/PrintLabel.cs index 8aac55d..2a11f3b 100644 --- a/Tiger.Business.MES/WorkAction/PrintLabel.cs +++ b/Tiger.Business.MES/WorkAction/PrintLabel.cs @@ -78,8 +78,8 @@ //閲嶇疆褰撳墠宸ュ簭 CurPosition.ResetSteps(); action.IsSuccessed = false; - action.LocaleMsg = new($"鏍囩[{Label.LABEL_NAME}]鎵撳嵃澶辫触锛岃閲嶆柊鎵弿浜у搧鏉$爜", Label.LABEL_NAME); - //action.LocaleMsg = new("MES.WorkAction.PrintLabel.PrintFail", Label.LABEL_NAME); + //action.LocaleMsg = new($"鏍囩{Label.LABEL_NAME}[{Label.LABEL_CODE}]鎵撳嵃澶辫触锛岃閲嶆柊鎵弿浜у搧鏉$爜", Label.LABEL_NAME); + action.LocaleMsg = new("MES.WorkAction.PrintLabel.PrintFail", Label.LABEL_NAME, Label.LABEL_CODE); } return action; } @@ -91,8 +91,8 @@ { var action = new ApiAction<SubmitOutput>(); IsFinished = true; - action.LocaleMsg = new($"鏍囩[{Label.LABEL_NAME}]鎵撳嵃鎴愬姛", Label.LABEL_NAME); - //action.LocaleMsg = new("MES.WorkAction.PrintLabel.PrintSuccess", Label.LABEL_NAME); + //action.LocaleMsg = new($"鏍囩{Label.LABEL_NAME}[{Label.LABEL_CODE}]鎵撳嵃鎴愬姛", Label.LABEL_NAME); + action.LocaleMsg = new("MES.WorkAction.PrintLabel.PrintSuccess", Label.LABEL_NAME, Label.LABEL_CODE); return action; } -- Gitblit v1.9.3