102 lines
2.9 KiB
C#
102 lines
2.9 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
|
using WalkingTec.Mvvm.Core;
|
|
using WalkingTec.Mvvm.Mvc;
|
|
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 Index
|
|
|
|
[ActionDescription("Sys.Search")]
|
|
public ActionResult Index()
|
|
{
|
|
return PartialView("Index");
|
|
}
|
|
|
|
#endregion Index
|
|
|
|
#region API Methods
|
|
|
|
[HttpPost]
|
|
public IActionResult GetOperators()
|
|
{
|
|
// TODO: 从数据库获取操作员列表
|
|
var operators = new List<object>
|
|
{
|
|
new { value = "1", label = "张三" },
|
|
new { value = "2", label = "李四" }
|
|
};
|
|
return Json(new { Code = 200, Data = operators });
|
|
}
|
|
|
|
[HttpPost]
|
|
public IActionResult GetProcesses()
|
|
{
|
|
// TODO: 从数据库获取工序列表
|
|
var processes = new List<object>
|
|
{
|
|
new { value = "1", label = "工序1" },
|
|
new { value = "2", label = "工序2" }
|
|
};
|
|
return Json(new { Code = 200, Data = processes });
|
|
}
|
|
|
|
[HttpPost]
|
|
public IActionResult GetOperatorInfo()
|
|
{
|
|
// TODO: 获取当前登录用户信息
|
|
return Json(new { Code = 200, Data = "当前操作员:张三" });
|
|
}
|
|
|
|
[HttpPost]
|
|
public IActionResult GetOrdersByMaterial(string materialCode)
|
|
{
|
|
// TODO: 根据物料码查询相关生产订单
|
|
var orders = new List<object>
|
|
{
|
|
new { value = "1", label = "生产订单1" },
|
|
new { value = "2", label = "生产订单2" }
|
|
};
|
|
return Json(new { Code = 200, Data = orders });
|
|
}
|
|
|
|
[HttpPost]
|
|
public IActionResult SubmitReceipt([FromBody] ReceiptInModel model)
|
|
{
|
|
try
|
|
{
|
|
// TODO: 实现入库逻辑
|
|
return Json(new { Code = 200, Msg = "入库成功" });
|
|
}
|
|
catch (System.Exception ex)
|
|
{
|
|
return Json(new { Code = 500, Msg = ex.Message });
|
|
}
|
|
}
|
|
|
|
#endregion API Methods
|
|
}
|
|
|
|
public class ReceiptInModel
|
|
{
|
|
public string PalletCode { get; set; }
|
|
public string MaterialCode { get; set; }
|
|
public string OrderId { get; set; }
|
|
public string OperatorId { get; set; }
|
|
public string ProcessId { get; set; }
|
|
public int Quantity { get; set; }
|
|
public bool IsQualified { get; set; }
|
|
public string OperatorInfo { get; set; }
|
|
}
|
|
} |