diff --git a/BasicData/Tnb.BasicData.Entities/Entity/ThirdWebapiRecord.cs b/BasicData/Tnb.BasicData.Entities/Entity/ThirdWebapiRecord.cs index 9dba0ee4..e1e1bfa3 100644 --- a/BasicData/Tnb.BasicData.Entities/Entity/ThirdWebapiRecord.cs +++ b/BasicData/Tnb.BasicData.Entities/Entity/ThirdWebapiRecord.cs @@ -4,7 +4,7 @@ using SqlSugar; namespace Tnb.BasicData.Entities { /// - /// 工位资料 + /// 第三方接口请求记录 /// [SugarTable("third_webapi_record")] public class ThirdWebapiRecord : BaseEntity @@ -48,16 +48,16 @@ namespace Tnb.BasicData.Entities /// 响应时长 /// public long response_time { get; set; } - + /// /// 是否发送 0 否 1是 /// - public int is_send { get; set; } - + public int is_send { get; set; } = 1; + /// - /// 状态 0 失败 1 成功 + /// 状态 0 失败或未发送 1 成功 /// - public int status { get; set; } + public int status { get; set; } = 0; /// /// 发送成功时类型 自动 手动 diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/ErpExtendField.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/ErpExtendField.cs index fff0a467..2133e2b0 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/ErpExtendField.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/ErpExtendField.cs @@ -35,6 +35,8 @@ namespace Tnb.ProductionMgr.Entities.Entity /// public string erp_line_pk { get; set; } + public string user_id { get; set; } + public DateTime create_time { get; set; } } } \ No newline at end of file diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/WmsWareHouseConst.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/WmsWareHouseConst.cs index 2714e0e4..7e914de2 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/WmsWareHouseConst.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/WmsWareHouseConst.cs @@ -464,6 +464,15 @@ /// 血路管自动生产线2线 /// public const string XUELUGUAN2XIAN = "25966313322789"; - + + /// + /// 第三方 bip + /// + public const string BIP = "BIP"; + + /// + /// 第三方 bip + /// + public const string BIP_DOMAIN = "http://192.168.1.11:8087/"; } } diff --git a/system/Tnb.Systems/Common/TestService.cs b/system/Tnb.Systems/Common/TestService.cs index 344ffb29..c8786b91 100644 --- a/system/Tnb.Systems/Common/TestService.cs +++ b/system/Tnb.Systems/Common/TestService.cs @@ -1,4 +1,8 @@ -using JNPF.Common.Core.Manager; +using JNPF.Common.Const; +using JNPF.Common.Contracts; +using JNPF.Common.Core.Manager; +using JNPF.Common.Security; +using JNPF.DataEncryption; using JNPF.DependencyInjection; using JNPF.DynamicApiController; using JNPF.JsonSerialization; @@ -7,7 +11,9 @@ using JNPF.Systems.Entitys.Permission; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Cors; using Microsoft.AspNetCore.Mvc; +using Npgsql.TypeHandlers; using SqlSugar; +using Tnb.ProductionMgr.Entities.Entity; namespace JNPF.Systems.Common; @@ -89,5 +95,60 @@ public class TestService : IDynamicApiController, ITransient { return "测试成功"; } + + [HttpGet] + [AllowAnonymous] + public async Task insertUser() + { + List users = _sugar.Queryable().ToList(); + List insertUsers = new List(); + List insertUserRelations = new List(); + List insertErpExtendFields = new List(); + foreach (var user in users) + { + UserEntity userEntity = new UserEntity(); + userEntity.Id = SnowflakeIdHelper.NextId(); + userEntity.Account = user.code; + userEntity.RealName = user.name; + userEntity.Gender = 1; + userEntity.OrganizeId = "25193668006933"; + userEntity.RoleId = "30327535942933"; + userEntity.Secretkey = Guid.NewGuid().ToString(); + userEntity.Password = MD5Encryption.Encrypt(MD5Encryption.Encrypt(CommonConst.DEFAULTPASSWORD) + userEntity.Secretkey); + userEntity.EntryDate = DateTime.Now; + userEntity.EnabledMark = 1; + userEntity.CreatorTime = DateTime.Now; + insertUsers.Add(userEntity); + + UserRelationEntity userRelationEntity = new UserRelationEntity(); + userRelationEntity.Id = SnowflakeIdHelper.NextId(); + userRelationEntity.UserId = userEntity.Id; + userRelationEntity.ObjectType = "Role"; + userRelationEntity.ObjectId = "30327535942933"; + userRelationEntity.CreatorTime = DateTime.Now; + insertUserRelations.Add(userRelationEntity); + + ErpExtendField extendField = new ErpExtendField(); + extendField.id = SnowflakeIdHelper.NextId(); + extendField.org_id = "25398501929509"; + extendField.table_name = "base_user"; + extendField.table_id = userEntity.Id; + extendField.user_id = user.id; + insertErpExtendFields.Add(extendField); + } + + await _sugar.Insertable(insertUsers).ExecuteCommandAsync(); + await _sugar.Insertable(insertUserRelations).ExecuteCommandAsync(); + await _sugar.Insertable(insertErpExtendFields).ExecuteCommandAsync(); + return "测试成功"; + } + + + [SugarTable("temp_erp_user")] + public class TempErpUser : BaseEntity + { + public string code { get; set; } + public string name { get; set; } + } }