新增磅单管理功能,支持免密接口和数据同步,更新相关控制器、实体和服务,优化权限管理,确保系统的灵活性和可扩展性。

This commit is contained in:
geht
2026-05-06 15:30:31 +08:00
parent b03cbeff9b
commit 71b8d94da8
48 changed files with 4205 additions and 3 deletions

View File

@@ -0,0 +1,11 @@
using Prism.Events;
namespace YY.Admin.Core.Events;
public class MesXslWeightRecordChangedPayload
{
public string Action { get; set; } = string.Empty; // add/edit/delete/reconnect/pull
public string? WeightRecordId { get; set; }
}
public class MesXslWeightRecordChangedEvent : PubSubEvent<MesXslWeightRecordChangedPayload> { }

View File

@@ -0,0 +1,23 @@
using YY.Admin.Core.Entity;
namespace YY.Admin.Core.Services;
public interface IWeightRecordService
{
Task<WeightRecordPageResult> PageAsync(
int pageNo, int pageSize,
string? filterBillNo = null,
string? filterPlateNumber = null,
string? filterInoutDirection = null,
string? filterGoodsName = null,
string? filterDriverName = null,
CancellationToken ct = default);
Task<MesXslWeightRecord?> GetByIdAsync(string id, CancellationToken ct = default);
Task<bool> AddAsync(MesXslWeightRecord entity, CancellationToken ct = default);
Task<bool> EditAsync(MesXslWeightRecord entity, CancellationToken ct = default);
Task<bool> DeleteAsync(string id, CancellationToken ct = default);
Task<bool> DeleteBatchAsync(string ids, CancellationToken ct = default);
}
public record WeightRecordPageResult(List<MesXslWeightRecord> Records, long Total, int PageNo, int PageSize);

View File

@@ -0,0 +1,61 @@
namespace YY.Admin.Core.Entity;
public class MesXslWeightRecord
{
public string? Id { get; set; }
/// <summary>磅单号</summary>
public string? BillNo { get; set; }
/// <summary>称重日期</summary>
public DateTime? WeighDate { get; set; }
/// <summary>进出方向1进厂 2出厂</summary>
public string? InoutDirection { get; set; }
/// <summary>车辆档案ID可选由车牌反查</summary>
public string? VehicleId { get; set; }
/// <summary>车牌号</summary>
public string? PlateNumber { get; set; }
/// <summary>发货单位(进厂时为供应商名称)</summary>
public string? SenderUnit { get; set; }
/// <summary>收货单位(出厂时为客户简称)</summary>
public string? ReceiverUnit { get; set; }
/// <summary>货物名称</summary>
public string? GoodsName { get; set; }
/// <summary>毛重(KG),实际称量</summary>
public double? GrossWeight { get; set; }
/// <summary>皮重(KG),从车辆档案带出或单独采集</summary>
public double? TareWeight { get; set; }
/// <summary>净重(KG)=毛重-皮重,自动计算</summary>
public double? NetWeight { get; set; }
/// <summary>司机姓名</summary>
public string? DriverName { get; set; }
/// <summary>司机手机号</summary>
public string? DriverPhone { get; set; }
/// <summary>单据类型1已称毛重 2称重完成</summary>
public string? BillType { get; set; }
public int? TenantId { get; set; }
public string? CreateBy { get; set; }
public DateTime? CreateTime { get; set; }
public string? UpdateBy { get; set; }
public DateTime? UpdateTime { get; set; }
public string? SysOrgCode { get; set; }
/// <summary>进出方向显示文本(由 ViewModel 填充)</summary>
public string InoutDirectionText { get; set; } = string.Empty;
/// <summary>单据类型显示文本(由 ViewModel 填充)</summary>
public string BillTypeText { get; set; } = string.Empty;
}

View File

@@ -32,6 +32,10 @@ public class SysMenuSeedData : ISqlSugarEntitySeedData<SysMenu>
new SysMenu{ Id=1300150010201, Pid=1300150000101, Title="客户管理", Path="/xslmes/mesXslCustomer", Name="mesXslCustomer", Component="CustomerListView", Icon="&#xe7ce;", Type=MenuTypeEnum.Menu, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=101 },
// 供应商管理
new SysMenu{ Id=1300150010301, Pid=1300150000101, Title="供应商管理", Path="/xslmes/mesXslSupplier", Name="mesXslSupplier", Component="SupplierListView", Icon="&#xe7ce;", Type=MenuTypeEnum.Menu, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=102 },
// 磅单记录管理标准CRUD
new SysMenu{ Id=1300150010401, Pid=1300150000101, Title="磅单记录管理", Path="/xslmes/mesXslWeightRecord", Name="mesXslWeightRecord", Component="WeightRecordListView", Icon="&#xe7ce;", Type=MenuTypeEnum.Menu, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=103 },
// 地磅称重操作(操作台大页面)
new SysMenu{ Id=1300150010501, Pid=1300150000101, Title="地磅称重操作", Path="/xslmes/weightRecordOperation", Name="weightRecordOperation", Component="WeightRecordOperationView", Icon="&#xe7de;", Type=MenuTypeEnum.Menu, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=104 },
#endregion

View File

@@ -24,6 +24,8 @@ public class SysTenantMenuSeedData : ISqlSugarEntitySeedData<SysTenantMenu>
new SysTenantMenu(){ TenantId=1300000000001,MenuId=1300150000101},
new SysTenantMenu(){ TenantId=1300000000001,MenuId=1300150010101},
new SysTenantMenu(){ TenantId=1300000000001,MenuId=1300150010201},
new SysTenantMenu(){ TenantId=1300000000001,MenuId=1300150010401},
new SysTenantMenu(){ TenantId=1300000000001,MenuId=1300150010501},
new SysTenantMenu(){ TenantId=1300000000001,MenuId=1300200010701 },
new SysTenantMenu(){ TenantId=1300000000001,MenuId=1300300100601 },
new SysTenantMenu(){ TenantId=1300000000001,MenuId=1300200090401 },