Merge branch 'master' of http://115.159.85.185:8098/r/MeiRuiAn/HuaiAn
# Conflicts:
# 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IInboundService/IInboundOrderService.cs
| | |
| | | WebResponseContent RequestWMSTask(string palletCode, string sourceAddress, string roadway); |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="sourceAddress"></param> |
| | | /// <param name="palletCode"></param> |
| | | /// <param name="heightType"></param> |
| | | /// <param name="roadways"></param> |
| | | /// <returns></returns> |
| | | WebResponseContent RequestWMSTask(string palletCode, string sourceAddress, int heightType, List<string> roadways); |
| | | |
| | | /// <summary> |
| | | /// åWMSç³è¯·åé
è´§ä½ |
| | | /// </summary> |
| | | /// <param name="taskNum">ä»»å¡å·</param> |
| | |
| | | /// <returns></returns> |
| | | AgvResponseContent AgvUpdateTask(AgvUpdateDTO agvUpdateModel); |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="taskNum"></param> |
| | | /// <returns></returns> |
| | | WebResponseContent SendSecureReplyToAgv(int taskNum); |
| | | |
| | | /// <summary> |
| | |
| | | /// |
| | | /// </summary> |
| | | /// <param name="roadwayNos"></param> |
| | | /// <param name="palletCode"></param> |
| | | /// <param name="heightType"></param> |
| | | /// <returns></returns> |
| | | WebResponseContent RequestWMSAssignRoadway(List<string> roadwayNos, string palletCode, int heightType); |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="roadwayNos"></param> |
| | | /// <param name="taskNum"></param> |
| | | /// <param name="heightType"></param> |
| | | /// <returns></returns> |
| | |
| | | /// <returns></returns> |
| | | WebResponseContent RequestWMSAssignRoadway(List<string> roadwayNos); |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="agvPodModel"></param> |
| | | /// <param name="PodBerthAndMat"></param> |
| | | /// <returns></returns> |
| | | WebResponseContent AgvPodBerthAndMat(AgvPodBerthAndMatDTO agvPodModel, APIEnum PodBerthAndMat = APIEnum.Agv_CSJPodBerthAndMat); |
| | | } |
| | | } |
| | |
| | | return content; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="palletCode"></param> |
| | | /// <param name="sourceAddress"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent RequestWMSTaskSimple(string palletCode, string sourceAddress) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | |
| | | return content; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="palletCode"></param> |
| | | /// <param name="sourceAddress"></param> |
| | | /// <param name="roadway"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent RequestWMSTask(string palletCode, string sourceAddress, string roadway) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | |
| | | 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; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="sourceAddress"></param> |
| | | /// <param name="palletCode"></param> |
| | | /// <param name="heightType"></param> |
| | | /// <param name="roadways"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent RequestWMSTask(string palletCode, string sourceAddress, int heightType, List<string> roadways) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | string address = AppSettings.Get("WMSApiAddress"); |
| | | if (string.IsNullOrEmpty(address)) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°WMSApiå°å"); |
| | | } |
| | | string responseStr = HttpHelper.Post($"{address}/api/Task/DeviceRequestInboundTaskByRoadways?stationCode={sourceAddress}&palletCode={palletCode}&heightType={heightType}", roadways.Serialize()); |
| | | WebResponseContent? responseContent = JsonConvert.DeserializeObject<WebResponseContent>(responseStr); |
| | | if (responseContent != null && responseContent.Status && responseContent.Data != null) |
| | | { |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="roadwayNos"></param> |
| | | /// <param name="palletCode"></param> |
| | | /// <param name="heightType"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent RequestWMSAssignRoadway(List<string> roadwayNos, string palletCode, int heightType) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | string address = AppSettings.Get("WMSApiAddress"); |
| | | if (string.IsNullOrEmpty(address)) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°WMSApiå°å"); |
| | | } |
| | | string responseStr = HttpHelper.Post($"{address}/api/Task/AssignRoadwayByHeightAndCode?palletCode={palletCode}&heightType={heightType}", roadwayNos.Serialize()); |
| | | WebResponseContent? responseContent = JsonConvert.DeserializeObject<WebResponseContent>(responseStr); |
| | | if (responseContent != null && responseContent.Status && responseContent.Data != null) |
| | | { |
| | | return responseContent; |
| | | } |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content = WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// åé
å··é |
| | | /// </summary> |
| | | /// <param name="roadwayNos"></param> |
| | |
| | | private readonly IStationMangerRepository _stationMangerRepository; |
| | | private readonly IRouterRepository _routerRepository; |
| | | private readonly IRouterService _routerService; |
| | | private readonly IRouterExtension _routerExtension; |
| | | private readonly List<Dt_WarehouseDevice> warehouseDevices; |
| | | |
| | | public RGVJob_BC(ICacheService cacheService, ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository, IRouterService routerService) |
| | | public RGVJob_BC(ICacheService cacheService, ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository, IRouterService routerService, IRouterExtension routerExtension) |
| | | { |
| | | _cacheService = cacheService; |
| | | _taskService = taskService; |
| | |
| | | _stationMangerRepository = stationMangerRepository; |
| | | _routerRepository = routerRepository; |
| | | _routerService = routerService; |
| | | _routerExtension = routerExtension; |
| | | |
| | | string? warehouseDevicesStr = _cacheService.Get<string>(nameof(Dt_WarehouseDevice)); |
| | | if (!string.IsNullOrEmpty(warehouseDevicesStr)) |
| | |
| | | |
| | | if (item.StationType == StationTypeEnum.StationType_InStartAndOutEnd.ObjToInt()) |
| | | { |
| | | if (conveyorLineSignalRead.STB && /*conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && */!conveyorLineSignalWrite.ACK && !string.IsNullOrEmpty(conveyorLineInfoRead.Barcode) && conveyorLineInfoRead.TaskNum == 0)//å
¥åº |
| | | //if (conveyorLineSignalRead.STB && !conveyorLineSignalWrite.ACK && !string.IsNullOrEmpty(conveyorLineInfoRead.Barcode) && conveyorLineInfoRead.TaskNum == 0)//å
¥åº |
| | | //{ |
| | | // List<string> stations = _routerExtension.GetEndPoint(item.StationCode, TaskTypeEnum.Inbound.ObjToInt()).Select(x => x.NextPosi).ToList(); |
| | | // WebResponseContent responseContent = _taskService.RequestWMSTask(conveyorLineInfoRead.Barcode, item.StationCode, conveyorLineInfoRead.Spare2, stations); |
| | | // if (responseContent.Status) |
| | | // { |
| | | // Dt_Task task = _taskRepository.QueryFirst(x => x.PalletCode == conveyorLineInfoRead.Barcode && x.CurrentAddress == item.StationCode && x.DeviceCode == device.DeviceCode && x.TaskState == TaskStatusEnum.New.ObjToInt()); |
| | | // if (task != null) |
| | | // { |
| | | // device.SetValue(W_ConveyorLineDB.TaskNum, task.TaskNum, item.StationCode); |
| | | // device.SetValue(W_ConveyorLineDB.StartPos, task.CurrentAddress, item.StationCode); |
| | | // device.SetValue(W_ConveyorLineDB.Spare1, ConveyorWorkTypeEnum.Inbound.ObjToInt(), item.StationCode); |
| | | // device.SetValue(W_ConveyorLineDB.EndPos, task.NextAddress, item.StationCode); |
| | | // device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode); |
| | | // _taskService.UpdateTask(task, TaskStatusEnum.Line_Executing); |
| | | // } |
| | | // } |
| | | //} |
| | | |
| | | if (conveyorLineSignalRead.STB && !conveyorLineSignalWrite.ACK && !string.IsNullOrEmpty(conveyorLineInfoRead.Barcode) && conveyorLineInfoRead.TaskNum == 0)//å
¥åº |
| | | { |
| | | WebResponseContent content = _taskService.RequestWMSTaskSimple(conveyorLineInfoRead.Barcode, item.StationCode); |
| | | if (content.Status) |
| | |
| | | _taskService.UpdateTask(task, TaskStatusEnum.Line_Executing); |
| | | } |
| | | } |
| | | |
| | | #region |
| | | //Dt_Task task = _taskRepository.QueryFirst(x => x.SourceAddress == item.StationDeviceCode && x.TaskState == TaskStatusEnum.New.ObjToInt() && _taskService.TaskInboundTypes.Contains(x.TaskType) && x.PalletCode == conveyorLineInfoRead.Barcode && string.IsNullOrEmpty(x.DeviceCode) && string.IsNullOrEmpty(x.NextAddress) && string.IsNullOrEmpty(x.TargetAddress)); |
| | | //if (task != null && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup) |
| | | //{ |
| | | // Dt_StationManger? stationManger = stationMangers.FirstOrDefault(x => x.StationCode == item.StationCode); |
| | | // if (stationManger == null) |
| | | // { |
| | | // WriteError(item.StationName, $"æªæ¾å°å¯¹åºç«å°ä¿¡æ¯,设å¤ç¼å·:{item.StationCode},ä»»å¡å·:{task.TaskNum}"); |
| | | // continue; |
| | | // } |
| | | // List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == task.TaskType && (task.Roadway == x.ChildPosiDeviceCode || task.Roadway == x.ChildPosi)); |
| | | // Dt_Router? router = routers.FirstOrDefault(); |
| | | // if (router == null) |
| | | // { |
| | | // WriteError(device.DeviceName, $"æªæ¾å°ä»»å¡ç±»å{task.TaskType}对åºçè·¯ç±ä¿¡æ¯"); |
| | | // } |
| | | // else |
| | | // { |
| | | // if (routers.Count == 1) |
| | | // { |
| | | // task.Dispatchertime = DateTime.Now; |
| | | // _taskService.UpdateTask(task, TaskStatusEnum.Line_Executing, deviceCode: router.ChildPosi, targetAddress: router.NextPosi, nextAddress: router.StartPosi, currentAddress: item.StationCode); |
| | | |
| | | // device.SetValue(W_ConveyorLineDB.StartPos, item.StationCode, item.StationCode); |
| | | // device.SetValue(W_ConveyorLineDB.EndPos, router.StartPosi, item.StationCode); |
| | | // device.SetValue(W_ConveyorLineDB.TaskNum, task.TaskNum, item.StationCode); |
| | | // device.SetValue(W_ConveyorLineDB.Spare1, ConveyorWorkTypeEnum.Inbound.ObjToInt(), item.StationCode); |
| | | // device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode); |
| | | // } |
| | | // else |
| | | // { |
| | | // List<string> canInboundStations = new List<string>(); |
| | | // List<string> stations = routers.Select(x => x.NextPosi).ToList(); |
| | | // foreach (string station in stations) |
| | | // { |
| | | // Dt_StationManger stationManger1 = _stationMangerRepository.QueryFirst(x => x.StationCode == station); |
| | | // if (stationManger1 != null) |
| | | // { |
| | | // IDevice? device1 = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger1.StationDeviceCode); |
| | | // if (device1 != null) |
| | | // { |
| | | // OtherDevice otherDevice = (OtherDevice)device1; |
| | | // //short workType = otherDevice.GetValue<R_ConveyorLineWorkType, short>(R_ConveyorLineWorkType.ConveyorLineWorkType, item.StationCode); |
| | | // //if (workType == ConveyorWorkTypeEnum.Undefined.ObjToInt() || workType == ConveyorWorkTypeEnum.Inbound.ObjToInt()) |
| | | // { |
| | | // canInboundStations.Add(stationManger1.Remark); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | // WebResponseContent responseContent = _taskService.RequestWMSAssignRoadway(task.TaskNum, canInboundStations); |
| | | // if (responseContent.Status) |
| | | // { |
| | | // List<Dt_Router> dt_Routers = _routerService.QueryNextRoutes(item.StationCode, responseContent.Data.ToString() ?? "", task.TaskType); |
| | | |
| | | // Dt_Router? routerTemp = _routerService.QueryNextRoutes(item.StationCode, responseContent.Data.ToString() ?? "", task.TaskType).FirstOrDefault(); |
| | | // if (routerTemp != null) |
| | | // { |
| | | // task.Dispatchertime = DateTime.Now; |
| | | // task.Roadway = responseContent.Data.ToString() ?? task.Roadway; |
| | | // _taskService.UpdateTask(task, TaskStatusEnum.Line_Executing, deviceCode: routerTemp.ChildPosiDeviceCode, targetAddress: routerTemp.NextPosi, nextAddress: routerTemp.NextPosi, currentAddress: item.StationCode); |
| | | |
| | | // device.SetValue(W_ConveyorLineDB.StartPos, item.StationCode, item.StationCode); |
| | | // device.SetValue(W_ConveyorLineDB.EndPos, routerTemp.NextPosi, item.StationCode); |
| | | // device.SetValue(W_ConveyorLineDB.TaskNum, task.TaskNum, item.StationCode); |
| | | // device.SetValue(W_ConveyorLineDB.Spare1, ConveyorWorkTypeEnum.Inbound.ObjToInt(), item.StationCode); |
| | | // device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode); |
| | | // } |
| | | // else |
| | | // { |
| | | // WriteError(device.DeviceName, $"æªæ¾å°ä»»å¡ç±»å{task.TaskType},èµ·ç¹{item.StationCode},ç»ç¹{responseContent.Data.ToString()}çè·¯ç±ä¿¡æ¯"); |
| | | // } |
| | | // } |
| | | // else |
| | | // { |
| | | // WriteError(device.DeviceName, responseContent.Message); |
| | | // } |
| | | // } |
| | | // } |
| | | //} |
| | | #endregion |
| | | } |
| | | else if (conveyorLineSignalRead.STB /*&& conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm*/ && !conveyorLineSignalWrite.ACK && conveyorLineInfoRead.TaskNum > 0)//åºåº |
| | | { |
| | |
| | | title: "ç©æç¼ç ", |
| | | field: "materielCode", |
| | | type: "select", |
| | | required: true, |
| | | // dataKey: "MaterielCodes", |
| | | data: [], |
| | | required: true, |
| | | }, |
| | | ], |
| | | [ |
| | |
| | | title: "éè´åå·", |
| | | field: "purchaseOrderNo", |
| | | type: "select", |
| | | // dataKey: "purchaseOrderNos", |
| | | data: [], |
| | | required: true, |
| | | }, |
| | |
| | | /// <param name="stationCode"></param> |
| | | /// <param name="palletCode"></param> |
| | | /// <returns></returns> |
| | | WebResponseContent DeviceRequestInboundTask(string stationCode, string palletCode); |
| | | WebResponseContent DeviceRequestInboundTaskSimple(string stationCode, string palletCode); |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="stationCode"></param> |
| | | /// <param name="palletCode"></param> |
| | | /// <param name="roadwayNos"></param> |
| | | /// <param name="heightType"></param> |
| | | /// <returns></returns> |
| | | WebResponseContent DeviceRequestInboundTaskByRoadways(string stationCode, string palletCode, List<string> roadwayNos, int heightType); |
| | | |
| | | /// <summary> |
| | | /// å
¥åºä»»å¡ç³è¯·åé
è´§ä½ |
| | |
| | | /// </summary> |
| | | /// <param name="keys"></param> |
| | | /// <returns></returns> |
| | | WebResponseContent GenerateOutboundTask(int[] keys); |
| | | WebResponseContent GenerateOutboundTasks(int[] keys); |
| | | |
| | | /// <summary> |
| | | /// åºåºä»»å¡å®æ |
| | |
| | | /// <param name="taskNum"></param> |
| | | /// <param name="heightType"></param> |
| | | /// <returns></returns> |
| | | WebResponseContent AssignRoadway(List<string> roadwayNos, int taskNum, int heightType = 0); |
| | | WebResponseContent AssignRoadwayByHeight(List<string> roadwayNos, int taskNum, int heightType = 0); |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="roadwayNos"></param> |
| | | /// <param name="palletCode"></param> |
| | | /// <param name="heightType"></param> |
| | | /// <returns></returns> |
| | | WebResponseContent AssignRoadwayByHeightAndCode(List<string> roadwayNos, string palletCode, int heightType = 0); |
| | | |
| | | /// <summary> |
| | | /// åé
å··é |
| | |
| | | /// </summary> |
| | | /// <param name="roadwayNos"></param> |
| | | /// <returns></returns> |
| | | WebResponseContent AssignRoadway(List<string> roadwayNos); |
| | | WebResponseContent SingleAssignRoadway(List<string> roadwayNos); |
| | | |
| | | /// <summary> |
| | | /// |
| | |
| | | PalletCode = palletCode, |
| | | StockStatus = StockStatusEmun.ç»çæå.ObjToInt(), |
| | | WarehouseId = inboundOrder.WarehouseId, |
| | | PalletType = GetPalletType(warehouse, palletCode, materielInfo), |
| | | PalletType = GetPalletType(warehouse, palletCode), |
| | | Details = new List<Dt_StockInfoDetail>() |
| | | }; |
| | | } |
| | |
| | | PalletCode = palletCode, |
| | | StockStatus = StockStatusEmun.æå¨ç»çæå.ObjToInt(), |
| | | WarehouseId = warehouse.WarehouseId, |
| | | PalletType = GetPalletType(warehouse, palletCode, materielInfo), |
| | | PalletType = GetPalletType(warehouse, palletCode), |
| | | Details = new List<Dt_StockInfoDetail>() |
| | | }; |
| | | } |
| | |
| | | // } |
| | | //} |
| | | |
| | | public int GetPalletType(Dt_Warehouse warehouse, string palletCode, Dt_MaterielInfo materielInfo) |
| | | public int GetPalletType(Dt_Warehouse warehouse, string palletCode) |
| | | { |
| | | if (warehouse.WarehouseCode == WarehouseEnum.HA64.ToString()) |
| | | { |
| | |
| | | { |
| | | List<Dt_PurchaseOrderDetail> purchaseOrderDetails = BaseDal.QueryData(x => x.WarehouseId == warehouseId && x.PurchaseDetailStatus != PurchaseOrderDetailStatusEnum.Received.ObjToInt()); |
| | | List<string> MaterielCodes = purchaseOrderDetails.Select(x => x.MaterielCode).ToList(); |
| | | MaterielCodes = MaterielCodes.Distinct().ToList(); |
| | | return WebResponseContent.Instance.OK(data: MaterielCodes); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | /// <param name="taskNum">ä»»å¡å·</param> |
| | | /// <param name="roadwayNos">å··éå·</param> |
| | | /// <returns></returns> |
| | | public WebResponseContent AssignRoadway(List<string> roadwayNos, int taskNum, int heightType = 0) |
| | | public WebResponseContent AssignRoadwayByHeight(List<string> roadwayNos, int taskNum, int heightType = 0) |
| | | { |
| | | try |
| | | { |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="roadwayNos"></param> |
| | | /// <param name="palletCode"></param> |
| | | /// <param name="heightType"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent AssignRoadwayByHeightAndCode(List<string> roadwayNos, string palletCode, int heightType = 0) |
| | | { |
| | | try |
| | | { |
| | | if (heightType == 0 || heightType > 3) |
| | | { |
| | | return WebResponseContent.Instance.Error($"é«åº¦é误"); |
| | | } |
| | | if (roadwayNos == null || roadwayNos.Count == 0) |
| | | { |
| | | return WebResponseContent.Instance.Error($"å··éä¸è½ä¸ºç©º"); |
| | | } |
| | | Dt_LocationInfo locationInfo = _basicRepository.LocationInfoRepository.QueryFirst(x => x.RoadwayNo == roadwayNos[0]); |
| | | if (locationInfo == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°å··é对åºè´§ä½"); |
| | | } |
| | | Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseId == locationInfo.WarehouseId); |
| | | if (warehouse == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°å··é对åºä»åºä¿¡æ¯"); |
| | | } |
| | | |
| | | int palletType = _inboundOrderService.GetPalletType(warehouse, palletCode); |
| | | if (palletType == -1) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æçå·è§£ææçç±»åé误"); |
| | | } |
| | | |
| | | string roadwayNo = ""; |
| | | if (heightType == 1) |
| | | { |
| | | List<LocationCount> locationCounts = Db.Queryable<Dt_LocationInfo>().Where(x => (x.LocationType == palletType || x.LocationType == LocationTypeEnum.Undefined.ObjToInt()) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && roadwayNos.Contains(x.RoadwayNo) && x.Layer <= 3).GroupBy(x => x.RoadwayNo).Select(x => new LocationCount { RoadwayNo = x.RoadwayNo, Count = SqlFunc.AggregateCount(x) }).ToList(); |
| | | roadwayNo = locationCounts.OrderBy(x => x.Count).FirstOrDefault()?.RoadwayNo ?? ""; |
| | | } |
| | | else if (heightType == 2) |
| | | { |
| | | List<LocationCount> locationCounts = Db.Queryable<Dt_LocationInfo>().Where(x => (x.LocationType == palletType || x.LocationType == LocationTypeEnum.Undefined.ObjToInt()) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && roadwayNos.Contains(x.RoadwayNo) && x.Layer == 4).GroupBy(x => x.RoadwayNo).Select(x => new LocationCount { RoadwayNo = x.RoadwayNo, Count = SqlFunc.AggregateCount(x) }).ToList(); |
| | | roadwayNo = locationCounts.OrderBy(x => x.Count).FirstOrDefault()?.RoadwayNo ?? ""; |
| | | } |
| | | else if (heightType == 3) |
| | | { |
| | | List<LocationCount> locationCounts = Db.Queryable<Dt_LocationInfo>().Where(x => (x.LocationType == palletType || x.LocationType == LocationTypeEnum.Undefined.ObjToInt()) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && roadwayNos.Contains(x.RoadwayNo) && x.Layer == 5).GroupBy(x => x.RoadwayNo).Select(x => new LocationCount { RoadwayNo = x.RoadwayNo, Count = SqlFunc.AggregateCount(x) }).ToList(); |
| | | roadwayNo = locationCounts.OrderBy(x => x.Count).FirstOrDefault()?.RoadwayNo ?? ""; |
| | | } |
| | | |
| | | return !string.IsNullOrEmpty(roadwayNo) ? WebResponseContent.Instance.OK(data: roadwayNo) : WebResponseContent.Instance.Error("æªæ¾å°å¯åé
å··é"); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | |
| | | public string AssignRoadwayNo(List<string> roadwayNos, string palletCode, int heightType = 0) |
| | | { |
| | | try |
| | | { |
| | | if (heightType == 0 || heightType > 3) |
| | | { |
| | | throw new Exception($"é«åº¦é误"); |
| | | } |
| | | if (roadwayNos == null || roadwayNos.Count == 0) |
| | | { |
| | | throw new Exception($"å··éä¸è½ä¸ºç©º"); |
| | | } |
| | | Dt_LocationInfo locationInfo = _basicRepository.LocationInfoRepository.QueryFirst(x => x.RoadwayNo == roadwayNos[0]); |
| | | if (locationInfo == null) |
| | | { |
| | | throw new Exception($"æªæ¾å°å··é对åºè´§ä½"); |
| | | } |
| | | Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseId == locationInfo.WarehouseId); |
| | | if (warehouse == null) |
| | | { |
| | | throw new Exception($"æªæ¾å°å··é对åºä»åºä¿¡æ¯"); |
| | | } |
| | | |
| | | int palletType = _inboundOrderService.GetPalletType(warehouse, palletCode); |
| | | if (palletType == -1) |
| | | { |
| | | throw new Exception($"æçå·è§£ææçç±»åé误"); |
| | | } |
| | | |
| | | string roadwayNo = ""; |
| | | if (heightType == 1) |
| | | { |
| | | List<LocationCount> locationCounts = Db.Queryable<Dt_LocationInfo>().Where(x => (x.LocationType == palletType || x.LocationType == LocationTypeEnum.Undefined.ObjToInt()) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && roadwayNos.Contains(x.RoadwayNo) && x.Layer <= 3).GroupBy(x => x.RoadwayNo).Select(x => new LocationCount { RoadwayNo = x.RoadwayNo, Count = SqlFunc.AggregateCount(x) }).ToList(); |
| | | roadwayNo = locationCounts.OrderBy(x => x.Count).FirstOrDefault()?.RoadwayNo ?? ""; |
| | | } |
| | | else if (heightType == 2) |
| | | { |
| | | List<LocationCount> locationCounts = Db.Queryable<Dt_LocationInfo>().Where(x => (x.LocationType == palletType || x.LocationType == LocationTypeEnum.Undefined.ObjToInt()) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && roadwayNos.Contains(x.RoadwayNo) && x.Layer == 4).GroupBy(x => x.RoadwayNo).Select(x => new LocationCount { RoadwayNo = x.RoadwayNo, Count = SqlFunc.AggregateCount(x) }).ToList(); |
| | | roadwayNo = locationCounts.OrderBy(x => x.Count).FirstOrDefault()?.RoadwayNo ?? ""; |
| | | } |
| | | else if (heightType == 3) |
| | | { |
| | | List<LocationCount> locationCounts = Db.Queryable<Dt_LocationInfo>().Where(x => (x.LocationType == palletType || x.LocationType == LocationTypeEnum.Undefined.ObjToInt()) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && roadwayNos.Contains(x.RoadwayNo) && x.Layer == 5).GroupBy(x => x.RoadwayNo).Select(x => new LocationCount { RoadwayNo = x.RoadwayNo, Count = SqlFunc.AggregateCount(x) }).ToList(); |
| | | roadwayNo = locationCounts.OrderBy(x => x.Count).FirstOrDefault()?.RoadwayNo ?? ""; |
| | | } |
| | | |
| | | return !string.IsNullOrEmpty(roadwayNo) ? ( roadwayNo) : throw new Exception("æªæ¾å°å¯åé
å··é"); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | throw new Exception(ex.Message); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å
¥åºä»»å¡ç³è¯·åé
è´§ä½ |
| | | /// </summary> |
| | | /// <param name="taskNum">ä»»å¡å·</param> |
| | |
| | | /// </summary> |
| | | /// <param name="roadwayNos">å··éå·</param> |
| | | /// <returns></returns> |
| | | public WebResponseContent AssignRoadway(List<string> roadwayNos) |
| | | public WebResponseContent SingleAssignRoadway(List<string> roadwayNos) |
| | | { |
| | | try |
| | | { |
| | |
| | | /// <param name="stationCode"></param> |
| | | /// <param name="palletCode"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent DeviceRequestInboundTask(string stationCode, string palletCode) |
| | | public WebResponseContent DeviceRequestInboundTaskSimple(string stationCode, string palletCode) |
| | | { |
| | | try |
| | | { |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="stationCode"></param> |
| | | /// <param name="palletCode"></param> |
| | | /// <param name="staions"></param> |
| | | /// <param name="heightType"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent DeviceRequestInboundTaskByRoadways(string stationCode, string palletCode, List<string> staions, int heightType) |
| | | { |
| | | try |
| | | { |
| | | Dt_Task task = Repository.QueryFirst(x => x.PalletCode == palletCode); |
| | | if (task != null) |
| | | { |
| | | PushTasksToWCS(new List<Dt_Task> { task }); |
| | | return WebResponseContent.Instance.OK($"该æçå·²çæä»»å¡", _mapper.Map<WMSTaskDTO>(task)); |
| | | } |
| | | |
| | | if (Repository.QueryFirst(x => x.SourceAddress == stationCode && x.TaskStatus == TaskStatusEnum.New.ObjToInt()) != null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"该ç«ç¹å·²ææªæ§è¡çä»»å¡"); |
| | | } |
| | | |
| | | string roadwayNo = AssignRoadwayNo(staions, palletCode, heightType); |
| | | |
| | | Dt_StockInfo stockInfo = _stockRepository.StockInfoRepository.QueryFirst(x => x.PalletCode == palletCode); |
| | | if (stockInfo == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°ç»çä¿¡æ¯"); |
| | | } |
| | | if (stockInfo.StockStatus != StockStatusEmun.ç»çæå.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.æå¨ç»çæå.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.åºåºå®æ.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.æ£é宿.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.éåº.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.MESéåº.ObjToInt()) |
| | | { |
| | | return WebResponseContent.Instance.Error($"该æçç¶æä¸æ£ç¡®,ä¸å¯ç³è¯·å
¥åº"); |
| | | } |
| | | if (!string.IsNullOrEmpty(stockInfo.LocationCode)) |
| | | { |
| | | return WebResponseContent.Instance.Error($"该æçå·²ç»å®è´§ä½"); |
| | | } |
| | | |
| | | Dt_Task newTask = new Dt_Task() |
| | | { |
| | | CurrentAddress = stationCode, |
| | | Grade = 0, |
| | | NextAddress = "", |
| | | PalletCode = palletCode, |
| | | Roadway = roadwayNo, |
| | | SourceAddress = stationCode, |
| | | TargetAddress = roadwayNo, |
| | | TaskType = TaskTypeEnum.Inbound.ObjToInt(), |
| | | TaskStatus = TaskStatusEnum.New.ObjToInt(), |
| | | WarehouseId = stockInfo.WarehouseId, |
| | | PalletType = stockInfo.PalletType |
| | | }; |
| | | |
| | | if (stockInfo.StockStatus == StockStatusEmun.æå¨ç»çæå.ObjToInt()) |
| | | { |
| | | stockInfo.StockStatus = StockStatusEmun.æå¨ç»çå
¥åºç¡®è®¤.ObjToInt(); |
| | | } |
| | | else if (stockInfo.StockStatus == StockStatusEmun.MESéåº.ObjToInt()) |
| | | { |
| | | newTask.TaskType = TaskTypeEnum.MesMatReturn.ObjToInt(); |
| | | } |
| | | else |
| | | { |
| | | stockInfo.StockStatus = StockStatusEmun.å
¥åºç¡®è®¤.ObjToInt(); |
| | | } |
| | | |
| | | _unitOfWorkManage.BeginTran(); |
| | | int taskId = BaseDal.AddData(newTask); |
| | | newTask.TaskId = taskId; |
| | | _stockRepository.StockInfoRepository.UpdateData(stockInfo); |
| | | _unitOfWorkManage.CommitTran(); |
| | | WMSTaskDTO wMSTaskDTO = _mapper.Map<WMSTaskDTO>(newTask); |
| | | |
| | | PushTasksToWCS(new List<Dt_Task> { newTask }); |
| | | //if (newTask.WarehouseId == 5) PutFinish(stationCode); |
| | | return WebResponseContent.Instance.OK(data: wMSTaskDTO); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å
¥åºä»»å¡ç³è¯·åé
è´§ä½ |
| | | /// </summary> |
| | | /// <param name="taskNum">ä»»å¡å·</param> |
| | |
| | | /// </summary> |
| | | /// <param name="keys">åºåºåæç»ä¸»é®</param> |
| | | /// <returns></returns> |
| | | public WebResponseContent GenerateOutboundTask(int[] keys) |
| | | public WebResponseContent GenerateOutboundTasks(int[] keys) |
| | | { |
| | | try |
| | | { |
| | |
| | | { |
| | | List<int> keys = _outboundService.OutboundOrderDetailService.Repository.QueryData(x => x.Id, x => x.OrderId == outboundId); |
| | | |
| | | return GenerateOutboundTask(keys.ToArray()); |
| | | return GenerateOutboundTasks(keys.ToArray()); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | [HttpPost, HttpGet, Route("DeviceRequestInboundTaskSimple"), AllowAnonymous] |
| | | public WebResponseContent DeviceRequestInboundTaskSimple(string stationCode, string palletCode) |
| | | { |
| | | return Service.DeviceRequestInboundTask(stationCode, palletCode); |
| | | return Service.DeviceRequestInboundTaskSimple(stationCode, palletCode); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="stationCode"></param> |
| | | /// <param name="palletCode"></param> |
| | | /// <param name="roadwayNos"></param> |
| | | /// <param name="heightType"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("DeviceRequestInboundTaskByRoadways"), AllowAnonymous] |
| | | public WebResponseContent DeviceRequestInboundTaskByRoadways(string stationCode, string palletCode, int heightType, [FromBody] List<string> roadwayNos) |
| | | { |
| | | return Service.DeviceRequestInboundTaskByRoadways(stationCode, palletCode, roadwayNos, heightType); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <param name="keys"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("GenerateOutboundTasks"), AllowAnonymous] |
| | | public WebResponseContent GenerateOutboundTask([FromBody] int[] keys) |
| | | public WebResponseContent GenerateOutboundTasks([FromBody] int[] keys) |
| | | { |
| | | return Service.GenerateOutboundTask(keys); |
| | | return Service.GenerateOutboundTasks(keys); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | [HttpPost, Route("AssignRoadwayByHeight"), AllowAnonymous] |
| | | public WebResponseContent AssignRoadwayByHeight([FromBody] List<string> roadwayNos, int taskNum, int heightType = 0) |
| | | { |
| | | return Service.AssignRoadway(roadwayNos, taskNum, heightType); |
| | | return Service.AssignRoadwayByHeight(roadwayNos, taskNum, heightType); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="roadwayNos"></param> |
| | | /// <param name="palletCode"></param> |
| | | /// <param name="heightType"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("AssignRoadwayByHeightAndCode"), AllowAnonymous] |
| | | public WebResponseContent AssignRoadwayByHeightAndCode([FromBody] List<string> roadwayNos, string palletCode, int heightType = 0) |
| | | { |
| | | return Service.AssignRoadwayByHeightAndCode(roadwayNos, palletCode, heightType); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <param name="roadwayNos"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("SingleAssignRoadway"), AllowAnonymous] |
| | | public WebResponseContent AssignRoadway([FromBody] List<string> roadwayNos) |
| | | public WebResponseContent SingleAssignRoadway([FromBody] List<string> roadwayNos) |
| | | { |
| | | return Service.AssignRoadway(roadwayNos); |
| | | return Service.SingleAssignRoadway(roadwayNos); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | app.UseAllServicesMiddle(builder.Services); |
| | | |
| | | app.UseSession(); |
| | | //if (app.Environment.IsDevelopment()) |
| | | if (app.Environment.IsProduction()) |
| | | { |
| | | //todo |
| | | app.UseSwaggerAuthorized(); |
| | | app.UseSwaggerMiddle(() => Assembly.GetExecutingAssembly().GetManifestResourceStream("WIDESEA_WMSServer.index.html") ?? throw new Exception("WIDESEA_WMSServer.index.htmlæä»¶")); |
| | | |
| | | }//夿æ¯å¦éè¦æå¼swagger |
| | | |
| | | app.UseSwaggerMiddle(() => Assembly.GetExecutingAssembly().GetManifestResourceStream("WIDESEA_WMSServer.index.html") ?? throw new Exception("WIDESEA_WMSServer.index.htmlæä»¶")); |
| | | app.UseIpLimitMiddle(); |
| | | app.UseApiLogMiddleware(); |
| | | //todo |
| | |
| | | placeholder="è¯·æ«ææçæ¡ç " ref='midInput' @input="inputChangebarcode" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item label="å°åæ¡ç "> |
| | | <uni-easyinput type="text" v-model="address" :disabled="addressdisabled" placeholder="è¯·æ«æå°åæ¡ç " ref='midInput' |
| | | :focus="addressFocus" /> |
| | | <uni-easyinput type="text" v-model="address" :disabled="addressdisabled" |
| | | placeholder="è¯·æ«æå°åæ¡ç " ref='midInput' :focus="addressFocus" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item> |
| | | <button @click="inbound" type="primary" size="default" style="margin-top: 2%;">å
¥åºç¡®è®¤</button> |
| | |
| | | <view style="font-size: 18px;">åæ®å·ï¼{{orderNo}}</view> |
| | | <view style="font-size: 18px;">ç©æç¼ç ï¼{{item.materielCode}}</view> |
| | | <!-- <view style="font-size: 18px;">ç©æåç§°ï¼{{item.matName}}</view> --> |
| | | <view style="font-size: 18px;">æ°éï¼{{item.orderQuantity}}</view> |
| | | <view style="font-size: 18px;">åä½ï¼{{item.unit}}</view> |
| | | <view style="font-size: 18px;">æ°éï¼{{item.orderQuantity+item.unit}}</view> |
| | | <view style="font-size: 18px;">ç»çæ°éï¼{{item.receiptQuantity}}</view> |
| | | </view> |
| | | </view> |