BarCodeController.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using Microsoft.AspNetCore.Mvc;
  2. using Newtonsoft.Json;
  3. using WMS.BZModels.Dto.PT.BarcodeDtos;
  4. using WMS.BZServices.PT;
  5. using WMS.Info;
  6. namespace WMS.BZWeb.Areas.PTManager.Controllers
  7. {
  8. [Area("PTManager")]
  9. public class BarCodeController : MvcControllerBase
  10. {
  11. private readonly barCodeInfoService _barCodeInfoService;
  12. public BarCodeController(barCodeInfoService barCodeInfoService)
  13. {
  14. _barCodeInfoService = barCodeInfoService;
  15. }
  16. public IActionResult Index()
  17. {
  18. return View();
  19. }
  20. public ActionResult GetPageList(string pagination, string queryJson)
  21. {
  22. Pagination paginationobj = InitPagination(pagination);
  23. var query = new BarcodeQueryDto();
  24. if (!string.IsNullOrEmpty(queryJson))
  25. {
  26. query = JsonConvert.DeserializeObject<BarcodeQueryDto>(queryJson);
  27. }
  28. var lists = _barCodeInfoService.GetPageList(paginationobj, query ?? new BarcodeQueryDto());
  29. var jsonData = new
  30. {
  31. rows = lists.Result,
  32. total = lists.TotalPage,
  33. page = lists.PageIndex,
  34. records = lists.TotalNum
  35. };
  36. return Success(jsonData);
  37. }
  38. }
  39. }