已删除13个文件
已修改21个文件
已添加17个文件
已重命名1个文件
| | |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <PackageReference Include="WIDESEAWCS_QuartzJob" Version="3.0.1" /> |
| | | <PackageReference Include="WIDESEAWCS_QuartzJob" Version="3.0.3" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | |
| | | |
| | | namespace WIDESEAWCS_Common.Helper |
| | | { |
| | | public class ConvertHelper |
| | | public static class ConvertHelper |
| | | { |
| | | public static bool[] ByteToBoolArray(byte data) |
| | | public static bool[] ByteToBoolArray(this byte data) |
| | | { |
| | | bool[] result = new bool[8]; |
| | | for (int i = 0; i < 8; i++) |
| | |
| | | return result; |
| | | } |
| | | |
| | | public static T ByteToBoolObject<T>(byte data) |
| | | public static T ByteToBoolObject<T>(this byte data) |
| | | { |
| | | bool[] boolArray = ByteToBoolArray(data); |
| | | |
| | | Array.Reverse(boolArray); |
| | | |
| | | Type type = typeof(T); |
| | | object? obj = Activator.CreateInstance(type); |
| | | if (obj == null) |
| | |
| | | } |
| | | |
| | | task.NextAddress = stationManger?.AGVStationCode ?? ""; |
| | | task.DeviceCode = "AGV_CSJ"; |
| | | task.DeviceCode = stationManger?.Remark ?? ""; |
| | | task.TaskState = TaskStatusEnum.AGV_Execute.ObjToInt(); |
| | | } |
| | | } |
| | |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <PackageReference Include="WIDESEAWCS_QuartzJob" Version="3.0.1" /> |
| | | <PackageReference Include="WIDESEAWCS_QuartzJob" Version="3.0.3" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Quartz; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEAWCS_Common; |
| | | using WIDESEAWCS_Common.Helper; |
| | | 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_Tasks.ConveyorLineJob; |
| | | |
| | | namespace WIDESEAWCS_Tasks |
| | | { |
| | | [DisallowConcurrentExecution] |
| | | public class ConveyorLineJob_GM : JobBase, IJob |
| | | { |
| | | |
| | | private readonly ITaskService _taskService; |
| | | private readonly ITaskExecuteDetailService _taskExecuteDetailService; |
| | | private readonly ITaskRepository _taskRepository; |
| | | private readonly IStationMangerRepository _stationMangerRepository; |
| | | |
| | | public ConveyorLineJob_GM(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IStationMangerRepository stationMangerRepository) |
| | | { |
| | | _taskService = taskService; |
| | | _taskExecuteDetailService = taskExecuteDetailService; |
| | | _taskRepository = taskRepository; |
| | | _stationMangerRepository = stationMangerRepository; |
| | | } |
| | | |
| | | 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))) |
| | | { |
| | | if (item.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt()) |
| | | { |
| | | DeviceProDTO? devicePro = device.DeviceProDTOs.Where(x => x.DeviceChildCode == item.StationCode).OrderBy(x => x.DeviceProOffset).FirstOrDefault(); |
| | | if (devicePro != null) |
| | | { |
| | | R_ConveyorLineInfo conveyorLineInfo = device.Communicator.ReadCustomer<R_ConveyorLineInfo>(devicePro.DeviceProAddress); |
| | | |
| | | R_ConveyorLineStatus conveyorLineStatus = conveyorLineInfo.Status.ByteToBoolObject<R_ConveyorLineStatus>(); |
| | | |
| | | bool stb = device.GetValue<R_ConveyorLineDBName, bool>(R_ConveyorLineDBName.STB); |
| | | } |
| | | else |
| | | { |
| | | WriteInfo(device.DeviceName, $"æªæ¾å°è®¾å¤åç¼å·{item.StationCode}çå议信æ¯"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | return Task.CompletedTask; |
| | | } |
| | | } |
| | | } |
| | |
| | | using System.Threading.Tasks; |
| | | using WIDESEAWCS_Common.TaskEnum; |
| | | using WIDESEAWCS_Core.Enums; |
| | | using WIDESEAWCS_Core.Helper; |
| | | using WIDESEAWCS_IBasicInfoRepository; |
| | | using WIDESEAWCS_ITaskInfoRepository; |
| | | using WIDESEAWCS_ITaskInfoService; |
| | |
| | | |
| | | public Task Execute(IJobExecutionContext context) |
| | | { |
| | | CommonStackerCrane commonStackerCrane = (CommonStackerCrane)context.JobDetail.JobDataMap.Get("JobParams"); |
| | | try |
| | | { |
| | | CommonStackerCrane commonStackerCrane = (CommonStackerCrane)context.JobDetail.JobDataMap.Get("JobParams"); |
| | | if (commonStackerCrane != null) |
| | | { |
| | | if (!commonStackerCrane.IsEventSubscribed) |
| | | { |
| | | commonStackerCrane.StackerCraneTaskCompletedEventHandler += CommonStackerCrane_StackerCraneTaskCompletedEventHandler;//订é
ä»»å¡å®æäºä»¶ |
| | | } |
| | | |
| | | if (commonStackerCrane.StackerCraneAutoStatusValue == StackerCraneAutoStatus.Automatic && commonStackerCrane.StackerCraneStatusValue == StackerCraneStatus.Normal) |
| | | { |
| | | commonStackerCrane.CheckStackerCraneTaskCompleted();//鲿¢ä»»å¡å®æäºä»¶çæµè¶
æ¶ï¼åæå¨è§¦å䏿¬¡ |
| | | |
| | | if (commonStackerCrane.StackerCraneWorkStatusValue == StackerCraneWorkStatus.Standby) |
| | | if (commonStackerCrane.StackerCraneAutoStatusValue == StackerCraneAutoStatus.Automatic && commonStackerCrane.StackerCraneStatusValue == StackerCraneStatus.Normal && commonStackerCrane.StackerCraneWorkStatusValue == StackerCraneWorkStatus.Standby) |
| | | { |
| | | Dt_Task? task = GetTask(commonStackerCrane); |
| | | if (task != null) |
| | |
| | | if (sendFlag) |
| | | { |
| | | commonStackerCrane.LastTaskType = task.TaskType; |
| | | // _taskService.UpdateTaskStatusToNext(task.TaskNum); |
| | | } |
| | | int oldState = task.TaskState; |
| | | task.TaskState = TaskStatusEnum.SC_Executing.ObjToInt(); |
| | | task.ExceptionMessage = ""; |
| | | task.Dispatchertime = DateTime.Now; |
| | | _taskRepository.UpdateData(task); |
| | | _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"ç³»ç»èªå¨æµç¨ï¼ä»»å¡ç¶æä»ã{oldState}ã转å°ã{task.TaskState}ã"); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | WriteError(nameof(CommonStackerCraneJob), ex.Message, ex); |
| | | WriteError(commonStackerCrane.DeviceName, ex.Message, ex); |
| | | } |
| | | return Task.CompletedTask; |
| | | } |
| | |
| | | private void CommonStackerCrane_StackerCraneTaskCompletedEventHandler(object? sender, WIDESEAWCS_QuartzJob.StackerCrane.StackerCraneTaskCompletedEventArgs e) |
| | | { |
| | | CommonStackerCrane? commonStackerCrane = sender as CommonStackerCrane; |
| | | try |
| | | { |
| | | if (commonStackerCrane != null) |
| | | { |
| | | if (commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType) != 5) |
| | | { |
| | | Console.Out.WriteLine("TaskCompleted" + e.TaskNum); |
| | | // _taskService.StackCraneTaskCompleted(e.TaskNum); |
| | | WriteInfo(commonStackerCrane.DeviceName, $"读åå°ä»»å¡å®æä¿¡å·,{e.TaskNum}"); |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == e.TaskNum); |
| | | if (task != null) |
| | | { |
| | | _taskService.TaskCompleted(e.TaskNum); |
| | | } |
| | | else |
| | | { |
| | | WriteInfo(commonStackerCrane.DeviceName, $"读åå°ä»»å¡å®æä¿¡å·,æªæ¾å°å¯¹åºçä»»å¡ä¿¡æ¯,{e.TaskNum}"); |
| | | } |
| | | commonStackerCrane.SetValue(StackerCraneDBName.WorkType, 5); |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | WriteError(commonStackerCrane?.DeviceCode ?? nameof(StackerCraneJob_YM), ex.Message, ex); |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | OtherDevice client = (OtherDevice)device; |
| | | if (client.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanPut, stationManger.StationCode))//åºåºç«å°æªè¢«å ç¨ |
| | | { |
| | | task.TargetAddress = stationManger.StackerCraneStationCode; |
| | | task.NextAddress = stationManger.StackerCraneStationCode; |
| | | _taskRepository.UpdateData(task); |
| | | return task; |
| | | } |
| | |
| | | stackerCraneTaskCommand.TrayType = 1; |
| | | if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)//夿æ¯å¦æ¯å
¥åºä»»å¡ |
| | | { |
| | | //List<Dt_Router> routers = _routerService.QueryNextRoutes(task.CurrentAddress, task.Roadway); |
| | | //if (routers.Count > 0) |
| | | //{ |
| | | string[] startCodes = task.CurrentAddress.Split("-"); |
| | | |
| | | if (startCodes.Length == 3) |
| | | { |
| | | stackerCraneTaskCommand.StartRow = Convert.ToInt16(startCodes[0]); |
| | | stackerCraneTaskCommand.StartColumn = Convert.ToInt16(startCodes[1]); |
| | | stackerCraneTaskCommand.StartLayer = Convert.ToInt16(startCodes[2]); |
| | | } |
| | | else |
| | | { |
| | | _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"å
¥åºä»»å¡èµ·ç¹é误ï¼èµ·ç¹ï¼ã{task.CurrentAddress}ã"); |
| | | WriteInfo(task.DeviceCode, $"å
¥åºä»»å¡èµ·ç¹é误ï¼èµ·ç¹ï¼ã{task.CurrentAddress}ã"); |
| | | return null; |
| | | } |
| | | |
| | | string[] targetCodes = task.NextAddress.Split("-"); |
| | | if (targetCodes.Length == 5) |
| | | { |
| | | stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[1]); |
| | | stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[2]); |
| | | stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[3]); |
| | | } |
| | | else |
| | | { |
| | | //æ°æ®é
ç½®é误 |
| | | _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"å
¥åºä»»å¡ç»ç¹é误ï¼ç»ç¹ï¼ã{task.NextAddress}ã"); |
| | | WriteInfo(task.DeviceCode, $"å
¥åºä»»å¡ç»ç¹é误ï¼ç»ç¹ï¼ã{task.NextAddress}ã"); |
| | | return null; |
| | | } |
| | | } |
| | | else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) |
| | | { |
| | | string[] targetCodes = task.NextAddress.Split("-"); |
| | | |
| | | if (targetCodes.Length == 3) |
| | | { |
| | | stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[0]); |
| | |
| | | else |
| | | { |
| | | //æ°æ®é
ç½®é误 |
| | | _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"å
¥åºä»»å¡ç»ç¹é误ï¼èµ·ç¹ï¼ã{task.NextAddress}ã"); |
| | | _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"åºåºä»»å¡ç»ç¹é误ï¼ç»ç¹ï¼ã{task.NextAddress}ã"); |
| | | WriteInfo(task.DeviceCode, $"åºåºä»»å¡ç»ç¹é误ï¼ç»ç¹ï¼ã{task.NextAddress}ã"); |
| | | return null; |
| | | } |
| | | //} |
| | | //else |
| | | //{ |
| | | // _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"æªæ¾å°ç«å°ã{task.NextAddress}ãä¿¡æ¯ï¼æ æ³è·å对åºçå åæºåè´§ç«å°ä¿¡æ¯"); |
| | | // return null; |
| | | //} |
| | | } |
| | | else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) |
| | | { |
| | | //List<Dt_Router> routers = _routerService.QueryNextRoutes(task.Roadway, task.TargetAddress); |
| | | //if (routers.Count > 0) |
| | | { |
| | | string[] targetCodes = task.NextAddress.Split("-"); |
| | | |
| | | stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[0]); |
| | | stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[1]); |
| | | stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[2]); |
| | | |
| | | string[] sourceCodes = task.CurrentAddress.Split("-"); |
| | | if (sourceCodes.Length == 3) |
| | | 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 |
| | | { |
| | | //æ°æ®é
ç½®é误 |
| | | _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"åºåºä»»å¡èµ·ç¹é误ï¼èµ·ç¹ï¼ã{task.CurrentAddress}ã"); |
| | | WriteInfo(task.DeviceCode, $"åºåºä»»å¡èµ·ç¹é误ï¼èµ·ç¹ï¼ã{task.CurrentAddress}ã"); |
| | | return null; |
| | | } |
| | | } |
| | | //else |
| | | //{ |
| | | // _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"æªæ¾å°ç«å°ã{task.NextAddress}ãä¿¡æ¯ï¼æ æ³è·å对åºçå åæºæ¾è´§ç«å°ä¿¡æ¯"); |
| | | // return null; |
| | | //} |
| | | } |
| | | else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup) |
| | | { |
| | | string[] targetCodes = task.NextAddress.Split("-"); |
| | | if (targetCodes.Length == 3) |
| | | if (targetCodes.Length == 5) |
| | | { |
| | | stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[0]); |
| | | stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[1]); |
| | | stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[2]); |
| | | stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[1]); |
| | | stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[2]); |
| | | stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[3]); |
| | | } |
| | | else |
| | | { |
| | | //æ°æ®é
ç½®é误 |
| | | _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"ç§»åºä»»å¡ç»ç¹é误ï¼èµ·ç¹ï¼ã{task.NextAddress}ã"); |
| | | _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"ç§»åºä»»å¡ç»ç¹é误ï¼ç»ç¹ï¼ã{task.NextAddress}ã"); |
| | | WriteInfo(task.DeviceCode, $"ç§»åºä»»å¡ç»ç¹é误ï¼ç»ç¹ï¼ã{task.NextAddress}ã"); |
| | | return null; |
| | | } |
| | | string[] sourceCodes = task.CurrentAddress.Split("-"); |
| | | if (sourceCodes.Length == 3) |
| | | 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 |
| | | { |
| | | //æ°æ®é
ç½®é误 |
| | | _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"ç§»åºä»»å¡èµ·ç¹é误ï¼èµ·ç¹ï¼ã{task.CurrentAddress}ã"); |
| | | WriteInfo(task.DeviceCode, $"ç§»åºä»»å¡èµ·ç¹é误ï¼èµ·ç¹ï¼ã{task.CurrentAddress}ã"); |
| | | return null; |
| | | } |
| | | } |
| | |
| | | private readonly ITaskRepository _taskRepository; |
| | | private readonly IRouterService _routerService; |
| | | private readonly IStationMangerRepository _stationMangerRepository; |
| | | private List<Dt_ApiInfo> apiInfos; |
| | | |
| | | public StackerCraneJob_YM(ITaskService taskService, ICacheService cacheService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository) |
| | | { |
| | |
| | | _taskRepository = taskRepository; |
| | | _routerService = routerService; |
| | | _stationMangerRepository = stationMangerRepository; |
| | | |
| | | string? apiInfoStr = _cacheService.Get("apiInfos"); |
| | | if (!string.IsNullOrEmpty(apiInfoStr)) |
| | | { |
| | | apiInfos = JsonConvert.DeserializeObject<List<Dt_ApiInfo>>(apiInfoStr); |
| | | if (apiInfos == null || apiInfos.Count == 0) |
| | | { |
| | | apiInfos = new List<Dt_ApiInfo>(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public Task Execute(IJobExecutionContext context) |
| | | { |
| | | CommonStackerCrane commonStackerCrane = (CommonStackerCrane)context.JobDetail.JobDataMap.Get("JobParams"); |
| | | bool flag = context.JobDetail.JobDataMap.TryGetValue("JobParams", out object value); |
| | | if (flag && value != null) |
| | | { |
| | | CommonStackerCrane commonStackerCrane = (CommonStackerCrane)value; |
| | | try |
| | | { |
| | | if (commonStackerCrane != null) |
| | |
| | | { |
| | | WriteError(commonStackerCrane.DeviceName, ex.Message, ex); |
| | | } |
| | | } |
| | | |
| | | |
| | | return Task.CompletedTask; |
| | | } |
| | | |
| | |
| | | onClick: function () { |
| | | } |
| | | }, |
| | | |
| | | ] |
| | | |
| | | export default buttons |
| | |
| | | "echarts": "^5.0.2", |
| | | "element-plus": "^2.2.14", |
| | | "less": "^4.1.1", |
| | | "qrcode": "^1.5.4", |
| | | "vue": "^3.2.37", |
| | | "vue-draggable-next": "^2.0.1", |
| | | "vue-qrcode": "^2.2.2", |
| | | "vue-router": "^4.0.0-0", |
| | | "vuex": "^4.0.0-0" |
| | | }, |
| | |
| | | /***************************************************************************************** |
| | | ** Author:jxx 2022 |
| | | ** QQ:283591387 |
| | | **宿´ææ¡£è§ï¼http://v2.volcore.xyz/document/api ã代ç çæé¡µé¢ViewGridã |
| | | **常ç¨ç¤ºä¾è§ï¼http://v2.volcore.xyz/document/vueDev |
| | | **åå°æä½è§ï¼http://v2.volcore.xyz/document/netCoreDev |
| | | *****************************************************************************************/ |
| | | //æ¤jsæä»¶æ¯ç¨æ¥èªå®ä¹æ©å±ä¸å¡ä»£ç ï¼å¯ä»¥æ©å±ä¸äºèªå®ä¹é¡µé¢æè
éæ°é
ç½®çæç代ç |
| | | |
| | | let extension = { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <vol-box |
| | | v-model="showDetialBox" |
| | | :lazy="true" |
| | | width="300px" |
| | | :padding="15" |
| | | title="æå°" |
| | | > |
| | | <div |
| | | id="printContent" |
| | | style="display: flex; justify-content: center; align-items: center" |
| | | > |
| | | <div |
| | | style="display: flex; justify-content: center; align-items: center" |
| | | > |
| | | <VueQrcode id="qrcode" :value="palletCode" :size="200"></VueQrcode> |
| | | </div> |
| | | <span |
| | | style="display: flex; justify-content: center; align-items: center" |
| | | >{{ palletCode }}</span |
| | | > |
| | | </div> |
| | | |
| | | <template #footer> |
| | | <el-button type="primary" size="small" @click="print()">æå°</el-button> |
| | | <el-button type="danger" size="small" @click="showDetialBox = false" |
| | | >å
³é</el-button |
| | | > |
| | | </template> |
| | | </vol-box> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import VolBox from "@/components/basic/VolBox.vue"; |
| | | import VueQrcode from "vue-qrcode"; |
| | | import QRCode from "qrcode"; |
| | | export default { |
| | | components: { VolBox, VueQrcode }, |
| | | data() { |
| | | return { |
| | | showDetialBox: false, |
| | | row: null, |
| | | qrcodeDataURL: "", |
| | | palletCode: "", |
| | | }; |
| | | }, |
| | | methods: { |
| | | open(row) { |
| | | this.row = row; |
| | | this.showDetialBox = true; |
| | | if (row && row.palletCode) { |
| | | this.palletCode = row.palletCode; |
| | | } |
| | | }, |
| | | print() { |
| | | let printContent = document.getElementById("printContent"); |
| | | var printWindow = window.open("", ""); |
| | | printWindow.document.write(printContent.innerHTML); |
| | | printWindow.document.close(); |
| | | printWindow.focus(); |
| | | printWindow.print(); |
| | | printWindow.close(); |
| | | }, |
| | | }, |
| | | |
| | | created() {}, |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .el-col { |
| | | border-radius: 4px; |
| | | } |
| | | |
| | | .grid-content { |
| | | border-radius: 4px; |
| | | min-height: 36px; |
| | | } |
| | | |
| | | .content-text { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | |
| | | .right-text { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: flex-end; |
| | | } |
| | | </style> |
| | | <style> |
| | | .el-table .warning-row { |
| | | background: #e6a23c; |
| | | } |
| | | |
| | | .el-table .success-row { |
| | | background: #f0f9eb; |
| | | } |
| | | |
| | | .el-table .error-row { |
| | | background: #f56c6c; |
| | | } |
| | | |
| | | canvas { |
| | | display: block; |
| | | margin: auto; |
| | | } |
| | | </style> |
ÎļþÃû´Ó ´úÂë¹ÜÀí/WMS/WIDESEA_WMSClient/src/extension/basic/CachePoint.js ÐÞ¸Ä |
| | |
| | | |
| | | //æ¤jsæä»¶æ¯ç¨æ¥èªå®ä¹æ©å±ä¸å¡ä»£ç ï¼å¯ä»¥æ©å±ä¸äºèªå®ä¹é¡µé¢æè
éæ°é
ç½®çæç代ç |
| | | |
| | | import gridBody from './extend/printView.vue' |
| | | let extension = { |
| | | components: { |
| | | //æ¥è¯¢ç颿©å±ç»ä»¶ |
| | | gridHeader: '', |
| | | gridBody: '', |
| | | gridBody: gridBody, |
| | | gridFooter: '', |
| | | //æ°å»ºãç¼è¾å¼¹åºæ¡æ©å±ç»ä»¶ |
| | | modelHeader: '', |
| | |
| | | buttons: { view: [], box: [], detail: [] }, //æ©å±çæé® |
| | | methods: { |
| | | //ä¸é¢è¿äºæ¹æ³å¯ä»¥ä¿çä¹å¯ä»¥å é¤ |
| | | onInit() { |
| | | let enableBtn = this.buttons.find(x => x.value == 'Enable'); |
| | | if (enableBtn) { |
| | | enableBtn.onClick = function () { |
| | | this.$message.success('èªå®ä¹æé®ç¹å»äºä»¶'); |
| | | onInit() { //æ¡æ¶åå§åé
ç½®åï¼ |
| | | this.columns.push({ |
| | | field: 'æä½', |
| | | title: 'æä½', |
| | | width: 90, |
| | | fixed: 'right', |
| | | align: 'center', |
| | | formatter: (row) => { |
| | | return ( |
| | | '<i style="cursor: pointer;color: #2d8cf0;"class="el-icon-printer">æå°</i>' |
| | | ); |
| | | }, |
| | | click: (row) => { |
| | | this.$refs.gridBody.open(row); |
| | | } |
| | | } |
| | | let disableBtn = this.buttons.find(x => x.value == 'Disable'); |
| | | if (disableBtn) { |
| | | disableBtn.onClick = function () { |
| | | this.$message.success('èªå®ä¹æé®ç¹å»äºä»¶'); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | onInited() { |
| | | //æ¡æ¶åå§åé
ç½®å |
| | |
| | | }, |
| | | rowClick({ row, column, event }) { |
| | | //æ¥è¯¢çé¢ç¹å»è¡äºä»¶ |
| | | this.$refs.table.$refs.table.toggleRowSelection(row); //åå»è¡æ¶éä¸å½åè¡; |
| | | // this.$refs.table.$refs.table.toggleRowSelection(row); //åå»è¡æ¶éä¸å½åè¡; |
| | | }, |
| | | modelOpenAfter(row) { |
| | | //ç¹å»ç¼è¾ãæ°å»ºæé®å¼¹åºæ¡åï¼å¯ä»¥å¨æ¤å¤åé»è¾ï¼å¦ï¼ä»åå°è·åæ°æ® |
| | |
| | | /***************************************************************************************** |
| | | ** Author:jxx 2022 |
| | | ** QQ:283591387 |
| | | **宿´ææ¡£è§ï¼http://v2.volcore.xyz/document/api ã代ç çæé¡µé¢ViewGridã |
| | | **常ç¨ç¤ºä¾è§ï¼http://v2.volcore.xyz/document/vueDev |
| | | **åå°æä½è§ï¼http://v2.volcore.xyz/document/netCoreDev |
| | | *****************************************************************************************/ |
| | | |
| | | //æ¤jsæä»¶æ¯ç¨æ¥èªå®ä¹æ©å±ä¸å¡ä»£ç ï¼å¯ä»¥æ©å±ä¸äºèªå®ä¹é¡µé¢æè
éæ°é
ç½®çæç代ç |
| | | |
| | | let extension = { |
| | |
| | | /***************************************************************************************** |
| | | ** Author:jxx 2022 |
| | | ** QQ:283591387 |
| | | **宿´ææ¡£è§ï¼http://v2.volcore.xyz/document/api ã代ç çæé¡µé¢ViewGridã |
| | | **常ç¨ç¤ºä¾è§ï¼http://v2.volcore.xyz/document/vueDev |
| | | **åå°æä½è§ï¼http://v2.volcore.xyz/document/netCoreDev |
| | | *****************************************************************************************/ |
| | | |
| | | //æ¤jsæä»¶æ¯ç¨æ¥èªå®ä¹æ©å±ä¸å¡ä»£ç ï¼å¯ä»¥æ©å±ä¸äºèªå®ä¹é¡µé¢æè
éæ°é
ç½®çæç代ç |
| | | |
| | | let extension = { |
| | |
| | | name: 'Sys_DictionaryList', |
| | | component: () => import('@/views/system/Sys_DictionaryList.vue') |
| | | }, { |
| | | path: '/areaInfo', |
| | | name: 'areaInfo', |
| | | component: () => import('@/views/basic/areaInfo.vue') |
| | | }, |
| | | { |
| | | path: '/areaRouter', |
| | | name: 'areaRouter', |
| | | component: () => import('@/views/basic/areaRouter.vue') |
| | | }, { |
| | | path: '/locationInfo', |
| | | name: 'locationInfo', |
| | | component: () => import('@/views/basic/locationInfo.vue') |
| | |
| | | path: '/materielInfo', |
| | | name: 'materielInfo', |
| | | component: () => import('@/views/basic/materielInfo.vue') |
| | | }, |
| | | { |
| | | path: '/cachePoint', |
| | | name: 'cachePoint', |
| | | component: () => import('@/views/basic/cachePoint.vue') |
| | | }, |
| | | { |
| | | path: '/roadwayInfo', |
| | | name: 'roadwayInfo', |
| | | component: () => import('@/views/basic/roadwayInfo.vue') |
| | | }, { |
| | | path: '/warehouse', |
| | | name: 'warehouse', |
| | | component: () => import('@/views/basic/warehouse.vue') |
| | | }, { |
| | | path: '/palletCodeInfo', |
| | | name: 'palletCodeInfo', |
| | | component: () => import('@/views/basic/palletCodeInfo.vue') |
| | | }, { |
| | | path: '/inboundOrder', |
| | | name: 'inboundOrder', |
| | | component: () => import('@/views/inbound/inboundOrder.vue') |
¶Ô±ÈÐÂÎļþ |
| | |
| | | |
| | | <template> |
| | | <view-grid |
| | | ref="grid" |
| | | :columns="columns" |
| | | :detail="detail" |
| | | :editFormFields="editFormFields" |
| | | :editFormOptions="editFormOptions" |
| | | :searchFormFields="searchFormFields" |
| | | :searchFormOptions="searchFormOptions" |
| | | :table="table" |
| | | :extend="extend" |
| | | > |
| | | </view-grid> |
| | | </template> |
| | | <script> |
| | | import extend from "@/extension/basic/palletCodeInfo.js"; |
| | | import { ref, defineComponent } from "vue"; |
| | | export default defineComponent({ |
| | | setup() { |
| | | const table = ref({ |
| | | key: "id", |
| | | footer: "Foots", |
| | | cnName: "æçä¿¡æ¯", |
| | | name: "palletCodeInfo", |
| | | url: "/PalletCodeInfo/", |
| | | sortName: "id", |
| | | }); |
| | | const editFormFields = ref({}); |
| | | const editFormOptions = ref([ |
| | | [ |
| | | { |
| | | title: "ä»åº", |
| | | field: "warehouseId", |
| | | type: "select", |
| | | dataKey: "warehouses", |
| | | data: [], |
| | | required: true, |
| | | }, |
| | | { |
| | | title: "æ°é", |
| | | field: "count", |
| | | type: "int", |
| | | required: true, |
| | | }, |
| | | ], |
| | | ]); |
| | | const searchFormFields = ref({ |
| | | palletCode: "", |
| | | }); |
| | | const searchFormOptions = ref([ |
| | | [{ title: "æçç¼å·", field: "palletCode", type: "like" }], |
| | | ]); |
| | | const columns = ref([ |
| | | { |
| | | field: "id", |
| | | title: "Id", |
| | | type: "int", |
| | | width: 90, |
| | | hidden: true, |
| | | readonly: true, |
| | | require: true, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "warehouseId", |
| | | title: "ä»åºä¸»é®", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | bind: { key: "warehouse", data: [] }, |
| | | }, |
| | | { |
| | | field: "palletType", |
| | | title: "æçç±»å", |
| | | type: "string", |
| | | width: 150, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "palletCode", |
| | | title: "æçç¼å·", |
| | | type: "decimal", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "status", |
| | | title: "æå°ç¶æ", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | bind: { key: "enableEnum", data: [] }, |
| | | }, |
| | | { |
| | | field: "size", |
| | | title: "尺寸", |
| | | type: "int", |
| | | width: 120, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "creater", |
| | | title: "å建人", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "createDate", |
| | | title: "å建æ¶é´", |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | sort: true, |
| | | }, |
| | | { |
| | | field: "modifier", |
| | | title: "ä¿®æ¹äºº", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "modifyDate", |
| | | title: "ä¿®æ¹æ¶é´", |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | sort: true, |
| | | }, |
| | | { |
| | | field: "remark", |
| | | title: "夿³¨", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | }, |
| | | ]); |
| | | const detail = ref({ |
| | | cnName: "#detailCnName", |
| | | table: "", |
| | | columns: [], |
| | | sortName: "", |
| | | }); |
| | | return { |
| | | table, |
| | | extend, |
| | | editFormFields, |
| | | editFormOptions, |
| | | searchFormFields, |
| | | searchFormOptions, |
| | | columns, |
| | | detail, |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_IBasicRepository; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_BasicRepository |
| | | { |
| | | public class PalletCodeInfoRepository : RepositoryBase<Dt_PalletCodeInfo>, IPalletCodeInfoRepository |
| | | { |
| | | public PalletCodeInfoRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) |
| | | { |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_IBasicRepository; |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_BasicService |
| | | { |
| | | public class PalletCodeInfoService : ServiceBase<Dt_PalletCodeInfo, IPalletCodeInfoRepository>, IPalletCodeInfoService |
| | | { |
| | | public PalletCodeInfoService(IPalletCodeInfoRepository BaseDal) : base(BaseDal) |
| | | { |
| | | } |
| | | |
| | | static object locker = new object(); |
| | | public override WebResponseContent AddData(SaveModel saveModel) |
| | | { |
| | | int warehouseId = 0; |
| | | int count = 0; |
| | | if (saveModel.MainData.TryGetValue("warehouseId", out object? warehouse) && warehouse != null) |
| | | { |
| | | warehouseId = warehouse.ObjToInt(); |
| | | } |
| | | if (saveModel.MainData.TryGetValue("count", out object? countValue) && countValue != null) |
| | | { |
| | | count = countValue.ObjToInt(); |
| | | } |
| | | lock (locker) |
| | | { |
| | | List<Dt_PalletCodeInfo> palletCodeInfos = new List<Dt_PalletCodeInfo>(); |
| | | int serialNo = 0; |
| | | DateTime now = DateTime.Now; |
| | | Dt_PalletCodeInfo palletCodeInfo = BaseDal.QueryFirst(x => x.WarehouseId == warehouseId, new Dictionary<string, OrderByType> { { nameof(Dt_PalletCodeInfo.SerialNo), OrderByType.Desc } }); |
| | | if (palletCodeInfo != null && palletCodeInfo.CreateDate.Year == now.Year && palletCodeInfo.CreateDate.Month == now.Month && palletCodeInfo.CreateDate.Day == now.Day) |
| | | { |
| | | serialNo = palletCodeInfo.SerialNo + 1; |
| | | |
| | | } |
| | | else |
| | | { |
| | | serialNo = 1; |
| | | } |
| | | for (int i = 0; i < count; i++) |
| | | { |
| | | palletCodeInfos.Add(new Dt_PalletCodeInfo |
| | | { |
| | | SerialNo = serialNo, |
| | | PalletCode = now.ToString("yyyyMMdd") + serialNo.ToString().PadLeft(3, '0'), |
| | | PalletType = 1, |
| | | PalletTypeId = 0, |
| | | WarehouseId = warehouseId, |
| | | Status = 0, |
| | | Size = 0 |
| | | }); |
| | | |
| | | serialNo = serialNo + 1; |
| | | } |
| | | return base.AddData(palletCodeInfos); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | 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.Column).ThenBy(x => x.Row).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.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.Column).ThenBy(x => x.Row).ToList(); |
| | | |
| | | if ((locationInfos.Count * weightValue_BC >= definedTypeLocations.Count && undefinedTypeEmptyLocations.Any()) || !definedTypeEmptyLocations.Any())//妿已å®ä¹ç±»åè´§ä½æªè¶
è¿æ¯ä¾ï¼ä¸ææªå®ä¹ç±»åçè´§ä½ |
| | | { |
| | | if (palletType == PalletTypeEnum.LargePallet || palletType == PalletTypeEnum.LargestPallet) |
| | | { |
| | | undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Depth % 2 == 1).ToList(); |
| | | undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Column % 2 == 1).ToList(); |
| | | } |
| | | for (int i = 0; i < undefinedTypeEmptyLocations.Count; i++) |
| | | { |
| | |
| | | { |
| | | case PalletTypeEnum.LargestPallet: |
| | | case PalletTypeEnum.LargePallet: |
| | | if (emptyLocation.Depth % 2 == 0) |
| | | if (emptyLocation.Column % 2 == 0) |
| | | { |
| | | return null; |
| | | } |
| | |
| | | using System; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | |
| | | 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.Column).ThenBy(x => x.Row).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.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.Column).ThenBy(x => x.Row).ToList(); |
| | | |
| | | if ((locationInfos.Count * weightValue_CSJ >= definedTypeLocations.Count && undefinedTypeEmptyLocations.Any()) || !definedTypeEmptyLocations.Any())//妿已å®ä¹ç±»åè´§ä½æªè¶
è¿æ¯ä¾ï¼ä¸ææªå®ä¹ç±»åçè´§ä½ |
| | | { |
| | |
| | | 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.Column).ThenBy(x => x.Row).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.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.Column).ThenBy(x => x.Row).ToList(); |
| | | |
| | | if ((locationInfos.Count * weightValue_GM >= definedTypeLocations.Count && undefinedTypeEmptyLocations.Any()) || !definedTypeEmptyLocations.Any())//妿已å®ä¹ç±»åè´§ä½æªè¶
è¿æ¯ä¾ï¼ä¸ææªå®ä¹ç±»åçè´§ä½ |
| | | { |
| | | if (palletType == PalletTypeEnum.LargePallet || palletType == PalletTypeEnum.LargestPallet) |
| | | { |
| | | undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Depth % 2 == 1).ToList(); |
| | | undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Column % 2 == 1).ToList(); |
| | | } |
| | | for (int i = 0; i < undefinedTypeEmptyLocations.Count; i++) |
| | | { |
| | |
| | | { |
| | | case PalletTypeEnum.LargestPallet: |
| | | case PalletTypeEnum.LargePallet: |
| | | if (emptyLocation.Depth % 2 == 0) |
| | | if (emptyLocation.Column % 2 == 0) |
| | | { |
| | | return null; |
| | | } |
| | |
| | | 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.Column).ThenBy(x => x.Row).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.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.Column).ThenBy(x => x.Row).ToList(); |
| | | |
| | | if ((locationInfos.Count * weightValue_PP >= definedTypeLocations.Count && undefinedTypeEmptyLocations.Any()) || !definedTypeEmptyLocations.Any())//妿已å®ä¹ç±»åè´§ä½æªè¶
è¿æ¯ä¾ï¼ä¸ææªå®ä¹ç±»åçè´§ä½ |
| | | { |
| | | if (palletType == PalletTypeEnum.LargePallet || palletType == PalletTypeEnum.LargestPallet) |
| | | { |
| | | undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Depth % 2 == 1).ToList(); |
| | | undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Column % 2 == 1).ToList(); |
| | | } |
| | | for (int i = 0; i < undefinedTypeEmptyLocations.Count; i++) |
| | | { |
| | |
| | | { |
| | | case PalletTypeEnum.LargestPallet: |
| | | case PalletTypeEnum.LargePallet: |
| | | if (emptyLocation.Depth % 2 == 0) |
| | | if (emptyLocation.Column % 2 == 0) |
| | | { |
| | | return null; |
| | | } |
| | |
| | | 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.Column).ThenBy(x => x.Row).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.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.Column).ThenBy(x => x.Row).ToList(); |
| | | |
| | | if ((locationInfos.Count * weightValue_ZH >= definedTypeLocations.Count && undefinedTypeEmptyLocations.Any()) || !definedTypeEmptyLocations.Any())//妿已å®ä¹ç±»åè´§ä½æªè¶
è¿æ¯ä¾ï¼ä¸ææªå®ä¹ç±»åçè´§ä½ |
| | | { |
| | | if (palletType == PalletTypeEnum.LargePallet || palletType == PalletTypeEnum.LargestPallet) |
| | | { |
| | | undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Depth % 2 == 1).ToList(); |
| | | undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Column % 2 == 0).ToList(); |
| | | } |
| | | for (int i = 0; i < undefinedTypeEmptyLocations.Count; i++) |
| | | { |
| | |
| | | { |
| | | case PalletTypeEnum.LargestPallet: |
| | | case PalletTypeEnum.LargePallet: |
| | | if (emptyLocation.Depth % 2 == 0) |
| | | if (emptyLocation.Column % 2 != 0) |
| | | { |
| | | return null; |
| | | } |
| | |
| | | }; |
| | | } |
| | | |
| | | //public bool LittleDepthLocationIsEmpty(Dt_LocationInfo locationInfo, PalletTypeEnum palletType) |
| | | //{ |
| | | // Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseId == locationInfo.WarehouseId); |
| | | // if (warehouse == null) |
| | | // { |
| | | // throw new Exception($"æªæ¾å°ä»åºä¿¡æ¯"); |
| | | // } |
| | | |
| | | // return warehouse.WarehouseName switch |
| | | // { |
| | | // "æ¿æä»" => false, |
| | | // "PPä»" => false, |
| | | // "å¹²èä»" => false, |
| | | // "æµè¯æ¶ä»" => LittleDepthLocationIsEmpty_CSJ(locationInfo, palletType), |
| | | // "é»çä»" => false, |
| | | // "油墨ä»" => true, |
| | | // "æåä»" => true, |
| | | // "è¾
æä»" => true, |
| | | // _ => throw new Exception($"æªæ¾å°ä»åºè´§ä½åé
æ¹æ³") |
| | | // }; |
| | | //} |
| | | |
| | | private readonly static object _locker = new object(); |
| | | private static List<LocationCache> locationCaches = new List<LocationCache>(); |
| | | /// <summary> |
| | |
| | | { |
| | | public class HttpHelper |
| | | { |
| | | public static async Task<string> GetAsync(string serviceAddress, string contentType = "application/json", Dictionary<string, string>? headers = null) |
| | | public static async Task<string> GetAsync(string serviceAddress, Dictionary<string, string>? headers = null) |
| | | { |
| | | string result = string.Empty; |
| | | DateTime beginDate = DateTime.Now; |
| | |
| | | } |
| | | } |
| | | |
| | | public static async Task<string?> PostAsync(string serviceAddress, string requestJson = null, string contentType = "application/json", Dictionary<string, string>? headers = null) |
| | | public static async Task<string?> PostAsync(string serviceAddress, string requestJson = "", string contentType = "application/json", Dictionary<string, string>? headers = null) |
| | | { |
| | | string result = string.Empty; |
| | | DateTime beginDate = DateTime.Now; |
| | |
| | | } |
| | | finally |
| | | { |
| | | Logger.Add(serviceAddress, requestJson == null ? "" : requestJson, result, beginDate); |
| | | Logger.Add(serviceAddress, requestJson, result, beginDate); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | public static string Post(string serviceAddress, string requestJson = null, string contentType = "application/json", Dictionary<string, string>? headers = null) |
| | | public static string Post(string serviceAddress, string requestJson = "", string contentType = "application/json", Dictionary<string, string>? headers = null) |
| | | { |
| | | string result = string.Empty; |
| | | DateTime beginDate = DateTime.Now; |
| | |
| | | } |
| | | finally |
| | | { |
| | | Logger.Add(serviceAddress, requestJson == null ? "" : requestJson, result, beginDate); |
| | | Logger.Add(serviceAddress, requestJson, result, beginDate); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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_IBasicRepository |
| | | { |
| | | public interface IPalletCodeInfoRepository : IRepository<Dt_PalletCodeInfo> |
| | | { |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_IBasicService |
| | | { |
| | | public interface IPalletCodeInfoService : IService<Dt_PalletCodeInfo> |
| | | { |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.DB.Models; |
| | | |
| | | namespace WIDESEA_Model.Models |
| | | { |
| | | [SugarTable(nameof(Dt_PalletCodeInfo), "æçç¼å·ä¿¡æ¯")] |
| | | public class Dt_PalletCodeInfo : BaseEntity |
| | | { |
| | | [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主é®")] |
| | | public int Id { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "ä»åºä¸»é®")] |
| | | public int WarehouseId { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "æçç±»å")] |
| | | public int PalletType { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "æçç¼å·")] |
| | | public string PalletCode { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "æµæ°´å·")] |
| | | public int SerialNo { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "æå°ç¶æ")] |
| | | public int Status { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "尺寸")] |
| | | public int Size { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "æçç±»å主é®")] |
| | | public int PalletTypeId { get; set; } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.DB.Models; |
| | | |
| | | namespace WIDESEA_Model.Models |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [SugarTable(nameof(Dt_PalletTypeInfo), "æçç±»å")] |
| | | public class Dt_PalletTypeInfo : BaseEntity |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主é®")] |
| | | public int Id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "æçç±»å")] |
| | | public int PalletType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "æçç±»ååç§°")] |
| | | public string TypeName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "é¿åº¦")] |
| | | public int Length { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "宽度")] |
| | | public int Width { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "é«åº¦")] |
| | | public int Height { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "ç¶æ")] |
| | | public int Enbale { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "ä»åºç¼å·")] |
| | | public int WarehouseId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "æå±å±")] |
| | | public string SortNum { get; set; } |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | public WebResponseContent DeviceRequestInboundTask(string stationCode, string roadwayNo, string palletCode) |
| | | { |
| | | try |
| | | { |
| | | Dt_Task task = Repository.QueryFirst(x => x.PalletCode == palletCode); |
| | | if (task != null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"该æçå·²çæä»»å¡"); |
| | | } |
| | | |
| | | if (Repository.QueryFirst(x => x.SourceAddress == stationCode && x.TaskStatus == TaskStatusEnum.New.ObjToInt()) != null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"该ç«ç¹å·²ææªæ§è¡çä»»å¡"); |
| | | } |
| | | |
| | | Dt_StockInfo stockInfo = _stockRepository.StockInfoRepository.QueryFirst(x => x.PalletCode == palletCode); |
| | | if (stockInfo == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°ç»çä¿¡æ¯"); |
| | | } |
| | | if (stockInfo.StockStatus != StockStatusEmun.ç»çæå.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.æå¨ç»çæå.ObjToInt()) |
| | | { |
| | | return WebResponseContent.Instance.Error($"该æçç¶æä¸æ£ç¡®,ä¸å¯ç³è¯·å
¥åº"); |
| | | } |
| | | if (!string.IsNullOrEmpty(stockInfo.LocationCode)) |
| | | { |
| | | return WebResponseContent.Instance.Error($"该æçå·²ç»å®è´§ä½"); |
| | | } |
| | | |
| | | Dt_LocationInfo? locationInfo = _basicService.LocationInfoService.AssignLocation(roadwayNo, (PalletTypeEnum)stockInfo.PalletType, stockInfo.WarehouseId); |
| | | if (locationInfo == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"è´§ä½åé
失败,æªæ¾å°å¯åé
è´§ä½"); |
| | | } |
| | | |
| | | Dt_Task newTask = new Dt_Task() |
| | | { |
| | | CurrentAddress = stationCode, |
| | | Grade = 0, |
| | | NextAddress = locationInfo.LocationCode, |
| | | PalletCode = palletCode, |
| | | Roadway = roadwayNo, |
| | | SourceAddress = stationCode, |
| | | TargetAddress = locationInfo.LocationCode, |
| | | TaskType = TaskTypeEnum.Inbound.ObjToInt(), |
| | | TaskStatus = TaskStatusEnum.New.ObjToInt(), |
| | | WarehouseId = stockInfo.WarehouseId, |
| | | PalletType = stockInfo.PalletType |
| | | }; |
| | | |
| | | if (stockInfo.StockStatus == StockStatusEmun.æå¨ç»çæå.ObjToInt()) |
| | | { |
| | | stockInfo.StockStatus = StockStatusEmun.æå¨ç»çå
¥åºç¡®è®¤.ObjToInt(); |
| | | } |
| | | else |
| | | { |
| | | stockInfo.StockStatus = StockStatusEmun.å
¥åºç¡®è®¤.ObjToInt(); |
| | | } |
| | | _unitOfWorkManage.BeginTran(); |
| | | int taskId = BaseDal.AddData(newTask); |
| | | newTask.TaskId = taskId; |
| | | _stockRepository.StockInfoRepository.UpdateData(stockInfo); |
| | | _unitOfWorkManage.CommitTran(); |
| | | PushTasksToWCS(new List<Dt_Task> { newTask }); |
| | | return WebResponseContent.Instance.OK(data: newTask); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å
¥åºä»»å¡ç³è¯·åé
è´§ä½ |
| | | /// </summary> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers.Basic |
| | | { |
| | | [Route("api/[controller]")] |
| | | [ApiController] |
| | | public class PalletCodeInfoController : ApiBaseController<IPalletCodeInfoService, Dt_PalletCodeInfo> |
| | | { |
| | | public PalletCodeInfoController(IPalletCodeInfoService service) : base(service) |
| | | { |
| | | } |
| | | } |
| | | } |
| | |
| | | builder.Services.AddWebSocketSetup(); |
| | | builder.Services.AddSqlsugarSetup();//SqlSugar å¯å¨æå¡ |
| | | builder.Services.AddDbSetup();//Db å¯å¨æå¡ |
| | | builder.Services.AddInitializationHostServiceSetup();//åºç¨åå§åæå¡æ³¨å
¥ |
| | | //builder.Services.AddInitializationHostServiceSetup();//åºç¨åå§åæå¡æ³¨å
¥ |
| | | builder.Services.AddHostedService<PermissionDataHostService>();//åºç¨åå§åæå¡æ³¨å
¥ |
| | | builder.Services.AddAutoMapperSetup(); |
| | | |