CrabtreeOn,印度客户定制APP,迁移2.0平台版本
JLChen
2021-02-25 c0379d078e7919c9934085da038e8e3c20dee85a
Crabtree/SmartHome/HDL/Common/HDLLinkUtlis.cs
@@ -72,7 +72,7 @@
        public static long ConvertDateTimeLong ()
        {
            System.DateTime startTime = TimeZoneInfo.ConvertTimeToUtc (new System.DateTime (2020, 1, 1));
            long l = (long)(Math.Round ((DateTime.Now - startTime).TotalSeconds, 1) * 10);
            long l = (long)(Math.Round ((DateTime.Now - startTime).TotalMilliseconds, 1) / 10);
            if (l <= LastTime) l = LastTime + 1;
            LastTime = l;
            return l;
@@ -134,14 +134,10 @@
                        hdlLinkSceneList.Add (mHDLLinkScene);
                    }
                }
                //2.上传场景
                //2.1不存在,需要新上传的
                //全量同步场景
                res = UploadSceneList (hdlLinkSceneList);
                //2.2已存在,需要更新的
                //if (res) {
                //    var updateLinkSceneList = new List<HDLLinkScene> ();
                //    res = UploadSceneList (updateLinkSceneList);
                //}
            } catch (Exception ex){
                Utlis.WriteLine ("catch :" + ex.ToString ());
@@ -205,14 +201,14 @@
        }
        /// <summary>
        ///
        /// 全量同步场景
        /// </summary>
        /// <param name="mScene"></param>
        bool UploadSceneList (List<HDLLinkScene> hdlLinkSceneList)
        {
            var res = false;
            try {
                var revertObj = HttpServerRequest.Current.AddScene (hdlLinkSceneList);
                var revertObj = HttpServerRequest.Current.SecneSyncList (hdlLinkSceneList);
                if (revertObj.Code == StateCode.SUCCESS) {
                    res = true;
                } else {
@@ -736,11 +732,11 @@
                        functionLists.AddRange (ConvertToSidListToIotCloud (tmpOid.oid, tmp));
                        Utlis.WriteLine ("新的模块,新的的OID:" + tmpOid.addresses + " deviceType:" + tmpOid.deviceType);
                        //Utlis.WriteLine ("新的模块,新的的OID:" + tmpOid.addresses + " deviceType:" + tmpOid.deviceType);
                    } else {
                        //3.2存在则取之前的oid 
                        functionLists.AddRange (ConvertToSidListToIotCloud (deviceOid.oid, tmp));
                        Utlis.WriteLine ("相同的模块,取之前的OID:" + deviceOid.addresses + " deviceType:" + deviceOid.deviceType);
                        //Utlis.WriteLine ("相同的模块,取之前的OID:" + deviceOid.addresses + " deviceType:" + deviceOid.deviceType);
                    }
                }