pan
2025-12-03 98c5fbdce57cf9f0914ca5fb2c659c9396d3aed6
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_BasicService/InvokeMESService.cs
@@ -27,31 +27,7 @@
using WIDESEA_Model.Models;
namespace WIDESEA_BasicService
{
    public class TransferDataDto
    {
        public DateTime TransferTime { get; set; }
        public List<TransferItemDto> Items { get; set; }
    }
    public class TransferItemDto
    {
        public string MaterialCode { get; set; }
        public decimal TotalQuantity { get; set; }
        public List<LocationInfoDto> Locations { get; set; }
    }
    public class LocationInfoDto
    {
        public string LocationCode { get; set; }
        public decimal Quantity { get; set; }
        public List<BarcodeInfoDto> Barcodes { get; set; }
    }
    public class BarcodeInfoDto
    {
        public string Barcode { get; set; }
        public decimal Quantity { get; set; }
    }
{
    public class InvokeMESService : IInvokeMESService
    {
        private readonly IHttpClientFactory _httpClientFactory;
@@ -817,12 +793,21 @@
            var now = DateTime.Now;
            string datePart = now.ToString("MMdd");
            long ticksPart = now.Ticks;
            // æ‹¼æŽ¥ï¼šè®¡æ•°å™¨è¡¥0为3位(避免位数不一致)
            return $"{datePart}{ticksPart}";
        }
        public static string GenerateCount()
        {
            var now = DateTime.Now;
            string datePart = now.ToString("yyyyMMddHHmmss");
            // åŽŸå­é€’å¢žè®¡æ•°å™¨ï¼ˆå–æ¨¡1000,确保计数器仅3位,控制长度)
            long counterPart = Interlocked.Increment(ref _counter) % 1000;
            // æ‹¼æŽ¥ï¼šè®¡æ•°å™¨è¡¥0为3位(避免位数不一致)
            return $"{datePart}{ticksPart}";
            return $"{datePart}{counterPart:D3}";
        }
    }
}