Merge branch 'master' of http://115.159.85.185:8098/r/MeiRuiAn/HuaiAn
已删除12个文件
已修改24个文件
已添加23个文件
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEAWCS_Core.BaseRepository; |
| | | using WIDESEAWCS_IBasicInfoRepository; |
| | | using WIDESEAWCS_Model.Models; |
| | | |
| | | namespace WIDESEAWCS_BasicInfoRepository |
| | | { |
| | | public class StationMangerRepository : RepositoryBase<Dt_StationManger>, IStationMangerRepository |
| | | { |
| | | public StationMangerRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) |
| | | { |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEAWCS_Core.BaseRepository; |
| | | using WIDESEAWCS_Model.Models; |
| | | |
| | | namespace WIDESEAWCS_IBasicInfoRepository |
| | | { |
| | | public interface IStationMangerRepository : IRepository<Dt_StationManger> |
| | | { |
| | | } |
| | | } |
| | |
| | | <Nullable>enable</Nullable> |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <ProjectReference Include="..\WIDESEAWCS_BasicInfoRepository\WIDESEAWCS_BasicInfoRepository.csproj" /> |
| | | </ItemGroup> |
| | | |
| | | </Project> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEAWCS_Core.DB.Models; |
| | | |
| | | namespace WIDESEAWCS_Model.Models |
| | | { |
| | | [SugarTable(nameof(Dt_StationManger), "ç«å°è¡¨")] |
| | | public class Dt_StationManger : BaseEntity |
| | | { |
| | | /// <summary> |
| | | /// ä¸»é® |
| | | /// </summary> |
| | | [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主é®")] |
| | | public int Id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç«å°ç¼å· |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "ç«å°ç¼å·")] |
| | | public string StationCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç«å°åç§° |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "ç«å°åç§°")] |
| | | public string StationName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 对åºå åæºæ-å-å± |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "对åºå åæºæ-å-å±")] |
| | | public string StackerCraneStationCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç«å°è®¾å¤ç¼å· |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "ç«å°è®¾å¤ç¼å·")] |
| | | public string StationDeviceCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å åæºç¼å· |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "å åæºç¼å·")] |
| | | public string StackerCraneCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// AGVç«å°ç¼å· |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "AGVç«å°ç¼å·")] |
| | | public string AGVStationCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "夿³¨")] |
| | | public string Remark { get; set; } |
| | | } |
| | | } |
| | |
| | | public string PalletCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æçç±»å |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "æçç±»å")] |
| | | public int PalletType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å··éå· |
| | | /// </summary> |
| | | [ImporterHeader(Name = "å··éå·")] |
| | |
| | | <Project Sdk="Microsoft.NET.Sdk"> |
| | | <Project Sdk="Microsoft.NET.Sdk"> |
| | | |
| | | <PropertyGroup> |
| | | <TargetFramework>net6.0</TargetFramework> |
| | |
| | | |
| | | <ItemGroup> |
| | | <ProjectReference Include="..\WIDESEAWCS_Common\WIDESEAWCS_Common.csproj" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <Folder Include="Models\BasicInfo\" /> |
| | | </ItemGroup> |
| | | |
| | | </Project> |
| | |
| | | EndProject |
| | | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WIDESEAWCS_BasicInfoService", "WIDESEAWCS_BasicInfoService\WIDESEAWCS_BasicInfoService.csproj", "{FFAB2C76-1C9E-4006-95C8-A0B2AA53139D}" |
| | | EndProject |
| | | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WIDESEAWCS_Model", "WIDESEAWCS_Model\WIDESEAWCS_Model.csproj", "{9D2AC22C-9A86-41AE-AA02-553554A7B1D7}" |
| | | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WIDESEAWCS_Model", "WIDESEAWCS_Model\WIDESEAWCS_Model.csproj", "{9D2AC22C-9A86-41AE-AA02-553554A7B1D7}" |
| | | EndProject |
| | | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WIDESEAWCS_ISystemRepository", "WIDESEAWCS_ISystemRepository\WIDESEAWCS_ISystemRepository.csproj", "{B778DFFD-A5BA-4CAF-805E-2630CF080CDC}" |
| | | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WIDESEAWCS_ISystemRepository", "WIDESEAWCS_ISystemRepository\WIDESEAWCS_ISystemRepository.csproj", "{B778DFFD-A5BA-4CAF-805E-2630CF080CDC}" |
| | | EndProject |
| | | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WIDESEAWCS_IBasicInfoRepository", "WIDESEAWCS_IBasicInfoRepository\WIDESEAWCS_IBasicInfoRepository.csproj", "{3B954A6E-CE88-4B33-BEAC-757BE4BE1204}" |
| | | EndProject |
| | | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WIDESEAWCS_BasicInfoRepository", "WIDESEAWCS_BasicInfoRepository\WIDESEAWCS_BasicInfoRepository.csproj", "{D0CC28FA-6426-4FDE-A5B9-24CF06787863}" |
| | | EndProject |
| | | Global |
| | | GlobalSection(SolutionConfigurationPlatforms) = preSolution |
| | |
| | | {B778DFFD-A5BA-4CAF-805E-2630CF080CDC}.Debug|Any CPU.Build.0 = Debug|Any CPU |
| | | {B778DFFD-A5BA-4CAF-805E-2630CF080CDC}.Release|Any CPU.ActiveCfg = Release|Any CPU |
| | | {B778DFFD-A5BA-4CAF-805E-2630CF080CDC}.Release|Any CPU.Build.0 = Release|Any CPU |
| | | {3B954A6E-CE88-4B33-BEAC-757BE4BE1204}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
| | | {3B954A6E-CE88-4B33-BEAC-757BE4BE1204}.Debug|Any CPU.Build.0 = Debug|Any CPU |
| | | {3B954A6E-CE88-4B33-BEAC-757BE4BE1204}.Release|Any CPU.ActiveCfg = Release|Any CPU |
| | | {3B954A6E-CE88-4B33-BEAC-757BE4BE1204}.Release|Any CPU.Build.0 = Release|Any CPU |
| | | {D0CC28FA-6426-4FDE-A5B9-24CF06787863}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
| | | {D0CC28FA-6426-4FDE-A5B9-24CF06787863}.Debug|Any CPU.Build.0 = Debug|Any CPU |
| | | {D0CC28FA-6426-4FDE-A5B9-24CF06787863}.Release|Any CPU.ActiveCfg = Release|Any CPU |
| | | {D0CC28FA-6426-4FDE-A5B9-24CF06787863}.Release|Any CPU.Build.0 = Release|Any CPU |
| | | EndGlobalSection |
| | | GlobalSection(SolutionProperties) = preSolution |
| | | HideSolutionNode = FALSE |
| | |
| | | {8C2CC25B-DE5D-433E-A550-63864C7A716D} = {9CB2F821-BB23-48E5-88E8-C326477733C0} |
| | | {FFAB2C76-1C9E-4006-95C8-A0B2AA53139D} = {9CB2F821-BB23-48E5-88E8-C326477733C0} |
| | | {B778DFFD-A5BA-4CAF-805E-2630CF080CDC} = {93EFF637-042E-4DD0-A74B-7F0CF998CF96} |
| | | {3B954A6E-CE88-4B33-BEAC-757BE4BE1204} = {5CC8AEFF-2F75-4053-9569-73419839875A} |
| | | {D0CC28FA-6426-4FDE-A5B9-24CF06787863} = {5CC8AEFF-2F75-4053-9569-73419839875A} |
| | | EndGlobalSection |
| | | GlobalSection(ExtensibilityGlobals) = postSolution |
| | | SolutionGuid = {C9A356D5-D4FE-414B-B982-6C97792BE6C6} |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_IBasicInfoRepository; |
| | | using WIDESEAWCS_Model.Models; |
| | | using WIDESEAWCS_QuartzJob; |
| | | using WIDESEAWCS_Tasks.é»çä»; |
| | | |
| | | namespace WIDESEAWCS_Server.Controllers |
| | | { |
| | | [Route("api/[controller]")] |
| | | [ApiController] |
| | | public class AGVController : ControllerBase |
| | | { |
| | | private readonly IStationMangerRepository _stationMangerRepository; |
| | | |
| | | public AGVController(IStationMangerRepository stationMangerRepository) |
| | | { |
| | | _stationMangerRepository = stationMangerRepository; |
| | | } |
| | | |
| | | [HttpPost, HttpGet, Route("PutRequest"), AllowAnonymous] |
| | | public WebResponseContent PutRequest(string code, int palletType) |
| | | { |
| | | try |
| | | { |
| | | Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.AGVStationCode == code); |
| | | if (stationManger == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°ç«å°é
ç½®"); |
| | | } |
| | | IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode); |
| | | if (device == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°å¯¹åºè®¾å¤"); |
| | | } |
| | | |
| | | OtherDevice otherDevice = (OtherDevice)device; |
| | | |
| | | bool canPut = otherDevice.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanPut, stationManger.StationCode); |
| | | if (canPut) |
| | | { |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | else |
| | | { |
| | | otherDevice.SetValue(GroundStationDBName.W_PutRequest, true, stationManger.StationCode); |
| | | otherDevice.SetValue(GroundStationDBName.W_PutPalletType, (short)palletType, stationManger.StationCode); |
| | | Thread.Sleep(1000); |
| | | canPut = otherDevice.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanPut, stationManger.StationCode); |
| | | if (canPut) |
| | | { |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | else |
| | | { |
| | | return WebResponseContent.Instance.Error($"æ¾è´§ç³è¯·ä¸"); |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | |
| | | [HttpPost, HttpGet, Route("PutFinish"), AllowAnonymous] |
| | | public WebResponseContent PutFinish(string code) |
| | | { |
| | | try |
| | | { |
| | | Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.AGVStationCode == code); |
| | | if (stationManger == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°ç«å°é
ç½®"); |
| | | } |
| | | IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode); |
| | | if (device == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°å¯¹åºè®¾å¤"); |
| | | } |
| | | |
| | | OtherDevice otherDevice = (OtherDevice)device; |
| | | otherDevice.SetValue(GroundStationDBName.W_PutFinish, true, stationManger.StationCode); |
| | | |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | |
| | | [HttpPost, HttpGet, Route("TakeRequest"), AllowAnonymous] |
| | | public WebResponseContent TakeRequest(string code) |
| | | { |
| | | try |
| | | { |
| | | Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.AGVStationCode == code); |
| | | if (stationManger == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°ç«å°é
ç½®"); |
| | | } |
| | | IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode); |
| | | if (device == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°å¯¹åºè®¾å¤"); |
| | | } |
| | | |
| | | OtherDevice otherDevice = (OtherDevice)device; |
| | | |
| | | bool canPut = otherDevice.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanTake, stationManger.StationCode); |
| | | if (canPut) |
| | | { |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | else |
| | | { |
| | | otherDevice.SetValue(GroundStationDBName.W_TakeRequest, true, stationManger.StationCode); |
| | | Thread.Sleep(1000); |
| | | canPut = otherDevice.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanTake, stationManger.StationCode); |
| | | if (canPut) |
| | | { |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | else |
| | | { |
| | | return WebResponseContent.Instance.Error($"åè´§ç³è¯·ä¸"); |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | |
| | | [HttpPost, HttpGet, Route("TakeFinish"), AllowAnonymous] |
| | | public WebResponseContent TakeFinish(string code) |
| | | { |
| | | try |
| | | { |
| | | Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.AGVStationCode == code); |
| | | if (stationManger == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°ç«å°é
ç½®"); |
| | | } |
| | | IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode); |
| | | if (device == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°å¯¹åºè®¾å¤"); |
| | | } |
| | | |
| | | OtherDevice otherDevice = (OtherDevice)device; |
| | | otherDevice.SetValue(GroundStationDBName.W_TakeFinish, true, stationManger.StationCode); |
| | | |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_DTO.System; |
| | | using WIDESEAWCS_DTO.TaskInfo; |
| | | using WIDESEAWCS_Model.Models; |
| | | using WIDESEAWCS_QuartzJob.DTO; |
| | |
| | | /// </summary> |
| | | public CustomProfile() |
| | | { |
| | | CreateMap<Sys_Menu, MenuDTO>(); |
| | | CreateMap<Dt_DeviceInfo,DeviceInfoDTO>(); |
| | | CreateMap<WMSTaskDTO, Dt_Task>().ForMember(a => a.WMSId, b => b.MapFrom(b => b.Id)); |
| | | CreateMap<Dt_Task, ConveyorLineTaskCommand>().ForMember(a => a.TargetAddress, b => b.MapFrom(b => b.NextAddress)).ForMember(a => a.Barcode, b => b.MapFrom(b => b.PalletCode)).ForMember(a => a.TaskNum, b => b.MapFrom(b => b.TaskNum)); |
| | |
| | | "MainDB": "DB_WIDESEA", //å½å项ç®ç主åºï¼æå¯¹åºçè¿æ¥å符串çEnabledå¿
须为true |
| | | //è¿æ¥å符串 |
| | | //"ConnectionString": "HTI6FB1H05Krd07mNm9yBCNhofW6edA5zLs9TY~MNthRYW3kn0qKbMIsGp~3yyPDF1YZUCPBQx8U0Jfk4PH~ajNFXVIwlH85M3F~v_qKYQ3CeAz3q1mLVDn8O5uWt1~3Ut2V3KRkEwYHvW2oMDN~QIDXPxDgXN0R2oTIhc9dNu7QNaLEknblqmHhjaNSSpERdDVZIgHnMKejU_SL49tralBkZmDNi0hmkbL~837j1NWe37u9fJKmv91QPb~16JsuI9uu0EvNZ06g6PuZfOSAeFH9GMMIZiketdcJG3tHelo=", |
| | | "ConnectionString": "Data Source=.;Initial Catalog=WIDESEAWCS__HUAIAN;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | "ConnectionString": "Data Source=.;Initial Catalog=WIDESEAWCS_HUAIAN;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | //è·¨å |
| | | "Cors": { |
| | | "PolicyName": "CorsIpAccess", //çç¥åç§° |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Microsoft.AspNetCore.Components.Routing; |
| | | using Quartz; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Diagnostics.CodeAnalysis; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEAWCS_Common.TaskEnum; |
| | | using WIDESEAWCS_Core.Enums; |
| | | using WIDESEAWCS_IBasicInfoRepository; |
| | | using WIDESEAWCS_ITaskInfoRepository; |
| | | using WIDESEAWCS_ITaskInfoService; |
| | | using WIDESEAWCS_Model.Models; |
| | | using WIDESEAWCS_QuartzJob; |
| | | using WIDESEAWCS_QuartzJob.DeviceBase; |
| | | using WIDESEAWCS_QuartzJob.Models; |
| | | using WIDESEAWCS_QuartzJob.Service; |
| | | using WIDESEAWCS_QuartzJob.StackerCrane.Enum; |
| | | using WIDESEAWCS_Tasks.HoisterJob; |
| | | using WIDESEAWCS_Tasks.StackerCraneJob; |
| | | using WIDESEAWCS_Tasks.é»çä»; |
| | | |
| | | namespace WIDESEAWCS_Tasks |
| | | { |
| | | [DisallowConcurrentExecution] |
| | | public class StackerCraneJob_CSJ : JobBase, IJob |
| | | { |
| | | private readonly ITaskService _taskService; |
| | | private readonly ITaskExecuteDetailService _taskExecuteDetailService; |
| | | private readonly ITaskRepository _taskRepository; |
| | | private readonly IRouterService _routerService; |
| | | private readonly IStationMangerRepository _stationMangerRepository; |
| | | |
| | | public StackerCraneJob_CSJ(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository) |
| | | { |
| | | _taskService = taskService; |
| | | _taskExecuteDetailService = taskExecuteDetailService; |
| | | _taskRepository = taskRepository; |
| | | _routerService = routerService; |
| | | _stationMangerRepository = stationMangerRepository; |
| | | } |
| | | |
| | | public Task Execute(IJobExecutionContext context) |
| | | { |
| | | 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) |
| | | { |
| | | Dt_Task? task = GetTask(commonStackerCrane); |
| | | if (task != null) |
| | | { |
| | | StackerCraneTaskCommand? stackerCraneTaskCommand = ConvertToStackerCraneTaskCommand(task); |
| | | if (stackerCraneTaskCommand != null) |
| | | { |
| | | bool sendFlag = commonStackerCrane.SendCommand(stackerCraneTaskCommand); |
| | | if (sendFlag) |
| | | { |
| | | commonStackerCrane.LastTaskType = task.TaskType; |
| | | _taskService.UpdateTaskStatusToNext(task.TaskNum); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | WriteError(nameof(CommonStackerCraneJob), ex.Message, ex); |
| | | } |
| | | return Task.CompletedTask; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡å®æäºä»¶è®¢é
çæ¹æ³ |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | private void CommonStackerCrane_StackerCraneTaskCompletedEventHandler(object? sender, WIDESEAWCS_QuartzJob.StackerCrane.StackerCraneTaskCompletedEventArgs e) |
| | | { |
| | | CommonStackerCrane? commonStackerCrane = sender as CommonStackerCrane; |
| | | if (commonStackerCrane != null) |
| | | { |
| | | if (commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType) != 5) |
| | | { |
| | | Console.Out.WriteLine("TaskCompleted" + e.TaskNum); |
| | | _taskService.StackCraneTaskCompleted(e.TaskNum); |
| | | commonStackerCrane.SetValue(StackerCraneDBName.WorkType, 5); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åä»»å¡ |
| | | /// </summary> |
| | | /// <param name="commonStackerCrane">å åæºå¯¹è±¡</param> |
| | | /// <returns></returns> |
| | | private Dt_Task? GetTask(CommonStackerCrane commonStackerCrane) |
| | | { |
| | | Dt_Task task; |
| | | if (commonStackerCrane.LastTaskType == null) |
| | | { |
| | | task = _taskService.QueryStackerCraneTask(commonStackerCrane.DeviceCode); |
| | | } |
| | | else |
| | | { |
| | | if (commonStackerCrane.LastTaskType.GetValueOrDefault().GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) |
| | | { |
| | | task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode); |
| | | if (task == null) |
| | | { |
| | | task = _taskService.QueryStackerCraneOutTask(commonStackerCrane.DeviceCode); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | task = _taskService.QueryStackerCraneOutTask(commonStackerCrane.DeviceCode); |
| | | if (task == null) |
| | | { |
| | | task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode); |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (task != null && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) |
| | | { |
| | | if (OutTaskStationIsOccupied(task) != null || true) |
| | | { |
| | | return task; |
| | | } |
| | | else |
| | | { |
| | | List<string> otherOutStaionCodes = _routerService.QueryNextRoutes(commonStackerCrane.DeviceCode, task.NextAddress).Select(x => x.ChildPosi).ToList(); |
| | | List<Dt_Task> tasks = _taskService.QueryStackerCraneOutTasks(commonStackerCrane.DeviceCode, otherOutStaionCodes); |
| | | foreach (var item in tasks) |
| | | { |
| | | if (OutTaskStationIsOccupied(task) != null) |
| | | { |
| | | return task; |
| | | } |
| | | } |
| | | task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode); |
| | | } |
| | | } |
| | | |
| | | return task; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// åºåºä»»å¡å¤æåºåºç«å°æ¯å¦è¢«å ç¨ |
| | | /// </summary> |
| | | /// <param name="task">ä»»å¡å®ä½</param> |
| | | /// <returns>妿æªè¢«å ç¨ï¼è¿åä¼ å
¥çä»»å¡ä¿¡æ¯ï¼å¦åï¼è¿ånull</returns> |
| | | private Dt_Task? OutTaskStationIsOccupied([NotNull] Dt_Task task) |
| | | { |
| | | Dt_StationManger? stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == task.TargetAddress && x.StackerCraneCode == task.Roadway); |
| | | if (stationManger != null) |
| | | { |
| | | IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode); |
| | | if (device != null) |
| | | { |
| | | OtherDevice client = (OtherDevice)device; |
| | | if (client.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanPut, stationManger.StationCode))//åºåºç«å°æªè¢«å ç¨ |
| | | { |
| | | task.TargetAddress = stationManger.StackerCraneStationCode; |
| | | _taskRepository.UpdateData(task); |
| | | return task; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"æªæ¾å°åºåºç«å°ã{stationManger.StationDeviceCode}ã对åºçéè®¯å¯¹è±¡ï¼æ æ³å¤æåºåºç«å°æ¯å¦è¢«å ç¨"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"æªæ¾å°ç«å°ã{task.NextAddress}ãä¿¡æ¯ï¼æ æ³æ ¡éªç«å°"); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡å®ä½è½¬æ¢æå½ä»¤Model |
| | | /// </summary> |
| | | /// <param name="task">ä»»å¡å®ä½</param> |
| | | /// <returns></returns> |
| | | /// <exception cref="Exception"></exception> |
| | | public StackerCraneTaskCommand? ConvertToStackerCraneTaskCommand([NotNull] Dt_Task task) |
| | | { |
| | | StackerCraneTaskCommand stackerCraneTaskCommand = new StackerCraneTaskCommand(); |
| | | |
| | | stackerCraneTaskCommand.Barcode = task.PalletCode; |
| | | stackerCraneTaskCommand.TaskNum = task.TaskNum; |
| | | stackerCraneTaskCommand.WorkType = 1; |
| | | 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("-"); |
| | | |
| | | stackerCraneTaskCommand.StartRow = Convert.ToInt16(startCodes[0]); |
| | | stackerCraneTaskCommand.StartColumn = Convert.ToInt16(startCodes[1]); |
| | | stackerCraneTaskCommand.StartLayer = Convert.ToInt16(startCodes[2]); |
| | | |
| | | string[] targetCodes = task.NextAddress.Split("-"); |
| | | if (targetCodes.Length == 3) |
| | | { |
| | | stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[0]); |
| | | stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[1]); |
| | | stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[2]); |
| | | } |
| | | else |
| | | { |
| | | //æ°æ®é
ç½®é误 |
| | | _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"å
¥åºä»»å¡ç»ç¹é误ï¼èµ·ç¹ï¼ã{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) |
| | | { |
| | | stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[0]); |
| | | stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[1]); |
| | | stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[2]); |
| | | } |
| | | else |
| | | { |
| | | //æ°æ®é
ç½®é误 |
| | | _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"åºåºä»»å¡èµ·ç¹é误ï¼èµ·ç¹ï¼ã{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) |
| | | { |
| | | stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[0]); |
| | | stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[1]); |
| | | stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[2]); |
| | | } |
| | | else |
| | | { |
| | | //æ°æ®é
ç½®é误 |
| | | _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"ç§»åºä»»å¡ç»ç¹é误ï¼èµ·ç¹ï¼ã{task.NextAddress}ã"); |
| | | return null; |
| | | } |
| | | string[] sourceCodes = task.CurrentAddress.Split("-"); |
| | | if (sourceCodes.Length == 3) |
| | | { |
| | | stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[0]); |
| | | stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[1]); |
| | | stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[2]); |
| | | } |
| | | else |
| | | { |
| | | //æ°æ®é
ç½®é误 |
| | | _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"ç§»åºä»»å¡èµ·ç¹é误ï¼èµ·ç¹ï¼ã{task.CurrentAddress}ã"); |
| | | return null; |
| | | } |
| | | } |
| | | return stackerCraneTaskCommand; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEAWCS_Tasks.é»çä» |
| | | { |
| | | public enum GroundStationDBName |
| | | { |
| | | /// <summary> |
| | | /// æ¯å¦å
许æ¾è´§(读) |
| | | /// </summary> |
| | | R_IsCanPut, |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦å
许åè´§(读) |
| | | /// </summary> |
| | | R_IsCanTake, |
| | | |
| | | /// <summary> |
| | | /// åè´§æçç±»å(读) |
| | | /// </summary> |
| | | R_TakePalletType, |
| | | |
| | | /// <summary> |
| | | /// æ¾è´§æçç±»å(å) |
| | | /// </summary> |
| | | W_PutPalletType, |
| | | |
| | | /// <summary> |
| | | /// æ¾è´§è¯·æ±(å) |
| | | /// </summary> |
| | | W_PutRequest, |
| | | |
| | | /// <summary> |
| | | /// æ¾è´§å®æ(å) |
| | | /// </summary> |
| | | W_PutFinish, |
| | | |
| | | /// <summary> |
| | | /// å货请æ±(å) |
| | | /// </summary> |
| | | W_TakeRequest, |
| | | |
| | | /// <summary> |
| | | /// åè´§å®æ(å) |
| | | /// </summary> |
| | | W_TakeFinish |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Microsoft.AspNetCore.Components.Routing; |
| | | using Quartz; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Diagnostics.CodeAnalysis; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEAWCS_Common.TaskEnum; |
| | | using WIDESEAWCS_Core.Enums; |
| | | using WIDESEAWCS_IBasicInfoRepository; |
| | | using WIDESEAWCS_ITaskInfoRepository; |
| | | using WIDESEAWCS_ITaskInfoService; |
| | | using WIDESEAWCS_Model.Models; |
| | | using WIDESEAWCS_QuartzJob; |
| | | using WIDESEAWCS_QuartzJob.DeviceBase; |
| | | using WIDESEAWCS_QuartzJob.Models; |
| | | using WIDESEAWCS_QuartzJob.Service; |
| | | using WIDESEAWCS_QuartzJob.StackerCrane.Enum; |
| | | using WIDESEAWCS_Tasks.HoisterJob; |
| | | using WIDESEAWCS_Tasks.StackerCraneJob; |
| | | using WIDESEAWCS_Tasks.é»çä»; |
| | | |
| | | namespace WIDESEAWCS_Tasks |
| | | { |
| | | [DisallowConcurrentExecution] |
| | | public class StackerCraneJob_ZH : JobBase, IJob |
| | | { |
| | | private readonly ITaskService _taskService; |
| | | private readonly ITaskExecuteDetailService _taskExecuteDetailService; |
| | | private readonly ITaskRepository _taskRepository; |
| | | private readonly IRouterService _routerService; |
| | | private readonly IStationMangerRepository _stationMangerRepository; |
| | | |
| | | public StackerCraneJob_ZH(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository) |
| | | { |
| | | _taskService = taskService; |
| | | _taskExecuteDetailService = taskExecuteDetailService; |
| | | _taskRepository = taskRepository; |
| | | _routerService = routerService; |
| | | _stationMangerRepository = stationMangerRepository; |
| | | } |
| | | |
| | | public Task Execute(IJobExecutionContext context) |
| | | { |
| | | 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) |
| | | { |
| | | Dt_Task? task = GetTask(commonStackerCrane); |
| | | if (task != null) |
| | | { |
| | | StackerCraneTaskCommand? stackerCraneTaskCommand = ConvertToStackerCraneTaskCommand(task); |
| | | if (stackerCraneTaskCommand != null) |
| | | { |
| | | bool sendFlag = commonStackerCrane.SendCommand(stackerCraneTaskCommand); |
| | | if (sendFlag) |
| | | { |
| | | commonStackerCrane.LastTaskType = task.TaskType; |
| | | _taskService.UpdateTaskStatusToNext(task.TaskNum); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | WriteError(nameof(StackerCraneJob_ZH), ex.Message, ex); |
| | | } |
| | | return Task.CompletedTask; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡å®æäºä»¶è®¢é
çæ¹æ³ |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | private void CommonStackerCrane_StackerCraneTaskCompletedEventHandler(object? sender, WIDESEAWCS_QuartzJob.StackerCrane.StackerCraneTaskCompletedEventArgs e) |
| | | { |
| | | CommonStackerCrane? commonStackerCrane = sender as CommonStackerCrane; |
| | | if (commonStackerCrane != null) |
| | | { |
| | | if (commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType) != 5) |
| | | { |
| | | Console.Out.WriteLine("TaskCompleted" + e.TaskNum); |
| | | _taskService.StackCraneTaskCompleted(e.TaskNum); |
| | | commonStackerCrane.SetValue(StackerCraneDBName.WorkType, 5); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åä»»å¡ |
| | | /// </summary> |
| | | /// <param name="commonStackerCrane">å åæºå¯¹è±¡</param> |
| | | /// <returns></returns> |
| | | private Dt_Task? GetTask(CommonStackerCrane commonStackerCrane) |
| | | { |
| | | Dt_Task task; |
| | | if (commonStackerCrane.LastTaskType == null) |
| | | { |
| | | task = _taskService.QueryStackerCraneTask(commonStackerCrane.DeviceCode); |
| | | } |
| | | else |
| | | { |
| | | if (commonStackerCrane.LastTaskType.GetValueOrDefault().GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) |
| | | { |
| | | task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode); |
| | | if (task == null) |
| | | { |
| | | task = _taskService.QueryStackerCraneOutTask(commonStackerCrane.DeviceCode); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | task = _taskService.QueryStackerCraneOutTask(commonStackerCrane.DeviceCode); |
| | | if (task == null) |
| | | { |
| | | task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode); |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (task != null && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) |
| | | { |
| | | if (OutTaskStationIsOccupied(task) != null || true) |
| | | { |
| | | return task; |
| | | } |
| | | else |
| | | { |
| | | List<string> otherOutStaionCodes = _routerService.QueryNextRoutes(commonStackerCrane.DeviceCode, task.NextAddress).Select(x => x.ChildPosi).ToList(); |
| | | List<Dt_Task> tasks = _taskService.QueryStackerCraneOutTasks(commonStackerCrane.DeviceCode, otherOutStaionCodes); |
| | | foreach (var item in tasks) |
| | | { |
| | | if (OutTaskStationIsOccupied(task) != null) |
| | | { |
| | | return task; |
| | | } |
| | | } |
| | | task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode); |
| | | } |
| | | } |
| | | |
| | | return task; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// åºåºä»»å¡å¤æåºåºç«å°æ¯å¦è¢«å ç¨ |
| | | /// </summary> |
| | | /// <param name="task">ä»»å¡å®ä½</param> |
| | | /// <returns>妿æªè¢«å ç¨ï¼è¿åä¼ å
¥çä»»å¡ä¿¡æ¯ï¼å¦åï¼è¿ånull</returns> |
| | | private Dt_Task? OutTaskStationIsOccupied([NotNull] Dt_Task task) |
| | | { |
| | | Dt_StationManger? stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == task.TargetAddress && x.StackerCraneCode == task.Roadway); |
| | | if (stationManger != null) |
| | | { |
| | | IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode); |
| | | if (device != null) |
| | | { |
| | | OtherDevice client = (OtherDevice)device; |
| | | if (client.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanPut, stationManger.StationCode))//åºåºç«å°æªè¢«å ç¨ |
| | | { |
| | | task.TargetAddress = stationManger.StackerCraneStationCode; |
| | | _taskRepository.UpdateData(task); |
| | | return task; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"æªæ¾å°åºåºç«å°ã{stationManger.StationDeviceCode}ã对åºçéè®¯å¯¹è±¡ï¼æ æ³å¤æåºåºç«å°æ¯å¦è¢«å ç¨"); |
| | | WriteInfo(nameof(StackerCraneJob_ZH), $"æªæ¾å°åºåºç«å°ã{stationManger.StationDeviceCode}ã对åºçéè®¯å¯¹è±¡ï¼æ æ³å¤æåºåºç«å°æ¯å¦è¢«å ç¨"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"æªæ¾å°ç«å°ã{task.NextAddress}ãä¿¡æ¯ï¼æ æ³æ ¡éªç«å°"); |
| | | WriteInfo(nameof(StackerCraneJob_ZH), $"æªæ¾å°ç«å°ã{task.NextAddress}ãä¿¡æ¯ï¼æ æ³æ ¡éªç«å°"); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡å®ä½è½¬æ¢æå½ä»¤Model |
| | | /// </summary> |
| | | /// <param name="task">ä»»å¡å®ä½</param> |
| | | /// <returns></returns> |
| | | /// <exception cref="Exception"></exception> |
| | | public StackerCraneTaskCommand? ConvertToStackerCraneTaskCommand([NotNull] Dt_Task task) |
| | | { |
| | | StackerCraneTaskCommand stackerCraneTaskCommand = new StackerCraneTaskCommand(); |
| | | |
| | | stackerCraneTaskCommand.Barcode = task.PalletCode; |
| | | stackerCraneTaskCommand.TaskNum = task.TaskNum; |
| | | stackerCraneTaskCommand.WorkType = 1; |
| | | 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("-"); |
| | | |
| | | stackerCraneTaskCommand.StartRow = Convert.ToInt16(startCodes[0]); |
| | | stackerCraneTaskCommand.StartColumn = Convert.ToInt16(startCodes[1]); |
| | | stackerCraneTaskCommand.StartLayer = Convert.ToInt16(startCodes[2]); |
| | | |
| | | string[] targetCodes = task.NextAddress.Split("-"); |
| | | if (targetCodes.Length == 3) |
| | | { |
| | | stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[0]); |
| | | stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[1]); |
| | | stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[2]); |
| | | } |
| | | else |
| | | { |
| | | //æ°æ®é
ç½®é误 |
| | | _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"å
¥åºä»»å¡ç»ç¹é误ï¼èµ·ç¹ï¼ã{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) |
| | | { |
| | | stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[0]); |
| | | stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[1]); |
| | | stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[2]); |
| | | } |
| | | else |
| | | { |
| | | //æ°æ®é
ç½®é误 |
| | | _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"åºåºä»»å¡èµ·ç¹é误ï¼èµ·ç¹ï¼ã{task.CurrentAddress}ã"); |
| | | WriteInfo(nameof(StackerCraneJob_ZH), $"åºåºä»»å¡èµ·ç¹é误ï¼èµ·ç¹ï¼ã{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) |
| | | { |
| | | stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[0]); |
| | | stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[1]); |
| | | stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[2]); |
| | | } |
| | | else |
| | | { |
| | | //æ°æ®é
ç½®é误 |
| | | _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"ç§»åºä»»å¡ç»ç¹é误ï¼èµ·ç¹ï¼ã{task.NextAddress}ã"); |
| | | WriteInfo(nameof(StackerCraneJob_ZH), $"ç§»åºä»»å¡ç»ç¹é误ï¼èµ·ç¹ï¼ã{task.NextAddress}ã"); |
| | | return null; |
| | | } |
| | | string[] sourceCodes = task.CurrentAddress.Split("-"); |
| | | if (sourceCodes.Length == 3) |
| | | { |
| | | stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[0]); |
| | | stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[1]); |
| | | stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[2]); |
| | | } |
| | | else |
| | | { |
| | | //æ°æ®é
ç½®é误 |
| | | _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"ç§»åºä»»å¡èµ·ç¹é误ï¼èµ·ç¹ï¼ã{task.CurrentAddress}ã"); |
| | | |
| | | WriteInfo(nameof(StackerCraneJob_ZH), $"ç§»åºä»»å¡èµ·ç¹é误ï¼èµ·ç¹ï¼ã{task.CurrentAddress}ã"); |
| | | return null; |
| | | } |
| | | } |
| | | return stackerCraneTaskCommand; |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | public partial class MaterielInfoService : ServiceBase<Dt_MaterielInfo, IMaterielInfoRepository>, IMaterielInfoService |
| | | { |
| | | public MaterielInfoService(IMaterielInfoRepository BaseDal) : base(BaseDal) |
| | | private readonly IBasicRepository _basicRepository; |
| | | |
| | | public MaterielInfoService(IMaterielInfoRepository BaseDal, IBasicRepository basicRepository) : base(BaseDal) |
| | | { |
| | | _basicRepository = basicRepository; |
| | | } |
| | | |
| | | public IMaterielInfoRepository Repository => BaseDal; |
| | |
| | | { |
| | | public class BasicService : IBasicService |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public ILocationInfoService LocationInfoService { get; } |
| | | |
| | | public IMaterielInfoService MaterielInfoService { get; } |
| | | |
| | | public IWarehouseService WarehouseService { get; } |
| | | |
| | | public BasicService(ILocationInfoService locationInfoService, IMaterielInfoService materielInfoService, IWarehouseService warehouseService) |
| | | public ISupplierInfoService SupplierInfoService { get; } |
| | | |
| | | public BasicService(ILocationInfoService locationInfoService, IMaterielInfoService materielInfoService, IWarehouseService warehouseService, ISupplierInfoService supplierInfoService) |
| | | { |
| | | LocationInfoService = locationInfoService; |
| | | MaterielInfoService = materielInfoService; |
| | | WarehouseService = warehouseService; |
| | | SupplierInfoService = supplierInfoService; |
| | | } |
| | | } |
| | | } |
| | |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_DTO.Basic; |
| | | using WIDESEA_DTO.ERP; |
| | | using WIDESEA_IBasicRepository; |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_Model.Models; |
| | |
| | | { |
| | | try |
| | | { |
| | | Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseCode == model.WaId); |
| | | if (warehouse == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°ä»åºä¿¡æ¯"); |
| | | } |
| | | |
| | | if (model.OperateType == 0) |
| | | { |
| | | Dt_MaterielInfo materielInfo = new Dt_MaterielInfo() |
| | |
| | | MaterielName = model.Name, |
| | | MaterielSize = model.Size, |
| | | MaterielSourceType = (MaterielSourceTypeEnum)model.ItemSourceType, |
| | | MaterielSpec = "model.", |
| | | MaterielSpec = model.StandType, |
| | | MaterielState = (EnableEnum)model.State, |
| | | MaterielThickness = model.Thickness, |
| | | MaterielType = (MaterielTypeEnum)model.ItemType, |
| | | MaterielUnit = model.Unit, |
| | | MaterielVersion = model.MaterialVersion, |
| | | MaterielWide = model.Wide, |
| | | WarehouseId = model.WaId, |
| | | WarehouseId = warehouse.WarehouseId, |
| | | }; |
| | | BaseDal.AddData(materielInfo); |
| | | } |
| | |
| | | materielInfo.MaterielUnit = model.Unit; |
| | | materielInfo.MaterielVersion = model.MaterialVersion; |
| | | materielInfo.MaterielWide = model.Wide; |
| | | materielInfo.WarehouseId = model.WaId; |
| | | materielInfo.WarehouseId = warehouse.WarehouseId; |
| | | BaseDal.UpdateData(materielInfo); |
| | | } |
| | | else if (model.OperateType == 2) |
| | |
| | | [AttributeUsage(AttributeTargets.Method)] |
| | | public class MethodParamsValidateAttribute : Attribute |
| | | { |
| | | |
| | | } |
| | | } |
| | |
| | | |
| | | public Func<object, (bool, string, object?)> CustomValidateMethod { get; set; } |
| | | |
| | | public object ErrorResponse { get; set; } |
| | | |
| | | public ModelValidateAttribute() |
| | | { |
| | | } |
| | |
| | | namespace WIDESEA_DTO.Basic |
| | | { |
| | | [ModelValidate] |
| | | public class Supplier |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string From { get; set; } |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string DateTime { get; set; } |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [PropertyValidate("ç©æå表", NotNullAndEmpty = true)] |
| | | public SupplierDTO Content { get; set; } |
| | | } |
| | | [ModelValidate] |
| | | public class SupplierDTO |
| | | { |
| | | /// <summary> |
| | | /// ä¾åºåç¼ç |
| | | /// </summary> |
| | | [PropertyValidate("ä¾åºåç¼ç ", NotNullAndEmpty = true)] |
| | | public string Code { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¾åºåå
¨ç§° |
| | | /// </summary> |
| | | [PropertyValidate("ä¾åºåå
¨ç§°", NotNullAndEmpty = true)] |
| | | public string Name { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¾åºåç®ç§° |
| | | /// </summary> |
| | | [PropertyValidate("ä¾åºåç®ç§°", NotNullAndEmpty = true)] |
| | | public string ShortName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è系人 |
| | | /// </summary> |
| | | [PropertyValidate("è系人", NotNullAndEmpty = true)] |
| | | public string Contacts { get; set; } |
| | | |
| | | /// <summary> |
| | | /// èç³»çµè¯ |
| | | /// </summary> |
| | | [PropertyValidate("èç³»çµè¯", NotNullAndEmpty = true)] |
| | | public string ContactNumber { get; set; } |
| | | |
| | | /// <summary> |
| | | /// èç³»å°å |
| | | /// </summary> |
| | | [PropertyValidate("èç³»å°å", NotNullAndEmpty = true)] |
| | | public string ContactAddress { get; set; } |
| | | |
| | | /// <summary> |
| | | /// çµåé®ç®± |
| | | /// </summary> |
| | | [PropertyValidate("çµåé®ç®±", NotNullAndEmpty = true)] |
| | | public string Email { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æè¿° |
| | | /// </summary> |
| | | [PropertyValidate("æè¿°", NotNullAndEmpty = true)] |
| | | public string Description { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç¶æ |
| | | /// </summary> |
| | | [PropertyValidate("ç¶æ", NotNullAndEmpty = true)] |
| | | public int State { get; set; } |
| | | |
| | | public string InvOrgId { get; set; } |
| | | /// <summary> |
| | | /// åºåç»ç» |
| | | /// </summary> |
| | | [PropertyValidate("åºåç»ç»", NotNullAndEmpty = true)] |
| | | public string InvOrgId { get; set; } = "æ·®å®ç¹åäºå"; |
| | | |
| | | /// <summary> |
| | | /// æä½ç±»å |
| | | /// </summary> |
| | | [PropertyValidate("æä½ç±»å", NotNullAndEmpty = true,Check = new object[] { 0, 1, 2 })] |
| | | public string OperateType { get; set; } |
| | | } |
| | | } |
| | |
| | | |
| | | namespace WIDESEA_DTO.ERP |
| | | { |
| | | [ModelValidate] |
| | | public class ErpOutOrder |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// åºåºå |
| | | /// </summary> |
| | | public string From { get; set; } |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string DateTime { get; set; } |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [PropertyValidate("ç©æå表", NotNullAndEmpty = true)] |
| | | public ErpOutOrderDTO Content { get; set; } |
| | | } |
| | | [ModelValidate] |
| | | public class ErpOutOrderDTO |
| | | { |
| | | /// <summary> |
| | | /// æä½ç±»å<br/> |
| | | /// 1ï¼æ°å¢<br/> |
| | | /// 2ï¼ä¿®æ¹<br/> |
| | | /// 3ï¼å é¤(å é¤åªè¦æç»è¡å·å颿åå·) |
| | | /// </summary> |
| | | [PropertyValidate("æä½ç±»å", NotNullAndEmpty = true, Check = new object[] { 1, 2, 3 })] |
| | | public int Way { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æç»è¡å· |
| | | /// </summary> |
| | | [PropertyValidate("æç»è¡å·", NotNullAndEmpty = true)] |
| | | public string RowNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é¢æè®¢åå· |
| | | /// </summary> |
| | | [PropertyValidate("é¢æè®¢åå·", NotNullAndEmpty = true)] |
| | | public string OrderNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»åºç¼å· |
| | | /// </summary> |
| | | [PropertyValidate("ä»åºç¼å·", NotNullAndEmpty = true)] |
| | | public string WaId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 订åç±»å<br/> |
| | | /// 1ï¼æ åçäº§é¢æ<br/> |
| | | /// 2ï¼æ åé¨é¨é¢æ<br/> |
| | | /// 3ï¼ç å项ç®é¢æ<br/> |
| | | /// 4ï¼ç©æéæ£åºä»<br/> |
| | | /// 5ï¼ç©æè°åº<br/> |
| | | /// 6ï¼ç»´ä¿®åæ<br/> |
| | | /// 7ï¼éå®è´¸æ<br/> |
| | | /// 8ï¼é货管ç |
| | | /// </summary> |
| | | [PropertyValidate("订åç±»å", NotNullAndEmpty = true, Check = new object[] { 1, 2, 3, 4, 5, 6, 7, 8 })] |
| | | public int OType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æç¼ç |
| | | /// </summary> |
| | | [PropertyValidate("ç©æç¼ç ", NotNullAndEmpty = true)] |
| | | public string MCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©ææ¹æ¬¡ |
| | | /// </summary> |
| | | [PropertyValidate("ç©ææ¹æ¬¡")] |
| | | public string MLot { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ°é |
| | | /// </summary> |
| | | [PropertyValidate("æ°é", NotNullAndEmpty = true, MinValue = 0, IsContainMinValue = false)] |
| | | public float Qty { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½ |
| | | /// </summary> |
| | | [PropertyValidate("åä½", NotNullAndEmpty = true)] |
| | | public string Unit { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¸åæ¥æ |
| | | /// </summary> |
| | | [PropertyValidate("ä¸åæ¥æ", NotNullAndEmpty = true)] |
| | | public string OrderData { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | [PropertyValidate("夿³¨")] |
| | | public string Node { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é¨é¨ç¼å· |
| | | /// </summary> |
| | | [PropertyValidate("é¨é¨ç¼å·")] |
| | | public string DepartmentCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é¨é¨åç§° |
| | | /// </summary> |
| | | [PropertyValidate("é¨é¨åç§°")] |
| | | public string DepartmentName { get; set; } |
| | | } |
| | | } |
| | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public bool bSucc { get; set; } = true; |
| | | public bool BSucc { get; set; } = true; |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string strCode { get; set; } = "0000"; |
| | | public string StrCode { get; set; } = "0000"; |
| | | /// <summary> |
| | | /// æ§è¡æå |
| | | /// </summary> |
| | | public string strMsg { get; set; } = "æ§è¡æå"; |
| | | public string StrMsg { get; set; } = "æ§è¡æå"; |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | |
| | | } |
| | | public ErpResponseContent OK(string message = null) |
| | | { |
| | | bSucc = true; |
| | | strCode = "0000"; |
| | | strMsg = message == null ? "æ§è¡æå" : message; |
| | | BSucc = true; |
| | | StrCode = "0000"; |
| | | StrMsg = message == null ? "æ§è¡æå" : message; |
| | | return this; |
| | | } |
| | | |
| | | public ErpResponseContent Error(string message = null) |
| | | { |
| | | bSucc = false; |
| | | strCode = "404"; |
| | | strMsg = message == null ? "æ§è¡å¤±è´¥" : message; |
| | | BSucc = false; |
| | | StrCode = "404"; |
| | | StrMsg = message == null ? "æ§è¡å¤±è´¥" : message; |
| | | return this; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.Attributes; |
| | | |
| | | namespace WIDESEA_DTO.ERP |
| | | { |
| | | [ModelValidate()] |
| | | public class MaterielInfoDTO |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [PropertyValidate("", NotNullAndEmpty = true)] |
| | | public string Code { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [PropertyValidate("", NotNullAndEmpty = true)] |
| | | public string Name { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [PropertyValidate("", NotNullAndEmpty = true)] |
| | | public string StandType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [PropertyValidate("", NotNullAndEmpty = true)] |
| | | public int ItemType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [PropertyValidate("", NotNullAndEmpty = true)] |
| | | public string Type { get; set; } |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [PropertyValidate("", NotNullAndEmpty = true)] |
| | | public int ItemSourceType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [PropertyValidate("", NotNullAndEmpty = true)] |
| | | public string Unit { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [PropertyValidate("", NotNullAndEmpty = true)] |
| | | public string MaterialVersion { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [PropertyValidate("", NotNullAndEmpty = true)] |
| | | public int Size { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [PropertyValidate("", NotNullAndEmpty = true)] |
| | | public int Length { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [PropertyValidate("", NotNullAndEmpty = true)] |
| | | public int Thickness { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [PropertyValidate("", NotNullAndEmpty = true)] |
| | | public int Wide { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [PropertyValidate("", NotNullAndEmpty = true)] |
| | | public string Model { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [PropertyValidate("", NotNullAndEmpty = true)] |
| | | public string Color { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [PropertyValidate("", NotNullAndEmpty = true)] |
| | | public string MaterialTG { get; set; } |
| | | |
| | | ///// <summary> |
| | | ///// |
| | | ///// </summary> |
| | | //[PropertyValidate("", NotNullAndEmpty = true)] |
| | | //public string Spare1 { get; set; } |
| | | |
| | | ///// <summary> |
| | | ///// |
| | | ///// </summary> |
| | | //[PropertyValidate("", NotNullAndEmpty = true)] |
| | | //public string Spare2 { get; set; } |
| | | |
| | | ///// <summary> |
| | | ///// |
| | | ///// </summary> |
| | | //[PropertyValidate("", NotNullAndEmpty = true)] |
| | | //public string Spare3 { get; set; } |
| | | |
| | | ///// <summary> |
| | | ///// |
| | | ///// </summary> |
| | | //[PropertyValidate("", NotNullAndEmpty = true)] |
| | | //public string Spare4 { get; set; } |
| | | |
| | | ///// <summary> |
| | | ///// |
| | | ///// </summary> |
| | | //[PropertyValidate("", NotNullAndEmpty = true)] |
| | | //public string Spare5 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [PropertyValidate("", NotNullAndEmpty = true)] |
| | | public int State { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [PropertyValidate("", NotNullAndEmpty = true)] |
| | | public string InvOrgId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [PropertyValidate("", NotNullAndEmpty = true)] |
| | | public int OperateType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [PropertyValidate("", NotNullAndEmpty = true)] |
| | | public string UserDef01 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [PropertyValidate("", NotNullAndEmpty = true)] |
| | | public string UserDef04 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [PropertyValidate("", NotNullAndEmpty = true)] |
| | | public int IsCheck { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [PropertyValidate("", NotNullAndEmpty = true)] |
| | | public string WaId { get; set; } |
| | | } |
| | | } |
| | |
| | | |
| | | namespace WIDESEA_DTO |
| | | { |
| | | [ModelValidate] |
| | | public class Root |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string From { get; set; } |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string DateTime { get; set; } |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [PropertyValidate("ç©æå表", NotNullAndEmpty = true)] |
| | | public PurchaseOrderModel Content { get; set; } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// éè´å模å |
| | | /// </summary> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.Attributes; |
| | | |
| | | namespace WIDESEA_DTO.ERP |
| | | { |
| | | [ModelValidate] |
| | | public class Root<T> |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string From { get; set; } |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string DateTime { get; set; } |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [PropertyValidate("å
容", NotNullAndEmpty = true)] |
| | | public T Content { get; set; } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.Attributes; |
| | | |
| | | namespace WIDESEA_DTO |
| | | { |
| | | [ModelValidate] |
| | | public class MesResponseContent |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public bool bSucc { get; set; } |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string StrCode { get; set; } |
| | | /// <summary> |
| | | /// æ§è¡æå |
| | | /// </summary> |
| | | public string StrMsg { get; set; } |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public DateTime DataTime { get; set; } |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public content Content { get; set; } |
| | | |
| | | public class content |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string Code { get; set; } |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string Name { get; set; } |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string ShortName { get; set; } |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string Contacts { get; set; } |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.Attributes; |
| | | |
| | | namespace WIDESEA_DTO |
| | | { |
| | | /// <summary> |
| | | /// æµè¯æ¶åºä»æ¨¡å |
| | | /// </summary> |
| | | [ModelValidate] |
| | | public class TestToolOutModel |
| | | { |
| | | /// <summary> |
| | | /// æµæ¶ç¼ç |
| | | /// </summary> |
| | | [PropertyValidate("æµæ¶ç¼ç ", NotNullAndEmpty = true)] |
| | | public string ToolCode { get; set; } |
| | | /// <summary> |
| | | /// ç®æ å°åç |
| | | /// </summary> |
| | | [PropertyValidate("ç®æ å°åç ", NotNullAndEmpty = true)] |
| | | public string TargetAddressCode { get; set; } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æµè¯æ¶æ¥åºæ¨¡å |
| | | /// </summary> |
| | | [ModelValidate] |
| | | public class TestToolScrapModel |
| | | { |
| | | /// <summary> |
| | | /// æµæ¶ç¼ç |
| | | /// </summary> |
| | | [PropertyValidate("æµæ¶ç¼ç ", NotNullAndEmpty = true)] |
| | | public string ToolCode { get; set; } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æµè¯æ¶éåºæ¨¡å |
| | | /// </summary> |
| | | [ModelValidate] |
| | | public class TestToolBackModel |
| | | { |
| | | /// <summary> |
| | | /// æºä½ç½® |
| | | /// </summary> |
| | | [PropertyValidate("æºä½ç½®", NotNullAndEmpty = true)] |
| | | public string SourceAddressCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æµè¯æ¶ç¼ç |
| | | /// </summary> |
| | | [PropertyValidate("æµè¯æ¶ç¼ç ", NotNullAndEmpty = true)] |
| | | public string TestToolCode { get; set; } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_DTO.Stock |
| | | { |
| | | public class StockOutboundOrderDTO |
| | | { |
| | | /// <summary> |
| | | /// åæ®ç¼ç |
| | | /// </summary> |
| | | public string OrderNo { get; set; } |
| | | /// <summary> |
| | | /// æçå· |
| | | /// </summary> |
| | | public string PalletCode { get; set; } |
| | | /// <summary> |
| | | /// ç©æç¼ç |
| | | /// </summary> |
| | | public string MaterielCode { get; set; } |
| | | /// <summary> |
| | | /// ç©æåç§° |
| | | /// </summary> |
| | | public string MaterielName { get; set; } |
| | | /// <summary> |
| | | /// æ¹æ¬¡å· |
| | | /// </summary> |
| | | public string BatchNo { get; set; } |
| | | /// <summary> |
| | | /// åºåå· |
| | | /// </summary> |
| | | public string SerialNumber { get; set; } |
| | | /// <summary> |
| | | /// åºåæ°é |
| | | /// </summary> |
| | | public float StockQuantity { get; set; } |
| | | /// <summary> |
| | | /// åºåºæ°é |
| | | /// </summary> |
| | | public float OutboundQuantity { get; set; } |
| | | /// <summary> |
| | | /// å·¥åæ»æ° |
| | | /// </summary> |
| | | public float OrderQuantity { get; set; } |
| | | /// <summary> |
| | | /// å·²åºæ°é |
| | | /// </summary> |
| | | public float OverOutQuantity { get; set; } |
| | | } |
| | | } |
| | |
| | | { |
| | | public interface IBasicService: IDependency |
| | | { |
| | | /// <summary> |
| | | /// è´§ä½ä¸å¡å± |
| | | /// </summary> |
| | | ILocationInfoService LocationInfoService { get; } |
| | | |
| | | /// <summary> |
| | | /// ç©æä¸å¡å± |
| | | /// </summary> |
| | | IMaterielInfoService MaterielInfoService { get; } |
| | | |
| | | /// <summary> |
| | | /// ä»åºä¸å¡å± |
| | | /// </summary> |
| | | IWarehouseService WarehouseService { get; } |
| | | |
| | | /// <summary> |
| | | /// ä¾åºåä¸å¡å± |
| | | /// </summary> |
| | | ISupplierInfoService SupplierInfoService { get; } |
| | | } |
| | | } |
| | |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_DTO.Basic; |
| | | using WIDESEA_DTO.ERP; |
| | | using WIDESEA_IBasicRepository; |
| | | using WIDESEA_Model.Models; |
| | | |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_DTO.Stock; |
| | | using WIDESEA_IStockRepository; |
| | |
| | | List<Dt_StockInfo> GetOutboundStocks(List<Dt_StockInfo> stockInfos, string materielCode, float needQuantity, out float residueQuantity); |
| | | |
| | | List<Dt_StockInfo> GetUseableStocks(string materielCode, string batchNo, int warehoseId); |
| | | StockOutboundOrderDTO GetStockOutboundOrder(SaveModel saveModel); |
| | | } |
| | | } |
| | |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_DTO; |
| | | using WIDESEA_DTO.ERP; |
| | | using WIDESEA_DTO.Stock; |
| | | using WIDESEA_ITaskInfoRepository; |
| | | using WIDESEA_Model.Models; |
| | |
| | | WebResponseContent RequestInboundTask(string palletCode, string stationCode); |
| | | |
| | | WebResponseContent InboundTaskCompleted(int taskNum); |
| | | /// <summary> |
| | | /// æµè¯æ¶åºä» |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | MesResponseContent TestToolOut(TestToolOutModel model); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | private static object _rowNoLocker = new object(); |
| | | /// <summary> |
| | | /// æ«ç æ·»å æ¶è´§åæç»ï¼åä¸ªï¼ |
| | | /// </summary> |
| | | /// <param name="serNum">ç©æç </param> |
| | | /// <param name="orderNo">æ¶è´§åå·</param> |
| | | /// <returns></returns> |
| | | public WebResponseContent AddReceiveOrderDetail(string serNum, string orderNo) |
| | | { |
| | | try |
| | |
| | | [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "夿³¨")] |
| | | public string Remark { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "ä»åºç¼å·")] |
| | | public string WarehouseId { get; set; } |
| | | /// <summary> |
| | | /// ä»åºç¼å· |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "ä»åºç¼å·")] |
| | | public int WarehouseId { get; set; } |
| | | } |
| | | } |
| | |
| | | using AutoMapper; |
| | | using MailKit.Search; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.RefAndLookup; |
| | | using SqlSugar; |
| | | using System; |
| | |
| | | } |
| | | |
| | | } |
| | | public StockOutboundOrderDTO GetStockOutboundOrder(SaveModel saveModel) |
| | | { |
| | | try |
| | | { |
| | | var palletCode = saveModel.MainData["barcode"].ToString(); |
| | | Dt_StockInfo stockInfo = BaseDal.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == palletCode).Includes(x => x.Details).First(); |
| | | if (stockInfo == null) |
| | | { |
| | | throw new Exception($"æªæ¾å°åºåä¿¡æ¯"); |
| | | } |
| | | Dt_StockInfoDetail stockInfoDetail = stockInfo.Details.FirstOrDefault(); |
| | | if (stockInfoDetail == null) |
| | | { |
| | | throw new Exception($"æªæ¾å°åºå详æ
"); |
| | | } |
| | | BaseDal.QueryTabs<Dt_OutboundOrder, Dt_OutboundOrderDetail, StockOutboundOrderDTO>((a, b) => a.Id == b.OrderId, (a, b) => new StockOutboundOrderDTO |
| | | { |
| | | OrderNo = a.OrderNo, |
| | | MaterielCode = b.MaterielCode, |
| | | MaterielName = b.MaterielName, |
| | | PalletCode = stockInfo.PalletCode, |
| | | BatchNo = b.BatchNo, |
| | | OrderQuantity = b.OrderQuantity, |
| | | OverOutQuantity = b.OverOutQuantity, |
| | | OutboundQuantity = stockInfoDetail.OutboundQuantity, |
| | | SerialNumber = stockInfoDetail.SerialNumber, |
| | | StockQuantity = stockInfoDetail.StockQuantity, |
| | | |
| | | }, a => true, b => b.BatchNo == stockInfoDetail.BatchNo && b.MaterielCode == stockInfoDetail.MaterielCode, x => true).Select(x => new StockOutboundOrderDTO |
| | | { |
| | | OrderNo = x.OrderNo, |
| | | MaterielCode = x.MaterielCode, |
| | | MaterielName = x.MaterielName, |
| | | PalletCode = x.PalletCode, |
| | | BatchNo = x.BatchNo, |
| | | OrderQuantity = x.OrderQuantity, |
| | | OverOutQuantity = x.OverOutQuantity, |
| | | OutboundQuantity = x.OutboundQuantity, |
| | | SerialNumber = x.SerialNumber, |
| | | StockQuantity = x.StockQuantity, |
| | | }).ToList(); |
| | | return new StockOutboundOrderDTO(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return null; |
| | | } |
| | | } |
| | | public List<Dt_StockInfo> GetOutboundStocks(List<Dt_StockInfo> stockInfos, string materielCode, float needQuantity, out float residueQuantity) |
| | | { |
| | | List<Dt_StockInfo> outStocks = new List<Dt_StockInfo>(); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_DTO; |
| | | using WIDESEA_ITaskInfoRepository; |
| | | using WIDESEA_ITaskInfoService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_TaskInfoService |
| | | { |
| | | public partial class TaskService : ServiceBase<Dt_Task, ITaskRepository>, ITaskService |
| | | { |
| | | /// <summary> |
| | | /// æµè¯æ¶åºä» |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | public MesResponseContent TestToolOut(TestToolOutModel model) |
| | | { |
| | | return new MesResponseContent(); |
| | | } |
| | | } |
| | | } |
| | |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("ReceivePurchaseOrderSingle"), AllowAnonymous, MethodParamsValidate] |
| | | public ErpResponseContent ReceivePurchaseOrder([FromBody] Root model) |
| | | public ErpResponseContent ReceivePurchaseOrder([FromBody] Root<PurchaseOrderModel> model) |
| | | { |
| | | WebResponseContent content = _purchaseOrderService.ReceivePurchaseOrder(model.Content); |
| | | if (content.Status) return Instance.OK(); |
| | |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("ReceiveSupplier"), AllowAnonymous, MethodParamsValidate] |
| | | public ErpResponseContent ReceiveSupplier([FromBody] Supplier model) |
| | | public ErpResponseContent ReceiveSupplier([FromBody] Root<SupplierDTO> model) |
| | | { |
| | | WebResponseContent content = _supplierInfoService.ReceiveSupplier(model.Content); |
| | | if (content.Status) return Instance.OK(); |
| | |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("ReceiveMaterial"), AllowAnonymous, MethodParamsValidate] |
| | | public ErpResponseContent ReceiveMaterial([FromBody] MaterielInfo model) |
| | | public ErpResponseContent ReceiveMaterial([FromBody] Root<MaterielInfoDTO> model) |
| | | { |
| | | WebResponseContent content = _materielInfoService.ReceiveMaterial(model.Content); |
| | | if (content.Status) return Instance.OK(); |
| | |
| | | /// <param name="erpOutOrder"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("ReceiveOutOrder"), AllowAnonymous, MethodParamsValidate] |
| | | public ErpResponseContent ReceiveOutOrder([FromBody] ErpOutOrder erpOutOrder) |
| | | public ErpResponseContent ReceiveOutOrder([FromBody] Root<ErpOutOrderDTO> erpOutOrder) |
| | | { |
| | | WebResponseContent content = _outboundOrderService.ReceiveOutOrder(erpOutOrder.Content); |
| | | if (content.Status) return Instance.OK(); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core.Attributes; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_DTO; |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_IInboundRepository; |
| | | using WIDESEA_IInboundService; |
| | | using WIDESEA_IOutboundService; |
| | | using WIDESEA_ITaskInfoService; |
| | | using WIDESEA_TaskInfoService; |
| | | using WIDESEA_DTO.ERP; |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers.MES |
| | | { |
| | | [Route("api/Mes")] |
| | | [ApiController] |
| | | public class MesController : ControllerBase |
| | | { |
| | | private readonly IPurchaseOrderRepository _purchaseOrderRepository; |
| | | private readonly IPurchaseOrderService _purchaseOrderService; |
| | | private readonly ISupplierInfoService _supplierInfoService; |
| | | private readonly IMaterielInfoService _materielInfoService; |
| | | private readonly IOutboundOrderService _outboundOrderService; |
| | | private readonly ITaskService _taskService; |
| | | |
| | | public MesController(IPurchaseOrderRepository purchaseOrderRepository, IPurchaseOrderService purchaseOrderService, ISupplierInfoService supplierInfoService, IMaterielInfoService materielInfoService, IOutboundOrderService outboundOrderService,ITaskService taskService) |
| | | { |
| | | _purchaseOrderRepository = purchaseOrderRepository; |
| | | _purchaseOrderService = purchaseOrderService; |
| | | _supplierInfoService = supplierInfoService; |
| | | _materielInfoService = materielInfoService; |
| | | _outboundOrderService = outboundOrderService; |
| | | _taskService = taskService; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¥æ¶MESæµè¯æ¶åºåº |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("TestToolOut"), AllowAnonymous, MethodParamsValidate] |
| | | public MesResponseContent TestToolOut([FromBody] Root<TestToolOutModel> model) |
| | | { |
| | | return _taskService.TestToolOut(model.Content); |
| | | } |
| | | } |
| | | } |
| | |
| | | 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_IBasicRepository; |
| | |
| | | { |
| | | return Service.GetStockSelectViews(orderId, materielCode); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ£é |
| | | /// </summary> |
| | | /// <param name="saveModel"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("GetStockOutboundOrder")] |
| | | public StockOutboundOrderDTO GetStockOutboundOrder([FromBody] SaveModel saveModel) |
| | | { |
| | | return Service.GetStockOutboundOrder(saveModel); |
| | | } |
| | | } |
| | | } |