| | |
| | | private readonly ILocationInfoService _locationInfoService; |
| | | private readonly IDailySequenceService _dailySequenceService; |
| | | private readonly IMaterialUnitService _materialUnitService; |
| | | private readonly IRepository<Dt_MaterielInfo> _materialInfoRepository; |
| | | private readonly IOutStockLockInfoService _outStockLockInfoService; |
| | | private readonly IOutboundOrderDetailService _outboundOrderDetailService; |
| | | private readonly IRepository<Dt_Task> _taskRepository; |
| | | private readonly ITask_HtyService _task_HtyService; |
| | | private readonly ILogger<InboundOrderController> _logger; |
| | | public InboundOrderController(IInboundOrderService service, WIDESEA_IBasicService.IErpApiService erpApiService, WIDESEA_IBasicService.IInvokeMESService invokeMESService, IESSApiService eSSApiService, IDailySequenceService dailySequenceService, ILocationInfoService locationInfoService, ILogger<InboundOrderController> logger, IMaterialUnitService materialUnitService, IInboundService inboundService, IOutStockLockInfoService outStockLockInfoService, IOutboundOrderDetailService outboundOrderDetailService, IRepository<Dt_Task> taskRepository, ITask_HtyService task_HtyService) : base(service) |
| | | public InboundOrderController(IInboundOrderService service, WIDESEA_IBasicService.IErpApiService erpApiService, WIDESEA_IBasicService.IInvokeMESService invokeMESService, IESSApiService eSSApiService, IDailySequenceService dailySequenceService, ILocationInfoService locationInfoService, ILogger<InboundOrderController> logger, IMaterialUnitService materialUnitService, IInboundService inboundService, IOutStockLockInfoService outStockLockInfoService, IOutboundOrderDetailService outboundOrderDetailService, IRepository<Dt_Task> taskRepository, ITask_HtyService task_HtyService, IRepository<Dt_MaterielInfo> materialInfoRepository) : base(service) |
| | | { |
| | | this.erpApiService = erpApiService; |
| | | _invokeMESService = invokeMESService; |
| | |
| | | _outboundOrderDetailService = outboundOrderDetailService; |
| | | _taskRepository = taskRepository; |
| | | _task_HtyService = task_HtyService; |
| | | _materialInfoRepository = materialInfoRepository; |
| | | } |
| | | |
| | | [HttpPost, Route("Test"), AllowAnonymous, MethodParamsValidate] |
| | | public async Task<WebResponseContent> Test() |
| | | { |
| | | |
| | | //var seq = await _dailySequenceService.GetNextSequenceAsync(); |
| | | //var SDDD= "WSLOT" + DateTime.Now.ToString("yyyyMMdd") + seq.ToString()?.PadLeft(5, '0'); |
| | | |
| | | //var originalTask = _taskRepository.Db.Queryable<Dt_Task>().First(); |
| | | |
| | |
| | | //var ddddssss = "WSLOT" + DateTime.Now.ToString("yyyyMMddHHmmss") + ssss.ToString().PadLeft(5, '0'); |
| | | //erpApiService.GetSuppliersAsync(); |
| | | |
| | | erpApiService.GetMaterialUnitAsync(); |
| | | // erpApiService.GetMaterialUnitAsync(); |
| | | |
| | | var sss = await _invokeMESService.NewMaterielToMes(new WIDESEA_DTO.Basic.MaterielToMesDTO |
| | | { |
| | | reqTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), |
| | | reqCode = Guid.NewGuid().ToString(), |
| | | oldmaterialCode = "b001", |
| | | newmaterialCode = "Bar01", |
| | | unit = "A01", |
| | | operationType = 1, |
| | | supplyCode = "A0001", |
| | | batchNo = "A0002", |
| | | materialCode = "FC00001", |
| | | warehouseCode = "", |
| | | factoryArea = "A01", |
| | | qty =20, |
| | | }); |
| | | //var sss = await _invokeMESService.NewMaterielToMes(new WIDESEA_DTO.Basic.MaterielToMesDTO |
| | | //{ |
| | | // reqTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), |
| | | // reqCode = Guid.NewGuid().ToString(), |
| | | // oldmaterialCode = "b001", |
| | | // newmaterialCode = "Bar01", |
| | | // unit = "A01", |
| | | // operationType = 1, |
| | | // supplyCode = "A0001", |
| | | // batchNo = "A0002", |
| | | // materialCode = "FC00001", |
| | | // warehouseCode = "", |
| | | // factoryArea = "A01", |
| | | // qty =20, |
| | | //}); |
| | | |
| | | //await _eSSApiService.MoveContainerAsync(new WIDESEA_DTO.Basic.MoveContainerRequest |
| | | //{ |
| | |
| | | //await erpApiService.GetMaterialInfoAsync(new WIDESEA_DTO.Basic.MaterialRequest()); |
| | | |
| | | |
| | | return WebResponseContent.Instance.OK(result?1:0 ); |
| | | return WebResponseContent.Instance.OK( ); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | Dt_InboundOrder dt_InboundOrder = new Dt_InboundOrder() { Details = new List<Dt_InboundOrderDetail>() }; |
| | | foreach (var detailitem in item.details) |
| | | { |
| | | |
| | | var materialName = _materialInfoRepository.QueryFirst(x => x.MaterielCode == detailitem.materialCode).MaterielName; |
| | | if (detailitem.barcodes != null && detailitem.barcodes.Any()) |
| | | { |
| | | foreach (var barcode in detailitem.barcodes) |
| | |
| | | { |
| | | lineNo = detailitem.lineNo, |
| | | MaterielCode = detailitem.materialCode, |
| | | MaterielName = materialName, |
| | | SupplyCode = detailitem.supplyCode, |
| | | BatchNo = detailitem.batchNo, |
| | | Unit = detailitem.unit, |
| | |
| | | OrderQuantity = detailitem.qty, |
| | | BarcodeUnit = detailitem.unit, |
| | | BarcodeQty = detailitem.qty, |
| | | MaterielName = materialName |
| | | }; |
| | | dt_InboundOrder.Details.Add(inboundOrderDetail); |
| | | } |
| | |
| | | |
| | | } |
| | | |
| | | [HttpPost, Route("UndoPalletGroup"), AllowAnonymous, MethodParamsValidate] |
| | | public WebResponseContent UndoPalletGroup(string palletCode) |
| | | [HttpPost, Route("UnPalletGroupBarcode"), AllowAnonymous, MethodParamsValidate] |
| | | public WebResponseContent UnPalletGroupBarcode(string orderNo) |
| | | { |
| | | return Service.UndoPalletGroup(palletCode); |
| | | return Service.UnPalletGroupBarcode(orderNo); |
| | | } |
| | | |
| | | [HttpPost, Route("UndoPalletGroup"), AllowAnonymous, MethodParamsValidate] |
| | | public WebResponseContent UndoPalletGroup(string palletCode,string barcode="") |
| | | { |
| | | return Service.UndoPalletGroup(palletCode,barcode); |
| | | } |
| | | /// <summary> |
| | | /// |