123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- using Microsoft.AspNetCore.Mvc;
- using Newtonsoft.Json;
- using WMS.BZModels.Dto.KLHC.WCSCachelineDtos;
- using WMS.BZServices.KLHC;
- using WMS.Info;
- namespace WMS.BZWeb.Areas.KLHCManager.Controllers
- {
- [Area("KLHCManager")]
- 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<WCSCachelineQueryDto>(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<List<int>>(ids);
- _WCSCachelineService.Delete(lists);
- return Success("删除成功。");
- }
- }
- }
|