jianghaiqing 4 months ago
commit 5be2e1b2d4

@ -299,6 +299,26 @@ namespace DS.Module.Core
/// </summary>
[Description("待办保险")]
WAIT_Insurance = 312,
/// <summary>
/// 待出号
/// </summary>
[Description("待出号")]
WAIT_CHUHAO = 313,
/// <summary>
/// 待内点入货
/// </summary>
[Description("待内点入货")]
WAIT_NDRH = 314,
/// <summary>
/// 待发快递
/// </summary>
[Description("待发快递")]
WAIT_DELIVERY = 315,
/// <summary>
/// 待箱使
/// </summary>
[Description("待箱使")]
WAIT_XIANGSHI = 316,
#endregion
}
}

@ -20,13 +20,12 @@ namespace DS.WMS.Core.Op.Dtos.TaskInteraction
/// </summary>
public BusinessType BusinessType { get; set; }
TaskBaseTypeEnum _taskType;
TaskBaseTypeEnum _defaultTaskType = TaskBaseTypeEnum.NOT_SPECIFIED;
/// <summary>
/// 任务类型
/// </summary>
[IgnoreDataMember]
public TaskBaseTypeEnum TaskType => _taskType == default ?
string.IsNullOrEmpty(TaskTypeName) ? TaskBaseTypeEnum.NOT_SPECIFIED : Enum.Parse<TaskBaseTypeEnum>(TaskTypeName) : _taskType;
public TaskBaseTypeEnum TaskType => string.IsNullOrEmpty(TaskTypeName) ? _defaultTaskType : Enum.Parse<TaskBaseTypeEnum>(TaskTypeName);
/// <summary>
/// 任务类型名称
@ -38,7 +37,7 @@ namespace DS.WMS.Core.Op.Dtos.TaskInteraction
/// </summary>
/// <param name="validationContext">验证上下文</param>
/// <returns></returns>
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
public virtual IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{
if (BusinessId == 0)
{

@ -1,5 +1,4 @@
using DS.Module.Core;
using DS.WMS.Core.Op.Dtos.TaskInteraction;
using DS.WMS.Core.Op.Dtos.TaskInteraction;
namespace DS.WMS.Core.Op.Interface.TaskInteraction
{
@ -13,6 +12,6 @@ namespace DS.WMS.Core.Op.Interface.TaskInteraction
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
Task<DataResult> CreateSubTaskAsync(IEnumerable<TaskCreationRequest> request);
Task CreateSubTaskAsync(IEnumerable<TaskCreationRequest> request);
}
}

@ -34,8 +34,11 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public async Task<DataResult> CreateSubTaskAsync(IEnumerable<TaskCreationRequest> request)
public async Task CreateSubTaskAsync(IEnumerable<TaskCreationRequest> request)
{
if (request == null || !request.Any())
return;
long userId = long.Parse(User.UserId);
long tenatId = long.Parse(User.TenantId);
string tenatName = Db.Queryable<SysTenant>().Where(x => x.Id == tenatId).Select(x => x.Name).First();
@ -46,6 +49,7 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
var biz = await TenantDb.Queryable<SeaExport>().Select(x => new
{
x.Id,
x.CustomerNo,
x.MBLNO,
x.Vessel,
x.Voyno,
@ -81,7 +85,7 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
IsCheckExistsByTaskType = true
}
};
info.Main.TaskDesp = info.Main.TaskTitle = $"【{item.TaskType.GetDescription()}】 {biz?.Vessel} {biz?.Voyno} ETD:{biz?.ETD?.ToString("yyyy-MM-dd")} BLNo:{biz?.MBLNO}";
info.Main.TaskDesp = info.Main.TaskTitle = $"【{item.TaskType.GetDescription()}】{biz?.CustomerNo} {biz?.Vessel} {biz?.Voyno} ETD:{biz?.ETD?.ToString("yyyy-MM-dd")}";
var result = await ManagerService.InitTaskJob(info);
if (!result.Succeeded)
@ -101,7 +105,6 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
}
await TenantDb.Insertable(taskList).ExecuteCommandAsync();
return DataResult.Success;
}
/// <summary>
@ -117,16 +120,16 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
var task = await GetQuery(request.BusinessId, request.BusinessType, request.TaskType).FirstAsync();
if (task != null)
{
var list = Array.FindAll(await GetSubRequestAsync(request.BusinessId, request.BusinessType, task.RecvUserIdArray), x => !string.IsNullOrEmpty(x.TaskTypeName));
await CreateSubTaskAsync(list);
var list = await GetSubRequestAsync(request.BusinessId, request.BusinessType, task.RecvUserIdArray);
await CreateSubTaskAsync(list.FindAll(x => x.TaskType != TaskBaseTypeEnum.NOT_SPECIFIED).OrderBy(x => x.TaskType));
}
}
}
internal async Task<TaskCreationRequest[]> GetSubRequestAsync(long id, BusinessType businessType, params long[]? recvUsers)
internal async Task<List<TaskCreationRequest>> GetSubRequestAsync(long id, BusinessType businessType, params long[]? recvUsers)
{
var svcList = await GetServicesAsync(id);
var list = new TaskCreationRequest[svcList.Length];
var list = new List<TaskCreationRequest>(svcList.Length);
for (int i = 0; i < svcList.Length; i++)
{
var dto = new TaskCreationRequest { BusinessId = id, BusinessType = businessType, RecvUserIdList = recvUsers };
@ -156,8 +159,16 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
dto.TaskTypeName = TaskBaseTypeEnum.WAIT_TUOCHE.ToString();
else if (svcName == "保险")
dto.TaskTypeName = TaskBaseTypeEnum.WAIT_Insurance.ToString();
list[i] = dto;
else if (svcName == "出号")
dto.TaskTypeName = TaskBaseTypeEnum.WAIT_CHUHAO.ToString();
else if (svcName == "内点入货")
dto.TaskTypeName = TaskBaseTypeEnum.WAIT_NDRH.ToString();
else if (svcName == "快递")
dto.TaskTypeName = TaskBaseTypeEnum.WAIT_DELIVERY.ToString();
else if (svcName == "箱使")
dto.TaskTypeName = TaskBaseTypeEnum.WAIT_XIANGSHI.ToString();
list.Add(dto);
}
return list;

@ -254,13 +254,14 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
var biz = await TenantDb.Queryable<SeaExport>().Select(x => new
{
x.Id,
x.CustomerNo,
x.MBLNO,
x.Vessel,
x.Voyno,
x.ETD,
}).FirstAsync(x => x.Id == request.BusinessId);
info.Main.TaskDesp = info.Main.TaskTitle = $"【{request.TaskType.GetDescription()}】 {biz?.Vessel} {biz?.Voyno} ETD:{biz?.ETD?.ToString("yyyy-MM-dd")} BLNo:{biz?.MBLNO}";
info.Main.TaskDesp = info.Main.TaskTitle = $"【{request.TaskType.GetDescription()}】{biz?.CustomerNo} {biz?.Vessel} {biz?.Voyno} ETD:{biz?.ETD?.ToString("yyyy-MM-dd")}";
}
if (useTransaction)

Loading…
Cancel
Save