| | |
| | | 锘縰sing Microsoft.AspNetCore.Http; |
| | | using Microsoft.Extensions.Logging; |
| | | using Org.BouncyCastle.Asn1.Ocsp; |
| | | using System; |
| | | using System.Collections.Generic; |
| | |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_DTO.Basic; |
| | | using WIDESEA_DTO.Outbound; |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_IOutboundService; |
| | |
| | | private readonly IStockInfoDetailService _stockInfoDetailService; |
| | | private readonly IOutStockLockInfoService _outStockLockInfoService; |
| | | private readonly IDailySequenceService _dailySequenceService; |
| | | private readonly IInvokeMESService _invokeMESService; |
| | | |
| | | public SplitPackageService(IRepository<Dt_SplitPackageRecord> BaseDal, IUnitOfWorkManage unitOfWorkManage, IStockInfoService stockInfoService, IOutStockLockInfoService outStockLockInfoService, IStockInfoDetailService stockInfoDetailService, IDailySequenceService dailySequenceService) : base(BaseDal) |
| | | private readonly ILogger<SplitPackageService> _logger; |
| | | public SplitPackageService(IRepository<Dt_SplitPackageRecord> BaseDal, IUnitOfWorkManage unitOfWorkManage, IStockInfoService stockInfoService, IOutStockLockInfoService outStockLockInfoService, IStockInfoDetailService stockInfoDetailService, IDailySequenceService dailySequenceService, IInvokeMESService invokeMESService, ILogger<SplitPackageService> logger) : base(BaseDal) |
| | | { |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | | _stockInfoService = stockInfoService; |
| | | _outStockLockInfoService = outStockLockInfoService; |
| | | _stockInfoDetailService = stockInfoDetailService; |
| | | _dailySequenceService = dailySequenceService; |
| | | _invokeMESService = invokeMESService; |
| | | _logger = logger; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | |
| | | _unitOfWorkManage.CommitTran(); |
| | | |
| | | // 7. 鍥炰紶鏂版潯鐮佺粰MES |
| | | // await SendBarcodeToMES(newBarcode, request.MaterielCode, request.SplitQuantity); |
| | | |
| | | try |
| | | { |
| | | MaterielToMesDTO dto = new MaterielToMesDTO |
| | | { |
| | | batchNo = stockDetail.BatchNo, |
| | | factoryArea = stockDetail.FactoryArea, |
| | | materialCode = stockDetail.MaterielCode, |
| | | newmaterialCode = newBarcode, |
| | | oldmaterialCode = request.OriginalBarcode, |
| | | operationType = 1, |
| | | qty = remainingQty, |
| | | supplyCode = stockDetail.SupplyCode, |
| | | unit = stockDetail.BarcodeUnit, |
| | | warehouseCode = stockDetail.WarehouseCode, |
| | | reqCode = Guid.NewGuid().ToString(), |
| | | reqTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") |
| | | }; |
| | | _invokeMESService.NewMaterielToMes(dto); |
| | | } |
| | | catch(Exception ex) |
| | | { |
| | | _logger.LogError("SplitPackage 鍥炰紶MES: " + ex.Message); |
| | | } |
| | | return WebResponseContent.Instance.OK("鎷嗗寘鎴愬姛", new |
| | | { |
| | | NewBarcode = newBarcode, |