WeighingResultController.cs 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. using Microsoft.AspNetCore.Mvc;
  2. using Newtonsoft.Json;
  3. using WMS.BZModels;
  4. using WMS.BZModels.Dto.CP.WeighingResult;
  5. using WMS.BZServices.CP;
  6. using WMS.Info;
  7. using WMS.Util;
  8. namespace WMS.BZWeb.Areas.CPManager.Controllers
  9. {
  10. [Area("CPManager")]
  11. public class WeighingResultController : MvcControllerBase
  12. {
  13. private readonly WeighingResultService _syscon;
  14. public WeighingResultController(WeighingResultService syscon)
  15. {
  16. _syscon = syscon;
  17. }
  18. public IActionResult Index()
  19. {
  20. return View();
  21. }
  22. public IActionResult TunnelIndex()
  23. {
  24. //ViewBag.HJWCSWebAPIUrl = ConfigHelper.GetConfig().HJWCSWebAPIUrl;
  25. return View();
  26. }
  27. public IActionResult OutInPationIndex()
  28. {
  29. return View();
  30. }
  31. public ActionResult Form()
  32. {
  33. return View();
  34. }
  35. public IActionResult StartIndex()
  36. {
  37. return View();
  38. }
  39. public IActionResult StopIndex()
  40. {
  41. return View();
  42. }
  43. public IActionResult BoxBingIndex()
  44. {
  45. ViewBag.CPWMSWebAPIUrl = ConfigHelper.GetConfig().CPWMSWebAPIUrl;
  46. return View();
  47. }
  48. public ActionResult GetPageList(string pagination, string queryJson)
  49. {
  50. Pagination paginationobj = InitPagination(pagination);
  51. var query = new WeighingResultQueryDto();
  52. if (!string.IsNullOrEmpty(queryJson))
  53. {
  54. query = JsonConvert.DeserializeObject<WeighingResultQueryDto>(queryJson);
  55. }
  56. var lists = _syscon.GetPageList(paginationobj, query ?? new WeighingResultQueryDto());
  57. var jsonData = new
  58. {
  59. rows = lists.Result,
  60. total = lists.TotalPage,
  61. page = lists.PageIndex,
  62. records = lists.TotalNum
  63. };
  64. return Success(jsonData);
  65. }
  66. public ActionResult GetIsOutOfTolerance(string pagination, string queryJson)
  67. {
  68. var jsonData = new List<EnumEntity>()
  69. {
  70. new EnumEntity(){ id=1,text="超限" },
  71. new EnumEntity(){ id=2,text="未超限" }
  72. };
  73. return Success(jsonData);
  74. }
  75. }
  76. }