| | |
| | | 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; |
| | |
| | | { |
| | | 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. æ¥è¯¢æåé
æ¹ä¿¡æ¯ |
| | |
| | | existBoxinModel.PalletCode = PalletCode; |
| | | existBoxinModel.ProductCode = proCode; |
| | | existBoxinModel.BoxingNo = proOther; |
| | | existBoxinModel.SupplierCode = supplierCode; |
| | | |
| | | int id = _boxingService.Repository.AddData(existBoxinModel); |
| | | |