From ec3daa05f122738f18d4474b9257e4cf794dc5cf Mon Sep 17 00:00:00 2001
From: Admin <Admin@ADMIN>
Date: 星期五, 06 三月 2026 10:36:01 +0800
Subject: [PATCH] 接口新增
---
项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/AGV/Partial/UntieStation.cs | 58 ++++++++++++++++++++++++++++++++++++++++------------------
1 files changed, 40 insertions(+), 18 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/AGV/Partial/UntieStation.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/AGV/Partial/UntieStation.cs"
index 34a9a0f..ea841c7 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/AGV/Partial/UntieStation.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/AGV/Partial/UntieStation.cs"
@@ -10,6 +10,9 @@
using WIDESEA_Comm.AGVInterface.Requset;
using WIDESEA_Common;
using WIDESEA_Core;
+using WIDESEA_Core.Const;
+using WIDESEA_Core.Helper;
+using WIDESEA_DTO;
using WIDESEA_Model.Models;
namespace WIDESEA_StoragIntegrationServices
@@ -17,37 +20,56 @@
public partial class ToAGVService
{
/// <summary>
- ///
+ /// PDA鎵цagv浠诲姟鐩磋蛋鍔熻兘
/// </summary>
/// <param name="taskinfo"></param>
/// <param name="operationType">鎿嶄綔绫诲瀷(1-缁戝畾 2-瑙g粦)</param>
/// <returns></returns>
- public static WebResponseContent UntieStation(Dt_Task taskinfo, string operationType)
+ public WebResponseContent UntieStation(SaveModel saveModel)
{
+
WebResponseContent content = new WebResponseContent();
+
+ string CZTM = saveModel.MainData["CZTM"].ToString();
+ if (string.IsNullOrEmpty(CZTM)) throw new Exception("杞﹁酱鏉$爜涓虹┖");
+
+ string TargetAddress = saveModel.MainData["TargetAddress"].ToString();
+ if (string.IsNullOrEmpty(TargetAddress)) return content.Error("鏈�夋嫨缂撳瓨鍙帮紝缂撳瓨鍙颁笉鍙负绌�");
try
{
- bindCtnrAndBin bind = new bindCtnrAndBin()
+ //璋冨彇wcs鎺ュ彛锛岃鍙栬绔欏彴鏄惁鍙斁
+ var configs = _configService.GetConfigsByCategory(CateGoryConst.CONFIG_SYS_IPAddress);
+ var ipAddress = configs.FirstOrDefault(x => x.ConfigKey == SysConfigConst.WCSIPAddress)?.ConfigValue;
+ var ReceiveByWMSTask = configs.FirstOrDefault(x => x.ConfigKey == SysConfigConst.GetPlcState)?.ConfigValue;
+ if (ReceiveByWMSTask == null || ipAddress == null)
{
- reqCode = Guid.NewGuid().ToString().Replace("-", ""),
- clientCode = "WMS",
- ctnrTyp = "2",
- indBind = operationType, // 1-缁戝畾 2-瑙g粦
- stgBinCode = taskinfo.SourceAddress,
- };
+ throw new Exception("WMS IP 鏈厤缃�");
+ }
+ var wmsIpAddrss = ipAddress + ReceiveByWMSTask;
- string ipaddress = AGV_Interface + "/getCLInfostring";
+ var respon = HttpHelper.Post(wmsIpAddrss, JsonConvert.SerializeObject(TargetAddress)); //http://localhost:9291/api/Task/ReceiveTask,
- var requestBindInfo = bind.ToDictionary();
+ if (respon == null) return content.Error("澶辫触锛佽皟鍙杦cs澶辫触");
- var strRespon = HttpsClient.PostAsync(ipaddress, requestBindInfo).Result;
+ WebResponseContent respone = JsonConvert.DeserializeObject<WebResponseContent>(respon.ToString());
+ if (!respone.Status)
+ {
+ return content.Error(respone.Message);
+ }
- var responBase = JsonConvert.DeserializeObject<AGVResponBase>(strRespon);
- if (responBase.code != "0") throw new Exception(responBase.message);
-
- //todo
-
- return content.OK();
+ RequestTaskDto input=new RequestTaskDto();
+ input.Position = TargetAddress;
+ input.RequestType = "888";
+ input.PalletCode = CZTM;
+ WebResponseContent agvtocon=genAgvSchedulingTask(input);
+ if(agvtocon.Status)
+ {
+ return content.OK("鐢熸垚浠诲姟鎴愬姛");
+ }
+ else
+ {
+ return content.Error("閿欒淇℃伅锛�"+agvtocon.Message);
+ }
}
catch (Exception ex)
{
--
Gitblit v1.9.3