ExcelConfig.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678
  1. using Microsoft.CSharp.RuntimeBinder;
  2. using MiniExcelLibs;
  3. using MiniExcelLibs.Attributes;
  4. using ProjectManagementSystem.Common.Extenions;
  5. using ProjectManagementSystem.Common.Function;
  6. using ProjectManagementSystem.Common.Logger;
  7. using System;
  8. using System.Collections.Concurrent;
  9. using System.Collections.Generic;
  10. using System.Data;
  11. using System.Dynamic;
  12. using System.IO;
  13. using System.Linq;
  14. using System.Linq.Expressions;
  15. using System.Reflection;
  16. using System.Runtime.CompilerServices;
  17. using System.Text;
  18. using System.Threading.Tasks;
  19. using System.Xml.Serialization;
  20. namespace ProjectManagementSystem.Common.Config
  21. {
  22. public class ExcelConfig
  23. {
  24. private static ExcelConfig m_instance;
  25. private static readonly object m_locker = new object();
  26. public static ExcelConfig Instance
  27. {
  28. get
  29. {
  30. if (m_instance == null)
  31. {
  32. lock (m_locker)
  33. {
  34. if (m_instance == null)
  35. {
  36. m_instance = new ExcelConfig();
  37. if (!m_instance.Load())
  38. {
  39. m_instance = null;
  40. }
  41. }
  42. }
  43. }
  44. return m_instance;
  45. }
  46. }
  47. private ConcurrentDictionary<string, string> m_locationAddressDict;
  48. public Dictionary<string, RouteConfig> RouteConfigDictionary { get; private set; } = new Dictionary<string, RouteConfig>();
  49. public List<RouteConfig> RouteConfigList { get; private set; }
  50. public List<AreaConfig> AreaConfigList { get; private set; }
  51. public List<PlcBehavior> PlcBehaviorList { get; private set; }
  52. public List<TaskRely> TaskRelyList { get; private set; }
  53. public List<TaskMatch> TaskMatchList { get; private set; }
  54. public List<TaskStatusMatch> TaskStatusMatchList { get; private set; }
  55. public List<VcuAlarmInfo> VcuAlarmInfoList { get; private set; }
  56. public IEnumerable<IDictionary<string, object>> RouteConfigDicts { get; private set; }
  57. public Dictionary<string, CButton> ButtonPropertyDict { get; set; }
  58. public Dictionary<string, ColumnKeyInfo> ColumnKeyInfoDict { get; set; } = new Dictionary<string, ColumnKeyInfo>();
  59. public Dictionary<int, VcuAlarmInfo> VcuAlarmInfoDict { get; set; } = new Dictionary<int, VcuAlarmInfo>();
  60. public List<LineCallPrority> LineCallProrityList { get; private set; }
  61. public List<InfoPlc> InfoPlcList { get; private set; }
  62. public List<LineInfo> LineInfoList { get; private set; }
  63. public List<TrafficInfo> TrafficList { get; private set; }
  64. public string CurrentPath { get; private set; }
  65. private ExcelConfig()
  66. {
  67. m_locationAddressDict = new ConcurrentDictionary<string, string>();
  68. ButtonPropertyDict = new Dictionary<string, CButton>();
  69. }
  70. public RouteConfig GetRouteConfig(string location)
  71. {
  72. if (string.IsNullOrEmpty(location)) return null;
  73. RouteConfigDictionary.TryGetValue(location, out RouteConfig routeConfig);
  74. return routeConfig;
  75. }
  76. public VcuAlarmInfo GetVcuAlarmInfo(int id)
  77. {
  78. VcuAlarmInfoDict.TryGetValue(id, out var vcuAlarmInfo);
  79. return vcuAlarmInfo;
  80. }
  81. public void SaveExcel(string fileName, object data)
  82. {
  83. MiniExcel.SaveAs(fileName, data);
  84. }
  85. /// <summary>
  86. /// 根据库位号和列名,获取文本
  87. /// </summary>
  88. /// <param name="location">库位号</param>
  89. /// <param name="member">列名</param>
  90. /// <returns></returns>
  91. private string GetLocationMember(string location, string member)
  92. {
  93. var item = RouteConfigDicts.FirstOrDefault(d => d.ContainsKey("库位号") && d["库位号"].ToString() == location);
  94. if (item != null
  95. && item.ContainsKey(member))
  96. {
  97. return item[member]?.ToString();
  98. }
  99. return null;
  100. }
  101. public string GetLocationMemberCache(string location, string member)
  102. {
  103. string key = $"{location}-{member}";
  104. if (m_locationAddressDict.ContainsKey(key))
  105. {
  106. return m_locationAddressDict[key];
  107. }
  108. else
  109. {
  110. string realAddr = GetLocationMember(location, member);
  111. m_locationAddressDict.AddOrUpdate(key, realAddr, (oldKey, oldValue) => realAddr);
  112. return realAddr;
  113. }
  114. }
  115. public bool SaveButtonPropertyList()
  116. {
  117. try
  118. {
  119. string sLocation = System.Reflection.Assembly.GetExecutingAssembly().Location;
  120. FileInfo finfo = new FileInfo(sLocation);
  121. string currPath = finfo.DirectoryName;
  122. string xmlFilePath = Path.Combine(currPath, "CButtonTemplate.xml");
  123. var list = ButtonPropertyDict.Values.ToList();
  124. XmlSerializer serializer = new XmlSerializer(list.GetType());
  125. using (TextWriter tw = new StreamWriter(xmlFilePath))
  126. {
  127. serializer.Serialize(tw, list);
  128. }
  129. return true;
  130. }
  131. catch (Exception)
  132. {
  133. return false;
  134. }
  135. }
  136. public object GetProperty(object o, string member)
  137. {
  138. if (o == null) throw new ArgumentNullException("o");
  139. if (member == null) throw new ArgumentNullException("member");
  140. Type scope = o.GetType();
  141. IDynamicMetaObjectProvider provider = o as IDynamicMetaObjectProvider;
  142. if (provider != null)
  143. {
  144. ParameterExpression param = Expression.Parameter(typeof(object));
  145. DynamicMetaObject mobj = provider.GetMetaObject(param);
  146. GetMemberBinder binder = (GetMemberBinder)Microsoft.CSharp.RuntimeBinder.Binder.GetMember(0, member, scope, new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(0, null) });
  147. DynamicMetaObject ret = mobj.BindGetMember(binder);
  148. BlockExpression final = Expression.Block(
  149. Expression.Label(CallSiteBinder.UpdateLabel),
  150. ret.Expression
  151. );
  152. LambdaExpression lambda = Expression.Lambda(final, param);
  153. Delegate del = lambda.Compile();
  154. return del.DynamicInvoke(o);
  155. }
  156. else
  157. {
  158. return o.GetType().GetProperty(member, BindingFlags.Public | BindingFlags.Instance).GetValue(o, null);
  159. }
  160. }
  161. private bool Load()
  162. {
  163. try
  164. {
  165. string sLocation = System.Reflection.Assembly.GetExecutingAssembly().Location;
  166. FileInfo finfo = new FileInfo(sLocation);
  167. CurrentPath = finfo.DirectoryName;
  168. string currPath = finfo.DirectoryName;
  169. string dataPath = Path.Combine(currPath, "PMS", "Config");
  170. string dataFile = Path.Combine(dataPath, "基础配置表.xlsx");
  171. /* 如果没有数据路径,则创建该路径 */
  172. if (false == Directory.Exists(dataPath))
  173. {
  174. Directory.CreateDirectory(dataPath);
  175. }
  176. var sheets = MiniExcel.GetSheetNames(dataFile);
  177. if(sheets.Contains("表格显示"))
  178. {
  179. var rows = MiniExcel.Query<ColumnKeyInfo>(dataFile, sheetName: "表格显示");
  180. foreach (var item in rows)
  181. {
  182. if(!ColumnKeyInfoDict.ContainsKey(item.Name))
  183. {
  184. ColumnKeyInfoDict.Add(item.Name, item);
  185. }
  186. }
  187. }
  188. RouteConfigDicts = MiniExcel.Query(dataFile, true, sheetName: "线路配置").Cast<IDictionary<string, object>>();
  189. RouteConfigList = MiniExcel.Query<RouteConfig>(dataFile, sheetName: "线路配置").ToList();
  190. InfoPlcList = MiniExcel.Query<InfoPlc>(dataFile, sheetName: "线路配置")
  191. .Where(d => !string.IsNullOrEmpty(d.IP地址))
  192. .ToList();
  193. AreaConfigList = MiniExcel.Query<AreaConfig>(dataFile, sheetName: "区域配置").ToList();
  194. PlcBehaviorList = MiniExcel.Query<PlcBehavior>(dataFile, sheetName: "PLC行为码").ToList();
  195. TaskRelyList = MiniExcel.Query<TaskRely>(dataFile, sheetName: "任务依赖").ToList();
  196. LineCallProrityList = MiniExcel.Query<LineCallPrority>(dataFile, sheetName: "叫料优先级").ToList();
  197. if (sheets.Contains("任务匹配"))
  198. {
  199. TaskMatchList = MiniExcel.Query<TaskMatch>(dataFile, sheetName: "任务匹配").ToList();
  200. }
  201. if (sheets.Contains("任务状态"))
  202. {
  203. TaskStatusMatchList = MiniExcel.Query<TaskStatusMatch>(dataFile, sheetName: "任务状态").ToList();
  204. }
  205. if (sheets.Contains("报警信息"))
  206. {
  207. VcuAlarmInfoList = MiniExcel.Query<VcuAlarmInfo>(dataFile, sheetName: "报警信息").ToList();
  208. foreach (var item in VcuAlarmInfoList)
  209. {
  210. if (item.AlarmId <= 0) continue;
  211. if (!VcuAlarmInfoDict.ContainsKey(item.AlarmId))
  212. {
  213. VcuAlarmInfoDict.Add(item.AlarmId, item);
  214. }
  215. }
  216. }
  217. foreach (var item in RouteConfigList)
  218. {
  219. if (string.IsNullOrEmpty(item.LocationCode)) continue;
  220. if (!RouteConfigDictionary.ContainsKey(item.LocationCode))
  221. {
  222. RouteConfigDictionary.Add(item.LocationCode, item);
  223. }
  224. }
  225. foreach (var item in RouteConfigList)
  226. {
  227. item.LesRoutes = item.LesRouteStr.ToValueArray<int>();
  228. item.LesPodTypes = item.LesPodTypeStr.ToValueArray<string>();
  229. }
  230. foreach (var item in PlcBehaviorList)
  231. {
  232. item.DbAddressRead = item.DbAddressReadStr.ToValueArray<string>();
  233. item.DbAddressWrite = item.DbAddressWriteStr.ToValueArray<string>();
  234. item.DbAddressFinalWrite = item.DbAddressFinalWriteStr.ToValueArray<string>();
  235. //item.DbValueRead = item.DbValueReadStr.ToBoolArray();
  236. //item.DbValueWrite = item.DbValueWriteStr.ToBoolArray();
  237. //item.DbValueFinalWrite = item.DbValueFinalWriteStr.ToBoolArray();
  238. if(item.IsIOTrans)
  239. {
  240. item.DbValueReadIO = item.DbValueReadStr.ToValueArray<ushort>();
  241. item.DbValueWriteIO = item.DbValueWriteStr.ToValueArray<ushort>();
  242. item.DbValueFinalWriteIO = item.DbValueFinalWriteStr.ToValueArray<ushort>();
  243. }
  244. }
  245. foreach (var item in AreaConfigList)
  246. {
  247. item.GraphVertexs = item.GraphVertexStr.ToValueArray<int>();
  248. item.GraphEdges = item.GraphEdgeStr.ToValueArray<int>();
  249. }
  250. foreach (var item in TaskRelyList)
  251. {
  252. item.EndWareHouse = item.EndWareHouseStr.ToValueArray<string>();
  253. }
  254. foreach (var item in LineCallProrityList)
  255. {
  256. item.CalledLocations = item.CalledLocationStr.ToValueArray<string>();
  257. }
  258. //
  259. string dataFile2 = Path.Combine(dataPath, "类型一.xlsx");
  260. if(File.Exists(dataFile2))
  261. {
  262. LineInfoList = MiniExcel.Query<LineInfo>(dataFile2, sheetName: "线体信息").ToList();
  263. TrafficList = MiniExcel.Query<TrafficInfo>(dataFile2, sheetName: "管制信息").ToList();
  264. foreach (var item in LineInfoList)
  265. {
  266. item.DetailTable = MiniExcel.QueryAsDataTable(dataFile2, sheetName: item.Name);
  267. }
  268. foreach (var item in TrafficList)
  269. {
  270. item.Marks = item.MarksString.ToValueArray<int>();
  271. item.ExtraMarks = item.ExtraMarksString.ToValueArray<int>();
  272. }
  273. }
  274. //else
  275. //{
  276. // WareHouseManager wareHouseManager = new WareHouseManager();
  277. // var wareHouseList = wareHouseManager.GetList();
  278. // for (int i = 0; i < wareHouseList.Count; i++)
  279. // {
  280. // var wareHouse = wareHouseList[i];
  281. // if (!m_wareHouseDict.ContainsKey(wareHouse.WareHouseCode))
  282. // {
  283. // m_wareHouseDict.Add(wareHouse.WareHouseCode, wareHouse.WareHouseName);
  284. // }
  285. // }
  286. // MaterialDetailManager materialDetailManager = new MaterialDetailManager();
  287. // var materialDetailList = materialDetailManager.GetList();
  288. // for (int i = 0; i < materialDetailList.Count; i++)
  289. // {
  290. // var mData = materialDetailList[i];
  291. // string[] materialIdArray = mData.MaterialId.Split(new char[] { '|' });
  292. // string[] materialNameArray = mData.MaterialName.Split(new char[] { '|' });
  293. // string[] materialNumberArray = mData.MaterialNumber.Split(new char[] { '|' });
  294. // for (int index = 0; index < materialIdArray.Length; index++)
  295. // {
  296. // MaterialDetail materialDetail = new MaterialDetail();
  297. // materialDetail.WareHouseCode = mData.WareHouseCode;
  298. // materialDetail.LocationCode = mData.LocationCode;
  299. // materialDetail.MaterialId = materialIdArray[index];
  300. // materialDetail.MaterialName = materialNameArray[index];
  301. // materialDetail.MaterialNumber = materialNumberArray[index];
  302. // MaterialDetailList.Add(materialDetail);
  303. // if (!m_materailDict.ContainsKey(materialDetail.MaterialId))
  304. // {
  305. // m_materailDict.Add(materialDetail.MaterialId, materialDetail.MaterialName);
  306. // }
  307. // }
  308. // }
  309. //}
  310. //加载布局
  311. string xmlFilePath = Path.Combine(currPath, "CButtonTemplate.xml");
  312. if (File.Exists(xmlFilePath))
  313. {
  314. List<CButton> cButtonList = new List<CButton>();
  315. XmlSerializer deserializer = new XmlSerializer(cButtonList.GetType());
  316. using (TextReader tr = new StreamReader(xmlFilePath))
  317. {
  318. cButtonList = (List<CButton>)deserializer.Deserialize(tr);
  319. }
  320. for (int i = 0; i < cButtonList.Count; i++)
  321. {
  322. var cBtn = cButtonList[i];
  323. if (!ButtonPropertyDict.ContainsKey(cBtn.ButtonName))
  324. {
  325. ButtonPropertyDict.Add(cBtn.ButtonName, cBtn);
  326. }
  327. }
  328. }
  329. return true;
  330. }
  331. catch (Exception ex)
  332. {
  333. CLog.Instance.SystemLog.WriteException("ExcelConfig", ex);
  334. }
  335. return false;
  336. }
  337. }
  338. public class RouteConfig
  339. {
  340. [ExcelColumnName("线路")]
  341. public int Route { get; set; }
  342. [ExcelColumnName("仓库号")]
  343. public string WareHouseCode { get; set; }
  344. [ExcelColumnName("库位号")]
  345. public string LocationCode { get; set; }
  346. [ExcelColumnName("库位组名称")]
  347. public string WarehouseGroupType { get; set; }
  348. [ExcelColumnName("活动站点")]
  349. public int StationID { get; set; }
  350. [ExcelColumnName("导航点")]
  351. public int GraphVertex { get; set; }
  352. [ExcelColumnName("关联点1")]
  353. public int RelationStationID1 { get; set; }
  354. [ExcelColumnName("关联点2")]
  355. public int RelationStationID2 { get; set; }
  356. [ExcelColumnName("关联点3")]
  357. public int RelationStationID3 { get; set; }
  358. [ExcelColumnName("行")]
  359. public int RowIndex { get; set; }
  360. [ExcelColumnName("列")]
  361. public int ColumnIndex { get; set; }
  362. [ExcelColumnName("备注1")]
  363. public string Remark1 { get; set; }
  364. [ExcelColumnName("叫料状态")]
  365. public int CallLineStauts { get; set; }
  366. [ExcelColumnName("取消叫料状态")]
  367. public int CancelLineStauts { get; set; }
  368. [ExcelColumnName("IP地址(PLC)")]
  369. public string PlcIpAddr { get; set; }
  370. [ExcelColumnName("心跳信号(PLC)")]
  371. public string PlcHeartbearAddr { get; set; }
  372. [ExcelColumnName("心跳信号(AGV)")]
  373. public string PlcHeartbearAddr_AGV { get; set; }
  374. [ExcelColumnName("滚筒台ID")]
  375. public int RollerID { get; set; }
  376. [ExcelColumnName("对接盒ID")]
  377. public int IOTransID { get; set; }
  378. [ExcelColumnName("LES线路")]
  379. public string LesRouteStr { get; set; }
  380. [ExcelColumnName("叫料器具类型")]
  381. public string LesPodTypeStr { get; set; }
  382. public int[] LesRoutes { get; set; }
  383. public string[] LesPodTypes { get; set; }
  384. public bool PlcIsNeedClear { get; set; }
  385. public bool PlcConnected { get; set; }
  386. [ExcelIgnore(true)]
  387. public Newtonsoft.Json.Linq.JObject JData { get; set; } = new Newtonsoft.Json.Linq.JObject();
  388. public HslCommunication.Core.IReadWriteNet PlcReadWrite { get; set; }
  389. public DateTime LastPackTaskAddTime { get; set; }
  390. public bool PackTaskAddCooled { get { return Math.Abs((DateTime.Now - LastPackTaskAddTime).TotalSeconds) > 5; } }
  391. }
  392. public class AreaConfig
  393. {
  394. [ExcelColumnName("区域名称")]
  395. public string Name { get; set; }
  396. [ExcelColumnName("导航点")]
  397. public string GraphVertexStr { get; set; }
  398. [ExcelColumnName("路段")]
  399. public string GraphEdgeStr { get; set; }
  400. public bool AgvInArea { get; set; }
  401. [ExcelColumnName("交通灯编号")]
  402. public int TrafficLightId { get; set; }
  403. public DateTime SetTrafficLightTime { get; set; }
  404. public bool ReSetTrafficLight
  405. {
  406. get { return (DateTime.Now - SetTrafficLightTime).TotalSeconds > 30; }
  407. }
  408. public int[] GraphVertexs { get; set; }
  409. public int[] GraphEdges { get; set; }
  410. }
  411. public class PlcBehavior
  412. {
  413. [ExcelColumnName("行为码")]
  414. public int Behavior { get; set; }
  415. [ExcelColumnName("逻辑位(True)")]
  416. public int LogicBitTrue { get; set; } = -1;
  417. [ExcelColumnName("DB地址写入")]
  418. public string DbAddressWriteStr { get; set; }
  419. [ExcelColumnName("DB地址读取")]
  420. public string DbAddressReadStr { get; set; }
  421. [ExcelColumnName("DB地址最终写入")]
  422. public string DbAddressFinalWriteStr { get; set; }
  423. [ExcelColumnName("写入值")]
  424. public string DbValueWriteStr { get; set; }
  425. [ExcelColumnName("读取值")]
  426. public string DbValueReadStr { get; set; }
  427. [ExcelColumnName("最终写入值")]
  428. public string DbValueFinalWriteStr { get; set; }
  429. public string[] DbAddressWrite { get; set; }
  430. public string[] DbAddressRead { get; set; }
  431. public string[] DbAddressFinalWrite { get; set; }
  432. //public bool[] DbValueWrite { get; set; }
  433. //public bool[] DbValueRead { get; set; }
  434. //public bool[] DbValueFinalWrite { get; set; }
  435. public ushort[] DbValueWriteIO { get; set; }
  436. public ushort[] DbValueReadIO { get; set; }
  437. public ushort[] DbValueFinalWriteIO { get; set; }
  438. [ExcelColumnName("数据类型")]
  439. public string DbValueDataType { get; set; }
  440. [ExcelColumnName("备注")]
  441. public string Remark { get; set; }
  442. [ExcelColumnName("模拟")]
  443. public bool IsSimulate { get; set; }
  444. [ExcelColumnName("IO透传")]
  445. public bool IsIOTrans { get; set; }
  446. [ExcelColumnName("异步执行类")]
  447. public string AsyncClassName { get; set; }
  448. [ExcelColumnName("异步执行步骤数")]
  449. public int AsyncStepOffset { get; set; }
  450. }
  451. public class TaskRely
  452. {
  453. [ExcelColumnName("新任务开始仓库")]
  454. public string StartWareHouse { get; set; }
  455. [ExcelColumnName("旧任务结束仓库")]
  456. public string EndWareHouseStr { get; set; }
  457. public string[] EndWareHouse { get; set; }
  458. }
  459. public class ColumnKeyInfo
  460. {
  461. public string Name { get; set; }
  462. public string HeaderText { get; set; }
  463. public string Format { get; set; }
  464. public bool Visible { get; set; }
  465. }
  466. public class LineCallPrority
  467. {
  468. [ExcelColumnName("当前点")]
  469. public string Location { get; set; }
  470. [ExcelColumnName("设备叫料点")]
  471. public string CalledLocationStr { get; set; }
  472. public string[] CalledLocations { get; set; }
  473. }
  474. public class InfoPlc
  475. {
  476. internal RouteConfig routeConfig { get; set; }
  477. public string 库位号 { get; set; }
  478. [ExcelColumnName("IP地址(PLC)")]
  479. public string IP地址 { get; set; }
  480. [ExcelIgnore(true)]
  481. public Newtonsoft.Json.Linq.JObject JData { get; set; }
  482. public string[] PlcSignalAddrArray { get; set; }
  483. public ushort[] PlcSignalAddrLengthArray { get; set; }
  484. public DateTime LastUpdateTime { get; set; }
  485. public bool 有效
  486. {
  487. get { return (DateTime.Now - LastUpdateTime).TotalSeconds < 5; }
  488. }
  489. }
  490. public class LineInfo
  491. {
  492. [ExcelColumnName("线体编号")]
  493. public int Number { get; set; }
  494. [ExcelColumnName("线体名称")]
  495. public string Name { get; set; }
  496. [ExcelColumnName("下一线体编号")]
  497. public int NextNumber { get; set; }
  498. [ExcelColumnName("判断点")]
  499. public int Mark { get; set; }
  500. [ExcelColumnName("对接方式")]
  501. public int CommunicationType { get; set; }
  502. public DataTable DetailTable { get; set; }
  503. }
  504. public class TrafficInfo
  505. {
  506. [ExcelColumnName("进管制区地标")]
  507. public string MarksString { get; set; }
  508. [ExcelColumnName("管制区内地标")]
  509. public string ExtraMarksString { get; set; }
  510. public int[] Marks { get; set; }
  511. public int[] ExtraMarks { get; set; }
  512. public bool IsTraffic { get; set; } = true;
  513. public long LastReleaseTime { get; set; }
  514. public bool ReleaseCold { get { return (DateTime.Now.Ticks - LastReleaseTime) > 50000000L; } }
  515. }
  516. public class TaskMatch
  517. {
  518. [ExcelColumnName("取货仓库")]
  519. public string WarehouseCode { get; set; }
  520. [ExcelColumnName("取货仓位")]
  521. public string LocationCode { get; set; }
  522. [ExcelColumnName("放货仓库")]
  523. public string TargetWarehouseCode { get; set; }
  524. [ExcelColumnName("放货仓位")]
  525. public string TargetLocationCode { get; set; }
  526. [ExcelColumnName("任务模板")]
  527. public string TemplateName { get; set; }
  528. [ExcelColumnName("指定小车")]
  529. public int AgvId { get; set; }
  530. [ExcelColumnName("小车类型")]
  531. public string AgvType { get; set; }
  532. [ExcelColumnName("优先级")]
  533. public int Priority { get; set; }
  534. }
  535. public class TaskStatusMatch
  536. {
  537. [ExcelColumnName("任务模板")]
  538. public string TaskBook { get; set; }
  539. [ExcelColumnName("步骤")]
  540. public int StepID { get; set; }
  541. [ExcelColumnName("状态")]
  542. public int TaskState { get; set; }
  543. [ExcelColumnName("状态描述")]
  544. public string TaskDesc { get; set; }
  545. }
  546. public class VcuAlarmInfo
  547. {
  548. [ExcelColumnName("报警编号")]
  549. public int AlarmId { get; set; }
  550. [ExcelColumnName("报警名称")]
  551. public string AlarmName { get; set; }
  552. [ExcelColumnName("忽略")]
  553. public bool Ignore { get; set; }
  554. }
  555. }