SystemInitialize.cs 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693
  1. using DbCommon.BusinessCore.BaseCore;
  2. using DbCommon.Enties.DbModels;
  3. using ProjectManagementSystem.Common.Config;
  4. using ProjectManagementSystem.Common.Extenions;
  5. using ProjectManagementSystem.Common.Function;
  6. using ProjectManagementSystem.Common.Logger;
  7. using ProjectManagementSystem.Common.Models.Crms;
  8. using ProjectManagementSystem.Common.Service;
  9. using System;
  10. using System.Collections.Concurrent;
  11. using System.Collections.Generic;
  12. using System.IO;
  13. using System.Linq;
  14. using System.Text;
  15. using System.Threading.Tasks;
  16. using System.Xml.Serialization;
  17. namespace ProjectManagementSystem.Common.Core
  18. {
  19. public class SystemInitialize
  20. {
  21. public static ConcurrentDictionary<int, Station> MapStationDictionary { get; set; } = new ConcurrentDictionary<int, Station>();
  22. public static void SystemStarted()
  23. {
  24. var firstLoop = true;
  25. while (true)
  26. {
  27. try
  28. {
  29. var result = Crms.PmsApi.GetPmsBehavior();
  30. if (result != null)
  31. {
  32. if (!firstLoop)
  33. {
  34. System.Threading.Thread.Sleep(5000);
  35. }
  36. break;
  37. }
  38. firstLoop = false;
  39. }
  40. catch (Exception ex)
  41. {
  42. CLog.Instance.SystemLog.WriteExceptionCaller(ex);
  43. }
  44. System.Threading.Thread.Sleep(5000);
  45. }
  46. }
  47. public static bool InitDataSource()
  48. {
  49. try
  50. {
  51. AsyncBehaviorManager asyncBehaviorManager = new AsyncBehaviorManager();
  52. asyncBehaviorManager.Init();
  53. WareHouseManager wareHouseManager = new WareHouseManager();
  54. wareHouseManager.Init();
  55. LocationPropertyManager locationPropertyManager = new LocationPropertyManager();
  56. locationPropertyManager.Init();
  57. MaterialDetailManager materialDetailManager = new MaterialDetailManager();
  58. materialDetailManager.Init();
  59. //CallTaskManager callTaskManager = new CallTaskManager();
  60. //callTaskManager.Init();
  61. //callTaskManager.DeleteOldData();
  62. MaterialBindingManager materialBindingManager = new MaterialBindingManager();
  63. materialBindingManager.Init();
  64. PmsTaskInfoManager pmsTaskInfoManger = new PmsTaskInfoManager();
  65. pmsTaskInfoManger.Init();
  66. pmsTaskInfoManger.DeleteOldData();
  67. //AgvMaterialBindingManager agvMaterialBindingManager = new AgvMaterialBindingManager();
  68. //agvMaterialBindingManager.Init();
  69. AreaTrafficManager areaTrafficManager = new AreaTrafficManager();
  70. areaTrafficManager.Init();
  71. return true;
  72. }
  73. catch (Exception ex)
  74. {
  75. CLog.Instance.SystemLog.WriteExceptionCaller(ex);
  76. }
  77. return false;
  78. }
  79. public static bool InitWMS()
  80. {
  81. try
  82. {
  83. CLog.Instance.SystemLog.WriteInfo("同步WMS信息...");
  84. LocationPropertyManager locationManager = new LocationPropertyManager();
  85. WareHouseManager wareHouseManager = new WareHouseManager();
  86. //从基础配置表里获取库位信息
  87. var wHouses = ExcelConfig.Instance.RouteConfigList
  88. .Where(d => !string.IsNullOrEmpty(d.WareHouseCode))
  89. .Select(d => d.WareHouseCode)
  90. .Distinct()
  91. .ToList();
  92. var wHousesInsertList = new List<WareHouse>();
  93. var wHouseList = wareHouseManager.GetList();
  94. foreach (var item in wHouses)
  95. {
  96. var data = wHouseList.FirstOrDefault(d => d.WareHouseCode == item);
  97. if (data == null)
  98. {
  99. var data2 = new WareHouse();
  100. data2.WareHouseCode = item;
  101. data2.WareHouseName = item;
  102. wHousesInsertList.Add(data2);
  103. }
  104. }
  105. if (wHousesInsertList.Count > 0)
  106. {
  107. wareHouseManager.Insert(wHousesInsertList);
  108. }
  109. //仓位
  110. var configs = ExcelConfig.Instance.RouteConfigList
  111. .Where(d => !string.IsNullOrEmpty(d.WareHouseCode) && !string.IsNullOrEmpty(d.LocationCode) && d.StationID > 0);
  112. var insertList = new List<LocationProperty>();
  113. var updateList = new List<LocationProperty>();
  114. var locationList = locationManager.GetList();
  115. foreach (var item in configs)
  116. {
  117. if (string.IsNullOrWhiteSpace(item.Area))
  118. {
  119. item.Area = item.WareHouseCode;
  120. }
  121. var data = locationList.FirstOrDefault(d => d.LocationCode == item.LocationCode);
  122. if (data == null)
  123. {
  124. var data2 = new LocationProperty();
  125. data2.WareHouseCode = item.WareHouseCode;
  126. data2.LocationCode = item.LocationCode;
  127. data2.Mark = item.StationID;
  128. data2.Active = "N";
  129. data2.ModifyUser = "xjh";
  130. data2.ModifyTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
  131. data2.Area = item.Area;
  132. data2.RowIndex = item.RowIndex;
  133. data2.ColumnIndex = item.ColumnIndex;
  134. insertList.Add(data2);
  135. }
  136. else
  137. {
  138. if (data.Mark != item.StationID
  139. || data.WareHouseCode != item.WareHouseCode
  140. || data.Area != item.Area
  141. || data.RowIndex != item.RowIndex
  142. || data.ColumnIndex != item.ColumnIndex)
  143. {
  144. data.Mark = item.StationID;
  145. data.WareHouseCode = item.WareHouseCode;
  146. data.Area = item.Area;
  147. data.RowIndex = item.RowIndex;
  148. data.ColumnIndex = item.ColumnIndex;
  149. updateList.Add(data);
  150. }
  151. }
  152. }
  153. if (insertList.Count > 0)
  154. {
  155. locationManager.Insert(insertList);
  156. }
  157. if (updateList.Count > 0)
  158. {
  159. locationManager.Update(updateList);
  160. }
  161. CLog.Instance.SystemLog.WriteInfo("同步WMS信息完毕");
  162. return true;
  163. }
  164. catch (Exception ex)
  165. {
  166. CLog.Instance.SystemLog.WriteExceptionCaller(ex);
  167. }
  168. return false;
  169. }
  170. public static bool InitSWMS()
  171. {
  172. try
  173. {
  174. CLog.Instance.SystemLog.WriteInfo("同步SWMS信息...");
  175. //仓库
  176. var wHouseList = Crms.SWmsApi.GetAllWarehouse();
  177. var wHouses = ExcelConfig.Instance.RouteConfigList
  178. .Where(d => !string.IsNullOrEmpty(d.WareHouseCode))
  179. .Select(d => d.WareHouseCode)
  180. .Distinct()
  181. .ToList();
  182. foreach (var item in wHouses)
  183. {
  184. var data = wHouseList.FirstOrDefault(d => d.warehouseId == item);
  185. if (data == null)
  186. {
  187. var data2 = new SWmsWarehouse();
  188. data2.warehouseId = item;
  189. data2.warehouseName = item;
  190. var result = Crms.SWmsApi.AddWarehouse(data2, out var content);
  191. if (!result)
  192. {
  193. CLog.Instance.SystemLog.WriteInfo($"添加仓库配置失败 {content}");
  194. }
  195. }
  196. }
  197. //区域
  198. var areaList = Crms.SWmsApi.GetAllArea();
  199. var areas = ExcelConfig.Instance.RouteConfigList
  200. .Where(d => !string.IsNullOrEmpty(d.Area))
  201. .Select(d => d.Area)
  202. .Distinct()
  203. .ToList();
  204. foreach (var item in areas)
  205. {
  206. var data = areaList.FirstOrDefault(d => d.areaId == item);
  207. if (data == null)
  208. {
  209. var data2 = new SWmsArea();
  210. data2.areaId = item;
  211. data2.areaName = item;
  212. var result = Crms.SWmsApi.AddArea(data2, out var content);
  213. if (!result)
  214. {
  215. CLog.Instance.SystemLog.WriteInfo($"添加区域配置失败 {content}");
  216. }
  217. }
  218. }
  219. //库位状态
  220. var statusList = Crms.SWmsApi.GetAllLocationStatus();
  221. //var statusArray = typeof(LocationStatus).GetEnumValues();
  222. var statusArray = new LocationStatus[] { LocationStatus.None };
  223. foreach (var item in statusArray)
  224. {
  225. var statusCode = item.ToValue<int>().ToString();
  226. var data = statusList.FirstOrDefault(d => d.statusCode == statusCode);
  227. if (data == null)
  228. {
  229. var data2 = new SWmsLocationStatus();
  230. data2.statusCode = statusCode;
  231. data2.zh_CN = item.ToStatusString();
  232. data2.zh_HK = "";
  233. data2.en_US = "";
  234. data2.active = true;
  235. var result = Crms.SWmsApi.AddLocationStatus(data2, out var content);
  236. if (!result)
  237. {
  238. CLog.Instance.SystemLog.WriteInfo($"添加库位状态配置失败 {content}");
  239. }
  240. }
  241. }
  242. #region 8723屏蔽
  243. //货物模型
  244. //var freightShapeList = Crms.SWmsApi.GetAllFreightShape();
  245. //var goodsArray = new string[] { "默认货物", "空料车", "满料车" };
  246. //foreach (var item in goodsArray)
  247. //{
  248. // var data = freightShapeList.FirstOrDefault(d => d.shapeName == item);
  249. // if (data == null)
  250. // {
  251. // var data2 = new SWmsFreightShape();
  252. // data2.shapeName = item;
  253. // data2.shapeType = 1;
  254. // data2.freightIcon = 3;
  255. // data2.maxLength = 1000;
  256. // data2.maxWidth = 1000;
  257. // data2.rotateWithCarrier = true;
  258. // data2.viewRatio = 100;
  259. // var result = Crms.SWmsApi.AddFreightShape(data2, out var content);
  260. // if (!result)
  261. // {
  262. // CLog.Instance.SystemLog.WriteInfo($"添加货物模型失败 {content}");
  263. // }
  264. // }
  265. //}
  266. //freightShapeList = Crms.SWmsApi.GetAllFreightShape();
  267. //var goodsList = Crms.SWmsApi.GetAllGoods();
  268. //foreach (var item in goodsArray)
  269. //{
  270. // var data = goodsList.FirstOrDefault(d => d.goodsCode == item);
  271. // if (data == null)
  272. // {
  273. // var data2 = new SWmsGoods();
  274. // data2.goodsCode = item;
  275. // data2.goodsName = item;
  276. // data2.goodsShape = freightShapeList.FirstOrDefault(d => d.shapeName == item)?.id ?? 0;
  277. // var result = Crms.SWmsApi.AddGoods(data2, out var content);
  278. // if (!result)
  279. // {
  280. // CLog.Instance.SystemLog.WriteInfo($"添加货物失败 {content}");
  281. // }
  282. // }
  283. //}
  284. #endregion
  285. //库位
  286. var locationList = Crms.SWmsApi.GetAllLocation();
  287. var configs = ExcelConfig.Instance.RouteConfigList
  288. .Where(d => !string.IsNullOrEmpty(d.WareHouseCode) && !string.IsNullOrEmpty(d.LocationCode) && d.StationID > 0);
  289. foreach (var item in configs)
  290. {
  291. if (string.IsNullOrWhiteSpace(item.Area))
  292. {
  293. item.Area = item.WareHouseCode;
  294. }
  295. var rowText = item.RowIndex > 0 ? item.RowIndex.ToString("D4") : string.Empty;
  296. var colText = item.ColumnIndex > 0 ? item.ColumnIndex.ToString("D4") : string.Empty;
  297. var data = locationList.FirstOrDefault(d => d.locationId == item.LocationCode);
  298. if (data == null)
  299. {
  300. var data2 = new SWmsLocation();
  301. data2.warehouseId = item.WareHouseCode;
  302. data2.areaId = item.Area;
  303. data2.locationId = item.LocationCode;
  304. data2.locationName = item.LocationCode;
  305. data2.enable = true;
  306. data2.row = rowText;
  307. data2.column = colText;
  308. var result = Crms.SWmsApi.AddLocation(data2, out var content);
  309. if (!result)
  310. {
  311. CLog.Instance.SystemLog.WriteInfo($"添加库位失败 {content}");
  312. }
  313. }
  314. else if (data.warehouseId != item.WareHouseCode
  315. || data.areaId != item.Area
  316. || data.row != rowText
  317. || data.column != colText)
  318. {
  319. data.warehouseId = item.WareHouseCode;
  320. data.areaId = item.Area;
  321. data.row = rowText;
  322. data.column = colText;
  323. var result = Crms.SWmsApi.UpdateLocation(data, out var content);
  324. if (!result)
  325. {
  326. CLog.Instance.SystemLog.WriteInfo($"更新库位失败 {content}");
  327. }
  328. }
  329. }
  330. CLog.Instance.SystemLog.WriteInfo("同步SWMS信息完毕");
  331. return true;
  332. }
  333. catch (Exception ex)
  334. {
  335. CLog.Instance.SystemLog.WriteExceptionCaller(ex);
  336. }
  337. return false;
  338. }
  339. public static bool InitWareHouse()
  340. {
  341. try
  342. {
  343. CLog.Instance.SystemLog.WriteInfo("同步任务点信息...");
  344. var whouseInfoList = Crms.PmsApi.GetWarehouseListInfo(string.Empty);
  345. if (whouseInfoList == null)
  346. {
  347. CLog.Instance.SystemLog.WriteError("获取库位活动点失败,请检查CRMS是否启动");
  348. return false;
  349. }
  350. var whouseGroupTypeList = Crms.PmsApi.GetwarehouseGroupType();
  351. if (whouseGroupTypeList == null)
  352. {
  353. CLog.Instance.SystemLog.WriteError("获取库位组信息失败,请检查CRMS是否启动");
  354. return false;
  355. }
  356. //WarehouseType -> GroupId
  357. Dictionary<string, string> whouseTypeGroupIdDict = new Dictionary<string, string>();
  358. for (int i = 0; i < whouseGroupTypeList.Count; i++)
  359. {
  360. var whouseGroupType = whouseGroupTypeList[i];
  361. if (!whouseTypeGroupIdDict.ContainsKey(whouseGroupType.WareHouseType))
  362. {
  363. whouseTypeGroupIdDict.Add(whouseGroupType.WareHouseType, whouseGroupType.GroupId);
  364. }
  365. }
  366. //仓位
  367. var configs = ExcelConfig.Instance.RouteConfigList
  368. .Where(d => /*!string.IsNullOrEmpty(d.WareHouseCode) &&*/ !string.IsNullOrEmpty(d.LocationCode) && d.StationID > 0);
  369. foreach (var item in configs)
  370. {
  371. if (item.StationID <= 0)
  372. {
  373. continue;
  374. }
  375. string groupId = !string.IsNullOrEmpty(item.WarehouseGroupType) && whouseTypeGroupIdDict.TryGetValue(item.WarehouseGroupType, out var info) ?
  376. info : string.Empty;
  377. int findIndex = whouseInfoList.FindIndex(d => d.WareHouseID == item.LocationCode);
  378. if (findIndex < 0)
  379. {
  380. //添加
  381. Crms.PmsApi.AddWarehouse(
  382. item.LocationCode,
  383. item.StationID,
  384. item.RelationStationID1,
  385. item.RelationStationID2,
  386. item.RelationStationID3,
  387. groupId);
  388. }
  389. else
  390. {
  391. //更新
  392. var requestInfo = whouseInfoList[findIndex];
  393. if (requestInfo.StationID != item.StationID
  394. || (requestInfo.RelationStationID1 ?? 0) != item.RelationStationID1
  395. || (requestInfo.RelationStationID2 ?? 0) != item.RelationStationID2
  396. || (requestInfo.RelationStationID3 ?? 0) != item.RelationStationID3
  397. || (requestInfo.GroupId ?? "") != groupId)
  398. {
  399. var result = Crms.PmsApi.UpdateWarehouse(
  400. item.LocationCode,
  401. item.StationID,
  402. item.RelationStationID1,
  403. item.RelationStationID2,
  404. item.RelationStationID3,
  405. groupId);
  406. if (!result)
  407. {
  408. CLog.Instance.SystemLog.WriteInfo($"更新库位信息失败 {requestInfo.WareHouseID}");
  409. }
  410. }
  411. }
  412. }
  413. CLog.Instance.SystemLog.WriteInfo("同步任务点信息完毕");
  414. return true;
  415. }
  416. catch (Exception ex)
  417. {
  418. CLog.Instance.SystemLog.WriteExceptionCaller(ex);
  419. }
  420. return false;
  421. }
  422. public static void InitOperate()
  423. {
  424. try
  425. {
  426. var operateInfoList = Crms.PmsApi.GetOperateList(string.Empty);
  427. if (operateInfoList == null)
  428. {
  429. CLog.Instance.SystemLog.WriteError("获取操作码列表失败,请检查CRMS是否启动");
  430. return;
  431. }
  432. var vaules = TaskBehavior.BehaviorDict.Values.OrderBy(d => d.Behavior);
  433. foreach (var item in vaules)
  434. {
  435. //添加或更新到PMS行为码动作列表(WEB)
  436. AddOrUpdateOperate(item, operateInfoList);
  437. }
  438. }
  439. catch (Exception ex)
  440. {
  441. CLog.Instance.SystemLog.WriteException("TaskBookRegister", ex);
  442. }
  443. }
  444. private static void AddOrUpdateOperate(BaseTaskBookBehaviorV2 item, List<OperateInfo> operateInfoList)
  445. {
  446. var name = string.IsNullOrWhiteSpace(item.Name) ? item.Behavior.ToString() : item.Name;
  447. var behavior = item.Behavior;
  448. var remark = item.Remark;
  449. int findIndex = operateInfoList.FindIndex(d => d.Name == name);
  450. if (findIndex < 0)
  451. {
  452. //添加
  453. Crms.PmsApi.AddOperate(name, behavior, remark);
  454. }
  455. else
  456. {
  457. //更新
  458. var operateInfo = operateInfoList[findIndex];
  459. if (operateInfo.Code != behavior
  460. || operateInfo.Remark != remark)
  461. {
  462. operateInfo.Code = behavior;
  463. operateInfo.Remark = remark;
  464. Crms.PmsApi.UpdateOperate(operateInfo);
  465. }
  466. }
  467. }
  468. public static void InitAsyncBehavior()
  469. {
  470. try
  471. {
  472. CLog.Instance.SystemLog.WriteInfo("初始化异步行为码...");
  473. AsyncBehaviorManager asyncBehaviorManager = new AsyncBehaviorManager();
  474. var dataList = asyncBehaviorManager.GetList();
  475. foreach (var item in dataList)
  476. {
  477. var asyncBehavior = InstanceConstructor.GetInstance<AsyncBehavior>(item.AssemblyString, item.FullClassName);
  478. if (asyncBehavior == null)
  479. {
  480. CLog.Instance.SystemLog.WriteInfo($"创建异步行为码实例为空 {item.FullClassName}");
  481. continue;
  482. }
  483. asyncBehavior.Id = item.Id;
  484. asyncBehavior.TaskID = item.TaskID;
  485. asyncBehavior.AgvId = item.AgvId;
  486. asyncBehavior.Behavior = item.Behavior;
  487. asyncBehavior.Interval = item.Interval;
  488. asyncBehavior.MaxStepId = item.MaxStepId;
  489. asyncBehavior.FirstStart = item.FirstStart;
  490. asyncBehavior.Start();
  491. }
  492. CLog.Instance.SystemLog.WriteInfo("初始化异步行为码完毕");
  493. }
  494. catch (Exception ex)
  495. {
  496. CLog.Instance.SystemLog.WriteExceptionCaller(ex);
  497. }
  498. }
  499. public static bool InitLocationXY()
  500. {
  501. var RouteConfigList = ExcelConfig.Instance.RouteConfigList;
  502. while (true)
  503. {
  504. try
  505. {
  506. var mapData = Crms.PmsApi.GetMapData();
  507. if (mapData != null)
  508. {
  509. foreach (var item in mapData.Stations)
  510. {
  511. MapStationDictionary.AddOrUpdate(item.Index, item, (k, v) => item);
  512. }
  513. for (int i = 0; i < RouteConfigList.Count; i++)
  514. {
  515. var item = RouteConfigList[i];
  516. if (MapStationDictionary.TryGetValue(item.StationID, out var mapStationInfo) && mapStationInfo != null)
  517. {
  518. item.X = mapStationInfo.Vertex.X;
  519. item.Y = mapStationInfo.Vertex.Y;
  520. item.GraphVertex = mapStationInfo.Vertex.Number;
  521. }
  522. else
  523. {
  524. CLog.Instance.SystemLog.WriteInfo($"从地图数据中找不到活动站点 {item.LocationCode} {item.StationID}");
  525. }
  526. }
  527. break;
  528. }
  529. else
  530. {
  531. CLog.Instance.SystemLog.WriteInfo("获取地图数据失败");
  532. }
  533. }
  534. catch (Exception ex)
  535. {
  536. CLog.Instance.SystemLog.WriteExceptionCaller(ex);
  537. }
  538. System.Threading.Thread.Sleep(5000);
  539. }
  540. CLog.Instance.SystemLog.WriteInfo("获取地图数据完毕");
  541. return true;
  542. }
  543. public static void InitPmsAutoupdateXml()
  544. {
  545. try
  546. {
  547. string s = System.Reflection.Assembly.GetExecutingAssembly().Location;
  548. FileInfo finfo = new FileInfo(s);
  549. string currPath = finfo.DirectoryName;
  550. string configFile = Path.Combine(currPath, "pms.xml");
  551. var PmsConfig = new PmsAutoupdateConfig();
  552. PmsConfig.Version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
  553. PmsConfig.Url = AppSetting.GetAutoUpdateUrl().Replace("xml", "zip");
  554. string xml = XmlTools.XmlSerialize(PmsConfig);
  555. using (TextWriter tw = new StreamWriter(configFile))
  556. {
  557. tw.Write(xml);
  558. }
  559. string dataFile = Path.Combine(currPath, "pms.zip");
  560. if (File.Exists(dataFile))
  561. {
  562. File.Delete(dataFile);
  563. }
  564. List<string> fileList = new List<string>();
  565. DirectoryInfo theFolder = new DirectoryInfo(currPath);
  566. FileInfo[] fileInfos = theFolder.GetFiles();
  567. //遍历文件
  568. foreach (FileInfo fileInfo in fileInfos)
  569. {
  570. if (fileInfo.Extension == ".config"
  571. || fileInfo.Name.Contains("vshost"))
  572. {
  573. continue;
  574. }
  575. if (fileInfo.Name.StartsWith("ProjectManagementSystem")
  576. || fileInfo.Name.StartsWith("DbCommon"))
  577. {
  578. fileList.Add(fileInfo.FullName);
  579. }
  580. }
  581. ZipUtility zipUtility = new ZipUtility();
  582. zipUtility.ZipFileFromFiles(currPath, fileList, dataFile, 9);
  583. }
  584. catch (Exception)
  585. {
  586. }
  587. }
  588. [XmlRoot("item")]
  589. public class PmsAutoupdateConfig
  590. {
  591. [XmlElement("version")]
  592. public string Version { get; set; }
  593. [XmlElement("url")]
  594. public string Url { get; set; }
  595. }
  596. }
  597. }