已删除5个文件
已修改24个文件
已添加20个文件
| | |
| | | New = 100, |
| | | |
| | | /// <summary> |
| | | /// æåæºæ§è¡ä¸ |
| | | /// </summary> |
| | | [Description("æåæºæ§è¡ä¸")] |
| | | HT_Executing = 110, |
| | | |
| | | /// <summary> |
| | | /// å åæºå¾
æ§è¡ |
| | | /// </summary> |
| | | [Description("å åæºå¾
æ§è¡")] |
| | |
| | | /// </summary> |
| | | [Description("ä»»å¡å¼å¸¸")] |
| | | Exception = 990, |
| | | /// <summary> |
| | | /// æåæºæ§è¡ä¸ |
| | | /// </summary> |
| | | [Description("æåæºæ§è¡ä¸")] |
| | | HT_Executing = 110, |
| | | |
| | | } |
| | | } |
| | |
| | | MesMatReturn = 560, |
| | | |
| | | /// <summary> |
| | | /// MES空æéæ |
| | | /// </summary> |
| | | [Description("MES空æéæ")] |
| | | MesPalletReturn = 580, |
| | | |
| | | /// <summary> |
| | | /// è°æ¨å
¥åº |
| | | /// </summary> |
| | | [Description("è°æ¨å
¥åº")] |
| | |
| | | /// <param name="PodBerthAndMat"></param> |
| | | /// <returns></returns> |
| | | WebResponseContent AgvPodBerthAndMat(AgvPodBerthAndMatDTO agvPodModel, APIEnum PodBerthAndMat = APIEnum.Agv_CSJPodBerthAndMat); |
| | | /// <summary> |
| | | /// //å¤æç§»åºè´§ä½ä»»å¡æ¯å¦å·²åå¨ï¼å¦åå¨å
æ§è¡ |
| | | /// </summary> |
| | | Dt_Task QueryStackerExistTask(string PalletCode,string locationCode); |
| | | } |
| | | } |
| | |
| | | #endregion << ç æ¬ 注 é >> |
| | | |
| | | using AutoMapper; |
| | | using HslCommunication.Enthernet; |
| | | using Newtonsoft.Json; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.Text; |
| | | using SqlSugar; |
| | |
| | | private Dictionary<string, OrderByType> _taskOrderBy = new() |
| | | { |
| | | {nameof(Dt_Task.Grade),OrderByType.Desc }, |
| | | {nameof(Dt_Task.TaskNum),OrderByType.Asc}, |
| | | {nameof(Dt_Task.CreateDate),OrderByType.Asc}, |
| | | }; |
| | | |
| | |
| | | task.NextAddress = router.NextPosi; |
| | | task.DeviceCode = router.ChildPosi; |
| | | } |
| | | else if (item.TaskType == TaskTypeEnum.MesOutbound.ObjToInt() || item.TaskType == TaskTypeEnum.MesHandOutbound.ObjToInt() || item.TaskType == TaskTypeEnum.MesHandPickOutbound.ObjToInt()) |
| | | else if (item.TaskType == TaskTypeEnum.MesPalletReturn.ObjToInt() && router.IsEnd) |
| | | { |
| | | task.NextAddress = router.NextPosi; |
| | | task.DeviceCode = router.ChildPosi; |
| | | } |
| | | else if (item.TaskType == TaskTypeEnum.MesOutbound.ObjToInt() || item.TaskType == TaskTypeEnum.MesHandOutbound.ObjToInt() || item.TaskType == TaskTypeEnum.MesHandPickOutbound.ObjToInt() || (item.TaskType == TaskTypeEnum.OutAllocate.ObjToInt() && item.RoadWay.Contains("BC"))) |
| | | { |
| | | task.NextAddress = router.NextPosi; |
| | | task.DeviceCode = stationManger.StackerCraneCode; |
| | |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// //å¤æç§»åºè´§ä½ä»»å¡æ¯å¦å·²åå¨ï¼å¦åå¨å
æ§è¡ |
| | | /// </summary> |
| | | public Dt_Task QueryStackerExistTask(string PalletCode, string locationCode) |
| | | { |
| | | return BaseDal.QueryFirst(x => x.PalletCode == PalletCode && x.SourceAddress == locationCode && x.TaskState == (int)TaskStatusEnum.SC_Execute); |
| | | } |
| | | } |
| | | } |
| | |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType) /*&& x.DeviceCode == item.StationDeviceCode*/ && (x.TaskState == TaskStatusEnum.New.ObjToInt()) && x.WarehouseId == warehouseDevice.WarehouseId); |
| | | if (task != null && conveyorLineInfoWrite.Spare2 == 0 && conveyorLineStatus.Goods) |
| | | { |
| | | List<string> stations = _routerExtension.GetEndPoint(item.StationCode, TaskTypeEnum.Inbound.ObjToInt()).Select(x => x.NextPosi).ToList(); |
| | | WebResponseContent responseContent = _taskService.RequestWMSAssignRoadway(stations, task.TaskNum, conveyorLineInfoRead.Spare2); |
| | | if (responseContent.Status) |
| | | { |
| | | //List<string> stations = _routerExtension.GetEndPoint(item.StationCode, TaskTypeEnum.Inbound.ObjToInt()).Select(x => x.NextPosi).ToList(); |
| | | ////åé
å··é |
| | | //WebResponseContent responseContent = _taskService.RequestWMSAssignRoadway(stations, task.TaskNum, conveyorLineInfoRead.Spare2); |
| | | //if (responseContent.Status) |
| | | //{ |
| | | // device.SetValue(W_ConveyorLineDB.Spare2, 1, item.StationCode); |
| | | // _taskService.UpdateTask(task, TaskStatusEnum.Line_Execute, deviceCode: item.StationDeviceCode, roadwayNo: responseContent.Data.ToString() ?? ""); |
| | | //} |
| | | device.SetValue(W_ConveyorLineDB.Spare2, 1, item.StationCode); |
| | | _taskService.UpdateTask(task, TaskStatusEnum.Line_Execute, deviceCode: item.StationDeviceCode, roadwayNo: responseContent.Data.ToString() ?? ""); |
| | | } |
| | | _taskService.UpdateTask(task, TaskStatusEnum.Line_Execute, deviceCode: item.StationDeviceCode); |
| | | } |
| | | else |
| | | { |
| | |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType) && x.DeviceCode == item.StationDeviceCode && (x.TaskState == TaskStatusEnum.Line_Execute.ObjToInt()) && x.PalletCode == conveyorLineInfoRead.Barcode && x.WarehouseId == warehouseDevice.WarehouseId); |
| | | if (task != null) |
| | | { |
| | | List<string> stations = _routerExtension.GetEndPoint(item.StationCode, TaskTypeEnum.Inbound.ObjToInt()).Select(x => x.NextPosi).ToList(); |
| | | //åé
å··é |
| | | if (stations.Count>1) |
| | | { |
| | | WebResponseContent responseContent = _taskService.RequestWMSAssignRoadway(stations, task.TaskNum, conveyorLineInfoRead.Spare2); |
| | | if (responseContent.Status) |
| | | { |
| | | _taskService.UpdateTask(task, TaskStatusEnum.Line_Execute, roadwayNo: responseContent.Data.ToString() ?? ""); |
| | | } |
| | | } |
| | | |
| | | device.SetValue(W_ConveyorLineDB.Spare2, 0, item.StationCode); |
| | | |
| | | string currentAddress = task.CurrentAddress; |
| | |
| | | else |
| | | { |
| | | //task.NextAddresså¯è½æ¯router.NextPosi |
| | | device.SetValue(W_ConveyorLineDB.EndPos, task.NextAddress, item.StationCode); |
| | | nextAddress = router.NextPosi; |
| | | device.SetValue(W_ConveyorLineDB.EndPos, router.NextPosi, item.StationCode); |
| | | } |
| | | device.SetValue(W_ConveyorLineDB.TaskNum, task.TaskNum, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.StartPos, task.CurrentAddress, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.Spare1, ConveyorWorkTypeEnum.Outbound.ObjToInt(), item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode); |
| | | if (router.IsEnd) |
| | | { |
| | | _taskService.UpdateTask(task, taskState, currentAddress: currentAddress, nextAddress: nextAddress, targetAddress: targetAddress, deviceCode: deviceCode); |
| | | } |
| | | else |
| | | { |
| | | _taskService.UpdateTask(task, taskState, nextAddress: nextAddress); |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | |
| | | } |
| | | #endregion |
| | | } |
| | | else//ç产éåº |
| | | else//ç产éåº //æ¢å··éå
¥åº |
| | | { |
| | | #region ç产éåº,带任å¡å·æ¥è¯¢ä»»å¡ |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.TaskNum && x.NextAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType) && x.WarehouseId == warehouseDevice.WarehouseId); // 带任å¡å·æ¥è¯¢ä»»å¡ |
| | | Dt_Task taskIn = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.TaskNum && _taskService.TaskInboundTypes.Contains(x.TaskType) && x.DeviceCode == item.StationDeviceCode && x.NextAddress == item.StationCode && x.WarehouseId == warehouseDevice.WarehouseId && x.TaskState == TaskStatusEnum.Line_Executing.ObjToInt()); // 带任å¡å·æ¥è¯¢ä»»å¡ |
| | | if (task != null) |
| | | { |
| | | List<string> stations = _routerExtension.GetEndPoint(item.StationCode, TaskTypeEnum.Inbound.ObjToInt()).Select(x => x.NextPosi).ToList(); |
| | |
| | | } |
| | | |
| | | } |
| | | if (taskIn!=null) |
| | | { |
| | | string currentAddress = taskIn.CurrentAddress; |
| | | string nextAddress = taskIn.NextAddress; |
| | | string targetAddress = taskIn.TargetAddress; |
| | | string deviceCode = taskIn.DeviceCode; |
| | | TaskStatusEnum taskState = (TaskStatusEnum)taskIn.TaskState; |
| | | List<Dt_Router> routers = _routerService.QueryNextRoutes(item.StationCode, taskIn.Roadway, taskIn.TaskType); |
| | | Dt_Router? router = routers.FirstOrDefault(); |
| | | if (routers == null || routers.Count == 0 || router == null) |
| | | { |
| | | WriteError(item.StationName, $"æªæ¾å°å¯¹åºè·¯ç±ä¿¡æ¯,设å¤ç¼å·:{item.StationCode},ä»»å¡å·:{taskIn.TaskNum}"); |
| | | continue; |
| | | } |
| | | if (routers.Count > 1) |
| | | { |
| | | WriteError(item.StationName, $"è·¯ç±ä¿¡æ¯é
ç½®é误,设å¤ç¼å·:{item.StationCode},ä»»å¡å·:{taskIn.TaskNum}"); |
| | | continue; |
| | | } |
| | | |
| | | if (router.IsEnd) |
| | | { |
| | | string? targetLoca = _taskService.RequestAssignLocationByHeight(taskIn.TaskNum, taskIn.Roadway, conveyorLineInfoRead.Spare2); |
| | | if (!string.IsNullOrEmpty(targetLoca)) |
| | | { |
| | | currentAddress = item.StackerCraneStationCode; |
| | | targetAddress = targetLoca; |
| | | nextAddress = targetLoca; |
| | | taskState = TaskStatusEnum.SC_Execute; |
| | | deviceCode = item.StackerCraneCode; |
| | | device.SetValue(W_ConveyorLineDB.EndPos, taskIn.CurrentAddress, item.StationCode); |
| | | } |
| | | else |
| | | { |
| | | WriteError(item.StationName, $"请æ±åé
è´§ä½å¤±è´¥,设å¤ç¼å·:{item.StationCode},ä»»å¡å·:{task.TaskNum}"); |
| | | continue; |
| | | } |
| | | } |
| | | device.SetValue(W_ConveyorLineDB.TaskNum, taskIn.TaskNum, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.StartPos, taskIn.CurrentAddress, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.Spare1, ConveyorWorkTypeEnum.Outbound.ObjToInt(), item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode); |
| | | _taskService.UpdateTask(taskIn, taskState, currentAddress: currentAddress, nextAddress: nextAddress, targetAddress: targetAddress, deviceCode: deviceCode); |
| | | } |
| | | #endregion |
| | | } |
| | | } |
| | |
| | | device.SetValue(W_ConveyorLineDB.Spare1, ConveyorWorkTypeEnum.Outbound.ObjToInt(), item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.STB, true, item.StationCode); |
| | | } |
| | | else //è°æ¨ä½¿ç¨ |
| | | { |
| | | device.SetValue(W_ConveyorLineDB.STB, true, item.StationCode); |
| | | } |
| | | //{ |
| | | // task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType) && string.IsNullOrEmpty(x.DeviceCode) && x.TaskState == TaskStatusEnum.New.ObjToInt() && x.WarehouseId == warehouseDevice.WarehouseId); |
| | | // if (task != null) |
| | |
| | | } |
| | | else if (!conveyorLineSignalRead.STB && conveyorLineSignalWrite.ACK && !conveyorLineStatus.Alarm) |
| | | { |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.PalletCode == conveyorLineInfoRead.Barcode); |
| | | if (task!=null && task.TaskType==TaskTypeEnum.MesPalletReturn.ObjToInt()) |
| | | { |
| | | _taskService.TaskCompleted(task.TaskNum); |
| | | } |
| | | device.SetValue(W_ConveyorLineDB.ACK, false, item.StationCode); |
| | | } |
| | | } |
| | |
| | | } |
| | | else |
| | | { |
| | | _taskService.UpdateTask(task, TaskStatusEnum.Line_Execute, deviceCode: stationManger.StationDeviceCode, currentAddress: stationManger.StationCode, nextAddress: router.NextPosi, targetAddress: "1102"); |
| | | _taskService.UpdateTask(task, TaskStatusEnum.Line_Execute, deviceCode: stationManger.StationDeviceCode, currentAddress: stationManger.StationCode, nextAddress: "1102", targetAddress: "1102"); |
| | | } |
| | | |
| | | } |
| | |
| | | else |
| | | { |
| | | Dt_Task reloTask = _mapper.Map<Dt_Task>(taskDTO); |
| | | //å¤æç§»åºè´§ä½ä»»å¡æ¯å¦å·²åå¨ï¼å¦åå¨å
æ§è¡ |
| | | Dt_Task existTask = _taskService.QueryStackerExistTask(reloTask.PalletCode, reloTask.SourceAddress); |
| | | if (existTask != null) |
| | | { |
| | | return existTask; |
| | | } |
| | | else |
| | | { |
| | | reloTask.TaskState = TaskStatusEnum.SC_Execute.ObjToInt(); |
| | | reloTask.CurrentAddress = taskDTO.SourceAddress; |
| | | reloTask.NextAddress = taskDTO.TargetAddress; |
| | |
| | | reloTask.TaskType = TaskTypeEnum.Relocation.ObjToInt(); |
| | | int taskId = _taskRepository.AddData(reloTask); |
| | | reloTask.TaskId = taskId; |
| | | } |
| | | return reloTask; |
| | | |
| | | } |
| | |
| | | using Microsoft.AspNetCore.Components.Routing; |
| | | using AutoMapper; |
| | | using Microsoft.AspNetCore.Components.Routing; |
| | | using Newtonsoft.Json; |
| | | using Quartz; |
| | | using System; |
| | |
| | | using WIDESEAWCS_Core.Caches; |
| | | using WIDESEAWCS_Core.Enums; |
| | | using WIDESEAWCS_Core.Helper; |
| | | using WIDESEAWCS_DTO.TaskInfo; |
| | | using WIDESEAWCS_IBasicInfoRepository; |
| | | using WIDESEAWCS_ITaskInfoRepository; |
| | | using WIDESEAWCS_ITaskInfoService; |
| | |
| | | [DisallowConcurrentExecution] |
| | | public class StackerCraneJob_CSJ : JobBase, IJob |
| | | { |
| | | private readonly IMapper _mapper; |
| | | private readonly ICacheService _cacheService; |
| | | private readonly ITaskService _taskService; |
| | | private readonly ITaskExecuteDetailService _taskExecuteDetailService; |
| | |
| | | private readonly IStationMangerRepository _stationMangerRepository; |
| | | private List<Dt_ApiInfo> apiInfos; |
| | | |
| | | public StackerCraneJob_CSJ(ITaskService taskService, ICacheService cacheService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository) |
| | | public StackerCraneJob_CSJ(ITaskService taskService, ICacheService cacheService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository, IMapper mapper) |
| | | { |
| | | _taskService = taskService; |
| | | _taskExecuteDetailService = taskExecuteDetailService; |
| | |
| | | _routerService = routerService; |
| | | _stationMangerRepository = stationMangerRepository; |
| | | _cacheService = cacheService; |
| | | _mapper = mapper; |
| | | |
| | | string? apiInfoStr = _cacheService.Get("apiInfos"); |
| | | if (!string.IsNullOrEmpty(apiInfoStr)) |
| | |
| | | _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"æªæ¾å°WMSç§»åºå¤ææ¥å£"); |
| | | return null; |
| | | } |
| | | HttpHelper.Post($"{url}?taskNum={task.TaskNum}&locationCode={task.NextAddress}", "");//todo è°ç¨WMSä»»å¡å®ææ¹æ³ |
| | | string response = HttpHelper.Post($"{url}?taskNum={task.TaskNum}&locationCode={task.CurrentAddress}", "");//todo è°ç¨WMSä»»å¡å®ææ¹æ³ |
| | | if (string.IsNullOrEmpty(response)) |
| | | { |
| | | _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskNum, $"ç§»åºæ¥å£è°ç¨é误"); |
| | | WriteError(commonStackerCrane.DeviceCode, $"ç§»åºæ¥å£è°ç¨é误"); |
| | | _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"ç§»åºæ¥å£è°ç¨é误"); |
| | | return null; |
| | | } |
| | | WebResponseContent? responseContent = JsonConvert.DeserializeObject<WebResponseContent>(response); |
| | | if (responseContent == null || !responseContent.Status) |
| | | { |
| | | _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskNum, $"ç§»åºæ¥å£è°ç¨é误"); |
| | | WriteError(commonStackerCrane.DeviceCode, $"ç§»åºæ¥å£è°ç¨é误"); |
| | | _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"ç§»åºæ¥å£è°ç¨é误"); |
| | | return null; |
| | | } |
| | | WMSTaskDTO? taskDTO = JsonConvert.DeserializeObject<WMSTaskDTO>(responseContent.Data.Serialize()); |
| | | if (taskDTO == null) |
| | | { |
| | | _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskNum, $"ç§»åºæ¥å£è°ç¨é误"); |
| | | WriteError(commonStackerCrane.DeviceCode, $"ç§»åºæ¥å£è°ç¨é误"); |
| | | _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"ç§»åºæ¥å£è°ç¨é误"); |
| | | return null; |
| | | |
| | | } |
| | | if (task.TaskNum == taskDTO.TaskNum) |
| | | { |
| | | return task; |
| | | } |
| | | else |
| | | { |
| | | Dt_Task reloTask = _mapper.Map<Dt_Task>(taskDTO); |
| | | //å¤æç§»åºè´§ä½ä»»å¡æ¯å¦å·²åå¨ï¼å¦åå¨å
æ§è¡ |
| | | Dt_Task existTask = _taskService.QueryStackerExistTask(reloTask.PalletCode, reloTask.SourceAddress); |
| | | if (existTask != null) |
| | | { |
| | | return existTask; |
| | | } |
| | | else |
| | | { |
| | | reloTask.TaskState = TaskStatusEnum.SC_Execute.ObjToInt(); |
| | | reloTask.CurrentAddress = taskDTO.SourceAddress; |
| | | reloTask.NextAddress = taskDTO.TargetAddress; |
| | | reloTask.DeviceCode = task.DeviceCode; |
| | | reloTask.TaskType = TaskTypeEnum.Relocation.ObjToInt(); |
| | | int taskId = _taskRepository.AddData(reloTask); |
| | | reloTask.TaskId = taskId; |
| | | } |
| | | return reloTask; |
| | | |
| | | } |
| | | } |
| | | |
| | | return task; |
| | |
| | | /// <returns>妿æªè¢«å ç¨ï¼è¿åä¼ å
¥çä»»å¡ä¿¡æ¯ï¼å¦åï¼è¿ånull</returns> |
| | | private Dt_Task? OutTaskStationIsOccupied([NotNull] Dt_Task task) |
| | | { |
| | | Dt_StationManger? stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == task.NextAddress && x.StackerCraneCode == task.DeviceCode); |
| | | Dt_StationManger? stationManger = _stationMangerRepository.QueryFirst(x => (x.StationCode == task.NextAddress || x.StackerCraneStationCode == task.NextAddress) && x.StackerCraneCode == task.DeviceCode); |
| | | if (stationManger != null) |
| | | { |
| | | IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode); |
| | |
| | | ]); |
| | | const searchFormFields = ref({ |
| | | orderNo: "", |
| | | taskNo:"", |
| | | materialCode: "", |
| | | batchNo: "", |
| | | }); |
| | | const searchFormOptions = ref([ |
| | | [ |
| | | { title: "åæ®ç¼å·", field: "orderNo", type:"like" }, |
| | | { title: "MESä»»å¡åå·", field: "taskNo", type:"like" }, |
| | | { title: "ç©æç¼å·", field: "materialCode" ,type:"like"}, |
| | | { title: "æ¹æ¬¡å·", field: "batchNo" ,type:"like"}, |
| | | ], |
| | |
| | | }, |
| | | { |
| | | field: "taskNo", |
| | | title: "ä»»å¡åå·", |
| | | title: "MESä»»å¡åå·", |
| | | type: "string", |
| | | width: 150, |
| | | align: "left", |
| | |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | hidden: true |
| | | }, |
| | | { |
| | | field: "createDate", |
| | | title: "å建æ¶é´", |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "width", |
| | |
| | | List<Dt_PalletCodeInfo> palletCodeInfos = new List<Dt_PalletCodeInfo>(); |
| | | int serialNo = 0; |
| | | DateTime now = DateTime.Now; |
| | | Dt_PalletCodeInfo palletCodeInfo = BaseDal.QueryFirst(x => x.WarehouseId == warehouseId, new Dictionary<string, OrderByType> { { nameof(Dt_PalletCodeInfo.SerialNo), OrderByType.Desc } }); |
| | | Dt_PalletCodeInfo palletCodeInfo = BaseDal.QueryFirst(x => x.WarehouseId == warehouseId && x.PalletTypeId==palletTypeId, new Dictionary<string, OrderByType> { { nameof(Dt_PalletCodeInfo.SerialNo), OrderByType.Desc } }); |
| | | if (palletCodeInfo != null && palletCodeInfo.CreateDate.Year == now.Year && palletCodeInfo.CreateDate.Month == now.Month && palletCodeInfo.CreateDate.Day == now.Day) |
| | | { |
| | | serialNo = palletCodeInfo.SerialNo + 1; |
| | |
| | | SerialNo = serialNo, |
| | | PalletCode = palletTypeInfo.CodeStartStr + now.ToString("yyyyMMdd") + serialNo.ToString().PadLeft(3, '0'), |
| | | PalletType = 1, |
| | | PalletTypeId = 0, |
| | | PalletTypeId = palletTypeId, |
| | | WarehouseId = warehouseId, |
| | | Status = 0, |
| | | Size = 0 |
| | |
| | | { |
| | | Dt_LocationInfo definedTypeEmptyLocation = definedTypeEmptyLocations[i]; |
| | | Dt_LocationInfo? locationInfo = GetUsableLocation_BC(locationInfos, definedTypeEmptyLocation, palletType, palletTypeInfo); |
| | | //å¤æè´§ä½ä¸¤æ·±å以䏿¯å¦åå¨åºåºéå®è´§ä½ |
| | | if (locationInfo?.Depth == 1) |
| | | { |
| | | Dt_LocationInfo? IsBebusyLocation = locationInfos.Where(x => x.Row == (locationInfo?.Row == 2 ? locationInfo?.Row - 1 : locationInfo?.Row + 1) && x.Column==locationInfo?.Column && x.Layer== locationInfo?.Layer).FirstOrDefault(); |
| | | if (IsBebusyLocation!=null && (IsBebusyLocation.LocationStatus<LocationStatusEnum.InStock.ObjToInt())) |
| | | { |
| | | continue; |
| | | } |
| | | } |
| | | if (locationInfo != null) |
| | | { |
| | | locationCaches_BC.Add(new LocationCache { LocationCode = locationInfo.LocationCode, DateTime = DateTime.Now }); |
| | |
| | | undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Column % 2 == 1).ToList(); |
| | | else |
| | | undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Column % 2 == 0).ToList(); |
| | | } |
| | | |
| | | for (int i = 0; i < undefinedTypeEmptyLocations.Count; i++) |
| | | { |
| | | Dt_LocationInfo undefinedTypeEmptyLocation = undefinedTypeEmptyLocations[i]; |
| | | Dt_LocationInfo? locationInfo = GetUsableLocation_BC(locationInfos, undefinedTypeEmptyLocation, palletType, palletTypeInfo); |
| | | //å¤æè´§ä½ä¸¤æ·±å以䏿¯å¦åå¨åºåºéå®è´§ä½ |
| | | if (locationInfo?.Depth == 1) |
| | | { |
| | | Dt_LocationInfo? IsBebusyLocation = locationInfos.Where(x => x.Row == (locationInfo?.Row == 2 ? locationInfo?.Row - 1 : locationInfo?.Row + 1) && x.Column == locationInfo?.Column && x.Layer == locationInfo?.Layer).FirstOrDefault(); |
| | | if (IsBebusyLocation != null && (IsBebusyLocation.LocationStatus < LocationStatusEnum.InStock.ObjToInt())) |
| | | { |
| | | continue; |
| | | } |
| | | } |
| | | if (locationInfo != null) |
| | | { |
| | | //UpdateLocationStatus(locationInfo, palletType, LocationStatusEnum.Lock, locationInfo.WarehouseId); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | |
| | | nearLocation = locationInfos.FirstOrDefault(x => x.Row == location.Row && x.Layer == location.Layer && x.Depth == location.Depth && x.Column == location.Column - 1); |
| | | } |
| | | |
| | | if (location.RoadwayNo == "SC01_BC") |
| | | if (nearLocation!=null && location.RoadwayNo.Contains("BC")) |
| | | { |
| | | if (nearLocation?.LocationType == LocationTypeEnum.SmallPallet.ObjToInt()) |
| | | { |
| | | nearLocation = null; |
| | | } |
| | | } |
| | | if (location.RoadwayNo == "SC01_BC" && palletType != PalletTypeEnum.SmallPallet.ObjToInt()) |
| | | { |
| | | nearLocation = locationInfos.FirstOrDefault(x => x.Row == location.Row && x.Layer == location.Layer && x.Depth == location.Depth && x.Column == location.Column - 1); |
| | | if (nearLocation?.LocationType == LocationTypeEnum.SmallPallet.ObjToInt()) |
| | | { |
| | | nearLocation = null; |
| | | } |
| | | } |
| | | |
| | | if (nearLocation != null) |
| | |
| | | InStockLock = 10, |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// æè´§éå® |
| | | /// </summary> |
| | | [Description("空é²éå®")] |
| | | FreeLock = 20, |
| | |
| | | [Description("éåº")] |
| | | MESéåº = 21, |
| | | |
| | | [Description("MES空æéåº")] |
| | | MES空æéåº = 22, |
| | | |
| | | [Description("ç»çæ¤é")] |
| | | ç»çæ¤é = 99, |
| | | |
| | |
| | | InAllocate = 570, |
| | | |
| | | /// <summary> |
| | | /// MES空æéæ |
| | | /// </summary> |
| | | [Description("MES空æéæ")] |
| | | MesPalletReturn = 580, |
| | | |
| | | /// <summary> |
| | | /// 空箱å
¥åº |
| | | /// </summary> |
| | | [Description("空箱å
¥åº")] |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.Attributes; |
| | | |
| | | namespace WIDESEA_DTO.ERP |
| | | { |
| | | /// <summary> |
| | | /// æå订ååºåº |
| | | /// </summary> |
| | | public class ErpProOutOrderDTO |
| | | { |
| | | /// <summary> |
| | | /// æä½ç±»å<br/> |
| | | /// 1ï¼æ°å¢<br/> |
| | | /// 2ï¼ä¿®æ¹<br/> |
| | | /// 3ï¼å é¤(å é¤åªè¦æç»è¡å·å颿åå·) |
| | | /// </summary> |
| | | [PropertyValidate("æä½ç±»å", NotNullAndEmpty = true, Check = new object[] { 1, 2, 3 })] |
| | | public int Way { get; set; } |
| | | /// <summary> |
| | | /// åºåºè®¢åå· |
| | | /// </summary> |
| | | [PropertyValidate("åºåºè®¢åå·", NotNullAndEmpty = true)] |
| | | public string OrderNo { get; set; } |
| | | /// <summary> |
| | | /// 订åç±»å<br/> |
| | | /// 1ï¼åºåºå<br/> |
| | | /// 2ï¼å¯å®è®¢å转ä»<br/> |
| | | /// </summary> |
| | | [PropertyValidate("订åç±»å", NotNullAndEmpty = true, Check = new object[] { 1, 2})] |
| | | public int OType { get; set; } |
| | | /// <summary> |
| | | /// 计ååºè´§æ¶é´ |
| | | /// </summary> |
| | | public string PlantShipDate { get; set; } |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | public string Note { get; set; } |
| | | /// <summary> |
| | | /// 详æ
|
| | | /// </summary> |
| | | public List<ErpProOutOrderDetailds> OrderDetails { get; set; } |
| | | } |
| | | /// <summary> |
| | | /// è¯¦ç» |
| | | /// </summary> |
| | | public class ErpProOutOrderDetailds |
| | | { |
| | | /// <summary> |
| | | /// è¡å· |
| | | /// </summary> |
| | | public int RowId { get; set; } |
| | | /// <summary> |
| | | /// éå®è®¢åå· |
| | | /// </summary> |
| | | public string SaleOrder { get; set; } |
| | | /// <summary> |
| | | /// å®¢æ· |
| | | /// </summary> |
| | | public string Customer { get; set; } |
| | | /// <summary> |
| | | /// å·¥å |
| | | /// </summary> |
| | | public string FactoryCode { get; set; } = "HA02"; |
| | | /// <summary> |
| | | /// 产åç¼ç |
| | | /// </summary> |
| | | public string PCode { get; set; } |
| | | /// <summary> |
| | | /// 产åçæ¬ |
| | | /// </summary> |
| | | public string PVer { get; set; } |
| | | /// <summary> |
| | | /// äº§åæ¹æ¬¡ |
| | | /// </summary> |
| | | public string PLot { get; set; } |
| | | /// <summary> |
| | | /// 产å卿 |
| | | /// </summary> |
| | | public int DateCode { get; set; } |
| | | /// <summary> |
| | | /// åæ ¼PCSæ° |
| | | /// </summary> |
| | | public float QtyPcs { get; set; } |
| | | /// <summary> |
| | | /// Xæ¿æ° |
| | | /// </summary> |
| | | public float XQty { get; set; } |
| | | /// <summary> |
| | | /// Xæ¿ä½ |
| | | /// </summary> |
| | | public string XSite { get; set; } |
| | | /// <summary> |
| | | /// åä½ |
| | | /// </summary> |
| | | public string Unit { get; set; } |
| | | /// <summary> |
| | | /// å¤åæ° |
| | | /// </summary> |
| | | public float SpareQty { get; set; } |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.Attributes; |
| | | |
| | | namespace WIDESEA_DTO.ERP |
| | | { |
| | | /// <summary> |
| | | /// æå仿£æ¥åºå |
| | | /// </summary> |
| | | [ModelValidate] |
| | | public class ErpProductScrappedOrderDTO |
| | | { |
| | | /// <summary> |
| | | /// 订åå· |
| | | /// </summary> |
| | | [PropertyValidate("订åå·", NotNullAndEmpty = true)] |
| | | public string OrderNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 产åç¼ç |
| | | /// </summary> |
| | | [PropertyValidate("产åç¼ç ", NotNullAndEmpty = true)] |
| | | public string PCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 产åçæ¬ |
| | | /// </summary> |
| | | [PropertyValidate("产åçæ¬", NotNullAndEmpty = true)] |
| | | public string PVer { get; set; } |
| | | |
| | | /// <summary> |
| | | /// äº§åæ¹æ¬¡ |
| | | /// </summary> |
| | | [PropertyValidate("äº§åæ¹æ¬¡", NotNullAndEmpty = true)] |
| | | public string PLot { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 产å卿 |
| | | /// </summary> |
| | | [PropertyValidate("产å卿")] |
| | | public int DateCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»åºç±»å |
| | | /// HA72=å°¾æ°ä»ãHA71=æåä»ãHA73=ç åä» |
| | | /// </summary> |
| | | [PropertyValidate("ä»åºç±»å", NotNullAndEmpty = true)] |
| | | public string WaType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæ ¼PCSæ° |
| | | /// </summary> |
| | | [PropertyValidate("åæ ¼PCSæ°", NotNullAndEmpty = true)] |
| | | public float QtyPcs { get; set; } |
| | | |
| | | /// <summary> |
| | | /// Xæ¿æ° |
| | | /// </summary> |
| | | [PropertyValidate("Xæ¿æ°")] |
| | | public float XQty { get; set; } |
| | | |
| | | /// <summary> |
| | | /// Xæ¿ä½ |
| | | /// </summary> |
| | | [PropertyValidate("Xæ¿ä½")] |
| | | public string XSite { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½ |
| | | /// </summary> |
| | | [PropertyValidate("åä½", NotNullAndEmpty = true)] |
| | | public string Unit { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å»ºåæ¥æ |
| | | /// yyyy-MM-dd |
| | | /// </summary> |
| | | [PropertyValidate("å»ºåæ¥æ", NotNullAndEmpty = true)] |
| | | public string OrderDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | [PropertyValidate("夿³¨")] |
| | | public string Note { get; set; } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.Attributes; |
| | | |
| | | namespace WIDESEA_DTO.ERP |
| | | { |
| | | /// <summary> |
| | | /// æåéå®ææ´¾è¡¨ |
| | | /// </summary> |
| | | [ModelValidate] |
| | | public class ErpProductSpecifyVerDTO |
| | | { |
| | | /// <summary> |
| | | /// 订åå· |
| | | /// </summary> |
| | | [PropertyValidate("订åå·", NotNullAndEmpty = true)] |
| | | public string OrderNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æç»è¡å· |
| | | /// </summary> |
| | | [PropertyValidate("æç»è¡å·", NotNullAndEmpty = true)] |
| | | public int RowId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 产åç¼ç |
| | | /// </summary> |
| | | [PropertyValidate("产åç¼ç ", NotNullAndEmpty = true)] |
| | | public string PCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 产åçæ¬ |
| | | /// </summary> |
| | | [PropertyValidate("产åçæ¬", NotNullAndEmpty = true)] |
| | | public string PVer { get; set; } |
| | | |
| | | /// <summary> |
| | | /// äº§åæ¹æ¬¡ |
| | | /// </summary> |
| | | [PropertyValidate("äº§åæ¹æ¬¡", NotNullAndEmpty = true)] |
| | | public string PLot { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 产å卿 |
| | | /// </summary> |
| | | [PropertyValidate("产å卿")] |
| | | public int DateCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»åºç±»å |
| | | /// HA72=å°¾æ°ä»ãHA71=æåä»ãHA73=ç åä» |
| | | /// </summary> |
| | | [PropertyValidate("ä»åºç±»å", NotNullAndEmpty = true)] |
| | | public string WaType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæ ¼PCSæ° |
| | | /// </summary> |
| | | [PropertyValidate("åæ ¼PCSæ°", NotNullAndEmpty = true)] |
| | | public float QtyPcs { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ææ´¾çæ¬å· |
| | | /// </summary> |
| | | [PropertyValidate("ææ´¾çæ¬å·",NotNullAndEmpty =true)] |
| | | public string Ver { get; set; } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.Attributes; |
| | | |
| | | namespace WIDESEA_DTO.ERP |
| | | { |
| | | /// <summary> |
| | | /// ç åæåè°å
¥æåä»è¡¨ |
| | | /// </summary> |
| | | [ModelValidate] |
| | | |
| | | public class ErpProductTransferOrder |
| | | { |
| | | /// <summary> |
| | | /// è°æ¨åå· |
| | | /// </summary> |
| | | [PropertyValidate("è°æ¨åå·",NotNullAndEmpty =true)] |
| | | public string TransferNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 产åç¼ç |
| | | /// </summary> |
| | | [PropertyValidate("产åç¼ç ", NotNullAndEmpty = true)] |
| | | public string PCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 产åçæ¬ |
| | | /// </summary> |
| | | [PropertyValidate("产åçæ¬", NotNullAndEmpty = true)] |
| | | public string PVer { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 产å卿 |
| | | /// </summary> |
| | | [PropertyValidate("产å卿")] |
| | | public int DateCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæ ¼PCSæ° |
| | | /// </summary> |
| | | [PropertyValidate("åæ ¼PCSæ°", NotNullAndEmpty = true)] |
| | | public float QtyPcs { get; set; } |
| | | |
| | | /// <summary> |
| | | /// Xæ¿æ° |
| | | /// </summary> |
| | | [PropertyValidate("Xæ¿æ°")] |
| | | public float XQty { get; set; } |
| | | |
| | | /// <summary> |
| | | /// Xæ¿ä½ |
| | | /// </summary> |
| | | [PropertyValidate("Xæ¿ä½")] |
| | | public int XSite { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½ |
| | | /// </summary> |
| | | [PropertyValidate("åä½",NotNullAndEmpty =true)] |
| | | public string Unit { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å»ºåæ¥æ |
| | | /// yyyy-MM-dd |
| | | /// </summary> |
| | | [PropertyValidate("å»ºåæ¥æ",NotNullAndEmpty =true)] |
| | | public string OrderDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | [PropertyValidate("夿³¨")] |
| | | public string Note { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éå®è®¢åå· |
| | | /// </summary> |
| | | [PropertyValidate("éå®è®¢åå·",NotNullAndEmpty =true)] |
| | | public string SaleOrder { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å®¢æ· |
| | | /// </summary> |
| | | [PropertyValidate("客æ·", NotNullAndEmpty =true)] |
| | | public string Customer { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å·¥å |
| | | /// </summary> |
| | | [PropertyValidate("å·¥å", NotNullAndEmpty =true)] |
| | | public string FactoryCode { get; set; } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.Attributes; |
| | | |
| | | namespace WIDESEA_DTO.ERP |
| | | { |
| | | /// <summary> |
| | | /// æåè°å
¥å¾
åè´§ä»è¡¨ |
| | | /// </summary> |
| | | [ModelValidate] |
| | | public class ErpProductWarehousingOrderDTO |
| | | { |
| | | /// <summary> |
| | | /// è°æ¨åå· |
| | | /// </summary> |
| | | [PropertyValidate("è°æ¨åå·", NotNullAndEmpty = true)] |
| | | public string TransferNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 产åç¼ç |
| | | /// </summary> |
| | | [PropertyValidate("产åç¼ç ", NotNullAndEmpty = true)] |
| | | public string PCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 产åçæ¬ |
| | | /// </summary> |
| | | [PropertyValidate("产åçæ¬", NotNullAndEmpty = true)] |
| | | public string PVer { get; set; } |
| | | |
| | | /// <summary> |
| | | /// äº§åæ¹æ¬¡ |
| | | /// </summary> |
| | | [PropertyValidate("äº§åæ¹æ¬¡", NotNullAndEmpty = true)] |
| | | public string PLot { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 产å卿 |
| | | /// </summary> |
| | | [PropertyValidate("产å卿")] |
| | | public int DateCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæ ¼PCSæ° |
| | | /// </summary> |
| | | [PropertyValidate("åæ ¼PCSæ°", NotNullAndEmpty = true)] |
| | | public float QtyPcs { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å
è£
Setæ° |
| | | /// </summary> |
| | | [PropertyValidate("å
è£
Setæ°", NotNullAndEmpty = true)] |
| | | public float QtySet { get; set; } |
| | | |
| | | /// <summary> |
| | | /// Xæ¿æ° |
| | | /// </summary> |
| | | [PropertyValidate("Xæ¿æ°")] |
| | | public float XQty { get; set; } |
| | | |
| | | /// <summary> |
| | | /// Xæ¿ä½ |
| | | /// </summary> |
| | | [PropertyValidate("Xæ¿ä½")] |
| | | public string XSite { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½ |
| | | /// </summary> |
| | | [PropertyValidate("åä½",NotNullAndEmpty =true)] |
| | | public string Unit { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å»ºåæ¥æ |
| | | /// yyyy-MM-dd |
| | | /// </summary> |
| | | [PropertyValidate("å»ºåæ¥æ",NotNullAndEmpty =true)] |
| | | public string OrderDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | [PropertyValidate("夿³¨")] |
| | | public string Note { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éå®è®¢åå· |
| | | /// </summary> |
| | | [PropertyValidate("éå®è®¢åå·", NotNullAndEmpty = true)] |
| | | public string SaleOrder { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å®¢æ· |
| | | /// </summary> |
| | | [PropertyValidate("客æ·", NotNullAndEmpty = true)] |
| | | public string Customer { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å·¥å |
| | | /// </summary> |
| | | [PropertyValidate("å·¥å", NotNullAndEmpty = true)] |
| | | public string FactoryCode { get; set; } |
| | | } |
| | | } |
| | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public DateTime DataTime { get; set; } |
| | | public string DataTime { get; set; } |
| | | |
| | | public static MesResponseContent Instance |
| | | { |
| | | get { return new MesResponseContent(); } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è¿å |
| | | /// </summary> |
| | | public MesResponseContent OK(string message = null) |
| | | { |
| | | BSucc = true; |
| | | StrCode = "0000"; |
| | | StrMsg = message == null ? "æ§è¡æå" : message; |
| | | DataTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); |
| | | return this; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è¿å |
| | | /// </summary> |
| | | public MesResponseContent Error(string message = null) |
| | | { |
| | | BSucc = false; |
| | | StrCode = "404"; |
| | | StrMsg = message == null ? "æ§è¡å¤±è´¥" : message; |
| | | DataTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); |
| | | return this; |
| | | } |
| | | public ContentMes Content { get; set; } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_External.Model |
| | | { |
| | | /// <summary> |
| | | /// ç»´ä¿®åæåºåºå |
| | | /// </summary> |
| | | public class ERPMaintainIssueModel |
| | | { |
| | | /// <summary> |
| | | /// æä½ç±»å |
| | | /// </summary> |
| | | public int Way { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 主å¥å¼ |
| | | /// </summary> |
| | | public int UniqueTag { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæåå· |
| | | /// </summary> |
| | | public string Code { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åææ¶é´ |
| | | /// </summary> |
| | | public string Createtime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæäººå |
| | | /// </summary> |
| | | public string Createuser { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»åºç¼ç |
| | | /// </summary> |
| | | public string WarehouseCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | public string Remark { get; set; } |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public List<ERPItemlist> Itemlist { get; set; } |
| | | } |
| | | public class ERPItemlist |
| | | { |
| | | /// <summary> |
| | | /// åææç»è¡å· |
| | | /// </summary> |
| | | public int RowNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æç¼ç |
| | | /// </summary> |
| | | public string Material { get; set; } |
| | | /// <summary> |
| | | /// ç»´ä¿®åå· |
| | | /// </summary> |
| | | public string Pickno { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åææ°é |
| | | /// </summary> |
| | | public string Issueqty { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public List<ERPBatchlist> Batchlist { get; set; } |
| | | } |
| | | public class ERPBatchlist { |
| | | /// <summary> |
| | | /// æ¹æ¬¡å· |
| | | /// </summary> |
| | | public string Lotno { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ°é |
| | | /// </summary> |
| | | public string Qty { get; set; } |
| | | |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_External.Model |
| | | { |
| | | /// <summary> |
| | | /// ç©æéå®éè´§å
¥åº |
| | | /// </summary> |
| | | public class ERPMaterialSaleReturnModel |
| | | { |
| | | /// <summary> |
| | | /// ç±»å |
| | | /// </summary> |
| | | public string Way { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åå· |
| | | /// </summary> |
| | | public string Code { get; set; } |
| | | |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_External.Model |
| | | { |
| | | /// <summary> |
| | | /// æåå
¥åºå®æä¸æ¥ERP |
| | | /// </summary> |
| | | public class ERPProInboundModel |
| | | { |
| | | /// <summary> |
| | | /// æä½ç±»å |
| | | /// </summary> |
| | | public int Way { get; set; } |
| | | /// <summary> |
| | | /// å
¥åºåå· |
| | | /// </summary> |
| | | public string Code { get; set; } |
| | | /// <summary> |
| | | /// å建人代ç |
| | | /// </summary> |
| | | public string CreatorCode { get; set; } |
| | | /// <summary> |
| | | /// å
¬å¸ä»£ç |
| | | /// </summary> |
| | | public string CompanyCode { get; set; } = "HATC"; |
| | | /// <summary> |
| | | /// å·¥åä»£å· |
| | | /// </summary> |
| | | public string FactoryCode { get; set; } = "HA02"; |
| | | /// <summary> |
| | | /// ä»åºä»£ç |
| | | /// </summary> |
| | | public string WarehouseCode { get; set; } |
| | | /// <summary> |
| | | /// å¨ä½ä»£ç |
| | | /// </summary> |
| | | public string LocationCode { get; set; } |
| | | /// <summary> |
| | | /// å
¥åºæ¥æ |
| | | /// </summary> |
| | | public string StockDate { get; set; } |
| | | /// <summary> |
| | | /// å
¥åºæ¥æ |
| | | /// </summary> |
| | | public string Remark { get; set; } |
| | | /// <summary> |
| | | /// å
¥åºç±»å |
| | | /// </summary> |
| | | public string StockFormType { get; set; } = "Production"; |
| | | /// <summary> |
| | | /// å
¥åºæç» |
| | | /// </summary> |
| | | public List<ERPProItemsItem> StockFormItems { get; set; } |
| | | } |
| | | /// <summary> |
| | | /// å
¥åºä¸æ¥æç» |
| | | /// </summary> |
| | | public class ERPProItemsItem |
| | | { |
| | | /// <summary> |
| | | /// 产åç¼ç |
| | | /// </summary> |
| | | public string PartNum { get; set; } |
| | | /// <summary> |
| | | /// 产åçæ¬ |
| | | /// </summary> |
| | | public string Rev { get; set; } |
| | | /// <summary> |
| | | /// 卿ç |
| | | /// </summary> |
| | | public string DateCode { get; set; } |
| | | /// <summary> |
| | | /// æ¹æ¬¡(å
¥åºåå·+æåç¼ç +大å°çæ¬)mesçæ |
| | | /// </summary> |
| | | public string BatchNumber { get; set; } |
| | | /// <summary> |
| | | /// åæ¿ä½ç½® |
| | | /// </summary> |
| | | public string XLocation { get; set; } |
| | | /// <summary> |
| | | /// åæ¿æ° |
| | | /// </summary> |
| | | public float Xqty { get; set; } |
| | | /// <summary> |
| | | /// Pnlæ°é |
| | | /// </summary> |
| | | public float QtyPnl { get; set; } |
| | | /// <summary> |
| | | /// Setæ°é |
| | | /// </summary> |
| | | public float QtySet { get; set; } |
| | | /// <summary> |
| | | /// Pcsæ°é |
| | | /// </summary> |
| | | public float QtyPcs { get; set; } |
| | | /// <summary> |
| | | /// å·¥åæç» |
| | | /// </summary> |
| | | public List<ERPProListItem> WoList { get; set; } |
| | | } |
| | | /// <summary> |
| | | /// å
¥åºå·¥åæç» |
| | | /// </summary> |
| | | public class ERPProListItem |
| | | { |
| | | /// <summary> |
| | | /// å¶é 订å |
| | | /// </summary> |
| | | public string moNumber { get; set; } |
| | | /// <summary> |
| | | /// å·¥å |
| | | /// </summary> |
| | | public string WoNumber { get; set; } |
| | | /// <summary> |
| | | /// Pcsæ°é |
| | | /// </summary> |
| | | public float QtyPcs { get; set; } |
| | | /// <summary> |
| | | /// Setæ°é |
| | | /// </summary> |
| | | public float QtySet { get; set; } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_External.Model |
| | | { |
| | | /// <summary> |
| | | /// æååºåºåä¼ ERP |
| | | /// </summary> |
| | | public class ERPProOutOrderModel |
| | | { |
| | | /// <summary> |
| | | /// æä½ç±»å |
| | | /// </summary> |
| | | public int Way { get; set; } |
| | | /// <summary> |
| | | /// åæåå· |
| | | /// </summary> |
| | | public string StockOutCode { get; set; } |
| | | /// <summary> |
| | | ///åºåææ´¾å代ç |
| | | /// </summary> |
| | | public string ConfirmedUserNo { get; set; } |
| | | /// <summary> |
| | | /// åºåºäººä»£ç |
| | | /// </summary> |
| | | public string AssignUserNo { get; set; } |
| | | /// <summary> |
| | | /// éè´§æ¥æ |
| | | /// </summary> |
| | | public string ShipDate { get; set; } |
| | | /// <summary> |
| | | /// ä»åºä»£ç |
| | | /// </summary> |
| | | public string WarehouseCode { get; set; } |
| | | /// <summary> |
| | | /// 计ååºè´§åå· |
| | | /// </summary> |
| | | public string DeliverplanCode { get; set; } |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | public string Remark { get; set; } |
| | | /// <summary> |
| | | /// æç»è¯¦æ
|
| | | /// </summary> |
| | | public List<StockOutItemsItem> StockOutItems { get; set; } |
| | | } |
| | | /// <summary> |
| | | /// åºåºæç» |
| | | /// </summary> |
| | | public class StockOutItemsItem |
| | | { |
| | | /// <summary> |
| | | /// 产åç¼ç |
| | | /// </summary> |
| | | public string PartNum { get; set; } |
| | | /// <summary> |
| | | /// çæ¬ |
| | | /// </summary> |
| | | public string Rev { get; set; } |
| | | /// <summary> |
| | | /// éå®è®¢åå· |
| | | /// </summary> |
| | | public string SoNumber { get; set; } |
| | | /// <summary> |
| | | /// æ¹æ¬¡å· |
| | | /// </summary> |
| | | public string BatchNumber { get; set; } |
| | | /// <summary> |
| | | /// å¤åæ°é |
| | | /// </summary> |
| | | public float QtyFree { get; set; } |
| | | /// <summary> |
| | | /// PCSæ°é |
| | | /// </summary> |
| | | public float QtyPcs { get; set; } |
| | | /// <summary> |
| | | /// å
è£
SETæ°é |
| | | /// </summary> |
| | | public float QtySet { get; set; } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_External.Model |
| | | { |
| | | /// <summary> |
| | | /// æå鿣 |
| | | /// </summary> |
| | | public class ERPProductCheckModel |
| | | { |
| | | /// <summary> |
| | | /// æä½ç±»å |
| | | /// 1 æ°å¢ |
| | | /// </summary> |
| | | public int Way { get; set; } |
| | | |
| | | /// <summary> |
| | | /// WMES主å¥å¼ |
| | | /// </summary> |
| | | public string UniqueTag { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ£éªåå· |
| | | /// </summary> |
| | | public string Code { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å·¥åä»£å· |
| | | /// </summary> |
| | | public string PlantsCode { get; set; } = "HA02"; |
| | | |
| | | /// <summary> |
| | | /// 鿣åå· |
| | | /// </summary> |
| | | public string RecheckCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç产åå· |
| | | /// </summary> |
| | | public string PartNum { get; set; } |
| | | |
| | | /// <summary> |
| | | /// çæ¬å· |
| | | /// </summary> |
| | | public string PartRev { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»åºä»£å· |
| | | /// "HA72å°¾æ°ä»ã HA71æåä»ãHA73ç åä»" |
| | | /// </summary> |
| | | public string WarehouseCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¨ä½ä»£å· |
| | | ///"HA72å°¾æ°ä»ã HA71æåä»ãHA73ç åä»" |
| | | /// </summary> |
| | | public string Location { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¹æ¬¡å· |
| | | /// </summary> |
| | | public string LotNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | public string Node { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæ ¼PCSæ°é |
| | | /// </summary> |
| | | public int QtyPcs { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæ ¼Setæ°é |
| | | /// </summary> |
| | | public int QtyArray { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæ ¼PNLæ°é |
| | | /// </summary> |
| | | public int QtyPanel { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 鿣PCSæ°é |
| | | /// </summary> |
| | | public int QtyPcsRecieved { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 鿣Setæ°é |
| | | /// </summary> |
| | | public int QtyArrayRecieved { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 鿣PNLæ°é |
| | | /// </summary> |
| | | public int QtyPanelRecieved { get; set; } |
| | | |
| | | /// <summary> |
| | | ///æ¥åºPcsæ°é |
| | | /// </summary> |
| | | public int QtyPcsScrapped { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¥åºSetæ°é |
| | | /// </summary> |
| | | public int QtyArrayScrapped { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¥åºPNLæ°é |
| | | /// </summary> |
| | | public int QtyPanelScrapped { get; set; } |
| | | |
| | | /// <summary> |
| | | ///æ½æ£Pcsæ°é |
| | | ///妿 é»è®¤ä¸º0 |
| | | /// </summary> |
| | | public int QtySample { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ¥æ¶æ¥æ |
| | | /// æ ¼å¼ï¼yyyy-MM-dd |
| | | /// </summary> |
| | | public string ReceiveDate { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// åå»ºäººä»£å· |
| | | /// </summary> |
| | | public string CreatorCode { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ£éªæ¥æ |
| | | /// æ ¼å¼ï¼yyyy-MM-dd |
| | | /// </summary> |
| | | public string TestDate { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public List<ERPIqcItem> IqcItem { get; set; } |
| | | |
| | | } |
| | | public class ERPIqcItem |
| | | { |
| | | /// <summary> |
| | | /// 缺é·ä»£ç |
| | | /// </summary> |
| | | public string DefectCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç»æ |
| | | /// </summary> |
| | | public string Result{ get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ£éªæ¥æ |
| | | /// </summary> |
| | | public string TestDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// PCSæ°é |
| | | /// </summary> |
| | | public string QtyPcs { get; set; } |
| | | |
| | | /// <summary> |
| | | /// Setæ°é |
| | | /// </summary> |
| | | public string QtyArray { get; set; } |
| | | |
| | | /// <summary> |
| | | /// PNLæ°é |
| | | /// </summary> |
| | | public string QtyPanel { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | public string Node { get; set; } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_External.Model |
| | | { |
| | | /// <summary> |
| | | /// æåæ¥åº |
| | | /// </summary> |
| | | public class ERPScrapSheetModel |
| | | { |
| | | /// <summary> |
| | | /// æä½ç±»å |
| | | /// 1 æ°å¢ |
| | | /// </summary> |
| | | public int Way { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 主å¥å¼ |
| | | /// </summary> |
| | | public string UniqueTag { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¥åºåå· |
| | | /// </summary> |
| | | public string Code { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¥åºç¶æ |
| | | /// Valid å·²æ ¸å ï¼é»è®¤ï¼TOChecked å¾
æ ¸å |
| | | /// </summary> |
| | | public string Status { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åå»ºæ¥æ |
| | | /// </summary> |
| | | public string Createtime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å建人 |
| | | /// </summary> |
| | | public string Createuser { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»åº |
| | | /// "HA72å°¾æ°ä»ã HA71æåä»ãHA73ç åä»" |
| | | /// </summary> |
| | | public string WarehouseCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | public string Remark { get; set; } |
| | | |
| | | public List<ERPDataItem> DataItem { get; set; } |
| | | } |
| | | public class ERPDataItemSheet |
| | | { |
| | | /// <summary> |
| | | /// ç产ç¼ç |
| | | /// </summary> |
| | | public string PartNum { get; set; } |
| | | |
| | | /// <summary> |
| | | /// çæ¬ |
| | | /// </summary> |
| | | public string PartRev { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | public string Remark { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¹æ¬¡å· |
| | | /// </summary> |
| | | public string Lotno { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¥åºSetæ° |
| | | /// </summary> |
| | | public int QtyOfArray { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¥åºPCSæ° |
| | | /// </summary> |
| | | public int QtyOfUnit { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¥åºåæ¿SETæ° |
| | | /// </summary> |
| | | public int QtyOfArray_Alloc { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¥åºåæ¿PCSæ° |
| | | /// </summary> |
| | | public int QtyOfUnit_Alloc { get; set; } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_External.Model |
| | | { |
| | | /// <summary> |
| | | /// æåçç¹ |
| | | /// </summary> |
| | | public class ERPStockCheckModel |
| | | { |
| | | /// <summary> |
| | | /// æä½ç±»å |
| | | /// 1 æ°å¢ |
| | | /// </summary> |
| | | public int Way { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 主å¥å¼ |
| | | /// </summary> |
| | | public string UniqueTag { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæ®å· |
| | | /// </summary> |
| | | public string Code { get; set; } |
| | | |
| | | /// <summary> |
| | | /// çç¹åç§° |
| | | /// </summary> |
| | | public string Name { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è´¦æå¼å§æ¶é´ |
| | | /// 2023-01-01 æ ¼å¼ |
| | | /// </summary> |
| | | public string FiscalPeriotime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åå»ºæ¥æ |
| | | /// </summary> |
| | | public string Createtime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å建人 |
| | | /// </summary> |
| | | public string Createuser { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»åº |
| | | /// "HA72å°¾æ°ä»ã HA71æåä»ãHA73ç åä»" |
| | | /// </summary> |
| | | public string WarehouseCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | public string Remark { get; set; } |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public List<ERPDataItem> DataItem { get; set; } |
| | | } |
| | | public class ERPDataItem { |
| | | /// <summary> |
| | | /// å¨ä½ä»£å· |
| | | /// </summary> |
| | | public string Location { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç产ç¼ç |
| | | /// </summary> |
| | | public string PartNum { get; set; } |
| | | |
| | | /// <summary> |
| | | /// çæ¬ |
| | | /// </summary> |
| | | public string PartRev { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | public string Remark { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¹æ¬¡ |
| | | /// </summary> |
| | | public string Lotno { get; set; } |
| | | |
| | | /// <summary> |
| | | /// çç¹åæ¿åå
æ° |
| | | /// åæ¿pcsæ° |
| | | /// </summary> |
| | | public int QtyOfUnit_Alloc { get; set; } |
| | | |
| | | /// <summary> |
| | | /// çç¹äº¤è´§æ¿æ° |
| | | /// 好æ¿Setæ° |
| | | /// </summary> |
| | | public int QtyOfArray { get; set; } |
| | | |
| | | /// <summary> |
| | | /// çç¹åå
æ° |
| | | /// 好æ¿pcsæ° |
| | | /// </summary> |
| | | public int QtyOfUnit { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç³»ç»åºååå
æ° |
| | | /// 好æ¿pcsæ° |
| | | /// </summary> |
| | | public int SysQtyOfUnit { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç³»ç»åºåæ¿æ° |
| | | ///好æ¿Setæ° |
| | | /// </summary> |
| | | public int SysQtyOfArray { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç³»ç»åæ¿åºååå
æ° |
| | | /// åæ¿pcsæ° |
| | | /// </summary> |
| | | public int SysQtyOfUnit_Alloc { get; set; } |
| | | } |
| | | } |
| | |
| | | /// <param name="taskNum"></param> |
| | | /// <param name="roadwayNos"></param> |
| | | /// <returns></returns> |
| | | WebResponseContent AssignRoadway(int taskNum, List<string> roadwayNos); |
| | | WebResponseContent AssignRoadway(int taskNum, List<string> roadwayNos, int heightType); |
| | | |
| | | /// <summary> |
| | | /// |
| | |
| | | } |
| | | List<Dt_StockInfo> autoAssignStocks = _stockService.StockInfoService.GetOutboundStocks(stockInfos, mesOutboundOrder.MaterialCode, needQuantity, out float residueQuantity); |
| | | mesOutboundOrder.LockQuantity += needQuantity - residueQuantity; |
| | | autoAssignStocks.OrderBy(x => x.Details.FirstOrDefault()?.StockQuantity).ToList(); |
| | | outStocks.AddRange(autoAssignStocks); |
| | | float assignQuantity = needQuantity - residueQuantity; |
| | | |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.CommonEnum; |
| | | using WIDESEA_Common.LocationEnum; |
| | | using WIDESEA_Common.OrderEnum; |
| | | using WIDESEA_Common.StockEnum; |
| | |
| | | /// <param name="taskNum">ä»»å¡å·</param> |
| | | /// <param name="roadwayNos">å··éå·</param> |
| | | /// <returns></returns> |
| | | public WebResponseContent AssignRoadway(int taskNum, List<string> roadwayNos) |
| | | public WebResponseContent AssignRoadway(int taskNum, List<string> roadwayNos, int heightType) |
| | | { |
| | | try |
| | | { |
| | |
| | | { |
| | | return WebResponseContent.Instance.OK(data: task.TargetAddress); |
| | | } |
| | | |
| | | List<LocationCount> locationCounts = Db.Queryable<Dt_LocationInfo>().Where(x => (x.LocationType == task.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)).GroupBy(x => x.RoadwayNo).Select(x => new LocationCount { RoadwayNo = x.RoadwayNo, Count = SqlFunc.AggregateCount(x) }).ToList(); |
| | | |
| | | string roadwayNo = locationCounts.OrderBy(x => x.Count).FirstOrDefault()?.RoadwayNo ?? ""; |
| | | |
| | | bool IsBCS = task.PalletType == PalletTypeEnum.SmallPallet.ObjToInt(); |
| | | //è·åæ¯ä¸ªå··é1-3å±ï¼4å±ï¼5å±çè´§ä½ |
| | | List<LocationCount> locationCounts = new List<LocationCount>(); |
| | | if (heightType == 1) |
| | | { |
| | | locationCounts = Db.Queryable<Dt_LocationInfo>().Where(x => (x.LocationType == task.PalletType || (IsBCS ? false : x.LocationType == LocationTypeEnum.Undefined.ObjToInt())) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && (IsBCS ? !IsBCS : ("SC01_BC".Contains(x.RoadwayNo) ? x.Column % 2 == 0 : x.Column % 2 == 1)) && x.Layer <= 3 && roadwayNos.Contains(x.RoadwayNo)).GroupBy(x => x.RoadwayNo).Select(x => new LocationCount { RoadwayNo = x.RoadwayNo, Count = SqlFunc.AggregateCount(x) }).ToList(); |
| | | } |
| | | else if(heightType == 2) |
| | | { |
| | | locationCounts = Db.Queryable<Dt_LocationInfo>().Where(x => (x.LocationType == task.PalletType || (IsBCS ? false : x.LocationType == LocationTypeEnum.Undefined.ObjToInt())) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && (IsBCS ? !IsBCS : ("SC01_BC".Contains(x.RoadwayNo) ? x.Column % 2 == 0 : x.Column % 2 == 1)) && x.Layer == 4 && roadwayNos.Contains(x.RoadwayNo)).GroupBy(x => x.RoadwayNo).Select(x => new LocationCount { RoadwayNo = x.RoadwayNo, Count = SqlFunc.AggregateCount(x) }).ToList(); |
| | | } |
| | | else if(heightType == 3) |
| | | { |
| | | locationCounts = Db.Queryable<Dt_LocationInfo>().Where(x => (x.LocationType == task.PalletType || (IsBCS ? false : x.LocationType == LocationTypeEnum.Undefined.ObjToInt())) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && (IsBCS ? !IsBCS : ("SC01_BC".Contains(x.RoadwayNo) ? x.Column % 2 == 0 : x.Column % 2 == 1)) && x.Layer == 5 && roadwayNos.Contains(x.RoadwayNo)).GroupBy(x => x.RoadwayNo).Select(x => new LocationCount { RoadwayNo = x.RoadwayNo, Count = SqlFunc.AggregateCount(x) }).ToList(); |
| | | } |
| | | string roadwayNo=string.Empty; |
| | | foreach (var location in locationCounts.OrderBy(x => x.Count)) |
| | | { |
| | | if (location.Count == 1) |
| | | continue; |
| | | roadwayNo = location?.RoadwayNo ?? ""; |
| | | break; |
| | | } |
| | | return !string.IsNullOrEmpty(roadwayNo) ? WebResponseContent.Instance.OK(data: roadwayNo) : WebResponseContent.Instance.Error("æªæ¾å°å¯åé
å··é"); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | OutboundQuantity = 0, |
| | | SerialNumber = stockInfoDetail_Hty?.SerialNumber ?? "0", |
| | | StockQuantity = model.Quantity, |
| | | Status = StockStatusEmun.MESéåº.ObjToInt(), |
| | | Status = model.Quantity <= 0.0 ? StockStatusEmun.MES空æéåº.ObjToInt() : StockStatusEmun.MESéåº.ObjToInt(), |
| | | Unit = model.Unit |
| | | }; |
| | | Dt_StockInfo stockInfo = new Dt_StockInfo() |
| | |
| | | PalletCode = model.CarrierCode, |
| | | PalletType = palletTypeInfo.PalletType, |
| | | WarehouseId = warehouse.WarehouseId, |
| | | StockStatus = StockStatusEmun.MESéåº.ObjToInt(), |
| | | Details = new List<Dt_StockInfoDetail> { stockInfoDetail } |
| | | StockStatus = stockInfoDetail.StockQuantity<=0.0? StockStatusEmun.MES空æéåº.ObjToInt():StockStatusEmun.MESéåº.ObjToInt(), |
| | | Details = new List<Dt_StockInfoDetail> { stockInfoDetail }, |
| | | Remark= stockInfoDetail.StockQuantity <= 0.0 ? StockStatusEmun.MES空æéåº.ToString() : StockStatusEmun.MESéåº.ToString() |
| | | }; |
| | | //Dt_Task task = new Dt_Task() |
| | | //{ |
| | |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°è¯¥æçåºåæç»ä¿¡æ¯"); |
| | | } |
| | | |
| | | #region 空æéåº |
| | | if (task.TaskType == TaskTypeEnum.MesPalletReturn.ObjToInt()) |
| | | { |
| | | _unitOfWorkManage.BeginTran(); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? OperateTypeEnum.äººå·¥å®æ : OperateTypeEnum.èªå¨å®æ); |
| | | _stockService.StockInfoService.Repository.DeleteAndMoveIntoHty(stockInfo, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); |
| | | _stockService.StockInfoDetailService.Repository.DeleteAndMoveIntoHty(stockInfo.Details, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); |
| | | _unitOfWorkManage.CommitTran(); |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | #endregion |
| | | Dt_LocationInfo locationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.TargetAddress); |
| | | if (locationInfo == 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()) |
| | | 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() && stockInfo.StockStatus != StockStatusEmun.MES空æéåº.ObjToInt()) |
| | | { |
| | | return WebResponseContent.Instance.Error($"该æçç¶æä¸æ£ç¡®,ä¸å¯ç³è¯·å
¥åº"); |
| | | } |
| | |
| | | { |
| | | newTask.TaskType = TaskTypeEnum.MesMatReturn.ObjToInt(); |
| | | } |
| | | else if (stockInfo.StockStatus == StockStatusEmun.MES空æéåº.ObjToInt()) |
| | | { |
| | | //todo ææ¶æªå¯ç¨ |
| | | return WebResponseContent.Instance.Error($"ç©ºææªå¯ç¨"); |
| | | //newTask.TaskType = TaskTypeEnum.MesPalletReturn.ObjToInt(); |
| | | } |
| | | else |
| | | { |
| | | stockInfo.StockStatus = StockStatusEmun.å
¥åºç¡®è®¤.ObjToInt(); |
| | |
| | | (List<Dt_StockInfo>, Dt_OutboundOrderDetail, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) result = _outboundService.OutboundOrderDetailService.AssignStockOutbound(outboundOrderDetail, stockSelectViews); |
| | | if (result.Item1 != null && result.Item1.Count > 0) |
| | | { |
| | | Dt_OutboundOrder outboundOrder = _outboundService.OutboundOrderService.Repository.QueryFirst(x => x.Id == outboundOrderDetail.OrderId); |
| | | TaskTypeEnum typeEnum = outboundOrder.OrderType switch |
| | | { |
| | | (int)OutOrderTypeEnum.Issue => TaskTypeEnum.Outbound, |
| | | (int)OutOrderTypeEnum.Allocate => TaskTypeEnum.OutAllocate, |
| | | (int)OutOrderTypeEnum.Quality => TaskTypeEnum.OutQuality, |
| | | _ => new TaskTypeEnum() |
| | | }; |
| | | tasks = GetTasks(result.Item1, TaskTypeEnum.Outbound); |
| | | result.Item2.OrderDetailStatus = OrderDetailStatusEnum.Outbound.ObjToInt(); |
| | | result.Item3.ForEach(x => |
| | |
| | | /// <param name="roadwayNos"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("AssignRoadway"), AllowAnonymous] |
| | | public WebResponseContent AssignRoadway(int taskNum, [FromBody] List<string> roadwayNos) |
| | | public WebResponseContent AssignRoadway(int taskNum, [FromBody] List<string> roadwayNos,int heightType) |
| | | { |
| | | return Service.AssignRoadway(taskNum, roadwayNos); |
| | | return Service.AssignRoadway(taskNum, roadwayNos, heightType); |
| | | } |
| | | |
| | | /// <summary> |