andon相关接口

This commit is contained in:
2023-10-07 17:28:47 +08:00
parent bd86072173
commit 861be92ec4
4 changed files with 70 additions and 0 deletions

View File

@@ -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.Interfaces;
using MessageTemplateEntity = JNPF.Message.Entitys.Entity.MessageTemplateEntity;
namespace Tnb.ProductionMgr
@@ -35,16 +36,19 @@ namespace Tnb.ProductionMgr
private readonly ISqlSugarClient _db;
private readonly IUserManager _userManager;
private SendMessageService _sendMessageService;
private readonly IBasPushRuleLogService _basPushRuleLogService;
private readonly TimeTaskService _timeTaskService;
public AndonRecordService(ISqlSugarRepository<AndonRecords> repository,
SendMessageService sendMessageService,
TimeTaskService timeTaskService,
IBasPushRuleLogService basPushRuleLogService,
IUserManager userManager)
{
_userManager = userManager;
_sendMessageService = sendMessageService;
_timeTaskService = timeTaskService;
_basPushRuleLogService = basPushRuleLogService;
_db = repository.AsSugarClient();
}
@@ -119,6 +123,8 @@ namespace Tnb.ProductionMgr
}
}
await _db.Insertable<AndonRecords>(andonRecords).ExecuteCommandAsync();
});
if (result.IsSuccess)
@@ -206,6 +212,11 @@ namespace Tnb.ProductionMgr
.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;
}
}
@@ -224,6 +235,7 @@ namespace Tnb.ProductionMgr
{
await _db.Updateable<AndonRecords>()
.SetColumns(x=>x.start_repair_time==DateTime.Now)
.Where(x=>x.id==id)
.ExecuteCommandAsync();
return true;
}
@@ -242,6 +254,7 @@ namespace Tnb.ProductionMgr
{
await _db.Updateable<AndonRecords>()
.SetColumns(x=>x.end_repair_time==DateTime.Now)
.Where(x=>x.id==id)
.ExecuteCommandAsync();
return true;
}
@@ -260,6 +273,7 @@ namespace Tnb.ProductionMgr
{
await _db.Updateable<AndonRecords>()
.SetColumns(x=>x.confirm_time==DateTime.Now)
.Where(x=>x.id==id)
.ExecuteCommandAsync();
return true;
}