|
|
|
@ -125,16 +125,28 @@ namespace GuideScreen.Common.Services.Impl
|
|
|
|
|
public IDictionary<string, int> ToiletPositionRecordTotal()
|
|
|
|
|
{
|
|
|
|
|
//厕所侧位使用统计
|
|
|
|
|
//var toilets = new Dictionary<string, int>
|
|
|
|
|
//{
|
|
|
|
|
// ["男厕1"] = GetPointWashCount(PLCPointNameByWashCount.ToiletManCount1),
|
|
|
|
|
// ["男厕2"] = GetPointWashCount(PLCPointNameByWashCount.ToiletManCount2),
|
|
|
|
|
// ["男厕3"] = GetPointWashCount(PLCPointNameByWashCount.ToiletManCount3),
|
|
|
|
|
// ["男厕4"] = GetPointWashCount(PLCPointNameByWashCount.ToiletManCount4),
|
|
|
|
|
// ["男厕5"] = GetPointWashCount(PLCPointNameByWashCount.ToiletManCount5),
|
|
|
|
|
// ["女厕1"] = GetPointWashCount(PLCPointNameByWashCount.ToiletWomanCount1),
|
|
|
|
|
// ["女厕2"] = GetPointWashCount(PLCPointNameByWashCount.ToiletWomanCount2),
|
|
|
|
|
// ["女厕3"] = GetPointWashCount(PLCPointNameByWashCount.ToiletWomanCount3),
|
|
|
|
|
//};
|
|
|
|
|
var total = deviceRecordService.ToiletTotal();
|
|
|
|
|
var toilets = new Dictionary<string, int>
|
|
|
|
|
{
|
|
|
|
|
["男厕1"] = GetPointWashCount(PLCPointNameByWashCount.ToiletManCount1),
|
|
|
|
|
["男厕2"] = GetPointWashCount(PLCPointNameByWashCount.ToiletManCount2),
|
|
|
|
|
["男厕3"] = GetPointWashCount(PLCPointNameByWashCount.ToiletManCount3),
|
|
|
|
|
["男厕4"] = GetPointWashCount(PLCPointNameByWashCount.ToiletManCount4),
|
|
|
|
|
["男厕5"] = GetPointWashCount(PLCPointNameByWashCount.ToiletManCount5),
|
|
|
|
|
["女厕1"] = GetPointWashCount(PLCPointNameByWashCount.ToiletWomanCount1),
|
|
|
|
|
["女厕2"] = GetPointWashCount(PLCPointNameByWashCount.ToiletWomanCount2),
|
|
|
|
|
["女厕3"] = GetPointWashCount(PLCPointNameByWashCount.ToiletWomanCount3),
|
|
|
|
|
["男厕1"] = GetPointWashCount(total,PLCPointNameByToiletPosition.ToiletManStatus1),
|
|
|
|
|
["男厕2"] = GetPointWashCount(total, PLCPointNameByToiletPosition.ToiletManStatus2),
|
|
|
|
|
["男厕3"] = GetPointWashCount(total, PLCPointNameByToiletPosition.ToiletManStatus3),
|
|
|
|
|
["男厕4"] = GetPointWashCount(total, PLCPointNameByToiletPosition.ToiletManStatus4),
|
|
|
|
|
["男厕5"] = GetPointWashCount(total, PLCPointNameByToiletPosition.ToiletManStatus5),
|
|
|
|
|
["女厕1"] = GetPointWashCount(total, PLCPointNameByToiletPosition.ToiletWomanStatus1),
|
|
|
|
|
["女厕2"] = GetPointWashCount(total, PLCPointNameByToiletPosition.ToiletWomanStatus2),
|
|
|
|
|
["女厕3"] = GetPointWashCount(total, PLCPointNameByToiletPosition.ToiletWomanStatus3),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return toilets;
|
|
|
|
@ -172,10 +184,19 @@ namespace GuideScreen.Common.Services.Impl
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private Int16 GetPointWashCount(string name)
|
|
|
|
|
//private Int16 GetPointWashCount(string name)
|
|
|
|
|
//{
|
|
|
|
|
// var point = Points.Where(f => f.Name == name).FirstOrDefault();
|
|
|
|
|
// return Convert.ToInt16(point?.ObjectValue);
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
private int GetPointWashCount(IDictionary<string, decimal> pairs , string name)
|
|
|
|
|
{
|
|
|
|
|
var point = Points.Where(f => f.Name == name).FirstOrDefault();
|
|
|
|
|
return Convert.ToInt16(point?.ObjectValue);
|
|
|
|
|
if (pairs.ContainsKey(name))
|
|
|
|
|
{
|
|
|
|
|
return Convert.ToInt32(pairs[name]);
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -204,7 +225,7 @@ namespace GuideScreen.Common.Services.Impl
|
|
|
|
|
break;
|
|
|
|
|
//获取冲洗统计
|
|
|
|
|
case PLCDeviceNames.WashCount:
|
|
|
|
|
ToiletPositionRecordTotal();
|
|
|
|
|
//ToiletPositionRecordTotal();
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|