胶料快检添加离线模式
This commit is contained in:
@@ -18,12 +18,25 @@ public interface IRubberQuickTestRecordService
|
||||
|
||||
Task<RubberQuickTestRecordSaveResult> SaveAsync(MesXslRubberQuickTestRecord entity, CancellationToken ct = default);
|
||||
|
||||
/// <summary>删除本地同步失败的快检记录(已同步或待同步不可删)</summary>
|
||||
bool DeleteFailedLocal(string localId);
|
||||
/// <summary>更新本地未同步快检记录</summary>
|
||||
Task<RubberQuickTestRecordSaveResult> UpdateLocalAsync(string localId, MesXslRubberQuickTestRecord entity, CancellationToken ct = default);
|
||||
|
||||
/// <summary>删除本地未同步的快检记录(已同步不可删)</summary>
|
||||
bool DeleteUnsyncedLocal(string localId);
|
||||
|
||||
/// <summary>将本地未同步记录推送到 MES(须已联网且密炼计划信息完整)</summary>
|
||||
Task<RubberQuickTestRecordSyncResult> SyncLocalAsync(string localId, CancellationToken ct = default);
|
||||
|
||||
string GenerateRecordNo(string rubberMaterialName);
|
||||
}
|
||||
|
||||
public class RubberQuickTestRecordSyncResult
|
||||
{
|
||||
public bool Success { get; set; }
|
||||
public string? Message { get; set; }
|
||||
public string? RecordNo { get; set; }
|
||||
}
|
||||
|
||||
public record RubberQuickTestRecordPageResult(
|
||||
List<RubberQuickTestRecordListRow> Records,
|
||||
long Total,
|
||||
|
||||
@@ -23,10 +23,16 @@ public class RubberQuickTestRecordListRow
|
||||
public string SyncStatusDisplay => SyncStatus switch
|
||||
{
|
||||
"Synced" => "已同步",
|
||||
"Failed" => "失败",
|
||||
_ => "待同步"
|
||||
"Failed" => "同步失败",
|
||||
_ => "未同步"
|
||||
};
|
||||
|
||||
/// <summary>仅本地同步失败记录可删除</summary>
|
||||
public bool CanDelete => SyncStatus == "Failed" && !string.IsNullOrWhiteSpace(LocalId);
|
||||
/// <summary>本地未同步记录可删除</summary>
|
||||
public bool CanDelete => SyncStatus != "Synced" && !string.IsNullOrWhiteSpace(LocalId);
|
||||
|
||||
/// <summary>本地未同步记录可手动同步</summary>
|
||||
public bool CanSync => SyncStatus != "Synced" && !string.IsNullOrWhiteSpace(LocalId);
|
||||
|
||||
/// <summary>本地未同步记录可编辑</summary>
|
||||
public bool CanEdit => CanSync;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user