载具查物料条码库存接口
This commit is contained in:
@@ -13,5 +13,6 @@ namespace Tnb.WarehouseMgr.Entities.Dto.Inputs
|
|||||||
public string? create_id { get; set; }
|
public string? create_id { get; set; }
|
||||||
public string? carry_code { get; set; }
|
public string? carry_code { get; set; }
|
||||||
public string? startlocation_code { get; set; }
|
public string? startlocation_code { get; set; }
|
||||||
|
public string? warehouse_id { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
namespace Tnb.WarehouseMgr.Entities.Dto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 库房业务更新输入参数
|
||||||
|
/// </summary>
|
||||||
|
public class MaterialByCarryInput
|
||||||
|
{
|
||||||
|
public string carry_code { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -101,7 +101,7 @@ namespace Tnb.WarehouseMgr
|
|||||||
throw new Exception($"托盘{wmsCarryH.carry_code}在存储库位中,不能绑定!");
|
throw new Exception($"托盘{wmsCarryH.carry_code}在存储库位中,不能绑定!");
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (startlocationn.wh_id)
|
switch (input.warehouse_id)
|
||||||
{
|
{
|
||||||
case WmsWareHouseConst.WAREHOUSE_YCL_ID:
|
case WmsWareHouseConst.WAREHOUSE_YCL_ID:
|
||||||
{
|
{
|
||||||
@@ -133,7 +133,7 @@ namespace Tnb.WarehouseMgr
|
|||||||
wmsArtificialInstock.create_time = DateTime.Now;
|
wmsArtificialInstock.create_time = DateTime.Now;
|
||||||
wmsArtificialInstock.location_id = startlocationn.id;
|
wmsArtificialInstock.location_id = startlocationn.id;
|
||||||
wmsArtificialInstock.location_code = startlocationn.location_code;
|
wmsArtificialInstock.location_code = startlocationn.location_code;
|
||||||
wmsArtificialInstock.warehouse_id = startlocationn.wh_id;
|
wmsArtificialInstock.warehouse_id = input.warehouse_id;
|
||||||
await _db.Insertable(wmsArtificialInstock).ExecuteCommandAsync();
|
await _db.Insertable(wmsArtificialInstock).ExecuteCommandAsync();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ using Mapster;
|
|||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
using Npgsql;
|
using Npgsql;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using Tnb.BasicData.Entities;
|
using Tnb.BasicData.Entities;
|
||||||
@@ -355,5 +356,38 @@ namespace Tnb.WarehouseMgr
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 根据载具获取物料
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <exception cref="AppFriendlyException"></exception>
|
||||||
|
|
||||||
|
[HttpPost, NonUnify, AllowAnonymous]
|
||||||
|
public async Task<Tnb.WarehouseMgr.Entities.Dto.Outputs.Result> MaterialByCarry(MaterialByCarryInput input)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(input.carry_code))
|
||||||
|
{
|
||||||
|
throw new AppFriendlyException($"【MaterialByCarry】托盘编码不能为空", 500);
|
||||||
|
}
|
||||||
|
|
||||||
|
WmsCarryH wmsCarryH = await _db.Queryable<WmsCarryH>().Where(r => r.carry_code == input.carry_code).FirstAsync();
|
||||||
|
if (wmsCarryH == null)
|
||||||
|
{
|
||||||
|
throw new AppFriendlyException($"【MaterialByCarry】托盘{input.carry_code}不存在", 500);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<WmsCarryCode> wmsCarryCodes = _db.Queryable<WmsCarryCode>().Where(r => r.carry_id == wmsCarryH.id).ToList();
|
||||||
|
|
||||||
|
return await ToApiResult(HttpStatusCode.OK, "成功", wmsCarryCodes);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
await _db.Ado.RollbackTranAsync();
|
||||||
|
return await ToApiResult(HttpStatusCode.InternalServerError, ex.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"AgvRequestUrls": {
|
"AgvRequestUrls": {
|
||||||
"CreateTaskChainUrl": "http://10.147.19.104:5013/api/task-chain/create",
|
"CreateTaskChainUrl": "http://192.168.11.104:1880/api/task-chain/create",
|
||||||
"CancelTaskChainUrl": "http://192.168.11.104:1880/api/task-chain/cancel"
|
"CancelTaskChainUrl": "http://192.168.11.104:1880/api/task-chain/cancel"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user