xm
2020-07-14 d87400af518ebc9274f4447f06476959c3aa5102
ZigbeeApp/Shared/Phone/UserCenter/Device/DoorLock/DoorLockHistoryLogForm.cs
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using ZigBee.Device;
namespace Shared.Phone.UserCenter.DeviceDoorLock
@@ -223,12 +222,12 @@
                this.listHistoryInfo = null;
            }
            HdlThreadLogic.Current.RunThread(async () =>
            HdlThreadLogic.Current.RunThread(() =>
            {
                //打开进度条
                this.ShowProgressBar();
                //成员列表
                var result = await this.GetMemberListInfo();
                var result = this.GetMemberListInfo();
                if (result == false)
                {
                    //关闭进度条
@@ -242,7 +241,7 @@
                    dicMemberName.Add(listMenberInfo[i].SubAccountDistributedMark, string.IsNullOrEmpty(listMenberInfo[i].UserName) == false ? listMenberInfo[i].UserName : listMenberInfo[i].Account);
                }
                //历史记录
                var historyLog = await this.GetHistoryLogInfo(dicMemberName);
                var historyLog = this.GetHistoryLogInfo(dicMemberName);
                if (historyLog == null)
                {
                    //关闭进度条
@@ -276,7 +275,7 @@
        /// 获取成员列表信息
        /// </summary>
        /// <returns></returns>
        private async Task<bool> GetMemberListInfo()
        private bool GetMemberListInfo()
        {
            if (listMenberInfo != null)
            {
@@ -299,8 +298,8 @@
            }
            var pra = new MemberListInfoPra();
            string result = await UserCenterLogic.GetResponseDataByRequestHttps("ZigbeeUsers/GetSubAccountByDistributedMark", false, pra);
            if (result == null)
            string result = UserCenterLogic.GetResponseDataByRequestHttps("ZigbeeUsers/GetSubAccountByDistributedMark", false, pra);
            if (string.IsNullOrEmpty(result) == true)
            {
                return false;
            }
@@ -585,7 +584,7 @@
        /// 获取历史记录
        /// </summary>
        /// <returns></returns>
        private async Task<List<HistoryInfo>> GetHistoryLogInfo(Dictionary<string, string> dicMemberName)
        private List<HistoryInfo> GetHistoryLogInfo(Dictionary<string, string> dicMemberName)
        {
            if (this.listHistoryInfo != null)
            {
@@ -596,9 +595,9 @@
            var pra = this.GetReadHistoryPra();
            //获取门锁的打开和关闭记录
            var listAllLog = await this.GetDoorOpenHistoryLog(pra);
            var listAllLog = this.GetDoorOpenHistoryLog(pra);
            //获取门锁的其他记录
            var listOtherLog = await this.GetDoorOtherHistoryLog(pra.UnlockTimeBegin, pra.UnlockTimeEnd);
            var listOtherLog = this.GetDoorOtherHistoryLog(pra.UnlockTimeBegin, pra.UnlockTimeEnd);
            listAllLog.AddRange(listOtherLog);
            //排序一下
@@ -632,7 +631,7 @@
        /// </summary>
        /// <param name="i_pra"></param>
        /// <returns></returns>
        private async Task<List<HistoryInfo>> GetDoorOpenHistoryLog(GetHistoryDataPra i_pra)
        private List<HistoryInfo> GetDoorOpenHistoryLog(GetHistoryDataPra i_pra)
        {
            var listLog = new List<HistoryInfo>();
@@ -640,8 +639,8 @@
            while (true)
            {
                //访问云端
                var result = await UserCenterLogic.GetResponseDataByRequestHttps("DoorLock/GetDoorLockHistoryPager", true, i_pra);
                if (result == null)
                var result = UserCenterLogic.GetResponseDataByRequestHttps("DoorLock/GetDoorLockHistoryPager", true, i_pra);
                if (string.IsNullOrEmpty(result) == true)
                {
                    return null;
                }
@@ -680,7 +679,7 @@
        /// 获取门锁的其他记录
        /// </summary>
        /// <returns></returns>
        private async Task<List<HistoryInfo>> GetDoorOtherHistoryLog(string beginTime, string endTime)
        private List<HistoryInfo> GetDoorOtherHistoryLog(string beginTime, string endTime)
        {
            var listLog = new List<HistoryInfo>();
@@ -690,8 +689,8 @@
            pra2.EndTime = endTime;
            pra2.Topic = "/Alarms/SendAlarmInform";
            pra2.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
            var result = await UserCenterLogic.GetResponseDataByRequestHttps("MessageCenter/GetMessageCenterPagger", true, pra2);
            if (result == null)
            var result = UserCenterLogic.GetResponseDataByRequestHttps("MessageCenter/GetMessageCenterPagger", true, pra2);
            if (string.IsNullOrEmpty(result) == true)
            {
                return null;
            }
@@ -699,8 +698,8 @@
            //从自动化中,获取常开模式记录
            pra2.Topic = "/Logic/Execute_Respon";
            result = await UserCenterLogic.GetResponseDataByRequestHttps("MessageCenter/GetMessageCenterPagger", true, pra2);
            if (result == null)
            result = UserCenterLogic.GetResponseDataByRequestHttps("MessageCenter/GetMessageCenterPagger", true, pra2);
            if (string.IsNullOrEmpty(result) == true)
            {
                return null;
            }
@@ -708,8 +707,8 @@
            //获取门锁临时密码开锁记录
            pra2.Topic = "/DoorLock/DoorLockOperatingEventNotificationCommand";
            result = await UserCenterLogic.GetResponseDataByRequestHttps("MessageCenter/GetMessageCenterPagger", true, pra2);
            if (result == null)
            result = UserCenterLogic.GetResponseDataByRequestHttps("MessageCenter/GetMessageCenterPagger", true, pra2);
            if (string.IsNullOrEmpty(result) == true)
            {
                return null;
            }
@@ -868,14 +867,14 @@
        /// <summary>
        /// 清空所有记录
        /// </summary>
        private async void ClearAllHistoryLog()
        private void ClearAllHistoryLog()
        {
            //获取访问云端接口的启动参数(2020.05.08:全部清空)
            var pra = this.GetDeleteDataPra();
            //打开进度条
            this.ShowProgressBar();
            var result = await UserCenterLogic.GetResultStatuByRequestHttps("DoorLock/ClearDoorLockHistory", true, pra);
            var result = UserCenterLogic.GetResultStatuByRequestHttps("DoorLock/ClearDoorLockHistory", true, pra);
            if (result == false)
            {
                return;
@@ -889,7 +888,7 @@
                for (int i = 0; i < listOtherMsgId.Count; i++)
                {
                    pra2.Id = listOtherMsgId[i];
                    result = await UserCenterLogic.GetResultStatuByRequestHttps("MessageCenter/DelMessageCenterItem", true, pra2);
                    result = UserCenterLogic.GetResultStatuByRequestHttps("MessageCenter/DelMessageCenterItem", true, pra2);
                    if (result == false)
                    {
                        return;