Merge branch 'master' into wxw
| | |
| | | public string? Text { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 是否启用 |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "Enable", ColumnDescription = "是否启用")] |
| | | public YesNoEnum Enable { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 是否连接 |
| | | /// </summary> |
| | | [SugarColumn(IsIgnore = true)] |
| | |
| | | // 用于保存每个设备的初始状态 |
| | | var initialStates = new Dictionary<long, WcsDeviceOutput>(); |
| | | |
| | | var listPlc = _db.Queryable<WcsPlc>().Where(s => s.Type == PLCTypeEnum.StackingMachine || s.Type == PLCTypeEnum.ConveyorLine).ToList(); |
| | | var listPlc = _db.Queryable<WcsPlc>().Where(s => s.Type == PLCTypeEnum.StackingMachine || s.Type == PLCTypeEnum.ConveyorLine).Where(s => s.Enable == YesNoEnum.Y).ToList(); |
| | | var listPlcId = listPlc.Select(s => s.Id).ToList(); |
| | | var listPlcDevice = _db.Queryable<WcsDevice>().Where(s => s.DeviceType == DeviceTypeEnum.Business && listPlcId.Contains(s.PlcId)).Select<WcsDeviceOutput>().ToList(); |
| | | var listPlcDeviceId = listPlcDevice.Select(s => s.Id).ToList(); |
| | |
| | | { |
| | | (result, var palletNo) = modConn.GetPlcDBValue(modPositionPalletNo.PosType, modDevice.DbNumber, modPositionPalletNo.PlcPos, modPositionPalletNo.StringLength); |
| | | modDevice.PalletNo = Convert.ToString(palletNo); |
| | | Console.WriteLine(modDevice.DbNumber + "." + modPositionPalletNo.PlcPos + "----------"); |
| | | } |
| | | if (modPlc.Type == PLCTypeEnum.ConveyorLine) |
| | | { |
| | |
| | | if (initialStates.TryGetValue(modDevice.Id, out var initialState)) |
| | | { |
| | | if (modDevice.Status != initialState.Status || |
| | | modDevice.Plc != initialState.Plc || |
| | | (!modDevice.Plc.IsNullOrEmpty() && modDevice.Plc != initialState.Plc) || |
| | | modDevice.Wcs != initialState.Wcs || |
| | | modDevice.TaskNo != initialState.TaskNo || |
| | | modDevice.TaskType != initialState.TaskType || |
| | |
| | | public class ResponseTasks |
| | | { |
| | | public string StatusCode { get; set; } |
| | | public string Success { get; set; } |
| | | public int Success { get; set; } |
| | | |
| | | public string Message { get; set; } |
| | | |
| | | public WcsTask TaskList { get; set; } |
| | | public ResponseTasksModel TaskList { get; set; } |
| | | } |
| | | |
| | | public class ResponseTasksModel |
| | | { |
| | | /// <summary> |
| | | /// 任务号 |
| | | /// </summary> |
| | | public string TaskNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 任务类型 |
| | | /// </summary> |
| | | public string TaskType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 托盘号 |
| | | /// </summary> |
| | | public string PalletNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 起始位置 |
| | | /// </summary> |
| | | public string StartLocate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 起始巷道 |
| | | /// </summary> |
| | | public string StartRoadway { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 结束位置 |
| | | /// </summary> |
| | | public string EndLocate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 目标巷道 |
| | | /// </summary> |
| | | public string EndRoadway { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 出库口 |
| | | /// </summary> |
| | | public string OutMode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 顺序-优先级 |
| | | /// </summary> |
| | | public int Order { get; set; } |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 申请入库任务 巷道或储位 |
| | | /// </summary> |
| | |
| | | public static string GetRoadwayByStationNew(string StationNum) |
| | | { |
| | | string value = ""; |
| | | var conveyList1 = new List<string>() { "147", "145", "139", "137", "129", "127", "121", "119", "111", "109", "103", "101", "093", "091", "085", "083", "075", "073", "067", "065" }; |
| | | var conveyList2 = new List<string>() { "252", "254", "260", "262", "272", "270", "278", "280", "288", "290", "294", "301", "307", "309", "315", "317", "325", "327", "331", "337" }; |
| | | var conveyList3 = new List<string>() { "401", "402", "405", "406", "409", "410", "413", "414", "417", "418", "421", "422", "425", "426", "429", "430", "433", "434", "437", "438" }; |
| | | //var conveyList1 = new List<string>() { "147", "145", "139", "137", "129", "127", "121", "119", "111", "109", "103", "101", "093", "091", "085", "083", "075", "073", "067", "065" }; |
| | | //var conveyList2 = new List<string>() { "252", "254", "260", "262", "272", "270", "278", "280", "288", "290", "294", "301", "307", "309", "315", "317", "325", "327", "331", "337" }; |
| | | //var conveyList3 = new List<string>() { "401", "402", "405", "406", "409", "410", "413", "414", "417", "418", "421", "422", "425", "426", "429", "430", "433", "434", "437", "438" }; |
| | | |
| | | if (conveyList1.Contains(StationNum)) |
| | | var ipInfo = _db.Queryable<WcsPlc>().Where(s => s.Type == PLCTypeEnum.StackingMachine || s.Type == PLCTypeEnum.ConveyorLine || s.Type == PLCTypeEnum.BoxConveyorLine); |
| | | var ip1 = ipInfo.First(m=>m.Text == "1层托盘输送线"); |
| | | var ip2 = ipInfo.First(m=>m.Text == "2层托盘输送线"); |
| | | var ip3 = ipInfo.First(m=>m.Text == "3层托盘输送线"); |
| | | |
| | | var dev1 = PLCTaskAction.plcDevices.Where(m => m.IsDelete == false && m.PlcId == ip1.Id).Select(m=>m.StationNum).ToList(); |
| | | var dev2 = PLCTaskAction.plcDevices.Where(m => m.IsDelete == false && m.PlcId == ip2.Id).Select(m => m.StationNum).ToList(); |
| | | var dev3 = PLCTaskAction.plcDevices.Where(m => m.IsDelete == false && m.PlcId == ip3.Id).Select(m => m.StationNum).ToList(); |
| | | |
| | | if (dev1.Contains(StationNum)) |
| | | { |
| | | value = "1"; |
| | | } |
| | | else if (conveyList2.Contains(StationNum)) |
| | | else if (dev2.Contains(StationNum)) |
| | | { |
| | | value = "2"; |
| | | } |
| | | else if (conveyList3.Contains(StationNum)) |
| | | else if (dev3.Contains(StationNum)) |
| | | { |
| | | value = "3"; |
| | | } |
| | |
| | | private static void ConveyorLine(WcsDeviceDto modDevice) |
| | | { |
| | | var plcConn = modDevice.PLCUtil; |
| | | // 获取楼层数 |
| | | // 获取楼层数ceshi |
| | | var louCeng = PLCCommon.GetRoadwayByStationNew(modDevice.StationNum); |
| | | switch (modDevice.Value.ToString()) |
| | | { |
| | |
| | | } |
| | | string pallet = palletVal.ToString(); |
| | | // 获取任务信息 |
| | | var modTask = _db.Queryable<WcsTask>().First(s => s.IsDelete == false && s.PalletNo == pallet && (s.Status == TaskStatusEnum.Wait || s.Status == TaskStatusEnum.Doing) && s.TaskType == TaskTypeEnum.In && s.StartRoadway == modDevice.StationNum); |
| | | var modTask = _db.Queryable<WcsTask>().First(s => s.IsDelete == false && s.PalletNo == pallet && (s.Status == TaskStatusEnum.Wait || s.Status == TaskStatusEnum.Doing) && s.TaskType == TaskTypeEnum.In); |
| | | if (modTask == null) |
| | | { |
| | | // 此托盘没有对应的转移任务 led显示 |
| | |
| | | // 任务号、任务类型、托盘号 |
| | | var modPosTask = modDevice.listStation.FirstOrDefault(s => s.Text == "任务号"); |
| | | listResult.Add(plcConn.SetPlcDBValue(modPosTask.PosType, modDevice.DbNumber, modPosTask.PlcPos, modTask.TaskNo)); |
| | | var modPosTaskType = modDevice.listStation.FirstOrDefault(s => s.Text == "任务号"); |
| | | listResult.Add(plcConn.SetPlcDBValue(modPosTaskType.PosType, modDevice.DbNumber, modPosTaskType.PlcPos, modTask.TaskType.ToString())); |
| | | var modPosTaskType = modDevice.listStation.FirstOrDefault(s => s.Text == "任务类型"); |
| | | var taskTypeStr = (int)modTask.TaskType; |
| | | listResult.Add(plcConn.SetPlcDBValue(modPosTaskType.PosType, modDevice.DbNumber, modPosTaskType.PlcPos, taskTypeStr.ToString())); |
| | | var modPosPalletNo = modDevice.listStation.FirstOrDefault(s => s.Text == "托盘码"); |
| | | listResult.Add(plcConn.SetPlcDBValue(modPosPalletNo.PosType, modDevice.DbNumber, modPosPalletNo.PlcPos, modTask.PalletNo)); |
| | | // 起始工位、目的工位 |
| | |
| | | // 获取工位托盘码信息 |
| | | var modPosPallet = modDevice.listStation.FirstOrDefault(m => m.Text == "托盘码"); |
| | | var (res, palletVal) = plcConn.GetPlcDBValue(PLCDataTypeEnum.String, modDevice.DbNumber, modPosPallet.PlcPos); |
| | | // 获取工位托盘码信息 |
| | | // 获取工位任务号信息 |
| | | var modPosTaskNo = modDevice.listStation.FirstOrDefault(m => m.Text == "任务号"); |
| | | var (taskRes, taskNoVal) = plcConn.GetPlcDBValue(PLCDataTypeEnum.String, modDevice.DbNumber, modPosTaskNo.PlcPos); |
| | | if (!res.IsSucceed || !taskRes.IsSucceed ) |
| | |
| | | var modPosTask = djInfos.FirstOrDefault(s => s.Text == "任务号"); |
| | | listResult.Add(plcStackeConn.SetPlcDBValue(modPosTask.PosType, djMod.DbNumber, modPosTask.PlcPos, modTask.TaskNo)); |
| | | var modPosTaskType = djInfos.FirstOrDefault(s => s.Text == "任务类型"); |
| | | listResult.Add(plcStackeConn.SetPlcDBValue(modPosTaskType.PosType, djMod.DbNumber, modPosTaskType.PlcPos, modTask.TaskType.ToString())); |
| | | var taskTypeStr = (int)modTask.TaskType; |
| | | listResult.Add(plcStackeConn.SetPlcDBValue(modPosTaskType.PosType, djMod.DbNumber, modPosTaskType.PlcPos, taskTypeStr.ToString())); |
| | | var modPosPalletNo = djInfos.FirstOrDefault(s => s.Text == "托盘号"); |
| | | listResult.Add(plcStackeConn.SetPlcDBValue(modPosPallet.PosType, djMod.DbNumber, modPosPallet.PlcPos, modTask.PalletNo)); |
| | | listResult.Add(plcStackeConn.SetPlcDBValue(modPosPalletNo.PosType, djMod.DbNumber, modPosPalletNo.PlcPos, modTask.PalletNo)); |
| | | |
| | | //起始工位 |
| | | var modPosStrStationNum = djInfos.FirstOrDefault(s => s.Text == "取货排"); |
| | | var modPosStrStationNum = djInfos.FirstOrDefault(s => s.Text == "起始工位"); |
| | | listResult.Add(plcStackeConn.SetPlcDBValue(modPosStrStationNum.PosType, djMod.DbNumber, modPosStrStationNum.PlcPos, modDevice.StationNum)); |
| | | |
| | | //取货排、列、层 |
| | |
| | | public static void Init() |
| | | { |
| | | cts.Cancel(); |
| | | listPlc = _db.Queryable<WcsPlc>().Where(s => s.Type == PLCTypeEnum.StackingMachine || s.Type == PLCTypeEnum.ConveyorLine || s.Type == PLCTypeEnum.BoxConveyorLine).ToList(); |
| | | listPlc = _db.Queryable<WcsPlc>() |
| | | .Where(s => s.Type == PLCTypeEnum.StackingMachine || s.Type == PLCTypeEnum.ConveyorLine || s.Type == PLCTypeEnum.BoxConveyorLine) |
| | | .Where(s => s.Enable == YesNoEnum.Y) |
| | | .ToList(); |
| | | listPlcDevice = _db.Queryable<WcsDevice>().ToList(); |
| | | listPlcPosition = _db.Queryable<WcsPosition>().ToList(); |
| | | listAlarmInfo = _db.Queryable<WcsAlarmInfo>().ToList(); |
| | |
| | | address = DbNumber + "." + Pos; |
| | | else |
| | | address = DbNumber + Pos; |
| | | return this.SetPlcDBValue(PosType, address, Pos, Value); |
| | | return this.SetPlcDBValue(PosType, address, Value); |
| | | } |
| | | /// <summary> |
| | | /// 写入PLC值 |
| | |
| | | var listPosition = await _wcsDeviceRep.Context.Queryable<WcsPosition>().Where(s => s.DeviceId == modDevice.Id).ToListAsync(); |
| | | var result = new IoTClient.Result(); |
| | | //任务号 |
| | | if (!modDevice.TaskNo.IsNullOrEmpty()) |
| | | if (modDevice.TaskNo != null) |
| | | { |
| | | var modPositionTask = listPosition.FirstOrDefault(s => s.Text == "任务号"); |
| | | if (modPositionTask != null) |
| | | result = modUtil.SetPlcDBValue(modPositionTask.PosType, modDbDevice.DbNumber + "." + modPositionTask.PlcPos, modDevice.TaskNo); |
| | | result = modUtil.SetPlcDBValue(modPositionTask.PosType, modDbDevice.DbNumber, modPositionTask.PlcPos, modDevice.TaskNo); |
| | | } |
| | | //任务类型 |
| | | if (!modDevice.TaskType.IsNullOrEmpty()) |
| | | if (modDevice.TaskType != null) |
| | | { |
| | | var modPositionTaskType = listPosition.FirstOrDefault(s => s.Text == "任务类型"); |
| | | if (modPositionTaskType != null) |
| | | result = modUtil.SetPlcDBValue(modPositionTaskType.PosType, modDbDevice.DbNumber + "." + modPositionTaskType.PlcPos, ((int)modDevice.TaskType).ToString()); |
| | | result = modUtil.SetPlcDBValue(modPositionTaskType.PosType, modDbDevice.DbNumber, modPositionTaskType.PlcPos, ((int)modDevice.TaskType).ToString()); |
| | | } |
| | | //起始工位 |
| | | if (!modDevice.StartLocatNo.IsNullOrEmpty()) |
| | | if (modDevice.StartLocatNo != null) |
| | | { |
| | | var modPositionStartLocatNo = listPosition.FirstOrDefault(s => s.Text == "起始工位"); |
| | | if (modPositionStartLocatNo != null) |
| | | result = modUtil.SetPlcDBValue(modPositionStartLocatNo.PosType, modDbDevice.DbNumber + "." + modPositionStartLocatNo.PlcPos, modDevice.StartLocatNo.ToString()); |
| | | result = modUtil.SetPlcDBValue(modPositionStartLocatNo.PosType, modDbDevice.DbNumber, modPositionStartLocatNo.PlcPos, modDevice.StartLocatNo.ToString()); |
| | | } |
| | | //目的工位 |
| | | if (!modDevice.EndLocatNo.IsNullOrEmpty()) |
| | | if (modDevice.EndLocatNo != null) |
| | | { |
| | | var modPositionEndLocatNo = listPosition.FirstOrDefault(s => s.Text == "目的工位"); |
| | | if (modPositionEndLocatNo != null) |
| | | result = modUtil.SetPlcDBValue(modPositionEndLocatNo.PosType, modDbDevice.DbNumber + "." + modPositionEndLocatNo.PlcPos, modDevice.EndLocatNo.ToString()); |
| | | result = modUtil.SetPlcDBValue(modPositionEndLocatNo.PosType, modDbDevice.DbNumber, modPositionEndLocatNo.PlcPos, modDevice.EndLocatNo.ToString()); |
| | | } |
| | | //托盘码 |
| | | if (!modDevice.PalletNo.IsNullOrEmpty()) |
| | | if (modDevice.PalletNo != null) |
| | | { |
| | | var modPositionPalletNo = listPosition.FirstOrDefault(s => s.Text == "托盘码"); |
| | | if (modPositionPalletNo != null) |
| | | result = modUtil.SetPlcDBValue(modPositionPalletNo.PosType, modDbDevice.DbNumber + "." + modPositionPalletNo.PlcPos, modDevice.PalletNo.ToString()); |
| | | result = modUtil.SetPlcDBValue(modPositionPalletNo.PosType, modDbDevice.DbNumber, modPositionPalletNo.PlcPos, modDevice.PalletNo.ToString()); |
| | | } |
| | | if (modDevice.Plc != null) |
| | | { |
| | | var modPositionPLC = listPosition.FirstOrDefault(s => s.Text == "PLC流程字"); |
| | | if (modPositionPLC != null) |
| | | result = modUtil.SetPlcDBValue(modPositionPLC.PosType, modDbDevice.DbNumber, modPositionPLC.PlcPos, modDevice.Plc); |
| | | } |
| | | if (modDevice.Wcs != null) |
| | | { |
| | | var modPositionWCS = listPosition.FirstOrDefault(s => s.Text == "WCS流程字"); |
| | | if (modPositionWCS != null) |
| | | result = modUtil.SetPlcDBValue(modPositionWCS.PosType, modDbDevice.DbNumber, modPositionWCS.PlcPos, modDevice.Wcs); |
| | | } |
| | | if (modPlc.Type == PLCTypeEnum.ConveyorLine) |
| | | { |
| | |
| | | { |
| | | var modPositionReleaseRow = listPosition.FirstOrDefault(s => s.Text == "放货排"); |
| | | if (modPositionReleaseRow != null) |
| | | modUtil.SetPlcDBValue(modPositionReleaseRow.PosType, modDbDevice.DbNumber + "." + modPositionReleaseRow.PlcPos, modDevice.ReleaseRow.ToString()); |
| | | modUtil.SetPlcDBValue(modPositionReleaseRow.PosType, modDbDevice.DbNumber, modPositionReleaseRow.PlcPos, modDevice.ReleaseRow.ToString()); |
| | | } |
| | | //放货列 |
| | | if (modDevice.ReleaseCol != null) |
| | | { |
| | | var modPositionReleaseCol = listPosition.FirstOrDefault(s => s.Text == "放货列"); |
| | | if (modPositionReleaseCol != null) |
| | | modUtil.SetPlcDBValue(modPositionReleaseCol.PosType, modDbDevice.DbNumber + "." + modPositionReleaseCol.PlcPos, modDevice.ReleaseCol.ToString()); |
| | | modUtil.SetPlcDBValue(modPositionReleaseCol.PosType, modDbDevice.DbNumber, modPositionReleaseCol.PlcPos, modDevice.ReleaseCol.ToString()); |
| | | } |
| | | //放货层 |
| | | if (modDevice.ReleaseStorey != null) |
| | | { |
| | | var modPositionReleaseStorey = listPosition.FirstOrDefault(s => s.Text == "放货层"); |
| | | if (modPositionReleaseStorey != null) |
| | | modUtil.SetPlcDBValue(modPositionReleaseStorey.PosType, modDbDevice.DbNumber + "." + modPositionReleaseStorey.PlcPos, modDevice.ReleaseStorey.ToString()); |
| | | modUtil.SetPlcDBValue(modPositionReleaseStorey.PosType, modDbDevice.DbNumber, modPositionReleaseStorey.PlcPos, modDevice.ReleaseStorey.ToString()); |
| | | } |
| | | //取货排 |
| | | if (modDevice.PickRow != null) |
| | | { |
| | | var modPositionPickRow = listPosition.FirstOrDefault(s => s.Text == "取货排"); |
| | | if (modPositionPickRow != null) |
| | | modUtil.SetPlcDBValue(modPositionPickRow.PosType, modDbDevice.DbNumber + "." + modPositionPickRow.PlcPos, modDevice.PickRow.ToString()); |
| | | modUtil.SetPlcDBValue(modPositionPickRow.PosType, modDbDevice.DbNumber, modPositionPickRow.PlcPos, modDevice.PickRow.ToString()); |
| | | } |
| | | //取货列 |
| | | if (modDevice.PickCol != null) |
| | | { |
| | | var modPositionPickCol = listPosition.FirstOrDefault(s => s.Text == "取货列"); |
| | | if (modPositionPickCol != null) |
| | | modUtil.SetPlcDBValue(modPositionPickCol.PosType, modDbDevice.DbNumber + "." + modPositionPickCol.PlcPos, modDevice.PickCol.ToString()); |
| | | modUtil.SetPlcDBValue(modPositionPickCol.PosType, modDbDevice.DbNumber, modPositionPickCol.PlcPos, modDevice.PickCol.ToString()); |
| | | } |
| | | //取货层 |
| | | if (modDevice.PickStorey != null) |
| | | { |
| | | var modPositionPickStorey = listPosition.FirstOrDefault(s => s.Text == "取货层"); |
| | | if (modPositionPickStorey != null) |
| | | modUtil.SetPlcDBValue(modPositionPickStorey.PosType, modDbDevice.DbNumber + "." + modPositionPickStorey.PlcPos, modDevice.PickStorey.ToString()); |
| | | modUtil.SetPlcDBValue(modPositionPickStorey.PosType, modDbDevice.DbNumber, modPositionPickStorey.PlcPos, modDevice.PickStorey.ToString()); |
| | | } |
| | | } |
| | | modUtil.Close(); |
| | |
| | | /// </summary> |
| | | public string? Text { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 是否启用 |
| | | /// </summary> |
| | | public YesNoEnum Enable { get; set; } |
| | | } |
| | |
| | | /// </summary> |
| | | public virtual string? Text { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 是否启用 |
| | | /// </summary> |
| | | public virtual YesNoEnum Enable { get; set; } |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | public PLCTypeEnum? Type { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 是否启用 |
| | | /// </summary> |
| | | public YesNoEnum? Enable { get; set; } |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | [Required(ErrorMessage = "设备类型不能为空")] |
| | | public override PLCTypeEnum Type { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 是否启用 |
| | | /// </summary> |
| | | [Required(ErrorMessage = "是否启用不能为空")] |
| | | public override YesNoEnum Enable { get; set; } |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | public string? Text { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 是否启用 |
| | | /// </summary> |
| | | public YesNoEnum Enable { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 创建时间 |
| | | /// </summary> |
| | | public DateTime? CreateTime { get; set; } |
| | |
| | | input.SearchKey = input.SearchKey?.Trim(); |
| | | var query = _wcsPlcRep.AsQueryable() |
| | | .WhereIF(!string.IsNullOrEmpty(input.SearchKey), u => |
| | | u.IP.Contains(input.SearchKey) |
| | | u.IP.Contains(input.SearchKey) && u.Text.Contains(input.SearchKey) |
| | | ) |
| | | .WhereIF(input.PLCType.HasValue, u => u.PLCType == input.PLCType) |
| | | .WhereIF(!string.IsNullOrWhiteSpace(input.IP), u => u.IP.Contains(input.IP.Trim())) |
| | | .WhereIF(input.Type.HasValue, u => u.Type == input.Type) |
| | | .WhereIF(input.Enable.HasValue, u => u.Enable == input.Enable) |
| | | .Select<WcsPlcOutput>(); |
| | | return await query.OrderBuilder(input).ToPagedListAsync(input.Page, input.PageSize); |
| | | } |
| | |
| | | using Furion.Logging; |
| | | using Elastic.Clients.Elasticsearch; |
| | | using Furion.Logging; |
| | | using Furion.RemoteRequest.Extensions; |
| | | using Newtonsoft.Json; |
| | | using System.Text; |
| | |
| | | string url = Urls.WMSAddress + ":" + Urls.WMSPort; |
| | | var result = (url + "/api/DownAPi/RequestRoadWay").SetBody(model, "application/json", Encoding.UTF8).PostAsAsync<ResponseTasks>().Result; |
| | | Log.Information("调用WMS接口反馈任务接口" + result.ToJson()); |
| | | if (result.StatusCode == "0") |
| | | if (result.Success == 0) |
| | | { |
| | | |
| | | var taskAdd = new WcsTask() |
| | | { |
| | | TaskType = TaskTypeEnum.In, |
| | | Status = TaskStatusEnum.Wait, |
| | | Origin = "WMS", |
| | | StartLocate = startLocat, |
| | | PalletNo = palletNo, |
| | | TaskNo = result.TaskList.TaskNo, |
| | | EndLocate = result.TaskList.EndLocate, |
| | | EndRoadway = result.TaskList.EndRoadway |
| | |
| | | endLocat = PLCCommon.RoadwayToStationNum(endLocat, ceng); |
| | | |
| | | return returnStr; |
| | | // 确定目标工位//需添加层数确认 |
| | | //switch (endLocat) |
| | | //{ |
| | | // case "R01": |
| | | // if (ceng == "1") |
| | | // { |
| | | // endLocat = "145"; |
| | | // } |
| | | // else if (ceng == "2") |
| | | // { |
| | | // endLocat = "252"; |
| | | // } |
| | | // else if (ceng == "3") |
| | | // { |
| | | // endLocat = "101"; |
| | | // } |
| | | // break; |
| | | // case "R02": |
| | | // if (ceng == "1") |
| | | // { |
| | | // endLocat = "137"; |
| | | // } |
| | | // else if (ceng == "2") |
| | | // { |
| | | // endLocat = "260"; |
| | | // } |
| | | // else if (ceng == "3") |
| | | // { |
| | | // endLocat = "405"; |
| | | // } |
| | | // break; |
| | | // case "R03": |
| | | // if (ceng == "1") |
| | | // { |
| | | // endLocat = "127"; |
| | | // } |
| | | // else if (ceng == "2") |
| | | // { |
| | | // endLocat = "270"; |
| | | // } |
| | | // else if (ceng == "3") |
| | | // { |
| | | // endLocat = "409"; |
| | | // } |
| | | // break; |
| | | // case "R04": |
| | | // if (ceng == "1") |
| | | // { |
| | | // endLocat = "119"; |
| | | // } |
| | | // else if (ceng == "2") |
| | | // { |
| | | // endLocat = "278"; |
| | | // } |
| | | // else if (ceng == "3") |
| | | // { |
| | | // endLocat = "413"; |
| | | // } |
| | | // break; |
| | | // case "R05": |
| | | // if (ceng == "1") |
| | | // { |
| | | // endLocat = "109"; |
| | | // } |
| | | // else if (ceng == "2") |
| | | // { |
| | | // endLocat = "288"; |
| | | // } |
| | | // else if (ceng == "3") |
| | | // { |
| | | // endLocat = "417"; |
| | | // } |
| | | // break; |
| | | // case "R06": |
| | | // if (ceng == "1") |
| | | // { |
| | | // endLocat = "101"; |
| | | // } |
| | | // else if (ceng == "2") |
| | | // { |
| | | // endLocat = "301"; |
| | | // } |
| | | // else if (ceng == "3") |
| | | // { |
| | | // endLocat = "421"; |
| | | // } |
| | | // break; |
| | | // case "R07": |
| | | // if (ceng == "1") |
| | | // { |
| | | // endLocat = "091"; |
| | | // } |
| | | // else if (ceng == "2") |
| | | // { |
| | | // endLocat = "307"; |
| | | // } |
| | | // else if (ceng == "3") |
| | | // { |
| | | // endLocat = "425"; |
| | | // } |
| | | // break; |
| | | // case "R08": |
| | | // if (ceng == "1") |
| | | // { |
| | | // endLocat = "083"; |
| | | // } |
| | | // else if (ceng == "2") |
| | | // { |
| | | // endLocat = "315"; |
| | | // } |
| | | // else if (ceng == "3") |
| | | // { |
| | | // endLocat = "429"; |
| | | // } |
| | | // break; |
| | | // case "R09": |
| | | // if (ceng == "1") |
| | | // { |
| | | // endLocat = "073"; |
| | | // } |
| | | // else if (ceng == "2") |
| | | // { |
| | | // endLocat = "325"; |
| | | // } |
| | | // else if (ceng == "3") |
| | | // { |
| | | // endLocat = "433"; |
| | | // } |
| | | // break; |
| | | // case "R10": |
| | | // if (ceng == "1") |
| | | // { |
| | | // endLocat = "065"; |
| | | // } |
| | | // else if (ceng == "2") |
| | | // { |
| | | // endLocat = "337"; |
| | | // } |
| | | // else if (ceng == "3") |
| | | // { |
| | | // endLocat = "437"; |
| | | // } |
| | | // break; |
| | | //} |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | string url = Urls.WMSAddress + ":" + Urls.WMSPort; |
| | | var result = (url + "/api/DownAPi/RequestLocation").SetBody(model, "application/json", Encoding.UTF8).PostAsAsync<ResponseTasks>().Result; |
| | | Log.Information("调用WMS申请储位接口反馈任务接口" + result.ToJson()); |
| | | if (result.StatusCode == "0") |
| | | if (result.Success == 0) |
| | | { |
| | | |
| | | var taskAdd = new WcsTask() |
| | | |
| | | var taskUp = _db.Queryable<WcsTask>().First(m => m.IsDelete == false && m.TaskNo == result.TaskList.TaskNo); |
| | | if (taskUp == null) |
| | | { |
| | | TaskType = TaskTypeEnum.In, |
| | | Origin = "WMS", |
| | | StartLocate = startLocat, |
| | | TaskNo = result.TaskList.TaskNo, |
| | | EndLocate = result.TaskList.EndLocate, |
| | | EndRoadway = result.TaskList.EndRoadway |
| | | }; |
| | | var taskAdd = new WcsTask() |
| | | { |
| | | TaskNo = result.TaskList.TaskNo, |
| | | TaskType = TaskTypeEnum.In, |
| | | Status = TaskStatusEnum.Wait, |
| | | //IsSuccess =TaskSuccessEnum.Success, |
| | | Origin = "WMS", |
| | | StartLocate = startLocat, |
| | | PalletNo = palletNo, |
| | | EndLocate = result.TaskList.EndLocate, |
| | | EndRoadway = result.TaskList.EndRoadway |
| | | }; |
| | | _db.Insertable(taskAdd).ExecuteCommand(); |
| | | } |
| | | else |
| | | { |
| | | taskUp.EndRoadway = result.TaskList.EndRoadway; |
| | | taskUp.EndLocate = result.TaskList.EndLocate; |
| | | _db.Updateable(taskUp).ExecuteCommand(); |
| | | } |
| | | |
| | | _db.Updateable(taskAdd).ExecuteCommand(); |
| | | |
| | | returnStr = result.TaskList.EndLocate; |
| | | taskNo = result.TaskList.TaskNo; |
| | | } |
| | |
| | | </el-form-item> |
| | | |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="是否启用" prop="enable"> |
| | | <el-select clearable v-model="ruleForm.enable" placeholder="请选择是否启用"> |
| | | <el-option v-for="(item, index) in dl('YesNoEnum')" :key="index" |
| | | :value="Number(item.value)" |
| | | :label="`${item.name} (${item.code}) [${item.value}]`"></el-option> |
| | | |
| | | </el-select> |
| | | |
| | | </el-form-item> |
| | | |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | |
| | | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI"> |
| | | <el-form-item label="是否启用"> |
| | | <el-select clearable="" v-model="queryParams.enable" placeholder="请选择是否启用"> |
| | | <el-option v-for="(item, index) in dl('YesNoEnum')" :key="index" :value="item.value" |
| | | :label="`${item.name} (${item.code}) [${item.value}] `" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10"> |
| | | <el-form-item> |
| | | <el-button-group style="display: flex; align-items: center;"> |
| | |
| | | </el-table-column> |
| | | <el-table-column prop="wareHouseNo" label="仓库号" show-overflow-tooltip="" /> |
| | | <el-table-column prop="text" label="描述" show-overflow-tooltip="" /> |
| | | <el-table-column prop="enable" label="是否启用" show-overflow-tooltip=""> |
| | | <template #default="scope"> |
| | | <el-tag :type="dv('YesNoEnum', scope.row.enable)?.tagType"> {{ dv('YesNoEnum', |
| | | scope.row.enable)?.name }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="修改记录" width="80" align="center" show-overflow-tooltip> |
| | | <template #default="scope"> |
| | | <ModifyRecord :data="scope.row" /> |