添加海康箱号识别

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

@ -568,6 +568,13 @@
<param name="id"></param>
<returns></returns>
</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">
<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
/// </summary>
public string TRUCKNO { get; set; }
/// <summary>
/// 箱号
/// </summary>
public string BoxNo { get; set; }
/// <summary>
///
/// </summary>

@ -1,10 +1,12 @@
using DS.Module.Core;
using DS.Module.Core.Extensions;
using DS.Module.HkOpenApi;
using DS.WMS.Core.OpenApiModule.Dtos;
using DS.WMS.Core.OpenApiModule.Entity;
using DS.WMS.Core.OpenApiModule.Interface;
using Mapster;
using Microsoft.Extensions.DependencyInjection;
using Newtonsoft.Json;
using NLog;
using SqlSugar;
@ -15,7 +17,7 @@ public class PortOpenService : IPortOpenService
private readonly IServiceProvider _serviceProvider;
private readonly ISqlSugarClient db;
static readonly Logger Logger = LogManager.GetCurrentClassLogger();
private readonly IHttpRequestService _ihkHttpService;
/// <summary>
///
/// </summary>
@ -24,6 +26,7 @@ public class PortOpenService : IPortOpenService
{
_serviceProvider = serviceProvider;
db = _serviceProvider.GetRequiredService<ISqlSugarClient>();
_ihkHttpService = _serviceProvider.GetRequiredService<IHttpRequestService>();
}
@ -76,8 +79,36 @@ public class PortOpenService : IPortOpenService
{
return DataResult.Failed("车辆信息不存在!");
}
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();

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

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

Loading…
Cancel
Save