BoxItemsController.cs 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. using Microsoft.AspNetCore.Mvc;
  2. using Newtonsoft.Json;
  3. using WMS.BZModels.Dto.CP.BoxitemsDtos;
  4. using WMS.BZServices.CP;
  5. using WMS.Info;
  6. namespace WMS.BZWeb.Areas.CPManager.Controllers
  7. {
  8. [Area("CPManager")]
  9. public class BoxItemsController : MvcControllerBase
  10. {
  11. private readonly BoxitemsInfoService _boxitemsService;
  12. private readonly BillBoxitemsHistoryService _billBoxitemsHistoryService;
  13. public BoxItemsController(BoxitemsInfoService boxitemsService, BillBoxitemsHistoryService billBoxitemsHistoryService)
  14. {
  15. _boxitemsService = boxitemsService;
  16. _billBoxitemsHistoryService = billBoxitemsHistoryService;
  17. }
  18. public IActionResult Index()
  19. {
  20. return View();
  21. }
  22. public IActionResult HistoryIndex()
  23. {
  24. return View();
  25. }
  26. public ActionResult GetPageList(string pagination, string queryJson)
  27. {
  28. Pagination paginationobj = InitPagination(pagination);
  29. var query = new BoxitemsQueryDto();
  30. if (!string.IsNullOrEmpty(queryJson))
  31. {
  32. query = JsonConvert.DeserializeObject<BoxitemsQueryDto>(queryJson);
  33. }
  34. var lists = _boxitemsService.GetPageList(paginationobj, query ?? new BoxitemsQueryDto());
  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 GetHistoryPageList(string pagination, string queryJson)
  45. {
  46. Pagination paginationobj = InitPagination(pagination);
  47. var query = new BillBoxitemsHistoryQueryDto();
  48. if (!string.IsNullOrEmpty(queryJson))
  49. {
  50. query = JsonConvert.DeserializeObject<BillBoxitemsHistoryQueryDto>(queryJson);
  51. }
  52. var lists = _billBoxitemsHistoryService.GetPageList(paginationobj, query ?? new BillBoxitemsHistoryQueryDto());
  53. var jsonData = new
  54. {
  55. rows = lists.Result,
  56. total = lists.TotalPage,
  57. page = lists.PageIndex,
  58. records = lists.TotalNum
  59. };
  60. return Success(jsonData);
  61. }
  62. }
  63. }