XunJianDataManager.cs 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830
  1. using LitJson;
  2. using Newtonsoft.Json;
  3. using Newtonsoft.Json.Linq;
  4. using System;
  5. using System.Collections;
  6. using System.Collections.Generic;
  7. using System.Linq;
  8. using UnityEngine;
  9. using XRTool.Util;
  10. using static easyar.ImageTargetController;
  11. public class XunJianDataManager : Singleton<XunJianDataManager>
  12. {
  13. public XunJianListData chooseXunJian;
  14. public List<XunJianListData> xjDataList = new List<XunJianListData>();
  15. public void GetXunJianList(Action<List<XunJianListData>> callback)
  16. {
  17. WindowsManager.Instance.StartCoroutine(testBack(callback));
  18. }
  19. public string nowArea = "全部";
  20. public void GetAreaList(string area, Action<List<XunJianListData>> callback)
  21. {
  22. nowArea = area;
  23. List<XunJianListData> data = new List<XunJianListData>();
  24. if (areaList.ContainsKey(area))
  25. {
  26. for (int i = 0; i < areaList[area].Count; i++)
  27. {
  28. Debug.Log(nowPeople == areaList[area][i].people);
  29. Debug.Log(!peopleList.ContainsKey(nowPeople));
  30. if (nowPeople == areaList[area][i].people || !peopleList.ContainsKey(nowPeople))
  31. {
  32. data.Add(areaList[area][i]);
  33. }
  34. }
  35. callback.Invoke(data);
  36. }
  37. else
  38. {
  39. for (int i = 0; i < xjDataList.Count; i++)
  40. {
  41. if (nowPeople == xjDataList[i].people || !peopleList.ContainsKey(nowPeople))
  42. {
  43. data.Add(xjDataList[i]);
  44. }
  45. }
  46. callback.Invoke(data);
  47. }
  48. }
  49. public string nowPeople="全部";
  50. public void GetPeopleList(string people, Action<List<XunJianListData>> callback)
  51. {
  52. nowPeople = people;
  53. List<XunJianListData> data = new List<XunJianListData>();
  54. if (peopleList.ContainsKey(people))
  55. {
  56. for (int i = 0; i < peopleList[people].Count; i++)
  57. {
  58. if(nowArea == peopleList[people][i].inarea||!areaList.ContainsKey(nowArea))
  59. {
  60. data.Add(peopleList[people][i]);
  61. }
  62. }
  63. callback.Invoke(data);
  64. }else
  65. {
  66. for (int i = 0; i < xjDataList.Count; i++)
  67. {
  68. if (nowArea == xjDataList[i].inarea || !areaList.ContainsKey(nowArea))
  69. {
  70. data.Add(xjDataList[i]);
  71. }
  72. }
  73. callback.Invoke(data);
  74. }
  75. }
  76. XunJianListData testData()
  77. {
  78. XunJianListData xj = new XunJianListData();
  79. xj.id = "saotu";
  80. xj.url = Application.streamingAssetsPath + "/DianYun/85471-ghzoffice (2).bytes";
  81. xj.projectname = "工厂巡检";
  82. xj.inarea = "杨浦区";
  83. xj.updateState = "新项目";
  84. xj.projectState = "测试巡检 ";
  85. xj.projectType = "未开始 ";
  86. xj.projectTime = "2023/11/23 10:53 ";
  87. xj.renwuModelType = RenWuModelType.SaoTu;
  88. // xj.itemList = getRenwuData();
  89. xj.tasksList = new List<XunJianTasks>();
  90. xj.people = "员工A";
  91. return xj;
  92. }
  93. XunJianListData testData2()
  94. {
  95. XunJianListData xj = new XunJianListData();
  96. xj.id = "saotu";
  97. xj.url = Application.streamingAssetsPath + "/DianYun/85471-ghzoffice (2).bytes";
  98. xj.projectname = "办公室巡检";
  99. xj.inarea = "杨浦区";
  100. xj.updateState = "新项目";
  101. xj.projectState = "测试巡检 ";
  102. xj.projectType = "未开始 ";
  103. xj.projectTime = "2023/11/23 10:53 ";
  104. xj.renwuModelType = RenWuModelType.DianYun;
  105. // xj.itemList = getRenwuData();
  106. xj.tasksList = new List<XunJianTasks>();
  107. xj.people = "员工B";
  108. return xj;
  109. }
  110. XunJianListData testData3()
  111. {
  112. XunJianListData xj = new XunJianListData();
  113. xj.id = "saotu";
  114. xj.url = Application.streamingAssetsPath + "/DianYun/85471-ghzoffice (2).bytes";
  115. xj.projectname = "机房巡检";
  116. xj.inarea = "杨浦区";
  117. xj.updateState = "新项目";
  118. xj.projectState = "巡检 ";
  119. xj.projectType = "未开始 ";
  120. xj.projectTime = "2023/11/23 10:53 ";
  121. xj.renwuModelType = RenWuModelType.None;
  122. // xj.itemList = getRenwuData();
  123. xj.tasksList = new List<XunJianTasks>();
  124. xj.people = "员工C";
  125. xj.listWall = getWallData();
  126. return xj;
  127. }
  128. List<RenWuItem> getRenwuData()
  129. {
  130. List < RenWuItem > itemlist = new List<RenWuItem>();
  131. for (int j = 0; j < 7; j++)
  132. {
  133. RenWuItem rw = new RenWuItem();
  134. rw.imageUrl ="";
  135. //任务id
  136. rw.id = j.ToString();
  137. RenWuTypeModel rwtm = new RenWuTypeModel();
  138. RenWuTypeModel rwtm2 = new RenWuTypeModel();
  139. RenWuTypeModel rwtm3 = new RenWuTypeModel();
  140. RenWuTypeModel rwtm4 = new RenWuTypeModel();
  141. //任务索引
  142. rw.index = j;
  143. switch(j)
  144. {
  145. case 0:
  146. //任务路线 (空间定位时才有)
  147. rw.roadList = new List<Vector3>();
  148. rw.roadList.Add(new Vector3(-4.2f+0.5f, 0, 0.92f));
  149. rw.roadList.Add(new Vector3(-4.2f + 0.5f, 0, 2));
  150. rw.roadList.Add(new Vector3(-5 + 0.5f, 0, 2));
  151. rw.info = "请检查机房空调温度是否正常";
  152. //单个任务素材
  153. rw.typeList = new List<RenWuTypeModel>();
  154. rwtm.id = "1";
  155. rwtm.type = RenWuType.Image;
  156. rwtm.url = Application.streamingAssetsPath + "/Demo1/温湿度.jpeg";
  157. rw.typeList.Add(rwtm);
  158. rwtm4.id = "4";
  159. rwtm4.type = RenWuType.Text;
  160. rwtm4.info = "通常要求机房长期工作环境温度: 0'C'4S'C; 短期工作环境温度: -5C~SSC";
  161. rw.typeList.Add(rwtm4);
  162. break;
  163. case 1:
  164. //任务路线 (空间定位时才有)
  165. rw.roadList = new List<Vector3>();
  166. rw.roadList.Add(new Vector3(-4.2f + 0.5f, 0, 0.92f));
  167. rw.info = "请检查机房湿度是否正常";
  168. //单个任务素材
  169. rw.typeList = new List<RenWuTypeModel>();
  170. rwtm4.id = "4";
  171. rwtm4.type = RenWuType.Text;
  172. rwtm4.info = "通常机房的长期工作环境相对漫庭应在5%RH~85%RH之间,不结露;短期工作环境相对湿度应在0%RH~95%RH之间,不结露.";
  173. rw.typeList.Add(rwtm4);
  174. rwtm.id = "1";
  175. rwtm.type = RenWuType.Image;
  176. rwtm.url = Application.streamingAssetsPath + "/Demo1/温湿度.jpeg";
  177. rw.typeList.Add(rwtm);
  178. break;
  179. case 2:
  180. //任务路线 (空间定位时才有)
  181. rw.roadList = new List<Vector3>();
  182. rw.roadList.Add(new Vector3(-4.2f + 0.5f, 0, -1.6f));
  183. rw.info = "请检查服务器电源灯是否正常";
  184. //单个任务素材
  185. rw.typeList = new List<RenWuTypeModel>();
  186. rwtm.id = "1";
  187. rwtm.type = RenWuType.Image;
  188. rwtm.url = Application.streamingAssetsPath + "/Demo1/服务器指示灯.png";
  189. rw.typeList.Add(rwtm);
  190. rwtm3.id = "3";
  191. rwtm3.type = RenWuType.Model;
  192. rwtm3.url = Application.streamingAssetsPath + "/Demo1/dell poweredge.fbx";
  193. rw.typeList.Add(rwtm3);
  194. break;
  195. case 3:
  196. //任务路线 (空间定位时才有)
  197. rw.roadList = new List<Vector3>();
  198. rw.roadList.Add(new Vector3(-4.2f + 0.5f, 0, 0.52f));
  199. rw.roadList.Add(new Vector3(-1.78f, 0, 0.52f));
  200. rw.roadList.Add(new Vector3(-1.78f, 0, -1.6f));
  201. rw.info = "请检查服务器告警灯状态是否正常";
  202. //单个任务素材
  203. rw.typeList = new List<RenWuTypeModel>();
  204. rwtm3.id = "3";
  205. rwtm3.type = RenWuType.Model;
  206. rwtm3.url = Application.streamingAssetsPath + "/Demo1/dell poweredge.fbx";
  207. rw.typeList.Add(rwtm3);
  208. rwtm2.id = "2";
  209. rwtm2.type = RenWuType.Video;
  210. rwtm2.url = Application.streamingAssetsPath + "/Demo1/服务器告警灯2.mp4";
  211. rw.typeList.Add(rwtm2);
  212. break;
  213. case 4:
  214. //任务路线 (空间定位时才有)
  215. rw.roadList = new List<Vector3>();
  216. rw.roadList.Add(new Vector3(-1.78f, 0, 0.52f));
  217. rw.roadList.Add(new Vector3(-5.18f + 0.5f, 0, 0.52f));
  218. rw.info = "请检查服务器网线连接是否正常";
  219. //单个任务素材
  220. rw.typeList = new List<RenWuTypeModel>();
  221. rwtm2.id = "2";
  222. rwtm2.type = RenWuType.Video;
  223. rwtm2.url = Application.streamingAssetsPath + "/Demo1/网线.mp4";
  224. rw.typeList.Add(rwtm2);
  225. break;
  226. case 5:
  227. //任务路线 (空间定位时才有)
  228. rw.roadList = new List<Vector3>();
  229. rw.roadList.Add(new Vector3(-1.78f, 0, 0.52f));
  230. rw.info = "机房室内消防设施是否齐全";
  231. //单个任务素材
  232. rw.typeList = new List<RenWuTypeModel>();
  233. rwtm.id = "1";
  234. rwtm.type = RenWuType.Image;
  235. rwtm.url = Application.streamingAssetsPath + "/Demo1/机房消防设施巡检.jpeg";
  236. rw.typeList.Add(rwtm);
  237. break;
  238. case 6:
  239. //任务路线 (空间定位时才有)
  240. rw.roadList = new List<Vector3>();
  241. rw.roadList.Add(new Vector3(-4.2f + 0.5f, 0, 0.52f));
  242. rw.roadList.Add(new Vector3(-1.78f, 0, 0.52f));
  243. rw.roadList.Add(new Vector3(-1.78f, 0, -1f));
  244. rw.info = "机房室内消防设施摆放是否规范";
  245. //单个任务素材
  246. rw.typeList = new List<RenWuTypeModel>();
  247. rwtm.id = "1";
  248. rwtm.type = RenWuType.Image;
  249. rwtm.url = Application.streamingAssetsPath + "/Demo1/机房消防设施摆放.jpeg";
  250. rw.typeList.Add(rwtm);
  251. break;
  252. }
  253. //任务介绍
  254. //拍照按钮
  255. int randomInt = UnityEngine.Random.Range(0, 10);
  256. rw.isPaiZhao = randomInt > 5 ? true : false;
  257. //RTC按钮
  258. int randomInt2 = UnityEngine.Random.Range(0, 10);
  259. rw.isYuanCheng = randomInt2 > 5 ? true : false;
  260. itemlist.Add(rw);
  261. }
  262. return itemlist;
  263. }
  264. public Dictionary<string, List<XunJianListData>> areaList = new Dictionary<string, List<XunJianListData>>();
  265. public Dictionary<string, List<XunJianListData>> peopleList = new Dictionary<string, List<XunJianListData>>();
  266. List<Wall> getWallData()
  267. {
  268. List<Wall> listWall = new List<Wall>();
  269. for (int i = 0; i < 6; i++)
  270. {
  271. switch (i)
  272. {
  273. case 0:
  274. Wall wall = new Wall();
  275. wall.listPoint.Add(new Vector3(-5, 0, 0.25f));
  276. wall.listPoint.Add(new Vector3(5, 0, 0.25f));
  277. wall.listPoint.Add(new Vector3(5, 0, -0.25f));
  278. wall.listPoint.Add(new Vector3(-5, 0, -0.25f));
  279. listWall.Add(wall);
  280. break;
  281. case 1:
  282. Wall wall1 = new Wall();
  283. wall1.listPoint.Add(new Vector3(-5, 0, -4.75f));
  284. wall1.listPoint.Add(new Vector3(5, 0, -4.75f));
  285. wall1.listPoint.Add(new Vector3(5, 0, -5.25f));
  286. wall1.listPoint.Add(new Vector3(-5, 0, -5.25f));
  287. listWall.Add(wall1);
  288. break;
  289. case 2:
  290. Wall wall2 = new Wall();
  291. wall2.listPoint.Add(new Vector3(-5.25f, 0, 0));
  292. wall2.listPoint.Add(new Vector3(-4.75f, 0, 0));
  293. wall2.listPoint.Add(new Vector3(-4.75f, 0, -5));
  294. wall2.listPoint.Add(new Vector3(-5.25f, 0, -5));
  295. listWall.Add(wall2);
  296. break;
  297. case 3:
  298. Wall wall3 = new Wall();
  299. wall3.listPoint.Add(new Vector3(4.75f, 0, 0));
  300. wall3.listPoint.Add(new Vector3(5.25f, 0, 0));
  301. wall3.listPoint.Add(new Vector3(5.25f, 0, -5));
  302. wall3.listPoint.Add(new Vector3(4.75f, 0, -5));
  303. listWall.Add(wall3);
  304. break;
  305. case 4:
  306. Wall wall4 = new Wall();
  307. wall4.listPoint.Add(new Vector3(-2.75f, 0, -1f));
  308. wall4.listPoint.Add(new Vector3(-2.25f, 0, -1f));
  309. wall4.listPoint.Add(new Vector3(-2.25f, 0, -3f));
  310. wall4.listPoint.Add(new Vector3(-2.75f, 0, -3f));
  311. listWall.Add(wall4);
  312. break;
  313. case 5:
  314. Wall wall5 = new Wall();
  315. wall5.listPoint.Add(new Vector3(2.25f, 0, -2));
  316. wall5.listPoint.Add(new Vector3(2.75f, 0, -2));
  317. wall5.listPoint.Add(new Vector3(2.75f, 0, -4));
  318. wall5.listPoint.Add(new Vector3(2.25f, 0, -4));
  319. listWall.Add(wall5);
  320. break;
  321. default:
  322. break;
  323. }
  324. }
  325. return listWall;
  326. }
  327. IEnumerator testBack(Action<List<XunJianListData>> callback)
  328. {
  329. yield return WindowsManager.Instance.StartCoroutine(HttpTool.Instance.SendHttp(HttpEdustryAction.InspectionList, "", (string msg) =>
  330. {
  331. Debug.Log("DGJ ===>InspectionList " + msg);
  332. JObject jObject = JObject.Parse(msg);
  333. if (jObject["code"].ToString() == "200")
  334. {
  335. List<XunJianData> data = JsonConvert.DeserializeObject<List<XunJianData>>(jObject["data"]["list"].ToString());
  336. if(WindowsManager.Instance.isTest)
  337. {
  338. xjDataList.Add(testData3());
  339. xjDataList.Add(testData());
  340. xjDataList.Add(testData2());
  341. }
  342. /*
  343. * 1是否为异常巡检>2是否逾期>3是否更新>4接收时间
  344. 1. 异常巡检项目>常规巡检项目
  345. 2. 已逾期>即将开始>未到逾期提醒>进行中>已完成
  346. 3. 新项目>已更新>未更新项目
  347. 4. 新接收时间>老接收时间
  348. 新项目 : 接受发布时间在24小时内
  349. */
  350. // 排序
  351. // var data2 = data.OrderBy(XunJianData => XunJianData.projectType);
  352. // .ThenBy(XunJianData => XunJianData.projectState)
  353. // .ThenBy(XunJianData => XunJianData.projectTime);
  354. for (int i = 0; i < data.Count; i++)
  355. {
  356. int sortStatus = 10;
  357. switch (data[i].status)
  358. {
  359. case 1:
  360. sortStatus = 3;
  361. break;
  362. case 2:
  363. sortStatus = 2;
  364. break;
  365. case 3:
  366. sortStatus = 1;
  367. break;
  368. case 4:
  369. sortStatus = 4;
  370. break;
  371. case 5:
  372. sortStatus = 5;
  373. break;
  374. default:
  375. break;
  376. }
  377. int sortType = 10;
  378. if(data[i].publishTime == data[i].firstPublishTime)
  379. {
  380. DateTime publishTime = UnixTimeStampToDateTime(data[i].publishTime);
  381. DateTime nowTime = UnixTimeStampToDateTime(GetHttpTimer.Instance.timestamp);
  382. if (IsWithin24Hours(publishTime, nowTime))
  383. {
  384. sortType = 1;
  385. }
  386. else
  387. {
  388. sortType = 3;
  389. }
  390. }
  391. else
  392. {
  393. sortType = 2;
  394. }
  395. data[i].sort_projectStatus = sortStatus;
  396. data[i].sort_status = sortStatus;
  397. }
  398. var data2 = data.OrderByDescending(XunJianData => XunJianData.type)
  399. .ThenBy(XunJianData => XunJianData.sort_status)
  400. .ThenBy(XunJianData => XunJianData.sort_projectStatus)
  401. .ThenByDescending(XunJianData => XunJianData.publishTime);
  402. List<XunJianData> data3 = new List<XunJianData>();
  403. foreach (XunJianData item in data2)
  404. {
  405. data3.Add(item);
  406. }
  407. Debug.Log("DGJ ===> 排序后 " + JsonConvert.SerializeObject(data3));
  408. xjDataList.AddRange(XunJianDataParetListData(data3));
  409. peopleList = new Dictionary<string, List<XunJianListData>>();
  410. areaList = new Dictionary<string, List<XunJianListData>>();
  411. for (int i = 0; i < xjDataList.Count; i++)
  412. {
  413. if (areaList.ContainsKey(xjDataList[i].inarea))
  414. {
  415. areaList[xjDataList[i].inarea].Add(xjDataList[i]);
  416. }
  417. else
  418. {
  419. areaList.Add(xjDataList[i].inarea, new List<XunJianListData>());
  420. areaList[xjDataList[i].inarea].Add(xjDataList[i]);
  421. }
  422. if (peopleList.ContainsKey(xjDataList[i].people))
  423. {
  424. peopleList[xjDataList[i].people].Add(xjDataList[i]);
  425. }
  426. else
  427. {
  428. peopleList.Add(xjDataList[i].people, new List<XunJianListData>());
  429. peopleList[xjDataList[i].people].Add(xjDataList[i]);
  430. }
  431. }
  432. callback(xjDataList);
  433. }
  434. else
  435. {
  436. Debug.LogError("获取巡检列表失败 " + jObject["code"].ToString());
  437. xjDataList = new List<XunJianListData>();
  438. if (WindowsManager.Instance.isTest)
  439. {
  440. xjDataList.Add(testData3());
  441. xjDataList.Add(testData());
  442. xjDataList.Add(testData2());
  443. }
  444. callback(xjDataList);
  445. }
  446. }));
  447. }
  448. List<XunJianListData> XunJianDataParetListData(List<XunJianData> data)
  449. {
  450. List<XunJianListData> listData = new List<XunJianListData>();
  451. for (int i = 0; i < data.Count; i++)
  452. {
  453. XunJianListData xj = new XunJianListData();
  454. xj.id = data[i].id.ToString();
  455. xj.projectname = data[i].name;
  456. xj.inarea = data[i].regionName;
  457. xj.projectState = ((ProjectStatus)data[i].status).ToString();
  458. xj.projectType = ((ProjectType)data[i].type).ToString();
  459. xj.projectTime = data[i].inspectionTime.ToString();
  460. xj.updateState = data[i].status > 3 ? "已更新" : "新项目";
  461. xj.listWall = data[i].listWall;
  462. switch (data[i].regionMapType)
  463. {
  464. case 0:
  465. xj.renwuModelType = RenWuModelType.None;
  466. break;
  467. case 1:
  468. xj.renwuModelType = RenWuModelType.SaoTu;
  469. break;
  470. case 2:
  471. xj.renwuModelType = RenWuModelType.DianYun;
  472. break;
  473. default:
  474. break;
  475. }
  476. listData.Add(xj);
  477. }
  478. return listData;
  479. }
  480. // 将Unix时间戳转换为DateTime对象
  481. DateTime UnixTimeStampToDateTime(long unixTimeStamp)
  482. {
  483. DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
  484. return epoch.AddSeconds(unixTimeStamp).ToLocalTime();
  485. }
  486. // 判断两个时间是否相差在24小时以内
  487. bool IsWithin24Hours(DateTime dateTime1, DateTime dateTime2)
  488. {
  489. TimeSpan difference = dateTime2 - dateTime1;
  490. return Math.Abs(difference.TotalHours) <= 24;
  491. }
  492. public class XunJianListData
  493. {
  494. public int nowIndex = 0;
  495. public string id;
  496. public string projectname;
  497. public string inarea; // 所在区域
  498. public string updateState; // 这个参数目前本地自己判断
  499. public string projectState;
  500. public string projectType;
  501. public string projectTime;
  502. // public List<RenWuItem> itemList;
  503. public List<XunJianTasks> tasksList;
  504. public RenWuModelType renwuModelType;
  505. public int regionMapType;
  506. public string url;
  507. public string people = "未知员工";
  508. public List<Wall> listWall;
  509. }
  510. public class XunJianData
  511. {
  512. public int id { get; set; }
  513. public string name { get; set; }
  514. public string regionId { get; set; }
  515. public string regionName { get; set; }
  516. public int type { get; set; }
  517. public int status { get; set; }
  518. public int inspectionTime { get; set; }
  519. /// <summary>
  520. /// 第一次发布时间
  521. /// </summary>
  522. public int firstPublishTime { get; set; }
  523. /// <summary>
  524. /// 当前发布时间
  525. /// </summary>
  526. public int publishTime { get; set; }
  527. /// <summary>
  528. /// 排序用的 状态 已逾期>即将开始>未到逾期提醒>进行中>已完成
  529. /// </summary>
  530. public int sort_status { get; set; }
  531. /// <summary>
  532. /// 当前项目状态 新项目>已更新>未更新项目
  533. /// </summary>
  534. public int sort_projectStatus { get; set; }
  535. /// <summary>
  536. /// 区域地图类型 默认0 1:2d 2:3d 点云
  537. /// </summary>
  538. public int regionMapType { get; set; }
  539. public List<EmployeesData> listEmployees { get; set; }
  540. public List<Wall> listWall { get; set; }
  541. }
  542. public class EmployeesData
  543. {
  544. public int id { get; set; }
  545. public string name { get; set; }
  546. public string number { get; set; }
  547. }
  548. public void GotoXunJian(XunJianListData xjld)
  549. {
  550. chooseXunJian = xjld;
  551. WindowsManager.Instance.show(WindowConfig.windowType.XunJianStart);
  552. JinRuRenwu.Instance.initStart();
  553. }
  554. public void gotoNext()
  555. {
  556. // if(chooseXunJian.itemList.Count-1 > chooseXunJian.nowIndex)
  557. if (chooseXunJian.tasksList.Count - 1 > chooseXunJian.nowIndex)
  558. {
  559. chooseXunJian.nowIndex++;
  560. if (JinRuRenwu.Instance != null)
  561. {
  562. JinRuRenwu.Instance.UpdateData();
  563. }
  564. if (RenWuListWindow.Instance != null)
  565. {
  566. RenWuListWindow.Instance.UpdateData();
  567. }
  568. if (CaoZuoLanManager.Instance)
  569. CaoZuoLanManager.Instance.nextInteractable(chooseXunJian.tasksList[chooseXunJian.nowIndex].confirmNormal);
  570. }
  571. else
  572. {
  573. List<string> backTip = new List<string>();
  574. JsonData data = new JsonData();
  575. data["type"] = "30001";
  576. backTip.Add("1");
  577. backTip.Add(data.ToJson());
  578. backTip.Add("3");
  579. WindowsManager.Instance.show(WindowConfig.windowType.Error, false, WindowsManager.Instance.getErrorData("提示", "已经是最后一步了!", Color.gray, "icon", backTip, false, "自动退出", 5,"","退出巡检","返回").ToJson());
  580. }
  581. }
  582. public void chooseItem(int i)
  583. {
  584. chooseXunJian.nowIndex = i;
  585. if (JinRuRenwu.Instance != null)
  586. {
  587. JinRuRenwu.Instance.UpdateData();
  588. }
  589. if (RenWuListWindow.Instance != null)
  590. {
  591. RenWuListWindow.Instance.UpdateData();
  592. }
  593. }
  594. public class RenWuItem
  595. {
  596. public string id;
  597. public int index;
  598. public bool isPaiZhao;
  599. public bool isYuanCheng;
  600. public string info;
  601. public List<RenWuTypeModel> typeList;
  602. public List<Vector3> roadList;
  603. public string imageUrl;
  604. public ImageFileSourceData imageData;
  605. public RenWuState state = RenWuState.None;
  606. }
  607. public class XunJianTasks
  608. {
  609. /// <summary>
  610. /// // 任务ID
  611. /// </summary>
  612. public int id { get; set; }
  613. /// <summary>
  614. /// 任务类型
  615. /// </summary>
  616. public int type { get; set; }
  617. /// <summary>
  618. /// 任务标题
  619. /// </summary>
  620. public string title { get; set; }
  621. /// <summary>
  622. /// 任务详情描述
  623. /// </summary>
  624. public string description { get; set; }
  625. /// <summary>
  626. /// 定位方式 1:标识图 2:定位器 目前两个都走一套逻辑
  627. /// </summary>
  628. public int targetingMethod { get; set; }
  629. /// <summary>
  630. /// 定位器编号
  631. /// </summary>
  632. public string locatorNumber { get; set; }
  633. /// <summary>
  634. /// 确认状态 如果是true 可以直接点下一步
  635. /// </summary>
  636. public bool confirmNormal { get; set; }
  637. /// <summary>
  638. /// 识别图列表
  639. /// </summary>
  640. public List<MinioResources> diagram { get; set; }
  641. /// <summary>
  642. /// 资源文件列表
  643. /// </summary>
  644. public List<MinioResources> resources { get; set; }
  645. /// <summary>
  646. /// 当前项目任务下标
  647. /// </summary>
  648. public int index { get; set; }
  649. /// <summary>
  650. /// 任务路径
  651. /// </summary>
  652. public List<Vector3> roadList { get; set; }
  653. public ImageFileSourceData imageData { get; set; }
  654. public RenWuState state = RenWuState.None;
  655. }
  656. public class MinioResources
  657. {
  658. public int id { get; set; }
  659. public string path { get; set; }
  660. public string uuid { get; set; }
  661. public int loadingMethod { get; set; }
  662. // public string name { get; set; }
  663. }
  664. public class RenWuTypeModel
  665. {
  666. public RenWuType type;
  667. public string id;
  668. public string url;
  669. public string info;
  670. }
  671. public class Wall
  672. {
  673. public List<Vector3> listPoint { get; set; }
  674. public Wall()
  675. {
  676. listPoint = new List<Vector3>();
  677. }
  678. }
  679. public enum RenWuState
  680. {
  681. None = 100001, // 未处理
  682. Success = 100002, // 成功
  683. Fail = 100003, // 失败
  684. }
  685. public enum RenWuType
  686. {
  687. Text = 100001, // 文字
  688. Image = 100002, // 图片
  689. Video = 100003, // 视频
  690. Model = 100004, // 模型
  691. }
  692. public enum RenWuModelType
  693. {
  694. SaoTu = 100001, // 扫图
  695. DingWeiBan = 100002, // 定位板
  696. DianYun = 100003, // 点云
  697. None = 100004, // 无
  698. }
  699. public enum ProjectType
  700. {
  701. 常规 =1,
  702. 异常 = 2
  703. }
  704. public enum ProjectStatus
  705. {
  706. 未开始 = 1,
  707. 即将开始 =2,
  708. 已逾期 = 3,
  709. 进行中 = 4,
  710. 已完成=5
  711. }
  712. }