灭菌线、信号变更

This commit is contained in:
2024-07-16 12:45:35 +08:00
parent 1f5dfa5a2e
commit bfc22c7326
5 changed files with 265 additions and 24 deletions

View File

@@ -1892,23 +1892,27 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
return;
}
List<BasLocation> endLocations = db_Floor4DMJ2MJX.Queryable<BasLocation>().Where(r => r.wh_id == WmsWareHouseConst.WAREHOUSE_DMJC_ID
&& r.is_type == ((int)EnumLocationType.).ToString() && r.is_lock == 0).ToList();
Dictionary<string, string[]> putdic = new Dictionary<string, string[]>();
putdic.Add("SLD1", new string[] { "设备名", "信号" });
Dictionary<BasLocation, string[]> getdic = new Dictionary<BasLocation, string[]>();
foreach (BasLocation endLocation in endLocations)
{
getdic.Add(endLocation, new string[] { "", "" });
}
//Dictionary<BasLocation, string[]> putdic = new Dictionary<BasLocation, string[]>();
//List<BasLocation> endLocations = db_Floor4DMJ2MJX.Queryable<BasLocation>().Where(r => r.wh_id == WmsWareHouseConst.WAREHOUSE_DMJC_ID
//&& r.is_type == ((int)EnumLocationType.分拣库位).ToString() && r.is_lock == 0).ToList();
foreach (var key in getdic.Keys)
//foreach (BasLocation endLocation in endLocations)
//{
// putdic.Add(endLocation, new string[] { "", "" });
//}
foreach (var key in putdic.Keys)
{
await db_Floor4DMJ2MJX.Ado.BeginTranAsync();
var strs = getdic.Where(p => p.Key == key).First().Value;
var strs = putdic.Where(p => p.Key == key).First().Value;
bool result = await GetBoolTag(strs[0], strs[1]);
if (result)
{
LoggerYCLGLDPJInstock.LogInformation($"【四楼待灭菌仓到灭菌线】 上料点 {key} {strs[1]}采集到 {result}");
LoggerFloor4DMJ2MJX.LogInformation($"【四楼待灭菌仓到灭菌线】 上料点 {key} {strs[1]}采集到 {result}");
OutStockStrategyQuery outStockStrategyInput = new()
{
@@ -1919,23 +1923,25 @@ where carry_code = '{coderesult}' and status = '{WmsWareHouseConst.TASK_BILL_STA
if (items.Count < 1)
{
LoggerYCLGLDPJInstock.LogInformation($"【四楼待灭菌仓到灭菌线】 没有可以出库的空载具");
LoggerFloor4DMJ2MJX.LogWarning($"【四楼待灭菌仓到灭菌线】 没有可以出库的空载具");
break;
}
BasLocation endlocation = await db_Floor4DMJ2MJX.Queryable<BasLocation>().Where(r => r.location_code == key).FirstAsync();
WmsCarryH wmsCarryH = items[0];
//锁定起点库位 更新为空闲
await db_YCLWXDPJInstocktimer.Updateable<BasLocation>().SetColumns(r => new BasLocation { is_lock = 1, is_use = "0" }).Where(r => r.id == wmsCarryH.location_id).ExecuteCommandAsync();
//锁定起点库位
await db_Floor4DMJ2MJX.Updateable<BasLocation>().SetColumns(r => new BasLocation { is_lock = 1 }).Where(r => r.id == wmsCarryH.location_id).ExecuteCommandAsync();
//锁定终点库位
await db_YCLWXDPJInstocktimer.Updateable<BasLocation>().SetColumns(r => new BasLocation { is_lock = 1 }).Where(r => r.id == key.id).ExecuteCommandAsync();
await db_Floor4DMJ2MJX.Updateable<BasLocation>().SetColumns(r => new BasLocation { is_lock = 1 }).Where(r => r.id == endlocation.id).ExecuteCommandAsync();
bool result_createPretask = await createPretask(wmsCarryH.location_id, key.id, "", "", LoggerYCLGLDPJInstock, db_YCLWXDPJInstocktimer);
bool result_createPretask = await createPretask(wmsCarryH.location_id, endlocation.id, wmsCarryH.id, wmsCarryH.carry_code, LoggerFloor4DMJ2MJX, db_Floor4DMJ2MJX);
if (!result_createPretask)
{
LoggerYCLGLDPJInstock.LogWarning($"【四楼待灭菌仓到灭菌线】 {wmsCarryH.location_code} 到 {key.location_code} 预任务生成失败");
throw new Exception($"【四楼待灭菌仓到灭菌线】 {wmsCarryH.location_code} 到 {key.location_code} 预任务生成失败");
LoggerFloor4DMJ2MJX.LogWarning($"【四楼待灭菌仓到灭菌线】 {wmsCarryH.location_code} 到 {endlocation.location_code} 预任务生成失败");
throw new Exception($"【四楼待灭菌仓到灭菌线】 {wmsCarryH.location_code} 到 {endlocation.location_code} 预任务生成失败");
}
LoggerYCLGLDPJInstock.LogWarning($"【四楼待灭菌仓到灭菌线】 {wmsCarryH.location_code} 到 {key.location_code} 预任务生成成功");
LoggerFloor4DMJ2MJX.LogInformation($"【四楼待灭菌仓到灭菌线】 {wmsCarryH.location_code} 到 {endlocation.location_code} 预任务生成成功");
}
await db_Floor4DMJ2MJX.Ado.CommitTranAsync();
@@ -1986,10 +1992,90 @@ 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")} 开始执行四楼待灭菌线到灭菌仓");
await db_Floor4MJX2MJC.Ado.BeginTranAsync();
if (true)
{
return;
}
Dictionary<string, string[]> getdic = new Dictionary<string, string[]>();
getdic.Add("SLD1", new string[] { "设备名", "信号", "条码信号" });
//List<BasLocation> startLocations = db_Floor4MJX2MJC.Queryable<BasLocation>().Where(r => r.wh_id == WmsWareHouseConst.WAREHOUSE_MJC_ID
//&& r.is_type == ((int)EnumLocationType.分拣库位).ToString() && r.is_lock == 0).ToList();
//Dictionary<BasLocation, string[]> getdic = new Dictionary<BasLocation, string[]>();
//foreach (BasLocation startLocation in getdic)
//{
// getdic.Add(startLocation, new string[] { "", "" });
//}
foreach (var key in getdic.Keys)
{
var strs = getdic.Where(p => p.Key == key).First().Value;
bool result = await GetBoolTag(strs[0], strs[1]);
if (result)
{
LoggerFloor4MJX2MJC.LogInformation($"【四楼待灭菌线到灭菌仓】 上料点 {key} {strs[1]}采集到 {result}");
InStockStrategyQuery inStockStrategyInput = new()
{
warehouse_id = WmsWareHouseConst.WAREHOUSE_MJC_ID,
Size = 1
};
List<BasLocation> items = await _wareHouseService.InStockStrategy(inStockStrategyInput);
if (items.Count < 1)
{
LoggerFloor4MJX2MJC.LogWarning($"【四楼待灭菌线到灭菌仓】 没有可以入库的库位");
break;
}
await db_Floor4MJX2MJC.Ado.BeginTranAsync();
BasLocation startlocation = await db_Floor4DMJ2MJX.Queryable<BasLocation>().Where(r => r.location_code == key).FirstAsync();
BasLocation endlocation = items[0];
string carry_code = "";
WmsCarryH wmsCarryH = await db_Floor4MJX2MJC.Queryable<WmsCarryH>().Where(r => r.carry_code == carry_code).FirstAsync();
//锁定起点库位
await db_Floor4MJX2MJC.Updateable<BasLocation>().SetColumns(r => new BasLocation { is_lock = 1 }).Where(r => r.id == startlocation.id).ExecuteCommandAsync();
//锁定终点库位
await db_Floor4MJX2MJC.Updateable<BasLocation>().SetColumns(r => new BasLocation { is_lock = 1 }).Where(r => r.id == endlocation.id).ExecuteCommandAsync();
bool result_createPretask = await createPretask(startlocation.id, endlocation.id, wmsCarryH.id, wmsCarryH.carry_code, LoggerFloor4MJX2MJC, db_Floor4MJX2MJC);
if (!result_createPretask)
{
LoggerFloor4MJX2MJC.LogWarning($"【四楼待灭菌线到灭菌仓】 {startlocation.location_code} 到 {endlocation.location_code} 预任务生成失败");
throw new Exception($"【四楼待灭菌线到灭菌仓】 {startlocation.location_code} 到 {endlocation.location_code} 预任务生成失败");
}
LoggerFloor4MJX2MJC.LogInformation($"【四楼待灭菌线到灭菌仓】 {startlocation.location_code} 到 {endlocation.location_code} 预任务生成成功");
DateTime dateTime = DateTime.Now;
WmsSterilizationInstockH wmsSterilizationInstockH = new WmsSterilizationInstockH();
wmsSterilizationInstockH.carry_id = wmsCarryH.id;
wmsSterilizationInstockH.carry_code = wmsCarryH.carry_code;
wmsSterilizationInstockH.location_id = endlocation.id;
wmsSterilizationInstockH.location_code = endlocation.location_code;
wmsSterilizationInstockH.create_id = WmsWareHouseConst.AdministratorUserId;
wmsSterilizationInstockH.create_time = dateTime;
wmsSterilizationInstockH.instock_time = dateTime;
wmsSterilizationInstockH.org_id = WmsWareHouseConst.AdministratorOrgId;
wmsSterilizationInstockH.xl_location_id = startlocation.id;
wmsSterilizationInstockH.xl_location_code = startlocation.location_code;
wmsSterilizationInstockH.status = WmsWareHouseConst.BILLSTATUS_ON_ID;
int row = await db_Floor4MJX2MJC.Insertable(wmsSterilizationInstockH).ExecuteCommandAsync();
if (row > 0)
LoggerFloor4MJX2MJC.LogInformation($"【四楼待灭菌线到灭菌仓】 灭菌入库记录生成成功");
else
LoggerFloor4MJX2MJC.LogWarning($"【四楼待灭菌线到灭菌仓】 灭菌入库记录生成失败");
}
await db_Floor4MJX2MJC.Ado.CommitTranAsync();
}
_ = _wareHouseService.GenTaskExecute();
await db_Floor4MJX2MJC.Ado.CommitTranAsync();
}
catch (ObjectDisposedException ex)
{
@@ -2034,6 +2120,16 @@ 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")} 开始执行四楼灭菌仓到成品库");
int hours = 168;
List<WmsSterilizationInstockH> wmsSterilizationInstockHs = db_Floor4DMC2CPK.Queryable<WmsSterilizationInstockH>()
.Where(r => DateTime.Now.Subtract(r.instock_time.Value).TotalHours > hours && r.status == WmsWareHouseConst.BILLSTATUS_ON_ID).ToList();
foreach (WmsSterilizationInstockH wmsSterilizationInstockH in wmsSterilizationInstockHs)
{
}
await db_Floor4DMC2CPK.Ado.BeginTranAsync();

View File

@@ -0,0 +1,52 @@
using JNPF.Common.Contracts;
using JNPF.Common.Security;
using SqlSugar;
namespace Tnb.WarehouseMgr.Entities.Entity;
/// <summary>
/// 四楼静置仓配置
/// </summary>
[SugarTable("wms_floor4stewing_config")]
public partial class WmsFloor4stewingConfig : BaseEntity<string>
{
public WmsFloor4stewingConfig()
{
id = SnowflakeIdHelper.NextId();
}
/// <summary>
/// 配置项
/// </summary>
public string? name { get; set; }
/// <summary>
/// 值
/// </summary>
public string? value { get; set; }
/// <summary>
/// 创建用户
/// </summary>
public string? create_id { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime? create_time { get; set; }
/// <summary>
/// 修改用户
/// </summary>
public string? modify_id { get; set; }
/// <summary>
/// 修改时间
/// </summary>
public DateTime? modify_time { get; set; }
/// <summary>
/// 所属组织
/// </summary>
public string? org_id { get; set; }
}

View File

@@ -0,0 +1,92 @@
using JNPF.Common.Contracts;
using JNPF.Common.Security;
using SqlSugar;
namespace Tnb.WarehouseMgr.Entities.Entity;
/// <summary>
/// 灭菌入库记录
/// </summary>
[SugarTable("wms_sterilization_instock_h")]
public partial class WmsSterilizationInstockH : BaseEntity<string>
{
public WmsSterilizationInstockH()
{
id = SnowflakeIdHelper.NextId();
}
/// <summary>
/// 创建用户
/// </summary>
public string? create_id { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime? create_time { get; set; }
/// <summary>
/// 所属组织
/// </summary>
public string? org_id { get; set; }
/// <summary>
/// 载具id
/// </summary>
public string? carry_id { get; set; }
/// <summary>
/// 载具编码
/// </summary>
public string? carry_code { get; set; }
/// <summary>
/// 入库时间
/// </summary>
public DateTime? instock_time { get; set; }
/// <summary>
/// 入库库位id
/// </summary>
public string? location_id { get; set; }
/// <summary>
/// 入库库位编码
/// </summary>
public string? location_code { get; set; }
/// <summary>
/// 修改用户
/// </summary>
public string? modify_id { get; set; }
/// <summary>
/// 修改时间
/// </summary>
public DateTime? modify_time { get; set; }
/// <summary>
/// 下料库位id
/// </summary>
public string? xl_location_id { get; set; }
/// <summary>
/// 下料库位编码
/// </summary>
public string? xl_location_code { get; set; }
/// <summary>
/// 成品仓库位id
/// </summary>
public string? cp_location_id { get; set; }
/// <summary>
/// 成品仓库位编码
/// </summary>
public string? cp_location_code { get; set; }
/// <summary>
/// 状态
/// </summary>
public string? status { get; set; }
}

View File

@@ -657,10 +657,11 @@ namespace Tnb.WarehouseMgr
Logger.Information($"【Check】 判断KIVA是否可以{action} {code}");
Dictionary<string, string[]> putdic = new Dictionary<string, string[]>();
Dictionary<string, string[]> getdic = new Dictionary<string, string[]>();
putdic.Add("ZSSSXCTU02", new string[] { "YTCS", "右输送线下层允许入箱4", });
putdic.Add("ZSSSXCTU01", new string[] { "YTCS", "左输送线下层允许入箱2", });
getdic.Add("ZSSSXCTU01", new string[] { "YTCS", "左输送线上层允许出箱1" });
getdic.Add("ZSSSXCTU02", new string[] { "YTCS", "右输送线上层允许出箱3" });
putdic.Add("ZSSSXCTU02", new string[] { "YTCS", "AllowAgvFullIn_CS04", });
putdic.Add("ZSSSXCTU01", new string[] { "YTCS", "AllowAgvFullIn_CS02", });
getdic.Add("ZSSSXCTU01", new string[] { "YTCS", "AllowAgvEmptyOut_CS01" });
getdic.Add("ZSSSXCTU02", new string[] { "YTCS", "AllowAgvEmptyOut_CS03" });
#region
putdic.Add("ZS-C01-1", new string[] { "hxjC", "A2允许入空箱", });