| | |
| | | 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; |
| | |
| | | private readonly IFormulaDetailService _formulaDetailService; |
| | | private readonly IProcessInfoDetailService _processInfoDetailService; |
| | | private readonly IScanStationService _scanStationService; |
| | | |
| | | |
| | | |
| | | private readonly IUnitOfWorkManage _unitOfWorkManage; |
| | | |
| | |
| | | _processInfoDetailService = processInfoDetailService; |
| | | _scanStationService = scanStationService; |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | | |
| | | |
| | | } |
| | | |
| | | public IRepository<Dt_BoxingDetail> Repository => BaseDal; |
| | |
| | | { |
| | | 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)) |
| | | { |
| | | 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 = System.Text.RegularExpressions.Regex.Match(productCode, @"TX(\d+)(?=\s|\||$)", System.Text.RegularExpressions.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 = System.Text.RegularExpressions.Regex.Match(productCode, @"\d{10}"); |
| | | if (proOtherMatch.Success) |
| | | { |
| | | proOther = proOtherMatch.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_ScanStation dt_ScanStation = _scanStationService.Repository.QueryFirst(x => x.StationCode == "001"); |
| | | if (dt_ScanStation.StationEndProduct != proCode) |
| | | if (dt_ScanStation.StationEndProduct != proCode) |
| | | { |
| | | return WebResponseContent.Instance.Error("æåç¼å·é误"); |
| | | } |
| | |
| | | return WebResponseContent.Instance.Error($"ç©æã{IsCode}ãé误ï¼è¯·æ ¸å¯¹ç©æç¼å·"); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | //Dt_Boxing existBoxinModel = _boxingService.Repository.QueryFirst(x => x.PalletCode == PalletCode); |
| | | |
| | | |
| | | //if (existBoxinModel == null) |
| | | //{ |
| | | // return WebResponseContent.Instance.Error($"æçæªæ·»å ï¼è¯·ç¨åéè¯"); |
| | |
| | | throw new InvalidOperationException("æçç æªæ«å°ï¼è¯·éè¯"); |
| | | } |
| | | Dt_Boxing dt_Boxing = _boxingService.Repository.QueryFirst(x => x.PalletCode == PalletCode); |
| | | if(dt_Boxing != null) |
| | | if (dt_Boxing != null) |
| | | { |
| | | throw new InvalidOperationException("æçç é夿«æ"); |
| | | } |
| | | Dt_Boxing existBoxinModel = new Dt_Boxing(); |
| | | existBoxinModel.PalletCode = PalletCode; |
| | | existBoxinModel.ProductCode = proCode; |
| | | existBoxinModel.ProductName = formulaModel.ProductName; |
| | | existBoxinModel.BoxingNo = proOther; |
| | | existBoxinModel.SupplierCode = supplierCode; |
| | | |
| | | int id = _boxingService.Repository.AddData(existBoxinModel); |
| | | |
| | |
| | | uow.Commit(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | OtherDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceName == "主æ§PLC") as OtherDevice; |
| | | if (device == null) throw new Exception("æªæ¾å°ä¸»æ§PLC设å¤ä¿¡æ¯"); |
| | |
| | | .QueryData(x => x.ProductSn == proOther && x.ProductCode == proCode).ToList(); |
| | | |
| | | // 3. 夿æ¥è¯¢ç»æï¼åå¨åèµå¼æç¤ºä¿¡æ¯ |
| | | if (dt_ProcessInfoDetail.Count<=3 && dt_ProcessInfoDetail.Count != 0) |
| | | if (dt_ProcessInfoDetail.Count <= 3 && dt_ProcessInfoDetail.Count != 0) |
| | | { |
| | | msg = "å·²ææµæ°´å·"; |
| | | } |