RfidController.cs 1.7 KB

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