From 39531cf0ea52494fe56b8734afa552db32b7a164 Mon Sep 17 00:00:00 2001
From: yanjinhui <3306209981@qq.com>
Date: 星期三, 15 四月 2026 14:27:07 +0800
Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/RuiShengZhiNeng/GaoPuLiTiKu
---
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/InterfaceLogService.cs | 52 ++++++++
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/ApiInfoService.cs | 74 ++++++++++++
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/BasicInfo/Dt_InterfaceLog.cs | 83 +++++++++++++
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/BasicInfo/InterfaceLogController.cs | 22 +++
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/RGVLocationInfoService.cs | 2
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskMethods.cs | 22 ++-
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_IBasicInfoService/IApiInfoService.cs | 11 +
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/BasicInfo/Dt_ApiInfo.cs | 6 +
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/RGVTaskExtend.cs | 48 ++++++--
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_IBasicInfoService/IInterfaceLogService.cs | 20 +++
10 files changed, 319 insertions(+), 21 deletions(-)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/ApiInfoService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/ApiInfoService.cs"
index 19486f1..99a8888 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/ApiInfoService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/ApiInfoService.cs"
@@ -3,8 +3,12 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using WIDESEAWCS_Core;
using WIDESEAWCS_Core.BaseRepository;
using WIDESEAWCS_Core.BaseServices;
+using WIDESEAWCS_Core.Helper;
+using WIDESEAWCS_DTO;
+using WIDESEAWCS_DTO.RGV.FOURBOT;
using WIDESEAWCS_IBasicInfoService;
using WIDESEAWCS_Model.Models;
@@ -12,10 +16,78 @@
{
public class ApiInfoService : ServiceBase<Dt_ApiInfo, IRepository<Dt_ApiInfo>>, IApiInfoService
{
- public ApiInfoService(IRepository<Dt_ApiInfo> BaseDal) : base(BaseDal)
+ private readonly IInterfaceLogService _interfaceLogService;
+ public ApiInfoService(IRepository<Dt_ApiInfo> BaseDal, IInterfaceLogService interfaceLogService) : base(BaseDal)
{
+ _interfaceLogService = interfaceLogService;
}
public IRepository<Dt_ApiInfo> Repository => BaseDal;
+
+ /// <summary>
+ /// Post鎺ュ彛璇锋眰
+ /// </summary>
+ /// <param name="apiCode">鎺ュ彛缂栧彿</param>
+ /// <param name="requestParameters">璇锋眰鍐呭</param>
+ /// <param name="remark">澶囨敞</param>
+ /// <param name="isAdd">鏄惁娣诲姞鏃ュ織</param>
+ /// <returns></returns>
+ public WebResponseContent PostInterfaceRequest(string apiCode, string requestParameters, string remark, bool isAdd = true)
+ {
+ WebResponseContent content = new WebResponseContent();
+ string response = string.Empty;
+ Dt_ApiInfo? apiInfo = null;
+ try
+ {
+ apiInfo = BaseDal.QueryFirst(x => x.ApiCode == apiCode) ?? throw new Exception($"鏈壘鍒皗remark}鎺ュ彛閰嶇疆淇℃伅锛佽妫�鏌ユ帴鍙i厤缃�");
+ response = HttpHelper.Post(apiInfo.ApiAddress, requestParameters);
+ if (apiInfo.Remark.Contains("鍥涘悜杞�"))
+ {
+ FOURBOTReturn fOURBOTReturn = response.DeserializeObject<FOURBOTReturn>();
+ if (fOURBOTReturn == null) throw new Exception($"{apiInfo.Remark}鍝嶅簲鍐呭杞崲瀹炰綋澶辫触锛�");
+ if (fOURBOTReturn.returnCode != 0) throw new Exception(fOURBOTReturn.returnUserMsg);
+ content.Data = fOURBOTReturn;
+ }
+ else if (apiInfo.Remark.Contains("鍑箰澹�"))
+ {
+
+ }
+ else if (apiInfo.Remark.Contains("娴峰悍"))
+ {
+
+ }
+ else if (apiInfo.Remark.Contains("WMS"))
+ {
+
+ }
+ content.OK();
+ }
+ catch (Exception ex)
+ {
+ content.Error(ex.Message);
+ }
+ finally
+ {
+ if (isAdd && !string.IsNullOrEmpty(response) && apiInfo != null)
+ {
+ Dt_InterfaceLog interfaceLog = new Dt_InterfaceLog()
+ {
+ ApiCode = apiCode,
+ RequestParameters = requestParameters,
+ ApiAddress = apiInfo.ApiAddress,
+ ApiName = apiInfo.ApiName,
+ PushFrequency = 1,
+ PushState = content.Status ? 1 : 2,
+ Requestor = "WCS",
+ Recipient = apiInfo.Remark,
+ ResponseParameters = response,
+ Creater = "System",
+ Remark = content.Status ? remark : content.Message,
+ };
+ _interfaceLogService.Repository.AddData(interfaceLog);
+ }
+ }
+ return content;
+ }
}
}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/InterfaceLogService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/InterfaceLogService.cs"
new file mode 100644
index 0000000..36dc77e
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/InterfaceLogService.cs"
@@ -0,0 +1,52 @@
+锘縰sing Microsoft.AspNetCore.Mvc;
+using Newtonsoft.Json;
+using SqlSugar;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEAWCS_Core;
+using WIDESEAWCS_Core.BaseRepository;
+using WIDESEAWCS_Core.BaseServices;
+using WIDESEAWCS_IBasicInfoService;
+using WIDESEAWCS_Model.Models;
+
+
+namespace WIDESEAWCS_BasicInfoService
+{
+ public class InterfaceLogService : ServiceBase<Dt_InterfaceLog, IRepository<Dt_InterfaceLog>>, IInterfaceLogService
+ {
+ public InterfaceLogService(IRepository<Dt_InterfaceLog> BaseDal) : base(BaseDal)
+ {
+ }
+
+ public IRepository<Dt_InterfaceLog> Repository => BaseDal;
+ /// <summary>
+ /// 娣诲姞鏃ュ織
+ /// </summary>
+ /// <param name="ApiCode">鎺ュ彛缂栧彿</param>
+ /// <param name="ApiName">鎺ュ彛鍚嶇О</param>
+ /// <param name="ApiAddress">鎺ュ彛鍦板潃</param>
+ /// <param name="Requestor">璇锋眰鏂�</param>
+ /// <param name="RequestParameters">璇锋眰鍐呭</param>
+ /// <param name="Recipient">鎺ユ敹鏂�</param>
+ /// <param name="ResponseParameters">鍝嶅簲鍐呭</param>
+ /// <param name="Add">鏄惁娣诲姞</param>
+ /// <returns></returns>
+ public WebResponseContent AddInterfaceLog(string ApiCode, string ApiName, string ApiAddress, string Requestor, string RequestParameters, string Recipient, string ResponseParameters, bool Add)
+ {
+ WebResponseContent content = new WebResponseContent();
+ try
+ {
+
+ }
+ catch (Exception ex)
+ {
+ content.Error(ex.Message);
+ }
+ return content;
+ }
+ }
+}
+
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/RGVLocationInfoService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/RGVLocationInfoService.cs"
index 4e6faa9..bc78e76 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/RGVLocationInfoService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/RGVLocationInfoService.cs"
@@ -60,7 +60,7 @@
if (rGVLocationInfo == null) break;
Dt_Task dt_Task = new()
{
- Grade = 1,
+ Grade = 66,
PalletCode = locationInfo.PalletCode,
Roadway = locationInfo.RoadwayNo,
TaskState = TaskStatusEnum.RGV_NewMoveTask.ObjToInt(),
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_IBasicInfoService/IApiInfoService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_IBasicInfoService/IApiInfoService.cs"
index 3d3b5f9..a4daeec 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_IBasicInfoService/IApiInfoService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_IBasicInfoService/IApiInfoService.cs"
@@ -3,6 +3,7 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using WIDESEAWCS_Core;
using WIDESEAWCS_Core.BaseRepository;
using WIDESEAWCS_Core.BaseServices;
using WIDESEAWCS_Model.Models;
@@ -12,5 +13,15 @@
public interface IApiInfoService : IService<Dt_ApiInfo>
{
public IRepository<Dt_ApiInfo> Repository { get; }
+
+ /// <summary>
+ /// Post鎺ュ彛璇锋眰
+ /// </summary>
+ /// <param name="apiCode">鎺ュ彛缂栧彿</param>
+ /// <param name="requestParameters">璇锋眰鍐呭</param>
+ /// <param name="remark">澶囨敞</param>
+ /// <param name="isAdd">鏄惁娣诲姞鏃ュ織</param>
+ /// <returns></returns>
+ public WebResponseContent PostInterfaceRequest(string apiCode, string requestParameters, string remark, bool isAdd = true);
}
}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_IBasicInfoService/IInterfaceLogService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_IBasicInfoService/IInterfaceLogService.cs"
new file mode 100644
index 0000000..b5cd3d9
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_IBasicInfoService/IInterfaceLogService.cs"
@@ -0,0 +1,20 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEAWCS_Core;
+using WIDESEAWCS_Core.BaseRepository;
+using WIDESEAWCS_Core.BaseServices;
+using WIDESEAWCS_Model.Models;
+
+
+namespace WIDESEAWCS_IBasicInfoService
+{
+ public interface IInterfaceLogService : IService<Dt_InterfaceLog>
+ {
+ public IRepository<Dt_InterfaceLog> Repository { get; }
+ }
+
+
+}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/BasicInfo/Dt_ApiInfo.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/BasicInfo/Dt_ApiInfo.cs"
index 4e043be..b7023a3 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/BasicInfo/Dt_ApiInfo.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/BasicInfo/Dt_ApiInfo.cs"
@@ -36,6 +36,12 @@
public string ApiAddress { get; set; }
/// <summary>
+ /// 鎺ㄩ�佹鏁�
+ /// </summary>
+ [SugarColumn(IsNullable = false, ColumnDescription = "璐т綅琛�")]
+ public int PushFrequency { get; set; }
+
+ /// <summary>
/// 澶囨敞
/// </summary>
[SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "澶囨敞")]
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/BasicInfo/Dt_InterfaceLog.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/BasicInfo/Dt_InterfaceLog.cs"
new file mode 100644
index 0000000..176cd09
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/BasicInfo/Dt_InterfaceLog.cs"
@@ -0,0 +1,83 @@
+锘縰sing SqlSugar;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEAWCS_Core.DB.Models;
+
+namespace WIDESEAWCS_Model.Models
+{
+ [SugarTable(nameof(Dt_InterfaceLog), "鎺ュ彛鏃ュ織")]
+ public class Dt_InterfaceLog : BaseEntity
+ {
+ /// <summary>
+ /// 涓婚敭
+ /// </summary>
+ [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")]
+ public int Id { get; set; }
+
+ /// <summary>
+ /// 鎺ュ彛缂栧彿
+ /// </summary>
+ [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "鎺ュ彛缂栧彿")]
+ public string ApiCode { get; set; }
+
+ /// <summary>
+ /// 鎺ュ彛鍚嶇О
+ /// </summary>
+ [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "鎺ュ彛鍚嶇О")]
+ public string ApiName { get; set; }
+
+ /// <summary>
+ /// 鎺ュ彛鍦板潃
+ /// </summary>
+ [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "鎺ュ彛鍦板潃")]
+ public string ApiAddress { get; set; }
+
+ /// <summary>
+ /// 鎺ㄩ�佹鏁�
+ /// </summary>
+ [SugarColumn(IsNullable = false, ColumnDescription = "鎺ㄩ�佹鏁�")]
+ public int PushFrequency { get; set; } = 0;
+
+ /// <summary>
+ /// 鎺ㄩ�佺姸鎬�
+ /// 0鏈帹閫�
+ /// 1鎺ㄩ�佹垚鍔�
+ /// 2鎺ㄩ�佸け璐�
+ /// </summary>
+ [SugarColumn(IsNullable = false, ColumnDescription = "鎺ㄩ�佺姸鎬�")]
+ public int PushState { get; set; } = 0;
+
+ /// <summary>
+ /// 璇锋眰鏂�
+ /// </summary>
+ [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "璇锋眰鏂�")]
+ public string Requestor { get; set; }
+
+ /// <summary>
+ /// 璇锋眰鍐呭
+ /// </summary>
+ [SugarColumn(IsNullable = true, Length = int.MaxValue, ColumnDescription = "璇锋眰鍐呭")]
+ public string RequestParameters { get; set; }
+
+ /// <summary>
+ /// 鎺ユ敹鏂�
+ /// </summary>
+ [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "鎺ユ敹鏂�")]
+ public string Recipient { get; set; }
+
+ /// <summary>
+ /// 鍝嶅簲鍐呭
+ /// </summary>
+ [SugarColumn(IsNullable = true, Length = int.MaxValue, ColumnDescription = "鍝嶅簲鍐呭")]
+ public string ResponseParameters { get; set; }
+
+ /// <summary>
+ /// 澶囨敞
+ /// </summary>
+ [SugarColumn(IsNullable = true, Length = 100, ColumnDescription = "澶囨敞")]
+ public string Remark { get; set; }
+ }
+}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/BasicInfo/InterfaceLogController.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/BasicInfo/InterfaceLogController.cs"
new file mode 100644
index 0000000..391f9e8
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/BasicInfo/InterfaceLogController.cs"
@@ -0,0 +1,22 @@
+锘縰sing Microsoft.AspNetCore.Mvc;
+using WIDESEAWCS_Core.BaseController;
+using WIDESEAWCS_IBasicInfoService;
+using WIDESEAWCS_Model.Models;
+
+namespace WIDESEAWCS_Server.Controllers.BasicInfo
+{
+ /// <summary>
+ ///鎺ュ彛淇℃伅
+ /// </summary>
+ [Route("api/InterfaceLog")]
+ [ApiController]
+ public class InterfaceLogController : ApiBaseController<IInterfaceLogService, Dt_InterfaceLog>
+ {
+ public InterfaceLogController(IInterfaceLogService service) : base(service)
+ {
+
+ }
+
+
+ }
+}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskMethods.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskMethods.cs"
index 25fc196..28f1f26 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskMethods.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskMethods.cs"
@@ -397,16 +397,24 @@
{
task.ExceptionMessage = Rgv.content.errorReason;
var Error = _taskErrorMessageService.Repository.QueryFirst(x => x.ErrorCode == Rgv.content.errorCode && x.DeviceType == (int)deviceTypeEnum);
- if (Error != null)
+ if (task.TaskType == (int)TaskTypeEnum.CPOutbound && task.TaskState == (int)TaskStatusEnum.Execut && Rgv.content.errorCode == 1330003)//鎴愬搧鍑哄簱浠诲姟涓嬪彂鍚庡弽棣堟湁闃荤鎵橈紝淇敼浠诲姟鐘舵�佷负鏂板缓閲嶆柊鏌ヨ闃荤鎵樺叧绯�
{
- task.ExceptionMessage = Error.ExceptionMessage;
- MatchCollection matches = Regex.Matches(Rgv.content.errorReason, @"\(([^)]+)\)");
- if (matches.Count > 0)
- task.ExceptionMessage = ReplacePlaceholders(Rgv.content.errorReason, Error.ExceptionMessage);
- ErrorTaskFeedback(task, true, Error.ErrorCode.ToString());
+ task.TaskState = (int)TaskStatusEnum.New;
+ BaseDal.UpdateData(task);
}
else
- ErrorTaskFeedback(task, true);
+ {
+ if (Error != null)
+ {
+ task.ExceptionMessage = Error.ExceptionMessage;
+ MatchCollection matches = Regex.Matches(Rgv.content.errorReason, @"\(([^)]+)\)");
+ if (matches.Count > 0)
+ task.ExceptionMessage = ReplacePlaceholders(Rgv.content.errorReason, Error.ExceptionMessage);
+ ErrorTaskFeedback(task, true, Error.ErrorCode.ToString());
+ }
+ else
+ ErrorTaskFeedback(task, true);
+ }
}
}
}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/RGVTaskExtend.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/RGVTaskExtend.cs"
index 71c5c1c..a695aa8 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/RGVTaskExtend.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/RGVTaskExtend.cs"
@@ -161,15 +161,11 @@
/// <param name="tasks"></param>
public void IsMoveTask(List<Dt_Task> tasks)
{
-
- object requestData = null; // 娣诲姞鍙橀噺璁板綍璇锋眰鏁版嵁
WebResponseContent content = new WebResponseContent();
try
{
- Dt_ApiInfo? apiInfo = _apiInfoService.Repository.QueryFirst(x => x.ApiCode == nameof(GetBlockPodContentDto)) ?? throw new Exception("鏈壘鍒版壒閲忚幏鍙栭樆纰嶆墭鐩樺叧绯绘帴鍙i厤缃俊鎭紒璇锋鏌ユ帴鍙i厤缃�");
List<Dt_Task> dt_Tasks = new List<Dt_Task>();
var PalletCodes = tasks.Select(x => x.PalletCode).ToList();
- //GetBlockPodContentDto content = new GetBlockPodContentDto();
var request = new GetBlockPodContentListDto
{
content = new List<GetBlockPodContentDto>
@@ -181,21 +177,49 @@
}
}
};
- requestData = request; // 淇濆瓨璇锋眰鏁版嵁鐢ㄤ簬鏃ュ織
- //content.candidatePodIDs = tasks.Select(x => x.PalletCode).ToList();
//string response = HttpHelper.Post("http://127.0.0.1:4523/m2/6165241-5857331-default/440906899?apifoxApiId=440906899", request.Serialize());
-
- string response = HttpHelper.Post(apiInfo.ApiAddress, request.Serialize());
- FOURBOTReturn fOURBOTReturn = response.DeserializeObject<FOURBOTReturn>();
- content.OK(data: fOURBOTReturn);
+ content = _apiInfoService.PostInterfaceRequest(nameof(GetBlockPodContentDto), request.Serialize(), "鎵归噺鑾峰彇闃荤鎵樼洏鍏崇郴");
+ if (!content.Status)
+ {
+ foreach (var item in tasks)
+ {
+ item.ExceptionMessage = content.Message;
+ }
+ _taskService.UpdateData(tasks);
+ return;
+ }
+ FOURBOTReturn fOURBOTReturn = content.Data as FOURBOTReturn;
if (fOURBOTReturn.returnCode == 0)
{
//ReturnBlockPodResultDto getBlockPod = fOURBOTReturn.data as ReturnBlockPodResultDto ?? throw new Exception("鏈幏鍙栧埌闃荤鎵樼洏鍏崇郴鏁版嵁");
var dataJson = fOURBOTReturn.data.ToString();
+ if (string.IsNullOrEmpty(dataJson))
+ {
+ foreach (var item in tasks)
+ {
+ item.ExceptionMessage = "鑾峰彇闃荤鎵樼洏鍏崇郴澶辫触锛�";
+ }
+ _taskService.UpdateData(tasks);
+ return;
+ }
ReturnBlockPodResultDto? getBlockPod = JsonConvert.DeserializeObject<ReturnBlockPodResultDto>(dataJson);
+ if (getBlockPod == null)
+ {
+ foreach (var item in tasks)
+ {
+ item.ExceptionMessage = "闃荤鎵樼洏鍏崇郴鏁版嵁杞崲瀹炰綋澶辫触锛�";
+ }
+ _taskService.UpdateData(tasks);
+ return;
+ }
if (getBlockPod.Result.Count == 0)
{
- throw new Exception("鏈幏鍙栧埌闃荤鎵樼洏鍏崇郴鏁版嵁");
+ foreach (var item in tasks)
+ {
+ item.ExceptionMessage = "鏈幏鍙栧埌闃荤鎵樼洏鍏崇郴鏁版嵁锛�";
+ }
+ _taskService.UpdateData(tasks);
+ return;
}
foreach (var Result in getBlockPod.Result)
{
@@ -234,7 +258,7 @@
}
finally
{
- _trackloginfoService.AddTrackLog(requestData, content, "澶勭悊鍑哄簱浠诲姟鏄惁闇�瑕佺Щ搴�", "", "");
+ //_trackloginfoService.AddTrackLog(requestData, content, "澶勭悊鍑哄簱浠诲姟鏄惁闇�瑕佺Щ搴�", "", "");
}
}
#endregion
--
Gitblit v1.9.3