コード例 #1
0
        public async Task <AjaxResult <PB_Tray> > OutManualTray(OutAutoByTary data)
        {
            var StorId = _Op.Property.DefaultStorageId;

            var traySvc = this._provider.GetRequiredService <IPB_TrayBusiness>();
            var tray    = await traySvc.GetByTrayId(data.TrayCode);

            if (tray == null)
            {
                return new AjaxResult <PB_Tray>()
                       {
                           Success = false, Msg = "托盘号为空"
                       }
            }
            ;
            if (tray.LocalId == null)
            {
                return new AjaxResult <PB_Tray>()
                       {
                           Success = false, Msg = "货位编号为空"
                       }
            }
            ;

            var localSvc = this._provider.GetRequiredService <IPB_LocationBusiness>();
            var local    = await localSvc.GetTheDataAsync(tray.LocalId);

            var entity = new PB_Tray()
            {
                Code        = tray.Code,
                LocalId     = tray.LocalId,
                PB_Location = local
            };

            return(new AjaxResult <PB_Tray>()
            {
                Success = true, Msg = "空托盘手动出库成功", Data = entity
            });
        }
コード例 #2
0
        public async Task <AjaxResult <PB_Tray> > OutAutoTray(OutAutoByTary data)
        {
            var traySvc = this._provider.GetRequiredService <IPB_TrayBusiness>();
            var tray    = await traySvc.GetByLocation(data.TrayTypeId);

            if (tray == null)
            {
                return new AjaxResult <PB_Tray>()
                       {
                           Success = false, Msg = "托盘号为空"
                       }
            }
            ;

            var StorId  = _Op.Property.DefaultStorageId;
            var listOut = await this._pB_TrayBus.ReqBlankTray(StorId, data.TrayTypeId);

            if (listOut.Local == null || listOut.Tray == null)
            {
                return new AjaxResult <PB_Tray>()
                       {
                           Success = false, Msg = "无空托盘"
                       }
            }
            ;

            var entity = new PB_Tray()
            {
                Code        = listOut.Tray.Code,
                PB_Location = listOut.Local
            };

            return(new AjaxResult <PB_Tray>()
            {
                Success = true, Msg = "空托盘自动出库成功", Data = entity
            });
        }