schangxiang@126.com
2025-09-17 ff43ddf18764629ff875478e4e47a7281cbd230a
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
//using Admin.NET.Core.TaskModule.Enum;
//using iWareCC.Common.Helper;
//using iWareCommon;
//using iWareCommon.Common.Globle;
//using iWareCommon.Utils;
//using iWareModel.Entity.WCS;
//using iWareSql.DataAccess;
//using iWareSql.MyDbContext;
//using Newtonsoft.Json;
//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Threading;
 
//namespace iWareCC
//{
//    /// <summary>
//    /// WCS任务完成线程(平库)
//    /// </summary>
//    public static class PingKu_TaskFinishHandler
//    {
//        public static void Handler()
//        {
//            while (true)
//            {
 
//                Thread.Sleep(2000);//休眠2秒
//                try
//                {
//                    if (SystemValue.isAllowRuning_PingKuTaskFinish && SystemValue.isStartedModel)
//                    {
//                        using (MyDbContext dbContext = new MyDbContext())
//                        {
//                            //只查询平库
 
//                            var model = dbContext.ware_task
//                                .Where(TaskHandler.CommonFilterExpressionForNoFinishAndNoCancel())
//                                .Where(x => (x.IsDeleted == null || x.IsDeleted == false) && (x.AreaType == (int)AreaTypeEnum.平库)).ToList();
 
//                            if (model != null && model.Count > 0)
//                            {
//                                List<TaskDatailsOutPut> taskDatailsOutPutsList = MyExtendHelper.CreateSimulationWcsData(model);
//                                foreach (var item in taskDatailsOutPutsList)
//                                {
//                                    LiTiKu_TaskFinishedTask.HandleByWcsResult(item, model, dbContext, "PingKu_TaskFinishHandler");
//                                }
//                            }
//                            SystemWarningMsg._lbl_Alert_PingKuTaskFinish = "";
//                        }
//                    }
//                }
//                catch (Exception ex)
//                {
//                    SystemWarningMsg._lbl_Alert_PingKuTaskFinish = "WCS任务完成线程(平库) 出现异常:" + ex.Message;
//                    Log4NetHelper.WriteErrorLog(LogType.PingKuTaskFinish, "WCS任务完成线程(平库) 出现异常:" + ex.Message, ex);
//                }
//            }
//        }
//    }
//}