´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/009c71ac-3f6b-4e87-8d77-9e67b15f196a.vsidxBinary files differ´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/05de9a72-8eef-42af-bb91-2884b11682fc.vsidxBinary files differ´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/1c314e67-7b22-4b95-82d8-39953c4ffcb1.vsidxBinary files differ´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/30faed0f-10c1-4ef3-8430-efc0de767fc3.vsidxBinary files differ´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/9c8323bc-3d97-4f52-8315-faf14a56756c.vsidxBinary files differ´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/be38a26a-2b17-43c8-b4f8-d9fd5f3264c6.vsidxBinary files differ´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/fc24c9bc-a681-4021-afee-e9730bbda510.vsidxBinary files differ´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskInfo/WMSTaskDTO.cs
@@ -60,6 +60,11 @@ /// </summary> public string GroupId { get; set; } /// <summary> /// ä»»å¡ç©æé¿åº¦ /// </summary> public int TaskLength { get; set; } public string AGVArea { get; set; } public int PalletType { get; set; } ´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs
@@ -64,7 +64,7 @@ /// <param name="palletCode">æçå·</param> /// <param name="sourceAddress">èµ·å§å°å</param> /// <returns></returns> WebResponseContent RequestWMSTask(string palletCode, string sourceAddress); WebResponseContent RequestWMSTask(string palletCode, string sourceAddress, string materielBoxCode = ""); /// <summary> /// åWMSç³è¯·ä»»å¡ @@ -81,7 +81,7 @@ /// <param name="sourceAddress">èµ·å§å°å</param> /// <param name="roadway">å··éå·</param> /// <returns></returns> WebResponseContent RequestWMSTask(string palletCode, string sourceAddress, string roadway); //WebResponseContent RequestWMSTask(string palletCode, string sourceAddress, string roadway); /// <summary> /// ´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/TaskInfo/Dt_Task.cs
@@ -183,7 +183,13 @@ [ExporterHeader(DisplayName = "ä»»å¡ç»")] [SugarColumn(IsNullable = true, ColumnDescription = "ä»»å¡ç»")] public string GroupId { get; set; } /// <summary> /// ä»»å¡ç©æé¿åº¦ /// </summary> [ImporterHeader(Name = "ä»»å¡ç©æé¿åº¦")] [ExporterHeader(DisplayName = "ä»»å¡ç©æé¿åº¦")] [SugarColumn(IsNullable = true, ColumnDescription = "ä»»å¡ç©æé¿åº¦")] public int TaskLength { get; set; } /// <summary> /// 夿³¨ /// </summary> ´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/CTU_AGVController .cs
@@ -293,12 +293,12 @@ //è°ç¨AGVé¢è°åº¦æ¥å£ AgvScheduleTaskDTO agvScheduleTask = new AgvScheduleTaskDTO() { PositionCode = task.CurrentAddress, NextTask = "60", PositionCode = "8001", NextTask = "90", UseableLayers = "1", CacheCount = "1", Update = "0", AgvTyp = "11", AgvTyp = "10", PreTaskQty = "1", ReqCode = Guid.NewGuid().ToString().Replace("-", ""), ReqTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), ´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
@@ -386,7 +386,7 @@ /// <param name="palletCode">æçå·</param> /// <param name="sourceAddress">èµ·å§å°å</param> /// <returns></returns> public WebResponseContent RequestWMSTask(string palletCode, string sourceAddress) public WebResponseContent RequestWMSTask(string palletCode, string sourceAddress, string materielBoxCode = "") { WebResponseContent content = new WebResponseContent(); try @@ -401,7 +401,15 @@ { return WebResponseContent.Instance.Error($"æªæ¾å°WMSApiå°å"); } string responseStr = HttpHelper.Get($"{address}/api/Task/DeviceRequestInboundTask?stationCode={sourceAddress}&roadwayNo={stationManger.StackerCraneCode}&palletCode={palletCode}"); string responseStr = ""; if (!string.IsNullOrEmpty(materielBoxCode)) { responseStr = HttpHelper.Get($"{address}/api/Task/DeviceRequestInboundTask?stationCode={sourceAddress}&roadwayNo={stationManger.StackerCraneCode}&palletCode={palletCode}&materielBoxCode={materielBoxCode}"); } else { responseStr = HttpHelper.Get($"{address}/api/Task/DeviceRequestInboundTask?stationCode={sourceAddress}&roadwayNo={stationManger.StackerCraneCode}&palletCode={palletCode}"); } WebResponseContent? responseContent = JsonConvert.DeserializeObject<WebResponseContent>(responseStr); if (responseContent != null && responseContent.Status && responseContent.Data != null) { @@ -462,34 +470,34 @@ /// <param name="sourceAddress"></param> /// <param name="roadway"></param> /// <returns></returns> public WebResponseContent RequestWMSTask(string palletCode, string sourceAddress, string roadway) { WebResponseContent content = new WebResponseContent(); try { string address = AppSettings.Get("WMSApiAddress"); if (string.IsNullOrEmpty(address)) { return WebResponseContent.Instance.Error($"æªæ¾å°WMSApiå°å"); } string responseStr = HttpHelper.Get($"{address}/api/Task/DeviceRequestInboundTask?stationCode={sourceAddress}&roadwayNo={roadway}&palletCode={palletCode}"); WebResponseContent? responseContent = JsonConvert.DeserializeObject<WebResponseContent>(responseStr); if (responseContent != null && responseContent.Status && responseContent.Data != null) { WMSTaskDTO? taskDTO = JsonConvert.DeserializeObject<WMSTaskDTO>(responseContent.Data.ToString()); if (taskDTO != null) { content = ReceiveWMSTask(new List<WMSTaskDTO> { taskDTO }); } } //public WebResponseContent RequestWMSTask(string palletCode, string sourceAddress, string roadway) //{ // WebResponseContent content = new WebResponseContent(); // try // { // string address = AppSettings.Get("WMSApiAddress"); // if (string.IsNullOrEmpty(address)) // { // return WebResponseContent.Instance.Error($"æªæ¾å°WMSApiå°å"); // } // string responseStr = HttpHelper.Get($"{address}/api/Task/DeviceRequestInboundTask?stationCode={sourceAddress}&roadwayNo={roadway}&palletCode={palletCode}"); // WebResponseContent? responseContent = JsonConvert.DeserializeObject<WebResponseContent>(responseStr); // if (responseContent != null && responseContent.Status && responseContent.Data != null) // { // WMSTaskDTO? taskDTO = JsonConvert.DeserializeObject<WMSTaskDTO>(responseContent.Data.ToString()); // if (taskDTO != null) // { // content = ReceiveWMSTask(new List<WMSTaskDTO> { taskDTO }); // } // } } catch (Exception ex) { content = WebResponseContent.Instance.Error(ex.Message); } return content; } // } // catch (Exception ex) // { // content = WebResponseContent.Instance.Error(ex.Message); // } // return content; //} /// <summary> /// ´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/ConveyorLineTaskCommand.cs
@@ -163,6 +163,15 @@ /// </summary> public short CheckPos { get; set; } } public class R_ConveyorLineGMInfo : DeviceCommand { /// <summary> /// ç®±å· /// </summary> /// <summary> [DataLength(120)] public string Boxcode { get; set; } } public class R_ConveyorLineFLInfo : DeviceCommand { /// <summary> ´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/R_ConveyorLineDBName.cs
@@ -118,7 +118,11 @@ /// <summary> /// ååºä¿¡å· /// </summary> ACK ACK, /// <summary> /// æ¡ç /// </summary> Boxcode } public enum R_ConveyorLineWorkType ´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/PP²Ö/ConveyorLineJob_PP.cs
@@ -73,14 +73,41 @@ { if (conveyorLineSignalRead.STB && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !conveyorLineSignalWrite.ACK) { if (!string.IsNullOrEmpty(conveyorLineInfoRead.Barcode)) string boxcode = device.GetValue<R_ConveyorLineDB, string>(R_ConveyorLineDB.Boxcode, item.StationCode); if (!string.IsNullOrEmpty(boxcode)) { WebResponseContent content = _taskService.RequestWMSTask(conveyorLineInfoRead.Barcode, item.StationCode); string sc = device.Communicator.Read<string>("DB900.598.0"); WriteError(device.DeviceName, $"读åå¼ï¼{boxcode},对æ¯{sc}"); string boxEndCode = ""; if (boxcode.LastIndexOf(",SC:") >= 0) { boxEndCode = "M" + boxcode.Substring(0, boxcode.LastIndexOf(",SC:")) + sc.Substring(sc.IndexOf(",SC:")).Replace("\0", ""); } else if (boxcode.LastIndexOf(",SC") > 0) { boxEndCode = "M" + boxcode.Substring(0, boxcode.LastIndexOf(",SC")) + sc.Substring(sc.IndexOf("SC:")).Replace("\0", ""); } else if (boxcode.LastIndexOf(",S") > 0) { boxEndCode = "M" + boxcode.Substring(0, boxcode.LastIndexOf(",S")) + sc.Substring(sc.IndexOf("SC:")).Replace("\0", ""); } //å ¥åºç³è¯·ä»»å¡ WebResponseContent content = _taskService.RequestWMSTask(conveyorLineInfoRead.Barcode, item.StationCode, boxEndCode); if (content.Status) { device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode); } } //if (!string.IsNullOrEmpty(conveyorLineInfoRead.Barcode)) //{ // WebResponseContent content = _taskService.RequestWMSTask(conveyorLineInfoRead.Barcode, item.StationCode); // if (content.Status) // { // device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode); // } //} } else if (!conveyorLineSignalRead.STB && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && conveyorLineSignalWrite.ACK) { ´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/StackerCraneTaskCommandGMPP.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,87 @@ #region << ç æ¬ 注 é >> /*---------------------------------------------------------------- * å½å空é´ï¼WIDESEAWCS_Tasks.StackerCraneJob * å建è ï¼è¡ç«¥åº * å建æ¶é´ï¼2024/8/2 16:13:36 * çæ¬ï¼V1.0.0 * æè¿°ï¼ * * ---------------------------------------------------------------- * ä¿®æ¹äººï¼ * ä¿®æ¹æ¶é´ï¼ * çæ¬ï¼V1.0.1 * ä¿®æ¹è¯´æï¼ * *----------------------------------------------------------------*/ #endregion << ç æ¬ 注 é >> using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WIDESEAWCS_Model.Models; using WIDESEAWCS_QuartzJob.DeviceBase; namespace WIDESEAWCS_Tasks.StackerCraneJob { public class StackerCraneTaskCommandGMPP : DeviceCommand { #region <Public Menber> /// <summary> /// ä»»å¡å· /// </summary> public int TaskNum { get; set; } /// <summary> /// ä½ä¸ç±»å /// </summary> public short WorkType { get; set; } /// <summary> /// æçç±»å /// </summary> public short TrayType { get; set; } /// <summary> /// èµ·å§è¡ /// </summary> public short StartRow { get; set; } /// <summary> /// èµ·å§å /// </summary> public short StartColumn { get; set; } /// <summary> /// èµ·å§å± /// </summary> public short StartLayer { get; set; } /// <summary> /// ç®æ è¡ /// </summary> public short EndRow { get; set; } /// <summary> /// ç®æ å /// </summary> public short EndColumn { get; set; } /// <summary> /// ç®æ å± /// </summary> public short EndLayer { get; set; } /// <summary> /// æçå· /// </summary> [DataLength(30)] public string Barcode { get; set; } /// <summary> /// ç©æé¿åº¦ /// </summary> public short TaskLength { get; set; } #endregion <Public Menber> } } ´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/¸ÉĤ²Ö/ConveyorLineJob_GM.cs
@@ -1,4 +1,5 @@ using Newtonsoft.Json; using Microsoft.IdentityModel.Tokens; using Newtonsoft.Json; using Quartz; using System; using System.Collections.Generic; @@ -94,10 +95,28 @@ { if (conveyorLineSignalRead.STB && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !conveyorLineSignalWrite.ACK) { if (!string.IsNullOrEmpty(conveyorLineInfoRead.Barcode)) string boxcode = device.GetValue<R_ConveyorLineDB, string>(R_ConveyorLineDB.Boxcode, item.StationCode); if (!string.IsNullOrEmpty(boxcode)) { string sc = device.Communicator.Read<string>("DB900.508.0"); WriteError(device.DeviceName, $"读åå¼ï¼{boxcode},对æ¯{sc}"); string boxEndCode = ""; if (boxcode.LastIndexOf(",SC:") >=0) { boxEndCode = "M"+ boxcode.Substring(0,boxcode.LastIndexOf(",SC:")) + sc.Substring(sc.IndexOf(",SC:")).Replace("\0", ""); } else if (boxcode.LastIndexOf(",SC") > 0) { boxEndCode = "M" + boxcode.Substring(0, boxcode.LastIndexOf(",SC")) + sc.Substring(sc.IndexOf("SC:")).Replace("\0", ""); } else if (boxcode.LastIndexOf(",S") > 0) { boxEndCode = "M" + boxcode.Substring(0, boxcode.LastIndexOf(",S")) + sc.Substring(sc.IndexOf("SC:")).Replace("\0", ""); } //å ¥åºç³è¯·ä»»å¡ WebResponseContent content = _taskService.RequestWMSTask(conveyorLineInfoRead.Barcode, item.StationCode); WebResponseContent content = _taskService.RequestWMSTask(conveyorLineInfoRead.Barcode, item.StationCode, boxEndCode); if (content.Status) { device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode); @@ -106,7 +125,8 @@ } else if (!conveyorLineSignalRead.STB && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && conveyorLineSignalWrite.ACK) { Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && x.PalletCode == conveyorLineInfoRead.Barcode && x.DeviceCode == item.StationDeviceCode && x.TaskState == TaskStatusEnum.New.ObjToInt()); string boxcode = device.GetValue<R_ConveyorLineDB, string>(R_ConveyorLineDB.Boxcode, item.StationCode); Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && boxcode.Contains(x.PalletCode) && x.TaskState == TaskStatusEnum.New.ObjToInt()); if (task != null) { _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, currentAddress: item.StackerCraneStationCode, deviceCode: task.Roadway, nextAddress: task.TargetAddress); ´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/¸ÉĤ²Ö/StackerCraneJob_GM.cs
@@ -92,6 +92,12 @@ commonStackerCrane.LastTaskType = task.TaskType; task.Dispatchertime = DateTime.Now; task.ExceptionMessage = ""; if (task.TaskLength<=0) { WriteInfo(commonStackerCrane.DeviceCode, $"ç©æé¿åº¦é误{task.TaskLength}"); return Task.CompletedTask; } commonStackerCrane.Communicator.Write("DB105.58", (short)task.TaskLength); _taskService.UpdateTask(task, TaskStatusEnum.SC_Executing); commonStackerCrane.Communicator.Write("DB105.54", (short)1); //å»¶æ¶1s @@ -297,7 +303,7 @@ stackerCraneTaskCommand.Barcode = task.PalletCode; stackerCraneTaskCommand.TaskNum = task.TaskNum; stackerCraneTaskCommand.WorkType = 1; stackerCraneTaskCommand.TrayType = (Int16)task.PalletType; stackerCraneTaskCommand.TrayType = 0; if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)//夿æ¯å¦æ¯å ¥åºä»»å¡ { string[] startCodes = task.CurrentAddress.Split("-"); ´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/¸¨ÁϲÖ/ConveyorLineJob_FL.cs
@@ -60,6 +60,8 @@ public Task Execute(IJobExecutionContext context) { try { bool flag = context.JobDetail.JobDataMap.TryGetValue("JobParams", out object? value); if (flag && value != null) { @@ -86,6 +88,11 @@ } } } catch (Exception ex) { WriteError(nameof(ConveyorLineJob_FL), ex.Message, ex); } return Task.CompletedTask; } } ´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/b157c59e-a4e0-4f94-a6da-466245995b56.vsidxBinary files differ´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/bfe4e4fb-c551-4c7f-94ec-d7011d126854.vsidxBinary files differ´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Task/WMSTaskDTO.cs
@@ -67,6 +67,11 @@ public string GroupId { get; set; } /// <summary> /// ä»»å¡ç©æé¿åº¦ /// </summary> public int TaskLength { get; set; } /// <summary> /// /// </summary> public string AGVArea { get; set; } ´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_IInboundService/IInboundOrderService.cs
@@ -28,6 +28,8 @@ //WebResponseContent FeedbackInboundOrder(int id); WebResponseContent MaterielGroup(SaveModel saveModel); WebResponseContent MaterielPPorGM(string materielBoxCode=""); /// <summary> /// å ¥åºå®æä¸æ¥ /// </summary> ´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs
@@ -87,7 +87,7 @@ /// <param name="roadwayNo"></param> /// <param name="palletCode"></param> /// <returns></returns> WebResponseContent DeviceRequestInboundTask(string stationCode, string roadwayNo, string palletCode); WebResponseContent DeviceRequestInboundTask(string stationCode, string roadwayNo, string palletCode,string materielBoxCode = ""); /// <summary> /// ä» ç³è¯·ä»»å¡ï¼è®©WCSæ ¹æ®è·¯ç±ç¡®å®ä¸ä¸å°å ´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs
@@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Mvc.RazorPages; using Newtonsoft.Json; using OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime; using OfficeOpenXml.FormulaParsing.Excel.Functions.RefAndLookup; using SqlSugar; using System; using System.Collections; @@ -900,6 +901,220 @@ } return content; } public WebResponseContent MaterielPPorGM(string materielBoxCode = "") { WebResponseContent content = new WebResponseContent(); try { string SerNum = materielBoxCode.Substring(0, materielBoxCode.LastIndexOf("SC:")-1); MatSerNumAnalysisModel model = CodeAnalysisHelper.CodeAnalysis<MatSerNumAnalysisModel>(AnalysisCodeEnum.MatSerNumAnalysis, SerNum); //éªè¯å¤ææ¶é´æ ¼å¼ WebResponseContent IsValidContent = IsValidMCDates(new List<MatSerNumAnalysisModel>() { model }); if (!IsValidContent.Status) { return content.Error(IsValidContent.Message); } string result = materielBoxCode.Substring(materielBoxCode.LastIndexOf("SC:") + 3); //è·åå ¥åºåæç» Dt_InboundOrderDetail inboundOrderDetail = _inboundRepository.InboundOrderDetailRepository.QueryFirst(x=>x.BatchNo== model.LotNo && x.MaterielCode== model.MaterielCode); if (inboundOrderDetail == null) { return InOtherGMOrPP(model, result); } Dt_InboundOrder inboundOrder = BaseDal.Db.Queryable<Dt_InboundOrder>().First(x => x.Id == inboundOrderDetail.OrderId); if (inboundOrder == null) { return WebResponseContent.Instance.Error($"æªæ¾å°å ¥åºåä¿¡æ¯"); } Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseId == inboundOrder.WarehouseId); //é¤éè´å ¥åºå以å¤å ¶ä»å ¥åºåç»çæ°æ®å¤ç if (inboundOrder.OrderType != InOrderTypeEnum.Purchase.ObjToInt()) { return OtherInGroup(inboundOrder, model.LotNo, 0, warehouse, new List<MatSerNumAnalysisModel>() { model }); } Dt_ReceiveOrder receiveOrder = _inboundRepository.ReceiveOrderRepository.Db.Queryable<Dt_ReceiveOrder>().Where(x => x.ReceiveOrderNo == inboundOrder.UpperOrderNo).Includes(x => x.Details).First(); if (receiveOrder == null) { return WebResponseContent.Instance.Error($"æªæ¾å°å¯¹åºçæ¶è´§å"); } if (receiveOrder.Details == null || receiveOrder.Details.Count <= 0) { return WebResponseContent.Instance.Error($"æªæ¾å°å¯¹åºçæ¶è´§åæç»"); } List<string> purchaseOrderNos = receiveOrder.Details.Select(x => x.PurchaseOrderNo).ToList(); string materielCode = model?.MaterielCode ?? ""; Dt_MaterielInfo materielInfo = _basicRepository.MaterielInfoRepository.QueryFirst(x => x.MaterielCode == materielCode); if (materielInfo == null) { return WebResponseContent.Instance.Error($"æªæ¾å°è¯¥ç©æçä¿¡æ¯"); } float beforeQuantity = 0; Dt_StockInfo stockInfo = _stockRepository.StockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == model.LotNo).Includes(x => x.Details).First(); if (stockInfo == null) { stockInfo = new Dt_StockInfo() { PalletCode = model.LotNo, StockStatus = StockStatusEmun.ç»çæå.ObjToInt(), WarehouseId = inboundOrder.WarehouseId, PalletType = GetPalletTypeGMOrPP(warehouse, result.Split("*")[0]), StockLength = result.Split("*")[0].ObjToInt(), Details = new List<Dt_StockInfoDetail>() }; } else { if (stockInfo.StockStatus != StockStatusEmun.ç»çæå.ObjToInt()) { return WebResponseContent.Instance.Error($"æçå·éå¤"); } } if (stockInfo.PalletType==-1) { return WebResponseContent.Instance.Error($"æçç±»åä¸åå¨"); } List<Dt_StockInfoDetail> stockInfoDetails = new List<Dt_StockInfoDetail>(); if (purchaseOrderNos.FirstOrDefault(x => x == model.PurchaseOrderNo) == null) { return WebResponseContent.Instance.Error($"æªå¨æ¶è´§æç»ä¸æ¾å°è¯¥éè´å"); } if (inboundOrderDetail.OrderDetailStatus > OrderDetailStatusEnum.Inbounding.ObjToInt() || inboundOrderDetail.OrderQuantity == inboundOrderDetail.ReceiptQuantity) { return WebResponseContent.Instance.Error($"è¯¥ç©æå¨è¯¥å ¥åºåä¸å·²å ¨é¨ç»ç宿"); } Dt_StockInfoDetail stockInfoDetail = new Dt_StockInfoDetail() { BatchNo = model.LotNo, MaterielCode = materielInfo.MaterielCode, MaterielName = materielInfo.MaterielName, MaterielSpec = materielInfo.MaterielSpec, OrderNo = inboundOrder.InboundOrderNo, SerialNumber = model.SerialNumber, StockQuantity = model.Quantity, OutboundQuantity = 0, Unit = materielInfo.MaterielUnit, Status = StockStatusEmun.ç»çæå.ObjToInt(), ProductionDate = model.ProductionDate, EffectiveDate = model.EffectiveDate, InboundOrderRowNo = inboundOrderDetail.RowNo, }; stockInfo.Details.Add(stockInfoDetail); stockInfoDetails.Add(stockInfoDetail); inboundOrderDetail.ReceiptQuantity += model.Quantity; if (inboundOrderDetail.ReceiptQuantity > inboundOrderDetail.OrderQuantity) { return WebResponseContent.Instance.Error($"ç»çæ°é溢åº{inboundOrderDetail.ReceiptQuantity - inboundOrderDetail.OrderQuantity}"); } if (inboundOrderDetail.OrderDetailStatus == OrderDetailStatusEnum.New.ObjToInt()) { inboundOrderDetail.OrderDetailStatus = OrderDetailStatusEnum.GroupAndInbound.ObjToInt(); } float totalQuantity = stockInfo.Details.Sum(x => x.StockQuantity); if (inboundOrder.OrderStatus == InOrderStatusEnum.æªå¼å§.ObjToInt()) { inboundOrder.OrderStatus = InOrderStatusEnum.å ¥åºä¸.ObjToInt(); } _inboundRepository.InboundOrderDetailRepository.UpdateData(inboundOrderDetail); _inboundRepository.InboundOrderRepository.UpdateData(inboundOrder); _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfoDetails, beforeQuantity, totalQuantity, StockChangeTypeEnum.MaterielGroup); content.OK(data: stockInfo); } catch (Exception ex) { content.Error(ex.Message); } return content; } public WebResponseContent InOtherGMOrPP(MatSerNumAnalysisModel model,string request = "") { string materielCode = model?.MaterielCode ?? ""; Dt_MaterielInfo materielInfo = _basicRepository.MaterielInfoRepository.QueryFirst(x => x.MaterielCode == materielCode); if (materielInfo == null) { return WebResponseContent.Instance.Error($"æªæ¾å°è¯¥ç©æçä¿¡æ¯"); } float beforeQuantity = 0; Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseId == materielInfo.WarehouseId); Dt_StockInfo stockInfo = _stockRepository.StockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == model.LotNo).Includes(x => x.Details).First(); if (stockInfo == null) { stockInfo = new Dt_StockInfo() { PalletCode = model.LotNo, StockStatus = StockStatusEmun.ç»çæå.ObjToInt(), WarehouseId = warehouse.WarehouseId, PalletType = GetPalletTypeGMOrPP(warehouse, request.Split("*")[0]), StockLength = request.Split("*")[0].ObjToInt(), Details = new List<Dt_StockInfoDetail>() }; } else { if (stockInfo.StockStatus != StockStatusEmun.ç»çæå.ObjToInt()) { return WebResponseContent.Instance.Error($"æçå·éå¤"); } } if (stockInfo.PalletType == -1) { return WebResponseContent.Instance.Error($"æçç±»åä¸åå¨"); } List<Dt_StockInfoDetail> stockInfoDetails = new List<Dt_StockInfoDetail>(); Dt_StockInfoDetail stockInfoDetail = new Dt_StockInfoDetail() { BatchNo = model.LotNo, MaterielCode = materielInfo.MaterielCode, MaterielName = materielInfo.MaterielName, MaterielSpec = materielInfo.MaterielSpec, OrderNo = "", SerialNumber = model.SerialNumber, StockQuantity = model.Quantity, OutboundQuantity = 0, Unit = materielInfo.MaterielUnit, Status = StockStatusEmun.ç»çæå.ObjToInt(), ProductionDate = model.ProductionDate, EffectiveDate = model.EffectiveDate, InboundOrderRowNo = 0, }; stockInfo.Details.Add(stockInfoDetail); stockInfoDetails.Add(stockInfoDetail); float totalQuantity = stockInfo.Details.Sum(x => x.StockQuantity); _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfoDetails, beforeQuantity, totalQuantity, StockChangeTypeEnum.MaterielGroup); return WebResponseContent.Instance.OK(data: stockInfo); } public int GetPalletTypeGMOrPP(Dt_Warehouse warehouse, string boxWidth) { if (warehouse.WarehouseCode == WarehouseEnum.HA152.ToString()) { if (boxWidth.ObjToInt() <= 690 && boxWidth.ObjToInt()>=515) { return 15; } else if (boxWidth.ObjToInt() > 690 && boxWidth.ObjToInt() <= 1400) { return 16; } } else if (warehouse.WarehouseCode == WarehouseEnum.HA58.ToString()) { Dt_PalletTypeInfo palletTypeInfo = _palletTypeInfoRepository.QueryFirst(x => x.WarehouseId == warehouse.WarehouseId); return palletTypeInfo.PalletType; } return -1; } public WebResponseContent OtherInGroup(Dt_InboundOrder inboundOrder,string? palletCode,int Initiallife,Dt_Warehouse warehouse,List<MatSerNumAnalysisModel> models) { WebResponseContent content = new WebResponseContent(); ´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Stock/Dt_StockInfo.cs
@@ -55,6 +55,11 @@ /// </summary> [SugarColumn(IsNullable = true, ColumnDescription = "夿³¨")] public string Remark { get; set; } /// <summary> /// åºåç©æé¿åº¦GM/PP /// </summary> [SugarColumn(IsNullable = true, ColumnDescription = "åºåç©æé¿åº¦")] public int StockLength { get; set; } /// <summary> /// åºåæç» ´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/TaskInfo/Dt_Task.cs
@@ -142,6 +142,13 @@ [SugarColumn(IsNullable = true, ColumnDescription = "ä»»å¡ç»")] public string GroupId { get; set; } /// <summary> /// ä»»å¡ç©æé¿åº¦ /// </summary> [ImporterHeader(Name = "ä»»å¡ç©æé¿åº¦")] [ExporterHeader(DisplayName = "ä»»å¡ç©æé¿åº¦")] [SugarColumn(IsNullable = true, ColumnDescription = "ä»»å¡ç©æé¿åº¦")] public int TaskLength { get; set; } /// <summary> /// 夿³¨ /// </summary> [ImporterHeader(Name = "夿³¨")] ´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs
@@ -687,6 +687,10 @@ { x.Status = StockStatusEmun.åºåºå®æ.ObjToInt(); }); if (stockInfo.StockLength>0) { stockInfo.StockLength = 0; } _stockRepository.StockInfoRepository.UpdateData(stockInfo); _stockRepository.StockInfoDetailRepository.UpdateData(stockInfo.Details); } ´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs
@@ -278,7 +278,7 @@ /// <param name="roadwayNo"></param> /// <param name="palletCode"></param> /// <returns></returns> public WebResponseContent DeviceRequestInboundTask(string stationCode, string roadwayNo, string palletCode) public WebResponseContent DeviceRequestInboundTask(string stationCode, string roadwayNo, string palletCode,string materielBoxCode = "") { try { @@ -293,7 +293,72 @@ { return WebResponseContent.Instance.Error($"该ç«ç¹å·²ææªæ§è¡çä»»å¡"); } if (!string.IsNullOrEmpty(materielBoxCode)) { _unitOfWorkManage.BeginTran(); WebResponseContent responseGroup = _inboundOrderService.MaterielPPorGM(materielBoxCode); if (!responseGroup.Status) { return WebResponseContent.Instance.Error($"{responseGroup.Message}"); } Dt_StockInfo stockInfoPPorGM = responseGroup.Data as Dt_StockInfo ?? null; if (stockInfoPPorGM==null) { return WebResponseContent.Instance.Error($"ç»çæ°æ®è½¬æ¢å¤±è´¥"); } Dt_LocationInfo? locationInfoPPorGM = _basicService.LocationInfoService.AssignLocation(roadwayNo, stockInfoPPorGM.PalletType, stockInfoPPorGM.WarehouseId); if (locationInfoPPorGM == null) { return WebResponseContent.Instance.Error($"è´§ä½åé 失败,æªæ¾å°å¯åé è´§ä½"); } Dt_Task newTaskPPorGM = new Dt_Task() { CurrentAddress = stationCode, Grade = 0, NextAddress = locationInfoPPorGM.LocationCode, PalletCode = stockInfoPPorGM.PalletCode, Roadway = roadwayNo, SourceAddress = stationCode, TargetAddress = locationInfoPPorGM.LocationCode, TaskType = TaskTypeEnum.Inbound.ObjToInt(), TaskStatus = TaskStatusEnum.New.ObjToInt(), WarehouseId = stockInfoPPorGM.WarehouseId, PalletType = stockInfoPPorGM.PalletType, TaskLength= stockInfoPPorGM.StockLength }; //è·åæ¯å¦åå¨å ¥åºå Dt_InboundOrder? inboundOrderPPorGM = null; if (stockInfoPPorGM != null && stockInfoPPorGM.Details.Count > 0) { string? orderNo = stockInfoPPorGM.Details.FirstOrDefault()?.OrderNo ?? ""; inboundOrderPPorGM = _inboundOrderService.Repository.QueryFirst(x => x.InboundOrderNo == orderNo && x.OrderStatus < InOrderStatusEnum.å ¥åºå®æ.ObjToInt()); } if (inboundOrderPPorGM != null) { if (inboundOrderPPorGM.OrderType == InOrderTypeEnum.Allocat.ObjToInt()) { newTaskPPorGM.TaskType = TaskTypeEnum.InAllocate.ObjToInt(); } else if (inboundOrderPPorGM.OrderType == InOrderTypeEnum.Return.ObjToInt()) { newTaskPPorGM.TaskType = TaskTypeEnum.ProductionReturn.ObjToInt(); } } stockInfoPPorGM.StockStatus = StockStatusEmun.å ¥åºç¡®è®¤.ObjToInt(); LocationStatusEnum lastStatusPPorGM = (LocationStatusEnum)locationInfoPPorGM.LocationStatus; _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfoPPorGM, lastStatusPPorGM, LocationStatusEnum.Lock, LocationChangeType.InboundAssignLocation); _basicService.LocationInfoService.UpdateLocationStatus(locationInfoPPorGM, newTaskPPorGM.PalletType, LocationStatusEnum.Lock, newTaskPPorGM.WarehouseId); int taskIdPPorGM = BaseDal.AddData(newTaskPPorGM); newTaskPPorGM.TaskId = taskIdPPorGM; _stockRepository.StockInfoRepository.Db.InsertNav(stockInfoPPorGM).Include(x => x.Details).ExecuteCommand(); _unitOfWorkManage.CommitTran(); WMSTaskDTO wMSTaskDTOPPorGM = _mapper.Map<WMSTaskDTO>(newTaskPPorGM); PushTasksToWCS(new List<Dt_Task> { newTaskPPorGM }); return WebResponseContent.Instance.OK(data: wMSTaskDTOPPorGM); } Dt_StockInfo stockInfo = _stockRepository.StockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == palletCode).Includes(x => x.Details).First(); if (stockInfo == null) { ´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs
@@ -526,6 +526,10 @@ PalletType = stockInfo.PalletType, WarehouseId = stockInfo.WarehouseId, }; if (stockInfo.StockLength>0) { task.TaskLength = stockInfo.StockLength; } tasks.Add(task); } } ´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs
@@ -75,9 +75,9 @@ /// <param name="palletCode"></param> /// <returns></returns> [HttpPost, HttpGet, Route("DeviceRequestInboundTask"), AllowAnonymous] public WebResponseContent DeviceRequestInboundTask(string stationCode, string roadwayNo, string palletCode) public WebResponseContent DeviceRequestInboundTask(string stationCode, string roadwayNo, string palletCode,string materielBoxCode = "") { return Service.DeviceRequestInboundTask(stationCode, roadwayNo, palletCode); return Service.DeviceRequestInboundTask(stationCode, roadwayNo, palletCode, materielBoxCode); } /// <summary> ÏîÄ¿×ÊÁÏ/24KH244 ÉîÛÚÃÀÈð°² »´°²ÌØ´´Á¢Ìå¿âÏîÄ¿µç¿ØÈí¼þ¿ª·¢¡¢²âÊÔ¼°Î¬»¤·þÎñ-¼¼ÊõÐÒé-2024.11.21.pdfBinary files differ