销售发货接口、原材料仓优化调整、日志优化

This commit is contained in:
2024-07-29 15:49:52 +08:00
parent 0e09a8187c
commit b1027b6e49
15 changed files with 393 additions and 76 deletions

View File

@@ -165,6 +165,17 @@ namespace Tnb.WarehouseMgr
try
{
WmsCarryH? carry = await _db.Queryable<WmsCarryH>().SingleAsync(it => it.carry_code == input.carrycode);
if (carry == null)
{
throw new Exception($"托盘{input.carrycode}不存在!");
}
var _WmsCarryCode = _db.Queryable<WmsCarryCode>().Where(it => it.carry_id == carry.id).OrderByDescending(it => it.id).First();
if (_WmsCarryCode != null)
{
throw new Exception($"托盘{input.carrycode}已绑定物料!");
}
List<WmsCarryCode> WmsCarryCodes = new List<WmsCarryCode>();
foreach (var detail in input.details)
{
@@ -183,7 +194,8 @@ namespace Tnb.WarehouseMgr
await _db.Updateable<WmsCarryH>().SetColumns(r => new WmsCarryH
{
location_id = WmsWareHouseConst.LOCATION_YCLBGWDRK,
location_code = "YCLBGWDRK"
location_code = "YCLBGWDRK",
carry_status = "1"
}).Where(r => r.id == carry.id).ExecuteCommandAsync();
if (rows == 0)
{
@@ -194,7 +206,7 @@ namespace Tnb.WarehouseMgr
{
Logger.LogError(ex.Message);
Logger.LogError(ex.StackTrace);
throw new AppFriendlyException($"绑定失败(1.可能是存在已被绑定的条码 2.存在其他与此载具编号相同的载具 3.存在字段传了空值) {ex.Message}", 500);
throw new AppFriendlyException($"绑定失败(1.可能是存在已被绑定的条码 2.系统中存在其他与此托盘编号相同的托盘 3.存在字段传了空值) {ex.Message}", 500);
}
catch (Exception ex)
{