333
schangxiang@126.com
2025-09-19 18966e02fb573c7e2bb0c6426ed792b38b910940
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
using IWareCC.CacheInfo;
using IWareCC.CacheInfo.Container;
using IWareCC.ORM;
using IWareCC.Properties;
using IWareCC.RGV.Entity;
using IWareCommon.Enum.Common;
using IWareCommon.Enum.Conveyor;
using IWareCommon.Help;
using IWareCommon.Util;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace IWareCC.RGV.Handle.DoRgvTaskAuto
{
    public class 选择一个未执行的Rgv的任务 : IHandler
    {
        /// <summary>
        /// 该节点的下一个节点
        /// </summary>
        private IHandler nextHandler = null;
        public IHandler NextHandler
        {
            set { nextHandler = value; }
        }
 
        private RgvEntity Rgv;
 
        /// <summary>
        /// 任务容器
        /// </summary>
        private PartTaskContainer DecompositionTaskContainer;
 
 
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="resultContainer">结果容器</param>
        /// <param name="decompositionTaskContainer">WIP任务容器</param>
        public 选择一个未执行的Rgv的任务(PartTaskContainer decompositionTaskContainer)
        {
 
            this.DecompositionTaskContainer = decompositionTaskContainer;
        }
 
 
        public void Handle()
        {
 
            using (var dbModel = new DbModel())
            {
                try
                {
                    string msg;
                    var task = dbModel.PartTasks.OrderBy(x => x.priority).ThenBy(x => x.updatetime).FirstOrDefault(x => x.eqtype == (int)EPartTaskType.Rgv任务 && x.isreleased == (int)EYesOrNo.否 && x.isfinished == (int)EYesOrNo.否);
 
                    if (task == null)
                    {
 
                        // LogTextHelper.WriteLine(Resources.LogDir + @"/自动执行Rgv任务流程/", "选择一个未执行的Rgv的任务:{0}", "未找到相应的Rgv任务");
                        return;
                    }
                    else
                    {
                        task.updatetime = DateTime.Now;
                        dbModel.SaveChanges();
                        int tdevid = (int)((EDeviceId)task.eqid);
                        var rgv = CacheEntity.Rgvs.FirstOrDefault(x => x.DeviceId == tdevid);
                        Rgv = rgv;
                    }
 
                    ///如果是叠盘任务,必须校验去的位置是否有满托盘回库的任务,如果有不能执行
                    if (task.maintasktype == (int)EMainTaskType.出库叠盘)
                    {
                        var newtask = dbModel.PartTasks.OrderBy(x => x.priority).ThenBy(x => x.updatetime).FirstOrDefault(x => x.eqtype == (int)EPartTaskType.Rgv任务 && x.isreleased == (int)EYesOrNo.否 && x.isfinished == (int)EYesOrNo.否 && x.maintasktype == (int)EMainTaskType.满空托回库 && x.sourceplace == task.toplace);
                        if (newtask != null)
                        {
                            LogTextHelper.WriteLine(Resources.LogDir + @"/自动执行Rgv任务流程/" + Rgv.RgvName, "选择一个未执行的Rgv的任务:Rgv{0}不能执行任务--{1}", Rgv.RgvName, "满托盘需要回库无法执行叠盘任务");
                            msg = "有满托盘回库的任务,不能执行出库叠盘";
                            if (task.filereason != msg)
                            {
                                task.filereason = msg;
                                dbModel.SaveChanges();
                            }
 
                            return;
                        }
                        else
                        {
                            int devno = (int)EDeviceId.小盘叠盘机;
                            if (task.containertype != 1)
                            {
                                devno = (int)EDeviceId.大盘叠盘机;
                            }
                            var transporTask = dbModel.ChaiDieTransports.OrderBy(x => x.createtime).FirstOrDefault(x => x.status == 0 && x.type == 2 && x.dev == devno);
                            if (transporTask != null)
                            {
                                msg = "叠盘机已叠满,不能执行叠盘任务!";
                                if (task.filereason != msg)
                                {
                                    task.filereason = msg;
                                    dbModel.SaveChanges();
                                }
                                return;
                            }
                        }
 
                    }
                    //检测上一任务是否完成
                    var notfinishtask = dbModel.PartTasks.OrderBy(x => x.priority).ThenBy(x => x.createtime).FirstOrDefault(x => x.eqtype == (int)EPartTaskType.Rgv任务 && x.isreleased == (int)EYesOrNo.是 && x.isfinished == (int)EYesOrNo.否 && x.eqid == Rgv.DeviceId);
                    if (notfinishtask != null)
                    {
                        LogTextHelper.WriteLine(Resources.LogDir + @"/自动执行Rgv任务流程/" + Rgv.RgvName, "选择一个未执行的Rgv的任务:{0}", "当前设备还有未完成的任务");
                        msg = "上一任务未完成";
                        if (task.filereason != msg)
                        {
                            task.filereason = msg;
                            dbModel.SaveChanges();
                        }
                        return;
                    }
                    //检测同一个目标点,上一个rgv任务的完成时间是否超过了10s,如果未超过,则暂时不允许下发新的rgv任务【EditBy shaocx,2022-10-18】
                    var lastFinishtask = dbModel.PartTasks.OrderByDescending(x => x.createtime).FirstOrDefault(x => x.toplace == task.toplace
                        && x.eqtype == (int)EPartTaskType.Rgv任务 && x.isfinished == (int)EYesOrNo.是 && x.eqid == Rgv.DeviceId);
                    if (lastFinishtask != null && lastFinishtask.finishTime != null)
                    {
                        TimeSpan ts = DateTime.Now - Convert.ToDateTime(lastFinishtask.finishTime);
                        if (ts.TotalSeconds <= 10)
                        {
                            msg = "同一个目标点,上一个rgv任务(" + lastFinishtask.taskcode + ")的完成时间没有超过10s,暂时不允许下发新的rgv任务";
                            LogTextHelper.WriteLine(Resources.LogDir + @"/自动执行Rgv任务流程/" + Rgv.RgvName, "选择一个未执行的Rgv的任务:{0}", msg);
                            if (task.filereason != msg)
                            {
                                task.filereason = msg;
                                dbModel.SaveChanges();
                            }
                            return;
                        }
                    }
 
                    if (!CheckSourAndToPlaceIsEmpty(task, out msg))
                    {
 
                        LogTextHelper.WriteLine(Resources.LogDir + @"/自动执行Rgv任务流程/" + Rgv.RgvName, "选择一个未执行的Rgv的任务:{0}", "请检车RGV的起始位或目标位是否有货");
                        if (task.filereason != msg)
                        {
                            task.filereason = msg;
                            dbModel.SaveChanges();
                        }
                        return;
                    }
 
                    if (!Rgv.CanSendTask(Rgv.DeviceId, out msg))
                    {
                        LogTextHelper.WriteLine(Resources.LogDir + @"/自动执行Rgv任务流程/" + Rgv.RgvName, "选择一个未执行的Rgv的任务:Rgv{0}不能执行任务--{1}", Rgv.RgvName, msg);
 
                        if (task.filereason != msg)
                        {
                            task.filereason = msg;
                            dbModel.SaveChanges();
                        }
                        return;
                    }
                    if (task.maintasktype == (int)EMainTaskType.常规入库 && (task.heighttype == 0 || task.targetplace == "0"))
                    {
                        LogTextHelper.WriteLine(Resources.LogDir + @"/自动执行Rgv任务流程/" + Rgv.RgvName, "选择一个未执行的Rgv的任务:Rgv{0}不能执行任务--{1}", Rgv.RgvName, "入库任务未确定入库位置");
                        msg = "常规入库任务目标位置或者托盘高度没有,无法继续执行!";
                        if (task.filereason != msg)
                        {
                            task.filereason = msg;
                            dbModel.SaveChanges();
                        }
                        return;
                    }
 
 
 
                    DecompositionTaskContainer.DecompositionTask = task;
 
                    LogTextHelper.WriteLine(Resources.LogDir + @"/自动执行Rgv任务流程/" + Rgv.RgvName, "选择一个未执行的Rgv的任务:{0}", DecompositionTaskContainer.DecompositionTask.id);
 
                    if (nextHandler != null)
                    {
                        nextHandler.Handle();
                    }
 
                }
                catch (Exception ex)
                {
                    LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "Handle", ex.Message);
                }
            }
 
 
        }
 
        /// <summary>
        /// 验证目标位置是否为空
        /// </summary>
        /// <param name="task"></param>
        /// <returns></returns>
        public bool CheckSourAndToPlaceIsEmpty(PartTask task, out string msg)
        {
            if (task != null)
            {
                int tasktype = task.maintasktype;
                bool b1 = false;
                msg = "";
                switch (tasktype)
                {
                    case (int)EMainTaskType.常规入库:
                        string name = "Line" + task.sourceplace;
                        var sconveyor = CacheEntity.Conveyors.FirstOrDefault(x => x.ConveyorName == name);
                        if ((sconveyor != null && (sconveyor.RPh1 == 1 && sconveyor.RPh2 == 1)))
                        {
                            b1 = true;
                        }
                        else
                        {
                            b1 = false;
                            msg = "起始位置未检测到货物,请查看广电是否检测到";
                            LogTextHelper.WriteLine(Resources.LogDir + @"/自动执行Rgv任务流程/" + Rgv.RgvName, "{0}端口不为空:{1},{2}", sconveyor.ConveyorName, sconveyor.RPh1, sconveyor.RPh2);
 
                        }
                        string tname = "Line" + task.toplace;
                        var tconveyor = CacheEntity.Conveyors.FirstOrDefault(x => x.ConveyorName == tname);
                        if ((tconveyor != null && (tconveyor.RPh1 == 2 && tconveyor.RPh2 == 2 && tconveyor.RPh3 == 2)))
                        {
                            b1 = true;
                        }
                        else
                        {
                            b1 = false;
                            msg = "目标位置检测到有货物,请确认无货才允许执行";
                            LogTextHelper.WriteLine(Resources.LogDir + @"/自动执行Rgv任务流程/" + Rgv.RgvName, "{0}端口不为空:{1},{2}", tconveyor.ConveyorName, tconveyor.RPh1, tconveyor.RPh2);
                        }
                        break;
                    case (int)EMainTaskType.常规出库:
                        if (task.toplace == "1001")
                        {
                            string t1name = "Line" + task.toplace;
                            var t1conveyor = CacheEntity.Conveyors.FirstOrDefault(x => x.ConveyorName == t1name);
                            if ((t1conveyor != null && (t1conveyor.RPh1 == 2 && t1conveyor.RPh2 == 2)))
                            {
                                b1 = true;
                            }
                            else
                            {
                                b1 = false;
                                msg = "目标位置检测到有货物,请确认无货才允许执行";
                                LogTextHelper.WriteLine(Resources.LogDir + @"/自动执行Rgv任务流程/" + Rgv.RgvName, "{0}端口不为空:{1},{2}", t1conveyor.ConveyorName, t1conveyor.RPh1, t1conveyor.RPh2);
                            }
                        }
                        else if (task.toplace == "1011")
                        {
                            string t2name = "Line1012";
                            var t2conveyor = CacheEntity.Conveyors.FirstOrDefault(x => x.ConveyorName == t2name);
                            if ((t2conveyor != null && (t2conveyor.RPh1 == 2 && t2conveyor.RPh2 == 2)))
                            {
                                b1 = true;
                            }
                            else
                            {
                                b1 = false;
                                msg = "目标位置检测到有货物,请确认无货才允许执行";
                                LogTextHelper.WriteLine(Resources.LogDir + @"/自动执行Rgv任务流程/" + Rgv.RgvName, "{0}端口不为空:{1},{2}", t2conveyor.ConveyorName, t2conveyor.RPh1, t2conveyor.RPh2);
                            }
                        }
                        else if (task.toplace == "1005")
                        {
                            string t3name = "Line1006";
                            var t3conveyor = CacheEntity.Conveyors.FirstOrDefault(x => x.ConveyorName == t3name);
                            if ((t3conveyor != null && (t3conveyor.RPh1 == 2 && t3conveyor.RPh2 == 2)))
                            {
                                b1 = true;
                            }
                            else
                            {
                                b1 = false;
                                msg = "目标位置检测到有货物,请确认无货才允许执行";
                                LogTextHelper.WriteLine(Resources.LogDir + @"/自动执行Rgv任务流程/" + Rgv.RgvName, "{0}端口不为空:{1},{2}", t3conveyor.ConveyorName, t3conveyor.RPh1, t3conveyor.RPh2);
                            }
                        }
                        else
                        {
                            b1 = false;
                        }
                        break;
                    case (int)EMainTaskType.出库叠盘:
                        if (task.sourceplace == "1001")
                        {
                            string t1name = "Line" + task.sourceplace;
                            var t1conveyor = CacheEntity.Conveyors.FirstOrDefault(x => x.ConveyorName == t1name);
                            if ((t1conveyor != null && (t1conveyor.RPh1 == 1 && t1conveyor.RPh2 == 1)))
                            {
                                b1 = true;
                            }
                            else
                            {
                                b1 = false;
                                msg = "起始位置未检测到货物,请查看广电是否检测到";
                                LogTextHelper.WriteLine(Resources.LogDir + @"/自动执行Rgv任务流程/" + Rgv.RgvName, "{0}端口不为空:{1},{2}", t1conveyor.ConveyorName, t1conveyor.RPh1, t1conveyor.RPh2);
 
                            }
                        }
                        else if (task.sourceplace == "1007")
                        {
                            string t2name = "Line1008";
                            var t2conveyor = CacheEntity.Conveyors.FirstOrDefault(x => x.ConveyorName == t2name);
                            if ((t2conveyor != null && (t2conveyor.RPh1 == 1 && t2conveyor.RPh2 == 1)))
                            {
                                b1 = true;
                            }
                            else
                            {
                                b1 = false;
                                msg = "起始位置未检测到货物,请查看广电是否检测到";
                                LogTextHelper.WriteLine(Resources.LogDir + @"/自动执行Rgv任务流程/" + Rgv.RgvName, "{0}端口不为空:{1},{2}", t2conveyor.ConveyorName, t2conveyor.RPh1, t2conveyor.RPh2);
                            }
                        }
                        else if (task.sourceplace == "1002")
                        {
                            string t3name = "Line1003";
                            var t3conveyor = CacheEntity.Conveyors.FirstOrDefault(x => x.ConveyorName == t3name);
                            if ((t3conveyor != null && (t3conveyor.RPh1 == 1 && t3conveyor.RPh2 == 1)))
                            {
 
                                b1 = true;
 
                            }
                            else
                            {
                                b1 = false;
                                msg = "起始位置未检测到货物,请查看广电是否检测到";
                                LogTextHelper.WriteLine(Resources.LogDir + @"/自动执行Rgv任务流程/" + Rgv.RgvName, "{0}端口不为空:{1},{2}", t3conveyor.ConveyorName, t3conveyor.RPh1, t3conveyor.RPh2);
 
                            }
                        }
                        else
                        {
                            b1 = false;
                        }
                        break;
                    case (int)EMainTaskType.满空托回库:
                        string tmname = "Line" + task.toplace;
                        var tmconveyor = CacheEntity.Conveyors.FirstOrDefault(x => x.ConveyorName == tmname);
                        if ((tmconveyor != null && (tmconveyor.RPh1 == 2 && tmconveyor.RPh2 == 2 && tmconveyor.RPh3 == 2)))
                        {
                            b1 = true;
                        }
                        else
                        {
                            b1 = false;
                            msg = "目标位置检测到有货物,请确认无货才允许执行";
                            LogTextHelper.WriteLine(Resources.LogDir + @"/自动执行Rgv任务流程/" + Rgv.RgvName, "{0}端口不为空:{1},{2}", tmconveyor.ConveyorName, tmconveyor.RPh1, tmconveyor.RPh2);
                        }
                        break;
                    case (int)EMainTaskType.余料回库:
                        string tvname = "Line" + task.toplace;
                        var tyconveyor = CacheEntity.Conveyors.FirstOrDefault(x => x.ConveyorName == tvname);
                        if ((tyconveyor != null && (tyconveyor.RPh1 == 2 && tyconveyor.RPh2 == 2 && tyconveyor.RPh3 == 2)))
                        {
                            b1 = true;
                        }
                        else
                        {
                            b1 = false;
                            msg = "目标位置检测到有货物,请确认无货才允许执行";
                            LogTextHelper.WriteLine(Resources.LogDir + @"/自动执行Rgv任务流程/" + Rgv.RgvName, "{0}端口不为空:{1},{2}", tyconveyor.ConveyorName, tyconveyor.RPh1, tyconveyor.RPh2);
                        }
                        if (task.sourceplace == "1001")
                        {
                            string t1name = "Line" + task.sourceplace;
                            var t1conveyor = CacheEntity.Conveyors.FirstOrDefault(x => x.ConveyorName == t1name);
                            if ((t1conveyor != null && (t1conveyor.RPh1 == 1 && t1conveyor.RPh2 == 1)))
                            {
                                b1 = true;
                            }
                            else
                            {
                                b1 = false;
                                msg = "起始位置未检测到货物,请查看广电是否检测到";
                                LogTextHelper.WriteLine(Resources.LogDir + @"/自动执行Rgv任务流程/" + Rgv.RgvName, "{0}端口不为空:{1},{2}", t1conveyor.ConveyorName, t1conveyor.RPh1, t1conveyor.RPh2);
 
                            }
                        }
                        else if (task.sourceplace == "1007")
                        {
                            string t2name = "Line1008";
                            var t2conveyor = CacheEntity.Conveyors.FirstOrDefault(x => x.ConveyorName == t2name);
                            if ((t2conveyor != null && (t2conveyor.RPh1 == 1 && t2conveyor.RPh2 == 1)))
                            {
                                b1 = true;
                            }
                            else
                            {
                                b1 = false;
                                msg = "起始位置未检测到货物,请查看广电是否检测到";
                                LogTextHelper.WriteLine(Resources.LogDir + @"/自动执行Rgv任务流程/" + Rgv.RgvName, "{0}端口不为空:{1},{2}", t2conveyor.ConveyorName, t2conveyor.RPh1, t2conveyor.RPh2);
                            }
                        }
                        else if (task.sourceplace == "1002")
                        {
                            string t3name = "Line1003";
                            var t3conveyor = CacheEntity.Conveyors.FirstOrDefault(x => x.ConveyorName == t3name);
                            if ((t3conveyor != null && (t3conveyor.RPh1 == 1 && t3conveyor.RPh2 == 1)))
                            {
                                b1 = true;
                            }
                            else
                            {
                                b1 = false;
                                msg = "起始位置未检测到货物,请查看广电是否检测到";
                                LogTextHelper.WriteLine(Resources.LogDir + @"/自动执行Rgv任务流程/" + Rgv.RgvName, "{0}端口不为空:{1},{2}", t3conveyor.ConveyorName, t3conveyor.RPh1, t3conveyor.RPh2);
                            }
                        }
                        else
                        {
                            b1 = false;
                        }
                        break;
                    case (int)EMainTaskType.组盘出库:
                        bool bt1 = false;
                        string tzname = "Line" + task.toplace;
                        var tzconveyor = CacheEntity.Conveyors.FirstOrDefault(x => x.ConveyorName == tzname);
                        if ((tzconveyor != null && (tzconveyor.RPh1 == 2 && tzconveyor.RPh2 == 2)) && tzconveyor.RState == (int)EConveyorState.空闲)
                        {
                            bt1 = true;
                        }
                        else
                        {
                            bt1 = false;
                            LogTextHelper.WriteLine(Resources.LogDir + @"/自动执行Rgv任务流程/" + Rgv.RgvName, "{0}端口不为空:{1},{2}", tzconveyor.ConveyorName, tzconveyor.RPh1, tzconveyor.RPh2);
                        }
                        bool bt2 = false;
                        string t8name = "Line" + (int.Parse(task.toplace) - 1).ToString();
                        var ti1conveyor = CacheEntity.Conveyors.FirstOrDefault(x => x.ConveyorName == t8name);
                        if ((ti1conveyor != null && (ti1conveyor.RPh1 == 2 && ti1conveyor.RPh2 == 2)) && ti1conveyor.RState == (int)EConveyorState.空闲)
                        {
                            bt2 = true;
                        }
                        else
                        {
                            bt2 = false;
 
                            LogTextHelper.WriteLine(Resources.LogDir + @"/自动执行Rgv任务流程/" + Rgv.RgvName, "{0}端口不为空:{1},{2},{3}", ti1conveyor.ConveyorName, ti1conveyor.RPh1, ti1conveyor.RPh2, ti1conveyor.RState);
                        }
                        bool bt3 = false;
                        string t10name = "Line" + (int.Parse(task.toplace) - 2).ToString();
                        var ti10conveyor = CacheEntity.Conveyors.FirstOrDefault(x => x.ConveyorName == t10name);
                        if ((ti10conveyor != null && (ti10conveyor.RPh1 == 2 && ti10conveyor.RPh2 == 2)) && ti10conveyor.RState == (int)EConveyorState.空闲)
                        {
                            bt3 = true;
                        }
                        else
                        {
                            bt3 = false;
 
                            LogTextHelper.WriteLine(Resources.LogDir + @"/自动执行Rgv任务流程/" + Rgv.RgvName, "{0}端口不为空:{1},{2},{3}", ti10conveyor.ConveyorName, ti10conveyor.RPh1, ti10conveyor.RPh2, ti10conveyor.RState);
                        }
                        bool bt4 = false;
                        string t9name = "Line" + (int.Parse(task.toplace) - 3).ToString();
                        var ti2conveyor = CacheEntity.Conveyors.FirstOrDefault(x => x.ConveyorName == t9name);
                        if ((ti2conveyor != null && (ti2conveyor.RPh1 == 2 && ti2conveyor.RPh2 == 2)) && ti2conveyor.RState == (int)EConveyorState.空闲)
                        {
                            bt4 = true;
                        }
                        else
                        {
                            bt4 = false;
 
                            LogTextHelper.WriteLine(Resources.LogDir + @"/自动执行Rgv任务流程/" + Rgv.RgvName, "{0}端口不为空:{1},{2},{3}", ti2conveyor.ConveyorName, ti2conveyor.RPh1, ti2conveyor.RPh2, ti2conveyor.RState);
                        }
                        if (bt1 && bt2 && bt3 && bt4)
                        {
                            b1 = true;
                            LogTextHelper.WriteLine(Resources.LogDir + @"/自动执行Rgv任务流程/" + Rgv.RgvName, "出库组盘可下发任务号:{0},起始位置;{1},目标位置:{2}", task.id, task.sourceplace, task.toplace);
                        }
                        else
                        {
                            msg = "目标位置检测到有货物,请确认无货才允许执行";
                            b1 = false;
                        }
                        break;
                    default:
                        b1 = true;
                        break;
                }
                return b1;
            }
            else
            {
                msg = "未找到任务起始位置与目标位置验证失败";
                return false;
            }
        }
    }
}