using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json; using WMS.BZModels.Dto.FJ.WCSCachelineDtos; using WMS.BZServices.FJ; using WMS.Info; namespace WMS.BZWeb.Areas.FJManager.Controllers { [Area("FJManager")] public class WCSCachelineController : MvcControllerBase { private readonly WCSCachelineService _WCSCachelineService; private readonly WCSCachelinelocService _WCSCachelinelocService; public WCSCachelineController(WCSCachelineService wCSCachelineService, WCSCachelinelocService wCSCachelinelocService) { _WCSCachelineService = wCSCachelineService; _WCSCachelinelocService = wCSCachelinelocService; } #region 视图功能 public IActionResult Index() { return View(); } #endregion public ActionResult GetPageList(string pagination, string queryJson) { Pagination paginationobj = InitPagination(pagination); var query = new WCSCachelineQueryDto(); if (!string.IsNullOrEmpty(queryJson)) { query = JsonConvert.DeserializeObject(queryJson); } var lists = _WCSCachelineService.GetPageList(paginationobj, query ?? new WCSCachelineQueryDto()); var jsonData = new { rows = lists.Result, total = lists.TotalPage, page = lists.PageIndex, records = lists.TotalNum }; return Success(jsonData); } public ActionResult GetCachelineItem(string cachelineId) { if (string.IsNullOrEmpty(cachelineId)) { return Fail("缓存id不能为空"); } var list = _WCSCachelinelocService.GetDtlById(Convert.ToInt32(cachelineId)); return Success(list); } [HttpPost] public ActionResult Delete(string ids) { if (string.IsNullOrEmpty(ids)) { return Fail("没有选择数据!"); } var lists = JsonConvert.DeserializeObject>(ids); _WCSCachelineService.Delete(lists); return Success("删除成功。"); } [HttpPost] public ActionResult UpdateOvertime(string ids) { if (string.IsNullOrEmpty(ids)) { return Fail("没有选择数据!"); } var lists = JsonConvert.DeserializeObject>(ids); _WCSCachelineService.UpdateOvertime(lists); return Success("更新成功。"); } } }