采购入库代码部分重写,回传bip调整,采购订单接收调整、小件移库到三层货架
This commit is contained in:
@@ -121,71 +121,85 @@ namespace Tnb.WarehouseMgr
|
||||
create_time = DateTime.Now,
|
||||
};
|
||||
var instockDs = new List<WmsInstockD>();
|
||||
WmsInstockD? instockD = null;
|
||||
if (mat != null)
|
||||
{
|
||||
instockD = new()
|
||||
{
|
||||
id = SnowflakeIdHelper.NextId(),
|
||||
bill_id = instock.id,
|
||||
line_status = WmsWareHouseConst.BILLSTATUS_ADD_ID,
|
||||
material_id = mat.id,
|
||||
material_code = mat.code,
|
||||
unit_id = mat.unit_id,
|
||||
pr_qty = item.codeqty,
|
||||
qty = 0,
|
||||
code_batch = item.code_batch,
|
||||
material_specification = item.material_specification,
|
||||
container_no = item.container_no,
|
||||
warehouse_id = WmsWareHouseConst.WAREHOUSE_CP_ID,
|
||||
print_qty = item.codeqty,
|
||||
scan_qty = item.codeqty,
|
||||
print_id = "",
|
||||
create_id = _userManager.UserId,
|
||||
create_time = DateTime.Now,
|
||||
};
|
||||
instockDs.Add(instockD);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (input.data.ContainsKey("details"))
|
||||
{
|
||||
instockDs = input.data["details"].Adapt<List<WmsInstockD>>();
|
||||
var instockCodes = new List<WmsInstockCode>();
|
||||
|
||||
List<WmsCarryCode> wmsCarryCodes = await _db.Queryable<WmsCarryCode>().Where(r => r.carry_id == carry.id).ToListAsync();
|
||||
|
||||
wmsCarryCodes.GroupBy(g => new { g.material_id, g.code_batch }).Select(
|
||||
r =>
|
||||
{
|
||||
var list = r.ToList();
|
||||
decimal qty = list.Sum(x=>x.codeqty);
|
||||
|
||||
WmsInstockD? instockD = null;
|
||||
if (mat != null)
|
||||
{
|
||||
instockD = new()
|
||||
{
|
||||
id = SnowflakeIdHelper.NextId(),
|
||||
bill_id = instock.id,
|
||||
line_status = WmsWareHouseConst.BILLSTATUS_ADD_ID,
|
||||
material_id = mat.id,
|
||||
material_code = mat.code,
|
||||
unit_id = mat.unit_id,
|
||||
pr_qty = qty,
|
||||
qty = 0,
|
||||
code_batch = r.Key.code_batch,
|
||||
material_specification = item.material_specification,
|
||||
container_no = item.container_no,
|
||||
warehouse_id = WmsWareHouseConst.WAREHOUSE_CP_ID,
|
||||
print_qty = qty,
|
||||
scan_qty = qty,
|
||||
print_id = "",
|
||||
create_id = _userManager.UserId,
|
||||
create_time = DateTime.Now,
|
||||
};
|
||||
instockDs.Add(instockD);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (input.data.ContainsKey("details"))
|
||||
{
|
||||
instockDs = input.data["details"].Adapt<List<WmsInstockD>>();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var row in list)
|
||||
{
|
||||
WmsInstockCode? instockCode = null;
|
||||
if (mat != null)
|
||||
{
|
||||
instockCode = new()
|
||||
{
|
||||
id = SnowflakeIdHelper.NextId(),
|
||||
bill_id = instock.id,
|
||||
bill_d_id = instockD?.id ?? string.Empty,
|
||||
line_status = WmsWareHouseConst.BILLSTATUS_ADD_ID,
|
||||
material_id = mat.id,
|
||||
material_code = mat.code,
|
||||
unit_id = mat.unit_id,
|
||||
barcode = row.barcode,
|
||||
code_batch = row.code_batch,
|
||||
material_specification = item.material_specification,
|
||||
container_no = item.container_no,
|
||||
codeqty = row.codeqty,
|
||||
is_lock = 0,
|
||||
is_end = 0,
|
||||
create_id = _userManager.UserId,
|
||||
create_time = DateTime.Now,
|
||||
};
|
||||
instockCodes.Add(instockCode);
|
||||
}
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
WmsInstockCode? instockCode = null;
|
||||
if (mat != null)
|
||||
{
|
||||
instockCode = new()
|
||||
{
|
||||
id = SnowflakeIdHelper.NextId(),
|
||||
bill_id = instock.id,
|
||||
bill_d_id = instockD?.id ?? string.Empty,
|
||||
line_status = WmsWareHouseConst.BILLSTATUS_ADD_ID,
|
||||
material_id = mat.id,
|
||||
material_code = mat.code,
|
||||
unit_id = mat.unit_id,
|
||||
barcode = carryCode,
|
||||
code_batch = item.code_batch,
|
||||
material_specification = item.material_specification,
|
||||
container_no = item.container_no,
|
||||
codeqty = item.codeqty,
|
||||
is_lock = 0,
|
||||
is_end = 0,
|
||||
create_id = _userManager.UserId,
|
||||
create_time = DateTime.Now,
|
||||
};
|
||||
}
|
||||
|
||||
);
|
||||
|
||||
_ = await _db.Insertable(instock).ExecuteCommandAsync();
|
||||
_ = await _db.Insertable(instockDs).ExecuteCommandAsync();
|
||||
if (instockCode != null)
|
||||
{
|
||||
_ = await _db.Insertable(instockCode).ExecuteCommandAsync();
|
||||
}
|
||||
_ = await _db.Insertable(instockCodes).ExecuteCommandAsync();
|
||||
|
||||
|
||||
InStockStrategyQuery inStockStrategyInput = new() { warehouse_id = WmsWareHouseConst.WAREHOUSE_CP_ID, Size = 1 };
|
||||
@@ -260,21 +274,26 @@ namespace Tnb.WarehouseMgr
|
||||
return preTask;
|
||||
}).ToList();
|
||||
List<WmsPretaskCode> pretaskCodes = new();
|
||||
foreach (WmsPretaskH? pt in preTasks)
|
||||
|
||||
foreach (var wmsCarryCode in wmsCarryCodes)
|
||||
{
|
||||
WmsPretaskCode ptc = pt.Adapt<WmsPretaskCode>();
|
||||
ptc.id = SnowflakeIdHelper.NextId();
|
||||
ptc.bill_id = pt.id;
|
||||
ptc.material_id = instockCode.material_id;
|
||||
ptc.material_code = instockCode.material_code;
|
||||
ptc.barcode = instockCode.barcode;
|
||||
ptc.codeqty = instockCode.codeqty;
|
||||
ptc.material_specification = instockCode.material_specification;
|
||||
ptc.container_no = instockCode.container_no;
|
||||
ptc.unit_id = instockCode.unit_id;
|
||||
ptc.code_batch = instockCode.code_batch;
|
||||
pretaskCodes.Add(ptc);
|
||||
foreach (WmsPretaskH? pt in preTasks)
|
||||
{
|
||||
WmsPretaskCode ptc = pt.Adapt<WmsPretaskCode>();
|
||||
ptc.id = SnowflakeIdHelper.NextId();
|
||||
ptc.bill_id = pt.id;
|
||||
ptc.material_id = wmsCarryCode.material_id;
|
||||
ptc.material_code = wmsCarryCode.material_code;
|
||||
ptc.barcode = wmsCarryCode.barcode;
|
||||
ptc.codeqty = wmsCarryCode.codeqty;
|
||||
ptc.material_specification = item.material_specification;
|
||||
ptc.container_no = item.container_no;
|
||||
ptc.unit_id = item.unit_id;
|
||||
ptc.code_batch = wmsCarryCode.code_batch;
|
||||
pretaskCodes.Add(ptc);
|
||||
}
|
||||
}
|
||||
|
||||
bool isOk = await _wareHouseService.GenPreTask(preTasks, pretaskCodes);
|
||||
if (isOk)
|
||||
{
|
||||
@@ -288,49 +307,49 @@ namespace Tnb.WarehouseMgr
|
||||
LocationIds = points.Select(x => x.location_id).ToList()!
|
||||
};
|
||||
|
||||
//生成操作记录
|
||||
WmsHandleH handleH = new()
|
||||
{
|
||||
org_id = _userManager.User == null ? "" : _userManager.User.OrganizeId!,
|
||||
startlocation_id = loc.id,
|
||||
endlocation_id = endLocations![0].id,
|
||||
bill_code = instock.bill_code,
|
||||
biz_type = instock.biz_type,
|
||||
carry_id = carry.id,
|
||||
carry_code = carry.carry_code,
|
||||
require_id = instock.id,
|
||||
require_code = instock.bill_code,
|
||||
create_id = _userManager.User == null ? "" : _userManager.UserId!,
|
||||
create_time = DateTime.Now
|
||||
};
|
||||
preTaskUpInput.PreTaskRecord = handleH;
|
||||
////生成操作记录
|
||||
//WmsHandleH handleH = new()
|
||||
//{
|
||||
// org_id = _userManager.User == null ? "" : _userManager.User.OrganizeId!,
|
||||
// startlocation_id = loc.id,
|
||||
// endlocation_id = endLocations![0].id,
|
||||
// bill_code = instock.bill_code,
|
||||
// biz_type = instock.biz_type,
|
||||
// carry_id = carry.id,
|
||||
// carry_code = carry.carry_code,
|
||||
// require_id = instock.id,
|
||||
// require_code = instock.bill_code,
|
||||
// create_id = _userManager.User == null ? "" : _userManager.UserId!,
|
||||
// create_time = DateTime.Now
|
||||
//};
|
||||
//preTaskUpInput.PreTaskRecord = handleH;
|
||||
|
||||
//生成操作记录条码表
|
||||
WmsHandleCode handleCode = instockCode.Adapt<WmsHandleCode>();
|
||||
handleCode.id = SnowflakeIdHelper.NextId();
|
||||
handleCode.org_id = _userManager.User == null ? "" : _userManager.User.OrganizeId!;
|
||||
handleCode.bill_id = handleH.id;
|
||||
handleCode.create_id = _userManager.User == null ? "" : _userManager.UserId!;
|
||||
handleCode.create_time = DateTime.Now;
|
||||
preTaskUpInput.PreTaskHandleCodes.Add(handleCode);
|
||||
////生成操作记录条码表
|
||||
//WmsHandleCode handleCode = instockCode.Adapt<WmsHandleCode>();
|
||||
//handleCode.id = SnowflakeIdHelper.NextId();
|
||||
//handleCode.org_id = _userManager.User == null ? "" : _userManager.User.OrganizeId!;
|
||||
//handleCode.bill_id = handleH.id;
|
||||
//handleCode.create_id = _userManager.User == null ? "" : _userManager.UserId!;
|
||||
//handleCode.create_time = DateTime.Now;
|
||||
//preTaskUpInput.PreTaskHandleCodes.Add(handleCode);
|
||||
|
||||
//生成载具条码表
|
||||
WmsCarryCode wmsCarryCode = instockCode.Adapt<WmsCarryCode>();
|
||||
{
|
||||
wmsCarryCode.id = SnowflakeIdHelper.NextId();
|
||||
wmsCarryCode.carry_id = carry.id;
|
||||
wmsCarryCode.is_out = 0;
|
||||
wmsCarryCode.location_id = loc.id;
|
||||
wmsCarryCode.location_code = loc.location_code;
|
||||
wmsCarryCode.warehouse_id = instock.warehouse_id;
|
||||
}
|
||||
_ = await _db.Insertable(wmsCarryCode).ExecuteCommandAsync();
|
||||
////生成载具条码表
|
||||
//WmsCarryCode wmsCarryCode = instockCode.Adapt<WmsCarryCode>();
|
||||
//{
|
||||
// wmsCarryCode.id = SnowflakeIdHelper.NextId();
|
||||
// wmsCarryCode.carry_id = carry.id;
|
||||
// wmsCarryCode.is_out = 0;
|
||||
// wmsCarryCode.location_id = loc.id;
|
||||
// wmsCarryCode.location_code = loc.location_code;
|
||||
// wmsCarryCode.warehouse_id = instock.warehouse_id;
|
||||
//}
|
||||
//_ = await _db.Insertable(wmsCarryCode).ExecuteCommandAsync();
|
||||
|
||||
//回更状态
|
||||
await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput,
|
||||
it => new WmsCarryH { carry_code = instock!.carry_code!, is_lock = 1, carry_status = ((int)EnumCarryStatus.占用).ToString(), location_id = preTaskUpInput.CarryStartLocationId, location_code = preTaskUpInput.CarryStartLocationCode },
|
||||
it => new BasLocation { is_lock = 1 });
|
||||
_ = await _db.Updateable<WmsInstockD>().SetColumns(it => new WmsInstockD { line_status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => instockCode.bill_d_id == it.id).ExecuteCommandAsync();
|
||||
_ = await _db.Updateable<WmsInstockD>().SetColumns(it => new WmsInstockD { line_status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => instock.id == it.bill_id).ExecuteCommandAsync();
|
||||
_ = await _db.Updateable<WmsInstockH>().SetColumns(it => new WmsInstockH { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == instock!.id).ExecuteCommandAsync();
|
||||
|
||||
}
|
||||
@@ -399,11 +418,13 @@ namespace Tnb.WarehouseMgr
|
||||
string biz_type = WmsWareHouseConst.BIZTYPE_WMSINSTOCK_ID;
|
||||
string required_type = (await _dbScanInStockByRedis.Queryable<WmsTempCode>().FirstAsync(it => it.barcode == input.data["物料条码"])).required_type;
|
||||
string source_id = (await _dbScanInStockByRedis.Queryable<WmsTempCode>().FirstAsync(it => it.barcode == input.data["物料条码"])).require_id;
|
||||
string source_main_id = "";
|
||||
switch (required_type)
|
||||
{
|
||||
case WmsWareHouseConst.BILLTYPE_PURCHASE_ID:
|
||||
{
|
||||
bill_type = WmsWareHouseConst.BILLTYPE_MATERIALINSTOCK_ID;
|
||||
source_main_id = (await _dbScanInStockByRedis.Queryable<WmsPurchaseD>().FirstAsync(it => it.id == source_id)).bill_id;
|
||||
break;
|
||||
}
|
||||
case WmsWareHouseConst.BILLTYPE_OUTSOURCE_ID:
|
||||
@@ -439,77 +460,90 @@ namespace Tnb.WarehouseMgr
|
||||
print_status = WmsWareHouseConst.PRINT_STATUS_PRINTCOMPLETE,
|
||||
is_check = 1,
|
||||
purchase_code = billCode?.ToString() ?? string.Empty,
|
||||
create_id = _userManager.UserId==null?"": _userManager.UserId,
|
||||
create_id = _userManager.UserId == null ? "" : _userManager.UserId,
|
||||
create_time = DateTime.Now,
|
||||
source_id = source_main_id
|
||||
};
|
||||
var instockDs = new List<WmsInstockD>();
|
||||
WmsInstockD? instockD = null;
|
||||
if (mat != null)
|
||||
{
|
||||
instockD = new()
|
||||
{
|
||||
id = SnowflakeIdHelper.NextId(),
|
||||
bill_id = instock.id,
|
||||
line_status = WmsWareHouseConst.BILLSTATUS_ADD_ID,
|
||||
material_id = mat.id,
|
||||
material_code = mat.code,
|
||||
unit_id = mat.unit_id,
|
||||
pr_qty = item.codeqty,
|
||||
qty = 0,
|
||||
code_batch = item.code_batch,
|
||||
material_specification = item.material_specification,
|
||||
container_no = item.container_no,
|
||||
warehouse_id = whId?.ToString() ?? "1",
|
||||
print_qty = item.codeqty,
|
||||
scan_qty = item.codeqty,
|
||||
print_id = "",
|
||||
create_id = _userManager.UserId == null ? "" : _userManager.UserId,
|
||||
create_time = DateTime.Now,
|
||||
};
|
||||
instockDs.Add(instockD);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (input.data.ContainsKey("details"))
|
||||
{
|
||||
instockDs = input.data["details"].Adapt<List<WmsInstockD>>();
|
||||
var instockCodes = new List<WmsInstockCode>();
|
||||
List<WmsCarryCode> wmsCarryCodes = await _db.Queryable<WmsCarryCode>().Where(r => r.carry_id == carry.id).ToListAsync();
|
||||
|
||||
foreach (var r in wmsCarryCodes.GroupBy(g => new { g.material_id, g.code_batch }))
|
||||
{
|
||||
var list = r.ToList();
|
||||
decimal qty = list.Sum(x => x.codeqty);
|
||||
|
||||
WmsInstockD? instockD = null;
|
||||
if (mat != null)
|
||||
{
|
||||
instockD = new()
|
||||
{
|
||||
id = SnowflakeIdHelper.NextId(),
|
||||
bill_id = instock.id,
|
||||
line_status = WmsWareHouseConst.BILLSTATUS_ADD_ID,
|
||||
material_id = mat.id,
|
||||
material_code = mat.code,
|
||||
unit_id = mat.unit_id,
|
||||
pr_qty = qty,
|
||||
qty = 0,
|
||||
code_batch = r.Key.code_batch,
|
||||
material_specification = item.material_specification,
|
||||
container_no = item.container_no,
|
||||
warehouse_id = WmsWareHouseConst.WAREHOUSE_CP_ID,
|
||||
print_qty = qty,
|
||||
scan_qty = qty,
|
||||
print_id = "",
|
||||
create_id = _userManager.UserId,
|
||||
create_time = DateTime.Now,
|
||||
};
|
||||
instockDs.Add(instockD);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
WmsInstockCode? instockCode = null;
|
||||
if (mat != null)
|
||||
{
|
||||
instockCode = new()
|
||||
else
|
||||
{
|
||||
id = SnowflakeIdHelper.NextId(),
|
||||
bill_id = instock.id,
|
||||
bill_d_id = instockD?.id ?? string.Empty,
|
||||
line_status = WmsWareHouseConst.BILLSTATUS_ADD_ID,
|
||||
material_id = mat.id,
|
||||
material_code = mat.code,
|
||||
unit_id = mat.unit_id,
|
||||
barcode = carryCode,//carry code bar_code
|
||||
code_batch = item.code_batch,
|
||||
material_specification = item.material_specification,
|
||||
container_no = item.container_no,
|
||||
codeqty = item.codeqty,
|
||||
is_lock = 0,
|
||||
is_end = 0,
|
||||
create_id = _userManager.UserId == null ? "" : _userManager.UserId,
|
||||
create_time = DateTime.Now,
|
||||
};
|
||||
if (input.data.ContainsKey("details"))
|
||||
{
|
||||
instockDs = input.data["details"].Adapt<List<WmsInstockD>>();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var row in list)
|
||||
{
|
||||
WmsInstockCode? instockCode = null;
|
||||
if (mat != null)
|
||||
{
|
||||
instockCode = new()
|
||||
{
|
||||
id = SnowflakeIdHelper.NextId(),
|
||||
bill_id = instock.id,
|
||||
bill_d_id = instockD?.id ?? string.Empty,
|
||||
line_status = WmsWareHouseConst.BILLSTATUS_ADD_ID,
|
||||
material_id = mat.id,
|
||||
material_code = mat.code,
|
||||
unit_id = mat.unit_id,
|
||||
barcode = row.barcode,
|
||||
code_batch = row.code_batch,
|
||||
material_specification = item.material_specification,
|
||||
container_no = item.container_no,
|
||||
codeqty = row.codeqty,
|
||||
is_lock = 0,
|
||||
is_end = 0,
|
||||
create_id = _userManager.UserId,
|
||||
create_time = DateTime.Now,
|
||||
};
|
||||
instockCodes.Add(instockCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_ = await _dbScanInStockByRedis.Insertable(instock).ExecuteCommandAsync();
|
||||
Logger.LogInformation($"【ScanInStockByRedis】插入WmsInstockH {JsonConvert.SerializeObject(instock)}");
|
||||
_ = await _dbScanInStockByRedis.Insertable(instockDs).ExecuteCommandAsync();
|
||||
Logger.LogInformation($"【ScanInStockByRedis】插入WmsInstockD {JsonConvert.SerializeObject(instockDs)}");
|
||||
if (instockCode != null)
|
||||
if (instockCodes != null)
|
||||
{
|
||||
_ = await _dbScanInStockByRedis.Insertable(instockCode).ExecuteCommandAsync();
|
||||
Logger.LogInformation($"【ScanInStockByRedis】插入WmsInstockCode {JsonConvert.SerializeObject(instockCode)}");
|
||||
_ = await _dbScanInStockByRedis.Insertable(instockCodes).ExecuteCommandAsync();
|
||||
Logger.LogInformation($"【ScanInStockByRedis】插入WmsInstockCode {JsonConvert.SerializeObject(instockCodes)}");
|
||||
}
|
||||
|
||||
InStockStrategyQuery inStockStrategyInput = new() { warehouse_id = "1", Size = 1, AvoidBusyPassage = true, Region_id = WmsWareHouseConst.REGION_YCLCache_ID };
|
||||
@@ -593,20 +627,23 @@ namespace Tnb.WarehouseMgr
|
||||
return preTask;
|
||||
}).ToList();
|
||||
List<WmsPretaskCode> pretaskCodes = new();
|
||||
foreach (WmsPretaskH? pt in preTasks)
|
||||
foreach (var wmsCarryCode in wmsCarryCodes)
|
||||
{
|
||||
WmsPretaskCode ptc = pt.Adapt<WmsPretaskCode>();
|
||||
ptc.id = SnowflakeIdHelper.NextId();
|
||||
ptc.bill_id = pt.id;
|
||||
ptc.material_id = instockCode.material_id;
|
||||
ptc.material_code = instockCode.material_code;
|
||||
ptc.barcode = instockCode.barcode;
|
||||
ptc.codeqty = instockCode.codeqty;
|
||||
ptc.material_specification = instockCode.material_specification;
|
||||
ptc.container_no = instockCode.container_no;
|
||||
ptc.unit_id = instockCode.unit_id;
|
||||
ptc.code_batch = instockCode.code_batch;
|
||||
pretaskCodes.Add(ptc);
|
||||
foreach (WmsPretaskH? pt in preTasks)
|
||||
{
|
||||
WmsPretaskCode ptc = pt.Adapt<WmsPretaskCode>();
|
||||
ptc.id = SnowflakeIdHelper.NextId();
|
||||
ptc.bill_id = pt.id;
|
||||
ptc.material_id = wmsCarryCode.material_id;
|
||||
ptc.material_code = wmsCarryCode.material_code;
|
||||
ptc.barcode = wmsCarryCode.barcode;
|
||||
ptc.codeqty = wmsCarryCode.codeqty;
|
||||
ptc.material_specification = item.material_specification;
|
||||
ptc.container_no = item.container_no;
|
||||
ptc.unit_id = mat.unit_id;
|
||||
ptc.code_batch = wmsCarryCode.code_batch;
|
||||
pretaskCodes.Add(ptc);
|
||||
}
|
||||
}
|
||||
bool isOk = await _wareHouseService.GenPreTask(preTasks, pretaskCodes, _dbScanInStockByRedis);
|
||||
if (isOk)
|
||||
@@ -621,37 +658,37 @@ namespace Tnb.WarehouseMgr
|
||||
LocationIds = points.Select(x => x.location_id).ToList()!
|
||||
};
|
||||
|
||||
//生成操作记录
|
||||
WmsHandleH handleH = new()
|
||||
{
|
||||
org_id = _userManager.User == null ? "" : _userManager.User.OrganizeId!,
|
||||
startlocation_id = loc.id,
|
||||
endlocation_id = endLocations![0].id,
|
||||
bill_code = instock.bill_code,
|
||||
biz_type = instock.biz_type,
|
||||
carry_id = carry.id,
|
||||
carry_code = carry.carry_code,
|
||||
require_id = instock.id,
|
||||
require_code = instock.bill_code,
|
||||
create_id = _userManager.User == null ? "" : _userManager.UserId!,
|
||||
create_time = DateTime.Now
|
||||
};
|
||||
preTaskUpInput.PreTaskRecord = handleH;
|
||||
////生成操作记录
|
||||
//WmsHandleH handleH = new()
|
||||
//{
|
||||
// org_id = _userManager.User == null ? "" : _userManager.User.OrganizeId!,
|
||||
// startlocation_id = loc.id,
|
||||
// endlocation_id = endLocations![0].id,
|
||||
// bill_code = instock.bill_code,
|
||||
// biz_type = instock.biz_type,
|
||||
// carry_id = carry.id,
|
||||
// carry_code = carry.carry_code,
|
||||
// require_id = instock.id,
|
||||
// require_code = instock.bill_code,
|
||||
// create_id = _userManager.User == null ? "" : _userManager.UserId!,
|
||||
// create_time = DateTime.Now
|
||||
//};
|
||||
//preTaskUpInput.PreTaskRecord = handleH;
|
||||
|
||||
//生成操作记录条码表
|
||||
WmsHandleCode handleCode = instockCode.Adapt<WmsHandleCode>();
|
||||
handleCode.id = SnowflakeIdHelper.NextId();
|
||||
handleCode.org_id = _userManager.User == null ? "" : _userManager.User.OrganizeId!;
|
||||
handleCode.bill_id = handleH.id;
|
||||
handleCode.create_id = _userManager.User == null ? "" : _userManager.UserId!;
|
||||
handleCode.create_time = DateTime.Now;
|
||||
preTaskUpInput.PreTaskHandleCodes.Add(handleCode);
|
||||
////生成操作记录条码表
|
||||
//WmsHandleCode handleCode = instockCode.Adapt<WmsHandleCode>();
|
||||
//handleCode.id = SnowflakeIdHelper.NextId();
|
||||
//handleCode.org_id = _userManager.User == null ? "" : _userManager.User.OrganizeId!;
|
||||
//handleCode.bill_id = handleH.id;
|
||||
//handleCode.create_id = _userManager.User == null ? "" : _userManager.UserId!;
|
||||
//handleCode.create_time = DateTime.Now;
|
||||
//preTaskUpInput.PreTaskHandleCodes.Add(handleCode);
|
||||
|
||||
//回更状态
|
||||
await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput,
|
||||
it => new WmsCarryH { carry_code = instock!.carry_code!, is_lock = 1, carry_status = ((int)EnumCarryStatus.占用).ToString(), location_id = preTaskUpInput.CarryStartLocationId, location_code = preTaskUpInput.CarryStartLocationCode },
|
||||
it => new BasLocation { is_lock = 1 }, _dbScanInStockByRedis);
|
||||
_ = await _dbScanInStockByRedis.Updateable<WmsInstockD>().SetColumns(it => new WmsInstockD { line_status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => instockCode.bill_d_id == it.id).ExecuteCommandAsync();
|
||||
_ = await _dbScanInStockByRedis.Updateable<WmsInstockD>().SetColumns(it => new WmsInstockD { line_status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => instock.id == it.bill_id).ExecuteCommandAsync();
|
||||
_ = await _dbScanInStockByRedis.Updateable<WmsInstockH>().SetColumns(it => new WmsInstockH { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == instock!.id).ExecuteCommandAsync();
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user