| | |
| | | using WIDESEAWCS_Core.BaseServices; |
| | | using WIDESEAWCS_Core.Helper; |
| | | using WIDESEAWCS_DTO.BasicInfo; |
| | | using WIDESEAWCS_IBasicInfoService; |
| | | using WIDESEAWCS_Model.Models; |
| | | using WIDESEAWCS_QuartzJob; |
| | | |
| | |
| | | private readonly IBoxingService _boxingService; |
| | | private readonly IFormulaService _formulaService; |
| | | private readonly IFormulaDetailService _formulaDetailService; |
| | | private readonly IProcessInfoDetailService _processInfoDetailService; |
| | | private readonly IScanStationService _scanStationService; |
| | | |
| | | |
| | | private readonly IUnitOfWorkManage _unitOfWorkManage; |
| | | |
| | | public BoxingDetailService( |
| | |
| | | IFormulaService formulaService, |
| | | IBoxingService boxingService, |
| | | IFormulaDetailService formulaDetailService, |
| | | IProcessInfoDetailService processInfoDetailService, |
| | | IScanStationService scanStationService, |
| | | IUnitOfWorkManage unitOfWorkManage |
| | | ) : base(BaseDal) |
| | | { |
| | | _formulaService = formulaService; |
| | | _boxingService = boxingService; |
| | | _formulaDetailService = formulaDetailService; |
| | | _processInfoDetailService = processInfoDetailService; |
| | | _scanStationService = scanStationService; |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | | |
| | | } |
| | | |
| | | public IRepository<Dt_BoxingDetail> Repository => BaseDal; |
| | |
| | | /// <returns></returns> |
| | | public string IsComponentCodesEqual(List<string> boxingDetails, List<string> formulaDetails) |
| | | { |
| | | |
| | | // å¤çnulléåï¼è§é¿ç©ºæéå¼å¸¸ |
| | | var boxList = boxingDetails ?? new List<string>(); |
| | | var formulaList = formulaDetails ?? new List<string>(); |
| | |
| | | return WebResponseContent.Instance.Error("æäº¤åæ°ä¸è½ä¸ºç©º"); |
| | | } |
| | | string productCode = toolingBoardSubmitDto.FinishedProductCode?.Trim(); |
| | | if (!string.IsNullOrWhiteSpace(productCode)) |
| | | { |
| | | |
| | | string proCode = string.Empty; |
| | | string proOther = string.Empty; |
| | | |
| | | if (!string.IsNullOrWhiteSpace(productCode)) |
| | | { |
| | | |
| | | 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()}"; // æ¼æ¥TX+æ°åï¼ä¿ææ ¼å¼ç»ä¸ |
| | | proCode = $"TX{proCodeMatch.Groups[1].Value.Trim()}"; |
| | | } |
| | | |
| | | // æ£å2ï¼å¹é
è¿ç»ç10ä½çº¯æ°åï¼å
¨å±å¹é
ï¼å第ä¸ä¸ªç¬¦åçå³å¯ï¼ |
| | |
| | | if (formulaModel == null) |
| | | { |
| | | return WebResponseContent.Instance.Error("æ æåé
æ¹ï¼è¯·æ ¸å¯¹æåç¼ç "); |
| | | } |
| | | |
| | | Dt_ScanStation dt_ScanStation = _scanStationService.Repository.QueryFirst(x => x.StationCode == "001"); |
| | | if (dt_ScanStation.StationEndProduct != proCode) |
| | | { |
| | | return WebResponseContent.Instance.Error("æåç¼å·é误"); |
| | | } |
| | | |
| | | List<Dt_FormulaDetail> dt_FormulaDetails = _formulaDetailService.Repository.QueryData(x => x.FormulaId == formulaModel.Id && x.IsScanned == 1); |
| | |
| | | if (!PalletCode.IsNotEmptyOrNull() || PalletCode == "NoRead") |
| | | { |
| | | throw new InvalidOperationException("æçç æªæ«å°ï¼è¯·éè¯"); |
| | | } |
| | | Dt_Boxing dt_Boxing = _boxingService.Repository.QueryFirst(x => x.PalletCode == PalletCode); |
| | | if(dt_Boxing != null) |
| | | { |
| | | throw new InvalidOperationException("æçç é夿«æ"); |
| | | } |
| | | Dt_Boxing existBoxinModel = new Dt_Boxing(); |
| | | existBoxinModel.PalletCode = PalletCode; |
| | |
| | | // #endregion |
| | | //} |
| | | //uow.Commit(); |
| | | //string msg = existBoxinModel == null ? "ç»çä¿¡æ¯æ°å¢æåï¼" : "ç»çä¿¡æ¯ä¿®æ¹æåï¼"; |
| | | string msg = null; |
| | | List<Dt_ProcessInfoDetail> dt_ProcessInfoDetail = _processInfoDetailService.Repository |
| | | .QueryData(x => x.ProductSn == proOther && x.ProductCode == proCode).ToList(); |
| | | |
| | | return WebResponseContent.Instance.OK(); |
| | | // 3. 夿æ¥è¯¢ç»æï¼åå¨åèµå¼æç¤ºä¿¡æ¯ |
| | | if (dt_ProcessInfoDetail.Count<=3 && dt_ProcessInfoDetail.Count != 0) |
| | | { |
| | | msg = "å·²ææµæ°´å·"; |
| | | } |
| | | |
| | | // 4. è¿åååºï¼åå¨éå¤åmsgæ¯"å·²ææµæ°´å·"ï¼ä¸åå¨åmsg为nullï¼ |
| | | return WebResponseContent.Instance.OK(msg); |
| | | } |
| | | catch (Exception ex) |
| | | { |