新增MES模块,包含供应商、客户、车辆和地磅数据记录管理功能,支持免密接口和数据同步。更新相关控制器、实体、服务和数据库配置,优化权限管理和数据字典支持,确保系统的灵活性和可扩展性。
This commit is contained in:
@@ -164,6 +164,37 @@ public class JeecgDictSyncService : IJeecgDictSyncService, ISingletonDependency
|
||||
return synced;
|
||||
}
|
||||
|
||||
public async Task<List<KeyValuePair<string, string>>> GetDictOptionsAsync(string dictCode, bool includeAll = false)
|
||||
{
|
||||
var result = new List<KeyValuePair<string, string>>();
|
||||
if (includeAll)
|
||||
{
|
||||
result.Add(new KeyValuePair<string, string>("全部", ""));
|
||||
}
|
||||
if (string.IsNullOrWhiteSpace(dictCode))
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
var rows = await _dbContext.Queryable<JeecgSysDictItem>()
|
||||
.ClearFilter()
|
||||
.Where(x => x.DictCode == dictCode)
|
||||
.Where(x => x.Status == null || x.Status == 1)
|
||||
.OrderBy(x => SqlFunc.IsNull(x.SortOrder, 0))
|
||||
.OrderBy(x => SqlFunc.Asc(x.ItemValue))
|
||||
.ToListAsync();
|
||||
|
||||
foreach (var row in rows)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(row.ItemValue))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
result.Add(new KeyValuePair<string, string>(row.ItemText ?? row.ItemValue, row.ItemValue));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private static string? GetString(JsonElement row, string propertyName)
|
||||
{
|
||||
if (!row.TryGetProperty(propertyName, out var el))
|
||||
|
||||
Reference in New Issue
Block a user