コード例 #1
0
        public override async Task <IEnumerable <ProcessInformation> > HandleCommand(GetCommonProcessCommand request, CancellationToken cancellationToken)
        {
            var company = await companyQueries.GetByUserIdAsync(request.LoginSession.Id);

            if (company == null)
            {
                throw new BusinessException("Common.NoPermission");
            }

            var lst = (await processQueries.GetsAsync(company?.Id)).ToList();

            foreach (var item in lst)
            {
                if (item.Production?.GTIN != null)
                {
                    item.Production.GTIN.Code = await gTINService.GetCodeGTINAsync(item.Production.GTIN);
                }
            }

            return(lst);
        }