using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json.Linq; using Opsoft.NetCore.O3App.Domain; using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IServices; using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.Model; using Opsoft.NetCore.O3App.Shared; using Opsoft.NetCore.O3App.WebApi.Models; using System.Collections.Generic; using System.Threading.Tasks; namespace Opsoft.NetCore.O3App.WebApi.Controllers.WMS { [Authorize] public class BillHandleController : BaseApiController { private readonly IBillHandleService _Service; public BillHandleController(IMapper mapper, ILogger logger, IBillHandleService Service) : base(mapper, logger) { _Service = Service; } /// /// 查询需要进行复核的单据信息 /// /// /// [HttpGet] public async Task>> QuerySelBill() { return await TryProcess(async input => { return await _Service.QuerySelBill(); }, LoginInfo); } /// /// 扫描单据编号,查询单据信息 /// /// /// [HttpPost] public async Task> QueryBillInfo([FromBody] JObject data) { return await TryProcess(async input => { RetMessage retMess = await _Service.QueryBillInfo(data); if (retMess == null || retMess.Status == 0) { throw new O3AppException(retMess.Message); } else { return retMess.Data["data"]; } }, LoginInfo); } /// /// 扫描条码,查询条码信息 /// /// /// [HttpPost] public async Task> QueryBarCode([FromBody] JObject data) { return await TryProcess(async input => { RetMessage retMess = await _Service.QueryBarCode(data); if (retMess == null || retMess.Status == 0) { throw new O3AppException(retMess.Message); } else { return retMess.Data["data"]; } }, LoginInfo); } /// /// 出入库复核提交 /// /// /// [HttpPost] public async Task> CheckSubmit([FromBody] CheckBarCode request) { return await TryProcess(async input => { RetMessage retMess = await _Service.CheckSubmit(request.orgID, request.tranType, request.fbillNo, request.barcodeList); if (retMess == null || retMess.Status == 0) { throw new O3AppException(retMess.Message); } else { return retMess.Data["data"]; } }, LoginInfo); } } }