Răsfoiți Sursa

【+】
添加成绩上传功能

lxd 1 lună în urmă
părinte
comite
9ae6c73429

+ 1 - 1
Framework/Scripts/GRPC/protos/OperateInfoGreer.cs.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: b6079d82645b0af43a6928993618f18e
+guid: 4f448725ff55eda4296c8eac97a093d7
 MonoImporter:
   externalObjects: {}
   serializedVersion: 2

+ 1 - 1
Framework/Scripts/GRPC/protos/OperateInfoGreerGrpc.cs.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: ea869a6602c7f554a89a13e7c7a89bc5
+guid: 31272ecc59bdfe04cb5e3f70ff1b4afe
 MonoImporter:
   externalObjects: {}
   serializedVersion: 2

+ 16 - 10
Framework/Scripts/Proxys/ExamProxy.cs

@@ -30,6 +30,12 @@ public class ExamProxy : DataProxy
     {
         startTime = System.DateTime.Now;
         curse = GlobalConfig.m_SelectDevice;
+        Debug.LogError(curse);
+        UserProxy userProxy = DAL.Instance.Get<UserProxy>();
+
+        SearchInfoResponse searchInfoResponse =  GrpcChannelContronller.Instance.client.StudentInfoSearch(new SearchRequest() {PhoneNumber = userProxy.userInfo.phoneNumber });
+
+        Debug.LogError(searchInfoResponse.StudentInfos.Count);
     }
 
 
@@ -40,17 +46,17 @@ public class ExamProxy : DataProxy
     {
         UserProxy userProxy = DAL.Instance.Get<UserProxy>();
 
-        //OperateResponse operateResponse = GrpcChannelContronller.Instance.client.StudentScoreAdd(new StudentScore()
-        //{
-        //    Answertime = (int)TimestampConvert.ConverOldTiemAndNewTiemDuration(startTime, System.DateTime.Now),
-        //    CourseName = curse,
-        //    Name = userProxy.userInfo.userName,
-        //    Score = score,
-        //    Starttime = GetCurrentTime(startTime),
-        //    PhoneNumber = userProxy.userInfo.phoneNumber
-        //});
+        OperateResponse operateResponse = GrpcChannelContronller.Instance.client.StudentScoreAdd(new StudentScore()
+        {
+            Answertime = (int)TimestampConvert.ConverOldTiemAndNewTiemDuration(startTime, System.DateTime.Now),
+            CourseName = curse,
+            Name = userProxy.userInfo.userName,
+            Score = score,
+            Starttime = GetCurrentTime(startTime),
+            PhoneNumber = userProxy.userInfo.phoneNumber
+        });
 
-        return true;
+        return operateResponse.Result;
     }
 
     /// <summary>

+ 1 - 0
Framework/Scripts/Proxys/UserProxy.cs

@@ -23,6 +23,7 @@ public class UserProxy : DataProxy
 
         if (response != null && response.Result == true) 
         {
+
             userInfo.userName = response.Name;
             userInfo.phoneNumber = account;
         }

+ 78 - 4
Framework/Scripts/UI/PCController/OperateSetting.cs

@@ -183,6 +183,8 @@ public class OperateSetting : MonoSingleton<OperateSetting>
             m_CurrentOperationMode = GlobalData.m_CurrentOperationMode;
         }
 
+        ParseParameters();
+
         #region 本地化语言
         if (useLocalization)
         {
@@ -198,13 +200,82 @@ public class OperateSetting : MonoSingleton<OperateSetting>
 
         }
         
-            
-
         InitQuestionInfo();
         InitOperationMode();
         ProcessManagement.Instance.awakePlay = false;
     }
 
+    private void ParseParameters()
+    {
+        string[] args = System.Environment.GetCommandLineArgs();
+
+        ///临时测试数据
+        string para = "b0e6098c7b65e46928b38e09a506234abb0b9a0/闭式水泵整体拆装/访客/40008013900/127.0.0.1:15157/Exam/测试参数/这是第条参数/这是总平台参数";
+
+
+        string[] tmpArgs = para.Split('/');
+
+        // 文件各种:手机号/课程名/模式/地址
+        string tmpPhoneNumber = "";
+        string tmpCourseName = "";
+        string tmpMode = "";
+
+        UserProxy userProxy = DAL.Instance.Get<UserProxy>();
+        userProxy.userInfo.userName = tmpArgs[2];
+        userProxy.userInfo.phoneNumber = tmpArgs[3];
+
+        Debug.Log(tmpArgs.Length + "-asd-" + args[1]);
+        if (tmpArgs.Length < 4)
+        {
+            #region 电专平台接口解析
+
+            // 文件各种:手机号/课程名/模式/地址
+            tmpPhoneNumber = tmpArgs[0];
+            tmpCourseName = tmpArgs[1];
+            tmpMode = tmpArgs[2];
+            //if (tmpArgs.Length > 3)
+            //{
+            //    string tmpAddress = tmpArgs[3];
+            //    //GrpcChannelContronller.Instance.StartClient(tmpAddress);
+
+            //    GetInfoaboutSpecifiedUser(tmpPhoneNumber);
+            //}
+            #endregion
+        }
+        else
+        {
+            #region 通用平台接口解析 
+
+            tmpPhoneNumber = tmpArgs[5];
+            tmpCourseName = tmpArgs[1];
+            tmpMode = tmpArgs[2];
+
+            GrpcChannelContronller.Instance.StartClient(tmpArgs[4]);
+            tmpCourseName = tmpArgs[1];
+
+            GlobalConfig.m_SelectDevice = tmpCourseName;
+
+            switch (tmpArgs[5])
+            {
+                case "Learn":
+                    m_CurrentOperationMode = OperationMode.Learn;
+                    break;
+                case "Practice":
+                    m_CurrentOperationMode = OperationMode.Practice;
+                    break;
+                case "Exam":
+                    m_CurrentOperationMode = OperationMode.Exam;
+                    break;
+                default:
+                    tmpMode = "学习";
+                    break;
+            }
+
+            Debug.Log(tmpCourseName + " --" + tmpMode);
+            #endregion
+        }
+    }
+
     /// <summary>
     /// 初始化游戏设置
     /// </summary>
@@ -323,8 +394,11 @@ public class OperateSetting : MonoSingleton<OperateSetting>
 
             ExamSetInfo tmpExamInfo = tmpProxy.GetExamSetInfoByCourseName(name);
 
-            maxErrorCount = int.Parse(tmpExamInfo.maxErrorCount);
-            examTime = int.Parse(tmpExamInfo.examTime);
+            if (tmpExamInfo != null)
+            {
+                maxErrorCount = int.Parse(tmpExamInfo.maxErrorCount);
+                examTime = int.Parse(tmpExamInfo.examTime);
+            }
         }
 
         UIKit.OpenPanel<ToolDisplayForm>();