1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- using Microsoft.AspNetCore.Mvc;
- using Newtonsoft.Json;
- using WMS.BZModels.Dto.CP.BoxitemsDtos;
- using WMS.BZServices.CP;
- using WMS.Info;
- namespace WMS.BZWeb.Areas.CPManager.Controllers
- {
- [Area("CPManager")]
- public class BoxItemsController : MvcControllerBase
- {
- private readonly BoxitemsInfoService _boxitemsService;
- private readonly BillBoxitemsHistoryService _billBoxitemsHistoryService;
- public BoxItemsController(BoxitemsInfoService boxitemsService, BillBoxitemsHistoryService billBoxitemsHistoryService)
- {
- _boxitemsService = boxitemsService;
- _billBoxitemsHistoryService = billBoxitemsHistoryService;
- }
- public IActionResult Index()
- {
- return View();
- }
- public IActionResult HistoryIndex()
- {
- return View();
- }
-
- public ActionResult GetPageList(string pagination, string queryJson)
- {
- Pagination paginationobj = InitPagination(pagination);
- var query = new BoxitemsQueryDto();
- if (!string.IsNullOrEmpty(queryJson))
- {
- query = JsonConvert.DeserializeObject<BoxitemsQueryDto>(queryJson);
- }
- var lists = _boxitemsService.GetPageList(paginationobj, query ?? new BoxitemsQueryDto());
- var jsonData = new
- {
- rows = lists.Result,
- total = lists.TotalPage,
- page = lists.PageIndex,
- records = lists.TotalNum
- };
- return Success(jsonData);
- }
- public ActionResult GetHistoryPageList(string pagination, string queryJson)
- {
- Pagination paginationobj = InitPagination(pagination);
- var query = new BillBoxitemsHistoryQueryDto();
- if (!string.IsNullOrEmpty(queryJson))
- {
- query = JsonConvert.DeserializeObject<BillBoxitemsHistoryQueryDto>(queryJson);
- }
- var lists = _billBoxitemsHistoryService.GetPageList(paginationobj, query ?? new BillBoxitemsHistoryQueryDto());
- var jsonData = new
- {
- rows = lists.Result,
- total = lists.TotalPage,
- page = lists.PageIndex,
- records = lists.TotalNum
- };
- return Success(jsonData);
- }
- }
- }
|