分支自 SuZhouGuanHong/TaiYuanTaiZhong

dengjunjie
2024-03-14 73a926018601d9a5a5a3d3f4c051537f45a8eff4
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
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http.Json;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.FreeDB;
using WIDESEA_Core.Utilities;
using WIDESEA_Entity.DomainModels;
 
namespace WIDESEA_WMS.ToPCS
{
    public partial class ToPCSServer
    {
        public  WebResponseContent AddTask(string json)
        {
            WebResponseContent content = new WebResponseContent();
            TaskData taskData = new TaskData();
            try
            {
                if (string.IsNullOrEmpty(json) || json == "null")
                    throw new Exception("未获取到请求参数数据");
                taskData = JsonConvert.DeserializeObject<TaskData>(json);
                var haveInTask = freeDB.Select<dt_agvtask>()
                   .Where(t => t.agv_fromaddress == taskData.fromaddress
                   || t.agv_fromaddress == taskData.toaddress
                   || t.agv_toaddress == taskData.fromaddress
                   || t.agv_toaddress == taskData.toaddress
                   ).Any();
                if (haveInTask)
                    throw new Exception("当前起点或终点已存在任务!");
 
                dt_agvtask taskinfo = new dt_agvtask()
                {
 
                };
            }
            catch (Exception ex)
            {
                content.Message = ex.Message;
            }
            return content;
        }
    }
}