using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using System; using WalkingTec.Mvvm.Core; using WalkingTec.Mvvm.Mvc; using WalkingTec.Mvvm.Core.Extensions; using HHWMS.Web; using HHWMS.Web.Models; using Microsoft.EntityFrameworkCore; using System.Linq; using Newtonsoft.Json; using System.Collections.Generic; namespace HHWMS.Web.Controllers { [Area("receipt")] [ActionDescription("盘料操作")] public partial class ReceiptInController : BaseController { private readonly IUnitWork _unitwork; public ReceiptInController(IUnitWork unitwork) { _unitwork = unitwork; } #region Search [ActionDescription("Sys.Search")] public ActionResult Index() { return PartialView("Index"); } [HttpPost] public ActionResult SelectReceiptCode() { var data = _unitwork.Find(x => x.FirstStatus < ReceiptStatusEnum.回传) .Select(x => new { label = x.Code, value = x.Code }); return JsonMore(data); } [HttpPost] public ActionResult SelectReceipt(string Code) { var data = _unitwork.Find(x => x.Code == Code).Include(x => x.ReceiptDetails).FirstOrDefault(); if(data != null) { var result = data.ReceiptDetails.Select(x => new { name = x.MaterialCode }); return JsonMore(result); } else { return JsonMore(null); } } /// /// 入库盘料绑定操作 /// /// /// [HttpPost] public dynamic BindingData(List data) { // 查找明细,修改对应状态,并且 绑定物料周转箱 return new ApiJsonResult { Success = true }; } #endregion } public class Binding { public string UniqueCode { get; set; } public string BoxCode { get; set; } public int Index { get; set; } public int Size { get; set; } } }