1
This commit is contained in:
@@ -12,5 +12,7 @@ namespace Tnb.ProductionMgr.Entities.Dto
|
|||||||
public string? end_repair_time { get; set; }
|
public string? end_repair_time { get; set; }
|
||||||
public string? confirm_time { get; set; }
|
public string? confirm_time { get; set; }
|
||||||
public string status { get; set; }
|
public string status { get; set; }
|
||||||
|
public string breakdown_name { get; set; }
|
||||||
|
public string andon_type_name { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -116,8 +116,10 @@ namespace Tnb.ProductionMgr
|
|||||||
.LeftJoin<UserEntity>((a, b, c, d) => a.create_id == d.Id)
|
.LeftJoin<UserEntity>((a, b, c, d) => a.create_id == d.Id)
|
||||||
.LeftJoin<DictionaryTypeEntity>((a, b, c, d, e) => e.EnCode == DictConst.AndonStatus)
|
.LeftJoin<DictionaryTypeEntity>((a, b, c, d, e) => e.EnCode == DictConst.AndonStatus)
|
||||||
.LeftJoin<DictionaryDataEntity>((a, b, c, d, e, f) => a.status == f.EnCode && e.Id == f.DictionaryTypeId)
|
.LeftJoin<DictionaryDataEntity>((a, b, c, d, e, f) => a.status == f.EnCode && e.Id == f.DictionaryTypeId)
|
||||||
|
.LeftJoin<AndonBreakDown>((a,b,c,d,e,f,g)=>a.breakdown==g.id)
|
||||||
|
.LeftJoin<AndonType>((a,b,c,d,e,f,g,h)=>a.andon_type_id==h.id)
|
||||||
.WhereIF(statusList.Count > 0, a => statusList.Contains(a.status))
|
.WhereIF(statusList.Count > 0, a => statusList.Contains(a.status))
|
||||||
.Select((a, b, c, d, e, f) => new AndonPadListOutput
|
.Select((a, b, c, d, e, f,g,h) => new AndonPadListOutput
|
||||||
{
|
{
|
||||||
id = a.id,
|
id = a.id,
|
||||||
andon_info_name = b.name,
|
andon_info_name = b.name,
|
||||||
@@ -129,6 +131,8 @@ namespace Tnb.ProductionMgr
|
|||||||
end_repair_time = a.end_repair_time == null ? "" : a.end_repair_time.Value.ToString(DbTimeFormat.SS),
|
end_repair_time = a.end_repair_time == null ? "" : a.end_repair_time.Value.ToString(DbTimeFormat.SS),
|
||||||
confirm_time = a.confirm_time == null ? "" : a.confirm_time.Value.ToString(DbTimeFormat.SS),
|
confirm_time = a.confirm_time == null ? "" : a.confirm_time.Value.ToString(DbTimeFormat.SS),
|
||||||
status = f.FullName,
|
status = f.FullName,
|
||||||
|
andon_type_name = h.name,
|
||||||
|
breakdown_name = g.name
|
||||||
})
|
})
|
||||||
.MergeTable()
|
.MergeTable()
|
||||||
.OrderBy($"{input.sidx} {input.sort}")
|
.OrderBy($"{input.sidx} {input.sort}")
|
||||||
@@ -142,7 +146,10 @@ namespace Tnb.ProductionMgr
|
|||||||
public async Task<dynamic> AddAndon(AddAndonInput input)
|
public async Task<dynamic> AddAndon(AddAndonInput input)
|
||||||
{
|
{
|
||||||
AndonInfo andonInfo = await _db.Queryable<AndonInfo>().SingleAsync(x => x.id == input.andon_info_id);
|
AndonInfo andonInfo = await _db.Queryable<AndonInfo>().SingleAsync(x => x.id == input.andon_info_id);
|
||||||
|
AndonBreakDown andonBreakDown = await _db.Queryable<AndonBreakDown>().SingleAsync(x => x.id == input.andon_breakdown_id);
|
||||||
AndonRecords andonRecords = input.Adapt<AndonRecords>();
|
AndonRecords andonRecords = input.Adapt<AndonRecords>();
|
||||||
|
andonRecords.breakdown = input.andon_breakdown_id;
|
||||||
|
andonRecords.breakdown_type = andonBreakDown?.type_id;
|
||||||
DbResult<bool> result = await _db.Ado.UseTranAsync(async () =>
|
DbResult<bool> result = await _db.Ado.UseTranAsync(async () =>
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -279,6 +286,7 @@ namespace Tnb.ProductionMgr
|
|||||||
{
|
{
|
||||||
_ = await _db.Updateable<AndonRecords>()
|
_ = await _db.Updateable<AndonRecords>()
|
||||||
.SetColumns(x => x.repair_id == _userManager.UserId)
|
.SetColumns(x => x.repair_id == _userManager.UserId)
|
||||||
|
.SetColumns(x=>x.status==DictConst.AndonStatusYXY)
|
||||||
.SetColumns(x => x.response_time == DateTime.Now)
|
.SetColumns(x => x.response_time == DateTime.Now)
|
||||||
.ExecuteCommandAsync();
|
.ExecuteCommandAsync();
|
||||||
Dictionary<string, string> postData = new()
|
Dictionary<string, string> postData = new()
|
||||||
@@ -320,6 +328,7 @@ namespace Tnb.ProductionMgr
|
|||||||
{
|
{
|
||||||
_ = await _db.Updateable<AndonRecords>()
|
_ = await _db.Updateable<AndonRecords>()
|
||||||
.SetColumns(x => x.start_repair_time == DateTime.Now)
|
.SetColumns(x => x.start_repair_time == DateTime.Now)
|
||||||
|
.SetColumns(x=>x.status==DictConst.AndonStatusCLZ)
|
||||||
.Where(x => x.id == id)
|
.Where(x => x.id == id)
|
||||||
.ExecuteCommandAsync();
|
.ExecuteCommandAsync();
|
||||||
return true;
|
return true;
|
||||||
@@ -356,6 +365,7 @@ namespace Tnb.ProductionMgr
|
|||||||
{
|
{
|
||||||
_ = await _db.Updateable<AndonRecords>()
|
_ = await _db.Updateable<AndonRecords>()
|
||||||
.SetColumns(x => x.end_repair_time == DateTime.Now)
|
.SetColumns(x => x.end_repair_time == DateTime.Now)
|
||||||
|
.SetColumns(x=>x.status==DictConst.AndonStatusDQR)
|
||||||
.Where(x => x.id == id)
|
.Where(x => x.id == id)
|
||||||
.ExecuteCommandAsync();
|
.ExecuteCommandAsync();
|
||||||
return true;
|
return true;
|
||||||
@@ -392,6 +402,7 @@ namespace Tnb.ProductionMgr
|
|||||||
{
|
{
|
||||||
_ = await _db.Updateable<AndonRecords>()
|
_ = await _db.Updateable<AndonRecords>()
|
||||||
.SetColumns(x => x.confirm_time == DateTime.Now)
|
.SetColumns(x => x.confirm_time == DateTime.Now)
|
||||||
|
.SetColumns(x=>x.status==DictConst.AndonStatusYWC)
|
||||||
.Where(x => x.id == id)
|
.Where(x => x.id == id)
|
||||||
.ExecuteCommandAsync();
|
.ExecuteCommandAsync();
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user