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.

84 lines
2.6 KiB
C#

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using Sln.Wcs.Api.Domain.Dto.genAgvSchedulingTask;
using Sln.Wcs.Api.Domain.Enum;
using Sln.Wcs.Api.Domain.Model.genAgvSchedulingTask;
using Sln.Wcs.Api.Sdk.HikRoBot;
using Sln.Wcs.Api.Util;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
#region << 版 本 注 释 >>
/*--------------------------------------------------------------------
* 版权所有 (c) 2026 WenJY 保留所有权利。
* CLR版本4.0.30319.42000
* 机器名称T14-GEN3-7895
* 命名空间Sln.Wcs.Api.Service.Impl
* 唯一标识f7a3e236-5c29-4a01-84a7-28666abe7962
*
* 创建者WenJY
* 电子邮箱:
* 创建时间2026-02-25 14:12:46
* 版本V1.0.0
* 描述:
*
*--------------------------------------------------------------------
* 修改人:
* 时间:
* 修改说明:
*
* 版本V1.0.0
*--------------------------------------------------------------------*/
#endregion << 版 本 注 释 >>
namespace Sln.Wcs.Api.Service.Impl
{
public class HikRoBotServiceImpl : IHikRoBotService
{
private readonly HIkRoBotSdk hikRoBotSdk;
private readonly ApiResultCodeUtil codeUtil;
public HikRoBotServiceImpl(HIkRoBotSdk hikRoBotSdk,ApiResultCodeUtil codeUtil)
{
this.hikRoBotSdk = hikRoBotSdk;
this.codeUtil = codeUtil;
}
/// <summary>
/// 生成任务单
/// </summary>
/// <param name="genAgvSchedulingTask"></param>
/// <returns></returns>
public GenAgvSchedulingTaskResultDto GenAgvSchedulingTask(GenAgvSchedulingTaskDto genAgvSchedulingTask)
{
try
{
if (genAgvSchedulingTask == null) //根据文档要求判断参数值是否合法
{
throw new ArgumentException($"输入参数为空。");
}
var data = this.hikRoBotSdk.genAgvSchedulingTask(genAgvSchedulingTask);
bool parseRes = this.codeUtil.parse(data.code, data.message, out ApiBaseStatusEnum apiBaseStatusEnumCode);
return new GenAgvSchedulingTaskResultDto()
{
code = apiBaseStatusEnumCode,
msg = data.message,
data = data,
};
}
catch (Exception ex)
{
return new GenAgvSchedulingTaskResultDto()
{
code = ApiBaseStatusEnum.,
msg = ex.Message,
};
}
}
}
}