| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- 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 Procurement.Services;
- using System.Data.SqlClient;
- using System.Data;
- namespace Procurement.Controllers
- {
- [Produces("application/json")]
- [Route("api/wms/[controller]")]
- public class WorkOrdMasterController : AbpController
- {
- private readonly ISqlRepository _repository;
- public WorkOrdMasterController(ISqlRepository sqlRepository)
- {
- _repository = sqlRepository;
- }
- [Route("getorder")]
- [HttpGet]
- public async Task<IActionResult> GetWorkOrd(string domain)
- {
- ResultCode code = ResultCode.Success, subCode = ResultCode.Success;
- string subMsg = "";
- dynamic items = null;
- try
- {
- Common common = new Common(_repository);
- items = await common.GetCommonItems(domain, "workordselectlist");
- }
- catch (Exception ex)
- {
- subMsg = ex.Message;
- code = ResultCode.Fail;
- subCode = ResultCode.Fail;
- }
- ResultViewModel result = ResultHelper.CreateResult(code, items, subCode, subMsg);
- return Ok(result);
- }
- [Route("search")]
- [HttpGet]
- public async Task<IActionResult> Get(string domain, string order = "", 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 = "@WorkOrd", Value = order,SqlDbType=SqlDbType.VarChar},
- new SqlParameter { ParameterName = "@Page", Value = page,SqlDbType=SqlDbType.Int},
- };
- items = await _repository.GetListByProcAsync("pr_WMS_GetLabelQueryWorkOrdList", parameters);
- }
- catch (Exception ex)
- {
- subMsg = ex.Message;
- code = ResultCode.Fail;
- subCode = ResultCode.Fail;
- }
- ResultViewModel result = ResultHelper.CreateResult(code, items, subCode, subMsg);
- return Ok(result);
- }
- }
- }
|