已修改44个文件
已删除1个文件
已添加15个文件
| | |
| | | PaperYLBackInbound = 730, |
| | | |
| | | /// <summary> |
| | | /// åæèåéåº |
| | | /// </summary> |
| | | [Description("åæèåéåº")] |
| | | PaperOldYLBackInbound = 740, |
| | | |
| | | /// <summary> |
| | | /// å··éå
ç§»åº |
| | | /// </summary> |
| | | [Description("å··éå
ç§»åº")] |
| | |
| | | AgvResponse agvResponse = new AgvResponse(); |
| | | try |
| | | { |
| | | if (secureApplyModel.ReceiveTaskID=="100") |
| | | { |
| | | return agvResponse.OK("æå", "0"); |
| | | } |
| | | var task = _taskRepository.QueryFirst(x => secureApplyModel.ReceiveTaskID.ObjToInt() == x.TaskNum); |
| | | if (task == null) throw new Exception("æªæ¾å°ä»»å¡"); |
| | | if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) |
| | |
| | | content = ReceiveWMSTask(new List<WMSTaskDTO> { taskDTO }); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | content = responseContent ?? content.Error("ç»æé误"); |
| | | } |
| | | |
| | | } |
| | | catch (Exception ex) |
| | |
| | | /// </summary> |
| | | W_Channel, |
| | | /// <summary> |
| | | /// é¿ |
| | | /// </summary> |
| | | W_Long, |
| | | /// <summary> |
| | | /// 宽 |
| | | /// </summary> |
| | | W_Wide, |
| | | /// <summary> |
| | | /// é« |
| | | /// </summary> |
| | | W_High, |
| | | /// <summary> |
| | | /// 请æ±ç¡®è®¤<br/> |
| | | /// 1:ä»»å¡ä¸å<br/> |
| | | /// 2:æ¸
é¤ç¡®è®¤<br/> |
| | | /// </summary> |
| | | W_Request |
| | | W_Request, |
| | | W_TMID, |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Microsoft.AspNetCore.Components.Routing; |
| | | using Newtonsoft.Json; |
| | | using Quartz; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Reflection.Metadata; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEAWCS_Common; |
| | | using WIDESEAWCS_Common.TaskEnum; |
| | | using WIDESEAWCS_Communicator; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.Helper; |
| | | using WIDESEAWCS_IBasicInfoRepository; |
| | | using WIDESEAWCS_ITaskInfoRepository; |
| | | using WIDESEAWCS_ITaskInfoService; |
| | | using WIDESEAWCS_Model.Models; |
| | | using WIDESEAWCS_QuartzJob; |
| | | using WIDESEAWCS_QuartzJob.DTO; |
| | | using WIDESEAWCS_QuartzJob.Models; |
| | | using WIDESEAWCS_QuartzJob.Repository; |
| | | using WIDESEAWCS_QuartzJob.Service; |
| | | using WIDESEAWCS_Tasks.ConveyorLineJob; |
| | | using ICacheService = WIDESEAWCS_Core.Caches.ICacheService; |
| | | |
| | | namespace WIDESEAWCS_Tasks |
| | | { |
| | | [DisallowConcurrentExecution] |
| | | public class ConveyorLineJob_YLOld : JobBase, IJob |
| | | { |
| | | private readonly ICacheService _cacheService; |
| | | private readonly ITaskService _taskService; |
| | | private readonly ITaskExecuteDetailService _taskExecuteDetailService; |
| | | private readonly ITaskRepository _taskRepository; |
| | | private readonly IStationMangerRepository _stationMangerRepository; |
| | | private readonly IRouterRepository _routerRepository; |
| | | private readonly IRouterService _routerService; |
| | | private readonly IRouterExtension _routerExtension; |
| | | private readonly List<Dt_WarehouseDevice> warehouseDevices; |
| | | |
| | | public ConveyorLineJob_YLOld(ICacheService cacheService, ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository, IRouterService routerService, IRouterExtension routerExtension) |
| | | { |
| | | _cacheService = cacheService; |
| | | _taskService = taskService; |
| | | _taskExecuteDetailService = taskExecuteDetailService; |
| | | _taskRepository = taskRepository; |
| | | _stationMangerRepository = stationMangerRepository; |
| | | _routerRepository = routerRepository; |
| | | _routerService = routerService; |
| | | _routerExtension = routerExtension; |
| | | |
| | | string? warehouseDevicesStr = _cacheService.Get<string>(nameof(Dt_WarehouseDevice)); |
| | | if (!string.IsNullOrEmpty(warehouseDevicesStr)) |
| | | { |
| | | warehouseDevices = JsonConvert.DeserializeObject<List<Dt_WarehouseDevice>>(warehouseDevicesStr) ?? new List<Dt_WarehouseDevice>(); |
| | | } |
| | | else |
| | | { |
| | | warehouseDevices = new List<Dt_WarehouseDevice>(); |
| | | } |
| | | } |
| | | |
| | | public Task Execute(IJobExecutionContext context) |
| | | { |
| | | bool flag = context.JobDetail.JobDataMap.TryGetValue("JobParams", out object? value); |
| | | if (flag && value != null) |
| | | { |
| | | OtherDevice device = (OtherDevice)value; |
| | | //è·åææåè®®çè¾é线ç«å° |
| | | List<string> deviceStations = device.DeviceProDTOs.Select(x => x.DeviceChildCode).ToList(); |
| | | List<Dt_StationManger> stationMangers = _stationMangerRepository.QueryData(x => x.StationDeviceCode == device.DeviceCode); |
| | | foreach (var item in stationMangers.Where(x => deviceStations.Contains(x.StationCode))) |
| | | { |
| | | DeviceProDTO? deviceProRead = device.DeviceProDTOs.Where(x => x.DeviceChildCode == item.StationCode && x.DeviceProParamType == nameof(WR_CLineYLDB)).OrderBy(x => x.DeviceProOffset).FirstOrDefault(); |
| | | if (deviceProRead != null) |
| | | { |
| | | R_ConveyorLineYLInfo conveyorLineInfoRead = device.Communicator.ReadCustomer<R_ConveyorLineYLInfo>(deviceProRead.DeviceProAddress); |
| | | if (conveyorLineInfoRead != null && item.StationType == StationTypeEnum.StationType_InStartAndOutEnd.ObjToInt() && conveyorLineInfoRead.WR_ToHode <= 0 && conveyorLineInfoRead.WR_Request == 86 && !string.IsNullOrEmpty(conveyorLineInfoRead.WR_TMID)) //èåç³è¯·å
¥åº |
| | | { |
| | | WebResponseContent content = _taskService.YLPurchaseBoxing(conveyorLineInfoRead.WR_TMID); |
| | | if (content.Status) |
| | | { |
| | | device.SetValue(WR_CLineYLDB.WR_Reresult, 86, item.StationCode); |
| | | WriteInfo(item.StationCode, $"请æ±éææ¡ç :{conveyorLineInfoRead.WR_TMID}"); |
| | | } |
| | | else |
| | | { |
| | | WriteError(item.StationCode, $"请æ±éæå¤±è´¥ï¼{content.Message}"); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | WriteError(item.StationName, $"æªæ¾å°è®¾å¤åç¼å·{item.StationCode}çå议信æ¯"); |
| | | } |
| | | } |
| | | } |
| | | return Task.CompletedTask; |
| | | } |
| | | } |
| | | } |
| | |
| | | _taskRepository.UpdateData(task); |
| | | return task; |
| | | } |
| | | else |
| | | { |
| | | task.ExceptionMessage = "åºåºç«å°æ æ³ä¸å"; |
| | | _taskRepository.UpdateData(task); |
| | | } |
| | | } |
| | | else |
| | | { |
| | |
| | | _taskRepository.UpdateData(task); |
| | | return task; |
| | | } |
| | | else |
| | | { |
| | | task.ExceptionMessage = "åºåºç«å°æ æ³ä¸å"; |
| | | _taskRepository.UpdateData(task); |
| | | } |
| | | } |
| | | else |
| | | { |
| | |
| | | task.NextAddress = stationManger.StackerCraneStationCode; |
| | | _taskRepository.UpdateData(task); |
| | | return task; |
| | | } |
| | | else |
| | | { |
| | | task.ExceptionMessage = "åºåºç«å°æ æ³ä¸å"; |
| | | _taskRepository.UpdateData(task); |
| | | } |
| | | } |
| | | else |
| | |
| | | { |
| | | YLStackerCraneTaskCommand stackerCraneTaskCommand = new YLStackerCraneTaskCommand(); |
| | | |
| | | stackerCraneTaskCommand.PalletType = Convert.ToInt16(task.PalletType); |
| | | stackerCraneTaskCommand.TaskNum = task.TaskNum; |
| | | stackerCraneTaskCommand.WorkType = 5; |
| | | stackerCraneTaskCommand.PalletType = Convert.ToInt16(task.PalletType); |
| | | if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)//夿æ¯å¦æ¯å
¥åºä»»å¡ |
| | | { |
| | | |
| | |
| | | string[] targetCodes = task.NextAddress.Split("-"); |
| | | if (targetCodes.Length == 3) |
| | | { |
| | | stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[1]); |
| | | stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[2]); |
| | | stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[3]); |
| | | stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[0]); |
| | | stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[1]); |
| | | stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[2]); |
| | | } |
| | | else |
| | | { |
| | |
| | | string[] sourceCodes = task.CurrentAddress.Split("-"); |
| | | if (sourceCodes.Length == 5) |
| | | { |
| | | stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[0]); |
| | | stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[1]); |
| | | stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[2]); |
| | | stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[1]); |
| | | stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[2]); |
| | | stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[3]); |
| | | } |
| | | else |
| | | { |
| | |
| | | using Microsoft.AspNetCore.Components.Routing; |
| | | using Newtonsoft.Json; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime; |
| | | using Org.BouncyCastle.Tls; |
| | | using Quartz; |
| | | using SqlSugar.Extensions; |
| | | using System; |
| | |
| | | private readonly IRouterService _routerService; |
| | | private readonly IRouterExtension _routerExtension; |
| | | private readonly List<Dt_WarehouseDevice> warehouseDevices; |
| | | private static object lockObj = 0;// |
| | | |
| | | public ConveyorLineJob_CPH(ICacheService cacheService, ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository, IRouterService routerService, IRouterExtension routerExtension) |
| | | { |
| | |
| | | |
| | | public Task Execute(IJobExecutionContext context) |
| | | { |
| | | bool flag = context.JobDetail.JobDataMap.TryGetValue("JobParams", out object? value); |
| | | if (flag && value != null) |
| | | lock (lockObj) |
| | | { |
| | | //è·åå½åè®¾å¤ |
| | | OtherDevice device = (OtherDevice)value; |
| | | List<string> deviceStations = device.DeviceProDTOs.Select(x => x.DeviceChildCode).Distinct().ToList(); |
| | | List<Dt_StationManger> stationMangers = _stationMangerRepository.QueryData(x => x.StationDeviceCode == device.DeviceCode); |
| | | foreach (var item in stationMangers.Where(x => deviceStations.Contains(x.StationCode))) |
| | | if (lockObj.ToString()=="0") |
| | | { |
| | | DeviceProDTO? deviceProRead = device.DeviceProDTOs.Where(x => x.DeviceChildCode == item.StationCode && x.DeviceProParamType == nameof(R_CLineCPHDB)).OrderBy(x => x.DeviceProOffset).FirstOrDefault(); |
| | | DeviceProDTO? deviceProWrite = device.DeviceProDTOs.Where(x => x.DeviceChildCode == item.StationCode && x.DeviceProParamType == nameof(W_CLineCPHDB)).OrderBy(x => x.DeviceProOffset).FirstOrDefault(); |
| | | if (item.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt() && deviceProRead != null && deviceProWrite != null) |
| | | lockObj = 1; |
| | | Task task = Task.Run(() => |
| | | { |
| | | R_CLineCPHInfo conveyorLineInfoRead = device.Communicator.ReadCustomer<R_CLineCPHInfo>(deviceProRead.DeviceProAddress); |
| | | //ç åç¯çº¿è¯·æ±ä»»å¡ |
| | | if (conveyorLineInfoRead != null && (conveyorLineInfoRead.R_State == 2 || conveyorLineInfoRead.R_State == 3) && conveyorLineInfoRead.R_TaskNo <= 0 && !string.IsNullOrEmpty(conveyorLineInfoRead.R_BoxCode) && conveyorLineInfoRead.R_Request==1) |
| | | try |
| | | { |
| | | //WebResponseContent content = _taskService.RequestWMSTaskSimple(conveyorLineInfoRead.R_BoxCode, item.StationCode); |
| | | ////åWMS请æ±ä»»å¡ |
| | | //if (true) |
| | | //{ |
| | | |
| | | //} |
| | | |
| | | } |
| | | } |
| | | else if(item.StationType == StationTypeEnum.StationType_OnlyOutbound.ObjToInt() && deviceProRead != null) |
| | | { |
| | | R_CLineCPHInfo conveyorLineInfoRead = device.Communicator.ReadCustomer<R_CLineCPHInfo>(deviceProRead.DeviceProAddress); |
| | | //è·åç åå£ä»»å¡æ´æ°ä»»å¡ç¶æ |
| | | if (conveyorLineInfoRead != null && (conveyorLineInfoRead.R_State == 2 || conveyorLineInfoRead.R_State == 3) && conveyorLineInfoRead.R_TaskNo > 0) |
| | | { |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.R_TaskNo && x.NextAddress==item.StationCode && x.TaskState == TaskStatusEnum.Line_Executing.ObjToInt()); |
| | | if (task != null) |
| | | while (true) |
| | | { |
| | | task.CurrentAddress = item.StationCode; |
| | | task.NextAddress = task.TargetAddress; |
| | | task.DeviceCode = item.StackerCraneCode; |
| | | _taskService.UpdateTask(task, TaskStatusEnum.MD_Executing); |
| | | bool flag = context.JobDetail.JobDataMap.TryGetValue("JobParams", out object? value); |
| | | if (flag && value != null) |
| | | { |
| | | //è·åå½åè®¾å¤ |
| | | OtherDevice device = (OtherDevice)value; |
| | | List<string> deviceStations = device.DeviceProDTOs.Select(x => x.DeviceChildCode).Distinct().ToList(); |
| | | List<Dt_StationManger> stationMangers = _stationMangerRepository.QueryData(x => x.StationDeviceCode == device.DeviceCode); |
| | | foreach (var item in stationMangers.Where(x => deviceStations.Contains(x.StationCode))) |
| | | { |
| | | DeviceProDTO? deviceProRead = device.DeviceProDTOs.Where(x => x.DeviceChildCode == item.StationCode && x.DeviceProParamType == nameof(R_CLineCPHDB)).OrderBy(x => x.DeviceProOffset).FirstOrDefault(); |
| | | DeviceProDTO? deviceProWrite = device.DeviceProDTOs.Where(x => x.DeviceChildCode == item.StationCode && x.DeviceProParamType == nameof(W_CLineCPHDB)).OrderBy(x => x.DeviceProOffset).FirstOrDefault(); |
| | | if (item.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt() && deviceProRead != null && deviceProWrite != null) |
| | | { |
| | | R_CLineCPHInfo conveyorLineInfoRead = device.Communicator.ReadCustomer<R_CLineCPHInfo>(deviceProRead.DeviceProAddress); |
| | | //ç åç¯çº¿è¯·æ±ä»»å¡ |
| | | if (conveyorLineInfoRead != null && (conveyorLineInfoRead.R_State == 2 || conveyorLineInfoRead.R_State == 3) && conveyorLineInfoRead.R_TaskNo <= 0 && !string.IsNullOrEmpty(conveyorLineInfoRead.R_BoxCode) && conveyorLineInfoRead.R_Request == 1) |
| | | { |
| | | //WebResponseContent content = _taskService.RequestWMSTaskSimple(conveyorLineInfoRead.R_BoxCode, item.StationCode); |
| | | ////åWMS请æ±ä»»å¡ |
| | | //if (true) |
| | | //{ |
| | | |
| | | //} |
| | | //åå
¥æ§è¡æ°æ® |
| | | device.SetValue(W_CLineCPHDB.W_TaskNo, 1002, item.StationCode); |
| | | device.SetValue(W_CLineCPHDB.W_Channel, 5, item.StationCode); |
| | | device.SetValue(W_CLineCPHDB.W_Long, 400, item.StationCode); |
| | | device.SetValue(W_CLineCPHDB.W_Wide, 370, item.StationCode); |
| | | device.SetValue(W_CLineCPHDB.W_High, 300, item.StationCode); |
| | | device.SetValue(W_CLineCPHDB.W_TMID, conveyorLineInfoRead.R_BoxCode, item.StationCode); |
| | | device.SetValue(W_CLineCPHDB.W_Request, 1, item.StationCode); |
| | | |
| | | } |
| | | } |
| | | else if (item.StationType == StationTypeEnum.StationType_OnlyOutbound.ObjToInt() && deviceProRead != null) |
| | | { |
| | | R_CLineCPHInfo conveyorLineInfoRead = device.Communicator.ReadCustomer<R_CLineCPHInfo>(deviceProRead.DeviceProAddress); |
| | | //è·åç åå£ä»»å¡æ´æ°ä»»å¡ç¶æ |
| | | if (conveyorLineInfoRead != null && (conveyorLineInfoRead.R_State == 2 || conveyorLineInfoRead.R_State == 3) && conveyorLineInfoRead.R_TaskNo > 0) |
| | | { |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.R_TaskNo && x.NextAddress == item.StationCode && x.TaskState == TaskStatusEnum.Line_Executing.ObjToInt()); |
| | | if (task != null) |
| | | { |
| | | task.CurrentAddress = item.StationCode; |
| | | task.NextAddress = task.TargetAddress; |
| | | task.DeviceCode = item.StackerCraneCode; |
| | | _taskService.UpdateTask(task, TaskStatusEnum.MD_Executing); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | WriteError(item.StationName, $"æªæ¾å°è®¾å¤åç¼å·{item.StationCode}çå议信æ¯"); |
| | | } |
| | | } |
| | | } |
| | | Thread.Sleep(100); |
| | | |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | WriteError(item.StationName, $"æªæ¾å°è®¾å¤åç¼å·{item.StationCode}çå议信æ¯"); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | lockObj = 0; |
| | | WriteError(nameof(ConveyorLineJob_CPH), $"é误信æ¯ï¼{ex.Message}"); |
| | | } |
| | | |
| | | }); |
| | | } |
| | | |
| | | } |
| | | return Task.CompletedTask; |
| | | } |
| | |
| | | } |
| | | }, |
| | | { |
| | | name: "æ å® åº å åº åº", |
| | | name: "æ å® è å åº å åº åº", |
| | | icon: '', |
| | | class: '', |
| | | value: 'StockOutbound', |
| | |
| | | window.webConfig = { |
| | | // "webApiBaseUrl": "http://192.168.35.3:9283/", |
| | | "webApiBaseUrl": "http://127.0.0.1:9293/", |
| | | "webApiProduction":"http://192.168.35.3:9283/" |
| | | } |
| | |
| | | methods: { |
| | | //ä¸é¢è¿äºæ¹æ³å¯ä»¥ä¿çä¹å¯ä»¥å é¤ |
| | | onInit() { |
| | | |
| | | //æå®åºåº |
| | | let OutOrder = this.buttons.find(x => x.value == 'StockOutbound'); |
| | | if (OutOrder) { |
| | | |
| | | OutOrder.onClick = function () { |
| | | let rows = this.$refs.table.getSelected(); |
| | | if (rows.length == 0) return this.$error("è¯·éæ©æ°æ®!"); |
| | | this.$confirm("确认è¦éæ©çæ°æ®åºåºåå?", "è¦å", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | center: true, |
| | | }).then(() => { |
| | | var keys = rows.map((x) => x.id); |
| | | this.http |
| | | .post("api/Task/OldYLOutbound?", keys, "æ°æ®å¤çä¸") |
| | | .then((x) => { |
| | | if (!x.status) return this.$message.error(x.message); |
| | | this.$message.success("æä½æå"); |
| | | this.refresh(); |
| | | }); |
| | | }); |
| | | } |
| | | } |
| | | }, |
| | | onInited() { |
| | | //æ¡æ¶åå§åé
ç½®å |
| | |
| | | enableStatus: "", |
| | | locationStatus: "", |
| | | row: "", |
| | | column: "", |
| | | columns: "", |
| | | layer: "", |
| | | }); |
| | | const searchFormOptions = ref([ |
| | | [ |
| | | { title: "è´§ä½ç¼å·", field: "locationCode", type: "like" }, |
| | | { title: "å··éç¼å·", field: "roadwayNo",type:"like" }, |
| | | { title: "å··éç¼å·", field: "roadwayNo",type: "select",dataKey: "Roadways" }, |
| | | { title: "è´§ä½ç±»å", field: "locationType",type: "select",dataKey: "locationTypeEnum",data: [], }, |
| | | { title: "ç¦ç¨ç¶æ", field: "enableStatus" ,type: "select",dataKey: "enableStatusEnum",data: [],}, |
| | | ], |
| | | [ |
| | | { title: "è´§ä½ç¶æ", field: "locationStatus" ,type: "selectList",dataKey: "locationStatusEnum",data: [],}, |
| | | { title: "è¡", field: "row" ,type: "int"}, |
| | | { title: "å", field: "column" ,type: "int"}, |
| | | { title: "å", field: "columns" ,type: "int"}, |
| | | { title: "å±", field: "layer" ,type: "int"} |
| | | ], |
| | | ]); |
| | |
| | | field: "locationCode", |
| | | title: "è´§ä½ç¼å·", |
| | | type: "string", |
| | | width: 200, |
| | | width: 240, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "locationName", |
| | | title: "è´§ä½åç§°", |
| | | type: "string", |
| | | width: 280, |
| | | width: 300, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "roadwayNo", |
| | | title: "å··éç¼å·", |
| | | type: "decimal", |
| | | width: 100, |
| | | width: 110, |
| | | align: "left", |
| | | }, |
| | | { |
| | |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | hidden: true, |
| | | }, |
| | | { |
| | | field: "column", |
| | | field: "columns", |
| | | title: "è´§ä½å", |
| | | type: "int", |
| | | width: 120, |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | hidden: true, |
| | | }, |
| | | { |
| | | field: "layer", |
| | | title: "è´§ä½å±", |
| | | type: "string", |
| | | width: 200, |
| | | width: 90, |
| | | align: "left", |
| | | hidden: true, |
| | | }, |
| | | { |
| | | field: "depth", |
| | |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | hidden: true |
| | | }, |
| | | { |
| | | field: "modifyDate", |
| | |
| | | width: 160, |
| | | align: "left", |
| | | sort: true, |
| | | hidden: true |
| | | }, |
| | | { |
| | | field: "remark", |
| | |
| | | { title: "è´§ä½ç¶æ", field: "locationStatus" ,type: "selectList",dataKey: "locationStatusEnum",data: [],}, |
| | | { title: "åºåç¶æ", field: "stockStatus",type: "selectList",dataKey: "stockStatusEmun",data: [],}, |
| | | ], |
| | | [ |
| | | { title: "æå±ä»åº", field: "warehouseId",type: "select",dataKey: "warehouses",data: []}, |
| | | { title: "åºå屿§", field: "proStockAttribute" ,type: "selectList",dataKey: "proStockAttributeEnum",data: [],}, |
| | | ], |
| | | ]); |
| | | const columns = ref([ |
| | | { |
| | |
| | | const searchFormFields = ref({ |
| | | palletCode: "", |
| | | locationCode: "", |
| | | materielCode: "", |
| | | materielWide: "", |
| | | }); |
| | | const searchFormOptions = ref([ |
| | | [ |
| | |
| | | {title: "åºåç»ç»", field:"materielInvOrgId",type:"select",dataKey:"materielInvOrgEnum",data:[]}, |
| | | {title: "ç©æç¼å·", field:"materielCode",type:"like"}, |
| | | ], |
| | | [ |
| | | {title: "ç©æå¹
宽", field:"materielWide",type:"int"}, |
| | | {title: "åºåç¶æ", field:"stockStatus",type:"select",dataKey:"stockStatusEmun",data:[]}, |
| | | { title: "å建æ¶é´", field: "createDate", type: "datetime" }, |
| | | ], |
| | | ]); |
| | | const columns = ref([ |
| | | { |
| | |
| | | /// <returns></returns> |
| | | public List<LocationGroupDTO> GetAllLocationGroups(string roadway) |
| | | { |
| | | return QueryTabs<Dt_LocationInfo, Dt_LocationInfo, LocationGroupDTO>((a, b) => a.Column == b.Column && a.Layer == b.Layer && a.Row != b.Row && SqlFunc.Abs(a.Row - b.Row) == 1, (a, b) => new LocationGroupDTO { DepthA = a.Depth, DepthB = b.Depth, EnableStatusA = a.EnableStatus, EnableStatusB = b.EnableStatus, IdA = a.Id, IdB = b.Id, LocationCodeA = a.LocationCode, LocationCodeB = b.LocationCode, LocationStatusA = a.LocationStatus, LocationStatusB = b.LocationStatus, LocationTypeA = a.LocationType, LocationTypeB = b.LocationType }, a => a.Depth == 1 && a.RoadwayNo == roadway, b => b.Depth == 2 && b.RoadwayNo == roadway, x => true); |
| | | return QueryTabs<Dt_LocationInfo, Dt_LocationInfo, LocationGroupDTO>((a, b) => a.Columns == b.Columns && a.Layer == b.Layer && a.Row != b.Row && SqlFunc.Abs(a.Row - b.Row) == 1, (a, b) => new LocationGroupDTO { DepthA = a.Depth, DepthB = b.Depth, EnableStatusA = a.EnableStatus, EnableStatusB = b.EnableStatus, IdA = a.Id, IdB = b.Id, LocationCodeA = a.LocationCode, LocationCodeB = b.LocationCode, LocationStatusA = a.LocationStatus, LocationStatusB = b.LocationStatus, LocationTypeA = a.LocationType, LocationTypeB = b.LocationType }, a => a.Depth == 1 && a.RoadwayNo == roadway, b => b.Depth == 2 && b.RoadwayNo == roadway, x => true); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | public List<LocationGroupDTO> GetLocationGroups(string roadway, LocationStatusEnum locationAStatus, LocationStatusEnum locationBStatus) |
| | | { |
| | | return QueryTabs<Dt_LocationInfo, Dt_LocationInfo, LocationGroupDTO>( |
| | | (a, b) => a.Column == b.Column && a.Layer == b.Layer && a.Row != b.Row && SqlFunc.Abs(a.Row - b.Row) == 1, |
| | | (a, b) => a.Columns == b.Columns && a.Layer == b.Layer && a.Row != b.Row && SqlFunc.Abs(a.Row - b.Row) == 1, |
| | | (a, b) => new LocationGroupDTO { DepthA = a.Depth, DepthB = b.Depth, EnableStatusA = a.EnableStatus, EnableStatusB = b.EnableStatus, IdA = a.Id, IdB = b.Id, LocationCodeA = a.LocationCode, LocationCodeB = b.LocationCode, LocationStatusA = a.LocationStatus, LocationStatusB = b.LocationStatus, LocationTypeA = a.LocationType, LocationTypeB = b.LocationType }, |
| | | a => a.Depth == 1 && a.RoadwayNo == roadway && a.LocationStatus == locationAStatus.ObjToInt(), |
| | | b => b.Depth == 2 && b.RoadwayNo == roadway && b.LocationStatus == locationBStatus.ObjToInt(), |
| | |
| | | Dt_LocationInfo locationInfo = new Dt_LocationInfo() |
| | | { |
| | | WarehouseId = 0, |
| | | Column = j + 1, |
| | | Columns = j + 1, |
| | | EnableStatus = EnableStatusEnum.Normal.ObjToInt(), |
| | | Layer = k + 1, |
| | | LocationStatus = LocationStatusEnum.Free.ObjToInt(), |
| | |
| | | Row = i + 1, |
| | | Depth = depth, |
| | | }; |
| | | locationInfo.LocationCode = $"{locationInfo.RoadwayNo}-{locationInfo.Row.ToString().PadLeft(3, '0')}-{locationInfo.Column.ToString().PadLeft(3, '0')}-{locationInfo.Layer.ToString().PadLeft(3, '0')}-{locationInfo.Depth.ToString().PadLeft(2, '0')}"; |
| | | locationInfo.LocationName = $"{locationInfo.RoadwayNo}å··é{locationInfo.Row.ToString().PadLeft(3, '0')}è¡{locationInfo.Column.ToString().PadLeft(3, '0')}å{locationInfo.Layer.ToString().PadLeft(3, '0')}å±{locationInfo.Depth.ToString().PadLeft(2, '0')}æ·±"; |
| | | locationInfo.LocationCode = $"{locationInfo.RoadwayNo}-{locationInfo.Row.ToString().PadLeft(3, '0')}-{locationInfo.Columns.ToString().PadLeft(3, '0')}-{locationInfo.Layer.ToString().PadLeft(3, '0')}-{locationInfo.Depth.ToString().PadLeft(2, '0')}"; |
| | | locationInfo.LocationName = $"{locationInfo.RoadwayNo}å··é{locationInfo.Row.ToString().PadLeft(3, '0')}è¡{locationInfo.Columns.ToString().PadLeft(3, '0')}å{locationInfo.Layer.ToString().PadLeft(3, '0')}å±{locationInfo.Depth.ToString().PadLeft(2, '0')}æ·±"; |
| | | locationInfos.Add(locationInfo); |
| | | } |
| | | } |
| | |
| | | List<Dt_LocationInfo> definedTypeLocations = locationInfos.Where(x => x.LocationType == palletType.ObjToInt()).ToList(); |
| | | |
| | | //æªå®ä¹ç±»åçç©ºè´§ä½ |
| | | List<Dt_LocationInfo> undefinedTypeEmptyLocations = locationInfos.Where(x => (x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() || x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt()) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.LocationType == LocationTypeEnum.Undefined.ObjToInt() && !lockLocationCodes.Contains(x.LocationCode)).OrderByDescending(x => x.Depth).ThenBy(x => x.Layer).ThenBy(x => x.Row).ThenBy(x => x.Column).ToList(); |
| | | List<Dt_LocationInfo> undefinedTypeEmptyLocations = locationInfos.Where(x => (x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() || x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt()) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.LocationType == LocationTypeEnum.Undefined.ObjToInt() && !lockLocationCodes.Contains(x.LocationCode)).OrderByDescending(x => x.Depth).ThenBy(x => x.Layer).ThenBy(x => x.Row).ThenBy(x => x.Columns).ToList(); |
| | | |
| | | if (locationInfos.Count * weightValue >= definedTypeLocations.Count && undefinedTypeEmptyLocations.Count > 0)//妿已å®ä¹ç±»åè´§ä½æªè¶
è¿æ¯ä¾ï¼ä¸ææªå®ä¹ç±»åçè´§ä½ |
| | | { |
| | | if (palletType == PalletTypeEnum.LargePallet) |
| | | { |
| | | undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Column % 2 == 1).ToList(); |
| | | undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Columns % 2 == 1).ToList(); |
| | | } |
| | | for (int i = 0; i < undefinedTypeEmptyLocations.Count; i++) |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | List<Dt_LocationInfo> definedTypeEmptyLocations = locationInfos.Where(x => (x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() || x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt()) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.LocationType == palletType.ObjToInt() && !lockLocationCodes.Contains(x.LocationCode)).OrderByDescending(x => x.Depth).ThenBy(x => x.Layer).ThenBy(x => x.Row).ThenBy(x => x.Column).ToList(); |
| | | List<Dt_LocationInfo> definedTypeEmptyLocations = locationInfos.Where(x => (x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() || x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt()) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.LocationType == palletType.ObjToInt() && !lockLocationCodes.Contains(x.LocationCode)).OrderByDescending(x => x.Depth).ThenBy(x => x.Layer).ThenBy(x => x.Row).ThenBy(x => x.Columns).ToList(); |
| | | |
| | | for (int i = 0; i < definedTypeEmptyLocations.Count; i++) |
| | | { |
| | |
| | | { |
| | | case PalletTypeEnum.LargePallet: |
| | | { |
| | | Dt_LocationInfo? nearLocation = locationInfos.FirstOrDefault(x => x.Row == undefinedTypeEmptyLocation.Row && x.Layer == undefinedTypeEmptyLocation.Layer && x.Depth == undefinedTypeEmptyLocation.Depth && x.Column == undefinedTypeEmptyLocation.Column + 1); |
| | | Dt_LocationInfo? nearLocation = locationInfos.FirstOrDefault(x => x.Row == undefinedTypeEmptyLocation.Row && x.Layer == undefinedTypeEmptyLocation.Layer && x.Depth == undefinedTypeEmptyLocation.Depth && x.Columns == undefinedTypeEmptyLocation.Columns + 1); |
| | | if (nearLocation != null && nearLocation.LocationStatus == LocationStatusEnum.Free.ObjToInt() && DepthLocationIsEmpty(locationInfos, undefinedTypeEmptyLocation) != null) |
| | | { |
| | | Dt_LocationInfo? locationInfo = DepthLocationIsEmpty(locationInfos, undefinedTypeEmptyLocation); |
| | |
| | | locations[i].LocationType = palletType.ObjToInt(); |
| | | } |
| | | |
| | | Dt_LocationInfo? nearLocation = locationInfos.FirstOrDefault(x => x.Row == location.Row && x.Layer == location.Layer && x.Depth == location.Depth && x.Column == location.Column + 1); |
| | | Dt_LocationInfo? nearLocation = locationInfos.FirstOrDefault(x => x.Row == location.Row && x.Layer == location.Layer && x.Depth == location.Depth && x.Columns == location.Columns + 1); |
| | | if (nearLocation != null) |
| | | { |
| | | List<Dt_LocationInfo> nearLocations = GetGroupLocations(locationInfos, nearLocation); |
| | |
| | | locations[i].LocationType = palletType.ObjToInt(); |
| | | } |
| | | |
| | | Dt_LocationInfo? nearLocation = locationInfos.FirstOrDefault(x => x.Row == location.Row && x.Layer == location.Layer && x.Depth == location.Depth && x.Column == location.Column + 1); |
| | | Dt_LocationInfo? nearLocation = locationInfos.FirstOrDefault(x => x.Row == location.Row && x.Layer == location.Layer && x.Depth == location.Depth && x.Columns == location.Columns + 1); |
| | | if (nearLocation != null) |
| | | { |
| | | List<Dt_LocationInfo> nearLocations = GetGroupLocations(locationInfos, nearLocation); |
| | |
| | | int maxDepth = locationInfos.Max(x => x.Depth); |
| | | for (int j = location.Depth + 1; j <= maxDepth; j++) |
| | | { |
| | | Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x => x.Depth == j && x.Column == location.Column && x.Layer == location.Layer); |
| | | Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x => x.Depth == j && x.Columns == location.Columns && x.Layer == location.Layer); |
| | | if (locationInfo != null) |
| | | { |
| | | groupLocations.Add(locationInfo); |
| | |
| | | |
| | | for (int j = location.Depth - 1; j >= 1; j--) |
| | | { |
| | | Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x => x.Depth == j && x.Column == location.Column && x.Layer == location.Layer); |
| | | Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x => x.Depth == j && x.Columns == location.Columns && x.Layer == location.Layer); |
| | | if (locationInfo != null) |
| | | { |
| | | groupLocations.Add(locationInfo); |
| | |
| | | |
| | | Dictionary<string, OrderByType> orderBy = new Dictionary<string, OrderByType>() |
| | | { |
| | | { nameof(Dt_LocationInfo.Column),OrderByType.Desc }, |
| | | { nameof(Dt_LocationInfo.Columns),OrderByType.Desc }, |
| | | { nameof(Dt_LocationInfo.Layer),OrderByType.Asc }, |
| | | { nameof(Dt_LocationInfo.Depth),OrderByType.Desc }, |
| | | { nameof(Dt_LocationInfo.Row),OrderByType.Asc } |
| | |
| | | |
| | | Dictionary<string, OrderByType> orderBy = new Dictionary<string, OrderByType>() |
| | | { |
| | | { nameof(Dt_LocationInfo.Column),OrderByType.Desc }, |
| | | { nameof(Dt_LocationInfo.Columns),OrderByType.Desc }, |
| | | { nameof(Dt_LocationInfo.Layer),OrderByType.Asc }, |
| | | { nameof(Dt_LocationInfo.Depth),OrderByType.Desc }, |
| | | { nameof(Dt_LocationInfo.Row),OrderByType.Asc } |
| | |
| | | Dt_LocationInfo? nearLocation1; |
| | | Dt_LocationInfo? nearLocation2; |
| | | |
| | | nearLocation1 = locationInfos.FirstOrDefault(x => x.LocationType == LocationTypeEnum.SmallPallet.ObjToInt() && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.Row == item.Row && x.Layer == item.Layer && x.Depth == item.Depth && x.Column == item.Column - 1); |
| | | nearLocation2 = locationInfos.FirstOrDefault(x => x.LocationType == LocationTypeEnum.SmallPallet.ObjToInt() && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.Row == item.Row && x.Layer == item.Layer && x.Depth == item.Depth && x.Column == item.Column + 1); |
| | | nearLocation1 = locationInfos.FirstOrDefault(x => x.LocationType == LocationTypeEnum.SmallPallet.ObjToInt() && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.Row == item.Row && x.Layer == item.Layer && x.Depth == item.Depth && x.Columns == item.Columns - 1); |
| | | nearLocation2 = locationInfos.FirstOrDefault(x => x.LocationType == LocationTypeEnum.SmallPallet.ObjToInt() && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.Row == item.Row && x.Layer == item.Layer && x.Depth == item.Depth && x.Columns == item.Columns + 1); |
| | | if (nearLocation1!=null && nearLocation2!=null) |
| | | { |
| | | locationInfo = item; |
| | |
| | | UpdateLocationStatus(location, palletType, locationStatus, warehousId); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä¿®æ¹è´§ä½ç¶æåç±»å |
| | | /// </summary> |
| | | /// <param name="location">è´§ä½å¯¹è±¡</param> |
| | | /// <param name="palletType">æçç±»å</param> |
| | | /// <param name="locationStatus">è´§ä½ç¶æ</param> |
| | | //public void UpdateLocationStatus2(Dt_LocationInfo location, int palletType, LocationStatusEnum locationStatus, int warehousId) |
| | | //{ |
| | | // List<Dt_LocationInfo> locationInfos = Repository.QueryData(x => x.RoadwayNo == location.RoadwayNo); |
| | | |
| | | // List<Dt_LocationInfo> locations = GetGroupLocations(locationInfos, location); |
| | | // if (locationInfos.Max(x => x.Depth) < 3) |
| | | // { |
| | | // for (int i = 0; i < locations.Count; i++) |
| | | // { |
| | | // if (locations[i].LocationType != palletType.ObjToInt()) |
| | | // { |
| | | // locations[i].LocationType = palletType.ObjToInt(); |
| | | // } |
| | | |
| | | // if (locations[i].LocationCode == location.LocationCode) |
| | | // { |
| | | // locations[i].LocationStatus = locationStatus.ObjToInt(); |
| | | // } |
| | | // else |
| | | // { |
| | | // if (locationStatus == LocationStatusEnum.Lock) |
| | | // { |
| | | // if (locations[i].LocationStatus == LocationStatusEnum.InStock.ObjToInt()) |
| | | // { |
| | | // locations[i].LocationStatus = LocationStatusEnum.InStockLock.ObjToInt(); |
| | | // } |
| | | // else if (locations[i].LocationStatus == LocationStatusEnum.Free.ObjToInt()) |
| | | // { |
| | | // locations[i].LocationStatus = LocationStatusEnum.FreeLock.ObjToInt(); |
| | | // } |
| | | // } |
| | | // else if (locationStatus == LocationStatusEnum.Free || locationStatus == LocationStatusEnum.InStock) |
| | | // { |
| | | // if (locations[i].LocationStatus == LocationStatusEnum.InStockLock.ObjToInt()) |
| | | // { |
| | | // locations[i].LocationStatus = LocationStatusEnum.InStock.ObjToInt(); |
| | | // } |
| | | // else if (locations[i].LocationStatus == LocationStatusEnum.FreeLock.ObjToInt()) |
| | | // { |
| | | // locations[i].LocationStatus = LocationStatusEnum.Free.ObjToInt(); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | // Dt_LocationInfo? 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") |
| | | // { |
| | | // nearLocation = locationInfos.FirstOrDefault(x => x.Row == location.Row && x.Layer == location.Layer && x.Depth == location.Depth && x.Column == location.Column + 1); |
| | | // } |
| | | // if (nearLocation != null) |
| | | // { |
| | | // List<Dt_LocationInfo> nearLocations = GetGroupLocations(locationInfos, nearLocation); |
| | | // for (int i = 0; i < nearLocations.Count; i++) |
| | | // { |
| | | // if (nearLocations[i].LocationType != palletType.ObjToInt()) |
| | | // { |
| | | // nearLocations[i].LocationType = palletType.ObjToInt(); |
| | | // } |
| | | |
| | | // if (palletType.ObjToInt() >= PalletTypeEnum.LargePallet.ObjToInt()) |
| | | // { |
| | | // if (nearLocations[i].LocationCode == nearLocation.LocationCode) |
| | | // { |
| | | // nearLocations[i].LocationStatus = locationStatus.ObjToInt(); |
| | | // } |
| | | // else |
| | | // { |
| | | // if (locationStatus == LocationStatusEnum.Lock) |
| | | // { |
| | | // if (nearLocations[i].LocationStatus == LocationStatusEnum.InStock.ObjToInt()) |
| | | // { |
| | | // nearLocations[i].LocationStatus = LocationStatusEnum.InStockLock.ObjToInt(); |
| | | // } |
| | | // else if (nearLocations[i].LocationStatus == LocationStatusEnum.Free.ObjToInt()) |
| | | // { |
| | | // nearLocations[i].LocationStatus = LocationStatusEnum.FreeLock.ObjToInt(); |
| | | // } |
| | | // } |
| | | // else if (locationStatus == LocationStatusEnum.InStock) |
| | | // { |
| | | // if (nearLocations[i].LocationStatus == LocationStatusEnum.InStockLock.ObjToInt()) |
| | | // { |
| | | // nearLocations[i].LocationStatus = LocationStatusEnum.InStock.ObjToInt(); |
| | | // } |
| | | // else if (nearLocations[i].LocationStatus == LocationStatusEnum.FreeLock.ObjToInt()) |
| | | // { |
| | | // nearLocations[i].LocationStatus = LocationStatusEnum.Free.ObjToInt(); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | // } |
| | | // locations.AddRange(nearLocations); |
| | | // } |
| | | // } |
| | | // else |
| | | // { |
| | | // for (int i = 0; i < locations.Count; i++) |
| | | // { |
| | | // if (locations[i].LocationCode == location.LocationCode) |
| | | // { |
| | | // locations[i].LocationStatus = locationStatus.ObjToInt(); |
| | | // } |
| | | // else |
| | | // { |
| | | // if (locationStatus == LocationStatusEnum.Lock) |
| | | // { |
| | | // if (locations[i].LocationStatus == LocationStatusEnum.InStock.ObjToInt()) |
| | | // { |
| | | // locations[i].LocationStatus = LocationStatusEnum.InStockLock.ObjToInt(); |
| | | // } |
| | | // else if (locations[i].LocationStatus == LocationStatusEnum.Free.ObjToInt()) |
| | | // { |
| | | // locations[i].LocationStatus = LocationStatusEnum.FreeLock.ObjToInt(); |
| | | // } |
| | | // } |
| | | // else if (locationStatus == LocationStatusEnum.Free || locationStatus == LocationStatusEnum.InStock) |
| | | // { |
| | | // if (locations[i].LocationStatus == LocationStatusEnum.InStockLock.ObjToInt()) |
| | | // { |
| | | // locations[i].LocationStatus = LocationStatusEnum.InStock.ObjToInt(); |
| | | // } |
| | | // else if (locations[i].LocationStatus == LocationStatusEnum.FreeLock.ObjToInt()) |
| | | // { |
| | | // locations[i].LocationStatus = LocationStatusEnum.Free.ObjToInt(); |
| | | // } |
| | | // } |
| | | // } |
| | | // if (locations[i].LocationType != palletType.ObjToInt()) |
| | | // { |
| | | // locations[i].LocationType = palletType.ObjToInt(); |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | // if (locations.Where(x => x.LocationStatus == LocationStatusEnum.Free.ObjToInt()).Count() == locations.Count && locationStatus == LocationStatusEnum.Free) |
| | | // { |
| | | // locations.ForEach(x => |
| | | // { |
| | | // x.LocationType = 0; |
| | | // }); |
| | | // } |
| | | |
| | | // Repository.UpdateData(locations); |
| | | //} |
| | | |
| | | public void UpdateLocationStatus(Dt_LocationInfo location, int palletType, LocationStatusEnum locationStatus, int warehouseId) |
| | | { |
| | |
| | | Dt_LocationInfo? nearLocation1; |
| | | Dt_LocationInfo? nearLocation2; |
| | | |
| | | nearLocation1 = locationInfos.FirstOrDefault(x => x.LocationType == LocationTypeEnum.SmallPallet.ObjToInt() && x.Row == location.Row && x.Layer == location.Layer && x.Depth == location.Depth && x.Column == location.Column - 1); |
| | | nearLocation2 = locationInfos.FirstOrDefault(x => x.LocationType == LocationTypeEnum.SmallPallet.ObjToInt() && x.Row == location.Row && x.Layer == location.Layer && x.Depth == location.Depth && x.Column == location.Column + 1); |
| | | nearLocation1 = locationInfos.FirstOrDefault(x => x.LocationType == LocationTypeEnum.SmallPallet.ObjToInt() && x.Row == location.Row && x.Layer == location.Layer && x.Depth == location.Depth && x.Columns == location.Columns - 1); |
| | | nearLocation2 = locationInfos.FirstOrDefault(x => x.LocationType == LocationTypeEnum.SmallPallet.ObjToInt() && x.Row == location.Row && x.Layer == location.Layer && x.Depth == location.Depth && x.Columns == location.Columns + 1); |
| | | |
| | | |
| | | if (nearLocation1 != null && nearLocation2 != null) |
| | |
| | | for (int j = location.Depth + 1; j <= maxDepth; j++) |
| | | { |
| | | row += 1; |
| | | Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x => x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row); |
| | | Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x => x.Depth == j && x.Columns == location.Columns && x.Layer == location.Layer && x.Row == row); |
| | | if (locationInfo != null) |
| | | { |
| | | groupLocations.Add(locationInfo); |
| | |
| | | for (int j = location.Depth - 1; j >= 1; j--) |
| | | { |
| | | row -= 1; |
| | | Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x => x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && x.Row == row); |
| | | Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x => x.Depth == j && x.Columns == location.Columns && x.Layer == location.Layer && x.Row == row); |
| | | if (locationInfo != null) |
| | | { |
| | | groupLocations.Add(locationInfo); |
| | |
| | | int row = location.Row; |
| | | for (int j = location.Depth + 1; j <= maxDepth; j++) |
| | | { |
| | | Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x => x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && (x.Row == row + 1 || x.Row == row - 1)); |
| | | Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x => x.Depth == j && x.Columns == location.Columns && x.Layer == location.Layer && (x.Row == row + 1 || x.Row == row - 1)); |
| | | if (locationInfo != null) |
| | | { |
| | | groupLocations.Add(locationInfo); |
| | |
| | | |
| | | for (int j = location.Depth - 1; j >= 1; j--) |
| | | { |
| | | Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x => x.Depth == j && x.Column == location.Column && x.Layer == location.Layer && (x.Row == row + 1 || x.Row == row - 1)); |
| | | Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x => x.Depth == j && x.Columns == location.Columns && x.Layer == location.Layer && (x.Row == row + 1 || x.Row == row - 1)); |
| | | if (locationInfo != null) |
| | | { |
| | | groupLocations.Add(locationInfo); |
| | |
| | | /// </summary> |
| | | [Description("æè´§")] |
| | | InStock = 100, |
| | | |
| | | /// <summary> |
| | | /// æçéå® |
| | | /// </summary> |
| | | [Description("æçéå®")] |
| | | PalletLock = 99 |
| | | } |
| | | } |
| | |
| | | [Description("æ£é宿")] |
| | | æ£é宿 =14, |
| | | |
| | | [Description("èåéåº")] |
| | | èåéåº = 15, |
| | | |
| | | [Description("MES使éåº")] |
| | | MES使éåº = 21, |
| | | |
| | |
| | | MD_Executing = 520, |
| | | |
| | | /// <summary> |
| | | /// çå¾
é
éå¼å« |
| | | /// </summary> |
| | | [Description("çå¾
é
éå¼å«")] |
| | | CallPending = 610, |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡å®æ |
| | | /// </summary> |
| | | [Description("ä»»å¡å®æ")] |
| | |
| | | PaperYLBackInbound = 730, |
| | | |
| | | /// <summary> |
| | | /// åæèåéåº |
| | | /// </summary> |
| | | [Description("åæèåéåº")] |
| | | PaperOldYLBackInbound = 740, |
| | | |
| | | /// <summary> |
| | | /// å··éå
ç§»åº |
| | | /// </summary> |
| | | [Description("å··éå
ç§»åº")] |
| | |
| | | } |
| | | else if (expressionType == LinqExpressionType.ThanOrEqual) |
| | | { |
| | | where += $"{searchParametersList[i].Name} {HtmlElementType.thanorequal} '{searchParametersList[i].Value}'"; |
| | | where += $"{searchParametersList[i].Name} {HtmlElementType.thanOrEqual} '{searchParametersList[i].Value}'"; |
| | | } |
| | | else if (expressionType == LinqExpressionType.LessThanOrEqual) |
| | | { |
| | | where += $"{searchParametersList[i].Name} {HtmlElementType.lessOrequal} '{searchParametersList[i].Value}'"; |
| | | where += $"{searchParametersList[i].Name} {HtmlElementType.lessOrEqual} '{searchParametersList[i].Value}'"; |
| | | } |
| | | else if (expressionType == LinqExpressionType.GreaterThan) |
| | | { |
| | |
| | | |
| | | public string DevMessage { get; set; } |
| | | |
| | | public string Datetime { get; set; } |
| | | |
| | | public WebResponseContent OK() |
| | | { |
| | | Status = true; |
| | | Datetime = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"); |
| | | return this; |
| | | } |
| | | |
| | |
| | | Status = true; |
| | | Message = message; |
| | | Data = data; |
| | | Datetime = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"); |
| | | return this; |
| | | } |
| | | |
| | |
| | | { |
| | | Status = false; |
| | | Message = message; |
| | | Datetime= DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"); |
| | | return this; |
| | | } |
| | | } |
| | |
| | | public const string like = "like"; |
| | | |
| | | public const string thanOrEqual = ">="; |
| | | public const string lessOrequal = "<="; |
| | | public const string lessOrEqual = "<="; |
| | | public const string Contains = "in"; |
| | | public const string Equal = "="; |
| | | } |
| | |
| | | case HtmlElementType.Contains: |
| | | linqExpression = LinqExpressionType.In; |
| | | break; |
| | | case HtmlElementType.thanOrEqual: |
| | | case HtmlElementType.thanorequal: |
| | | linqExpression = LinqExpressionType.ThanOrEqual; |
| | | break; |
| | | case HtmlElementType.lessOrequal: |
| | | case HtmlElementType.lessorequal: |
| | | linqExpression = LinqExpressionType.LessThanOrEqual; |
| | | break; |
| | | case HtmlElementType.GT: |
| | |
| | | namespace WIDESEA_DTO.ERP |
| | | { |
| | | /// <summary> |
| | | /// åæééè´å
¥åºåæ¥æ¶å®ä½ |
| | | /// åæéç产æç¨æ¥æ¶å®ä½ |
| | | /// </summary> |
| | | [ModelValidate] |
| | | public class BSTOutOrderDTO |
| | |
| | | public List<BstBoardMpsDetailItem> BstBoardMpsDetails { get; set; } |
| | | } |
| | | /// <summary> |
| | | /// éè´æ¶è´§æç» |
| | | /// ç产æç¨æç» |
| | | /// </summary> |
| | | public class BstBoardMpsDetailItem |
| | | { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.Attributes; |
| | | |
| | | namespace WIDESEA_DTO.MES |
| | | { |
| | | /// <summary> |
| | | /// MES颿èªå¨å«ææ¥æ¶å®ä½ |
| | | /// </summary> |
| | | [ModelValidate] |
| | | public class MESAutoIssueDTO |
| | | { |
| | | /// <summary> |
| | | /// åºåºæ¥æºæç»ID |
| | | /// </summary> |
| | | [PropertyValidate("åºåºæ¥æºæç»ID", NotNullAndEmpty = true)] |
| | | public int OutDetailId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æºå°ä½æå¯ç¨æ¶é¿ |
| | | /// </summary> |
| | | [PropertyValidate("æºå°ä½æå¯ç¨æ¶é¿", NotNullAndEmpty = true)] |
| | | public int OddsTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 䏿å¨è½¬ä½ä½ææ°é |
| | | /// </summary> |
| | | [PropertyValidate("䏿å¨è½¬ä½ä½ææ°é", NotNullAndEmpty = true)] |
| | | public decimal OddsQuantity { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¨è½¬ä½ç½®ç¼å· |
| | | /// </summary> |
| | | [PropertyValidate("å¨è½¬ä½ç½®ç¼å·", NotNullAndEmpty = true)] |
| | | public string PointCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¨è½¬ä½æ¯å¦åå¨ç©ºæ |
| | | /// </summary> |
| | | [PropertyValidate("å¨è½¬ä½æ¯å¦åå¨ç©ºæ", NotNullAndEmpty = true)] |
| | | public int IsEmptyPallet { 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.MES |
| | | { |
| | | /// <summary> |
| | | /// MESé¢æè®¡åæ¥æ¶å®ä½ |
| | | /// </summary> |
| | | [ModelValidate] |
| | | public class OutMESOrderDTO |
| | | { |
| | | /// <summary> |
| | | /// åºåºæ¥æºæç»ID |
| | | /// </summary> |
| | | [PropertyValidate("åºåºæ¥æºæç»ID", NotNullAndEmpty = true)] |
| | | public int OutDetailId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»åºä»£å· |
| | | /// </summary> |
| | | [PropertyValidate("纸质æ¶è´§å主表ID", NotNullAndEmpty = false)] |
| | | public string WarehouseCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç产订åç¼ç |
| | | /// </summary> |
| | | [PropertyValidate("ç产订åç¼ç ", NotNullAndEmpty = true)] |
| | | public string ProductOrderNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ´¾åå·¥åç¼ç |
| | | /// </summary> |
| | | [PropertyValidate("æ´¾åå·¥åç¼ç ", NotNullAndEmpty = true)] |
| | | public string SendOrderNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æç¼ç |
| | | /// </summary> |
| | | [PropertyValidate("ç©æç¼ç ", NotNullAndEmpty = true)] |
| | | public string MaterialCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©ææ¹æ¬¡ |
| | | /// </summary> |
| | | [PropertyValidate("ç©ææ¹æ¬¡", NotNullAndEmpty = false)] |
| | | public string MaterialLot { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æç级 |
| | | /// </summary> |
| | | [PropertyValidate("ç©æç级", NotNullAndEmpty = false)] |
| | | public string GradeCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æéæ±æ°é |
| | | /// </summary> |
| | | [PropertyValidate("ç©æéæ±æ°é", NotNullAndEmpty = true)] |
| | | public decimal ReqQuantity { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å å·¥ä¸å¿ç¼ç (æºå°) |
| | | /// </summary> |
| | | [PropertyValidate("å å·¥ä¸å¿ç¼ç (æºå°)", NotNullAndEmpty = true)] |
| | | public string MakeCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 计å颿æ¶é´ |
| | | /// </summary> |
| | | [PropertyValidate("计å颿æ¶é´", NotNullAndEmpty = true)] |
| | | public DateTime PlanDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç»ææ¶é´ |
| | | /// </summary> |
| | | [PropertyValidate("ç»ææ¶é´", NotNullAndEmpty = true)] |
| | | public DateTime EndDate { get; set; } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_External.Model; |
| | | |
| | | namespace WIDESEA_External.MESService |
| | | { |
| | | /// <summary> |
| | | /// è°ç¨MESæ¥å£ |
| | | /// </summary> |
| | | public interface IInvokeMESService : IDependency |
| | | { |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Serialization; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.APIEnum; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_External.Model; |
| | | using WIDESEA_IBasicRepository; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_External.MESService |
| | | { |
| | | /// <summary> |
| | | /// è°ç¨MESæ¥å£ |
| | | /// </summary> |
| | | public class InvokeMESService : IInvokeMESService |
| | | { |
| | | private readonly IApiInfoRepository _apiInfoRepository; |
| | | public InvokeMESService(IApiInfoRepository apiInfoRepository) |
| | | { |
| | | _apiInfoRepository = apiInfoRepository; |
| | | } |
| | | // å建ä¸ä¸ªä½¿ç¨å°é©¼å³°å½åæ³çåºåå设置 |
| | | JsonSerializerSettings settings = new JsonSerializerSettings |
| | | { |
| | | ContractResolver = new CamelCasePropertyNamesContractResolver() |
| | | }; |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_External.Model |
| | | { |
| | | internal class MESDispatchModel |
| | | { |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_External.Model |
| | | { |
| | | /// <summary> |
| | | /// MESè¿å |
| | | /// </summary> |
| | | public class MESResponse |
| | | { |
| | | /// <summary> |
| | | /// æåç»æ |
| | | /// </summary> |
| | | public bool Result { get; set; } |
| | | /// <summary> |
| | | /// è¿åä¿¡æ¯ |
| | | /// </summary> |
| | | public string Msg { get; set; } |
| | | /// <summary> |
| | | /// è¿å对象 |
| | | /// </summary> |
| | | public object Obj { get; set; } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_IOutboundRepository |
| | | { |
| | | /// <summary> |
| | | /// MESé¢æè®¡ååä»å¨æ¥å£å± |
| | | /// </summary> |
| | | public interface IOutMESOrderRepository : IRepository<Dt_OutMESOrder> |
| | | { |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.LocationEnum; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_IOutboundRepository; |
| | | using WIDESEA_Model.Models; |
| | | using WIDESEA_DTO.MES; |
| | | |
| | | namespace WIDESEA_IOutboundService |
| | | { |
| | | public interface IOutMESOrderService : IService<Dt_OutMESOrder> |
| | | { |
| | | IOutMESOrderRepository Repository { get; } |
| | | /// <summary> |
| | | /// æ¥æ¶MESé¢æè®¡å |
| | | /// </summary> |
| | | WebResponseContent ReceiveOutBound(OutMESOrderDTO outMESOrderDTO); |
| | | } |
| | | } |
| | |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_DTO; |
| | | using WIDESEA_DTO.ERP; |
| | | using WIDESEA_DTO.MES; |
| | | using WIDESEA_DTO.Stock; |
| | | using WIDESEA_DTO.Task; |
| | | using WIDESEA_ITaskInfoRepository; |
| | |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <returns></returns> |
| | | WebResponseContent Outbound(int id); |
| | | WebResponseContent Outbound(List<int> ids); |
| | | |
| | | /// <summary> |
| | | /// ä¿®æ¹ä»»å¡ç¶æ |
| | |
| | | /// <param name="keys"></param> |
| | | /// <returns></returns> |
| | | WebResponseContent CreateBSTOutboundTasks(int[] keys); |
| | | /// <summary> |
| | | /// MESèªå¨å«ææ¥å£ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | WebResponseContent ReceiveAutoIssue(MESAutoIssueDTO autoIssueDTO); |
| | | } |
| | | } |
| | |
| | | /// <summary> |
| | | /// åºå |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "åºå")] |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "åºå")] |
| | | public int StationArea { get; set; } |
| | | /// <summary> |
| | | /// MES对åºå¨è½¬ä½ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "MES对åºå¨è½¬ä½")] |
| | | public string MESPointCode { get; set; } |
| | | /// <summary> |
| | | /// æ¯å¦å ç¨ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "æ¯å¦å ç¨")] |
| | |
| | | /// è´§ä½å |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "è´§ä½å")] |
| | | public int Column { get; set; } |
| | | public int Columns { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è´§ä½å± |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.Attributes; |
| | | using WIDESEA_Core.CodeConfigEnum; |
| | | using WIDESEA_Core.DB.Models; |
| | | |
| | | namespace WIDESEA_Model.Models |
| | | { |
| | | /// <summary> |
| | | /// MESé¢æè®¡åå |
| | | /// </summary> |
| | | [SugarTable(nameof(Dt_OutMESOrder), "MESé¢æè®¡åå"), ModelValidate] |
| | | public class Dt_OutMESOrder : BaseEntity |
| | | { |
| | | /// <summary> |
| | | /// ä¸»é® |
| | | /// </summary> |
| | | [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主é®")] |
| | | public int Id { get; set; } |
| | | |
| | | ///// <summary> |
| | | ///// ä»åºä¸»é® |
| | | ///// </summary> |
| | | //[SugarColumn(IsNullable = false, ColumnDescription = "ä»åºä¸»é®")] |
| | | //public int WarehouseId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºåºæ¥æºæç»ID |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "åºåºæ¥æºæç»ID")] |
| | | public int OutDetailId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// WMSåæ®ç¼å· |
| | | /// </summary> |
| | | [CodeRule(RuleCodeEnum.OutboundOrderRule)] |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "WMSåæ®ç¼å·", IsOnlyIgnoreUpdate = true)] |
| | | public string OutMESOrderNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç产订åç¼ç (䏿¸¸) |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "ç产订åç¼ç (䏿¸¸)")] |
| | | public string ProductOrderNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ´¾åå·¥åç¼ç |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "æ´¾åå·¥åç¼ç ")] |
| | | public string SendOrderNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æç¼ç |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "ç©æç¼ç ")] |
| | | public string MaterialCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©ææ¹æ¬¡ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "ç©ææ¹æ¬¡")] |
| | | public string MaterialLot { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æç级 |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "ç©æç级")] |
| | | public string GradeCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æéæ±æ°é |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "ç©æéæ±æ°é")] |
| | | public decimal ReqQuantity { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å å·¥ä¸å¿ç¼ç (æºå°) |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "å å·¥ä¸å¿ç¼ç (æºå°)")] |
| | | public string MakeCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç产订åç¶æ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "ç产订åç¶æ")] |
| | | public int OutMESOrderStatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 计å颿æ¶é´ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "计å颿æ¶é´")] |
| | | public DateTime PlanDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç»ææ¶é´ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "ç»ææ¶é´")] |
| | | public DateTime EndDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åé
éæ±æ°é |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "åé
éæ±æ°é")] |
| | | public decimal AssignTotalUsage { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å·²åºéæ±æ°é |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "å·²åºéæ±æ°é")] |
| | | public decimal OutTotalUsage { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "夿³¨")] |
| | | public string Remark { get; set; } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_IOutboundRepository; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_OutboundRepository |
| | | { |
| | | /// <summary> |
| | | /// MESé¢æè®¡ååä»å¨å®ç°å± |
| | | /// </summary> |
| | | public class OutMESOrderRepository : RepositoryBase<Dt_OutMESOrder>, IOutMESOrderRepository |
| | | { |
| | | public OutMESOrderRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) |
| | | { |
| | | } |
| | | } |
| | | } |
| | |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | //è·åææåºåºå |
| | | List<Dt_OutBSTOrder> OldoutBSTOrders = BaseDal.Db.Queryable<Dt_OutBSTOrder>().Includes(x => x.Details).ToList(); |
| | | //æ°å¢ |
| | | List<BSTOutOrderDTO> outOrderDTOsAdd = bSTOutOrderDTOs.Where(x => x.Way == 1).ToList(); |
| | | //ä¿®æ¹ |
| | | List<BSTOutOrderDTO> outOrderDTOsUpdate = bSTOutOrderDTOs.Where(x => x.Way == 2).ToList(); |
| | | //å é¤ |
| | | List<BSTOutOrderDTO> outOrderDTOsDel = bSTOutOrderDTOs.Where(x => x.Way == 3).ToList(); |
| | | if (outOrderDTOsAdd.Count==0 && outOrderDTOsUpdate.Count==0 && outOrderDTOsDel.Count==0) |
| | | { |
| | | return content.Error($"åºåºæç¨ä¿¡æ¯ä¼ å
¥ä¸ºç©º"); |
| | | } |
| | | //è·åææåºåºå |
| | | List<Dt_OutBSTOrder> OldoutBSTOrders = BaseDal.Db.Queryable<Dt_OutBSTOrder>().Includes(x => x.Details).ToList(); |
| | | //è·åææç©æ |
| | | List<Dt_MaterielInfo> materielInfos = _basicRepository.MaterielInfoRepository.QueryData(x => x.WarehouseId == WarehouseEnum.LLDYL.ObjToInt() && x.MaterielInvOrgId == MaterielInvOrgEnum.èå.ObjToInt() && x.MaterialSourceId != 0); |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using AutoMapper; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.MaterielEnum; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_DTO.MES; |
| | | using WIDESEA_IBasicRepository; |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_IOutboundRepository; |
| | | using WIDESEA_IOutboundService; |
| | | using WIDESEA_IRecordService; |
| | | using WIDESEA_IStockService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_OutboundService |
| | | { |
| | | public class OutMESOrderService : ServiceBase<Dt_OutMESOrder, IOutMESOrderRepository>, IOutMESOrderService |
| | | { |
| | | public IOutMESOrderRepository Repository => BaseDal; |
| | | private IBasicRepository _basicRepository; |
| | | private IStockService _stockService; |
| | | private IOutStockLockInfoService _outStockLockInfoService; |
| | | private IBasicService _basicService; |
| | | private ILocationStatusChangeRecordService _locationStatusChangeRecordService; |
| | | private readonly IMapper _mapper; |
| | | |
| | | public OutMESOrderService(IOutMESOrderRepository BaseDal,IBasicRepository basicRepository, IStockService stockService, IOutStockLockInfoService outStockLockInfoService, IBasicService basicService, ILocationStatusChangeRecordService locationStatusChangeRecordService,IMapper mapper) : base(BaseDal) |
| | | { |
| | | _basicRepository = basicRepository; |
| | | _stockService = stockService; |
| | | _outStockLockInfoService = outStockLockInfoService; |
| | | _basicService = basicService; |
| | | _locationStatusChangeRecordService = locationStatusChangeRecordService; |
| | | _mapper = mapper; |
| | | } |
| | | /// <summary> |
| | | /// æ¥æ¶MESé¢æè®¡å |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public WebResponseContent ReceiveOutBound(OutMESOrderDTO outMESOrderDTO) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | if (outMESOrderDTO==null) |
| | | { |
| | | return content.Error("é¢æè®¡åä¼ å
¥ä¿¡æ¯ä¸ºç©º"); |
| | | } |
| | | if (outMESOrderDTO.OutDetailId <= 0) |
| | | { |
| | | return content.Error($"é¢æè®¡å{nameof(OutMESOrderDTO.OutDetailId)}:{outMESOrderDTO.OutDetailId}éè¦å¤§äº0"); |
| | | } |
| | | if (outMESOrderDTO.ReqQuantity <= 0) |
| | | { |
| | | return content.Error($"é¢æè®¡å{nameof(OutMESOrderDTO.ReqQuantity)}:{outMESOrderDTO.ReqQuantity}éè¦å¤§äº0"); |
| | | } |
| | | //è·åææç©æä¿¡æ¯ |
| | | List<Dt_MaterielInfo> materielInfos = _basicRepository.MaterielInfoRepository.QueryData(x=>x.MaterielInvOrgId==MaterielInvOrgEnum.æ°å.ObjToInt()); |
| | | //è·åææä¸´æè®¡å |
| | | List<Dt_OutMESOrder> outMESOrders = BaseDal.QueryData(); |
| | | Dt_MaterielInfo? ExistmaterielInfo = materielInfos.FirstOrDefault(x=>x.MaterielCode== outMESOrderDTO.MaterialCode); |
| | | if (ExistmaterielInfo == null) |
| | | { |
| | | return content.Error($"ç©æç¼ç {nameof(OutMESOrderDTO.MaterialCode)}:{outMESOrderDTO.MaterialCode}ä¿¡æ¯ä¸åå¨"); |
| | | } |
| | | Dt_OutMESOrder? OldoutMESOrder = outMESOrders.FirstOrDefault(x=>x.OutDetailId==outMESOrderDTO.OutDetailId); |
| | | if (OldoutMESOrder!=null) |
| | | { |
| | | return content.Error($"é¢æè®¡å{nameof(OutMESOrderDTO.OutDetailId)}:{outMESOrderDTO.OutDetailId}ä¿¡æ¯å·²åå¨"); |
| | | } |
| | | return content.Error($"é¢æè®¡å{nameof(OutMESOrderDTO.ProductOrderNo)}:{outMESOrderDTO.ProductOrderNo},ç©æ{outMESOrderDTO.MaterialCode}æ å¯åé
åºå"); |
| | | |
| | | Dt_OutMESOrder outMESOrder = _mapper.Map<Dt_OutMESOrder>(outMESOrderDTO); |
| | | BaseDal.AddData(outMESOrder); |
| | | return content.OK("æ¥æ¶æå"); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | } |
| | | } |
| | |
| | | throw new Exception($"{ex.Message}"); |
| | | } |
| | | } |
| | | |
| | | //è´§ä½åå¨è®°å½æ·»å |
| | | public void AddLocationStatusChangeRecord(List<Dt_LocationInfo> locationInfos, LocationStatusEnum newStatus, LocationChangeType changeType, string? orderNo = null, List<int>? taskNums = null) |
| | | { |
| | | try |
| | |
| | | List<SearchParameters> searchParametersList = options.Wheres.DeserializeObject<List<SearchParameters>>(); |
| | | if (searchParametersList.Count > 0) |
| | | { |
| | | SearchParameters? searchParameters1 = searchParametersList.FirstOrDefault(x => x.Name == nameof(Dt_ProStockInfoDetail.ProductCode).FirstLetterToLower()); |
| | | if (searchParameters1 != null) |
| | | { |
| | | SearchParameters? searchParameters = searchParametersList.FirstOrDefault(x => x.Name == nameof(Dt_ProStockInfoDetail.ProductCode).FirstLetterToLower()); |
| | | if (searchParameters != null) |
| | | { |
| | | sugarQueryable1 = sugarQueryable1.Where(x => x.proStockInfoDetails.Any(v => v.ProductCode.Contains(searchParameters.Value))); |
| | | } |
| | | sugarQueryable1 = sugarQueryable1.Where(x => x.proStockInfoDetails.Any(v => v.ProductCode.Contains(searchParameters1.Value))); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | { |
| | | ProStockAttribute=b.ProStockAttribute, |
| | | LocationCode = b.LocationCode, |
| | | Column = a.Column, |
| | | Column = a.Columns, |
| | | WarehouseId = b.WarehouseId, |
| | | CreateDate = b.CreateDate, |
| | | Creater = b.Creater, |
| | |
| | | SumStocks=b.proStockInfoDetails.Sum(x=>x.StockQty) |
| | | }); |
| | | |
| | | var pklist = sugarQueryable1.Where(b => b.LocationCode == "æåå¾
åè´§åº" || b.LocationCode == "æåå
è£
æ£è´§åº").Select(b => new ProStockViewDTO |
| | | { |
| | | ProStockAttribute = b.ProStockAttribute, |
| | | LocationCode = b.LocationCode, |
| | | WarehouseId = b.WarehouseId, |
| | | CreateDate = b.CreateDate, |
| | | Creater = b.Creater, |
| | | LocationName = b.LocationCode, |
| | | Modifier = b.Modifier, |
| | | ModifyDate = b.ModifyDate, |
| | | PalletCode = b.PalletCode, |
| | | StockRemark = b.Remark, |
| | | ProStockId = b.Id, |
| | | StockStatus = b.StockStatus, |
| | | Details = b.proStockInfoDetails, |
| | | SumStocks = b.proStockInfoDetails.Sum(x => x.StockQty) |
| | | }); |
| | | |
| | | int totalCount = 0; |
| | | int pktotalCount = 0; |
| | | |
| | | stockViewDTOs = list.ToPageList(options.Page, options.Rows, ref totalCount); |
| | | stockViewDTOs.AddRange(pklist.ToPageList(options.Page, options.Rows, ref pktotalCount)); |
| | | |
| | | stockViewDTOs.ForEach(x => |
| | | { |
| | |
| | | { |
| | | ProStockAttribute = b.ProStockAttribute, |
| | | LocationCode = b.LocationCode, |
| | | Column = a.Column, |
| | | Column = a.Columns, |
| | | WarehouseId = b.WarehouseId, |
| | | CreateDate = b.CreateDate, |
| | | Creater = b.Creater, |
| | |
| | | { |
| | | if (userRole.WarehouseIds.Count > 0) |
| | | { |
| | | return $"{nameof(BaseWarehouseEntity.WarehouseId)} in ({userRole.WarehouseIds.Serialize().Replace("[", "").Replace("]", "")})"; |
| | | return $"{nameof(BaseWarehouseEntity.WarehouseId)} in ({userRole.WarehouseIds.OrderBy(x=>x).Serialize().Replace("[", "").Replace("]", "")})"; |
| | | } |
| | | |
| | | else |
| | |
| | | using WIDESEA_DTO.Stock; |
| | | using SqlSugar; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.RefAndLookup; |
| | | using WIDESEA_DTO.MES; |
| | | |
| | | namespace WIDESEA_TaskInfoService |
| | | { |
| | | public partial class TaskService |
| | | { |
| | | static object lock_out = new object(); |
| | | /// <summary> |
| | | /// MESèªå¨å«ææ¥å£ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public WebResponseContent ReceiveAutoIssue(MESAutoIssueDTO autoIssueDTO) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | //è·å对åºåæ® |
| | | Dt_OutMESOrder? outMESOrder = _outMESOrderRepository.QueryFirst(x=>x.OutDetailId==autoIssueDTO.OutDetailId); |
| | | if (outMESOrder==null) |
| | | { |
| | | return content.Error($"é¢æè®¡å{nameof(MESAutoIssueDTO.OutDetailId)}{autoIssueDTO.OutDetailId}ä¸åå¨"); |
| | | } |
| | | //è·åå¨è½¬ä½ç½®ç¼å· |
| | | Dt_AGVStationInfo? stationInfo = _agvStationInfoRepository.QueryFirst(x=>x.MESPointCode==autoIssueDTO.PointCode); |
| | | if (stationInfo == null) |
| | | { |
| | | return content.Error($"é¢æè®¡åå¨è½¬ä½{nameof(MESAutoIssueDTO.PointCode)}{autoIssueDTO.PointCode}ä¸åå¨"); |
| | | } |
| | | if (autoIssueDTO.IsEmptyPallet>0) |
| | | { |
| | | return content.Error($"é¢æè®¡åå¨è½¬ä½{nameof(MESAutoIssueDTO.PointCode)}{autoIssueDTO.PointCode}åå¨ç©ºæ"); |
| | | } |
| | | Dt_Task? task = BaseDal.QueryData(x => x.OrderNo == outMESOrder.OutMESOrderNo && x.TaskStatus==TaskStatusEnum.CallPending.ObjToInt()).OrderByDescending(x=>x.Grade).ThenBy(x=>x.TaskNum).FirstOrDefault(); |
| | | //è·åä»»å¡ |
| | | if (task==null) |
| | | { |
| | | return content.Error($"æªæ¾å°é¢æè®¡åç¼å·{outMESOrder.ProductOrderNo}å¯é
éä»»å¡"); |
| | | } |
| | | task.TaskStatus = TaskStatusEnum.New.ObjToInt(); |
| | | task.TargetAddress= stationInfo.AGVStationCode; |
| | | PushTasksToWCS(new List<Dt_Task> { task }); |
| | | return content.OK("嫿æå"); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | } |
| | | } |
| | |
| | | private readonly IOutBSTOrderDetailRepository _outBSTOrderDetailRepository; |
| | | private readonly IOutBSTOrderRepository _outBSTOrderRepository; |
| | | private readonly IOutBSTOrderDetailService _outBSTOrderDetailService; |
| | | private readonly IOutMESOrderService _outMESOrderService; |
| | | private readonly IOutMESOrderRepository _outMESOrderRepository; |
| | | public ITaskRepository Repository => BaseDal; |
| | | |
| | | private Dictionary<string, OrderByType> _taskOrderBy = new() |
| | |
| | | |
| | | public List<int> TaskOutboundTypes => typeof(TaskTypeEnum).GetEnumIndexList().Where(x => x >= 100 && x < 500).ToList(); |
| | | |
| | | public TaskService(ITaskRepository BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IStockRepository stockRepository, IBasicService basicService, IRecordService recordService, IStockService stockService, IBasicRepository basicRepository, IApiInfoRepository apiInfoRepository, IInvokeERPService invokeERPService, IPalletTypeInfoRepository palletTypeInfoRepository, IAGVStationInfoRepository agvStationInfoRepository, IPurchaseBSTOrderRepository purchaseBSTOrderRepository, IPurchaseBSTOrderDetailRepository purchaseBSTOrderDetailRepository, IOutBSTOrderDetailRepository outBSTOrderDetailRepository, IOutBSTOrderRepository outBSTOrderRepository,IOutBSTOrderDetailService outBSTOrderDetailService) : base(BaseDal) |
| | | public TaskService(ITaskRepository BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IStockRepository stockRepository, IBasicService basicService, IRecordService recordService, IStockService stockService, IBasicRepository basicRepository, IApiInfoRepository apiInfoRepository, IInvokeERPService invokeERPService, IPalletTypeInfoRepository palletTypeInfoRepository, IAGVStationInfoRepository agvStationInfoRepository, IPurchaseBSTOrderRepository purchaseBSTOrderRepository, IPurchaseBSTOrderDetailRepository purchaseBSTOrderDetailRepository, IOutBSTOrderDetailRepository outBSTOrderDetailRepository, IOutBSTOrderRepository outBSTOrderRepository,IOutBSTOrderDetailService outBSTOrderDetailService, IOutMESOrderService outMESOrderService, IOutMESOrderRepository outMESOrderRepository) : base(BaseDal) |
| | | { |
| | | _mapper = mapper; |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | |
| | | _agvStationInfoRepository = agvStationInfoRepository; |
| | | _purchaseBSTOrderRepository = purchaseBSTOrderRepository; |
| | | _purchaseBSTOrderDetailRepository = purchaseBSTOrderDetailRepository; |
| | | _outBSTOrderRepository= outBSTOrderRepository; |
| | | _outBSTOrderDetailRepository= outBSTOrderDetailRepository; |
| | | _outBSTOrderDetailService= outBSTOrderDetailService; |
| | | _outBSTOrderRepository = outBSTOrderRepository; |
| | | _outBSTOrderDetailRepository = outBSTOrderDetailRepository; |
| | | _outBSTOrderDetailService = outBSTOrderDetailService; |
| | | _outMESOrderService = outMESOrderService; |
| | | _outMESOrderRepository = outMESOrderRepository; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | return content.Error($"æªæ¾å°ç»çä¿¡æ¯"); |
| | | } |
| | | if (stockInfo.StockStatus != StockStatusEmun.æå¨ç»çæå.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.ç»çæå.ObjToInt()) |
| | | if (stockInfo.StockStatus != StockStatusEmun.æå¨ç»çæå.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.ç»çæå.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.èåéåº.ObjToInt()) |
| | | { |
| | | return content.Error($"该æçç¶æä¸æ£ç¡®,ä¸å¯ç³è¯·å
¥åº"); |
| | | } |
| | | //åé
å··é |
| | | string rowWay = AssignYLRoadwayNo(stockInfo.PalletCode); |
| | | if (string.IsNullOrEmpty(rowWay)) |
| | | { |
| | |
| | | Roadway = rowWay, |
| | | SourceAddress = stationCode, |
| | | TargetAddress = "", |
| | | TaskType = TaskTypeEnum.Inbound.ObjToInt(), |
| | | TaskType = stationCode=="307" ? TaskTypeEnum.PaperOldYLBackInbound.ObjToInt() : TaskTypeEnum.Inbound.ObjToInt(), |
| | | TaskStatus = TaskStatusEnum.New.ObjToInt(), |
| | | WarehouseId = stockInfo.WarehouseId, |
| | | PalletType = stockInfo.PalletType, |
| | | TaskLength = (int)stockInfo.MaterielWide |
| | | }; |
| | | |
| | | //æ´æ°ç¶æ |
| | | if (stockInfo.StockStatus == StockStatusEmun.æå¨ç»çæå.ObjToInt()) |
| | | { |
| | | stockInfo.StockStatus = StockStatusEmun.æå¨ç»çå
¥åºç¡®è®¤.ObjToInt(); |
| | |
| | | { |
| | | stockInfo.StockStatus = StockStatusEmun.å
¥åºç¡®è®¤.ObjToInt(); |
| | | } |
| | | //æ°æ®æ´æ° |
| | | _unitOfWorkManage.BeginTran(); |
| | | int taskId = BaseDal.AddData(newTask); |
| | | newTask.TaskId = taskId; |
| | |
| | | { |
| | | return content.OK($"æ°å临æ¶å
¥åº{stockInfoOld.PalletCode}"); |
| | | } |
| | | else if (stockInfoOld != null && stockInfoOld.MaterielInvOrgId==MaterielInvOrgEnum.èå.ObjToInt() && stockInfoOld.StockStatus == StockStatusEmun.èåéåº.ObjToInt()) |
| | | { |
| | | return content.OK($"èå临æ¶éåº{stockInfoOld.PalletCode}"); |
| | | } |
| | | else if (stockInfoOld != null) |
| | | { |
| | | return content.Error($"æ¡ç {stockInfoOld.PalletCode}ä¿¡æ¯å·²åå¨"); |
| | | } |
| | | |
| | | //è·åéè´ä¿¡æ¯ |
| | | Dt_PurchaseBSTOrderDetail purchaseBSTOrderDetail = _purchaseBSTOrderDetailRepository.QueryFirst(x=>x.Barcode== palletCode); |
| | | if (purchaseBSTOrderDetail == null) |
| | |
| | | if (stockInfo.MaterielInvOrgId==MaterielInvOrgEnum.æ°å.ObjToInt()) |
| | | { |
| | | //éå¶ç´å¾ |
| | | if (stockInfo.MaterielThickness <= 1250) |
| | | if (stockInfo.MaterielThickness >= 300 && stockInfo.MaterielThickness <= 1300 && stockInfo.MaterielWide >= 700 && stockInfo.MaterielWide <= 2700) |
| | | { |
| | | bool LayerLimit = false; |
| | | if (stockInfo.MaterielThickness >= 800) |
| | | { |
| | | LayerLimit = true; |
| | | } |
| | | //è·ååé
|
| | | List<LocationCount> locationCounts = Db.Queryable<Dt_LocationInfo>().Where(x => x.WarehouseId == warehouse.WarehouseId && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && x.RoadwayNo.Contains("YLDual")).GroupBy(x => x.RoadwayNo).Select(x => new LocationCount { RoadwayNo = x.RoadwayNo, Count = SqlFunc.AggregateCount(x) }).ToList(); |
| | | |
| | |
| | | } |
| | | else |
| | | { |
| | | //éå¶ç´å¾ |
| | | if (stockInfo.MaterielThickness >= 800 && stockInfo.MaterielThickness <= 1450) |
| | | //éå¶ |
| | | if (stockInfo.MaterielThickness >= 800 && stockInfo.MaterielThickness <= 1500 && stockInfo.MaterielWide >= 700 && stockInfo.MaterielWide <= 2500) |
| | | { |
| | | bool LayerLimit = false; |
| | | if (stockInfo.MaterielThickness>1300) |
| | | { |
| | | LayerLimit = true; |
| | | } |
| | | //è·ååé
|
| | | List<LocationCount> locationCounts = Db.Queryable<Dt_LocationInfo>().Where(x => x.WarehouseId == warehouse.WarehouseId && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && x.RoadwayNo.Contains("YL") && !x.RoadwayNo.Contains("YLDual")).GroupBy(x => x.RoadwayNo).Select(x => new LocationCount { RoadwayNo = x.RoadwayNo, Count = SqlFunc.AggregateCount(x) }).ToList(); |
| | | List<LocationCount> locationCounts = Db.Queryable<Dt_LocationInfo>().Where(x => x.WarehouseId == warehouse.WarehouseId && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && x.RoadwayNo.Contains("YL") && !x.RoadwayNo.Contains("YLDual") && (LayerLimit ? x.Columns>=56 : x.Columns<=55)).GroupBy(x => x.RoadwayNo).Select(x => new LocationCount { RoadwayNo = x.RoadwayNo, Count = SqlFunc.AggregateCount(x) }).ToList(); |
| | | if (stockInfo.MaterielWide > 2200) |
| | | { |
| | | locationCounts = Db.Queryable<Dt_LocationInfo>().Where(x => x.WarehouseId == warehouse.WarehouseId && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && x.RoadwayNo == "SC02_YL").GroupBy(x => x.RoadwayNo).Select(x => new LocationCount { RoadwayNo = x.RoadwayNo, Count = SqlFunc.AggregateCount(x) }).ToList(); |
| | | locationCounts = Db.Queryable<Dt_LocationInfo>().Where(x => x.WarehouseId == warehouse.WarehouseId && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && x.RoadwayNo == "SC02_YL" && (LayerLimit ? x.Columns >= 56 : x.Columns <= 55)).GroupBy(x => x.RoadwayNo).Select(x => new LocationCount { RoadwayNo = x.RoadwayNo, Count = SqlFunc.AggregateCount(x) }).ToList(); |
| | | } |
| | | |
| | | roadwayNo = HandleRoadway(locationCounts, warehouse); |
| | |
| | | item.Count -= count.Count; |
| | | } |
| | | } |
| | | return locationCounts.OrderByDescending(x => x.Count).FirstOrDefault()?.RoadwayNo ?? ""; |
| | | return locationCounts.Where(x => x.Count > 0).OrderByDescending(x => x.Count).FirstOrDefault()?.RoadwayNo ?? ""; |
| | | } |
| | | /// <summary> |
| | | /// å
¥åºå®æ |
| | |
| | | List<LocationCount> locationCounts = Db.Queryable<Dt_LocationInfo>().Where(x => x.WarehouseId == WarehouseEnum.LLDCP.ObjToInt() && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && x.RoadwayNo.Contains("CP")).GroupBy(x => x.RoadwayNo).Select(x => new LocationCount { RoadwayNo = x.RoadwayNo, Count = SqlFunc.AggregateCount(x) }).ToList(); |
| | | //çéå½åå
¥åºä»»å¡ä¸å·²åé
å··é任塿°é |
| | | List<LocationCount> useLocationCounts = Db.Queryable<Dt_Task>().Where(x => (x.WarehouseId == WarehouseEnum.LLDCP.ObjToInt()|| x.WarehouseId == WarehouseEnum.LLDFL.ObjToInt()) |
| | | && locationCounts.Select(j=>j.RoadwayNo).Contains(x.Roadway) |
| | | && locationCounts.Select(j=>j.RoadwayNo).Distinct().Contains(x.Roadway) |
| | | && TaskInboundTypes.Contains(x.TaskType)).GroupBy(x => x.Roadway).Select(x => new LocationCount { RoadwayNo = x.Roadway, Count = SqlFunc.AggregateCount(x) }).ToList(); |
| | | foreach (var item in locationCounts) |
| | | { |
| | |
| | | } |
| | | } |
| | | //éè¿å¯ç¨è´§ä½æ°éæåºï¼æå¤çä¼å
åé
|
| | | roadwayNo = locationCounts.OrderByDescending(x => x.Count).FirstOrDefault()?.RoadwayNo ?? ""; |
| | | roadwayNo = locationCounts.Where(x=>x.Count>0).OrderByDescending(x => x.Count).FirstOrDefault()?.RoadwayNo ?? ""; |
| | | return !string.IsNullOrEmpty(roadwayNo) ? (roadwayNo) : throw new Exception("æªæ¾å°å¯åé
å··é"); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent Outbound(int id) |
| | | public WebResponseContent Outbound(List<int> ids) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | Dt_StockInfo stockInfo = _stockRepository.StockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.Id == id).First(); |
| | | if (stockInfo == null) |
| | | //è·åéå®åºå |
| | | List<Dt_StockInfo> stockInfos = _stockRepository.StockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => ids.Contains(x.Id) && x.StockStatus == StockStatusEmun.å
¥åºå®æ.ObjToInt() && x.MaterielInvOrgId == MaterielInvOrgEnum.èå.ObjToInt()).ToList(); |
| | | if (stockInfos == null || stockInfos.Count != ids.Count) |
| | | { |
| | | return content.Error($"æªæ¾å°åºå"); |
| | | } |
| | | Dt_LocationInfo locationInfo = _basicRepository.LocationInfoRepository.QueryFirst(x => x.LocationCode == stockInfo.LocationCode); |
| | | if (locationInfo != null && (locationInfo.EnableStatus == EnableStatusEnum.OnlyOut.ObjToInt() || locationInfo.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && locationInfo.LocationStatus == LocationStatusEnum.InStock.ObjToInt() && stockInfo.StockStatus == StockStatusEmun.å
¥åºå®æ.ObjToInt()) |
| | | //è·ååºåè´§ä½ |
| | | List<Dt_LocationInfo> locationInfos = _basicRepository.LocationInfoRepository.QueryData(x =>x.WarehouseId == WarehouseEnum.LLDYL.ObjToInt() && stockInfos.Select(x=>x.LocationCode).Contains(x.LocationCode) && x.LocationStatus == LocationStatusEnum.InStock.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyOut.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt())); |
| | | if (locationInfos == null || locationInfos.Count != stockInfos.Count) |
| | | { |
| | | List<Dt_Task> tasks = GetTasks(new List<Dt_StockInfo>() { stockInfo }, TaskTypeEnum.Outbound); |
| | | if (tasks == null || tasks.Count <= 0) |
| | | { |
| | | return content.Error($"çæä»»å¡å¤±è´¥"); |
| | | } |
| | | //å¤çåºåæ°æ® |
| | | stockInfo.StockStatus = (int)StockStatusEmun.åºåºéå®; |
| | | LocationStatusEnum locationStatus = (LocationStatusEnum)locationInfo.LocationStatus; |
| | | locationInfo.LocationStatus = (int)LocationStatusEnum.Lock; |
| | | //夿æ¯å¦æåºåºåä¿¡æ¯ |
| | | _unitOfWorkManage.BeginTran(); |
| | | //æ´æ°åºåç¶æ |
| | | _stockRepository.StockInfoRepository.UpdateData(stockInfo); |
| | | //æ´æ°è´§ä½ç¶æ |
| | | _basicService.LocationInfoService.UpdateLocationStatus(locationInfo, stockInfo.PalletType, LocationStatusEnum.Lock, stockInfo.WarehouseId); |
| | | //æ°å»ºä»»å¡ |
| | | BaseDal.AddData(tasks); |
| | | //å å
¥è´§ä½åå¨è®°å½ |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, locationStatus, LocationStatusEnum.Lock, LocationChangeType.OutboundAssignLocation, stockInfo.OrderNo ?? "", tasks[0].TaskNum); |
| | | _unitOfWorkManage.CommitTran(); |
| | | PushTasksToWCS(tasks); |
| | | content.OK(); |
| | | return content.Error($"è´§ä½åºåºæ¡ä»¶ä¸æ»¡è¶³"); |
| | | } |
| | | else |
| | | //ä»»å¡çæ |
| | | List<Dt_Task> tasks = GetTasks(stockInfos, TaskTypeEnum.OldYLOutbound); |
| | | if (tasks == null || tasks.Count <= 0) |
| | | { |
| | | content.Error($"è´§ä½åºåºæ¡ä»¶ä¸æ»¡è¶³"); |
| | | return content.Error($"çæä»»å¡å¤±è´¥"); |
| | | } |
| | | stockInfos.ForEach(x => |
| | | { |
| | | x.StockStatus = StockStatusEmun.åºåºéå®.ObjToInt(); |
| | | }); |
| | | _unitOfWorkManage.BeginTran(); |
| | | //æ´æ°åºåç¶æ |
| | | _stockRepository.StockInfoRepository.UpdateData(stockInfos); |
| | | //æ´æ°è´§ä½ç¶æ |
| | | _basicRepository.LocationInfoRepository.UpdateLocationStatus(locationInfos, LocationStatusEnum.Lock); |
| | | //å å
¥è´§ä½åå¨è®°å½ |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfos, LocationStatusEnum.Lock, LocationChangeType.OutboundAssignLocation, taskNums: tasks.Select(x => x.TaskNum).ToList()); |
| | | //æ°å»ºä»»å¡ |
| | | BaseDal.AddData(tasks); |
| | | _unitOfWorkManage.CommitTran(); |
| | | PushTasksToWCS(tasks); |
| | | content.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// åºåæ°æ®è½¬åºåºä»»å¡ |
| | | /// åºåæ°æ®è½¬åºåºä»»å¡(åæ/åæå) |
| | | /// </summary> |
| | | /// <param name="stockInfos"></param> |
| | | /// <returns></returns> |
| | |
| | | } |
| | | return tasks; |
| | | } |
| | | /// <summary> |
| | | /// åºåæ°æ®è½¬åºåºä»»å¡(è¾
æ/æå) |
| | | /// </summary> |
| | | public List<Dt_Task> GetTasks(List<Dt_ProStockInfo> stockInfos, TaskTypeEnum taskType,List<Dt_LocationInfo> locationInfos) |
| | | { |
| | | List<Dt_Task> tasks = new List<Dt_Task>(); |
| | |
| | | .Where(x => x.proStockInfoDetails |
| | | .Any(v => |
| | | v.ProductCode == materialCode) |
| | | ).ToList(); |
| | | ).Take(Count).ToList(); |
| | | |
| | | if (stockInfos.Count!=Count) |
| | | { |
| | |
| | | |
| | | List<Dt_LocationInfo> littleDepthLocations = _basicService.LocationInfoService.GetGroupLocations(locationInfo); |
| | | |
| | | Dt_LocationInfo? needRelocationItem = littleDepthLocations.Where(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && x.LocationStatus != LocationStatusEnum.PalletLock.ObjToInt() && x.LocationStatus != LocationStatusEnum.FreeLock.ObjToInt() && x.Depth < locationInfo.Depth).OrderBy(x => x.Depth).FirstOrDefault(); |
| | | Dt_LocationInfo? needRelocationItem = littleDepthLocations.Where(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && x.LocationStatus != LocationStatusEnum.FreeLock.ObjToInt() && x.Depth < locationInfo.Depth).OrderBy(x => x.Depth).FirstOrDefault(); |
| | | |
| | | if (needRelocationItem == null) |
| | | { |
| | |
| | | //å |
| | | row = data_col.Row, |
| | | layer = data_col.Layer, |
| | | index = data_col.Column, |
| | | index = data_col.Columns, |
| | | locationCode = data_col.LocationCode, |
| | | location_state = data_col.LocationStatus, |
| | | location_lock = data_col.EnableStatus, |
| | |
| | | using WIDESEA_Core.Helper; |
| | | using Autofac.Core; |
| | | using WIDESEA_DTO.Stock; |
| | | using WIDESEA_BasicService; |
| | | using WIDESEA_DTO.Basic; |
| | | using WIDESEA_DTO.MES; |
| | | using WIDESEA_IOutboundService; |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers.MES |
| | | { |
| | |
| | | public class MesController : ControllerBase |
| | | { |
| | | private readonly ITaskService _taskService; |
| | | private readonly IOutMESOrderService _outMESOrderService; |
| | | |
| | | public MesController(ITaskService taskService) |
| | | public MesController(ITaskService taskService,IOutMESOrderService outMESOrderService) |
| | | { |
| | | _taskService = taskService; |
| | | _outMESOrderService = outMESOrderService; |
| | | } |
| | | /// <summary> |
| | | /// æ¥æ¶MESé¢æè®¡å |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("ReceiveOutBound"), AllowAnonymous] |
| | | |
| | | public WebResponseContent ReceiveOutBound([FromBody] OutMESOrderDTO outMESOrderDTO) |
| | | { |
| | | return _outMESOrderService.ReceiveOutBound(outMESOrderDTO); |
| | | } |
| | | /// <summary> |
| | | /// MESèªå¨å«ææ¥å£ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | /// <summary> |
| | | [HttpPost, HttpGet, Route("ReceiveAutoIssue"), AllowAnonymous] |
| | | public WebResponseContent ReceiveAutoIssue([FromBody] MESAutoIssueDTO autoIssueDTO) |
| | | { |
| | | return _taskService.ReceiveAutoIssue(autoIssueDTO); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// MESæå¨å«ææ¥å£ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | /// <summary> |
| | | [HttpPost, HttpGet, Route("ReceiveManualIssue"), AllowAnonymous] |
| | | public WebResponseContent ReceiveManualIssue([FromBody] MESAutoIssueDTO autoIssueDTO) |
| | | { |
| | | return _taskService.ReceiveAutoIssue(autoIssueDTO); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// MES空æ/使å¼å«æ¥å£ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | /// <summary> |
| | | [HttpPost, HttpGet, Route("ReceiveReturnIssue"), AllowAnonymous] |
| | | public WebResponseContent ReceiveReturnIssue([FromBody] MESAutoIssueDTO autoIssueDTO) |
| | | { |
| | | return _taskService.ReceiveAutoIssue(autoIssueDTO); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æå/åæåä¿¡æ¯åæ¥æ¥å£ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | /// <summary> |
| | | [HttpPost, HttpGet, Route("ReceiveProCodeInfo"), AllowAnonymous] |
| | | public WebResponseContent ReceiveProCodeInfo([FromBody] MESAutoIssueDTO autoIssueDTO) |
| | | { |
| | | return _taskService.ReceiveAutoIssue(autoIssueDTO); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// MESå·¥å忢æ¥å£ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | /// <summary> |
| | | [HttpPost, HttpGet, Route("ReceiveProOrderStop"), AllowAnonymous] |
| | | public WebResponseContent ReceiveProOrderStop([FromBody] MESAutoIssueDTO autoIssueDTO) |
| | | { |
| | | return _taskService.ReceiveAutoIssue(autoIssueDTO); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_IOutboundService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers.Outbound |
| | | { |
| | | /// <summary> |
| | | /// MESé¢æè®¡åå |
| | | /// </summary> |
| | | [Route("api/OutMESOrder")] |
| | | [ApiController] |
| | | public class OutMESOrderController : ApiBaseController<IOutMESOrderService, Dt_OutMESOrder> |
| | | { |
| | | public OutMESOrderController(IOutMESOrderService service) : base(service) |
| | | { |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | return Service.AssignInboundTaskLocation(taskNum, roadwayNo); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// æå空æ¡ååº |
| | | /// </summary> |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// éæ©åºåçæåºåºä»»å¡ |
| | | /// éæ©åºåçæèååºåºä»»å¡ |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("Outbound"), AllowAnonymous] |
| | | public WebResponseContent Outbound(int id) |
| | | [HttpPost, Route("OldYLOutbound"), AllowAnonymous] |
| | | public WebResponseContent Outbound([FromBody] List<int> ids) |
| | | { |
| | | return Service.Outbound(id); |
| | | return Service.Outbound(ids); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <summary> |
| | | /// åæç§»åºä»»å¡ |
| | | /// </summary> |
| | | /// <param name="startAddress"></param> |
| | | /// <param name="endAddress"></param> |
| | | /// <param name="roadWay"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("Relocation"), AllowAnonymous] |
| | | public WebResponseContent IsRelocation(string startAddress, string endAddress, string roadWay) |
| | |
| | | using WIDESEA_DTO.Basic; |
| | | using WIDESEA_DTO.ERP; |
| | | using WIDESEA_DTO.Inbound; |
| | | using WIDESEA_DTO.MES; |
| | | using WIDESEA_DTO.System; |
| | | using WIDESEA_DTO.Task; |
| | | using WIDESEA_Model.Models; |
| | |
| | | //BSTéæåå®ä½è½¬æ¢ |
| | | CreateMap<BSTReturnOrderDTO, Dt_ReturnBSTOrder>().ForMember(x => x.ReturnOrderStatus, b => b.MapFrom(b => InOrderStatusEnum.æªå¼å§.ObjToInt())).ForMember(x => x.WreturnDate, b => b.MapFrom(b => DateTimeOffset.FromUnixTimeMilliseconds(b.WreturnDate).DateTime)).ForMember(x => x.WarehouseId, b => b.MapFrom(b => WarehouseEnum.LLDYL.ObjToInt())); |
| | | CreateMap<BSTReturnOrderDTOItem, Dt_ReturnBSTOrderDetail>().ForMember(x => x.ReturnBSTOrderDetailStatus, b => b.MapFrom(b => OutOrderStatusEnum.æªå¼å§.ObjToInt())).ForMember(x => x.MaterialWide, b => b.MapFrom(b => b.W)).ForMember(x => x.MaterialThick, b => b.MapFrom(b => b.Thick)); |
| | | //MESé¢æè®¡åå®ä½è½¬æ¢ |
| | | CreateMap<OutMESOrderDTO, Dt_OutMESOrder>().ForMember(x => x.OutMESOrderStatus, b => b.MapFrom(b => OutOrderStatusEnum.æªå¼å§.ObjToInt())); |
| | | } |
| | | } |
| | | } |