fix(任务服务): 修复出库任务选择逻辑和货位分配问题
refactor(基础服务): 优化货位查询性能并添加空闲货位阈值检查
fix(常量配置): 修正常温1号出库地址和输送线映射关系
perf(库存服务): 添加按仓库ID和货位编码查询库存的接口
fix(模拟器): 调整PLC端口配置
style: 清理无用引用和格式化代码
fix(任务流): 设置WMS任务接收委托避免循环依赖
fix(Web响应): 完善WebResponseContent的默认值和状态码
fix(机器人任务): 修正仓库ID和巷道分配逻辑
| | |
| | | public WebResponseContent OK() |
| | | { |
| | | Status = true; |
| | | Code = 200; |
| | | return this; |
| | | } |
| | | |
| | |
| | | get { return new WebResponseContent(); } |
| | | } |
| | | // OKæ¹æ³ï¼è®¾ç½®ç¶æä¸ºtrueï¼å¹¶è®¾ç½®æ¶æ¯åæ°æ®ï¼è¿åå½å对象 |
| | | public WebResponseContent OK(string message = null, object data = null) |
| | | public WebResponseContent OK(string? message = null, object? data = null) |
| | | { |
| | | Status = true; |
| | | Message = message; |
| | | Data = data; |
| | | Code = 200; |
| | | Message = message ?? "è¯·æ±æå"; |
| | | Data = data ?? new { }; |
| | | return this; |
| | | } |
| | | |
| | | // Erroræ¹æ³ï¼è®¾ç½®ç¶æä¸ºfalseï¼å¹¶è®¾ç½®æ¶æ¯ï¼è¿åå½å对象 |
| | | public WebResponseContent Error(string message = null) |
| | | public WebResponseContent Error(string? message = null) |
| | | { |
| | | Status = false; |
| | | Message = message; |
| | | Message = message ?? "请æ±å¤±è´¥"; |
| | | return this; |
| | | } |
| | | } |
| | |
| | | /// <param name="task">ä»»å¡å®ä½ã</param> |
| | | /// <returns>å¤çç»æã</returns> |
| | | WebResponseContent CompleteStackerTask([NotNull] Dt_Task task); |
| | | |
| | | /// <summary> |
| | | /// è®¾ç½®æ¥æ¶WMSä»»å¡çå§æï¼ç±TaskService卿é åè°ç¨ï¼é¿å
循ç¯ä¾èµï¼ã |
| | | /// </summary> |
| | | /// <param name="receiveWMSTaskFunc">æ¥æ¶WMSä»»å¡çæ¹æ³å§æã</param> |
| | | void SetReceiveWMSTaskDelegate(Func<List<WMSTaskDTO>, WebResponseContent> receiveWMSTaskFunc); |
| | | } |
| | | } |
| | |
| | | "10030": "GWSC1" |
| | | }, |
| | | "AddressSourceLineNoMap": { // 对åºè¾é线ç¼å·å°åæ å° |
| | | "11001": "10010", |
| | | "11010": "10030", |
| | | "10010": "11001", |
| | | "10030": "11010" |
| | | "11001": "2101", |
| | | "11010": "2103", |
| | | "2101": "11001", |
| | | "2103": "11010" |
| | | } |
| | | }, |
| | | "RobotAddressRules": { |
| | |
| | | using Autofac; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json; |
| | | using Serilog; |
| | | using System.Diagnostics.CodeAnalysis; |
| | | using WIDESEA_Core; |
| | |
| | | using WIDESEAWCS_DTO; |
| | | using WIDESEAWCS_DTO.Stock; |
| | | using WIDESEAWCS_DTO.TaskInfo; |
| | | using WIDESEAWCS_ITaskInfoRepository; |
| | | using WIDESEAWCS_ITaskInfoService; |
| | | using WIDESEAWCS_Model.Models; |
| | | using WIDESEAWCS_QuartzJob.Models; |
| | |
| | | private readonly IRouterService _routerService; |
| | | private readonly HttpClientHelper _httpClientHelper; |
| | | private readonly IRobotTaskService _robotTaskService; |
| | | private readonly IComponentContext _componentContext; |
| | | private readonly ITaskRepository _taskRepository; |
| | | private readonly IUnitOfWorkManage _unitOfWorkManage; |
| | | private readonly ILogger _logger; |
| | | private Func<List<WMSTaskDTO>, WebResponseContent> _receiveWMSTaskFunc; |
| | | |
| | | /// <summary> |
| | | /// åå§ååºåºä»»å¡æµç¨æå¡ã |
| | |
| | | /// <param name="routerService">è·¯ç±æå¡ã</param> |
| | | /// <param name="httpClientHelper">WMSæ¥å£è°ç¨å¸®å©ç±»ã</param> |
| | | /// <param name="robotTaskService">æºæ¢°æä»»å¡æå¡ã</param> |
| | | /// <param name="componentContext">Autofacç»ä»¶ä¸ä¸æï¼ç¨äºå»¶è¿è§£æITaskService以é¿å
循ç¯ä¾èµï¼ã</param> |
| | | public OutboundTaskFlowService(IRouterService routerService, HttpClientHelper httpClientHelper, IRobotTaskService robotTaskService, IComponentContext componentContext, IUnitOfWorkManage unitOfWorkManage, ILogger logger) |
| | | /// <param name="taskRepository">ä»»å¡ä»å¨ï¼ç¨äºå é¤/彿¡£ä»»å¡ï¼ã</param> |
| | | /// <param name="unitOfWorkManage">å·¥ä½åå
管çå¨ã</param> |
| | | /// <param name="logger">æ¥å¿è®°å½å¨ã</param> |
| | | public OutboundTaskFlowService( |
| | | IRouterService routerService, |
| | | HttpClientHelper httpClientHelper, |
| | | IRobotTaskService robotTaskService, |
| | | ITaskRepository taskRepository, |
| | | IUnitOfWorkManage unitOfWorkManage, |
| | | ILogger logger) |
| | | { |
| | | _routerService = routerService; |
| | | _httpClientHelper = httpClientHelper; |
| | | _robotTaskService = robotTaskService; |
| | | _componentContext = componentContext; |
| | | _taskRepository = taskRepository; |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | | _logger = logger; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å»¶è¿è§£æITaskService以é¿å
循ç¯ä¾èµ |
| | | /// è®¾ç½®æ¥æ¶WMSä»»å¡çå§æï¼ç±TaskService卿é åè°ç¨ï¼é¿å
循ç¯ä¾èµï¼ã |
| | | /// </summary> |
| | | private ITaskService TaskService => _componentContext.Resolve<ITaskService>(); |
| | | /// <param name="receiveWMSTaskFunc">æ¥æ¶WMSä»»å¡çæ¹æ³å§æã</param> |
| | | public void SetReceiveWMSTaskDelegate(Func<List<WMSTaskDTO>, WebResponseContent> receiveWMSTaskFunc) |
| | | { |
| | | _receiveWMSTaskFunc = receiveWMSTaskFunc; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¥æ¶WMS任塿¶åå§ååºåºä»»å¡ã |
| | |
| | | _unitOfWorkManage.BeginTran(() => |
| | | { |
| | | // å
å 餿¬å°åºåºä»»å¡ï¼é¿å
æçå·å¯ä¸é®å²çª |
| | | bool isDeleted = TaskService.Repository.DeleteAndMoveIntoHty(task, OperateTypeEnum.èªå¨å®æ); |
| | | bool isDeleted = _taskRepository.DeleteAndMoveIntoHty(task, OperateTypeEnum.èªå¨å®æ); |
| | | if (!isDeleted) |
| | | { |
| | | return content.Error($"å 餿¬å°åºåºä»»å¡å¤±è´¥,ä»»å¡å·:ã{task.TaskNum}ã,æçå·:ã{task.PalletCode}ã"); |
| | | } |
| | | |
| | | // è°ç¨ReceiveWMSTaskå建æ¬å°å
¥åºä»»å¡ |
| | | var receiveResult = TaskService.ReceiveWMSTask(new List<WMSTaskDTO> { inboundTaskDto }); |
| | | // è°ç¨ReceiveWMSTaskå§æå建æ¬å°å
¥åºä»»å¡ |
| | | var receiveResult = _receiveWMSTaskFunc(new List<WMSTaskDTO> { inboundTaskDto }); |
| | | if (!receiveResult.Status) |
| | | { |
| | | return content.Error($"å建æ¬å°å
¥åºä»»å¡å¤±è´¥: {receiveResult.Message}"); |
| | |
| | | if (wMSTask == null) |
| | | return WebResponseContent.Instance.Error($"è·åWMSç³»ç»ç©ºæçåºåºä»»å¡å¤±è´¥,ä»»å¡å·:ã{task.TaskNum}ã,æçå·:ã{task.PalletCode}ã,é误信æ¯:ãWMSæªè¿åææä»»å¡æ°æ®ã"); |
| | | |
| | | if (TaskService.ReceiveWMSTask(new List<WMSTaskDTO> { wMSTask }).Status) |
| | | if (_receiveWMSTaskFunc(new List<WMSTaskDTO> { wMSTask }).Status) |
| | | return WebResponseContent.Instance.OK("æå"); |
| | | |
| | | return WebResponseContent.Instance.Error("æ¥æ¶WMSä»»å¡å¤±è´¥"); |
| | |
| | | using MapsterMapper; |
| | | using SqlSugar; |
| | | using System.Diagnostics.CodeAnalysis; |
| | | using WIDESEA_Core; |
| | | using WIDESEAWCS_Common.TaskEnum; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.BaseServices; |
| | | using WIDESEAWCS_Core.Enums; |
| | | using WIDESEAWCS_DTO; |
| | | using WIDESEAWCS_DTO.Stock; |
| | | using WIDESEAWCS_DTO.TaskInfo; |
| | | using WIDESEAWCS_ITaskInfoRepository; |
| | | using WIDESEAWCS_ITaskInfoService; |
| | | using WIDESEAWCS_Model.Models; |
| | | using WIDESEAWCS_QuartzJob; |
| | | using WIDESEAWCS_QuartzJob.DeviceBase; |
| | | using WIDESEAWCS_QuartzJob.DTO; |
| | | using WIDESEAWCS_QuartzJob.Models; |
| | | using WIDESEAWCS_QuartzJob.Service; |
| | | |
| | | namespace WIDESEAWCS_TaskInfoService; |
| | |
| | | _inboundTaskFlowService = inboundTaskFlowService; |
| | | _relocationTaskFlowService = relocationTaskFlowService; |
| | | _robotTaskFlowService = robotTaskFlowService; |
| | | |
| | | // è®¾ç½®å§æï¼é¿å
OutboundTaskFlowServiceéè¿IComponentContextå»¶è¿è§£æå¯¼è´ObjectDisposedException |
| | | _outboundTaskFlowService.SetReceiveWMSTaskDelegate(ReceiveWMSTask); |
| | | } |
| | | } |
| | |
| | | /// </summary> |
| | | /// <remarks> |
| | | /// </remarks> |
| | | private static List<string> AddressToDeviceType = new List<string> { "11020", "11028", "2125" }; |
| | | private static List<string> AddressToDeviceType = new List<string> { "11020", "11028", "2125", "11062" }; |
| | | |
| | | /// <summary> |
| | | /// æçæ£æ¥ä½ç½®çæè¿æ§è¡æ¶é´ï¼ç¨äº30ç§é´ééå¶ï¼ |
| | |
| | | |
| | | // ========== æ£æ¥ç¹å®ä½ç½®æ¯å¦ææç ========== |
| | | // ä»é
ç½®ä¸è¯»åéè¦æ£æ¥æççä½ç½®å表 |
| | | var checkPalletPositions = App.Configuration.GetSection("CheckPalletPositions") |
| | | .Get<List<CheckPalletPosition>>() ?? new List<CheckPalletPosition>(); |
| | | //var checkPalletPositions = App.Configuration.GetSection("CheckPalletPositions") |
| | | // .Get<List<CheckPalletPosition>>() ?? new List<CheckPalletPosition>(); |
| | | |
| | | // 妿å½å设å¤å¨æ£æ¥åè¡¨ä¸ |
| | | if (checkPalletPositions.Any(x => x.Code == childDeviceCode)) |
| | | { |
| | | // 30ç§é´ééå¶ |
| | | if (_lastPalletCheckTime.TryGetValue(childDeviceCode, out var lastTime) && |
| | | (DateTime.Now - lastTime).TotalSeconds < 30) |
| | | { |
| | | continue; |
| | | } |
| | | //// 妿å½å设å¤å¨æ£æ¥åè¡¨ä¸ |
| | | //if (checkPalletPositions.Any(x => x.Code == childDeviceCode)) |
| | | //{ |
| | | // // 30ç§é´ééå¶ |
| | | // if (_lastPalletCheckTime.TryGetValue(childDeviceCode, out var lastTime) && |
| | | // (DateTime.Now - lastTime).TotalSeconds < 30) |
| | | // { |
| | | // continue; |
| | | // } |
| | | |
| | | // æ£æ¥è¾éçº¿ç¶æï¼æ¯å¦ææçï¼ |
| | | if (command.CV_State == 2) |
| | | { |
| | | // æ£æ¥è¯¥ä½ç½®æ¯å¦å·²æä»»å¡ |
| | | var existingTask = _taskService.Db.Queryable<Dt_Task>().Count(x => x.TargetAddress == childDeviceCode); |
| | | if (existingTask < 5) |
| | | { |
| | | // 没æä»»å¡ï¼å WMS 请æ±åºåºæçä»»å¡ |
| | | var position = checkPalletPositions.FirstOrDefault(x => x.Code == childDeviceCode); |
| | | // // æ£æ¥è¾éçº¿ç¶æï¼æ¯å¦ææçï¼ |
| | | // if (command.CV_State == 2) |
| | | // { |
| | | // // æ£æ¥è¯¥ä½ç½®æ¯å¦å·²æä»»å¡ |
| | | // var existingTask = _taskService.Db.Queryable<Dt_Task>().Count(x => x.TargetAddress == childDeviceCode); |
| | | // if (existingTask < 5) |
| | | // { |
| | | // // 没æä»»å¡ï¼å WMS 请æ±åºåºæçä»»å¡ |
| | | // var position = checkPalletPositions.FirstOrDefault(x => x.Code == childDeviceCode); |
| | | |
| | | string configKey = "GetOutBoundTrayTaskAsync"; |
| | | string requestParam = new CreateTaskDto() |
| | | { |
| | | WarehouseId = position.WarehouseId, |
| | | TargetAddress = childDeviceCode |
| | | }.Serialize(); |
| | | DateTime startTime = DateTime.Now; |
| | | // string configKey = "GetOutBoundTrayTaskAsync"; |
| | | // string requestParam = new CreateTaskDto() |
| | | // { |
| | | // WarehouseId = position.WarehouseId, |
| | | // TargetAddress = childDeviceCode |
| | | // }.Serialize(); |
| | | // DateTime startTime = DateTime.Now; |
| | | |
| | | var responseResult = _httpClientHelper.Post<WebResponseContent>(configKey, requestParam); |
| | | // var responseResult = _httpClientHelper.Post<WebResponseContent>(configKey, requestParam); |
| | | |
| | | _lastPalletCheckTime[childDeviceCode] = DateTime.Now; |
| | | // _lastPalletCheckTime[childDeviceCode] = DateTime.Now; |
| | | |
| | | // å¦æè¯·æ±æåï¼æ¥æ¶ WMS è¿åçä»»å¡ |
| | | if (responseResult.IsSuccess && responseResult.Data.Status) |
| | | { |
| | | QuartzLogHelper.LogInfo(_logger, $"è°ç¨WMSæ¥å£æå,æ¥å£:ã{configKey}ã,请æ±åæ°:ã{requestParam}ã,ååºæ°æ®:ã{responseResult.Data?.Data}ã,èæ¶:{(DateTime.Now - startTime).TotalMilliseconds}ms", conveyorLine.DeviceCode); |
| | | var wmsTask = JsonConvert.DeserializeObject<WMSTaskDTO>(responseResult.Data.Data.ToString()); |
| | | List<WMSTaskDTO> taskDTOs = new List<WMSTaskDTO> { wmsTask }; |
| | | if (wmsTask != null) |
| | | _taskService.ReceiveWMSTask(taskDTOs); |
| | | } |
| | | else |
| | | { |
| | | QuartzLogHelper.LogError(_logger, $"è°ç¨WMSæ¥å£å¤±è´¥,æ¥å£:ã{configKey}ã,请æ±åæ°:ã{requestParam}ã,é误信æ¯:ã{responseResult.Data?.Message}ã", conveyorLine.DeviceCode); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | // // å¦æè¯·æ±æåï¼æ¥æ¶ WMS è¿åçä»»å¡ |
| | | // if (responseResult.IsSuccess && responseResult.Data.Status) |
| | | // { |
| | | // QuartzLogHelper.LogInfo(_logger, $"è°ç¨WMSæ¥å£æå,æ¥å£:ã{configKey}ã,请æ±åæ°:ã{requestParam}ã,ååºæ°æ®:ã{responseResult.Data?.Data}ã,èæ¶:{(DateTime.Now - startTime).TotalMilliseconds}ms", conveyorLine.DeviceCode); |
| | | // var wmsTask = JsonConvert.DeserializeObject<WMSTaskDTO>(responseResult.Data.Data.ToString()); |
| | | // List<WMSTaskDTO> taskDTOs = new List<WMSTaskDTO> { wmsTask }; |
| | | // if (wmsTask != null) |
| | | // _taskService.ReceiveWMSTask(taskDTOs); |
| | | // } |
| | | // else |
| | | // { |
| | | // QuartzLogHelper.LogError(_logger, $"è°ç¨WMSæ¥å£å¤±è´¥,æ¥å£:ã{configKey}ã,请æ±åæ°:ã{requestParam}ã,é误信æ¯:ã{responseResult.Data?.Message}ã", conveyorLine.DeviceCode); |
| | | // } |
| | | // } |
| | | // } |
| | | //} |
| | | |
| | | #endregion æ£æµæ¯å¦éè¦ç©ºæç |
| | | |
| | |
| | | conveyorLine.SetValue(ConveyorLineDBNameNew.WCS_ACK, (short)1, childDeviceCode); |
| | | } |
| | | } |
| | | else if (!command.Barcode.IsNullOrEmpty() && (childDeviceCode == "11001" || childDeviceCode == "11010")) |
| | | { |
| | | var isWcsTask = _taskService.Db.Queryable<Dt_Task>().Any(x => x.PalletCode == command.Barcode && (x.TaskStatus == (int)TaskOutStatusEnum.OutNew || x.TaskStatus == (int)TaskInStatusEnum.InNew)); |
| | | var isRobotTask = _robotTaskService.Db.Queryable<Dt_RobotTask>().Any(x => x.RobotTargetAddressPalletCode == command.Barcode); |
| | | if (isWcsTask || isRobotTask) |
| | | { |
| | | continue; |
| | | } |
| | | //else if (!command.Barcode.IsNullOrEmpty() && (childDeviceCode == "11001" || childDeviceCode == "11010")) |
| | | //{ |
| | | // var isWcsTask = _taskService.Db.Queryable<Dt_Task>().Any(x => x.PalletCode == command.Barcode && (x.TaskStatus == (int)TaskOutStatusEnum.OutNew || x.TaskStatus == (int)TaskInStatusEnum.InNew)); |
| | | // var isRobotTask = _robotTaskService.Db.Queryable<Dt_RobotTask>().Any(x => x.RobotTargetAddressPalletCode == command.Barcode); |
| | | // if (isWcsTask || isRobotTask) |
| | | // { |
| | | // continue; |
| | | // } |
| | | |
| | | // è°ç¨ WMS å建空æçå
¥åºä»»å¡ |
| | | string configKey = nameof(ConfigKey.CreateTaskInboundAsync); |
| | | string requestParam = new CreateTaskDto() |
| | | { |
| | | PalletCode = command.Barcode, |
| | | SourceAddress = childDeviceCode, |
| | | TargetAddress = "GWSC1", // ç®æ å°å |
| | | Roadway = "GWSC1", // å··é |
| | | WarehouseId = 1, // ä»åº ID |
| | | PalletType = 1, // æçç±»åï¼é»è®¤ä¸º1ï¼ |
| | | TaskType = TaskTypeEnum.InEmpty.GetHashCode() // ä»»å¡ç±»åï¼å
¥åº/空æçå
¥åºï¼ |
| | | }.Serialize(); |
| | | DateTime startTime = DateTime.Now; |
| | | // // è°ç¨ WMS å建空æçå
¥åºä»»å¡ |
| | | // string configKey = nameof(ConfigKey.CreateTaskInboundAsync); |
| | | // string requestParam = new CreateTaskDto() |
| | | // { |
| | | // PalletCode = command.Barcode, |
| | | // SourceAddress = childDeviceCode, |
| | | // TargetAddress = "GWSC1", // ç®æ å°å |
| | | // Roadway = "GWSC1", // å··é |
| | | // WarehouseId = 1, // ä»åº ID |
| | | // PalletType = 1, // æçç±»åï¼é»è®¤ä¸º1ï¼ |
| | | // TaskType = TaskTypeEnum.InEmpty.GetHashCode() // ä»»å¡ç±»åï¼å
¥åº/空æçå
¥åºï¼ |
| | | // }.Serialize(); |
| | | // DateTime startTime = DateTime.Now; |
| | | |
| | | var responseResult = _httpClientHelper.Post<WebResponseContent>(configKey, requestParam); |
| | | // var responseResult = _httpClientHelper.Post<WebResponseContent>(configKey, requestParam); |
| | | |
| | | if (responseResult.IsSuccess && responseResult.Data.Status) |
| | | { |
| | | QuartzLogHelper.LogInfo(_logger, $"è°ç¨WMSæ¥å£æå,æ¥å£:ã{configKey}ã,请æ±åæ°:ã{requestParam}ã,ååºæ°æ®:ã{responseResult.Data?.Data}ã,èæ¶:{(DateTime.Now - startTime).TotalMilliseconds}ms", conveyorLine.DeviceCode); |
| | | var wmsTask = JsonConvert.DeserializeObject<WMSTaskDTO>(responseResult?.Data?.Data?.ToString()); |
| | | List<WMSTaskDTO> taskDTOs = new List<WMSTaskDTO> { wmsTask }; |
| | | if (wmsTask == null) continue; |
| | | // if (responseResult.IsSuccess && responseResult.Data.Status) |
| | | // { |
| | | // QuartzLogHelper.LogInfo(_logger, $"è°ç¨WMSæ¥å£æå,æ¥å£:ã{configKey}ã,请æ±åæ°:ã{requestParam}ã,ååºæ°æ®:ã{responseResult.Data?.Data}ã,èæ¶:{(DateTime.Now - startTime).TotalMilliseconds}ms", conveyorLine.DeviceCode); |
| | | // var wmsTask = JsonConvert.DeserializeObject<WMSTaskDTO>(responseResult?.Data?.Data?.ToString()); |
| | | // List<WMSTaskDTO> taskDTOs = new List<WMSTaskDTO> { wmsTask }; |
| | | // if (wmsTask == null) continue; |
| | | |
| | | if (_taskService.ReceiveWMSTask(taskDTOs).Status) |
| | | { |
| | | conveyorLine.SetValue(ConveyorLineDBNameNew.WCS_ACK, (short)1, childDeviceCode); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | QuartzLogHelper.LogError(_logger, $"è°ç¨WMSæ¥å£å¤±è´¥,æ¥å£:ã{configKey}ã,请æ±åæ°:ã{requestParam}ã,é误信æ¯:ã{responseResult.Data?.Message}ã", conveyorLine.DeviceCode); |
| | | } |
| | | } |
| | | // if (_taskService.ReceiveWMSTask(taskDTOs).Status) |
| | | // { |
| | | // conveyorLine.SetValue(ConveyorLineDBNameNew.WCS_ACK, (short)1, childDeviceCode); |
| | | // } |
| | | // } |
| | | // else |
| | | // { |
| | | // QuartzLogHelper.LogError(_logger, $"è°ç¨WMSæ¥å£å¤±è´¥,æ¥å£:ã{configKey}ã,请æ±åæ°:ã{requestParam}ã,é误信æ¯:ã{responseResult.Data?.Message}ã", conveyorLine.DeviceCode); |
| | | // } |
| | | //} |
| | | } |
| | | } |
| | | catch (Exception innerEx) |
| | |
| | | PalletCode = currentTask.RobotSourceAddressPalletCode; // ä½¿ç¨æºå°åçæçç
|
| | | if (isRoadway == "HCSC1")
|
| | | {
|
| | | warehouseId = 2;
|
| | | warehouseId = 3;
|
| | | roadway = "HCSC1";
|
| | | }
|
| | | else if (isRoadway == "GWSC1")
|
| | |
| | | taskType = TaskTypeEnum.InEmpty.GetHashCode(); // 空æçå
¥åº
|
| | | PalletCode = currentTask.RobotSourceAddressPalletCode; // ä½¿ç¨æºå°åçæçç
|
| | |
|
| | | warehouseId = 3;
|
| | | warehouseId = 2;
|
| | | roadway = "CWSC1";
|
| | |
|
| | | SourceAddress = currentTask.RobotSourceAddressLineCode;
|
| | |
| | |
|
| | | if (isRoadway == "HCSC1")
|
| | | {
|
| | | warehouseId = 2;
|
| | | warehouseId = 3;
|
| | | roadway = "HCSC1";
|
| | | }
|
| | | else if (isRoadway == "GWSC1")
|
| | |
| | | var sameStationTasks = _taskService |
| | | .QueryStackerCraneOutTasks(deviceCode, new List<string> { candidateTask.NextAddress }) |
| | | .Where(x => x.TaskId != candidateTask.TaskId && x.TargetAddress != candidateTask.TargetAddress) |
| | | .GroupBy(x => x.TargetAddress) |
| | | .Select(g => g.FirstOrDefault()) |
| | | .ToList(); |
| | | |
| | | foreach (var sameStationTask in sameStationTasks) |
| | |
| | | { |
| | | // å
è¿è¡æ¬å°ç«å°æ£æ¥ï¼PLC 读åï¼å¿«éï¼ï¼é¿å
ä¸å¿
è¦ç WMS HTTP è°ç¨ |
| | | |
| | | if (outboundTask.TaskType != (int)TaskOutboundTypeEnum.OutEmpty) |
| | | if (outboundTask.TaskType != (int)TaskOutboundTypeEnum.OutEmpty && outboundTask.Roadway != "GWSC1" && outboundTask.TargetAddress != "CWSC1") |
| | | { |
| | | // 夿 TargetAddress è¾é线ç«å°æ¯å¦ç©ºé² |
| | | if (!IsTargetAddressConveyorStationAvailable(outboundTask)) |
| | |
| | | return null; |
| | | } |
| | | |
| | | // æ£æ¥æ¯å¦ææ£å¨æ§è¡çè¾é线任å¡å»å¾åä¸ TargetAddress |
| | | if (_taskService.HasExecutingTaskToTarget(outboundTask.Roadway, outboundTask.TargetAddress)) |
| | | if (outboundTask.TargetAddress != "CWSC1") |
| | | { |
| | | QuartzLogHelper.LogInfo(_logger, "TrySelectOutboundTaskï¼TargetAddress: {TargetAddress} å·²ææ£å¨æ§è¡çè¾é线任å¡ï¼ä»»å¡å·: {TaskNum}", |
| | | $"TrySelectOutboundTaskï¼TargetAddress: {outboundTask.TargetAddress} å·²ææ£å¨æ§è¡çè¾é线任å¡", outboundTask.Roadway, outboundTask.TargetAddress, outboundTask.TaskNum); |
| | | return null; |
| | | // æ£æ¥æ¯å¦ææ£å¨æ§è¡çè¾é线任å¡å»å¾åä¸ TargetAddress |
| | | if (_taskService.HasExecutingTaskToTarget(outboundTask.Roadway, outboundTask.TargetAddress)) |
| | | { |
| | | QuartzLogHelper.LogInfo(_logger, "TrySelectOutboundTaskï¼TargetAddress: {TargetAddress} å·²ææ£å¨æ§è¡çè¾é线任å¡ï¼ä»»å¡å·: {TaskNum}", |
| | | $"TrySelectOutboundTaskï¼TargetAddress: {outboundTask.TargetAddress} å·²ææ£å¨æ§è¡çè¾é线任å¡", outboundTask.Roadway, outboundTask.TargetAddress, outboundTask.TaskNum); |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | if(outboundTask.Roadway != "GWSC1") |
| | | { |
| | | return outboundTask; |
| | | } |
| | | // ç«å°æ£æ¥éè¿åï¼è°ç¨ WMS 夿æ¯å¦éè¦ç§»åº |
| | | var taskAfterTransferCheck = _transferCheck(outboundTask.TaskNum) ?? outboundTask; |
| | | var taskGroup = taskAfterTransferCheck.TaskType.GetTaskTypeGroup(); |
| | |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®å··éè·å空é²è´§ä½ä¿¡æ¯ |
| | | /// æåºçç¥ï¼æ·±åº¦ä¼å
ï¼äºæ·±ä½ä¼å
ï¼ï¼å
¶æ¬¡æå±ãåãè¡ååº |
| | | /// </summary> |
| | | /// <param name="roadwayNo">å··éç¼å·</param> |
| | | /// <returns>空é²è´§ä½ä¿¡æ¯ï¼å¦ææªæ¾å°åè¿ånull</returns> |
| | | /// <returns>空é²è´§ä½ä¿¡æ¯ï¼å¦æç©ºé²è´§ä½ä¸è¶³åè¿ånull</returns> |
| | | public async Task<Dt_LocationInfo?> GetLocationInfo(string roadwayNo) |
| | | { |
| | | var locations = await BaseDal.QueryDataAsync(x => |
| | | x.EnableStatus == EnableStatusEnum.Normal.GetHashCode() && |
| | | x.RoadwayNo == roadwayNo && |
| | | x.LocationStatus == LocationStatusEnum.Free.GetHashCode() && |
| | | (roadwayNo.Contains("HC") |
| | | ? x.LocationType == (int)LocationTypeEnum.Capacity |
| | | : x.LocationType == (int)LocationTypeEnum.ShelfCapacity)); |
| | | // HC å··éä½¿ç¨ Capacity ç±»åï¼å
¶ä»å··éä½¿ç¨ ShelfCapacity ç±»å |
| | | var locationType = roadwayNo.Contains("HC") |
| | | ? (int)LocationTypeEnum.Capacity |
| | | : (int)LocationTypeEnum.ShelfCapacity; |
| | | |
| | | return locations? |
| | | .OrderByDescending(x => x.Depth) // 1. 深度ä¼å
ï¼ä»å¤§å°å°ï¼ |
| | | .ThenBy(x => x.Layer) // 2. 屿° |
| | | .ThenBy(x => x.Column) // 3. å |
| | | .ThenBy(x => x.Row) // 4. è¡ |
| | | .FirstOrDefault(); |
| | | var enableStatus = EnableStatusEnum.Normal.GetHashCode(); |
| | | var freeStatus = LocationStatusEnum.Free.GetHashCode(); |
| | | |
| | | // æ°æ®åºç«¯ COUNT æ£æ¥ç©ºé²è´§ä½æ°éï¼ä»
è¿åä¸ä¸ªæ°åï¼æ æ°æ®ä¼ è¾å¼éï¼ |
| | | var freeCount = await BaseDal.Db.Queryable<Dt_LocationInfo>() |
| | | .Where(x => x.EnableStatus == enableStatus |
| | | && x.RoadwayNo == roadwayNo |
| | | && x.LocationStatus == freeStatus |
| | | && x.LocationType == locationType) |
| | | .CountAsync(); |
| | | |
| | | // 空é²è´§ä½ä¸è¶³æä½ä¿çæ°éæ¶è¿ånullï¼é¿å
å°å··éåé
èå°½ |
| | | const int minFreeLocationThreshold = 5; |
| | | if (freeCount < minFreeLocationThreshold) return null; |
| | | |
| | | // æ°æ®åºç«¯æåºåç¬¬ä¸æ¡ï¼åªä¼ è¾åè¡æ°æ®ï¼ |
| | | return await BaseDal.Db.Queryable<Dt_LocationInfo>() |
| | | .Where(x => x.EnableStatus == enableStatus |
| | | && x.RoadwayNo == roadwayNo |
| | | && x.LocationStatus == freeStatus |
| | | && x.LocationType == locationType) |
| | | .OrderByDescending(x => x.Depth) |
| | | .OrderBy(x => x.Layer) |
| | | .OrderBy(x => x.Column) |
| | | .OrderBy(x => x.Row) |
| | | .FirstAsync(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | // å¤æè¯¥ä½ç½®æ¯å¦æåºå |
| | | var stockInfo = await _stockInfoRepository.QueryDataNavFirstAsync(x => |
| | | x.LocationCode == newLocationID && |
| | | x.StockStatus == StockStatusEmun.å
¥åºå®æ.GetHashCode() && |
| | | (x.StockStatus == StockStatusEmun.å
¥åºå®æ.GetHashCode() || x.StockStatus == StockStatusEmun.空æçåºå.GetHashCode()) && |
| | | x.LocationDetails.LocationStatus == LocationStatusEnum.InStock.GetHashCode()); |
| | | if (stockInfo == null) |
| | | { |
| | |
| | | |
| | | #endregion ç§ææ¹æ³ |
| | | } |
| | | } |
| | | } |
| | |
| | | /// <summary> |
| | | /// 常温1å·åºåºå°å |
| | | /// </summary> |
| | | public const string CW1_ADDRESS = "22001"; |
| | | public const string CW1_ADDRESS = "11085"; |
| | | |
| | | /// <summary> |
| | | /// å容åºåºåºå°å |
| | |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Reflection; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.Const; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_Core.Helper; |
| | |
| | | public int Total { get; set; } |
| | | public string TableName { get; set; } |
| | | public string Sort { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æåºæ¹å¼ |
| | | /// </summary> |
| | | public string Order { get; set; } |
| | | |
| | | public string Wheres { get; set; } |
| | | public bool Export { get; set; } |
| | | public object Value { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¥è¯¢æ¡ä»¶ |
| | | /// </summary> |
| | | public List<SearchParameters> Filter { get; set; } |
| | | |
| | | |
| | | |
| | | public string ValidatePageOptions(PropertyInfo[] entityProperties) |
| | | { |
| | |
| | | return where; |
| | | } |
| | | |
| | | |
| | | public Dictionary<string, OrderByType> GetPageDataSort(PropertyInfo[] propertyInfo) |
| | | { |
| | | if (!string.IsNullOrEmpty(Sort)) |
| | |
| | | return new Dictionary<string, OrderByType> { { "CreateDate", Order?.ToLower() == OrderByType.Asc.ToString() ? OrderByType.Asc : OrderByType.Desc } }; |
| | | } |
| | | } |
| | | |
| | | public class SearchParameters |
| | | { |
| | | public string Name { get; set; } |
| | | public string Value { get; set; } |
| | | |
| | | //æ¥è¯¢ç±»åï¼LinqExpressionType |
| | | public string DisplayType { get; set; } |
| | | } |
| | | } |
| | | } |
| | |
| | | public WebResponseContent OK() |
| | | { |
| | | Status = true; |
| | | Code = 200; |
| | | return this; |
| | | } |
| | | |
| | |
| | | public WebResponseContent OK(string? message = null, object? data = null) |
| | | { |
| | | Status = true; |
| | | Message = message; |
| | | Data = data; |
| | | Code = 200; |
| | | Message = message ?? "è¯·æ±æå"; |
| | | Data = data ?? new { }; |
| | | return this; |
| | | } |
| | | |
| | | public WebResponseContent Error(string? message = null) |
| | | { |
| | | Status = false; |
| | | Message = message; |
| | | Message = message ?? "请æ±å¤±è´¥"; |
| | | return this; |
| | | } |
| | | } |
| | |
| | | using WIDESEA_Core.DB.Models; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_Core.Helper; |
| | | |
| | | //using WIDESEA_Core.HostedService; |
| | | using WIDESEA_Core.Utilities; |
| | | using ICacheService = WIDESEA_Core.Caches.ICacheService; |
| | |
| | | } |
| | | |
| | | private PropertyInfo[] _propertyInfo { get; set; } = null; |
| | | |
| | | public PropertyInfo[] TProperties |
| | | { |
| | | get |
| | |
| | | string? value = propertyValue?.ToString(); |
| | | if (value == null) return p => true; |
| | | |
| | | |
| | | parameter = parameter ?? Expression.Parameter(typeof(TEntity), "x"); |
| | | //å建èç¹ç屿§p=>p.name 屿§name |
| | | MemberExpression memberProperty = Expression.PropertyOrField(parameter, propertyName); |
| | |
| | | case LinqExpressionType.Equal: |
| | | expression = Expression.Lambda<Func<TEntity, bool>>(Expression.Equal(member, constant), parameter); |
| | | break; |
| | | |
| | | case LinqExpressionType.NotEqual: |
| | | expression = Expression.Lambda<Func<TEntity, bool>>(Expression.NotEqual(member, constant), parameter); |
| | | break; |
| | | |
| | | case LinqExpressionType.GreaterThan: |
| | | expression = Expression.Lambda<Func<TEntity, bool>>(Expression.GreaterThan(member, constant), parameter); |
| | | break; |
| | | |
| | | case LinqExpressionType.LessThan: |
| | | expression = Expression.Lambda<Func<TEntity, bool>>(Expression.LessThan(member, constant), parameter); |
| | | break; |
| | | |
| | | case LinqExpressionType.ThanOrEqual: |
| | | expression = Expression.Lambda<Func<TEntity, bool>>(Expression.GreaterThanOrEqual(member, constant), parameter); |
| | | break; |
| | | |
| | | case LinqExpressionType.LessThanOrEqual: |
| | | expression = Expression.Lambda<Func<TEntity, bool>>(Expression.LessThanOrEqual(member, constant), parameter); |
| | | break; |
| | | |
| | | case LinqExpressionType.Contains: |
| | | case LinqExpressionType.NotContains: |
| | | MethodInfo? method = typeof(string).GetMethod("Contains", new[] { typeof(string) }); |
| | |
| | | expression = p => true; |
| | | } |
| | | break; |
| | | |
| | | default: |
| | | expression = p => false; |
| | | break; |
| | |
| | | } |
| | | return new Dictionary<string, OrderByType> { { "CreateDate", pageData.Order?.ToLower() == OrderByType.Asc.ToString() ? OrderByType.Asc : OrderByType.Desc } }; |
| | | } |
| | | |
| | | |
| | | |
| | | //private string GetDataRole(Type type) |
| | | //{ |
| | |
| | | { |
| | | content = WebResponseContent.Instance.Error("æªæ¾å°ä¸»è¡¨ä¸»é®å¼"); |
| | | } |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | return content; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | using Autofac; |
| | | using Autofac.Extras.DynamicProxy; |
| | | using HslCommunication.WebSocket; |
| | | using Microsoft.Extensions.DependencyModel; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.Text; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Reflection; |
| | | using System.Runtime.Loader; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.AOP; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.BaseServices; |
| | |
| | | { |
| | | cacheType.Add(typeof(LogAOP)); |
| | | } |
| | | |
| | | |
| | | builder.RegisterGeneric(typeof(RepositoryBase<>)).As(typeof(IRepository<>)).InstancePerDependency();//注åä»å¨ |
| | | builder.RegisterGeneric(typeof(ServiceBase<,>)).As(typeof(IService<>)).InstancePerDependency();//注åæå¡ |
| | | |
| | |
| | | builder.RegisterType<RequestLogModel>().InstancePerLifetimeScope(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.Extensions.Logging; |
| | | using Newtonsoft.Json; |
| | | using Org.BouncyCastle.Asn1.Ocsp; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Net; |
| | | using System.Text; |
| | | using System.Text.RegularExpressions; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_Core.LogHelper; |
| | | |
| | |
| | | public class ApiLogMiddleware |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// |
| | | /// </summary> |
| | | private readonly RequestDelegate _next; |
| | | |
| | |
| | | var json = new WebResponseContent(); |
| | | |
| | | json.Message = HttpStatusCode.InternalServerError.ToString();//éè¯¯ä¿¡æ¯ |
| | | json.Code = 500;//500å¼å¸¸ |
| | | json.Code = 500;//500å¼å¸¸ |
| | | |
| | | StreamWriter streamWriter = new StreamWriter(context.Response.Body); |
| | | await streamWriter.WriteAsync(json.Serialize()); |
| | |
| | | catch (Exception ex) |
| | | { |
| | | // è®°å½å¼å¸¸ |
| | | |
| | | } |
| | | finally |
| | | { |
| | |
| | | return ""; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | public int IsNormalProcedure { get; set; } |
| | | |
| | | /// <summary> |
| | | /// çµè¯æ°æ® |
| | | /// </summary> |
| | | public CellCodeData Data { get; set; } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// çµè¯æ¡ç |
| | | /// </summary> |
| | | public class CellCodeData |
| | | { |
| | | |
| | | |
| | | /// <summary> |
| | | /// ééå· |
| | | /// </summary> |
| | | public string Channel { get; set; } |
| | |
| | | Task<Dt_StockInfo> GetStockInfoAsync(string palletCode, string locationCode); |
| | | |
| | | /// <summary> |
| | | /// æ£ç´¢æå®è´§ä½å¨ç»å®ä»åºçåºå详ç»ä¿¡æ¯ |
| | | /// </summary> |
| | | /// <param name="warehouseId">ä»åºID</param> |
| | | /// <param name="locationCode">è´§ä½ç¼ç </param> |
| | | /// <returns>åºåä¿¡æ¯</returns> |
| | | Task<Dt_StockInfo> GetStockInfoAsync(int warehouseId, string locationCode); |
| | | |
| | | /// <summary> |
| | | /// è·åä»åº3Då¸å±æ°æ® |
| | | /// </summary> |
| | | /// <param name="warehouseId">ä»åºID</param> |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ£ç´¢æå®è´§ä½å¨ç»å®ä»åºçåºå详ç»ä¿¡æ¯ |
| | | /// </summary> |
| | | /// <param name="warehouseId">ä»åºID</param> |
| | | /// <param name="locationCode">è´§ä½ç¼ç </param> |
| | | /// <returns>åºåä¿¡æ¯</returns> |
| | | public async Task<Dt_StockInfo> GetStockInfoAsync(int warehouseId, string locationCode) |
| | | { |
| | | return await BaseDal.QueryDataNavFirstAsync(x => x.WarehouseId == warehouseId && x.LocationCode == locationCode); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åä»åº3Då¸å±æ°æ® |
| | | /// </summary> |
| | | /// <param name="warehouseId">ä»åºID</param> |
| | |
| | | using Mapster; |
| | | using MapsterMapper; |
| | | using Microsoft.Extensions.Configuration; |
| | | using SqlSugar; |
| | | using System.DirectoryServices.Protocols; |
| | | using System.Text.Json; |
| | | using WIDESEA_Common.Constants; |
| | | using WIDESEA_Common.LocationEnum; |
| | | using WIDESEA_Common.StockEnum; |
| | | using WIDESEA_Common.TaskEnum; |
| | | using WIDESEA_Common.WareHouseEnum; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Core; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_DTO.GradingMachine; |
| | | using WIDESEA_DTO.MES; |
| | | using WIDESEA_DTO.Stock; |
| | | using WIDESEA_DTO.Task; |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_IStockService; |
| | | using WIDESEA_ITaskInfoService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_TaskInfoService |
| | |
| | | public async Task<WebResponseContent> InOrOutCompletedAsync(GradingMachineInputDto input) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | if (string.IsNullOrWhiteSpace(input.PalletCode) || string.IsNullOrWhiteSpace(input.LocationCode)) |
| | | if (string.IsNullOrWhiteSpace(input.LocationCode)) |
| | | { |
| | | return content.Error($"æçå·æè
è´§ä½ç¼å·ä¸è½ä¸ºç©º"); |
| | | return content.Error($"è´§ä½ç¼å·ä¸è½ä¸ºç©º"); |
| | | } |
| | | |
| | | try |
| | | { |
| | | var stockInfo = await _stockInfoService.GetStockInfoAsync(input.PalletCode, input.LocationCode); |
| | | var stockInfo = await _stockInfoService.GetStockInfoAsync(3, input.LocationCode); |
| | | |
| | | int locationStatus; |
| | | if (stockInfo == null) |
| | | { |
| | | var location = await _locationInfoService.GetLocationInfoAsync(input.LocationCode); |
| | | locationStatus = location?.LocationStatus == (int)LocationStatusEnum.InStock ? 10 : 0; |
| | | } |
| | | else |
| | | { |
| | | locationStatus = MapLocationStatus(stockInfo.StockStatus); |
| | | } |
| | | return content.Error("WMSæªæ¾å°åºåä¿¡æ¯"); |
| | | locationStatus = MapLocationStatus(stockInfo.StockStatus); |
| | | |
| | | int MapLocationStatus(int stockStatus) => stockStatus switch |
| | | { |
| | |
| | | OutputDto outPutDto = new OutputDto() |
| | | { |
| | | LocationCode = input.LocationCode, |
| | | PalletCode = input.PalletCode, |
| | | PalletCode = stockInfo.PalletCode, |
| | | IsNormalProcedure = 1, |
| | | LocationStatus = locationStatus |
| | | }; |
| | |
| | | { |
| | | return content.Error("æªæ¾å°å¯¹åºçæç"); |
| | | } |
| | | var outPutDtos = stockInfo.Details.Select(x => new OutputDto() |
| | | |
| | | var outPutDtos = new |
| | | { |
| | | LocationCode = input.LocationCode, |
| | | PalletCode = input.PalletCode, |
| | | input.LocationCode, |
| | | input.PalletCode, |
| | | IsNormalProcedure = 1, |
| | | LocationStatus = stockInfo.LocationDetails.LocationStatus, |
| | | CellCode = x.SerialNumber, |
| | | Channel = x.InboundOrderRowNo.ToString() |
| | | }).ToList(); |
| | | stockInfo.LocationDetails.LocationStatus, |
| | | Data = stockInfo.Details.Select(x => new CellCodeData |
| | | { |
| | | CellCode = x.SerialNumber, |
| | | Channel = x.InboundOrderRowNo.ToString() |
| | | }).ToList() |
| | | }; |
| | | return content.OK(data: outPutDtos); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | // 1. æ¥è¯¢å°æåºå |
| | | var expiredStocks = await _stockInfoService.Repository |
| | | .QueryDataNavAsync(s => s.OutboundDate <= DateTime.Now |
| | | && s.StockStatus == StockStatusEmun.å
¥åºå®æ.GetHashCode()); |
| | | && s.StockStatus == StockStatusEmun.å
¥åºå®æ.GetHashCode() && s.WarehouseId != 3); |
| | | |
| | | if (expiredStocks == null || !expiredStocks.Any()) |
| | | { |
| | |
| | | WebResponseContent content = new WebResponseContent(); |
| | | stockInfo.LocationCode = location.LocationCode; |
| | | stockInfo.LocationId = location.Id; |
| | | stockInfo.WarehouseId = task.WarehouseId; |
| | | |
| | | SetOutboundDateByRoadway(task, stockInfo); |
| | | |
| | |
| | | TaskNum = await BaseDal.GetTaskNo(), |
| | | PalletCode = task.PalletCode, |
| | | PalletType = task.PalletType, |
| | | Roadway = "CW1", |
| | | Roadway = "CWSC1", |
| | | TaskType = TaskInboundTypeEnum.Inbound.GetHashCode(), |
| | | TaskStatus = TaskInStatusEnum.InNew.GetHashCode(), |
| | | SourceAddress = task.TargetAddress, |
| | | SourceAddress = "11042", |
| | | TargetAddress = task.TargetAddress, |
| | | CurrentAddress = task.TargetAddress, |
| | | CurrentAddress = "11042", |
| | | NextAddress = task.TargetAddress, |
| | | WarehouseId = (int)WarehouseEnum.CW1, |
| | | Grade = 1, |
| | |
| | | return WebResponseContent.Instance.OK("ä»»å¡å建æå", taskDTO); |
| | | } |
| | | |
| | | var stockInfo = await _stockInfoService.Repository.QueryDataNavFirstAsync(x => x.LocationDetails.WarehouseId == taskDto.WarehouseId && x.LocationDetails.LocationStatus == LocationStatusEnum.InStock.GetHashCode() && x.StockStatus == StockStatusEmun.空æçåºå.GetHashCode()); |
| | | var stockInfo = await _stockInfoService.Repository.QueryDataNavFirstAsync(x => x.LocationDetails.WarehouseId == taskDto.WarehouseId && x.LocationDetails.LocationStatus == LocationStatusEnum.InStock.GetHashCode() && x.StockStatus == StockStatusEmun.空æçåºå.GetHashCode() && x.LocationDetails.EnableStatus == (int)EnableStatusEnum.Normal); |
| | | if (stockInfo == null) |
| | | return WebResponseContent.Instance.Error("æªæ¾å°å¯¹åºçåºåä¿¡æ¯"); |
| | | |
| | |
| | | using Microsoft.Extensions.Hosting; |
| | | using Microsoft.Extensions.Logging; |
| | | using Microsoft.Extensions.Options; |
| | | using System; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.Core; |
| | | using WIDESEA_ITaskInfoService; |
| | | |
| | |
| | | await base.StopAsync(cancellationToken); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | using Microsoft.AspNetCore.SignalR; |
| | | using Microsoft.Extensions.DependencyInjection; |
| | | using Microsoft.Extensions.Hosting; |
| | | using Microsoft.Extensions.Logging; |
| | | using System; |
| | | using System.Collections.Concurrent; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_IStockService; |
| | | using WIDESEA_Model.Models; |
| | |
| | | /// åå«è·è¸ªè´§ä½ãåºå主表ãåºåæç»ï¼é¿å
æ¯æ¬¡å
¨è¡¨æ«æã |
| | | /// </summary> |
| | | private DateTime _lastLocationCheckTime = DateTime.MinValue; |
| | | |
| | | private DateTime _lastStockCheckTime = DateTime.MinValue; |
| | | private DateTime _lastDetailCheckTime = DateTime.MinValue; |
| | | |
| | |
| | | "å¢éåºååæ´æ¨éï¼LocationId={LocationId}ï¼LocationStatus={LocationStatus}ï¼StockStatus={StockStatus}ï¼Quantity={Quantity}", |
| | | snapshot.LocationId, |
| | | snapshot.LocationStatus, |
| | | snapshot.StockStatus, |
| | | snapshot.StockStatus, |
| | | snapshot.OutboundDate, |
| | | snapshot.StockQuantity); |
| | | } |
| | |
| | | public int LocationId { get; set; } |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | /// </summary> |
| | | /// <param name="taskNum"></param> |
| | | /// <returns></returns> |
| | | [HttpGet, HttpPost, Route("TransferCheck"),AllowAnonymous] |
| | | [HttpGet, HttpPost, Route("TransferCheck"), AllowAnonymous] |
| | | public async Task<WebResponseContent?> TransferCheckAsync([FromBody] int taskNum) |
| | | { |
| | | return await Service.TransferCheckAsync(taskNum); |
| | |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_Model.Models; |
| | |
| | | { |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | using Autofac.Core; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.CodeConfigEnum; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_DTO.Basic; |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | |
| | | public MaterielInfoController(IMaterielInfoService service) : base(service) |
| | | { |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_Model.Models; |
| | |
| | | public PalletCodeInfoController(IPalletCodeInfoService service) : base(service) |
| | | { |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_IBasicService; |
| | |
| | | return WebResponseContent.Instance.OK(data: result); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_ICheckService; |
| | | using WIDESEA_Model.Models; |
| | |
| | | public CheckOrderController(ICheckOrderService service) : base(service) |
| | | { |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_ICheckService; |
| | | using WIDESEA_Model.Models; |
| | |
| | | public CheckOrderResultController(ICheckOrderResultService service) : base(service) |
| | | { |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | return WebResponseContent.Instance.Error($"æ¯æ¥ç»è®¡è·å失败: {ex.Message}");
|
| | | }
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// æ¯å¨ç»è®¡
|
| | | /// </summary>
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | } |
| | |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_DTO.Inbound; |
| | | using WIDESEA_IInboundService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | |
| | | public InboundOrderController(IInboundOrderService service) : base(service) |
| | | { |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_IInboundService; |
| | | using WIDESEA_Model.Models; |
| | |
| | | public InboundOrderDetailController(IInboundOrderDetailService service) : base(service) |
| | | { |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_DTO.Inbound; |
| | | using WIDESEA_IInboundService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | |
| | | { |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_DTO.Inbound; |
| | | using WIDESEA_IInboundService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | |
| | | { |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | using Autofac.Core; |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core; |
| | |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_IOutboundService; |
| | | using WIDESEA_Model.Models; |
| | |
| | | public OutStockLockInfoController(IOutStockLockInfoService service) : base(service) |
| | | { |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | using Autofac.Core; |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_Core.CodeConfigEnum; |
| | | using WIDESEA_DTO.Inbound; |
| | | using WIDESEA_DTO.Outbound; |
| | | using WIDESEA_IOutboundService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | |
| | | { |
| | | public OutboundOrderController(IOutboundOrderService service) : base(service) |
| | | { |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_DTO.Stock; |
| | | using WIDESEA_IOutboundService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | |
| | | public OutboundOrderDetailController(IOutboundOrderDetailService service) : base(service) |
| | | { |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_DTO.Inbound; |
| | | using WIDESEA_IInboundService; |
| | | using WIDESEA_IOutboundService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | |
| | | { |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_DTO.Inbound; |
| | | using WIDESEA_IInboundService; |
| | | using WIDESEA_IOutboundService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | |
| | | { |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using System.IO; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_DTO.Inbound; |
| | | using WIDESEA_IInboundService; |
| | | using WIDESEA_IOutboundService; |
| | | using WIDESEA_ITaskInfoService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers |
| | | { |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_IRecordService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers.Record |
| | | { |
| | | /// <summary> |
| | | /// è´§ä½ç¶æåå¨è®°å½ |
| | | /// </summary> |
| | | [Route("api/LocationStatusChangeRecord")] |
| | | [ApiController] |
| | | public class LocationStatusChangeRecordController : ApiBaseController<ILocationStatusChangeRecordService, Dt_LocationStatusChangeRecord> |
| | | { |
| | | public LocationStatusChangeRecordController(ILocationStatusChangeRecordService service) : base(service) |
| | | { |
| | | using Microsoft.AspNetCore.Authorization;
|
| | | using Microsoft.AspNetCore.Mvc;
|
| | | using WIDESEA_Core;
|
| | | using WIDESEA_Core.BaseController;
|
| | | using WIDESEA_IRecordService;
|
| | | using WIDESEA_Model.Models;
|
| | |
|
| | | namespace WIDESEA_WMSServer.Controllers.Record
|
| | | {
|
| | | /// <summary>
|
| | | /// è´§ä½ç¶æåå¨è®°å½
|
| | | /// </summary>
|
| | | [Route("api/LocationStatusChangeRecord")]
|
| | | [ApiController]
|
| | | public class LocationStatusChangeRecordController : ApiBaseController<ILocationStatusChangeRecordService, Dt_LocationStatusChangeRecord>
|
| | | {
|
| | | public LocationStatusChangeRecordController(ILocationStatusChangeRecordService service) : base(service)
|
| | | {
|
| | | }
|
| | | /// <summary> |
| | | /// æ ¹æ®IDè·åè´§ä½ç¶æåå¨è®°å½ |
| | | /// </summary> |
| | | /// <param name="id">è´§ä½ç¶æåå¨è®°å½ID</param> |
| | | /// <returns>è´§ä½ç¶æåå¨è®°å½ä¿¡æ¯</returns> |
| | |
|
| | | /// <summary>
|
| | | /// æ ¹æ®IDè·åè´§ä½ç¶æåå¨è®°å½
|
| | | /// </summary>
|
| | | /// <param name="id">è´§ä½ç¶æåå¨è®°å½ID</param>
|
| | | /// <returns>è´§ä½ç¶æåå¨è®°å½ä¿¡æ¯</returns>
|
| | | [HttpPost("GetLocationState"), AllowAnonymous]
|
| | | public WebResponseContent GetLocationState(int id)
|
| | | {
|
| | |
| | | {
|
| | | return WebResponseContent.Instance.Error($"è·åè´§ä½ç¶æåå¨è®°å½å¤±è´¥: {ex.Message}");
|
| | | }
|
| | | } |
| | | } |
| | | } |
| | | }
|
| | | }
|
| | | } |
| | |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_IRecordService; |
| | | using WIDESEA_Model.Models; |
| | |
| | | { |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseController; |
| | |
| | | /// </summary> |
| | | /// <param name="stock"></param> |
| | | /// <returns></returns> |
| | | [HttpGet,HttpPost,Route("GroupPalletAsync"), AllowAnonymous] |
| | | public async Task<WebResponseContent> GroupPallet([FromBody]StockDTO stock) |
| | | [HttpGet, HttpPost, Route("GroupPalletAsync"), AllowAnonymous] |
| | | public async Task<WebResponseContent> GroupPallet([FromBody] StockDTO stock) |
| | | { |
| | | return await Service.GroupPalletAsync(stock); |
| | | } |
| | |
| | | /// </summary> |
| | | /// <param name="stock"></param> |
| | | /// <returns></returns> |
| | | [HttpGet, HttpPost, Route("ChangePalletAsync"),AllowAnonymous] |
| | | [HttpGet, HttpPost, Route("ChangePalletAsync"), AllowAnonymous] |
| | | public async Task<WebResponseContent> ChangePalletAsync([FromBody] StockDTO stock) |
| | | { |
| | | return await Service.ChangePalletAsync(stock); |
| | |
| | | return await Service.GetStockDetailCountByPalletCodeAsync(palletCode); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_DTO.Stock; |
| | | using WIDESEA_DTO.MES; |
| | | using WIDESEA_IStockService; |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_ISystemService; |
| | | using WIDESEA_Model.Models; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Common.Constants; |
| | | using WIDESEA_Common.StockEnum; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_DTO.MES; |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_IStockService; |
| | | using WIDESEA_ISystemService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers.Stock |
| | | { |
| | |
| | | return defaultValue; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_DTO.Stock; |
| | | using WIDESEA_IStockService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | |
| | | { |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_DTO.Stock; |
| | | using WIDESEA_IStockService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | |
| | | { |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Microsoft.Extensions.Options; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_DTO.Stock; |
| | | using WIDESEA_IStockService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers.Stock |
| | | { |
| | |
| | | public class StockViewController : Controller |
| | | { |
| | | private readonly IStockViewService _stockViewService; |
| | | public StockViewController(IStockViewService stockViewService) |
| | | |
| | | public StockViewController(IStockViewService stockViewService) |
| | | { |
| | | _stockViewService = stockViewService; |
| | | } |
| | |
| | | return _stockViewService.GetDetailPage(pageData); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Newtonsoft.Json; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_ISystemService; |
| | | using WIDESEA_Model.Models; |
| | | using WIDESEA_DTO.System; |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers |
| | | { |
| | |
| | | public class Sys_DictionaryController : ApiBaseController<ISys_DictionaryService, Sys_Dictionary> |
| | | { |
| | | private readonly IHttpContextAccessor _httpContextAccessor; |
| | | |
| | | public Sys_DictionaryController(ISys_DictionaryService service, IHttpContextAccessor httpContextAccessor) : base(service) |
| | | { |
| | | _httpContextAccessor = httpContextAccessor; |
| | |
| | | return Json(Service.GetVueDictionary(dicNos)); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_ISystemService; |
| | | using WIDESEA_Model.Models; |
| | |
| | | { |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | public class Sys_MenuController : ApiBaseController<ISys_MenuService, Sys_Menu> |
| | | { |
| | | private readonly IHttpContextAccessor _httpContextAccessor; |
| | | |
| | | public Sys_MenuController(ISys_MenuService menuService, IHttpContextAccessor httpContextAccessor) : base(menuService) |
| | | { |
| | | _httpContextAccessor = httpContextAccessor; |
| | | } |
| | | |
| | | [HttpGet, HttpPost, Route("getTreeMenu")] |
| | | public IActionResult GetTreeMenu() |
| | | { |
| | |
| | | return Json(WebResponseContent.Instance.Error("ä»
éè¶
级管çåä¿®æ¹æ°æ®")); |
| | | } |
| | | } |
| | | |
| | | [HttpPost, Route("delMenu")] |
| | | public WebResponseContent DelMenu(int menuId) |
| | | { |
| | |
| | | return Json(Service.GetTreeMenuPDAStash(ParentId)); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Microsoft.AspNetCore.Routing; |
| | | using WIDESEA_DTO.System; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_DTO.System; |
| | | using WIDESEA_ISystemService; |
| | | using WIDESEA_Model.Models; |
| | | using WIDESEA_Model.Models.System; |
| | |
| | | public class Sys_RoleController : ApiBaseController<ISys_RoleService, Sys_Role> |
| | | { |
| | | private readonly IHttpContextAccessor _httpContextAccessor; |
| | | |
| | | public Sys_RoleController(ISys_RoleService service, IHttpContextAccessor httpContextAccessor) : base(service) |
| | | { |
| | | _httpContextAccessor = httpContextAccessor; |
| | |
| | | { |
| | | return Json(Service.GetCurrentTreePermissionPDA()); |
| | | } |
| | | |
| | | [HttpPost, Route("getUserTreePermissionPDA")] |
| | | public IActionResult GetUserTreePermissionPDA(int roleId) |
| | | { |
| | |
| | | return Json(Service.SavePermissionPDA(userPermissions, roleId)); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | |  |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_Core.Const; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_Core.HttpContextUser; |
| | | using WIDESEA_ISystemService; |
| | | using WIDESEA_Model; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers |
| | |
| | | return Service.InitTenantInfo(tenantName, tenantType); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Microsoft.Extensions.Caching.Memory; |
| | | using Newtonsoft.Json; |
| | | using StackExchange.Profiling; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.Authorization; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_Core.Caches; |
| | | using WIDESEA_Core.Const; |
| | | using WIDESEA_Core.Extensions; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_Core.HttpContextUser; |
| | | using WIDESEA_Core.Utilities; |
| | | using WIDESEA_ISystemService; |
| | | using WIDESEA_Model; |
| | |
| | | |
| | | return Json(data); |
| | | } |
| | | |
| | | [HttpGet, Route("SerializeJwt"), AllowAnonymous] |
| | | public WebResponseContent SerializeJwt(string code) |
| | | { |
| | | return WebResponseContent.Instance.OK(data: JwtHelper.SerializeJwt(code)); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¿æ¢Tokenï¼å·æ°ä»¤çï¼ |
| | | /// </summary> |
| | |
| | | { |
| | | return responseContent.Error(ex.Message); |
| | | } |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ´æ°å¯ç |
| | | /// </summary> |
| | | /// <param name="password">å¯ç </param> |
| | | /// <param name="userName">ç¨æ·å</param> |
| | | /// <returns></returns> |
| | | [HttpPost,Route("ModifyUserPwd")] |
| | | [HttpPost, Route("ModifyUserPwd")] |
| | | public WebResponseContent ModifyUserPwd(string password, string userName) |
| | | { |
| | | return Service.ModifyUserPwd(password,userName); |
| | | return Service.ModifyUserPwd(password, userName); |
| | | } |
| | | } |
| | | |
| | |
| | | public string name { get; set; } |
| | | public string pwd { get; set; } |
| | | } |
| | | } |
| | | } |
| | |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using System.DirectoryServices.Protocols; |
| | | using WIDESEA_Common.CommonEnum; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_DTO.GradingMachine; |
| | |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_DTO.Stock; |
| | | using WIDESEA_ITaskInfoService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | |
| | | { |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | for details on configuring this project to bundle and minify static web assets. */ |
| | | |
| | | a.navbar-brand { |
| | | white-space: normal; |
| | | text-align: center; |
| | | word-break: break-all; |
| | | white-space: normal; |
| | | text-align: center; |
| | | word-break: break-all; |
| | | } |
| | | |
| | | /* Provide sufficient contrast against white background */ |
| | | a { |
| | | color: #0366d6; |
| | | color: #0366d6; |
| | | } |
| | | |
| | | .btn-primary { |
| | | color: #fff; |
| | | background-color: #1b6ec2; |
| | | border-color: #1861ac; |
| | | color: #fff; |
| | | background-color: #1b6ec2; |
| | | border-color: #1861ac; |
| | | } |
| | | |
| | | .nav-pills .nav-link.active, .nav-pills .show > .nav-link { |
| | | color: #fff; |
| | | background-color: #1b6ec2; |
| | | border-color: #1861ac; |
| | | color: #fff; |
| | | background-color: #1b6ec2; |
| | | border-color: #1861ac; |
| | | } |
| | | |
| | | /* Sticky footer styles |
| | | -------------------------------------------------- */ |
| | | html { |
| | | font-size: 14px; |
| | | font-size: 14px; |
| | | } |
| | | |
| | | @media (min-width: 768px) { |
| | | html { |
| | | font-size: 16px; |
| | | } |
| | | html { |
| | | font-size: 16px; |
| | | } |
| | | } |
| | | |
| | | .border-top { |
| | | border-top: 1px solid #e5e5e5; |
| | | border-top: 1px solid #e5e5e5; |
| | | } |
| | | |
| | | .border-bottom { |
| | | border-bottom: 1px solid #e5e5e5; |
| | | border-bottom: 1px solid #e5e5e5; |
| | | } |
| | | |
| | | .box-shadow { |
| | | box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05); |
| | | box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05); |
| | | } |
| | | |
| | | button.accept-policy { |
| | | font-size: 1rem; |
| | | line-height: inherit; |
| | | font-size: 1rem; |
| | | line-height: inherit; |
| | | } |
| | | |
| | | /* Sticky footer styles |
| | | -------------------------------------------------- */ |
| | | html { |
| | | position: relative; |
| | | min-height: 100%; |
| | | position: relative; |
| | | min-height: 100%; |
| | | } |
| | | |
| | | body { |
| | | /* Margin bottom by footer height */ |
| | | margin-bottom: 60px; |
| | | /* Margin bottom by footer height */ |
| | | margin-bottom: 60px; |
| | | } |
| | | |
| | | .footer { |
| | | position: absolute; |
| | | bottom: 0; |
| | | width: 100%; |
| | | white-space: nowrap; |
| | | line-height: 60px; /* Vertically center the text there */ |
| | | } |
| | | position: absolute; |
| | | bottom: 0; |
| | | width: 100%; |
| | | white-space: nowrap; |
| | | line-height: 60px; /* Vertically center the text there */ |
| | | } |
| | |
| | | @charset "utf-8"; |
| | | |
| | | ::selection { |
| | | background: #2D2F36; |
| | | background: #2D2F36; |
| | | } |
| | | |
| | | ::-webkit-selection { |
| | | background: #2D2F36; |
| | | background: #2D2F36; |
| | | } |
| | | |
| | | ::-moz-selection { |
| | | background: #2D2F36; |
| | | background: #2D2F36; |
| | | } |
| | | |
| | | body { |
| | | background: white; |
| | | font-family: 'Inter UI', sans-serif; |
| | | margin: 0; |
| | | padding: 20px; |
| | | background: white; |
| | | font-family: 'Inter UI', sans-serif; |
| | | margin: 0; |
| | | padding: 20px; |
| | | } |
| | | |
| | | .page { |
| | | background: #e2e2e5; |
| | | display: flex; |
| | | flex-direction: column; |
| | | height: calc(100% - 40px); |
| | | position: absolute; |
| | | place-content: center; |
| | | width: calc(100% - 40px); |
| | | } |
| | | @media (max-width: 767px) { |
| | | .page { |
| | | height: auto; |
| | | margin-bottom: 20px; |
| | | padding-bottom: 20px; |
| | | } |
| | | } |
| | | .container { |
| | | display: flex; |
| | | height: 320px; |
| | | margin: 0 auto; |
| | | width: 640px; |
| | | } |
| | | @media (max-width: 767px) { |
| | | .container { |
| | | background: #e2e2e5; |
| | | display: flex; |
| | | flex-direction: column; |
| | | height: 630px; |
| | | width: 320px; |
| | | } |
| | | } |
| | | .left { |
| | | background: white; |
| | | height: calc(100% - 40px); |
| | | top: 20px; |
| | | position: relative; |
| | | width: 50%; |
| | | } |
| | | @media (max-width: 767px) { |
| | | .left { |
| | | height: 100%; |
| | | left: 20px; |
| | | height: calc(100% - 40px); |
| | | position: absolute; |
| | | place-content: center; |
| | | width: calc(100% - 40px); |
| | | max-height: 270px; |
| | | } |
| | | } |
| | | .login { |
| | | font-size: 33px; |
| | | font-weight: 900; |
| | | margin: 50px 40px 40px; |
| | | } |
| | | .eula { |
| | | color: #999; |
| | | font-size: 14px; |
| | | line-height: 1.5; |
| | | margin: 40px; |
| | | } |
| | | .right { |
| | | background: #474A59; |
| | | box-shadow: 0px 0px 40px 16px rgba(0,0,0,0.22); |
| | | color: #F1F1F2; |
| | | position: relative; |
| | | width: 50%; |
| | | } |
| | | |
| | | @media (max-width: 767px) { |
| | | .right { |
| | | flex-shrink: 0; |
| | | height: 100%; |
| | | width: 100%; |
| | | max-height: 350px; |
| | | } |
| | | .page { |
| | | height: auto; |
| | | margin-bottom: 20px; |
| | | padding-bottom: 20px; |
| | | } |
| | | } |
| | | |
| | | .container { |
| | | display: flex; |
| | | height: 320px; |
| | | margin: 0 auto; |
| | | width: 640px; |
| | | } |
| | | |
| | | @media (max-width: 767px) { |
| | | .container { |
| | | flex-direction: column; |
| | | height: 630px; |
| | | width: 320px; |
| | | } |
| | | } |
| | | |
| | | .left { |
| | | background: white; |
| | | height: calc(100% - 40px); |
| | | top: 20px; |
| | | position: relative; |
| | | width: 50%; |
| | | } |
| | | |
| | | @media (max-width: 767px) { |
| | | .left { |
| | | height: 100%; |
| | | left: 20px; |
| | | width: calc(100% - 40px); |
| | | max-height: 270px; |
| | | } |
| | | } |
| | | |
| | | .login { |
| | | font-size: 33px; |
| | | font-weight: 900; |
| | | margin: 50px 40px 40px; |
| | | } |
| | | |
| | | .eula { |
| | | color: #999; |
| | | font-size: 14px; |
| | | line-height: 1.5; |
| | | margin: 40px; |
| | | } |
| | | |
| | | .right { |
| | | background: #474A59; |
| | | box-shadow: 0px 0px 40px 16px rgba(0,0,0,0.22); |
| | | color: #F1F1F2; |
| | | position: relative; |
| | | width: 50%; |
| | | } |
| | | |
| | | @media (max-width: 767px) { |
| | | .right { |
| | | flex-shrink: 0; |
| | | height: 100%; |
| | | width: 100%; |
| | | max-height: 350px; |
| | | } |
| | | } |
| | | |
| | | svg { |
| | | position: absolute; |
| | | width: 320px; |
| | | position: absolute; |
| | | width: 320px; |
| | | } |
| | | |
| | | path { |
| | | fill: none; |
| | | stroke: url(#linearGradient);; |
| | | stroke-width: 4; |
| | | stroke-dasharray: 240 1386; |
| | | fill: none; |
| | | stroke: url(#linearGradient); |
| | | ; |
| | | stroke-width: 4; |
| | | stroke-dasharray: 240 1386; |
| | | } |
| | | |
| | | .form { |
| | | margin: 40px; |
| | | position: absolute; |
| | | margin: 40px; |
| | | position: absolute; |
| | | } |
| | | |
| | | label { |
| | | color: #c2c2c5; |
| | | display: block; |
| | | font-size: 14px; |
| | | height: 16px; |
| | | margin-top: 20px; |
| | | margin-bottom: 5px; |
| | | color: #c2c2c5; |
| | | display: block; |
| | | font-size: 14px; |
| | | height: 16px; |
| | | margin-top: 20px; |
| | | margin-bottom: 5px; |
| | | } |
| | | |
| | | input { |
| | | background: transparent; |
| | | border: 0; |
| | | color: #f2f2f2; |
| | | font-size: 20px; |
| | | height: 30px; |
| | | line-height: 30px; |
| | | outline: none !important; |
| | | width: 100%; |
| | | background: transparent; |
| | | border: 0; |
| | | color: #f2f2f2; |
| | | font-size: 20px; |
| | | height: 30px; |
| | | line-height: 30px; |
| | | outline: none !important; |
| | | width: 100%; |
| | | } |
| | | input::-moz-focus-inner { |
| | | border: 0; |
| | | } |
| | | |
| | | input::-moz-focus-inner { |
| | | border: 0; |
| | | } |
| | | |
| | | #submit { |
| | | color: #707075; |
| | | margin-top: 40px; |
| | | transition: color 300ms; |
| | | color: #707075; |
| | | margin-top: 40px; |
| | | transition: color 300ms; |
| | | } |
| | | #submit:focus { |
| | | color: #f2f2f2; |
| | | } |
| | | #submit:active { |
| | | color: #d0d0d2; |
| | | } |
| | | |
| | | #submit:focus { |
| | | color: #f2f2f2; |
| | | } |
| | | |
| | | #submit:active { |
| | | color: #d0d0d2; |
| | | } |
| | |
| | | -webkit-transform: translateY(0); |
| | | transform: translateY(0); |
| | | } |
| | | |
| | | .drop li:first-child:before { |
| | | content: " "; |
| | | font-size: 0; |
| | |
| | | -webkit-transition: all .2s ease-in; |
| | | transition: all .2s ease-in; |
| | | } |
| | | |
| | | .drop li:first-child a { |
| | | border-top-left-radius: 5px; |
| | | border-top-right-radius: 5px; |
| | |
| | | border-bottom-right-radius: 5px; |
| | | border-bottom: none; |
| | | } |
| | | |
| | | .drop li:hover:before { |
| | | background-color: #85ea2d; |
| | | } |
| | |
| | | .drop li:hover a { |
| | | background-color: #85ea2d; |
| | | color: #fff; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification |
| | | // for details on configuring this project to bundle and minify static web assets. |
| | | |
| | | // Write your JavaScript code. |
| | | // Write your JavaScript code. |
| | |
| | | }, 788); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * å»¶è¿å½æ° |
| | | * @param {any} delay |
| | |
| | | var blob = this.response; |
| | | var reader = new FileReader(); |
| | | reader.readAsDataURL(blob); // 转æ¢ä¸ºbase64ï¼å¯ä»¥ç´æ¥æ¾å
¥a表æ
href |
| | | reader.onload = function(e) { |
| | | reader.onload = function (e) { |
| | | // 转æ¢å®æï¼å建ä¸ä¸ªaæ ç¾ç¨äºä¸è½½ |
| | | var a = document.createElement('a'); |
| | | a.download = 'WIDESEAWCS APIææ¡£ ' + version + exten; |
| | |
| | | $(a).remove(); |
| | | } |
| | | } else { |
| | | alert(this.status+this.statusText); |
| | | alert(this.status + this.statusText); |
| | | } |
| | | //å
³éload |
| | | $.busyLoadFull('hide', |
| | |
| | | text: "LOADING ...", |
| | | animation: "fade" |
| | | }); |
| | | } |
| | | } |
| | |
| | | }); |
| | | } |
| | | </script> |
| | | |
| | | </body> |
| | | </html> |
| | |
| | | "id": "1001", |
| | | "name": "A\u533A_\u4E00\u6CE8\u8F93\u9001\u7EBF", |
| | | "plcType": "S71500", |
| | | "port": 102, |
| | | "port": 103, |
| | | "activationKey": "", |
| | | "autoStart": false, |
| | | "protocolTemplateId": "protocol-1001", |
| | |
| | | "dataType": 0, |
| | | "length": 1, |
| | | "direction": 2 |
| | | }, |
| | | { |
| | | "fieldKey": "2201_TaskNo", |
| | | "dbNumber": 50, |
| | | "offset": 4000, |
| | | "bit": 1, |
| | | "dataType": 1, |
| | | "length": 1, |
| | | "direction": 2 |
| | | }, |
| | | { |
| | | "fieldKey": "2201_Source", |
| | | "dbNumber": 50, |
| | | "offset": 4002, |
| | | "bit": 1, |
| | | "dataType": 1, |
| | | "length": 1, |
| | | "direction": 2 |
| | | }, |
| | | { |
| | | "fieldKey": "2201_Target", |
| | | "dbNumber": 50, |
| | | "offset": 4004, |
| | | "bit": 1, |
| | | "dataType": 1, |
| | | "length": 1, |
| | | "direction": 2 |
| | | }, |
| | | { |
| | | "fieldKey": "2201_BoxType", |
| | | "dbNumber": 50, |
| | | "offset": 4006, |
| | | "bit": 1, |
| | | "dataType": 0, |
| | | "length": 1, |
| | | "direction": 2 |
| | | }, |
| | | { |
| | | "fieldKey": "2201_CV_State", |
| | | "dbNumber": 50, |
| | | "offset": 4007, |
| | | "bit": 1, |
| | | "dataType": 0, |
| | | "length": 1, |
| | | "direction": 2 |
| | | }, |
| | | { |
| | | "fieldKey": "2201_CV_ERRCode", |
| | | "dbNumber": 50, |
| | | "offset": 4008, |
| | | "bit": 1, |
| | | "dataType": 0, |
| | | "length": 1, |
| | | "direction": 2 |
| | | }, |
| | | { |
| | | "fieldKey": "2201_WCS_STB", |
| | | "dbNumber": 50, |
| | | "offset": 4009, |
| | | "bit": 1, |
| | | "dataType": 0, |
| | | "length": 1, |
| | | "direction": 2 |
| | | }, |
| | | { |
| | | "fieldKey": "2201_WCS_ACK", |
| | | "dbNumber": 50, |
| | | "offset": 4010, |
| | | "bit": 1, |
| | | "dataType": 0, |
| | | "length": 1, |
| | | "direction": 2 |
| | | }, |
| | | { |
| | | "fieldKey": "2201_PLC_STB", |
| | | "dbNumber": 50, |
| | | "offset": 4011, |
| | | "bit": 1, |
| | | "dataType": 0, |
| | | "length": 1, |
| | | "direction": 2 |
| | | }, |
| | | { |
| | | "fieldKey": "2201_PLC_ACK", |
| | | "dbNumber": 50, |
| | | "offset": 4012, |
| | | "bit": 1, |
| | | "dataType": 0, |
| | | "length": 1, |
| | | "direction": 2 |
| | | }, |
| | | { |
| | | "fieldKey": "2201_PLC_REQ", |
| | | "dbNumber": 50, |
| | | "offset": 4013, |
| | | "bit": 1, |
| | | "dataType": 0, |
| | | "length": 1, |
| | | "direction": 2 |
| | | }, |
| | | { |
| | | "fieldKey": "2201_WCS_ERRCode", |
| | | "dbNumber": 50, |
| | | "offset": 4014, |
| | | "bit": 1, |
| | | "dataType": 0, |
| | | "length": 1, |
| | | "direction": 2 |
| | | }, |
| | | { |
| | | "fieldKey": "2201_WCS_Special", |
| | | "dbNumber": 50, |
| | | "offset": 4015, |
| | | "bit": 1, |
| | | "dataType": 0, |
| | | "length": 1, |
| | | "direction": 2 |
| | | }, |
| | | { |
| | | "fieldKey": "2201_Equ_Auto", |
| | | "dbNumber": 50, |
| | | "offset": 4016, |
| | | "bit": 1, |
| | | "dataType": 0, |
| | | "length": 1, |
| | | "direction": 2 |
| | | }, |
| | | { |
| | | "fieldKey": "2201_Last_pallet", |
| | | "dbNumber": 50, |
| | | "offset": 4017, |
| | | "bit": 1, |
| | | "dataType": 0, |
| | | "length": 1, |
| | | "direction": 2 |
| | | }, |
| | | { |
| | | "fieldKey": "2201_Barcode", |
| | | "dbNumber": 50, |
| | | "offset": 4018, |
| | | "bit": 1, |
| | | "dataType": 0, |
| | | "length": 20, |
| | | "direction": 2 |
| | | }, |
| | | { |
| | | "fieldKey": "2201_Spare_1", |
| | | "dbNumber": 50, |
| | | "offset": 4038, |
| | | "bit": 1, |
| | | "dataType": 0, |
| | | "length": 1, |
| | | "direction": 2 |
| | | }, |
| | | { |
| | | "fieldKey": "2201_Spare_2", |
| | | "dbNumber": 50, |
| | | "offset": 4039, |
| | | "bit": 1, |
| | | "dataType": 0, |
| | | "length": 1, |
| | | "direction": 2 |
| | | } |
| | | ] |
| | | } |