任务台相关接口

usertest
zhangxiaofeng 4 months ago
parent f4ac5a93b5
commit 3e8b428057

@ -1425,6 +1425,12 @@ public static class MultiLanguageConst
#region 任务台相关 #region 任务台相关
[Description("当前状态是{0}不能执行完成")] [Description("当前状态是{0}不能执行完成")]
public const string TaskCannotCompleteWhenStatusMismatch = "TaskCannotCompleteWhenStatusMismatch"; public const string TaskCannotCompleteWhenStatusMismatch = "TaskCannotCompleteWhenStatusMismatch";
[Description("未能获取到指定任务基础数据")]
public const string TaskBaseEmpty = "TaskBaseEmpty";
[Description("未能获取到相应BC业务数据")]
public const string TaskBCInfoEmpty = "TaskBCInfoEmpty";
#endregion #endregion
#region 邮件解析配置 #region 邮件解析配置

@ -0,0 +1,148 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.WMS.Core.TaskPlat.Dtos
{
/// <summary>
/// 生成订舱或者舱位请求
/// </summary>
public class BookingOrSlotGenerateDto
{
/// <summary>
/// BC任务主键
/// </summary>
public long BCTaskId { get; set; }
/// <summary>
/// BC主键
/// </summary>
public long BCPkId { get; set; }
/// <summary>
/// 生成方式GEN_BOOKING_SLOT-生成舱位和订舱;GEN_BOOKING-只生成订舱GEN_SLOT-只生成舱位GEN_EXIST_BOOKING-匹配指定的订舱;UPD_BOOKING-更新订舱)
/// </summary>
public string GenerateMethod { get; set; }
/// <summary>
/// 舱位ID
/// </summary>
public Nullable<long> SlotId { get; set; }
/// <summary>
/// 委托客户ID
/// </summary>
public Nullable<long> CustomerId { get; set; }
/// <summary>
/// 委托客户名称
/// </summary>
public string CustomerName { get; set; }
/// <summary>
/// 销售ID
/// </summary>
public Nullable<long> SaleId { get; set; }
/// <summary>
/// 销售名称
/// </summary>
public string SaleName { get; set; }
/// <summary>
/// 操作ID
/// </summary>
public Nullable<long> OpId { get; set; }
/// <summary>
/// 操作名称
/// </summary>
public string OpName { get; set; }
/// <summary>
/// 单证ID
/// </summary>
public Nullable<long> DocId { get; set; }
/// <summary>
/// 单证名称
/// </summary>
public string DocName { get; set; }
/// <summary>
/// 航线操作ID
/// </summary>
public Nullable<long> RouteID { get; set; }
/// <summary>
/// 航线操作
/// </summary>
public string Route { get; set; }
/// <summary>
/// 航线管理
/// </summary>
public string LineManage { get; set; }
/// <summary>
/// 航线管理ID
/// </summary>
public Nullable<long> LineManageID { get; set; }
/// <summary>
/// 操作备注
/// </summary>
public string CZRemark { get; set; }
/// <summary>
/// 申请箱使
/// </summary>
public string ShenQingXiangShi { get; set; }
/// <summary>
/// 服务项目列表传serviceProjectCode
/// </summary>
public List<string> ProjectList { get; set; }
/// <summary>
/// 联系人列表
/// </summary>
public List<CustomerContact> CustomerContactList { get; set; }
/// <summary>
/// 是否直接发送邮件给订舱联系人
/// </summary>
public bool IsDirectSend { get; set; } = false;
/// <summary>
/// 是否默认使用用户个人邮箱发送 false-使用公共邮箱 true-使用个人邮箱
/// </summary>
public bool usePersonalEmailSend { get; set; } = false;
/// <summary>
/// 客服ID
/// </summary>
public Nullable<long> CustServiceId { get; set; }
/// <summary>
/// 客服名称
/// </summary>
public string CustServiceName { get; set; }
}
public class CustomerContact
{
/// <summary>
/// 委托单位联系人ID
/// </summary>
public long CustomerContactId { get; set; }
/// <summary>
/// 委托单位联系人名称
/// </summary>
public string CustomerContactName { get; set; }
}
}

@ -0,0 +1,59 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.WMS.Core.TaskPlat.Dtos
{
/// <summary>
/// 批量BC引入订舱检索
/// </summary>
public class BookingOrderBCQuery
{
/// <summary>
/// 开船开始日期
/// </summary>
public Nullable<DateTime> beginETD { get; set; }
/// <summary>
/// 开船结束日期
/// </summary>
public Nullable<DateTime> endETD { get; set; }
/// <summary>
/// 创建开始日期
/// </summary>
public Nullable<DateTime> beginCreated { get; set; }
/// <summary>
/// 创建结束日期
/// </summary>
public Nullable<DateTime> endCreated { get; set; }
/// <summary>
/// 主提单号
/// </summary>
public string mblNo { get; set; }
/// <summary>
/// 订舱编号
/// </summary>
public string custNo { get; set; }
/// <summary>
/// 船名
/// </summary>
public string vessel { get; set; }
/// <summary>
/// 航次号
/// </summary>
public string voyno { get; set; }
/// <summary>
/// 最大返回行数默认100
/// </summary>
public int topNum { get; set; } = 100;
}
}

@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.WMS.Core.TaskPlat.Dtos
{
public class BookingOrderBCTaskDto
{
/// <summary>
/// 序号
/// </summary>
public int Indx { get; set; }
/// <summary>
/// 对应BC序号
/// </summary>
public int BCIndx { get; set; }
}
}

@ -0,0 +1,398 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.WMS.Core.TaskPlat.Dtos
{
/// <summary>
/// BC展示信息
/// </summary>
public class TaskBCShowBaseDto
{
/// <summary>
/// 主键
/// </summary>
public long Id { get; set; }
/// <summary>
/// 任务主键
/// </summary>
public long TaskId { get; set; }
/// <summary>
/// 业务类型 BookingConfirmation(订舱)BookingAmendment(订舱变更)BookingCancellation(订舱取消)
/// </summary>
public string BusiType { get; set; }
/// <summary>
/// 订舱单位
/// </summary>
public string BookingParty { get; set; }
/// <summary>
/// 发货人
/// </summary>
public string Shipper { get; set; }
/// <summary>
/// 收货人
/// </summary>
public string Consignee { get; set; }
/// <summary>
/// 通知人
/// </summary>
public string NotifyParty { get; set; }
/// <summary>
/// BC更新次数
/// </summary>
public Nullable<int> BCModifyTimes { get; set; }
/// <summary>
/// BC更新时间
/// </summary>
public Nullable<DateTime> BCModifyDate { get; set; }
/// <summary>
/// 主单号
/// </summary>
public string MBLNo { get; set; }
/// <summary>
/// 船名
/// </summary>
public string Vessel { get; set; }
/// <summary>
/// 航次
/// </summary>
public string VoyNo { get; set; }
/// <summary>
/// 船公司
/// </summary>
public string Carrier { get; set; }
/// <summary>
/// 收货地
/// </summary>
public string PlaceReceipt { get; set; }
/// <summary>
/// 装货港
/// </summary>
public string Portload { get; set; }
/// <summary>
/// 截关时间
/// </summary>
public Nullable<DateTime> ClosingDate { get; set; }
/// <summary>
/// 截VGM时间
/// </summary>
public Nullable<DateTime> VGMCutoffTime { get; set; }
/// <summary>
/// ETA(预计到港时间)
/// </summary>
public Nullable<DateTime> ETA { get; set; }
/// <summary>
/// ETD(预计离港时间)
/// </summary>
public Nullable<DateTime> ETD { get; set; }
/// <summary>
/// 目的港ETA
/// </summary>
public Nullable<DateTime> PODETA { get; set; }
/// <summary>
/// 截单时间
/// </summary>
public Nullable<DateTime> CutSingleTime { get; set; }
/// <summary>
/// 卸货港
/// </summary>
public string PortDischarge { get; set; }
/// <summary>
/// 交货地
/// </summary>
public string PlaceDelivery { get; set; }
/// <summary>
/// 装运方式
/// </summary>
public string ShippingMethod { get; set; }
/// <summary>
/// 运输条款
/// </summary>
public string Service { get; set; }
/// <summary>
/// 港前运输形态
/// </summary>
public string PreTransMode { get; set; }
/// <summary>
/// 品名
/// </summary>
public string Description { get; set; }
/// <summary>
/// 签单地点
/// </summary>
public string IssuePlace { get; set; }
/// <summary>
/// 集港码头
/// </summary>
public string CollectionTerminal { get; set; }
/// <summary>
/// 约号
/// </summary>
public string ContractNo { get; set; }
/// <summary>
/// 预付地点
/// </summary>
public string PrepardAT { get; set; }
/// <summary>
/// 船代
/// </summary>
public string ShipAgent { get; set; }
/// <summary>
/// 场站
/// </summary>
public string Yard { get; set; }
/// <summary>
/// 场站联系人
/// </summary>
public string YardContactUserName { get; set; }
/// <summary>
/// 场站联系电话
/// </summary>
public string YardContactTel { get; set; }
/// <summary>
/// 一代客服姓名
/// </summary>
public string FstCustomerSerUserName { get; set; }
/// <summary>
/// 一代客服电话
/// </summary>
public string FstCustomerSerUserTel { get; set; }
/// <summary>
/// 一代客服邮箱
/// </summary>
public string FstCustomerSerUserEmail { get; set; }
/// <summary>
/// 备注1
/// </summary>
public string Remark1 { get; set; }
/// <summary>
/// 截港时间
/// </summary>
public Nullable<DateTime> CYCutoffTime { get; set; }
/// <summary>
/// 状态 TEMP-暂存 SUCC-已对应 ERROR-异常
/// </summary>
public string Status { get; set; }
/// <summary>
/// 文件MD5
/// </summary>
public string FileMD5 { get; set; }
/// <summary>
/// 最后对应时间,最后关联到订舱日期
/// </summary>
public Nullable<DateTime> LastToBookingDate { get; set; }
/// <summary>
/// 来源邮箱
/// </summary>
public string FromEmail { get; set; }
/// <summary>
/// 接收邮箱
/// </summary>
public string RecvEmail { get; set; }
/// <summary>
/// 订舱ID对应成功后订舱ID写入
/// </summary>
public Nullable<long> BookingOrderId { get; set; }
/// <summary>
/// 集装箱列表
/// </summary>
public List<TaskBCCTNInfoDto> CtnList { get; set; }
/// <summary>
/// 任务附件
/// </summary>
public List<TaskFileDto> FileList { get; set; }
/// <summary>
/// 舱位主键
/// </summary>
public Nullable<long> BookingSlotId { get; set; }
/// <summary>
/// 船公司代号
/// </summary>
public string CarrierId { get; set; }
/// <summary>
/// 航线代码(船公司)
/// </summary>
public string LaneCode { get; set; }
/// <summary>
/// 航线名称(船公司)
/// </summary>
public string LaneName { get; set; }
/// <summary>
/// 承运方式 DIRECT_SHIP-直达TRANSFER_SHIP-中转
/// </summary>
public string CarriageType { get; set; }
/// <summary>
/// 承运方式名称 DIRECT_SHIP-直达TRANSFER_SHIP-中转
/// </summary>
public string CarriageTypeName { get; set; }
/// <summary>
/// 订舱方式 CONTRACT_ORDER-合约订舱SPOT_ORDER-SPOT订舱
/// </summary>
public string BookingSlotType { get; set; }
/// <summary>
/// 订舱方式名称 CONTRACT_ORDER-合约订舱SPOT_ORDER-SPOT订舱
/// </summary>
public string BookingSlotTypeName { get; set; }
/// <summary>
/// 箱型箱量
/// </summary>
public string CtnStat { get; set; }
/// <summary>
/// 所在周数
/// </summary>
public string WeekAt { get; set; }
/// <summary>
/// 箱使天数
/// </summary>
public int DetensionFreeDays { get; set; }
/// <summary>
/// 样单截止日期
/// </summary>
public Nullable<DateTime> SICutDate { get; set; }
/// <summary>
/// VGM截止日期
/// </summary>
public Nullable<DateTime> VGMSubmissionCutDate { get; set; }
/// <summary>
/// 舱单截止时间
/// </summary>
public Nullable<DateTime> ManifestCutDate { get; set; }
/// <summary>
/// MDGF提交截止时间
/// </summary>
public Nullable<DateTime> MDGFCutDate { get; set; }
/// <summary>
/// 中转港1
/// </summary>
public string TransferPort1 { get; set; }
/// <summary>
/// 中转港2
/// </summary>
public string TransferPort2 { get; set; }
/// <summary>
/// 二程船名
/// </summary>
public string SecondVessel { get; set; }
/// <summary>
/// 二程航次
/// </summary>
public string SecondVoyno { get; set; }
/// <summary>
/// 二程ETD
/// </summary>
public Nullable<DateTime> SecondETD { get; set; }
/// <summary>
/// 二程ETA
/// </summary>
public Nullable<DateTime> SecondETA { get; set; }
/// <summary>
/// 订舱确认时间
/// </summary>
public Nullable<DateTime> BookingConfirmDate { get; set; }
/// <summary>
/// 关键信息列表
/// </summary>
public List<TaskBCShowBaseKeywordDto> Keywords { get; set; }
/// <summary>
/// 任务状态
/// </summary>
public string taskStatus { get; set; }
/// <summary>
/// 批次号
/// </summary>
public string BatchNo { get; set; }
}
public class TaskBCShowBaseKeywordDto
{
/// <summary>
/// 关键名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 关键背景色
/// </summary>
public string Background { get; set; }
/// <summary>
/// 图标KEY
/// </summary>
public string Icon { get; set; }
}
}

@ -0,0 +1,78 @@
namespace DS.WMS.Core.TaskPlat.Dtos
{
/// <summary>
/// 任务BC集装箱
/// </summary>
public class TaskBCCTNInfoDto
{
/// <summary>
/// 惟一主键
/// </summary>
public long Id { get; set; }
/// <summary>
/// 父主键
/// </summary>
public long P_ID { get; set; }
/// <summary>
/// 箱型代码
/// </summary>
public string CtnCode { get; set; }
/// <summary>
/// 箱型
/// </summary>
public string CtnALL { get; set; }
/// <summary>
/// 箱量
/// </summary>
public Nullable<int> CTNNUM { get; set; }
/// <summary>
/// 件数
/// </summary>
public Nullable<int> PKGS { get; set; }
/// <summary>
/// 尺码
/// </summary>
public Nullable<decimal> CBM { get; set; }
/// <summary>
/// 毛重
/// </summary>
public Nullable<decimal> KGS { get; set; }
/// <summary>
/// 皮重
/// </summary>
public Nullable<decimal> TareWeight { get; set; }
/// <summary>
/// 危品票标示
/// </summary>
public string IODGT { get; set; }
/// <summary>
/// 特殊装载需求
/// </summary>
public string SpecialLoadingRequire { get; set; }
/// <summary>
/// 提箱场站
/// </summary>
public string TakeCTNYard { get; set; }
/// <summary>
/// 提箱时间
/// </summary>
public Nullable<DateTime> TakeCTNTime { get; set; }
/// <summary>
/// 还箱场站
/// </summary>
public string ReturnCTNYard { get; set; }
}
}

@ -0,0 +1,31 @@
namespace DS.WMS.Core.TaskPlat.Dtos
{
/// <summary>
/// 任务附件
/// </summary>
public class TaskFileDto
{
/// <summary>
/// 文件路径
/// </summary>
public string FilePath { get; set; }
/// <summary>
/// 文件类型
/// </summary>
public string FileType { get; set; }
/// <summary>
/// 文件名
/// </summary>
public string FileName { get; set; }
/// <summary>
/// 附件类型代码 BC-Booking Confirmation
/// </summary>
public string FileCategory { get; set; }
/// <summary>
/// 附件类型名称 BC-Booking Confirmation
/// </summary>
public string FileCategoryName { get; set; }
}
}

@ -0,0 +1,16 @@
using DS.Module.Core;
using DS.Module.DjyServiceStatus;
using DS.WMS.Core.TaskPlat.Dtos;
using Microsoft.AspNetCore.Http;
namespace DS.WMS.Core.TaskPlat.Interface
{
public interface ITaskManageBCService
{
/// <summary>
/// 通过任务主键获取BC详情
/// </summary>
/// <param name="taskId">BC任务主键</param>
Task<DataResult<TaskManageOrderResultDto>> GetInfoByTaskId(long taskId);
}
}

@ -14,6 +14,13 @@ namespace DS.WMS.Core.TaskPlat.Interface
/// <returns>返回结果</returns> /// <returns>返回结果</returns>
Task<DataResult<TaskManageOrderResultDto>> CancelTask(long[] ids); Task<DataResult<TaskManageOrderResultDto>> CancelTask(long[] ids);
/// <summary>
/// 完成任务(可批量)
/// </summary>
/// <param name="ids">任务主键数组</param>
/// <returns>返回结果</returns>
Task<DataResult<TaskManageOrderResultDto>> CompleteTask(long[] ids);
/// <summary> /// <summary>
/// 获取登陆人相关的任务统计信息 /// 获取登陆人相关的任务统计信息
/// </summary> /// </summary>

@ -0,0 +1,137 @@
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.Module.Core.Helpers;
using DS.Module.SqlSugar;
using DS.Module.UserModule;
using DS.WMS.Core.TaskPlat.Dtos;
using DS.WMS.Core.TaskPlat.Entity;
using DS.WMS.Core.TaskPlat.Interface;
using Mapster;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using SqlSugar;
using System.Runtime.InteropServices;
using DS.Module.Core.Extensions;
using DS.Module.DjyServiceStatus;
using LanguageExt.Common;
namespace DS.WMS.Core.TaskPlat.Method
{
/// <summary>
/// 任务台-BC子任务
/// </summary>
public class TaskManageBCService : ITaskManageBCService
{
private readonly ILogger<TaskManageBCService> _logger;
private readonly IUser user;
private readonly ISaasDbService saasDbService;
private readonly IServiceProvider serviceProvider;
private readonly IWebHostEnvironment environment;
public TaskManageBCService(ILogger<TaskManageBCService> logger,
ISaasDbService saasDbService,
IServiceProvider serviceProvider,
IUser user,
IWebHostEnvironment environment)
{
_logger = logger;
this.saasDbService = saasDbService;
this.serviceProvider = serviceProvider;
this.user = user;
this.environment = environment;
}
/// <summary>
/// 通过任务主键获取BC详情
/// </summary>
/// <param name="taskId">BC任务主键</param>
public async Task<DataResult<TaskManageOrderResultDto>> GetInfoByTaskId(long taskId)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
try
{
var tenantDb = saasDbService.GetBizDbScopeById(user.TenantId);
var taskBase = await tenantDb.Queryable<TaskBaseInfo>().FirstAsync(a => a.Id == taskId);
if (taskBase == null)
throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.TaskBaseEmpty)));
var bcOrder = await tenantDb.Queryable<TaskBCInfo>().FirstAsync(a => a.TASK_ID == taskId);
if (bcOrder == null)
throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.TaskBCInfoEmpty)));
var bcCtnList = await tenantDb.Queryable<TaskBCCTNInfo>().ToListAsync(a => a.P_ID == bcOrder.Id);
TaskBCShowBaseDto model = bcOrder.Adapt<TaskBCShowBaseDto>();
if (bcCtnList.Count > 0)
model.CtnList = bcCtnList.Adapt<List<TaskBCCTNInfoDto>>();
var fileList = await tenantDb.Queryable <TaskFileInfo>().Where(a => a.TASK_PKID == bcOrder.TASK_ID).ToListAsync();
if (fileList.Count > 0)
model.FileList = fileList.Adapt<List<TaskFileDto>>();
model.taskStatus = taskBase.STATUS;
//生成关键信息
#region 生成关键信息
model.Keywords = new List<TaskBCShowBaseKeywordDto>();
if (bcOrder.CARRIAGE_TYPE == "DIRECT_SHIP")
{
model.Keywords.Add(new TaskBCShowBaseKeywordDto() { Name = $"承运方式:{bcOrder.CARRIAGE_TYPE_NAME}", Background = "#FFFF80", Icon = "icon-yunshu1" });
}
else if (bcOrder.CARRIAGE_TYPE == "TRANSFER_SHIP")
{
model.Keywords.Add(new TaskBCShowBaseKeywordDto() { Name = $"承运方式:{bcOrder.CARRIAGE_TYPE_NAME}", Background = "#CAF982", Icon = "icon-shuaxin" });
}
if (bcOrder.BOOKING_SLOT_TYPE == "CONTRACT_ORDER")
{
model.Keywords.Add(new TaskBCShowBaseKeywordDto() { Name = $"订舱方式:{bcOrder.BOOKING_SLOT_TYPE_NAME}", Background = "#81D3F8", Icon = "icon-touzijilu" });
}
else if (bcOrder.BOOKING_SLOT_TYPE == "SPOT_ORDER")
{
model.Keywords.Add(new TaskBCShowBaseKeywordDto() { Name = $"订舱方式:{bcOrder.BOOKING_SLOT_TYPE_NAME}", Background = "#FACD91", Icon = "icon-beizhu1" });
}
#endregion
result.succ = true;
result.ext = model;
//如果当前BC有对应记录则读取订舱详情
//0726:经确认页面上没有用到订舱详情,所以暂时不返回
//if (bcOrder.BOOKING_ORDER_ID.HasValue)
//{
// var bkOrder = await _bookingOrderRepository.AsQueryable().
// FirstAsync(a => a.Id == bcOrder.BOOKING_ORDER_ID.Value);
// if (bkOrder != null)
// {
// var showBKOrder = bkOrder.Adapt<BookingOrderOutput>();
// var ctnList = await _bookingCtnRepository.AsQueryable().
// Where(a => a.BILLID == bkOrder.Id).ToListAsync();
// if (ctnList.Count > 0)
// showBKOrder.ctnInputs = ctnList.Adapt<List<BookingCtnDto>>();
// result.ext2 = showBKOrder;
// }
//}
}
catch (Exception ex)
{
result.succ = false;
result.msg = $"获取BC详情异常原因{ex.Message}";
}
return DataResult<TaskManageOrderResultDto>.Success(result);
}
}
}

@ -1657,6 +1657,75 @@ namespace DS.WMS.Core.TaskPlat.Method
return result; return result;
} }
/// <summary>
/// 完成任务(可批量)
/// </summary>
/// <param name="ids">任务主键数组</param>
/// <returns>返回结果</returns>
public async Task<DataResult<TaskManageOrderResultDto>> CompleteTask(long[] ids)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
var tenantDb = saasDbService.GetBizDbScopeById(user.TenantId);
var userId = long.Parse(user.UserId);
string batchNo = Guid.NewGuid().ToString();
var taskList = await tenantDb.Queryable<TaskBaseInfo>()
.Where(x => ids.Contains(x.Id)).ToListAsync();
List<TaskManageOrderResultDto> taskRunList = new List<TaskManageOrderResultDto>();
_logger.LogInformation("批次={no} ids={ids} 完成任务开始", batchNo, string.Join(",", ids));
var noList = ids.Select((a, idx) => new { no = idx + 1, id = a }).ToList();
foreach (var bk in taskList)
{
var sortNo = noList.FirstOrDefault(a => a.id == bk.Id).no;
taskRunList.Add(await InnerManualTask(batchNo, bk, TaskOperTypeEnum.COMPLETE_TASK, sortNo));
}
result.succ = true;
result.msg = "执行成功";
var downResultList = taskRunList.Select(x => x).ToList();
if (downResultList.Any(x => !x.succ))
{
result.succ = false;
result.msg = "执行失败";
}
else
{
result.succ = true;
result.msg = downResultList.FirstOrDefault().msg;
}
result.ext = downResultList;
var succ = downResultList.Count(x => x.succ);
var fail = downResultList.Count(x => !x.succ);
if (succ > 0)
{
result.batchTotal = succ.ToString();
}
else
{
result.batchTotal = "- ";
}
if (fail > 0)
{
result.batchTotal += "/" + fail.ToString();
}
else
{
result.batchTotal += " -";
}
return DataResult<TaskManageOrderResultDto>.Success(result);
}
#endregion #endregion
} }
} }

@ -0,0 +1,30 @@
using DS.Module.Core;
using DS.Module.DjyServiceStatus;
using DS.WMS.Core.TaskPlat.Interface;
using DS.WMS.Core.TaskPlat.Method;
using Microsoft.AspNetCore.Mvc;
namespace DS.WMS.TaskApi.Controllers
{
/// <summary>
/// 任务台-BC子任务相关接口
/// </summary>
public class TaskManageBCController : ApiController
{
private readonly ITaskManageBCService _taskManageBCService;
public TaskManageBCController(ITaskManageBCService taskManageBCService)
{
_taskManageBCService = taskManageBCService;
}
/// <summary>
/// 通过任务主键获取BC详情
/// </summary>
/// <param name="taskId">BC任务主键</param>
[HttpPost("GetInfoByTaskId")]
public async Task<DataResult<TaskManageOrderResultDto>> GetInfoByTaskId(long taskId)
{
var result = await _taskManageBCService.GetInfoByTaskId(taskId);
return result;
}
}
}

@ -90,6 +90,18 @@ public class TaskManageController : ApiController
return result; return result;
} }
/// <summary>
/// 完成任务(可批量)
/// </summary>
/// <param name="Ids">任务主键数组</param>
/// <returns>返回结果</returns>
[HttpPost("CompleteTask")]
public async Task<DataResult<TaskManageOrderResultDto>> CompleteTask([FromBody] long[] Ids)
{
var result = await taskManageService.CompleteTask(Ids);
return result;
}
/// <summary> /// <summary>
/// 取消任务(可批量) /// 取消任务(可批量)
/// </summary> /// </summary>
@ -108,20 +120,33 @@ public class TaskManageController : ApiController
[HttpPost("GetTaskPlatEnumDict")] [HttpPost("GetTaskPlatEnumDict")]
public DataResult<object> GetTaskPlatEnumDict() public DataResult<object> GetTaskPlatEnumDict()
{ {
Dictionary<string, List<(string key, string value)>> dict = new(); Dictionary<string, List<(string key, string value)>> dict = new()
{
dict.Add("STATUS", EnumUtil.GetEnumDictionaryWithKey(typeof(TaskStatusEnum)) {
"STATUS",
EnumUtil.GetEnumDictionaryWithKey(typeof(TaskStatusEnum))
.Select(x => (x.Key.ToString(), x.Value)) .Select(x => (x.Key.ToString(), x.Value))
.ToList()); .ToList()
dict.Add("TASK_TYPE", EnumUtil.GetEnumDictionaryWithKey(typeof(TaskBaseTypeEnum)) },
{
"TASK_TYPE",
EnumUtil.GetEnumDictionaryWithKey(typeof(TaskBaseTypeEnum))
.Select(x => (x.Key.ToString(), x.Value)) .Select(x => (x.Key.ToString(), x.Value))
.ToList()); .ToList()
dict.Add("SOURCE", EnumUtil.GetEnumDictionaryWithKey(typeof(TaskSourceEnum)) },
{
"SOURCE",
EnumUtil.GetEnumDictionaryWithKey(typeof(TaskSourceEnum))
.Select(x => (x.Key.ToString(), x.Value)) .Select(x => (x.Key.ToString(), x.Value))
.ToList()); .ToList()
dict.Add("CATEGORY", EnumUtil.GetEnumDictionaryWithKey(typeof(TaskStatLevelEnum)) },
{
"CATEGORY",
EnumUtil.GetEnumDictionaryWithKey(typeof(TaskStatLevelEnum))
.Select(x => (x.Key.ToString(), x.Value)) .Select(x => (x.Key.ToString(), x.Value))
.ToList()); .ToList()
}
};
var result = dict.Select(x => new var result = dict.Select(x => new
{ {

Loading…
Cancel
Save