| | |
| | | // AddErrorInfo("寻æ¾åºåºåºå¤±è´¥", result.msg); |
| | | // return result; |
| | | //} |
| | | |
| | | string state = "çå¾
"; |
| | | int n_type = 0; //任塿¥æº 1.å¯ç¼ç«åº 3.é¢å¤åº ,4.åææåº |
| | | string Source = ""; |
| | | switch (taskData.source) |
| | |
| | | case "YBK": |
| | | n_type = 2; |
| | | Source = "é¢å¤åº"; |
| | | state = "çå¾
æ¨é"; |
| | | break; |
| | | |
| | | } |
| | |
| | | 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 |
| | | { |
| | |
| | | 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 |
| | | |
| | | }; |
| | |
| | | } |
| | | |
| | | |
| | | /// <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==> åæ°ä¸ºnull"); |
| | | result.code = "1"; |
| | | result.msg = "åæ°ä¸ºnullå¼ï¼è¯·æ£æ¥åæ°æ ¼å¼"; |
| | | 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(); |
| | |
| | | /// <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) |
| | |
| | | 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}ä¸ä¸è´ï¼è¯·æ£æ¥æçç æ¯å¦æ£ç¡®"; |
| | | 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}ä¸ä¸è´ï¼è¯·æ£æ¥æçç æ¯å¦æ£ç¡®"; |
| | | // 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) |
| | | { |
| | |
| | | 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") |