Administrator 5 лет назад
Родитель
Сommit
dd90c0bb08

+ 30 - 0
DK.Service/PDAModuleLogic/PDAModuleLogic.cs

@@ -164,6 +164,36 @@ namespace Dongke.IBOSS.PRD.Service.PDAModuleLogic
             }
             return pdaResult;
         }
+
+        /// <summary>
+        /// 获取Apk信息
+        /// </summary>
+        /// <returns></returns>
+        public static ServiceResultEntity GetApkInfo()
+        {
+            ServiceResultEntity sre = new ServiceResultEntity();
+            Dictionary<string, object> appInfo = new Dictionary<string, object>();
+            string ApkPath = INIUtility.Instance(INIUtility.IniFile.Config).ReadIniData("PathSetting", "UpgradeAPKPath");
+            ApkPath = System.AppDomain.CurrentDomain.BaseDirectory + ApkPath;
+
+            appInfo.Add("AppVersion", INIUtility.Instance(INIUtility.IniFile.Config).ReadIniData("VersionSetting", "AndroidVersion"));
+            appInfo.Add("ApkPath", ApkPath);
+            if (File.Exists(ApkPath))
+            {
+                //pdaResult.Rights = userEntity.UserRightData;
+                FileStream file = File.OpenRead(ApkPath);
+                appInfo.Add("ApkSize", file.Length);
+                file.Close();
+            }
+            else
+            {
+                appInfo.Add("ApkSize", -1);//APK文件不存在
+                sre.Message = "APK文件不存在";
+            }
+            sre.Result = appInfo;
+
+            return sre;
+        }
         #endregion
 
         #region 获得显示数据

+ 10 - 0
WCF.Service/WCF.Contracts/IPDAModule.cs

@@ -88,6 +88,16 @@ namespace Dongke.IBOSS.PRD.WCF.Contracts
             , RequestFormat = WebMessageFormat.Json)]
         ActionResult ChangeUserPassword(string accountCode, string userCode, string userPassword, string sessionKey,
             string newPassWord);
+
+        /// <summary>
+        /// PDA登录
+        /// </summary>
+        /// <returns></returns>
+        [OperationContract]
+        [WebInvoke(BodyStyle = WebMessageBodyStyle.WrappedRequest
+            , ResponseFormat = WebMessageFormat.Json
+            , RequestFormat = WebMessageFormat.Json)]
+        string GetApkInfo();
         #endregion
 
         #region 获得系统/基数数据

+ 21 - 0
WCF.Service/WCF.Services/PDAModuleService.cs

@@ -282,6 +282,27 @@ namespace Dongke.IBOSS.PRD.WCF.Services
 			return actionResult;
 		}
 
+		/// <summary>
+		/// 获取Apk信息
+		/// </summary>
+		/// <returns></returns>
+		public string GetApkInfo()
+		{
+			try
+			{
+				ServiceResultEntity sre = PDAModuleLogic.GetApkInfo();
+				return JsonHelper.ToJson(sre);
+			}
+			catch (Exception ex)
+			{
+				OutputLog.TraceLog(LogPriority.Error,
+					this.ToString(),
+					System.Reflection.MethodBase.GetCurrentMethod().Name,
+					ex.ToString(),
+					LocalPath.LogExePath);
+				return null;
+			}
+		}
 		#endregion
 
 		#region 取得展示数据