dengjunjie
2 天以前 b784d019c3848718eb95eb0d34dde34c6a262b06
´úÂë¹ÜÀí/WIDESEAWCS_Server/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/BoxingDetailService.cs
@@ -3,6 +3,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using WIDESEAWCS_Common;
using WIDESEAWCS_Common.PLCEnum;
@@ -152,25 +153,31 @@
                    {
                        return WebResponseContent.Instance.Error("提交参数不能为空");
                    }
                    string productCode = toolingBoardSubmitDto.FinishedProductCode?.Trim();
                    string productCode = toolingBoardSubmitDto.FinishedProductCode.Trim();
                    string proCode = string.Empty;
                    string proOther = string.Empty;
                    string supplierCode = string.Empty;
                    if (!string.IsNullOrWhiteSpace(productCode))
                    {
                        var proCodeMatch = System.Text.RegularExpressions.Regex.Match(productCode, @"TX(\d+)(?=\s|\||$)", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
                        var proCodeMatch = Regex.Match(productCode, @"TX(\d+)(?=\s|\||$)", RegexOptions.IgnoreCase);
                        if (proCodeMatch.Success)
                        {
                            proCode = $"TX{proCodeMatch.Groups[1].Value.Trim()}";
                        }
                        // æ­£åˆ™2:匹配连续的10位纯数字(全局匹配,取第一个符合的即可)
                        var proOtherMatch = System.Text.RegularExpressions.Regex.Match(productCode, @"\d{10}");
                        var proOtherMatch = Regex.Match(productCode, @"\d{10}");
                        if (proOtherMatch.Success)
                        {
                            proOther = proOtherMatch.Value.Trim();
                        }
                        var supplierCodeMatch = Regex.Match(productCode, @"[A-Z]+$", RegexOptions.IgnoreCase);
                        if (supplierCodeMatch.Success)
                        {
                            supplierCode = supplierCodeMatch.Value.Trim();
                        }
                        toolingBoardSubmitDto.PartsList = toolingBoardSubmitDto.PartsList.Where(code => !string.IsNullOrEmpty(code)).ToList();
                        // 2. æŸ¥è¯¢æˆå“é…æ–¹ä¿¡æ¯
@@ -222,6 +229,7 @@
                        existBoxinModel.PalletCode = PalletCode;
                        existBoxinModel.ProductCode = proCode;
                        existBoxinModel.BoxingNo = proOther;
                        existBoxinModel.SupplierCode = supplierCode;
                        int id = _boxingService.Repository.AddData(existBoxinModel);