添加海康箱号识别

dev
ZR20090193-陈敬勇 2 years ago
parent de7c584964
commit ed64508261

@ -568,6 +568,13 @@
<param name="id"></param> <param name="id"></param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:DS.WMS.WebApi.Controllers.InternalCarController.CancelInternalCar(System.String)">
<summary>
内部车辆取消包期
</summary>
<param name="id"></param>
<returns></returns>
</member>
<member name="T:DS.WMS.WebApi.Controllers.NoticeController"> <member name="T:DS.WMS.WebApi.Controllers.NoticeController">
<summary> <summary>
公告模块 公告模块

@ -0,0 +1,102 @@
namespace DS.WMS.Core.OpenApiModule.Dtos;
public class HkRecords
{
/// <summary>
///
/// </summary>
public int Total { get; set; }
/// <summary>
///
/// </summary>
public int PageSize { get; set; }
/// <summary>
///
/// </summary>
public int PageNo { get; set; }
/// <summary>
///
/// </summary>
public int TotalPages { get; set; }
/// <summary>
///
/// </summary>
public List<RecordList> List { get; set; }
}
public class RecordList
{
/// <summary>
/// 闸口事件id
/// </summary>
public int Id { get; set; }
/// <summary>
/// 设备名称
/// </summary>
public string DeviceName { get; set; }
/// <summary>
/// 设备id
/// </summary>
public string DeviceId { get; set; }
/// <summary>
/// 到达时间
/// </summary>
public DateTime StartTime { get; set; }
/// <summary>
/// 离开时间
/// </summary>
public DateTime EndTime { get; set; }
/// <summary>
/// 集装箱型号
/// </summary>
public int Model { get; set; }
/// <summary>
/// 集装箱模式
/// </summary>
public string Mode { get; set; }
/// <summary>
/// 集装箱1号
/// </summary>
public string ContainerNumOne { get; set; }
/// <summary>
/// 集装箱1号ISO
/// </summary>
public string ContainerISONumOne { get; set; }
/// <summary>
/// 集装箱1号ISO
/// </summary>
public string ContainerNumTwo { get; set; }
/// <summary>
/// 集装箱2号
/// </summary>
public string ContainerISONumTwo { get; set; }
/// <summary>
/// 车牌号
/// </summary>
public string PlateNo { get; set; }
/// <summary>
/// 车牌颜色
/// </summary>
public string PlateColor { get; set; }
/// <summary>
/// 车身颜色
/// </summary>
public string VehicleColor { get; set; }
/// <summary>
/// 集装箱图片urls
/// </summary>
public List<string> ContainerPicUrls { get; set; }
/// <summary>
/// 车牌图url
/// </summary>
public string PlatePicUrl { get; set; }
/// <summary>
/// 车辆图url
/// </summary>
public string VehiclePicUrl { get; set; }
/// <summary>
/// 记录类型
/// </summary>
public int RecordType { get; set; }
}

@ -33,7 +33,10 @@ public partial class tb_TruckRecord
/// Nullable:False /// Nullable:False
/// </summary> /// </summary>
public string TRUCKNO { get; set; } public string TRUCKNO { get; set; }
/// <summary>
/// 箱号
/// </summary>
public string BoxNo { get; set; }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>

@ -1,10 +1,12 @@
using DS.Module.Core; using DS.Module.Core;
using DS.Module.Core.Extensions; using DS.Module.Core.Extensions;
using DS.Module.HkOpenApi;
using DS.WMS.Core.OpenApiModule.Dtos; using DS.WMS.Core.OpenApiModule.Dtos;
using DS.WMS.Core.OpenApiModule.Entity; using DS.WMS.Core.OpenApiModule.Entity;
using DS.WMS.Core.OpenApiModule.Interface; using DS.WMS.Core.OpenApiModule.Interface;
using Mapster; using Mapster;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Newtonsoft.Json;
using NLog; using NLog;
using SqlSugar; using SqlSugar;
@ -15,7 +17,7 @@ public class PortOpenService : IPortOpenService
private readonly IServiceProvider _serviceProvider; private readonly IServiceProvider _serviceProvider;
private readonly ISqlSugarClient db; private readonly ISqlSugarClient db;
static readonly Logger Logger = LogManager.GetCurrentClassLogger(); static readonly Logger Logger = LogManager.GetCurrentClassLogger();
private readonly IHttpRequestService _ihkHttpService;
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
@ -24,6 +26,7 @@ public class PortOpenService : IPortOpenService
{ {
_serviceProvider = serviceProvider; _serviceProvider = serviceProvider;
db = _serviceProvider.GetRequiredService<ISqlSugarClient>(); db = _serviceProvider.GetRequiredService<ISqlSugarClient>();
_ihkHttpService = _serviceProvider.GetRequiredService<IHttpRequestService>();
} }
@ -76,8 +79,36 @@ public class PortOpenService : IPortOpenService
{ {
return DataResult.Failed("车辆信息不存在!"); return DataResult.Failed("车辆信息不存在!");
} }
var info = model.Adapt<tb_TruckRecord>(); var info = model.Adapt<tb_TruckRecord>();
var now = DateTime.Now.AddMinutes(-5).ToString("yyyy-MM-dd HH:mm:ss");
var end = DateTime.Now.AddMinutes(5).ToString("yyyy-MM-dd HH:mm:ss");
var parm = new
{
boxNo = "",
plateNo = info.TRUCKNO,
pageNo = 1,
pageSize = 20,
startTime = now,
endTime = end,
};
var req = new HKPostData()
{
Url = "/artemis/api/pms/v1/record/query/gate",
Data = JsonConvert.SerializeObject(parm),
};
var res= _ihkHttpService.HKHttpPost(req);
if (res.Code == "0")
{
Logger.Log(LogLevel.Info,
DateTime.Now.ToString() + JsonConvert.SerializeObject(res.Data));
var record = JsonConvert.DeserializeObject<HkRecords>(res.Data.ToString());
info.BoxNo = record.List[0].ContainerNumOne +";"+ record.List[0].ContainerNumTwo;
}
else
{
Logger.Log(LogLevel.Error,
DateTime.Now.ToString() + JsonConvert.SerializeObject(res));
}
await db.Insertable(info).ExecuteCommandAsync(); await db.Insertable(info).ExecuteCommandAsync();

@ -40,6 +40,7 @@
<ItemGroup> <ItemGroup>
<Folder Include="wwwroot\PDFUpload" /> <Folder Include="wwwroot\PDFUpload" />
<Folder Include="wwwroot\PrintFiles" /> <Folder Include="wwwroot\PrintFiles" />
<Folder Include="wwwroot\Update\" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

@ -41,8 +41,8 @@ builder.Services.AddSmsModuleInstall();//短信服务
builder.Services.AddHKModuleInstall();//海康服务 builder.Services.AddHKModuleInstall();//海康服务
builder.Services.AddJwtInstall(); builder.Services.AddJwtInstall();
builder.Services.AddHangfireInstall();//Hangfire // builder.Services.AddHangfireInstall();//Hangfire
builder.Services.AddModbusInstall();//Modbus服务 // builder.Services.AddModbusInstall();//Modbus服务
// 3、配置中间件 // 3、配置中间件
var app = builder.Build(); var app = builder.Build();
// if (app.Environment.IsDevelopment()) // if (app.Environment.IsDevelopment())
@ -72,24 +72,24 @@ if (!policyName.IsNullOrEmpty())
{ {
app.UseCors(policyName); //添加跨域中间件 app.UseCors(policyName); //添加跨域中间件
} }
app.UseHangfireServer(); // app.UseHangfireServer();
app.UseHangfireDashboard("/hangfire", new DashboardOptions // app.UseHangfireDashboard("/hangfire", new DashboardOptions
{ // {
Authorization = new[] {new BasicAuthAuthorizationFilter(new BasicAuthAuthorizationFilterOptions // Authorization = new[] {new BasicAuthAuthorizationFilter(new BasicAuthAuthorizationFilterOptions
{ // {
RequireSsl = false, // RequireSsl = false,
SslRedirect = false, // SslRedirect = false,
LoginCaseSensitive = true, // LoginCaseSensitive = true,
Users = new [] // Users = new []
{ // {
new BasicAuthAuthorizationUser // new BasicAuthAuthorizationUser
{ // {
Login = "admin", // Login = "admin",
PasswordClear = "admin" // PasswordClear = "admin"
} // }
} // }
})} // })}
}); // });
app.UseRouting(); app.UseRouting();
app.UseStaticFiles(); app.UseStaticFiles();

Loading…
Cancel
Save