现场问题处理,电梯逻辑处理
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
namespace Tnb.WarehouseMgr.Entities.Dto
|
||||
using SqlSugar;
|
||||
|
||||
namespace Tnb.WarehouseMgr.Entities.Dto
|
||||
{
|
||||
/// <summary>
|
||||
/// 入库策略输入参数
|
||||
@@ -34,5 +36,8 @@
|
||||
|
||||
// 策略编号
|
||||
public string PolicyCode { get; set; }
|
||||
|
||||
// 策略编号
|
||||
public ISqlSugarClient dbConn { get; set; } = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
namespace Tnb.WarehouseMgr.Entities.Dto
|
||||
using SqlSugar;
|
||||
|
||||
namespace Tnb.WarehouseMgr.Entities.Dto
|
||||
{
|
||||
public class OutStockStrategyQuery
|
||||
{
|
||||
@@ -52,5 +54,8 @@
|
||||
|
||||
// 策略编号
|
||||
public string PolicyCode { get; set; }
|
||||
|
||||
// 策略编号
|
||||
public ISqlSugarClient dbConn { get; set; } = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,4 +18,9 @@ public partial class WmsPretaskH : ITaskManagerDel
|
||||
/// </summary>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public string third_eqp_type { get; set; }
|
||||
/// <summary>
|
||||
/// 巷道
|
||||
/// </summary>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public string passage { get; set; }
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ public partial class WmsStockReportCode : BaseEntity<string>
|
||||
/// <summary>
|
||||
/// 主表ID
|
||||
/// </summary>
|
||||
public string? report_id { get; set; }
|
||||
//public string? report_id { get; set; }
|
||||
|
||||
///// <summary>
|
||||
///// 载具ID
|
||||
@@ -52,7 +52,7 @@ public partial class WmsStockReportCode : BaseEntity<string>
|
||||
/// <summary>
|
||||
/// 条码数量
|
||||
/// </summary>
|
||||
public decimal codeqty { get; set; }
|
||||
public decimal? codeqty { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 单位ID
|
||||
@@ -84,6 +84,10 @@ public partial class WmsStockReportCode : BaseEntity<string>
|
||||
/// </summary>
|
||||
public DateTime? time_stamp { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物料名称
|
||||
/// </summary>
|
||||
public string? material_name { get; set; }
|
||||
/// <summary>
|
||||
/// 规格型号
|
||||
/// </summary>
|
||||
@@ -116,4 +120,14 @@ public partial class WmsStockReportCode : BaseEntity<string>
|
||||
/// </summary>
|
||||
public string? warehouse_name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 区域编码
|
||||
/// </summary>
|
||||
public string? region_code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 区域名称
|
||||
/// </summary>
|
||||
public string? region_name { get; set; }
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ public partial class WmsStockReportH
|
||||
//[SugarColumn(IsIgnore = true)]
|
||||
//public List<WmsStockReportCode> Details { get; set; }
|
||||
//[SugarColumn(IsIgnore = true)]
|
||||
public decimal codeqty { get; set; }
|
||||
public decimal? codeqty { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -10,5 +10,6 @@
|
||||
出库库位,
|
||||
出入库位,
|
||||
分拣库位,
|
||||
人工管理库位,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -196,6 +196,7 @@ namespace Tnb.WarehouseMgr.Interfaces
|
||||
/// <returns></returns>
|
||||
Task<List<WmsPointH>> PathAlgorithmsEle(string pStartId, string pEndId, int ele);
|
||||
Task SsxControl(WmsDistaskH disTask, string action);
|
||||
Task SsxControl_complete(WmsDistaskH disTask, string action);
|
||||
Func<string, int, Task> AddUnExecuteTask { get; set; }
|
||||
Task<bool> Check(string code, string action);
|
||||
/// <summary>
|
||||
|
||||
@@ -290,10 +290,12 @@ namespace Tnb.WarehouseMgr
|
||||
if (flag)
|
||||
{
|
||||
await _wareHouseService.SsxControl(dis, "UNLOAD");
|
||||
Logger.Information($"【UnloadConfirm】 当前放货,任务编号:{input.taskCode} 确认成功");
|
||||
return await ToApiResult(HttpStatusCode.OK, "成功");
|
||||
}
|
||||
else
|
||||
{
|
||||
Logger.Information($"【UnloadConfirm】 当前放货,任务编号:{input.taskCode} 确认信号不允许");
|
||||
return await ToApiResult(HttpStatusCode.InternalServerError, "失败");
|
||||
}
|
||||
}
|
||||
@@ -304,10 +306,12 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
// 二楼机械臂
|
||||
await _wareHouseService.Floor2MechanicalConfirm(dis, "UNLOAD");
|
||||
Logger.Information($"【UnloadConfirm】 当前放货,任务编号:{input.taskCode} 确认成功");
|
||||
return await ToApiResult(HttpStatusCode.OK, "成功");
|
||||
}
|
||||
else
|
||||
{
|
||||
Logger.Information($"【UnloadConfirm】 当前放货,任务编号:{input.taskCode} 确认成功");
|
||||
return await ToApiResult(HttpStatusCode.OK, "成功");
|
||||
}
|
||||
}
|
||||
@@ -316,6 +320,7 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
Logger.LogError(ex.Message);
|
||||
Logger.LogError(ex.StackTrace);
|
||||
Logger.Information($"【UnloadConfirm】 当前放货,任务编号:{input.taskCode} 确认失败");
|
||||
return await ToApiResult(HttpStatusCode.InternalServerError, $"放货确认..................失败 原因是{ex.Message}");
|
||||
throw;
|
||||
}
|
||||
@@ -915,7 +920,7 @@ namespace Tnb.WarehouseMgr
|
||||
};
|
||||
Logger.Information($"taskCompleUpInput json parameter:{JsonConvert.SerializeObject(taskCompleUpInput)}");
|
||||
await _wareHouseService.TaskComplate(taskCompleUpInput);
|
||||
await _wareHouseService.SsxControl(disTask, "UNLOAD");
|
||||
await _wareHouseService.SsxControl_complete(disTask, "UNLOAD");
|
||||
|
||||
await _wareHouseService.Floor2MechanicalComplete(disTask, "UNLOAD");
|
||||
|
||||
@@ -960,6 +965,13 @@ namespace Tnb.WarehouseMgr
|
||||
})
|
||||
.Where(it => it.elevator_id == wmsElevatorH.elevator_id).ExecuteCommandAsync();
|
||||
|
||||
var floor3FirstSelectElevator = await _db.Queryable<BasFactoryConfig>().Where(p => p.key == "floor3FirstSelectElevator").FirstAsync();
|
||||
if (floor3FirstSelectElevator.value == input.elevator_code)
|
||||
{
|
||||
// 剩余可放托数
|
||||
await _db.Updateable<BasFactoryConfig>().SetColumns(r => r.value == "2")
|
||||
.Where(r => r.key == "floor3FirstSelectElevatorTasknums").ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
List<WmsDistaskH> elevatorTasks = _db.Queryable<WmsDistaskH>()
|
||||
.Where(r => r.startlocation_code.Contains($"DT") && r.endlocation_code.Contains($"DT") && r.act_start_date == null && r.act_end_date == null
|
||||
|
||||
@@ -5,6 +5,7 @@ using JNPF.Common.Enums;
|
||||
using JNPF.DependencyInjection;
|
||||
using JNPF.DynamicApiController;
|
||||
using JNPF.FriendlyException;
|
||||
using JNPF.Systems.Entitys.Permission;
|
||||
using JNPF.Systems.Entitys.System;
|
||||
using JNPF.Systems.Interfaces.System;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
@@ -1218,6 +1219,12 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
wmsRawmatTransferinstockH.outstockorg_id = org_erpExtendField.pk_org_v;
|
||||
wmsRawmatTransferinstockH.outstockorg_code = org_erpExtendField.pk_org;
|
||||
|
||||
var OrganizeEntity = await db.Queryable<OrganizeEntity>().Where(a => a.Id == org_erpExtendField.table_id).FirstAsync();
|
||||
if (OrganizeEntity != null)
|
||||
{
|
||||
wmsRawmatTransferinstockH.outstockorg_name = OrganizeEntity.FullName;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -276,7 +276,11 @@ namespace Tnb.WarehouseMgr
|
||||
List<BasLocation> items = new();
|
||||
try
|
||||
{
|
||||
var db = _db.CopyNew();
|
||||
var db = input.dbConn;
|
||||
if (input.dbConn == null)
|
||||
{
|
||||
db = _db.CopyNew();
|
||||
}
|
||||
WmsInstockPolicies policy = await db.Queryable<WmsInstockPolicies>().Where(it => it.status == 1 && (string.IsNullOrEmpty(input.PolicyCode)||
|
||||
it.bill_code == input.PolicyCode)).FirstAsync();
|
||||
if (policy == null)
|
||||
@@ -307,7 +311,7 @@ namespace Tnb.WarehouseMgr
|
||||
.AndIF(!string.IsNullOrEmpty(input.passage), it => it.passage == input.passage)
|
||||
.ToExpression();
|
||||
|
||||
items = await _db.CopyNew().Queryable<BasLocation>().Where(whereExp).OrderBy(policy.policy).ToListAsync();
|
||||
items = await db.Queryable<BasLocation>().Where(whereExp).OrderBy(policy.policy).ToListAsync();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
@@ -325,7 +329,12 @@ namespace Tnb.WarehouseMgr
|
||||
List<BasLocation> items = new();
|
||||
try
|
||||
{
|
||||
WmsInstockPolicies policy = await _db.CopyNew().Queryable<WmsInstockPolicies>().Where(it => it.status == 1).FirstAsync();
|
||||
var db = input.dbConn;
|
||||
if (input.dbConn == null)
|
||||
{
|
||||
db = _db.CopyNew();
|
||||
}
|
||||
WmsInstockPolicies policy = await db.Queryable<WmsInstockPolicies>().Where(it => it.status == 1).FirstAsync();
|
||||
if (policy == null)
|
||||
{
|
||||
throw new AppFriendlyException("没有可用的策略", 500);
|
||||
@@ -337,7 +346,7 @@ namespace Tnb.WarehouseMgr
|
||||
.And(it => it.is_type == ((int)EnumLocationType.分拣库位).ToString())
|
||||
.And(it => it.is_use == ((int)EnumCarryStatus.空闲).ToString())
|
||||
.ToExpression();
|
||||
items = await _db.CopyNew().Queryable<BasLocation>().Where(whereExp).OrderBy(policy.policy).ToListAsync();
|
||||
items = await db.Queryable<BasLocation>().Where(whereExp).OrderBy(policy.policy).ToListAsync();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
@@ -356,7 +365,12 @@ namespace Tnb.WarehouseMgr
|
||||
List<BasLocation> items = new();
|
||||
try
|
||||
{
|
||||
WmsInstockPolicies policy = await _db.CopyNew().Queryable<WmsInstockPolicies>().Where(it => it.status == 1).FirstAsync();
|
||||
var db = input.dbConn;
|
||||
if (input.dbConn == null)
|
||||
{
|
||||
db = _db.CopyNew();
|
||||
}
|
||||
WmsInstockPolicies policy = await db.Queryable<WmsInstockPolicies>().Where(it => it.status == 1).FirstAsync();
|
||||
if (policy == null)
|
||||
{
|
||||
throw new AppFriendlyException("没有可用的策略", 500);
|
||||
@@ -368,7 +382,7 @@ namespace Tnb.WarehouseMgr
|
||||
.And(it => it.is_type == ((int)EnumLocationType.出入库位).ToString())
|
||||
.And(it => it.is_use == ((int)EnumCarryStatus.空闲).ToString())
|
||||
.ToExpression();
|
||||
items = await _db.CopyNew().Queryable<BasLocation>().Where(whereExp).OrderBy(policy.policy).ToListAsync();
|
||||
items = await db.Queryable<BasLocation>().Where(whereExp).OrderBy(policy.policy).ToListAsync();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
@@ -472,7 +486,11 @@ namespace Tnb.WarehouseMgr
|
||||
_ = whereExprable.And(carryStatusFilterExp);
|
||||
Expression<Func<WmsCarryH, WmsCarryCode, BasLocation, bool>> whereExpr = whereExprable.ToExpression();
|
||||
|
||||
SqlSugarClient cyDb = _db.CopyNew();
|
||||
var cyDb = input.dbConn;
|
||||
if (input.dbConn == null)
|
||||
{
|
||||
cyDb = _db.CopyNew();
|
||||
}
|
||||
|
||||
List<Tuple<string, WmsCarryH, WmsCarryCode, BasLocation>> items = cyDb.Queryable<WmsCarryH>().LeftJoin<WmsCarryCode>((a, b) => a.id == b.carry_id)
|
||||
.LeftJoin<BasLocation>((a, b, c) => a.location_id == c.id)
|
||||
@@ -513,7 +531,11 @@ namespace Tnb.WarehouseMgr
|
||||
|
||||
public async Task<List<WmsCarryH>> OutStockStrategy([FromQuery] OutStockStrategyQuery input)
|
||||
{
|
||||
SqlSugarClient cyDb = _db.CopyNew();
|
||||
var cyDb = input.dbConn;
|
||||
if (input.dbConn == null)
|
||||
{
|
||||
cyDb = _db.CopyNew();
|
||||
}
|
||||
List<string> busyPassages = new();
|
||||
if (input.AvoidBusyPassage)
|
||||
{
|
||||
@@ -915,8 +937,8 @@ namespace Tnb.WarehouseMgr
|
||||
putdic.Add("ZS-A03-1", new string[] { "hxjA", "A5允许入空箱", });
|
||||
getdic.Add("ZS-A03-2", new string[] { "hxjA", "A5允许取满箱" });
|
||||
|
||||
putdic.Add("ZS-A04-1", new string[] { "hxjA", "A6允许入空箱", });
|
||||
getdic.Add("ZS-A04-2", new string[] { "hxjA", "A6允许取满箱" });
|
||||
putdic.Add("ZS-D06-1", new string[] { "hxjA", "A6允许入空箱", });
|
||||
getdic.Add("ZS-D06-2", new string[] { "hxjA", "A6允许取满箱" });
|
||||
|
||||
putdic.Add("ZS-A05-1", new string[] { "hxjA", "A7允许入空箱", });
|
||||
getdic.Add("ZS-A05-2", new string[] { "hxjA", "A7允许取满箱" });
|
||||
@@ -1028,7 +1050,7 @@ namespace Tnb.WarehouseMgr
|
||||
getdic.Add("ZS-A01-2", new string[] { "hxjA", "A3AGV允许入满箱", "true" });
|
||||
getdic.Add("ZS-A02-2", new string[] { "hxjA", "A4AGV允许入满箱", "true" });
|
||||
getdic.Add("ZS-A03-2", new string[] { "hxjA", "A5AGV允许入满箱", "true" });
|
||||
getdic.Add("ZS-A04-2", new string[] { "hxjA", "A6AGV允许入满箱", "true" });
|
||||
getdic.Add("ZS-D06-2", new string[] { "hxjA", "A6AGV允许入满箱", "true" });
|
||||
getdic.Add("ZS-A05-2", new string[] { "hxjA", "A7AGV允许入满箱", "true" });
|
||||
getdic.Add("ZS-A06-2", new string[] { "hxjA", "A8AGV允许入满箱", "true" });
|
||||
getdic.Add("ZS-A07-2", new string[] { "hxjA", "A9AGV允许入满箱", "true" });
|
||||
@@ -1067,7 +1089,7 @@ namespace Tnb.WarehouseMgr
|
||||
putdic.Add("ZS-A01-1", new string[] { "hxjA", "A3AGV允许出空箱", "true" });
|
||||
putdic.Add("ZS-A02-1", new string[] { "hxjA", "A4AGV允许出空箱", "true" });
|
||||
putdic.Add("ZS-A03-1", new string[] { "hxjA", "A5AGV允许出空箱", "true" });
|
||||
putdic.Add("ZS-A04-1", new string[] { "hxjA", "A6AGV允许出空箱", "true" });
|
||||
putdic.Add("ZS-D06-1", new string[] { "hxjA", "A6AGV允许出空箱", "true" });
|
||||
putdic.Add("ZS-A05-1", new string[] { "hxjA", "A7AGV允许出空箱", "true" });
|
||||
putdic.Add("ZS-A06-1", new string[] { "hxjA", "A8AGV允许出空箱", "true" });
|
||||
putdic.Add("ZS-A07-1", new string[] { "hxjA", "A9AGV允许出空箱", "true" });
|
||||
@@ -1116,6 +1138,131 @@ namespace Tnb.WarehouseMgr
|
||||
|
||||
}
|
||||
|
||||
|
||||
public async Task SsxControl_complete(WmsDistaskH disTask, string action)
|
||||
{
|
||||
Logger.Information($"输送线控制SsxControl_complete传入参数: {JsonConvert.SerializeObject(disTask)} {action}");
|
||||
|
||||
Dictionary<string, string[]> putdic = new Dictionary<string, string[]>();
|
||||
Dictionary<string, string[]> getdic = new Dictionary<string, string[]>();
|
||||
getdic.Add("SSX-021-005", new string[] { "YTCS", "FullOut_CS05Done", "true" });
|
||||
getdic.Add("SSX-111-011", new string[] { "东面提升机输送线", "下升降机11出箱完毕", "true" });
|
||||
getdic.Add("SSX-111-012", new string[] { "东面提升机输送线", "下升降机12出箱完毕", "true" });
|
||||
|
||||
getdic.Add("ZZ-01-02", new string[] { "外包装箱码垛线", "WBZX_x1_take_mtp", "true" });
|
||||
getdic.Add("ZZ-02-02", new string[] { "外包装箱码垛线", "WBZX_x2_take_mtp", "true" });
|
||||
|
||||
|
||||
getdic.Add("ZSSSXCTU02", new string[] { "YTCS", "右输送线上层允许出箱3", "true" });
|
||||
getdic.Add("ZSSSXCTU01", new string[] { "YTCS", "左输送线上层允许出箱1", "true" });
|
||||
getdic.Add("SSX-011-008", new string[] { "东面提升机输送线", "入库输送线8出箱完毕", "true" });
|
||||
getdic.Add("ZS-C01-2", new string[] { "hxjC", "A2AGV允许入满箱", "true" });
|
||||
getdic.Add("ZS-C02-2", new string[] { "hxjC", "A3AGV允许入满箱", "true" });
|
||||
getdic.Add("ZS-C03-2", new string[] { "hxjC", "A4AGV允许入满箱", "true" });
|
||||
getdic.Add("ZS-C04-2", new string[] { "hxjC", "A5AGV允许入满箱", "true" });
|
||||
getdic.Add("ZS-C05-2", new string[] { "hxjC", "A6AGV允许入满箱", "true" });
|
||||
getdic.Add("ZS-C06-2", new string[] { "hxjC", "A7AGV允许入满箱", "true" });
|
||||
getdic.Add("ZS-C07-2", new string[] { "hxjC", "A8AGV允许入满箱", "true" });
|
||||
getdic.Add("ZS-C08-2", new string[] { "hxjC", "A9AGV允许入满箱", "true" });
|
||||
getdic.Add("ZS-C09-2", new string[] { "hxjC", "A10AGV允许入满箱", "true" });
|
||||
getdic.Add("ZS-C10-2", new string[] { "hxjC", "A11AGV允许入满箱", "true" });
|
||||
getdic.Add("ZS-C11-2", new string[] { "hxjC", "A12AGV允许入满箱", "true" });
|
||||
getdic.Add("ZS-C12-2", new string[] { "hxjC", "A13AGV允许入满箱", "true" });
|
||||
getdic.Add("ZS-C13-2", new string[] { "hxjC", "A14AGV允许入满箱", "true" });
|
||||
getdic.Add("ZS-C14-2", new string[] { "hxjC", "A1AGV允许入满箱", "true" });
|
||||
|
||||
getdic.Add("ZS-A01-2", new string[] { "hxjA", "A3AGV允许入满箱", "true" });
|
||||
getdic.Add("ZS-A02-2", new string[] { "hxjA", "A4AGV允许入满箱", "true" });
|
||||
getdic.Add("ZS-A03-2", new string[] { "hxjA", "A5AGV允许入满箱", "true" });
|
||||
getdic.Add("ZS-D06-2", new string[] { "hxjA", "A6AGV允许入满箱", "true" });
|
||||
getdic.Add("ZS-A05-2", new string[] { "hxjA", "A7AGV允许入满箱", "true" });
|
||||
getdic.Add("ZS-A06-2", new string[] { "hxjA", "A8AGV允许入满箱", "true" });
|
||||
getdic.Add("ZS-A07-2", new string[] { "hxjA", "A9AGV允许入满箱", "true" });
|
||||
getdic.Add("ZS-A08-2", new string[] { "hxjA", "A10AGV允许入满箱", "true" });
|
||||
getdic.Add("ZS-A09-2", new string[] { "hxjA", "A11AGV允许入满箱", "true" });
|
||||
getdic.Add("ZS-A10-2", new string[] { "hxjA", "A12AGV允许入满箱", "true" });
|
||||
getdic.Add("ZS-A11-2", new string[] { "hxjA", "A13AGV允许入满箱", "true" });
|
||||
getdic.Add("ZS-A12-2", new string[] { "hxjA", "A14AGV允许入满箱", "true" });
|
||||
|
||||
|
||||
|
||||
putdic.Add("SSX-021-007", new string[] { "东面提升机输送线", "出库输送线7入箱完毕", "true" });
|
||||
putdic.Add("SSX-011-006", new string[] { "YTCS", "EmptyIn_CS06Done", "true" });
|
||||
putdic.Add("SSX-021-003", new string[] { "YTCS", "AgvFullIn_CS03Done", "true" });
|
||||
putdic.Add("SSX-021-001", new string[] { "YTCS", "CtuEmptyIn_CS01Done", "true" });
|
||||
putdic.Add("ZSSSXCTU02", new string[] { "YTCS", "右输送线下层允许入箱4", "true" });
|
||||
putdic.Add("ZSSSXCTU01", new string[] { "YTCS", "左输送线下层允许入箱2", "true" });
|
||||
putdic.Add("SSX-121-009", new string[] { "东面提升机输送线", "上升降机9入箱完毕", "true" });
|
||||
putdic.Add("SSX-121-010", new string[] { "东面提升机输送线", "上升降机10入箱完毕", "true" });
|
||||
putdic.Add("YCLCKBGW", new string[] { "CP8", "PutDoneEmptyBox", "true" });
|
||||
putdic.Add("ZS-C01-1", new string[] { "hxjC", "A2AGV允许出空箱", "true" });
|
||||
putdic.Add("ZS-C02-1", new string[] { "hxjC", "A3AGV允许出空箱", "true" });
|
||||
putdic.Add("ZS-C03-1", new string[] { "hxjC", "A4AGV允许出空箱", "true" });
|
||||
putdic.Add("ZS-C04-1", new string[] { "hxjC", "A5AGV允许出空箱", "true" });
|
||||
putdic.Add("ZS-C05-1", new string[] { "hxjC", "A6AGV允许出空箱", "true" });
|
||||
putdic.Add("ZS-C06-1", new string[] { "hxjC", "A7AGV允许出空箱", "true" });
|
||||
putdic.Add("ZS-C07-1", new string[] { "hxjC", "A8AGV允许出空箱", "true" });
|
||||
putdic.Add("ZS-C08-1", new string[] { "hxjC", "A9AGV允许出空箱", "true" });
|
||||
putdic.Add("ZS-C09-1", new string[] { "hxjC", "A10AGV允许出空箱", "true" });
|
||||
putdic.Add("ZS-C10-1", new string[] { "hxjC", "A11AGV允许出空箱", "true" });
|
||||
putdic.Add("ZS-C11-1", new string[] { "hxjC", "A12AGV允许出空箱", "true" });
|
||||
putdic.Add("ZS-C12-1", new string[] { "hxjC", "A13AGV允许出空箱", "true" });
|
||||
putdic.Add("ZS-C13-1", new string[] { "hxjC", "A14AGV允许出空箱", "true" });
|
||||
putdic.Add("ZS-C14-1", new string[] { "hxjC", "A1AGV允许出空箱", "true" });
|
||||
|
||||
putdic.Add("ZS-A01-1", new string[] { "hxjA", "A3AGV允许出空箱", "true" });
|
||||
putdic.Add("ZS-A02-1", new string[] { "hxjA", "A4AGV允许出空箱", "true" });
|
||||
putdic.Add("ZS-A03-1", new string[] { "hxjA", "A5AGV允许出空箱", "true" });
|
||||
putdic.Add("ZS-D06-1", new string[] { "hxjA", "A6AGV允许出空箱", "false" });
|
||||
putdic.Add("ZS-A05-1", new string[] { "hxjA", "A7AGV允许出空箱", "true" });
|
||||
putdic.Add("ZS-A06-1", new string[] { "hxjA", "A8AGV允许出空箱", "true" });
|
||||
putdic.Add("ZS-A07-1", new string[] { "hxjA", "A9AGV允许出空箱", "true" });
|
||||
putdic.Add("ZS-A08-1", new string[] { "hxjA", "A10AGV允许出空箱", "true" });
|
||||
putdic.Add("ZS-A09-1", new string[] { "hxjA", "A11AGV允许出空箱", "true" });
|
||||
putdic.Add("ZS-A10-1", new string[] { "hxjA", "A12AGV允许出空箱", "true" });
|
||||
putdic.Add("ZS-A11-1", new string[] { "hxjA", "A13AGV允许出空箱", "false" });
|
||||
putdic.Add("ZS-A12-1", new string[] { "hxjA", "A14AGV允许出空箱", "true" });
|
||||
|
||||
if (action == "LOAD")//取货
|
||||
{
|
||||
if (getdic.Keys.Contains(disTask.startlocation_code))
|
||||
{
|
||||
var strarr = getdic.Where(p => p.Key == disTask.startlocation_code).First().Value;
|
||||
Dictionary<string, string> dicCommand = new(StringComparer.OrdinalIgnoreCase)
|
||||
{
|
||||
["DevName"] = strarr[0],
|
||||
["token"] = _eleCtlCfg.token,
|
||||
["TagName"] = strarr[1],
|
||||
["Value"] = strarr[2],
|
||||
};
|
||||
Logger.Information($"SsxControlLOAD:{JsonConvert.SerializeObject(dicCommand)}");
|
||||
var str = await HttpClientHelper.GetRequestAsync(_eleCtlCfg.WriteTagUrl, dicCommand);
|
||||
Logger.Information($"SsxControlLOAD:{str}");
|
||||
//Logger.Information($"SsxControlUNLOAD - 控制后查询:{_redisData.GetHash(strarr[0], strarr[1]).Result}");
|
||||
}
|
||||
}
|
||||
else if (action == "UNLOAD")//放货
|
||||
{
|
||||
if (putdic.Keys.Contains(disTask.endlocation_code))
|
||||
{
|
||||
var strarr = putdic.Where(p => p.Key == disTask.endlocation_code).First().Value;
|
||||
Dictionary<string, string> dicCommand = new(StringComparer.OrdinalIgnoreCase)
|
||||
{
|
||||
["DevName"] = strarr[0],
|
||||
["token"] = _eleCtlCfg.token,
|
||||
["TagName"] = strarr[1],
|
||||
["Value"] = strarr[2],
|
||||
};
|
||||
Logger.Information($"SsxControlUNLOAD:{JsonConvert.SerializeObject(dicCommand)}");
|
||||
var str = await HttpClientHelper.GetRequestAsync(_eleCtlCfg.WriteTagUrl, dicCommand);
|
||||
Logger.Information($"SsxControlUNLOAD:{str}");
|
||||
//Logger.Information($"SsxControlUNLOAD - 控制后查询:{_redisData.GetHash(strarr[0], strarr[1]).Result}");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 二楼机械臂
|
||||
/// </summary>
|
||||
@@ -1480,6 +1627,35 @@ namespace Tnb.WarehouseMgr
|
||||
agvElevatorTasks = agvElevatorTasks.Where(x => !equalEndLocPreTasks.Contains(x.endlocation_code)).ToList();
|
||||
}
|
||||
|
||||
#region 原材料仓同巷道任务出库控制同时只发一条
|
||||
// 原材料仓的未完成任务
|
||||
List<WmsPretaskH> wmspretasks_ycl = await db.Queryable<WmsPretaskH>()
|
||||
.InnerJoin<BasLocation>((a, b) => a.endlocation_id == b.id)
|
||||
.InnerJoin<WmsAreaH>((a, b, c) => a.area_id == c.id)
|
||||
.InnerJoin<BasLocation>((a, b, c, d) => a.startlocation_id == d.id)
|
||||
.Where((a, b, c, d) => a.status != WmsWareHouseConst.PRETASK_BILL_STATUS_COMPLE_ID && a.status != WmsWareHouseConst.PRETASK_BILL_STATUS_CANCEL_ID
|
||||
&& b.is_use == "0" && d.is_type == "0" && b.wh_id == WmsWareHouseConst.WAREHOUSE_YCL_ID)
|
||||
.Select((a, b, c, d) => new WmsPretaskH
|
||||
{
|
||||
move_num = c.move_num,
|
||||
third_eqp_type = c.third_eqp_type,
|
||||
passage = d.passage
|
||||
}, true)
|
||||
.ToListAsync();
|
||||
// 原材料仓的执行中任务
|
||||
List<WmsPretaskH> wmspretasksrun_ycl = wmspretasks_ycl.Where(r => r.status == WmsWareHouseConst.PRETASK_BILL_STATUS_YXF_ID || r.status == WmsWareHouseConst.PRETASK_BILL_STATUS_START_ID).ToList();
|
||||
|
||||
// 过滤normalPreTasks中的原材料仓的任务
|
||||
normalPreTasks = normalPreTasks.Where(r => !wmspretasks_ycl.Select(a => a.id).Contains(r.id)).ToList();
|
||||
// 过滤原材料仓同巷道的正在执行的任务
|
||||
var yclTasks = wmspretasks_ycl.Where(r => !wmspretasksrun_ycl.Select(a => a.passage).Contains(r.passage)).ToList();
|
||||
// 过滤重复巷道的预任务
|
||||
yclTasks = yclTasks.OrderBy(r => r.passage).GroupBy(r => r.passage).Select(r => { return r.ToList()[0]; }).OrderBy(r => r.bill_code).ToList();
|
||||
|
||||
normalPreTasks = normalPreTasks.Concat(yclTasks).ToList();
|
||||
#endregion
|
||||
|
||||
|
||||
#region 三楼三四号梯如果与判断一托下有冲突
|
||||
|
||||
#region 电梯第三次改动
|
||||
@@ -1507,7 +1683,7 @@ namespace Tnb.WarehouseMgr
|
||||
// 过滤到三楼暂存区同目标库位的正在执行的任务
|
||||
var cacheLocTasks = wmspretasks_agvElevator.Where(r => !wmsdistasks_agvElevator.Select(a => a.endlocation_id).Contains(r.endlocation_id)).ToList();
|
||||
// 过滤重复目标库位的预任务
|
||||
cacheLocTasks = cacheLocTasks.OrderBy(r => r.endlocation_code).GroupBy(r => r.endlocation_code).Select(r => { return r.ToList()[0]; }).ToList();
|
||||
cacheLocTasks = cacheLocTasks.OrderBy(r => r.endlocation_code).GroupBy(r => r.endlocation_code).Select(r => { return r.ToList()[0]; }).OrderBy(r => r.bill_code).ToList();
|
||||
|
||||
normalPreTasks = normalPreTasks.Concat(cacheLocTasks).ToList();
|
||||
#endregion
|
||||
@@ -4085,8 +4261,7 @@ namespace Tnb.WarehouseMgr
|
||||
code_batch = input.code_batch,
|
||||
Size = 100,
|
||||
Region_id = WmsWareHouseConst.REGION_Purchase_ID,
|
||||
PolicyCode = WmsWareHouseConst.POLICY_YCLOUTSTOCK,
|
||||
AvoidBusyPassage = true
|
||||
PolicyCode = WmsWareHouseConst.POLICY_YCLOUTSTOCK
|
||||
};
|
||||
|
||||
List<WmsCarryH> items = await OutStockStrategy(outStockStrategyInput);
|
||||
|
||||
@@ -200,7 +200,10 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
decimal? sum = input.details.Where(r => group.Select(r => r.barcode).Contains(r.barcode)).Select(r => r.codeqty).Sum();
|
||||
WmsPurchaseD wmsPurchaseD = await _db.Queryable<WmsPurchaseD>().Where(r => r.id == group.Key.require_id).FirstAsync();
|
||||
|
||||
if (wmsPurchaseD == null)
|
||||
{
|
||||
throw new Exception($"条码{string.Join(',', input.details.Select(r => r.barcode))}来源采购收货明细不存在!");
|
||||
}
|
||||
// 收货质检之后不能绑定
|
||||
if (!string.IsNullOrEmpty(wmsPurchaseD.qc_res))
|
||||
{
|
||||
@@ -221,6 +224,10 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
decimal? sum = input.details.Where(r => group.Select(r => r.barcode).Contains(r.barcode)).Select(r => r.codeqty).Sum();
|
||||
WmsOutsourceD wmsOutsourceD = await _db.Queryable<WmsOutsourceD>().Where(r => r.id == group.Key.require_id).FirstAsync();
|
||||
if (wmsOutsourceD == null)
|
||||
{
|
||||
throw new Exception($"条码{string.Join(',', input.details.Select(r => r.barcode))}来源委外收货明细不存在!");
|
||||
}
|
||||
decimal? bind_qty = wmsOutsourceD.bind_qty ?? 0;
|
||||
if (sum + bind_qty > wmsOutsourceD.outsource_quantity)
|
||||
{
|
||||
@@ -234,6 +241,10 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
decimal? sum = input.details.Where(r => group.Select(r => r.barcode).Contains(r.barcode)).Select(r => r.codeqty).Sum();
|
||||
WmsRawmatTransferinstockD wmsRawmatTransferinstockD = await _db.Queryable<WmsRawmatTransferinstockD>().Where(r => r.id == group.Key.require_id).FirstAsync();
|
||||
if (wmsRawmatTransferinstockD == null)
|
||||
{
|
||||
throw new Exception($"条码{string.Join(',', input.details.Select(r => r.barcode))}来源原材料调拨入库明细不存在!");
|
||||
}
|
||||
decimal? bind_qty = wmsRawmatTransferinstockD.bind_qty ?? 0;
|
||||
|
||||
if (sum + bind_qty > wmsRawmatTransferinstockD.qty)
|
||||
@@ -339,7 +350,6 @@ namespace Tnb.WarehouseMgr
|
||||
throw new Exception($"以下条码已被绑定:{string.Join(',', repeat_wmsCarryCodes.Select(r => r.barcode))}");
|
||||
}
|
||||
|
||||
|
||||
List<WmsCarryCode> WmsCarryCodes = new List<WmsCarryCode>();
|
||||
|
||||
WmsCarrybindH wmsCarrybindH = new WmsCarrybindH();
|
||||
|
||||
@@ -71,8 +71,8 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
warehouse_name = c.whname,
|
||||
carry_id = b.id,
|
||||
carry_code = string.IsNullOrEmpty(b.carry_code) ? "空托盘堆垛" : b.carry_code,
|
||||
carry_name = string.IsNullOrEmpty(b.carry_code) ? "空托盘堆垛" : b.carry_name,
|
||||
carry_code = a.is_use == "1" && string.IsNullOrEmpty(b.carry_code) ? "空托盘堆垛" : b.carry_code,
|
||||
carry_name = a.is_use == "1" && string.IsNullOrEmpty(b.carry_code) ? "空托盘堆垛" : b.carry_name,
|
||||
carry_status = b.is_lock == 1 ? "锁定" : "未锁定",
|
||||
carry_type = d.carrystd_name,
|
||||
location_code = a.location_code,
|
||||
@@ -146,7 +146,7 @@ namespace Tnb.WarehouseMgr
|
||||
|
||||
if (report.carry_code != "空托盘堆垛")
|
||||
{
|
||||
List<WmsCarryStockReport> curCarryCodes = items.FindAll(x => x.carry_id == itGroup.Key.carry_id);
|
||||
List<WmsCarryStockReport> curCarryCodes = items.FindAll(x => !string.IsNullOrEmpty(x.carry_id) && x.carry_id == itGroup.Key.carry_id);
|
||||
|
||||
List<WmsCarryStockReportCode> wmsCarryStockReportCodes = new List<WmsCarryStockReportCode>();
|
||||
int index = 0;
|
||||
@@ -230,8 +230,8 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
warehouse_name = c.whname,
|
||||
carry_id = b.id,
|
||||
carry_code = string.IsNullOrEmpty(b.carry_code) ? "空托盘堆垛" : b.carry_code,
|
||||
carry_name = string.IsNullOrEmpty(b.carry_code) ? "空托盘堆垛" : b.carry_name,
|
||||
carry_code = a.is_use == "1" && string.IsNullOrEmpty(b.carry_code) ? "空托盘堆垛" : b.carry_code,
|
||||
carry_name = a.is_use == "1" && string.IsNullOrEmpty(b.carry_code) ? "空托盘堆垛" : b.carry_name,
|
||||
carry_status = b.is_lock == 1 ? "锁定" : "未锁定",
|
||||
carry_type = d.carrystd_name,
|
||||
location_code = a.location_code,
|
||||
|
||||
@@ -68,7 +68,8 @@ namespace Tnb.WarehouseMgr
|
||||
SemaphoreSlim semaphoreSlim = null;
|
||||
try
|
||||
{
|
||||
semaphoreSlim = _wareHouseService.GetSemaphore("outstock", input.data[nameof(OutStockStrategyQuery.warehouse_id)].ToString());
|
||||
string warehouse_id = input.data[nameof(OutStockStrategyQuery.warehouse_id)].ToString();
|
||||
semaphoreSlim = _wareHouseService.GetSemaphore("outstock", warehouse_id);
|
||||
await semaphoreSlim.WaitAsync();
|
||||
await _db.Ado.BeginTranAsync();
|
||||
|
||||
@@ -83,9 +84,10 @@ namespace Tnb.WarehouseMgr
|
||||
OutStockStrategyQuery OutStockStrategyInput = new()
|
||||
{
|
||||
carrystd_id = input.data[nameof(OutStockStrategyQuery.carrystd_id)].ToString(),
|
||||
warehouse_id = input.data[nameof(OutStockStrategyQuery.warehouse_id)].ToString(),
|
||||
warehouse_id = warehouse_id,
|
||||
Size = qty
|
||||
};
|
||||
|
||||
List<WmsCarryH>? carrys = await _wareHouseService.OutStockStrategy(OutStockStrategyInput);
|
||||
Logger.Information($"根据出库策略获取的载具数量:{carrys?.Count}");
|
||||
//var carrys = await _db.Queryable<WmsCarryH>().LeftJoin<BasLocation>((a, b) => a.location_id == b.id)
|
||||
@@ -253,7 +255,8 @@ namespace Tnb.WarehouseMgr
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.Information($"空载具出库错误", ex);
|
||||
Logger.Information($"空载具出库错误", ex.Message);
|
||||
Logger.Information($"空载具出库错误", ex.StackTrace);
|
||||
await _db.Ado.RollbackTranAsync();
|
||||
throw;
|
||||
}
|
||||
|
||||
@@ -179,57 +179,113 @@ namespace Tnb.WarehouseMgr
|
||||
List<WmsCarryCode> _wmsCarryCodes = _db.Queryable<WmsCarryCode>().Where(r => r.carry_id == wmsCarryH.id).ToList();
|
||||
await _db.Updateable<WmsCarryH>().SetColumns(r => r.carry_status == (_wmsCarryCodes.Count == 0 ? "0" : r.carry_status)).Where(r => r.id == wmsCarryH.id).ExecuteCommandAsync();
|
||||
|
||||
switch (carryLoc.wh_id)
|
||||
await _db.Updateable(wmsCarryCodes).ExecuteCommandAsync();
|
||||
|
||||
wmsMaterialSignH.warehouse_sign_id = carryLoc.wh_id;
|
||||
|
||||
if (_wmsCarryCodes.Count > 0)
|
||||
{
|
||||
case WmsWareHouseConst.WAREHOUSE_YCL_ID:
|
||||
{
|
||||
|
||||
await _db.Updateable(wmsCarryCodes).ExecuteCommandAsync();
|
||||
|
||||
await _wareHouseService.s_taskExecuteSemaphore_YCLInstock.WaitAsync();
|
||||
wmsMaterialSignH.warehouse_sign_id = WmsWareHouseConst.WAREHOUSE_YCL_ID;
|
||||
wmsMaterialSignH.warehouse_instock_id = WmsWareHouseConst.WAREHOUSE_YCL_ID;
|
||||
try
|
||||
switch (carryLoc.wh_id)
|
||||
{
|
||||
case WmsWareHouseConst.WAREHOUSE_YCL_ID:
|
||||
{
|
||||
InStockStrategyQuery inStockStrategyInput = new() { warehouse_id = "1", Size = 1, AvoidBusyPassage = true, Region_id = WmsWareHouseConst.REGION_YCLCache_ID };
|
||||
List<BasLocation> endLocations = await _wareHouseService.InStockStrategy(inStockStrategyInput);
|
||||
if (endLocations.Count == 0)
|
||||
try
|
||||
{
|
||||
throw new AppFriendlyException("没有可以回库的库位", 500);
|
||||
await _wareHouseService.s_taskExecuteSemaphore_YCLInstock.WaitAsync();
|
||||
wmsMaterialSignH.warehouse_instock_id = WmsWareHouseConst.WAREHOUSE_YCL_ID;
|
||||
InStockStrategyQuery inStockStrategyInput = new() { warehouse_id = "1", Size = 1, AvoidBusyPassage = true, Region_id = WmsWareHouseConst.REGION_YCLCache_ID };
|
||||
List<BasLocation> endLocations = await _wareHouseService.InStockStrategy(inStockStrategyInput);
|
||||
if (endLocations.Count == 0)
|
||||
{
|
||||
throw new AppFriendlyException("没有可以回库的库位", 500);
|
||||
}
|
||||
CommonCreatePretaskInput commonCreatePretaskInput = new CommonCreatePretaskInput();
|
||||
commonCreatePretaskInput.startlocation_id = carryLoc.id;
|
||||
commonCreatePretaskInput.endlocation_id = endLocations[0].id;
|
||||
commonCreatePretaskInput.carry_id = wmsCarryH.id;
|
||||
commonCreatePretaskInput.carry_code = wmsCarryH.carry_code;
|
||||
commonCreatePretaskInput.task_type = WmsWareHouseConst.WMS_PRETASK_INSTOCK_TYPE_ID;
|
||||
commonCreatePretaskInput.biz_type = WmsWareHouseConst.BIZTYPE_WmsMaterialSign_ID;
|
||||
|
||||
Logger.LogInformation($"【MaterialSign】 开始生成原材料仓回库任务 起点{carryLoc.location_code} 终点{endLocations[0].location_code} 托盘 {wmsCarryH.carry_code}");
|
||||
|
||||
Entities.Dto.Outputs.Result res = await _wareHouseService.CommonCreatePretask(commonCreatePretaskInput, _db);
|
||||
if (res.code != HttpStatusCode.OK)
|
||||
{
|
||||
throw new AppFriendlyException(res.msg, 500);
|
||||
}
|
||||
}
|
||||
CommonCreatePretaskInput commonCreatePretaskInput = new CommonCreatePretaskInput();
|
||||
commonCreatePretaskInput.startlocation_id = carryLoc.id;
|
||||
commonCreatePretaskInput.endlocation_id = endLocations[0].id;
|
||||
commonCreatePretaskInput.carry_id = wmsCarryH.id;
|
||||
commonCreatePretaskInput.carry_code = wmsCarryH.carry_code;
|
||||
commonCreatePretaskInput.task_type = WmsWareHouseConst.WMS_PRETASK_INSTOCK_TYPE_ID;
|
||||
commonCreatePretaskInput.biz_type = WmsWareHouseConst.BIZTYPE_WmsMaterialSign_ID;
|
||||
|
||||
Logger.LogInformation($"【MaterialSign】 开始生成原材料仓回库任务 起点{carryLoc.location_code} 终点{endLocations[0].location_code} 托盘 {wmsCarryH.carry_code}");
|
||||
|
||||
Entities.Dto.Outputs.Result res = await _wareHouseService.CommonCreatePretask(commonCreatePretaskInput, _db);
|
||||
if (res.code != HttpStatusCode.OK)
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new AppFriendlyException(res.msg, 500);
|
||||
throw;
|
||||
}
|
||||
finally
|
||||
{
|
||||
_wareHouseService.s_taskExecuteSemaphore_YCLInstock.Release();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
finally
|
||||
{
|
||||
_wareHouseService.s_taskExecuteSemaphore_YCLInstock.Release();
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
await _db.Insertable(wmsMaterialSignH).ExecuteCommandAsync();
|
||||
await _db.Insertable(wmsMaterialSignDs).ExecuteCommandAsync();
|
||||
|
||||
#region 更新库存表
|
||||
|
||||
//switch (wmsDistaskH.biz_type)
|
||||
//{
|
||||
// // 原材料调拨出库
|
||||
// case WmsWareHouseConst.BIZTYPE_WmsRawmatTransferoutstock_ID:
|
||||
// {
|
||||
// //WmsRawmatTransferoutstockD wmsRawmatTransferoutstockD = await _db.Queryable<WmsRawmatTransferoutstockD>().Where(r => r.id == wmsDistaskH.source_id).FirstAsync();
|
||||
// //WmsRawmatTransferoutstockH wmsRawmatTransferoutstockH = await _db.Queryable<WmsRawmatTransferoutstockH>().Where(r => r.id == wmsRawmatTransferoutstockD.bill_id).FirstAsync();
|
||||
|
||||
// //WmsTransferOrderH wmsTransferOrderH = await _db.Queryable<WmsTransferOrderH>().Where(r => r.id == wmsRawmatTransferoutstockH.transfer_order_id).FirstAsync();
|
||||
|
||||
|
||||
// break;
|
||||
// }
|
||||
// case WmsWareHouseConst.BIZTYPE_WMSMATERIALTRANSFER_ID:
|
||||
// {
|
||||
// WmsMaterialTransferD wmsMaterialTransferD = await _db.Queryable<WmsMaterialTransferD>().Where(r => r.id == wmsDistaskH.source_id).FirstAsync();
|
||||
// WmsMaterialTransfer wmsMaterialTransfer = await _db.Queryable<WmsMaterialTransfer>().Where(r => r.id == wmsMaterialTransferD.bill_id).FirstAsync();
|
||||
|
||||
// List<WmsStockReportCode> wmsStockReportCodes = new List<WmsStockReportCode>();
|
||||
// foreach (var wmsMaterialSignD in wmsMaterialSignDs)
|
||||
// {
|
||||
// WmsStockReportCode wmsStockReportCode = new WmsStockReportCode();
|
||||
// wmsStockReportCode.material_id = wmsMaterialSignD.id;
|
||||
// wmsStockReportCode.material_code = wmsMaterialSignD.material_code;
|
||||
// wmsStockReportCode.barcode = wmsMaterialSignD.barcode;
|
||||
// wmsStockReportCode.code_batch = wmsMaterialSignD.code_batch;
|
||||
// wmsStockReportCode.codeqty = wmsMaterialSignD.qty - wmsMaterialSignD.sign_qty;
|
||||
// wmsStockReportCode.unit_id = wmsMaterialSignD.unit_id;
|
||||
// wmsStockReportCode.create_id = _userManager?.User?.Id;
|
||||
// wmsStockReportCode.create_time = DateTime.Now;
|
||||
// wmsStockReportCode.warehouse_id = wmsMaterialTransfer.warehouse_instock;
|
||||
// wmsStockReportCode.
|
||||
// wmsStockReportCodes.Add(wmsStockReportCode);
|
||||
// }
|
||||
|
||||
|
||||
// //// todo 对接其它出库单 出库数量为签收数量
|
||||
// //if (!_wareHouseService.GetFloor1WXSGWOutstockLocation().Contains(carryLoc.id))
|
||||
// //{
|
||||
// // // todo 对接其它入库单 入库数量为签收数量
|
||||
|
||||
// //}
|
||||
// break;
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 上传bip
|
||||
|
||||
switch (wmsDistaskH.biz_type)
|
||||
|
||||
@@ -227,8 +227,7 @@ namespace Tnb.WarehouseMgr
|
||||
code_batch = input.code_batch,
|
||||
Size = input.palletCount,
|
||||
Region_id = WmsWareHouseConst.REGION_Purchase_ID,
|
||||
PolicyCode = WmsWareHouseConst.POLICY_YCLOUTSTOCK,
|
||||
AvoidBusyPassage = true
|
||||
PolicyCode = WmsWareHouseConst.POLICY_YCLOUTSTOCK
|
||||
};
|
||||
|
||||
List<WmsCarryH> items = await _wareHouseService.OutStockStrategy(outStockStrategyInput);
|
||||
@@ -337,8 +336,7 @@ namespace Tnb.WarehouseMgr
|
||||
await _db.Ado.BeginTranAsync();
|
||||
|
||||
OutStockStrategyQuery outStockStrategyInput = new() { warehouse_id = WmsWareHouseConst.WAREHOUSE_YCL_ID, material_id = wmsMaterialTransferD.material_id,
|
||||
code_batch = input.code_batch, Size = input.palletCount,Region_id = WmsWareHouseConst.REGION_Purchase_ID,PolicyCode = WmsWareHouseConst.POLICY_YCLOUTSTOCK,
|
||||
AvoidBusyPassage = true};
|
||||
code_batch = input.code_batch, Size = input.palletCount,Region_id = WmsWareHouseConst.REGION_Purchase_ID,PolicyCode = WmsWareHouseConst.POLICY_YCLOUTSTOCK};
|
||||
List<WmsCarryH> items = await _wareHouseService.OutStockStrategy(outStockStrategyInput);
|
||||
|
||||
if (items.Count == 0)
|
||||
|
||||
@@ -226,8 +226,8 @@ namespace Tnb.WarehouseMgr
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error("PDA空载具出库错误", ex.Message);
|
||||
Log.Error("PDA空载具出库错误", ex.StackTrace);
|
||||
Logger.Error("PDA空载具出库错误", ex.Message);
|
||||
Logger.Error("PDA空载具出库错误", ex.StackTrace);
|
||||
await _db.Ado.RollbackTranAsync();
|
||||
throw;
|
||||
}
|
||||
|
||||
@@ -274,7 +274,6 @@ namespace Tnb.WarehouseMgr
|
||||
commonCreatePretaskInput2.task_type = WmsWareHouseConst.WMS_PRETASK_INSTOCK_TYPE_ID;
|
||||
commonCreatePretaskInput2.biz_type = WmsWareHouseConst.BIZTYPE_WMSPRDINSTOCK_ID;
|
||||
commonCreatePretaskInput2.require_id = wmsPrdInstockD.id;
|
||||
commonCreatePretaskInput2.isChangeCarryLoc2StartLoc = false;
|
||||
|
||||
Entities.Dto.Outputs.Result res2 = await _wareHouseService.CommonCreatePretask(commonCreatePretaskInput2, db);
|
||||
if (res2.code != HttpStatusCode.OK)
|
||||
|
||||
@@ -165,7 +165,7 @@ namespace Tnb.WarehouseMgr
|
||||
WmsSaleD wmsOutstockD = await _db.Queryable<WmsSaleD>().FirstAsync(it => it.id == input.source_id);
|
||||
await _db.Ado.BeginTranAsync();
|
||||
//入库取终点 //出库起点
|
||||
OutStockStrategyQuery outStockStrategyInput = new() { warehouse_id = WmsWareHouseConst.WAREHOUSE_CP_ID, material_id = wmsOutstockD.material_id, qty = input.qty, code_batch = wmsOutstockD.code_batch, Region_id = WmsWareHouseConst.REGION_CPOutstock_ID };
|
||||
OutStockStrategyQuery outStockStrategyInput = new() { warehouse_id = WmsWareHouseConst.WAREHOUSE_CP_ID, material_id = wmsOutstockD.material_id, qty = input.qty, code_batch = wmsOutstockD.code_batch, Region_id = WmsWareHouseConst.REGION_CPOutstock_ID, dbConn = _db };
|
||||
List<Tuple<string, WmsCarryH, WmsCarryCode, BasLocation>> items = await _wareHouseService.OutStockStrategy_saleRelease(outStockStrategyInput);
|
||||
|
||||
decimal canOutstockQty = items.Sum(r => r.Item3.codeqty).ParseToDecimal();
|
||||
@@ -200,7 +200,7 @@ namespace Tnb.WarehouseMgr
|
||||
//人工发货
|
||||
else
|
||||
{
|
||||
InStockStrategyQuery inStockStrategyInput = new() { warehouse_id = WmsWareHouseConst.WAREHOUSE_CP_ID, Size = items_pretask.Count, Region_id = WmsWareHouseConst.REGION_CPManualOutstock_ID };
|
||||
InStockStrategyQuery inStockStrategyInput = new() { warehouse_id = WmsWareHouseConst.WAREHOUSE_CP_ID, Size = items_pretask.Count, Region_id = WmsWareHouseConst.REGION_CPManualOutstock_ID, dbConn = _db };
|
||||
endLocations = await _wareHouseService.InStockStrategy(inStockStrategyInput);
|
||||
|
||||
if (endLocations.Count < items_pretask.Count)
|
||||
@@ -244,11 +244,15 @@ namespace Tnb.WarehouseMgr
|
||||
throw new AppFriendlyException($"载具{carry.carry_code}无法选到缓存区库位,请检查电梯缓存分区配置表", 500);
|
||||
}
|
||||
#endregion
|
||||
if (endLocation == null)
|
||||
{
|
||||
throw new AppFriendlyException("一楼没有足够的未锁定且空闲的出库工位", 500);
|
||||
}
|
||||
}
|
||||
//人工发货
|
||||
else
|
||||
{
|
||||
InStockStrategyQuery inStockStrategyInput = new() { warehouse_id = WmsWareHouseConst.WAREHOUSE_CP_ID, Size = 1, Region_id = WmsWareHouseConst.REGION_CPManualOutstock_ID };
|
||||
InStockStrategyQuery inStockStrategyInput = new() { warehouse_id = WmsWareHouseConst.WAREHOUSE_CP_ID, Size = 1, Region_id = WmsWareHouseConst.REGION_CPManualOutstock_ID, dbConn = _db };
|
||||
endLocations = await _wareHouseService.InStockStrategy(inStockStrategyInput);
|
||||
|
||||
if (endLocations.Count < 1)
|
||||
@@ -257,10 +261,6 @@ namespace Tnb.WarehouseMgr
|
||||
}
|
||||
endLocation = endLocations[0];
|
||||
}
|
||||
if (endLocation == null)
|
||||
{
|
||||
throw new AppFriendlyException("一楼没有足够的未锁定且空闲的出库工位", 500);
|
||||
}
|
||||
WmsPointH sPoint = null!;
|
||||
WmsPointH ePoint = null!;
|
||||
|
||||
@@ -366,8 +366,7 @@ namespace Tnb.WarehouseMgr
|
||||
|
||||
//所有库位加锁
|
||||
string?[] ids = new[] { startLocation.id, preTasks[0].endlocation_id, endLocationId };
|
||||
_ = await _db.Updateable<BasLocation>().SetColumns(it => new BasLocation { is_lock = 1 }).Where(it => ids.Contains(it.id)).ExecuteCommandAsync();
|
||||
|
||||
int row = await _db.Updateable<BasLocation>().SetColumns(it => new BasLocation { is_lock = 1 }).Where(it => ids.Contains(it.id)).ExecuteCommandAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ namespace Tnb.WarehouseMgr
|
||||
WmsTransferOutstockD wmsOutstockD = await _db.Queryable<WmsTransferOutstockD>().FirstAsync(it => it.id == input.source_id);
|
||||
await _db.Ado.BeginTranAsync();
|
||||
//入库取终点 //出库起点
|
||||
OutStockStrategyQuery outStockStrategyInput = new() { warehouse_id = WmsWareHouseConst.WAREHOUSE_CP_ID, material_id = wmsOutstockD.material_id, qty = input.qty, code_batch = wmsOutstockD.pi_code, Region_id = WmsWareHouseConst.REGION_CPOutstock_ID };
|
||||
OutStockStrategyQuery outStockStrategyInput = new() { warehouse_id = WmsWareHouseConst.WAREHOUSE_CP_ID, material_id = wmsOutstockD.material_id, qty = input.qty, code_batch = wmsOutstockD.pi_code, Region_id = WmsWareHouseConst.REGION_CPOutstock_ID, dbConn = _db };
|
||||
List<Tuple<string, WmsCarryH, WmsCarryCode, BasLocation>> items = await _wareHouseService.OutStockStrategy_saleRelease(outStockStrategyInput);
|
||||
|
||||
decimal canOutstockQty = items.Sum(r => r.Item3.codeqty).ParseToDecimal();
|
||||
|
||||
Reference in New Issue
Block a user