This commit is contained in:
2024-07-26 17:54:29 +08:00
parent 1fa00ea4fc
commit c61cd04ae7
4 changed files with 26 additions and 11 deletions

View File

@@ -2255,19 +2255,18 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
Console.WriteLine($"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")} 开始执行四楼灭菌仓到成品库");
LoggerTimer.LogInformation($"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")} 开始执行四楼灭菌仓到成品库");
WmsFloor4stewingConfig wmsFloor4StewingConfig = await db_Floor4DMC2CPK.Queryable<WmsFloor4stewingConfig>()
.Where(r => r.name == "静置时间(小时)").FirstAsync();
if (wmsFloor4StewingConfig == null)
var time = db_Floor4DMC2CPK.Queryable<BasFactoryConfig>().Where(p => p.key == "mjcstewingtime").FirstAsync().Result.value;
if (time == null)
{
LoggerFloor4DMC2CPK.LogWarning($"【四楼灭菌仓到成品库】 未在静置仓配置中配置 静置时间(小时)");
return;
}
int hours = 168;
if (!int.TryParse(wmsFloor4StewingConfig.value, out hours))
if (!int.TryParse(time, out hours))
{
LoggerFloor4DMC2CPK.LogWarning($"【四楼灭菌仓到成品库】 静置时间(小时) 配置有误,错误值为 {wmsFloor4StewingConfig.value}");
LoggerFloor4DMC2CPK.LogWarning($"【四楼灭菌仓到成品库】 静置时间(小时) 配置有误,错误值为 {time}");
return;
}
@@ -2529,7 +2528,7 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
Floor4DMC2CPKtimer = new Timer(Floor4DMC2CPK, null, TimeSpan.Zero, TimeSpan.FromSeconds(30));
F2KTPsupplementtimer = new Timer(F2KTPsupplement, null, TimeSpan.Zero, TimeSpan.FromSeconds(30));
//YCLInternalTransfertimer = new Timer(YCLInternalTransfer, null, TimeSpan.Zero, TimeSpan.FromSeconds(180));
YCLInternalTransfertimer = new Timer(YCLInternalTransfer, null, TimeSpan.Zero, TimeSpan.FromSeconds(180));
return Task.CompletedTask;
}

View File

@@ -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";
}
}

View File

@@ -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; }
}

View File

@@ -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;
}