增加载具绑定条码表
This commit is contained in:
@@ -65,8 +65,8 @@ namespace Tnb.WarehouseMgr
|
|||||||
if (input == null) throw new ArgumentNullException(nameof(input));
|
if (input == null) throw new ArgumentNullException(nameof(input));
|
||||||
var carryId = input.data.ContainsKey("carry_id") ? input.data["carry_id"]?.ToString() : "";
|
var carryId = input.data.ContainsKey("carry_id") ? input.data["carry_id"]?.ToString() : "";
|
||||||
var subCarryId = input.data.ContainsKey("newcarry_id") ? input.data["newcarry_id"]?.ToString() : "";
|
var subCarryId = input.data.ContainsKey("newcarry_id") ? input.data["newcarry_id"]?.ToString() : "";
|
||||||
var carry = await _db.Queryable<WmsCarryH>().FirstAsync(it => it.id == carryId);
|
var carry = await _db.Queryable<WmsCarryH>().SingleAsync(it => it.id == carryId);
|
||||||
var subCarry = await _db.Queryable<WmsCarryH>().FirstAsync(it => it.id == subCarryId);
|
var subCarry = await _db.Queryable<WmsCarryH>().SingleAsync(it => it.id == subCarryId);
|
||||||
WmsCarrybindH wmsCarrybindH = carry.Adapt<WmsCarrybindH>();
|
WmsCarrybindH wmsCarrybindH = carry.Adapt<WmsCarrybindH>();
|
||||||
if (carry != null && subCarry != null)
|
if (carry != null && subCarry != null)
|
||||||
{
|
{
|
||||||
@@ -83,9 +83,28 @@ namespace Tnb.WarehouseMgr
|
|||||||
row = await _db.Updateable(carry).ExecuteCommandAsync();
|
row = await _db.Updateable(carry).ExecuteCommandAsync();
|
||||||
subCarry.carry_status = "1";
|
subCarry.carry_status = "1";
|
||||||
row = await _db.Updateable(subCarry).ExecuteCommandAsync();
|
row = await _db.Updateable(subCarry).ExecuteCommandAsync();
|
||||||
|
var items = await _db.Queryable<WmsCarryCode>().Where(it => it.carry_id == subCarryId).ToListAsync();
|
||||||
|
for (int i = 0; i < items.Count; i++)
|
||||||
|
{
|
||||||
|
WmsCarrybindCode wmsCarrybindCode = new();
|
||||||
|
wmsCarrybindCode.id = SnowflakeIdHelper.NextId();
|
||||||
|
wmsCarrybindCode.org_id = subCarry.id;
|
||||||
|
wmsCarrybindCode.carrybind_id = wmsCarrybindH.id;
|
||||||
|
wmsCarrybindCode.material_id = items[i].material_id;
|
||||||
|
wmsCarrybindCode.material_code = items[i].material_code;
|
||||||
|
wmsCarrybindCode.barcode = items[i].barcode;
|
||||||
|
wmsCarrybindCode.code_batch = items[i].code_batch;
|
||||||
|
wmsCarrybindCode.codeqty = items[i].codeqty;
|
||||||
|
wmsCarrybindCode.membercarry_id = subCarry.id;
|
||||||
|
wmsCarrybindCode.membercarry_code = subCarry.carry_code;
|
||||||
|
wmsCarrybindCode.unit_id = items[i].unit_id;
|
||||||
|
wmsCarrybindCode.unit_code = items[i].unit_code;
|
||||||
|
wmsCarrybindCode.create_id = _userManager.UserId;
|
||||||
|
wmsCarrybindCode.create_time = DateTime.Now;
|
||||||
|
row = await _db.Insertable(wmsCarrybindCode).ExecuteCommandAsync();
|
||||||
|
}
|
||||||
isOk = (row > 0);
|
isOk = (row > 0);
|
||||||
if (!isOk) throw Oops.Oh(ErrorCode.COM1001);
|
if (!isOk) throw Oops.Oh(ErrorCode.COM1001);
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ namespace Tnb.WarehouseMgr
|
|||||||
ePoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == input.data[nameof(WmsPointH.location_id)].ToString());
|
ePoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == input.data[nameof(WmsPointH.location_id)].ToString());
|
||||||
}
|
}
|
||||||
int i = 0;
|
int i = 0;
|
||||||
var isOk = false;
|
|
||||||
|
|
||||||
//根据每个载具的起始库位做路径运算
|
//根据每个载具的起始库位做路径运算
|
||||||
for (i = 0; i < setQty.qty; i++)
|
for (i = 0; i < setQty.qty; i++)
|
||||||
@@ -95,7 +95,7 @@ namespace Tnb.WarehouseMgr
|
|||||||
|
|
||||||
if (carrys?.Count > 0)
|
if (carrys?.Count > 0)
|
||||||
sPoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == carrys[i].location_id);
|
sPoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == carrys[i].location_id);
|
||||||
|
var isOk = false;
|
||||||
if (sPoint != null && ePoint != null)
|
if (sPoint != null && ePoint != null)
|
||||||
{
|
{
|
||||||
var points = await _wareHouseService.PathAlgorithms(sPoint.id, ePoint.id);
|
var points = await _wareHouseService.PathAlgorithms(sPoint.id, ePoint.id);
|
||||||
|
|||||||
Reference in New Issue
Block a user