sqlsugar的PostgreSQL数据库 时间格式化分钟mm改为mi
This commit is contained in:
15
BasicData/Tnb.BasicData.Entities/Consts/DbTimeFormat.cs
Normal file
15
BasicData/Tnb.BasicData.Entities/Consts/DbTimeFormat.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
namespace Tnb.BasicData
|
||||
{
|
||||
public static class DbTimeFormat
|
||||
{
|
||||
/// <summary>
|
||||
/// 2024-10-27 10:10
|
||||
/// </summary>
|
||||
public const string MM = "yyyy-MM-dd HH:mi";
|
||||
|
||||
/// <summary>
|
||||
/// 2024-10-27 10:10:10
|
||||
/// </summary>
|
||||
public const string SS = "yyyy-MM-dd HH:mi:ss";
|
||||
}
|
||||
}
|
||||
@@ -229,8 +229,8 @@ namespace Tnb.BasicData
|
||||
bom_id = a.id,
|
||||
material_code = b.code,
|
||||
material_name = b.name,
|
||||
start_time = a.start_time.HasValue ? a.start_time.Value.ToString("yyyy-MM-dd HH:mm:ss") : null,
|
||||
end_time = a.end_time.HasValue ? a.end_time.Value.ToString("yyyy-MM-dd HH:mm:ss") : null,
|
||||
start_time = a.start_time.HasValue ? a.start_time.Value.ToString(DbTimeFormat.SS) : null,
|
||||
end_time = a.end_time.HasValue ? a.end_time.Value.ToString(DbTimeFormat.SS) : null,
|
||||
version = a.version,
|
||||
route_id = c.id,
|
||||
route_name = c.name,
|
||||
|
||||
@@ -9,6 +9,7 @@ using SqlSugar;
|
||||
using Tnb.EquipMgr.Entities;
|
||||
using Tnb.EquipMgr.Entities.Dto;
|
||||
using Tnb.EquipMgr.Interfaces;
|
||||
using Tnb.BasicData;
|
||||
|
||||
namespace Tnb.EquipMgr
|
||||
{
|
||||
@@ -48,7 +49,7 @@ namespace Tnb.EquipMgr
|
||||
id = a.id,
|
||||
data_source = a.data_source,
|
||||
create_id = b.RealName,
|
||||
create_time = a.create_time==null ? null : a.create_time.Value.ToString("yyyy-MM-dd HH:mm"),
|
||||
create_time = a.create_time==null ? null : a.create_time.Value.ToString(DbTimeFormat.MM),
|
||||
data_type = a.data_type,
|
||||
enabled = a.enabled==1 ? "是" : "否",
|
||||
equip_id = a.equip_id,
|
||||
|
||||
@@ -281,7 +281,7 @@ namespace Tnb.EquipMgr
|
||||
is_ugent = a.is_ugent==1 ? "是" : "否",
|
||||
description = a.description,
|
||||
repair_description = a.repair_description,
|
||||
complete_time = a.complete_time==null ? null : a.complete_time.Value.ToString("yyyy-MM-dd HH:mm"),
|
||||
complete_time = a.complete_time==null ? null : a.complete_time.Value.ToString(DbTimeFormat.MM),
|
||||
repairer_id = c.RealName
|
||||
}).ToPagedListAsync(input.currentPage, input.pageSize);
|
||||
|
||||
@@ -336,9 +336,9 @@ namespace Tnb.EquipMgr
|
||||
apply_user_id_id =b.Id,
|
||||
is_ugent = a.is_ugent==1 ? "是" : "否",
|
||||
description = a.description,
|
||||
create_time = a.create_time==null ? "" : a.create_time.Value.ToString("yyyy-MM-dd HH:mm:ss"),
|
||||
complete_time = a.complete_time==null ? "" : a.complete_time.Value.ToString("yyyy-MM-dd HH:mm:ss"),
|
||||
expect_complete_time = a.expect_complete_time==null ? "" : a.expect_complete_time.Value.ToString("yyyy-MM-dd HH:mm:ss"),
|
||||
create_time = a.create_time==null ? "" : a.create_time.Value.ToString(DbTimeFormat.SS),
|
||||
complete_time = a.complete_time==null ? "" : a.complete_time.Value.ToString(DbTimeFormat.SS),
|
||||
expect_complete_time = a.expect_complete_time==null ? "" : a.expect_complete_time.Value.ToString(DbTimeFormat.SS),
|
||||
repairer_id = c.RealName,
|
||||
repairer_id_id = c.Id,
|
||||
remark = a.remark,
|
||||
|
||||
@@ -235,17 +235,17 @@ namespace Tnb.EquipMgr
|
||||
{
|
||||
id = a.id,
|
||||
attachment = a.attachment,
|
||||
create_time = a.create_time==null ? null : a.create_time.Value.ToString("yyyy-MM-dd HH:mm"),
|
||||
create_time = a.create_time==null ? null : a.create_time.Value.ToString(DbTimeFormat.MM),
|
||||
equip_id = b.code,
|
||||
equip_id_id = a.equip_id,
|
||||
repeat_remark = a.repeat_remark,
|
||||
repeat_result = a.repeat_result=="1"?"合格":"不合格",
|
||||
repeat_time = a.repeat_time==null ? null : a.repeat_time.Value.ToString("yyyy-MM-dd HH:mm"),
|
||||
repeat_time = a.repeat_time==null ? null : a.repeat_time.Value.ToString(DbTimeFormat.MM),
|
||||
repeat_user_id = d.RealName,
|
||||
result = a.result=="1"?"合格":"不合格",
|
||||
result_remark = a.result_remark,
|
||||
maintain_tem_equip_id = a.maintain_tem_equip_id,
|
||||
execute_time = a.execute_time==null ? null : a.execute_time.Value.ToString("yyyy-MM-dd HH:mm"),
|
||||
execute_time = a.execute_time==null ? null : a.execute_time.Value.ToString(DbTimeFormat.MM),
|
||||
execute_user_id = c.RealName,
|
||||
status = SqlFunc.IF(a.status.Equals("1")).Return("待执行").ElseIF(a.status.Equals("2")).Return("待复核").ElseIF(a.status.Equals("3")).Return("已完成").End("")
|
||||
}).ToPagedListAsync(input.currentPage, input.pageSize);
|
||||
@@ -272,7 +272,7 @@ namespace Tnb.EquipMgr
|
||||
equip_id = a.equip_id,
|
||||
equip_code = b.code,
|
||||
equip_name = b.name,
|
||||
create_time = a.create_time==null ? "" : a.create_time.Value.ToString("yyyy-MM-dd HH:mm:ss"),
|
||||
create_time = a.create_time==null ? "" : a.create_time.Value.ToString(DbTimeFormat.SS),
|
||||
result_remark = a.result_remark,
|
||||
result = a.result,
|
||||
status = a.status,
|
||||
|
||||
@@ -19,6 +19,7 @@ using Tnb.BasicData.Entities.Dto;
|
||||
using Tnb.EquipMgr.Entities;
|
||||
using Tnb.EquipMgr.Entities.Dto;
|
||||
using Tnb.EquipMgr.Interfaces;
|
||||
using Tnb.BasicData;
|
||||
|
||||
namespace Tnb.EquipMgr
|
||||
{
|
||||
@@ -194,16 +195,16 @@ namespace Tnb.EquipMgr
|
||||
{
|
||||
id = a.id,
|
||||
attachment = a.attachment,
|
||||
create_time = a.create_time==null ? null : a.create_time.Value.ToString("yyyy-MM-dd HH:mm"),
|
||||
create_time = a.create_time==null ? null : a.create_time.Value.ToString(DbTimeFormat.MM),
|
||||
equip_id = a.equip_id,
|
||||
repeat_remark = a.repeat_remark,
|
||||
repeat_result = a.repeat_result=="1"?"合格":"不合格",
|
||||
repeat_time = a.repeat_time==null ? null : a.repeat_time.Value.ToString("yyyy-MM-dd HH:mm"),
|
||||
repeat_time = a.repeat_time==null ? null : a.repeat_time.Value.ToString(DbTimeFormat.MM),
|
||||
repeat_user_id = b.RealName,
|
||||
result = a.result=="1"?"合格":"不合格",
|
||||
result_remark = a.result_remark,
|
||||
spot_ins_tem_equip_id = a.spot_ins_tem_equip_id,
|
||||
spot_record_date_time = a.spot_record_date_time==null ? null :a.spot_record_date_time.Value.ToString("yyyy-MM-dd HH:mm"),
|
||||
spot_record_date_time = a.spot_record_date_time==null ? null :a.spot_record_date_time.Value.ToString(DbTimeFormat.MM),
|
||||
spot_record_user_id = a.spot_record_user_id,
|
||||
status = SqlFunc.IF(a.status.Equals("1")).Return("待执行").ElseIF(a.status.Equals("2")).Return("待复核").ElseIF(a.status.Equals("3")).Return("已完成").End("")
|
||||
}).ToPagedListAsync(input.currentPage, input.pageSize);
|
||||
@@ -230,7 +231,7 @@ namespace Tnb.EquipMgr
|
||||
equip_id = a.equip_id,
|
||||
equip_code = b.code,
|
||||
equip_name = b.name,
|
||||
create_time = a.create_time==null ? "" : a.create_time.Value.ToString("yyyy-MM-dd HH:mm:ss"),
|
||||
create_time = a.create_time==null ? "" : a.create_time.Value.ToString(DbTimeFormat.SS),
|
||||
result_remark = a.result_remark,
|
||||
result = a.result,
|
||||
status = a.status,
|
||||
|
||||
@@ -122,5 +122,9 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage
|
||||
/// 预计结束时间
|
||||
/// </summary>
|
||||
public string? plan_end_date { get; set; }
|
||||
/// <summary>
|
||||
/// 实际完工日期
|
||||
/// </summary>
|
||||
public string? act_end_date { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -167,8 +167,8 @@ namespace Tnb.ProductionMgr
|
||||
{
|
||||
eqp_code = it.eqp_code,
|
||||
eqp_name = it.eqp_name,
|
||||
closedown_start_time = it.closedown_start_time.HasValue ? it.closedown_start_time.Value.ToString("yyyy-MM-dd HH:mm:ss") : null,
|
||||
closedown_end_time = it.closedown_end_time.HasValue ? it.closedown_end_time.Value.ToString("yyyy-MM-dd HH:mm:ss") : null,
|
||||
closedown_start_time = it.closedown_start_time.HasValue ? it.closedown_start_time.Value.ToString(DbTimeFormat.SS) : null,
|
||||
closedown_end_time = it.closedown_end_time.HasValue ? it.closedown_end_time.Value.ToString(DbTimeFormat.SS) : null,
|
||||
closedown_time = it.closedown_time,
|
||||
})
|
||||
.ToListAsync();
|
||||
|
||||
@@ -396,8 +396,8 @@ namespace Tnb.ProductionMgr
|
||||
id = x.id,
|
||||
mo_task_code = x.mo_task_code,
|
||||
mo_task_status = y.FullName,
|
||||
estimated_start_date = x.estimated_start_date==null ? "" : x.estimated_start_date.Value.ToString("yyyy-MM-dd HH:mm:ss"),
|
||||
estimated_end_date = x.estimated_end_date==null ? "" : x.estimated_end_date.Value.ToString("yyyy-MM-dd HH:mm:ss"),
|
||||
estimated_start_date = x.estimated_start_date==null ? "" : x.estimated_start_date.Value.ToString(DbTimeFormat.SS),
|
||||
estimated_end_date = x.estimated_end_date==null ? "" : x.estimated_end_date.Value.ToString(DbTimeFormat.SS),
|
||||
scheduled_qty = x.scheduled_qty,
|
||||
reported_work_qty = x.reported_work_qty,
|
||||
scrap_qty = x.scrap_qty,
|
||||
@@ -456,8 +456,8 @@ namespace Tnb.ProductionMgr
|
||||
material_code = b.code,
|
||||
material_name = b.name,
|
||||
material_standard = b.material_standard,
|
||||
act_start_date = a.act_start_date==null ? "" : a.act_start_date.Value.ToString("yyyy-MM-dd HH:mm:ss"),
|
||||
act_end_date = a.act_end_date==null ? "" : a.act_end_date.Value.ToString("yyyy-MM-dd HH:mm:ss")
|
||||
act_start_date = a.act_start_date==null ? "" : a.act_start_date.Value.ToString(DbTimeFormat.SS),
|
||||
act_end_date = a.act_end_date==null ? "" : a.act_end_date.Value.ToString(DbTimeFormat.SS)
|
||||
}).ToPagedListAsync(input.currentPage, input.pageSize);
|
||||
return PageResult<PrdMoFromOneListOutput>.SqlSugarPageResult(result);
|
||||
}
|
||||
@@ -500,8 +500,8 @@ namespace Tnb.ProductionMgr
|
||||
material_code = b.code,
|
||||
material_name = b.name,
|
||||
material_standard = b.material_standard,
|
||||
act_start_date = a.act_start_date == null ? "" : a.act_start_date.Value.ToString("yyyy-MM-dd HH:mm:ss"),
|
||||
act_end_date = a.act_end_date == null ? "" : a.act_end_date.Value.ToString("yyyy-MM-dd HH:mm:ss"),
|
||||
act_start_date = a.act_start_date == null ? "" : a.act_start_date.Value.ToString(DbTimeFormat.SS),
|
||||
act_end_date = a.act_end_date == null ? "" : a.act_end_date.Value.ToString(DbTimeFormat.SS),
|
||||
workshop_name = e.FullName,
|
||||
station_name = d.FullName,
|
||||
equip_code = f.code
|
||||
@@ -525,8 +525,8 @@ namespace Tnb.ProductionMgr
|
||||
material_code = b.code,
|
||||
material_name = b.name,
|
||||
material_standard = b.material_standard,
|
||||
act_start_date = a.act_start_date == null ? "" : a.act_start_date.Value.ToString("yyyy-MM-dd HH:mm:ss"),
|
||||
act_end_date = a.act_end_date == null ? "" : a.act_end_date.Value.ToString("yyyy-MM-dd HH:mm:ss"),
|
||||
act_start_date = a.act_start_date == null ? "" : a.act_start_date.Value.ToString(DbTimeFormat.SS),
|
||||
act_end_date = a.act_end_date == null ? "" : a.act_end_date.Value.ToString(DbTimeFormat.SS),
|
||||
workline_name = c.FullName,
|
||||
mbom_version = d.version
|
||||
}).ToListAsync();
|
||||
@@ -751,8 +751,8 @@ namespace Tnb.ProductionMgr
|
||||
batch = a.batch,
|
||||
supplier_name = d.supplier_name,
|
||||
check_conclusion = c.check_conclusion,
|
||||
instock_time = c.instock_time.ToString("yyyy-MM-dd HH:mm:ss"),
|
||||
feeding_time = e.create_time == null ? "" : e.create_time.Value.ToString("yyyy-MM-dd HH:mm:ss"),
|
||||
instock_time = c.instock_time.ToString(DbTimeFormat.SS),
|
||||
feeding_time = e.create_time == null ? "" : e.create_time.Value.ToString(DbTimeFormat.SS),
|
||||
}).ToListAsync();
|
||||
|
||||
}
|
||||
@@ -984,7 +984,7 @@ namespace Tnb.ProductionMgr
|
||||
feeding_detail_id = x.id,
|
||||
feeding_time = y.create_time == null
|
||||
? ""
|
||||
: y.create_time.Value.ToString("yyyy-MM-dd HH:mm:ss"),
|
||||
: y.create_time.Value.ToString(DbTimeFormat.SS),
|
||||
num = x.num,
|
||||
check_conclusion = mp.check_conclusion,
|
||||
feeding_name = z.RealName,
|
||||
|
||||
@@ -128,7 +128,7 @@ namespace Tnb.ProductionMgr
|
||||
mo_task_status = d.FullName,
|
||||
plan_qty = f.plan_qty,
|
||||
scheduled_qty = a.scheduled_qty,
|
||||
create_time = a.create_time==null ? "" :a.create_time.Value.ToString("yyyy-MM-dd HH:mm:ss"),
|
||||
create_time = a.create_time==null ? "" :a.create_time.Value.ToString(DbTimeFormat.SS),
|
||||
}).OrderByDescending(a=>a.create_time).ToPagedListAsync(input.currentPage, input.pageSize);
|
||||
return PageResult<PrdMoTaskIssueListOutput>.SqlSugarPageResult(result);
|
||||
}
|
||||
|
||||
@@ -320,13 +320,13 @@ namespace Tnb.ProductionMgr
|
||||
eqp_name = e.name,
|
||||
eqp_type_code = SqlFunc.Subqueryable<EqpEquipType>().Where(it => it.id == e.equip_type_id).Select(it => it.code),
|
||||
mo_task_qty = SqlFunc.Subqueryable<PrdMoTask>().Where(a => a.mo_id == moId).Count(),
|
||||
estimated_start_date = a.estimated_start_date.Value.ToString("yyyy-MM-dd HH:mm:ss"),
|
||||
estimated_end_date = a.estimated_end_date.Value.ToString("yyyy-MM-dd HH:mm:ss"),
|
||||
estimated_start_date = a.estimated_start_date.Value.ToString(DbTimeFormat.SS),
|
||||
estimated_end_date = a.estimated_end_date.Value.ToString(DbTimeFormat.SS),
|
||||
plan_qty = a.scheduled_qty,
|
||||
complete_qty = SqlFunc.IsNull(a.reported_work_qty,0)+SqlFunc.IsNull(a.scrap_qty,0),
|
||||
process_code = SqlFunc.Subqueryable<BasProcess>().Where(it => it.id == a.process_id).Select(it => it.process_code),
|
||||
process_name = SqlFunc.Subqueryable<BasProcess>().Where(it => it.id == a.process_id).Select(it => it.process_name),
|
||||
create_time = a.create_time==null ? "" : a.create_time.Value.ToString("yyyy-MM-dd HH:mm:ss"),
|
||||
create_time = a.create_time==null ? "" : a.create_time.Value.ToString(DbTimeFormat.SS),
|
||||
})
|
||||
.Mapper(it =>
|
||||
{
|
||||
@@ -353,11 +353,11 @@ namespace Tnb.ProductionMgr
|
||||
process_code = e.process_code,
|
||||
process_name = e.process_name,
|
||||
mo_task_qty = SqlFunc.Subqueryable<PrdMoTask>().Where(a => a.mo_id == moId).Count(),
|
||||
estimated_start_date = a.estimated_start_date.Value.ToString("yyyy-MM-dd HH:mm:ss"),
|
||||
estimated_end_date = a.estimated_end_date.Value.ToString("yyyy-MM-dd HH:mm:ss"),
|
||||
estimated_start_date = a.estimated_start_date.Value.ToString(DbTimeFormat.SS),
|
||||
estimated_end_date = a.estimated_end_date.Value.ToString(DbTimeFormat.SS),
|
||||
plan_qty = a.scheduled_qty,
|
||||
complete_qty = SqlFunc.IsNull(a.reported_work_qty,0)+SqlFunc.IsNull(a.scrap_qty,0),
|
||||
create_time = a.create_time==null ? "" : a.create_time.Value.ToString("yyyy-MM-dd HH:mm:ss"),
|
||||
create_time = a.create_time==null ? "" : a.create_time.Value.ToString(DbTimeFormat.SS),
|
||||
})
|
||||
.Mapper(it =>
|
||||
{
|
||||
@@ -399,8 +399,8 @@ namespace Tnb.ProductionMgr
|
||||
scheduled_qty = a.scheduled_qty,
|
||||
plan_qty = SqlFunc.Subqueryable<PrdMo>().Where(it => it.id == a.mo_id).Select(it => it.plan_qty),
|
||||
complete_qty = a.last_process_complete_qty,
|
||||
estimated_start_date = a.estimated_start_date==null ? null : a.estimated_start_date.Value.ToString("yyyy-MM-dd HH:mm"),
|
||||
estimated_end_date = a.estimated_end_date==null ? null : a.estimated_end_date.Value.ToString("yyyy-MM-dd HH:mm"),
|
||||
estimated_start_date = a.estimated_start_date==null ? null : a.estimated_start_date.Value.ToString(DbTimeFormat.MM),
|
||||
estimated_end_date = a.estimated_end_date==null ? null : a.estimated_end_date.Value.ToString(DbTimeFormat.MM),
|
||||
bom_id = d.id,
|
||||
bom_version = d.version
|
||||
})
|
||||
@@ -436,8 +436,8 @@ namespace Tnb.ProductionMgr
|
||||
plan_qty = d.plan_qty,
|
||||
process_task_qty = a.process_task_qty,
|
||||
complete_qty = SqlFunc.IsNull(a.reported_work_qty,0)+SqlFunc.IsNull(a.scrap_qty,0),
|
||||
estimated_start_date = a.estimated_start_date==null ? null : a.estimated_start_date.Value.ToString("yyyy-MM-dd HH:mm"),
|
||||
estimated_end_date = a.estimated_end_date==null ? null : a.estimated_end_date.Value.ToString("yyyy-MM-dd HH:mm"),
|
||||
estimated_start_date = a.estimated_start_date==null ? null : a.estimated_start_date.Value.ToString(DbTimeFormat.MM),
|
||||
estimated_end_date = a.estimated_end_date==null ? null : a.estimated_end_date.Value.ToString(DbTimeFormat.MM),
|
||||
process_name = e.process_name,
|
||||
bom_version = SqlFunc.Subqueryable<BasMbom>().Where(it => it.material_id == a.material_id).Select(it => it.version)
|
||||
})
|
||||
@@ -1163,6 +1163,10 @@ namespace Tnb.ProductionMgr
|
||||
{
|
||||
prdTaskList.ForEach(x => x.act_start_date = DateTime.Now);
|
||||
}
|
||||
if (behavior == PrdTaskBehavior.Compled)
|
||||
{
|
||||
prdTaskList.ForEach(x => x.act_end_date = DateTime.Now);
|
||||
}
|
||||
row = await db.Updateable(prdTaskList).ExecuteCommandAsync();
|
||||
foreach (var item in prdTaskList)
|
||||
{
|
||||
@@ -2080,7 +2084,7 @@ namespace Tnb.ProductionMgr
|
||||
estimated_end_date = a.estimated_end_date==null ? "" : a.estimated_end_date.Value.ToString("yyyy-MM-dd"),
|
||||
eqp_id = a.eqp_id==null ? "" : h.code+"/"+h.name,
|
||||
eqp_id_id = a.eqp_id,
|
||||
create_time = a.create_time==null ? "" :a.create_time.Value.ToString("yyyy-MM-dd HH:mm:ss")
|
||||
create_time = a.create_time==null ? "" :a.create_time.Value.ToString(DbTimeFormat.SS)
|
||||
}).OrderByDescending(a => a.create_time).ToPagedListAsync(input.currentPage, input.pageSize);
|
||||
return PageResult<WorkOrderAdjustmentListOutput>.SqlSugarPageResult(result);
|
||||
}
|
||||
|
||||
@@ -276,8 +276,8 @@ namespace Tnb.ProductionMgr
|
||||
scrap_qty = a.scrap_qty,
|
||||
scheduled_qty = a.scheduled_qty,
|
||||
reported_work_qty = a.reported_work_qty,
|
||||
estimated_start_date = a.estimated_start_date==null ? "" : a.estimated_start_date.Value.ToString("yyyy-MM-dd HH:mm:ss"),
|
||||
estimated_end_date = a.estimated_end_date==null ? "" : a.estimated_end_date.Value.ToString("yyyy-MM-dd HH:mm:ss"),
|
||||
estimated_start_date = a.estimated_start_date==null ? "" : a.estimated_start_date.Value.ToString(DbTimeFormat.SS),
|
||||
estimated_end_date = a.estimated_end_date==null ? "" : a.estimated_end_date.Value.ToString(DbTimeFormat.SS),
|
||||
parent_id = a.parent_id,
|
||||
process_id = a.process_id,
|
||||
process_name = c.process_name,
|
||||
@@ -332,8 +332,8 @@ namespace Tnb.ProductionMgr
|
||||
scrap_qty = a.scrap_qty,
|
||||
scheduled_qty = a.scheduled_qty,
|
||||
reported_work_qty = a.reported_work_qty,
|
||||
estimated_start_date = a.estimated_start_date==null ? "" : a.estimated_start_date.Value.ToString("yyyy-MM-dd HH:mm:ss"),
|
||||
estimated_end_date = a.estimated_end_date==null ? "" : a.estimated_end_date.Value.ToString("yyyy-MM-dd HH:mm:ss"),
|
||||
estimated_start_date = a.estimated_start_date==null ? "" : a.estimated_start_date.Value.ToString(DbTimeFormat.SS),
|
||||
estimated_end_date = a.estimated_end_date==null ? "" : a.estimated_end_date.Value.ToString(DbTimeFormat.SS),
|
||||
parent_id = a.parent_id,
|
||||
process_id = a.process_id,
|
||||
process_name = c.process_name,
|
||||
@@ -362,6 +362,8 @@ namespace Tnb.ProductionMgr
|
||||
Dictionary<string, object> queryJson = string.IsNullOrEmpty(input.queryJson) ? new Dictionary<string, object>() : input.queryJson.ToObject<Dictionary<string, object>>();
|
||||
string mo_task_code = queryJson.ContainsKey("mo_task_code") ? queryJson["mo_task_code"].ToString() : "";
|
||||
string status = queryJson.ContainsKey("status") ? queryJson["status"].ToString() : "";
|
||||
DateTime? start_time = queryJson.ContainsKey("start_time") ? (DateTime?)queryJson["start_time"] : null;
|
||||
DateTime? end_time = queryJson.ContainsKey("end_time") ? (DateTime?)queryJson["end_time"] : null;
|
||||
List<string> statusList = new List<string>();
|
||||
if (!string.IsNullOrEmpty(status))
|
||||
{
|
||||
@@ -402,6 +404,8 @@ namespace Tnb.ProductionMgr
|
||||
.WhereIF(!string.IsNullOrEmpty(mo_task_code),a=>a.mo_task_code.Contains(mo_task_code))
|
||||
//.WhereIF(!string.IsNullOrEmpty(mo_task_status),a=>a.mo_task_status==mo_task_status)
|
||||
.WhereIF(statusList.Count>0,a=>statusList.Contains(a.mo_task_status))
|
||||
.WhereIF(status=="3" && start_time!=null,a=>a.act_end_date>=start_time)
|
||||
.WhereIF(status=="3" && end_time!=null,a=>a.act_end_date<=end_time)
|
||||
.Select((a, b, c, d, e,f,g,h,i,j) => new PADPackageTaskPageOutput
|
||||
{
|
||||
id = a.id,
|
||||
@@ -419,8 +423,8 @@ namespace Tnb.ProductionMgr
|
||||
scrap_qty = a.scrap_qty,
|
||||
scheduled_qty = a.scheduled_qty,
|
||||
reported_work_qty = a.reported_work_qty,
|
||||
estimated_start_date = a.estimated_start_date==null ? "" : a.estimated_start_date.Value.ToString("yyyy-MM-dd HH:mm:ss"),
|
||||
estimated_end_date = a.estimated_end_date==null ? "" : a.estimated_end_date.Value.ToString("yyyy-MM-dd HH:mm:ss"),
|
||||
estimated_start_date = a.estimated_start_date==null ? "" : a.estimated_start_date.Value.ToString(DbTimeFormat.SS),
|
||||
estimated_end_date = a.estimated_end_date==null ? "" : a.estimated_end_date.Value.ToString(DbTimeFormat.SS),
|
||||
parent_id = a.parent_id,
|
||||
process_id = a.process_id,
|
||||
process_name = c.process_name,
|
||||
@@ -436,8 +440,9 @@ namespace Tnb.ProductionMgr
|
||||
mold_cavity = g.mold_cavity,
|
||||
moulding_cycle = h.moulding_cycle,
|
||||
standard_time = i.standard_time,
|
||||
act_start_date = a.act_start_date==null ? "" : a.act_start_date.Value.ToString("yyyy-MM-dd HH:mm:ss"),
|
||||
plan_end_date = a.plan_end_date==null ? "" : a.plan_end_date.Value.ToString("yyyy-MM-dd HH:mm:ss"),
|
||||
act_start_date = a.act_start_date==null ? "" : a.act_start_date.Value.ToString(DbTimeFormat.SS),
|
||||
act_end_date = a.act_end_date==null ? "" : a.act_end_date.Value.ToString(DbTimeFormat.SS),
|
||||
plan_end_date = a.plan_end_date==null ? "" : a.plan_end_date.Value.ToString(DbTimeFormat.SS),
|
||||
})
|
||||
.MergeTable()
|
||||
.OrderBy($"{input.sidx} {input.sort}")
|
||||
|
||||
@@ -126,7 +126,7 @@ namespace Tnb.ProductionMgr
|
||||
reported_qty = x.reported_qty,
|
||||
create_id = y.RealName,
|
||||
create_id_id = x.create_id,
|
||||
create_time = x.create_time==null ? "" : x.create_time.Value.ToString("yyyy-MM-dd HH:mm"),
|
||||
create_time = x.create_time==null ? "" : x.create_time.Value.ToString(DbTimeFormat.MM),
|
||||
batch = x.barcode
|
||||
})
|
||||
}).ToPagedListAsync(input.currentPage, input.pageSize);
|
||||
|
||||
Reference in New Issue
Block a user