123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- 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);
- }
- }
- }
|