| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- 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.Data.SqlClient;
- using System.Data;
- namespace Procurement.Controllers
- {
- [Produces("application/json")]
- [Route("api/[controller]")]
- public class PurOrdMasterController : AbpController
- {
- private readonly ISqlRepository _repository;
- public PurOrdMasterController(ISqlRepository sqlRepository)
- {
- _repository = sqlRepository;
- }
- /// <summary>
- /// ²É¹ºµ¥Ñ¡ÔñÁбí
- /// </summary>
- /// <param name="domain"></param>
- /// <returns></returns>
- [Route("purordselectlist")]
- [HttpGet]
- public async Task<IActionResult> GetPurOrd(string domain, string type = "", string supplier = "")
- {
- 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 = "@Type", Value = type,SqlDbType=SqlDbType.VarChar},
- new SqlParameter { ParameterName = "@Supplier", Value = supplier,SqlDbType=SqlDbType.VarChar},
- };
- items = await _repository.GetSingleListByProcAsync("pr_WMS_GetPurOrdList", parameters);
- }
- catch (Exception ex)
- {
- subMsg = ex.Message;
- code = ResultCode.Fail;
- subCode = ResultCode.Fail;
- }
- ResultViewModel result = ResultHelper.CreateResult(code, items, subCode, subMsg);
- return Ok(result);
- }
- [Route("purorddetails")]
- [HttpGet]
- public async Task<IActionResult> GetPurOrdDetails(string domain, string purord, string type)
- {
- 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 = "@PurOrd", Value = purord,SqlDbType=SqlDbType.VarChar},
- new SqlParameter { ParameterName = "@Type", Value = type,SqlDbType=SqlDbType.VarChar}
- };
- items = await _repository.GetListByProcAsync("pr_WMS_GetPurOrdDetails", parameters);
- }
- catch (Exception ex)
- {
- subMsg = ex.Message;
- code = ResultCode.Fail;
- subCode = ResultCode.Fail;
- }
- ResultViewModel result = ResultHelper.CreateResult(code, items, subCode, subMsg);
- return Ok(result);
- }
- [Route("purordnbrdetails")]
- [HttpGet]
- public async Task<IActionResult> GetPurOrdNbrDetails(string domain, string purord, string nbr)
- {
- 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 = "@PurOrd", Value = purord,SqlDbType=SqlDbType.VarChar},
- new SqlParameter { ParameterName = "@Nbr", Value = nbr,SqlDbType=SqlDbType.VarChar}
- };
- items = await _repository.GetListByProcAsync("pr_WMS_GetVMIPurOrdNbrDetails", parameters);
- }
- catch (Exception ex)
- {
- subMsg = ex.Message;
- code = ResultCode.Fail;
- subCode = ResultCode.Fail;
- }
- ResultViewModel result = ResultHelper.CreateResult(code, items, subCode, subMsg);
- return Ok(result);
- }
- }
- }
|