PalletizingController.cs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. using Microsoft.AspNetCore.Mvc;
  2. using Newtonsoft.Json;
  3. using WMS.BZModels.Dto.SX.PalletizingDtos;
  4. using WMS.BZServices.SX;
  5. using WMS.Info;
  6. using WMS.Util;
  7. namespace WMS.BZWeb.Areas.SXManager.Controllers
  8. {
  9. [Area("SXManager")]
  10. public class PalletizingController : MvcControllerBase
  11. {
  12. private readonly PalletizingService _PalletizingService;
  13. private readonly PalletizingdetailService _PalletizingdetailServiceService;
  14. public PalletizingController(PalletizingService palletizingService, PalletizingdetailService palletizingdetailServiceService)
  15. {
  16. _PalletizingService = palletizingService;
  17. _PalletizingdetailServiceService = palletizingdetailServiceService;
  18. }
  19. #region 视图功能
  20. public IActionResult Index()
  21. {
  22. ViewBag.SXWMSWebAPIUrl = ConfigHelper.GetConfig().SXWMSWebAPIUrl;
  23. return View();
  24. }
  25. #endregion
  26. public ActionResult GetPageList(string pagination, string queryJson)
  27. {
  28. Pagination paginationobj = InitPagination(pagination);
  29. var query = new PalletizingQueryDto();
  30. if (!string.IsNullOrEmpty(queryJson))
  31. {
  32. query = JsonConvert.DeserializeObject<PalletizingQueryDto>(queryJson);
  33. }
  34. var lists = _PalletizingService.GetPageList(paginationobj, query ?? new PalletizingQueryDto());
  35. var jsonData = new
  36. {
  37. rows = lists.Result,
  38. total = lists.TotalPage,
  39. page = lists.PageIndex,
  40. records = lists.TotalNum
  41. };
  42. return Success(jsonData);
  43. }
  44. public ActionResult GetPalletizingItem(string Palletizingid)
  45. {
  46. if (string.IsNullOrEmpty(Palletizingid))
  47. {
  48. return Fail("码垛Id不能为空");
  49. }
  50. var list = _PalletizingdetailServiceService.GetDtlById(Convert.ToInt64(Palletizingid));
  51. return Success(list);
  52. }
  53. }
  54. }