ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_Common/StationTypeEnum.cs
@@ -32,6 +32,11 @@ StationType_InStartAndOutEnd = 33, /// <summary> /// å··é /// </summary> StationType_RoadwayError = 81, /// <summary> /// å ç嫿ç«å° /// </summary> StationType_StackingPlates = 91, ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_DTO/TaskInfo/WMSTaskDTO.cs
@@ -82,4 +82,13 @@ /// </summary> public string WorkCentreCode { get; set; } } public class RoadwayError { public static List<ErrorDeviceInfo> Roadways = new List<ErrorDeviceInfo>(); } public class ErrorDeviceInfo { public string Code { get; set; } public string Roadway { get; set; } } } ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_ITaskInfoService/ITaskService.cs
@@ -130,7 +130,10 @@ /// <param name="roadwayNo">å··éå·</param> /// <returns></returns> string? RequestAssignLocation(int taskNum, string roadwayNo); /// <summary> /// åWMSæåå ¥åºæ«ç è¯·æ±æ´æ°æ¡ç /// </summary> WebResponseContent RequestInBoundPalletCode(int taskNum, string barCode); /// <summary> /// åWMSç³è¯·åºåºAGVç»ç¹ /// </summary> ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_Server/Controllers/Task/TaskController.cs
@@ -1,4 +1,5 @@ using HslCommunication.WebSocket; using Autofac.Core; using HslCommunication.WebSocket; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; @@ -165,5 +166,14 @@ return content.Error(ex.Message); } } /// <summary> /// è·åæ éå··é /// </summary> /// <returns></returns> [HttpPost, HttpGet, Route("ExistRoadwaysError"), AllowAnonymous] public List<string> ExistRoadwaysError() { return RoadwayError.Roadways.Select(x => x.Roadway).Distinct().ToList(); } } } ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_TaskInfoService/TaskService.cs
@@ -609,6 +609,34 @@ return ""; } /// <summary> /// åWMSæåå ¥åºæ«ç è¯·æ±æ´æ°æ¡ç /// </summary> /// <param name="taskNum">ä»»å¡å·</param> /// <returns></returns> /// <exception cref="Exception"></exception> public WebResponseContent RequestInBoundPalletCode(int taskNum,string barCode) { WebResponseContent content = new WebResponseContent(); try { string address = AppSettings.Get("WMSApiAddress"); if (string.IsNullOrEmpty(address)) throw new Exception("æªæ¾å°WMSApiå°å"); string responseStr = HttpHelper.Get($"{address}/api/Task/InBoundPalletCode?taskNum={taskNum}&barCode={barCode}"); WebResponseContent responseContent = JsonConvert.DeserializeObject<WebResponseContent>(responseStr) ?? throw new Exception("æªæ¶å°è¿ååæ°"); if (!responseContent.Status) { return responseContent; } content.OK(); } catch (Exception ex) { content.Error(ex.Message); } return content; } /// <summary> /// åWMSç³è¯·åºåºAGVç»ç¹ /// </summary> /// <param name="taskNum">ä»»å¡å·</param> ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_Tasks/ConveyorLineJob/ConveyorLineTaskCommand.cs
@@ -343,6 +343,13 @@ set { _barcode = value.Replace("\0", "").Replace("\\0", ""); } } } public class R_ErrorYLDB : DeviceCommand { /// <summary> /// æ é /// </summary> public short R_Error { get; set; } } public class W_RGVCPInfo : DeviceCommand { /// <summary> ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_Tasks/ÔÁÏ¿â/ConveyorLineJob_YL1ndFloor.cs
@@ -12,6 +12,7 @@ using WIDESEAWCS_Communicator; using WIDESEAWCS_Core; using WIDESEAWCS_Core.Helper; using WIDESEAWCS_DTO.TaskInfo; using WIDESEAWCS_IBasicInfoRepository; using WIDESEAWCS_ITaskInfoRepository; using WIDESEAWCS_ITaskInfoService; @@ -73,6 +74,7 @@ foreach (var item in stationMangers.Where(x => deviceStations.Contains(x.StationCode))) { DeviceProDTO? deviceProRead = device.DeviceProDTOs.Where(x => x.DeviceChildCode == item.StationCode && x.DeviceProParamType == nameof(WR_CLineYLDB)).OrderBy(x => x.DeviceProOffset).FirstOrDefault(); DeviceProDTO? deviceErrRead = device.DeviceProDTOs.Where(x => x.DeviceChildCode == item.StationCode && x.DeviceProParamType == nameof(R_ErrorYLDB)).OrderBy(x => x.DeviceProOffset).FirstOrDefault(); if (deviceProRead != null) { R_ConveyorLineYLInfo conveyorLineInfoRead = device.Communicator.ReadCustomer<R_ConveyorLineYLInfo>(deviceProRead.DeviceProAddress); @@ -221,6 +223,26 @@ } } } else if (deviceErrRead!=null) { R_ErrorYLDB errorYLDB = device.Communicator.ReadCustomer<R_ErrorYLDB>(deviceErrRead.DeviceProAddress); if (errorYLDB != null && errorYLDB.R_Error==2) { ErrorDeviceInfo? errorDeviceInfo = RoadwayError.Roadways.FirstOrDefault(x=>x.Code==item.StationCode); if (errorDeviceInfo==null) { RoadwayError.Roadways.Add(new ErrorDeviceInfo() { Code = item.StationCode, Roadway = item.StackerCraneCode }); } } else if(errorYLDB != null && errorYLDB.R_Error == 1) { ErrorDeviceInfo? deviceInfo = RoadwayError.Roadways.FirstOrDefault(x => x.Code == item.StationCode); if (deviceInfo != null) { RoadwayError.Roadways.Remove(deviceInfo); } } } else { WriteError(item.StationName, $"æªæ¾å°è®¾å¤åç¼å·{item.StationCode}çå议信æ¯"); ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_Tasks/ÔÁÏ¿â/StackerCraneJob_YLSC2.cs
@@ -25,6 +25,7 @@ using WIDESEAWCS_QuartzJob.Repository; using WIDESEAWCS_QuartzJob.DTO; using WIDESEAWCS_QuartzJob.StackerCrane; using WIDESEAWCS_DTO.TaskInfo; namespace WIDESEAWCS_Tasks { @@ -90,6 +91,19 @@ } } } ErrorDeviceInfo? deviceInfo = RoadwayError.Roadways.FirstOrDefault(x => x.Code == commonStackerCrane.DeviceCode); if (deviceInfo != null) { RoadwayError.Roadways.Remove(deviceInfo); } } else { ErrorDeviceInfo? deviceInfo = RoadwayError.Roadways.FirstOrDefault(x => x.Code == commonStackerCrane.DeviceCode); if (deviceInfo==null) { RoadwayError.Roadways.Add(new ErrorDeviceInfo() { Code = commonStackerCrane.DeviceCode, Roadway = commonStackerCrane.DeviceCode }); } } } } ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_Tasks/ÔÁÏ¿â/StackerCraneJob_YLSC3.cs
@@ -26,6 +26,7 @@ using HslCommunication.WebSocket; using WIDESEAWCS_DTO.Equipment; using WIDESEAWCS_QuartzJob.StackerCrane; using WIDESEAWCS_DTO.TaskInfo; namespace WIDESEAWCS_Tasks { @@ -95,6 +96,19 @@ } } } ErrorDeviceInfo? deviceInfo = RoadwayError.Roadways.FirstOrDefault(x => x.Code == commonStackerCrane.DeviceCode); if (deviceInfo != null) { RoadwayError.Roadways.Remove(deviceInfo); } } else { ErrorDeviceInfo? deviceInfo = RoadwayError.Roadways.FirstOrDefault(x => x.Code == commonStackerCrane.DeviceCode); if (deviceInfo == null) { RoadwayError.Roadways.Add(new ErrorDeviceInfo() { Code = commonStackerCrane.DeviceCode, Roadway = commonStackerCrane.DeviceCode }); } } } ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_Tasks/³ÉÆ·²Ö/ConveyorLineJob_CPB.cs
@@ -101,16 +101,24 @@ WriteError(item.StationName, $"è·¯ç±ä¿¡æ¯é ç½®é误,设å¤ç¼å·:{item.StationCode},ä»»å¡å·:{task.TaskNum}"); continue; } device.SetValue(W_ConveyorLineCPDB.W_TargetAddress, router.NextPosi, item.StationCode); device.SetValue(W_ConveyorLineCPDB.W_TaskNo, task.TaskNum, item.StationCode); device.SetValue(W_ConveyorLineCPDB.W_Command, 1, item.StationCode); task.CurrentAddress = item.StationCode; task.NextAddress = router.NextPosi; task.PalletCode = conveyorLineInfoRead.PalletCode; task.Roadway = roadWay; task.DeviceCode = router.ChildPosiDeviceCode; _taskService.UpdateTask(task, TaskStatusEnum.Line_Executing); WriteInfo(item.StationName, $"ä»»å¡å·{conveyorLineInfoRead.TaskNo}ä¸ä¸æ¥"); WebResponseContent responseContent = _taskService.RequestInBoundPalletCode(task.TaskNum, conveyorLineInfoRead.PalletCode.Trim()); if (responseContent.Status) { device.SetValue(W_ConveyorLineCPDB.W_TargetAddress, router.NextPosi, item.StationCode); device.SetValue(W_ConveyorLineCPDB.W_TaskNo, task.TaskNum, item.StationCode); device.SetValue(W_ConveyorLineCPDB.W_Command, 1, item.StationCode); task.CurrentAddress = item.StationCode; task.NextAddress = router.NextPosi; task.PalletCode = conveyorLineInfoRead.PalletCode.Trim(); task.Roadway = roadWay; task.DeviceCode = router.ChildPosiDeviceCode; _taskService.UpdateTask(task, TaskStatusEnum.Line_Executing); WriteInfo(item.StationName, $"ä»»å¡å·{task.TaskNum}ä¸ä¸æ¥å°è¾¾{router.NextPosi}å ¥åºç«å°"); } else { WriteError(item.StationName, $"ä»»å¡å·{task.TaskNum}æ«ç 请æ±é误{responseContent.Message}"); } } else { @@ -212,7 +220,7 @@ } } } else if (item.StationType == StationTypeEnum.StationType_StackingPlates.ObjToInt() && deviceProRead != null && deviceProWrite != null) else if (item.StationType == StationTypeEnum.StationType_StackingPlates.ObjToInt() && item.IsOccupied==StationOccupiedEnum.None.ObjToInt() && deviceProRead != null && deviceProWrite != null) {//å çæºå·¥ä½å«æ R_ConveyorLineCPInfo conveyorLineInfoRead = device.Communicator.ReadCustomer<R_ConveyorLineCPInfo>(deviceProRead.DeviceProAddress); ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_Tasks/Âë¶â/MDJob_CP.cs
@@ -74,7 +74,7 @@ if (flag && value != null) { OtherDevice device = (OtherDevice)value; List<Dt_StationManger> stationMangers = _stationMangerRepository.QueryData(x => x.StackerCraneCode == device.DeviceCode && x.StationType == StationTypeEnum.StationType_InStartAndOutEnd.ObjToInt() && x.IsOccupied == 0); List<Dt_StationManger> stationMangers = _stationMangerRepository.QueryData(x => x.StackerCraneCode == device.DeviceCode && x.StationType == StationTypeEnum.StationType_InStartAndOutEnd.ObjToInt()); //è·ååè®® DeviceProDTO? deviceProRead = device.DeviceProDTOs.Where(x => x.DeviceChildCode == device.DeviceCode && x.DeviceProParamType == nameof(R_MDDB)).OrderBy(x => x.DeviceProOffset).FirstOrDefault(); DeviceProDTO? deviceProWrite = device.DeviceProDTOs.Where(x => x.DeviceChildCode == device.DeviceCode && x.DeviceProParamType == nameof(W_MDDB)).OrderBy(x => x.DeviceProOffset).FirstOrDefault(); @@ -93,6 +93,7 @@ #endregion //ç åç¶æ short PackState = device.GetValue<R_MDDB, short>(GetPackStateEnum(item.StackerCraneStationCode), item.StackerCraneCode); short PackSendState = device.GetValue<W_MDDB, short>(GetPackSendEnum(item.StackerCraneStationCode), item.StackerCraneCode); //ç åæ°é short PackNum = device.GetValue<R_MDDB, short>(GetPackNumEnum(item.StackerCraneStationCode), item.StackerCraneCode); if ((R_MDStatus1 == 1 || R_MDStatus2 == 1 || R_MDStatus3 == 1 || R_MDStatus4 == 1) && Allow == 4) @@ -105,11 +106,18 @@ } continue; } if (PackState == 2) if (PackState == 2 && PackSendState == 2) { Thread.Sleep(200); device.Communicator.Write<float>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == GetPackSendEnum(item.StackerCraneStationCode).ToString()).DeviceProDataBlock, 0); WriteInfo(item.StationName, $"{item.StationName}æ¸ é¤å·¥ä½ç»æä¿¡å·"); device.Communicator.Write<short>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == GetPackSendEnum(item.StackerCraneStationCode).ToString()).DeviceProDataBlock, 4); WriteInfo(item.StationName, $"{item.StationName}åå ¥æ¸ æä¿¡å·"); continue; } if (PackState == 4 && PackSendState == 4) { Thread.Sleep(200); device.Communicator.Write<short>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == GetPackSendEnum(item.StackerCraneStationCode).ToString()).DeviceProDataBlock, 0); WriteInfo(item.StationName, $"{item.StationName}æ¸ æä¿¡å·å¤ä½"); continue; } //è·åå½åå·¥ä½ç åæ§è¡ä¸æ°æ® ÏîÄ¿´úÂë/WMS/WMSServices/WIDESEA_ITaskInfoService/ITaskService.cs
@@ -276,5 +276,10 @@ /// <returns></returns> WebResponseContent DisableStatus(int[] keys); WebResponseContent BoxingInBound(string stationCode, List<string> barCodes); /// <summary> /// æåå ¥åºæ«ç è¯·æ±æ´æ°æ¡ç /// </summary> /// <returns></returns> WebResponseContent InBoundPalletCode(int taskNum, string barCode); } } ÏîÄ¿´úÂë/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService.cs
@@ -136,6 +136,28 @@ } } /// <summary> /// ä»»å¡ä¿¡æ¯æ¨éè³WCS /// </summary> /// <returns></returns> public List<string> ExistRoadwaysError() { try { string url = AppSettings.Get("WCS"); if (string.IsNullOrEmpty(url)) { return null; } string response = HttpHelper.Get($"{url}/api/Task/ExistRoadwaysError"); return JsonConvert.DeserializeObject<List<string>>(response) ?? throw new Exception("è¿åé误"); } catch (Exception ex) { return null; } } /// <summary> /// æ¾è´§å®æ /// </summary> /// <param name="code"></param> ÏîÄ¿´úÂë/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService_Completed.cs
@@ -108,6 +108,14 @@ wmsTask.Dispatchertime = task.Dispatchertime; wmsTask.TaskType = task.TaskType; wmsTask.TargetAddress = task.TargetAddress; ////æåå ¥åºæ´æ°æçæ¡ç //if (wmsTask.TaskType == TaskTypeEnum.InProduct.ObjToInt() && oldPalletCode != task.PalletCode) //{ // Dt_ProStockInfo stockInfo = _stockRepository.ProStockInfoRepository.QueryFirst(x => x.PalletCode == oldPalletCode); // //夿é夿ç // stockInfo.PalletCode = task.PalletCode; // _stockRepository.ProStockInfoRepository.UpdateData(stockInfo); //} BaseDal.UpdateData(wmsTask); //æ¨éMESæ¥é©³æåæ¥å£ if (wmsTask.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup && !wmsTask.WorkCentreCode.IsNullOrEmpty() && wmsTask.TaskStatus == TaskStatusEnum.AGV_TakeFinish.ObjToInt()) @@ -134,31 +142,24 @@ }; } //æ¨éERPåæåå ¥åº if (wmsTask.TaskType>=TaskTypeEnum.WFBYLInbound.ObjToInt() && wmsTask.TaskType <= TaskTypeEnum.PrintYLInbound.ObjToInt() && wmsTask.TaskStatus==TaskStatusEnum.AGV_TakeFinish.ObjToInt()) { Dt_StockInfo stockInfo = _stockRepository.StockInfoRepository.QueryFirst(x=>x.PalletCode== wmsTask.PalletCode); string request = _invokeERPService.ERPSemiProInUp( new ERPProInUpModel() { PB_INV_PRODUCT_IN = new List<PB_INV_PRODUCT_INItem>() { new PB_INV_PRODUCT_INItem() { WP_ID = 0, INV_BARCODE = wmsTask.PalletCode, REMARK = "åæåå ¥åº", QTY=(int)stockInfo.StockLength } } }) ?? throw new Exception("åæåå ¥åºæ¥å£è¯·æ±å¤±è´¥"); } //æåå ¥åºæ´æ°æçæ¡ç if (wmsTask.TaskType == TaskTypeEnum.InProduct.ObjToInt() && oldPalletCode!=task.PalletCode) { Dt_ProStockInfo stockInfo = _stockRepository.ProStockInfoRepository.QueryFirst(x => x.PalletCode == oldPalletCode); stockInfo.PalletCode = task.PalletCode; _stockRepository.ProStockInfoRepository.UpdateData(stockInfo); } //if (wmsTask.TaskType>=TaskTypeEnum.WFBYLInbound.ObjToInt() && wmsTask.TaskType <= TaskTypeEnum.PrintYLInbound.ObjToInt() && wmsTask.TaskStatus==TaskStatusEnum.AGV_TakeFinish.ObjToInt()) //{ // Dt_StockInfo stockInfo = _stockRepository.StockInfoRepository.QueryFirst(x=>x.PalletCode== wmsTask.PalletCode); // string request = _invokeERPService.ERPSemiProInUp( // new ERPProInUpModel() // { // PB_INV_PRODUCT_IN = new List<PB_INV_PRODUCT_INItem>() // { // new PB_INV_PRODUCT_INItem() // { // WP_ID = 0, // INV_BARCODE = wmsTask.PalletCode, // REMARK = "åæåå ¥åº", // QTY=(int)stockInfo.StockLength // } // } // }) ?? throw new Exception("åæåå ¥åºæ¥å£è¯·æ±å¤±è´¥"); //} } return WebResponseContent.Instance.OK(); } ÏîÄ¿´úÂë/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService_Inbound.cs
@@ -826,6 +826,12 @@ { try { List<string> roadways = ExistRoadwaysError(); bool ErrorRoadway = false; if (roadways!=null && roadways.Count>0) { ErrorRoadway = true; } Dt_StockInfo stockInfo = _stockRepository.StockInfoRepository.QueryFirst(x => x.PalletCode == palletCode); if (stockInfo==null) { @@ -861,8 +867,7 @@ { locationCounts = locationCounts.Where(x => x.RoadwayNo != "SC03_YLDual").ToList(); } roadwayNo = HandleRoadway(locationCounts, warehouse); roadwayNo = HandleRoadway(locationCounts, warehouse, ErrorRoadway ? roadways : null); } } else @@ -872,6 +877,7 @@ { bool LayerLimit = stockInfo.CheckThickness > 1300; bool RoadwayLimit = stockInfo.MaterielWide > 2200; bool RoadwayType = stockInfo.PalletType == LocationTypeEnum.MediumPallet.ObjToInt(); var query = Db.Queryable<Dt_LocationInfo>() .Where(x => x.WarehouseId == warehouse.WarehouseId && x.LocationStatus == (int)LocationStatusEnum.Free @@ -897,15 +903,46 @@ }) .OrderBy(x => x.RoadwayNo) .ToList(); roadwayNo = HandleRoadway(locationCounts, warehouse); if (RoadwayType) { foreach (var item in locationCounts) { if (item.RoadwayNo.Contains("YLDual")) { int count = Db.Queryable<Dt_LocationInfo>() .Where(x => x.WarehouseId == warehouse.WarehouseId && x.LocationStatus == (int)LocationStatusEnum.Free && x.EnableStatus == (int)EnableStatusEnum.Normal && x.LocationType==LocationTypeEnum.MediumPallet.ObjToInt() && x.RoadwayNo == item.RoadwayNo).Count(); item.Count = count; } } } roadwayNo = HandleRoadway(locationCounts, warehouse, ErrorRoadway ? roadways : null); } else if (stockInfo.CheckThickness >= 400 && stockInfo.CheckThickness < 800 && stockInfo.MaterielWide >= 700 && stockInfo.MaterielWide <= 2500) { bool RoadwayType = stockInfo.PalletType == LocationTypeEnum.MediumPallet.ObjToInt(); //è·ååé List<LocationCount> locationCounts = Db.Queryable<Dt_LocationInfo>().Where(x => x.WarehouseId == warehouse.WarehouseId && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() && x.RoadwayNo.Contains("YLDual") && (stockInfo.PalletType == LocationTypeEnum.MediumPallet.ObjToInt() ? x.LocationType == LocationTypeEnum.MediumPallet.ObjToInt() : x.LocationType == LocationTypeEnum.SmallPallet.ObjToInt())).GroupBy(x => x.RoadwayNo).Select(x => new LocationCount { RoadwayNo = x.RoadwayNo, Count = SqlFunc.AggregateCount(x) }).OrderBy(x => x.RoadwayNo).ToList(); roadwayNo = HandleRoadway(locationCounts, warehouse); if (RoadwayType) { foreach (var item in locationCounts) { if (item.RoadwayNo.Contains("YLDual")) { int count = Db.Queryable<Dt_LocationInfo>() .Where(x => x.WarehouseId == warehouse.WarehouseId && x.LocationStatus == (int)LocationStatusEnum.Free && x.EnableStatus == (int)EnableStatusEnum.Normal && x.LocationType == LocationTypeEnum.MediumPallet.ObjToInt() && x.RoadwayNo == item.RoadwayNo).Count(); item.Count = count; } } } roadwayNo = HandleRoadway(locationCounts, warehouse, ErrorRoadway ? roadways : null); } } @@ -923,12 +960,17 @@ } } //å¤çåé å··é 任塿°é public string HandleRoadway(List<LocationCount> locationCounts, Dt_Warehouse warehouse) public string HandleRoadway(List<LocationCount> locationCounts, Dt_Warehouse warehouse,List<string> roadways=null) { if (roadways != null) { locationCounts = locationCounts.Where(x => !roadways.Contains(x.RoadwayNo)).ToList(); } //å··éä»»å¡åé æ°é List<LocationCount> useLocationCounts = Db.Queryable<Dt_Task>().Where(x => x.WarehouseId == warehouse.WarehouseId && locationCounts.Select(j => j.RoadwayNo).Distinct().Contains(x.Roadway) && TaskInboundTypes.Contains(x.TaskType)).GroupBy(x => x.Roadway).Select(x => new LocationCount { RoadwayNo = x.Roadway, Count = SqlFunc.AggregateCount(x) }).ToList(); foreach (var item in locationCounts) { LocationCount? count = useLocationCounts.FirstOrDefault(x => x.RoadwayNo == item.RoadwayNo); @@ -1847,8 +1889,26 @@ List<Dt_Task> tasks = new List<Dt_Task>(); _unitOfWorkManage.BeginTran(); _inboundRepository.MESProInOrderInfoRepository.AddData(AddMESProInOrders); if (AddMESProInOrders.Where(x => x.MESProOrderType == MaterielTypeEnum.åæå.ObjToInt()).Count() > 0) List<Dt_MESProInOrderInfo> mESProInOrderInfos = AddMESProInOrders.Where(x => x.MESProOrderType == MaterielTypeEnum.åæå.ObjToInt()).ToList(); if (mESProInOrderInfos.Count > 0) { List<PB_INV_PRODUCT_INItem> pRODUCT_INItems = new List<PB_INV_PRODUCT_INItem>(); foreach (var item in mESProInOrderInfos) { PB_INV_PRODUCT_INItem pB_INV_PRODUCT_INItem = new PB_INV_PRODUCT_INItem() { WP_ID = item.ProcessNum, INV_BARCODE=item.BarCode, REMARK = "åæåå ¥åº", QTY=(int)item.ProQuantity }; pRODUCT_INItems.Add(pB_INV_PRODUCT_INItem); } string request = _invokeERPService.ERPSemiProInUp( new ERPProInUpModel() { PB_INV_PRODUCT_IN= pRODUCT_INItems }) ?? throw new Exception("åæåå ¥åºæ¥å£è¯·æ±å¤±è´¥"); //çæåæåå ¥åº WebResponseContent webResponse = SemiProInbound(AddMESProInOrders.Where(x => x.MESProOrderType == MaterielTypeEnum.åæå.ObjToInt()).ToList()); if (!webResponse.Status) @@ -2087,5 +2147,43 @@ } return content; } /// <summary> /// æåå ¥åºæ«ç è¯·æ±æ´æ°æ¡ç /// </summary> /// <returns></returns> public WebResponseContent InBoundPalletCode(int taskNum, string barCode) { WebResponseContent content = new WebResponseContent(); try { //è·åå½åä»»å¡ Dt_Task? taskExist = BaseDal.QueryFirst(x => x.TaskNum == taskNum); if (taskExist==null) { return content.Error($"æªæ¾å°ä»»å¡{taskNum}"); } //夿åºå䏿¯å¦åå¨éå¤æçæ¡ç Dt_ProStockInfo? proStockInfo = _stockRepository.ProStockInfoRepository.QueryFirst(x=>x.PalletCode==barCode); if (proStockInfo!=null) { return content.Error($"åºåæ¡ç {proStockInfo.PalletCode}å·²åå¨"); } Dt_ProStockInfo proStockInfoExist = _stockRepository.ProStockInfoRepository.QueryFirst(x=>x.PalletCode== taskExist.PalletCode); //æ´æ° proStockInfoExist.PalletCode = barCode; taskExist.PalletCode = barCode; _unitOfWorkManage.BeginTran(); _stockRepository.ProStockInfoRepository.UpdateData(proStockInfoExist); BaseDal.UpdateData(taskExist); _unitOfWorkManage.CommitTran(); content.OK(); } catch (Exception ex) { _unitOfWorkManage.RollbackTran(); content.Error(ex.Message); } return content; } } } ÏîÄ¿´úÂë/WMS/WMSServices/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs
@@ -334,5 +334,14 @@ { return Service.BoxingInBound(stationCode, barCodes); } /// <summary> /// æåå ¥åºæ«ç è¯·æ±æ´æ°æçæ¡ç /// </summary> /// <returns></returns> [HttpPost, HttpGet, Route("InBoundPalletCode"), AllowAnonymous] public WebResponseContent InBoundPalletCode(int taskNum, string barCode) { return Service.InBoundPalletCode(taskNum, barCode); } } } ÏîÄ¿×ÊÁÏ/ͨÐÅÐÒé/ÔÁÏ¿âÊäËÍÏß¹ÊÕ϶ÁÈ¡.xlsBinary files differ