优化
This commit is contained in:
@@ -541,11 +541,11 @@
|
||||
/// <summary>
|
||||
/// 原材料仓内转移策略
|
||||
/// </summary>
|
||||
public const string POLICY_YCLINSTOCK = "WISP202407250001";
|
||||
public const string POLICY_YCLINSTOCK = "WISP202407260001";
|
||||
|
||||
/// <summary>
|
||||
/// 原材料仓先进先出
|
||||
/// </summary>
|
||||
public const string POLICY_YCLOUTSTOCK = "WOSP202407250001";
|
||||
public const string POLICY_YCLOUTSTOCK = "WOSP202407260001";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,5 +96,8 @@ public partial class WmsElevatorH : BaseEntity<string>
|
||||
/// 电梯占用状态
|
||||
/// </summary>
|
||||
public int is_use { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 占用任务
|
||||
/// </summary>
|
||||
public int use_tasks { get; set; }
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ using Tnb.WarehouseMgr.Interfaces;
|
||||
using Tnb.BasicData;
|
||||
using Tnb.ProductionMgr.Entities.Entity;
|
||||
using Tnb.WarehouseMgr.Entities.Entity;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Tnb.WarehouseMgr
|
||||
{
|
||||
@@ -280,8 +281,18 @@ namespace Tnb.WarehouseMgr
|
||||
throw new AppFriendlyException("条码已生成", 500);
|
||||
};
|
||||
WmsPurchaseD WmsPurchaseD = await _db.Queryable<WmsPurchaseD>().Where(it => input.BillId == it.id).FirstAsync();
|
||||
|
||||
if (WmsPurchaseD.purchase_arriveqty == 0)
|
||||
{
|
||||
throw new AppFriendlyException("到货数量为0,没有物料可以打印", 500);
|
||||
};
|
||||
|
||||
List<WmsTempCode> wmsTempCodes = new();
|
||||
decimal? minPacking = (await _db.Queryable<BasMaterial>().FirstAsync(it => it.id == WmsPurchaseD.material_id))?.minpacking;
|
||||
if (!minPacking.HasValue || minPacking.Value <= 0)
|
||||
{
|
||||
throw new AppFriendlyException($"物料{WmsPurchaseD.material_code} {WmsPurchaseD.material_id} 包装数量为空或者等于0,无法打印!", 500);
|
||||
};
|
||||
int codeNum = 0;
|
||||
|
||||
if (minPacking.HasValue && minPacking.Value > 0)
|
||||
@@ -330,8 +341,10 @@ namespace Tnb.WarehouseMgr
|
||||
}
|
||||
|
||||
|
||||
catch (Exception)
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.LogError($"【BarCodePrint】" + ex.Message);
|
||||
Logger.LogError($"【BarCodePrint】" + ex.StackTrace);
|
||||
await _db.Ado.RollbackTranAsync();
|
||||
throw;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user