1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- using Microsoft.AspNetCore.Mvc;
- using Newtonsoft.Json;
- using wms.sqlsugar.model.pt;
- using WMS.BZModels;
- using WMS.BZModels.Dto.PT.WareCellDtos;
- using WMS.BZModels.Dto.PT.TaskDtos;
- using WMS.BZUtil;
- using WMS.Core;
- using WMS.Info;
- using WMS.Util;
- using WMS.BZServices.PT;
- namespace WMS.BZWeb.Areas.PTManager.Controllers
- {
- [Area("PTManager")]
- public class BaseWareCellController : MvcControllerBase
- {
- private readonly WareCellService _wareCellService;
- public BaseWareCellController(WareCellService wareCellService)
- {
- _wareCellService = wareCellService;
- }
- public IActionResult Index()
- {
- return View();
- }
- public ActionResult Form()
- {
- return View();
- }
- public ActionResult GetPageList(string pagination, string queryJson)
- {
- Pagination paginationobj = InitPagination(pagination);
- var query = new WarecellListQueryDto();
- if (!string.IsNullOrEmpty(queryJson))
- {
- query = JsonConvert.DeserializeObject<WarecellListQueryDto>(queryJson);
- }
- var lists = _wareCellService.GetPageList(paginationobj, query ?? new WarecellListQueryDto());
- var jsonData = new
- {
- rows = lists.Result,
- total = lists.TotalPage,
- page = lists.PageIndex,
- records = lists.TotalNum
- };
- return Success(jsonData);
- }
- [HttpPost]
- public ActionResult EnableWareCells(string ids)
- {
- if (string.IsNullOrEmpty(ids))
- {
- return Fail("没有选择货位!");
- }
- var lists = JsonConvert.DeserializeObject<List<string>>(ids);
- var userid = WebUtil.GetItem("userId");
- _wareCellService.ChangeWareCells(lists, LocationStop.LocationInvoke, userid?.ToString());
- return Success("保存成功!");
- }
- [HttpPost]
- public ActionResult DisableWareCells(string ids)
- {
- if (string.IsNullOrEmpty(ids))
- {
- return Fail("没有选择货位!");
- }
- var lists = JsonConvert.DeserializeObject<List<string>>(ids);
- var userid = WebUtil.GetItem("userId");
- _wareCellService.ChangeWareCells(lists, LocationStop.LocationStopped, userid?.ToString());
- return Success("保存成功!");
- }
- [HttpPost]
- public ActionResult SaveForm(string keyValue, BaseWarecell Data)
- {
- LoginUserInfo LoginUser = GetLoginUser();
- _wareCellService.Save(LoginUser, keyValue, Data);
- return Success("保存成功。");
- }
- [HttpPost]
- public ActionResult Delete(string keyValue)
- {
- _wareCellService.Delete(keyValue);
- return Success("删除成功。");
- }
- }
- }
|