using HighWayIot.Repository.domain;
using HighWayIot.Repository.service;
using HighWayIot.Repository.service.Impl;
using HighWayIot.TouchSocket;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web;
namespace RFIDSocket
{
///
/// 数据解析类
///
public class ServerDataAnalysis
{
private static readonly Lazy lazy = new Lazy(() => new ServerDataAnalysis());
public static ServerDataAnalysis Instance => lazy.Value;
public List rFIDContents = new List();
///
/// 获取数据解析
///
public void GetData(string lineNo)
{
if(string.IsNullOrEmpty(lineNo))
{
rFIDContents = BaseContentServiceImpl.Instance.Get200Infos().ToList();
}
else
{
rFIDContents = BaseContentServiceImpl.Instance.Get200Infos(lineNo).ToList();
}
}
///
/// 秒转时间
///
///
///
private string SecondToTime(int t)
{
int m = t / 60;
int s = t % 60;
if (m == 0)
{
return "00 分 " + s.ToString("00") + " 秒";
}
return m.ToString("00") + " 分 " + s.ToString("00") + " 秒";
}
public List ChangeReadResult(List list)
{
foreach (var item in list)
{
if (item.ReadKind == "GR")
{
item.ReadKind = "正常";
}
else if (item.ReadKind == "MR")
{
item.ReadKind = "多标签";
}
else if (item.ReadKind == "NB")
{
item.ReadKind = "无读";
}
}
return list;
}
}
}