Browse Source

设备中心数据上传

master
肖正 5 months ago
parent
commit
179726379a
  1. 1
      Admin.Bodk.Device/Entities/Dto/SupportDto.cs
  2. 4
      Admin.Bodk.Device/Services/DeviceService.cs
  3. 8
      Admin.Bodk.Device/Services/SupportService.cs
  4. 5
      Admin.NET.Core/SeedData/SysRoleMenuSeedData.cs
  5. 7
      Admin.NET.Core/SeedData/SysUserSeedData.cs
  6. 3
      Admin.NET.Core/Service/Role/SysRoleService.cs
  7. BIN
      Admin.NET.Web.Entry/Admin.NET.db

1
Admin.Bodk.Device/Entities/Dto/SupportDto.cs

@ -27,6 +27,7 @@ public class SupportOutput
public class CellOutput
{
public string Code { get; set; }
public string Activity { get; set; }
public double Temperature { get; set; }
public string Humidity { get; set; }

4
Admin.Bodk.Device/Services/DeviceService.cs

@ -7,6 +7,8 @@ using Furion.DependencyInjection;
using Furion.DynamicApiController;
using Furion.FriendlyException;
using Mapster;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using SqlSugar;
@ -34,6 +36,8 @@ public class DeviceService : IDynamicApiController, ITransient
/// <param name="input"></param>
/// <returns></returns>
[DisplayName("获取设备列表")]
[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme + "," + SignatureAuthenticationDefaults.AuthenticationScheme)]
public async Task<SqlSugarPagedList<EquipmentDto>> PostList(DeviceInpt input)
{
return await _repository.AsQueryable()

8
Admin.Bodk.Device/Services/SupportService.cs

@ -54,12 +54,12 @@ public class SupportService: IDynamicApiController, ITransient
public async Task<SqlSugarPagedList<CellOutput>> PostGetCellList(BaseInput input)
{
List<CellOutput> items = new List<CellOutput>();
items.Add( new CellOutput() {Activity="51%",Temperature = -192.5, Humidity = "12.1%",
Density="20个/ml", Capacity="200ml", Type= 1, Location="松山湖",LastOperationTime=null,
items.Add( new CellOutput() {Code="BT00D0015314A",Activity="98%",Temperature = -192.5, Humidity = "0.5%",
Density="1*10^7个/ml", Capacity="1.8ml", Type= 1, Location="松山湖",LastOperationTime=null,
DeviceInfo=new DeviceInfo()
{
DeviceId=23223232,PicUrl="",LiquidNitrogenHeight=302,Temperature=-195.2,
Humidity="10%",Address="广东省东莞市科技二路与科技一路交叉口西北角宏远·新智汇1栋",
DeviceId=23223232,PicUrl="",LiquidNitrogenHeight=180,Temperature=-195.2,
Humidity="0.5%",Address="广东省东莞市松山湖园区科技二路宏远新智汇1栋",
Name="M9_01",CellBaseInfo=new CellBaseInfo(){BaseName="松山湖",BaseId=13545}
}
});

5
Admin.NET.Core/SeedData/SysRoleMenuSeedData.cs

@ -15,9 +15,10 @@ public class SysRoleMenuSeedData : ISqlSugarEntitySeedData<SysRoleMenu>
return new[]
{
// 数据面板【admin/1300000000101】
new SysRoleMenu{ Id=1300000000101, RoleId=1300000000101, MenuId=1300000000101 },
new SysRoleMenu{ Id=1300000000101, RoleId=1300000000101, MenuId=35482331532101 },
new SysRoleMenu{ Id=1300000000102, RoleId=1300000000101, MenuId=1300000000111 },
new SysRoleMenu{ Id=1300000000103, RoleId=1300000000101, MenuId=1300000000121 },
new SysRoleMenu{ Id=1300000000103, RoleId=1300000000101, MenuId=35397279041861 },
new SysRoleMenu{ Id=1300000000104, RoleId=1300000000101, MenuId=35571166242117 },
// 系统管理
new SysRoleMenu{ Id=1300000000111, RoleId=1300000000101, MenuId=1310000000101 },

7
Admin.NET.Core/SeedData/SysUserSeedData.cs

@ -1,13 +1,10 @@
// 大名科技(天津)有限公司版权所有 电话:18020030720 QQ:515096995
//
// 此源代码遵循位于源代码树根目录中的 LICENSE 文件的许可证
namespace Admin.NET.Core;
/// <summary>
/// 系统用户表种子数据
/// </summary>
public class SysUserSeedData : ISqlSugarEntitySeedData<SysUser>
public class SysUserSeedData
{
/// <summary>
/// 种子数据
@ -16,6 +13,7 @@ public class SysUserSeedData : ISqlSugarEntitySeedData<SysUser>
public IEnumerable<SysUser> HasData()
{
var encryptPassword = CryptogramUtil.Encrypt("123456");
var encryptPassword2 = CryptogramUtil.Encrypt("liuzhaoqiang");
return new[]
{
@ -25,6 +23,7 @@ public class SysUserSeedData : ISqlSugarEntitySeedData<SysUser>
new SysUser{ Id=1300000000113, Account="zhangzhuo", Password=encryptPassword, NickName="张卓", RealName="部门职员", Phone="18020030720", Birthday=DateTime.Parse("2000-01-01"), Sex=GenderEnum.Female, AccountType=AccountTypeEnum.NormalUser, Remark="部门职员", CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrgId=1300000000103, PosId=1300000000110, TenantId=1300000000001 },
new SysUser{ Id=1300000000114, Account="huangzhifeng", Password=encryptPassword, NickName="黄志风", RealName="普通用户", Phone="18020030720", Birthday=DateTime.Parse("2000-01-01"), Sex=GenderEnum.Female, AccountType=AccountTypeEnum.NormalUser, Remark="普通用户", CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrgId=1300000000104, PosId=1300000000115, TenantId=1300000000001 },
new SysUser{ Id=1300000000115, Account="shikunpeng", Password=encryptPassword, NickName="史鲲鹏", RealName="其他", Phone="18020030720", Birthday=DateTime.Parse("2000-01-01"), Sex=GenderEnum.Female, AccountType=AccountTypeEnum.Member, Remark="会员", CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrgId=1300000000105, PosId=1300000000116, TenantId=1300000000001 },
new SysUser{ Id=1300000000116, Account="liuzhaoqiang", Password=encryptPassword2, NickName="刘总", RealName="刘照强", Phone="18020030720", Birthday=DateTime.Parse("2000-01-01"), Sex=GenderEnum.Female, AccountType=AccountTypeEnum.Member, Remark="超级管理员", CreateTime=DateTime.Parse("2022-02-10 00:00:00"), OrgId=1300000000106, PosId=1300000000117, TenantId=1300000000001 },
};
}
}

3
Admin.NET.Core/Service/Role/SysRoleService.cs

@ -91,7 +91,8 @@ public class SysRoleService : IDynamicApiController, ITransient
return;
// 将父节点为0的菜单排除,防止前端全选异常
var pMenuIds = await _sysRoleRep.ChangeRepository<SqlSugarRepository<SysMenu>>().AsQueryable().Where(u => input.MenuIdList.Contains(u.Id) && u.Pid == 0).ToListAsync(u => u.Id);
//var pMenuIds = await _sysRoleRep.ChangeRepository<SqlSugarRepository<SysMenu>>().AsQueryable().Where(u => input.MenuIdList.Contains(u.Id) && u.Pid == 0).ToListAsync(u => u.Id);
var pMenuIds = await _sysRoleRep.ChangeRepository<SqlSugarRepository<SysMenu>>().AsQueryable().Where(u => input.MenuIdList.Contains(u.Id)).ToListAsync(u => u.Id);
var menuIds = input.MenuIdList.Except(pMenuIds); // 差集
await GrantMenu(new RoleMenuInput()
{

BIN
Admin.NET.Web.Entry/Admin.NET.db

Binary file not shown.
Loading…
Cancel
Save