执行代码清理,修复warning
This commit is contained in:
@@ -105,10 +105,10 @@ namespace Tnb.ProductionMgr
|
||||
|
||||
private async Task<dynamic> GetList(VisualDevModelListQueryInput input)
|
||||
{
|
||||
var db = _repository.AsSugarClient();
|
||||
Dictionary<string, object> queryJson = !string.IsNullOrEmpty(input.queryJson) ? JsonConvert.DeserializeObject<Dictionary<string, object>>(input.queryJson) : new Dictionary<string, object>();
|
||||
string moTaskCode = queryJson != null && queryJson.ContainsKey("mo_task_code") ? queryJson["mo_task_code"].ToString() : "";
|
||||
string stationId = queryJson != null && queryJson.ContainsKey("stationId") ? queryJson["stationId"].ToString() : "";
|
||||
ISqlSugarClient db = _repository.AsSugarClient();
|
||||
Dictionary<string, object>? queryJson = !string.IsNullOrEmpty(input.queryJson) ? JsonConvert.DeserializeObject<Dictionary<string, object>>(input.queryJson) : new Dictionary<string, object>();
|
||||
string? moTaskCode = queryJson != null && queryJson.ContainsKey("mo_task_code") ? queryJson["mo_task_code"].ToString() : "";
|
||||
string? stationId = queryJson != null && queryJson.ContainsKey("stationId") ? queryJson["stationId"].ToString() : "";
|
||||
|
||||
if (string.IsNullOrEmpty(stationId))
|
||||
{
|
||||
@@ -121,23 +121,23 @@ namespace Tnb.ProductionMgr
|
||||
|
||||
Dictionary<string, object> dic = await _dictionaryDataService.GetDicByKey(DictConst.TaskStatus);
|
||||
|
||||
DateTime[] planStartDateArr = null;
|
||||
DateTime[] planEndDateArr = null;
|
||||
if (queryJson.TryGetValue("plan_start_date", out var value1))
|
||||
DateTime[]? planStartDateArr = null;
|
||||
DateTime[]? planEndDateArr = null;
|
||||
if (queryJson.TryGetValue("plan_start_date", out object? value1))
|
||||
{
|
||||
planStartDateArr = value1.ToObject<long[]>().Select(x => x.TimeStampToDateTime()).ToArray();
|
||||
}
|
||||
if (queryJson.TryGetValue("plan_end_date", out var value2))
|
||||
if (queryJson.TryGetValue("plan_end_date", out object? value2))
|
||||
{
|
||||
planEndDateArr = value2.ToObject<long[]>().Select(x => x.TimeStampToDateTime()).ToArray();
|
||||
}
|
||||
|
||||
|
||||
var result = await db.Queryable<PrdMoTask>()
|
||||
SqlSugarPagedList<PrdTaskManageListOutput> result = await db.Queryable<PrdMoTask>()
|
||||
.LeftJoin<EqpEquipment>((a, b) => a.eqp_id == b.id)
|
||||
.LeftJoin<BasMaterial>((a, b, c) => a.material_id == c.id)
|
||||
.LeftJoin<ToolMolds>((a, b, c, d) => a.mold_id == d.id)
|
||||
.Where((a, b, c, d) => (a.mo_task_status == DictConst.ToBeStartedEnCode || a.mo_task_status == DictConst.InProgressEnCode || a.mo_task_status == DictConst.MoStatusExceptionCode || a.mo_task_status == DictConst.MoStatusPauseCode || a.mo_task_status == DictConst.ComplatedEnCode))
|
||||
.Where((a, b, c, d) => a.mo_task_status == DictConst.ToBeStartedEnCode || a.mo_task_status == DictConst.InProgressEnCode || a.mo_task_status == DictConst.MoStatusExceptionCode || a.mo_task_status == DictConst.MoStatusPauseCode || a.mo_task_status == DictConst.ComplatedEnCode)
|
||||
.Where((a, b, c, d) => a.schedule_type == 1)
|
||||
.WhereIF(!string.IsNullOrEmpty(moTaskCode), (a, b, c, d) => a.mo_task_code.Contains(moTaskCode))
|
||||
.WhereIF(planStartDateArr != null, (a, b, c, d) => a.estimated_start_date >= planStartDateArr[0] && a.estimated_start_date <= planStartDateArr[1])
|
||||
@@ -243,7 +243,6 @@ namespace Tnb.ProductionMgr
|
||||
/// <summary>
|
||||
/// 根据任务单号获取提报记录明细
|
||||
/// </summary>
|
||||
/// <param name="icmoCode">任务单号</param>
|
||||
/// <remarks>
|
||||
/// returns:
|
||||
///<br/> {
|
||||
@@ -256,8 +255,8 @@ namespace Tnb.ProductionMgr
|
||||
[HttpGet]
|
||||
public async Task<dynamic> GetPrdReportByIcmoCode([FromRoute] string mo_task_code)
|
||||
{
|
||||
var db = _repository.AsSugarClient();
|
||||
var dic = await _dictionaryDataService.GetDicByTypeId(DictConst.PrdTaskStatusTypeId);
|
||||
ISqlSugarClient db = _repository.AsSugarClient();
|
||||
Dictionary<string, object> dic = await _dictionaryDataService.GetDicByTypeId(DictConst.PrdTaskStatusTypeId);
|
||||
var prdTask = await db.Queryable<PrdMoTask>()
|
||||
.LeftJoin<BasMaterial>((a, b) => a.material_id == b.id)
|
||||
.LeftJoin<ToolMolds>((a, b, c) => a.mold_id == c.id)
|
||||
@@ -268,28 +267,28 @@ namespace Tnb.ProductionMgr
|
||||
.Where((a, b) => a.mo_task_code == mo_task_code)
|
||||
.Select((a, b, c, d, e, f, g) => new
|
||||
{
|
||||
id = a.id,
|
||||
mo_task_code = a.mo_task_code,
|
||||
mo_id = a.mo_id,
|
||||
material_id = a.material_id,
|
||||
a.id,
|
||||
a.mo_task_code,
|
||||
a.mo_id,
|
||||
a.material_id,
|
||||
material_code = b.code,
|
||||
material_name = b.name,
|
||||
material_property = b.material_property,
|
||||
b.material_property,
|
||||
mo_task_status = e.FullName,
|
||||
plan_qty = a.plan_qty,
|
||||
scheduled_qty = a.scheduled_qty,
|
||||
a.plan_qty,
|
||||
a.scheduled_qty,
|
||||
complete_qty = a.reported_work_qty + a.scrap_qty,
|
||||
scrap_qty = a.scrap_qty,
|
||||
mold_code = c.mold_code,
|
||||
a.scrap_qty,
|
||||
c.mold_code,
|
||||
// icmo_qty = a.icmo_qty,
|
||||
reported_work_qty = a.reported_work_qty,
|
||||
a.reported_work_qty,
|
||||
// reported_qty = a.reported_qty,
|
||||
// prd_qty = a.prd_qty,
|
||||
eqp_code = d.code,
|
||||
mbom_process_id = a.mbom_process_id,
|
||||
a.mbom_process_id,
|
||||
workline_name = f.FullName,
|
||||
process_name = g.process_name,
|
||||
process_id = a.process_id
|
||||
g.process_name,
|
||||
a.process_id
|
||||
}).FirstAsync();
|
||||
|
||||
return prdTask;
|
||||
|
||||
Reference in New Issue
Block a user