首页大屏幕

This commit is contained in:
2023-12-08 18:33:21 +08:00
parent 20de71f91a
commit 5baefadb6b
7 changed files with 347 additions and 194 deletions
@@ -257,7 +257,7 @@
* 连接 服务器地址
* 并绑定 websock 四个事件方法
*/
websock = new WebSocket('ws://localhost:1000');
websock = new WebSocket('ws://sgglapi.chengda.com:1000');
// 接收服务器返回的数据
websock.onmessage = this.websocketonmessage;
// 连接建立时触发
@@ -52,9 +52,9 @@ namespace FineUIPro.Web.HSSE.KqShowScreen
public static object getData(string projectId)
{
int total = 0;
HashSet<string> ids = new HashSet<string>();
HashSet<string> ids = new HashSet<string>();
HashSet<string> idsIn = new HashSet<string>();
Dictionary<string,DateTime> inperson = new Dictionary<string, DateTime>();
Dictionary<string, DateTime> inperson = new Dictionary<string, DateTime>();
Dictionary<string, DateTime> outPerson = new Dictionary<string, DateTime>();
DateTime dateTime = DateTime.Now.AddDays(-1);
var inout = Funs.DB.SitePerson_PersonInOut.Where(x => x.ProjectId == projectId && x.ChangeTime > dateTime).OrderByDescending(x => x.ChangeTime);
@@ -155,28 +155,38 @@ namespace FineUIPro.Web.HSSE.KqShowScreen
}
}
var personInOut = inout.FirstOrDefault();
var person = Funs.DB.SitePerson_Person.FirstOrDefault(x => x.PersonId == personInOut.PersonId);
string teamGroupName = "";
string inOut = "出场";
string PhotoUrl = "";
PhotoUrl = "../../"+person.PhotoUrl;
if (personInOut.IsIn ==true)
string PersonName = "";
string UnitName = "";
string WorkPostName = "";
string ChangeTime = "";
if (personInOut != null)
{
inOut = "入场";
}
if (!string.IsNullOrEmpty(person.TeamGroupId))
{
var teamGroup = Funs.DB.ProjectData_TeamGroup.FirstOrDefault(x => x.TeamGroupId == person.TeamGroupId);
if (teamGroup != null)
var person = Funs.DB.SitePerson_Person.FirstOrDefault(x => x.PersonId == personInOut.PersonId);
PersonName = personInOut.PersonName;
UnitName = personInOut.UnitName;
WorkPostName = personInOut.WorkPostName;
ChangeTime = personInOut.ChangeTime.Value.ToString("yyyy-MM-dd HH:mm");
PhotoUrl = "../../" + person.PhotoUrl;
if (personInOut.IsIn == true)
{
teamGroupName = teamGroup.TeamGroupName;
inOut = "入场";
}
if (!string.IsNullOrEmpty(person.TeamGroupId))
{
var teamGroup = Funs.DB.ProjectData_TeamGroup.FirstOrDefault(x => x.TeamGroupId == person.TeamGroupId);
if (teamGroup != null)
{
teamGroupName = teamGroup.TeamGroupName;
}
}
}
List<object> comStatic = new List<object>();
List<object> comStatic = new List<object>();
foreach (var key in company.Keys)
{
comStatic.Add(new { name =key, value=company[key] });
comStatic.Add(new { name = key, value = company[key] });
}
List<string> workPostName = new List<string>();
List<int> workPostValue = new List<int>();
@@ -185,9 +195,9 @@ namespace FineUIPro.Web.HSSE.KqShowScreen
workPostName.Add(key);
workPostValue.Add(workPost[key]);
}
return new { company = comStatic, total, workPost = new { name = workPostName, value = workPostValue }, person = new{ personInOut.PersonName,personInOut.UnitName, personInOut.WorkPostName , inOut, PhotoUrl , teamGroupName, ChangeTime = personInOut.ChangeTime.Value.ToString("yyyy-MM-dd HH:mm")} };
}
return new { company = comStatic, total, workPost = new { name = workPostName, value = workPostValue }, person = new { PersonName, UnitName, WorkPostName, inOut, PhotoUrl, teamGroupName, ChangeTime } };
}
}
}