12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- using Microsoft.AspNetCore.Mvc;
- using Newtonsoft.Json;
- using wms.sqlsugar.model.pt;
- using WMS.BZModels.Dto.PT.RfidDtos;
- using WMS.BZServices.PT;
- using WMS.Info;
- namespace WMS.BZWeb.Areas.PTManager.Controllers
- {
- [Area("PTManager")]
- public class RfidController : MvcControllerBase
- {
- private readonly RfidService _rfidinfo;
- public RfidController(RfidService rfidinfo)
- {
- _rfidinfo = rfidinfo;
- }
- public IActionResult Index()
- {
- return View();
- }
- public ActionResult Form()
- {
- return View();
- }
- public ActionResult GetPageList(string pagination, string queryJson)
- {
- Pagination paginationobj = InitPagination(pagination);
- var query = new RfidQueryDto();
- if (!string.IsNullOrEmpty(queryJson))
- {
- query = JsonConvert.DeserializeObject<RfidQueryDto>(queryJson);
- }
- var lists = _rfidinfo.GetPageList(paginationobj, query ?? new RfidQueryDto());
- var jsonData = new
- {
- rows = lists.Result,
- total = lists.TotalPage,
- page = lists.PageIndex,
- records = lists.TotalNum
- };
- return Success(jsonData);
- }
- [HttpPost]
- public ActionResult SaveForm(string keyValue, BaseContinfo Data)
- {
- LoginUserInfo LoginUser = GetLoginUser();
- _rfidinfo.Save(LoginUser, keyValue, Data);
- return Success("保存成功。");
- }
- [HttpPost]
- public ActionResult Delete(string keyValue)
- {
- _rfidinfo.Delete(keyValue);
- return Success("删除成功。");
- }
- }
- }
|