刘磊
2024-11-23 4c511d29869878c7a7ea015cbac4367faeb0e27b
合并
已添加7个文件
216 ■■■■■ 文件已修改
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStoragIntegrationServices/WCS/IWCSService.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/BasicInfo/IDt_StationManagerRepository.cs 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/BasicInfo/IDt_StationManagerService.cs 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/WCS/Partial/RequestFlow.cs 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/WCS/WCSService.cs 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/BasicInfo/Dt_StationManagerRepository.cs 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/WCS/WCSController.cs 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStoragIntegrationServices/WCS/IWCSService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,14 @@
using 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
    {
    }
}
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/BasicInfo/IDt_StationManagerRepository.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,31 @@
#region << ç‰ˆ æœ¬ æ³¨ é‡Š >>
/*----------------------------------------------------------------
 * å‘½åç©ºé—´ï¼šWIDESEAWCS_ITaskInfoRepository
 * åˆ›å»ºè€…:胡童庆
 * åˆ›å»ºæ—¶é—´ï¼š2024/8/2 16:13:36
 * ç‰ˆæœ¬ï¼šV1.0.0
 * æè¿°ï¼š
 *
 * ----------------------------------------------------------------
 * ä¿®æ”¹äººï¼š
 * ä¿®æ”¹æ—¶é—´ï¼š
 * ç‰ˆæœ¬ï¼šV1.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>
    {
    }
}
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/BasicInfo/IDt_StationManagerService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,30 @@
#region << ç‰ˆ æœ¬ æ³¨ é‡Š >>
/*----------------------------------------------------------------
 * å‘½åç©ºé—´ï¼šWIDESEAWCS_ITaskInfoService
 * åˆ›å»ºè€…:胡童庆
 * åˆ›å»ºæ—¶é—´ï¼š2024/8/2 16:13:36
 * ç‰ˆæœ¬ï¼šV1.0.0
 * æè¿°ï¼š
 *
 * ----------------------------------------------------------------
 * ä¿®æ”¹äººï¼š
 * ä¿®æ”¹æ—¶é—´ï¼š
 * ç‰ˆæœ¬ï¼šV1.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);
    }
}
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/WCS/Partial/RequestFlow.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,56 @@
using 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);
            }
        }
    }
}
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/WCS/WCSService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,33 @@
using 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;
        }
    }
}
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/BasicInfo/Dt_StationManagerRepository.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,28 @@
#region << ç‰ˆ æœ¬ æ³¨ é‡Š >>
/*----------------------------------------------------------------
 * å‘½åç©ºé—´ï¼šWIDESEAWCS_TaskInfoRepository
 * åˆ›å»ºè€…:胡童庆
 * åˆ›å»ºæ—¶é—´ï¼š2024/8/2 16:13:36
 * ç‰ˆæœ¬ï¼šV1.0.0
 * æè¿°ï¼š
 *
 * ----------------------------------------------------------------
 * ä¿®æ”¹äººï¼š
 * ä¿®æ”¹æ—¶é—´ï¼š
 * ç‰ˆæœ¬ï¼šV1.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)
        {
        }
    }
}
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/WCS/WCSController.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,24 @@
using 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;
    }
}