| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- 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;
- namespace Procurement.Controllers
- {
- [Produces("application/json")]
- [Route("api/wms/[controller]")]
- public class PackageAppendController : AbpController
- {
- private readonly ISqlRepository _repository;
- public PackageAppendController(ISqlRepository sqlRepository)
- {
- _repository = sqlRepository;
- }
- /// <summary>
- /// ±£´æ
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public async Task<IActionResult> Post([FromBody] JsonElement jsonElement)
- {
- if (jsonElement.ValueKind == JsonValueKind.Undefined || jsonElement.ValueKind == JsonValueKind.Null)
- {
- return BadRequest();
- }
- ResultCode code = ResultCode.Success, subCode = ResultCode.Success;
- string subMsg = "";
- dynamic items = null;
- try
- {
- string proc = "pr_WMS_SavePackageAppend";
- SqlParameter[] sqlParams = SqlHelper.CreateSqlParameters(jsonElement);
- items = await _repository.GetListByProcAsync(proc, sqlParams);
- //´òÓ¡
- BarCodeHelper helper = new BarCodeHelper();
- helper.getPrintItems(items, sqlParams, _repository);
- }
- catch (Exception ex)
- {
- subMsg = ex.Message;
- code = ResultCode.Fail;
- subCode = ResultCode.Fail;
- }
- ResultViewModel result = ResultHelper.CreateResult(code, items, subCode, subMsg);
- return Ok(result);
- }
- }
- }
|