质量统计

This commit is contained in:
qianhao.xu
2023-12-12 22:26:20 +08:00
parent 3429a1e39e
commit 21ceea2a5b
14 changed files with 510 additions and 14 deletions

View File

@@ -0,0 +1,41 @@
using Microsoft.AspNetCore.Mvc;
using ZR.Model.mes.pro;
using ZR.Model.MES.op.DTO;
using ZR.Service.mes.pro;
using ZR.Service.MES.op.IService;
namespace ZR.Admin.WebApi.Controllers.mes.op.quality
{
[Route("mes/op/operation/quality")]
public class QualityStatisticsController : BaseController
{
private readonly IOperationService operationService;
public QualityStatisticsController(IOperationService operationService)
{
this.operationService = operationService;
}
/// <summary>
/// 获取质量统计表
/// </summary>
/// <param name="workorderid"></param>
/// <param name="pageNum"></param>
/// <param name="pageSize"></param>
/// <param name="year"></param>
/// <param name="week"></param>
/// <param name="date"></param>
/// <returns></returns>
[HttpGet("gueryQualityStatisticsTable")]
public IActionResult GueryQualityStatisticsTable(int pageNum, int pageSize, int year = -1, int week = -1, int date = -1, string workorderid = "")
{
(List<QcFqcDTO>, int) data = operationService.GueryQualityStatistics(workorderid,pageNum, pageSize, year, week, date);
return ToResponse(new ApiResult(200, "success", data));
}
}
}

View File

@@ -41,17 +41,17 @@ namespace ZR.Admin.WebApi.Controllers.mes.qc.IQC
{
CheckItemTableDTO itemTableDTO= fQCService.GetCheckItemTable();
hubContext.Clients.All.SendAsync(HubsConstant.mymy, "123456");
return SUCCESS(itemTableDTO);
}
[HttpGet("getcheckitemRecord")]
public IActionResult GetcheckitemRecord()
{
return null;
}
}
}

View File

@@ -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);
}
}
}
}

View File

@@ -9,8 +9,9 @@
"urls": "http://localhost:8888", //app会默认去读项目启动url如果改动端口前端对应devServer也需要进行修改
"dbConfigs": [
{
"Conn": "Data Source=192.168.0.36;User ID=root;Password=123456;Initial Catalog=ZrAdmin;",
// "Conn": "Data Source=127.0.0.1;User ID=sa;Password=123456;Initial Catalog=ZrAdmin;",
//"Conn": "Data Source=192.168.0.36;User ID=root;Password=123456;Initial Catalog=ZrAdmin;",
"Conn": "Data Source=47.116.122.230;Port=3307;User ID=root;Password=123456;Initial Catalog=ZrAdmin;",
"DbType": 0, //数据库类型 MySql = 0, SqlServer = 1, Oracle = 3PgSql = 4
"ConfigId": "0", //多租户唯一标识
"IsAutoCloseConnection": true