| | |
| | | |
| | | 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); |
| | |
| | | Dt_Boxing existBoxinModel = new Dt_Boxing(); |
| | | existBoxinModel.PalletCode = PalletCode; |
| | | existBoxinModel.ProductCode = proCode; |
| | | existBoxinModel.ProductName = formulaModel.ProductName; |
| | | existBoxinModel.BoxingNo = proOther; |
| | | existBoxinModel.SupplierCode = supplierCode; |
| | | |