dengjunjie
2 天以前 b52018589bf6c7ec1d51ce8ad000a7aa993b0ab5
´úÂë¹ÜÀí/WIDESEAWCS_Server/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/BoxingDetailService.cs
@@ -161,24 +161,31 @@
                    if (!string.IsNullOrWhiteSpace(productCode))
                    {
                        string[] parts = productCode.Split(new char[] { ' ', '|' }, StringSplitOptions.RemoveEmptyEntries);
                        if (parts.Length < 3) return WebResponseContent.Instance.Error("编码规则有误!");
                        proCode = parts[0];
                        proOther = parts[1];
                        supplierCode = parts[2];
                        var proCodeMatch = Regex.Match(productCode, @"TX(\d+)(?=\s|\||$)", RegexOptions.IgnoreCase);
                        if (proCodeMatch.Success)
                        {
                            proCode = $"TX{proCodeMatch.Groups[1].Value.Trim()}";
                        }
                        #region èŽ·å–æˆå“ç¼–å·ã€æµæ°´å·ã€ä¾›æ–¹ä»£ç 
                        //var proCodeMatch = Regex.Match(productCode, @"TX(\d+)(?=\s|\||$)", RegexOptions.IgnoreCase);
                        //if (proCodeMatch.Success)
                        //{
                        //    proCode = $"TX{proCodeMatch.Groups[1].Value.Trim()}";
                        //}
                        // æ­£åˆ™2:匹配连续的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();
                        }
                        //// æ­£åˆ™2:匹配连续的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();
                        //}
                        #endregion
                        toolingBoardSubmitDto.PartsList = toolingBoardSubmitDto.PartsList.Where(code => !string.IsNullOrEmpty(code)).ToList();
                        // 2. æŸ¥è¯¢æˆå“é…æ–¹ä¿¡æ¯
                        Dt_Formula formulaModel = _formulaService.Repository.QueryFirst(x => x.ProductCode == proCode);
@@ -228,6 +235,7 @@
                        Dt_Boxing existBoxinModel = new Dt_Boxing();
                        existBoxinModel.PalletCode = PalletCode;
                        existBoxinModel.ProductCode = proCode;
                        existBoxinModel.ProductName = formulaModel.ProductName;
                        existBoxinModel.BoxingNo = proOther;
                        existBoxinModel.SupplierCode = supplierCode;