andon增加状态
This commit is contained in:
@@ -137,6 +137,33 @@ public static class DictConst
|
||||
/// 任务单状态key
|
||||
/// </summary>
|
||||
public const string TaskStatus = "TaskStatus";
|
||||
|
||||
/// <summary>
|
||||
/// andon状态key
|
||||
/// </summary>
|
||||
public const string AndonStatus = "AndonStatus";
|
||||
|
||||
/// <summary>
|
||||
/// andon状态呼叫中
|
||||
/// </summary>
|
||||
public const string AndonStatusHJZ = "1";
|
||||
/// <summary>
|
||||
/// andon状态已响应
|
||||
/// </summary>
|
||||
public const string AndonStatusYXY = "2";
|
||||
/// <summary>
|
||||
/// andon状态处理中
|
||||
/// </summary>
|
||||
public const string AndonStatusCLZ = "3";
|
||||
/// <summary>
|
||||
/// andon状态待确认
|
||||
/// </summary>
|
||||
public const string AndonStatusDQR = "4";
|
||||
/// <summary>
|
||||
/// andon状态已完成
|
||||
/// </summary>
|
||||
public const string AndonStatusYWC = "5";
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@ namespace Tnb.ProductionMgr.Entities.Dto
|
||||
{
|
||||
public string andon_type_id { get; set; }
|
||||
|
||||
public string status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 页码.
|
||||
/// </summary>
|
||||
|
||||
@@ -11,5 +11,6 @@ namespace Tnb.ProductionMgr.Entities.Dto
|
||||
public string? start_repair_time { get; set; }
|
||||
public string? end_repair_time { get; set; }
|
||||
public string? confirm_time { get; set; }
|
||||
public string status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -45,5 +45,7 @@ namespace Tnb.ProductionMgr.Entities
|
||||
public DateTime? end_repair_time { get; set; }
|
||||
public DateTime? confirm_time { get; set; }
|
||||
|
||||
public string status { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ using Tnb.ProductionMgr.Interfaces;
|
||||
using Tnb.BasicData.Entities;
|
||||
using JNPF.Systems.Entitys.System;
|
||||
using JNPF.Message.Entitys.Entity;
|
||||
using Tnb.BasicData;
|
||||
using Tnb.BasicData.Interfaces;
|
||||
using MessageTemplateEntity = JNPF.Message.Entitys.Entity.MessageTemplateEntity;
|
||||
|
||||
@@ -59,8 +60,11 @@ namespace Tnb.ProductionMgr
|
||||
.LeftJoin<AndonInfo>((a, b) => a.andon_info_id == b.id)
|
||||
.LeftJoin<UserEntity>((a, b, c) => a.repair_id == c.Id)
|
||||
.LeftJoin<UserEntity>((a, b, c, d) => a.create_id == d.Id)
|
||||
.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)
|
||||
.Where((a, b, c, d) => a.andon_type_id == input.andon_type_id)
|
||||
.Select((a, b, c, d) => new AndonPadListOutput
|
||||
.WhereIF(!string.IsNullOrEmpty(input.status),(a, b, c, d)=>a.status==input.status)
|
||||
.Select((a, b, c, d,e,f) => new AndonPadListOutput
|
||||
{
|
||||
id = a.id,
|
||||
andon_info_name = b.name,
|
||||
@@ -71,6 +75,7 @@ namespace Tnb.ProductionMgr
|
||||
start_repair_time = a.start_repair_time == null ? "" : a.start_repair_time.Value.ToString("yyyy-MM-dd hh:mm:ss"),
|
||||
end_repair_time = a.end_repair_time == null ? "" : a.end_repair_time.Value.ToString("yyyy-MM-dd hh:mm:ss"),
|
||||
confirm_time = a.confirm_time == null ? "" : a.confirm_time.Value.ToString("yyyy-MM-dd hh:mm:ss"),
|
||||
status = f.FullName,
|
||||
}).ToPagedListAsync(input.currentPage, input.pageSize);
|
||||
|
||||
return PageResult<AndonPadListOutput>.SqlSugarPageResult(result);
|
||||
@@ -87,6 +92,7 @@ namespace Tnb.ProductionMgr
|
||||
|
||||
andonRecords.create_time = DateTime.Now;
|
||||
andonRecords.create_id = _userManager.UserId;
|
||||
andonRecords.status = DictConst.AndonStatusHJZ;
|
||||
|
||||
|
||||
List<string> toUsers = new List<string>();
|
||||
@@ -208,17 +214,25 @@ namespace Tnb.ProductionMgr
|
||||
}
|
||||
else
|
||||
{
|
||||
await _db.Updateable<AndonRecords>()
|
||||
.SetColumns(x => x.repair_id == _userManager.UserId)
|
||||
.SetColumns(x=>x.response_time==DateTime.Now)
|
||||
.ExecuteCommandAsync();
|
||||
Dictionary<string, string> postData = new Dictionary<string, string>()
|
||||
if (andonRecords.status != DictConst.AndonStatusHJZ)
|
||||
{
|
||||
["id"] = andonRecords.id
|
||||
};
|
||||
await _basPushRuleLogService.Stop(postData);
|
||||
throw Oops.Bah($"状态错误");
|
||||
}
|
||||
else
|
||||
{
|
||||
await _db.Updateable<AndonRecords>()
|
||||
.SetColumns(x => x.repair_id == _userManager.UserId)
|
||||
.SetColumns(x=>x.response_time==DateTime.Now)
|
||||
.ExecuteCommandAsync();
|
||||
Dictionary<string, string> postData = new Dictionary<string, string>()
|
||||
{
|
||||
["id"] = andonRecords.id
|
||||
};
|
||||
await _basPushRuleLogService.Stop(postData);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -234,11 +248,19 @@ namespace Tnb.ProductionMgr
|
||||
AndonRecords andonRecords = await _db.Queryable<AndonRecords>().SingleAsync(x => x.id == id);
|
||||
if (andonRecords != null)
|
||||
{
|
||||
await _db.Updateable<AndonRecords>()
|
||||
.SetColumns(x=>x.start_repair_time==DateTime.Now)
|
||||
.Where(x=>x.id==id)
|
||||
.ExecuteCommandAsync();
|
||||
return true;
|
||||
if (andonRecords.status != DictConst.AndonStatusYXY)
|
||||
{
|
||||
throw Oops.Bah($"状态错误");
|
||||
}
|
||||
else
|
||||
{
|
||||
await _db.Updateable<AndonRecords>()
|
||||
.SetColumns(x=>x.start_repair_time==DateTime.Now)
|
||||
.Where(x=>x.id==id)
|
||||
.ExecuteCommandAsync();
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -253,11 +275,19 @@ namespace Tnb.ProductionMgr
|
||||
AndonRecords andonRecords = await _db.Queryable<AndonRecords>().SingleAsync(x => x.id == id);
|
||||
if (andonRecords != null)
|
||||
{
|
||||
await _db.Updateable<AndonRecords>()
|
||||
.SetColumns(x=>x.end_repair_time==DateTime.Now)
|
||||
.Where(x=>x.id==id)
|
||||
.ExecuteCommandAsync();
|
||||
if (andonRecords.status != DictConst.AndonStatusCLZ)
|
||||
{
|
||||
throw Oops.Bah($"状态错误");
|
||||
}
|
||||
else
|
||||
{
|
||||
await _db.Updateable<AndonRecords>()
|
||||
.SetColumns(x=>x.end_repair_time==DateTime.Now)
|
||||
.Where(x=>x.id==id)
|
||||
.ExecuteCommandAsync();
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -272,11 +302,19 @@ namespace Tnb.ProductionMgr
|
||||
AndonRecords andonRecords = await _db.Queryable<AndonRecords>().SingleAsync(x => x.id == id);
|
||||
if (andonRecords != null)
|
||||
{
|
||||
await _db.Updateable<AndonRecords>()
|
||||
.SetColumns(x=>x.confirm_time==DateTime.Now)
|
||||
.Where(x=>x.id==id)
|
||||
.ExecuteCommandAsync();
|
||||
return true;
|
||||
if (andonRecords.status != DictConst.AndonStatusYWC)
|
||||
{
|
||||
throw Oops.Bah($"状态错误");
|
||||
}
|
||||
else
|
||||
{
|
||||
await _db.Updateable<AndonRecords>()
|
||||
.SetColumns(x=>x.confirm_time==DateTime.Now)
|
||||
.Where(x=>x.id==id)
|
||||
.ExecuteCommandAsync();
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user