From fe1e04654d55516fe65728857862a6b5b5d1b3be Mon Sep 17 00:00:00 2001
From: chenqiyang <1406175257@qq.com>
Date: 星期二, 17 五月 2022 17:10:17 +0800
Subject: [PATCH] 更新全视通dll(去掉访客管理的密码使用次数)
---
HDL_ON/DAL/DriverLayer/Control.cs | 92 ++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 85 insertions(+), 7 deletions(-)
diff --git a/HDL_ON/DAL/DriverLayer/Control.cs b/HDL_ON/DAL/DriverLayer/Control.cs
index 98bc02e..f14125b 100644
--- a/HDL_ON/DAL/DriverLayer/Control.cs
+++ b/HDL_ON/DAL/DriverLayer/Control.cs
@@ -360,10 +360,11 @@
/// <param name="function"></param>
/// <param name="useRemote">鏄惁鐩存帴浣跨敤杩滅▼鍙戦��</param>
/// <returns></returns>
- public void SendWriteCommand(Function function, Dictionary<string, string> commandDictionary, bool useRemote = false,int resend = 3)
+ public bool SendWriteCommand(Function function, Dictionary<string, string> commandDictionary, bool useRemote = false,int resend = 3)
{
function.controlCounter++;
function.refreshTime = DateTime.Now;
+
//濡傛灉鏄帶鍒惰皟鍏夌殑寮�鏃讹紝浜害鍊间笉鑳戒负0
if (commandDictionary.Count > 2)
@@ -404,7 +405,7 @@
upDataObj.objects.Add(asd);
revString = Newtonsoft.Json.JsonConvert.SerializeObject(upDataObj);
UpdataFunctionStatus(revString, null, true);
- return;
+ return true;
}
@@ -493,6 +494,8 @@
}
}
+
+ return true;
}
/// <summary>
/// 鍏ㄥ紑鍏ㄥ叧鍔熻兘
@@ -1232,13 +1235,88 @@
}
else
{
- Dictionary<string, object> d = new Dictionary<string, object>();
- d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
- d.Add("deviceId", doorlock.deviceId);
- var requestJson = HttpUtil.GetSignRequestJson(d);
- HttpUtil.RequestHttpsPost("/home-wisdom/app/device/door/remoteOpen", requestJson);
+ ConfirmUnlocking(doorlock.deviceId, extStr);
}
}
+ /// <summary>
+ /// 纭寮�閿�
+ /// </summary>
+ /// <param name="functionId"></param>
+ /// <param name="pwd"></param>
+ public void ConfirmUnlocking(string functionId,string pwd)
+ {
+ Loading loading = new Loading();
+ MainPage.BaseView.AddChidren(loading);
+ loading.BackgroundColor = 0x88000000;
+ loading.LodingBackgroundColor = UI.CSS.CSS_Color.BackgroundColor;
+ loading.Start(Language.StringByID(StringId.PleaseWait));
+ new System.Threading.Thread(() =>
+ {
+ try
+ {
+ Dictionary<string, object> d = new Dictionary<string, object>();
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+ d.Add("deviceId", functionId);
+ d.Add("pwd", pwd);
+ var requestJson = HttpUtil.GetSignRequestJson(d);
+ var pack = HttpUtil.RequestHttpsPost("/home-wisdom/app/device/door/pwdConfirm", requestJson);
+ if (pack.Code == StateCode.SUCCESS)
+ {
+ Newtonsoft.Json.Linq.JObject pairs = Newtonsoft.Json.Linq.JObject.Parse(pack.Data.ToString());
+ var scrip = pairs.GetValue("scrip");
+
+ d = new Dictionary<string, object>();
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+ d.Add("deviceId", functionId);
+ d.Add("scrip", scrip);
+ requestJson = HttpUtil.GetSignRequestJson(d);
+ pack = HttpUtil.RequestHttpsPost("/home-wisdom/app/device/door/remoteOpen", requestJson);
+ //if(pack.Code == StateCode.SUCCESS)
+ //{
+ // return true;
+ //}
+ //else
+ //{
+ // return false;
+ //}
+ if (pack.Code != StateCode.SUCCESS) {
+ Application.RunOnMainThread(() => {
+ new PublicAssmebly().TipMsg(Language.StringByID(StringId.Tip), pack.message);
+ UserInfo.Current.doorPasswordString = "";//
+ UserInfo.Current.LastTimeOpenDoor = DateTime.MinValue;
+ });
+ }
+ }
+ if (pack.Code != StateCode.SUCCESS)
+ {
+ Application.RunOnMainThread(() => {
+ if(string.IsNullOrEmpty(pack.message))
+ {
+ new PublicAssmebly().TipMsg(Language.StringByID(StringId.Tip),
+ Language.StringByID(StringId.OperationFailed));
+ }
+ else
+ {
+ new PublicAssmebly().TipMsg(Language.StringByID(StringId.Tip), pack.message);
+ }
+ });
+ }
+ }
+ catch (Exception ex)
+ {
+
+ }
+ finally
+ {
+ Application.RunOnMainThread(() =>
+ {
+ loading.Hide();
+ loading.RemoveFromParent();
+ });
+ }
+ })
+ { IsBackground = true }.Start();
+ }
//瀵嗙爜鍐荤粨
//瀵嗙爜楠岃瘉
--
Gitblit v1.8.0