添加变量名称导入
This commit is contained in:
@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using HT.Cloud.Code;
|
||||
using HT.Cloud.Domain.DevicesManage;
|
||||
@ -150,6 +151,55 @@ namespace HT.Cloud.Service.DevicesManage
|
||||
|
||||
return tree_MetaTagRedata.ToJson();
|
||||
}
|
||||
public async Task<string> ImportExcelToTableData(List<MetaTagEntity> metaTags)
|
||||
{
|
||||
var reList = new List<Tree_MetaTagEntity>();
|
||||
|
||||
var listMetaTag = metaTags;
|
||||
var treeListMetaTag = new List<Tree_MetaTagEntity>();
|
||||
foreach (var item in listMetaTag)
|
||||
{
|
||||
|
||||
var tree_MetaTag = PCAutoCopy(item);
|
||||
treeListMetaTag.Add(tree_MetaTag);
|
||||
}
|
||||
|
||||
|
||||
var listArray = treeListMetaTag.GroupBy(x => x.Subsystem).ToList();
|
||||
|
||||
int gi = 1;
|
||||
foreach (var item in listArray)
|
||||
{
|
||||
var f_MetaTagEntity = new Tree_MetaTagEntity
|
||||
{
|
||||
TreeId = gi,
|
||||
F_TreeId = 0,
|
||||
|
||||
Address = item.First().Address,
|
||||
Subsystem = item.First().Subsystem,
|
||||
TagID = gi,
|
||||
};
|
||||
reList.Add(f_MetaTagEntity);
|
||||
foreach (var entity in item)
|
||||
{
|
||||
entity.F_TreeId = gi;
|
||||
entity.TreeId = entity.TagID;
|
||||
entity.Address = "";
|
||||
reList.Add(entity);
|
||||
}
|
||||
gi++;
|
||||
}
|
||||
|
||||
var tree_MetaTagRedata = new Tree_MetaTagRedata
|
||||
{
|
||||
code = 0,
|
||||
msg = "",
|
||||
count = reList.Count,
|
||||
data = reList
|
||||
};
|
||||
|
||||
return tree_MetaTagRedata.ToJson();
|
||||
}
|
||||
public class MetaTagRedata
|
||||
{
|
||||
public int code { get;set; }
|
||||
|
Reference in New Issue
Block a user