From c18d22001e06913d03fe63077edbf0655f43c2eb Mon Sep 17 00:00:00 2001 From: chenxiangxue <910695411@qq.com> Date: Thu, 11 Apr 2024 09:28:23 +0800 Subject: [PATCH] fjlasjfos --- .../UI/LoginPanel/Scripts/LoginPanel.cs | 2 +- .../Assets/StreamingAssets/tmpcxx.meta | 8 ++ .../Assets/StreamingAssets/tmpcxx/config.json | 88 +++++++++++++++++++ .../StreamingAssets/tmpcxx/config.json.meta | 7 ++ .../Assets/StreamingAssets/tmpcxx/examNum.txt | 1 + .../StreamingAssets/tmpcxx/examNum.txt.meta | 7 ++ .../Assets/Zion/Scripts/CXX/MyManage.cs | 28 ++++-- .../Assets/Zion/Scripts/DataHandler.cs | 2 +- .../Zion/Scripts/Scenes/ScenesRecorder.cs | 2 +- 9 files changed, 137 insertions(+), 8 deletions(-) create mode 100644 RuralPowerCompetition_yizheng1/Assets/StreamingAssets/tmpcxx.meta create mode 100644 RuralPowerCompetition_yizheng1/Assets/StreamingAssets/tmpcxx/config.json create mode 100644 RuralPowerCompetition_yizheng1/Assets/StreamingAssets/tmpcxx/config.json.meta create mode 100644 RuralPowerCompetition_yizheng1/Assets/StreamingAssets/tmpcxx/examNum.txt create mode 100644 RuralPowerCompetition_yizheng1/Assets/StreamingAssets/tmpcxx/examNum.txt.meta diff --git a/RuralPowerCompetition_yizheng1/Assets/Resources/UI/LoginPanel/Scripts/LoginPanel.cs b/RuralPowerCompetition_yizheng1/Assets/Resources/UI/LoginPanel/Scripts/LoginPanel.cs index 0fa3f86a..9be948e3 100644 --- a/RuralPowerCompetition_yizheng1/Assets/Resources/UI/LoginPanel/Scripts/LoginPanel.cs +++ b/RuralPowerCompetition_yizheng1/Assets/Resources/UI/LoginPanel/Scripts/LoginPanel.cs @@ -61,7 +61,7 @@ public class LoginPanel :XUIPanel if (MyManage.instance.startMode != null && MyManage.instance.startMode.teachplanId>0) { // - accountInput.text = "admin" + MyManage.instance.startMode.teachplanId; + accountInput.text = "admin" + MyManage.instance.examNum; accountInput.interactable = false; } else diff --git a/RuralPowerCompetition_yizheng1/Assets/StreamingAssets/tmpcxx.meta b/RuralPowerCompetition_yizheng1/Assets/StreamingAssets/tmpcxx.meta new file mode 100644 index 00000000..9f73e476 --- /dev/null +++ b/RuralPowerCompetition_yizheng1/Assets/StreamingAssets/tmpcxx.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2e5cf2ce39559434da4d890cefcaf7bf +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/RuralPowerCompetition_yizheng1/Assets/StreamingAssets/tmpcxx/config.json b/RuralPowerCompetition_yizheng1/Assets/StreamingAssets/tmpcxx/config.json new file mode 100644 index 00000000..e64e5d76 --- /dev/null +++ b/RuralPowerCompetition_yizheng1/Assets/StreamingAssets/tmpcxx/config.json @@ -0,0 +1,88 @@ +[{ + "eventTitle": "巡检工器具", + "eventid": 1, + "totalscore": 3, + "workconditions": "", + "veto": 0, + "stepArr": [] +}, +{ + "eventTitle": "排故工器具", + "eventid": 2, + "totalscore": 3, + "workconditions": "", + "veto": 0, + "stepArr": [] +}, +{ + "eventTitle": "停电操作票", + "eventid": 3, + "totalscore": 5, + "workconditions": "", + "veto": 0, + "stepArr": [] +}, +{ + "eventTitle": "送电操作票", + "eventid": 4, + "totalscore": 5, + "workconditions": "", + "veto": 0, + "stepArr": [] +}, +{ + "eventTitle": "停电操作票步骤", + "eventid": 5, + "totalscore": 5, + "workconditions": "", + "veto": 0, + "stepArr": [] +}, +{ + "eventTitle": "送电操作票步骤", + "eventid": 6, + "totalscore": 5, + "workconditions": "", + "veto": 0, + "stepArr": [] +}, +{ + "eventTitle": "围栏", + "eventid": 7, + "totalscore": 2, + "workconditions": "", + "veto": 0, + "stepArr": [] +}, +{ + "eventTitle": "验电", + "eventid": 8, + "totalscore": 2, + "workconditions": "", + "veto": 0, + "stepArr": [] +}, +{ + "eventTitle": "时间分", + "eventid": 9, + "totalscore": 5, + "workconditions": "", + "veto": 0, + "stepArr": [] +}, +{ + "eventTitle": "缺陷查找、缺陷处理、缺陷分类分值", + "eventid": 10, + "totalscore": 65, + "workconditions": "", + "veto": 0, + "stepArr": [] +}, +{ + "eventTitle": "其它扣分项", + "eventid": 11, + "totalscore": 0, + "workconditions": "", + "veto": 0, + "stepArr": [] +}] \ No newline at end of file diff --git a/RuralPowerCompetition_yizheng1/Assets/StreamingAssets/tmpcxx/config.json.meta b/RuralPowerCompetition_yizheng1/Assets/StreamingAssets/tmpcxx/config.json.meta new file mode 100644 index 00000000..64c5c5ca --- /dev/null +++ b/RuralPowerCompetition_yizheng1/Assets/StreamingAssets/tmpcxx/config.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 41d89540806e0304aa5c956b273e5ae3 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/RuralPowerCompetition_yizheng1/Assets/StreamingAssets/tmpcxx/examNum.txt b/RuralPowerCompetition_yizheng1/Assets/StreamingAssets/tmpcxx/examNum.txt new file mode 100644 index 00000000..e440e5c8 --- /dev/null +++ b/RuralPowerCompetition_yizheng1/Assets/StreamingAssets/tmpcxx/examNum.txt @@ -0,0 +1 @@ +3 \ No newline at end of file diff --git a/RuralPowerCompetition_yizheng1/Assets/StreamingAssets/tmpcxx/examNum.txt.meta b/RuralPowerCompetition_yizheng1/Assets/StreamingAssets/tmpcxx/examNum.txt.meta new file mode 100644 index 00000000..5ae80135 --- /dev/null +++ b/RuralPowerCompetition_yizheng1/Assets/StreamingAssets/tmpcxx/examNum.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: cb8f0815514012f4c9010a1ef0aec93a +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/RuralPowerCompetition_yizheng1/Assets/Zion/Scripts/CXX/MyManage.cs b/RuralPowerCompetition_yizheng1/Assets/Zion/Scripts/CXX/MyManage.cs index b3a2a9c4..9fec697f 100644 --- a/RuralPowerCompetition_yizheng1/Assets/Zion/Scripts/CXX/MyManage.cs +++ b/RuralPowerCompetition_yizheng1/Assets/Zion/Scripts/CXX/MyManage.cs @@ -11,6 +11,9 @@ using SGUnitySDK.Utils; using System; using RuralPower; using System.Linq; +using NPOI.SS.UserModel; +using System.Text; +using System.IO; public class MyManage : MonoBehaviour { @@ -28,6 +31,10 @@ public class MyManage : MonoBehaviour /// public PlayModeEnum playModeEnum; /// + /// + /// + public int examNum; + /// /// /// List infos; @@ -39,8 +46,8 @@ public class MyManage : MonoBehaviour //ʼ #if UNITY_EDITOR - SGStartParamsService.GetInstance().setMode("eyJtb2RlIjo1LCJwbGFuTG9jYWxQYXRoIjoiRDpcXFVzZXJGaWxlc1xc5Yac55S156ue6LWb5a+55o6lXFzmoYjkvoszLnppcCIsInByYWN0aXNlSWQiOiI4Iiwic3R1VXNlcklkIjoiNzM0IiwiYXBwSWQiOiIyIiwiZXhhbUlkIjoiLTEiLCJ0ZWFjaHBsYW5JZCI6IjMiLCJjb3Vyc2VJZCI6Ii0xIn0="); - SGStartParamsService.GetInstance().setToken("fad75ba1-541f-4d59-8366-fa5667abd615"); + SGStartParamsService.GetInstance().setMode("eyJtb2RlIjo1LCJwbGFuTG9jYWxQYXRoIjoiRDpcXFVzZXJGaWxlc1xc5Yac55S156ue6LWb5a+55o6lXFzmoYjkvoszLnppcCIsInByYWN0aXNlSWQiOiI1NSIsInN0dVVzZXJJZCI6IjUzOSIsImFwcElkIjoiMTQiLCJleGFtSWQiOiItMSIsInRlYWNocGxhbklkIjoiMTIzIiwiY291cnNlSWQiOiItMSJ9"); + SGStartParamsService.GetInstance().setToken("f1ebee39-fd39-49f1-8da5-9c7110570f90"); #endif SGUConfig config = new SGUConfig(); SGUSdk.GetInstance().InitSDK(config); @@ -62,6 +69,7 @@ public class MyManage : MonoBehaviour // playModeEnum = PlayModeEnum.; Debug.Log("ģʽ" + startMode.examId); + GetZip(); //HttpExamService getPractiseInfo = new HttpExamService(); //ResponObject responObject = getPractiseInfo.GetExamQuestionList(startMode.examId); //if(responObject.code=="0") @@ -79,6 +87,7 @@ public class MyManage : MonoBehaviour //ϰ playModeEnum = PlayModeEnum.ϰ; Debug.Log("ϰģʽ" + startMode.practiseId); + GetZip(); //HttpPractiseService getPractiseInfo = new HttpPractiseService(); //ResponObject responObject = getPractiseInfo.GetPractiseInfo(startMode.practiseId); //if(responObject.code=="0") @@ -104,7 +113,7 @@ public class MyManage : MonoBehaviour if(Input.GetKeyDown(KeyCode.O)) { RuralPowerAPI ruralPowerAPI = new RuralPowerAPI(); - var tmps=ruralPowerAPI.GetAnswer(ScenesRecorder.user.ExamId, ScenesRecorder.user.user_id, startMode.teachplanId); + var tmps=ruralPowerAPI.GetAnswer(ScenesRecorder.user.ExamId, ScenesRecorder.user.user_id, examNum); Debug.Log("ǰ====================="); Debug.Log(JsonConvert.SerializeObject(DataBase.achievement_list)); foreach (var tmp in tmps) @@ -130,6 +139,15 @@ public class MyManage : MonoBehaviour #endif } + private void GetZip() + { + string path = Application.streamingAssetsPath + "/tmpcxx"; + Directory.Delete(path,true); + Directory.CreateDirectory(path); + System.IO.Compression.ZipFile.ExtractToDirectory(startMode.planLocalPath, path, Encoding.GetEncoding("GBK")); + examNum = int.Parse(File.ReadAllText(path + "/examNum.txt")); + Debug.Log("ţ" + examNum); + } /// /// ʼϰ /// @@ -167,7 +185,7 @@ public class MyManage : MonoBehaviour public void GetUploadPracticeAnswer() { RuralPowerAPI ruralPowerAPI=new RuralPowerAPI(); - var answers=ruralPowerAPI.GetAnswer(ScenesRecorder.user.ExamId, ScenesRecorder.user.user_id, startMode.teachplanId); + var answers=ruralPowerAPI.GetAnswer(ScenesRecorder.user.ExamId, ScenesRecorder.user.user_id, examNum); Debug.Log("ϰ"); Debug.Log(JsonConvert.SerializeObject(answers)); @@ -235,7 +253,7 @@ public class MyManage : MonoBehaviour public void GetUploadExamAnswer() { RuralPowerAPI ruralPowerAPI = new RuralPowerAPI(); - var answers = ruralPowerAPI.GetAnswer(ScenesRecorder.user.ExamId, ScenesRecorder.user.user_id, startMode.teachplanId); + var answers = ruralPowerAPI.GetAnswer(ScenesRecorder.user.ExamId, ScenesRecorder.user.user_id, examNum); Debug.Log("ԣ"); Debug.Log(JsonConvert.SerializeObject(answers)); HttpExamService getPractiseInfo = new HttpExamService(); diff --git a/RuralPowerCompetition_yizheng1/Assets/Zion/Scripts/DataHandler.cs b/RuralPowerCompetition_yizheng1/Assets/Zion/Scripts/DataHandler.cs index 83c82b64..23fe3537 100644 --- a/RuralPowerCompetition_yizheng1/Assets/Zion/Scripts/DataHandler.cs +++ b/RuralPowerCompetition_yizheng1/Assets/Zion/Scripts/DataHandler.cs @@ -66,7 +66,7 @@ public class DataHandler : MonoBehaviour { Debug.Log("Load online data!"); RuralPowerAPI rpa = new RuralPowerAPI(); - var result = rpa.GetExam(_ip,ScenesRecorder.user.user_id,MyManage.instance.startMode.teachplanId.ToString(),Application.streamingAssetsPath+ "/zy"); + var result = rpa.GetExam(_ip,ScenesRecorder.user.user_id,MyManage.instance.examNum.ToString(),Application.streamingAssetsPath+ "/zy"); InitData(result); } } diff --git a/RuralPowerCompetition_yizheng1/Assets/Zion/Scripts/Scenes/ScenesRecorder.cs b/RuralPowerCompetition_yizheng1/Assets/Zion/Scripts/Scenes/ScenesRecorder.cs index 5354761c..14679ec1 100644 --- a/RuralPowerCompetition_yizheng1/Assets/Zion/Scripts/Scenes/ScenesRecorder.cs +++ b/RuralPowerCompetition_yizheng1/Assets/Zion/Scripts/Scenes/ScenesRecorder.cs @@ -191,7 +191,7 @@ public class ScenesRecorder : MonoBehaviour IsInit = true; RuralPowerAPI rpa = new RuralPowerAPI(); // ȡ - var resultstart = rpa.GetExam(_ip, ScenesRecorder.user.user_id,MyManage.instance.startMode.teachplanId.ToString(), Application.streamingAssetsPath + "/zy"); + var resultstart = rpa.GetExam(_ip, ScenesRecorder.user.user_id,MyManage.instance.examNum.ToString(), Application.streamingAssetsPath + "/zy"); if (JObject.Parse(resultstart)["code"].ToObject()!=0) { Debug.LogError("GetExamʧ");