载具绑定物料接口

This commit is contained in:
2024-05-30 11:19:11 +08:00
parent 745599875d
commit 260dd5d195
6 changed files with 74 additions and 2 deletions

View File

@@ -14,13 +14,16 @@ using JNPF.VisualDev.Interfaces;
using Mapster;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using SqlSugar;
using Tnb.BasicData.Entities;
using Tnb.Common.Utils;
using Tnb.WarehouseMgr.Entities;
using Tnb.WarehouseMgr.Entities.Consts;
using Tnb.WarehouseMgr.Entities.Dto;
using Tnb.WarehouseMgr.Entities.Dto.Inputs;
using Tnb.WarehouseMgr.Entities.Dto.Outputs;
using Tnb.WarehouseMgr.Entities.Entity;
using Tnb.WarehouseMgr.Entities.Enums;
using Tnb.WarehouseMgr.Interfaces;
@@ -299,5 +302,44 @@ namespace Tnb.WarehouseMgr
input.barCodes = input.barCodes.OrderBy(o => o).ToList();
base.BarCodePrint(input.barCodes, input.copies,"");
}
/// <summary>
/// 载具绑定物料
/// </summary>
/// <param name="input"></param>
/// <exception cref="ArgumentNullException"></exception>
[HttpPost]
public async Task<Tnb.WarehouseMgr.Entities.Dto.Outputs.Result> BindCarryMaterial(BindCarryCodeInput input)
{
try
{
WmsCarryCode wmsCarryCode = new WmsCarryCode();
wmsCarryCode.org_id = WmsWareHouseConst.AdministratorOrgId;
wmsCarryCode.create_time = DateTime.Now;
wmsCarryCode.carry_id = input.carry_id;
wmsCarryCode.barcode = input.barcode;
wmsCarryCode.codeqty = input.codeqty;
wmsCarryCode.material_id = input.material_id;
wmsCarryCode.material_code = input.material_code;
wmsCarryCode.material_name = input.material_name;
wmsCarryCode.location_id = input.location_id;
wmsCarryCode.location_code = input.location_code;
wmsCarryCode.code_batch = input.code_batch;
await _db.Insertable<WmsCarryCode>(wmsCarryCode).ExecuteCommandAsync();
// todo 绑定记录表
return await ToApiResult(HttpStatusCode.OK, "成功");
}
catch (Exception ex)
{
Logger.LogInformation(ex.Message);
Logger.LogInformation(ex.StackTrace);
return await ToApiResult(HttpStatusCode.InternalServerError, ex.Message);
}
}
}
}