huanghongfeng
2025-04-22 3c75ba788897a524771bfde12feddcc94aaf14c6
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
using Masuit.Tools;
using Microsoft.AspNetCore.Mvc.ViewFeatures;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Comm;
using WIDESEA_Comm.AGVInterface.Requset;
using WIDESEA_Common;
using WIDESEA_Core;
using WIDESEA_Model.Models;
 
namespace WIDESEA_StoragIntegrationServices
{
    public partial class ToAGVService
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="taskinfo"></param>
        /// <param name="operationType">操作类型(1-绑定 2-解绑)</param>
        /// <returns></returns>
        public static WebResponseContent UntieStation(Dt_Task taskinfo, string operationType)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                bindCtnrAndBin bind = new bindCtnrAndBin()
                {
                    reqCode = Guid.NewGuid().ToString().Replace("-", ""),
                    clientCode = "WMS",
                    ctnrTyp = "2",
                    indBind = operationType,   // 1-绑定 2-解绑
                    stgBinCode = taskinfo.SourceAddress,
                };
 
                string ipaddress = AGV_Interface + "/getCLInfostring";
 
                var requestBindInfo = bind.ToDictionary();
 
                var strRespon = HttpsClient.PostAsync(ipaddress, requestBindInfo).Result;
 
                var responBase = JsonConvert.DeserializeObject<AGVResponBase>(strRespon);
                if (responBase.code != "0") throw new Exception(responBase.message);
 
                //todo
 
                return content.OK();
            }
            catch (Exception ex)
            {
                return content.Error(ex.Message);
            }
        }
    }
 
}