using EasyEncryption;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using SWS.CAD.Models.NoEntity;
using SWS.Commons;
using SWS.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;
namespace SWS.CAD.Services
{
public class EnginedataService : HttpService
{
public EnginedataService() : base()
{
}
///
/// 获取位号的pixel对象(仅有位号).
/// 插件端的设计浏览处用到
///
///
///
public async Task> GetTagPixelsById(string objectTypeID)
{
var res = await this.GetAsync>($"EnginedataApi/GetTagPixelsById?projectId={GlobalObject.curProject.ProjectId}&EngineDataID={objectTypeID}");
if (res.code == 200)
{
return res.data;
}
else
{
return null;
}
}
///
/// 批量的去判断位号是否存在
///
/// 位号
/// true:有重复,false:无重复
public async Task CheckTagsExist(string tagNumber, string objectTypeId)
{
List listResult = new List();
List listTagNumber = new List();
listTagNumber.Add($"{tagNumber},{objectTypeId}");
var res = await this.PostBodyAsync, List>($"EnginedataApi/CheckTagsExist?projId={GlobalObject.curProject?.ProjectId}", listTagNumber);
if (res.code == 200)
{
if (res.data.Any())
{
return true;
}
else
{
return false;
}
}
else
{
return false;
}
}
///
/// 获取位号的pixel对象(仅有位号).
/// 解锁、加锁
///
/// 逗号分开
/// 加锁1或解锁0
///
public async Task LockTag(string Enginedataids, string action)
{
var res = await this.PostBodyAsync