MesInfoController.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. using Microsoft.AspNetCore.Mvc;
  2. using Newtonsoft.Json;
  3. using wms.sqlsugar.model.pt;
  4. using WMS.BZModels.Dto.PT.BaseMatinfoDtos;
  5. using WMS.BZServices.PT;
  6. using WMS.Info;
  7. namespace WMS.BZWeb.Areas.PTManager.Controllers
  8. {
  9. [Area("PTManager")]
  10. public class MesInfoController : MvcControllerBase
  11. {
  12. private readonly BillmesinfoService _billmesinfoService ;
  13. public MesInfoController(BillmesinfoService billmesinfoService)
  14. {
  15. _billmesinfoService = billmesinfoService;
  16. }
  17. #region 视图功能
  18. public IActionResult Index()
  19. {
  20. return View();
  21. }
  22. public IActionResult Form()
  23. {
  24. return View();
  25. }
  26. #endregion
  27. public ActionResult GetPageList(string pagination, string queryJson)
  28. {
  29. Pagination paginationobj = InitPagination(pagination);
  30. var query = new MesInfoQueryDto();
  31. if (!string.IsNullOrEmpty(queryJson))
  32. {
  33. query = JsonConvert.DeserializeObject<MesInfoQueryDto>(queryJson);
  34. }
  35. var lists = _billmesinfoService.GetMesInfoList(paginationobj, query ?? new MesInfoQueryDto());
  36. var jsonData = new
  37. {
  38. rows = lists.Result,
  39. total = lists.TotalPage,
  40. page = lists.PageIndex,
  41. records = lists.TotalNum
  42. };
  43. return Success(jsonData);
  44. }
  45. [HttpPost]
  46. public ActionResult SaveForm(string keyValue, BillMesmiddle Data)
  47. {
  48. LoginUserInfo LoginUser = GetLoginUser();
  49. _billmesinfoService.Save(LoginUser, keyValue, Data);
  50. return Success("保存成功。");
  51. }
  52. }
  53. }