呼梯时,到指定目标楼层,根据任务的start_floor来
This commit is contained in:
@@ -138,6 +138,33 @@ public static class DictConst
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public const string TaskStatus = "TaskStatus";
|
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
|
#endregion
|
||||||
|
|
||||||
#region WarehouseMgr
|
#region WarehouseMgr
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ namespace Tnb.ProductionMgr.Entities.Dto
|
|||||||
{
|
{
|
||||||
public string andon_type_id { get; set; }
|
public string andon_type_id { get; set; }
|
||||||
|
|
||||||
|
public string status { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 页码.
|
/// 页码.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -11,5 +11,6 @@ namespace Tnb.ProductionMgr.Entities.Dto
|
|||||||
public string? start_repair_time { get; set; }
|
public string? start_repair_time { get; set; }
|
||||||
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; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -45,5 +45,7 @@ namespace Tnb.ProductionMgr.Entities
|
|||||||
public DateTime? end_repair_time { get; set; }
|
public DateTime? end_repair_time { get; set; }
|
||||||
public DateTime? confirm_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 Tnb.BasicData.Entities;
|
||||||
using JNPF.Systems.Entitys.System;
|
using JNPF.Systems.Entitys.System;
|
||||||
using JNPF.Message.Entitys.Entity;
|
using JNPF.Message.Entitys.Entity;
|
||||||
|
using Tnb.BasicData;
|
||||||
using Tnb.BasicData.Interfaces;
|
using Tnb.BasicData.Interfaces;
|
||||||
using MessageTemplateEntity = JNPF.Message.Entitys.Entity.MessageTemplateEntity;
|
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<AndonInfo>((a, b) => a.andon_info_id == b.id)
|
||||||
.LeftJoin<UserEntity>((a, b, c) => a.repair_id == c.Id)
|
.LeftJoin<UserEntity>((a, b, c) => a.repair_id == c.Id)
|
||||||
.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<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)
|
.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,
|
id = a.id,
|
||||||
andon_info_name = b.name,
|
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"),
|
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"),
|
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"),
|
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);
|
}).ToPagedListAsync(input.currentPage, input.pageSize);
|
||||||
|
|
||||||
return PageResult<AndonPadListOutput>.SqlSugarPageResult(result);
|
return PageResult<AndonPadListOutput>.SqlSugarPageResult(result);
|
||||||
@@ -87,6 +92,7 @@ namespace Tnb.ProductionMgr
|
|||||||
|
|
||||||
andonRecords.create_time = DateTime.Now;
|
andonRecords.create_time = DateTime.Now;
|
||||||
andonRecords.create_id = _userManager.UserId;
|
andonRecords.create_id = _userManager.UserId;
|
||||||
|
andonRecords.status = DictConst.AndonStatusHJZ;
|
||||||
|
|
||||||
|
|
||||||
List<string> toUsers = new List<string>();
|
List<string> toUsers = new List<string>();
|
||||||
@@ -207,6 +213,12 @@ namespace Tnb.ProductionMgr
|
|||||||
throw Oops.Bah($"{user.RealName}已响应");
|
throw Oops.Bah($"{user.RealName}已响应");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
if (andonRecords.status != DictConst.AndonStatusHJZ)
|
||||||
|
{
|
||||||
|
throw Oops.Bah($"状态错误");
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
await _db.Updateable<AndonRecords>()
|
await _db.Updateable<AndonRecords>()
|
||||||
.SetColumns(x => x.repair_id == _userManager.UserId)
|
.SetColumns(x => x.repair_id == _userManager.UserId)
|
||||||
@@ -217,9 +229,11 @@ namespace Tnb.ProductionMgr
|
|||||||
["id"] = andonRecords.id
|
["id"] = andonRecords.id
|
||||||
};
|
};
|
||||||
await _basPushRuleLogService.Stop(postData);
|
await _basPushRuleLogService.Stop(postData);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -233,6 +247,12 @@ namespace Tnb.ProductionMgr
|
|||||||
string id = dic.ContainsKey("id") ? dic["id"] : "";
|
string id = dic.ContainsKey("id") ? dic["id"] : "";
|
||||||
AndonRecords andonRecords = await _db.Queryable<AndonRecords>().SingleAsync(x => x.id == id);
|
AndonRecords andonRecords = await _db.Queryable<AndonRecords>().SingleAsync(x => x.id == id);
|
||||||
if (andonRecords != null)
|
if (andonRecords != null)
|
||||||
|
{
|
||||||
|
if (andonRecords.status != DictConst.AndonStatusYXY)
|
||||||
|
{
|
||||||
|
throw Oops.Bah($"状态错误");
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
await _db.Updateable<AndonRecords>()
|
await _db.Updateable<AndonRecords>()
|
||||||
.SetColumns(x=>x.start_repair_time==DateTime.Now)
|
.SetColumns(x=>x.start_repair_time==DateTime.Now)
|
||||||
@@ -240,6 +260,8 @@ namespace Tnb.ProductionMgr
|
|||||||
.ExecuteCommandAsync();
|
.ExecuteCommandAsync();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
throw Oops.Bah($"无该andon记录");
|
throw Oops.Bah($"无该andon记录");
|
||||||
@@ -252,6 +274,12 @@ namespace Tnb.ProductionMgr
|
|||||||
string id = dic.ContainsKey("id") ? dic["id"] : "";
|
string id = dic.ContainsKey("id") ? dic["id"] : "";
|
||||||
AndonRecords andonRecords = await _db.Queryable<AndonRecords>().SingleAsync(x => x.id == id);
|
AndonRecords andonRecords = await _db.Queryable<AndonRecords>().SingleAsync(x => x.id == id);
|
||||||
if (andonRecords != null)
|
if (andonRecords != null)
|
||||||
|
{
|
||||||
|
if (andonRecords.status != DictConst.AndonStatusCLZ)
|
||||||
|
{
|
||||||
|
throw Oops.Bah($"状态错误");
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
await _db.Updateable<AndonRecords>()
|
await _db.Updateable<AndonRecords>()
|
||||||
.SetColumns(x=>x.end_repair_time==DateTime.Now)
|
.SetColumns(x=>x.end_repair_time==DateTime.Now)
|
||||||
@@ -259,6 +287,8 @@ namespace Tnb.ProductionMgr
|
|||||||
.ExecuteCommandAsync();
|
.ExecuteCommandAsync();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
throw Oops.Bah($"无该andon记录");
|
throw Oops.Bah($"无该andon记录");
|
||||||
@@ -271,6 +301,12 @@ namespace Tnb.ProductionMgr
|
|||||||
string id = dic.ContainsKey("id") ? dic["id"] : "";
|
string id = dic.ContainsKey("id") ? dic["id"] : "";
|
||||||
AndonRecords andonRecords = await _db.Queryable<AndonRecords>().SingleAsync(x => x.id == id);
|
AndonRecords andonRecords = await _db.Queryable<AndonRecords>().SingleAsync(x => x.id == id);
|
||||||
if (andonRecords != null)
|
if (andonRecords != null)
|
||||||
|
{
|
||||||
|
if (andonRecords.status != DictConst.AndonStatusYWC)
|
||||||
|
{
|
||||||
|
throw Oops.Bah($"状态错误");
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
await _db.Updateable<AndonRecords>()
|
await _db.Updateable<AndonRecords>()
|
||||||
.SetColumns(x=>x.confirm_time==DateTime.Now)
|
.SetColumns(x=>x.confirm_time==DateTime.Now)
|
||||||
@@ -278,6 +314,8 @@ namespace Tnb.ProductionMgr
|
|||||||
.ExecuteCommandAsync();
|
.ExecuteCommandAsync();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
throw Oops.Bah($"无该andon记录");
|
throw Oops.Bah($"无该andon记录");
|
||||||
|
|||||||
Reference in New Issue
Block a user