using Procurement.Enums; using Microsoft.AspNetCore.Mvc; using System; using System.Threading.Tasks; using Volo.Abp.AspNetCore.Mvc; using Procurement.EntityFrameworkCore.SqlRepositories; using Procurement.ViewModel; using Procurement.Helpers; using System.Text.Json; using System.Data.SqlClient; using System.Data; namespace Procurement.Controllers { [Produces("application/json")] [Route("api/wms/[controller]")] public class LableQueryController : AbpController { private readonly ISqlRepository _repository; public LableQueryController(ISqlRepository sqlRepository) { _repository = sqlRepository; } [HttpGet] public async Task Get(string domain, string location = "", string shelf = "", int page = 1) { ResultCode code = ResultCode.Success, subCode = ResultCode.Success; string subMsg = ""; dynamic items = null; try { SqlParameter[] parameters = { new SqlParameter { ParameterName = "@Domain", Value = domain,SqlDbType=SqlDbType.VarChar}, new SqlParameter { ParameterName = "@Location", Value = location,SqlDbType=SqlDbType.VarChar}, new SqlParameter { ParameterName = "@Shelf", Value = shelf,SqlDbType=SqlDbType.VarChar}, new SqlParameter { ParameterName = "@Page", Value = page,SqlDbType=SqlDbType.Int}, }; items = await _repository.GetListByProcAsync("pr_WMS_GetLableQueryWIPList", parameters); } catch (Exception ex) { subMsg = ex.Message; code = ResultCode.Fail; subCode = ResultCode.Fail; } ResultViewModel result = ResultHelper.CreateResult(code, items, subCode, subMsg); return Ok(result); } } }