1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- using Microsoft.AspNetCore.Mvc;
- using Newtonsoft.Json;
- using WMS.BZModels.Dto.FJ.BillBom;
- using WMS.BZServices.FJ;
- using WMS.Info;
- namespace WMS.BZWeb.Areas.FJManager.Controllers
- {
- [Area("FJManager")]
- public class BillBomInfoController : MvcControllerBase
- {
- private readonly BillBomInfoService _billBomInfoService;
- public BillBomInfoController(BillBomInfoService billBomInfoService)
- {
- _billBomInfoService = billBomInfoService;
- }
- #region 视图功能
- public IActionResult Index()
- {
- return View();
- }
- public IActionResult Form()
- {
- return View();
- }
- public IActionResult SelectForm()
- {
- return View();
- }
- #endregion
-
- public ActionResult GetPageList(string pagination, string queryJson)
- {
- Pagination paginationobj = InitPagination(pagination);
- var query = new BillBominfoQueryDto();
- if (!string.IsNullOrEmpty(queryJson))
- {
- query = JsonConvert.DeserializeObject<BillBominfoQueryDto>(queryJson);
- }
- var lists = _billBomInfoService.GetPageList(paginationobj, query ?? new BillBominfoQueryDto());
- var jsonData = new
- {
- rows = lists.Result,
- total = lists.TotalPage,
- page = lists.PageIndex,
- records = lists.TotalNum
- };
- return Success(jsonData);
- }
- public ActionResult GetList(string queryJson)
- {
- var query = new BillBominfoQueryDto();
- if (!string.IsNullOrEmpty(queryJson))
- {
- query = JsonConvert.DeserializeObject<BillBominfoQueryDto>(queryJson);
- }
- var lists = _billBomInfoService.GetList(query ?? new BillBominfoQueryDto());
- if (lists != null && lists.Any())
- {
- var listresult= lists.Where(o => o.Code == query?.Code).ToList();
- return Success(listresult);
- }
- return Success(lists);
- }
- }
- }
|