质量统计
This commit is contained in:
@@ -3,8 +3,12 @@ using Infrastructure.Constant;
|
||||
using Infrastructure.Model;
|
||||
using IPTools.Core;
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics.Metrics;
|
||||
using UAParser;
|
||||
using ZR.Admin.WebApi.Extensions;
|
||||
using ZR.Service.mes.qc;
|
||||
using ZR.Service.mes.qc.IService;
|
||||
using ZR.Service.System.IService;
|
||||
|
||||
namespace ZR.Admin.WebApi.Hubs
|
||||
@@ -18,10 +22,12 @@ namespace ZR.Admin.WebApi.Hubs
|
||||
public static readonly List<OnlineUsers> clientUsers = new();
|
||||
private readonly NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
|
||||
private readonly ISysNoticeService SysNoticeService;
|
||||
private readonly IFirstFQCService firstFQCService;
|
||||
|
||||
public MessageHub(ISysNoticeService noticeService)
|
||||
public MessageHub(ISysNoticeService noticeService, IFirstFQCService firstFQCService)
|
||||
{
|
||||
SysNoticeService = noticeService;
|
||||
this.firstFQCService = firstFQCService;
|
||||
}
|
||||
|
||||
private ApiResult SendNotice()
|
||||
@@ -102,5 +108,32 @@ namespace ZR.Admin.WebApi.Hubs
|
||||
Console.WriteLine($"{connectId},message={message}");
|
||||
await Clients.Client(connectId).SendAsync("receiveChat", new { userName, message });
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存油漆缺陷采集累加信息
|
||||
/// </summary>
|
||||
/// <param name="workorderid">工单id</param>
|
||||
/// <param name="checkid">检测项</param>
|
||||
/// <returns></returns>
|
||||
public async Task SaveCacheInformation(string workorderid, string Moudle, string checkid)
|
||||
{
|
||||
|
||||
if (CacheHelper.Exists(checkid))
|
||||
{
|
||||
int sum = Convert.ToInt32(CacheHelper.GetCache(checkid)) + 1;
|
||||
logger.Info($"当前保存工单号{workorderid},检测项{checkid},累加的数为{sum}");
|
||||
CacheHelper.SetCache(checkid, sum);
|
||||
//SaveinspectItem
|
||||
await firstFQCService.SaveinspectItem(workorderid,Moudle, checkid,sum);
|
||||
await Clients.All.SendAsync("GetCache", Moudle,checkid, sum);
|
||||
}
|
||||
else
|
||||
{
|
||||
CacheHelper.SetCache(checkid, 1);
|
||||
logger.Info($"当前保存工单号{workorderid},检测项{checkid},累加的数为1");
|
||||
await firstFQCService.SaveinspectItem(workorderid, Moudle, checkid, 1);
|
||||
await Clients.All.SendAsync("GetCache", Moudle, checkid, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user