merge from 2023-03-14
This commit is contained in:
@@ -87,6 +87,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tnb.Extend.Entitys", "exten
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tnb.Extend.Interfaces", "extend\Tnb.Extend.Interfaces\Tnb.Extend.Interfaces.csproj", "{2E9F8B23-37B9-42BD-A62F-140A38C43A89}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tnb.Extend.Interfaces", "extend\Tnb.Extend.Interfaces\Tnb.Extend.Interfaces.csproj", "{2E9F8B23-37B9-42BD-A62F-140A38C43A89}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tnb.Core", "..\Tnb.Core\src\Tnb.Core\Tnb.Core.csproj", "{6CE14DF1-4AC2-4E21-8910-1898BF7C2C6E}"
|
||||||
|
EndProject
|
||||||
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tnb.SqlSugar", "..\Tnb.Core\src\Tnb.SqlSugar\Tnb.SqlSugar.csproj", "{8144C78D-AF9A-4C1B-8A18-CCD78B26D870}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
@@ -209,6 +213,14 @@ Global
|
|||||||
{2E9F8B23-37B9-42BD-A62F-140A38C43A89}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{2E9F8B23-37B9-42BD-A62F-140A38C43A89}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{2E9F8B23-37B9-42BD-A62F-140A38C43A89}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{2E9F8B23-37B9-42BD-A62F-140A38C43A89}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{2E9F8B23-37B9-42BD-A62F-140A38C43A89}.Release|Any CPU.Build.0 = Release|Any CPU
|
{2E9F8B23-37B9-42BD-A62F-140A38C43A89}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{6CE14DF1-4AC2-4E21-8910-1898BF7C2C6E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{6CE14DF1-4AC2-4E21-8910-1898BF7C2C6E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{6CE14DF1-4AC2-4E21-8910-1898BF7C2C6E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{6CE14DF1-4AC2-4E21-8910-1898BF7C2C6E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{8144C78D-AF9A-4C1B-8A18-CCD78B26D870}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{8144C78D-AF9A-4C1B-8A18-CCD78B26D870}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{8144C78D-AF9A-4C1B-8A18-CCD78B26D870}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{8144C78D-AF9A-4C1B-8A18-CCD78B26D870}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|||||||
@@ -28,6 +28,13 @@ public static class LoggingConfigureExtensions
|
|||||||
writeError.UseRollbackFileName(Path.GetFileNameWithoutExtension(writeError.CurrentFileName) + "-oops" + Path.GetExtension(writeError.CurrentFileName));
|
writeError.UseRollbackFileName(Path.GetFileNameWithoutExtension(writeError.CurrentFileName) + "-oops" + Path.GetExtension(writeError.CurrentFileName));
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
// 日志监听
|
||||||
|
// services.AddMonitorLogging(options =>
|
||||||
|
//{
|
||||||
|
// options.IgnorePropertyNames = new[] { "Byte" };
|
||||||
|
// options.IgnorePropertyTypes = new[] { typeof(byte[]) };
|
||||||
|
//});
|
||||||
|
|
||||||
return services;
|
return services;
|
||||||
}
|
}
|
||||||
private static string LoggerLevelName(LogLevel level)
|
private static string LoggerLevelName(LogLevel level)
|
||||||
|
|||||||
@@ -1,31 +1,26 @@
|
|||||||
using JNPF.API.Entry.Handlers;
|
using IGeekFan.AspNetCore.Knife4jUI;
|
||||||
|
using JNPF.API.Entry.Handlers;
|
||||||
using JNPF.Common.Cache;
|
using JNPF.Common.Cache;
|
||||||
using JNPF.Common.Core.Filter;
|
using JNPF.Common.Core.Filter;
|
||||||
|
using JNPF.Common.Core.Handlers;
|
||||||
|
using JNPF.Common.Security;
|
||||||
using JNPF.DatabaseAccessor;
|
using JNPF.DatabaseAccessor;
|
||||||
using JNPF.EventHandler;
|
using JNPF.EventHandler;
|
||||||
using JNPF.JsonSerialization;
|
using JNPF.JsonSerialization;
|
||||||
using JNPF.Message.Handlers;
|
using JNPF.SpecificationDocument;
|
||||||
using JNPF.TaskScheduler.Interfaces.TaskScheduler;
|
using JNPF.TaskScheduler.Interfaces.TaskScheduler;
|
||||||
using JNPF.UnifyResult;
|
using JNPF.UnifyResult;
|
||||||
|
using JNPF.VisualDev;
|
||||||
using Microsoft.AspNetCore.HttpOverrides;
|
using Microsoft.AspNetCore.HttpOverrides;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
using Newtonsoft.Json.Serialization;
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Senparc.CO2NET.RegisterServices;
|
using Newtonsoft.Json.Serialization;
|
||||||
using Senparc.CO2NET;
|
using Senparc.CO2NET;
|
||||||
|
using Senparc.CO2NET.RegisterServices;
|
||||||
using Senparc.Weixin;
|
using Senparc.Weixin;
|
||||||
using Senparc.Weixin.Entities;
|
using Senparc.Weixin.Entities;
|
||||||
using Senparc.Weixin.RegisterServices;
|
using Senparc.Weixin.RegisterServices;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using IGeekFan.AspNetCore.Knife4jUI;
|
|
||||||
using JNPF.SpecificationDocument;
|
|
||||||
using JNPF.Logging;
|
|
||||||
using System.Xml;
|
|
||||||
using System;
|
|
||||||
using System.Text;
|
|
||||||
using Top.Api;
|
|
||||||
using JNPF.Common.Security;
|
|
||||||
using JNPF.VisualDev;
|
|
||||||
|
|
||||||
namespace JNPF.API.Entry;
|
namespace JNPF.API.Entry;
|
||||||
|
|
||||||
@@ -137,12 +132,6 @@ public class Startup : AppStartup
|
|||||||
services.AddMemoryCache(); // 使用本地缓存必须添加
|
services.AddMemoryCache(); // 使用本地缓存必须添加
|
||||||
|
|
||||||
services.LoggingConfigure();
|
services.LoggingConfigure();
|
||||||
// 日志监听
|
|
||||||
// services.AddMonitorLogging(options =>
|
|
||||||
//{
|
|
||||||
// options.IgnorePropertyNames = new[] { "Byte" };
|
|
||||||
// options.IgnorePropertyTypes = new[] { typeof(byte[]) };
|
|
||||||
//});
|
|
||||||
|
|
||||||
services.AddUnitOfWork<SqlSugarUnitOfWork>();
|
services.AddUnitOfWork<SqlSugarUnitOfWork>();
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ using JNPF.WebSockets;
|
|||||||
using Mapster;
|
using Mapster;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
|
||||||
namespace JNPF.Message.Handlers;
|
namespace JNPF.Common.Core.Handlers;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// IM 处理程序.
|
/// IM 处理程序.
|
||||||
@@ -13,7 +13,6 @@ using JNPF.Systems.Entitys.Permission;
|
|||||||
using JNPF.Systems.Entitys.System;
|
using JNPF.Systems.Entitys.System;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using System.Net.Http;
|
|
||||||
using System.Security.Claims;
|
using System.Security.Claims;
|
||||||
|
|
||||||
namespace JNPF.Common.Core.Manager;
|
namespace JNPF.Common.Core.Manager;
|
||||||
@@ -206,7 +205,7 @@ public class UserManager : IUserManager, IScoped
|
|||||||
UserAgent userAgent = new UserAgent(_httpContext);
|
UserAgent userAgent = new UserAgent(_httpContext);
|
||||||
var data = new UserInfoModel();
|
var data = new UserInfoModel();
|
||||||
var ipAddress = NetHelper.Ip;
|
var ipAddress = NetHelper.Ip;
|
||||||
//var ipAddressName = await NetHelper.GetLocation(ipAddress);
|
var ipAddressName = await NetHelper.GetLocation(ipAddress);
|
||||||
var userDataScope = await GetUserDataScopeAsync(UserId);
|
var userDataScope = await GetUserDataScopeAsync(UserId);
|
||||||
var sysConfigInfo = await _repository.AsSugarClient().Queryable<SysConfigEntity>().FirstAsync(s => s.Category.Equals("SysConfig") && s.Key.ToLower().Equals("tokentimeout"));
|
var sysConfigInfo = await _repository.AsSugarClient().Queryable<SysConfigEntity>().FirstAsync(s => s.Category.Equals("SysConfig") && s.Key.ToLower().Equals("tokentimeout"));
|
||||||
data = await _repository.AsQueryable().Where(it => it.Id == UserId)
|
data = await _repository.AsQueryable().Where(it => it.Id == UserId)
|
||||||
@@ -252,8 +251,8 @@ public class UserManager : IUserManager, IScoped
|
|||||||
data.loginTime = DateTime.Now;
|
data.loginTime = DateTime.Now;
|
||||||
data.prevLogin = (await _repository.AsSugarClient().Queryable<SysConfigEntity>().FirstAsync(x => x.Category.Equals("SysConfig") && x.Key.ToLower().Equals("lastlogintimeswitch"))).Value.ParseToInt();
|
data.prevLogin = (await _repository.AsSugarClient().Queryable<SysConfigEntity>().FirstAsync(x => x.Category.Equals("SysConfig") && x.Key.ToLower().Equals("lastlogintimeswitch"))).Value.ParseToInt();
|
||||||
data.loginIPAddress = ipAddress;
|
data.loginIPAddress = ipAddress;
|
||||||
//data.loginIPAddressName = ipAddressName;
|
data.loginIPAddressName = ipAddressName;
|
||||||
//data.prevLoginIPAddressName = await NetHelper.GetLocation(data.prevLoginIPAddress);
|
data.prevLoginIPAddressName = await NetHelper.GetLocation(data.prevLoginIPAddress);
|
||||||
data.loginPlatForm = userAgent.RawValue;
|
data.loginPlatForm = userAgent.RawValue;
|
||||||
data.subsidiary = await GetSubsidiaryAsync(data.organizeId, data.isAdministrator);
|
data.subsidiary = await GetSubsidiaryAsync(data.organizeId, data.isAdministrator);
|
||||||
data.subordinates = await this.GetSubordinatesAsync(UserId);
|
data.subordinates = await this.GetSubordinatesAsync(UserId);
|
||||||
@@ -501,11 +500,13 @@ public class UserManager : IUserManager, IScoped
|
|||||||
var itemValue = fieldItem.Value;
|
var itemValue = fieldItem.Value;
|
||||||
var itemMethod = (QueryType)System.Enum.Parse(typeof(QueryType), fieldItem.Op);
|
var itemMethod = (QueryType)System.Enum.Parse(typeof(QueryType), fieldItem.Op);
|
||||||
|
|
||||||
|
var cmodel = GetConditionalModel(itemMethod, itemField, User.OrganizeId);
|
||||||
|
if (itemMethod.Equals(QueryType.Equal)) cmodel.ConditionalType = ConditionalType.Like;
|
||||||
|
if (itemMethod.Equals(QueryType.NotEqual)) cmodel.ConditionalType = ConditionalType.NoLike;
|
||||||
switch (itemValue)
|
switch (itemValue)
|
||||||
{
|
{
|
||||||
case "@userId": // 当前用户
|
case "@userId": // 当前用户
|
||||||
{
|
{
|
||||||
var cmodel = GetConditionalModel(itemMethod, itemField, userInfo.userId);
|
|
||||||
switch (conditionItem.Logic)
|
switch (conditionItem.Logic)
|
||||||
{
|
{
|
||||||
case "and":
|
case "and":
|
||||||
@@ -524,17 +525,29 @@ public class UserManager : IUserManager, IScoped
|
|||||||
{
|
{
|
||||||
var ids = new List<string>() { userInfo.userId };
|
var ids = new List<string>() { userInfo.userId };
|
||||||
ids.AddRange(userInfo.subordinates);
|
ids.AddRange(userInfo.subordinates);
|
||||||
var cmodel = GetConditionalModel(itemMethod, itemField, string.Join(",", ids));
|
for (int i = 0; i < ids.Count; i++)
|
||||||
switch (conditionItem.Logic)
|
|
||||||
{
|
{
|
||||||
case "and":
|
if (i == 0)
|
||||||
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = string.Join(",", ids), ConditionalType = (int)cmodel.ConditionalType } });
|
{
|
||||||
|
switch (conditionItem.Logic)
|
||||||
|
{
|
||||||
|
case "and":
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case "or":
|
case "or":
|
||||||
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = string.Join(",", ids), ConditionalType = (int)cmodel.ConditionalType } });
|
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (itemMethod.Equals(QueryType.NotEqual) || itemMethod.Equals(QueryType.NotIncluded))
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
else
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -543,7 +556,6 @@ public class UserManager : IUserManager, IScoped
|
|||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(userInfo.organizeId))
|
if (!string.IsNullOrEmpty(userInfo.organizeId))
|
||||||
{
|
{
|
||||||
var cmodel = GetConditionalModel(itemMethod, itemField, userInfo.organizeId);
|
|
||||||
switch (conditionItem.Logic)
|
switch (conditionItem.Logic)
|
||||||
{
|
{
|
||||||
case "and":
|
case "and":
|
||||||
@@ -554,7 +566,6 @@ public class UserManager : IUserManager, IScoped
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@@ -564,17 +575,29 @@ public class UserManager : IUserManager, IScoped
|
|||||||
{
|
{
|
||||||
var ids = new List<string>() { userInfo.organizeId };
|
var ids = new List<string>() { userInfo.organizeId };
|
||||||
ids.AddRange(userInfo.subsidiary);
|
ids.AddRange(userInfo.subsidiary);
|
||||||
var cmodel = GetConditionalModel(itemMethod, itemField, string.Join(",", ids));
|
for (int i = 0; i < ids.Count; i++)
|
||||||
switch (conditionItem.Logic)
|
|
||||||
{
|
{
|
||||||
case "and":
|
if (i == 0)
|
||||||
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = string.Join(",", ids), ConditionalType = (int)cmodel.ConditionalType } });
|
{
|
||||||
|
switch (conditionItem.Logic)
|
||||||
|
{
|
||||||
|
case "and":
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case "or":
|
case "or":
|
||||||
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = string.Join(",", ids), ConditionalType = (int)cmodel.ConditionalType } });
|
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (itemMethod.Equals(QueryType.NotEqual) || itemMethod.Equals(QueryType.NotIncluded))
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
else
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -583,43 +606,79 @@ public class UserManager : IUserManager, IScoped
|
|||||||
|
|
||||||
case "@branchManageOrganize": // 当前分管组织
|
case "@branchManageOrganize": // 当前分管组织
|
||||||
{
|
{
|
||||||
var orgId = DataScope.Where(x => x.Select).Select(x => x.organizeId).ToList();
|
var ids = DataScope.Where(x => x.Select).Select(x => x.organizeId).ToList();
|
||||||
if (orgId != null)
|
if (ids != null)
|
||||||
{
|
{
|
||||||
var cmodel = GetConditionalModel(itemMethod, itemField, string.Join(",", orgId));
|
for (int i = 0; i < ids.Count; i++)
|
||||||
switch (conditionItem.Logic)
|
|
||||||
{
|
{
|
||||||
case "and":
|
if (i == 0)
|
||||||
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = string.Join(",", orgId), ConditionalType = (int)cmodel.ConditionalType } });
|
{
|
||||||
break;
|
switch (conditionItem.Logic)
|
||||||
case "or":
|
{
|
||||||
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = string.Join(",", orgId), ConditionalType = (int)cmodel.ConditionalType } });
|
case "and":
|
||||||
break;
|
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "or":
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (itemMethod.Equals(QueryType.NotEqual) || itemMethod.Equals(QueryType.NotIncluded))
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
else
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = "jnpf", ConditionalType = (int)ConditionalType.Equal } });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "@branchManageOrganizeAndSub": // 当前分管组织及子组织
|
case "@branchManageOrganizeAndSub": // 当前分管组织及子组织
|
||||||
{
|
{
|
||||||
var subOrgIds = new List<string>();
|
var ids = new List<string>();
|
||||||
DataScope.Where(x => x.Select).Select(x => x.organizeId).ToList()
|
DataScope.Where(x => x.Select).Select(x => x.organizeId).ToList()
|
||||||
.ForEach(item => subOrgIds.AddRange(_repository.AsSugarClient().Queryable<OrganizeEntity>().Where(x => x.OrganizeIdTree.Contains(item)).Select(x => x.Id).ToList()));
|
.ForEach(item => ids.AddRange(_repository.AsSugarClient().Queryable<OrganizeEntity>().Where(x => x.OrganizeIdTree.Contains(item)).Select(x => x.Id).ToList()));
|
||||||
|
|
||||||
if (subOrgIds.Any())
|
if (ids.Any())
|
||||||
{
|
{
|
||||||
var cmodel = GetConditionalModel(itemMethod, itemField, string.Join(",", subOrgIds));
|
for (int i = 0; i < ids.Count; i++)
|
||||||
switch (conditionItem.Logic)
|
|
||||||
{
|
{
|
||||||
case "and":
|
if (i == 0)
|
||||||
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = string.Join(",", subOrgIds), ConditionalType = (int)cmodel.ConditionalType } });
|
{
|
||||||
break;
|
switch (conditionItem.Logic)
|
||||||
case "or":
|
{
|
||||||
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = string.Join(",", subOrgIds), ConditionalType = (int)cmodel.ConditionalType } });
|
case "and":
|
||||||
break;
|
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "or":
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (itemMethod.Equals(QueryType.NotEqual) || itemMethod.Equals(QueryType.NotIncluded))
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
else
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = "jnpf", ConditionalType = (int)ConditionalType.Equal } });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@@ -628,9 +687,9 @@ public class UserManager : IUserManager, IScoped
|
|||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(itemValue))
|
if (!string.IsNullOrEmpty(itemValue))
|
||||||
{
|
{
|
||||||
var cmodel = GetConditionalModel(itemMethod, itemField, itemValue, fieldItem.Type);
|
var defCmodel = GetConditionalModel(itemMethod, itemField, itemValue, fieldItem.Type);
|
||||||
if (cmodel.ConditionalType.Equals(ConditionalType.In)) cmodel.ConditionalType = ConditionalType.Like;
|
if (defCmodel.ConditionalType.Equals(ConditionalType.In)) defCmodel.ConditionalType = ConditionalType.Like;
|
||||||
if (cmodel.ConditionalType.Equals(ConditionalType.NotIn)) cmodel.ConditionalType = ConditionalType.NoLike;
|
if (defCmodel.ConditionalType.Equals(ConditionalType.NotIn)) defCmodel.ConditionalType = ConditionalType.NoLike;
|
||||||
switch (conditionItem.Logic)
|
switch (conditionItem.Logic)
|
||||||
{
|
{
|
||||||
case "and":
|
case "and":
|
||||||
@@ -646,6 +705,8 @@ public class UserManager : IUserManager, IScoped
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (itemMethod.Equals(QueryType.NotEqual) || itemMethod.Equals(QueryType.NotIncluded))
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = string.Empty, ConditionalType = ConditionalType.IsNullOrEmpty } });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (conditionalList.Any())
|
if (conditionalList.Any())
|
||||||
@@ -749,19 +810,21 @@ public class UserManager : IUserManager, IScoped
|
|||||||
var itemValue = fieldItem.Value;
|
var itemValue = fieldItem.Value;
|
||||||
var itemMethod = (QueryType)System.Enum.Parse(typeof(QueryType), fieldItem.Op);
|
var itemMethod = (QueryType)System.Enum.Parse(typeof(QueryType), fieldItem.Op);
|
||||||
|
|
||||||
|
var cmodel = GetConditionalModel(itemMethod, itemField, User.OrganizeId);
|
||||||
|
if (itemMethod.Equals(QueryType.Equal)) cmodel.ConditionalType = ConditionalType.Like;
|
||||||
|
if (itemMethod.Equals(QueryType.NotEqual)) cmodel.ConditionalType = ConditionalType.NoLike;
|
||||||
switch (itemValue)
|
switch (itemValue)
|
||||||
{
|
{
|
||||||
case "@userId": // 当前用户
|
case "@userId": // 当前用户
|
||||||
{
|
{
|
||||||
var cmodel = GetConditionalModel(itemMethod, itemField, userInfo.userId);
|
|
||||||
switch (conditionItem.Logic)
|
switch (conditionItem.Logic)
|
||||||
{
|
{
|
||||||
case "and":
|
case "and":
|
||||||
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = userInfo.userId, ConditionalType = (int)cmodel.ConditionalType } });
|
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = UserId, ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case "or":
|
case "or":
|
||||||
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = userInfo.userId, ConditionalType = (int)cmodel.ConditionalType } });
|
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = UserId, ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -770,59 +833,81 @@ public class UserManager : IUserManager, IScoped
|
|||||||
break;
|
break;
|
||||||
case "@userAraSubordinates": // 当前用户集下属
|
case "@userAraSubordinates": // 当前用户集下属
|
||||||
{
|
{
|
||||||
var ids = new List<string>() { userInfo.userId };
|
var ids = new List<string>() { UserId };
|
||||||
ids.AddRange(userInfo.subordinates);
|
ids.AddRange(Subordinates);
|
||||||
var cmodel = GetConditionalModel(itemMethod, itemField, string.Join(",", ids));
|
for (int i = 0; i < ids.Count; i++)
|
||||||
switch (conditionItem.Logic)
|
|
||||||
{
|
{
|
||||||
case "and":
|
if (i == 0)
|
||||||
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = string.Join(",", ids), ConditionalType = (int)cmodel.ConditionalType } });
|
{
|
||||||
|
switch (conditionItem.Logic)
|
||||||
|
{
|
||||||
|
case "and":
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case "or":
|
case "or":
|
||||||
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = string.Join(",", ids), ConditionalType = (int)cmodel.ConditionalType } });
|
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (itemMethod.Equals(QueryType.NotEqual) || itemMethod.Equals(QueryType.NotIncluded))
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
else
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case "@organizeId": // 当前组织
|
case "@organizeId": // 当前组织
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(userInfo.organizeId))
|
if (!string.IsNullOrEmpty(User.OrganizeId))
|
||||||
{
|
{
|
||||||
var cmodel = GetConditionalModel(itemMethod, itemField, userInfo.organizeId);
|
|
||||||
switch (conditionItem.Logic)
|
switch (conditionItem.Logic)
|
||||||
{
|
{
|
||||||
case "and":
|
case "and":
|
||||||
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = userInfo.organizeId, ConditionalType = (int)cmodel.ConditionalType } });
|
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = User.OrganizeId, ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
break;
|
break;
|
||||||
case "or":
|
case "or":
|
||||||
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = userInfo.organizeId, ConditionalType = (int)cmodel.ConditionalType } });
|
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = User.OrganizeId, ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case "@organizationAndSuborganization": // 当前组织及子组织
|
case "@organizationAndSuborganization": // 当前组织及子组织
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(userInfo.organizeId))
|
if (!string.IsNullOrEmpty(User.OrganizeId))
|
||||||
{
|
{
|
||||||
var ids = new List<string>() { userInfo.organizeId };
|
var ids = new List<string>() { User.OrganizeId };
|
||||||
ids.AddRange(userInfo.subsidiary);
|
ids.AddRange(Subsidiary);
|
||||||
var cmodel = GetConditionalModel(itemMethod, itemField, string.Join(",", ids));
|
for (int i = 0; i < ids.Count; i++)
|
||||||
switch (conditionItem.Logic)
|
|
||||||
{
|
{
|
||||||
case "and":
|
if (i == 0)
|
||||||
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = string.Join(",", ids), ConditionalType = (int)cmodel.ConditionalType } });
|
{
|
||||||
|
switch (conditionItem.Logic)
|
||||||
|
{
|
||||||
|
case "and":
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case "or":
|
case "or":
|
||||||
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = string.Join(",", ids), ConditionalType = (int)cmodel.ConditionalType } });
|
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (itemMethod.Equals(QueryType.NotEqual) || itemMethod.Equals(QueryType.NotIncluded))
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
else
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -831,18 +916,32 @@ public class UserManager : IUserManager, IScoped
|
|||||||
|
|
||||||
case "@branchManageOrganize": // 当前分管组织
|
case "@branchManageOrganize": // 当前分管组织
|
||||||
{
|
{
|
||||||
var orgId = DataScope.Where(x => x.Select).Select(x => x.organizeId).ToList();
|
var ids = DataScope.Where(x => x.Select).Select(x => x.organizeId).ToList();
|
||||||
if (orgId != null)
|
if (ids != null)
|
||||||
{
|
{
|
||||||
var cmodel = GetConditionalModel(itemMethod, itemField, string.Join(",", orgId));
|
for (int i = 0; i < ids.Count; i++)
|
||||||
switch (conditionItem.Logic)
|
|
||||||
{
|
{
|
||||||
case "and":
|
if (i == 0)
|
||||||
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = string.Join(",", orgId), ConditionalType = (int)cmodel.ConditionalType } });
|
{
|
||||||
break;
|
switch (conditionItem.Logic)
|
||||||
case "or":
|
{
|
||||||
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = string.Join(",", orgId), ConditionalType = (int)cmodel.ConditionalType } });
|
case "and":
|
||||||
break;
|
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "or":
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (itemMethod.Equals(QueryType.NotEqual) || itemMethod.Equals(QueryType.NotIncluded))
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
else
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -855,21 +954,35 @@ public class UserManager : IUserManager, IScoped
|
|||||||
|
|
||||||
case "@branchManageOrganizeAndSub": // 当前分管组织及子组织
|
case "@branchManageOrganizeAndSub": // 当前分管组织及子组织
|
||||||
{
|
{
|
||||||
var subOrgIds = new List<string>();
|
var ids = new List<string>();
|
||||||
DataScope.Where(x => x.Select).Select(x => x.organizeId).ToList()
|
DataScope.Where(x => x.Select).Select(x => x.organizeId).ToList()
|
||||||
.ForEach(item => subOrgIds.AddRange(_repository.AsSugarClient().Queryable<OrganizeEntity>().Where(x => x.OrganizeIdTree.Contains(item)).Select(x => x.Id).ToList()));
|
.ForEach(item => ids.AddRange(_repository.AsSugarClient().Queryable<OrganizeEntity>().Where(x => x.OrganizeIdTree.Contains(item)).Select(x => x.Id).ToList()));
|
||||||
|
|
||||||
if (subOrgIds.Any())
|
if (ids.Any())
|
||||||
{
|
{
|
||||||
var cmodel = GetConditionalModel(itemMethod, itemField, string.Join(",", subOrgIds));
|
for (int i = 0; i < ids.Count; i++)
|
||||||
switch (conditionItem.Logic)
|
|
||||||
{
|
{
|
||||||
case "and":
|
if (i == 0)
|
||||||
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = string.Join(",", subOrgIds), ConditionalType = (int)cmodel.ConditionalType } });
|
{
|
||||||
break;
|
switch (conditionItem.Logic)
|
||||||
case "or":
|
{
|
||||||
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = string.Join(",", subOrgIds), ConditionalType = (int)cmodel.ConditionalType } });
|
case "and":
|
||||||
break;
|
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "or":
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (itemMethod.Equals(QueryType.NotEqual) || itemMethod.Equals(QueryType.NotIncluded))
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
else
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -884,16 +997,16 @@ public class UserManager : IUserManager, IScoped
|
|||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(itemValue))
|
if (!string.IsNullOrEmpty(itemValue))
|
||||||
{
|
{
|
||||||
var cmodel = GetConditionalModel(itemMethod, itemField, itemValue, fieldItem.Type);
|
var defCmodel = GetConditionalModel(itemMethod, itemField, itemValue, fieldItem.Type);
|
||||||
if (cmodel.ConditionalType.Equals(ConditionalType.In)) cmodel.ConditionalType = ConditionalType.Like;
|
if (defCmodel.ConditionalType.Equals(ConditionalType.In)) defCmodel.ConditionalType = ConditionalType.Like;
|
||||||
if (cmodel.ConditionalType.Equals(ConditionalType.NotIn)) cmodel.ConditionalType = ConditionalType.NoLike;
|
if (defCmodel.ConditionalType.Equals(ConditionalType.NotIn)) defCmodel.ConditionalType = ConditionalType.NoLike;
|
||||||
switch (conditionItem.Logic)
|
switch (conditionItem.Logic)
|
||||||
{
|
{
|
||||||
case "and":
|
case "and":
|
||||||
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = itemValue, ConditionalType = (int)cmodel.ConditionalType } });
|
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = itemValue, ConditionalType = (int)defCmodel.ConditionalType } });
|
||||||
break;
|
break;
|
||||||
case "or":
|
case "or":
|
||||||
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = itemValue, ConditionalType = (int)cmodel.ConditionalType } });
|
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = itemValue, ConditionalType = (int)defCmodel.ConditionalType } });
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -902,6 +1015,8 @@ public class UserManager : IUserManager, IScoped
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (itemMethod.Equals(QueryType.NotEqual) || itemMethod.Equals(QueryType.NotIncluded))
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = string.Empty, ConditionalType = ConditionalType.IsNullOrEmpty } });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (conditionalList.Any())
|
if (conditionalList.Any())
|
||||||
@@ -1048,11 +1163,13 @@ public class UserManager : IUserManager, IScoped
|
|||||||
var itemValue = fieldItem.Value;
|
var itemValue = fieldItem.Value;
|
||||||
var itemMethod = (QueryType)System.Enum.Parse(typeof(QueryType), fieldItem.Op);
|
var itemMethod = (QueryType)System.Enum.Parse(typeof(QueryType), fieldItem.Op);
|
||||||
|
|
||||||
|
var cmodel = GetConditionalModel(itemMethod, itemField, User.OrganizeId);
|
||||||
|
if (itemMethod.Equals(QueryType.Equal)) cmodel.ConditionalType = ConditionalType.Like;
|
||||||
|
if (itemMethod.Equals(QueryType.NotEqual)) cmodel.ConditionalType = ConditionalType.NoLike;
|
||||||
switch (itemValue)
|
switch (itemValue)
|
||||||
{
|
{
|
||||||
case "@userId": // 当前用户
|
case "@userId": // 当前用户
|
||||||
{
|
{
|
||||||
var cmodel = GetConditionalModel(itemMethod, itemField, UserId);
|
|
||||||
switch (conditionItem.Logic)
|
switch (conditionItem.Logic)
|
||||||
{
|
{
|
||||||
case "and":
|
case "and":
|
||||||
@@ -1070,19 +1187,30 @@ public class UserManager : IUserManager, IScoped
|
|||||||
case "@userAraSubordinates": // 当前用户集下属
|
case "@userAraSubordinates": // 当前用户集下属
|
||||||
{
|
{
|
||||||
var ids = new List<string>() { UserId };
|
var ids = new List<string>() { UserId };
|
||||||
var subordinates = await this.GetSubordinatesAsync(UserId);
|
ids.AddRange(Subordinates);
|
||||||
ids.AddRange(subordinates);
|
for (int i = 0; i < ids.Count; i++)
|
||||||
var cmodel = GetConditionalModel(itemMethod, itemField, string.Join(",", ids));
|
|
||||||
switch (conditionItem.Logic)
|
|
||||||
{
|
{
|
||||||
case "and":
|
if (i == 0)
|
||||||
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = string.Join(",", ids), ConditionalType = (int)cmodel.ConditionalType } });
|
{
|
||||||
|
switch (conditionItem.Logic)
|
||||||
|
{
|
||||||
|
case "and":
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case "or":
|
case "or":
|
||||||
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = string.Join(",", ids), ConditionalType = (int)cmodel.ConditionalType } });
|
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (itemMethod.Equals(QueryType.NotEqual) || itemMethod.Equals(QueryType.NotIncluded))
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
else
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1091,7 +1219,6 @@ public class UserManager : IUserManager, IScoped
|
|||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(User.OrganizeId))
|
if (!string.IsNullOrEmpty(User.OrganizeId))
|
||||||
{
|
{
|
||||||
var cmodel = GetConditionalModel(itemMethod, itemField, User.OrganizeId);
|
|
||||||
switch (conditionItem.Logic)
|
switch (conditionItem.Logic)
|
||||||
{
|
{
|
||||||
case "and":
|
case "and":
|
||||||
@@ -1108,23 +1235,33 @@ public class UserManager : IUserManager, IScoped
|
|||||||
break;
|
break;
|
||||||
case "@organizationAndSuborganization": // 当前组织及子组织
|
case "@organizationAndSuborganization": // 当前组织及子组织
|
||||||
{
|
{
|
||||||
var userInfo = User;
|
if (!string.IsNullOrEmpty(User.OrganizeId))
|
||||||
if (!string.IsNullOrEmpty(userInfo.OrganizeId))
|
|
||||||
{
|
{
|
||||||
var subsidiary = await GetSubsidiaryAsync(userInfo.OrganizeId, userInfo.IsAdministrator.Equals(1));
|
var ids = new List<string>() { User.OrganizeId };
|
||||||
var ids = new List<string>() { userInfo.OrganizeId };
|
ids.AddRange(Subsidiary);
|
||||||
ids.AddRange(subsidiary);
|
for (int i = 0; i < ids.Count; i++)
|
||||||
var cmodel = GetConditionalModel(itemMethod, itemField, string.Join(",", ids));
|
|
||||||
switch (conditionItem.Logic)
|
|
||||||
{
|
{
|
||||||
case "and":
|
if (i == 0)
|
||||||
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = string.Join(",", ids), ConditionalType = (int)cmodel.ConditionalType } });
|
{
|
||||||
|
switch (conditionItem.Logic)
|
||||||
|
{
|
||||||
|
case "and":
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case "or":
|
case "or":
|
||||||
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = string.Join(",", ids), ConditionalType = (int)cmodel.ConditionalType } });
|
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (itemMethod.Equals(QueryType.NotEqual) || itemMethod.Equals(QueryType.NotIncluded))
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
else
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1133,18 +1270,32 @@ public class UserManager : IUserManager, IScoped
|
|||||||
|
|
||||||
case "@branchManageOrganize": // 当前分管组织
|
case "@branchManageOrganize": // 当前分管组织
|
||||||
{
|
{
|
||||||
var orgId = DataScope.Where(x => x.Select).Select(x => x.organizeId).ToList();
|
var ids = DataScope.Where(x => x.Select).Select(x => x.organizeId).ToList();
|
||||||
if (orgId != null)
|
if (ids != null)
|
||||||
{
|
{
|
||||||
var cmodel = GetConditionalModel(itemMethod, itemField, string.Join(",", orgId));
|
for (int i = 0; i < ids.Count; i++)
|
||||||
switch (conditionItem.Logic)
|
|
||||||
{
|
{
|
||||||
case "and":
|
if (i == 0)
|
||||||
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = string.Join(",", orgId), ConditionalType = (int)cmodel.ConditionalType } });
|
{
|
||||||
break;
|
switch (conditionItem.Logic)
|
||||||
case "or":
|
{
|
||||||
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = string.Join(",", orgId), ConditionalType = (int)cmodel.ConditionalType } });
|
case "and":
|
||||||
break;
|
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "or":
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (itemMethod.Equals(QueryType.NotEqual) || itemMethod.Equals(QueryType.NotIncluded))
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
else
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1157,21 +1308,35 @@ public class UserManager : IUserManager, IScoped
|
|||||||
|
|
||||||
case "@branchManageOrganizeAndSub": // 当前分管组织及子组织
|
case "@branchManageOrganizeAndSub": // 当前分管组织及子组织
|
||||||
{
|
{
|
||||||
var subOrgIds = new List<string>();
|
var ids = new List<string>();
|
||||||
DataScope.Where(x => x.Select).Select(x => x.organizeId).ToList()
|
DataScope.Where(x => x.Select).Select(x => x.organizeId).ToList()
|
||||||
.ForEach(item => subOrgIds.AddRange(_repository.AsSugarClient().Queryable<OrganizeEntity>().Where(x => x.OrganizeIdTree.Contains(item)).Select(x => x.Id).ToList()));
|
.ForEach(item => ids.AddRange(_repository.AsSugarClient().Queryable<OrganizeEntity>().Where(x => x.OrganizeIdTree.Contains(item)).Select(x => x.Id).ToList()));
|
||||||
|
|
||||||
if (subOrgIds.Any())
|
if (ids.Any())
|
||||||
{
|
{
|
||||||
var cmodel = GetConditionalModel(itemMethod, itemField, string.Join(",", subOrgIds));
|
for (int i = 0; i < ids.Count; i++)
|
||||||
switch (conditionItem.Logic)
|
|
||||||
{
|
{
|
||||||
case "and":
|
if (i == 0)
|
||||||
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = string.Join(",", subOrgIds), ConditionalType = (int)cmodel.ConditionalType } });
|
{
|
||||||
break;
|
switch (conditionItem.Logic)
|
||||||
case "or":
|
{
|
||||||
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = string.Join(",", subOrgIds), ConditionalType = (int)cmodel.ConditionalType } });
|
case "and":
|
||||||
break;
|
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "or":
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (itemMethod.Equals(QueryType.NotEqual) || itemMethod.Equals(QueryType.NotIncluded))
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
else
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1186,24 +1351,25 @@ public class UserManager : IUserManager, IScoped
|
|||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(itemValue))
|
if (!string.IsNullOrEmpty(itemValue))
|
||||||
{
|
{
|
||||||
var cmodel = GetConditionalModel(itemMethod, itemField, itemValue, fieldItem.Type);
|
var defCmodel = GetConditionalModel(itemMethod, itemField, itemValue, fieldItem.Type);
|
||||||
if (cmodel.ConditionalType.Equals(ConditionalType.In)) cmodel.ConditionalType = ConditionalType.Like;
|
if (defCmodel.ConditionalType.Equals(ConditionalType.In)) defCmodel.ConditionalType = ConditionalType.Like;
|
||||||
if (cmodel.ConditionalType.Equals(ConditionalType.NotIn)) cmodel.ConditionalType = ConditionalType.NoLike;
|
if (defCmodel.ConditionalType.Equals(ConditionalType.NotIn)) defCmodel.ConditionalType = ConditionalType.NoLike;
|
||||||
switch (conditionItem.Logic)
|
switch (conditionItem.Logic)
|
||||||
{
|
{
|
||||||
case "and":
|
case "and":
|
||||||
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = itemValue, ConditionalType = (int)cmodel.ConditionalType } });
|
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = itemValue, ConditionalType = (int)defCmodel.ConditionalType } });
|
||||||
break;
|
break;
|
||||||
case "or":
|
case "or":
|
||||||
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = itemValue, ConditionalType = (int)cmodel.ConditionalType } });
|
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = itemValue, ConditionalType = (int)defCmodel.ConditionalType } });
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (itemMethod.Equals(QueryType.NotEqual) || itemMethod.Equals(QueryType.NotIncluded))
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = string.Empty, ConditionalType = ConditionalType.IsNullOrEmpty } });
|
||||||
codeGenConditionalObject.Find(it => it.FieldRule == fieldRule && it.TableName.Equals(tableName)).conditionalModel.AddRange(conditionalList);
|
codeGenConditionalObject.Find(it => it.FieldRule == fieldRule && it.TableName.Equals(tableName)).conditionalModel.AddRange(conditionalList);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1329,11 +1495,13 @@ public class UserManager : IUserManager, IScoped
|
|||||||
var itemValue = fieldItem.Value;
|
var itemValue = fieldItem.Value;
|
||||||
var itemMethod = (QueryType)System.Enum.Parse(typeof(QueryType), fieldItem.Op);
|
var itemMethod = (QueryType)System.Enum.Parse(typeof(QueryType), fieldItem.Op);
|
||||||
|
|
||||||
|
var cmodel = GetConditionalModel(itemMethod, itemField, User.OrganizeId);
|
||||||
|
if (itemMethod.Equals(QueryType.Equal)) cmodel.ConditionalType = ConditionalType.Like;
|
||||||
|
if (itemMethod.Equals(QueryType.NotEqual)) cmodel.ConditionalType = ConditionalType.NoLike;
|
||||||
switch (itemValue)
|
switch (itemValue)
|
||||||
{
|
{
|
||||||
case "@userId": // 当前用户
|
case "@userId": // 当前用户
|
||||||
{
|
{
|
||||||
var cmodel = GetConditionalModel(itemMethod, itemField, UserId);
|
|
||||||
switch (conditionItem.Logic)
|
switch (conditionItem.Logic)
|
||||||
{
|
{
|
||||||
case "and":
|
case "and":
|
||||||
@@ -1352,17 +1520,29 @@ public class UserManager : IUserManager, IScoped
|
|||||||
{
|
{
|
||||||
var ids = new List<string>() { UserId };
|
var ids = new List<string>() { UserId };
|
||||||
ids.AddRange(Subordinates);
|
ids.AddRange(Subordinates);
|
||||||
var cmodel = GetConditionalModel(itemMethod, itemField, string.Join(",", ids));
|
for (int i = 0; i < ids.Count; i++)
|
||||||
switch (conditionItem.Logic)
|
|
||||||
{
|
{
|
||||||
case "and":
|
if (i == 0)
|
||||||
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = string.Join(",", ids), ConditionalType = (int)cmodel.ConditionalType } });
|
{
|
||||||
|
switch (conditionItem.Logic)
|
||||||
|
{
|
||||||
|
case "and":
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case "or":
|
case "or":
|
||||||
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = string.Join(",", ids), ConditionalType = (int)cmodel.ConditionalType } });
|
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (itemMethod.Equals(QueryType.NotEqual) || itemMethod.Equals(QueryType.NotIncluded))
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
else
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1371,7 +1551,6 @@ public class UserManager : IUserManager, IScoped
|
|||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(User.OrganizeId))
|
if (!string.IsNullOrEmpty(User.OrganizeId))
|
||||||
{
|
{
|
||||||
var cmodel = GetConditionalModel(itemMethod, itemField, User.OrganizeId);
|
|
||||||
switch (conditionItem.Logic)
|
switch (conditionItem.Logic)
|
||||||
{
|
{
|
||||||
case "and":
|
case "and":
|
||||||
@@ -1382,7 +1561,6 @@ public class UserManager : IUserManager, IScoped
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@@ -1392,17 +1570,29 @@ public class UserManager : IUserManager, IScoped
|
|||||||
{
|
{
|
||||||
var ids = new List<string>() { User.OrganizeId };
|
var ids = new List<string>() { User.OrganizeId };
|
||||||
ids.AddRange(Subsidiary);
|
ids.AddRange(Subsidiary);
|
||||||
var cmodel = GetConditionalModel(itemMethod, itemField, string.Join(",", ids));
|
for (int i = 0; i < ids.Count; i++)
|
||||||
switch (conditionItem.Logic)
|
|
||||||
{
|
{
|
||||||
case "and":
|
if(i == 0)
|
||||||
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = string.Join(",", ids), ConditionalType = (int)cmodel.ConditionalType } });
|
{
|
||||||
|
switch (conditionItem.Logic)
|
||||||
|
{
|
||||||
|
case "and":
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case "or":
|
case "or":
|
||||||
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = string.Join(",", ids), ConditionalType = (int)cmodel.ConditionalType } });
|
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (itemMethod.Equals(QueryType.NotEqual) || itemMethod.Equals(QueryType.NotIncluded))
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
else
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1411,18 +1601,32 @@ public class UserManager : IUserManager, IScoped
|
|||||||
|
|
||||||
case "@branchManageOrganize": // 当前分管组织
|
case "@branchManageOrganize": // 当前分管组织
|
||||||
{
|
{
|
||||||
var orgId = DataScope.Where(x => x.Select).Select(x => x.organizeId).ToList();
|
var ids = DataScope.Where(x => x.Select).Select(x => x.organizeId).ToList();
|
||||||
if (orgId != null)
|
if (ids != null)
|
||||||
{
|
{
|
||||||
var cmodel = GetConditionalModel(itemMethod, itemField, string.Join(",", orgId));
|
for (int i = 0; i < ids.Count; i++)
|
||||||
switch (conditionItem.Logic)
|
|
||||||
{
|
{
|
||||||
case "and":
|
if (i == 0)
|
||||||
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = string.Join(",", orgId), ConditionalType = (int)cmodel.ConditionalType } });
|
{
|
||||||
break;
|
switch (conditionItem.Logic)
|
||||||
case "or":
|
{
|
||||||
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = string.Join(",", orgId), ConditionalType = (int)cmodel.ConditionalType } });
|
case "and":
|
||||||
break;
|
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "or":
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(itemMethod.Equals(QueryType.NotEqual) || itemMethod.Equals(QueryType.NotIncluded))
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
else
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1435,21 +1639,35 @@ public class UserManager : IUserManager, IScoped
|
|||||||
|
|
||||||
case "@branchManageOrganizeAndSub": // 当前分管组织及子组织
|
case "@branchManageOrganizeAndSub": // 当前分管组织及子组织
|
||||||
{
|
{
|
||||||
var subOrgIds = new List<string>();
|
var ids = new List<string>();
|
||||||
DataScope.Where(x => x.Select).Select(x => x.organizeId).ToList()
|
DataScope.Where(x => x.Select).Select(x => x.organizeId).ToList()
|
||||||
.ForEach(item => subOrgIds.AddRange(_repository.AsSugarClient().Queryable<OrganizeEntity>().Where(x => x.OrganizeIdTree.Contains(item)).Select(x => x.Id).ToList()));
|
.ForEach(item => ids.AddRange(_repository.AsSugarClient().Queryable<OrganizeEntity>().Where(x => x.OrganizeIdTree.Contains(item)).Select(x => x.Id).ToList()));
|
||||||
|
|
||||||
if (subOrgIds.Any())
|
if (ids.Any())
|
||||||
{
|
{
|
||||||
var cmodel = GetConditionalModel(itemMethod, itemField, string.Join(",", subOrgIds));
|
for (int i = 0; i < ids.Count; i++)
|
||||||
switch (conditionItem.Logic)
|
|
||||||
{
|
{
|
||||||
case "and":
|
if (i == 0)
|
||||||
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = string.Join(",", subOrgIds), ConditionalType = (int)cmodel.ConditionalType } });
|
{
|
||||||
break;
|
switch (conditionItem.Logic)
|
||||||
case "or":
|
{
|
||||||
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = string.Join(",", subOrgIds), ConditionalType = (int)cmodel.ConditionalType } });
|
case "and":
|
||||||
break;
|
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "or":
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (itemMethod.Equals(QueryType.NotEqual) || itemMethod.Equals(QueryType.NotIncluded))
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
else
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = ids[i], ConditionalType = (int)cmodel.ConditionalType } });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1464,16 +1682,16 @@ public class UserManager : IUserManager, IScoped
|
|||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(itemValue))
|
if (!string.IsNullOrEmpty(itemValue))
|
||||||
{
|
{
|
||||||
var cmodel = GetConditionalModel(itemMethod, itemField, itemValue, fieldItem.Type);
|
var defCmodel = GetConditionalModel(itemMethod, itemField, itemValue, fieldItem.Type);
|
||||||
if (cmodel.ConditionalType.Equals(ConditionalType.In)) cmodel.ConditionalType = ConditionalType.Like;
|
if (defCmodel.ConditionalType.Equals(ConditionalType.In)) defCmodel.ConditionalType = ConditionalType.Like;
|
||||||
if (cmodel.ConditionalType.Equals(ConditionalType.NotIn)) cmodel.ConditionalType = ConditionalType.NoLike;
|
if (defCmodel.ConditionalType.Equals(ConditionalType.NotIn)) defCmodel.ConditionalType = ConditionalType.NoLike;
|
||||||
switch (conditionItem.Logic)
|
switch (conditionItem.Logic)
|
||||||
{
|
{
|
||||||
case "and":
|
case "and":
|
||||||
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = itemValue, ConditionalType = (int)cmodel.ConditionalType } });
|
conditionalList.Add(new { Key = (int)WhereType.And, Value = new { FieldName = itemField, FieldValue = itemValue, ConditionalType = (int)defCmodel.ConditionalType } });
|
||||||
break;
|
break;
|
||||||
case "or":
|
case "or":
|
||||||
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = itemValue, ConditionalType = (int)cmodel.ConditionalType } });
|
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = itemValue, ConditionalType = (int)defCmodel.ConditionalType } });
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1482,6 +1700,8 @@ public class UserManager : IUserManager, IScoped
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (itemMethod.Equals(QueryType.NotEqual) || itemMethod.Equals(QueryType.NotIncluded))
|
||||||
|
conditionalList.Add(new { Key = (int)WhereType.Or, Value = new { FieldName = itemField, FieldValue = string.Empty, ConditionalType = ConditionalType.IsNullOrEmpty } });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (conditionalList.Any())
|
if (conditionalList.Any())
|
||||||
@@ -1691,12 +1911,14 @@ public class UserManager : IUserManager, IScoped
|
|||||||
|
|
||||||
// 包含
|
// 包含
|
||||||
case QueryType.In:
|
case QueryType.In:
|
||||||
case QueryType.Included:
|
|
||||||
return new ConditionalModel() { FieldName = fieldName, ConditionalType = ConditionalType.In, FieldValue = fieldValue };
|
return new ConditionalModel() { FieldName = fieldName, ConditionalType = ConditionalType.In, FieldValue = fieldValue };
|
||||||
|
case QueryType.Included:
|
||||||
|
return new ConditionalModel() { FieldName = fieldName, ConditionalType = ConditionalType.Like, FieldValue = fieldValue };
|
||||||
// 不包含
|
// 不包含
|
||||||
case QueryType.NotIn:
|
case QueryType.NotIn:
|
||||||
|
return new ConditionalModel() { FieldName = fieldName, ConditionalType = ConditionalType.In, FieldValue = fieldValue };
|
||||||
case QueryType.NotIncluded:
|
case QueryType.NotIncluded:
|
||||||
return new ConditionalModel() { FieldName = fieldName, ConditionalType = ConditionalType.NotIn, FieldValue = fieldValue };
|
return new ConditionalModel() { FieldName = fieldName, ConditionalType = ConditionalType.NoLike, FieldValue = fieldValue };
|
||||||
}
|
}
|
||||||
|
|
||||||
return new ConditionalModel();
|
return new ConditionalModel();
|
||||||
|
|||||||
@@ -14,8 +14,10 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\..\message\Tnb.Message.Entitys\Tnb.Message.Entitys.csproj" />
|
||||||
<ProjectReference Include="..\..\system\Tnb.Systems.Entitys\Tnb.Systems.Entitys.csproj" />
|
<ProjectReference Include="..\..\system\Tnb.Systems.Entitys\Tnb.Systems.Entitys.csproj" />
|
||||||
<ProjectReference Include="..\..\visualdev\Tnb.VisualDev.Entitys\Tnb.VisualDev.Entitys.csproj" />
|
<ProjectReference Include="..\..\visualdev\Tnb.VisualDev.Entitys\Tnb.VisualDev.Entitys.csproj" />
|
||||||
|
<ProjectReference Include="..\Tnb.WebSockets\Tnb.WebSockets.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -86,12 +86,14 @@ public class CodeGenUploadAttribute : Attribute
|
|||||||
/// 构造函数
|
/// 构造函数
|
||||||
/// "popupSelect".
|
/// "popupSelect".
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public CodeGenUploadAttribute(string Model, string SecondParameter, string ThreeParameters, string FourParameters, string Config)
|
public CodeGenUploadAttribute(string Model, string dataConversionModel, string SecondParameter, string ThreeParameters, string FourParameters, string ShowField, string Config)
|
||||||
{
|
{
|
||||||
__Model__ = Model;
|
__Model__ = Model;
|
||||||
|
__vModel__ = dataConversionModel;
|
||||||
interfaceId = SecondParameter;
|
interfaceId = SecondParameter;
|
||||||
propsValue = ThreeParameters;
|
propsValue = ThreeParameters;
|
||||||
relationField = FourParameters;
|
relationField = FourParameters;
|
||||||
|
showField = ShowField;
|
||||||
__config__ = Config.ToObject<CodeGenConfigModel>();
|
__config__ = Config.ToObject<CodeGenConfigModel>();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -135,9 +137,7 @@ public class CodeGenUploadAttribute : Attribute
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 构造函数
|
/// 构造函数
|
||||||
/// "treeSelect"
|
/// "treeSelect"
|
||||||
/// "usersSelect":
|
/// "depSelect":.
|
||||||
/// "depSelect":
|
|
||||||
/// "relationForm".
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public CodeGenUploadAttribute(string Model, bool Multiple, string ThreeParameters, string FourParameters, string Config)
|
public CodeGenUploadAttribute(string Model, bool Multiple, string ThreeParameters, string FourParameters, string Config)
|
||||||
{
|
{
|
||||||
@@ -146,18 +146,10 @@ public class CodeGenUploadAttribute : Attribute
|
|||||||
__config__ = Config.ToObject<CodeGenConfigModel>();
|
__config__ = Config.ToObject<CodeGenConfigModel>();
|
||||||
switch (__config__.jnpfKey)
|
switch (__config__.jnpfKey)
|
||||||
{
|
{
|
||||||
case JnpfKeyConst.RELATIONFORM:
|
|
||||||
modelId = ThreeParameters;
|
|
||||||
relationField = FourParameters;
|
|
||||||
break;
|
|
||||||
case JnpfKeyConst.DEPSELECT:
|
case JnpfKeyConst.DEPSELECT:
|
||||||
selectType = ThreeParameters;
|
selectType = ThreeParameters;
|
||||||
ableDepIds = FourParameters?.ToObject<List<string>>();
|
ableDepIds = FourParameters?.ToObject<List<string>>();
|
||||||
break;
|
break;
|
||||||
case JnpfKeyConst.USERSSELECT:
|
|
||||||
selectType = ThreeParameters;
|
|
||||||
ableIds = FourParameters?.ToObject<List<string>>();
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
props = ThreeParameters?.ToObject<CodeGenPropsModel>();
|
props = ThreeParameters?.ToObject<CodeGenPropsModel>();
|
||||||
options = FourParameters?.ToObject<List<object>>();
|
options = FourParameters?.ToObject<List<object>>();
|
||||||
@@ -165,10 +157,25 @@ public class CodeGenUploadAttribute : Attribute
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 构造函数
|
||||||
|
/// "usersSelect":.
|
||||||
|
/// </summary>
|
||||||
|
public CodeGenUploadAttribute(string Model, string dataConversionModel, bool Multiple, string ThreeParameters, string FourParameters, string Config)
|
||||||
|
{
|
||||||
|
__Model__ = Model;
|
||||||
|
__vModel__ = dataConversionModel;
|
||||||
|
multiple = Multiple;
|
||||||
|
__config__ = Config.ToObject<CodeGenConfigModel>();
|
||||||
|
selectType = ThreeParameters;
|
||||||
|
ableIds = FourParameters?.ToObject<List<string>>();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 构造函数
|
/// 构造函数
|
||||||
/// "cascader"
|
/// "cascader"
|
||||||
/// "posSelect":
|
/// "posSelect":
|
||||||
|
/// "relationForm"
|
||||||
/// "popupTableSelect".
|
/// "popupTableSelect".
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public CodeGenUploadAttribute(string Model, bool Multiple, string InterfaceId, string PropsValue, string RelationField, string Config)
|
public CodeGenUploadAttribute(string Model, bool Multiple, string InterfaceId, string PropsValue, string RelationField, string Config)
|
||||||
@@ -196,6 +203,21 @@ public class CodeGenUploadAttribute : Attribute
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 构造函数
|
||||||
|
/// "relationForm".
|
||||||
|
/// </summary>
|
||||||
|
public CodeGenUploadAttribute(string Model, string dataConversionModel, bool Multiple, string InterfaceId, string PropsValue, string RelationField, string Config)
|
||||||
|
{
|
||||||
|
__Model__ = Model;
|
||||||
|
__vModel__ = dataConversionModel;
|
||||||
|
multiple = Multiple;
|
||||||
|
__config__ = Config.ToObject<CodeGenConfigModel>();
|
||||||
|
modelId = InterfaceId;
|
||||||
|
relationField = PropsValue;
|
||||||
|
showField = RelationField;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 构造函数
|
/// 构造函数
|
||||||
/// "userSelect":.
|
/// "userSelect":.
|
||||||
@@ -218,6 +240,11 @@ public class CodeGenUploadAttribute : Attribute
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string __Model__ { get; set; }
|
public string __Model__ { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 数据转换.
|
||||||
|
/// </summary>
|
||||||
|
public string __vModel__ { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 最小值.
|
/// 最小值.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -332,4 +359,9 @@ public class CodeGenUploadAttribute : Attribute
|
|||||||
/// 新用户选择控件.
|
/// 新用户选择控件.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<string> ableIds { get; set; }
|
public List<string> ableIds { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 展示字段.
|
||||||
|
/// </summary>
|
||||||
|
public string showField { get; set; }
|
||||||
}
|
}
|
||||||
@@ -222,6 +222,18 @@ public enum ErrorCode
|
|||||||
[ErrorCodeItemMetadata("登录票据已失效")]
|
[ErrorCodeItemMetadata("登录票据已失效")]
|
||||||
D1035,
|
D1035,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 主系统不允许禁用.
|
||||||
|
/// </summary>
|
||||||
|
[ErrorCodeItemMetadata("主系统不允许禁用")]
|
||||||
|
D1036,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 主系统不允许更改应用编码.
|
||||||
|
/// </summary>
|
||||||
|
[ErrorCodeItemMetadata("主系统不允许更改应用编码")]
|
||||||
|
D1037,
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 机构 2
|
#region 机构 2
|
||||||
@@ -504,6 +516,12 @@ public enum ErrorCode
|
|||||||
[ErrorCodeItemMetadata("当前导入菜单为Web端菜单,请在对应模块下导入!")]
|
[ErrorCodeItemMetadata("当前导入菜单为Web端菜单,请在对应模块下导入!")]
|
||||||
D4013,
|
D4013,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 该系统已被禁用
|
||||||
|
/// </summary>
|
||||||
|
[ErrorCodeItemMetadata("切换失败,当前系统已被管理员禁用")]
|
||||||
|
D4014,
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 用户 5
|
#region 用户 5
|
||||||
|
|||||||
@@ -83,4 +83,9 @@ public class ConvertSuperQuery
|
|||||||
/// 是否主条件.
|
/// 是否主条件.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool mainWhere { get; set; }
|
public bool mainWhere { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 象征.
|
||||||
|
/// </summary>
|
||||||
|
public string symbol { get; set; }
|
||||||
}
|
}
|
||||||
@@ -22,14 +22,14 @@ public static class CodeGenHelper
|
|||||||
case "nchar":
|
case "nchar":
|
||||||
case "timestamp":
|
case "timestamp":
|
||||||
case "string":
|
case "string":
|
||||||
return "string";
|
return "string?";
|
||||||
|
|
||||||
case "int":
|
case "int":
|
||||||
case "smallint":
|
case "smallint":
|
||||||
return "int";
|
return "int?";
|
||||||
|
|
||||||
case "tinyint":
|
case "tinyint":
|
||||||
return "byte";
|
return "byte?";
|
||||||
|
|
||||||
case "bigint":
|
case "bigint":
|
||||||
// sqlite数据库
|
// sqlite数据库
|
||||||
@@ -43,10 +43,10 @@ public static class CodeGenHelper
|
|||||||
case "smallmoney":
|
case "smallmoney":
|
||||||
case "numeric":
|
case "numeric":
|
||||||
case "decimal":
|
case "decimal":
|
||||||
return "decimal";
|
return "decimal?";
|
||||||
|
|
||||||
case "real":
|
case "real":
|
||||||
return "Single";
|
return "Single?";
|
||||||
|
|
||||||
case "datetime":
|
case "datetime":
|
||||||
case "datetime2":
|
case "datetime2":
|
||||||
@@ -55,7 +55,7 @@ public static class CodeGenHelper
|
|||||||
return "DateTime?";
|
return "DateTime?";
|
||||||
|
|
||||||
case "float":
|
case "float":
|
||||||
return "double";
|
return "double?";
|
||||||
|
|
||||||
case "image":
|
case "image":
|
||||||
case "binary":
|
case "binary":
|
||||||
@@ -218,7 +218,7 @@ public static class CodeGenHelper
|
|||||||
result.Add(label, "系统自动生成");
|
result.Add(label, "系统自动生成");
|
||||||
break;
|
break;
|
||||||
case JnpfKeyConst.COMSELECT:
|
case JnpfKeyConst.COMSELECT:
|
||||||
result.Add(label, multiple ? "例:拓通智联/产品部,拓通智联/技术部" : "例:拓通智联/技术部");
|
result.Add(label, multiple ? "例:引迈信息/产品部,引迈信息/技术部" : "例:引迈信息/技术部");
|
||||||
break;
|
break;
|
||||||
case JnpfKeyConst.DEPSELECT:
|
case JnpfKeyConst.DEPSELECT:
|
||||||
result.Add(label, multiple ? "例:产品部/部门编码,技术部/部门编码" : "例:技术部/部门编码");
|
result.Add(label, multiple ? "例:产品部/部门编码,技术部/部门编码" : "例:技术部/部门编码");
|
||||||
@@ -230,7 +230,7 @@ public static class CodeGenHelper
|
|||||||
result.Add(label, multiple ? "例:张三/账号,李四/账号" : "例:张三/账号");
|
result.Add(label, multiple ? "例:张三/账号,李四/账号" : "例:张三/账号");
|
||||||
break;
|
break;
|
||||||
case JnpfKeyConst.USERSSELECT:
|
case JnpfKeyConst.USERSSELECT:
|
||||||
result.Add(label, multiple ? "例:拓通智联/产品部,产品部/部门编码,技术经理/岗位编码,研发人员/角色编码,A分组/分组编码,张三/账号" : "例:李四/账号");
|
result.Add(label, multiple ? "例:引迈信息/产品部,产品部/部门编码,技术经理/岗位编码,研发人员/角色编码,A分组/分组编码,张三/账号" : "例:李四/账号");
|
||||||
break;
|
break;
|
||||||
case JnpfKeyConst.ROLESELECT:
|
case JnpfKeyConst.ROLESELECT:
|
||||||
result.Add(label, multiple ? "例:研发人员/角色编码,测试人员/角色编码" : "例:研发人员/角色编码");
|
result.Add(label, multiple ? "例:研发人员/角色编码,测试人员/角色编码" : "例:研发人员/角色编码");
|
||||||
|
|||||||
41
extend/Tnb.Extend.Entitys/Dto/Customer/CustomerListOutput.cs
Normal file
41
extend/Tnb.Extend.Entitys/Dto/Customer/CustomerListOutput.cs
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
using JNPF.DependencyInjection;
|
||||||
|
using SqlSugar;
|
||||||
|
|
||||||
|
namespace JNPF.Extend.Entitys.Dto.Customer;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 客户信息.
|
||||||
|
/// </summary>
|
||||||
|
[SuppressSniffer]
|
||||||
|
public class CustomerListOutput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 主键.
|
||||||
|
/// </summary>
|
||||||
|
public string id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 客户编号.
|
||||||
|
/// </summary>
|
||||||
|
public string code { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 客户名称.
|
||||||
|
/// </summary>
|
||||||
|
public string customerName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 地址.
|
||||||
|
/// </summary>
|
||||||
|
public string address { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 名称.
|
||||||
|
/// </summary>
|
||||||
|
public string name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 联系方式.
|
||||||
|
/// </summary>
|
||||||
|
public string contactTel { get; set; }
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using JNPF.DependencyInjection;
|
using JNPF.DependencyInjection;
|
||||||
|
using JNPF.Extend.Entitys.Dto.ProductEntry;
|
||||||
|
|
||||||
namespace JNPF.Extend.Entitys.Dto.Product;
|
namespace JNPF.Extend.Entitys.Dto.Product;
|
||||||
|
|
||||||
@@ -106,5 +107,5 @@ public class ProductCrInput
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 子表数据.
|
/// 子表数据.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<ProductEntryEntity> productEntryList { get; set; }
|
public List<ProductEntryCrInput> productEntryList { get; set; }
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
using JNPF.DependencyInjection;
|
||||||
|
|
||||||
|
namespace JNPF.Extend.Entitys.Dto.ProductEntry;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 新建产品明细.
|
||||||
|
/// </summary>
|
||||||
|
[SuppressSniffer]
|
||||||
|
public class ProductEntryCrInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 主键.
|
||||||
|
/// </summary>
|
||||||
|
public string? id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 产品编号.
|
||||||
|
/// </summary>
|
||||||
|
public string productCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 产品名称.
|
||||||
|
/// </summary>
|
||||||
|
public string productName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 产品规格.
|
||||||
|
/// </summary>
|
||||||
|
public string productSpecification { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 数量.
|
||||||
|
/// </summary>
|
||||||
|
public int qty { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 订货类型.
|
||||||
|
/// </summary>
|
||||||
|
public string type { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 单价.
|
||||||
|
/// </summary>
|
||||||
|
public decimal money { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 折后单价.
|
||||||
|
/// </summary>
|
||||||
|
public decimal price { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 金额.
|
||||||
|
/// </summary>
|
||||||
|
public decimal amount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 备注.
|
||||||
|
/// </summary>
|
||||||
|
public string description { get; set; }
|
||||||
|
}
|
||||||
@@ -8,6 +8,11 @@ namespace JNPF.Extend.Entitys.Dto.ProductEntry;
|
|||||||
[SuppressSniffer]
|
[SuppressSniffer]
|
||||||
public class ProductEntryInfoOutput
|
public class ProductEntryInfoOutput
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 主键.
|
||||||
|
/// </summary>
|
||||||
|
public string id { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 产品编号.
|
/// 产品编号.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
using JNPF.DependencyInjection;
|
||||||
|
|
||||||
|
namespace JNPF.Extend.Entitys.Dto.ProductGoods;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 产品列表.
|
||||||
|
/// </summary>
|
||||||
|
[SuppressSniffer]
|
||||||
|
public class ProductGoodsListOutput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 主键.
|
||||||
|
/// </summary>
|
||||||
|
public string id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 分类主键.
|
||||||
|
/// </summary>
|
||||||
|
public string classifyId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 订单编号.
|
||||||
|
/// </summary>
|
||||||
|
public string code { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 订单名称.
|
||||||
|
/// </summary>
|
||||||
|
public string fullName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 订单名称.
|
||||||
|
/// </summary>
|
||||||
|
public int qty { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 订货类型.
|
||||||
|
/// </summary>
|
||||||
|
public string type { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 金额.
|
||||||
|
/// </summary>
|
||||||
|
public string amount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 单价.
|
||||||
|
/// </summary>
|
||||||
|
public string money { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
using JNPF.Common.Filter;
|
||||||
|
using JNPF.DependencyInjection;
|
||||||
|
|
||||||
|
namespace JNPF.Extend.Entitys.Dto.ProductGoods;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 产品列表.
|
||||||
|
/// </summary>
|
||||||
|
[SuppressSniffer]
|
||||||
|
public class ProductGoodsListQueryInput : PageInputBase
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 订单编号.
|
||||||
|
/// </summary>
|
||||||
|
public string code { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 产品名称.
|
||||||
|
/// </summary>
|
||||||
|
public string fullName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 分类ID.
|
||||||
|
/// </summary>
|
||||||
|
public string classifyId { get; set; }
|
||||||
|
}
|
||||||
@@ -6,7 +6,8 @@ namespace JNPF.Extend.Entitys;
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 大数据测试
|
/// 大数据测试
|
||||||
/// 版 本:V3.2
|
/// 版 本:V3.2
|
||||||
/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com)
|
/// 版 权:引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||||
|
/// 作 者:JNPF开发平台组
|
||||||
/// 日 期:2021-06-01.
|
/// 日 期:2021-06-01.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("EXT_BIGDATA")]
|
[SugarTable("EXT_BIGDATA")]
|
||||||
|
|||||||
59
extend/Tnb.Extend.Entitys/Entity/CustomerEntity.cs
Normal file
59
extend/Tnb.Extend.Entitys/Entity/CustomerEntity.cs
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
using JNPF.Common.Contracts;
|
||||||
|
using SqlSugar;
|
||||||
|
|
||||||
|
namespace JNPF.Extend.Entitys.Entity;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 客户信息.
|
||||||
|
/// </summary>
|
||||||
|
[SugarTable("ext_customer", TableDescription = "客户信息")]
|
||||||
|
public class CustomerEntity : CLEntityBase
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 编码.
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "F_Code")]
|
||||||
|
public string Code { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 客户名称.
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "F_CustomerName")]
|
||||||
|
public string Customername { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 地址.
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "F_Address")]
|
||||||
|
public string Address { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 名称.
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "F_Name")]
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 联系方式.
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "F_ContactTel")]
|
||||||
|
public string ContactTel { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 删除标志.
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "F_DeleteMark")]
|
||||||
|
public float Deletemark { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 删除时间.
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "F_DeleteTime")]
|
||||||
|
public DateTime Deletetime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 删除用户.
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "F_DeleteUserId")]
|
||||||
|
public string Deleteuserid { get; set; }
|
||||||
|
}
|
||||||
@@ -6,7 +6,8 @@ namespace JNPF.Extend.Entitys;
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 知识文档
|
/// 知识文档
|
||||||
/// 版 本:V3.2
|
/// 版 本:V3.2
|
||||||
/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com)
|
/// 版 权:引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||||
|
/// 作 者:JNPF开发平台组
|
||||||
/// 日 期:2021-06-01.
|
/// 日 期:2021-06-01.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("EXT_DOCUMENT")]
|
[SugarTable("EXT_DOCUMENT")]
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ namespace JNPF.Extend.Entitys;
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 知识文档共享
|
/// 知识文档共享
|
||||||
/// 版 本:V3.2
|
/// 版 本:V3.2
|
||||||
/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com)
|
/// 版 权:引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||||
|
/// 作 者:JNPF开发平台组
|
||||||
/// 日 期:2021-06-01 .
|
/// 日 期:2021-06-01 .
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("EXT_DOCUMENTSHARE")]
|
[SugarTable("EXT_DOCUMENTSHARE")]
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ namespace JNPF.Extend.Entitys;
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 邮件配置
|
/// 邮件配置
|
||||||
/// 版 本:V3.2
|
/// 版 本:V3.2
|
||||||
/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com)
|
/// 版 权:引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||||
|
/// 作 者:JNPF开发平台组
|
||||||
/// 日 期:2021-06-01.
|
/// 日 期:2021-06-01.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("EXT_EMAILCONFIG")]
|
[SugarTable("EXT_EMAILCONFIG")]
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ namespace JNPF.Extend.Entitys;
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 邮件接收
|
/// 邮件接收
|
||||||
/// 版 本:V3.2
|
/// 版 本:V3.2
|
||||||
/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com)
|
/// 版 权:引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||||
|
/// 作 者:JNPF开发平台组
|
||||||
/// 日 期:2021-06-01.
|
/// 日 期:2021-06-01.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("EXT_EMAILRECEIVE")]
|
[SugarTable("EXT_EMAILRECEIVE")]
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ namespace JNPF.Extend.Entitys;
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 邮件发送
|
/// 邮件发送
|
||||||
/// 版 本:V3.2
|
/// 版 本:V3.2
|
||||||
/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com)
|
/// 版 权:引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||||
|
/// 作 者:JNPF开发平台组
|
||||||
/// 日 期:2021-06-01 .
|
/// 日 期:2021-06-01 .
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("EXT_EMAILSEND")]
|
[SugarTable("EXT_EMAILSEND")]
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ namespace JNPF.Extend.Entitys;
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 职员信息
|
/// 职员信息
|
||||||
/// 版 本:V3.2
|
/// 版 本:V3.2
|
||||||
/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com)
|
/// 版 权:引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||||
|
/// 作 者:JNPF开发平台组
|
||||||
/// 日 期:2021-06-01 .
|
/// 日 期:2021-06-01 .
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("EXT_EMPLOYEE")]
|
[SugarTable("EXT_EMPLOYEE")]
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ namespace JNPF.Extend.Entitys;
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 订单信息
|
/// 订单信息
|
||||||
/// 版 本:V3.2
|
/// 版 本:V3.2
|
||||||
/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com)
|
/// 版 权:引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||||
|
/// 作 者:JNPF开发平台组
|
||||||
/// 日 期:2021-06-01 .
|
/// 日 期:2021-06-01 .
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("EXT_ORDER")]
|
[SugarTable("EXT_ORDER")]
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ namespace JNPF.Extend.Entitys;
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 订单明细
|
/// 订单明细
|
||||||
/// 版 本:V3.2
|
/// 版 本:V3.2
|
||||||
/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com)
|
/// 版 权:引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||||
|
/// 作 者:JNPF开发平台组
|
||||||
/// 日 期:2021-06-01 .
|
/// 日 期:2021-06-01 .
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("EXT_ORDERENTRY")]
|
[SugarTable("EXT_ORDERENTRY")]
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ namespace JNPF.Extend.Entitys;
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 订单收款
|
/// 订单收款
|
||||||
/// 版 本:V3.2
|
/// 版 本:V3.2
|
||||||
/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com)
|
/// 版 权:引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||||
|
/// 作 者:JNPF开发平台组
|
||||||
/// 日 期:2021-06-01 .
|
/// 日 期:2021-06-01 .
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("EXT_ORDERRECEIVABLE")]
|
[SugarTable("EXT_ORDERRECEIVABLE")]
|
||||||
|
|||||||
@@ -9,14 +9,8 @@ namespace JNPF.Extend.Entitys;
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("ext_productclassify")]
|
[SugarTable("ext_productclassify")]
|
||||||
[Tenant(ClaimConst.TENANTID)]
|
[Tenant(ClaimConst.TENANTID)]
|
||||||
public class ProductClassifyEntity : CLDEntityBase
|
public class ProductClassifyEntity : CLEntityBase
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// 主键.
|
|
||||||
/// </summary>
|
|
||||||
[SugarColumn(ColumnName = "F_Id", IsPrimaryKey = true)]
|
|
||||||
public string Id { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 上级.
|
/// 上级.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -28,4 +22,22 @@ public class ProductClassifyEntity : CLDEntityBase
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnName = "F_FULLNAME")]
|
[SugarColumn(ColumnName = "F_FULLNAME")]
|
||||||
public string FullName { get; set; }
|
public string FullName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置 删除标志.
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "F_DeleteMark", ColumnDescription = "删除标志")]
|
||||||
|
public int? DeleteMark { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置 删除时间.
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "F_DeleteTime", ColumnDescription = "删除时间")]
|
||||||
|
public DateTime? DeleteTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置 删除用户.
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "F_DeleteUserId", ColumnDescription = "删除用户")]
|
||||||
|
public string DeleteUserId { get; set; }
|
||||||
}
|
}
|
||||||
@@ -9,14 +9,8 @@ namespace JNPF.Extend.Entitys;
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("ext_product")]
|
[SugarTable("ext_product")]
|
||||||
[Tenant(ClaimConst.TENANTID)]
|
[Tenant(ClaimConst.TENANTID)]
|
||||||
public class ProductEntity
|
public class ProductEntity : EntityBase<string>
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// 自然主键.
|
|
||||||
/// </summary>
|
|
||||||
[SugarColumn(ColumnName = "F_Id", IsPrimaryKey = true)]
|
|
||||||
public string Id { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 订单编号.
|
/// 订单编号.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -7,7 +7,8 @@ namespace JNPF.Extend.Entitys;
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 项目计划
|
/// 项目计划
|
||||||
/// 版 本:V3.2
|
/// 版 本:V3.2
|
||||||
/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com)
|
/// 版 权:引迈信息技术有限公司(https://www.yinmaisoft.com)
|
||||||
|
/// 作 者:JNPF开发平台组
|
||||||
/// 日 期:2021-06-01.
|
/// 日 期:2021-06-01.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("EXT_PROJECTGANTT")]
|
[SugarTable("EXT_PROJECTGANTT")]
|
||||||
|
|||||||
@@ -7,7 +7,8 @@ namespace JNPF.Extend.Entitys;
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 日程安排
|
/// 日程安排
|
||||||
/// 版 本:V3.2
|
/// 版 本:V3.2
|
||||||
/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com)
|
/// 版 权:引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||||
|
/// 作 者:JNPF开发平台组
|
||||||
/// 日 期:2021-06-01.
|
/// 日 期:2021-06-01.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("EXT_SCHEDULE")]
|
[SugarTable("EXT_SCHEDULE")]
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ namespace JNPF.Extend.Entitys;
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 表格示例数据
|
/// 表格示例数据
|
||||||
/// 版 本:V3.2
|
/// 版 本:V3.2
|
||||||
/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com)
|
/// 版 权:引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||||
|
/// 作 者:JNPF开发平台组
|
||||||
/// 日 期:2021-06-01 .
|
/// 日 期:2021-06-01 .
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("EXT_TABLEEXAMPLE")]
|
[SugarTable("EXT_TABLEEXAMPLE")]
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ namespace JNPF.Extend.Entitys;
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 工作日志
|
/// 工作日志
|
||||||
/// 版 本:V3.2
|
/// 版 本:V3.2
|
||||||
/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com)
|
/// 版 权:引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||||
|
/// 作 者:JNPF开发平台组
|
||||||
/// 日 期:2021-06-01 .
|
/// 日 期:2021-06-01 .
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("EXT_WORKLOG")]
|
[SugarTable("EXT_WORKLOG")]
|
||||||
|
|||||||
@@ -7,7 +7,8 @@ namespace JNPF.Extend.Entitys;
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 工作日志分享
|
/// 工作日志分享
|
||||||
/// 版 本:V3.2
|
/// 版 本:V3.2
|
||||||
/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com)
|
/// 版 权:引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||||
|
/// 作 者:JNPF开发平台组
|
||||||
/// 日 期:2021-06-01 .
|
/// 日 期:2021-06-01 .
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("EXT_WORKLOGSHARE")]
|
[SugarTable("EXT_WORKLOGSHARE")]
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ public class ProductClassifyService : IDynamicApiController, ITransient
|
|||||||
[HttpGet("{id}")]
|
[HttpGet("{id}")]
|
||||||
public async Task<dynamic> GetInfo(string id)
|
public async Task<dynamic> GetInfo(string id)
|
||||||
{
|
{
|
||||||
return (await _repository.AsQueryable().FirstAsync(a => a.Id.Equals(id))).Adapt<ProductClassifyInfoOutput>();
|
return (await _repository.AsQueryable().FirstAsync(a => a.Id.Equals(id) && a.DeleteMark == null)).Adapt<ProductClassifyInfoOutput>();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
@@ -1,13 +1,16 @@
|
|||||||
using System.Collections.Generic;
|
using JNPF.Common.Core.Manager;
|
||||||
using JNPF.Common.Core.Manager;
|
using JNPF.Common.Enums;
|
||||||
using JNPF.Common.Filter;
|
using JNPF.Common.Filter;
|
||||||
using JNPF.Common.Security;
|
using JNPF.Common.Security;
|
||||||
|
using JNPF.DatabaseAccessor;
|
||||||
using JNPF.DependencyInjection;
|
using JNPF.DependencyInjection;
|
||||||
using JNPF.DynamicApiController;
|
using JNPF.DynamicApiController;
|
||||||
using JNPF.Extend.Entitys;
|
using JNPF.Extend.Entitys;
|
||||||
using JNPF.Extend.Entitys.Dto.Product;
|
using JNPF.Extend.Entitys.Dto.Product;
|
||||||
using JNPF.Extend.Entitys.Dto.ProductEntry;
|
using JNPF.Extend.Entitys.Dto.ProductEntry;
|
||||||
using JNPF.Extend.Entitys.Model;
|
using JNPF.Extend.Entitys.Model;
|
||||||
|
using JNPF.FriendlyException;
|
||||||
|
using JNPF.Systems.Interfaces.System;
|
||||||
using Mapster;
|
using Mapster;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
@@ -31,17 +34,26 @@ public class ProductService : IDynamicApiController, ITransient
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private readonly IUserManager _userManager;
|
private readonly IUserManager _userManager;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 单据规则服务.
|
||||||
|
/// </summary>
|
||||||
|
private readonly IBillRullService _billRullService;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 初始化一个<see cref="ProductService"/>类型的新实例.
|
/// 初始化一个<see cref="ProductService"/>类型的新实例.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ProductService(
|
public ProductService(
|
||||||
ISqlSugarRepository<ProductEntity> extProductRepository,
|
ISqlSugarRepository<ProductEntity> extProductRepository,
|
||||||
|
IBillRullService billRullService,
|
||||||
IUserManager userManager)
|
IUserManager userManager)
|
||||||
{
|
{
|
||||||
_repository = extProductRepository;
|
_repository = extProductRepository;
|
||||||
|
_billRullService = billRullService;
|
||||||
_userManager = userManager;
|
_userManager = userManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region Get
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取订单示例.
|
/// 获取订单示例.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -51,7 +63,7 @@ public class ProductService : IDynamicApiController, ITransient
|
|||||||
public async Task<dynamic> GetInfo(string id)
|
public async Task<dynamic> GetInfo(string id)
|
||||||
{
|
{
|
||||||
return (await _repository.AsQueryable()
|
return (await _repository.AsQueryable()
|
||||||
.Includes(x => x.productEntryList.Select(it => new ProductEntryEntity
|
.Includes(x => x.productEntryList.Where(it => it.DeleteMark == null).Select(it => new ProductEntryEntity
|
||||||
{
|
{
|
||||||
ProductCode = it.ProductCode,
|
ProductCode = it.ProductCode,
|
||||||
ProductName = it.ProductName,
|
ProductName = it.ProductName,
|
||||||
@@ -62,7 +74,7 @@ public class ProductService : IDynamicApiController, ITransient
|
|||||||
Price = it.Price,
|
Price = it.Price,
|
||||||
Amount = it.Amount,
|
Amount = it.Amount,
|
||||||
Description = it.Description
|
Description = it.Description
|
||||||
}).ToList()).Where(a => a.Id.Equals(id))
|
}).ToList()).Where(a => a.Id.Equals(id) && a.DeleteMark == null)
|
||||||
.ToListAsync(it => new ProductInfoOutput
|
.ToListAsync(it => new ProductInfoOutput
|
||||||
{
|
{
|
||||||
id = it.Id,
|
id = it.Id,
|
||||||
@@ -96,10 +108,15 @@ public class ProductService : IDynamicApiController, ITransient
|
|||||||
[HttpGet("")]
|
[HttpGet("")]
|
||||||
public async Task<dynamic> GetList([FromQuery] ProductListQueryInput input)
|
public async Task<dynamic> GetList([FromQuery] ProductListQueryInput input)
|
||||||
{
|
{
|
||||||
|
if (input.auditState == "0")
|
||||||
|
input.auditState = null;
|
||||||
|
if (input.closeState == "0")
|
||||||
|
input.closeState = null;
|
||||||
var data = await _repository.AsQueryable()
|
var data = await _repository.AsQueryable()
|
||||||
|
.Where(it => it.DeleteMark == null)
|
||||||
.WhereIF(!string.IsNullOrEmpty(input.code), it => it.Code.Contains(input.code))
|
.WhereIF(!string.IsNullOrEmpty(input.code), it => it.Code.Contains(input.code))
|
||||||
.WhereIF(!string.IsNullOrEmpty(input.customerName), it => it.Type.Contains(input.customerName))
|
.WhereIF(!string.IsNullOrEmpty(input.customerName), it => it.CustomerName.Contains(input.customerName))
|
||||||
.WhereIF(!string.IsNullOrEmpty(input.contactTel), it => it.CustomerId.Contains(input.contactTel))
|
.WhereIF(!string.IsNullOrEmpty(input.contactTel), it => it.ContactTel.Contains(input.contactTel))
|
||||||
.WhereIF(!string.IsNullOrEmpty(input.auditState), it => it.AuditState.Equals(input.auditState))
|
.WhereIF(!string.IsNullOrEmpty(input.auditState), it => it.AuditState.Equals(input.auditState))
|
||||||
.WhereIF(!string.IsNullOrEmpty(input.closeState), it => it.CloseState.Equals(input.closeState))
|
.WhereIF(!string.IsNullOrEmpty(input.closeState), it => it.CloseState.Equals(input.closeState))
|
||||||
.Select(it => new ProductListOutput
|
.Select(it => new ProductListOutput
|
||||||
@@ -130,7 +147,7 @@ public class ProductService : IDynamicApiController, ITransient
|
|||||||
{
|
{
|
||||||
string data = "[{\"id\":\"37c995b4044541009fb7e285bcf9845d\",\"productSpecification\":\"120ml\",\"qty\":16,\"money\":510,\"price\":120,\"commandType\":\"唯一码\",\"util\":\"盒\"},{\"id\":\"2dbb11d3cde04c299985ac944d130ba0\",\"productSpecification\":\"150ml\",\"qty\":15,\"money\":520,\"price\":310,\"commandType\":\"唯一码\",\"util\":\"盒\"},{\"id\":\"f8ec261ccdf045e5a2e1f0e5485cda76\",\"productSpecification\":\"40ml\",\"qty\":13,\"money\":530,\"price\":140,\"commandType\":\"唯一码\",\"util\":\"盒\"},{\"id\":\"6c110b57ae56445faa8ce9be501c8997\",\"productSpecification\":\"103ml\",\"qty\":2,\"money\":504,\"price\":150,\"commandType\":\"唯一码\",\"util\":\"盒\"},{\"id\":\"f2ee981aaf934147a4d090a0eed2203f\",\"productSpecification\":\"120ml\",\"qty\":21,\"money\":550,\"price\":160,\"commandType\":\"唯一码\",\"util\":\"盒\"}]";
|
string data = "[{\"id\":\"37c995b4044541009fb7e285bcf9845d\",\"productSpecification\":\"120ml\",\"qty\":16,\"money\":510,\"price\":120,\"commandType\":\"唯一码\",\"util\":\"盒\"},{\"id\":\"2dbb11d3cde04c299985ac944d130ba0\",\"productSpecification\":\"150ml\",\"qty\":15,\"money\":520,\"price\":310,\"commandType\":\"唯一码\",\"util\":\"盒\"},{\"id\":\"f8ec261ccdf045e5a2e1f0e5485cda76\",\"productSpecification\":\"40ml\",\"qty\":13,\"money\":530,\"price\":140,\"commandType\":\"唯一码\",\"util\":\"盒\"},{\"id\":\"6c110b57ae56445faa8ce9be501c8997\",\"productSpecification\":\"103ml\",\"qty\":2,\"money\":504,\"price\":150,\"commandType\":\"唯一码\",\"util\":\"盒\"},{\"id\":\"f2ee981aaf934147a4d090a0eed2203f\",\"productSpecification\":\"120ml\",\"qty\":21,\"money\":550,\"price\":160,\"commandType\":\"唯一码\",\"util\":\"盒\"}]";
|
||||||
List<ProductEntryMdoel> dataAll = data.ToObject<List<ProductEntryMdoel>>();
|
List<ProductEntryMdoel> dataAll = data.ToObject<List<ProductEntryMdoel>>();
|
||||||
List<ProductEntryListOutput> productEntryList = await _repository.AsSugarClient().Queryable<ProductEntryEntity>().Where(it => it.ProductId.Equals(id)).Select(it => new ProductEntryListOutput
|
List<ProductEntryListOutput> productEntryList = await _repository.AsSugarClient().Queryable<ProductEntryEntity>().Where(it => it.ProductId.Equals(id) && it.DeleteMark == null).Select(it => new ProductEntryListOutput
|
||||||
{
|
{
|
||||||
productCode = it.ProductCode,
|
productCode = it.ProductCode,
|
||||||
productName = it.ProductName,
|
productName = it.ProductName,
|
||||||
@@ -155,4 +172,126 @@ public class ProductService : IDynamicApiController, ITransient
|
|||||||
|
|
||||||
return new { list = productEntryList };
|
return new { list = productEntryList };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region POST
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 新建.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input">请求参数.</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("")]
|
||||||
|
[UnitOfWork]
|
||||||
|
public async Task Create([FromBody] ProductCrInput input)
|
||||||
|
{
|
||||||
|
var entity = input.Adapt<ProductEntity>();
|
||||||
|
entity.Code = await _billRullService.GetBillNumber("OrderNumber", false);
|
||||||
|
entity.Id = SnowflakeIdHelper.NextId();
|
||||||
|
entity.CreatorTime = DateTime.Now;
|
||||||
|
entity.CreatorUserId = _userManager.UserId;
|
||||||
|
|
||||||
|
var productEntryList = input.productEntryList.Adapt<List<ProductEntryEntity>>();
|
||||||
|
if (productEntryList != null)
|
||||||
|
{
|
||||||
|
productEntryList.ForEach(item =>
|
||||||
|
{
|
||||||
|
item.Id = SnowflakeIdHelper.NextId();
|
||||||
|
item.ProductId = entity.Id;
|
||||||
|
item.CreatorTime = DateTime.Now;
|
||||||
|
item.CreatorUserId = _userManager.UserId;
|
||||||
|
});
|
||||||
|
entity.productEntryList = productEntryList;
|
||||||
|
}
|
||||||
|
|
||||||
|
var isOk = await _repository.AsSugarClient().InsertNav(entity)
|
||||||
|
.Include(it => it.productEntryList).ExecuteCommandAsync();
|
||||||
|
if (!isOk)
|
||||||
|
throw Oops.Oh(ErrorCode.COM1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 更新订单示例.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id">主键值.</param>
|
||||||
|
/// <param name="input">参数.</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPut("{id}")]
|
||||||
|
[UnitOfWork]
|
||||||
|
public async Task Update(string id, [FromBody] ProductUpInput input)
|
||||||
|
{
|
||||||
|
var entity = input.Adapt<ProductEntity>();
|
||||||
|
entity.LastModifyTime = DateTime.Now;
|
||||||
|
entity.LastModifyUserId = _userManager.UserId;
|
||||||
|
|
||||||
|
await _repository.AsSugarClient().Updateable<ProductEntryEntity>()
|
||||||
|
.Where(it => it.ProductId.Equals(entity.Id) && !input.productEntryList.Select(a => a.id).ToList().Contains(it.Id))
|
||||||
|
.SetColumns(it => new ProductEntryEntity()
|
||||||
|
{
|
||||||
|
DeleteMark = 1,
|
||||||
|
DeleteUserId = _userManager.UserId,
|
||||||
|
DeleteTime = SqlFunc.GetDate()
|
||||||
|
}).ExecuteCommandAsync();
|
||||||
|
|
||||||
|
var productEntryList = input.productEntryList.Adapt<List<ProductEntryEntity>>();
|
||||||
|
productEntryList.ForEach(item =>
|
||||||
|
{
|
||||||
|
item.Id = item.Id == null ? SnowflakeIdHelper.NextId() : item.Id;
|
||||||
|
item.ProductId = entity.Id;
|
||||||
|
});
|
||||||
|
|
||||||
|
await _repository.AsSugarClient().Storageable(productEntryList).ExecuteCommandAsync();
|
||||||
|
|
||||||
|
var isOk = await _repository.AsUpdateable(entity).UpdateColumns(it => new
|
||||||
|
{
|
||||||
|
it.Code,
|
||||||
|
it.CustomerName,
|
||||||
|
it.ContactTel,
|
||||||
|
it.Address,
|
||||||
|
it.GoodsWarehouse,
|
||||||
|
it.Business,
|
||||||
|
it.GatheringType,
|
||||||
|
it.PartPrice,
|
||||||
|
it.ReducedPrice,
|
||||||
|
it.DiscountPrice,
|
||||||
|
it.Description,
|
||||||
|
it.LastModifyUserId,
|
||||||
|
it.LastModifyTime
|
||||||
|
}).ExecuteCommandAsync();
|
||||||
|
if (!(isOk > 0))
|
||||||
|
throw Oops.Oh(ErrorCode.COM1001);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 删除订单示例.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpDelete("{id}")]
|
||||||
|
[UnitOfWork]
|
||||||
|
public async Task Delete(string id)
|
||||||
|
{
|
||||||
|
await _repository.AsSugarClient().Updateable<ProductEntryEntity>()
|
||||||
|
.Where(it => it.ProductId.Equals(id))
|
||||||
|
.SetColumns(it => new ProductEntryEntity()
|
||||||
|
{
|
||||||
|
DeleteMark = 1,
|
||||||
|
DeleteUserId = _userManager.UserId,
|
||||||
|
DeleteTime = SqlFunc.GetDate()
|
||||||
|
}).ExecuteCommandAsync();
|
||||||
|
|
||||||
|
var isOk = await _repository.AsUpdateable()
|
||||||
|
.Where(it => it.Id.Equals(id))
|
||||||
|
.SetColumns(it => new ProductEntity()
|
||||||
|
{
|
||||||
|
DeleteMark = 1,
|
||||||
|
DeleteUserId = _userManager.UserId,
|
||||||
|
DeleteTime = SqlFunc.GetDate()
|
||||||
|
}).ExecuteCommandAsync();
|
||||||
|
if (!(isOk > 0))
|
||||||
|
throw Oops.Oh(ErrorCode.COM1002);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
using JNPF.Common.Core.Manager;
|
using JNPF.Common.Core.Handlers;
|
||||||
|
using JNPF.Common.Core.Manager;
|
||||||
using JNPF.Common.Security;
|
using JNPF.Common.Security;
|
||||||
using JNPF.DependencyInjection;
|
using JNPF.DependencyInjection;
|
||||||
using JNPF.DynamicApiController;
|
using JNPF.DynamicApiController;
|
||||||
using JNPF.Message.Entitys;
|
using JNPF.Message.Entitys;
|
||||||
using JNPF.Message.Entitys.Dto.ImReply;
|
using JNPF.Message.Entitys.Dto.ImReply;
|
||||||
using JNPF.Message.Handlers;
|
|
||||||
using JNPF.Message.Interfaces;
|
using JNPF.Message.Interfaces;
|
||||||
using JNPF.Systems.Entitys.Permission;
|
using JNPF.Systems.Entitys.Permission;
|
||||||
using Mapster;
|
using Mapster;
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using JNPF.Common.Core.Manager;
|
using JNPF.Common.Core.Handlers;
|
||||||
|
using JNPF.Common.Core.Manager;
|
||||||
using JNPF.Common.Enums;
|
using JNPF.Common.Enums;
|
||||||
using JNPF.Common.Extension;
|
using JNPF.Common.Extension;
|
||||||
using JNPF.Common.Filter;
|
using JNPF.Common.Filter;
|
||||||
@@ -12,7 +13,6 @@ using JNPF.LinqBuilder;
|
|||||||
using JNPF.Message.Entitys;
|
using JNPF.Message.Entitys;
|
||||||
using JNPF.Message.Entitys.Dto.Message;
|
using JNPF.Message.Entitys.Dto.Message;
|
||||||
using JNPF.Message.Entitys.Entity;
|
using JNPF.Message.Entitys.Entity;
|
||||||
using JNPF.Message.Handlers;
|
|
||||||
using JNPF.Message.Interfaces.Message;
|
using JNPF.Message.Interfaces.Message;
|
||||||
using JNPF.RemoteRequest.Extensions;
|
using JNPF.RemoteRequest.Extensions;
|
||||||
using JNPF.Systems.Entitys.Permission;
|
using JNPF.Systems.Entitys.Permission;
|
||||||
@@ -26,7 +26,8 @@ namespace JNPF.Message;
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 系统消息
|
/// 系统消息
|
||||||
/// 版 本:V3.2
|
/// 版 本:V3.2
|
||||||
/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com)
|
/// 版 权:引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||||
|
/// 作 者:JNPF开发平台组
|
||||||
/// 日 期:2021-06-01.
|
/// 日 期:2021-06-01.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ApiDescriptionSettings(Tag = "Message", Name = "message", Order = 240)]
|
[ApiDescriptionSettings(Tag = "Message", Name = "message", Order = 240)]
|
||||||
|
|||||||
@@ -10,7 +10,6 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\..\common\Tnb.Common.Core\Tnb.Common.Core.csproj" />
|
<ProjectReference Include="..\..\common\Tnb.Common.Core\Tnb.Common.Core.csproj" />
|
||||||
<ProjectReference Include="..\..\common\Tnb.WebSockets\Tnb.WebSockets.csproj" />
|
|
||||||
<ProjectReference Include="..\..\system\Tnb.Systems.Interfaces\Tnb.Systems.Interfaces.csproj" />
|
<ProjectReference Include="..\..\system\Tnb.Systems.Interfaces\Tnb.Systems.Interfaces.csproj" />
|
||||||
<ProjectReference Include="..\..\workflow\Tnb.WorkFlow.Entitys\Tnb.WorkFlow.Entitys.csproj" />
|
<ProjectReference Include="..\..\workflow\Tnb.WorkFlow.Entitys\Tnb.WorkFlow.Entitys.csproj" />
|
||||||
<ProjectReference Include="..\Tnb.Message.Interfaces\Tnb.Message.Interfaces.csproj" />
|
<ProjectReference Include="..\Tnb.Message.Interfaces\Tnb.Message.Interfaces.csproj" />
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
using JNPF.Common.Core.Manager;
|
using JNPF.Common.Const;
|
||||||
|
using JNPF.Common.Core.Handlers;
|
||||||
|
using JNPF.Common.Core.Manager;
|
||||||
using JNPF.Common.Enums;
|
using JNPF.Common.Enums;
|
||||||
using JNPF.Common.Extension;
|
using JNPF.Common.Extension;
|
||||||
|
using JNPF.Common.Manager;
|
||||||
using JNPF.Common.Models.User;
|
using JNPF.Common.Models.User;
|
||||||
using JNPF.Common.Security;
|
using JNPF.Common.Security;
|
||||||
using JNPF.DatabaseAccessor;
|
using JNPF.DatabaseAccessor;
|
||||||
@@ -36,15 +39,29 @@ public class AuthorizeService : IAuthorizeService, IDynamicApiController, ITrans
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private readonly IUserManager _userManager;
|
private readonly IUserManager _userManager;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 缓存管理器.
|
||||||
|
/// </summary>
|
||||||
|
private readonly ICacheManager _cacheManager;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// IM中心处理程序.
|
||||||
|
/// </summary>
|
||||||
|
private IMHandler _imHandler;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 初始化一个<see cref="AuthorizeService"/>类型的新实例.
|
/// 初始化一个<see cref="AuthorizeService"/>类型的新实例.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public AuthorizeService(
|
public AuthorizeService(
|
||||||
ISqlSugarRepository<AuthorizeEntity> authorizeRepository,
|
ISqlSugarRepository<AuthorizeEntity> authorizeRepository,
|
||||||
IUserManager userManager)
|
ICacheManager cacheManager,
|
||||||
|
IUserManager userManager,
|
||||||
|
IMHandler imHandler)
|
||||||
{
|
{
|
||||||
_authorizeRepository = authorizeRepository;
|
_authorizeRepository = authorizeRepository;
|
||||||
|
_cacheManager = cacheManager;
|
||||||
_userManager = userManager;
|
_userManager = userManager;
|
||||||
|
_imHandler = imHandler;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Get
|
#region Get
|
||||||
@@ -391,42 +408,52 @@ public class AuthorizeService : IAuthorizeService, IDynamicApiController, ITrans
|
|||||||
/// <param name="input"></param>
|
/// <param name="input"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPut("Model/{itemId}")]
|
[HttpPut("Model/{itemId}")]
|
||||||
[UnitOfWork]
|
|
||||||
public async Task UpdateModel(string itemId, [FromBody] AuthorizeModelInput input)
|
public async Task UpdateModel(string itemId, [FromBody] AuthorizeModelInput input)
|
||||||
{
|
{
|
||||||
List<AuthorizeEntity>? authorizeList = new List<AuthorizeEntity>();
|
List<AuthorizeEntity>? authorizeList = new List<AuthorizeEntity>();
|
||||||
|
|
||||||
// 角色ID不为空
|
try
|
||||||
if (input.objectId.Count > 0)
|
|
||||||
{
|
{
|
||||||
input.objectId.ForEach(item =>
|
_authorizeRepository.AsSugarClient().Ado.BeginTran();
|
||||||
|
|
||||||
|
// 角色ID不为空
|
||||||
|
if (input.objectId.Count > 0)
|
||||||
{
|
{
|
||||||
AuthorizeEntity? entity = new AuthorizeEntity();
|
input.objectId.ForEach(item =>
|
||||||
entity.Id = SnowflakeIdHelper.NextId();
|
{
|
||||||
entity.CreatorTime = DateTime.Now;
|
AuthorizeEntity? entity = new AuthorizeEntity();
|
||||||
entity.CreatorUserId = _userManager.UserId;
|
entity.Id = SnowflakeIdHelper.NextId();
|
||||||
entity.ItemId = itemId;
|
entity.CreatorTime = DateTime.Now;
|
||||||
entity.ItemType = input.itemType;
|
entity.CreatorUserId = _userManager.UserId;
|
||||||
entity.ObjectId = item;
|
entity.ItemId = itemId;
|
||||||
entity.ObjectType = input.objectType;
|
entity.ItemType = input.itemType;
|
||||||
entity.SortCode = input.objectId.IndexOf(item);
|
entity.ObjectId = item;
|
||||||
authorizeList.Add(entity);
|
entity.ObjectType = input.objectType;
|
||||||
});
|
entity.SortCode = input.objectId.IndexOf(item);
|
||||||
|
authorizeList.Add(entity);
|
||||||
|
});
|
||||||
|
|
||||||
// 删除除了门户外的相关权限
|
// 删除除了门户外的相关权限
|
||||||
await _authorizeRepository.DeleteAsync(a => a.ItemId == itemId);
|
await _authorizeRepository.DeleteAsync(a => a.ItemId == itemId);
|
||||||
|
|
||||||
// 新增权限
|
// 新增权限
|
||||||
await _authorizeRepository.AsSugarClient().Insertable(authorizeList).CallEntityMethod(m => m.Creator()).ExecuteCommandAsync();
|
await _authorizeRepository.AsSugarClient().Insertable(authorizeList).CallEntityMethod(m => m.Creator()).ExecuteCommandAsync();
|
||||||
|
|
||||||
// 编辑角色权限退出角色的登录用户
|
}
|
||||||
await ForcedOffline(input.objectId);
|
else
|
||||||
|
{
|
||||||
|
// 删除除了门户外的相关权限
|
||||||
|
await _authorizeRepository.DeleteAsync(a => a.ItemId == itemId);
|
||||||
|
}
|
||||||
|
|
||||||
|
_authorizeRepository.AsSugarClient().Ado.CommitTran();
|
||||||
}
|
}
|
||||||
else
|
catch
|
||||||
{
|
{
|
||||||
// 删除除了门户外的相关权限
|
_authorizeRepository.AsSugarClient().Ado.RollbackTran();
|
||||||
await _authorizeRepository.DeleteAsync(a => a.ItemId == itemId);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(input.objectId.Any()) await ForcedOffline(input.objectId); // 编辑角色权限退出角色的登录用户
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -754,14 +781,17 @@ public class AuthorizeService : IAuthorizeService, IDynamicApiController, ITrans
|
|||||||
{
|
{
|
||||||
// 查找该角色下的所有成员id
|
// 查找该角色下的所有成员id
|
||||||
var roleUserIds = await _authorizeRepository.AsSugarClient().Queryable<UserRelationEntity>().Where(x => x.ObjectType == "Role" && roleId.Contains(x.ObjectId)).Select(x => x.UserId).ToListAsync();
|
var roleUserIds = await _authorizeRepository.AsSugarClient().Queryable<UserRelationEntity>().Where(x => x.ObjectType == "Role" && roleId.Contains(x.ObjectId)).Select(x => x.UserId).ToListAsync();
|
||||||
Scoped.Create((_, scope) =>
|
roleUserIds.ForEach(async id =>
|
||||||
{
|
{
|
||||||
roleUserIds.ForEach(id =>
|
var tenantId = _userManager.TenantId;
|
||||||
|
var list = await GetOnlineUserList(tenantId);
|
||||||
|
var user = list.Find(it => it.tenantId == tenantId && it.userId == id);
|
||||||
|
if (user != null)
|
||||||
{
|
{
|
||||||
var services = scope.ServiceProvider;
|
await _imHandler.SendMessageAsync(user.connectionId, new { method = "logout", msg = "此账号已在其他地方登陆" }.ToJsonString());
|
||||||
var _onlineuser = App.GetService<OnlineUserService>(services);
|
await DelOnlineUser(tenantId, user.userId);
|
||||||
_onlineuser.ForcedOffline(id);
|
await DelUserInfo(tenantId, user.userId);
|
||||||
});
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
@@ -1018,5 +1048,44 @@ public class AuthorizeService : IAuthorizeService, IDynamicApiController, ITrans
|
|||||||
|
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取在线用户列表.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="tenantId">租户ID.</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<List<UserOnlineModel>> GetOnlineUserList(string tenantId)
|
||||||
|
{
|
||||||
|
var cacheKey = string.Format("{0}{1}", CommonConst.CACHEKEYONLINEUSER, tenantId);
|
||||||
|
return await _cacheManager.GetAsync<List<UserOnlineModel>>(cacheKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 删除在线用户ID.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="tenantId">租户ID.</param>
|
||||||
|
/// <param name="userId">用户ID.</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
private async Task<bool> DelOnlineUser(string tenantId, string userId)
|
||||||
|
{
|
||||||
|
var cacheKey = string.Format("{0}{1}", CommonConst.CACHEKEYONLINEUSER, tenantId);
|
||||||
|
var list = await _cacheManager.GetAsync<List<UserOnlineModel>>(cacheKey);
|
||||||
|
var online = list.Find(it => it.userId == userId);
|
||||||
|
list.RemoveAll((x) => x.connectionId == online.connectionId);
|
||||||
|
return await _cacheManager.SetAsync(cacheKey, list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 删除用户登录信息缓存.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="tenantId">租户ID.</param>
|
||||||
|
/// <param name="userId">用户ID.</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
private async Task<bool> DelUserInfo(string tenantId, string userId)
|
||||||
|
{
|
||||||
|
var cacheKey = string.Format("{0}{1}_{2}", CommonConst.CACHEKEYUSER, tenantId, userId);
|
||||||
|
return await _cacheManager.DelAsync(cacheKey);
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
@@ -474,6 +474,13 @@ public class UsersCurrentService : IUsersCurrentService, IDynamicApiController,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// 当前系统已被管理员禁用.
|
||||||
|
var switchSystem = await _repository.AsSugarClient().Queryable<SystemEntity>()
|
||||||
|
.Where(it => input.majorId.Equals(it.Id) && it.DeleteMark == null)
|
||||||
|
.FirstAsync();
|
||||||
|
if (switchSystem != null && !switchSystem.EnabledMark.Equals(1))
|
||||||
|
throw Oops.Oh(ErrorCode.D4014);
|
||||||
|
|
||||||
// 系统下没有菜单不允许切换.
|
// 系统下没有菜单不允许切换.
|
||||||
var mList = await _repository.AsSugarClient().Queryable<ModuleEntity>().Where(x => x.SystemId.Equals(input.majorId) && x.DeleteMark == null && x.Category.Equals("Web")).Select(x => x.Id).ToListAsync();
|
var mList = await _repository.AsSugarClient().Queryable<ModuleEntity>().Where(x => x.SystemId.Equals(input.majorId) && x.DeleteMark == null && x.Category.Equals("Web")).Select(x => x.Id).ToListAsync();
|
||||||
if (!mList.Any()) throw Oops.Oh(ErrorCode.D4009);
|
if (!mList.Any()) throw Oops.Oh(ErrorCode.D4009);
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ using JNPF.Common.Enums;
|
|||||||
using JNPF.Common.Extension;
|
using JNPF.Common.Extension;
|
||||||
using JNPF.Common.Filter;
|
using JNPF.Common.Filter;
|
||||||
using JNPF.Common.Helper;
|
using JNPF.Common.Helper;
|
||||||
|
using JNPF.Common.Manager;
|
||||||
using JNPF.Common.Models.NPOI;
|
using JNPF.Common.Models.NPOI;
|
||||||
using JNPF.Common.Models.User;
|
using JNPF.Common.Models.User;
|
||||||
using JNPF.Common.Security;
|
using JNPF.Common.Security;
|
||||||
@@ -69,6 +70,11 @@ public class UsersService : IUsersService, IDynamicApiController, ITransient
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private readonly IFileManager _fileManager;
|
private readonly IFileManager _fileManager;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 缓存管理.
|
||||||
|
/// </summary>
|
||||||
|
private readonly ICacheManager _cacheManager;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 用户管理.
|
/// 用户管理.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -83,6 +89,7 @@ public class UsersService : IUsersService, IDynamicApiController, ITransient
|
|||||||
IUserRelationService userRelationService,
|
IUserRelationService userRelationService,
|
||||||
ISysConfigService sysConfigService,
|
ISysConfigService sysConfigService,
|
||||||
ISynThirdInfoService synThirdInfoService,
|
ISynThirdInfoService synThirdInfoService,
|
||||||
|
ICacheManager cacheManager,
|
||||||
IFileManager fileService,
|
IFileManager fileService,
|
||||||
IUserManager userManager)
|
IUserManager userManager)
|
||||||
{
|
{
|
||||||
@@ -91,6 +98,7 @@ public class UsersService : IUsersService, IDynamicApiController, ITransient
|
|||||||
_userRelationService = userRelationService;
|
_userRelationService = userRelationService;
|
||||||
_sysConfigService = sysConfigService;
|
_sysConfigService = sysConfigService;
|
||||||
_userManager = userManager;
|
_userManager = userManager;
|
||||||
|
_cacheManager = cacheManager;
|
||||||
_synThirdInfoService = synThirdInfoService;
|
_synThirdInfoService = synThirdInfoService;
|
||||||
_fileManager = fileService;
|
_fileManager = fileService;
|
||||||
}
|
}
|
||||||
@@ -1522,6 +1530,7 @@ public class UsersService : IUsersService, IDynamicApiController, ITransient
|
|||||||
fs.Close();
|
fs.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_cacheManager.Set(excelconfig.FileName, string.Empty);
|
||||||
return new { name = excelconfig.FileName, url = "/api/file/Download?encryption=" + DESCEncryption.Encrypt(_userManager.UserId + "|" + excelconfig.FileName + "|" + addPath, "JNPF") };
|
return new { name = excelconfig.FileName, url = "/api/file/Download?encryption=" + DESCEncryption.Encrypt(_userManager.UserId + "|" + excelconfig.FileName + "|" + addPath, "JNPF") };
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1551,6 +1560,7 @@ public class UsersService : IUsersService, IDynamicApiController, ITransient
|
|||||||
string? addPath = Path.Combine(FileVariable.TemporaryFilePath, excelconfig.FileName);
|
string? addPath = Path.Combine(FileVariable.TemporaryFilePath, excelconfig.FileName);
|
||||||
ExcelExportHelper<UserListImportDataInput>.Export(dataList, excelconfig, addPath);
|
ExcelExportHelper<UserListImportDataInput>.Export(dataList, excelconfig, addPath);
|
||||||
|
|
||||||
|
_cacheManager.Set(excelconfig.FileName, string.Empty);
|
||||||
return new { name = excelconfig.FileName, url = "/api/file/Download?encryption=" + DESCEncryption.Encrypt(_userManager.UserId + "|" + excelconfig.FileName + "|" + addPath, "JNPF") };
|
return new { name = excelconfig.FileName, url = "/api/file/Download?encryption=" + DESCEncryption.Encrypt(_userManager.UserId + "|" + excelconfig.FileName + "|" + addPath, "JNPF") };
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1631,6 +1641,7 @@ public class UsersService : IUsersService, IDynamicApiController, ITransient
|
|||||||
string? addPath = Path.Combine(FileVariable.TemporaryFilePath, excelconfig.FileName);
|
string? addPath = Path.Combine(FileVariable.TemporaryFilePath, excelconfig.FileName);
|
||||||
ExcelExportHelper<UserListImportDataInput>.Export(errorlist, excelconfig, addPath);
|
ExcelExportHelper<UserListImportDataInput>.Export(errorlist, excelconfig, addPath);
|
||||||
|
|
||||||
|
_cacheManager.Set(excelconfig.FileName, string.Empty);
|
||||||
return new { name = excelconfig.FileName, url = "/api/file/Download?encryption=" + DESCEncryption.Encrypt(_userManager.UserId + "|" + excelconfig.FileName + "|" + addPath, "JNPF") };
|
return new { name = excelconfig.FileName, url = "/api/file/Download?encryption=" + DESCEncryption.Encrypt(_userManager.UserId + "|" + excelconfig.FileName + "|" + addPath, "JNPF") };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,8 @@ namespace JNPF.Systems;
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 数据接口
|
/// 数据接口
|
||||||
/// 版 本:V3.2
|
/// 版 本:V3.2
|
||||||
/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com)
|
/// 版 权:引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||||
|
/// 作 者:JNPF开发平台组
|
||||||
/// 日 期:2021-06-01.
|
/// 日 期:2021-06-01.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ApiDescriptionSettings(Tag = "System", Name = "DataInterface", Order = 204)]
|
[ApiDescriptionSettings(Tag = "System", Name = "DataInterface", Order = 204)]
|
||||||
@@ -345,7 +346,7 @@ public class DataInterfaceService : IDataInterfaceService, IDynamicApiController
|
|||||||
{
|
{
|
||||||
string sheetData = Regex.Match(info.DataProcessing, @"\{(.*)\}", RegexOptions.Singleline).Groups[1].Value;
|
string sheetData = Regex.Match(info.DataProcessing, @"\{(.*)\}", RegexOptions.Singleline).Groups[1].Value;
|
||||||
var scriptStr = "var result = function(data){data = JSON.parse(data);" + sheetData + "}";
|
var scriptStr = "var result = function(data){data = JSON.parse(data);" + sheetData + "}";
|
||||||
return JsEngineUtil.CallFunction(scriptStr, output.ToJsonString());
|
return JsEngineUtil.CallFunction(scriptStr, output.ToJsonString(CommonConst.options));//此处时间非时间戳
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -732,7 +733,7 @@ public class DataInterfaceService : IDataInterfaceService, IDynamicApiController
|
|||||||
|
|
||||||
list = await GetDynamicDataCache(dynamic.Id);
|
list = await GetDynamicDataCache(dynamic.Id);
|
||||||
|
|
||||||
if (list == null)
|
if (list == null || list.Count == 0)
|
||||||
{
|
{
|
||||||
list = new List<StaticDataModel>();
|
list = new List<StaticDataModel>();
|
||||||
// 远端数据 配置参数
|
// 远端数据 配置参数
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
using JNPF.Common.Core.Manager;
|
using JNPF.Common.Const;
|
||||||
|
using JNPF.Common.Core.Handlers;
|
||||||
|
using JNPF.Common.Core.Manager;
|
||||||
using JNPF.Common.Enums;
|
using JNPF.Common.Enums;
|
||||||
using JNPF.Common.Extension;
|
using JNPF.Common.Extension;
|
||||||
using JNPF.Common.Filter;
|
using JNPF.Common.Filter;
|
||||||
|
using JNPF.Common.Manager;
|
||||||
|
using JNPF.Common.Models.User;
|
||||||
|
using JNPF.Common.Security;
|
||||||
using JNPF.DependencyInjection;
|
using JNPF.DependencyInjection;
|
||||||
using JNPF.DynamicApiController;
|
using JNPF.DynamicApiController;
|
||||||
using JNPF.FriendlyException;
|
using JNPF.FriendlyException;
|
||||||
@@ -27,6 +32,16 @@ public class SystemService : IDynamicApiController, ITransient
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private readonly ISqlSugarRepository<SystemEntity> _repository;
|
private readonly ISqlSugarRepository<SystemEntity> _repository;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 缓存管理器.
|
||||||
|
/// </summary>
|
||||||
|
private readonly ICacheManager _cacheManager;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// IM中心处理程序.
|
||||||
|
/// </summary>
|
||||||
|
private IMHandler _imHandler;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 用户管理.
|
/// 用户管理.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -37,9 +52,13 @@ public class SystemService : IDynamicApiController, ITransient
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public SystemService(
|
public SystemService(
|
||||||
ISqlSugarRepository<SystemEntity> repository,
|
ISqlSugarRepository<SystemEntity> repository,
|
||||||
|
ICacheManager cacheManager,
|
||||||
|
IMHandler imHandler,
|
||||||
IUserManager userManager)
|
IUserManager userManager)
|
||||||
{
|
{
|
||||||
_repository = repository;
|
_repository = repository;
|
||||||
|
_cacheManager = cacheManager;
|
||||||
|
_imHandler = imHandler;
|
||||||
_userManager = userManager;
|
_userManager = userManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -108,10 +127,99 @@ public class SystemService : IDynamicApiController, ITransient
|
|||||||
{
|
{
|
||||||
if (await _repository.IsAnyAsync(x => x.Id != id && (x.EnCode == input.enCode || x.FullName == input.fullName) && x.DeleteMark == null))
|
if (await _repository.IsAnyAsync(x => x.Id != id && (x.EnCode == input.enCode || x.FullName == input.fullName) && x.DeleteMark == null))
|
||||||
throw Oops.Oh(ErrorCode.COM1004);
|
throw Oops.Oh(ErrorCode.COM1004);
|
||||||
var entity = input.Adapt<SystemEntity>();
|
|
||||||
var isOk = await _repository.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).CallEntityMethod(m => m.LastModify()).ExecuteCommandHasChangeAsync();
|
var mainSystem = await _repository.GetFirstAsync(it => it.IsMain.Equals(1) && it.EnabledMark.Equals(1) && it.DeleteMark == null);
|
||||||
if (!isOk)
|
|
||||||
|
// 判断主系统是否被禁用.
|
||||||
|
if (input.id.Equals(mainSystem.Id) && input.enabledMark.Equals(0))
|
||||||
|
throw Oops.Oh(ErrorCode.D1036);
|
||||||
|
|
||||||
|
// 判断主系统是否有修改系统编码.
|
||||||
|
if (input.id.Equals(mainSystem.Id) && !input.enCode.Equals(mainSystem.EnCode))
|
||||||
|
throw Oops.Oh(ErrorCode.D1037);
|
||||||
|
|
||||||
|
var isOk = await _repository.AsUpdateable().SetColumns(it => new SystemEntity()
|
||||||
|
{
|
||||||
|
FullName = input.fullName,
|
||||||
|
EnCode = input.enCode,
|
||||||
|
Icon = input.icon,
|
||||||
|
SortCode = input.sortCode,
|
||||||
|
Description = input.description,
|
||||||
|
EnabledMark = input.enabledMark,
|
||||||
|
LastModifyUserId = _userManager.UserId,
|
||||||
|
LastModifyTime = SqlFunc.GetDate(),
|
||||||
|
}).Where(it => it.Id.Equals(id)).ExecuteCommandAsync();
|
||||||
|
if (!(isOk > 0))
|
||||||
throw Oops.Oh(ErrorCode.COM1001);
|
throw Oops.Oh(ErrorCode.COM1001);
|
||||||
|
|
||||||
|
// 当用户的子系统被禁用时,更换成其他未被禁用的系统.
|
||||||
|
if (!input.id.Equals(mainSystem.Id) && input.enabledMark.Equals(0))
|
||||||
|
{
|
||||||
|
var systemUser = await _repository.AsSugarClient().Queryable<UserEntity>()
|
||||||
|
.Where(it => it.DeleteMark == null && input.id.Equals(it.SystemId))
|
||||||
|
.Select(x => new UserEntity()
|
||||||
|
{
|
||||||
|
Id = x.Id,
|
||||||
|
SystemId = x.SystemId
|
||||||
|
}).ToListAsync();
|
||||||
|
|
||||||
|
// 获取用户所有角色id.
|
||||||
|
var userRoleIdList = await _repository.AsSugarClient().Queryable<UserRelationEntity>()
|
||||||
|
.Where(it => systemUser.Select(s => s.Id).ToList().Contains(it.UserId) && it.ObjectType.Equals("Role"))
|
||||||
|
.Select(x => x.ObjectId)
|
||||||
|
.ToListAsync();
|
||||||
|
var authorizeList = await _repository.AsSugarClient().Queryable<AuthorizeEntity>()
|
||||||
|
.Where(it => it.ItemType.Equals("module") && it.ObjectType.Equals("Role"))
|
||||||
|
.ToListAsync();
|
||||||
|
var moduleList = await _repository.AsSugarClient().Queryable<ModuleEntity>()
|
||||||
|
.Where(it => !it.SystemId.Equals(mainSystem.Id) && !it.SystemId.Equals(input.id) && it.DeleteMark == null)
|
||||||
|
.ToListAsync();
|
||||||
|
|
||||||
|
systemUser.ForEach(async item =>
|
||||||
|
{
|
||||||
|
// 获取用户所有角色的菜单.
|
||||||
|
var moduleIdList = authorizeList
|
||||||
|
.Where(x => userRoleIdList.Contains(x.ObjectId))
|
||||||
|
.Select(s => s.ItemId);
|
||||||
|
|
||||||
|
// 获取用户所有有权限的系统id.
|
||||||
|
var systemId = moduleList
|
||||||
|
.Where(x => moduleIdList.Contains(x.Id))
|
||||||
|
.Select(s => s.SystemId).FirstOrDefault();
|
||||||
|
|
||||||
|
if (systemId == null)
|
||||||
|
systemId = mainSystem.Id;
|
||||||
|
|
||||||
|
// 更新用户的系统id.
|
||||||
|
var res = await _repository.AsSugarClient().Updateable<UserEntity>()
|
||||||
|
.Where(x => item.Id.Equals(x.Id))
|
||||||
|
.SetColumns(x => new UserEntity()
|
||||||
|
{
|
||||||
|
SystemId = systemId
|
||||||
|
}).ExecuteCommandAsync();
|
||||||
|
|
||||||
|
if (!(res > 0))
|
||||||
|
throw Oops.Oh(ErrorCode.COM1001);
|
||||||
|
});
|
||||||
|
|
||||||
|
var tenantId = _userManager.TenantId;
|
||||||
|
var cacheKey = string.Format("{0}{1}", CommonConst.CACHEKEYONLINEUSER, tenantId);
|
||||||
|
var allUserOnlineList = await _cacheManager.GetAsync<List<UserOnlineModel>>(cacheKey);
|
||||||
|
|
||||||
|
var userOnlineList = allUserOnlineList.FindAll(it => systemUser.Select(s => s.Id).ToList().Contains(it.userId));
|
||||||
|
userOnlineList.ForEach(async item =>
|
||||||
|
{
|
||||||
|
await _imHandler.SendMessageAsync(item.connectionId, new { method = "logout", msg = "此系统已被禁用" }.ToJsonString());
|
||||||
|
|
||||||
|
// 删除在线用户ID.
|
||||||
|
allUserOnlineList.RemoveAll((x) => x.connectionId == item.connectionId);
|
||||||
|
|
||||||
|
// 删除用户登录信息缓存.
|
||||||
|
var mCacheKey = string.Format("{0}{1}_{2}", CommonConst.CACHEKEYUSER, tenantId, item.userId);
|
||||||
|
await _cacheManager.DelAsync(mCacheKey);
|
||||||
|
});
|
||||||
|
await _cacheManager.SetAsync(cacheKey, allUserOnlineList);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -106,8 +106,6 @@ public class CodeGenWay
|
|||||||
ControlLabel = control.__config__.label,
|
ControlLabel = control.__config__.label,
|
||||||
IsImportField = isImportField.ParseToBool(),
|
IsImportField = isImportField.ParseToBool(),
|
||||||
ImportConfig = CodeGenControlsAttributeHelper.GetImportConfig(control, column.field, tableName),
|
ImportConfig = CodeGenControlsAttributeHelper.GetImportConfig(control, column.field, tableName),
|
||||||
ParsJnpfKeyConstList = CodeGenControlsAttributeHelper.GetParsJnpfKeyConstList(controls, (bool)columnDesignModel?.type.Equals(4)),
|
|
||||||
ParsJnpfKeyConstListDetails = CodeGenControlsAttributeHelper.GetParsJnpfKeyConstListDetails(controls),
|
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -149,8 +147,7 @@ public class CodeGenWay
|
|||||||
ControlLabel = control.__config__.label,
|
ControlLabel = control.__config__.label,
|
||||||
IsImportField = isImportField.ParseToBool(),
|
IsImportField = isImportField.ParseToBool(),
|
||||||
ImportConfig = CodeGenControlsAttributeHelper.GetImportConfig(control, column.field, tableName),
|
ImportConfig = CodeGenControlsAttributeHelper.GetImportConfig(control, column.field, tableName),
|
||||||
ParsJnpfKeyConstList = CodeGenControlsAttributeHelper.GetParsJnpfKeyConstList(controls, (bool)columnDesignModel?.type.Equals(4)),
|
ShowField = control.relational,
|
||||||
ParsJnpfKeyConstListDetails = CodeGenControlsAttributeHelper.GetParsJnpfKeyConstListDetails(controls),
|
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -292,6 +289,7 @@ public class CodeGenWay
|
|||||||
ImportConfig = CodeGenControlsAttributeHelper.GetImportConfig(control, column.field, tableName),
|
ImportConfig = CodeGenControlsAttributeHelper.GetImportConfig(control, column.field, tableName),
|
||||||
IsImportField = isImportField.ParseToBool(),
|
IsImportField = isImportField.ParseToBool(),
|
||||||
ChildControlKey = controlId,
|
ChildControlKey = controlId,
|
||||||
|
ShowField = control.relational,
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case false:
|
case false:
|
||||||
@@ -426,8 +424,6 @@ public class CodeGenWay
|
|||||||
ControlLabel = control.__config__.label,
|
ControlLabel = control.__config__.label,
|
||||||
IsImportField = isImportField == null ? false : (bool)isImportField,
|
IsImportField = isImportField == null ? false : (bool)isImportField,
|
||||||
ImportConfig = CodeGenControlsAttributeHelper.GetImportConfig(control, column.field, tableName),
|
ImportConfig = CodeGenControlsAttributeHelper.GetImportConfig(control, column.field, tableName),
|
||||||
ParsJnpfKeyConstList = CodeGenControlsAttributeHelper.GetParsJnpfKeyConstList(controls, (bool)columnDesignModel?.type.Equals(4)),
|
|
||||||
ParsJnpfKeyConstListDetails = CodeGenControlsAttributeHelper.GetParsJnpfKeyConstListDetails(controls),
|
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -465,8 +461,7 @@ public class CodeGenWay
|
|||||||
ControlLabel = control.__config__.label,
|
ControlLabel = control.__config__.label,
|
||||||
IsImportField = isImportField == null ? false : (bool)isImportField,
|
IsImportField = isImportField == null ? false : (bool)isImportField,
|
||||||
ImportConfig = CodeGenControlsAttributeHelper.GetImportConfig(control, column.field, tableName),
|
ImportConfig = CodeGenControlsAttributeHelper.GetImportConfig(control, column.field, tableName),
|
||||||
ParsJnpfKeyConstList = CodeGenControlsAttributeHelper.GetParsJnpfKeyConstList(controls, (bool)columnDesignModel?.type.Equals(4)),
|
ShowField = control.relational,
|
||||||
ParsJnpfKeyConstListDetails = CodeGenControlsAttributeHelper.GetParsJnpfKeyConstListDetails(controls),
|
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -580,8 +575,6 @@ public class CodeGenWay
|
|||||||
ControlLabel = control.__config__.label,
|
ControlLabel = control.__config__.label,
|
||||||
IsImportField = isImportField.ParseToBool(),
|
IsImportField = isImportField.ParseToBool(),
|
||||||
ImportConfig = CodeGenControlsAttributeHelper.GetImportConfig(control, column.field, tableName),
|
ImportConfig = CodeGenControlsAttributeHelper.GetImportConfig(control, column.field, tableName),
|
||||||
ParsJnpfKeyConstList = CodeGenControlsAttributeHelper.GetParsJnpfKeyConstList(controls, (bool)columnDesignModel?.type.Equals(4)),
|
|
||||||
ParsJnpfKeyConstListDetails = CodeGenControlsAttributeHelper.GetParsJnpfKeyConstListDetails(controls),
|
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -621,8 +614,6 @@ public class CodeGenWay
|
|||||||
ControlLabel = control.__config__.label,
|
ControlLabel = control.__config__.label,
|
||||||
IsImportField = isImportField.ParseToBool(),
|
IsImportField = isImportField.ParseToBool(),
|
||||||
ImportConfig = CodeGenControlsAttributeHelper.GetImportConfig(control, column.field, tableName),
|
ImportConfig = CodeGenControlsAttributeHelper.GetImportConfig(control, column.field, tableName),
|
||||||
ParsJnpfKeyConstList = CodeGenControlsAttributeHelper.GetParsJnpfKeyConstList(controls, (bool)columnDesignModel?.type.Equals(4)),
|
|
||||||
ParsJnpfKeyConstListDetails = CodeGenControlsAttributeHelper.GetParsJnpfKeyConstListDetails(controls),
|
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -740,8 +731,6 @@ public class CodeGenWay
|
|||||||
ControlLabel = control.__config__.label,
|
ControlLabel = control.__config__.label,
|
||||||
IsImportField = columnDesignModel?.uploaderTemplateJson?.selectKey?.Any(it => it.Equals(field)) == null ? false : (bool)columnDesignModel?.uploaderTemplateJson?.selectKey?.Any(it => it.Equals(field)),
|
IsImportField = columnDesignModel?.uploaderTemplateJson?.selectKey?.Any(it => it.Equals(field)) == null ? false : (bool)columnDesignModel?.uploaderTemplateJson?.selectKey?.Any(it => it.Equals(field)),
|
||||||
ImportConfig = CodeGenControlsAttributeHelper.GetImportConfig(control, column.field, tableName),
|
ImportConfig = CodeGenControlsAttributeHelper.GetImportConfig(control, column.field, tableName),
|
||||||
ParsJnpfKeyConstList = CodeGenControlsAttributeHelper.GetParsJnpfKeyConstList(controls, (bool)columnDesignModel?.type.Equals(4)),
|
|
||||||
ParsJnpfKeyConstListDetails = CodeGenControlsAttributeHelper.GetParsJnpfKeyConstListDetails(controls),
|
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -781,8 +770,7 @@ public class CodeGenWay
|
|||||||
ControlLabel = control.__config__.label,
|
ControlLabel = control.__config__.label,
|
||||||
IsImportField = columnDesignModel?.uploaderTemplateJson?.selectKey?.Any(it => it.Equals(field)) == null ? false : (bool)columnDesignModel?.uploaderTemplateJson?.selectKey?.Any(it => it.Equals(field)),
|
IsImportField = columnDesignModel?.uploaderTemplateJson?.selectKey?.Any(it => it.Equals(field)) == null ? false : (bool)columnDesignModel?.uploaderTemplateJson?.selectKey?.Any(it => it.Equals(field)),
|
||||||
ImportConfig = CodeGenControlsAttributeHelper.GetImportConfig(control, column.field, tableName),
|
ImportConfig = CodeGenControlsAttributeHelper.GetImportConfig(control, column.field, tableName),
|
||||||
ParsJnpfKeyConstList = CodeGenControlsAttributeHelper.GetParsJnpfKeyConstList(controls, (bool)columnDesignModel?.type.Equals(4)),
|
ShowField = control.relational,
|
||||||
ParsJnpfKeyConstListDetails = CodeGenControlsAttributeHelper.GetParsJnpfKeyConstListDetails(controls),
|
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -893,8 +881,6 @@ public class CodeGenWay
|
|||||||
ControlLabel = control.__config__.label,
|
ControlLabel = control.__config__.label,
|
||||||
IsImportField = isImportField.ParseToBool(),
|
IsImportField = isImportField.ParseToBool(),
|
||||||
ImportConfig = CodeGenControlsAttributeHelper.GetImportConfig(control, column.field, tableName),
|
ImportConfig = CodeGenControlsAttributeHelper.GetImportConfig(control, column.field, tableName),
|
||||||
ParsJnpfKeyConstList = CodeGenControlsAttributeHelper.GetParsJnpfKeyConstList(controls, (bool)columnDesignModel?.type.Equals(4)),
|
|
||||||
ParsJnpfKeyConstListDetails = CodeGenControlsAttributeHelper.GetParsJnpfKeyConstListDetails(controls),
|
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -932,8 +918,7 @@ public class CodeGenWay
|
|||||||
ControlLabel = control.__config__.label,
|
ControlLabel = control.__config__.label,
|
||||||
IsImportField = isImportField.ParseToBool(),
|
IsImportField = isImportField.ParseToBool(),
|
||||||
ImportConfig = CodeGenControlsAttributeHelper.GetImportConfig(control, column.field, tableName),
|
ImportConfig = CodeGenControlsAttributeHelper.GetImportConfig(control, column.field, tableName),
|
||||||
ParsJnpfKeyConstList = CodeGenControlsAttributeHelper.GetParsJnpfKeyConstList(controls, (bool)columnDesignModel?.type.Equals(4)),
|
ShowField = control.relational,
|
||||||
ParsJnpfKeyConstListDetails = CodeGenControlsAttributeHelper.GetParsJnpfKeyConstListDetails(controls),
|
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1214,7 +1199,7 @@ public class CodeGenWay
|
|||||||
var isAdd = indexTopButton.Any(it => it.Value == "add");
|
var isAdd = indexTopButton.Any(it => it.Value == "add");
|
||||||
var isTreeRelation = !string.IsNullOrEmpty(columnDesignModel?.treeRelation);
|
var isTreeRelation = !string.IsNullOrEmpty(columnDesignModel?.treeRelation);
|
||||||
var isRelationForm = formControlList.Any(it => it.IsRelationForm);
|
var isRelationForm = formControlList.Any(it => it.IsRelationForm);
|
||||||
var isFixed = columnDesignModel.childTableStyle == 1 ? indexColumnDesign.Any(it => it.Fixed.Any()) : false;
|
var isFixed = columnDesignModel.childTableStyle == 1 ? indexColumnDesign.Any(it => it.Fixed.Equals("fixed='left' ") && !it.Name.Equals(columnDesignModel.groupField)) : false;
|
||||||
|
|
||||||
switch (logic)
|
switch (logic)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -250,12 +250,7 @@ public class TableColumnConfigModel
|
|||||||
public string LeagueTableNo { get; set; }
|
public string LeagueTableNo { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 需解析的控件类型 JnpfKeyConst @@ 需解析的字段集合(以,隔开).
|
/// 展示字段.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<string[]> ParsJnpfKeyConstList { get; set; }
|
public string ShowField { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 需解析的控件类型 JnpfKeyConst @@ 需解析的字段集合(以,隔开)(行内编辑 特殊处理).
|
|
||||||
/// </summary>
|
|
||||||
public List<string[]> ParsJnpfKeyConstListDetails { get; set; }
|
|
||||||
}
|
}
|
||||||
@@ -220,4 +220,10 @@ public class LinkageConfig
|
|||||||
/// 是否多选.
|
/// 是否多选.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsMultiple { get; set; }
|
public bool IsMultiple { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 联动模板json.
|
||||||
|
/// </summary>
|
||||||
|
public List<LinkageConfig> templateJson { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -5,7 +5,7 @@ namespace JNPF.VisualDev.Engine;
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 实体字段模型
|
/// 实体字段模型
|
||||||
/// 版 本:V3.0.0
|
/// 版 本:V3.0.0
|
||||||
/// 版 权:拓通智联科技有限公司(http://www.tuotong-tech.com)
|
/// 版 权:引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||||
/// 作 者:JNPF开发平台组.
|
/// 作 者:JNPF开发平台组.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SuppressSniffer]
|
[SuppressSniffer]
|
||||||
|
|||||||
@@ -581,4 +581,9 @@ public class FieldsModel
|
|||||||
/// 上级__vModel__.
|
/// 上级__vModel__.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string superiorVModel { get; set; }
|
public string superiorVModel { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 后端自我创建字段、用于统一处理关联表单属性与弹窗选择属性.
|
||||||
|
/// </summary>
|
||||||
|
public string relational { get; set; }
|
||||||
}
|
}
|
||||||
@@ -92,7 +92,6 @@ public class CodeGenControlsAttributeHelper
|
|||||||
case JnpfKeyConst.DEPSELECT:
|
case JnpfKeyConst.DEPSELECT:
|
||||||
case JnpfKeyConst.POSSELECT:
|
case JnpfKeyConst.POSSELECT:
|
||||||
case JnpfKeyConst.USERSELECT:
|
case JnpfKeyConst.USERSELECT:
|
||||||
case JnpfKeyConst.POPUPTABLESELECT:
|
|
||||||
case JnpfKeyConst.ROLESELECT:
|
case JnpfKeyConst.ROLESELECT:
|
||||||
case JnpfKeyConst.GROUPSELECT:
|
case JnpfKeyConst.GROUPSELECT:
|
||||||
{
|
{
|
||||||
@@ -106,7 +105,9 @@ public class CodeGenControlsAttributeHelper
|
|||||||
case JnpfKeyConst.CHECKBOX:
|
case JnpfKeyConst.CHECKBOX:
|
||||||
case JnpfKeyConst.CASCADER:
|
case JnpfKeyConst.CASCADER:
|
||||||
case JnpfKeyConst.COMSELECT:
|
case JnpfKeyConst.COMSELECT:
|
||||||
|
case JnpfKeyConst.POPUPTABLESELECT:
|
||||||
case JnpfKeyConst.ADDRESS:
|
case JnpfKeyConst.ADDRESS:
|
||||||
|
case JnpfKeyConst.USERSSELECT:
|
||||||
tag = true;
|
tag = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -206,7 +207,6 @@ public class CodeGenControlsAttributeHelper
|
|||||||
case JnpfKeyConst.DEPSELECT:
|
case JnpfKeyConst.DEPSELECT:
|
||||||
case JnpfKeyConst.POSSELECT:
|
case JnpfKeyConst.POSSELECT:
|
||||||
case JnpfKeyConst.USERSELECT:
|
case JnpfKeyConst.USERSELECT:
|
||||||
case JnpfKeyConst.POPUPTABLESELECT:
|
|
||||||
case JnpfKeyConst.ROLESELECT:
|
case JnpfKeyConst.ROLESELECT:
|
||||||
case JnpfKeyConst.GROUPSELECT:
|
case JnpfKeyConst.GROUPSELECT:
|
||||||
{
|
{
|
||||||
@@ -221,6 +221,7 @@ public class CodeGenControlsAttributeHelper
|
|||||||
case JnpfKeyConst.CASCADER:
|
case JnpfKeyConst.CASCADER:
|
||||||
case JnpfKeyConst.COMSELECT:
|
case JnpfKeyConst.COMSELECT:
|
||||||
case JnpfKeyConst.ADDRESS:
|
case JnpfKeyConst.ADDRESS:
|
||||||
|
case JnpfKeyConst.POPUPTABLESELECT:
|
||||||
tag = true;
|
tag = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -248,6 +249,7 @@ public class CodeGenControlsAttributeHelper
|
|||||||
case JnpfKeyConst.DEPSELECT:
|
case JnpfKeyConst.DEPSELECT:
|
||||||
case JnpfKeyConst.POSSELECT:
|
case JnpfKeyConst.POSSELECT:
|
||||||
case JnpfKeyConst.USERSELECT:
|
case JnpfKeyConst.USERSELECT:
|
||||||
|
case JnpfKeyConst.USERSSELECT:
|
||||||
case JnpfKeyConst.POPUPTABLESELECT:
|
case JnpfKeyConst.POPUPTABLESELECT:
|
||||||
case JnpfKeyConst.ROLESELECT:
|
case JnpfKeyConst.ROLESELECT:
|
||||||
case JnpfKeyConst.GROUPSELECT:
|
case JnpfKeyConst.GROUPSELECT:
|
||||||
@@ -456,6 +458,14 @@ public class CodeGenControlsAttributeHelper
|
|||||||
if (!res.ContainsKey(JnpfKeyConst.USERSSELECT)) res.Add(JnpfKeyConst.USERSSELECT, new List<string>());
|
if (!res.ContainsKey(JnpfKeyConst.USERSSELECT)) res.Add(JnpfKeyConst.USERSSELECT, new List<string>());
|
||||||
res[JnpfKeyConst.USERSSELECT].Add(item.__vModel__);
|
res[JnpfKeyConst.USERSSELECT].Add(item.__vModel__);
|
||||||
break;
|
break;
|
||||||
|
case JnpfKeyConst.POPUPSELECT: // 弹窗选择
|
||||||
|
if (!res.ContainsKey(JnpfKeyConst.POPUPSELECT)) res.Add(JnpfKeyConst.POPUPSELECT, new List<string>());
|
||||||
|
res[JnpfKeyConst.POPUPSELECT].Add(item.__vModel__);
|
||||||
|
break;
|
||||||
|
case JnpfKeyConst.RELATIONFORM: // 关联表单
|
||||||
|
if (!res.ContainsKey(JnpfKeyConst.RELATIONFORM)) res.Add(JnpfKeyConst.RELATIONFORM, new List<string>());
|
||||||
|
res[JnpfKeyConst.RELATIONFORM].Add(item.__vModel__);
|
||||||
|
break;
|
||||||
case JnpfKeyConst.TABLE: // 遍历 子表 控件
|
case JnpfKeyConst.TABLE: // 遍历 子表 控件
|
||||||
var ctRes = GetParsJnpfKeyConstList(item.__config__.children, isInlineEditor);
|
var ctRes = GetParsJnpfKeyConstList(item.__config__.children, isInlineEditor);
|
||||||
if (ctRes != null && ctRes.Any())
|
if (ctRes != null && ctRes.Any())
|
||||||
@@ -463,7 +473,7 @@ public class CodeGenControlsAttributeHelper
|
|||||||
foreach (var ct in ctRes)
|
foreach (var ct in ctRes)
|
||||||
{
|
{
|
||||||
if (!res.ContainsKey(ct.FirstOrDefault())) res.Add(ct.FirstOrDefault(), new List<string>());
|
if (!res.ContainsKey(ct.FirstOrDefault())) res.Add(ct.FirstOrDefault(), new List<string>());
|
||||||
res[ct.FirstOrDefault()].AddRange(ct.LastOrDefault().Split(','));
|
res[ct.FirstOrDefault()].Add(item.__vModel__ + "-" + ct.LastOrDefault());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -506,10 +516,6 @@ public class CodeGenControlsAttributeHelper
|
|||||||
if (!res.ContainsKey(JnpfKeyConst.USERSSELECT)) res.Add(JnpfKeyConst.USERSSELECT, new List<string>());
|
if (!res.ContainsKey(JnpfKeyConst.USERSSELECT)) res.Add(JnpfKeyConst.USERSSELECT, new List<string>());
|
||||||
res[JnpfKeyConst.USERSSELECT].Add(item.__vModel__);
|
res[JnpfKeyConst.USERSSELECT].Add(item.__vModel__);
|
||||||
break;
|
break;
|
||||||
case JnpfKeyConst.POPUPTABLESELECT: // 下拉表格.
|
|
||||||
if (!res.ContainsKey(JnpfKeyConst.POPUPTABLESELECT)) res.Add(JnpfKeyConst.POPUPTABLESELECT, new List<string>());
|
|
||||||
res[JnpfKeyConst.POPUPTABLESELECT].Add(item.__vModel__);
|
|
||||||
break;
|
|
||||||
case JnpfKeyConst.POPUPSELECT: // 弹窗选择.
|
case JnpfKeyConst.POPUPSELECT: // 弹窗选择.
|
||||||
if (!res.ContainsKey(JnpfKeyConst.POPUPSELECT)) res.Add(JnpfKeyConst.POPUPSELECT, new List<string>());
|
if (!res.ContainsKey(JnpfKeyConst.POPUPSELECT)) res.Add(JnpfKeyConst.POPUPSELECT, new List<string>());
|
||||||
res[JnpfKeyConst.POPUPSELECT].Add(item.__vModel__);
|
res[JnpfKeyConst.POPUPSELECT].Add(item.__vModel__);
|
||||||
@@ -524,8 +530,8 @@ public class CodeGenControlsAttributeHelper
|
|||||||
{
|
{
|
||||||
foreach (var ct in ctRes)
|
foreach (var ct in ctRes)
|
||||||
{
|
{
|
||||||
if (!res.ContainsKey(item.__vModel__ + "-" + ct.FirstOrDefault())) res.Add(item.__vModel__ + "-" + ct.FirstOrDefault(), new List<string>());
|
if (!res.ContainsKey(ct.FirstOrDefault())) res.Add(ct.FirstOrDefault(), new List<string>());
|
||||||
res[item.__vModel__ + "-" + ct.FirstOrDefault()].AddRange(ct.LastOrDefault().Split(','));
|
res[ct.FirstOrDefault()].Add(item.__vModel__ + "-" + ct.LastOrDefault());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -288,4 +288,41 @@ public class CodeGenUnifiedHandlerHelper
|
|||||||
}
|
}
|
||||||
return NewFormDataModel;
|
return NewFormDataModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 统一处理控件关系.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="formDataModel">控件列表.</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static List<FieldsModel> UnifiedHandlerControlRelationship(List<FieldsModel> formDataModel, bool isMain = true)
|
||||||
|
{
|
||||||
|
formDataModel.ForEach(item =>
|
||||||
|
{
|
||||||
|
switch (item.__config__.jnpfKey)
|
||||||
|
{
|
||||||
|
case JnpfKeyConst.RELATIONFORM:
|
||||||
|
{
|
||||||
|
var list = formDataModel.FindAll(it => it.__config__.jnpfKey.Equals(JnpfKeyConst.RELATIONFORMATTR) && it.relationField.Equals(string.Format("{0}_jnpfTable_{1}{2}", item.__vModel__, item.__config__.tableName, isMain ? 1 : 0)) && it.__config__.isStorage.Equals(1));
|
||||||
|
item.relational = string.Join(",", list.Select(it => it.showField).ToList());
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
case JnpfKeyConst.TABLE:
|
||||||
|
{
|
||||||
|
item.__config__.children = UnifiedHandlerControlRelationship(item.__config__.children, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
case JnpfKeyConst.POPUPSELECT:
|
||||||
|
{
|
||||||
|
var list = formDataModel.FindAll(it => it.__config__.jnpfKey.Equals(JnpfKeyConst.POPUPATTR) && it.relationField.Equals(string.Format("{0}_jnpfTable_{1}{2}", item.__vModel__, item.__config__.tableName, isMain ? 1 : 0)) && it.__config__.isStorage.Equals(1));
|
||||||
|
item.relational = string.Join(",", list.Select(it => it.showField).ToList());
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return formDataModel;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -363,9 +363,11 @@ public class CodeGenFormControlDesignHelper
|
|||||||
{
|
{
|
||||||
var relationField = Regex.Match(item.relationField, @"^(.+)_jnpfTable_").Groups[1].Value;
|
var relationField = Regex.Match(item.relationField, @"^(.+)_jnpfTable_").Groups[1].Value;
|
||||||
var relationControl = realisticControls.Find(it => it.__vModel__ == relationField);
|
var relationControl = realisticControls.Find(it => it.__vModel__ == relationField);
|
||||||
|
var columnDesign = columnDesignModel?.Find(it => it.__vModel__ == item.__vModel__);
|
||||||
list.Add(new FormControlDesignModel()
|
list.Add(new FormControlDesignModel()
|
||||||
{
|
{
|
||||||
vModel = item.__vModel__.IsNotEmptyOrNull() ? string.Format("v-model=\"dataForm.{0}\"", item.__vModel__) : string.Empty,
|
vModel = item.__vModel__.IsNotEmptyOrNull() ? string.Format("v-model=\"dataForm.{0}\"", item.__vModel__) : string.Empty,
|
||||||
|
IsInlineEditor = columnDesignModel != null ? columnDesignModel.Any(it => it.__vModel__ == item.__vModel__) : false,
|
||||||
Style = item.style != null && !item.style.ToString().Equals("{}") ? $":style='{item.style.ToJsonString()}' " : string.Empty,
|
Style = item.style != null && !item.style.ToString().Equals("{}") ? $":style='{item.style.ToJsonString()}' " : string.Empty,
|
||||||
jnpfKey = config.jnpfKey,
|
jnpfKey = config.jnpfKey,
|
||||||
OriginalName = config.isStorage == 2 ? item.__vModel__ : relationField,
|
OriginalName = config.isStorage == 2 ? item.__vModel__ : relationField,
|
||||||
@@ -377,7 +379,9 @@ public class CodeGenFormControlDesignHelper
|
|||||||
Label = config.label,
|
Label = config.label,
|
||||||
Span = config.span,
|
Span = config.span,
|
||||||
IsStorage = config.isStorage,
|
IsStorage = config.isStorage,
|
||||||
|
IndexWidth = columnDesign?.width,
|
||||||
LabelWidth = config?.labelWidth ?? labelWidth,
|
LabelWidth = config?.labelWidth ?? labelWidth,
|
||||||
|
IndexAlign = columnDesign?.align,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,9 +15,6 @@ using JNPF.Systems.Interfaces.System;
|
|||||||
using JNPF.RemoteRequest.Extensions;
|
using JNPF.RemoteRequest.Extensions;
|
||||||
using JNPF.Systems.Entitys.Model.DataInterFace;
|
using JNPF.Systems.Entitys.Model.DataInterFace;
|
||||||
using JNPF.Common.Core.Manager;
|
using JNPF.Common.Core.Manager;
|
||||||
using Microsoft.AspNetCore.Identity;
|
|
||||||
using Spire.Pdf.Lists;
|
|
||||||
using Senparc.NeuChar.Entities;
|
|
||||||
|
|
||||||
namespace JNPF.Common.CodeGen.DataParsing;
|
namespace JNPF.Common.CodeGen.DataParsing;
|
||||||
|
|
||||||
@@ -43,11 +40,6 @@ public class ControlParsing : ITransient
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private readonly IDataInterfaceService _dataInterfaceService;
|
private readonly IDataInterfaceService _dataInterfaceService;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 解析控件的控件属性 (vModel , Attr).
|
|
||||||
/// </summary>
|
|
||||||
private Dictionary<string, FieldsModel>? ControlAttr;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 构造函数.
|
/// 构造函数.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -74,9 +66,6 @@ public class ControlParsing : ITransient
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<List<Dictionary<string, object>>> GetParsDataList(List<Dictionary<string, object>> oldDatas, string vModelStr, string jnpfKeyConst, string tenantId, List<FieldsModel>? vModelAttr = null)
|
public async Task<List<Dictionary<string, object>>> GetParsDataList(List<Dictionary<string, object>> oldDatas, string vModelStr, string jnpfKeyConst, string tenantId, List<FieldsModel>? vModelAttr = null)
|
||||||
{
|
{
|
||||||
ControlAttr = new Dictionary<string, FieldsModel>();
|
|
||||||
if (vModelAttr != null) vModelAttr.ForEach(it => ControlAttr.Add(it.__vModel__, it));
|
|
||||||
|
|
||||||
var vModels = new Dictionary<string, object>();
|
var vModels = new Dictionary<string, object>();
|
||||||
var vModelList = vModelStr.Split(',');
|
var vModelList = vModelStr.Split(',');
|
||||||
oldDatas.ForEach(items =>
|
oldDatas.ForEach(items =>
|
||||||
@@ -91,45 +80,54 @@ public class ControlParsing : ITransient
|
|||||||
var ctOldDatas = item.Value.ToObject<List<Dictionary<string, object>>>();
|
var ctOldDatas = item.Value.ToObject<List<Dictionary<string, object>>>();
|
||||||
ctOldDatas.ForEach(ctItems =>
|
ctOldDatas.ForEach(ctItems =>
|
||||||
{
|
{
|
||||||
foreach (var ctItem in ctItems) if (vModelList.Contains(ctItem.Key) && !vModels.ContainsKey(ctItem.Key)) vModels.Add(ctItem.Key, jnpfKeyConst);
|
foreach (var ctItem in ctItems)
|
||||||
|
{
|
||||||
|
if (vModelList.Contains(item.Key + "-" + ctItem.Key) && !vModels.ContainsKey(item.Key + "-" + ctItem.Key))
|
||||||
|
vModels.Add(item.Key + "-" + ctItem.Key, jnpfKeyConst);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return await GetParsDataByList(oldDatas, vModels, tenantId);
|
return await GetParsDataByList(vModelAttr, oldDatas, vModels, tenantId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取解析数据.
|
/// 获取解析数据.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <param name="fields">模板集合.</param>
|
||||||
/// <param name="oldDatas">原数据集合.</param>
|
/// <param name="oldDatas">原数据集合.</param>
|
||||||
/// <param name="vModels">需解析的字段 (字段名,JnpfKeyConst/子表dictionary).</param>
|
/// <param name="vModels">需解析的字段 (字段名,JnpfKeyConst/子表dictionary).</param>
|
||||||
/// <param name="tenantId">租户Id.</param>
|
/// <param name="tenantId">租户Id.</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private async Task<List<Dictionary<string, object>>> GetParsDataByList(List<Dictionary<string, object>> oldDatas, Dictionary<string, object> vModels, string tenantId)
|
private async Task<List<Dictionary<string, object>>> GetParsDataByList(List<FieldsModel> fields, List<Dictionary<string, object>> oldDatas, Dictionary<string, object> vModels, string tenantId)
|
||||||
{
|
{
|
||||||
var cacheData = await GetCaCheData(vModels, tenantId);
|
var cacheData = await GetCaCheData(vModels, tenantId);
|
||||||
var usersselectDatas = cacheData.Where(t => t.Key.Equals(CommonConst.CodeGenDynamic + "_usersSelect_" + tenantId)).FirstOrDefault().Value.ToObject<Dictionary<string, string>>(); // 用户组件
|
var usersselectDatas = cacheData.Where(t => t.Key.Equals(CommonConst.CodeGenDynamic + "_usersSelect_" + tenantId)).FirstOrDefault().Value.ToObject<Dictionary<string, string>>(); // 用户组件
|
||||||
|
|
||||||
oldDatas.ForEach(async items =>
|
foreach (var items in oldDatas)
|
||||||
{
|
{
|
||||||
foreach (var item in items)
|
for(var i = 0; i < items.Count; i++)
|
||||||
{
|
{
|
||||||
if (vModels.Any(x => x.Key.Equals(item.Key)))
|
var item = items.ToList()[i];
|
||||||
|
|
||||||
|
if (vModels.Any(x => x.Key.Equals(item.Key)) && items[item.Key] != null)
|
||||||
{
|
{
|
||||||
FieldsModel model = ControlAttr.ContainsKey(item.Key) ? ControlAttr[item.Key] : new FieldsModel();
|
FieldsModel model = fields.Any(x=>x.__vModel__.Equals(item.Key)) ? fields.Find(x=> x.__vModel__.Equals(item.Key)) : (fields.Any(x => x.__vModel__.Equals(item.Key.Replace("_name", string.Empty))) ? fields.Find(x => x.__vModel__.Equals(item.Key.Replace("_name", string.Empty))) : new FieldsModel());
|
||||||
model.separator = ",";
|
model.separator = ",";
|
||||||
var jnpfKey = vModels.FirstOrDefault(x => x.Key.Equals(item.Key)).Value;
|
var jnpfKey = vModels.FirstOrDefault(x => x.Key.Equals(item.Key)).Value;
|
||||||
switch (jnpfKey)
|
switch (jnpfKey)
|
||||||
{
|
{
|
||||||
case JnpfKeyConst.USERSSELECT:
|
case JnpfKeyConst.USERSSELECT:
|
||||||
{
|
{
|
||||||
if (item.Value != null)
|
var itemValue = item.Value;
|
||||||
|
if (itemValue == null && items.ContainsKey(item.Key.Replace("_name", string.Empty))) itemValue = items[item.Key.Replace("_name", string.Empty)];
|
||||||
|
if (itemValue != null)
|
||||||
{
|
{
|
||||||
var vList = new List<string>();
|
var vList = new List<string>();
|
||||||
if (item.Value.ToString().Contains("[")) vList = item.Value.ToString().ToObject<List<string>>();
|
if (itemValue.ToString().Contains("[")) vList = itemValue.ToString().ToObject<List<string>>();
|
||||||
else vList.Add(item.Value.ToString());
|
else vList.Add(itemValue.ToString());
|
||||||
var itemValues = new List<string>();
|
var itemValues = new List<string>();
|
||||||
vList.ForEach(it =>
|
vList.ForEach(it =>
|
||||||
{
|
{
|
||||||
@@ -140,7 +138,6 @@ public class ControlParsing : ITransient
|
|||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case JnpfKeyConst.POPUPTABLESELECT:
|
|
||||||
case JnpfKeyConst.POPUPSELECT: // 弹窗选择
|
case JnpfKeyConst.POPUPSELECT: // 弹窗选择
|
||||||
{
|
{
|
||||||
if (model.interfaceId.IsNullOrEmpty()) continue;
|
if (model.interfaceId.IsNullOrEmpty()) continue;
|
||||||
@@ -193,62 +190,45 @@ public class ControlParsing : ITransient
|
|||||||
{
|
{
|
||||||
case 1: // SQL数据
|
case 1: // SQL数据
|
||||||
{
|
{
|
||||||
var specificData = popupselectDataList.Where(it => it.ContainsKey(model.propsValue) && it.ContainsValue(items[item.Key].ToString())).FirstOrDefault();
|
var specificData = popupselectDataList.Where(it => it.ContainsKey(model.propsValue) && it.ContainsValue(items[item.Key] == null ? model.interfaceId : items[item.Key].ToString())).FirstOrDefault();
|
||||||
if (specificData != null)
|
if (specificData != null)
|
||||||
{
|
{
|
||||||
// 要用模板的 “显示字段 - relationField”来展示数据
|
// 要用模板的 “显示字段 - relationField”来展示数据
|
||||||
items[item.Key + "_id"] = items[item.Key];
|
items[item.Key + "_id"] = items[item.Key];
|
||||||
items[item.Key] = specificData[model.relationField];
|
items[item.Key] = specificData[model.relationField];
|
||||||
}
|
|
||||||
else
|
// 弹窗选择属性
|
||||||
{
|
if (model.relational.IsNotEmptyOrNull())
|
||||||
if (model.multiple)
|
foreach (var fItem in model.relational.Split(",")) items[model.__vModel__ + "_" + fItem] = specificData[fItem];
|
||||||
{
|
|
||||||
var nameList = new List<string>();
|
|
||||||
items[item.Key].ToObject<List<string>>().ForEach(strIt =>
|
|
||||||
{
|
|
||||||
var specificData = popupselectDataList.Where(it => it.ContainsKey(model.propsValue) && it.ContainsValue(strIt)).FirstOrDefault();
|
|
||||||
if (specificData != null)
|
|
||||||
{
|
|
||||||
// 要用模板的 “显示字段 - relationField”来展示数据
|
|
||||||
if (model.relationField.IsNotEmptyOrNull())
|
|
||||||
nameList.Add(specificData[model.relationField]);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (nameList.Any())
|
|
||||||
{
|
|
||||||
items[item.Key + "_id"] = items[item.Key];
|
|
||||||
items[item.Key] = string.Join(model.separator, nameList);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
items[item.Key] = items[item.Key].ToString().Contains("[") ? string.Join(model.separator, items[item.Key].ToObject<List<object>>()) : items[item.Key];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2: // 静态数据
|
case 2: // 静态数据
|
||||||
{
|
{
|
||||||
List<string> dataList = items[item.Key].ToJsonString().ToObject<List<string>>();
|
var vara = popupselectDataList.Where(a => a.ContainsValue(items[item.Key] == null ? model.interfaceId : items[item.Key].ToString())).FirstOrDefault();
|
||||||
List<string> cascaderList = new List<string>();
|
if (vara != null)
|
||||||
foreach (var it in dataList)
|
|
||||||
{
|
{
|
||||||
var vara = popupselectDataList.Where(a => a.ContainsValue(it)).FirstOrDefault();
|
items[item.Key + "_id"] = items[item.Key];
|
||||||
if (vara != null) cascaderList.Add(vara[model.props.props.label]);
|
items[item.Key] = vara[items[item.Key].ToString()];
|
||||||
}
|
|
||||||
|
|
||||||
items[item.Key + "_id"] = items[item.Key];
|
// 弹窗选择属性
|
||||||
items[item.Key] = string.Join(model.separator, cascaderList);
|
if (model.relational.IsNotEmptyOrNull())
|
||||||
|
foreach (var fItem in model.relational.Split(",")) items[model.__vModel__ + "_" + fItem] = vara[fItem];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 3: // Api数据
|
case 3: // Api数据
|
||||||
{
|
{
|
||||||
List<object> cascaderList = new List<object>();
|
var vara = popupselectDataList.Where(a => a.ContainsValue(items[item.Key] == null ? model.interfaceId : items[item.Key].ToString())).FirstOrDefault();
|
||||||
if (popupselectDataList != null) popupselectDataList.ForEach(obj => { if (obj[model.propsValue] == items[item.Key].ToString()) cascaderList.Add(obj[model.relationField]); });
|
if (vara != null)
|
||||||
|
{
|
||||||
|
items[item.Key + "_id"] = items[item.Key];
|
||||||
|
items[item.Key] = vara[items[item.Key].ToString()];
|
||||||
|
|
||||||
items[item.Key + "_id"] = items[item.Key];
|
// 弹窗选择属性
|
||||||
items[item.Key] = string.Join(model.separator, cascaderList);
|
if (model.relational.IsNotEmptyOrNull())
|
||||||
|
foreach (var fItem in model.relational.Split(",")) items[model.__vModel__ + "_" + fItem] = vara[fItem];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -293,6 +273,10 @@ public class ControlParsing : ITransient
|
|||||||
{
|
{
|
||||||
items[item.Key + "_id"] = relationFormRealData["id"];
|
items[item.Key + "_id"] = relationFormRealData["id"];
|
||||||
items[item.Key] = relationFormRealData.ContainsKey(model.relationField) ? relationFormRealData[model.relationField] : string.Empty;
|
items[item.Key] = relationFormRealData.ContainsKey(model.relationField) ? relationFormRealData[model.relationField] : string.Empty;
|
||||||
|
|
||||||
|
// 关联表单属性
|
||||||
|
if (model.relational.IsNotEmptyOrNull())
|
||||||
|
foreach (var fItem in model.relational.Split(",")) items[model.__vModel__ + "_" + fItem] = relationFormRealData[fItem];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -309,11 +293,15 @@ public class ControlParsing : ITransient
|
|||||||
{
|
{
|
||||||
var ctList = item.Value.ToObject<List<Dictionary<string, object>>>();
|
var ctList = item.Value.ToObject<List<Dictionary<string, object>>>();
|
||||||
var ctVModels = new Dictionary<string, object>();
|
var ctVModels = new Dictionary<string, object>();
|
||||||
vModels.Where(x => x.Key.Contains(item.Key)).ToList().ForEach(ctItem => ctVModels.Add(ctItem.Key.Split("-").LastOrDefault(), ctItem.Value));
|
foreach (var ctItem in vModels.Where(x => x.Key.Contains(item.Key)).ToList())
|
||||||
if (ctList.Any()) items[item.Key] = await GetParsDataByList(ctList, ctVModels, tenantId);
|
{
|
||||||
|
ctVModels.Add(ctItem.Key.Split("-").LastOrDefault(), ctItem.Value);
|
||||||
|
var ctFields = fields.Find(x => x.__vModel__.Equals(ctItem.Key.Split("-").FirstOrDefault())).__config__.children;
|
||||||
|
if (ctList.Any()) items[item.Key] = await GetParsDataByList(ctFields, ctList, ctVModels, tenantId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
|
||||||
return oldDatas;
|
return oldDatas;
|
||||||
}
|
}
|
||||||
@@ -493,5 +481,4 @@ public class ControlParsing : ITransient
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -21,9 +21,9 @@ using JNPF.Systems.Entitys.Model.DataInterFace;
|
|||||||
using JNPF.Systems.Entitys.Permission;
|
using JNPF.Systems.Entitys.Permission;
|
||||||
using JNPF.Systems.Entitys.System;
|
using JNPF.Systems.Entitys.System;
|
||||||
using JNPF.Systems.Interfaces.System;
|
using JNPF.Systems.Interfaces.System;
|
||||||
|
using JNPF.VisualDev;
|
||||||
using JNPF.VisualDev.Engine;
|
using JNPF.VisualDev.Engine;
|
||||||
using JNPF.VisualDev.Engine.Core;
|
using JNPF.VisualDev.Engine.Core;
|
||||||
using JNPF.VisualDev.Interfaces;
|
|
||||||
using JNPF.WorkFlow.Interfaces.Service;
|
using JNPF.WorkFlow.Interfaces.Service;
|
||||||
using Mapster;
|
using Mapster;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
@@ -50,7 +50,7 @@ public class ExportImportDataHelper : ITransient
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 在线开发运行服务.
|
/// 在线开发运行服务.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private readonly IRunService _runService;
|
private readonly RunService _runService;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 单据.
|
/// 单据.
|
||||||
@@ -93,7 +93,7 @@ public class ExportImportDataHelper : ITransient
|
|||||||
public ExportImportDataHelper(
|
public ExportImportDataHelper(
|
||||||
ISqlSugarRepository<OrganizeEntity> repositoryRepository,
|
ISqlSugarRepository<OrganizeEntity> repositoryRepository,
|
||||||
IUserManager userManager,
|
IUserManager userManager,
|
||||||
IRunService runService,
|
RunService runService,
|
||||||
IBillRullService billRuleService,
|
IBillRullService billRuleService,
|
||||||
IDataInterfaceService dataInterfaceService,
|
IDataInterfaceService dataInterfaceService,
|
||||||
IDataBaseManager databaseService,
|
IDataBaseManager databaseService,
|
||||||
@@ -369,6 +369,55 @@ public class ExportImportDataHelper : ITransient
|
|||||||
field.ableRoleIds = (att as CodeGenUploadAttribute).ableRoleIds;
|
field.ableRoleIds = (att as CodeGenUploadAttribute).ableRoleIds;
|
||||||
field.ableGroupIds = (att as CodeGenUploadAttribute).ableGroupIds;
|
field.ableGroupIds = (att as CodeGenUploadAttribute).ableGroupIds;
|
||||||
field.ableIds = (att as CodeGenUploadAttribute).ableIds;
|
field.ableIds = (att as CodeGenUploadAttribute).ableIds;
|
||||||
|
field.relational = (att as CodeGenUploadAttribute).showField;
|
||||||
|
configModel = (att as CodeGenUploadAttribute).__config__.Adapt<ConfigModel>();
|
||||||
|
configModel.label = string.Format("{0}({1})", configModel.label, field.__vModel__);
|
||||||
|
field.__config__ = configModel;
|
||||||
|
fieldList.Add(field);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return fieldList;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取数据转换模板解析.
|
||||||
|
/// </summary>
|
||||||
|
public static List<FieldsModel> GetDataConversionTemplateParsing<T>(T entity)
|
||||||
|
{
|
||||||
|
List<FieldsModel> fieldList = new List<FieldsModel>();
|
||||||
|
foreach (PropertyInfo prop in entity.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public))
|
||||||
|
{
|
||||||
|
FieldsModel field = new FieldsModel();
|
||||||
|
foreach (var att in prop.GetCustomAttributes(false))
|
||||||
|
{
|
||||||
|
if (att is CodeGenUploadAttribute)
|
||||||
|
{
|
||||||
|
var configModel = new ConfigModel();
|
||||||
|
field.__vModel__ = (att as CodeGenUploadAttribute).__vModel__ ?? (att as CodeGenUploadAttribute).__Model__;
|
||||||
|
field.level = (att as CodeGenUploadAttribute).level;
|
||||||
|
field.min = (att as CodeGenUploadAttribute).min == 0 ? null : (att as CodeGenUploadAttribute).min;
|
||||||
|
field.max = (att as CodeGenUploadAttribute).max == 0 ? null : (att as CodeGenUploadAttribute).max;
|
||||||
|
field.activeTxt = (att as CodeGenUploadAttribute).activeTxt;
|
||||||
|
field.inactiveTxt = (att as CodeGenUploadAttribute).inactiveTxt;
|
||||||
|
field.format = (att as CodeGenUploadAttribute).format;
|
||||||
|
field.multiple = (att as CodeGenUploadAttribute).multiple;
|
||||||
|
field.separator = (att as CodeGenUploadAttribute).separator;
|
||||||
|
field.__slot__ = (att as CodeGenUploadAttribute).__slot__.Adapt<SlotModel>();
|
||||||
|
field.props = (att as CodeGenUploadAttribute).props.Adapt<PropsModel>();
|
||||||
|
field.options = (att as CodeGenUploadAttribute).options;
|
||||||
|
field.propsValue = (att as CodeGenUploadAttribute).propsValue;
|
||||||
|
field.relationField = (att as CodeGenUploadAttribute).relationField;
|
||||||
|
field.modelId = (att as CodeGenUploadAttribute).modelId;
|
||||||
|
field.interfaceId = (att as CodeGenUploadAttribute).interfaceId;
|
||||||
|
field.selectType = (att as CodeGenUploadAttribute).selectType;
|
||||||
|
field.ableDepIds = (att as CodeGenUploadAttribute).ableDepIds;
|
||||||
|
field.ablePosIds = (att as CodeGenUploadAttribute).ablePosIds;
|
||||||
|
field.ableUserIds = (att as CodeGenUploadAttribute).ableUserIds;
|
||||||
|
field.ableRoleIds = (att as CodeGenUploadAttribute).ableRoleIds;
|
||||||
|
field.ableGroupIds = (att as CodeGenUploadAttribute).ableGroupIds;
|
||||||
|
field.ableIds = (att as CodeGenUploadAttribute).ableIds;
|
||||||
|
field.relational = (att as CodeGenUploadAttribute).showField;
|
||||||
configModel = (att as CodeGenUploadAttribute).__config__.Adapt<ConfigModel>();
|
configModel = (att as CodeGenUploadAttribute).__config__.Adapt<ConfigModel>();
|
||||||
configModel.label = string.Format("{0}({1})", configModel.label, field.__vModel__);
|
configModel.label = string.Format("{0}({1})", configModel.label, field.__vModel__);
|
||||||
field.__config__ = configModel;
|
field.__config__ = configModel;
|
||||||
@@ -416,6 +465,56 @@ public class ExportImportDataHelper : ITransient
|
|||||||
field.ableRoleIds = (att as CodeGenUploadAttribute).ableRoleIds;
|
field.ableRoleIds = (att as CodeGenUploadAttribute).ableRoleIds;
|
||||||
field.ableGroupIds = (att as CodeGenUploadAttribute).ableGroupIds;
|
field.ableGroupIds = (att as CodeGenUploadAttribute).ableGroupIds;
|
||||||
field.ableIds = (att as CodeGenUploadAttribute).ableIds;
|
field.ableIds = (att as CodeGenUploadAttribute).ableIds;
|
||||||
|
field.relational = (att as CodeGenUploadAttribute).showField;
|
||||||
|
configModel = (att as CodeGenUploadAttribute).__config__.Adapt<ConfigModel>();
|
||||||
|
configModel.label = string.Format("{0}({1})", configModel.label, field.__vModel__);
|
||||||
|
field.__config__ = configModel;
|
||||||
|
fieldList.Add(field);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return fieldList;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取数据转换模板解析.
|
||||||
|
/// </summary>
|
||||||
|
public static List<FieldsModel> GetDataConversionTemplateParsing<T>(T entity, string tableName)
|
||||||
|
{
|
||||||
|
List<FieldsModel> fieldList = new List<FieldsModel>();
|
||||||
|
foreach (PropertyInfo prop in entity.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public))
|
||||||
|
{
|
||||||
|
FieldsModel field = new FieldsModel();
|
||||||
|
foreach (var att in prop.GetCustomAttributes(false))
|
||||||
|
{
|
||||||
|
if (att is CodeGenUploadAttribute)
|
||||||
|
{
|
||||||
|
var configModel = new ConfigModel();
|
||||||
|
field.__vModel__ = string.Format("jnpf_{0}_jnpf_{1}", tableName, (att as CodeGenUploadAttribute).__vModel__ ?? (att as CodeGenUploadAttribute).__Model__);
|
||||||
|
field.level = (att as CodeGenUploadAttribute).level;
|
||||||
|
field.min = (att as CodeGenUploadAttribute).min == 0 ? null : (att as CodeGenUploadAttribute).min;
|
||||||
|
field.max = (att as CodeGenUploadAttribute).max == 0 ? null : (att as CodeGenUploadAttribute).max;
|
||||||
|
field.activeTxt = (att as CodeGenUploadAttribute).activeTxt;
|
||||||
|
field.inactiveTxt = (att as CodeGenUploadAttribute).inactiveTxt;
|
||||||
|
field.format = (att as CodeGenUploadAttribute).format;
|
||||||
|
field.multiple = (att as CodeGenUploadAttribute).multiple;
|
||||||
|
field.separator = (att as CodeGenUploadAttribute).separator;
|
||||||
|
field.__slot__ = (att as CodeGenUploadAttribute).__slot__.Adapt<SlotModel>();
|
||||||
|
field.props = (att as CodeGenUploadAttribute).props.Adapt<PropsModel>();
|
||||||
|
field.options = (att as CodeGenUploadAttribute).options;
|
||||||
|
field.propsValue = (att as CodeGenUploadAttribute).propsValue;
|
||||||
|
field.relationField = (att as CodeGenUploadAttribute).relationField;
|
||||||
|
field.modelId = (att as CodeGenUploadAttribute).modelId;
|
||||||
|
field.interfaceId = (att as CodeGenUploadAttribute).interfaceId;
|
||||||
|
field.selectType = (att as CodeGenUploadAttribute).selectType;
|
||||||
|
field.ableDepIds = (att as CodeGenUploadAttribute).ableDepIds;
|
||||||
|
field.ablePosIds = (att as CodeGenUploadAttribute).ablePosIds;
|
||||||
|
field.ableUserIds = (att as CodeGenUploadAttribute).ableUserIds;
|
||||||
|
field.ableRoleIds = (att as CodeGenUploadAttribute).ableRoleIds;
|
||||||
|
field.ableGroupIds = (att as CodeGenUploadAttribute).ableGroupIds;
|
||||||
|
field.ableIds = (att as CodeGenUploadAttribute).ableIds;
|
||||||
|
field.relational = (att as CodeGenUploadAttribute).showField;
|
||||||
configModel = (att as CodeGenUploadAttribute).__config__.Adapt<ConfigModel>();
|
configModel = (att as CodeGenUploadAttribute).__config__.Adapt<ConfigModel>();
|
||||||
configModel.label = string.Format("{0}({1})", configModel.label, field.__vModel__);
|
configModel.label = string.Format("{0}({1})", configModel.label, field.__vModel__);
|
||||||
field.__config__ = configModel;
|
field.__config__ = configModel;
|
||||||
@@ -660,78 +759,78 @@ public class ExportImportDataHelper : ITransient
|
|||||||
return new { dataRow = resData, headerRow = headerRow };
|
return new { dataRow = resData, headerRow = headerRow };
|
||||||
}
|
}
|
||||||
|
|
||||||
///// <summary>
|
/// <summary>
|
||||||
///// 导入数据.
|
/// 导入数据.
|
||||||
///// </summary>
|
/// </summary>
|
||||||
///// <param name="tInfo">模板信息.</param>
|
/// <param name="tInfo">模板信息.</param>
|
||||||
///// <param name="list">数据集合.</param>
|
/// <param name="list">数据集合.</param>
|
||||||
///// <returns>[成功列表,失败列表].</returns>
|
/// <returns>[成功列表,失败列表].</returns>
|
||||||
//public async Task<object[]> ImportMenuData(TemplateParsingBase tInfo, List<Dictionary<string, object>> list)
|
public async Task<object[]> ImportMenuData(TemplateParsingBase tInfo, List<Dictionary<string, object>> list)
|
||||||
//{
|
{
|
||||||
// List<Dictionary<string, object>> userInputList = ImportFirstVerify(tInfo, list);
|
List<Dictionary<string, object>> userInputList = ImportFirstVerify(tInfo, list);
|
||||||
// List<FieldsModel> fieldsModelList = tInfo.AllFieldsModel.Where(x => tInfo.selectKey.Contains(x.__vModel__)).ToList();
|
List<FieldsModel> fieldsModelList = tInfo.AllFieldsModel.Where(x => tInfo.selectKey.Contains(x.__vModel__)).ToList();
|
||||||
|
|
||||||
// var successList = new List<Dictionary<string, object>>();
|
var successList = new List<Dictionary<string, object>>();
|
||||||
// var errorsList = new List<Dictionary<string, object>>();
|
var errorsList = new List<Dictionary<string, object>>();
|
||||||
|
|
||||||
// // 捞取控件解析数据
|
// 捞取控件解析数据
|
||||||
// var cData = await GetCDataList(tInfo.AllFieldsModel, new Dictionary<string, List<Dictionary<string, string>>>());
|
var cData = await GetCDataList(tInfo.AllFieldsModel, new Dictionary<string, List<Dictionary<string, string>>>());
|
||||||
// var res = await ImportDataAssemble(fieldsModelList, userInputList, cData);
|
var res = await ImportDataAssemble(fieldsModelList, userInputList, cData);
|
||||||
// res.Where(x => x.ContainsKey("errorsInfo")).ToList().ForEach(item => errorsList.Add(item));
|
res.Where(x => x.ContainsKey("errorsInfo")).ToList().ForEach(item => errorsList.Add(item));
|
||||||
// res.Where(x => !x.ContainsKey("errorsInfo")).ToList().ForEach(item => successList.Add(item));
|
res.Where(x => !x.ContainsKey("errorsInfo")).ToList().ForEach(item => successList.Add(item));
|
||||||
|
|
||||||
// try
|
try
|
||||||
// {
|
{
|
||||||
// // 唯一验证已处理,入库前去掉.
|
// 唯一验证已处理,入库前去掉.
|
||||||
// tInfo.AllFieldsModel.Where(x => x.__config__.jnpfKey.Equals(JnpfKeyConst.COMINPUT) && x.__config__.unique).ToList().ForEach(item => item.__config__.unique = false);
|
tInfo.AllFieldsModel.Where(x => x.__config__.jnpfKey.Equals(JnpfKeyConst.COMINPUT) && x.__config__.unique).ToList().ForEach(item => item.__config__.unique = false);
|
||||||
// _sqlSugarClient.BeginTran();
|
_sqlSugarClient.BeginTran();
|
||||||
// foreach (var item in successList)
|
foreach (var item in successList)
|
||||||
// {
|
{
|
||||||
// if (item.ContainsKey("Update_MainTablePrimary_Id"))
|
if (item.ContainsKey("Update_MainTablePrimary_Id"))
|
||||||
// {
|
{
|
||||||
// string? mainId = item["Update_MainTablePrimary_Id"].ToString();
|
string? mainId = item["Update_MainTablePrimary_Id"].ToString();
|
||||||
// var haveTableSql = await _runService.GetUpdateSqlByTemplate(tInfo, new VisualDevModelDataUpInput() { data = item.ToJsonString() }, mainId);
|
var haveTableSql = await _runService.GetUpdateSqlByTemplate(tInfo, new VisualDevModelDataUpInput() { data = item.ToJsonString() }, mainId);
|
||||||
// foreach (var it in haveTableSql) await _databaseService.ExecuteSql(tInfo.DbLink, it); // 修改功能数据
|
foreach (var it in haveTableSql) await _databaseService.ExecuteSql(tInfo.DbLink, it); // 修改功能数据
|
||||||
// }
|
}
|
||||||
// else
|
else
|
||||||
// {
|
{
|
||||||
// if ((tInfo.visualDevEntity?.EnableFlow.Equals(1)).ParseToBool())
|
if ((tInfo.visualDevEntity?.EnableFlow.Equals(1)).ParseToBool())
|
||||||
// {
|
{
|
||||||
// var flowId = _repository.AsSugarClient().Queryable<WorkFlow.Entitys.Entity.FlowFormEntity>().First(x => x.Id.Equals(tInfo.visualDevEntity.Id)).FlowId;
|
var flowId = _repository.AsSugarClient().Queryable<WorkFlow.Entitys.Entity.FlowFormEntity>().First(x => x.Id.Equals(tInfo.visualDevEntity.Id)).FlowId;
|
||||||
// await _flowTaskService.Create(new Common.Models.WorkFlow.FlowTaskSubmitModel() { formData = item.ToJsonString(), flowId = flowId, flowUrgent = 1 });
|
await _flowTaskService.Create(new Common.Models.WorkFlow.FlowTaskSubmitModel() { formData = item, flowId = flowId, flowUrgent = 1, status = 1 });
|
||||||
// }
|
}
|
||||||
// else
|
else
|
||||||
// {
|
{
|
||||||
// string? mainId = YitIdHelper.NextId().ToString();
|
string? mainId = YitIdHelper.NextId().ToString();
|
||||||
// var haveTableSql = await _runService.GetCreateSqlByTemplate(tInfo, new VisualDevModelDataCrInput() { data = item.ToJsonString() }, mainId);
|
var haveTableSql = await _runService.GetCreateSqlByTemplate(tInfo, new VisualDevModelDataCrInput() { data = item.ToJsonString() }, mainId);
|
||||||
|
|
||||||
// // 主表自增长Id.
|
// 主表自增长Id.
|
||||||
// if (haveTableSql.ContainsKey("MainTableReturnIdentity"))
|
if (haveTableSql.ContainsKey("MainTableReturnIdentity"))
|
||||||
// {
|
{
|
||||||
// mainId = haveTableSql["MainTableReturnIdentity"].First().First().Value.ToString();
|
mainId = haveTableSql["MainTableReturnIdentity"].First().First().Value.ToString();
|
||||||
// haveTableSql.Remove("MainTableReturnIdentity");
|
haveTableSql.Remove("MainTableReturnIdentity");
|
||||||
// }
|
}
|
||||||
// foreach (var it in haveTableSql)
|
foreach (var it in haveTableSql)
|
||||||
// await _databaseService.ExecuteSql(tInfo.DbLink, it.Key, it.Value); // 新增功能数据
|
await _databaseService.ExecuteSql(tInfo.DbLink, it.Key, it.Value); // 新增功能数据
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
|
|
||||||
// _sqlSugarClient.CommitTran();
|
_sqlSugarClient.CommitTran();
|
||||||
// }
|
}
|
||||||
// catch (Exception e)
|
catch (Exception e)
|
||||||
// {
|
{
|
||||||
// _sqlSugarClient.RollbackTran();
|
_sqlSugarClient.RollbackTran();
|
||||||
// throw;
|
throw;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// errorsList.ForEach(item =>
|
errorsList.ForEach(item =>
|
||||||
// {
|
{
|
||||||
// if (item.ContainsKey("errorsInfo") && item["errorsInfo"].IsNotEmptyOrNull()) item["errorsInfo"] = item["errorsInfo"].ToString().TrimStart(',').TrimEnd(',');
|
if (item.ContainsKey("errorsInfo") && item["errorsInfo"].IsNotEmptyOrNull()) item["errorsInfo"] = item["errorsInfo"].ToString().TrimStart(',').TrimEnd(',');
|
||||||
// });
|
});
|
||||||
|
|
||||||
// return new object[] { successList, errorsList };
|
return new object[] { successList, errorsList };
|
||||||
//}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Excel 转输出 Model.
|
/// Excel 转输出 Model.
|
||||||
|
|||||||
@@ -21,8 +21,6 @@ using JNPF.VisualDev.Entitys;
|
|||||||
using JNPF.VisualDev.Entitys.Dto.CodeGen;
|
using JNPF.VisualDev.Entitys.Dto.CodeGen;
|
||||||
using JNPF.VisualDev.Entitys.Enum;
|
using JNPF.VisualDev.Entitys.Enum;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Org.BouncyCastle.Asn1.Crmf;
|
|
||||||
using Spire.Presentation;
|
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using System.IO.Compression;
|
using System.IO.Compression;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
@@ -300,6 +298,7 @@ public class CodeGenService : IDynamicApiController, ITransient
|
|||||||
|
|
||||||
// 统一处理下表单内控件
|
// 统一处理下表单内控件
|
||||||
controls = CodeGenUnifiedHandlerHelper.UnifiedHandlerFormDataModel(controls, pcColumnDesignModel, appColumnDesignModel);
|
controls = CodeGenUnifiedHandlerHelper.UnifiedHandlerFormDataModel(controls, pcColumnDesignModel, appColumnDesignModel);
|
||||||
|
controls = CodeGenUnifiedHandlerHelper.UnifiedHandlerControlRelationship(controls);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1462,7 +1462,7 @@ public class VisualDevService : IVisualDevService, IDynamicApiController, ITrans
|
|||||||
authList.Add(new ModuleDataAuthorizeEntity()
|
authList.Add(new ModuleDataAuthorizeEntity()
|
||||||
{
|
{
|
||||||
Id = SnowflakeIdHelper.NextId(),
|
Id = SnowflakeIdHelper.NextId(),
|
||||||
ConditionSymbol = "Included", // 条件符号
|
ConditionSymbol = "Equal", // 条件符号
|
||||||
Type = "varchar", // 字段类型
|
Type = "varchar", // 字段类型
|
||||||
FullName = item.__config__.label, // 字段说明
|
FullName = item.__config__.label, // 字段说明
|
||||||
ConditionText = "@userAraSubordinates", // 条件内容(当前用户及下属)
|
ConditionText = "@userAraSubordinates", // 条件内容(当前用户及下属)
|
||||||
@@ -1519,7 +1519,7 @@ public class VisualDevService : IVisualDevService, IDynamicApiController, ITrans
|
|||||||
authList.Add(new ModuleDataAuthorizeEntity()
|
authList.Add(new ModuleDataAuthorizeEntity()
|
||||||
{
|
{
|
||||||
Id = SnowflakeIdHelper.NextId(),
|
Id = SnowflakeIdHelper.NextId(),
|
||||||
ConditionSymbol = "Included", // 条件符号
|
ConditionSymbol = "Equal", // 条件符号
|
||||||
Type = "varchar", // 字段类型
|
Type = "varchar", // 字段类型
|
||||||
FullName = item.__config__.label, // 字段说明
|
FullName = item.__config__.label, // 字段说明
|
||||||
ConditionText = "@organizationAndSuborganization", // 条件内容(当前组织及组织)
|
ConditionText = "@organizationAndSuborganization", // 条件内容(当前组织及组织)
|
||||||
@@ -1558,7 +1558,7 @@ public class VisualDevService : IVisualDevService, IDynamicApiController, ITrans
|
|||||||
authList.Add(new ModuleDataAuthorizeEntity()
|
authList.Add(new ModuleDataAuthorizeEntity()
|
||||||
{
|
{
|
||||||
Id = SnowflakeIdHelper.NextId(),
|
Id = SnowflakeIdHelper.NextId(),
|
||||||
ConditionSymbol = "Included", // 条件符号
|
ConditionSymbol = "Equal", // 条件符号
|
||||||
Type = "varchar", // 字段类型
|
Type = "varchar", // 字段类型
|
||||||
FullName = item.__config__.label, // 字段说明
|
FullName = item.__config__.label, // 字段说明
|
||||||
ConditionText = "@branchManageOrganize", // 条件内容(当前分管组织)
|
ConditionText = "@branchManageOrganize", // 条件内容(当前分管组织)
|
||||||
@@ -1576,7 +1576,7 @@ public class VisualDevService : IVisualDevService, IDynamicApiController, ITrans
|
|||||||
authList.Add(new ModuleDataAuthorizeEntity()
|
authList.Add(new ModuleDataAuthorizeEntity()
|
||||||
{
|
{
|
||||||
Id = SnowflakeIdHelper.NextId(),
|
Id = SnowflakeIdHelper.NextId(),
|
||||||
ConditionSymbol = "Included", // 条件符号
|
ConditionSymbol = "Equal", // 条件符号
|
||||||
Type = "varchar", // 字段类型
|
Type = "varchar", // 字段类型
|
||||||
FullName = item.__config__.label, // 字段说明
|
FullName = item.__config__.label, // 字段说明
|
||||||
ConditionText = "@branchManageOrganizeAndSub", // 条件内容(当前分管组织及子组织)
|
ConditionText = "@branchManageOrganizeAndSub", // 条件内容(当前分管组织及子组织)
|
||||||
@@ -1623,11 +1623,11 @@ public class VisualDevService : IVisualDevService, IDynamicApiController, ITrans
|
|||||||
|| x.FullName == "当前用户及下属" || x.FullName == "当前组织及子组织"
|
|| x.FullName == "当前用户及下属" || x.FullName == "当前组织及子组织"
|
||||||
|| x.FullName == "当前分管组织" || x.FullName == "当前分管组织及子组织")
|
|| x.FullName == "当前分管组织" || x.FullName == "当前分管组织及子组织")
|
||||||
.Where(x => x.ConditionJson.Contains("\"op\":\"Equal\",\"value\":\"@userId\"")
|
.Where(x => x.ConditionJson.Contains("\"op\":\"Equal\",\"value\":\"@userId\"")
|
||||||
|| x.ConditionJson.Contains("\"op\":\"Included\",\"value\":\"@userAraSubordinates\"")
|
|| x.ConditionJson.Contains("\"op\":\"Equal\",\"value\":\"@userAraSubordinates\"")
|
||||||
|| x.ConditionJson.Contains("\"op\":\"Equal\",\"value\":\"@organizeId\"")
|
|| x.ConditionJson.Contains("\"op\":\"Equal\",\"value\":\"@organizeId\"")
|
||||||
|| x.ConditionJson.Contains("\"op\":\"Included\",\"value\":\"@organizationAndSuborganization\"")
|
|| x.ConditionJson.Contains("\"op\":\"Equal\",\"value\":\"@organizationAndSuborganization\"")
|
||||||
|| x.ConditionJson.Contains("\"op\":\"Included\",\"value\":\"@branchManageOrganize\"")
|
|| x.ConditionJson.Contains("\"op\":\"Equal\",\"value\":\"@branchManageOrganize\"")
|
||||||
|| x.ConditionJson.Contains("\"op\":\"Included\",\"value\":\"@branchManageOrganizeAndSub\""))
|
|| x.ConditionJson.Contains("\"op\":\"Equal\",\"value\":\"@branchManageOrganizeAndSub\""))
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
List<ModuleDataAuthorizeSchemeEntity>? authSchemeList = new List<ModuleDataAuthorizeSchemeEntity>(); // 方案管理
|
List<ModuleDataAuthorizeSchemeEntity>? authSchemeList = new List<ModuleDataAuthorizeSchemeEntity>(); // 方案管理
|
||||||
@@ -1668,16 +1668,16 @@ public class VisualDevService : IVisualDevService, IDynamicApiController, ITrans
|
|||||||
|
|
||||||
model = authList.FirstOrDefault(x => x.EnCode == item.__vModel__ && x.ConditionText.Equals("@userAraSubordinates"));
|
model = authList.FirstOrDefault(x => x.EnCode == item.__vModel__ && x.ConditionText.Equals("@userAraSubordinates"));
|
||||||
condJson.groups.First().id = model.Id;
|
condJson.groups.First().id = model.Id;
|
||||||
condJson.groups.First().op = "Included";
|
condJson.groups.First().op = "Equal";
|
||||||
condJson.groups.First().value = "@userAraSubordinates";
|
condJson.groups.First().value = "@userAraSubordinates";
|
||||||
if (!oldDataAuthScheme.Any(x => x.ConditionText == "【{" + item.__config__.label + "} {包含} {@userAraSubordinates}】"))
|
if (!oldDataAuthScheme.Any(x => x.ConditionText == "【{" + item.__config__.label + "} {等于} {@userAraSubordinates}】"))
|
||||||
{
|
{
|
||||||
authSchemeList.Add(new ModuleDataAuthorizeSchemeEntity()
|
authSchemeList.Add(new ModuleDataAuthorizeSchemeEntity()
|
||||||
{
|
{
|
||||||
FullName = "当前用户及下属",
|
FullName = "当前用户及下属",
|
||||||
EnCode = SnowflakeIdHelper.NextId(),
|
EnCode = SnowflakeIdHelper.NextId(),
|
||||||
SortCode = -9527,
|
SortCode = -9527,
|
||||||
ConditionText = "【{" + item.__config__.label + "} {包含} {@userAraSubordinates}】",
|
ConditionText = "【{" + item.__config__.label + "} {等于} {@userAraSubordinates}】",
|
||||||
ConditionJson = new List<AuthorizeModuleResourceConditionModelInput>() { condJson }.ToJsonString(),
|
ConditionJson = new List<AuthorizeModuleResourceConditionModelInput>() { condJson }.ToJsonString(),
|
||||||
ModuleId = menuId
|
ModuleId = menuId
|
||||||
});
|
});
|
||||||
@@ -1685,14 +1685,14 @@ public class VisualDevService : IVisualDevService, IDynamicApiController, ITrans
|
|||||||
|
|
||||||
// 删除
|
// 删除
|
||||||
//List<ModuleDataAuthorizeSchemeEntity>? delData = oldDataAuthScheme.Where(x => x.EnCode != item.__vModel__
|
//List<ModuleDataAuthorizeSchemeEntity>? delData = oldDataAuthScheme.Where(x => x.EnCode != item.__vModel__
|
||||||
//&& (x.ConditionJson.Contains("\"op\":\"Equal\",\"value\":\"@userId\"") || x.ConditionJson.Contains("\"op\":\"Included\",\"value\":\"@userAraSubordinates\""))).ToList();
|
//&& (x.ConditionJson.Contains("\"op\":\"Equal\",\"value\":\"@userId\"") || x.ConditionJson.Contains("\"op\":\"Equal\",\"value\":\"@userAraSubordinates\""))).ToList();
|
||||||
//await _visualDevRepository.AsSugarClient().Deleteable(delData).ExecuteCommandAsync();
|
//await _visualDevRepository.AsSugarClient().Deleteable(delData).ExecuteCommandAsync();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// 删除
|
// 删除
|
||||||
List<ModuleDataAuthorizeSchemeEntity>? delData = oldDataAuthScheme
|
List<ModuleDataAuthorizeSchemeEntity>? delData = oldDataAuthScheme
|
||||||
.Where(x => x.ConditionJson.Contains("\"op\":\"Equal\",\"value\":\"@userId\"") || x.ConditionJson.Contains("\"op\":\"Included\",\"value\":\"@userAraSubordinates\"")).ToList();
|
.Where(x => x.ConditionJson.Contains("\"op\":\"Equal\",\"value\":\"@userId\"") || x.ConditionJson.Contains("\"op\":\"Equal\",\"value\":\"@userAraSubordinates\"")).ToList();
|
||||||
await _visualDevRepository.AsSugarClient().Deleteable(delData).ExecuteCommandAsync();
|
await _visualDevRepository.AsSugarClient().Deleteable(delData).ExecuteCommandAsync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1700,7 +1700,7 @@ public class VisualDevService : IVisualDevService, IDynamicApiController, ITrans
|
|||||||
{
|
{
|
||||||
// 删除
|
// 删除
|
||||||
List<ModuleDataAuthorizeSchemeEntity>? delData = oldDataAuthScheme
|
List<ModuleDataAuthorizeSchemeEntity>? delData = oldDataAuthScheme
|
||||||
.Where(x => x.ConditionJson.Contains("\"op\":\"Equal\",\"value\":\"@userId\"") || x.ConditionJson.Contains("\"op\":\"Included\",\"value\":\"@userAraSubordinates\"")).ToList();
|
.Where(x => x.ConditionJson.Contains("\"op\":\"Equal\",\"value\":\"@userId\"") || x.ConditionJson.Contains("\"op\":\"Equal\",\"value\":\"@userAraSubordinates\"")).ToList();
|
||||||
await _visualDevRepository.AsSugarClient().Deleteable(delData).ExecuteCommandAsync();
|
await _visualDevRepository.AsSugarClient().Deleteable(delData).ExecuteCommandAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1735,16 +1735,16 @@ public class VisualDevService : IVisualDevService, IDynamicApiController, ITrans
|
|||||||
|
|
||||||
model = authList.FirstOrDefault(x => x.EnCode == item.__vModel__ && x.ConditionText.Equals("@organizationAndSuborganization"));
|
model = authList.FirstOrDefault(x => x.EnCode == item.__vModel__ && x.ConditionText.Equals("@organizationAndSuborganization"));
|
||||||
condJson.groups.First().id = model.Id;
|
condJson.groups.First().id = model.Id;
|
||||||
condJson.groups.First().op = "Included";
|
condJson.groups.First().op = "Equal";
|
||||||
condJson.groups.First().value = "@organizationAndSuborganization";
|
condJson.groups.First().value = "@organizationAndSuborganization";
|
||||||
if (!oldDataAuthScheme.Any(x => x.ConditionText == "【{" + item.__config__.label + "} {包含} {@organizationAndSuborganization}】"))
|
if (!oldDataAuthScheme.Any(x => x.ConditionText == "【{" + item.__config__.label + "} {等于} {@organizationAndSuborganization}】"))
|
||||||
{
|
{
|
||||||
authSchemeList.Add(new ModuleDataAuthorizeSchemeEntity()
|
authSchemeList.Add(new ModuleDataAuthorizeSchemeEntity()
|
||||||
{
|
{
|
||||||
FullName = "当前组织及子组织",
|
FullName = "当前组织及子组织",
|
||||||
EnCode = SnowflakeIdHelper.NextId(),
|
EnCode = SnowflakeIdHelper.NextId(),
|
||||||
SortCode = -9527,
|
SortCode = -9527,
|
||||||
ConditionText = "【{" + item.__config__.label + "} {包含} {@organizationAndSuborganization}】",
|
ConditionText = "【{" + item.__config__.label + "} {等于} {@organizationAndSuborganization}】",
|
||||||
ConditionJson = new List<AuthorizeModuleResourceConditionModelInput>() { condJson }.ToJsonString(),
|
ConditionJson = new List<AuthorizeModuleResourceConditionModelInput>() { condJson }.ToJsonString(),
|
||||||
ModuleId = menuId
|
ModuleId = menuId
|
||||||
});
|
});
|
||||||
@@ -1752,14 +1752,14 @@ public class VisualDevService : IVisualDevService, IDynamicApiController, ITrans
|
|||||||
|
|
||||||
// 删除
|
// 删除
|
||||||
//List<ModuleDataAuthorizeSchemeEntity>? delData = oldDataAuthScheme.Where(x => x.EnCode != item.__vModel__
|
//List<ModuleDataAuthorizeSchemeEntity>? delData = oldDataAuthScheme.Where(x => x.EnCode != item.__vModel__
|
||||||
//&& (x.ConditionJson.Contains("\"op\":\"Equal\",\"value\":\"@organizeId\"") || x.ConditionJson.Contains("\"op\":\"Included\",\"value\":\"@organizationAndSuborganization\""))).ToList();
|
//&& (x.ConditionJson.Contains("\"op\":\"Equal\",\"value\":\"@organizeId\"") || x.ConditionJson.Contains("\"op\":\"Equal\",\"value\":\"@organizationAndSuborganization\""))).ToList();
|
||||||
//await _visualDevRepository.AsSugarClient().Deleteable(delData).ExecuteCommandAsync();
|
//await _visualDevRepository.AsSugarClient().Deleteable(delData).ExecuteCommandAsync();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// 删除
|
// 删除
|
||||||
List<ModuleDataAuthorizeSchemeEntity>? delData = oldDataAuthScheme
|
List<ModuleDataAuthorizeSchemeEntity>? delData = oldDataAuthScheme
|
||||||
.Where(x => x.ConditionJson.Contains("\"op\":\"Equal\",\"value\":\"@organizeId\"") || x.ConditionJson.Contains("\"op\":\"Included\",\"value\":\"@organizationAndSuborganization\"")).ToList();
|
.Where(x => x.ConditionJson.Contains("\"op\":\"Equal\",\"value\":\"@organizeId\"") || x.ConditionJson.Contains("\"op\":\"Equal\",\"value\":\"@organizationAndSuborganization\"")).ToList();
|
||||||
await _visualDevRepository.AsSugarClient().Deleteable(delData).ExecuteCommandAsync();
|
await _visualDevRepository.AsSugarClient().Deleteable(delData).ExecuteCommandAsync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1767,7 +1767,7 @@ public class VisualDevService : IVisualDevService, IDynamicApiController, ITrans
|
|||||||
{
|
{
|
||||||
// 删除
|
// 删除
|
||||||
List<ModuleDataAuthorizeSchemeEntity>? delData = oldDataAuthScheme
|
List<ModuleDataAuthorizeSchemeEntity>? delData = oldDataAuthScheme
|
||||||
.Where(x => x.ConditionJson.Contains("\"op\":\"Equal\",\"value\":\"@organizeId\"") || x.ConditionJson.Contains("\"op\":\"Included\",\"value\":\"@organizationAndSuborganization\"")).ToList();
|
.Where(x => x.ConditionJson.Contains("\"op\":\"Equal\",\"value\":\"@organizeId\"") || x.ConditionJson.Contains("\"op\":\"Equal\",\"value\":\"@organizationAndSuborganization\"")).ToList();
|
||||||
await _visualDevRepository.AsSugarClient().Deleteable(delData).ExecuteCommandAsync();
|
await _visualDevRepository.AsSugarClient().Deleteable(delData).ExecuteCommandAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1783,18 +1783,18 @@ public class VisualDevService : IVisualDevService, IDynamicApiController, ITrans
|
|||||||
condJson.groups.First().bindTable = model.BindTable;
|
condJson.groups.First().bindTable = model.BindTable;
|
||||||
condJson.groups.First().field = item.__vModel__;
|
condJson.groups.First().field = item.__vModel__;
|
||||||
condJson.groups.First().fieldRule = model.FieldRule.ParseToInt();
|
condJson.groups.First().fieldRule = model.FieldRule.ParseToInt();
|
||||||
condJson.groups.First().op = "Included";
|
condJson.groups.First().op = "Equal";
|
||||||
condJson.groups.First().value = "@branchManageOrganize";
|
condJson.groups.First().value = "@branchManageOrganize";
|
||||||
|
|
||||||
// 新增
|
// 新增
|
||||||
if (!oldDataAuthScheme.Any(x => x.ConditionText == "【{" + item.__config__.label + "} {包含} {@branchManageOrganize}】"))
|
if (!oldDataAuthScheme.Any(x => x.ConditionText == "【{" + item.__config__.label + "} {等于} {@branchManageOrganize}】"))
|
||||||
{
|
{
|
||||||
authSchemeList.Add(new ModuleDataAuthorizeSchemeEntity()
|
authSchemeList.Add(new ModuleDataAuthorizeSchemeEntity()
|
||||||
{
|
{
|
||||||
FullName = "当前分管组织",
|
FullName = "当前分管组织",
|
||||||
EnCode = SnowflakeIdHelper.NextId(),
|
EnCode = SnowflakeIdHelper.NextId(),
|
||||||
SortCode = -9527,
|
SortCode = -9527,
|
||||||
ConditionText = "【{" + item.__config__.label + "} {包含} {@branchManageOrganize}】",
|
ConditionText = "【{" + item.__config__.label + "} {等于} {@branchManageOrganize}】",
|
||||||
ConditionJson = new List<AuthorizeModuleResourceConditionModelInput>() { condJson }.ToJsonString(),
|
ConditionJson = new List<AuthorizeModuleResourceConditionModelInput>() { condJson }.ToJsonString(),
|
||||||
ModuleId = menuId
|
ModuleId = menuId
|
||||||
});
|
});
|
||||||
@@ -1802,16 +1802,16 @@ public class VisualDevService : IVisualDevService, IDynamicApiController, ITrans
|
|||||||
|
|
||||||
model = authList.FirstOrDefault(x => x.EnCode == item.__vModel__ && x.ConditionText.Equals("@branchManageOrganizeAndSub"));
|
model = authList.FirstOrDefault(x => x.EnCode == item.__vModel__ && x.ConditionText.Equals("@branchManageOrganizeAndSub"));
|
||||||
condJson.groups.First().id = model.Id;
|
condJson.groups.First().id = model.Id;
|
||||||
condJson.groups.First().op = "Included";
|
condJson.groups.First().op = "Equal";
|
||||||
condJson.groups.First().value = "@branchManageOrganizeAndSub";
|
condJson.groups.First().value = "@branchManageOrganizeAndSub";
|
||||||
if (!oldDataAuthScheme.Any(x => x.ConditionText == "【{" + item.__config__.label + "} {包含} {@branchManageOrganizeAndSub}】"))
|
if (!oldDataAuthScheme.Any(x => x.ConditionText == "【{" + item.__config__.label + "} {等于} {@branchManageOrganizeAndSub}】"))
|
||||||
{
|
{
|
||||||
authSchemeList.Add(new ModuleDataAuthorizeSchemeEntity()
|
authSchemeList.Add(new ModuleDataAuthorizeSchemeEntity()
|
||||||
{
|
{
|
||||||
FullName = "当前分管组织及子组织",
|
FullName = "当前分管组织及子组织",
|
||||||
EnCode = SnowflakeIdHelper.NextId(),
|
EnCode = SnowflakeIdHelper.NextId(),
|
||||||
SortCode = -9527,
|
SortCode = -9527,
|
||||||
ConditionText = "【{" + item.__config__.label + "} {包含} {@branchManageOrganizeAndSub}】",
|
ConditionText = "【{" + item.__config__.label + "} {等于} {@branchManageOrganizeAndSub}】",
|
||||||
ConditionJson = new List<AuthorizeModuleResourceConditionModelInput>() { condJson }.ToJsonString(),
|
ConditionJson = new List<AuthorizeModuleResourceConditionModelInput>() { condJson }.ToJsonString(),
|
||||||
ModuleId = menuId
|
ModuleId = menuId
|
||||||
});
|
});
|
||||||
@@ -1819,14 +1819,14 @@ public class VisualDevService : IVisualDevService, IDynamicApiController, ITrans
|
|||||||
|
|
||||||
// 删除
|
// 删除
|
||||||
//List<ModuleDataAuthorizeSchemeEntity>? delData = oldDataAuthScheme.Where(x => x.EnCode != item.__vModel__
|
//List<ModuleDataAuthorizeSchemeEntity>? delData = oldDataAuthScheme.Where(x => x.EnCode != item.__vModel__
|
||||||
//&& (x.ConditionJson.Contains("\"op\":\"Included\",\"value\":\"@branchManageOrganize\"") || x.ConditionJson.Contains("\"op\":\"Included\",\"value\":\"@branchManageOrganizeAndSub\""))).ToList();
|
//&& (x.ConditionJson.Contains("\"op\":\"Equal\",\"value\":\"@branchManageOrganize\"") || x.ConditionJson.Contains("\"op\":\"Equal\",\"value\":\"@branchManageOrganizeAndSub\""))).ToList();
|
||||||
//await _visualDevRepository.AsSugarClient().Deleteable(delData).ExecuteCommandAsync();
|
//await _visualDevRepository.AsSugarClient().Deleteable(delData).ExecuteCommandAsync();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// 删除
|
// 删除
|
||||||
List<ModuleDataAuthorizeSchemeEntity>? delData = oldDataAuthScheme
|
List<ModuleDataAuthorizeSchemeEntity>? delData = oldDataAuthScheme
|
||||||
.Where(x => x.ConditionJson.Contains("\"op\":\"Included\",\"value\":\"@branchManageOrganize\"") || x.ConditionJson.Contains("\"op\":\"Included\",\"value\":\"@branchManageOrganizeAndSub\"")).ToList();
|
.Where(x => x.ConditionJson.Contains("\"op\":\"Equal\",\"value\":\"@branchManageOrganize\"") || x.ConditionJson.Contains("\"op\":\"Equal\",\"value\":\"@branchManageOrganizeAndSub\"")).ToList();
|
||||||
await _visualDevRepository.AsSugarClient().Deleteable(delData).ExecuteCommandAsync();
|
await _visualDevRepository.AsSugarClient().Deleteable(delData).ExecuteCommandAsync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1834,7 +1834,7 @@ public class VisualDevService : IVisualDevService, IDynamicApiController, ITrans
|
|||||||
{
|
{
|
||||||
// 删除
|
// 删除
|
||||||
List<ModuleDataAuthorizeSchemeEntity>? delData = oldDataAuthScheme
|
List<ModuleDataAuthorizeSchemeEntity>? delData = oldDataAuthScheme
|
||||||
.Where(x => x.ConditionJson.Contains("\"op\":\"Included\",\"value\":\"@branchManageOrganize\"") || x.ConditionJson.Contains("\"op\":\"Included\",\"value\":\"@branchManageOrganizeAndSub\"")).ToList();
|
.Where(x => x.ConditionJson.Contains("\"op\":\"Equal\",\"value\":\"@branchManageOrganize\"") || x.ConditionJson.Contains("\"op\":\"Equal\",\"value\":\"@branchManageOrganizeAndSub\"")).ToList();
|
||||||
await _visualDevRepository.AsSugarClient().Deleteable(delData).ExecuteCommandAsync();
|
await _visualDevRepository.AsSugarClient().Deleteable(delData).ExecuteCommandAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -220,7 +220,8 @@ public class FlowTaskRepository : IFlowTaskRepository, ITransient
|
|||||||
flowUrgent = a.FlowUrgent,
|
flowUrgent = a.FlowUrgent,
|
||||||
startTime = a.CreatorTime,
|
startTime = a.CreatorTime,
|
||||||
completion = a.Completion,
|
completion = a.Completion,
|
||||||
nodeName = b.NodeName
|
nodeName = b.NodeName,
|
||||||
|
templateId = a.TemplateId,
|
||||||
});
|
});
|
||||||
|
|
||||||
// 委托审核
|
// 委托审核
|
||||||
@@ -251,7 +252,8 @@ public class FlowTaskRepository : IFlowTaskRepository, ITransient
|
|||||||
flowUrgent = a.FlowUrgent,
|
flowUrgent = a.FlowUrgent,
|
||||||
startTime = a.CreatorTime,
|
startTime = a.CreatorTime,
|
||||||
completion = a.Completion,
|
completion = a.Completion,
|
||||||
nodeName = b.NodeName
|
nodeName = b.NodeName,
|
||||||
|
templateId = a.TemplateId,
|
||||||
});
|
});
|
||||||
var output = await _repository.AsSugarClient().UnionAll(list1, list2).Where(whereLambda).MergeTable().OrderBy(x => x.creatorTime, OrderByType.Desc).ToPagedListAsync(input.currentPage, input.pageSize);
|
var output = await _repository.AsSugarClient().UnionAll(list1, list2).Where(whereLambda).MergeTable().OrderBy(x => x.creatorTime, OrderByType.Desc).ToPagedListAsync(input.currentPage, input.pageSize);
|
||||||
return PageResult<FlowBeforeListOutput>.SqlSugarPageResult(output);
|
return PageResult<FlowBeforeListOutput>.SqlSugarPageResult(output);
|
||||||
|
|||||||
Reference in New Issue
Block a user