预备signalr
This commit is contained in:
parent
4fc6dd5d8c
commit
3429a1e39e
@ -13,5 +13,6 @@ namespace Infrastructure.Constant
|
||||
public static string OnlineNum = "onlineNum";
|
||||
public static string MoreNotice = "moreNotice";
|
||||
public static string OnlineUser = "onlineUser";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
57
ZR.Admin.WebApi/Controllers/mes/qc/FQC/FirstFQCController.cs
Normal file
57
ZR.Admin.WebApi/Controllers/mes/qc/FQC/FirstFQCController.cs
Normal file
@ -0,0 +1,57 @@
|
||||
using Infrastructure.Constant;
|
||||
using Infrastructure.Extensions;
|
||||
using JinianNet.JNTemplate;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Text.Json;
|
||||
using ZR.Admin.WebApi.Extensions;
|
||||
using ZR.Admin.WebApi.Hubs;
|
||||
using ZR.Model.MES.qc.DTO;
|
||||
using ZR.Model.MES.qu;
|
||||
using ZR.Service.mes.qc.IService;
|
||||
using ZR.Service.System;
|
||||
using static System.Runtime.InteropServices.JavaScript.JSType;
|
||||
|
||||
namespace ZR.Admin.WebApi.Controllers.mes.qc.IQC
|
||||
{
|
||||
|
||||
|
||||
[Route("mes/qc/FQC")]
|
||||
public class FirstFQCController : BaseController
|
||||
{
|
||||
private readonly IFirstFQCService fQCService;
|
||||
private readonly IHubContext<MessageHub> hubContext;
|
||||
|
||||
public FirstFQCController(IFirstFQCService fQCService, IHubContext<MessageHub> hubContext) {
|
||||
this.fQCService = fQCService;
|
||||
this.hubContext = hubContext;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取 检测项 填充
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("getcheckItemTable")]
|
||||
public IActionResult GetcheckItemTable()
|
||||
{
|
||||
|
||||
CheckItemTableDTO itemTableDTO= fQCService.GetCheckItemTable();
|
||||
hubContext.Clients.All.SendAsync(HubsConstant.mymy, "123456");
|
||||
return SUCCESS(itemTableDTO);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -31,14 +31,9 @@ namespace ZR.Admin.WebApi.Controllers.mes.qc
|
||||
/// <returns></returns>
|
||||
[HttpGet("getinspectionItemList")]
|
||||
public IActionResult GetinspectionItemList(string inspectionModule="",string inspectionType="")
|
||||
{
|
||||
|
||||
{
|
||||
List<QcInspectionitem> data = qcinspection.GetinspectionItemList(inspectionModule, inspectionType);
|
||||
|
||||
|
||||
|
||||
return ToResponse(new ApiResult(200, "success", data));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -61,7 +61,7 @@ namespace ZR.Admin.WebApi.Hubs
|
||||
};
|
||||
clientUsers.Add(users);
|
||||
Console.WriteLine($"{DateTime.Now}:{name},{Context.ConnectionId}连接服务端success,当前已连接{clientUsers.Count}个");
|
||||
//Clients.All.SendAsync("welcome", $"欢迎您:{name},当前时间:{DateTime.Now}");
|
||||
Clients.All.SendAsync("welcome", $"欢迎您:{name},当前时间:{DateTime.Now}");
|
||||
Clients.All.SendAsync(HubsConstant.MoreNotice, SendNotice());
|
||||
}
|
||||
|
||||
@ -90,7 +90,7 @@ namespace ZR.Admin.WebApi.Hubs
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 注册信息
|
||||
/// 注册信息 todo vue向服务器端发送请求 注意参数一致和集线器转发的客户端
|
||||
/// </summary>
|
||||
/// <param name="connectId"></param>
|
||||
/// <param name="userName"></param>
|
||||
@ -100,7 +100,6 @@ namespace ZR.Admin.WebApi.Hubs
|
||||
public async Task SendMessage(string connectId, string userName, string message)
|
||||
{
|
||||
Console.WriteLine($"{connectId},message={message}");
|
||||
|
||||
await Clients.Client(connectId).SendAsync("receiveChat", new { userName, message });
|
||||
}
|
||||
}
|
||||
|
||||
@ -137,6 +137,7 @@ app.UseRateLimiter();
|
||||
//设置socket连接
|
||||
app.MapHub<MessageHub>("/msgHub");
|
||||
|
||||
|
||||
app.MapControllerRoute(
|
||||
name: "default",
|
||||
pattern: "{controller=Home}/{action=Index}/{id?}");
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
"commandName": "Project",
|
||||
"dotnetRunMessages": true,
|
||||
"launchUrl": "",
|
||||
"applicationUrl": "http://localhost:8888",
|
||||
"applicationUrl": "http://localhost:8889",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"urls": "http://localhost:8888", //项目启动url,如果改动端口前端对应devServer也需要进行修改
|
||||
"urls": "http://localhost:8888", //(app会默认去读)项目启动url,如果改动端口前端对应devServer也需要进行修改
|
||||
"dbConfigs": [
|
||||
{
|
||||
"Conn": "Data Source=192.168.0.36;User ID=root;Password=123456;Initial Catalog=ZrAdmin;",
|
||||
|
||||
19
ZR.Model/MES/qc/DTO/CheckItemTableDTO.cs
Normal file
19
ZR.Model/MES/qc/DTO/CheckItemTableDTO.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using ZR.Model.MES.qu;
|
||||
|
||||
namespace ZR.Model.MES.qc.DTO
|
||||
{
|
||||
public class CheckItemTableDTO
|
||||
{
|
||||
|
||||
public List<QcInspectionitem> Paint { set; get; }
|
||||
public List<QcInspectionitem> device { set; get; }
|
||||
public List<QcInspectionitem> Blank { set; get; }
|
||||
public List<QcInspectionitem> program { set; get; }
|
||||
public List<QcInspectionitem> Team { set; get; }
|
||||
}
|
||||
}
|
||||
61
ZR.Model/MES/qc/QcAgaininspectionPolish.cs
Normal file
61
ZR.Model/MES/qc/QcAgaininspectionPolish.cs
Normal file
@ -0,0 +1,61 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ZR.Model.MES.qc
|
||||
{
|
||||
/// <summary>
|
||||
/// 二检打磨表
|
||||
///</summary>
|
||||
[SugarTable("qc_againinspection_polish")]
|
||||
public class QcAgaininspectionPolish
|
||||
{
|
||||
/// <summary>
|
||||
/// 流水号
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "id", IsPrimaryKey = true)]
|
||||
public string Id { get; set; }
|
||||
/// <summary>
|
||||
/// fk_终检id
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "fk_FQC_id")]
|
||||
public string FkFqcId { get; set; }
|
||||
/// <summary>
|
||||
/// fk_检测项
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "fk_inspectionItem_id")]
|
||||
public string FkInspectionitemId { get; set; }
|
||||
/// <summary>
|
||||
/// 产品名称
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "productName")]
|
||||
public string ProductName { get; set; }
|
||||
/// <summary>
|
||||
/// 数量
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "number")]
|
||||
public string Number { get; set; }
|
||||
/// <summary>
|
||||
/// 创建人
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CREATED_BY")]
|
||||
public string CreatedBy { get; set; }
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CREATED_TIME")]
|
||||
public DateTime? CreatedTime { get; set; }
|
||||
/// <summary>
|
||||
/// 更新人
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "UPDATED_BY")]
|
||||
public string UpdatedBy { get; set; }
|
||||
/// <summary>
|
||||
/// 更新时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "UPDATED_TIME")]
|
||||
public DateTime? UpdatedTime { get; set; }
|
||||
}
|
||||
}
|
||||
61
ZR.Model/MES/qc/QcAgaininspectionUselessnum.cs
Normal file
61
ZR.Model/MES/qc/QcAgaininspectionUselessnum.cs
Normal file
@ -0,0 +1,61 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ZR.Model.MES.qc
|
||||
{
|
||||
/// <summary>
|
||||
/// 二检报废表
|
||||
///</summary>
|
||||
[SugarTable("qc_againinspection_uselessnum")]
|
||||
public class QcAgaininspectionUselessnum
|
||||
{
|
||||
/// <summary>
|
||||
/// 流水号
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "id", IsPrimaryKey = true)]
|
||||
public string Id { get; set; }
|
||||
/// <summary>
|
||||
/// fk_检测项
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "fk_inspectionItem_id")]
|
||||
public string FkInspectionitemId { get; set; }
|
||||
/// <summary>
|
||||
/// fk_终检id
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "fk_FQC_id")]
|
||||
public string FkFqcId { get; set; }
|
||||
/// <summary>
|
||||
/// 产品名称
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "productName")]
|
||||
public string ProductName { get; set; }
|
||||
/// <summary>
|
||||
/// 数量
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "number")]
|
||||
public int? Number { get; set; }
|
||||
/// <summary>
|
||||
/// 创建人
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CREATED_BY")]
|
||||
public string CreatedBy { get; set; }
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CREATED_TIME")]
|
||||
public DateTime? CreatedTime { get; set; }
|
||||
/// <summary>
|
||||
/// 更新人
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "UPDATED_BY")]
|
||||
public string UpdatedBy { get; set; }
|
||||
/// <summary>
|
||||
/// 更新时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "UPDATED_TIME")]
|
||||
public DateTime? UpdatedTime { get; set; }
|
||||
}
|
||||
}
|
||||
59
ZR.Model/MES/qc/QcFirstinspectionDefault.cs
Normal file
59
ZR.Model/MES/qc/QcFirstinspectionDefault.cs
Normal file
@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using SqlSugar;
|
||||
namespace ZR.Model.MES.qc
|
||||
{
|
||||
/// <summary>
|
||||
/// 初检瑕疵
|
||||
///</summary>
|
||||
[SugarTable("qc_firstinspection_default")]
|
||||
public class QcFirstinspectionDefault
|
||||
{
|
||||
/// <summary>
|
||||
/// 流水号
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "id")]
|
||||
public string Id { get; set; }
|
||||
/// <summary>
|
||||
/// 产品名称
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "productName")]
|
||||
public string ProductName { get; set; }
|
||||
/// <summary>
|
||||
/// fk_检测项
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "fk_inspectionItem_id")]
|
||||
public string FkInspectionitemId { get; set; }
|
||||
/// <summary>
|
||||
/// fk_FQC_id
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "fk_FQC_id")]
|
||||
public string FkFqcId { get; set; }
|
||||
/// <summary>
|
||||
/// 数量
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "number")]
|
||||
public string Number { get; set; }
|
||||
/// <summary>
|
||||
/// 创建人
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CREATED_BY")]
|
||||
public string CreatedBy { get; set; }
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CREATED_TIME")]
|
||||
public DateTime? CreatedTime { get; set; }
|
||||
/// <summary>
|
||||
/// 更新人
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "UPDATED_BY")]
|
||||
public string UpdatedBy { get; set; }
|
||||
/// <summary>
|
||||
/// 更新时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "UPDATED_TIME")]
|
||||
public DateTime? UpdatedTime { get; set; }
|
||||
}
|
||||
}
|
||||
60
ZR.Model/MES/qc/QcFirstinspectionUselessnum.cs
Normal file
60
ZR.Model/MES/qc/QcFirstinspectionUselessnum.cs
Normal file
@ -0,0 +1,60 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using SqlSugar;
|
||||
|
||||
namespace ZR.Model.MES.qc
|
||||
{
|
||||
/// <summary>
|
||||
/// 初检报废表
|
||||
///</summary>
|
||||
[SugarTable("qc_firstinspection_uselessnum")]
|
||||
public class QcFirstinspectionUselessnum
|
||||
{
|
||||
/// <summary>
|
||||
/// 流水号
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "id", IsPrimaryKey = true)]
|
||||
public string Id { get; set; }
|
||||
/// <summary>
|
||||
/// fk_报废检测id
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "fk_inspectionItem_id")]
|
||||
public string FkInspectionitemId { get; set; }
|
||||
/// <summary>
|
||||
/// fk_FQC_id
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "fk_FQC_id")]
|
||||
public string FkFqcId { get; set; }
|
||||
/// <summary>
|
||||
/// 报废数量
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "number")]
|
||||
public int? Number { get; set; }
|
||||
/// <summary>
|
||||
/// 产品名称
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "productname")]
|
||||
public string Productname { get; set; }
|
||||
/// <summary>
|
||||
/// 创建人
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CREATED_BY")]
|
||||
public string CreatedBy { get; set; }
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CREATED_TIME")]
|
||||
public DateTime? CreatedTime { get; set; }
|
||||
/// <summary>
|
||||
/// 更新人
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "UPDATED_BY")]
|
||||
public string UpdatedBy { get; set; }
|
||||
/// <summary>
|
||||
/// 更新时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "UPDATED_TIME")]
|
||||
public DateTime? UpdatedTime { get; set; }
|
||||
}
|
||||
}
|
||||
@ -84,7 +84,7 @@ namespace ZR.Service.mes.pro
|
||||
.Where(it => it.Id.Equals(id))
|
||||
.ExecuteCommand();
|
||||
}
|
||||
|
||||
|
||||
public int ReleaseProduction(string id, HttpContext context)
|
||||
{
|
||||
int result = Context.Updateable<ProWorkorder>()
|
||||
@ -180,7 +180,7 @@ namespace ZR.Service.mes.pro
|
||||
.AndIF(year > 0, it => it.Year == year)
|
||||
.AndIF(week > 0, it => it.Week == week)
|
||||
.AndIF(date > 0, it => it.Date == date)
|
||||
.And(it=>it.Wrokerorder_status==1)
|
||||
.And(it=>it.Wrokerorder_status==2) // 已经排产
|
||||
.ToExpression();
|
||||
|
||||
|
||||
|
||||
33
ZR.Service/mes/qc/FirstFQCService.cs
Normal file
33
ZR.Service/mes/qc/FirstFQCService.cs
Normal file
@ -0,0 +1,33 @@
|
||||
using Infrastructure.Attribute;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using ZR.Model.MES.qc.DTO;
|
||||
using ZR.Model.MES.qu;
|
||||
using ZR.Service.mes.qc.IService;
|
||||
using ZR.Service.mes.qu.IService;
|
||||
|
||||
namespace ZR.Service.mes.qc
|
||||
{
|
||||
|
||||
[AppService(ServiceType = typeof(IFirstFQCService), ServiceLifetime = LifeTime.Transient)]
|
||||
public class FirstFQCService : BaseService<QcInspectionitem>, IFirstFQCService
|
||||
{
|
||||
public CheckItemTableDTO GetCheckItemTable()
|
||||
{
|
||||
CheckItemTableDTO checkItem=new CheckItemTableDTO();
|
||||
checkItem.Paint = Queryable().Where(it => it.InspectionModule == "油漆").OrderBy(it=>it.Id).ToList();
|
||||
checkItem.device = Queryable().Where(it => it.InspectionModule == "设备").OrderBy(it => it.Id).ToList();
|
||||
checkItem.Blank = Queryable().Where(it => it.InspectionModule == "毛坯").OrderBy(it => it.Id).ToList();
|
||||
checkItem.program = Queryable().Where(it => it.InspectionModule == "程序").OrderBy(it => it.Id).ToList();
|
||||
checkItem.Team = Queryable().Where(it => it.InspectionModule == "班组操作").OrderBy(it => it.Id).ToList();
|
||||
|
||||
return checkItem;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
14
ZR.Service/mes/qc/IService/IFirstFQCService.cs
Normal file
14
ZR.Service/mes/qc/IService/IFirstFQCService.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using ZR.Model.MES.qc.DTO;
|
||||
|
||||
namespace ZR.Service.mes.qc.IService
|
||||
{
|
||||
public interface IFirstFQCService
|
||||
{
|
||||
public CheckItemTableDTO GetCheckItemTable();
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user