| | |
| | | using Model.ModelDto.BllAsnDto; |
| | | using System.Threading.Tasks; |
| | | using SqlSugar; |
| | | using System.Diagnostics; |
| | | using Model.ModelDto.SysDto; |
| | | using static System.Reflection.Metadata.BlobBuilder; |
| | | |
| | | namespace Wms.Controllers |
| | | { |
| | | [Route("api/[controller]/[action]")] |
| | | [ApiController] |
| | | [Authorize] |
| | | |
| | | public class BllAsnController : ControllerBase |
| | | { |
| | | #region 依赖注入 |
| | |
| | | private readonly IAuditLogServer _auditLog; // 审核记录 |
| | | private readonly IBllLabelBoxNoServer _labelBox; // 箱码标签 |
| | | private readonly IProcurePlanServer _procurePlanSvc; // 箱码标签 |
| | | private readonly IPalletUpShelfServer _palletUpShelfSvc; // 上架记录 |
| | | #endregion |
| | | |
| | | #region 构造函数 |
| | | public BllAsnController(IArrivalNoticeServer arrivalNoticeSvc, IPalletBindServer palletBindSvc,IBllBoxInfoServer bllBoxInfoSvc, ITaskServer taskSvc,IOperationASNServer logSvc, IPalletUnbindServer palletUnbind,IAuditLogServer auditLog,IBllLabelBoxNoServer labelBox, IProcurePlanServer procurePlanSvc) |
| | | public BllAsnController(IArrivalNoticeServer arrivalNoticeSvc, IPalletBindServer palletBindSvc, IBllBoxInfoServer bllBoxInfoSvc, ITaskServer taskSvc, IOperationASNServer logSvc, IPalletUnbindServer palletUnbind, IAuditLogServer auditLog, IBllLabelBoxNoServer labelBox, IProcurePlanServer procurePlanSvc, IPalletUpShelfServer palletUpShelfSvc) |
| | | { |
| | | _arrivalNoticeSvc = arrivalNoticeSvc; |
| | | _PalletBindSvc = palletBindSvc; |
| | |
| | | _auditLog = auditLog; |
| | | _labelBox = labelBox; |
| | | _procurePlanSvc = procurePlanSvc; |
| | | _palletUpShelfSvc = palletUpShelfSvc; |
| | | } |
| | | #endregion |
| | | |
| | |
| | | /// <param name="model">查询条件</param> |
| | | /// <returns>入库单信息</returns> |
| | | [HttpPost] |
| | | public IActionResult GetArrivalNoticeList(ArrivalNoticeVm model) |
| | | [ServiceFilter(typeof(ApiResponseActionFilter))] |
| | | public async Task<SqlSugarPagedList> GetArrivalNoticeList(ArrivalNoticeVm model) |
| | | { |
| | | try |
| | | { |
| | | var models = _arrivalNoticeSvc.GetArrivalNoticeList(model, out int count); |
| | | |
| | | return Ok(new { code = 0, count, msg = "入库单信息", data = models }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new { code = 1, msg = e.Message }); |
| | | } |
| | | } |
| | | RefAsync<int> count = new RefAsync<int>(); |
| | | var bolls = await _arrivalNoticeSvc.GetArrivalNoticeList(model, count); |
| | | return new SqlSugarPagedList() { Items = bolls, Total = count }; |
| | | } |
| | | |
| | | |
| | | [HttpPost] |
| | | public IActionResult GetArrivalNoticeDetailList(ArrivalNoticeDetailVm model) |
| | | [ServiceFilter(typeof(ApiResponseActionFilter))] |
| | | public async Task<SqlSugarPagedList> GetArrivalNoticeDetailList(ArrivalNoticeDetailVm model) |
| | | { |
| | | try |
| | | { |
| | | var models = _arrivalNoticeSvc.GetArrivalNoticeDetailList(model, out int count); |
| | | |
| | | return Ok(new { code = 0, count, msg = "入库单明细信息", data = models }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new { code = 1, msg = e.Message }); |
| | | } |
| | | RefAsync<int> count = new RefAsync<int>(); |
| | | var bolls = await _arrivalNoticeSvc.GetArrivalNoticeDetailList(model, count); |
| | | return new SqlSugarPagedList() { Items = bolls, Total = count }; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | throw new Exception("未获取到用户信息"); |
| | | } |
| | | if (string.IsNullOrWhiteSpace(model.ASNNo)) |
| | | { |
| | | throw new Exception("单据号不可为null!"); |
| | | } |
| | | |
| | | model.CreateUser = int.Parse(UserId); |
| | | string strMesage = _arrivalNoticeSvc.EditArrivalNotice(model); |
| | |
| | | } |
| | | if (strMesage.Contains("-1")) |
| | | { |
| | | return Ok(new { code = 0, msg = "部分成功 "+ strMesage }); |
| | | return Ok(new { code = 0, msg = "部分成功 " + strMesage }); |
| | | } |
| | | else |
| | | { |
| | |
| | | /// <param name="reason"></param> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | public IActionResult CancelOrder(int id,string reason) |
| | | public IActionResult CancelOrder(int id, string reason) |
| | | { |
| | | try |
| | | { |
| | |
| | | { |
| | | throw new Exception("未获取到用户信息"); |
| | | } |
| | | |
| | | _arrivalNoticeSvc.CancelOrder(id,reason,int.Parse(userId)); |
| | | |
| | | |
| | | _arrivalNoticeSvc.CancelOrder(id, reason, int.Parse(userId)); |
| | | |
| | | |
| | | return Ok(new { code = 0, msg = "入库单撤销申请成功" }); |
| | | |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | } |
| | | |
| | | [HttpGet] |
| | | public IActionResult GetBoxInfoByBoxNo(string boxNo, string boxNo3,int bindNo=0) |
| | | public IActionResult GetBoxInfoByBoxNo(string boxNo, string boxNo3, int bindNo = 0) |
| | | { |
| | | try |
| | | { |
| | | var models = _PalletBindSvc.GetBoxInfoByBoxNo(boxNo, boxNo3,bindNo); |
| | | var models = _PalletBindSvc.GetBoxInfoByBoxNo(boxNo, boxNo3, bindNo); |
| | | |
| | | return Ok(new { code = 0, count= models.Count, msg = "箱支明细信息", data = models }); |
| | | return Ok(new { code = 0, count = models.Count, msg = "箱支明细信息", data = models }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | { |
| | | throw new Exception("未获取到用户信息"); |
| | | } |
| | | _PalletBindSvc.DelBindBoxInfo(boxNo,int.Parse(userId)); |
| | | _PalletBindSvc.DelBindBoxInfo(boxNo, int.Parse(userId)); |
| | | |
| | | return Ok(new { code = 0, count = 0, msg = "删除成功", data = "" }); |
| | | } |
| | |
| | | { |
| | | throw new Exception("未获取到用户信息"); |
| | | } |
| | | _PalletBindSvc.CancelPalletBind(id, reason,int.Parse(userId)); |
| | | _PalletBindSvc.CancelPalletBind(id, reason, int.Parse(userId)); |
| | | |
| | | return Ok(new { code = 0, count = 0, msg = "托盘绑定撤销申请成功", data = "" }); |
| | | } |
| | |
| | | { |
| | | var list = _BoxInfoSvc.GetBoxInfoList(boxNo, isContinue, boxNo2); |
| | | var num = 0; |
| | | if (list!=null) |
| | | if (list != null) |
| | | { |
| | | num = list.Count; |
| | | } |
| | |
| | | { |
| | | try |
| | | { |
| | | var models = _PalletBindSvc.GetLocateList("W01",model.RoadwayNo,model.Row,model.Column,model.Layer,model.LocateNo,model.StockDetailId, model.Page,model.Limit, out int count); |
| | | var models = _PalletBindSvc.GetLocateList("W01", model.RoadwayNo, model.Row, model.Column, model.Layer, model.LocateNo, model.StockDetailId, model.Page, model.Limit, out int count); |
| | | |
| | | return Ok(new { code = 0, count, msg = "获取指定储位信息", data = models }); |
| | | } |
| | |
| | | { |
| | | throw new Exception("未获取到用户信息"); |
| | | } |
| | | _PalletBindSvc.SaveAppointSlot(model.BindId,model.LocateId,int.Parse(userId)); |
| | | _PalletBindSvc.SaveAppointSlot(model.BindId, model.LocateId, int.Parse(userId)); |
| | | |
| | | return Ok(new { code = 0, count = 0, msg = "指定储位成功", data = "" }); |
| | | } |
| | |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult GetArrivalTaskList(GetTaskVm model) |
| | | public async Task<IActionResult> GetArrivalTaskList(GetTaskVm model) |
| | | { |
| | | try |
| | | { |
| | | var type = new List<string>() { "0" }; |
| | | var bolls = _taskSvc.GetTaskList(type, model.Type, model.Status, model.TaskNo, model.IsSuccess, model.PalletNo, model.Msg, model.Page, model.Limit, out int count); |
| | | RefAsync<int> count = new RefAsync<int>(); |
| | | var bolls = await _taskSvc.GetTaskList(type, model.Type, model.Status, model.TaskNo, model.IsSuccess, model.PalletNo, model.Msg, model.Page, model.Limit, count); |
| | | |
| | | return Ok(new { code = 0, count, msg = "入库任务信息", data = bolls }); |
| | | return Ok(new { code = 0, count = count.Value, msg = "入库任务信息", data = bolls }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | { |
| | | return Ok(new { code = 1, msg = "未获取到当前操作人信息" }); |
| | | } |
| | | _auditLog.EditAudit(model.Id,model.Status,model.Opinion, int.Parse(userId)); |
| | | _auditLog.EditAudit(model.Id, model.Status, model.Opinion, int.Parse(userId)); |
| | | |
| | | return Ok(new { code = 0, count=0, msg = "审核记录列表", data = "" }); |
| | | return Ok(new { code = 0, count = 0, msg = "审核记录列表", data = "" }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | return Ok(new { code = 1, msg = "未获取到当前操作人信息" }); |
| | | } |
| | | var list = _BoxInfoSvc.AddLabelBox(model.Id, model.IsReset, decimal.Parse(model.ArriveQty), model.ProductionTime, model.ExpirationTime, model.StoreTime, model.SupplierLot, int.Parse(userId)); |
| | | return Ok(new { code = 0, msg = "生成箱码标签成功", data = list }); |
| | | return Ok(new { code = 0, msg = "生成箱码标签成功", data = list }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | { |
| | | return Ok(new { code = 1, msg = "未获取到当前操作人信息" }); |
| | | } |
| | | var list = _BoxInfoSvc.GetBuDaLabelList(model.BoxNo, model.EndBoxNo, model.BoxNo2, model.EndBoxNo2,model.Type,int.Parse(userId)); |
| | | var list = _BoxInfoSvc.GetBuDaLabelList(model.BoxNo, model.EndBoxNo, model.BoxNo2, model.EndBoxNo2, model.Type, int.Parse(userId)); |
| | | return Ok(new { code = 0, msg = "获取补打箱码标签信息", data = list }); |
| | | } |
| | | catch (Exception e) |
| | |
| | | { |
| | | return Ok(new { code = 1, msg = "未获取到当前操作人信息" }); |
| | | } |
| | | _BoxInfoSvc.DelLabelByAsnNo(model.AsnNo,model.LotNo,int.Parse(userId)); |
| | | _BoxInfoSvc.DelLabelByAsnNo(model.AsnNo, model.LotNo, int.Parse(userId)); |
| | | return Ok(new { code = 0, msg = "删除成功", data = "" }); |
| | | } |
| | | catch (Exception e) |
| | |
| | | { |
| | | try |
| | | { |
| | | var type = new List<string>() { "0","1","2" }; |
| | | var type = new List<string>() { "0", "1", "2" }; |
| | | var bolls = _taskSvc.GetArchivingTaskList(type, model.Type, model.Status, model.TaskNo, model.IsSuccess, model.PalletNo, model.Msg, model.Page, model.Limit, out int count); |
| | | |
| | | return Ok(new { code = 0, count, msg = "任务信息", data = bolls }); |
| | |
| | | { |
| | | try |
| | | { |
| | | var bolls = _logSvc.GetArchivingLogOperationList(model.ComeFrom,model.MenuName, model.Type, model.Msg, model.StartTime, model.EndTime, model.Page, model.Limit, out int count); |
| | | var bolls = _logSvc.GetArchivingLogOperationList(model.ComeFrom, model.MenuName, model.Type, model.Msg, model.StartTime, model.EndTime, model.Page, model.Limit, out int count); |
| | | |
| | | return Ok(new { code = 0, count, msg = "入库操作日志信息", data = bolls }); |
| | | } |
| | |
| | | /// <returns>采购单信息</returns> |
| | | [HttpPost] |
| | | [ServiceFilter(typeof(ApiResponseActionFilter))] |
| | | public async Task<SqlSugarPagedList<ProcurePlanNoticeDto>> GetProcurePlanNoticeList(ProcurePlanNoticeVm model) |
| | | public async Task<SqlSugarPagedList> GetProcurePlanNoticeList(ProcurePlanNoticeVm model) |
| | | { |
| | | RefAsync<int> count = new RefAsync<int>(); |
| | | var bolls = await _procurePlanSvc.GetProcurePlanNoticeList(model, count); |
| | | return new SqlSugarPagedList<ProcurePlanNoticeDto>() { Items = bolls, Total = count }; |
| | | return new SqlSugarPagedList() { Items = bolls, Total = count }; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取采购单明细信息 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult GetProcurePlanNoticeDetailList(ProcurePlanNoticeDetailVm model) |
| | | [ServiceFilter(typeof(ApiResponseActionFilter))] |
| | | public async Task<SqlSugarPagedList> GetProcurePlanNoticeDetailList(ProcurePlanNoticeDetailVm model) |
| | | { |
| | | try |
| | | { |
| | | var models = _procurePlanSvc.GetProcurePlanNoticeDetailList(model, out int count); |
| | | Stopwatch stopwatch = new Stopwatch(); |
| | | stopwatch.Start(); |
| | | RefAsync<int> count = new RefAsync<int>(); |
| | | var bolls = await _procurePlanSvc.GetProcurePlanNoticeDetailList(model, count); |
| | | stopwatch.Stop(); |
| | | |
| | | return Ok(new { code = 0, count, msg = "入库单明细信息", data = models }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new { code = 1, msg = e.Message }); |
| | | } |
| | | var time = stopwatch.ElapsedMilliseconds; |
| | | return new SqlSugarPagedList() { Items = bolls, Total = count }; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 通过采购单生成入库单据 |
| | | /// </summary> |
| | |
| | | { |
| | | throw new Exception("未获取到用户信息"); |
| | | } |
| | | |
| | | |
| | | _procurePlanSvc.CreateAsnByProcurePlan(Convert.ToInt32(model.Id), int.Parse(UserId)); |
| | | |
| | | return Ok(new { code = 0, msg = "添加成功" }); |
| | |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 上架任务记录 |
| | | |
| | | /// <summary> |
| | | /// 获取上架任务记录信息分页集合 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [ServiceFilter(typeof(ApiResponseActionFilter))] |
| | | public async Task<SqlSugarPagedList> GetPalletUpShelfList(PalletUpShelfVm model) |
| | | { |
| | | RefAsync<int> count = new RefAsync<int>(); |
| | | var data = await _palletUpShelfSvc.GetPalletUpShelfList(model.TraceNo, model.TaskNo,model.PalletNo,model.SkuNo,model.SkuName,model.LotNo,model.Status,model.Page,model.Limit, count); |
| | | return new SqlSugarPagedList() { Items = data, Total = count }; |
| | | } |
| | | #endregion |
| | | } |
| | | |
| | | } |