刘磊
2025-11-17 efbeb93b3d454f06d65dbcc68ad828cc95bc9404
同步文件
已添加7个文件
已修改1个文件
351 ■■■■■ 文件已修改
项目代码/WMS/WMSServer/WIDESEA_Common/BDC/BDCEnum.cs 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServer/WIDESEA_IStorageBasicRepository/BasicInfo/IDt_BDCConfigurationRepository.cs 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServer/WIDESEA_IStorageBasicService/BasicInfo/IDt_BDCConfigurationService.cs 82 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServer/WIDESEA_Model/Models/BasicInfo/Dt_BDCConfiguration.cs 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServer/WIDESEA_StoragIntegrationServices/MES/Partial/removeWorkOrderInfo.cs 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServer/WIDESEA_StorageBasicRepository/BasicInfo/Dt_BDCConfigurationRepository.cs 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServer/WIDESEA_StorageBasicServices/BasicInfo/Dt_BDCConfigurationService.cs 109 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目资料/项目图纸/零跑金华四厂BDC4巷道方案20250829.dwg 补丁 | 查看 | 原始文档 | blame | 历史
ÏîÄ¿´úÂë/WMS/WMSServer/WIDESEA_Common/BDC/BDCEnum.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WIDESEA_Common
{
    public enum BodyType
    {
        WhiteBody = 1,
        PaintedBody,
    }
    public enum BodyStatus
    {
        InWeldingShop = 1,
        InBDC,
        InPaintingShop,
        InAssemblyShop,
        Completed
    }
}
ÏîÄ¿´úÂë/WMS/WMSServer/WIDESEA_IStorageBasicRepository/BasicInfo/IDt_BDCConfigurationRepository.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_BDCConfigurationRepository : IRepository<Dt_BDCConfiguration>
    {
    }
}
ÏîÄ¿´úÂë/WMS/WMSServer/WIDESEA_IStorageBasicService/BasicInfo/IDt_BDCConfigurationService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,82 @@
#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_BDCConfigurationService : IService<Dt_BDCConfiguration>
    {
        /// <summary>
        /// èŽ·å–å½“å‰ç”Ÿæ•ˆçš„ç¼“å­˜é…ç½®
        /// </summary>
        Task<Dt_BDCConfiguration> GetCurrentConfiguration();
        /// <summary>
        /// æ›´æ–°ç¼“存配置
        /// </summary>
        Task<Dt_BDCConfiguration> UpdateConfiguration(int maxWhiteBody, int maxPaintedBody,
            int maxBatteryCase, int maxEmptySled, string updatedBy);
        /// <summary>
        /// æ£€æŸ¥ç™½è½¦èº«æ˜¯å¦å¯ä»¥å…¥åº“(未超过最大缓存数)
        /// </summary>
        Task<bool> CanAddWhiteBody();
        /// <summary>
        /// æ£€æŸ¥å½©è½¦èº«æ˜¯å¦å¯ä»¥å…¥åº“(未超过最大缓存数)
        /// </summary>
        Task<bool> CanAddPaintedBody();
        /// <summary>
        /// æ£€æŸ¥ç”µæ± å£³æ˜¯å¦å¯ä»¥å…¥åº“(未超过最大缓存数)
        /// </summary>
        //Task<bool> CanAddBatteryCase();
        /// <summary>
        /// æ£€æŸ¥ç©ºæ»‘橇是否可以入库(未超过最大缓存数)
        /// </summary>
        Task<bool> CanAddEmptySled();
        /// <summary>
        /// èŽ·å–å½“å‰ç™½è½¦èº«ç¼“å­˜æ•°é‡
        /// </summary>
        int GetWhiteBodyCount();
        /// <summary>
        /// èŽ·å–å½“å‰å½©è½¦èº«ç¼“å­˜æ•°é‡
        /// </summary>
        int GetPaintedBodyCount();
        /// <summary>
        /// èŽ·å–å½“å‰ç”µæ± å£³ç¼“å­˜æ•°é‡
        /// </summary>
       int GetBatteryCaseCount();
        /// <summary>
        /// èŽ·å–å½“å‰ç©ºæ»‘æ©‡ç¼“å­˜æ•°é‡
        /// </summary>
      int GetEmptySledCount();
        /// <summary>
        /// ç”Ÿæˆåº“存容量报告
        /// </summary>
        //Task<InventoryCapacityReport> GenerateCapacityReport();
    }
}
ÏîÄ¿´úÂë/WMS/WMSServer/WIDESEA_Model/Models/BasicInfo/Dt_BDCConfiguration.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,67 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WIDESEA_Model.Models
{
    /// <summary>
    /// BDC缓存配置,存储各类物料的最大缓存数量限制
    /// </summary>
    [SugarTable(nameof(Dt_BDCConfiguration), "BDC缓存配置")]
    public class Dt_BDCConfiguration
    {
        [Key]
        public int Id { get; set; }
        /// <summary>
        /// é…ç½®åç§°
        /// </summary>
        [Required]
        [MaxLength(100)]
        public string Name { get; set; } = "Default Configuration";
        /// <summary>
        /// ç™½è½¦èº«æœ€å¤§ç¼“存数
        /// </summary>
        [Range(0, int.MaxValue)]
        public int MaxWhiteBodyCache { get; set; } = 100;
        /// <summary>
        /// å½©è½¦èº«æœ€å¤§ç¼“存数
        /// </summary>
        [Range(0, int.MaxValue)]
        public int MaxPaintedBodyCache { get; set; } = 100;
        /// <summary>
        /// ç”µæ± å£³æœ€å¤§ç¼“存数
        /// </summary>
        [Range(0, int.MaxValue)]
        public int MaxBatteryCaseCache { get; set; } = 50;
        /// <summary>
        /// ç©ºæ»‘橇最大缓存数
        /// </summary>
        [Range(0, int.MaxValue)]
        public int MaxEmptySledCache { get; set; } = 30;
        /// <summary>
        /// æœ€åŽæ›´æ–°æ—¶é—´
        /// </summary>
        public DateTime LastUpdatedTime { get; set; } = DateTime.Now;
        /// <summary>
        /// æ›´æ–°äºº
        /// </summary>
        [MaxLength(50)]
        public string UpdatedBy { get; set; } = "System";
        /// <summary>
        /// æ˜¯å¦å¯ç”¨
        /// </summary>
        public int IsActive { get; set; }
    }
}
ÏîÄ¿´úÂë/WMS/WMSServer/WIDESEA_StoragIntegrationServices/MES/Partial/removeWorkOrderInfo.cs
@@ -8,8 +8,12 @@
namespace WIDESEA_StoragIntegrationServices
{
    /// <summary>
    /// BDC请求焊装特征下发
    /// æŽ¥å£æè¿°: è½¦èº«è¿›å…¥BDC时,BDC读取车身上的一维条码向MES请求焊装特征信息
    /// è®¢å•、工单撤排
    /// æŽ¥å£æè¿°:通知BDC涂装工单/总装工单/订单撤排
    /// 1- å·¥å•/订单撤排支持部分撤排
    /// 2- è¯•制类型工单/订单撤排BDC库已过BDC03/BDC05工单不支持撤排
    /// 3-非试制类型工单/订单撤排一句绑定状态,已完成绑定的工单/订单不支持撤排
    /// 4-总装工单已拉动锁车的车身工单不支持撤排
    /// </summary>
    public partial class MESService
    {
@@ -17,7 +21,7 @@
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
            {
                return content.OK();
ÏîÄ¿´úÂë/WMS/WMSServer/WIDESEA_StorageBasicRepository/BasicInfo/Dt_BDCConfigurationRepository.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_BDCConfigurationRepository : RepositoryBase<Dt_BDCConfiguration>, IDt_BDCConfigurationRepository
    {
        public Dt_BDCConfigurationRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage)
        {
        }
    }
}
ÏîÄ¿´úÂë/WMS/WMSServer/WIDESEA_StorageBasicServices/BasicInfo/Dt_BDCConfigurationService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,109 @@
using WIDESEA_Common;
using WIDESEA_IServices;
using WIDESEAWCS_BasicInfoRepository;
using WIDESEAWCS_Model.Models;
namespace WIDESEAWCS_BasicInfoService
{
    public partial class Dt_BDCConfigurationService : ServiceBase<Dt_BDCConfiguration, IDt_BDCConfigurationRepository>, IDt_BDCConfigurationService
    {
        private readonly ISys_ConfigService _sys_ConfigService;
        private readonly IDt_PalletStockInfoRepository _palletStockInfoRepository;
        public Dt_BDCConfigurationService(IDt_BDCConfigurationRepository BaseDal, ISys_ConfigService sys_ConfigService, IDt_PalletStockInfoRepository palletStockInfoRepository) : base(BaseDal)
        {
            _sys_ConfigService = sys_ConfigService;
            _palletStockInfoRepository = palletStockInfoRepository;
        }
        public async Task<Dt_BDCConfiguration> GetCurrentConfiguration()
        {
            // èŽ·å–å½“å‰ç”Ÿæ•ˆçš„é…ç½®
            var currentConfig = await BaseDal.QueryFirstAsync(c => c.IsActive == 1);
            // å¦‚果没有配置,创建默认配置
            if (currentConfig == null)
            {
                currentConfig = new Dt_BDCConfiguration();
                BaseDal.AddData(currentConfig);
            }
            return currentConfig;
        }
        public async Task<Dt_BDCConfiguration> UpdateConfiguration(int maxWhiteBody, int maxPaintedBody,
           int maxBatteryCase, int maxEmptySled, string updatedBy)
        {
            // ç¦ç”¨å½“前配置
            var currentConfigs = await BaseDal.QueryDataAsync(c => c.IsActive == 1);
            currentConfigs.ForEach(c => c.IsActive = 2);
            // åˆ›å»ºæ–°é…ç½®
            var newConfig = new Dt_BDCConfiguration
            {
                MaxWhiteBodyCache = maxWhiteBody,
                MaxPaintedBodyCache = maxPaintedBody,
                MaxBatteryCaseCache = maxBatteryCase,
                MaxEmptySledCache = maxEmptySled,
                LastUpdatedTime = DateTime.Now,
                UpdatedBy = updatedBy,
                IsActive = 1
            };
            BaseDal.UpdateData(currentConfigs);
            BaseDal.AddData(newConfig);
            return newConfig;
        }
        public async Task<bool> CanAddWhiteBody()
        {
            var config = await GetCurrentConfiguration();
            var currentCount =  GetWhiteBodyCount();
            // é¢„ç•™5%的缓冲空间
            var threshold = (int)(config.MaxWhiteBodyCache * 0.95);
            return currentCount < threshold;
        }
        public async Task<bool> CanAddPaintedBody()
        {
            var config = await GetCurrentConfiguration();
            var currentCount =  GetPaintedBodyCount();
            // é¢„ç•™5%的缓冲空间
            var threshold = (int)(config.MaxPaintedBodyCache * 0.95);
            return currentCount < threshold;
        }
        public async Task<bool> CanAddEmptySled()
        {
            var config = await GetCurrentConfiguration();
            var currentCount =  GetEmptySledCount();
            // é¢„ç•™5%的缓冲空间
            var threshold = (int)(config.MaxEmptySledCache * 0.95);
            return currentCount < threshold;
        }
        public int GetWhiteBodyCount()
        {
            return _palletStockInfoRepository.QueryData(b => b.CarType == (int)BodyType.WhiteBody && b.StockStatus == (int)BodyStatus.InBDC).Count;
        }
        public int GetPaintedBodyCount()
        {
            return  _palletStockInfoRepository.QueryData(b => b.CarType == (int)BodyType.PaintedBody && b.StockStatus == (int)BodyStatus.InBDC).Count;
        }
        public int GetBatteryCaseCount()
        {
            return _palletStockInfoRepository.QueryData(b => b.StockStatus == (int)BodyStatus.InBDC).Count;
        }
        public int GetEmptySledCount()
        {
            return _palletStockInfoRepository.QueryData(s => s.StockStatus == (int)BodyStatus.InBDC).Count;
        }
    }
}
ÏîÄ¿×ÊÁÏ/ÏîĿͼֽ/ÁãÅܽð»ªËij§BDC4ÏïµÀ·½°¸20250829.dwg
Binary files differ