You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

103 lines
3.3 KiB
C#

using Sln.Wcs.HikRoBotApi.Domain.Dto.CancelTask;
using Sln.Wcs.HikRoBotApi.Domain.Dto.ContinueTask;
using Sln.Wcs.HikRoBotApi.Domain.Dto.GenAgvSchedulingTask;
using Sln.Wcs.HikRoBotApi.Enum;
using Sln.Wcs.HikRoBotApi.Util;
using Sln.Wcs.HikRoBotSdk;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
#region << 版 本 注 释 >>
/*--------------------------------------------------------------------
* (c) 2026 WenJY
* CLR4.0.30319.42000
* T14-GEN3-7895
* Sln.Wcs.HikRoBotApi.Service.Impl
* 05713c1e-50f3-48cf-8ac8-0dfd1f768856
*
* WenJY
*
* 2026-02-25 15:15:34
* V1.0.0
*
*
*--------------------------------------------------------------------
*
*
*
*
* V1.0.0
*--------------------------------------------------------------------*/
#endregion << 版 本 注 释 >>
namespace Sln.Wcs.HikRoBotApi.Service.Impl
{
public class HikRoBotService : IHikRoBotService
{
private readonly HIKRoBotSdk hikRoBotSdk;
private readonly ApiResultCodeUtil codeUtil;
public HikRoBotService(HIKRoBotSdk hikRoBotSdk,ApiResultCodeUtil codeUtil)
{
this.hikRoBotSdk = hikRoBotSdk;
this.codeUtil = codeUtil;
}
public CancelTaskResultDto CancelTask(CancelTaskDto cancelTask)
{
throw new NotImplementedException();
}
public ContinueTaskResultDto ContinueTask(ContinueTaskDto continueTask)
{
throw new NotImplementedException();
}
public GenAgvSchedulingTaskResultDto GetGenAgvSchedulingTask(GenAgvSchedulingTaskDto genAgvSchedulingTask)
{
try
{
if (genAgvSchedulingTask == null) //根据文档要求判断参数值是否合法
{
throw new ArgumentException($"输入参数为空。");
}
var data = new HikRoBotSdk.Dto.GenAgvSchedulingTask.GenAgvSchedulingTaskDto()
{
reqCode = genAgvSchedulingTask.reqCode,
taskTyp = genAgvSchedulingTask.taskTyp,
};
var resp = this.hikRoBotSdk.GenAgvSchedulingTask(data);
bool parseRes = this.codeUtil.parse(resp.code, resp.message, out HikRoBotStatusEnum hikRoBotStatus);
return new GenAgvSchedulingTaskResultDto()
{
code = hikRoBotStatus,
msg = resp.message,
data = new Domain.Model.GenAgvSchedulingTask.GenAgvSchedulingTaskResultModel
{
code = resp.code,
message = resp.message,
reqCode = resp.reqCode,
data = resp.data
},
};
}
catch (Exception ex)
{
return new GenAgvSchedulingTaskResultDto()
{
code = HikRoBotStatusEnum.SDK,
msg = ex.Message,
};
}
}
}
}