1
This commit is contained in:
@@ -3,6 +3,7 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using JNPF.Common.Security;
|
using JNPF.Common.Security;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
using Yitter.IdGenerator;
|
||||||
|
|
||||||
namespace Tnb.BasicData.Entities
|
namespace Tnb.BasicData.Entities
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -601,6 +601,7 @@ public class DataBaseService : IDynamicApiController, ITransient
|
|||||||
List<string> dirs = new List<string>();
|
List<string> dirs = new List<string>();
|
||||||
foreach (string key in nsMapper.Keys)
|
foreach (string key in nsMapper.Keys)
|
||||||
{
|
{
|
||||||
|
if (key != "eqp_") continue;
|
||||||
var nsName = nsMapper[key];
|
var nsName = nsMapper[key];
|
||||||
var dir = Path.Combine(FileVariable.GenerateCodePath, nsName);
|
var dir = Path.Combine(FileVariable.GenerateCodePath, nsName);
|
||||||
dirs.Add(dir);
|
dirs.Add(dir);
|
||||||
@@ -661,7 +662,11 @@ public class DataBaseService : IDynamicApiController, ITransient
|
|||||||
if (sugarAttrs.Count > 0)
|
if (sugarAttrs.Count > 0)
|
||||||
sugarColumnStr = $"\r\n [SugarColumn({string.Join(", ", sugarAttrs)})]";
|
sugarColumnStr = $"\r\n [SugarColumn({string.Join(", ", sugarAttrs)})]";
|
||||||
var txt = tpl.Replace("{PropertyType}", type).Replace("{PropertyName}", col.DbColumnName).Replace("{SugarColumn}", sugarColumnStr);
|
var txt = tpl.Replace("{PropertyType}", type).Replace("{PropertyName}", col.DbColumnName).Replace("{SugarColumn}", sugarColumnStr);
|
||||||
if (col.DbColumnName == "id") txt = txt.TrimEnd('\n', '\r') + " = SnowflakeIdHelper.NextId();\r\n";
|
if (col.DbColumnName == "id")
|
||||||
|
{
|
||||||
|
if(type == "string") txt = txt.TrimEnd('\n', '\r') + " = SnowflakeIdHelper.NextId();\r\n";
|
||||||
|
else if(type == "long") txt = txt.TrimEnd('\n', '\r') + " = YitIdHelper.NextId();\r\n";
|
||||||
|
}
|
||||||
else if (type == "string") txt = txt.TrimEnd('\n', '\r') + " = string.Empty;\r\n";
|
else if (type == "string") txt = txt.TrimEnd('\n', '\r') + " = string.Empty;\r\n";
|
||||||
return txt;
|
return txt;
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user