| | |
| | | let loadingInstance; |
| | | let loadingStatus = false; |
| | | if (process.env.NODE_ENV == 'development') { |
| | | axios.defaults.baseURL = 'http://127.0.0.1:8099/'; |
| | | axios.defaults.baseURL = 'http://192.168.12.101:8099/'; |
| | | } |
| | | else if (process.env.NODE_ENV == 'debug') { |
| | | axios.defaults.baseURL = 'http://192.168.12.101:8099/'; |
| | |
| | | [Editable(true)] |
| | | public string area { get; set; } |
| | | /// <summary> |
| | | /// å·¥ä½ä»¤å· |
| | | /// å·¥åç¼å· |
| | | /// </summary> |
| | | [Display(Name = "å·¥åç¼å·")] |
| | | [Column(TypeName = "nvarchar(40)")] |
| | | [Editable(true)] |
| | | public string jobID { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å·¥ä½ä»¤å· |
| | | /// </summary> |
| | | [Display(Name = "å·¥ä½ä»¤å·")] |
| | | [Column(TypeName = "nvarchar(40)")] |
| | | [Editable(true)] |
| | | public string workOrder { get; set; } |
| | | } |
| | | } |
| | |
| | | #region 触åNGä»»å¡ |
| | | var NG = Stations.Where(x => x.enable && x.stationCode == NGStation && x.location_state == LocationStateEnum.Stroge.ToString() && x.quantity > 0).FirstOrDefault(); |
| | | if (NG != null) |
| | | agvtask(stationinfoRepository, NG, Work, "TaskType_OutsourceInbound"); |
| | | { |
| | | agvtask(stationinfoRepository, NG, Work, "TaskType_OutsourceInbound"); |
| | | continue; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | Stationinfo = Stations.Where(x => x.enable && x.stationCode == NGStation && x.location_state == LocationStateEnum.Stroge.ToString() && x.quantity == 0).FirstOrDefault(); |
| | | } |
| | | if (Stationinfo != null) |
| | | { |
| | |
| | | try |
| | | { |
| | | ExecuteJob(context, DoAction); |
| | | |
| | | } |
| | | catch { } |
| | | return Task.CompletedTask; |
| | |
| | | continue; |
| | | |
| | | } |
| | | var EmptyStation = GetStation.EmptyPalletStation(area); |
| | | |
| | | #region 空æå ç |
| | | var EmptyStations = stationinfoRepository.Find(x => x.stationCode.Contains("DD") && x.quantity < 5 && x.enable).ToList(); |
| | | var EmptyStation = EmptyStations.Where(x => x.tray_type == station.tray_type && x.location_state == LocationStateEnum.Stroge.ToString()).FirstOrDefault(); |
| | | if (EmptyStation == null) |
| | | EmptyStation = EmptyStations.Where(x => x.location_state == LocationStateEnum.Empty.ToString()).FirstOrDefault(); |
| | | #endregion |
| | | |
| | | if (EmptyStation == null)//æ¥æ¾åºå
空æç |
| | | EmptyStation = GetStation.EmptyPalletStation(area); |
| | | |
| | | #region æ¥æ¾åºåºä¸ç©ºæçç©ºè´§ä½ |
| | | // EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains("A") && x.location_state != LocationStateEnum.Busy.ToString() && x.enable) |
| | | //.OrderBy(x => x.column).ThenByDescending(x => x.line).FirstOrDefault();//æ¥æ¾æ²¡æä»»å¡ç空æçè´§ä½ |
| | | // EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains("A") && x.location_state != LocationStateEnum.Busy.ToString() && x.enable) |
| | | //.OrderBy(x => x.column).ThenByDescending(x => x.line).FirstOrDefault();//æ¥æ¾æ²¡æä»»å¡ç空æçè´§ä½ |
| | | |
| | | // if (EmptyStation != null) |
| | | // { |
| | | // if (stationinfoRepository.Find(x => x.area == EmptyStation.area && x.stationCode.Contains("A") && x.column == EmptyStation.column && x.location_state.Contains("Busy")).Any()) |
| | | // { |
| | | // EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains("A") && x.column != EmptyStation.column && x.location_state != LocationStateEnum.Busy.ToString() && x.enable).OrderBy(x => x.column).ThenByDescending(x => x.line).FirstOrDefault();//æé¤å½ååå¨ä»»å¡çè´§ä½ |
| | | // } |
| | | // if (EmptyStation != null && EmptyStation.line == 2)//妿任å¡åå¨ç¬¬äºè¡,ææ¥ç¬¬ä¸è¡æ¯å¦æè´§ |
| | | // { |
| | | // if (stationinfoRepository.Find(x => x.area == EmptyStation.area && x.stationCode.Contains("A") && x.column == EmptyStation.column && x.line == 1 && x.location_state != LocationStateEnum.Empty.ToString()).Any()) EmptyStation = null; |
| | | // } |
| | | // } |
| | | // if (EmptyStation != null) |
| | | // { |
| | | // if (stationinfoRepository.Find(x => x.area == EmptyStation.area && x.stationCode.Contains("A") && x.column == EmptyStation.column && x.location_state.Contains("Busy")).Any()) |
| | | // { |
| | | // EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains("A") && x.column != EmptyStation.column && x.location_state != LocationStateEnum.Busy.ToString() && x.enable).OrderBy(x => x.column).ThenByDescending(x => x.line).FirstOrDefault();//æé¤å½ååå¨ä»»å¡çè´§ä½ |
| | | // } |
| | | // if (EmptyStation != null && EmptyStation.line == 2)//妿任å¡åå¨ç¬¬äºè¡,ææ¥ç¬¬ä¸è¡æ¯å¦æè´§ |
| | | // { |
| | | // if (stationinfoRepository.Find(x => x.area == EmptyStation.area && x.stationCode.Contains("A") && x.column == EmptyStation.column && x.line == 1 && x.location_state != LocationStateEnum.Empty.ToString()).Any()) EmptyStation = null; |
| | | // } |
| | | // } |
| | | |
| | | // if (EmptyStation == null) |
| | | // { |
| | | // EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains(area == "10" ? "D" : "C") && x.location_state == LocationStateEnum.Busy.ToString() && x.enable).OrderByDescending(x => x.column).FirstOrDefault();//æåä¸ä¸ªè´§ä½æä»»å¡åä¸è½çæå
¥åºä»»å¡ |
| | | // if (EmptyStation != null) continue; |
| | | // EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains(area == "10" ? "D" : "C") && x.location_state == LocationStateEnum.Stroge.ToString() && x.enable).OrderByDescending(x => x.column).FirstOrDefault();//æ¾æå¤é¢æ²¡å 满5个çè´§ä½ |
| | | // if (EmptyStation == null) |
| | | // EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains(area == "10" ? "D" : "C") && x.location_state == LocationStateEnum.Empty.ToString() && x.enable).OrderBy(x => x.column).FirstOrDefault(); |
| | | // } |
| | | // if (EmptyStation == null) |
| | | // { |
| | | // EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains(area == "10" ? "D" : "C") && x.location_state == LocationStateEnum.Busy.ToString() && x.enable).OrderByDescending(x => x.column).FirstOrDefault();//æåä¸ä¸ªè´§ä½æä»»å¡åä¸è½çæå
¥åºä»»å¡ |
| | | // if (EmptyStation != null) continue; |
| | | // EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains(area == "10" ? "D" : "C") && x.location_state == LocationStateEnum.Stroge.ToString() && x.enable).OrderByDescending(x => x.column).FirstOrDefault();//æ¾æå¤é¢æ²¡å 满5个çè´§ä½ |
| | | // if (EmptyStation == null) |
| | | // EmptyStation = stationinfoRepository.Find(x => x.area == area && x.quantity < 5 && x.stationCode.Contains(area == "10" ? "D" : "C") && x.location_state == LocationStateEnum.Empty.ToString() && x.enable).OrderBy(x => x.column).FirstOrDefault(); |
| | | // } |
| | | |
| | | #endregion |
| | | |
| | |
| | | if (Station.location_state == LocationStateEnum.Stroge.ToString() && PalletSignal != 1) |
| | | { |
| | | Station.location_state = LocationStateEnum.Abnormal.ToString(); |
| | | Station.remark = "è´§ä½æè´§ï¼å
çµæ£æµæ æç"; |
| | | Station.remark = "å
çµæ£æµæ æç"; |
| | | stationinfoRepository.Update(Station, true); |
| | | client.WriteByOrder("W_AlarmSignal", (Int16)2, name);//æ¥è¦ |
| | | WriteDBLog.Error(name + "æ¥è¦", $"è´§ä½ç¼å·ï¼{Station.stationCode}ï¼é误信æ¯ï¼{Station.remark}", "PCS"); |
| | |
| | | if (Station.location_state == LocationStateEnum.Empty.ToString() && (PalletSignal == 1 || MaterialSignal == 1))//ç³»ç»è´§ä½ä¸ºç©ºï¼å
çµæ£æµææ |
| | | { |
| | | Station.location_state = LocationStateEnum.Abnormal.ToString(); |
| | | Station.remark = "è´§ä½æ è´§ï¼å
çµæ£æµææ"; |
| | | Station.remark = "å
çµæ£æµææ"; |
| | | stationinfoRepository.Update(Station, true); |
| | | client.WriteByOrder("W_AlarmSignal", (Int16)2, name);//æ¥è¦ |
| | | WriteDBLog.Error(name + "æ¥è¦", $"è´§ä½ç¼å·ï¼{Station.stationCode}ï¼é误信æ¯ï¼{Station.remark}", "PCS"); |
| | |
| | | using WIDESEA_WCS.WCSClient; |
| | | using WIDESEA_WMS.IRepositories; |
| | | using WIDESEA_WMS.Repositories; |
| | | using static System.Collections.Specialized.BitVector32; |
| | | |
| | | namespace WIDESEA_WCS.JobsPart.Common |
| | | { |
| | | public class GetStation |
| | | { |
| | | /// <summary> |
| | | /// æ¾å¯å
¥åºç©ºæä½ |
| | | /// </summary> |
| | | public static void EmptyStation() |
| | | { |
| | | try |
| | | { |
| | | VOLContext Context = new VOLContext(); |
| | | Idt_stationinfoRepository stationinfoRepository = new dt_stationinfoRepository(Context); |
| | | Idt_agvtaskRepository agvtaskService = new dt_agvtaskRepository(Context); |
| | | var Stations = stationinfoRepository.Find(x => x.stationCode.Contains("DD") && x.quantity == 5 && x.enable).ToList(); |
| | | foreach (var Station in Stations) |
| | | { |
| | | var area = Station.tray_type == "SmallTray" ? "11" : "10"; |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·å空æçè´§ä½ |
| | | /// </summary> |
| | |
| | | EmptyStation = stationinfoRepository.Find(x => x.quantity > 0 && x.stationCode == "C01005001"/* && x.location_state == "Stroge"*/ && x.tray_status == "EmptyTray" && x.enable).FirstOrDefault(); |
| | | if (EmptyStation != null) |
| | | EmptyStation = stationinfoRepository.Find(x => x.quantity > 0 && x.area == EmptyStation.area && x.line == EmptyStation.line /*&& x.location_state == "Stroge"*/ && x.tray_status == "EmptyTray" && x.enable).OrderByDescending(x => x.column).FirstOrDefault(); |
| | | if (EmptyStation != null) |
| | | if (EmptyStation.location_state == LocationStateEnum.Busy.ToString()) EmptyStation = null; |
| | | if (EmptyStation != null)//空æè´§ä½ä¸ä¸ºç©ºå¤ææ¯å¦åå¨å
¶ä»ä»»å¡ |
| | | if (stationinfoRepository.Find(x => x.line == EmptyStation.line && x.area == EmptyStation.area && x.location_state.Contains("Busy")).Any()) EmptyStation = null; |
| | | //if (EmptyStation.location_state == LocationStateEnum.Busy.ToString()) EmptyStation = null; |
| | | } |
| | | #endregion |
| | | |
| | | #region æ¥æ¾ç©ºæåºåº |
| | | if (EmptyStation == null) |
| | | EmptyStation = stationinfoRepository.Find(x => x.quantity > 0 && x.area == area /*&& x.location_state == "Stroge"*/ && x.tray_status == "EmptyTray" && x.enable).OrderBy(x => x.column).FirstOrDefault(); |
| | | if (EmptyStation != null) |
| | | if (EmptyStation.location_state == LocationStateEnum.Busy.ToString()) EmptyStation = null; |
| | | if (stationinfoRepository.Find(x => x.line == EmptyStation.line && x.area == EmptyStation.area && x.location_state.Contains("Busy")).Any()) EmptyStation = null; |
| | | //if (EmptyStation.location_state == LocationStateEnum.Busy.ToString()) EmptyStation = null; |
| | | if (EmptyStation != null) |
| | | { |
| | | var PalletSignal = Pipeline_client.ReadByOrder<Int16>("R_PalletSignal", task.agv_toaddress);//读åæçä¿¡å·:1:æ,2æ |
| | |
| | | WriteDBLog.Success("æ´æ°ç©ºçéåä»»å¡", $"ä»»å¡ç¼å·ï¼{task.agv_tasknum}", "PCS"); |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | Idt_stationinfoRepository stationinfoRepository = new dt_stationinfoRepository(Context); |
| | | |
| | | #region æ¥æ¾ç©ºæçåºåº |
| | | if (stationinfoRepository.Find(x => x.area == area && x.location_state == LocationStateEnum.Busy.ToString()).Any()) |
| | | if (stationinfoRepository.Find(x => x.area == area && x.location_state == LocationStateEnum.Busy.ToString()).Any() && area != "10") |
| | | { |
| | | var EmptyStation = stationinfoRepository.Find(x => x.stationCode == "C01005001" && x.location_state == LocationStateEnum.Empty.ToString()).FirstOrDefault(); |
| | | if (EmptyStation != null) |
| | |
| | | agv_toaddress = "", |
| | | agv_userid = "ç³»ç»", |
| | | bindSN = stationinfo.bindSN, |
| | | jobID = Mes_Work.jobID, |
| | | jobID = Mes_Work.workOrder, |
| | | agv_worktype = Convert.ToInt32(Mes_Work.processCode), |
| | | agv_materbarcode = Mes_Work.materialCode, |
| | | agv_Traytype = stationinfo.tray_type, |
| | |
| | | VOLContext context = new VOLContext(); |
| | | Idt_stationinfoRepository stationinfoRepository = new dt_stationinfoRepository(context); |
| | | Idt_agvtaskRepository agvtaskRepository = new dt_agvtaskRepository(context); |
| | | var stations = stationinfoRepository.Find(x => x.stationCode.Contains("X") && x.location_state == "Abnormal" /*LocationStateEnum.Abnormal.ToString()*/ && (x.tray_type == "SmallTray/LargeTray" || x.tray_type == "LargeTray/SmallTray")).ToList(); |
| | | var stations = stationinfoRepository.Find(x => (x.stationCode.Contains("X")|| x.stationCode.Contains("W01001004") || x.stationCode.Contains("W01001005")) && x.location_state == "Abnormal" /*LocationStateEnum.Abnormal.ToString()*/ && (x.tray_type == "SmallTray/LargeTray" || x.tray_type == "LargeTray/SmallTray") && x.enable).ToList(); |
| | | foreach (var station in stations) |
| | | { |
| | | if (agvtaskRepository.Find(x => x.agv_fromaddress == station.stationCode || x.agv_toaddress == station.stationCode).Any()) continue; |
| | | var types = station.tray_type.Split('/'); |
| | | var area = types[0] == "SmallTray" ? "11" : "10"; |
| | | //æ¾1åºåºç空æä½ |
| | |
| | | agv_Traytype = types[0] |
| | | }; |
| | | agvtaskRepository.Add(agvtask, true); |
| | | station.location_state = LocationStateEnum.Busy.ToString(); |
| | | stationinfoRepository.Update(EmptyStation, true); |
| | | EmptyStation.location_state = LocationStateEnum.Busy.ToString(); |
| | | stationinfoRepository.Update(EmptyStation, true); |
| | | WriteDBLog.Success("åå»ºæ´æ¢ç©ºçä»»å¡", $"ä»»å¡ç¼å·ï¼{agvtask.agv_tasknum}", "PCS"); |
| | |
| | | if (task.agv_tasknum.Contains("_")) |
| | | { |
| | | string mainTaskNum = task.agv_tasknum.Split('_')[0]; |
| | | if (agvtaskService.Find(x => x.agv_tasknum == mainTaskNum && (task.agv_taskstate == "Executing1" || task.agv_taskstate == "Complete1")).Any()) |
| | | if (agvtaskService.Find(x => x.agv_tasknum == mainTaskNum && task.agv_taskstate != "Executing" && task.agv_taskstate != "Create").Any() || !agvtaskService.Find(x => x.agv_tasknum == mainTaskNum).Any()) |
| | | GetStation.EmptyPalletStation(task); |
| | | } |
| | | else |
| | |
| | | } |
| | | return TargetLocation; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 临æ¶ä½¿ç¨ |
| | | /// </summary> |
| | | /// <param name="stationinfoRepository"></param> |
| | | /// <returns></returns> |
| | | public static dt_stationinfo GetEmptyLocation1(Idt_stationinfoRepository stationinfoRepository) |
| | | { |
| | | return stationinfoRepository.Find(x => x.line == 1 && x.location_state == LocationStateEnum.Empty.ToString() && x.enable && x.area == "3").OrderBy(x => x.column).FirstOrDefault();//è¡ååºåéåæ» |
| | | } |
| | | /// <summary> |
| | | /// å»å¤å |
| | | /// </summary> |
| | | /// <param name="stationinfoRepository"></param> |
| | | /// <returns></returns> |
| | | /// <exception cref="Exception"></exception> |
| | | public static dt_stationinfo GetEmptyLocation(Idt_stationinfoRepository stationinfoRepository) |
| | | { |
| | | dt_stationinfo TargetLocation = null; |
| | |
| | | "Connection": { |
| | | "DBType": "MsSql", //MySql/MsSql/PgSql //æ°æ®åºç±»åï¼å¦æä½¿ç¨çæ¯sqlserveræ¤å¤åºè®¾ç½®ä¸ºMsSql |
| | | //sqlserverè¿æ¥å符串P@ssw0rd |
| | | "DbConnectionString": "Data Source=.;Initial Catalog=WIDESEA_DB;Persist Security Info=True;User ID=sa;Password=P@ssw0rd;Connect Timeout=500;", |
| | | "DbConnectionString": "Data Source=192.168.12.101;Initial Catalog=WIDESEA_DB;Persist Security Info=True;User ID=sa;Password=123456;Connect Timeout=500;", |
| | | |
| | | //mysqlè¿æ¥å符串(å级EFCore3.1å°æ¶å·²å°mysqlè¿æ¥å符串修æ¹,2019-12-20) |
| | | // "DbConnectionString": " Data Source=127.0.0.1;Database=netcoredev;AllowLoadLocalInfile=true;User ID=root;Password=123456;allowPublicKeyRetrieval=true;pooling=true;CharSet=utf8;port=3306;sslmode=none;", |
| | |
| | | { |
| | | public class detail |
| | | { |
| | | /// <summary> |
| | | /// 车轮SNå· |
| | | /// </summary> |
| | | public string sn { get; set; } |
| | | /// <summary> |
| | | /// å·¥åå· |
| | | /// </summary> |
| | | public string jobID { get; set; } |
| | | /// <summary> |
| | | /// å·¥åç±»å (17-æºå å·¥ 28-æ£æµçº¿) |
| | | /// </summary> |
| | | public string processCode { get; set; } |
| | | } |
| | | |
| | | public class detail1 |
| | | { |
| | | /// <summary> |
| | | /// 车轮SNå· |
| | | /// </summary> |
| | | public string sn { get; set; } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | /// <summary> |
| | | /// å·¥åç¼å· |
| | | /// </summary> |
| | | public string JobID { get; set; } |
| | | public string WorkOrder { get; set; } |
| | | /// <summary> |
| | | /// 17-æºå å·¥ 28-æ£æµçº¿ |
| | | /// </summary> |
| | | public string processCode { get; set; } |
| | | //public string processCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è½¦è½®ä¿¡æ¯ |
| | |
| | | /// </summary> |
| | | public int? layerNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æä½è
|
| | | /// </summary> |
| | | public string Operator { get; set; } |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | /// <summary> |
| | | /// 车轮SN |
| | | /// </summary> |
| | | public List<detail> details { get; set; } |
| | | public List<detail1> details { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æºåºæ¿åç§° |
| | |
| | | /// ç®æ å±å· |
| | | /// </summary> |
| | | public string toLayerNo { get; set;} |
| | | |
| | | /// <summary> |
| | | /// æä½è
|
| | | /// </summary> |
| | | public string Operator { get; set; } |
| | | } |
| | | } |
| | |
| | | [Editable(true)] |
| | | public string area { get; set; } |
| | | /// <summary> |
| | | /// å·¥åç¼å·/å·¥ä½ä»¤å· |
| | | /// å·¥åç¼å· |
| | | /// </summary> |
| | | [Display(Name = "å·¥åç¼å·")] |
| | | [Column(TypeName = "nvarchar(40)")] |
| | | [Editable(true)] |
| | | public string jobID { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å·¥ä½ä»¤å· |
| | | /// </summary> |
| | | [Display(Name = "å·¥ä½ä»¤å·")] |
| | | [Column(TypeName = "nvarchar(40)")] |
| | | [Editable(true)] |
| | | public string workOrder { get; set; } |
| | | } |
| | | } |
| | |
| | | Operator = "admin", |
| | | stationCode = task.agv_toaddress, |
| | | area = station.area, |
| | | jobID = mes_Work.workOrder, |
| | | jobID = mes_Work.jobID, |
| | | workOrder = mes_Work.workOrder, |
| | | ID = Guid.NewGuid() |
| | | }; |
| | | inventorys.Add(inventory); |
| | |
| | | ////空æä»»å¡éä¿®æ¹é»è¾ |
| | | if (station2.stationCode.Contains("X")) |
| | | station2.quantity = 0;// task.agv_tasktype.Contains("TaskType_EmptyPallet") ? 0 : task.agv_qty; //task.agv_qty; |
| | | else if (station2.area == "10" || station2.area == "11" || (station2.stationCode.Contains("C") && task.agv_tasktype == "TaskType_EmptyPallet")) //å
¥åºç©ºæä»»å¡ |
| | | else if (station2.area == "10" || station2.area == "11" || (station2.stationCode.Contains("C") && task.agv_tasktype == "TaskType_EmptyPallet") || station2.stationCode.Contains("DD")) //å
¥åºç©ºæä»»å¡ |
| | | station2.quantity = station2.quantity + task.agv_qty; |
| | | else |
| | | station2.quantity = task.agv_qty; |
| | |
| | | //else |
| | | // station1.quantity = 0; |
| | | #endregion |
| | | |
| | | if (station1.area == "10" || station1.area == "11" || (station1.stationCode.Contains("C") && task.agv_tasktype == "TaskType_EmptyPallet")) //åºåºç©ºæä»»å¡ |
| | | if (station1.stationCode.Contains("DD"))//å çåºä½ |
| | | { |
| | | station1.quantity = station1.quantity - task.agv_qty; |
| | | station1.location_state = LocationStateEnum.Stroge.ToString(); |
| | | } |
| | | else if (station1.area == "10" || station1.area == "11" || (station1.stationCode.Contains("C") && task.agv_tasktype == "TaskType_EmptyPallet")) //åºåºç©ºæä»»å¡ |
| | | { |
| | | station1.location_state = LocationStateEnum.Stroge.ToString(); |
| | | station1.quantity = station1.quantity - 1; |
| | |
| | | using Confluent.Kafka; |
| | | using Newtonsoft.Json; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.Text; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Operators; |
| | | using WIDESEA_Comm.LogInfo; |
| | | using WIDESEA_Comm.MES_Info; |
| | | using WIDESEA_Comm.MES_Info.Request; |
| | | using WIDESEA_Common; |
| | | using WIDESEA_Core.EFDbContext; |
| | | using WIDESEA_Core.FreeDB; |
| | | using WIDESEA_Entity.DomainModels; |
| | | using WIDESEA_Entity.ToAGV; |
| | | using WIDESEA_WMS.IRepositories; |
| | | using WIDESEA_WMS.Repositories; |
| | | using static WIDESEA_Comm.MES_Info.BasicSN; |
| | | |
| | | namespace WIDESEA_WMS.Common.AGVTask |
| | |
| | | { |
| | | throw new Exception("æ 任塿°æ®"); |
| | | } |
| | | |
| | | VOLContext context = new VOLContext(); |
| | | IVV_Mes_WorkinfoRepository workinfoRepository = new VV_Mes_WorkinfoRepository(context); |
| | | if (task.agv_tasktype == AGVTaskTypeEnum.TaskType_Outbound.ToString() /*|| task.agv_tasktype == AGVTaskTypeEnum.TaskType_OutsourceOutbound.ToString()*/|| task.agv_tasktype == AGVTaskTypeEnum.TaskType_OutsourceCarry.ToString()) |
| | | { |
| | | foreach (var item in task.bindSN.Split(",")) |
| | | if(task.agv_tasktype == AGVTaskTypeEnum.TaskType_Outbound.ToString()) |
| | | { |
| | | detail detail = new detail(); |
| | | detail.sn = item; |
| | | list.Add(detail); |
| | | foreach (var item in task.bindSN.Split(",")) |
| | | { |
| | | var work = workinfoRepository.Find(x => x.SN == item && x.processCode == task.agv_worktype.ToString()).FirstOrDefault(); |
| | | detail detail = new detail(); |
| | | detail.sn = item; |
| | | detail.jobID = work.jobID; |
| | | detail.processCode = work.processCode; |
| | | list.Add(detail); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | foreach (var item in task.bindSN.Split(",")) |
| | | { |
| | | //var work = workinfoRepository.Find(x => x.SN == item && x.processCode == "28").FirstOrDefault(); |
| | | detail detail = new detail(); |
| | | detail.sn = item; |
| | | detail.jobID = task.jobID; |
| | | detail.processCode = task.agv_worktype.ToString(); |
| | | list.Add(detail); |
| | | } |
| | | } |
| | | |
| | | agvInWarehousePara outWarehousePara = new agvInWarehousePara() |
| | | { |
| | | JobID = task.jobID, |
| | | WorkOrder = task.jobID, |
| | | zoneID = task.agv_fromaddress, |
| | | processCode = task.agv_worktype.ToString(), |
| | | //processCode = task.agv_worktype.ToString(), |
| | | details = list, |
| | | layerNo = 1, |
| | | stackID = "1", |
| | | warehouseName = "Agvåº", |
| | | Operator="AGVèªå¨", |
| | | }; |
| | | obj = outWarehousePara; |
| | | ActionName = "agvOutWarehouse";//AGV->MES车轮åºåº |
| | |
| | | { |
| | | foreach (var item in task.bindSN.Split(",")) |
| | | { |
| | | var work = workinfoRepository.Find(x => x.SN == item && x.processCode == task.agv_worktype.ToString()).FirstOrDefault(); |
| | | detail detail = new detail(); |
| | | detail.sn = item; |
| | | detail.jobID = work.jobID; |
| | | detail.processCode = work.processCode; |
| | | list.Add(detail); |
| | | } |
| | | agvInWarehousePara inWarehousePara = new agvInWarehousePara() |
| | | { |
| | | JobID = task.jobID, |
| | | WorkOrder = task.jobID, |
| | | zoneID = task.agv_toaddress, |
| | | processCode = task.agv_worktype.ToString(), |
| | | //processCode = task.agv_worktype.ToString(), |
| | | details = list, |
| | | layerNo = 1, |
| | | stackID = "1", |
| | | warehouseName = "Agvåº", |
| | | Operator = "AGVèªå¨", |
| | | }; |
| | | obj = inWarehousePara; |
| | | ActionName = "agvInWarehouse";//AGV->MES车轮å
¥åº |
| | |
| | | //else if (task.agv_tasktype == "Transfer") //ç§»åºåºå åºå
ç§»åº |
| | | else if (task.agv_tasktype == AGVTaskTypeEnum.TaskType_Carry.ToString()) //ç§»åºåºå åºå
ç§»åº |
| | | { |
| | | List<detail1> list1 = new List<detail1>(); //è½¦è½®ä¿¡æ¯ |
| | | foreach (var item in task.bindSN.Split(",")) |
| | | { |
| | | detail detail = new detail(); |
| | | detail1 detail = new detail1(); |
| | | detail.sn = item; |
| | | list.Add(detail); |
| | | list1.Add(detail); |
| | | } |
| | | agvMoveWarehousePara moveWarehousePara = new agvMoveWarehousePara() |
| | | { |
| | | fromZoneID = task.agv_fromaddress, |
| | | toZoneID = task.agv_toaddress, |
| | | details = list, |
| | | details = list1, |
| | | fromLayerNo = "1", |
| | | fromStackID = "1", |
| | | fromWarehouseName = "Agvåº", |
| | | toLayerNo = "1", |
| | | toStackID = "1", |
| | | toWarehouseName = "Agvåº", |
| | | Operator = "AGVèªå¨", |
| | | }; |
| | | obj = moveWarehousePara; |
| | | ActionName = "agvMoveWarehouse";//AGV->MESè½¦è½®ç§»åº |
| | |
| | | station.heatNumber = string.Empty; |
| | | station.Number = string.Empty; |
| | | } |
| | | station.tray_status = list.Count == 0 ? "EmptyTray" : "StrogeTray"; |
| | | station.tray_status = string.IsNullOrEmpty(station.stationType) ? "EmptyTray" : "StrogeTray"; |
| | | //station.tray_status = list.Count == 0 ? "EmptyTray" : "StrogeTray"; |
| | | if (station.location_state == "Empty") |
| | | { |
| | | station.stationType = string.Empty; |
| | |
| | | station.tray_status = string.Empty; |
| | | station.bindSN = string.Empty; |
| | | station.quantity = 0; |
| | | if (!station.stationCode.Contains("S") && !station.stationCode.Contains("X") && !station.stationCode.Contains("W01001004") && !station.stationCode.Contains("W01001005")) |
| | | station.tray_type = string.Empty; |
| | | //if (!station.stationCode.Contains("S") && !station.stationCode.Contains("X") && !station.stationCode.Contains("W01001004") && !station.stationCode.Contains("W01001005")) |
| | | // station.tray_type = string.Empty; |
| | | } |
| | | var count = _repository.Update(station, true); |
| | | if (count > 0) |