From 4c511d29869878c7a7ea015cbac4367faeb0e27b Mon Sep 17 00:00:00 2001
From: 刘磊 <1161824510@qq.com>
Date: 星期六, 23 十一月 2024 19:22:17 +0800
Subject: [PATCH] 合并
---
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/BasicInfo/Dt_StationManagerRepository.cs | 28 +++++++
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/BasicInfo/IDt_StationManagerService.cs | 30 +++++++
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/WCS/WCSController.cs | 24 ++++++
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/WCS/Partial/RequestFlow.cs | 56 ++++++++++++++
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStoragIntegrationServices/WCS/IWCSService.cs | 14 +++
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/WCS/WCSService.cs | 33 ++++++++
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/BasicInfo/IDt_StationManagerRepository.cs | 31 +++++++
7 files changed, 216 insertions(+), 0 deletions(-)
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStoragIntegrationServices/WCS/IWCSService.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStoragIntegrationServices/WCS/IWCSService.cs
new file mode 100644
index 0000000..3857f3b
--- /dev/null
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStoragIntegrationServices/WCS/IWCSService.cs
@@ -0,0 +1,14 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core;
+
+namespace WIDESEA_IStoragIntegrationServices
+{
+ public interface IWCSService : IDependency
+ {
+
+ }
+}
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/BasicInfo/IDt_StationManagerRepository.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/BasicInfo/IDt_StationManagerRepository.cs
new file mode 100644
index 0000000..b6a59ef
--- /dev/null
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/BasicInfo/IDt_StationManagerRepository.cs
@@ -0,0 +1,31 @@
+锘�#region << 鐗� 鏈� 娉� 閲� >>
+/*----------------------------------------------------------------
+ * 鍛藉悕绌洪棿锛歐IDESEAWCS_ITaskInfoRepository
+ * 鍒涘缓鑰咃細鑳$搴�
+ * 鍒涘缓鏃堕棿锛�2024/8/2 16:13:36
+ * 鐗堟湰锛歏1.0.0
+ * 鎻忚堪锛�
+ *
+ * ----------------------------------------------------------------
+ * 淇敼浜猴細
+ * 淇敼鏃堕棿锛�
+ * 鐗堟湰锛歏1.0.1
+ * 淇敼璇存槑锛�
+ *
+ *----------------------------------------------------------------*/
+#endregion << 鐗� 鏈� 娉� 閲� >>
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEAWCS_Model.Models;
+
+namespace WIDESEAWCS_BasicInfoRepository
+{
+ public interface IDt_StationManagerRepository : IRepository<Dt_StationManager>
+ {
+
+ }
+}
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/BasicInfo/IDt_StationManagerService.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/BasicInfo/IDt_StationManagerService.cs
new file mode 100644
index 0000000..ce3a1b1
--- /dev/null
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/BasicInfo/IDt_StationManagerService.cs
@@ -0,0 +1,30 @@
+锘�#region << 鐗� 鏈� 娉� 閲� >>
+
+/*----------------------------------------------------------------
+ * 鍛藉悕绌洪棿锛歐IDESEAWCS_ITaskInfoService
+ * 鍒涘缓鑰咃細鑳$搴�
+ * 鍒涘缓鏃堕棿锛�2024/8/2 16:13:36
+ * 鐗堟湰锛歏1.0.0
+ * 鎻忚堪锛�
+ *
+ * ----------------------------------------------------------------
+ * 淇敼浜猴細
+ * 淇敼鏃堕棿锛�
+ * 鐗堟湰锛歏1.0.1
+ * 淇敼璇存槑锛�
+ *
+ *----------------------------------------------------------------*/
+
+#endregion << 鐗� 鏈� 娉� 閲� >>
+
+using WIDESEAWCS_Model.Models;
+
+namespace WIDESEAWCS_BasicInfoService
+{
+ public interface IDt_StationManagerService : IService<Dt_StationManager>
+ {
+ List<Dt_StationManager> GetAllStationByDeviceCode(string DeviceCode);
+
+ Dt_StationManager GetStationInfoByChildCode(string ChildCode);
+ }
+}
\ No newline at end of file
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/WCS/Partial/RequestFlow.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/WCS/Partial/RequestFlow.cs
new file mode 100644
index 0000000..ea7b1ff
--- /dev/null
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/WCS/Partial/RequestFlow.cs
@@ -0,0 +1,56 @@
+锘縰sing MailKit;
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core;
+using WIDESEA_Core.Enums;
+using WIDESEA_DTO;
+using WIDESEAWCS_Model.Models;
+
+namespace WIDESEA_StoragIntegrationServices
+{
+ public partial class WCSService
+ {
+ /// <summary>
+ /// 璇锋眰娴佸悜
+ /// </summary>
+ /// <param name="json"></param>
+ /// <returns></returns>
+ public WebResponseContent RequestFlow(RequestTaskDto json)
+ {
+ WebResponseContent content = new WebResponseContent();
+ try
+ {
+ var minGroup = _locationRepository.QueryData(x => x.LocationStatus == (int)LocationEnum.Free && x.AreaId == json.area)
+ .GroupBy(x => x.RoadwayNo) //鏍规嵁鍫嗗灈鏈哄贩閬撳垎缁�
+ .OrderByDescending(g => g.Count()) // 鏍规嵁姣忎釜缁勭殑鍏冪礌鏁伴噺鎺掑簭
+ .First(); // 鍙栧嚭鏁伴噺鏈�澶氱殑宸烽亾
+
+ var stationinfo = _stationManagerRepository.QueryData(x => x.stationArea == json.area.ToString() && x.Roadway == minGroup.Key);
+ Dt_StationManager stationManager = new Dt_StationManager();
+ var task = _taskRepository.QueryFirst(x => x.Roadway == minGroup.Key);
+ if (task != null)
+ {
+ stationManager = stationinfo.FirstOrDefault(x => x.Roadway != task.Roadway);
+ }
+ else
+ {
+ stationManager = stationinfo.FirstOrDefault();
+ }
+ if (stationManager == null)
+ {
+ throw new Exception($"寮傚父锛氭棤娉曞垎閰嶅贩閬�");
+ }
+ return content.OK(data: stationManager);
+ }
+ catch (Exception ex)
+ {
+ return content.Error(ex.Message);
+ }
+ }
+ }
+}
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/WCS/WCSService.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/WCS/WCSService.cs
new file mode 100644
index 0000000..ec2e618
--- /dev/null
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/WCS/WCSService.cs
@@ -0,0 +1,33 @@
+锘縰sing LogLibrary.Log;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_IServices;
+using WIDESEA_IStorageBasicRepository;
+using WIDESEA_IStorageTaskRepository;
+using WIDESEA_IStoragIntegrationServices;
+using WIDESEAWCS_BasicInfoRepository;
+
+namespace WIDESEA_StoragIntegrationServices
+{
+ public partial class WCSService : IWCSService
+ {
+ private readonly ILocationInfoRepository _locationRepository;
+ private readonly IDt_TaskRepository _taskRepository;
+ private readonly IStockInfoRepository _stockInfoRepository;
+ private readonly ISys_ConfigService _configService;
+ private readonly IDt_StationManagerRepository _stationManagerRepository;
+ private readonly LogFactory LogFactory = new LogFactory();
+
+ public WCSService(ILocationInfoRepository locationRepository,IDt_TaskRepository taskRepository,IStockInfoRepository stockInfoRepository, ISys_ConfigService configService, IDt_StationManagerRepository stationManagerRepository)
+ {
+ _locationRepository = locationRepository;
+ _taskRepository = taskRepository;
+ _stockInfoRepository = stockInfoRepository;
+ _configService = configService;
+ _stationManagerRepository = stationManagerRepository;
+ }
+ }
+}
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/BasicInfo/Dt_StationManagerRepository.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/BasicInfo/Dt_StationManagerRepository.cs
new file mode 100644
index 0000000..e585382
--- /dev/null
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/BasicInfo/Dt_StationManagerRepository.cs
@@ -0,0 +1,28 @@
+锘�#region << 鐗� 鏈� 娉� 閲� >>
+/*----------------------------------------------------------------
+ * 鍛藉悕绌洪棿锛歐IDESEAWCS_TaskInfoRepository
+ * 鍒涘缓鑰咃細鑳$搴�
+ * 鍒涘缓鏃堕棿锛�2024/8/2 16:13:36
+ * 鐗堟湰锛歏1.0.0
+ * 鎻忚堪锛�
+ *
+ * ----------------------------------------------------------------
+ * 淇敼浜猴細
+ * 淇敼鏃堕棿锛�
+ * 鐗堟湰锛歏1.0.1
+ * 淇敼璇存槑锛�
+ *
+ *----------------------------------------------------------------*/
+#endregion << 鐗� 鏈� 娉� 閲� >>
+
+using WIDESEAWCS_Model.Models;
+
+namespace WIDESEAWCS_BasicInfoRepository
+{
+ public class Dt_StationManagerRepository : RepositoryBase<Dt_StationManager>, IDt_StationManagerRepository
+ {
+ public Dt_StationManagerRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage)
+ {
+ }
+ }
+}
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/WCS/WCSController.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/WCS/WCSController.cs
new file mode 100644
index 0000000..dc9483e
--- /dev/null
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/WCS/WCSController.cs
@@ -0,0 +1,24 @@
+锘縰sing AutoMapper.Configuration.Annotations;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using WIDESEA_Core.BaseController;
+using WIDESEA_DTO;
+using WIDESEA_IStoragIntegrationServices;
+
+namespace WIDESEA_WMSServer.Controllers;
+
+[Route("api/[controller]")]
+[ApiController]
+public class WCSController : Controller
+{
+ private readonly IWCSService _WCSService;
+ private readonly IHttpContextAccessor _httpContextAccessor;
+
+ public WCSController(IWCSService WCSService, IHttpContextAccessor httpContextAccessor)
+ {
+ _httpContextAccessor = httpContextAccessor;
+ _WCSService = WCSService;
+ }
+
+
+}
\ No newline at end of file
--
Gitblit v1.9.3