桌面端密炼计划、胶料快检调整
This commit is contained in:
@@ -2,12 +2,8 @@ using YY.Admin.Core.Entity;
|
||||
|
||||
namespace YY.Admin.Core.Services;
|
||||
|
||||
/// <summary>胶料快检记录操作台:密炼计划筛选、实验标准匹配、记录保存</summary>
|
||||
/// <summary>胶料快检记录操作台:保存至 MES</summary>
|
||||
public interface IRubberQuickTestOperationService
|
||||
{
|
||||
Task<List<MesXslMixingProductionPlan>> GetMixingProductionPlansAsync(CancellationToken ct = default);
|
||||
|
||||
Task<MesXslRubberQuickTestStd?> GetStdByRubberMaterialNameAsync(string rubberMaterialName, CancellationToken ct = default);
|
||||
|
||||
Task<string?> SaveRecordAsync(MesXslRubberQuickTestRecord record, CancellationToken ct = default);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,13 @@ public interface IRubberQuickTestStdService
|
||||
|
||||
Task<MesXslRubberQuickTestStd?> GetByIdAsync(string id, CancellationToken ct = default);
|
||||
|
||||
Task<List<MesXslRubberQuickTestStd>> GetAllCachedAsync(CancellationToken ct = default);
|
||||
|
||||
Task<MesXslRubberQuickTestStd?> GetCachedByIdAsync(string id, CancellationToken ct = default);
|
||||
|
||||
/// <summary>优先读本地缓存;无明细时联网拉取详情并回写缓存</summary>
|
||||
Task<MesXslRubberQuickTestStd?> GetWithLinesAsync(string id, CancellationToken ct = default);
|
||||
|
||||
/// <returns>本地缓存是否有变更(有差异才写入)</returns>
|
||||
Task<bool> SyncFromRemoteAsync(CancellationToken ct = default);
|
||||
}
|
||||
|
||||
@@ -47,4 +47,18 @@ public class MesXslMixingProductionPlan
|
||||
};
|
||||
|
||||
public string PlanDateText => PlanDate?.ToString("yyyy-MM-dd") ?? string.Empty;
|
||||
|
||||
/// <summary>计划+胶料号:计划号_胶料名称,如 SA0001_HB10001</summary>
|
||||
public string PlanMaterialNo
|
||||
{
|
||||
get
|
||||
{
|
||||
var planNo = PlanNo?.Trim();
|
||||
var materialName = MaterialName?.Trim();
|
||||
if (string.IsNullOrEmpty(planNo) && string.IsNullOrEmpty(materialName)) return string.Empty;
|
||||
if (string.IsNullOrEmpty(planNo)) return materialName ?? string.Empty;
|
||||
if (string.IsNullOrEmpty(materialName)) return planNo;
|
||||
return $"{planNo}_{materialName}";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,9 @@ public class MesXslRubberQuickTestStd
|
||||
public string? StdName { get; set; }
|
||||
public string? TestMethodId { get; set; }
|
||||
public string? TestMethodName { get; set; }
|
||||
/// <summary>实验类型(来自实验方法,MES 回填)</summary>
|
||||
public string? QuickTestTypeId { get; set; }
|
||||
public string? QuickTestTypeName { get; set; }
|
||||
public string? MixerType { get; set; }
|
||||
public string? RubberMaterialId { get; set; }
|
||||
public string? RubberMaterialName { get; set; }
|
||||
|
||||
@@ -48,12 +48,12 @@ public class SysMenuSeedData : ISqlSugarEntitySeedData<SysMenu>
|
||||
new SysMenu{ Id=1300150011001, Pid=1300150000101, Title="库区管理", Path="/xslmes/mesXslWarehouseArea", Name="mesXslWarehouseArea", Component="WarehouseAreaListView", Icon="", Type=MenuTypeEnum.Menu, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=109 },
|
||||
// 密炼物料皮重策略
|
||||
new SysMenu{ Id=1300150011101, Pid=1300150000101, Title="密炼物料皮重策略", Path="/xslmes/mesXslMixerMaterialTareStrategy", Name="mesXslMixerMaterialTareStrategy", Component="MixerMaterialTareStrategyListView", Icon="", Type=MenuTypeEnum.Menu, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=110 },
|
||||
// 快检记录
|
||||
new SysMenu{ Id=1300150011201, Pid=1300150000101, Title="快检记录", Path="/xslmes/rubberQuickTestOperation", Name="rubberQuickTestOperation", Component="RubberQuickTestOperationView", Icon="", Type=MenuTypeEnum.Menu, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=111 },
|
||||
// 胶料快检实验标准(桌面端只读)
|
||||
new SysMenu{ Id=1300150011301, Pid=1300150000101, Title="胶料快检实验标准", Path="/xslmes/mesXslRubberQuickTestStd", Name="mesXslRubberQuickTestStd", Component="RubberQuickTestStdListView", Icon="", Type=MenuTypeEnum.Menu, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=112 },
|
||||
// 胶料快检记录(紧接实验标准之后)
|
||||
new SysMenu{ Id=1300150011201, Pid=1300150000101, Title="胶料快检记录", Path="/xslmes/rubberQuickTestOperation", Name="rubberQuickTestOperation", Component="RubberQuickTestOperationView", Icon="", Type=MenuTypeEnum.Menu, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=113 },
|
||||
// 密炼计划
|
||||
new SysMenu{ Id=1300150011401, Pid=1300150000101, Title="密炼计划", Path="/xslmes/mesXslMixingProductionPlan", Name="mesXslMixingProductionPlan", Component="MixingProductionPlanListView", Icon="", Type=MenuTypeEnum.Menu, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=113 },
|
||||
new SysMenu{ Id=1300150011401, Pid=1300150000101, Title="密炼计划", Path="/xslmes/mesXslMixingProductionPlan", Name="mesXslMixingProductionPlan", Component="MixingProductionPlanListView", Icon="", Type=MenuTypeEnum.Menu, CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrderNo=114 },
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -270,6 +270,8 @@ namespace YY.Admin.Core.SqlSugar
|
||||
EnsureBaselineSysMenuSeed(db, config);
|
||||
// 旧库升级:按种子补全缺失菜单及租户/角色授权(仅插入缺失项)
|
||||
EnsureIncrementalDesktopMenuSeed(db, config);
|
||||
// 旧库升级:胶料快检记录菜单名称与排序
|
||||
EnsureRubberQuickTestRecordMenuPatch(db, config);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -494,6 +496,43 @@ namespace YY.Admin.Core.SqlSugar
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 旧库升级:胶料快检记录改名为「胶料快检记录」,排序置于胶料快检实验标准之后。
|
||||
/// </summary>
|
||||
private static void EnsureRubberQuickTestRecordMenuPatch(SqlSugarScope db, DbConnectionConfig config)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!string.Equals(config.ConfigId.ToString(), SqlSugarConst.MainConfigId, StringComparison.Ordinal))
|
||||
return;
|
||||
if (config.DbType != DbType.Sqlite)
|
||||
return;
|
||||
|
||||
var dbProvider = db.GetConnectionScope(config.ConfigId);
|
||||
var menuEntityInfo = dbProvider.EntityMaintenance.GetEntityInfo(typeof(SysMenu));
|
||||
if (!dbProvider.DbMaintenance.IsAnyTable(menuEntityInfo.DbTableName, false))
|
||||
return;
|
||||
|
||||
const long quickTestRecordMenuId = 1300150011201;
|
||||
const long mixingPlanMenuId = 1300150011401;
|
||||
|
||||
dbProvider.Updateable<SysMenu>()
|
||||
.SetColumns(m => m.Title == "胶料快检记录")
|
||||
.SetColumns(m => m.OrderNo == 113)
|
||||
.Where(m => m.Id == quickTestRecordMenuId)
|
||||
.ExecuteCommand();
|
||||
|
||||
dbProvider.Updateable<SysMenu>()
|
||||
.SetColumns(m => m.OrderNo == 114)
|
||||
.Where(m => m.Id == mixingPlanMenuId)
|
||||
.ExecuteCommand();
|
||||
}
|
||||
catch
|
||||
{
|
||||
// 启动阶段不因菜单补丁失败而阻断
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 兼容旧库:补齐桌面端「登录设置」所需的 sys_config 配置项(升级前库可能缺少这些 code)
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user