PDA投料修改

This commit is contained in:
FanLian
2023-06-27 10:22:46 +08:00
parent 2456fd8017
commit 614424b55f
2 changed files with 5 additions and 30 deletions

View File

@@ -94,9 +94,4 @@ public partial class WmsFeedingrecordCode : BaseEntity<string>
/// </summary>
public DateTime? modify_time { get; set; }
/// <summary>
/// 行号
/// </summary>
public int no { get; set; }
}

View File

@@ -61,7 +61,8 @@ namespace Tnb.WarehouseMgr
/// </param>
/// <returns></returns>
/// <exception cref="ArgumentNullException"></exception>
private async Task<dynamic> WmsPDAFeedingRecord(VisualDevModelDataCrInput input)
[HttpPost]
public async Task<dynamic> WmsPDAFeedingRecord(VisualDevModelDataCrInput input)
{
@@ -79,7 +80,7 @@ namespace Tnb.WarehouseMgr
var feedBox = await _db.Queryable<WmsFeedbox>().SingleAsync(it => it.feedbox_code == feedBoxCode);
var carryMaterial = await _db.Queryable<WmsCarryMat>().FirstAsync(it => it.carry_id == carryId);
var carryCodes = await _db.Queryable<WmsCarryCode>().Where(it => it.carry_id == carryId).ToListAsync();
if (carry != null && feedBox != null)
if (carryMaterial != null && feedBox != null && carry != null)
{
//更新投料箱
feedBox.material_id = carryMaterial.material_id;
@@ -97,27 +98,6 @@ namespace Tnb.WarehouseMgr
it.modify_id,
it.modify_time
}).ExecuteCommandAsync();
//更新投料记录条码表
if (carryCodes != null)
{
foreach (var carryCode in carryCodes)
{
WmsFeedingrecordCode wmsFeedingrecordCode = new();
wmsFeedingrecordCode.id = SnowflakeIdHelper.NextId();
wmsFeedingrecordCode.org_id = _userManager.User.OrganizeId;
wmsFeedingrecordCode.record_id = input.data["ReturnIdentity"]?.ToString()!;
wmsFeedingrecordCode.material_id = carryCode.material_id;
wmsFeedingrecordCode.material_code = carryCode.material_code;
wmsFeedingrecordCode.barcode = carryCode.barcode;
wmsFeedingrecordCode.code_batch = carryCode.code_batch;
wmsFeedingrecordCode.codeqty = carryCode.codeqty;
wmsFeedingrecordCode.unit_id = carryCode.unit_id;
wmsFeedingrecordCode.unit_code = carryCode.unit_code;
wmsFeedingrecordCode.create_id = _userManager.UserId;
wmsFeedingrecordCode.create_time = DateTime.Now;
row = await _db.Insertable(wmsFeedingrecordCode).ExecuteCommandAsync();
}
}
//更新载具
row = await UpdateNullCarry(carry);
isOk = (row > 0);
@@ -125,7 +105,7 @@ namespace Tnb.WarehouseMgr
}
else
{
if (carry == null)
if (carryMaterial == null)
{
throw new AppFriendlyException("没有可用的载具", 500);
}
@@ -139,7 +119,7 @@ namespace Tnb.WarehouseMgr
}
catch (Exception ex)
{
Log.Error("载具更换失败", ex);
Log.Error("投料失败", ex);
await _db.Ado.RollbackTranAsync();
throw;
}