修复错误
This commit is contained in:
@@ -402,7 +402,7 @@ namespace Tnb.ProductionMgr
|
||||
})
|
||||
.Mapper(it =>
|
||||
{
|
||||
it.mo_task_status = dic.ContainsKey(it.mo_task_status) ? dic[it.mo_task_status].ToString() : "";
|
||||
it.mo_task_status = dic.ContainsKey(it.mo_task_status) ? dic[it.mo_task_status].ToString()! : "";
|
||||
})
|
||||
.ToListAsync();
|
||||
}
|
||||
@@ -434,7 +434,7 @@ namespace Tnb.ProductionMgr
|
||||
scheduled_qty = a.scheduled_qty,
|
||||
plan_qty = d.plan_qty
|
||||
})
|
||||
.Mapper(it => it.mo_task_status = dic.ContainsKey(it.mo_task_status) ? dic[it.mo_task_status].ToString() : "")
|
||||
.Mapper(it => it.mo_task_status = dic.ContainsKey(it.mo_task_status) ? dic[it.mo_task_status].ToString()! : "")
|
||||
.ToListAsync();
|
||||
return result;
|
||||
}
|
||||
@@ -465,7 +465,7 @@ namespace Tnb.ProductionMgr
|
||||
plan_qty = d.plan_qty,
|
||||
process_task_qty = a.process_task_qty,
|
||||
})
|
||||
.Mapper(it => it.mo_task_status = dic.ContainsKey(it.mo_task_status) ? dic[it.mo_task_status].ToString() : "")
|
||||
.Mapper(it => it.mo_task_status = dic.ContainsKey(it.mo_task_status) ? dic[it.mo_task_status].ToString()! : "")
|
||||
.ToListAsync();
|
||||
return result;
|
||||
}
|
||||
@@ -699,7 +699,7 @@ namespace Tnb.ProductionMgr
|
||||
var mo = await _db.Queryable<PrdMo>().FirstAsync(it => it.id == input.mo_id);
|
||||
var moCode = mo?.mo_code;
|
||||
var taskCode = await _db.Queryable<PrdMoTask>().Where(it => !string.IsNullOrEmpty(it.mo_task_code) && it.mo_task_code.Contains(moCode)).OrderByDescending(it => it.mo_task_code).Select(it => it.mo_task_code).FirstAsync();
|
||||
if (taskCode.IsNullOrEmpty())
|
||||
if (taskCode!.IsNullOrEmpty())
|
||||
{
|
||||
moTask.mo_task_code = $"{moCode}-01";
|
||||
}
|
||||
@@ -727,7 +727,7 @@ namespace Tnb.ProductionMgr
|
||||
taskLog.create_id = _userManager.UserId;
|
||||
taskLog.create_time = DateTime.Now;
|
||||
taskLog.mo_task_id = moTask.id;
|
||||
taskLog.mo_task_code = moTask.mo_task_code;
|
||||
taskLog.mo_task_code = moTask.mo_task_code!;
|
||||
row = await _db.Insertable(taskLog).ExecuteCommandAsync();
|
||||
//根据工单号获取当前工单包含的已排产数
|
||||
var schedQty = _db.Queryable<PrdMoTask>().Where(it => it.mo_id == input.mo_id)?.Sum(d => d.scheduled_qty);
|
||||
@@ -781,7 +781,7 @@ namespace Tnb.ProductionMgr
|
||||
subMoTasks.Add(subMoTask);
|
||||
}
|
||||
//根据生产任务编号生成子任务编号
|
||||
if (moTask.mo_task_code.IsNotEmptyOrNull())
|
||||
if (moTask.mo_task_code!.IsNotEmptyOrNull())
|
||||
{
|
||||
for (int i = 1; i <= subMoTasks.Count; i++)
|
||||
{
|
||||
@@ -884,19 +884,19 @@ namespace Tnb.ProductionMgr
|
||||
taskLog.id = SnowflakeIdHelper.NextId();
|
||||
if (taskItem != null)
|
||||
{
|
||||
if (taskItem.mo_id.IsNotEmptyOrNull())
|
||||
if (taskItem.mo_id!.IsNotEmptyOrNull())
|
||||
{
|
||||
taskLog.mo_code = (await db.Queryable<PrdMo>().FirstAsync(it => it.id == taskItem.mo_id))?.mo_code!;
|
||||
}
|
||||
if (taskItem.eqp_id.IsNotEmptyOrNull())
|
||||
if (taskItem.eqp_id!.IsNotEmptyOrNull())
|
||||
{
|
||||
taskLog.eqp_code = (await db.Queryable<EqpEquipment>().FirstAsync(it => it.id == taskItem.eqp_id))?.code!;
|
||||
}
|
||||
if (taskItem.mold_id.IsNotEmptyOrNull())
|
||||
if (taskItem.mold_id!.IsNotEmptyOrNull())
|
||||
{
|
||||
taskLog.mold_code = (await db.Queryable<Molds>().FirstAsync(it => it.id == taskItem.mold_id))?.mold_code!;
|
||||
}
|
||||
if (taskItem.material_id.IsNotEmptyOrNull())
|
||||
if (taskItem.material_id!.IsNotEmptyOrNull())
|
||||
{
|
||||
var material = await db.Queryable<BasMaterial>().FirstAsync(it => it.id == taskItem.material_id);
|
||||
taskLog.item_code = material?.code!;
|
||||
|
||||
Reference in New Issue
Block a user