1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- using Microsoft.AspNetCore.Mvc;
- using Newtonsoft.Json;
- using wms.sqlsugar.model.fj;
- using WMS.BZModels.Dto.FJ.BillMachInfoDtos;
- using WMS.BZServices.FJ;
- using WMS.Info;
- namespace WMS.BZWeb.Areas.FJManager.Controllers
- {
- [Area("FJManager")]
- public class BillMachInfoController : MvcControllerBase
- {
- private readonly BillMachinfoService _machinfoService;
- public BillMachInfoController(BillMachinfoService machinfoService)
- {
- _machinfoService = machinfoService;
- }
- #region 页面
- public IActionResult Index()
- {
- return View();
- }
- public ActionResult Form()
- {
- return View();
- }
- public ActionResult WareDirectForm()
- {
- return View();
- }
- #endregion
- public ActionResult GetPageList(string pagination, string queryJson)
- {
- Pagination paginationobj = InitPagination(pagination);
- var query = new BillMachinfoQueryDto();
- if (!string.IsNullOrEmpty(queryJson))
- {
- query = JsonConvert.DeserializeObject<BillMachinfoQueryDto>(queryJson);
- }
- var lists = _machinfoService.GetPageList(paginationobj, query ?? new BillMachinfoQueryDto());
- var jsonData = new
- {
- rows = lists.Result,
- total = lists.TotalPage,
- page = lists.PageIndex,
- records = lists.TotalNum
- };
- return Success(jsonData);
- }
- [HttpPost]
- public ActionResult SaveForm(string keyValue, BillMachinfo Data)
- {
- LoginUserInfo LoginUser = GetLoginUser();
- _machinfoService.Save(LoginUser, keyValue, Data);
- return Success("保存成功。");
- }
- [HttpPost]
- public ActionResult Delete(string keyValue)
- {
- if (string.IsNullOrWhiteSpace(keyValue))
- {
- return Fail("机台Id不能为空!");
- }
- if (!long.TryParse(keyValue, out var id))
- {
- return Fail("机台Id错误!");
- }
- _machinfoService.Delete(id);
- return Success("删除成功。");
- }
- [HttpPost]
- public ActionResult SaveWareDirect(SaveWareDirectDto Data)
- {
- LoginUserInfo LoginUser = GetLoginUser();
- _machinfoService.SaveWareDirect(LoginUser,Data);
- return Success("保存成功。");
- }
- }
- }
|