|
@@ -4,6 +4,7 @@ using System.Collections.Generic;
|
|
|
using System.Linq;
|
|
|
using WCS.Core;
|
|
|
using WCS.Entity;
|
|
|
+using WCS.Entity.Protocol.SRM;
|
|
|
using WCS.Service.Helpers;
|
|
|
|
|
|
namespace WCS.Service.Extensions
|
|
@@ -113,7 +114,9 @@ namespace WCS.Service.Extensions
|
|
|
{
|
|
|
if (!taksList.Any() || index > (taksList.Length - 1)) throw new DoException("无可执行出库任务");
|
|
|
var outDepot = taksList[index];
|
|
|
- if (db.Default.Set<WCS_TASK>().Any(v => v.TYPE == TaskType.出库 && v.STATUS == TaskStatus.新建 && v.ADDRTO == outDepot.Key && v.Priority > 0 && v.DEVICE != srm.Entity.CODE))
|
|
|
+ var task = db.Default.Set<WCS_TASK>().FirstOrDefault(v => v.TYPE == TaskType.出库 && v.STATUS == TaskStatus.新建 && v.ADDRTO == outDepot.Key && v.Priority > 0 && v.DEVICE != srm.Entity.CODE);
|
|
|
+ var dev = Device.Find(task.DEVICE).Create<SRMDevice>();
|
|
|
+ if (task != null && dev.Data2.SRMMode == SCMode.远程 && dev.Data2.SRMStatus == SCRunStatus.空闲)
|
|
|
{
|
|
|
taksList.GetSrmValidTaskList(db, srm, index++);
|
|
|
}
|