コード例 #1
0
        public async Task <ActionResult <MessageModel <List <string> > > > GetOdernos()
        {
            MessageModel <List <string> > res = new MessageModel <List <string> >();
            var listno = await _slOrderServices.GetEntitys(u => true).ToListAsync();

            var tasks = await _prProductTaskServices.GetEntitys(u => true).ToListAsync();

            List <string> tasknos = new List <string>();

            foreach (var item in tasks)
            {
                tasknos.Add(item.No);
            }
            List <string> nos = new List <string>();

            foreach (var item in listno)
            {
                if (!tasknos.Contains(item.No))
                {
                    nos.Add(item.No);
                }
            }
            res.Data = nos;
            return(Ok(res));
        }
コード例 #2
0
        public async Task <ActionResult <MessageModel <SlOrderDto> > > GetOrderByNo(string no)
        {
            MessageModel <SlOrderDto> res = new MessageModel <SlOrderDto>();

            if (!await _slOrderServices.ExistEntityAsync(a => a.No == no))
            {
                return(NotFound(res.FailRequest(404, "请输入正确的no")));
            }
            SlOrder entity = await _slOrderServices.GetEntitys(a => a.No == no).FirstOrDefaultAsync();

            res.Data = _mapper.Map <SlOrderDto>(entity);
            return(Ok(res));
        }