From ede3b3103cc39dbfff9c93e9a08fb1a9855387e4 Mon Sep 17 00:00:00 2001 From: lss <2538410689@qq.com> Date: 星期四, 24 七月 2025 17:31:55 +0800 Subject: [PATCH] 大车间 --- HH.WCS.Mobox3 - 大车间/HH.WCS.Mobox3.JiaTong/api/ApiHelper.cs | 103 +++++++++++++++++++++++++++++++++++---------------- 1 files changed, 70 insertions(+), 33 deletions(-) diff --git "a/HH.WCS.Mobox3 - \345\244\247\350\275\246\351\227\264/HH.WCS.Mobox3.JiaTong/api/ApiHelper.cs" "b/HH.WCS.Mobox3 - \345\244\247\350\275\246\351\227\264/HH.WCS.Mobox3.JiaTong/api/ApiHelper.cs" index 4cdb138..478b8ee 100644 --- "a/HH.WCS.Mobox3 - \345\244\247\350\275\246\351\227\264/HH.WCS.Mobox3.JiaTong/api/ApiHelper.cs" +++ "b/HH.WCS.Mobox3 - \345\244\247\350\275\246\351\227\264/HH.WCS.Mobox3.JiaTong/api/ApiHelper.cs" @@ -92,7 +92,7 @@ // AddErrorInfo("瀵绘壘鍑哄簱鍖哄け璐�, result.msg); // return result; //} - + string state = "绛夊緟"; int n_type = 0; //浠诲姟鏉ユ簮 1.瀵嗙偧绔嬪簱 3.棰勫搴�,4.鍘熸潗鏂欏簱 string Source = ""; switch (taskData.source) @@ -104,6 +104,7 @@ case "YBK": n_type = 2; Source = "棰勫搴�; + state = "绛夊緟鎺ㄩ�"; break; } @@ -170,15 +171,7 @@ AddErrorInfo("搴撳尯鏌ユ壘澶辫触", result.msg); return result; } - int pri = 1; - var area = Settings.wareLoc.Where(a => a.AreaCode == endloc.S_WH_CODE).First(); - if (area != null) - { - if (area.XbAreaCodes.Contains(endloc.S_AREA_CODE)) - { - pri = 2; - } - } + //鍒涘缓wcs浠诲姟 var wcsTask = new WCSTask { @@ -193,12 +186,13 @@ S_END_AREA = endloc.S_AREA_CODE, N_SCHEDULE_TYPE = 1, S_CNTR_CODE = CntrCode, - N_PRIORITY = pri, + N_PRIORITY = 1, Z_TYPE = n_type, N_START_LAYER = 1, N_END_LAYER = 1, S_WMS_NO = taskData.wmsTaskNo, S_NOTE = note, + S_B_STATE = state, S_MES_NO = taskData.mesTaskNo }; @@ -241,7 +235,50 @@ } + /// <summary> + /// 棰勫搴撲换鍔$姸鎬佷笅鍙�+ /// </summary> + /// <param name="model"></param> + /// <returns></returns> + internal static Result MstStateInquire(MstStateInquire model) + { + Result result = new Result() { code = "200", msg = "鐘舵�涓嬪彂鎴愬姛" }; + var db = new SqlHelper<object>().GetInstance(); + if (model == null) + { + LogHelper.Info($"MstStateInquire==> 鍙傛暟涓簄ull"); + result.code = "1"; + result.msg = "鍙傛暟涓簄ull鍊硷紝璇锋鏌ュ弬鏁版牸寮�; + AddErrorInfo("鍙傛暟涓虹┖", result.msg); + return result; + } + try + { + //鎵惧埌浠诲姟锛屼慨鏀逛换鍔$姸鎬�+ var task = db.Queryable<WCSTask>().Where(a => a.S_EQ_NO.Trim() == model.taskNum).First(); + if (task != null) + { + task.S_B_STATE ="绛夊緟"; + db.Updateable(task).UpdateColumns(a => new { a.S_B_STATE}).ExecuteCommand(); + } + else + { + result.code = "1"; + result.msg = $"鏍规嵁涓嬪彂浠诲姟鍙穥model.taskNum}鏈壘鍒板搴斾换鍔�; + AddErrorInfo("鏈壘鍒颁换鍔�, result.msg); + return result; + } + return result; + } + catch (Exception ex) + { + result.code = "1"; + result.msg = ex.ToString(); + LogHelper.Error("TrayItembind Error锛� + ex.ToString(), ex); + return result; + } + } public static object _Point = new object(); @@ -252,7 +289,7 @@ /// <returns></returns> internal static Result Point(PointModel model) { - Result result = new Result() { code = "200", msg = "鍏ュ钩搴撲换鍔′笅鍙戞垚鍔� }; + Result result = new Result() { code = "200", msg = "浠诲姟涓嬪彂鎴愬姛" }; string Source = "Mes"; if (model == null) @@ -305,25 +342,25 @@ AddErrorInfo("璐т綅鏌ユ壘澶辫触", result.msg, Source); return result; } - else - { - //鍒ゆ柇璧风偣鏄惁缁戝畾鍏朵粬鎵樼洏 - var CntrRel = LocationHelper.GetLocCntrRel(startloc.S_CODE).OrderBy(a => a.T_CREATE).FirstOrDefault(); - if (CntrRel != null) - { - if (CntrRel.S_CNTR_CODE != model.Rfid) - { - result.code = "1"; - result.msg = $"鏍规嵁璧风偣锛歿model.InitialLocation}鑾峰彇鎵樼洏:{CntrRel.S_CNTR_CODE}涓庝笅鍙戞墭鐩橈細{model.Rfid}涓嶄竴鑷达紝璇锋鏌ユ墭鐩樼爜鏄惁姝g‘"; - AddErrorInfo("鎵樼洏鐮佹牎妫�け璐�, result.msg, Source); - return result; - } - } - else - { - LocationHelper.BindingLoc(startloc.S_CODE, new List<string> { model.Rfid }); - } - } + //else + //{ + // //鍒ゆ柇璧风偣鏄惁缁戝畾鍏朵粬鎵樼洏 + // var CntrRel = LocationHelper.GetLocCntrRel(startloc.S_CODE).OrderBy(a => a.T_CREATE).FirstOrDefault(); + // if (CntrRel != null) + // { + // if (CntrRel.S_CNTR_CODE != model.Rfid) + // { + // result.code = "1"; + // result.msg = $"鏍规嵁璧风偣锛歿model.InitialLocation}鑾峰彇鎵樼洏:{CntrRel.S_CNTR_CODE}涓庝笅鍙戞墭鐩橈細{model.Rfid}涓嶄竴鑷达紝璇锋鏌ユ墭鐩樼爜鏄惁姝g‘"; + // AddErrorInfo("鎵樼洏鐮佹牎妫�け璐�, result.msg, Source); + // return result; + // } + // } + // else + // { + // LocationHelper.BindingLoc(startloc.S_CODE, new List<string> { model.Rfid }); + // } + //} endloc = db.Queryable<Location>().Where(a => a.S_CODE.Trim() == model.TargetLocation).First(); if (endloc == null) { @@ -460,7 +497,7 @@ var url = Settings.tableUrls.Find(a => a.id == 3); if (url != null) { - LogHelper.Info($"璐т綅涓婃姤涓婃姤锛氬湴鍧�{url}锛屽唴瀹癸細{date}"); + LogHelper.Info($"璐т綅涓婃姤涓婃姤锛氬湴鍧�{url.url}锛屽唴瀹癸細{date}"); var r = httpHelper.MesWebPost(url.url, date); result = JsonConvert.DeserializeObject<Result>(r); if (result.code == "200") @@ -473,7 +510,7 @@ result.code = "1"; result.msg = result.msg; } - ApiHelper.AddInfo("Mes", "Mes鐐瑰鐐逛换鍔′笅鍙�, JsonConvert.SerializeObject(date), JsonConvert.SerializeObject(result), "Post", url.url); + ApiHelper.AddInfo("Mes", "璐т綅鍚屾", JsonConvert.SerializeObject(date), JsonConvert.SerializeObject(result), "Post", url.url); } else -- Gitblit v1.9.1