| | |
| | | "ID": "20250323151832119", |
| | | "Name": "Program4", |
| | | "Desc": "", |
| | | "Content": "Conn.默认Redis.SetValue(\"西门子2.Param3\",\"300\",\"西门子2Queue\");", |
| | | "ContentCopy": "Conn.默认Redis.SetValue(\"西门子2.Param3\",\"300\",\"西门子2Queue\");", |
| | | "Content": "//Conn.默认Redis.SetValue(\"西门子2.Param3\",\"300\",\"西门子2Queue\");\r\n\r\n List<string> locs = new List<string>() { \"vxr1l\", \"vx1r\", \"vxr1c1\", \"vxr1c2\", \"vxr2l\", \"vxr2r\", \"vxr2c1\", \"vxr2c2\" };\r\n List<string> sites = new List<string>() { \"196365BB283162\", \"193841BB283149\", \"198756BB287300\", \"198767BB286133\", \"206987BB282931\", \"204460BB282975\", \"209405BB287057\", \"209377BB285899\" };\r\n\r\n LocRepository locservice = new LocRepository();\r\n for (int i = 0; i < locs.Count; i++)\r\n {\r\n string loccode = locs[i];\r\n string sitesss = sites[i];\r\n var loc = locservice.FindEntity(x => x.S_LOC_CODE == loccode);\r\n if (loc == null)\r\n {\r\n locservice.Insert(new LocEntity\r\n {\r\n S_ID = Guid.NewGuid().ToString(),\r\n S_STATE = \"编辑\",\r\n T_CREATE = DateTime.Now,\r\n T_MODIFY = DateTime.Now,\r\n S_DEEP = \"vxr\",\r\n\r\n S_LOC_CODE = loccode,\r\n S_AGV_SITE = sitesss,\r\n\r\n S_LOCK_STATE = \"无\",\r\n N_ROW = 1,\r\n N_COL = 1,\r\n N_AGV_CODE = 0,\r\n N_AGV_SITE_LAYER = 0,\r\n N_CAPACITY = 1,\r\n N_CURRENT_NUM = 0,\r\n S_TYPE = \"\",\r\n\r\n });\r\n }\r\n }\r\n // TaskProcess.CreateTask(\"\", locs[6], locs[7], \"test\", 9, new List<string> { \"test\" }, 1, 1, 1);\r\n", |
| | | "ContentCopy": "//Conn.默认Redis.SetValue(\"西门子2.Param3\",\"300\",\"西门子2Queue\");\r\n\r\n List<string> locs = new List<string>() { \"vxr1l\", \"vx1r\", \"vxr1c1\", \"vxr1c2\", \"vxr2l\", \"vxr2r\", \"vxr2c1\", \"vxr2c2\" };\r\n List<string> sites = new List<string>() { \"196365BB283162\", \"193841BB283149\", \"198756BB287300\", \"198767BB286133\", \"206987BB282931\", \"204460BB282975\", \"209405BB287057\", \"209377BB285899\" };\r\n\r\n LocRepository locservice = new LocRepository();\r\n for (int i = 0; i < locs.Count; i++)\r\n {\r\n string loccode = locs[i];\r\n string sitesss = sites[i];\r\n var loc = locservice.FindEntity(x => x.S_LOC_CODE == loccode);\r\n if (loc == null)\r\n {\r\n locservice.Insert(new LocEntity\r\n {\r\n S_ID = Guid.NewGuid().ToString(),\r\n S_STATE = \"编辑\",\r\n T_CREATE = DateTime.Now,\r\n T_MODIFY = DateTime.Now,\r\n S_DEEP = \"vxr\",\r\n\r\n S_LOC_CODE = loccode,\r\n S_AGV_SITE = sitesss,\r\n\r\n S_LOCK_STATE = \"无\",\r\n N_ROW = 1,\r\n N_COL = 1,\r\n N_AGV_CODE = 0,\r\n N_AGV_SITE_LAYER = 0,\r\n N_CAPACITY = 1,\r\n N_CURRENT_NUM = 0,\r\n S_TYPE = \"\",\r\n\r\n });\r\n }\r\n }\r\n // TaskProcess.CreateTask(\"\", locs[6], locs[7], \"test\", 9, new List<string> { \"test\" }, 1, 1, 1);\r\n", |
| | | "ParentID": "20250226153120175", |
| | | "Children": [], |
| | | "Type": "Program", |
| | | "Property": { |
| | | "SyncExec": "False", |
| | | "RepeatExec": "None", |
| | | "SyncExec": "True", |
| | | "RepeatExec": "Count", |
| | | "ExceCount": 1, |
| | | "ExceInternal": 3000, |
| | | "StartCondition": { |
| | |
| | | "Expression": "", |
| | | "Judge": "", |
| | | "Command": {}, |
| | | "HmiEvent": {} |
| | | "HmiEvent": { |
| | | "20250306140515428": [ |
| | | "Open" |
| | | ] |
| | | } |
| | | }, |
| | | "EndCondition": { |
| | | "Type": "None", |
| | |
| | | "ID": "20250325083149366", |
| | | "Name": "维希尔抓臂1", |
| | | "Desc": "", |
| | | "Content": "\r\nvar VERX = Settings.deviceInfos?.Find(x => x.deviceName == \"维希尔抓臂1\");\r\n\r\nif (VERX != null)\r\n{\r\nLocRepository locservice = new LocRepository();\r\nLocContainerRepository loccontainerservice = new LocContainerRepository();\r\nLocEntity v1l = null;\r\nLocEntity v1r = null;\r\nLocEntity startLoc = null;\r\nLocEntity endLoc = null;\r\nList<LocEntity> emptyLoc = new List<LocEntity>();\r\n if (!string.IsNullOrEmpty(VERX.location[0]))\r\n {\r\n v1l = locservice.FindEntity(x => x.S_LOC_CODE == VERX.location[0]);\r\n //if (startLoc == null && startLoc.S_LOCK_STATE == \"无\")\r\n if (v1l != null && v1l.N_CURRENT_NUM == 0 && v1l.S_LOCK_STATE == \"无\")\r\n emptyLoc.Add(v1l);\r\n }\r\n if (!string.IsNullOrEmpty(VERX.location[1]))\r\n {\r\n v1r = locservice.FindEntity(x => x.S_LOC_CODE == VERX.location[1]);\r\n if (v1r != null && v1r.N_CURRENT_NUM == 0 && v1r.S_LOCK_STATE == \"无\")\r\n emptyLoc.Add(v1r);\r\n }\r\n if (Tag.wxr1.R44)\r\n {\r\n startLoc = v1l;\r\n }\r\n else if (Tag.wxr1.R46)\r\n {\r\n startLoc = v1r;\r\n }\r\n\r\n ContainerRepository containerservice = new ContainerRepository();\r\n if (startLoc != null)\r\n {\r\n if (startLoc.N_CURRENT_NUM == 1)\r\n {\r\n if (startLoc.T_FULL_TIME == null)\r\n {\r\n //locservice.dbcontext.Set<LocEntity>().Attach(startLoc);\r\n startLoc.T_FULL_TIME = DateTime.Now;\r\n locservice.Update(startLoc);\r\n //locservice.dbcontext.Entry(startLoc).Property(x => x.T_FULL_TIME).IsModified = true;\r\n //locservice.dbcontext.SaveChanges();\r\n }\r\n if (startLoc.T_FULL_TIME != null && DateTime.Now.Subtract(startLoc.T_FULL_TIME ?? DateTime.Now).TotalSeconds > 30)\r\n {\r\n LocContainerEntity ent = loccontainerservice.FindEntity(x => x.S_LOC_CODE == startLoc.S_LOC_CODE);\r\n foreach (var item in VERX.deviceNo)\r\n {\r\n var loc = locservice.FindEntity(x => x.S_LOC_CODE == startLoc.S_LOC_CODE);\r\n if (loc != null)\r\n {\r\n if (loc.N_CURRENT_NUM == 0)\r\n {\r\n endLoc = loc;\r\n break;\r\n }\r\n }\r\n }\r\n if (endLoc != null && ent != null)\r\n {\r\n var c = containerservice.FindEntity(x => x.S_CODE == ent.S_CNTR_CODE);\r\n c.S_TYPE = \"F\";\r\n containerservice.Update(c);\r\n TaskProcess.CreateTask(\"\", startLoc.S_LOC_CODE, endLoc.S_LOC_CODE, \"vxr1下料\", 6, new List<string> { ent?.S_CNTR_CODE ?? \"TP\" + Settings.GetTimeStamp() }, 1, 1, 1);\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (emptyLoc.Any())\r\n {\r\n List<string> exclist = new List<string>();\r\n next:\r\n endLoc = emptyLoc.First();\r\n emptyLoc.Remove(endLoc);\r\n startLoc = null;\r\n ContainerEntity c = null;\r\n foreach (var lcode in VERX.deviceNo)\r\n {\r\n if (exclist.Contains(lcode))\r\n continue;\r\n var loc = locservice.FindEntity(x => x.S_LOC_CODE == lcode && x.S_LOCK_STATE == \"无\" && x.N_CURRENT_NUM == 1);\r\n if (loc != null)\r\n {\r\n var cntr = loccontainerservice.FindEntity(x => x.S_LOC_CODE == lcode);\r\n if (cntr != null)\r\n {\r\n c = containerservice.FindEntity(x => x.S_CODE == cntr.S_CNTR_CODE);\r\n if (c != null && c.S_TYPE == \"E\")\r\n {\r\n startLoc = loc;\r\n }\r\n }\r\n }\r\n exclist.Add(lcode);\r\n if (startLoc != null)\r\n break;\r\n }\r\n if (startLoc != null)\r\n {\r\n TaskProcess.CreateTask(\"\", startLoc.S_LOC_CODE, endLoc.S_LOC_CODE, \"vxr1上空托盘\", 7, new List<string> { c?.S_CODE }, 1, 1, 1);\r\n }\r\n if (emptyLoc.Any()) goto next;\r\n }\r\n}", |
| | | "ContentCopy": "\r\nvar VERX = Settings.deviceInfos?.Find(x => x.deviceName == \"维希尔抓臂1\");\r\n\r\nif (VERX != null)\r\n{\r\nLocRepository locservice = new LocRepository();\r\nLocContainerRepository loccontainerservice = new LocContainerRepository();\r\nLocEntity v1l = null;\r\nLocEntity v1r = null;\r\nLocEntity startLoc = null;\r\nLocEntity endLoc = null;\r\nList<LocEntity> emptyLoc = new List<LocEntity>();\r\n if (!string.IsNullOrEmpty(VERX.location[0]))\r\n {\r\n v1l = locservice.FindEntity(x => x.S_LOC_CODE == VERX.location[0]);\r\n //if (startLoc == null && startLoc.S_LOCK_STATE == \"无\")\r\n if (v1l != null && v1l.N_CURRENT_NUM == 0 && v1l.S_LOCK_STATE == \"无\")\r\n emptyLoc.Add(v1l);\r\n }\r\n if (!string.IsNullOrEmpty(VERX.location[1]))\r\n {\r\n v1r = locservice.FindEntity(x => x.S_LOC_CODE == VERX.location[1]);\r\n if (v1r != null && v1r.N_CURRENT_NUM == 0 && v1r.S_LOCK_STATE == \"无\")\r\n emptyLoc.Add(v1r);\r\n }\r\n if (Tag.wxr1.R44)\r\n {\r\n startLoc = v1l;\r\n }\r\n else if (Tag.wxr1.R46)\r\n {\r\n startLoc = v1r;\r\n }\r\n\r\n ContainerRepository containerservice = new ContainerRepository();\r\n if (startLoc != null)\r\n {\r\n if (startLoc.N_CURRENT_NUM == 1)\r\n {\r\n if (startLoc.T_FULL_TIME == null)\r\n {\r\n //locservice.dbcontext.Set<LocEntity>().Attach(startLoc);\r\n startLoc.T_FULL_TIME = DateTime.Now;\r\n locservice.Update(startLoc);\r\n //locservice.dbcontext.Entry(startLoc).Property(x => x.T_FULL_TIME).IsModified = true;\r\n //locservice.dbcontext.SaveChanges();\r\n }\r\n if (startLoc.T_FULL_TIME != null && DateTime.Now.Subtract(startLoc.T_FULL_TIME ?? DateTime.Now).TotalSeconds > 30)\r\n {\r\n LocContainerEntity ent = loccontainerservice.FindEntity(x => x.S_LOC_CODE == startLoc.S_LOC_CODE);\r\n foreach (var item in VERX.deviceNo)\r\n {\r\n var loc = locservice.FindEntity(x => x.S_LOC_CODE == startLoc.S_LOC_CODE);\r\n if (loc != null)\r\n {\r\n if (loc.N_CURRENT_NUM == 0)\r\n {\r\n endLoc = loc;\r\n break;\r\n }\r\n }\r\n }\r\n if (endLoc != null && ent != null)\r\n {\r\n var c = containerservice.FindEntity(x => x.S_CODE == ent.S_CNTR_CODE);\r\n c.S_TYPE = \"F\";\r\n containerservice.Update(c);\r\n TaskProcess.CreateTask(\"\", startLoc.S_LOC_CODE, endLoc.S_LOC_CODE, \"vxr1下料\", 6, new List<string> { ent?.S_CNTR_CODE ?? \"TP\" + Settings.GetTimeStamp() }, 1, 1, 1);\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (emptyLoc.Any())\r\n {\r\n List<string> exclist = new List<string>();\r\n next:\r\n endLoc = emptyLoc.First();\r\n emptyLoc.Remove(endLoc);\r\n startLoc = null;\r\n ContainerEntity c = null;\r\n foreach (var lcode in VERX.deviceNo)\r\n {\r\n if (exclist.Contains(lcode))\r\n continue;\r\n var loc = locservice.FindEntity(x => x.S_LOC_CODE == lcode && x.S_LOCK_STATE == \"无\" && x.N_CURRENT_NUM == 1);\r\n if (loc != null)\r\n {\r\n var cntr = loccontainerservice.FindEntity(x => x.S_LOC_CODE == lcode);\r\n if (cntr != null)\r\n {\r\n c = containerservice.FindEntity(x => x.S_CODE == cntr.S_CNTR_CODE);\r\n if (c != null && c.S_TYPE == \"E\")\r\n {\r\n startLoc = loc;\r\n }\r\n }\r\n }\r\n exclist.Add(lcode);\r\n if (startLoc != null)\r\n break;\r\n }\r\n if (startLoc != null)\r\n {\r\n TaskProcess.CreateTask(\"\", startLoc.S_LOC_CODE, endLoc.S_LOC_CODE, \"vxr1上空托盘\", 7, new List<string> { c?.S_CODE }, 1, 1, 1);\r\n }\r\n if (emptyLoc.Any()) goto next;\r\n }\r\n}", |
| | | "Content": "\r\nvar VERX = Settings.deviceInfos?.Find(x => x.deviceName == \"维希尔抓臂1\");\r\n\r\nif (VERX != null)\r\n{\r\nLocRepository locservice = new LocRepository();\r\nLocContainerRepository loccontainerservice = new LocContainerRepository();\r\nLocEntity v1l = null;\r\nLocEntity v1r = null;\r\nLocEntity startLoc = null;\r\nLocEntity endLoc = null;\r\nList<LocEntity> emptyLoc = new List<LocEntity>();\r\n if (!string.IsNullOrEmpty(VERX.location[0]))\r\n {\r\n v1l = locservice.FindEntity(x => x.S_LOC_CODE == VERX.location[0]);\r\n //if (startLoc == null && startLoc.S_LOCK_STATE == \"无\")\r\n if (v1l != null && v1l.N_CURRENT_NUM == 0 && v1l.S_LOCK_STATE == \"无\")\r\n emptyLoc.Add(v1l);\r\n }\r\n if (!string.IsNullOrEmpty(VERX.location[1]))\r\n {\r\n v1r = locservice.FindEntity(x => x.S_LOC_CODE == VERX.location[1]);\r\n if (v1r != null && v1r.N_CURRENT_NUM == 0 && v1r.S_LOCK_STATE == \"无\")\r\n emptyLoc.Add(v1r);\r\n }\r\n if (Tag.wxr1.R44&&Tag.wxr1.R10)\r\n {\r\n startLoc = v1l;\r\n }\r\n else if (Tag.wxr1.R46&&Tag.wxr1.R11)\r\n {\r\n startLoc = v1r;\r\n }\r\n\r\n ContainerRepository containerservice = new ContainerRepository();\r\n if (startLoc != null)\r\n {\r\n if (startLoc.N_CURRENT_NUM == 1)\r\n {\r\n if (startLoc.T_FULL_TIME == null)\r\n {\r\n //locservice.dbcontext.Set<LocEntity>().Attach(startLoc);\r\n startLoc.T_FULL_TIME = DateTime.Now;\r\n locservice.Update(startLoc);\r\n //locservice.dbcontext.Entry(startLoc).Property(x => x.T_FULL_TIME).IsModified = true;\r\n //locservice.dbcontext.SaveChanges();\r\n }\r\n if (startLoc.T_FULL_TIME != null && DateTime.Now.Subtract(startLoc.T_FULL_TIME ?? DateTime.Now).TotalSeconds > 30)\r\n {\r\n LocContainerEntity ent = loccontainerservice.FindEntity(x => x.S_LOC_CODE == startLoc.S_LOC_CODE);\r\n foreach (var item in VERX.deviceNo)\r\n {\r\n var loc = locservice.FindEntity(x => x.S_LOC_CODE == startLoc.S_LOC_CODE);\r\n if (loc != null)\r\n {\r\n if (loc.N_CURRENT_NUM == 0)\r\n {\r\n endLoc = loc;\r\n break;\r\n }\r\n }\r\n }\r\n if (endLoc != null && ent != null)\r\n {\r\n var c = containerservice.FindEntity(x => x.S_CODE == ent.S_CNTR_CODE);\r\n c.S_TYPE = \"F\";\r\n containerservice.Update(c);\r\n TaskProcess.CreateTask(\"\", startLoc.S_LOC_CODE, endLoc.S_LOC_CODE, \"vxr1下料\", 6, new List<string> { ent?.S_CNTR_CODE ?? \"TP\" + Settings.GetTimeStamp() }, 1, 1, 1);\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (emptyLoc.Any())\r\n {\r\n List<string> exclist = new List<string>();\r\n next:\r\n endLoc = emptyLoc.First();\r\n emptyLoc.Remove(endLoc);\r\n startLoc = null;\r\n ContainerEntity c = null;\r\n foreach (var lcode in VERX.deviceNo)\r\n {\r\n if (exclist.Contains(lcode))\r\n continue;\r\n var loc = locservice.FindEntity(x => x.S_LOC_CODE == lcode && x.S_LOCK_STATE == \"无\" && x.N_CURRENT_NUM == 1);\r\n if (loc != null)\r\n {\r\n var cntr = loccontainerservice.FindEntity(x => x.S_LOC_CODE == lcode);\r\n if (cntr != null)\r\n {\r\n c = containerservice.FindEntity(x => x.S_CODE == cntr.S_CNTR_CODE);\r\n if (c != null && c.S_TYPE == \"E\")\r\n {\r\n startLoc = loc;\r\n }\r\n }\r\n }\r\n exclist.Add(lcode);\r\n if (startLoc != null)\r\n break;\r\n }\r\n if (startLoc != null)\r\n {\r\n TaskProcess.CreateTask(\"\", startLoc.S_LOC_CODE, endLoc.S_LOC_CODE, \"vxr1上空托盘\", 7, new List<string> { c?.S_CODE }, 1, 1, 1);\r\n }\r\n if (emptyLoc.Any()) goto next;\r\n }\r\n}", |
| | | "ContentCopy": "\r\nvar VERX = Settings.deviceInfos?.Find(x => x.deviceName == \"维希尔抓臂1\");\r\n\r\nif (VERX != null)\r\n{\r\nLocRepository locservice = new LocRepository();\r\nLocContainerRepository loccontainerservice = new LocContainerRepository();\r\nLocEntity v1l = null;\r\nLocEntity v1r = null;\r\nLocEntity startLoc = null;\r\nLocEntity endLoc = null;\r\nList<LocEntity> emptyLoc = new List<LocEntity>();\r\n if (!string.IsNullOrEmpty(VERX.location[0]))\r\n {\r\n v1l = locservice.FindEntity(x => x.S_LOC_CODE == VERX.location[0]);\r\n //if (startLoc == null && startLoc.S_LOCK_STATE == \"无\")\r\n if (v1l != null && v1l.N_CURRENT_NUM == 0 && v1l.S_LOCK_STATE == \"无\")\r\n emptyLoc.Add(v1l);\r\n }\r\n if (!string.IsNullOrEmpty(VERX.location[1]))\r\n {\r\n v1r = locservice.FindEntity(x => x.S_LOC_CODE == VERX.location[1]);\r\n if (v1r != null && v1r.N_CURRENT_NUM == 0 && v1r.S_LOCK_STATE == \"无\")\r\n emptyLoc.Add(v1r);\r\n }\r\n if (Tag.wxr1.R44&&Tag.wxr1.R10)\r\n {\r\n startLoc = v1l;\r\n }\r\n else if (Tag.wxr1.R46&&Tag.wxr1.R11)\r\n {\r\n startLoc = v1r;\r\n }\r\n\r\n ContainerRepository containerservice = new ContainerRepository();\r\n if (startLoc != null)\r\n {\r\n if (startLoc.N_CURRENT_NUM == 1)\r\n {\r\n if (startLoc.T_FULL_TIME == null)\r\n {\r\n //locservice.dbcontext.Set<LocEntity>().Attach(startLoc);\r\n startLoc.T_FULL_TIME = DateTime.Now;\r\n locservice.Update(startLoc);\r\n //locservice.dbcontext.Entry(startLoc).Property(x => x.T_FULL_TIME).IsModified = true;\r\n //locservice.dbcontext.SaveChanges();\r\n }\r\n if (startLoc.T_FULL_TIME != null && DateTime.Now.Subtract(startLoc.T_FULL_TIME ?? DateTime.Now).TotalSeconds > 30)\r\n {\r\n LocContainerEntity ent = loccontainerservice.FindEntity(x => x.S_LOC_CODE == startLoc.S_LOC_CODE);\r\n foreach (var item in VERX.deviceNo)\r\n {\r\n var loc = locservice.FindEntity(x => x.S_LOC_CODE == startLoc.S_LOC_CODE);\r\n if (loc != null)\r\n {\r\n if (loc.N_CURRENT_NUM == 0)\r\n {\r\n endLoc = loc;\r\n break;\r\n }\r\n }\r\n }\r\n if (endLoc != null && ent != null)\r\n {\r\n var c = containerservice.FindEntity(x => x.S_CODE == ent.S_CNTR_CODE);\r\n c.S_TYPE = \"F\";\r\n containerservice.Update(c);\r\n TaskProcess.CreateTask(\"\", startLoc.S_LOC_CODE, endLoc.S_LOC_CODE, \"vxr1下料\", 6, new List<string> { ent?.S_CNTR_CODE ?? \"TP\" + Settings.GetTimeStamp() }, 1, 1, 1);\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (emptyLoc.Any())\r\n {\r\n List<string> exclist = new List<string>();\r\n next:\r\n endLoc = emptyLoc.First();\r\n emptyLoc.Remove(endLoc);\r\n startLoc = null;\r\n ContainerEntity c = null;\r\n foreach (var lcode in VERX.deviceNo)\r\n {\r\n if (exclist.Contains(lcode))\r\n continue;\r\n var loc = locservice.FindEntity(x => x.S_LOC_CODE == lcode && x.S_LOCK_STATE == \"无\" && x.N_CURRENT_NUM == 1);\r\n if (loc != null)\r\n {\r\n var cntr = loccontainerservice.FindEntity(x => x.S_LOC_CODE == lcode);\r\n if (cntr != null)\r\n {\r\n c = containerservice.FindEntity(x => x.S_CODE == cntr.S_CNTR_CODE);\r\n if (c != null && c.S_TYPE == \"E\")\r\n {\r\n startLoc = loc;\r\n }\r\n }\r\n }\r\n exclist.Add(lcode);\r\n if (startLoc != null)\r\n break;\r\n }\r\n if (startLoc != null)\r\n {\r\n TaskProcess.CreateTask(\"\", startLoc.S_LOC_CODE, endLoc.S_LOC_CODE, \"vxr1上空托盘\", 7, new List<string> { c?.S_CODE }, 1, 1, 1);\r\n }\r\n if (emptyLoc.Any()) goto next;\r\n }\r\n}", |
| | | "ParentID": "20250325083047245", |
| | | "Children": [], |
| | | "Type": "Program", |
| | |
| | | "ID": "20250325083325390", |
| | | "Name": "捷瞬抓臂1", |
| | | "Desc": "", |
| | | "Content": "//jsz1捷瞬抓臂1\r\nvar VERX = Settings.deviceInfos?.Find(x => x.deviceName == \"捷瞬抓臂1\");\r\n\r\nif (VERX != null)\r\n{\r\nLocRepository locservice = new LocRepository();\r\nLocContainerRepository loccontainerservice = new LocContainerRepository();\r\nLocEntity v1l = null;\r\nLocEntity v1r = null;\r\nLocEntity startLoc = null;\r\nLocEntity endLoc = null;\r\nList<LocEntity> emptyLoc = new List<LocEntity>();\r\n if (!string.IsNullOrEmpty(VERX.location[0]))\r\n {\r\n v1l = locservice.FindEntity(x => x.S_LOC_CODE == VERX.location[0]);\r\n //if (startLoc == null && startLoc.S_LOCK_STATE == \"无\")\r\n if (v1l != null && v1l.N_CURRENT_NUM == 0 && v1l.S_LOCK_STATE == \"无\")\r\n emptyLoc.Add(v1l);\r\n }\r\n if (!string.IsNullOrEmpty(VERX.location[1]))\r\n {\r\n v1r = locservice.FindEntity(x => x.S_LOC_CODE == VERX.location[1]);\r\n if (v1r != null && v1r.N_CURRENT_NUM == 0 && v1r.S_LOCK_STATE == \"无\")\r\n emptyLoc.Add(v1r);\r\n }\r\n if (Tag.js1.M40)\r\n {\r\n startLoc = v1l;\r\n }\r\n else if (Tag.js1.M41)\r\n {\r\n startLoc = v1r;\r\n }\r\n\r\n ContainerRepository containerservice = new ContainerRepository();\r\n if (startLoc != null)\r\n {\r\n if (startLoc.N_CURRENT_NUM == 1)\r\n {\r\n if (startLoc.T_FULL_TIME == null)\r\n {\r\n //locservice.dbcontext.Set<LocEntity>().Attach(startLoc);\r\n startLoc.T_FULL_TIME = DateTime.Now;\r\n locservice.Update(startLoc);\r\n //locservice.dbcontext.Entry(startLoc).Property(x => x.T_FULL_TIME).IsModified = true;\r\n //locservice.dbcontext.SaveChanges();\r\n }\r\n if (startLoc.T_FULL_TIME != null && DateTime.Now.Subtract(startLoc.T_FULL_TIME ?? DateTime.Now).TotalSeconds > 30)\r\n {\r\n LocContainerEntity ent = loccontainerservice.FindEntity(x => x.S_LOC_CODE == startLoc.S_LOC_CODE);\r\n foreach (var item in VERX.deviceNo)\r\n {\r\n var loc = locservice.FindEntity(x => x.S_LOC_CODE == startLoc.S_LOC_CODE);\r\n if (loc != null)\r\n {\r\n if (loc.N_CURRENT_NUM == 0)\r\n {\r\n endLoc = loc;\r\n break;\r\n }\r\n }\r\n }\r\n if (endLoc != null && ent != null)\r\n {\r\n var c = containerservice.FindEntity(x => x.S_CODE == ent.S_CNTR_CODE);\r\n c.S_TYPE = \"E\";\r\n containerservice.Update(c);\r\n TaskProcess.CreateTask(\"\", startLoc.S_LOC_CODE, endLoc.S_LOC_CODE, \"JS1下空\", 6, new List<string> { ent?.S_CNTR_CODE ?? \"TP\" + Settings.GetTimeStamp() }, 1, 1, 1);\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (emptyLoc.Any())\r\n {\r\n List<string> exclist = new List<string>();\r\n next:\r\n endLoc = emptyLoc.First();\r\n emptyLoc.Remove(endLoc);\r\n startLoc = null;\r\n ContainerEntity c = null;\r\n foreach (var lcode in VERX.deviceNo)\r\n {\r\n if (exclist.Contains(lcode))\r\n continue;\r\n var loc = locservice.FindEntity(x => x.S_LOC_CODE == lcode && x.S_LOCK_STATE == \"无\" && x.N_CURRENT_NUM == 1);\r\n if (loc != null)\r\n {\r\n var cntr = loccontainerservice.FindEntity(x => x.S_LOC_CODE == lcode);\r\n if (cntr != null)\r\n {\r\n c = containerservice.FindEntity(x => x.S_CODE == cntr.S_CNTR_CODE);\r\n if (c != null && c.S_TYPE == \"F\")\r\n {\r\n startLoc = loc;\r\n }\r\n }\r\n }\r\n exclist.Add(lcode);\r\n if (startLoc != null)\r\n break;\r\n }\r\n if (startLoc != null)\r\n {\r\n TaskProcess.CreateTask(\"\", startLoc.S_LOC_CODE, endLoc.S_LOC_CODE, \"JS1上料\", 7, new List<string> { c?.S_CODE }, 1, 1, 1);\r\n }\r\n if (emptyLoc.Any()) goto next;\r\n }\r\n}", |
| | | "ContentCopy": "//jsz1捷瞬抓臂1\r\nvar VERX = Settings.deviceInfos?.Find(x => x.deviceName == \"捷瞬抓臂1\");\r\n\r\nif (VERX != null)\r\n{\r\nLocRepository locservice = new LocRepository();\r\nLocContainerRepository loccontainerservice = new LocContainerRepository();\r\nLocEntity v1l = null;\r\nLocEntity v1r = null;\r\nLocEntity startLoc = null;\r\nLocEntity endLoc = null;\r\nList<LocEntity> emptyLoc = new List<LocEntity>();\r\n if (!string.IsNullOrEmpty(VERX.location[0]))\r\n {\r\n v1l = locservice.FindEntity(x => x.S_LOC_CODE == VERX.location[0]);\r\n //if (startLoc == null && startLoc.S_LOCK_STATE == \"无\")\r\n if (v1l != null && v1l.N_CURRENT_NUM == 0 && v1l.S_LOCK_STATE == \"无\")\r\n emptyLoc.Add(v1l);\r\n }\r\n if (!string.IsNullOrEmpty(VERX.location[1]))\r\n {\r\n v1r = locservice.FindEntity(x => x.S_LOC_CODE == VERX.location[1]);\r\n if (v1r != null && v1r.N_CURRENT_NUM == 0 && v1r.S_LOCK_STATE == \"无\")\r\n emptyLoc.Add(v1r);\r\n }\r\n if (Tag.js1.M40)\r\n {\r\n startLoc = v1l;\r\n }\r\n else if (Tag.js1.M41)\r\n {\r\n startLoc = v1r;\r\n }\r\n\r\n ContainerRepository containerservice = new ContainerRepository();\r\n if (startLoc != null)\r\n {\r\n if (startLoc.N_CURRENT_NUM == 1)\r\n {\r\n if (startLoc.T_FULL_TIME == null)\r\n {\r\n //locservice.dbcontext.Set<LocEntity>().Attach(startLoc);\r\n startLoc.T_FULL_TIME = DateTime.Now;\r\n locservice.Update(startLoc);\r\n //locservice.dbcontext.Entry(startLoc).Property(x => x.T_FULL_TIME).IsModified = true;\r\n //locservice.dbcontext.SaveChanges();\r\n }\r\n if (startLoc.T_FULL_TIME != null && DateTime.Now.Subtract(startLoc.T_FULL_TIME ?? DateTime.Now).TotalSeconds > 30)\r\n {\r\n LocContainerEntity ent = loccontainerservice.FindEntity(x => x.S_LOC_CODE == startLoc.S_LOC_CODE);\r\n foreach (var item in VERX.deviceNo)\r\n {\r\n var loc = locservice.FindEntity(x => x.S_LOC_CODE == startLoc.S_LOC_CODE);\r\n if (loc != null)\r\n {\r\n if (loc.N_CURRENT_NUM == 0)\r\n {\r\n endLoc = loc;\r\n break;\r\n }\r\n }\r\n }\r\n if (endLoc != null && ent != null)\r\n {\r\n var c = containerservice.FindEntity(x => x.S_CODE == ent.S_CNTR_CODE);\r\n c.S_TYPE = \"E\";\r\n containerservice.Update(c);\r\n TaskProcess.CreateTask(\"\", startLoc.S_LOC_CODE, endLoc.S_LOC_CODE, \"JS1下空\", 6, new List<string> { ent?.S_CNTR_CODE ?? \"TP\" + Settings.GetTimeStamp() }, 1, 1, 1);\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (emptyLoc.Any())\r\n {\r\n List<string> exclist = new List<string>();\r\n next:\r\n endLoc = emptyLoc.First();\r\n emptyLoc.Remove(endLoc);\r\n startLoc = null;\r\n ContainerEntity c = null;\r\n foreach (var lcode in VERX.deviceNo)\r\n {\r\n if (exclist.Contains(lcode))\r\n continue;\r\n var loc = locservice.FindEntity(x => x.S_LOC_CODE == lcode && x.S_LOCK_STATE == \"无\" && x.N_CURRENT_NUM == 1);\r\n if (loc != null)\r\n {\r\n var cntr = loccontainerservice.FindEntity(x => x.S_LOC_CODE == lcode);\r\n if (cntr != null)\r\n {\r\n c = containerservice.FindEntity(x => x.S_CODE == cntr.S_CNTR_CODE);\r\n if (c != null && c.S_TYPE == \"F\")\r\n {\r\n startLoc = loc;\r\n }\r\n }\r\n }\r\n exclist.Add(lcode);\r\n if (startLoc != null)\r\n break;\r\n }\r\n if (startLoc != null)\r\n {\r\n TaskProcess.CreateTask(\"\", startLoc.S_LOC_CODE, endLoc.S_LOC_CODE, \"JS1上料\", 7, new List<string> { c?.S_CODE }, 1, 1, 1);\r\n }\r\n if (emptyLoc.Any()) goto next;\r\n }\r\n}", |
| | | "Content": "//jsz1捷瞬抓臂1\r\nvar VERX = Settings.deviceInfos?.Find(x => x.deviceName == \"捷瞬抓臂1\");\r\n\r\nif (VERX != null)\r\n{\r\nLocRepository locservice = new LocRepository();\r\nLocContainerRepository loccontainerservice = new LocContainerRepository();\r\nLocEntity v1l = null;\r\nLocEntity v1r = null;\r\nLocEntity startLoc = null;\r\nLocEntity endLoc = null;\r\nList<LocEntity> emptyLoc = new List<LocEntity>();\r\n if (!string.IsNullOrEmpty(VERX.location[0]))\r\n {\r\n v1l = locservice.FindEntity(x => x.S_LOC_CODE == VERX.location[0]);\r\n //if (startLoc == null && startLoc.S_LOCK_STATE == \"无\")\r\n if (v1l != null && v1l.N_CURRENT_NUM == 0 && v1l.S_LOCK_STATE == \"无\")\r\n emptyLoc.Add(v1l);\r\n }\r\n if (!string.IsNullOrEmpty(VERX.location[1]))\r\n {\r\n v1r = locservice.FindEntity(x => x.S_LOC_CODE == VERX.location[1]);\r\n if (v1r != null && v1r.N_CURRENT_NUM == 0 && v1r.S_LOCK_STATE == \"无\")\r\n emptyLoc.Add(v1r);\r\n }\r\n if (Tag.js1.M40==1)\r\n {\r\n startLoc = v1l;\r\n }\r\n else if (Tag.js1.M41==1)\r\n {\r\n startLoc = v1r;\r\n }\r\n\r\n ContainerRepository containerservice = new ContainerRepository();\r\n if (startLoc != null)\r\n {\r\n if (startLoc.N_CURRENT_NUM == 1)\r\n {\r\n if (startLoc.T_FULL_TIME == null)\r\n {\r\n //locservice.dbcontext.Set<LocEntity>().Attach(startLoc);\r\n startLoc.T_FULL_TIME = DateTime.Now;\r\n locservice.Update(startLoc);\r\n //locservice.dbcontext.Entry(startLoc).Property(x => x.T_FULL_TIME).IsModified = true;\r\n //locservice.dbcontext.SaveChanges();\r\n }\r\n if (startLoc.T_FULL_TIME != null && DateTime.Now.Subtract(startLoc.T_FULL_TIME ?? DateTime.Now).TotalSeconds > 30)\r\n {\r\n LocContainerEntity ent = loccontainerservice.FindEntity(x => x.S_LOC_CODE == startLoc.S_LOC_CODE);\r\n foreach (var item in VERX.deviceNo)\r\n {\r\n var loc = locservice.FindEntity(x => x.S_LOC_CODE == startLoc.S_LOC_CODE);\r\n if (loc != null)\r\n {\r\n if (loc.N_CURRENT_NUM == 0)\r\n {\r\n endLoc = loc;\r\n break;\r\n }\r\n }\r\n }\r\n if (endLoc != null && ent != null)\r\n {\r\n var c = containerservice.FindEntity(x => x.S_CODE == ent.S_CNTR_CODE);\r\n c.S_TYPE = \"E\";\r\n containerservice.Update(c);\r\n TaskProcess.CreateTask(\"\", startLoc.S_LOC_CODE, endLoc.S_LOC_CODE, \"JS1下空\", 6, new List<string> { ent?.S_CNTR_CODE ?? \"TP\" + Settings.GetTimeStamp() }, 1, 1, 1);\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (emptyLoc.Any())\r\n {\r\n List<string> exclist = new List<string>();\r\n next:\r\n endLoc = emptyLoc.First();\r\n emptyLoc.Remove(endLoc);\r\n startLoc = null;\r\n ContainerEntity c = null;\r\n foreach (var lcode in VERX.deviceNo)\r\n {\r\n if (exclist.Contains(lcode))\r\n continue;\r\n var loc = locservice.FindEntity(x => x.S_LOC_CODE == lcode && x.S_LOCK_STATE == \"无\" && x.N_CURRENT_NUM == 1);\r\n if (loc != null)\r\n {\r\n var cntr = loccontainerservice.FindEntity(x => x.S_LOC_CODE == lcode);\r\n if (cntr != null)\r\n {\r\n c = containerservice.FindEntity(x => x.S_CODE == cntr.S_CNTR_CODE);\r\n if (c != null && c.S_TYPE == \"F\")\r\n {\r\n startLoc = loc;\r\n }\r\n }\r\n }\r\n exclist.Add(lcode);\r\n if (startLoc != null)\r\n break;\r\n }\r\n if (startLoc != null)\r\n {\r\n TaskProcess.CreateTask(\"\", startLoc.S_LOC_CODE, endLoc.S_LOC_CODE, \"JS1上料\", 7, new List<string> { c?.S_CODE }, 1, 1, 1);\r\n }\r\n if (emptyLoc.Any()) goto next;\r\n }\r\n}", |
| | | "ContentCopy": "//jsz1捷瞬抓臂1\r\nvar VERX = Settings.deviceInfos?.Find(x => x.deviceName == \"捷瞬抓臂1\");\r\n\r\nif (VERX != null)\r\n{\r\nLocRepository locservice = new LocRepository();\r\nLocContainerRepository loccontainerservice = new LocContainerRepository();\r\nLocEntity v1l = null;\r\nLocEntity v1r = null;\r\nLocEntity startLoc = null;\r\nLocEntity endLoc = null;\r\nList<LocEntity> emptyLoc = new List<LocEntity>();\r\n if (!string.IsNullOrEmpty(VERX.location[0]))\r\n {\r\n v1l = locservice.FindEntity(x => x.S_LOC_CODE == VERX.location[0]);\r\n //if (startLoc == null && startLoc.S_LOCK_STATE == \"无\")\r\n if (v1l != null && v1l.N_CURRENT_NUM == 0 && v1l.S_LOCK_STATE == \"无\")\r\n emptyLoc.Add(v1l);\r\n }\r\n if (!string.IsNullOrEmpty(VERX.location[1]))\r\n {\r\n v1r = locservice.FindEntity(x => x.S_LOC_CODE == VERX.location[1]);\r\n if (v1r != null && v1r.N_CURRENT_NUM == 0 && v1r.S_LOCK_STATE == \"无\")\r\n emptyLoc.Add(v1r);\r\n }\r\n if (Tag.js1.M40==1)\r\n {\r\n startLoc = v1l;\r\n }\r\n else if (Tag.js1.M41==1)\r\n {\r\n startLoc = v1r;\r\n }\r\n\r\n ContainerRepository containerservice = new ContainerRepository();\r\n if (startLoc != null)\r\n {\r\n if (startLoc.N_CURRENT_NUM == 1)\r\n {\r\n if (startLoc.T_FULL_TIME == null)\r\n {\r\n //locservice.dbcontext.Set<LocEntity>().Attach(startLoc);\r\n startLoc.T_FULL_TIME = DateTime.Now;\r\n locservice.Update(startLoc);\r\n //locservice.dbcontext.Entry(startLoc).Property(x => x.T_FULL_TIME).IsModified = true;\r\n //locservice.dbcontext.SaveChanges();\r\n }\r\n if (startLoc.T_FULL_TIME != null && DateTime.Now.Subtract(startLoc.T_FULL_TIME ?? DateTime.Now).TotalSeconds > 30)\r\n {\r\n LocContainerEntity ent = loccontainerservice.FindEntity(x => x.S_LOC_CODE == startLoc.S_LOC_CODE);\r\n foreach (var item in VERX.deviceNo)\r\n {\r\n var loc = locservice.FindEntity(x => x.S_LOC_CODE == startLoc.S_LOC_CODE);\r\n if (loc != null)\r\n {\r\n if (loc.N_CURRENT_NUM == 0)\r\n {\r\n endLoc = loc;\r\n break;\r\n }\r\n }\r\n }\r\n if (endLoc != null && ent != null)\r\n {\r\n var c = containerservice.FindEntity(x => x.S_CODE == ent.S_CNTR_CODE);\r\n c.S_TYPE = \"E\";\r\n containerservice.Update(c);\r\n TaskProcess.CreateTask(\"\", startLoc.S_LOC_CODE, endLoc.S_LOC_CODE, \"JS1下空\", 6, new List<string> { ent?.S_CNTR_CODE ?? \"TP\" + Settings.GetTimeStamp() }, 1, 1, 1);\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (emptyLoc.Any())\r\n {\r\n List<string> exclist = new List<string>();\r\n next:\r\n endLoc = emptyLoc.First();\r\n emptyLoc.Remove(endLoc);\r\n startLoc = null;\r\n ContainerEntity c = null;\r\n foreach (var lcode in VERX.deviceNo)\r\n {\r\n if (exclist.Contains(lcode))\r\n continue;\r\n var loc = locservice.FindEntity(x => x.S_LOC_CODE == lcode && x.S_LOCK_STATE == \"无\" && x.N_CURRENT_NUM == 1);\r\n if (loc != null)\r\n {\r\n var cntr = loccontainerservice.FindEntity(x => x.S_LOC_CODE == lcode);\r\n if (cntr != null)\r\n {\r\n c = containerservice.FindEntity(x => x.S_CODE == cntr.S_CNTR_CODE);\r\n if (c != null && c.S_TYPE == \"F\")\r\n {\r\n startLoc = loc;\r\n }\r\n }\r\n }\r\n exclist.Add(lcode);\r\n if (startLoc != null)\r\n break;\r\n }\r\n if (startLoc != null)\r\n {\r\n TaskProcess.CreateTask(\"\", startLoc.S_LOC_CODE, endLoc.S_LOC_CODE, \"JS1上料\", 7, new List<string> { c?.S_CODE }, 1, 1, 1);\r\n }\r\n if (emptyLoc.Any()) goto next;\r\n }\r\n}", |
| | | "ParentID": "20250325083047245", |
| | | "Children": [], |
| | | "Type": "Program", |
| | |
| | | "ID": "20250325083326611", |
| | | "Name": "捷瞬抓臂2", |
| | | "Desc": "", |
| | | "Content": "//jsz2捷瞬抓臂2\r\n\r\n var VERX = Settings.deviceInfos?.Find(x => x.deviceName == \"捷瞬抓臂2\");\r\n\r\n if (VERX != null)\r\n {\r\nLocRepository locservice = new LocRepository();\r\nLocContainerRepository loccontainerservice = new LocContainerRepository();\r\nLocEntity v1l = null;\r\nLocEntity v1r = null;\r\nLocEntity startLoc = null;\r\nLocEntity endLoc = null;\r\nList<LocEntity> emptyLoc = new List<LocEntity>();\r\n if (!string.IsNullOrEmpty(VERX.location[0]))\r\n {\r\n v1l = locservice.FindEntity(x => x.S_LOC_CODE == VERX.location[0]);\r\n //if (startLoc == null && startLoc.S_LOCK_STATE == \"无\")\r\n if (v1l != null && v1l.N_CURRENT_NUM == 0 && v1l.S_LOCK_STATE == \"无\")\r\n emptyLoc.Add(v1l);\r\n }\r\n if (!string.IsNullOrEmpty(VERX.location[1]))\r\n {\r\n v1r = locservice.FindEntity(x => x.S_LOC_CODE == VERX.location[1]);\r\n if (v1r != null && v1r.N_CURRENT_NUM == 0 && v1r.S_LOCK_STATE == \"无\")\r\n emptyLoc.Add(v1r);\r\n }\r\n if (Tag.js2.M40)\r\n\t\t\t\t {\r\n\t\t\t\t startLoc = v1l;\r\n\t\t\t\t }\r\n\t\t\t\t else if (Tag.js2.M41)\r\n {\r\n startLoc = v1r;\r\n }\r\n\r\n ContainerRepository containerservice = new ContainerRepository();\r\n if (startLoc != null)\r\n {\r\n if (startLoc.N_CURRENT_NUM == 1)\r\n {\r\n if (startLoc.T_FULL_TIME == null)\r\n {\r\n //locservice.dbcontext.Set<LocEntity>().Attach(startLoc);\r\n startLoc.T_FULL_TIME = DateTime.Now;\r\n locservice.Update(startLoc);\r\n //locservice.dbcontext.Entry(startLoc).Property(x => x.T_FULL_TIME).IsModified = true;\r\n //locservice.dbcontext.SaveChanges();\r\n }\r\n if (startLoc.T_FULL_TIME != null && DateTime.Now.Subtract(startLoc.T_FULL_TIME ?? DateTime.Now).TotalSeconds > 30)\r\n {\r\n LocContainerEntity ent = loccontainerservice.FindEntity(x => x.S_LOC_CODE == startLoc.S_LOC_CODE);\r\n foreach (var item in VERX.deviceNo)\r\n {\r\n var loc = locservice.FindEntity(x => x.S_LOC_CODE == startLoc.S_LOC_CODE);\r\n if (loc != null)\r\n {\r\n if (loc.N_CURRENT_NUM == 0)\r\n {\r\n endLoc = loc;\r\n break;\r\n }\r\n }\r\n }\r\n if (endLoc != null && ent != null)\r\n {\r\n var c = containerservice.FindEntity(x => x.S_CODE == ent.S_CNTR_CODE);\r\n c.S_TYPE = \"E\";\r\n containerservice.Update(c);\r\n TaskProcess.CreateTask(\"\", startLoc.S_LOC_CODE, endLoc.S_LOC_CODE, \"JS2下空\", 6, new List<string> { ent?.S_CNTR_CODE ?? \"TP\" + Settings.GetTimeStamp() }, 1, 1, 1);\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (emptyLoc.Any())\r\n {\r\n List<string> exclist = new List<string>();\r\n next:\r\n endLoc = emptyLoc.First();\r\n emptyLoc.Remove(endLoc);\r\n startLoc = null;\r\n ContainerEntity c = null;\r\n foreach (var lcode in VERX.deviceNo)\r\n {\r\n if (exclist.Contains(lcode))\r\n continue;\r\n var loc = locservice.FindEntity(x => x.S_LOC_CODE == lcode && x.S_LOCK_STATE == \"无\" && x.N_CURRENT_NUM == 1);\r\n if (loc != null)\r\n {\r\n var cntr = loccontainerservice.FindEntity(x => x.S_LOC_CODE == lcode);\r\n if (cntr != null)\r\n {\r\n c = containerservice.FindEntity(x => x.S_CODE == cntr.S_CNTR_CODE);\r\n if (c != null && c.S_TYPE == \"F\")\r\n {\r\n startLoc = loc;\r\n }\r\n }\r\n }\r\n exclist.Add(lcode);\r\n if (startLoc != null)\r\n break;\r\n }\r\n if (startLoc != null)\r\n {\r\n TaskProcess.CreateTask(\"\", startLoc.S_LOC_CODE, endLoc.S_LOC_CODE, \"JS2上料\", 7, new List<string> { c?.S_CODE }, 1, 1, 1);\r\n }\r\n if (emptyLoc.Any()) goto next;\r\n }\r\n }", |
| | | "ContentCopy": "//jsz2捷瞬抓臂2\r\n\r\n var VERX = Settings.deviceInfos?.Find(x => x.deviceName == \"捷瞬抓臂2\");\r\n\r\n if (VERX != null)\r\n {\r\nLocRepository locservice = new LocRepository();\r\nLocContainerRepository loccontainerservice = new LocContainerRepository();\r\nLocEntity v1l = null;\r\nLocEntity v1r = null;\r\nLocEntity startLoc = null;\r\nLocEntity endLoc = null;\r\nList<LocEntity> emptyLoc = new List<LocEntity>();\r\n if (!string.IsNullOrEmpty(VERX.location[0]))\r\n {\r\n v1l = locservice.FindEntity(x => x.S_LOC_CODE == VERX.location[0]);\r\n //if (startLoc == null && startLoc.S_LOCK_STATE == \"无\")\r\n if (v1l != null && v1l.N_CURRENT_NUM == 0 && v1l.S_LOCK_STATE == \"无\")\r\n emptyLoc.Add(v1l);\r\n }\r\n if (!string.IsNullOrEmpty(VERX.location[1]))\r\n {\r\n v1r = locservice.FindEntity(x => x.S_LOC_CODE == VERX.location[1]);\r\n if (v1r != null && v1r.N_CURRENT_NUM == 0 && v1r.S_LOCK_STATE == \"无\")\r\n emptyLoc.Add(v1r);\r\n }\r\n if (Tag.js2.M40)\r\n\t\t\t\t {\r\n\t\t\t\t startLoc = v1l;\r\n\t\t\t\t }\r\n\t\t\t\t else if (Tag.js2.M41)\r\n {\r\n startLoc = v1r;\r\n }\r\n\r\n ContainerRepository containerservice = new ContainerRepository();\r\n if (startLoc != null)\r\n {\r\n if (startLoc.N_CURRENT_NUM == 1)\r\n {\r\n if (startLoc.T_FULL_TIME == null)\r\n {\r\n //locservice.dbcontext.Set<LocEntity>().Attach(startLoc);\r\n startLoc.T_FULL_TIME = DateTime.Now;\r\n locservice.Update(startLoc);\r\n //locservice.dbcontext.Entry(startLoc).Property(x => x.T_FULL_TIME).IsModified = true;\r\n //locservice.dbcontext.SaveChanges();\r\n }\r\n if (startLoc.T_FULL_TIME != null && DateTime.Now.Subtract(startLoc.T_FULL_TIME ?? DateTime.Now).TotalSeconds > 30)\r\n {\r\n LocContainerEntity ent = loccontainerservice.FindEntity(x => x.S_LOC_CODE == startLoc.S_LOC_CODE);\r\n foreach (var item in VERX.deviceNo)\r\n {\r\n var loc = locservice.FindEntity(x => x.S_LOC_CODE == startLoc.S_LOC_CODE);\r\n if (loc != null)\r\n {\r\n if (loc.N_CURRENT_NUM == 0)\r\n {\r\n endLoc = loc;\r\n break;\r\n }\r\n }\r\n }\r\n if (endLoc != null && ent != null)\r\n {\r\n var c = containerservice.FindEntity(x => x.S_CODE == ent.S_CNTR_CODE);\r\n c.S_TYPE = \"E\";\r\n containerservice.Update(c);\r\n TaskProcess.CreateTask(\"\", startLoc.S_LOC_CODE, endLoc.S_LOC_CODE, \"JS2下空\", 6, new List<string> { ent?.S_CNTR_CODE ?? \"TP\" + Settings.GetTimeStamp() }, 1, 1, 1);\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (emptyLoc.Any())\r\n {\r\n List<string> exclist = new List<string>();\r\n next:\r\n endLoc = emptyLoc.First();\r\n emptyLoc.Remove(endLoc);\r\n startLoc = null;\r\n ContainerEntity c = null;\r\n foreach (var lcode in VERX.deviceNo)\r\n {\r\n if (exclist.Contains(lcode))\r\n continue;\r\n var loc = locservice.FindEntity(x => x.S_LOC_CODE == lcode && x.S_LOCK_STATE == \"无\" && x.N_CURRENT_NUM == 1);\r\n if (loc != null)\r\n {\r\n var cntr = loccontainerservice.FindEntity(x => x.S_LOC_CODE == lcode);\r\n if (cntr != null)\r\n {\r\n c = containerservice.FindEntity(x => x.S_CODE == cntr.S_CNTR_CODE);\r\n if (c != null && c.S_TYPE == \"F\")\r\n {\r\n startLoc = loc;\r\n }\r\n }\r\n }\r\n exclist.Add(lcode);\r\n if (startLoc != null)\r\n break;\r\n }\r\n if (startLoc != null)\r\n {\r\n TaskProcess.CreateTask(\"\", startLoc.S_LOC_CODE, endLoc.S_LOC_CODE, \"JS2上料\", 7, new List<string> { c?.S_CODE }, 1, 1, 1);\r\n }\r\n if (emptyLoc.Any()) goto next;\r\n }\r\n }", |
| | | "Content": "//jsz2捷瞬抓臂2\r\n\r\n var VERX = Settings.deviceInfos?.Find(x => x.deviceName == \"捷瞬抓臂2\");\r\n\r\n if (VERX != null)\r\n {\r\nLocRepository locservice = new LocRepository();\r\nLocContainerRepository loccontainerservice = new LocContainerRepository();\r\nLocEntity v1l = null;\r\nLocEntity v1r = null;\r\nLocEntity startLoc = null;\r\nLocEntity endLoc = null;\r\nList<LocEntity> emptyLoc = new List<LocEntity>();\r\n if (!string.IsNullOrEmpty(VERX.location[0]))\r\n {\r\n v1l = locservice.FindEntity(x => x.S_LOC_CODE == VERX.location[0]);\r\n //if (startLoc == null && startLoc.S_LOCK_STATE == \"无\")\r\n if (v1l != null && v1l.N_CURRENT_NUM == 0 && v1l.S_LOCK_STATE == \"无\")\r\n emptyLoc.Add(v1l);\r\n }\r\n if (!string.IsNullOrEmpty(VERX.location[1]))\r\n {\r\n v1r = locservice.FindEntity(x => x.S_LOC_CODE == VERX.location[1]);\r\n if (v1r != null && v1r.N_CURRENT_NUM == 0 && v1r.S_LOCK_STATE == \"无\")\r\n emptyLoc.Add(v1r);\r\n }\r\n if (Tag.js2.M40==1)\r\n\t\t\t\t {\r\n\t\t\t\t startLoc = v1l;\r\n\t\t\t\t }\r\n\t\t\t\t else if (Tag.js2.M41==1)\r\n {\r\n startLoc = v1r;\r\n }\r\n\r\n ContainerRepository containerservice = new ContainerRepository();\r\n if (startLoc != null)\r\n {\r\n if (startLoc.N_CURRENT_NUM == 1)\r\n {\r\n if (startLoc.T_FULL_TIME == null)\r\n {\r\n //locservice.dbcontext.Set<LocEntity>().Attach(startLoc);\r\n startLoc.T_FULL_TIME = DateTime.Now;\r\n locservice.Update(startLoc);\r\n //locservice.dbcontext.Entry(startLoc).Property(x => x.T_FULL_TIME).IsModified = true;\r\n //locservice.dbcontext.SaveChanges();\r\n }\r\n if (startLoc.T_FULL_TIME != null && DateTime.Now.Subtract(startLoc.T_FULL_TIME ?? DateTime.Now).TotalSeconds > 30)\r\n {\r\n LocContainerEntity ent = loccontainerservice.FindEntity(x => x.S_LOC_CODE == startLoc.S_LOC_CODE);\r\n foreach (var item in VERX.deviceNo)\r\n {\r\n var loc = locservice.FindEntity(x => x.S_LOC_CODE == startLoc.S_LOC_CODE);\r\n if (loc != null)\r\n {\r\n if (loc.N_CURRENT_NUM == 0)\r\n {\r\n endLoc = loc;\r\n break;\r\n }\r\n }\r\n }\r\n if (endLoc != null && ent != null)\r\n {\r\n var c = containerservice.FindEntity(x => x.S_CODE == ent.S_CNTR_CODE);\r\n c.S_TYPE = \"E\";\r\n containerservice.Update(c);\r\n TaskProcess.CreateTask(\"\", startLoc.S_LOC_CODE, endLoc.S_LOC_CODE, \"JS2下空\", 6, new List<string> { ent?.S_CNTR_CODE ?? \"TP\" + Settings.GetTimeStamp() }, 1, 1, 1);\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (emptyLoc.Any())\r\n {\r\n List<string> exclist = new List<string>();\r\n next:\r\n endLoc = emptyLoc.First();\r\n emptyLoc.Remove(endLoc);\r\n startLoc = null;\r\n ContainerEntity c = null;\r\n foreach (var lcode in VERX.deviceNo)\r\n {\r\n if (exclist.Contains(lcode))\r\n continue;\r\n var loc = locservice.FindEntity(x => x.S_LOC_CODE == lcode && x.S_LOCK_STATE == \"无\" && x.N_CURRENT_NUM == 1);\r\n if (loc != null)\r\n {\r\n var cntr = loccontainerservice.FindEntity(x => x.S_LOC_CODE == lcode);\r\n if (cntr != null)\r\n {\r\n c = containerservice.FindEntity(x => x.S_CODE == cntr.S_CNTR_CODE);\r\n if (c != null && c.S_TYPE == \"F\")\r\n {\r\n startLoc = loc;\r\n }\r\n }\r\n }\r\n exclist.Add(lcode);\r\n if (startLoc != null)\r\n break;\r\n }\r\n if (startLoc != null)\r\n {\r\n TaskProcess.CreateTask(\"\", startLoc.S_LOC_CODE, endLoc.S_LOC_CODE, \"JS2上料\", 7, new List<string> { c?.S_CODE }, 1, 1, 1);\r\n }\r\n if (emptyLoc.Any()) goto next;\r\n }\r\n }", |
| | | "ContentCopy": "//jsz2捷瞬抓臂2\r\n\r\n var VERX = Settings.deviceInfos?.Find(x => x.deviceName == \"捷瞬抓臂2\");\r\n\r\n if (VERX != null)\r\n {\r\nLocRepository locservice = new LocRepository();\r\nLocContainerRepository loccontainerservice = new LocContainerRepository();\r\nLocEntity v1l = null;\r\nLocEntity v1r = null;\r\nLocEntity startLoc = null;\r\nLocEntity endLoc = null;\r\nList<LocEntity> emptyLoc = new List<LocEntity>();\r\n if (!string.IsNullOrEmpty(VERX.location[0]))\r\n {\r\n v1l = locservice.FindEntity(x => x.S_LOC_CODE == VERX.location[0]);\r\n //if (startLoc == null && startLoc.S_LOCK_STATE == \"无\")\r\n if (v1l != null && v1l.N_CURRENT_NUM == 0 && v1l.S_LOCK_STATE == \"无\")\r\n emptyLoc.Add(v1l);\r\n }\r\n if (!string.IsNullOrEmpty(VERX.location[1]))\r\n {\r\n v1r = locservice.FindEntity(x => x.S_LOC_CODE == VERX.location[1]);\r\n if (v1r != null && v1r.N_CURRENT_NUM == 0 && v1r.S_LOCK_STATE == \"无\")\r\n emptyLoc.Add(v1r);\r\n }\r\n if (Tag.js2.M40==1)\r\n\t\t\t\t {\r\n\t\t\t\t startLoc = v1l;\r\n\t\t\t\t }\r\n\t\t\t\t else if (Tag.js2.M41==1)\r\n {\r\n startLoc = v1r;\r\n }\r\n\r\n ContainerRepository containerservice = new ContainerRepository();\r\n if (startLoc != null)\r\n {\r\n if (startLoc.N_CURRENT_NUM == 1)\r\n {\r\n if (startLoc.T_FULL_TIME == null)\r\n {\r\n //locservice.dbcontext.Set<LocEntity>().Attach(startLoc);\r\n startLoc.T_FULL_TIME = DateTime.Now;\r\n locservice.Update(startLoc);\r\n //locservice.dbcontext.Entry(startLoc).Property(x => x.T_FULL_TIME).IsModified = true;\r\n //locservice.dbcontext.SaveChanges();\r\n }\r\n if (startLoc.T_FULL_TIME != null && DateTime.Now.Subtract(startLoc.T_FULL_TIME ?? DateTime.Now).TotalSeconds > 30)\r\n {\r\n LocContainerEntity ent = loccontainerservice.FindEntity(x => x.S_LOC_CODE == startLoc.S_LOC_CODE);\r\n foreach (var item in VERX.deviceNo)\r\n {\r\n var loc = locservice.FindEntity(x => x.S_LOC_CODE == startLoc.S_LOC_CODE);\r\n if (loc != null)\r\n {\r\n if (loc.N_CURRENT_NUM == 0)\r\n {\r\n endLoc = loc;\r\n break;\r\n }\r\n }\r\n }\r\n if (endLoc != null && ent != null)\r\n {\r\n var c = containerservice.FindEntity(x => x.S_CODE == ent.S_CNTR_CODE);\r\n c.S_TYPE = \"E\";\r\n containerservice.Update(c);\r\n TaskProcess.CreateTask(\"\", startLoc.S_LOC_CODE, endLoc.S_LOC_CODE, \"JS2下空\", 6, new List<string> { ent?.S_CNTR_CODE ?? \"TP\" + Settings.GetTimeStamp() }, 1, 1, 1);\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (emptyLoc.Any())\r\n {\r\n List<string> exclist = new List<string>();\r\n next:\r\n endLoc = emptyLoc.First();\r\n emptyLoc.Remove(endLoc);\r\n startLoc = null;\r\n ContainerEntity c = null;\r\n foreach (var lcode in VERX.deviceNo)\r\n {\r\n if (exclist.Contains(lcode))\r\n continue;\r\n var loc = locservice.FindEntity(x => x.S_LOC_CODE == lcode && x.S_LOCK_STATE == \"无\" && x.N_CURRENT_NUM == 1);\r\n if (loc != null)\r\n {\r\n var cntr = loccontainerservice.FindEntity(x => x.S_LOC_CODE == lcode);\r\n if (cntr != null)\r\n {\r\n c = containerservice.FindEntity(x => x.S_CODE == cntr.S_CNTR_CODE);\r\n if (c != null && c.S_TYPE == \"F\")\r\n {\r\n startLoc = loc;\r\n }\r\n }\r\n }\r\n exclist.Add(lcode);\r\n if (startLoc != null)\r\n break;\r\n }\r\n if (startLoc != null)\r\n {\r\n TaskProcess.CreateTask(\"\", startLoc.S_LOC_CODE, endLoc.S_LOC_CODE, \"JS2上料\", 7, new List<string> { c?.S_CODE }, 1, 1, 1);\r\n }\r\n if (emptyLoc.Any()) goto next;\r\n }\r\n }", |
| | | "ParentID": "20250325083047245", |
| | | "Children": [], |
| | | "Type": "Program", |
| | |
| | | } |
| | | ], |
| | | "CreationTime": "2025-02-26 15:31:20", |
| | | "LastWriteTime": "2025-04-11 20:39:15", |
| | | "LastWriteTime": "2025-04-17 09:48:04", |
| | | "HasSaved": true |
| | | } |